diff --git a/404.html b/404.html index 7a5f343..6ac2405 100644 --- a/404.html +++ b/404.html @@ -6,7 +6,7 @@ Page Not Found | Simple Scaffold - + diff --git a/assets/js/3bd150b0.7f274eed.js b/assets/js/3bd150b0.83e20e07.js similarity index 96% rename from assets/js/3bd150b0.7f274eed.js rename to assets/js/3bd150b0.83e20e07.js index 312ad9f..0085a56 100644 --- a/assets/js/3bd150b0.7f274eed.js +++ b/assets/js/3bd150b0.83e20e07.js @@ -1 +1 @@ -"use strict";(self.webpackChunksimple_scaffold_docs=self.webpackChunksimple_scaffold_docs||[]).push([[189],{4749:(e,s,n)=>{n.r(s),n.d(s,{assets:()=>t,contentTitle:()=>r,default:()=>a,frontMatter:()=>d,metadata:()=>c,toc:()=>o});var i=n(1527),l=n(8672);const d={id:"ScaffoldConfig",title:"Interface: ScaffoldConfig",sidebar_label:"ScaffoldConfig",sidebar_position:0,custom_edit_url:null},r=void 0,c={id:"api/interfaces/ScaffoldConfig",title:"Interface: ScaffoldConfig",description:"The config object for defining a scaffolding group.",source:"@site/docs/api/interfaces/ScaffoldConfig.md",sourceDirName:"api/interfaces",slug:"/api/interfaces/ScaffoldConfig",permalink:"/simple-scaffold/docs/api/interfaces/ScaffoldConfig",draft:!1,unlisted:!1,editUrl:null,tags:[],version:"current",sidebarPosition:0,frontMatter:{id:"ScaffoldConfig",title:"Interface: ScaffoldConfig",sidebar_label:"ScaffoldConfig",sidebar_position:0,custom_edit_url:null},sidebar:"docs",previous:{title:"ScaffoldCmdConfig",permalink:"/simple-scaffold/docs/api/interfaces/ScaffoldCmdConfig"},next:{title:"Usage",permalink:"/simple-scaffold/docs/usage/"}},t={},o=[{value:"Properties",id:"properties",level:2},{value:"name",id:"name",level:3},{value:"Defined in",id:"defined-in",level:4},{value:"templates",id:"templates",level:3},{value:"Defined in",id:"defined-in-1",level:4},{value:"output",id:"output",level:3},{value:"Defined in",id:"defined-in-2",level:4},{value:"subdir",id:"subdir",level:3},{value:"Defined in",id:"defined-in-3",level:4},{value:"data",id:"data",level:3},{value:"Defined in",id:"defined-in-4",level:4},{value:"overwrite",id:"overwrite",level:3},{value:"Defined in",id:"defined-in-5",level:4},{value:"logLevel",id:"loglevel",level:3},{value:"Defined in",id:"defined-in-6",level:4},{value:"dryRun",id:"dryrun",level:3},{value:"Defined in",id:"defined-in-7",level:4},{value:"helpers",id:"helpers",level:3},{value:"Defined in",id:"defined-in-8",level:4},{value:"subdirHelper",id:"subdirhelper",level:3},{value:"Defined in",id:"defined-in-9",level:4},{value:"Methods",id:"methods",level:2},{value:"beforeWrite",id:"beforewrite",level:3},{value:"Parameters",id:"parameters",level:4},{value:"Returns",id:"returns",level:4},{value:"Defined in",id:"defined-in-10",level:4}];function h(e){const s={a:"a",code:"code",h2:"h2",h3:"h3",h4:"h4",hr:"hr",li:"li",p:"p",pre:"pre",strong:"strong",table:"table",tbody:"tbody",td:"td",th:"th",thead:"thead",tr:"tr",ul:"ul",...(0,l.a)(),...e.components};return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(s.p,{children:"The config object for defining a scaffolding group."}),"\n",(0,i.jsx)(s.p,{children:(0,i.jsx)(s.strong,{children:(0,i.jsx)(s.code,{children:"See"})})}),"\n",(0,i.jsxs)(s.ul,{children:["\n",(0,i.jsx)(s.li,{children:(0,i.jsx)(s.a,{href:"https://chenasraf.github.io/simple-scaffold/docs/usage/node%7C",children:"Node.js usage"})}),"\n",(0,i.jsx)(s.li,{children:(0,i.jsx)(s.a,{href:"https://chenasraf.github.io/simple-scaffold/docs/usage/cli%7C",children:"CLI usage"})}),"\n",(0,i.jsx)(s.li,{children:(0,i.jsx)(s.a,{href:"/simple-scaffold/docs/api/modules#defaulthelpers",children:"DefaultHelpers"})}),"\n",(0,i.jsx)(s.li,{children:(0,i.jsx)(s.a,{href:"/simple-scaffold/docs/api/modules#casehelpers",children:"CaseHelpers"})}),"\n",(0,i.jsx)(s.li,{children:(0,i.jsx)(s.a,{href:"/simple-scaffold/docs/api/modules#datehelpers",children:"DateHelpers"})}),"\n"]}),"\n",(0,i.jsx)(s.h2,{id:"properties",children:"Properties"}),"\n",(0,i.jsx)(s.h3,{id:"name",children:"name"}),"\n",(0,i.jsxs)(s.p,{children:["\u2022 ",(0,i.jsx)(s.strong,{children:"name"}),": ",(0,i.jsx)(s.code,{children:"string"})]}),"\n",(0,i.jsxs)(s.p,{children:["Name to be passed to the generated files. ",(0,i.jsx)(s.code,{children:"{{name}}"})," and ",(0,i.jsx)(s.code,{children:"{{Name}}"})," inside contents and file names will be replaced\naccordingly."]}),"\n",(0,i.jsx)(s.h4,{id:"defined-in",children:"Defined in"}),"\n",(0,i.jsx)(s.p,{children:(0,i.jsx)(s.a,{href:"https://github.com/chenasraf/simple-scaffold/blob/802f43c/src/types.ts#L19",children:"types.ts:19"})}),"\n",(0,i.jsx)(s.hr,{}),"\n",(0,i.jsx)(s.h3,{id:"templates",children:"templates"}),"\n",(0,i.jsxs)(s.p,{children:["\u2022 ",(0,i.jsx)(s.strong,{children:"templates"}),": ",(0,i.jsx)(s.code,{children:"string"}),"[]"]}),"\n",(0,i.jsx)(s.p,{children:"Template files to use as input. You may provide multiple files, each of which can be a relative or absolute path,\nor a glob pattern for multiple file matching easily."}),"\n",(0,i.jsx)(s.p,{children:(0,i.jsx)(s.strong,{children:(0,i.jsx)(s.code,{children:"Default"})})}),"\n",(0,i.jsx)(s.pre,{children:(0,i.jsx)(s.code,{className:"language-ts",children:"Current working directory\n"})}),"\n",(0,i.jsx)(s.h4,{id:"defined-in-1",children:"Defined in"}),"\n",(0,i.jsx)(s.p,{children:(0,i.jsx)(s.a,{href:"https://github.com/chenasraf/simple-scaffold/blob/802f43c/src/types.ts#L27",children:"types.ts:27"})}),"\n",(0,i.jsx)(s.hr,{}),"\n",(0,i.jsx)(s.h3,{id:"output",children:"output"}),"\n",(0,i.jsxs)(s.p,{children:["\u2022 ",(0,i.jsx)(s.strong,{children:"output"}),": ",(0,i.jsx)(s.a,{href:"/simple-scaffold/docs/api/modules#fileresponse",children:(0,i.jsx)(s.code,{children:"FileResponse"})}),"<",(0,i.jsx)(s.code,{children:"string"}),">"]}),"\n",(0,i.jsxs)(s.p,{children:["Path to output to. If ",(0,i.jsx)(s.code,{children:"subdir"})," is ",(0,i.jsx)(s.code,{children:"true"}),", the subfolder will be created inside this path."]}),"\n",(0,i.jsxs)(s.p,{children:["May also be a ",(0,i.jsx)(s.a,{href:"/simple-scaffold/docs/api/modules#fileresponsehandler",children:"FileResponseHandler"})," which returns a new output path to override the default one."]}),"\n",(0,i.jsx)(s.p,{children:(0,i.jsx)(s.strong,{children:(0,i.jsx)(s.code,{children:"See"})})}),"\n",(0,i.jsxs)(s.ul,{children:["\n",(0,i.jsx)(s.li,{children:(0,i.jsx)(s.a,{href:"/simple-scaffold/docs/api/modules#fileresponse",children:"FileResponse"})}),"\n",(0,i.jsx)(s.li,{children:(0,i.jsx)(s.a,{href:"/simple-scaffold/docs/api/modules#fileresponsehandler",children:"FileResponseHandler"})}),"\n"]}),"\n",(0,i.jsx)(s.h4,{id:"defined-in-2",children:"Defined in"}),"\n",(0,i.jsx)(s.p,{children:(0,i.jsx)(s.a,{href:"https://github.com/chenasraf/simple-scaffold/blob/802f43c/src/types.ts#L37",children:"types.ts:37"})}),"\n",(0,i.jsx)(s.hr,{}),"\n",(0,i.jsx)(s.h3,{id:"subdir",children:"subdir"}),"\n",(0,i.jsxs)(s.p,{children:["\u2022 ",(0,i.jsx)(s.code,{children:"Optional"})," ",(0,i.jsx)(s.strong,{children:"subdir"}),": ",(0,i.jsx)(s.code,{children:"boolean"})]}),"\n",(0,i.jsx)(s.p,{children:"Whether to create subfolder with the input name."}),"\n",(0,i.jsxs)(s.p,{children:["When ",(0,i.jsx)(s.code,{children:"true"}),", you may also use ",(0,i.jsx)(s.a,{href:"/simple-scaffold/docs/api/interfaces/ScaffoldConfig#subdirhelper",children:"subdirHelper"})," to determine a pre-process helper on\nthe directory name."]}),"\n",(0,i.jsx)(s.p,{children:(0,i.jsx)(s.strong,{children:(0,i.jsx)(s.code,{children:"Default"})})}),"\n",(0,i.jsx)(s.p,{children:(0,i.jsx)(s.code,{children:"false"})}),"\n",(0,i.jsx)(s.h4,{id:"defined-in-3",children:"Defined in"}),"\n",(0,i.jsx)(s.p,{children:(0,i.jsx)(s.a,{href:"https://github.com/chenasraf/simple-scaffold/blob/802f43c/src/types.ts#L47",children:"types.ts:47"})}),"\n",(0,i.jsx)(s.hr,{}),"\n",(0,i.jsx)(s.h3,{id:"data",children:"data"}),"\n",(0,i.jsxs)(s.p,{children:["\u2022 ",(0,i.jsx)(s.code,{children:"Optional"})," ",(0,i.jsx)(s.strong,{children:"data"}),": ",(0,i.jsx)(s.code,{children:"Record"}),"<",(0,i.jsx)(s.code,{children:"string"}),", ",(0,i.jsx)(s.code,{children:"any"}),">"]}),"\n",(0,i.jsxs)(s.p,{children:["Add custom data to the templates. By default, only your app name is included as ",(0,i.jsx)(s.code,{children:"{{name}}"})," and ",(0,i.jsx)(s.code,{children:"{{Name}}"}),"."]}),"\n",(0,i.jsx)(s.p,{children:"This can be any object that will be usable by Handlebars."}),"\n",(0,i.jsx)(s.h4,{id:"defined-in-4",children:"Defined in"}),"\n",(0,i.jsx)(s.p,{children:(0,i.jsx)(s.a,{href:"https://github.com/chenasraf/simple-scaffold/blob/802f43c/src/types.ts#L54",children:"types.ts:54"})}),"\n",(0,i.jsx)(s.hr,{}),"\n",(0,i.jsx)(s.h3,{id:"overwrite",children:"overwrite"}),"\n",(0,i.jsxs)(s.p,{children:["\u2022 ",(0,i.jsx)(s.code,{children:"Optional"})," ",(0,i.jsx)(s.strong,{children:"overwrite"}),": ",(0,i.jsx)(s.a,{href:"/simple-scaffold/docs/api/modules#fileresponse",children:(0,i.jsx)(s.code,{children:"FileResponse"})}),"<",(0,i.jsx)(s.code,{children:"boolean"}),">"]}),"\n",(0,i.jsx)(s.p,{children:"Enable to override output files, even if they already exist."}),"\n",(0,i.jsxs)(s.p,{children:["You may supply a function to this option, which can take the arguments ",(0,i.jsx)(s.code,{children:"(fullPath, baseDir, baseName)"})," and returns\na boolean for each file."]}),"\n",(0,i.jsxs)(s.p,{children:["May also be a ",(0,i.jsx)(s.a,{href:"/simple-scaffold/docs/api/modules#fileresponsehandler",children:"FileResponseHandler"})," which returns a boolean value per file."]}),"\n",(0,i.jsx)(s.p,{children:(0,i.jsx)(s.strong,{children:(0,i.jsx)(s.code,{children:"See"})})}),"\n",(0,i.jsxs)(s.ul,{children:["\n",(0,i.jsx)(s.li,{children:(0,i.jsx)(s.a,{href:"/simple-scaffold/docs/api/modules#fileresponse",children:"FileResponse"})}),"\n",(0,i.jsx)(s.li,{children:(0,i.jsx)(s.a,{href:"/simple-scaffold/docs/api/modules#fileresponsehandler",children:"FileResponseHandler"})}),"\n"]}),"\n",(0,i.jsx)(s.p,{children:(0,i.jsx)(s.strong,{children:(0,i.jsx)(s.code,{children:"Default"})})}),"\n",(0,i.jsx)(s.p,{children:(0,i.jsx)(s.code,{children:"false"})}),"\n",(0,i.jsx)(s.h4,{id:"defined-in-5",children:"Defined in"}),"\n",(0,i.jsx)(s.p,{children:(0,i.jsx)(s.a,{href:"https://github.com/chenasraf/simple-scaffold/blob/802f43c/src/types.ts#L69",children:"types.ts:69"})}),"\n",(0,i.jsx)(s.hr,{}),"\n",(0,i.jsx)(s.h3,{id:"loglevel",children:"logLevel"}),"\n",(0,i.jsxs)(s.p,{children:["\u2022 ",(0,i.jsx)(s.code,{children:"Optional"})," ",(0,i.jsx)(s.strong,{children:"logLevel"}),": ",(0,i.jsx)(s.a,{href:"/simple-scaffold/docs/api/modules#loglevel-1",children:(0,i.jsx)(s.code,{children:"LogLevel"})})]}),"\n",(0,i.jsx)(s.p,{children:"Determine amount of logs to display."}),"\n",(0,i.jsxs)(s.p,{children:["The values are: ",(0,i.jsx)(s.code,{children:"0 (none) | 1 (debug) | 2 (info) | 3 (warn) | 4 (error)"}),". The provided level will display messages\nof the same level or higher."]}),"\n",(0,i.jsx)(s.p,{children:(0,i.jsx)(s.strong,{children:(0,i.jsx)(s.code,{children:"See"})})}),"\n",(0,i.jsx)(s.p,{children:(0,i.jsx)(s.a,{href:"/simple-scaffold/docs/api/modules#loglevel",children:"LogLevel"})}),"\n",(0,i.jsx)(s.p,{children:(0,i.jsx)(s.strong,{children:(0,i.jsx)(s.code,{children:"Default"})})}),"\n",(0,i.jsx)(s.p,{children:(0,i.jsx)(s.code,{children:"2 (info)"})}),"\n",(0,i.jsx)(s.h4,{id:"defined-in-6",children:"Defined in"}),"\n",(0,i.jsx)(s.p,{children:(0,i.jsx)(s.a,{href:"https://github.com/chenasraf/simple-scaffold/blob/802f43c/src/types.ts#L81",children:"types.ts:81"})}),"\n",(0,i.jsx)(s.hr,{}),"\n",(0,i.jsx)(s.h3,{id:"dryrun",children:"dryRun"}),"\n",(0,i.jsxs)(s.p,{children:["\u2022 ",(0,i.jsx)(s.code,{children:"Optional"})," ",(0,i.jsx)(s.strong,{children:"dryRun"}),": ",(0,i.jsx)(s.code,{children:"boolean"})]}),"\n",(0,i.jsx)(s.p,{children:"Don't emit files. This is good for testing your scaffolds and making sure they don't fail, without having to write\nactual file contents or create directories."}),"\n",(0,i.jsx)(s.p,{children:(0,i.jsx)(s.strong,{children:(0,i.jsx)(s.code,{children:"Default"})})}),"\n",(0,i.jsx)(s.p,{children:(0,i.jsx)(s.code,{children:"false"})}),"\n",(0,i.jsx)(s.h4,{id:"defined-in-7",children:"Defined in"}),"\n",(0,i.jsx)(s.p,{children:(0,i.jsx)(s.a,{href:"https://github.com/chenasraf/simple-scaffold/blob/802f43c/src/types.ts#L89",children:"types.ts:89"})}),"\n",(0,i.jsx)(s.hr,{}),"\n",(0,i.jsx)(s.h3,{id:"helpers",children:"helpers"}),"\n",(0,i.jsxs)(s.p,{children:["\u2022 ",(0,i.jsx)(s.code,{children:"Optional"})," ",(0,i.jsx)(s.strong,{children:"helpers"}),": ",(0,i.jsx)(s.code,{children:"Record"}),"<",(0,i.jsx)(s.code,{children:"string"}),", ",(0,i.jsx)(s.code,{children:"HelperDelegate"}),">"]}),"\n",(0,i.jsx)(s.p,{children:"Additional helpers to add to the template parser. Provide an object whose keys are the name of the function to add,\nand the value is the helper function itself. The signature of helpers is as follows:"}),"\n",(0,i.jsx)(s.pre,{children:(0,i.jsx)(s.code,{className:"language-typescript",children:"(text: string, ...args: any[]) => string\n"})}),"\n",(0,i.jsx)(s.p,{children:"A full example might be:"}),"\n",(0,i.jsx)(s.pre,{children:(0,i.jsx)(s.code,{className:"language-typescript",children:"Scaffold({\n //...\n helpers: {\n upperKebabCase: (text) => kebabCase(text).toUpperCase()\n }\n})\n"})}),"\n",(0,i.jsx)(s.p,{children:"Which will allow:"}),"\n",(0,i.jsx)(s.pre,{children:(0,i.jsx)(s.code,{children:'{{ upperKebabCase "my value" }}\n'})}),"\n",(0,i.jsx)(s.p,{children:"To transform to:"}),"\n",(0,i.jsx)(s.pre,{children:(0,i.jsx)(s.code,{children:"MY-VALUE\n"})}),"\n",(0,i.jsxs)(s.p,{children:["See ",(0,i.jsx)(s.a,{href:"/simple-scaffold/docs/api/modules#defaulthelpers",children:"DefaultHelpers"})," for a list of all the built-in available helpers."]}),"\n",(0,i.jsxs)(s.p,{children:["Simple Scaffold uses Handlebars.js, so all the syntax from there is supported. See\n",(0,i.jsx)(s.a,{href:"https://handlebarsjs.com/guide/#custom-helpers",children:"their docs"})," for more information."]}),"\n",(0,i.jsx)(s.p,{children:(0,i.jsx)(s.strong,{children:(0,i.jsx)(s.code,{children:"See"})})}),"\n",(0,i.jsxs)(s.ul,{children:["\n",(0,i.jsx)(s.li,{children:(0,i.jsx)(s.a,{href:"/simple-scaffold/docs/api/modules#defaulthelpers",children:"DefaultHelpers"})}),"\n",(0,i.jsx)(s.li,{children:(0,i.jsx)(s.a,{href:"/simple-scaffold/docs/api/modules#casehelpers",children:"CaseHelpers"})}),"\n",(0,i.jsx)(s.li,{children:(0,i.jsx)(s.a,{href:"/simple-scaffold/docs/api/modules#datehelpers",children:"DateHelpers"})}),"\n",(0,i.jsx)(s.li,{children:(0,i.jsx)(s.a,{href:"https://chenasraf.github.io/simple-scaffold/docs/usage/templates%7C",children:"Templates"})}),"\n"]}),"\n",(0,i.jsx)(s.h4,{id:"defined-in-8",children:"Defined in"}),"\n",(0,i.jsx)(s.p,{children:(0,i.jsx)(s.a,{href:"https://github.com/chenasraf/simple-scaffold/blob/802f43c/src/types.ts#L131",children:"types.ts:131"})}),"\n",(0,i.jsx)(s.hr,{}),"\n",(0,i.jsx)(s.h3,{id:"subdirhelper",children:"subdirHelper"}),"\n",(0,i.jsxs)(s.p,{children:["\u2022 ",(0,i.jsx)(s.code,{children:"Optional"})," ",(0,i.jsx)(s.strong,{children:"subdirHelper"}),": ",(0,i.jsx)(s.code,{children:"string"})]}),"\n",(0,i.jsxs)(s.p,{children:["Default transformer to apply to subfolder name when using ",(0,i.jsx)(s.code,{children:"subdir: true"}),". Can be one of the default\ncapitalization helpers, or a custom one you provide to ",(0,i.jsx)(s.code,{children:"helpers"}),". Defaults to ",(0,i.jsx)(s.code,{children:"undefined"}),", which means no\ntransformation is done."]}),"\n",(0,i.jsx)(s.p,{children:(0,i.jsx)(s.strong,{children:(0,i.jsx)(s.code,{children:"See"})})}),"\n",(0,i.jsxs)(s.ul,{children:["\n",(0,i.jsx)(s.li,{children:(0,i.jsx)(s.a,{href:"/simple-scaffold/docs/api/interfaces/ScaffoldConfig#subdir",children:"subdir"})}),"\n",(0,i.jsx)(s.li,{children:(0,i.jsx)(s.a,{href:"/simple-scaffold/docs/api/modules#casehelpers",children:"CaseHelpers"})}),"\n",(0,i.jsx)(s.li,{children:(0,i.jsx)(s.a,{href:"/simple-scaffold/docs/api/modules#defaulthelpers",children:"DefaultHelpers"})}),"\n"]}),"\n",(0,i.jsx)(s.h4,{id:"defined-in-9",children:"Defined in"}),"\n",(0,i.jsx)(s.p,{children:(0,i.jsx)(s.a,{href:"https://github.com/chenasraf/simple-scaffold/blob/802f43c/src/types.ts#L142",children:"types.ts:142"})}),"\n",(0,i.jsx)(s.h2,{id:"methods",children:"Methods"}),"\n",(0,i.jsx)(s.h3,{id:"beforewrite",children:"beforeWrite"}),"\n",(0,i.jsxs)(s.p,{children:["\u25b8 ",(0,i.jsx)(s.strong,{children:"beforeWrite"}),"(",(0,i.jsx)(s.code,{children:"content"}),", ",(0,i.jsx)(s.code,{children:"rawContent"}),", ",(0,i.jsx)(s.code,{children:"outputPath"}),"): ",(0,i.jsx)(s.code,{children:"undefined"})," | ",(0,i.jsx)(s.code,{children:"string"})," | ",(0,i.jsx)(s.code,{children:"Buffer"})," | ",(0,i.jsx)(s.code,{children:"Promise"}),"<",(0,i.jsx)(s.code,{children:"undefined"})," | ",(0,i.jsx)(s.code,{children:"string"})," | ",(0,i.jsx)(s.code,{children:"Buffer"}),">"]}),"\n",(0,i.jsx)(s.p,{children:"This callback runs right before content is being written to the disk. If you supply this function, you may return\na string that represents the final content of your file, you may process the content as you see fit. For example,\nyou may run formatters on a file, fix output in edge-cases not supported by helpers or data, etc."}),"\n",(0,i.jsxs)(s.p,{children:["If the return value of this function is ",(0,i.jsx)(s.code,{children:"undefined"}),", the original content will be used."]}),"\n",(0,i.jsx)(s.h4,{id:"parameters",children:"Parameters"}),"\n",(0,i.jsxs)(s.table,{children:[(0,i.jsx)(s.thead,{children:(0,i.jsxs)(s.tr,{children:[(0,i.jsx)(s.th,{style:{textAlign:"left"},children:"Name"}),(0,i.jsx)(s.th,{style:{textAlign:"left"},children:"Type"}),(0,i.jsx)(s.th,{style:{textAlign:"left"},children:"Description"})]})}),(0,i.jsxs)(s.tbody,{children:[(0,i.jsxs)(s.tr,{children:[(0,i.jsx)(s.td,{style:{textAlign:"left"},children:(0,i.jsx)(s.code,{children:"content"})}),(0,i.jsx)(s.td,{style:{textAlign:"left"},children:(0,i.jsx)(s.code,{children:"Buffer"})}),(0,i.jsx)(s.td,{style:{textAlign:"left"},children:"The original template after token replacement"})]}),(0,i.jsxs)(s.tr,{children:[(0,i.jsx)(s.td,{style:{textAlign:"left"},children:(0,i.jsx)(s.code,{children:"rawContent"})}),(0,i.jsx)(s.td,{style:{textAlign:"left"},children:(0,i.jsx)(s.code,{children:"Buffer"})}),(0,i.jsx)(s.td,{style:{textAlign:"left"},children:"The original template before token replacement"})]}),(0,i.jsxs)(s.tr,{children:[(0,i.jsx)(s.td,{style:{textAlign:"left"},children:(0,i.jsx)(s.code,{children:"outputPath"})}),(0,i.jsx)(s.td,{style:{textAlign:"left"},children:(0,i.jsx)(s.code,{children:"string"})}),(0,i.jsx)(s.td,{style:{textAlign:"left"},children:"The final output path of the processed file"})]})]})]}),"\n",(0,i.jsx)(s.h4,{id:"returns",children:"Returns"}),"\n",(0,i.jsxs)(s.p,{children:[(0,i.jsx)(s.code,{children:"undefined"})," | ",(0,i.jsx)(s.code,{children:"string"})," | ",(0,i.jsx)(s.code,{children:"Buffer"})," | ",(0,i.jsx)(s.code,{children:"Promise"}),"<",(0,i.jsx)(s.code,{children:"undefined"})," | ",(0,i.jsx)(s.code,{children:"string"})," | ",(0,i.jsx)(s.code,{children:"Buffer"}),">"]}),"\n",(0,i.jsxs)(s.p,{children:["The final output of the file\ncontents-only, after further modifications - or ",(0,i.jsx)(s.code,{children:"undefined"})," to use the original content (i.e. ",(0,i.jsx)(s.code,{children:"content.toString()"}),")"]}),"\n",(0,i.jsx)(s.h4,{id:"defined-in-10",children:"Defined in"}),"\n",(0,i.jsx)(s.p,{children:(0,i.jsx)(s.a,{href:"https://github.com/chenasraf/simple-scaffold/blob/802f43c/src/types.ts#L158",children:"types.ts:158"})})]})}function a(e={}){const{wrapper:s}={...(0,l.a)(),...e.components};return s?(0,i.jsx)(s,{...e,children:(0,i.jsx)(h,{...e})}):h(e)}},8672:(e,s,n)=>{n.d(s,{Z:()=>c,a:()=>r});var i=n(959);const l={},d=i.createContext(l);function r(e){const s=i.useContext(d);return i.useMemo((function(){return"function"==typeof e?e(s):{...s,...e}}),[s,e])}function c(e){let s;return s=e.disableParentContext?"function"==typeof e.components?e.components(l):e.components||l:r(e.components),i.createElement(d.Provider,{value:s},e.children)}}}]); \ No newline at end of file +"use strict";(self.webpackChunksimple_scaffold_docs=self.webpackChunksimple_scaffold_docs||[]).push([[189],{4749:(e,s,n)=>{n.r(s),n.d(s,{assets:()=>t,contentTitle:()=>r,default:()=>a,frontMatter:()=>d,metadata:()=>c,toc:()=>o});var i=n(1527),l=n(8672);const d={id:"ScaffoldConfig",title:"Interface: ScaffoldConfig",sidebar_label:"ScaffoldConfig",sidebar_position:0,custom_edit_url:null},r=void 0,c={id:"api/interfaces/ScaffoldConfig",title:"Interface: ScaffoldConfig",description:"The config object for defining a scaffolding group.",source:"@site/docs/api/interfaces/ScaffoldConfig.md",sourceDirName:"api/interfaces",slug:"/api/interfaces/ScaffoldConfig",permalink:"/simple-scaffold/docs/api/interfaces/ScaffoldConfig",draft:!1,unlisted:!1,editUrl:null,tags:[],version:"current",sidebarPosition:0,frontMatter:{id:"ScaffoldConfig",title:"Interface: ScaffoldConfig",sidebar_label:"ScaffoldConfig",sidebar_position:0,custom_edit_url:null},sidebar:"docs",previous:{title:"ScaffoldCmdConfig",permalink:"/simple-scaffold/docs/api/interfaces/ScaffoldCmdConfig"},next:{title:"Usage",permalink:"/simple-scaffold/docs/usage/"}},t={},o=[{value:"Properties",id:"properties",level:2},{value:"name",id:"name",level:3},{value:"Defined in",id:"defined-in",level:4},{value:"templates",id:"templates",level:3},{value:"Defined in",id:"defined-in-1",level:4},{value:"output",id:"output",level:3},{value:"Defined in",id:"defined-in-2",level:4},{value:"subdir",id:"subdir",level:3},{value:"Defined in",id:"defined-in-3",level:4},{value:"data",id:"data",level:3},{value:"Defined in",id:"defined-in-4",level:4},{value:"overwrite",id:"overwrite",level:3},{value:"Defined in",id:"defined-in-5",level:4},{value:"logLevel",id:"loglevel",level:3},{value:"Defined in",id:"defined-in-6",level:4},{value:"dryRun",id:"dryrun",level:3},{value:"Defined in",id:"defined-in-7",level:4},{value:"helpers",id:"helpers",level:3},{value:"Defined in",id:"defined-in-8",level:4},{value:"subdirHelper",id:"subdirhelper",level:3},{value:"Defined in",id:"defined-in-9",level:4},{value:"Methods",id:"methods",level:2},{value:"beforeWrite",id:"beforewrite",level:3},{value:"Parameters",id:"parameters",level:4},{value:"Returns",id:"returns",level:4},{value:"Defined in",id:"defined-in-10",level:4}];function h(e){const s={a:"a",code:"code",h2:"h2",h3:"h3",h4:"h4",hr:"hr",li:"li",p:"p",pre:"pre",strong:"strong",table:"table",tbody:"tbody",td:"td",th:"th",thead:"thead",tr:"tr",ul:"ul",...(0,l.a)(),...e.components};return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(s.p,{children:"The config object for defining a scaffolding group."}),"\n",(0,i.jsx)(s.p,{children:(0,i.jsx)(s.strong,{children:(0,i.jsx)(s.code,{children:"See"})})}),"\n",(0,i.jsxs)(s.ul,{children:["\n",(0,i.jsx)(s.li,{children:(0,i.jsx)(s.a,{href:"https://chenasraf.github.io/simple-scaffold/docs/usage/node%7C",children:"Node.js usage"})}),"\n",(0,i.jsx)(s.li,{children:(0,i.jsx)(s.a,{href:"https://chenasraf.github.io/simple-scaffold/docs/usage/cli%7C",children:"CLI usage"})}),"\n",(0,i.jsx)(s.li,{children:(0,i.jsx)(s.a,{href:"/simple-scaffold/docs/api/modules#defaulthelpers",children:"DefaultHelpers"})}),"\n",(0,i.jsx)(s.li,{children:(0,i.jsx)(s.a,{href:"/simple-scaffold/docs/api/modules#casehelpers",children:"CaseHelpers"})}),"\n",(0,i.jsx)(s.li,{children:(0,i.jsx)(s.a,{href:"/simple-scaffold/docs/api/modules#datehelpers",children:"DateHelpers"})}),"\n"]}),"\n",(0,i.jsx)(s.h2,{id:"properties",children:"Properties"}),"\n",(0,i.jsx)(s.h3,{id:"name",children:"name"}),"\n",(0,i.jsxs)(s.p,{children:["\u2022 ",(0,i.jsx)(s.strong,{children:"name"}),": ",(0,i.jsx)(s.code,{children:"string"})]}),"\n",(0,i.jsxs)(s.p,{children:["Name to be passed to the generated files. ",(0,i.jsx)(s.code,{children:"{{name}}"})," and ",(0,i.jsx)(s.code,{children:"{{Name}}"})," inside contents and file names will be replaced\naccordingly."]}),"\n",(0,i.jsx)(s.h4,{id:"defined-in",children:"Defined in"}),"\n",(0,i.jsx)(s.p,{children:(0,i.jsx)(s.a,{href:"https://github.com/chenasraf/simple-scaffold/blob/bfee26f/src/types.ts#L19",children:"types.ts:19"})}),"\n",(0,i.jsx)(s.hr,{}),"\n",(0,i.jsx)(s.h3,{id:"templates",children:"templates"}),"\n",(0,i.jsxs)(s.p,{children:["\u2022 ",(0,i.jsx)(s.strong,{children:"templates"}),": ",(0,i.jsx)(s.code,{children:"string"}),"[]"]}),"\n",(0,i.jsx)(s.p,{children:"Template files to use as input. You may provide multiple files, each of which can be a relative or absolute path,\nor a glob pattern for multiple file matching easily."}),"\n",(0,i.jsx)(s.p,{children:(0,i.jsx)(s.strong,{children:(0,i.jsx)(s.code,{children:"Default"})})}),"\n",(0,i.jsx)(s.pre,{children:(0,i.jsx)(s.code,{className:"language-ts",children:"Current working directory\n"})}),"\n",(0,i.jsx)(s.h4,{id:"defined-in-1",children:"Defined in"}),"\n",(0,i.jsx)(s.p,{children:(0,i.jsx)(s.a,{href:"https://github.com/chenasraf/simple-scaffold/blob/bfee26f/src/types.ts#L27",children:"types.ts:27"})}),"\n",(0,i.jsx)(s.hr,{}),"\n",(0,i.jsx)(s.h3,{id:"output",children:"output"}),"\n",(0,i.jsxs)(s.p,{children:["\u2022 ",(0,i.jsx)(s.strong,{children:"output"}),": ",(0,i.jsx)(s.a,{href:"/simple-scaffold/docs/api/modules#fileresponse",children:(0,i.jsx)(s.code,{children:"FileResponse"})}),"<",(0,i.jsx)(s.code,{children:"string"}),">"]}),"\n",(0,i.jsxs)(s.p,{children:["Path to output to. If ",(0,i.jsx)(s.code,{children:"subdir"})," is ",(0,i.jsx)(s.code,{children:"true"}),", the subfolder will be created inside this path."]}),"\n",(0,i.jsxs)(s.p,{children:["May also be a ",(0,i.jsx)(s.a,{href:"/simple-scaffold/docs/api/modules#fileresponsehandler",children:"FileResponseHandler"})," which returns a new output path to override the default one."]}),"\n",(0,i.jsx)(s.p,{children:(0,i.jsx)(s.strong,{children:(0,i.jsx)(s.code,{children:"See"})})}),"\n",(0,i.jsxs)(s.ul,{children:["\n",(0,i.jsx)(s.li,{children:(0,i.jsx)(s.a,{href:"/simple-scaffold/docs/api/modules#fileresponse",children:"FileResponse"})}),"\n",(0,i.jsx)(s.li,{children:(0,i.jsx)(s.a,{href:"/simple-scaffold/docs/api/modules#fileresponsehandler",children:"FileResponseHandler"})}),"\n"]}),"\n",(0,i.jsx)(s.h4,{id:"defined-in-2",children:"Defined in"}),"\n",(0,i.jsx)(s.p,{children:(0,i.jsx)(s.a,{href:"https://github.com/chenasraf/simple-scaffold/blob/bfee26f/src/types.ts#L37",children:"types.ts:37"})}),"\n",(0,i.jsx)(s.hr,{}),"\n",(0,i.jsx)(s.h3,{id:"subdir",children:"subdir"}),"\n",(0,i.jsxs)(s.p,{children:["\u2022 ",(0,i.jsx)(s.code,{children:"Optional"})," ",(0,i.jsx)(s.strong,{children:"subdir"}),": ",(0,i.jsx)(s.code,{children:"boolean"})]}),"\n",(0,i.jsx)(s.p,{children:"Whether to create subfolder with the input name."}),"\n",(0,i.jsxs)(s.p,{children:["When ",(0,i.jsx)(s.code,{children:"true"}),", you may also use ",(0,i.jsx)(s.a,{href:"/simple-scaffold/docs/api/interfaces/ScaffoldConfig#subdirhelper",children:"subdirHelper"})," to determine a pre-process helper on\nthe directory name."]}),"\n",(0,i.jsx)(s.p,{children:(0,i.jsx)(s.strong,{children:(0,i.jsx)(s.code,{children:"Default"})})}),"\n",(0,i.jsx)(s.p,{children:(0,i.jsx)(s.code,{children:"false"})}),"\n",(0,i.jsx)(s.h4,{id:"defined-in-3",children:"Defined in"}),"\n",(0,i.jsx)(s.p,{children:(0,i.jsx)(s.a,{href:"https://github.com/chenasraf/simple-scaffold/blob/bfee26f/src/types.ts#L47",children:"types.ts:47"})}),"\n",(0,i.jsx)(s.hr,{}),"\n",(0,i.jsx)(s.h3,{id:"data",children:"data"}),"\n",(0,i.jsxs)(s.p,{children:["\u2022 ",(0,i.jsx)(s.code,{children:"Optional"})," ",(0,i.jsx)(s.strong,{children:"data"}),": ",(0,i.jsx)(s.code,{children:"Record"}),"<",(0,i.jsx)(s.code,{children:"string"}),", ",(0,i.jsx)(s.code,{children:"any"}),">"]}),"\n",(0,i.jsxs)(s.p,{children:["Add custom data to the templates. By default, only your app name is included as ",(0,i.jsx)(s.code,{children:"{{name}}"})," and ",(0,i.jsx)(s.code,{children:"{{Name}}"}),"."]}),"\n",(0,i.jsx)(s.p,{children:"This can be any object that will be usable by Handlebars."}),"\n",(0,i.jsx)(s.h4,{id:"defined-in-4",children:"Defined in"}),"\n",(0,i.jsx)(s.p,{children:(0,i.jsx)(s.a,{href:"https://github.com/chenasraf/simple-scaffold/blob/bfee26f/src/types.ts#L54",children:"types.ts:54"})}),"\n",(0,i.jsx)(s.hr,{}),"\n",(0,i.jsx)(s.h3,{id:"overwrite",children:"overwrite"}),"\n",(0,i.jsxs)(s.p,{children:["\u2022 ",(0,i.jsx)(s.code,{children:"Optional"})," ",(0,i.jsx)(s.strong,{children:"overwrite"}),": ",(0,i.jsx)(s.a,{href:"/simple-scaffold/docs/api/modules#fileresponse",children:(0,i.jsx)(s.code,{children:"FileResponse"})}),"<",(0,i.jsx)(s.code,{children:"boolean"}),">"]}),"\n",(0,i.jsx)(s.p,{children:"Enable to override output files, even if they already exist."}),"\n",(0,i.jsxs)(s.p,{children:["You may supply a function to this option, which can take the arguments ",(0,i.jsx)(s.code,{children:"(fullPath, baseDir, baseName)"})," and returns\na boolean for each file."]}),"\n",(0,i.jsxs)(s.p,{children:["May also be a ",(0,i.jsx)(s.a,{href:"/simple-scaffold/docs/api/modules#fileresponsehandler",children:"FileResponseHandler"})," which returns a boolean value per file."]}),"\n",(0,i.jsx)(s.p,{children:(0,i.jsx)(s.strong,{children:(0,i.jsx)(s.code,{children:"See"})})}),"\n",(0,i.jsxs)(s.ul,{children:["\n",(0,i.jsx)(s.li,{children:(0,i.jsx)(s.a,{href:"/simple-scaffold/docs/api/modules#fileresponse",children:"FileResponse"})}),"\n",(0,i.jsx)(s.li,{children:(0,i.jsx)(s.a,{href:"/simple-scaffold/docs/api/modules#fileresponsehandler",children:"FileResponseHandler"})}),"\n"]}),"\n",(0,i.jsx)(s.p,{children:(0,i.jsx)(s.strong,{children:(0,i.jsx)(s.code,{children:"Default"})})}),"\n",(0,i.jsx)(s.p,{children:(0,i.jsx)(s.code,{children:"false"})}),"\n",(0,i.jsx)(s.h4,{id:"defined-in-5",children:"Defined in"}),"\n",(0,i.jsx)(s.p,{children:(0,i.jsx)(s.a,{href:"https://github.com/chenasraf/simple-scaffold/blob/bfee26f/src/types.ts#L69",children:"types.ts:69"})}),"\n",(0,i.jsx)(s.hr,{}),"\n",(0,i.jsx)(s.h3,{id:"loglevel",children:"logLevel"}),"\n",(0,i.jsxs)(s.p,{children:["\u2022 ",(0,i.jsx)(s.code,{children:"Optional"})," ",(0,i.jsx)(s.strong,{children:"logLevel"}),": ",(0,i.jsx)(s.a,{href:"/simple-scaffold/docs/api/modules#loglevel-1",children:(0,i.jsx)(s.code,{children:"LogLevel"})})]}),"\n",(0,i.jsx)(s.p,{children:"Determine amount of logs to display."}),"\n",(0,i.jsxs)(s.p,{children:["The values are: ",(0,i.jsx)(s.code,{children:"0 (none) | 1 (debug) | 2 (info) | 3 (warn) | 4 (error)"}),". The provided level will display messages\nof the same level or higher."]}),"\n",(0,i.jsx)(s.p,{children:(0,i.jsx)(s.strong,{children:(0,i.jsx)(s.code,{children:"See"})})}),"\n",(0,i.jsx)(s.p,{children:(0,i.jsx)(s.a,{href:"/simple-scaffold/docs/api/modules#loglevel",children:"LogLevel"})}),"\n",(0,i.jsx)(s.p,{children:(0,i.jsx)(s.strong,{children:(0,i.jsx)(s.code,{children:"Default"})})}),"\n",(0,i.jsx)(s.p,{children:(0,i.jsx)(s.code,{children:"2 (info)"})}),"\n",(0,i.jsx)(s.h4,{id:"defined-in-6",children:"Defined in"}),"\n",(0,i.jsx)(s.p,{children:(0,i.jsx)(s.a,{href:"https://github.com/chenasraf/simple-scaffold/blob/bfee26f/src/types.ts#L81",children:"types.ts:81"})}),"\n",(0,i.jsx)(s.hr,{}),"\n",(0,i.jsx)(s.h3,{id:"dryrun",children:"dryRun"}),"\n",(0,i.jsxs)(s.p,{children:["\u2022 ",(0,i.jsx)(s.code,{children:"Optional"})," ",(0,i.jsx)(s.strong,{children:"dryRun"}),": ",(0,i.jsx)(s.code,{children:"boolean"})]}),"\n",(0,i.jsx)(s.p,{children:"Don't emit files. This is good for testing your scaffolds and making sure they don't fail, without having to write\nactual file contents or create directories."}),"\n",(0,i.jsx)(s.p,{children:(0,i.jsx)(s.strong,{children:(0,i.jsx)(s.code,{children:"Default"})})}),"\n",(0,i.jsx)(s.p,{children:(0,i.jsx)(s.code,{children:"false"})}),"\n",(0,i.jsx)(s.h4,{id:"defined-in-7",children:"Defined in"}),"\n",(0,i.jsx)(s.p,{children:(0,i.jsx)(s.a,{href:"https://github.com/chenasraf/simple-scaffold/blob/bfee26f/src/types.ts#L89",children:"types.ts:89"})}),"\n",(0,i.jsx)(s.hr,{}),"\n",(0,i.jsx)(s.h3,{id:"helpers",children:"helpers"}),"\n",(0,i.jsxs)(s.p,{children:["\u2022 ",(0,i.jsx)(s.code,{children:"Optional"})," ",(0,i.jsx)(s.strong,{children:"helpers"}),": ",(0,i.jsx)(s.code,{children:"Record"}),"<",(0,i.jsx)(s.code,{children:"string"}),", ",(0,i.jsx)(s.code,{children:"HelperDelegate"}),">"]}),"\n",(0,i.jsx)(s.p,{children:"Additional helpers to add to the template parser. Provide an object whose keys are the name of the function to add,\nand the value is the helper function itself. The signature of helpers is as follows:"}),"\n",(0,i.jsx)(s.pre,{children:(0,i.jsx)(s.code,{className:"language-typescript",children:"(text: string, ...args: any[]) => string\n"})}),"\n",(0,i.jsx)(s.p,{children:"A full example might be:"}),"\n",(0,i.jsx)(s.pre,{children:(0,i.jsx)(s.code,{className:"language-typescript",children:"Scaffold({\n //...\n helpers: {\n upperKebabCase: (text) => kebabCase(text).toUpperCase()\n }\n})\n"})}),"\n",(0,i.jsx)(s.p,{children:"Which will allow:"}),"\n",(0,i.jsx)(s.pre,{children:(0,i.jsx)(s.code,{children:'{{ upperKebabCase "my value" }}\n'})}),"\n",(0,i.jsx)(s.p,{children:"To transform to:"}),"\n",(0,i.jsx)(s.pre,{children:(0,i.jsx)(s.code,{children:"MY-VALUE\n"})}),"\n",(0,i.jsxs)(s.p,{children:["See ",(0,i.jsx)(s.a,{href:"/simple-scaffold/docs/api/modules#defaulthelpers",children:"DefaultHelpers"})," for a list of all the built-in available helpers."]}),"\n",(0,i.jsxs)(s.p,{children:["Simple Scaffold uses Handlebars.js, so all the syntax from there is supported. See\n",(0,i.jsx)(s.a,{href:"https://handlebarsjs.com/guide/#custom-helpers",children:"their docs"})," for more information."]}),"\n",(0,i.jsx)(s.p,{children:(0,i.jsx)(s.strong,{children:(0,i.jsx)(s.code,{children:"See"})})}),"\n",(0,i.jsxs)(s.ul,{children:["\n",(0,i.jsx)(s.li,{children:(0,i.jsx)(s.a,{href:"/simple-scaffold/docs/api/modules#defaulthelpers",children:"DefaultHelpers"})}),"\n",(0,i.jsx)(s.li,{children:(0,i.jsx)(s.a,{href:"/simple-scaffold/docs/api/modules#casehelpers",children:"CaseHelpers"})}),"\n",(0,i.jsx)(s.li,{children:(0,i.jsx)(s.a,{href:"/simple-scaffold/docs/api/modules#datehelpers",children:"DateHelpers"})}),"\n",(0,i.jsx)(s.li,{children:(0,i.jsx)(s.a,{href:"https://chenasraf.github.io/simple-scaffold/docs/usage/templates%7C",children:"Templates"})}),"\n"]}),"\n",(0,i.jsx)(s.h4,{id:"defined-in-8",children:"Defined in"}),"\n",(0,i.jsx)(s.p,{children:(0,i.jsx)(s.a,{href:"https://github.com/chenasraf/simple-scaffold/blob/bfee26f/src/types.ts#L131",children:"types.ts:131"})}),"\n",(0,i.jsx)(s.hr,{}),"\n",(0,i.jsx)(s.h3,{id:"subdirhelper",children:"subdirHelper"}),"\n",(0,i.jsxs)(s.p,{children:["\u2022 ",(0,i.jsx)(s.code,{children:"Optional"})," ",(0,i.jsx)(s.strong,{children:"subdirHelper"}),": ",(0,i.jsx)(s.code,{children:"string"})]}),"\n",(0,i.jsxs)(s.p,{children:["Default transformer to apply to subfolder name when using ",(0,i.jsx)(s.code,{children:"subdir: true"}),". Can be one of the default\ncapitalization helpers, or a custom one you provide to ",(0,i.jsx)(s.code,{children:"helpers"}),". Defaults to ",(0,i.jsx)(s.code,{children:"undefined"}),", which means no\ntransformation is done."]}),"\n",(0,i.jsx)(s.p,{children:(0,i.jsx)(s.strong,{children:(0,i.jsx)(s.code,{children:"See"})})}),"\n",(0,i.jsxs)(s.ul,{children:["\n",(0,i.jsx)(s.li,{children:(0,i.jsx)(s.a,{href:"/simple-scaffold/docs/api/interfaces/ScaffoldConfig#subdir",children:"subdir"})}),"\n",(0,i.jsx)(s.li,{children:(0,i.jsx)(s.a,{href:"/simple-scaffold/docs/api/modules#casehelpers",children:"CaseHelpers"})}),"\n",(0,i.jsx)(s.li,{children:(0,i.jsx)(s.a,{href:"/simple-scaffold/docs/api/modules#defaulthelpers",children:"DefaultHelpers"})}),"\n"]}),"\n",(0,i.jsx)(s.h4,{id:"defined-in-9",children:"Defined in"}),"\n",(0,i.jsx)(s.p,{children:(0,i.jsx)(s.a,{href:"https://github.com/chenasraf/simple-scaffold/blob/bfee26f/src/types.ts#L142",children:"types.ts:142"})}),"\n",(0,i.jsx)(s.h2,{id:"methods",children:"Methods"}),"\n",(0,i.jsx)(s.h3,{id:"beforewrite",children:"beforeWrite"}),"\n",(0,i.jsxs)(s.p,{children:["\u25b8 ",(0,i.jsx)(s.strong,{children:"beforeWrite"}),"(",(0,i.jsx)(s.code,{children:"content"}),", ",(0,i.jsx)(s.code,{children:"rawContent"}),", ",(0,i.jsx)(s.code,{children:"outputPath"}),"): ",(0,i.jsx)(s.code,{children:"undefined"})," | ",(0,i.jsx)(s.code,{children:"string"})," | ",(0,i.jsx)(s.code,{children:"Buffer"})," | ",(0,i.jsx)(s.code,{children:"Promise"}),"<",(0,i.jsx)(s.code,{children:"undefined"})," | ",(0,i.jsx)(s.code,{children:"string"})," | ",(0,i.jsx)(s.code,{children:"Buffer"}),">"]}),"\n",(0,i.jsx)(s.p,{children:"This callback runs right before content is being written to the disk. If you supply this function, you may return\na string that represents the final content of your file, you may process the content as you see fit. For example,\nyou may run formatters on a file, fix output in edge-cases not supported by helpers or data, etc."}),"\n",(0,i.jsxs)(s.p,{children:["If the return value of this function is ",(0,i.jsx)(s.code,{children:"undefined"}),", the original content will be used."]}),"\n",(0,i.jsx)(s.h4,{id:"parameters",children:"Parameters"}),"\n",(0,i.jsxs)(s.table,{children:[(0,i.jsx)(s.thead,{children:(0,i.jsxs)(s.tr,{children:[(0,i.jsx)(s.th,{style:{textAlign:"left"},children:"Name"}),(0,i.jsx)(s.th,{style:{textAlign:"left"},children:"Type"}),(0,i.jsx)(s.th,{style:{textAlign:"left"},children:"Description"})]})}),(0,i.jsxs)(s.tbody,{children:[(0,i.jsxs)(s.tr,{children:[(0,i.jsx)(s.td,{style:{textAlign:"left"},children:(0,i.jsx)(s.code,{children:"content"})}),(0,i.jsx)(s.td,{style:{textAlign:"left"},children:(0,i.jsx)(s.code,{children:"Buffer"})}),(0,i.jsx)(s.td,{style:{textAlign:"left"},children:"The original template after token replacement"})]}),(0,i.jsxs)(s.tr,{children:[(0,i.jsx)(s.td,{style:{textAlign:"left"},children:(0,i.jsx)(s.code,{children:"rawContent"})}),(0,i.jsx)(s.td,{style:{textAlign:"left"},children:(0,i.jsx)(s.code,{children:"Buffer"})}),(0,i.jsx)(s.td,{style:{textAlign:"left"},children:"The original template before token replacement"})]}),(0,i.jsxs)(s.tr,{children:[(0,i.jsx)(s.td,{style:{textAlign:"left"},children:(0,i.jsx)(s.code,{children:"outputPath"})}),(0,i.jsx)(s.td,{style:{textAlign:"left"},children:(0,i.jsx)(s.code,{children:"string"})}),(0,i.jsx)(s.td,{style:{textAlign:"left"},children:"The final output path of the processed file"})]})]})]}),"\n",(0,i.jsx)(s.h4,{id:"returns",children:"Returns"}),"\n",(0,i.jsxs)(s.p,{children:[(0,i.jsx)(s.code,{children:"undefined"})," | ",(0,i.jsx)(s.code,{children:"string"})," | ",(0,i.jsx)(s.code,{children:"Buffer"})," | ",(0,i.jsx)(s.code,{children:"Promise"}),"<",(0,i.jsx)(s.code,{children:"undefined"})," | ",(0,i.jsx)(s.code,{children:"string"})," | ",(0,i.jsx)(s.code,{children:"Buffer"}),">"]}),"\n",(0,i.jsxs)(s.p,{children:["The final output of the file\ncontents-only, after further modifications - or ",(0,i.jsx)(s.code,{children:"undefined"})," to use the original content (i.e. ",(0,i.jsx)(s.code,{children:"content.toString()"}),")"]}),"\n",(0,i.jsx)(s.h4,{id:"defined-in-10",children:"Defined in"}),"\n",(0,i.jsx)(s.p,{children:(0,i.jsx)(s.a,{href:"https://github.com/chenasraf/simple-scaffold/blob/bfee26f/src/types.ts#L158",children:"types.ts:158"})})]})}function a(e={}){const{wrapper:s}={...(0,l.a)(),...e.components};return s?(0,i.jsx)(s,{...e,children:(0,i.jsx)(h,{...e})}):h(e)}},8672:(e,s,n)=>{n.d(s,{Z:()=>c,a:()=>r});var i=n(959);const l={},d=i.createContext(l);function r(e){const s=i.useContext(d);return i.useMemo((function(){return"function"==typeof e?e(s):{...s,...e}}),[s,e])}function c(e){let s;return s=e.disableParentContext?"function"==typeof e.components?e.components(l):e.components||l:r(e.components),i.createElement(d.Provider,{value:s},e.children)}}}]); \ No newline at end of file diff --git a/assets/js/af0552f4.a9177571.js b/assets/js/af0552f4.a7387875.js similarity index 90% rename from assets/js/af0552f4.a9177571.js rename to assets/js/af0552f4.a7387875.js index 3e53ac8..819a57e 100644 --- a/assets/js/af0552f4.a9177571.js +++ b/assets/js/af0552f4.a7387875.js @@ -1 +1 @@ -"use strict";(self.webpackChunksimple_scaffold_docs=self.webpackChunksimple_scaffold_docs||[]).push([[158],{8898:(e,n,i)=>{i.r(n),i.d(n,{assets:()=>c,contentTitle:()=>r,default:()=>a,frontMatter:()=>l,metadata:()=>t,toc:()=>o});var s=i(1527),d=i(8672);const l={id:"ScaffoldCmdConfig",title:"Interface: ScaffoldCmdConfig",sidebar_label:"ScaffoldCmdConfig",sidebar_position:0,custom_edit_url:null},r=void 0,t={id:"api/interfaces/ScaffoldCmdConfig",title:"Interface: ScaffoldCmdConfig",description:"The Scaffold config for CLI",source:"@site/docs/api/interfaces/ScaffoldCmdConfig.md",sourceDirName:"api/interfaces",slug:"/api/interfaces/ScaffoldCmdConfig",permalink:"/simple-scaffold/docs/api/interfaces/ScaffoldCmdConfig",draft:!1,unlisted:!1,editUrl:null,tags:[],version:"current",sidebarPosition:0,frontMatter:{id:"ScaffoldCmdConfig",title:"Interface: ScaffoldCmdConfig",sidebar_label:"ScaffoldCmdConfig",sidebar_position:0,custom_edit_url:null},sidebar:"docs",previous:{title:"Exports",permalink:"/simple-scaffold/docs/api/modules"},next:{title:"ScaffoldConfig",permalink:"/simple-scaffold/docs/api/interfaces/ScaffoldConfig"}},c={},o=[{value:"Properties",id:"properties",level:2},{value:"name",id:"name",level:3},{value:"Defined in",id:"defined-in",level:4},{value:"templates",id:"templates",level:3},{value:"Defined in",id:"defined-in-1",level:4},{value:"output",id:"output",level:3},{value:"Defined in",id:"defined-in-2",level:4},{value:"subdir",id:"subdir",level:3},{value:"Defined in",id:"defined-in-3",level:4},{value:"subdirHelper",id:"subdirhelper",level:3},{value:"Defined in",id:"defined-in-4",level:4},{value:"data",id:"data",level:3},{value:"Defined in",id:"defined-in-5",level:4},{value:"appendData",id:"appenddata",level:3},{value:"Defined in",id:"defined-in-6",level:4},{value:"overwrite",id:"overwrite",level:3},{value:"Defined in",id:"defined-in-7",level:4},{value:"quiet",id:"quiet",level:3},{value:"Defined in",id:"defined-in-8",level:4},{value:"logLevel",id:"loglevel",level:3},{value:"Defined in",id:"defined-in-9",level:4},{value:"dryRun",id:"dryrun",level:3},{value:"Defined in",id:"defined-in-10",level:4},{value:"config",id:"config",level:3},{value:"Defined in",id:"defined-in-11",level:4},{value:"key",id:"key",level:3},{value:"Defined in",id:"defined-in-12",level:4},{value:"git",id:"git",level:3},{value:"Defined in",id:"defined-in-13",level:4}];function h(e){const n={a:"a",code:"code",h2:"h2",h3:"h3",h4:"h4",hr:"hr",p:"p",strong:"strong",...(0,d.a)(),...e.components};return(0,s.jsxs)(s.Fragment,{children:[(0,s.jsxs)(n.p,{children:["The Scaffold config for CLI\nContains less and more specific options than ",(0,s.jsx)(n.a,{href:"/simple-scaffold/docs/api/interfaces/ScaffoldConfig",children:"ScaffoldConfig"})]}),"\n",(0,s.jsx)(n.h2,{id:"properties",children:"Properties"}),"\n",(0,s.jsx)(n.h3,{id:"name",children:"name"}),"\n",(0,s.jsxs)(n.p,{children:["\u2022 ",(0,s.jsx)(n.strong,{children:"name"}),": ",(0,s.jsx)(n.code,{children:"string"})]}),"\n",(0,s.jsx)(n.p,{children:"The name of the scaffold template to use."}),"\n",(0,s.jsx)(n.h4,{id:"defined-in",children:"Defined in"}),"\n",(0,s.jsx)(n.p,{children:(0,s.jsx)(n.a,{href:"https://github.com/chenasraf/simple-scaffold/blob/802f43c/src/types.ts#L329",children:"types.ts:329"})}),"\n",(0,s.jsx)(n.hr,{}),"\n",(0,s.jsx)(n.h3,{id:"templates",children:"templates"}),"\n",(0,s.jsxs)(n.p,{children:["\u2022 ",(0,s.jsx)(n.strong,{children:"templates"}),": ",(0,s.jsx)(n.code,{children:"string"}),"[]"]}),"\n",(0,s.jsx)(n.p,{children:"The templates to use for generation"}),"\n",(0,s.jsx)(n.h4,{id:"defined-in-1",children:"Defined in"}),"\n",(0,s.jsx)(n.p,{children:(0,s.jsx)(n.a,{href:"https://github.com/chenasraf/simple-scaffold/blob/802f43c/src/types.ts#L331",children:"types.ts:331"})}),"\n",(0,s.jsx)(n.hr,{}),"\n",(0,s.jsx)(n.h3,{id:"output",children:"output"}),"\n",(0,s.jsxs)(n.p,{children:["\u2022 ",(0,s.jsx)(n.strong,{children:"output"}),": ",(0,s.jsx)(n.code,{children:"string"})]}),"\n",(0,s.jsx)(n.p,{children:"The output path to write to"}),"\n",(0,s.jsx)(n.h4,{id:"defined-in-2",children:"Defined in"}),"\n",(0,s.jsx)(n.p,{children:(0,s.jsx)(n.a,{href:"https://github.com/chenasraf/simple-scaffold/blob/802f43c/src/types.ts#L333",children:"types.ts:333"})}),"\n",(0,s.jsx)(n.hr,{}),"\n",(0,s.jsx)(n.h3,{id:"subdir",children:"subdir"}),"\n",(0,s.jsxs)(n.p,{children:["\u2022 ",(0,s.jsx)(n.strong,{children:"subdir"}),": ",(0,s.jsx)(n.code,{children:"boolean"})]}),"\n",(0,s.jsx)(n.p,{children:"Whether to create subfolder with the input name"}),"\n",(0,s.jsx)(n.h4,{id:"defined-in-3",children:"Defined in"}),"\n",(0,s.jsx)(n.p,{children:(0,s.jsx)(n.a,{href:"https://github.com/chenasraf/simple-scaffold/blob/802f43c/src/types.ts#L335",children:"types.ts:335"})}),"\n",(0,s.jsx)(n.hr,{}),"\n",(0,s.jsx)(n.h3,{id:"subdirhelper",children:"subdirHelper"}),"\n",(0,s.jsxs)(n.p,{children:["\u2022 ",(0,s.jsx)(n.code,{children:"Optional"})," ",(0,s.jsx)(n.strong,{children:"subdirHelper"}),": ",(0,s.jsx)(n.code,{children:"string"})]}),"\n",(0,s.jsxs)(n.p,{children:["Default transformer to apply to subfolder name when using ",(0,s.jsx)(n.code,{children:"subdir: true"})]}),"\n",(0,s.jsx)(n.h4,{id:"defined-in-4",children:"Defined in"}),"\n",(0,s.jsx)(n.p,{children:(0,s.jsx)(n.a,{href:"https://github.com/chenasraf/simple-scaffold/blob/802f43c/src/types.ts#L337",children:"types.ts:337"})}),"\n",(0,s.jsx)(n.hr,{}),"\n",(0,s.jsx)(n.h3,{id:"data",children:"data"}),"\n",(0,s.jsxs)(n.p,{children:["\u2022 ",(0,s.jsx)(n.code,{children:"Optional"})," ",(0,s.jsx)(n.strong,{children:"data"}),": ",(0,s.jsx)(n.code,{children:"Record"}),"<",(0,s.jsx)(n.code,{children:"string"}),", ",(0,s.jsx)(n.code,{children:"string"}),">"]}),"\n",(0,s.jsx)(n.p,{children:"Add custom data to the templates"}),"\n",(0,s.jsx)(n.h4,{id:"defined-in-5",children:"Defined in"}),"\n",(0,s.jsx)(n.p,{children:(0,s.jsx)(n.a,{href:"https://github.com/chenasraf/simple-scaffold/blob/802f43c/src/types.ts#L339",children:"types.ts:339"})}),"\n",(0,s.jsx)(n.hr,{}),"\n",(0,s.jsx)(n.h3,{id:"appenddata",children:"appendData"}),"\n",(0,s.jsxs)(n.p,{children:["\u2022 ",(0,s.jsx)(n.code,{children:"Optional"})," ",(0,s.jsx)(n.strong,{children:"appendData"}),": ",(0,s.jsx)(n.code,{children:"Record"}),"<",(0,s.jsx)(n.code,{children:"string"}),", ",(0,s.jsx)(n.code,{children:"string"}),">"]}),"\n",(0,s.jsx)(n.p,{children:"Add custom data to the template in a CLI-friendly syntax (and not JSON)"}),"\n",(0,s.jsx)(n.h4,{id:"defined-in-6",children:"Defined in"}),"\n",(0,s.jsx)(n.p,{children:(0,s.jsx)(n.a,{href:"https://github.com/chenasraf/simple-scaffold/blob/802f43c/src/types.ts#L341",children:"types.ts:341"})}),"\n",(0,s.jsx)(n.hr,{}),"\n",(0,s.jsx)(n.h3,{id:"overwrite",children:"overwrite"}),"\n",(0,s.jsxs)(n.p,{children:["\u2022 ",(0,s.jsx)(n.strong,{children:"overwrite"}),": ",(0,s.jsx)(n.code,{children:"boolean"})]}),"\n",(0,s.jsx)(n.p,{children:"Enable to override output files, even if they already exist"}),"\n",(0,s.jsx)(n.h4,{id:"defined-in-7",children:"Defined in"}),"\n",(0,s.jsx)(n.p,{children:(0,s.jsx)(n.a,{href:"https://github.com/chenasraf/simple-scaffold/blob/802f43c/src/types.ts#L343",children:"types.ts:343"})}),"\n",(0,s.jsx)(n.hr,{}),"\n",(0,s.jsx)(n.h3,{id:"quiet",children:"quiet"}),"\n",(0,s.jsxs)(n.p,{children:["\u2022 ",(0,s.jsx)(n.strong,{children:"quiet"}),": ",(0,s.jsx)(n.code,{children:"boolean"})]}),"\n",(0,s.jsxs)(n.p,{children:["Silence logs, same as ",(0,s.jsx)(n.code,{children:'logLevel: "none"'})]}),"\n",(0,s.jsx)(n.h4,{id:"defined-in-8",children:"Defined in"}),"\n",(0,s.jsx)(n.p,{children:(0,s.jsx)(n.a,{href:"https://github.com/chenasraf/simple-scaffold/blob/802f43c/src/types.ts#L345",children:"types.ts:345"})}),"\n",(0,s.jsx)(n.hr,{}),"\n",(0,s.jsx)(n.h3,{id:"loglevel",children:"logLevel"}),"\n",(0,s.jsxs)(n.p,{children:["\u2022 ",(0,s.jsx)(n.strong,{children:"logLevel"}),": ",(0,s.jsx)(n.a,{href:"/simple-scaffold/docs/api/modules#loglevel-1",children:(0,s.jsx)(n.code,{children:"LogLevel"})})]}),"\n",(0,s.jsx)(n.p,{children:"Determine amount of logs to display."}),"\n",(0,s.jsx)(n.p,{children:(0,s.jsx)(n.strong,{children:(0,s.jsx)(n.code,{children:"See"})})}),"\n",(0,s.jsx)(n.p,{children:(0,s.jsx)(n.a,{href:"/simple-scaffold/docs/api/modules#loglevel",children:"LogLevel"})}),"\n",(0,s.jsx)(n.h4,{id:"defined-in-9",children:"Defined in"}),"\n",(0,s.jsx)(n.p,{children:(0,s.jsx)(n.a,{href:"https://github.com/chenasraf/simple-scaffold/blob/802f43c/src/types.ts#L351",children:"types.ts:351"})}),"\n",(0,s.jsx)(n.hr,{}),"\n",(0,s.jsx)(n.h3,{id:"dryrun",children:"dryRun"}),"\n",(0,s.jsxs)(n.p,{children:["\u2022 ",(0,s.jsx)(n.strong,{children:"dryRun"}),": ",(0,s.jsx)(n.code,{children:"boolean"})]}),"\n",(0,s.jsx)(n.p,{children:"Don't emit files. This is good for testing your scaffolds and making sure they don't fail, without having to write actual file contents or create directories."}),"\n",(0,s.jsx)(n.h4,{id:"defined-in-10",children:"Defined in"}),"\n",(0,s.jsx)(n.p,{children:(0,s.jsx)(n.a,{href:"https://github.com/chenasraf/simple-scaffold/blob/802f43c/src/types.ts#L353",children:"types.ts:353"})}),"\n",(0,s.jsx)(n.hr,{}),"\n",(0,s.jsx)(n.h3,{id:"config",children:"config"}),"\n",(0,s.jsxs)(n.p,{children:["\u2022 ",(0,s.jsx)(n.code,{children:"Optional"})," ",(0,s.jsx)(n.strong,{children:"config"}),": ",(0,s.jsx)(n.code,{children:"string"})]}),"\n",(0,s.jsx)(n.p,{children:"Config file path to use"}),"\n",(0,s.jsx)(n.h4,{id:"defined-in-11",children:"Defined in"}),"\n",(0,s.jsx)(n.p,{children:(0,s.jsx)(n.a,{href:"https://github.com/chenasraf/simple-scaffold/blob/802f43c/src/types.ts#L355",children:"types.ts:355"})}),"\n",(0,s.jsx)(n.hr,{}),"\n",(0,s.jsx)(n.h3,{id:"key",children:"key"}),"\n",(0,s.jsxs)(n.p,{children:["\u2022 ",(0,s.jsx)(n.code,{children:"Optional"})," ",(0,s.jsx)(n.strong,{children:"key"}),": ",(0,s.jsx)(n.code,{children:"string"})]}),"\n",(0,s.jsx)(n.p,{children:"The key of the template to use"}),"\n",(0,s.jsx)(n.h4,{id:"defined-in-12",children:"Defined in"}),"\n",(0,s.jsx)(n.p,{children:(0,s.jsx)(n.a,{href:"https://github.com/chenasraf/simple-scaffold/blob/802f43c/src/types.ts#L357",children:"types.ts:357"})}),"\n",(0,s.jsx)(n.hr,{}),"\n",(0,s.jsx)(n.h3,{id:"git",children:"git"}),"\n",(0,s.jsxs)(n.p,{children:["\u2022 ",(0,s.jsx)(n.code,{children:"Optional"})," ",(0,s.jsx)(n.strong,{children:"git"}),": ",(0,s.jsx)(n.code,{children:"string"})]}),"\n",(0,s.jsx)(n.p,{children:"The git repository to use to fetch the config file"}),"\n",(0,s.jsx)(n.h4,{id:"defined-in-13",children:"Defined in"}),"\n",(0,s.jsx)(n.p,{children:(0,s.jsx)(n.a,{href:"https://github.com/chenasraf/simple-scaffold/blob/802f43c/src/types.ts#L359",children:"types.ts:359"})})]})}function a(e={}){const{wrapper:n}={...(0,d.a)(),...e.components};return n?(0,s.jsx)(n,{...e,children:(0,s.jsx)(h,{...e})}):h(e)}},8672:(e,n,i)=>{i.d(n,{Z:()=>t,a:()=>r});var s=i(959);const d={},l=s.createContext(d);function r(e){const n=s.useContext(l);return s.useMemo((function(){return"function"==typeof e?e(n):{...n,...e}}),[n,e])}function t(e){let n;return n=e.disableParentContext?"function"==typeof e.components?e.components(d):e.components||d:r(e.components),s.createElement(l.Provider,{value:n},e.children)}}}]); \ No newline at end of file +"use strict";(self.webpackChunksimple_scaffold_docs=self.webpackChunksimple_scaffold_docs||[]).push([[158],{8898:(e,n,i)=>{i.r(n),i.d(n,{assets:()=>c,contentTitle:()=>r,default:()=>f,frontMatter:()=>l,metadata:()=>t,toc:()=>o});var s=i(1527),d=i(8672);const l={id:"ScaffoldCmdConfig",title:"Interface: ScaffoldCmdConfig",sidebar_label:"ScaffoldCmdConfig",sidebar_position:0,custom_edit_url:null},r=void 0,t={id:"api/interfaces/ScaffoldCmdConfig",title:"Interface: ScaffoldCmdConfig",description:"The Scaffold config for CLI",source:"@site/docs/api/interfaces/ScaffoldCmdConfig.md",sourceDirName:"api/interfaces",slug:"/api/interfaces/ScaffoldCmdConfig",permalink:"/simple-scaffold/docs/api/interfaces/ScaffoldCmdConfig",draft:!1,unlisted:!1,editUrl:null,tags:[],version:"current",sidebarPosition:0,frontMatter:{id:"ScaffoldCmdConfig",title:"Interface: ScaffoldCmdConfig",sidebar_label:"ScaffoldCmdConfig",sidebar_position:0,custom_edit_url:null},sidebar:"docs",previous:{title:"Exports",permalink:"/simple-scaffold/docs/api/modules"},next:{title:"ScaffoldConfig",permalink:"/simple-scaffold/docs/api/interfaces/ScaffoldConfig"}},c={},o=[{value:"Properties",id:"properties",level:2},{value:"name",id:"name",level:3},{value:"Defined in",id:"defined-in",level:4},{value:"templates",id:"templates",level:3},{value:"Defined in",id:"defined-in-1",level:4},{value:"output",id:"output",level:3},{value:"Defined in",id:"defined-in-2",level:4},{value:"subdir",id:"subdir",level:3},{value:"Defined in",id:"defined-in-3",level:4},{value:"subdirHelper",id:"subdirhelper",level:3},{value:"Defined in",id:"defined-in-4",level:4},{value:"data",id:"data",level:3},{value:"Defined in",id:"defined-in-5",level:4},{value:"appendData",id:"appenddata",level:3},{value:"Defined in",id:"defined-in-6",level:4},{value:"overwrite",id:"overwrite",level:3},{value:"Defined in",id:"defined-in-7",level:4},{value:"quiet",id:"quiet",level:3},{value:"Defined in",id:"defined-in-8",level:4},{value:"logLevel",id:"loglevel",level:3},{value:"Defined in",id:"defined-in-9",level:4},{value:"dryRun",id:"dryrun",level:3},{value:"Defined in",id:"defined-in-10",level:4},{value:"config",id:"config",level:3},{value:"Defined in",id:"defined-in-11",level:4},{value:"key",id:"key",level:3},{value:"Defined in",id:"defined-in-12",level:4},{value:"git",id:"git",level:3},{value:"Defined in",id:"defined-in-13",level:4}];function h(e){const n={a:"a",code:"code",h2:"h2",h3:"h3",h4:"h4",hr:"hr",p:"p",strong:"strong",...(0,d.a)(),...e.components};return(0,s.jsxs)(s.Fragment,{children:[(0,s.jsxs)(n.p,{children:["The Scaffold config for CLI\nContains less and more specific options than ",(0,s.jsx)(n.a,{href:"/simple-scaffold/docs/api/interfaces/ScaffoldConfig",children:"ScaffoldConfig"})]}),"\n",(0,s.jsx)(n.h2,{id:"properties",children:"Properties"}),"\n",(0,s.jsx)(n.h3,{id:"name",children:"name"}),"\n",(0,s.jsxs)(n.p,{children:["\u2022 ",(0,s.jsx)(n.strong,{children:"name"}),": ",(0,s.jsx)(n.code,{children:"string"})]}),"\n",(0,s.jsx)(n.p,{children:"The name of the scaffold template to use."}),"\n",(0,s.jsx)(n.h4,{id:"defined-in",children:"Defined in"}),"\n",(0,s.jsx)(n.p,{children:(0,s.jsx)(n.a,{href:"https://github.com/chenasraf/simple-scaffold/blob/bfee26f/src/types.ts#L329",children:"types.ts:329"})}),"\n",(0,s.jsx)(n.hr,{}),"\n",(0,s.jsx)(n.h3,{id:"templates",children:"templates"}),"\n",(0,s.jsxs)(n.p,{children:["\u2022 ",(0,s.jsx)(n.strong,{children:"templates"}),": ",(0,s.jsx)(n.code,{children:"string"}),"[]"]}),"\n",(0,s.jsx)(n.p,{children:"The templates to use for generation"}),"\n",(0,s.jsx)(n.h4,{id:"defined-in-1",children:"Defined in"}),"\n",(0,s.jsx)(n.p,{children:(0,s.jsx)(n.a,{href:"https://github.com/chenasraf/simple-scaffold/blob/bfee26f/src/types.ts#L331",children:"types.ts:331"})}),"\n",(0,s.jsx)(n.hr,{}),"\n",(0,s.jsx)(n.h3,{id:"output",children:"output"}),"\n",(0,s.jsxs)(n.p,{children:["\u2022 ",(0,s.jsx)(n.strong,{children:"output"}),": ",(0,s.jsx)(n.code,{children:"string"})]}),"\n",(0,s.jsx)(n.p,{children:"The output path to write to"}),"\n",(0,s.jsx)(n.h4,{id:"defined-in-2",children:"Defined in"}),"\n",(0,s.jsx)(n.p,{children:(0,s.jsx)(n.a,{href:"https://github.com/chenasraf/simple-scaffold/blob/bfee26f/src/types.ts#L333",children:"types.ts:333"})}),"\n",(0,s.jsx)(n.hr,{}),"\n",(0,s.jsx)(n.h3,{id:"subdir",children:"subdir"}),"\n",(0,s.jsxs)(n.p,{children:["\u2022 ",(0,s.jsx)(n.strong,{children:"subdir"}),": ",(0,s.jsx)(n.code,{children:"boolean"})]}),"\n",(0,s.jsx)(n.p,{children:"Whether to create subfolder with the input name"}),"\n",(0,s.jsx)(n.h4,{id:"defined-in-3",children:"Defined in"}),"\n",(0,s.jsx)(n.p,{children:(0,s.jsx)(n.a,{href:"https://github.com/chenasraf/simple-scaffold/blob/bfee26f/src/types.ts#L335",children:"types.ts:335"})}),"\n",(0,s.jsx)(n.hr,{}),"\n",(0,s.jsx)(n.h3,{id:"subdirhelper",children:"subdirHelper"}),"\n",(0,s.jsxs)(n.p,{children:["\u2022 ",(0,s.jsx)(n.code,{children:"Optional"})," ",(0,s.jsx)(n.strong,{children:"subdirHelper"}),": ",(0,s.jsx)(n.code,{children:"string"})]}),"\n",(0,s.jsxs)(n.p,{children:["Default transformer to apply to subfolder name when using ",(0,s.jsx)(n.code,{children:"subdir: true"})]}),"\n",(0,s.jsx)(n.h4,{id:"defined-in-4",children:"Defined in"}),"\n",(0,s.jsx)(n.p,{children:(0,s.jsx)(n.a,{href:"https://github.com/chenasraf/simple-scaffold/blob/bfee26f/src/types.ts#L337",children:"types.ts:337"})}),"\n",(0,s.jsx)(n.hr,{}),"\n",(0,s.jsx)(n.h3,{id:"data",children:"data"}),"\n",(0,s.jsxs)(n.p,{children:["\u2022 ",(0,s.jsx)(n.code,{children:"Optional"})," ",(0,s.jsx)(n.strong,{children:"data"}),": ",(0,s.jsx)(n.code,{children:"Record"}),"<",(0,s.jsx)(n.code,{children:"string"}),", ",(0,s.jsx)(n.code,{children:"string"}),">"]}),"\n",(0,s.jsx)(n.p,{children:"Add custom data to the templates"}),"\n",(0,s.jsx)(n.h4,{id:"defined-in-5",children:"Defined in"}),"\n",(0,s.jsx)(n.p,{children:(0,s.jsx)(n.a,{href:"https://github.com/chenasraf/simple-scaffold/blob/bfee26f/src/types.ts#L339",children:"types.ts:339"})}),"\n",(0,s.jsx)(n.hr,{}),"\n",(0,s.jsx)(n.h3,{id:"appenddata",children:"appendData"}),"\n",(0,s.jsxs)(n.p,{children:["\u2022 ",(0,s.jsx)(n.code,{children:"Optional"})," ",(0,s.jsx)(n.strong,{children:"appendData"}),": ",(0,s.jsx)(n.code,{children:"Record"}),"<",(0,s.jsx)(n.code,{children:"string"}),", ",(0,s.jsx)(n.code,{children:"string"}),">"]}),"\n",(0,s.jsx)(n.p,{children:"Add custom data to the template in a CLI-friendly syntax (and not JSON)"}),"\n",(0,s.jsx)(n.h4,{id:"defined-in-6",children:"Defined in"}),"\n",(0,s.jsx)(n.p,{children:(0,s.jsx)(n.a,{href:"https://github.com/chenasraf/simple-scaffold/blob/bfee26f/src/types.ts#L341",children:"types.ts:341"})}),"\n",(0,s.jsx)(n.hr,{}),"\n",(0,s.jsx)(n.h3,{id:"overwrite",children:"overwrite"}),"\n",(0,s.jsxs)(n.p,{children:["\u2022 ",(0,s.jsx)(n.strong,{children:"overwrite"}),": ",(0,s.jsx)(n.code,{children:"boolean"})]}),"\n",(0,s.jsx)(n.p,{children:"Enable to override output files, even if they already exist"}),"\n",(0,s.jsx)(n.h4,{id:"defined-in-7",children:"Defined in"}),"\n",(0,s.jsx)(n.p,{children:(0,s.jsx)(n.a,{href:"https://github.com/chenasraf/simple-scaffold/blob/bfee26f/src/types.ts#L343",children:"types.ts:343"})}),"\n",(0,s.jsx)(n.hr,{}),"\n",(0,s.jsx)(n.h3,{id:"quiet",children:"quiet"}),"\n",(0,s.jsxs)(n.p,{children:["\u2022 ",(0,s.jsx)(n.strong,{children:"quiet"}),": ",(0,s.jsx)(n.code,{children:"boolean"})]}),"\n",(0,s.jsxs)(n.p,{children:["Silence logs, same as ",(0,s.jsx)(n.code,{children:'logLevel: "none"'})]}),"\n",(0,s.jsx)(n.h4,{id:"defined-in-8",children:"Defined in"}),"\n",(0,s.jsx)(n.p,{children:(0,s.jsx)(n.a,{href:"https://github.com/chenasraf/simple-scaffold/blob/bfee26f/src/types.ts#L345",children:"types.ts:345"})}),"\n",(0,s.jsx)(n.hr,{}),"\n",(0,s.jsx)(n.h3,{id:"loglevel",children:"logLevel"}),"\n",(0,s.jsxs)(n.p,{children:["\u2022 ",(0,s.jsx)(n.strong,{children:"logLevel"}),": ",(0,s.jsx)(n.a,{href:"/simple-scaffold/docs/api/modules#loglevel-1",children:(0,s.jsx)(n.code,{children:"LogLevel"})})]}),"\n",(0,s.jsx)(n.p,{children:"Determine amount of logs to display."}),"\n",(0,s.jsx)(n.p,{children:(0,s.jsx)(n.strong,{children:(0,s.jsx)(n.code,{children:"See"})})}),"\n",(0,s.jsx)(n.p,{children:(0,s.jsx)(n.a,{href:"/simple-scaffold/docs/api/modules#loglevel",children:"LogLevel"})}),"\n",(0,s.jsx)(n.h4,{id:"defined-in-9",children:"Defined in"}),"\n",(0,s.jsx)(n.p,{children:(0,s.jsx)(n.a,{href:"https://github.com/chenasraf/simple-scaffold/blob/bfee26f/src/types.ts#L351",children:"types.ts:351"})}),"\n",(0,s.jsx)(n.hr,{}),"\n",(0,s.jsx)(n.h3,{id:"dryrun",children:"dryRun"}),"\n",(0,s.jsxs)(n.p,{children:["\u2022 ",(0,s.jsx)(n.strong,{children:"dryRun"}),": ",(0,s.jsx)(n.code,{children:"boolean"})]}),"\n",(0,s.jsx)(n.p,{children:"Don't emit files. This is good for testing your scaffolds and making sure they don't fail, without having to write actual file contents or create directories."}),"\n",(0,s.jsx)(n.h4,{id:"defined-in-10",children:"Defined in"}),"\n",(0,s.jsx)(n.p,{children:(0,s.jsx)(n.a,{href:"https://github.com/chenasraf/simple-scaffold/blob/bfee26f/src/types.ts#L353",children:"types.ts:353"})}),"\n",(0,s.jsx)(n.hr,{}),"\n",(0,s.jsx)(n.h3,{id:"config",children:"config"}),"\n",(0,s.jsxs)(n.p,{children:["\u2022 ",(0,s.jsx)(n.code,{children:"Optional"})," ",(0,s.jsx)(n.strong,{children:"config"}),": ",(0,s.jsx)(n.code,{children:"string"})]}),"\n",(0,s.jsx)(n.p,{children:"Config file path to use"}),"\n",(0,s.jsx)(n.h4,{id:"defined-in-11",children:"Defined in"}),"\n",(0,s.jsx)(n.p,{children:(0,s.jsx)(n.a,{href:"https://github.com/chenasraf/simple-scaffold/blob/bfee26f/src/types.ts#L355",children:"types.ts:355"})}),"\n",(0,s.jsx)(n.hr,{}),"\n",(0,s.jsx)(n.h3,{id:"key",children:"key"}),"\n",(0,s.jsxs)(n.p,{children:["\u2022 ",(0,s.jsx)(n.code,{children:"Optional"})," ",(0,s.jsx)(n.strong,{children:"key"}),": ",(0,s.jsx)(n.code,{children:"string"})]}),"\n",(0,s.jsx)(n.p,{children:"The key of the template to use"}),"\n",(0,s.jsx)(n.h4,{id:"defined-in-12",children:"Defined in"}),"\n",(0,s.jsx)(n.p,{children:(0,s.jsx)(n.a,{href:"https://github.com/chenasraf/simple-scaffold/blob/bfee26f/src/types.ts#L357",children:"types.ts:357"})}),"\n",(0,s.jsx)(n.hr,{}),"\n",(0,s.jsx)(n.h3,{id:"git",children:"git"}),"\n",(0,s.jsxs)(n.p,{children:["\u2022 ",(0,s.jsx)(n.code,{children:"Optional"})," ",(0,s.jsx)(n.strong,{children:"git"}),": ",(0,s.jsx)(n.code,{children:"string"})]}),"\n",(0,s.jsx)(n.p,{children:"The git repository to use to fetch the config file"}),"\n",(0,s.jsx)(n.h4,{id:"defined-in-13",children:"Defined in"}),"\n",(0,s.jsx)(n.p,{children:(0,s.jsx)(n.a,{href:"https://github.com/chenasraf/simple-scaffold/blob/bfee26f/src/types.ts#L359",children:"types.ts:359"})})]})}function f(e={}){const{wrapper:n}={...(0,d.a)(),...e.components};return n?(0,s.jsx)(n,{...e,children:(0,s.jsx)(h,{...e})}):h(e)}},8672:(e,n,i)=>{i.d(n,{Z:()=>t,a:()=>r});var s=i(959);const d={},l=s.createContext(d);function r(e){const n=s.useContext(l);return s.useMemo((function(){return"function"==typeof e?e(n):{...n,...e}}),[n,e])}function t(e){let n;return n=e.disableParentContext?"function"==typeof e.components?e.components(d):e.components||d:r(e.components),s.createElement(l.Provider,{value:n},e.children)}}}]); \ No newline at end of file diff --git a/assets/js/dd1ef1bb.11bb3352.js b/assets/js/dd1ef1bb.11bb3352.js deleted file mode 100644 index 23825b6..0000000 --- a/assets/js/dd1ef1bb.11bb3352.js +++ /dev/null @@ -1 +0,0 @@ -"use strict";(self.webpackChunksimple_scaffold_docs=self.webpackChunksimple_scaffold_docs||[]).push([[634],{1208:(e,n,s)=>{s.r(n),s.d(n,{assets:()=>c,contentTitle:()=>t,default:()=>h,frontMatter:()=>o,metadata:()=>l,toc:()=>d});var a=s(1527),i=s(8672);const o={title:"Migration"},t=void 0,l={id:"usage/migration",title:"Migration",description:"v1.x to v2.x",source:"@site/docs/usage/migration.md",sourceDirName:"usage",slug:"/usage/migration",permalink:"/simple-scaffold/docs/usage/migration",draft:!1,unlisted:!1,editUrl:"https://github.com/facebook/docusaurus/tree/main/packages/create-docusaurus/templates/shared/docs/usage/migration.md",tags:[],version:"current",frontMatter:{title:"Migration"},sidebar:"docs",previous:{title:"Examples",permalink:"/simple-scaffold/docs/usage/examples"},next:{title:"Node.js Usage",permalink:"/simple-scaffold/docs/usage/node"}},c={},d=[{value:"v1.x to v2.x",id:"v1x-to-v2x",level:2},{value:"CLI option changes",id:"cli-option-changes",level:3},{value:"Behavior changes",id:"behavior-changes",level:3},{value:"v0.x to v1.x",id:"v0x-to-v1x",level:2},{value:"Argument changes",id:"argument-changes",level:3},{value:"Template syntax changes",id:"template-syntax-changes",level:3}];function r(e){const n={a:"a",code:"code",h2:"h2",h3:"h3",li:"li",p:"p",ul:"ul",...(0,i.a)(),...e.components};return(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(n.h2,{id:"v1x-to-v2x",children:"v1.x to v2.x"}),"\n",(0,a.jsx)(n.h3,{id:"cli-option-changes",children:"CLI option changes"}),"\n",(0,a.jsxs)(n.ul,{children:["\n",(0,a.jsxs)(n.li,{children:["Several changes to how remote configs are loaded via CLI:","\n",(0,a.jsxs)(n.ul,{children:["\n",(0,a.jsxs)(n.li,{children:["The ",(0,a.jsx)(n.code,{children:":template_key"})," syntax has been removed. You can still use ",(0,a.jsx)(n.code,{children:"-k template_key"})," to achieve the\nsame result."]}),"\n",(0,a.jsxs)(n.li,{children:["The ",(0,a.jsx)(n.code,{children:"--github"})," (",(0,a.jsx)(n.code,{children:"-gh"}),") flag has been replaced by a generic ",(0,a.jsx)(n.code,{children:"--git"})," (",(0,a.jsx)(n.code,{children:"-g"}),") one, which handles any\ngit URL. Providing a partial GitHub path will default to trying to find the project on GitHub,\ne.g. ",(0,a.jsx)(n.code,{children:"-g username/project"})]}),"\n",(0,a.jsxs)(n.li,{children:["The ",(0,a.jsx)(n.code,{children:"#template_file"})," syntax has been removed, you may use ",(0,a.jsx)(n.code,{children:"--config"})," or ",(0,a.jsx)(n.code,{children:"-c"})," to tell Simple\nScaffold which file to look for inside the git project. There is a default file priority list\nwhich can find the file for you if it is in one of the supported filenames."]}),"\n"]}),"\n"]}),"\n",(0,a.jsxs)(n.li,{children:[(0,a.jsx)(n.code,{children:"verbose"})," can now take the names ",(0,a.jsx)(n.code,{children:"debug"}),", ",(0,a.jsx)(n.code,{children:"info"}),", ",(0,a.jsx)(n.code,{children:"warn"}),", ",(0,a.jsx)(n.code,{children:"error"})," or ",(0,a.jsx)(n.code,{children:"none"})," (case insensitive) or\nas usual by using the numbering from before."]}),"\n",(0,a.jsxs)(n.li,{children:[(0,a.jsx)(n.code,{children:"--create-sub-folder"})," (",(0,a.jsx)(n.code,{children:"-s"}),") has been renamed to ",(0,a.jsx)(n.code,{children:"--subdir"})," (",(0,a.jsx)(n.code,{children:"-s"}),") in the CLI. The Node.js names\nhave been changed as well."]}),"\n",(0,a.jsxs)(n.li,{children:[(0,a.jsx)(n.code,{children:"--sub-folder-name-helper"})," (",(0,a.jsx)(n.code,{children:"-sh"}),") has been renamed to ",(0,a.jsx)(n.code,{children:"--subdir-helper"})," (",(0,a.jsx)(n.code,{children:"-sh"}),"). The Node.js\nnames have been changed as well."]}),"\n",(0,a.jsxs)(n.li,{children:["All boolean flags no longer take a value. ",(0,a.jsx)(n.code,{children:"-q"})," instead of ",(0,a.jsx)(n.code,{children:"-q 1"})," or ",(0,a.jsx)(n.code,{children:"-q true"}),", ",(0,a.jsx)(n.code,{children:"-s"})," instead of\n",(0,a.jsx)(n.code,{children:"-s 1"}),", ",(0,a.jsx)(n.code,{children:"-w"})," instead of ",(0,a.jsx)(n.code,{children:"-w 1"}),", etc."]}),"\n"]}),"\n",(0,a.jsx)(n.h3,{id:"behavior-changes",children:"Behavior changes"}),"\n",(0,a.jsxs)(n.ul,{children:["\n",(0,a.jsxs)(n.li,{children:["Data is no longer auto-populated with ",(0,a.jsx)(n.code,{children:"Name"})," (PascalCase) by default. You can just use the helper\nin your templates contents and file names, simply use ",(0,a.jsx)(n.code,{children:"{{ pascalCase name }}"})," instead of\n",(0,a.jsx)(n.code,{children:"{{ Name }}"}),". ",(0,a.jsx)(n.code,{children:"Name"})," was arbitrary and it is confusing (is it ",(0,a.jsx)(n.code,{children:"Title Case"}),"? ",(0,a.jsx)(n.code,{children:"PascalCase"}),"? only\nreading the docs can tell). Alternatively, you can inject the transformed name into your ",(0,a.jsx)(n.code,{children:"data"}),"\nmanually using a scaffold config file, by using the Node API or by appending the data to the CLI\ninvocation."]}),"\n"]}),"\n",(0,a.jsx)(n.h2,{id:"v0x-to-v1x",children:"v0.x to v1.x"}),"\n",(0,a.jsx)(n.p,{children:"In Simple Scaffold v1.0, the entire codebase was overhauled, yet usage remains mostly the same\nbetween versions. With these notable exceptions:"}),"\n",(0,a.jsxs)(n.ul,{children:["\n",(0,a.jsx)(n.li,{children:"Some of the argument names have changed"}),"\n",(0,a.jsx)(n.li,{children:"Template syntax has been improved"}),"\n",(0,a.jsxs)(n.li,{children:["The command to run Scaffold has been simplified from ",(0,a.jsx)(n.code,{children:"new SimpleScaffold(opts).run()"})," to\n",(0,a.jsx)(n.code,{children:"SimpleScaffold(opts)"}),", which now returns a promise that you can await to know when the process\nhas been completed."]}),"\n"]}),"\n",(0,a.jsx)(n.h3,{id:"argument-changes",children:"Argument changes"}),"\n",(0,a.jsxs)(n.ul,{children:["\n",(0,a.jsxs)(n.li,{children:[(0,a.jsx)(n.code,{children:"locals"})," has been renamed to ",(0,a.jsx)(n.code,{children:"data"}),". The appropriate command line args have been updated as well\nto ",(0,a.jsx)(n.code,{children:"--data"})," | ",(0,a.jsx)(n.code,{children:"-d"}),"."]}),"\n",(0,a.jsxs)(n.li,{children:["Additional options have been added to both CLI and Node interfaces. See\n",(0,a.jsx)(n.a,{href:"https://chenasraf.github.io/simple-scaffold/docs/usage/cli",children:"Command Line Interface (CLI) usage"}),"\nand ",(0,a.jsx)(n.a,{href:"https://chenasraf.github.io/simple-scaffold/docs/usage/node",children:"Node.js usage"})," for more\ninformation."]}),"\n"]}),"\n",(0,a.jsx)(n.h3,{id:"template-syntax-changes",children:"Template syntax changes"}),"\n",(0,a.jsx)(n.p,{children:"Simple Scaffold still uses Handlebars.js to handle template content and file names. However, helpers\nhave been added to remove the need for you to pre-process the template data on simple use-cases such\nas case type manipulation (converting to camel case, snake case, etc)"}),"\n",(0,a.jsx)(n.p,{children:"See the readme for the full information on how to use these helpers and which are available."})]})}function h(e={}){const{wrapper:n}={...(0,i.a)(),...e.components};return n?(0,a.jsx)(n,{...e,children:(0,a.jsx)(r,{...e})}):r(e)}},8672:(e,n,s)=>{s.d(n,{Z:()=>l,a:()=>t});var a=s(959);const i={},o=a.createContext(i);function t(e){const n=a.useContext(o);return a.useMemo((function(){return"function"==typeof e?e(n):{...n,...e}}),[n,e])}function l(e){let n;return n=e.disableParentContext?"function"==typeof e.components?e.components(i):e.components||i:t(e.components),a.createElement(o.Provider,{value:n},e.children)}}}]); \ No newline at end of file diff --git a/assets/js/dd1ef1bb.9a7f1119.js b/assets/js/dd1ef1bb.9a7f1119.js new file mode 100644 index 0000000..87a101f --- /dev/null +++ b/assets/js/dd1ef1bb.9a7f1119.js @@ -0,0 +1 @@ +"use strict";(self.webpackChunksimple_scaffold_docs=self.webpackChunksimple_scaffold_docs||[]).push([[634],{1208:(e,n,s)=>{s.r(n),s.d(n,{assets:()=>l,contentTitle:()=>t,default:()=>h,frontMatter:()=>o,metadata:()=>c,toc:()=>d});var a=s(1527),i=s(8672);const o={title:"Migration"},t=void 0,c={id:"usage/migration",title:"Migration",description:"v1.x to v2.x",source:"@site/docs/usage/migration.md",sourceDirName:"usage",slug:"/usage/migration",permalink:"/simple-scaffold/docs/usage/migration",draft:!1,unlisted:!1,editUrl:"https://github.com/facebook/docusaurus/tree/main/packages/create-docusaurus/templates/shared/docs/usage/migration.md",tags:[],version:"current",frontMatter:{title:"Migration"},sidebar:"docs",previous:{title:"Examples",permalink:"/simple-scaffold/docs/usage/examples"},next:{title:"Node.js Usage",permalink:"/simple-scaffold/docs/usage/node"}},l={},d=[{value:"v1.x to v2.x",id:"v1x-to-v2x",level:2},{value:"CLI option changes",id:"cli-option-changes",level:3},{value:"Behavior changes",id:"behavior-changes",level:3},{value:"v0.x to v1.x",id:"v0x-to-v1x",level:2},{value:"Argument changes",id:"argument-changes",level:3},{value:"Template syntax changes",id:"template-syntax-changes",level:3}];function r(e){const n={a:"a",code:"code",h2:"h2",h3:"h3",li:"li",p:"p",ul:"ul",...(0,i.a)(),...e.components};return(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(n.h2,{id:"v1x-to-v2x",children:"v1.x to v2.x"}),"\n",(0,a.jsx)(n.h3,{id:"cli-option-changes",children:"CLI option changes"}),"\n",(0,a.jsxs)(n.ul,{children:["\n",(0,a.jsxs)(n.li,{children:["Several changes to how remote configs are loaded via CLI:","\n",(0,a.jsxs)(n.ul,{children:["\n",(0,a.jsxs)(n.li,{children:["The ",(0,a.jsx)(n.code,{children:":template_key"})," syntax has been removed. You can still use ",(0,a.jsx)(n.code,{children:"-k template_key"})," to achieve the\nsame result."]}),"\n",(0,a.jsxs)(n.li,{children:["The ",(0,a.jsx)(n.code,{children:"--github"})," (",(0,a.jsx)(n.code,{children:"-gh"}),") flag has been replaced by a generic ",(0,a.jsx)(n.code,{children:"--git"})," (",(0,a.jsx)(n.code,{children:"-g"}),") one, which handles any\ngit URL. Providing a partial GitHub path will default to trying to find the project on GitHub,\ne.g. ",(0,a.jsx)(n.code,{children:"-g username/project"})]}),"\n",(0,a.jsxs)(n.li,{children:["The ",(0,a.jsx)(n.code,{children:"#template_file"})," syntax has been removed, you may use ",(0,a.jsx)(n.code,{children:"--config"})," or ",(0,a.jsx)(n.code,{children:"-c"})," to tell Simple\nScaffold which file to look for inside the git project. There is a default file priority list\nwhich can find the file for you if it is in one of the supported filenames."]}),"\n"]}),"\n"]}),"\n",(0,a.jsxs)(n.li,{children:[(0,a.jsx)(n.code,{children:"verbose"})," can now take the names ",(0,a.jsx)(n.code,{children:"debug"}),", ",(0,a.jsx)(n.code,{children:"info"}),", ",(0,a.jsx)(n.code,{children:"warn"}),", ",(0,a.jsx)(n.code,{children:"error"})," or ",(0,a.jsx)(n.code,{children:"none"})," (case insensitive)."]}),"\n",(0,a.jsxs)(n.li,{children:[(0,a.jsx)(n.code,{children:"--create-sub-folder"})," (",(0,a.jsx)(n.code,{children:"-s"}),") has been renamed to ",(0,a.jsx)(n.code,{children:"--subdir"})," (",(0,a.jsx)(n.code,{children:"-s"}),") in the CLI. The Node.js names\nhave been changed as well."]}),"\n",(0,a.jsxs)(n.li,{children:[(0,a.jsx)(n.code,{children:"--sub-folder-name-helper"})," (",(0,a.jsx)(n.code,{children:"-sh"}),") has been renamed to ",(0,a.jsx)(n.code,{children:"--subdir-helper"})," (",(0,a.jsx)(n.code,{children:"-sh"}),"). The Node.js\nnames have been changed as well."]}),"\n",(0,a.jsxs)(n.li,{children:["All boolean flags no longer take a value. ",(0,a.jsx)(n.code,{children:"-q"})," instead of ",(0,a.jsx)(n.code,{children:"-q 1"})," or ",(0,a.jsx)(n.code,{children:"-q true"}),", ",(0,a.jsx)(n.code,{children:"-s"})," instead of\n",(0,a.jsx)(n.code,{children:"-s 1"}),", ",(0,a.jsx)(n.code,{children:"-w"})," instead of ",(0,a.jsx)(n.code,{children:"-w 1"}),", etc."]}),"\n"]}),"\n",(0,a.jsx)(n.h3,{id:"behavior-changes",children:"Behavior changes"}),"\n",(0,a.jsxs)(n.ul,{children:["\n",(0,a.jsxs)(n.li,{children:["Data is no longer auto-populated with ",(0,a.jsx)(n.code,{children:"Name"})," (PascalCase) by default. You can just use the helper\nin your templates contents and file names, simply use ",(0,a.jsx)(n.code,{children:"{{ pascalCase name }}"})," instead of\n",(0,a.jsx)(n.code,{children:"{{ Name }}"}),". ",(0,a.jsx)(n.code,{children:"Name"})," was arbitrary and it is confusing (is it ",(0,a.jsx)(n.code,{children:"Title Case"}),"? ",(0,a.jsx)(n.code,{children:"PascalCase"}),"? only\nreading the docs can tell). Alternatively, you can inject the transformed name into your ",(0,a.jsx)(n.code,{children:"data"}),"\nmanually using a scaffold config file, by using the Node API or by appending the data to the CLI\ninvocation."]}),"\n"]}),"\n",(0,a.jsx)(n.h2,{id:"v0x-to-v1x",children:"v0.x to v1.x"}),"\n",(0,a.jsx)(n.p,{children:"In Simple Scaffold v1.0, the entire codebase was overhauled, yet usage remains mostly the same\nbetween versions. With these notable exceptions:"}),"\n",(0,a.jsxs)(n.ul,{children:["\n",(0,a.jsx)(n.li,{children:"Some of the argument names have changed"}),"\n",(0,a.jsx)(n.li,{children:"Template syntax has been improved"}),"\n",(0,a.jsxs)(n.li,{children:["The command to run Scaffold has been simplified from ",(0,a.jsx)(n.code,{children:"new SimpleScaffold(opts).run()"})," to\n",(0,a.jsx)(n.code,{children:"SimpleScaffold(opts)"}),", which now returns a promise that you can await to know when the process\nhas been completed."]}),"\n"]}),"\n",(0,a.jsx)(n.h3,{id:"argument-changes",children:"Argument changes"}),"\n",(0,a.jsxs)(n.ul,{children:["\n",(0,a.jsxs)(n.li,{children:[(0,a.jsx)(n.code,{children:"locals"})," has been renamed to ",(0,a.jsx)(n.code,{children:"data"}),". The appropriate command line args have been updated as well\nto ",(0,a.jsx)(n.code,{children:"--data"})," | ",(0,a.jsx)(n.code,{children:"-d"}),"."]}),"\n",(0,a.jsxs)(n.li,{children:["Additional options have been added to both CLI and Node interfaces. See\n",(0,a.jsx)(n.a,{href:"https://chenasraf.github.io/simple-scaffold/docs/usage/cli",children:"Command Line Interface (CLI) usage"}),"\nand ",(0,a.jsx)(n.a,{href:"https://chenasraf.github.io/simple-scaffold/docs/usage/node",children:"Node.js usage"})," for more\ninformation."]}),"\n"]}),"\n",(0,a.jsx)(n.h3,{id:"template-syntax-changes",children:"Template syntax changes"}),"\n",(0,a.jsx)(n.p,{children:"Simple Scaffold still uses Handlebars.js to handle template content and file names. However, helpers\nhave been added to remove the need for you to pre-process the template data on simple use-cases such\nas case type manipulation (converting to camel case, snake case, etc)"}),"\n",(0,a.jsx)(n.p,{children:"See the readme for the full information on how to use these helpers and which are available."})]})}function h(e={}){const{wrapper:n}={...(0,i.a)(),...e.components};return n?(0,a.jsx)(n,{...e,children:(0,a.jsx)(r,{...e})}):r(e)}},8672:(e,n,s)=>{s.d(n,{Z:()=>c,a:()=>t});var a=s(959);const i={},o=a.createContext(i);function t(e){const n=a.useContext(o);return a.useMemo((function(){return"function"==typeof e?e(n):{...n,...e}}),[n,e])}function c(e){let n;return n=e.disableParentContext?"function"==typeof e.components?e.components(i):e.components||i:t(e.components),a.createElement(o.Provider,{value:n},e.children)}}}]); \ No newline at end of file diff --git a/assets/js/f6aebfbf.2d2a8d1f.js b/assets/js/f6aebfbf.be876a01.js similarity index 96% rename from assets/js/f6aebfbf.2d2a8d1f.js rename to assets/js/f6aebfbf.be876a01.js index 02687df..89a2f4f 100644 --- a/assets/js/f6aebfbf.2d2a8d1f.js +++ b/assets/js/f6aebfbf.be876a01.js @@ -1 +1 @@ -"use strict";(self.webpackChunksimple_scaffold_docs=self.webpackChunksimple_scaffold_docs||[]).push([[306],{5513:(e,s,l)=>{l.r(s),l.d(s,{assets:()=>t,contentTitle:()=>r,default:()=>o,frontMatter:()=>i,metadata:()=>c,toc:()=>h});var n=l(1527),d=l(8672);const i={id:"modules",title:"simple-scaffold",sidebar_label:"Exports",sidebar_position:.5,custom_edit_url:null},r=void 0,c={id:"api/modules",title:"simple-scaffold",description:"Interfaces",source:"@site/docs/api/modules.md",sourceDirName:"api",slug:"/api/modules",permalink:"/simple-scaffold/docs/api/modules",draft:!1,unlisted:!1,editUrl:null,tags:[],version:"current",sidebarPosition:.5,frontMatter:{id:"modules",title:"simple-scaffold",sidebar_label:"Exports",sidebar_position:.5,custom_edit_url:null},sidebar:"docs",previous:{title:"Readme",permalink:"/simple-scaffold/docs/api/"},next:{title:"ScaffoldCmdConfig",permalink:"/simple-scaffold/docs/api/interfaces/ScaffoldCmdConfig"}},t={},h=[{value:"Interfaces",id:"interfaces",level:2},{value:"Main",id:"main",level:2},{value:"Scaffold",id:"scaffold",level:3},{value:"Create files",id:"create-files",level:4},{value:"Helpers",id:"helpers",level:4},{value:"Parameters",id:"parameters",level:4},{value:"Returns",id:"returns",level:4},{value:"Defined in",id:"defined-in",level:4},{value:"Config",id:"config",level:2},{value:"FileResponseHandler",id:"fileresponsehandler",level:3},{value:"Type parameters",id:"type-parameters",level:4},{value:"Type declaration",id:"type-declaration",level:4},{value:"Parameters",id:"parameters-1",level:5},{value:"Returns",id:"returns-1",level:5},{value:"Defined in",id:"defined-in-1",level:4},{value:"FileResponse",id:"fileresponse",level:3},{value:"Type parameters",id:"type-parameters-1",level:4},{value:"Defined in",id:"defined-in-2",level:4},{value:"Helpers",id:"helpers-1",level:2},{value:"CaseHelpers",id:"casehelpers",level:3},{value:"Defined in",id:"defined-in-3",level:4},{value:"DateHelpers",id:"datehelpers",level:3},{value:"Defined in",id:"defined-in-4",level:4},{value:"DefaultHelpers",id:"defaulthelpers",level:3},{value:"Defined in",id:"defined-in-5",level:4},{value:"Helper",id:"helper",level:3},{value:"Defined in",id:"defined-in-6",level:4},{value:"Logging",id:"logging",level:2},{value:"LogLevel",id:"loglevel",level:3},{value:"Defined in",id:"defined-in-7",level:4},{value:"Other",id:"other",level:2},{value:"LogLevel",id:"loglevel-1",level:3},{value:"Type declaration",id:"type-declaration-1",level:4},{value:"Defined in",id:"defined-in-8",level:4},{value:"ScaffoldConfigMap",id:"scaffoldconfigmap",level:3},{value:"Defined in",id:"defined-in-9",level:4},{value:"ScaffoldConfigFile",id:"scaffoldconfigfile",level:3},{value:"Defined in",id:"defined-in-10",level:4},{value:"default",id:"default",level:3}];function a(e){const s={a:"a",code:"code",h2:"h2",h3:"h3",h4:"h4",h5:"h5",hr:"hr",li:"li",ol:"ol",p:"p",pre:"pre",strong:"strong",table:"table",tbody:"tbody",td:"td",th:"th",thead:"thead",tr:"tr",ul:"ul",...(0,d.a)(),...e.components};return(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)(s.h2,{id:"interfaces",children:"Interfaces"}),"\n",(0,n.jsxs)(s.ul,{children:["\n",(0,n.jsx)(s.li,{children:(0,n.jsx)(s.a,{href:"/simple-scaffold/docs/api/interfaces/ScaffoldConfig",children:"ScaffoldConfig"})}),"\n",(0,n.jsx)(s.li,{children:(0,n.jsx)(s.a,{href:"/simple-scaffold/docs/api/interfaces/ScaffoldCmdConfig",children:"ScaffoldCmdConfig"})}),"\n"]}),"\n",(0,n.jsx)(s.h2,{id:"main",children:"Main"}),"\n",(0,n.jsx)(s.h3,{id:"scaffold",children:"Scaffold"}),"\n",(0,n.jsxs)(s.p,{children:["\u25b8 ",(0,n.jsx)(s.strong,{children:"Scaffold"}),"(",(0,n.jsx)(s.code,{children:"config"}),"): ",(0,n.jsx)(s.code,{children:"Promise"}),"<",(0,n.jsx)(s.code,{children:"void"}),">"]}),"\n",(0,n.jsxs)(s.p,{children:["Create a scaffold using given ",(0,n.jsx)(s.code,{children:"options"}),"."]}),"\n",(0,n.jsx)(s.h4,{id:"create-files",children:"Create files"}),"\n",(0,n.jsxs)(s.p,{children:["To create a file structure to output, use any directory and file structure you would like.\nInside folder names, file names or file contents, you may place ",(0,n.jsx)(s.code,{children:"{{ var }}"})," where ",(0,n.jsx)(s.code,{children:"var"})," is either\n",(0,n.jsx)(s.code,{children:"name"})," which is the scaffold name you provided or one of the keys you provided in the ",(0,n.jsx)(s.code,{children:"data"})," option."]}),"\n",(0,n.jsx)(s.p,{children:"The contents and names will be replaced with the transformed values so you can use your original structure as a\nboilerplate for other projects, components, modules, or even single files."}),"\n",(0,n.jsxs)(s.p,{children:["The files will maintain their structure, starting from the directory containing the template (or the template itself\nif it is already a directory), and will output from that directory into the directory defined by ",(0,n.jsx)(s.code,{children:"config.output"}),"."]}),"\n",(0,n.jsx)(s.h4,{id:"helpers",children:"Helpers"}),"\n",(0,n.jsxs)(s.p,{children:["Helpers are functions you can use to transform your ",(0,n.jsx)(s.code,{children:"{{ var }}"})," contents into other values without having to\npre-define the data and use a duplicated key."]}),"\n",(0,n.jsxs)(s.p,{children:["Any functions you provide in ",(0,n.jsx)(s.code,{children:"helpers"})," option will also be available to you to make custom formatting as you see fit\n(for example, formatting a date)"]}),"\n",(0,n.jsxs)(s.p,{children:["For available default values, see ",(0,n.jsx)(s.a,{href:"/simple-scaffold/docs/api/modules#defaulthelpers",children:"DefaultHelpers"}),"."]}),"\n",(0,n.jsx)(s.h4,{id:"parameters",children:"Parameters"}),"\n",(0,n.jsxs)(s.table,{children:[(0,n.jsx)(s.thead,{children:(0,n.jsxs)(s.tr,{children:[(0,n.jsx)(s.th,{style:{textAlign:"left"},children:"Name"}),(0,n.jsx)(s.th,{style:{textAlign:"left"},children:"Type"}),(0,n.jsx)(s.th,{style:{textAlign:"left"},children:"Description"})]})}),(0,n.jsx)(s.tbody,{children:(0,n.jsxs)(s.tr,{children:[(0,n.jsx)(s.td,{style:{textAlign:"left"},children:(0,n.jsx)(s.code,{children:"config"})}),(0,n.jsx)(s.td,{style:{textAlign:"left"},children:(0,n.jsx)(s.a,{href:"/simple-scaffold/docs/api/interfaces/ScaffoldConfig",children:(0,n.jsx)(s.code,{children:"ScaffoldConfig"})})}),(0,n.jsx)(s.td,{style:{textAlign:"left"},children:"The main configuration object"})]})})]}),"\n",(0,n.jsx)(s.h4,{id:"returns",children:"Returns"}),"\n",(0,n.jsxs)(s.p,{children:[(0,n.jsx)(s.code,{children:"Promise"}),"<",(0,n.jsx)(s.code,{children:"void"}),">"]}),"\n",(0,n.jsx)(s.p,{children:"A promise that resolves when the scaffold is complete"}),"\n",(0,n.jsx)(s.p,{children:(0,n.jsx)(s.strong,{children:(0,n.jsx)(s.code,{children:"See"})})}),"\n",(0,n.jsxs)(s.ul,{children:["\n",(0,n.jsx)(s.li,{children:(0,n.jsx)(s.a,{href:"/simple-scaffold/docs/api/modules#defaulthelpers",children:"DefaultHelpers"})}),"\n",(0,n.jsx)(s.li,{children:(0,n.jsx)(s.a,{href:"/simple-scaffold/docs/api/modules#casehelpers",children:"CaseHelpers"})}),"\n",(0,n.jsx)(s.li,{children:(0,n.jsx)(s.a,{href:"/simple-scaffold/docs/api/modules#datehelpers",children:"DateHelpers"})}),"\n"]}),"\n",(0,n.jsx)(s.h4,{id:"defined-in",children:"Defined in"}),"\n",(0,n.jsx)(s.p,{children:(0,n.jsx)(s.a,{href:"https://github.com/chenasraf/simple-scaffold/blob/802f43c/src/scaffold.ts#L57",children:"scaffold.ts:57"})}),"\n",(0,n.jsx)(s.h2,{id:"config",children:"Config"}),"\n",(0,n.jsx)(s.h3,{id:"fileresponsehandler",children:"FileResponseHandler"}),"\n",(0,n.jsxs)(s.p,{children:["\u01ac ",(0,n.jsx)(s.strong,{children:"FileResponseHandler"}),"<",(0,n.jsx)(s.code,{children:"T"}),">: (",(0,n.jsx)(s.code,{children:"fullPath"}),": ",(0,n.jsx)(s.code,{children:"string"}),", ",(0,n.jsx)(s.code,{children:"basedir"}),": ",(0,n.jsx)(s.code,{children:"string"}),", ",(0,n.jsx)(s.code,{children:"basename"}),": ",(0,n.jsx)(s.code,{children:"string"}),") => ",(0,n.jsx)(s.code,{children:"T"})]}),"\n",(0,n.jsxs)(s.p,{children:["A function that takes path information about file, and returns a value of type ",(0,n.jsx)(s.code,{children:"T"})]}),"\n",(0,n.jsx)(s.h4,{id:"type-parameters",children:"Type parameters"}),"\n",(0,n.jsxs)(s.table,{children:[(0,n.jsx)(s.thead,{children:(0,n.jsxs)(s.tr,{children:[(0,n.jsx)(s.th,{style:{textAlign:"left"},children:"Name"}),(0,n.jsx)(s.th,{style:{textAlign:"left"},children:"Description"})]})}),(0,n.jsx)(s.tbody,{children:(0,n.jsxs)(s.tr,{children:[(0,n.jsx)(s.td,{style:{textAlign:"left"},children:(0,n.jsx)(s.code,{children:"T"})}),(0,n.jsx)(s.td,{style:{textAlign:"left"},children:"The return type for the function"})]})})]}),"\n",(0,n.jsx)(s.h4,{id:"type-declaration",children:"Type declaration"}),"\n",(0,n.jsxs)(s.p,{children:["\u25b8 (",(0,n.jsx)(s.code,{children:"fullPath"}),", ",(0,n.jsx)(s.code,{children:"basedir"}),", ",(0,n.jsx)(s.code,{children:"basename"}),"): ",(0,n.jsx)(s.code,{children:"T"})]}),"\n",(0,n.jsx)(s.h5,{id:"parameters-1",children:"Parameters"}),"\n",(0,n.jsxs)(s.table,{children:[(0,n.jsx)(s.thead,{children:(0,n.jsxs)(s.tr,{children:[(0,n.jsx)(s.th,{style:{textAlign:"left"},children:"Name"}),(0,n.jsx)(s.th,{style:{textAlign:"left"},children:"Type"}),(0,n.jsx)(s.th,{style:{textAlign:"left"},children:"Description"})]})}),(0,n.jsxs)(s.tbody,{children:[(0,n.jsxs)(s.tr,{children:[(0,n.jsx)(s.td,{style:{textAlign:"left"},children:(0,n.jsx)(s.code,{children:"fullPath"})}),(0,n.jsx)(s.td,{style:{textAlign:"left"},children:(0,n.jsx)(s.code,{children:"string"})}),(0,n.jsx)(s.td,{style:{textAlign:"left"},children:"The full path of the current file"})]}),(0,n.jsxs)(s.tr,{children:[(0,n.jsx)(s.td,{style:{textAlign:"left"},children:(0,n.jsx)(s.code,{children:"basedir"})}),(0,n.jsx)(s.td,{style:{textAlign:"left"},children:(0,n.jsx)(s.code,{children:"string"})}),(0,n.jsx)(s.td,{style:{textAlign:"left"},children:"The directory containing the current file"})]}),(0,n.jsxs)(s.tr,{children:[(0,n.jsx)(s.td,{style:{textAlign:"left"},children:(0,n.jsx)(s.code,{children:"basename"})}),(0,n.jsx)(s.td,{style:{textAlign:"left"},children:(0,n.jsx)(s.code,{children:"string"})}),(0,n.jsx)(s.td,{style:{textAlign:"left"},children:"The name of the file"})]})]})]}),"\n",(0,n.jsx)(s.h5,{id:"returns-1",children:"Returns"}),"\n",(0,n.jsx)(s.p,{children:(0,n.jsx)(s.code,{children:"T"})}),"\n",(0,n.jsx)(s.h4,{id:"defined-in-1",children:"Defined in"}),"\n",(0,n.jsx)(s.p,{children:(0,n.jsx)(s.a,{href:"https://github.com/chenasraf/simple-scaffold/blob/802f43c/src/types.ts#L305",children:"types.ts:305"})}),"\n",(0,n.jsx)(s.hr,{}),"\n",(0,n.jsx)(s.h3,{id:"fileresponse",children:"FileResponse"}),"\n",(0,n.jsxs)(s.p,{children:["\u01ac ",(0,n.jsx)(s.strong,{children:"FileResponse"}),"<",(0,n.jsx)(s.code,{children:"T"}),">: ",(0,n.jsx)(s.code,{children:"T"})," | ",(0,n.jsx)(s.a,{href:"/simple-scaffold/docs/api/modules#fileresponsehandler",children:(0,n.jsx)(s.code,{children:"FileResponseHandler"})}),"<",(0,n.jsx)(s.code,{children:"T"}),">"]}),"\n",(0,n.jsx)(s.p,{children:"Represents a response for file path information.\nCan either be:"}),"\n",(0,n.jsxs)(s.ol,{children:["\n",(0,n.jsxs)(s.li,{children:[(0,n.jsx)(s.code,{children:"T"})," - static value"]}),"\n",(0,n.jsxs)(s.li,{children:["A function with the following signature which returns ",(0,n.jsx)(s.code,{children:"T"}),":","\n",(0,n.jsx)(s.pre,{children:(0,n.jsx)(s.code,{className:"language-typescript",children:"(fullPath: string, basedir: string, basename: string) => T\n"})}),"\n"]}),"\n"]}),"\n",(0,n.jsx)(s.p,{children:(0,n.jsx)(s.strong,{children:(0,n.jsx)(s.code,{children:"See"})})}),"\n",(0,n.jsx)(s.p,{children:(0,n.jsx)(s.a,{href:"/simple-scaffold/docs/api/modules#fileresponsehandler",children:"FileResponseHandler"})}),"\n",(0,n.jsx)(s.h4,{id:"type-parameters-1",children:"Type parameters"}),"\n",(0,n.jsxs)(s.table,{children:[(0,n.jsx)(s.thead,{children:(0,n.jsx)(s.tr,{children:(0,n.jsx)(s.th,{style:{textAlign:"left"},children:"Name"})})}),(0,n.jsx)(s.tbody,{children:(0,n.jsx)(s.tr,{children:(0,n.jsx)(s.td,{style:{textAlign:"left"},children:(0,n.jsx)(s.code,{children:"T"})})})})]}),"\n",(0,n.jsx)(s.h4,{id:"defined-in-2",children:"Defined in"}),"\n",(0,n.jsx)(s.p,{children:(0,n.jsx)(s.a,{href:"https://github.com/chenasraf/simple-scaffold/blob/802f43c/src/types.ts#L321",children:"types.ts:321"})}),"\n",(0,n.jsx)(s.h2,{id:"helpers-1",children:"Helpers"}),"\n",(0,n.jsx)(s.h3,{id:"casehelpers",children:"CaseHelpers"}),"\n",(0,n.jsxs)(s.p,{children:["\u01ac ",(0,n.jsx)(s.strong,{children:"CaseHelpers"}),": ",(0,n.jsx)(s.code,{children:'"camelCase"'})," | ",(0,n.jsx)(s.code,{children:'"hyphenCase"'})," | ",(0,n.jsx)(s.code,{children:'"kebabCase"'})," | ",(0,n.jsx)(s.code,{children:'"lowerCase"'})," | ",(0,n.jsx)(s.code,{children:'"pascalCase"'})," | ",(0,n.jsx)(s.code,{children:'"snakeCase"'})," | ",(0,n.jsx)(s.code,{children:'"startCase"'})," | ",(0,n.jsx)(s.code,{children:'"upperCase"'})]}),"\n",(0,n.jsx)(s.p,{children:"The names of the available helper functions that relate to text capitalization."}),"\n",(0,n.jsxs)(s.p,{children:["These are available for ",(0,n.jsx)(s.code,{children:"subfolderNameHelper"}),"."]}),"\n",(0,n.jsxs)(s.table,{children:[(0,n.jsx)(s.thead,{children:(0,n.jsxs)(s.tr,{children:[(0,n.jsx)(s.th,{children:"Helper name"}),(0,n.jsx)(s.th,{children:"Example code"}),(0,n.jsx)(s.th,{children:"Example output"})]})}),(0,n.jsxs)(s.tbody,{children:[(0,n.jsxs)(s.tr,{children:[(0,n.jsx)(s.td,{children:"[None]"}),(0,n.jsx)(s.td,{children:(0,n.jsx)(s.code,{children:"{{ name }}"})}),(0,n.jsx)(s.td,{children:"my name"})]}),(0,n.jsxs)(s.tr,{children:[(0,n.jsx)(s.td,{children:(0,n.jsx)(s.code,{children:"camelCase"})}),(0,n.jsx)(s.td,{children:(0,n.jsx)(s.code,{children:"{{ camelCase name }}"})}),(0,n.jsx)(s.td,{children:"myName"})]}),(0,n.jsxs)(s.tr,{children:[(0,n.jsx)(s.td,{children:(0,n.jsx)(s.code,{children:"snakeCase"})}),(0,n.jsx)(s.td,{children:(0,n.jsx)(s.code,{children:"{{ snakeCase name }}"})}),(0,n.jsx)(s.td,{children:"my_name"})]}),(0,n.jsxs)(s.tr,{children:[(0,n.jsx)(s.td,{children:(0,n.jsx)(s.code,{children:"startCase"})}),(0,n.jsx)(s.td,{children:(0,n.jsx)(s.code,{children:"{{ startCase name }}"})}),(0,n.jsx)(s.td,{children:"My Name"})]}),(0,n.jsxs)(s.tr,{children:[(0,n.jsx)(s.td,{children:(0,n.jsx)(s.code,{children:"kebabCase"})}),(0,n.jsx)(s.td,{children:(0,n.jsx)(s.code,{children:"{{ kebabCase name }}"})}),(0,n.jsx)(s.td,{children:"my-name"})]}),(0,n.jsxs)(s.tr,{children:[(0,n.jsx)(s.td,{children:(0,n.jsx)(s.code,{children:"hyphenCase"})}),(0,n.jsx)(s.td,{children:(0,n.jsx)(s.code,{children:"{{ hyphenCase name }}"})}),(0,n.jsx)(s.td,{children:"my-name"})]}),(0,n.jsxs)(s.tr,{children:[(0,n.jsx)(s.td,{children:(0,n.jsx)(s.code,{children:"pascalCase"})}),(0,n.jsx)(s.td,{children:(0,n.jsx)(s.code,{children:"{{ pascalCase name }}"})}),(0,n.jsx)(s.td,{children:"MyName"})]}),(0,n.jsxs)(s.tr,{children:[(0,n.jsx)(s.td,{children:(0,n.jsx)(s.code,{children:"upperCase"})}),(0,n.jsx)(s.td,{children:(0,n.jsx)(s.code,{children:"{{ upperCase name }}"})}),(0,n.jsx)(s.td,{children:"MY NAME"})]}),(0,n.jsxs)(s.tr,{children:[(0,n.jsx)(s.td,{children:(0,n.jsx)(s.code,{children:"lowerCase"})}),(0,n.jsx)(s.td,{children:(0,n.jsx)(s.code,{children:"{{ lowerCase name }}"})}),(0,n.jsx)(s.td,{children:"my name"})]})]})]}),"\n",(0,n.jsx)(s.p,{children:(0,n.jsx)(s.strong,{children:(0,n.jsx)(s.code,{children:"See"})})}),"\n",(0,n.jsxs)(s.ul,{children:["\n",(0,n.jsx)(s.li,{children:(0,n.jsx)(s.a,{href:"/simple-scaffold/docs/api/modules#defaulthelpers",children:"DefaultHelpers"})}),"\n",(0,n.jsx)(s.li,{children:(0,n.jsx)(s.a,{href:"/simple-scaffold/docs/api/modules#datehelpers",children:"DateHelpers"})}),"\n",(0,n.jsx)(s.li,{children:(0,n.jsx)(s.a,{href:"/simple-scaffold/docs/api/interfaces/ScaffoldConfig",children:"ScaffoldConfig"})}),"\n",(0,n.jsx)(s.li,{children:(0,n.jsx)(s.a,{href:"/simple-scaffold/docs/api/interfaces/ScaffoldConfig#subdirhelper",children:"ScaffoldConfig.subdirHelper"})}),"\n"]}),"\n",(0,n.jsx)(s.h4,{id:"defined-in-3",children:"Defined in"}),"\n",(0,n.jsx)(s.p,{children:(0,n.jsx)(s.a,{href:"https://github.com/chenasraf/simple-scaffold/blob/802f43c/src/types.ts#L189",children:"types.ts:189"})}),"\n",(0,n.jsx)(s.hr,{}),"\n",(0,n.jsx)(s.h3,{id:"datehelpers",children:"DateHelpers"}),"\n",(0,n.jsxs)(s.p,{children:["\u01ac ",(0,n.jsx)(s.strong,{children:"DateHelpers"}),": ",(0,n.jsx)(s.code,{children:'"date"'})," | ",(0,n.jsx)(s.code,{children:'"now"'})]}),"\n",(0,n.jsx)(s.p,{children:"The names of the available helper functions that relate to dates."}),"\n",(0,n.jsxs)(s.table,{children:[(0,n.jsx)(s.thead,{children:(0,n.jsxs)(s.tr,{children:[(0,n.jsx)(s.th,{children:"Helper name"}),(0,n.jsx)(s.th,{children:"Description"}),(0,n.jsx)(s.th,{children:"Example code"}),(0,n.jsx)(s.th,{children:"Example output"})]})}),(0,n.jsxs)(s.tbody,{children:[(0,n.jsxs)(s.tr,{children:[(0,n.jsx)(s.td,{children:(0,n.jsx)(s.code,{children:"now"})}),(0,n.jsx)(s.td,{children:"Current date with format"}),(0,n.jsx)(s.td,{children:(0,n.jsx)(s.code,{children:'{{ now "yyyy-MM-dd HH:mm" }}'})}),(0,n.jsx)(s.td,{children:(0,n.jsx)(s.code,{children:"2042-01-01 15:00"})})]}),(0,n.jsxs)(s.tr,{children:[(0,n.jsxs)(s.td,{children:[(0,n.jsx)(s.code,{children:"now"})," (with offset)"]}),(0,n.jsx)(s.td,{children:"Current date with format, and with offset"}),(0,n.jsx)(s.td,{children:(0,n.jsx)(s.code,{children:'{{ now "yyyy-MM-dd HH:mm" -1 "hours" }}'})}),(0,n.jsx)(s.td,{children:(0,n.jsx)(s.code,{children:"2042-01-01 14:00"})})]}),(0,n.jsxs)(s.tr,{children:[(0,n.jsx)(s.td,{children:(0,n.jsx)(s.code,{children:"date"})}),(0,n.jsx)(s.td,{children:"Custom date with format"}),(0,n.jsx)(s.td,{children:(0,n.jsx)(s.code,{children:'{{ date "2042-01-01T15:00:00Z" "yyyy-MM-dd HH:mm" }}'})}),(0,n.jsx)(s.td,{children:(0,n.jsx)(s.code,{children:"2042-01-01 15:00"})})]}),(0,n.jsxs)(s.tr,{children:[(0,n.jsxs)(s.td,{children:[(0,n.jsx)(s.code,{children:"date"})," (with offset)"]}),(0,n.jsx)(s.td,{children:"Custom date with format, and with offset"}),(0,n.jsx)(s.td,{children:(0,n.jsx)(s.code,{children:'{{ date "2042-01-01T15:00:00Z" "yyyy-MM-dd HH:mm" -1 "days" }}'})}),(0,n.jsx)(s.td,{children:(0,n.jsx)(s.code,{children:"2041-31-12 15:00"})})]}),(0,n.jsxs)(s.tr,{children:[(0,n.jsxs)(s.td,{children:[(0,n.jsx)(s.code,{children:"date"})," (with date from ",(0,n.jsx)(s.code,{children:"--data"}),")"]}),(0,n.jsxs)(s.td,{children:["Custom date with format, with data from the ",(0,n.jsx)(s.code,{children:"data"})," config option"]}),(0,n.jsx)(s.td,{children:(0,n.jsx)(s.code,{children:'{{ date myCustomDate "yyyy-MM-dd HH:mm" }}'})}),(0,n.jsx)(s.td,{children:(0,n.jsx)(s.code,{children:"2042-01-01 12:00"})})]})]})]}),"\n",(0,n.jsx)(s.p,{children:"Further details:"}),"\n",(0,n.jsxs)(s.ul,{children:["\n",(0,n.jsxs)(s.li,{children:["\n",(0,n.jsxs)(s.p,{children:["We use ",(0,n.jsx)(s.a,{href:"https://date-fns.org/docs/",children:(0,n.jsx)(s.code,{children:"date-fns"})})," for parsing/manipulating the dates. If you want\nmore information on the date tokens to use, refer to\n",(0,n.jsx)(s.a,{href:"https://date-fns.org/docs/format",children:"their format documentation"}),"."]}),"\n"]}),"\n",(0,n.jsxs)(s.li,{children:["\n",(0,n.jsx)(s.p,{children:"The date helper format takes the following arguments:"}),"\n",(0,n.jsx)(s.pre,{children:(0,n.jsx)(s.code,{className:"language-typescript",children:'(\n date: string,\n format: string,\n offsetAmount?: number,\n offsetType?: "years" | "months" | "weeks" | "days" | "hours" | "minutes" | "seconds"\n)\n'})}),"\n"]}),"\n",(0,n.jsxs)(s.li,{children:["\n",(0,n.jsxs)(s.p,{children:[(0,n.jsx)(s.strong,{children:"The now helper"})," (for current time) takes the same arguments, minus the first one (",(0,n.jsx)(s.code,{children:"date"}),") as it is implicitly\nthe current date."]}),"\n"]}),"\n"]}),"\n",(0,n.jsx)(s.p,{children:(0,n.jsx)(s.strong,{children:(0,n.jsx)(s.code,{children:"See"})})}),"\n",(0,n.jsxs)(s.ul,{children:["\n",(0,n.jsx)(s.li,{children:(0,n.jsx)(s.a,{href:"/simple-scaffold/docs/api/modules#defaulthelpers",children:"DefaultHelpers"})}),"\n",(0,n.jsx)(s.li,{children:(0,n.jsx)(s.a,{href:"/simple-scaffold/docs/api/modules#casehelpers",children:"CaseHelpers"})}),"\n",(0,n.jsx)(s.li,{children:(0,n.jsx)(s.a,{href:"/simple-scaffold/docs/api/interfaces/ScaffoldConfig",children:"ScaffoldConfig"})}),"\n"]}),"\n",(0,n.jsx)(s.h4,{id:"defined-in-4",children:"Defined in"}),"\n",(0,n.jsx)(s.p,{children:(0,n.jsx)(s.a,{href:"https://github.com/chenasraf/simple-scaffold/blob/802f43c/src/types.ts#L236",children:"types.ts:236"})}),"\n",(0,n.jsx)(s.hr,{}),"\n",(0,n.jsx)(s.h3,{id:"defaulthelpers",children:"DefaultHelpers"}),"\n",(0,n.jsxs)(s.p,{children:["\u01ac ",(0,n.jsx)(s.strong,{children:"DefaultHelpers"}),": ",(0,n.jsx)(s.a,{href:"/simple-scaffold/docs/api/modules#casehelpers",children:(0,n.jsx)(s.code,{children:"CaseHelpers"})})," | ",(0,n.jsx)(s.a,{href:"/simple-scaffold/docs/api/modules#datehelpers",children:(0,n.jsx)(s.code,{children:"DateHelpers"})})]}),"\n",(0,n.jsx)(s.p,{children:"The names of all the available helper functions in templates.\nSimple-Scaffold provides some built-in text transformation filters usable by Handlebars.js."}),"\n",(0,n.jsxs)(s.p,{children:["For example, you may use ",(0,n.jsx)(s.code,{children:"{{ snakeCase name }}"})," inside a template file or filename, and it will\nreplace ",(0,n.jsx)(s.code,{children:"My Name"})," with ",(0,n.jsx)(s.code,{children:"my_name"})," when producing the final value."]}),"\n",(0,n.jsx)(s.p,{children:(0,n.jsx)(s.strong,{children:(0,n.jsx)(s.code,{children:"See"})})}),"\n",(0,n.jsxs)(s.ul,{children:["\n",(0,n.jsx)(s.li,{children:(0,n.jsx)(s.a,{href:"/simple-scaffold/docs/api/modules#casehelpers",children:"CaseHelpers"})}),"\n",(0,n.jsx)(s.li,{children:(0,n.jsx)(s.a,{href:"/simple-scaffold/docs/api/modules#datehelpers",children:"DateHelpers"})}),"\n",(0,n.jsx)(s.li,{children:(0,n.jsx)(s.a,{href:"/simple-scaffold/docs/api/interfaces/ScaffoldConfig",children:"ScaffoldConfig"})}),"\n"]}),"\n",(0,n.jsx)(s.h4,{id:"defined-in-5",children:"Defined in"}),"\n",(0,n.jsx)(s.p,{children:(0,n.jsx)(s.a,{href:"https://github.com/chenasraf/simple-scaffold/blob/802f43c/src/types.ts#L251",children:"types.ts:251"})}),"\n",(0,n.jsx)(s.hr,{}),"\n",(0,n.jsx)(s.h3,{id:"helper",children:"Helper"}),"\n",(0,n.jsxs)(s.p,{children:["\u01ac ",(0,n.jsx)(s.strong,{children:"Helper"}),": ",(0,n.jsx)(s.code,{children:"HelperDelegate"})]}),"\n",(0,n.jsxs)(s.p,{children:["Helper function, see ",(0,n.jsx)(s.a,{href:"https://handlebarsjs.com/guide/#custom-helpers",children:"https://handlebarsjs.com/guide/#custom-helpers"})]}),"\n",(0,n.jsx)(s.h4,{id:"defined-in-6",children:"Defined in"}),"\n",(0,n.jsx)(s.p,{children:(0,n.jsx)(s.a,{href:"https://github.com/chenasraf/simple-scaffold/blob/802f43c/src/types.ts#L258",children:"types.ts:258"})}),"\n",(0,n.jsx)(s.h2,{id:"logging",children:"Logging"}),"\n",(0,n.jsx)(s.h3,{id:"loglevel",children:"LogLevel"}),"\n",(0,n.jsxs)(s.p,{children:["\u01ac ",(0,n.jsx)(s.strong,{children:"LogLevel"}),": typeof ",(0,n.jsx)(s.a,{href:"/simple-scaffold/docs/api/modules#loglevel",children:(0,n.jsx)(s.code,{children:"LogLevel"})}),"[keyof typeof ",(0,n.jsx)(s.a,{href:"/simple-scaffold/docs/api/modules#loglevel",children:(0,n.jsx)(s.code,{children:"LogLevel"})}),"]"]}),"\n",(0,n.jsxs)(s.p,{children:["The amount of information to log when generating scaffold.\nWhen not ",(0,n.jsx)(s.code,{children:"None"}),", the selected level will be the lowest level included."]}),"\n",(0,n.jsxs)(s.p,{children:["For example, level ",(0,n.jsx)(s.code,{children:"Info"})," (2) will include ",(0,n.jsx)(s.code,{children:"Info"}),", ",(0,n.jsx)(s.code,{children:"Warning"})," and ",(0,n.jsx)(s.code,{children:"Error"}),", but not ",(0,n.jsx)(s.code,{children:"Debug"}),"; and ",(0,n.jsx)(s.code,{children:"Warning"})," will only\nshow ",(0,n.jsx)(s.code,{children:"Warning"})," and ",(0,n.jsx)(s.code,{children:"Error"}),"."]}),"\n",(0,n.jsxs)(s.p,{children:["You may use either the number or the name of the level.\nFor example, ",(0,n.jsx)(s.code,{children:"2"})," or ",(0,n.jsx)(s.code,{children:"info"})," are both valid."]}),"\n",(0,n.jsx)(s.p,{children:(0,n.jsx)(s.strong,{children:(0,n.jsx)(s.code,{children:"Default"})})}),"\n",(0,n.jsx)(s.p,{children:(0,n.jsx)(s.code,{children:"2 (info)"})}),"\n",(0,n.jsx)(s.h4,{id:"defined-in-7",children:"Defined in"}),"\n",(0,n.jsx)(s.p,{children:(0,n.jsx)(s.a,{href:"https://github.com/chenasraf/simple-scaffold/blob/802f43c/src/types.ts#L260",children:"types.ts:260"})}),"\n",(0,n.jsx)(s.p,{children:(0,n.jsx)(s.a,{href:"https://github.com/chenasraf/simple-scaffold/blob/802f43c/src/types.ts#L291",children:"types.ts:291"})}),"\n",(0,n.jsx)(s.h2,{id:"other",children:"Other"}),"\n",(0,n.jsx)(s.h3,{id:"loglevel-1",children:"LogLevel"}),"\n",(0,n.jsxs)(s.p,{children:["\u2022 ",(0,n.jsx)(s.code,{children:"Const"})," ",(0,n.jsx)(s.strong,{children:"LogLevel"}),": ",(0,n.jsx)(s.code,{children:"Object"})]}),"\n",(0,n.jsx)(s.h4,{id:"type-declaration-1",children:"Type declaration"}),"\n",(0,n.jsxs)(s.table,{children:[(0,n.jsx)(s.thead,{children:(0,n.jsxs)(s.tr,{children:[(0,n.jsx)(s.th,{style:{textAlign:"left"},children:"Name"}),(0,n.jsx)(s.th,{style:{textAlign:"left"},children:"Type"}),(0,n.jsx)(s.th,{style:{textAlign:"left"},children:"Description"})]})}),(0,n.jsxs)(s.tbody,{children:[(0,n.jsxs)(s.tr,{children:[(0,n.jsx)(s.td,{style:{textAlign:"left"},children:(0,n.jsx)(s.code,{children:"none"})}),(0,n.jsx)(s.td,{style:{textAlign:"left"},children:(0,n.jsx)(s.code,{children:'"none"'})}),(0,n.jsx)(s.td,{style:{textAlign:"left"},children:"Silent output"})]}),(0,n.jsxs)(s.tr,{children:[(0,n.jsx)(s.td,{style:{textAlign:"left"},children:(0,n.jsx)(s.code,{children:"debug"})}),(0,n.jsx)(s.td,{style:{textAlign:"left"},children:(0,n.jsx)(s.code,{children:'"debug"'})}),(0,n.jsx)(s.td,{style:{textAlign:"left"},children:"Debugging information. Very verbose and only recommended for troubleshooting."})]}),(0,n.jsxs)(s.tr,{children:[(0,n.jsx)(s.td,{style:{textAlign:"left"},children:(0,n.jsx)(s.code,{children:"info"})}),(0,n.jsx)(s.td,{style:{textAlign:"left"},children:(0,n.jsx)(s.code,{children:'"info"'})}),(0,n.jsxs)(s.td,{style:{textAlign:"left"},children:["The regular level of logging. Major actions are logged to show the scaffold progress. ",(0,n.jsx)(s.strong,{children:(0,n.jsx)(s.code,{children:"Default"})})," ",(0,n.jsx)(s.code,{children:"ts "})]})]}),(0,n.jsxs)(s.tr,{children:[(0,n.jsx)(s.td,{style:{textAlign:"left"},children:(0,n.jsx)(s.code,{children:"warning"})}),(0,n.jsx)(s.td,{style:{textAlign:"left"},children:(0,n.jsx)(s.code,{children:'"warning"'})}),(0,n.jsx)(s.td,{style:{textAlign:"left"},children:"Warnings such as when file fails to replace token values properly in template."})]}),(0,n.jsxs)(s.tr,{children:[(0,n.jsx)(s.td,{style:{textAlign:"left"},children:(0,n.jsx)(s.code,{children:"error"})}),(0,n.jsx)(s.td,{style:{textAlign:"left"},children:(0,n.jsx)(s.code,{children:'"error"'})}),(0,n.jsx)(s.td,{style:{textAlign:"left"},children:"Errors, such as missing files, bad replacement token syntax, or un-writable directories."})]})]})]}),"\n",(0,n.jsx)(s.h4,{id:"defined-in-8",children:"Defined in"}),"\n",(0,n.jsx)(s.p,{children:(0,n.jsx)(s.a,{href:"https://github.com/chenasraf/simple-scaffold/blob/802f43c/src/types.ts#L260",children:"types.ts:260"})}),"\n",(0,n.jsx)(s.p,{children:(0,n.jsx)(s.a,{href:"https://github.com/chenasraf/simple-scaffold/blob/802f43c/src/types.ts#L291",children:"types.ts:291"})}),"\n",(0,n.jsx)(s.hr,{}),"\n",(0,n.jsx)(s.h3,{id:"scaffoldconfigmap",children:"ScaffoldConfigMap"}),"\n",(0,n.jsxs)(s.p,{children:["\u01ac ",(0,n.jsx)(s.strong,{children:"ScaffoldConfigMap"}),": ",(0,n.jsx)(s.code,{children:"Record"}),"<",(0,n.jsx)(s.code,{children:"string"}),", ",(0,n.jsx)(s.a,{href:"/simple-scaffold/docs/api/interfaces/ScaffoldConfig",children:(0,n.jsx)(s.code,{children:"ScaffoldConfig"})}),">"]}),"\n",(0,n.jsx)(s.p,{children:"A mapping of scaffold template keys to their configurations."}),"\n",(0,n.jsxs)(s.p,{children:["Each configuration is a ",(0,n.jsx)(s.a,{href:"/simple-scaffold/docs/api/interfaces/ScaffoldConfig",children:"ScaffoldConfig"})," object."]}),"\n",(0,n.jsx)(s.p,{children:"The key is the name of the template, and the value is the configuration for that template."}),"\n",(0,n.jsx)(s.p,{children:'When no template key is provided to the scaffold command, the "default" template is used.'}),"\n",(0,n.jsx)(s.p,{children:(0,n.jsx)(s.strong,{children:(0,n.jsx)(s.code,{children:"See"})})}),"\n",(0,n.jsx)(s.p,{children:(0,n.jsx)(s.a,{href:"/simple-scaffold/docs/api/interfaces/ScaffoldConfig",children:"ScaffoldConfig"})}),"\n",(0,n.jsx)(s.h4,{id:"defined-in-9",children:"Defined in"}),"\n",(0,n.jsx)(s.p,{children:(0,n.jsx)(s.a,{href:"https://github.com/chenasraf/simple-scaffold/blob/802f43c/src/types.ts#L373",children:"types.ts:373"})}),"\n",(0,n.jsx)(s.hr,{}),"\n",(0,n.jsx)(s.h3,{id:"scaffoldconfigfile",children:"ScaffoldConfigFile"}),"\n",(0,n.jsxs)(s.p,{children:["\u01ac ",(0,n.jsx)(s.strong,{children:"ScaffoldConfigFile"}),": ",(0,n.jsx)(s.code,{children:"AsyncResolver"}),"<",(0,n.jsx)(s.a,{href:"/simple-scaffold/docs/api/interfaces/ScaffoldCmdConfig",children:(0,n.jsx)(s.code,{children:"ScaffoldCmdConfig"})}),", ",(0,n.jsx)(s.a,{href:"/simple-scaffold/docs/api/modules#scaffoldconfigmap",children:(0,n.jsx)(s.code,{children:"ScaffoldConfigMap"})}),">"]}),"\n",(0,n.jsx)(s.p,{children:"The scaffold config file is either:"}),"\n",(0,n.jsxs)(s.ul,{children:["\n",(0,n.jsxs)(s.li,{children:["A ",(0,n.jsx)(s.a,{href:"/simple-scaffold/docs/api/modules#scaffoldconfigmap",children:"ScaffoldConfigMap"})," object"]}),"\n",(0,n.jsxs)(s.li,{children:["A function that returns a ",(0,n.jsx)(s.a,{href:"/simple-scaffold/docs/api/modules#scaffoldconfigmap",children:"ScaffoldConfigMap"})," object"]}),"\n",(0,n.jsxs)(s.li,{children:["A promise that resolves to a ",(0,n.jsx)(s.a,{href:"/simple-scaffold/docs/api/modules#scaffoldconfigmap",children:"ScaffoldConfigMap"})," object"]}),"\n",(0,n.jsxs)(s.li,{children:["A function that returns a promise that resolves to a ",(0,n.jsx)(s.a,{href:"/simple-scaffold/docs/api/modules#scaffoldconfigmap",children:"ScaffoldConfigMap"})," object"]}),"\n"]}),"\n",(0,n.jsx)(s.h4,{id:"defined-in-10",children:"Defined in"}),"\n",(0,n.jsx)(s.p,{children:(0,n.jsx)(s.a,{href:"https://github.com/chenasraf/simple-scaffold/blob/802f43c/src/types.ts#L381",children:"types.ts:381"})}),"\n",(0,n.jsx)(s.hr,{}),"\n",(0,n.jsx)(s.h3,{id:"default",children:"default"}),"\n",(0,n.jsxs)(s.p,{children:["Renames and re-exports ",(0,n.jsx)(s.a,{href:"/simple-scaffold/docs/api/modules#scaffold",children:"Scaffold"})]})]})}function o(e={}){const{wrapper:s}={...(0,d.a)(),...e.components};return s?(0,n.jsx)(s,{...e,children:(0,n.jsx)(a,{...e})}):a(e)}},8672:(e,s,l)=>{l.d(s,{Z:()=>c,a:()=>r});var n=l(959);const d={},i=n.createContext(d);function r(e){const s=n.useContext(i);return n.useMemo((function(){return"function"==typeof e?e(s):{...s,...e}}),[s,e])}function c(e){let s;return s=e.disableParentContext?"function"==typeof e.components?e.components(d):e.components||d:r(e.components),n.createElement(i.Provider,{value:s},e.children)}}}]); \ No newline at end of file +"use strict";(self.webpackChunksimple_scaffold_docs=self.webpackChunksimple_scaffold_docs||[]).push([[306],{5513:(e,s,l)=>{l.r(s),l.d(s,{assets:()=>t,contentTitle:()=>r,default:()=>o,frontMatter:()=>i,metadata:()=>c,toc:()=>h});var n=l(1527),d=l(8672);const i={id:"modules",title:"simple-scaffold",sidebar_label:"Exports",sidebar_position:.5,custom_edit_url:null},r=void 0,c={id:"api/modules",title:"simple-scaffold",description:"Interfaces",source:"@site/docs/api/modules.md",sourceDirName:"api",slug:"/api/modules",permalink:"/simple-scaffold/docs/api/modules",draft:!1,unlisted:!1,editUrl:null,tags:[],version:"current",sidebarPosition:.5,frontMatter:{id:"modules",title:"simple-scaffold",sidebar_label:"Exports",sidebar_position:.5,custom_edit_url:null},sidebar:"docs",previous:{title:"Readme",permalink:"/simple-scaffold/docs/api/"},next:{title:"ScaffoldCmdConfig",permalink:"/simple-scaffold/docs/api/interfaces/ScaffoldCmdConfig"}},t={},h=[{value:"Interfaces",id:"interfaces",level:2},{value:"Main",id:"main",level:2},{value:"Scaffold",id:"scaffold",level:3},{value:"Create files",id:"create-files",level:4},{value:"Helpers",id:"helpers",level:4},{value:"Parameters",id:"parameters",level:4},{value:"Returns",id:"returns",level:4},{value:"Defined in",id:"defined-in",level:4},{value:"Config",id:"config",level:2},{value:"FileResponseHandler",id:"fileresponsehandler",level:3},{value:"Type parameters",id:"type-parameters",level:4},{value:"Type declaration",id:"type-declaration",level:4},{value:"Parameters",id:"parameters-1",level:5},{value:"Returns",id:"returns-1",level:5},{value:"Defined in",id:"defined-in-1",level:4},{value:"FileResponse",id:"fileresponse",level:3},{value:"Type parameters",id:"type-parameters-1",level:4},{value:"Defined in",id:"defined-in-2",level:4},{value:"Helpers",id:"helpers-1",level:2},{value:"CaseHelpers",id:"casehelpers",level:3},{value:"Defined in",id:"defined-in-3",level:4},{value:"DateHelpers",id:"datehelpers",level:3},{value:"Defined in",id:"defined-in-4",level:4},{value:"DefaultHelpers",id:"defaulthelpers",level:3},{value:"Defined in",id:"defined-in-5",level:4},{value:"Helper",id:"helper",level:3},{value:"Defined in",id:"defined-in-6",level:4},{value:"Logging",id:"logging",level:2},{value:"LogLevel",id:"loglevel",level:3},{value:"Defined in",id:"defined-in-7",level:4},{value:"Other",id:"other",level:2},{value:"LogLevel",id:"loglevel-1",level:3},{value:"Type declaration",id:"type-declaration-1",level:4},{value:"Defined in",id:"defined-in-8",level:4},{value:"ScaffoldConfigMap",id:"scaffoldconfigmap",level:3},{value:"Defined in",id:"defined-in-9",level:4},{value:"ScaffoldConfigFile",id:"scaffoldconfigfile",level:3},{value:"Defined in",id:"defined-in-10",level:4},{value:"default",id:"default",level:3}];function a(e){const s={a:"a",code:"code",h2:"h2",h3:"h3",h4:"h4",h5:"h5",hr:"hr",li:"li",ol:"ol",p:"p",pre:"pre",strong:"strong",table:"table",tbody:"tbody",td:"td",th:"th",thead:"thead",tr:"tr",ul:"ul",...(0,d.a)(),...e.components};return(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)(s.h2,{id:"interfaces",children:"Interfaces"}),"\n",(0,n.jsxs)(s.ul,{children:["\n",(0,n.jsx)(s.li,{children:(0,n.jsx)(s.a,{href:"/simple-scaffold/docs/api/interfaces/ScaffoldConfig",children:"ScaffoldConfig"})}),"\n",(0,n.jsx)(s.li,{children:(0,n.jsx)(s.a,{href:"/simple-scaffold/docs/api/interfaces/ScaffoldCmdConfig",children:"ScaffoldCmdConfig"})}),"\n"]}),"\n",(0,n.jsx)(s.h2,{id:"main",children:"Main"}),"\n",(0,n.jsx)(s.h3,{id:"scaffold",children:"Scaffold"}),"\n",(0,n.jsxs)(s.p,{children:["\u25b8 ",(0,n.jsx)(s.strong,{children:"Scaffold"}),"(",(0,n.jsx)(s.code,{children:"config"}),"): ",(0,n.jsx)(s.code,{children:"Promise"}),"<",(0,n.jsx)(s.code,{children:"void"}),">"]}),"\n",(0,n.jsxs)(s.p,{children:["Create a scaffold using given ",(0,n.jsx)(s.code,{children:"options"}),"."]}),"\n",(0,n.jsx)(s.h4,{id:"create-files",children:"Create files"}),"\n",(0,n.jsxs)(s.p,{children:["To create a file structure to output, use any directory and file structure you would like.\nInside folder names, file names or file contents, you may place ",(0,n.jsx)(s.code,{children:"{{ var }}"})," where ",(0,n.jsx)(s.code,{children:"var"})," is either\n",(0,n.jsx)(s.code,{children:"name"})," which is the scaffold name you provided or one of the keys you provided in the ",(0,n.jsx)(s.code,{children:"data"})," option."]}),"\n",(0,n.jsx)(s.p,{children:"The contents and names will be replaced with the transformed values so you can use your original structure as a\nboilerplate for other projects, components, modules, or even single files."}),"\n",(0,n.jsxs)(s.p,{children:["The files will maintain their structure, starting from the directory containing the template (or the template itself\nif it is already a directory), and will output from that directory into the directory defined by ",(0,n.jsx)(s.code,{children:"config.output"}),"."]}),"\n",(0,n.jsx)(s.h4,{id:"helpers",children:"Helpers"}),"\n",(0,n.jsxs)(s.p,{children:["Helpers are functions you can use to transform your ",(0,n.jsx)(s.code,{children:"{{ var }}"})," contents into other values without having to\npre-define the data and use a duplicated key."]}),"\n",(0,n.jsxs)(s.p,{children:["Any functions you provide in ",(0,n.jsx)(s.code,{children:"helpers"})," option will also be available to you to make custom formatting as you see fit\n(for example, formatting a date)"]}),"\n",(0,n.jsxs)(s.p,{children:["For available default values, see ",(0,n.jsx)(s.a,{href:"/simple-scaffold/docs/api/modules#defaulthelpers",children:"DefaultHelpers"}),"."]}),"\n",(0,n.jsx)(s.h4,{id:"parameters",children:"Parameters"}),"\n",(0,n.jsxs)(s.table,{children:[(0,n.jsx)(s.thead,{children:(0,n.jsxs)(s.tr,{children:[(0,n.jsx)(s.th,{style:{textAlign:"left"},children:"Name"}),(0,n.jsx)(s.th,{style:{textAlign:"left"},children:"Type"}),(0,n.jsx)(s.th,{style:{textAlign:"left"},children:"Description"})]})}),(0,n.jsx)(s.tbody,{children:(0,n.jsxs)(s.tr,{children:[(0,n.jsx)(s.td,{style:{textAlign:"left"},children:(0,n.jsx)(s.code,{children:"config"})}),(0,n.jsx)(s.td,{style:{textAlign:"left"},children:(0,n.jsx)(s.a,{href:"/simple-scaffold/docs/api/interfaces/ScaffoldConfig",children:(0,n.jsx)(s.code,{children:"ScaffoldConfig"})})}),(0,n.jsx)(s.td,{style:{textAlign:"left"},children:"The main configuration object"})]})})]}),"\n",(0,n.jsx)(s.h4,{id:"returns",children:"Returns"}),"\n",(0,n.jsxs)(s.p,{children:[(0,n.jsx)(s.code,{children:"Promise"}),"<",(0,n.jsx)(s.code,{children:"void"}),">"]}),"\n",(0,n.jsx)(s.p,{children:"A promise that resolves when the scaffold is complete"}),"\n",(0,n.jsx)(s.p,{children:(0,n.jsx)(s.strong,{children:(0,n.jsx)(s.code,{children:"See"})})}),"\n",(0,n.jsxs)(s.ul,{children:["\n",(0,n.jsx)(s.li,{children:(0,n.jsx)(s.a,{href:"/simple-scaffold/docs/api/modules#defaulthelpers",children:"DefaultHelpers"})}),"\n",(0,n.jsx)(s.li,{children:(0,n.jsx)(s.a,{href:"/simple-scaffold/docs/api/modules#casehelpers",children:"CaseHelpers"})}),"\n",(0,n.jsx)(s.li,{children:(0,n.jsx)(s.a,{href:"/simple-scaffold/docs/api/modules#datehelpers",children:"DateHelpers"})}),"\n"]}),"\n",(0,n.jsx)(s.h4,{id:"defined-in",children:"Defined in"}),"\n",(0,n.jsx)(s.p,{children:(0,n.jsx)(s.a,{href:"https://github.com/chenasraf/simple-scaffold/blob/bfee26f/src/scaffold.ts#L57",children:"scaffold.ts:57"})}),"\n",(0,n.jsx)(s.h2,{id:"config",children:"Config"}),"\n",(0,n.jsx)(s.h3,{id:"fileresponsehandler",children:"FileResponseHandler"}),"\n",(0,n.jsxs)(s.p,{children:["\u01ac ",(0,n.jsx)(s.strong,{children:"FileResponseHandler"}),"<",(0,n.jsx)(s.code,{children:"T"}),">: (",(0,n.jsx)(s.code,{children:"fullPath"}),": ",(0,n.jsx)(s.code,{children:"string"}),", ",(0,n.jsx)(s.code,{children:"basedir"}),": ",(0,n.jsx)(s.code,{children:"string"}),", ",(0,n.jsx)(s.code,{children:"basename"}),": ",(0,n.jsx)(s.code,{children:"string"}),") => ",(0,n.jsx)(s.code,{children:"T"})]}),"\n",(0,n.jsxs)(s.p,{children:["A function that takes path information about file, and returns a value of type ",(0,n.jsx)(s.code,{children:"T"})]}),"\n",(0,n.jsx)(s.h4,{id:"type-parameters",children:"Type parameters"}),"\n",(0,n.jsxs)(s.table,{children:[(0,n.jsx)(s.thead,{children:(0,n.jsxs)(s.tr,{children:[(0,n.jsx)(s.th,{style:{textAlign:"left"},children:"Name"}),(0,n.jsx)(s.th,{style:{textAlign:"left"},children:"Description"})]})}),(0,n.jsx)(s.tbody,{children:(0,n.jsxs)(s.tr,{children:[(0,n.jsx)(s.td,{style:{textAlign:"left"},children:(0,n.jsx)(s.code,{children:"T"})}),(0,n.jsx)(s.td,{style:{textAlign:"left"},children:"The return type for the function"})]})})]}),"\n",(0,n.jsx)(s.h4,{id:"type-declaration",children:"Type declaration"}),"\n",(0,n.jsxs)(s.p,{children:["\u25b8 (",(0,n.jsx)(s.code,{children:"fullPath"}),", ",(0,n.jsx)(s.code,{children:"basedir"}),", ",(0,n.jsx)(s.code,{children:"basename"}),"): ",(0,n.jsx)(s.code,{children:"T"})]}),"\n",(0,n.jsx)(s.h5,{id:"parameters-1",children:"Parameters"}),"\n",(0,n.jsxs)(s.table,{children:[(0,n.jsx)(s.thead,{children:(0,n.jsxs)(s.tr,{children:[(0,n.jsx)(s.th,{style:{textAlign:"left"},children:"Name"}),(0,n.jsx)(s.th,{style:{textAlign:"left"},children:"Type"}),(0,n.jsx)(s.th,{style:{textAlign:"left"},children:"Description"})]})}),(0,n.jsxs)(s.tbody,{children:[(0,n.jsxs)(s.tr,{children:[(0,n.jsx)(s.td,{style:{textAlign:"left"},children:(0,n.jsx)(s.code,{children:"fullPath"})}),(0,n.jsx)(s.td,{style:{textAlign:"left"},children:(0,n.jsx)(s.code,{children:"string"})}),(0,n.jsx)(s.td,{style:{textAlign:"left"},children:"The full path of the current file"})]}),(0,n.jsxs)(s.tr,{children:[(0,n.jsx)(s.td,{style:{textAlign:"left"},children:(0,n.jsx)(s.code,{children:"basedir"})}),(0,n.jsx)(s.td,{style:{textAlign:"left"},children:(0,n.jsx)(s.code,{children:"string"})}),(0,n.jsx)(s.td,{style:{textAlign:"left"},children:"The directory containing the current file"})]}),(0,n.jsxs)(s.tr,{children:[(0,n.jsx)(s.td,{style:{textAlign:"left"},children:(0,n.jsx)(s.code,{children:"basename"})}),(0,n.jsx)(s.td,{style:{textAlign:"left"},children:(0,n.jsx)(s.code,{children:"string"})}),(0,n.jsx)(s.td,{style:{textAlign:"left"},children:"The name of the file"})]})]})]}),"\n",(0,n.jsx)(s.h5,{id:"returns-1",children:"Returns"}),"\n",(0,n.jsx)(s.p,{children:(0,n.jsx)(s.code,{children:"T"})}),"\n",(0,n.jsx)(s.h4,{id:"defined-in-1",children:"Defined in"}),"\n",(0,n.jsx)(s.p,{children:(0,n.jsx)(s.a,{href:"https://github.com/chenasraf/simple-scaffold/blob/bfee26f/src/types.ts#L305",children:"types.ts:305"})}),"\n",(0,n.jsx)(s.hr,{}),"\n",(0,n.jsx)(s.h3,{id:"fileresponse",children:"FileResponse"}),"\n",(0,n.jsxs)(s.p,{children:["\u01ac ",(0,n.jsx)(s.strong,{children:"FileResponse"}),"<",(0,n.jsx)(s.code,{children:"T"}),">: ",(0,n.jsx)(s.code,{children:"T"})," | ",(0,n.jsx)(s.a,{href:"/simple-scaffold/docs/api/modules#fileresponsehandler",children:(0,n.jsx)(s.code,{children:"FileResponseHandler"})}),"<",(0,n.jsx)(s.code,{children:"T"}),">"]}),"\n",(0,n.jsx)(s.p,{children:"Represents a response for file path information.\nCan either be:"}),"\n",(0,n.jsxs)(s.ol,{children:["\n",(0,n.jsxs)(s.li,{children:[(0,n.jsx)(s.code,{children:"T"})," - static value"]}),"\n",(0,n.jsxs)(s.li,{children:["A function with the following signature which returns ",(0,n.jsx)(s.code,{children:"T"}),":","\n",(0,n.jsx)(s.pre,{children:(0,n.jsx)(s.code,{className:"language-typescript",children:"(fullPath: string, basedir: string, basename: string) => T\n"})}),"\n"]}),"\n"]}),"\n",(0,n.jsx)(s.p,{children:(0,n.jsx)(s.strong,{children:(0,n.jsx)(s.code,{children:"See"})})}),"\n",(0,n.jsx)(s.p,{children:(0,n.jsx)(s.a,{href:"/simple-scaffold/docs/api/modules#fileresponsehandler",children:"FileResponseHandler"})}),"\n",(0,n.jsx)(s.h4,{id:"type-parameters-1",children:"Type parameters"}),"\n",(0,n.jsxs)(s.table,{children:[(0,n.jsx)(s.thead,{children:(0,n.jsx)(s.tr,{children:(0,n.jsx)(s.th,{style:{textAlign:"left"},children:"Name"})})}),(0,n.jsx)(s.tbody,{children:(0,n.jsx)(s.tr,{children:(0,n.jsx)(s.td,{style:{textAlign:"left"},children:(0,n.jsx)(s.code,{children:"T"})})})})]}),"\n",(0,n.jsx)(s.h4,{id:"defined-in-2",children:"Defined in"}),"\n",(0,n.jsx)(s.p,{children:(0,n.jsx)(s.a,{href:"https://github.com/chenasraf/simple-scaffold/blob/bfee26f/src/types.ts#L321",children:"types.ts:321"})}),"\n",(0,n.jsx)(s.h2,{id:"helpers-1",children:"Helpers"}),"\n",(0,n.jsx)(s.h3,{id:"casehelpers",children:"CaseHelpers"}),"\n",(0,n.jsxs)(s.p,{children:["\u01ac ",(0,n.jsx)(s.strong,{children:"CaseHelpers"}),": ",(0,n.jsx)(s.code,{children:'"camelCase"'})," | ",(0,n.jsx)(s.code,{children:'"hyphenCase"'})," | ",(0,n.jsx)(s.code,{children:'"kebabCase"'})," | ",(0,n.jsx)(s.code,{children:'"lowerCase"'})," | ",(0,n.jsx)(s.code,{children:'"pascalCase"'})," | ",(0,n.jsx)(s.code,{children:'"snakeCase"'})," | ",(0,n.jsx)(s.code,{children:'"startCase"'})," | ",(0,n.jsx)(s.code,{children:'"upperCase"'})]}),"\n",(0,n.jsx)(s.p,{children:"The names of the available helper functions that relate to text capitalization."}),"\n",(0,n.jsxs)(s.p,{children:["These are available for ",(0,n.jsx)(s.code,{children:"subfolderNameHelper"}),"."]}),"\n",(0,n.jsxs)(s.table,{children:[(0,n.jsx)(s.thead,{children:(0,n.jsxs)(s.tr,{children:[(0,n.jsx)(s.th,{children:"Helper name"}),(0,n.jsx)(s.th,{children:"Example code"}),(0,n.jsx)(s.th,{children:"Example output"})]})}),(0,n.jsxs)(s.tbody,{children:[(0,n.jsxs)(s.tr,{children:[(0,n.jsx)(s.td,{children:"[None]"}),(0,n.jsx)(s.td,{children:(0,n.jsx)(s.code,{children:"{{ name }}"})}),(0,n.jsx)(s.td,{children:"my name"})]}),(0,n.jsxs)(s.tr,{children:[(0,n.jsx)(s.td,{children:(0,n.jsx)(s.code,{children:"camelCase"})}),(0,n.jsx)(s.td,{children:(0,n.jsx)(s.code,{children:"{{ camelCase name }}"})}),(0,n.jsx)(s.td,{children:"myName"})]}),(0,n.jsxs)(s.tr,{children:[(0,n.jsx)(s.td,{children:(0,n.jsx)(s.code,{children:"snakeCase"})}),(0,n.jsx)(s.td,{children:(0,n.jsx)(s.code,{children:"{{ snakeCase name }}"})}),(0,n.jsx)(s.td,{children:"my_name"})]}),(0,n.jsxs)(s.tr,{children:[(0,n.jsx)(s.td,{children:(0,n.jsx)(s.code,{children:"startCase"})}),(0,n.jsx)(s.td,{children:(0,n.jsx)(s.code,{children:"{{ startCase name }}"})}),(0,n.jsx)(s.td,{children:"My Name"})]}),(0,n.jsxs)(s.tr,{children:[(0,n.jsx)(s.td,{children:(0,n.jsx)(s.code,{children:"kebabCase"})}),(0,n.jsx)(s.td,{children:(0,n.jsx)(s.code,{children:"{{ kebabCase name }}"})}),(0,n.jsx)(s.td,{children:"my-name"})]}),(0,n.jsxs)(s.tr,{children:[(0,n.jsx)(s.td,{children:(0,n.jsx)(s.code,{children:"hyphenCase"})}),(0,n.jsx)(s.td,{children:(0,n.jsx)(s.code,{children:"{{ hyphenCase name }}"})}),(0,n.jsx)(s.td,{children:"my-name"})]}),(0,n.jsxs)(s.tr,{children:[(0,n.jsx)(s.td,{children:(0,n.jsx)(s.code,{children:"pascalCase"})}),(0,n.jsx)(s.td,{children:(0,n.jsx)(s.code,{children:"{{ pascalCase name }}"})}),(0,n.jsx)(s.td,{children:"MyName"})]}),(0,n.jsxs)(s.tr,{children:[(0,n.jsx)(s.td,{children:(0,n.jsx)(s.code,{children:"upperCase"})}),(0,n.jsx)(s.td,{children:(0,n.jsx)(s.code,{children:"{{ upperCase name }}"})}),(0,n.jsx)(s.td,{children:"MY NAME"})]}),(0,n.jsxs)(s.tr,{children:[(0,n.jsx)(s.td,{children:(0,n.jsx)(s.code,{children:"lowerCase"})}),(0,n.jsx)(s.td,{children:(0,n.jsx)(s.code,{children:"{{ lowerCase name }}"})}),(0,n.jsx)(s.td,{children:"my name"})]})]})]}),"\n",(0,n.jsx)(s.p,{children:(0,n.jsx)(s.strong,{children:(0,n.jsx)(s.code,{children:"See"})})}),"\n",(0,n.jsxs)(s.ul,{children:["\n",(0,n.jsx)(s.li,{children:(0,n.jsx)(s.a,{href:"/simple-scaffold/docs/api/modules#defaulthelpers",children:"DefaultHelpers"})}),"\n",(0,n.jsx)(s.li,{children:(0,n.jsx)(s.a,{href:"/simple-scaffold/docs/api/modules#datehelpers",children:"DateHelpers"})}),"\n",(0,n.jsx)(s.li,{children:(0,n.jsx)(s.a,{href:"/simple-scaffold/docs/api/interfaces/ScaffoldConfig",children:"ScaffoldConfig"})}),"\n",(0,n.jsx)(s.li,{children:(0,n.jsx)(s.a,{href:"/simple-scaffold/docs/api/interfaces/ScaffoldConfig#subdirhelper",children:"ScaffoldConfig.subdirHelper"})}),"\n"]}),"\n",(0,n.jsx)(s.h4,{id:"defined-in-3",children:"Defined in"}),"\n",(0,n.jsx)(s.p,{children:(0,n.jsx)(s.a,{href:"https://github.com/chenasraf/simple-scaffold/blob/bfee26f/src/types.ts#L189",children:"types.ts:189"})}),"\n",(0,n.jsx)(s.hr,{}),"\n",(0,n.jsx)(s.h3,{id:"datehelpers",children:"DateHelpers"}),"\n",(0,n.jsxs)(s.p,{children:["\u01ac ",(0,n.jsx)(s.strong,{children:"DateHelpers"}),": ",(0,n.jsx)(s.code,{children:'"date"'})," | ",(0,n.jsx)(s.code,{children:'"now"'})]}),"\n",(0,n.jsx)(s.p,{children:"The names of the available helper functions that relate to dates."}),"\n",(0,n.jsxs)(s.table,{children:[(0,n.jsx)(s.thead,{children:(0,n.jsxs)(s.tr,{children:[(0,n.jsx)(s.th,{children:"Helper name"}),(0,n.jsx)(s.th,{children:"Description"}),(0,n.jsx)(s.th,{children:"Example code"}),(0,n.jsx)(s.th,{children:"Example output"})]})}),(0,n.jsxs)(s.tbody,{children:[(0,n.jsxs)(s.tr,{children:[(0,n.jsx)(s.td,{children:(0,n.jsx)(s.code,{children:"now"})}),(0,n.jsx)(s.td,{children:"Current date with format"}),(0,n.jsx)(s.td,{children:(0,n.jsx)(s.code,{children:'{{ now "yyyy-MM-dd HH:mm" }}'})}),(0,n.jsx)(s.td,{children:(0,n.jsx)(s.code,{children:"2042-01-01 15:00"})})]}),(0,n.jsxs)(s.tr,{children:[(0,n.jsxs)(s.td,{children:[(0,n.jsx)(s.code,{children:"now"})," (with offset)"]}),(0,n.jsx)(s.td,{children:"Current date with format, and with offset"}),(0,n.jsx)(s.td,{children:(0,n.jsx)(s.code,{children:'{{ now "yyyy-MM-dd HH:mm" -1 "hours" }}'})}),(0,n.jsx)(s.td,{children:(0,n.jsx)(s.code,{children:"2042-01-01 14:00"})})]}),(0,n.jsxs)(s.tr,{children:[(0,n.jsx)(s.td,{children:(0,n.jsx)(s.code,{children:"date"})}),(0,n.jsx)(s.td,{children:"Custom date with format"}),(0,n.jsx)(s.td,{children:(0,n.jsx)(s.code,{children:'{{ date "2042-01-01T15:00:00Z" "yyyy-MM-dd HH:mm" }}'})}),(0,n.jsx)(s.td,{children:(0,n.jsx)(s.code,{children:"2042-01-01 15:00"})})]}),(0,n.jsxs)(s.tr,{children:[(0,n.jsxs)(s.td,{children:[(0,n.jsx)(s.code,{children:"date"})," (with offset)"]}),(0,n.jsx)(s.td,{children:"Custom date with format, and with offset"}),(0,n.jsx)(s.td,{children:(0,n.jsx)(s.code,{children:'{{ date "2042-01-01T15:00:00Z" "yyyy-MM-dd HH:mm" -1 "days" }}'})}),(0,n.jsx)(s.td,{children:(0,n.jsx)(s.code,{children:"2041-31-12 15:00"})})]}),(0,n.jsxs)(s.tr,{children:[(0,n.jsxs)(s.td,{children:[(0,n.jsx)(s.code,{children:"date"})," (with date from ",(0,n.jsx)(s.code,{children:"--data"}),")"]}),(0,n.jsxs)(s.td,{children:["Custom date with format, with data from the ",(0,n.jsx)(s.code,{children:"data"})," config option"]}),(0,n.jsx)(s.td,{children:(0,n.jsx)(s.code,{children:'{{ date myCustomDate "yyyy-MM-dd HH:mm" }}'})}),(0,n.jsx)(s.td,{children:(0,n.jsx)(s.code,{children:"2042-01-01 12:00"})})]})]})]}),"\n",(0,n.jsx)(s.p,{children:"Further details:"}),"\n",(0,n.jsxs)(s.ul,{children:["\n",(0,n.jsxs)(s.li,{children:["\n",(0,n.jsxs)(s.p,{children:["We use ",(0,n.jsx)(s.a,{href:"https://date-fns.org/docs/",children:(0,n.jsx)(s.code,{children:"date-fns"})})," for parsing/manipulating the dates. If you want\nmore information on the date tokens to use, refer to\n",(0,n.jsx)(s.a,{href:"https://date-fns.org/docs/format",children:"their format documentation"}),"."]}),"\n"]}),"\n",(0,n.jsxs)(s.li,{children:["\n",(0,n.jsx)(s.p,{children:"The date helper format takes the following arguments:"}),"\n",(0,n.jsx)(s.pre,{children:(0,n.jsx)(s.code,{className:"language-typescript",children:'(\n date: string,\n format: string,\n offsetAmount?: number,\n offsetType?: "years" | "months" | "weeks" | "days" | "hours" | "minutes" | "seconds"\n)\n'})}),"\n"]}),"\n",(0,n.jsxs)(s.li,{children:["\n",(0,n.jsxs)(s.p,{children:[(0,n.jsx)(s.strong,{children:"The now helper"})," (for current time) takes the same arguments, minus the first one (",(0,n.jsx)(s.code,{children:"date"}),") as it is implicitly\nthe current date."]}),"\n"]}),"\n"]}),"\n",(0,n.jsx)(s.p,{children:(0,n.jsx)(s.strong,{children:(0,n.jsx)(s.code,{children:"See"})})}),"\n",(0,n.jsxs)(s.ul,{children:["\n",(0,n.jsx)(s.li,{children:(0,n.jsx)(s.a,{href:"/simple-scaffold/docs/api/modules#defaulthelpers",children:"DefaultHelpers"})}),"\n",(0,n.jsx)(s.li,{children:(0,n.jsx)(s.a,{href:"/simple-scaffold/docs/api/modules#casehelpers",children:"CaseHelpers"})}),"\n",(0,n.jsx)(s.li,{children:(0,n.jsx)(s.a,{href:"/simple-scaffold/docs/api/interfaces/ScaffoldConfig",children:"ScaffoldConfig"})}),"\n"]}),"\n",(0,n.jsx)(s.h4,{id:"defined-in-4",children:"Defined in"}),"\n",(0,n.jsx)(s.p,{children:(0,n.jsx)(s.a,{href:"https://github.com/chenasraf/simple-scaffold/blob/bfee26f/src/types.ts#L236",children:"types.ts:236"})}),"\n",(0,n.jsx)(s.hr,{}),"\n",(0,n.jsx)(s.h3,{id:"defaulthelpers",children:"DefaultHelpers"}),"\n",(0,n.jsxs)(s.p,{children:["\u01ac ",(0,n.jsx)(s.strong,{children:"DefaultHelpers"}),": ",(0,n.jsx)(s.a,{href:"/simple-scaffold/docs/api/modules#casehelpers",children:(0,n.jsx)(s.code,{children:"CaseHelpers"})})," | ",(0,n.jsx)(s.a,{href:"/simple-scaffold/docs/api/modules#datehelpers",children:(0,n.jsx)(s.code,{children:"DateHelpers"})})]}),"\n",(0,n.jsx)(s.p,{children:"The names of all the available helper functions in templates.\nSimple-Scaffold provides some built-in text transformation filters usable by Handlebars.js."}),"\n",(0,n.jsxs)(s.p,{children:["For example, you may use ",(0,n.jsx)(s.code,{children:"{{ snakeCase name }}"})," inside a template file or filename, and it will\nreplace ",(0,n.jsx)(s.code,{children:"My Name"})," with ",(0,n.jsx)(s.code,{children:"my_name"})," when producing the final value."]}),"\n",(0,n.jsx)(s.p,{children:(0,n.jsx)(s.strong,{children:(0,n.jsx)(s.code,{children:"See"})})}),"\n",(0,n.jsxs)(s.ul,{children:["\n",(0,n.jsx)(s.li,{children:(0,n.jsx)(s.a,{href:"/simple-scaffold/docs/api/modules#casehelpers",children:"CaseHelpers"})}),"\n",(0,n.jsx)(s.li,{children:(0,n.jsx)(s.a,{href:"/simple-scaffold/docs/api/modules#datehelpers",children:"DateHelpers"})}),"\n",(0,n.jsx)(s.li,{children:(0,n.jsx)(s.a,{href:"/simple-scaffold/docs/api/interfaces/ScaffoldConfig",children:"ScaffoldConfig"})}),"\n"]}),"\n",(0,n.jsx)(s.h4,{id:"defined-in-5",children:"Defined in"}),"\n",(0,n.jsx)(s.p,{children:(0,n.jsx)(s.a,{href:"https://github.com/chenasraf/simple-scaffold/blob/bfee26f/src/types.ts#L251",children:"types.ts:251"})}),"\n",(0,n.jsx)(s.hr,{}),"\n",(0,n.jsx)(s.h3,{id:"helper",children:"Helper"}),"\n",(0,n.jsxs)(s.p,{children:["\u01ac ",(0,n.jsx)(s.strong,{children:"Helper"}),": ",(0,n.jsx)(s.code,{children:"HelperDelegate"})]}),"\n",(0,n.jsxs)(s.p,{children:["Helper function, see ",(0,n.jsx)(s.a,{href:"https://handlebarsjs.com/guide/#custom-helpers",children:"https://handlebarsjs.com/guide/#custom-helpers"})]}),"\n",(0,n.jsx)(s.h4,{id:"defined-in-6",children:"Defined in"}),"\n",(0,n.jsx)(s.p,{children:(0,n.jsx)(s.a,{href:"https://github.com/chenasraf/simple-scaffold/blob/bfee26f/src/types.ts#L258",children:"types.ts:258"})}),"\n",(0,n.jsx)(s.h2,{id:"logging",children:"Logging"}),"\n",(0,n.jsx)(s.h3,{id:"loglevel",children:"LogLevel"}),"\n",(0,n.jsxs)(s.p,{children:["\u01ac ",(0,n.jsx)(s.strong,{children:"LogLevel"}),": typeof ",(0,n.jsx)(s.a,{href:"/simple-scaffold/docs/api/modules#loglevel",children:(0,n.jsx)(s.code,{children:"LogLevel"})}),"[keyof typeof ",(0,n.jsx)(s.a,{href:"/simple-scaffold/docs/api/modules#loglevel",children:(0,n.jsx)(s.code,{children:"LogLevel"})}),"]"]}),"\n",(0,n.jsxs)(s.p,{children:["The amount of information to log when generating scaffold.\nWhen not ",(0,n.jsx)(s.code,{children:"None"}),", the selected level will be the lowest level included."]}),"\n",(0,n.jsxs)(s.p,{children:["For example, level ",(0,n.jsx)(s.code,{children:"Info"})," (2) will include ",(0,n.jsx)(s.code,{children:"Info"}),", ",(0,n.jsx)(s.code,{children:"Warning"})," and ",(0,n.jsx)(s.code,{children:"Error"}),", but not ",(0,n.jsx)(s.code,{children:"Debug"}),"; and ",(0,n.jsx)(s.code,{children:"Warning"})," will only\nshow ",(0,n.jsx)(s.code,{children:"Warning"})," and ",(0,n.jsx)(s.code,{children:"Error"}),"."]}),"\n",(0,n.jsxs)(s.p,{children:["You may use either the number or the name of the level.\nFor example, ",(0,n.jsx)(s.code,{children:"2"})," or ",(0,n.jsx)(s.code,{children:"info"})," are both valid."]}),"\n",(0,n.jsx)(s.p,{children:(0,n.jsx)(s.strong,{children:(0,n.jsx)(s.code,{children:"Default"})})}),"\n",(0,n.jsx)(s.p,{children:(0,n.jsx)(s.code,{children:"2 (info)"})}),"\n",(0,n.jsx)(s.h4,{id:"defined-in-7",children:"Defined in"}),"\n",(0,n.jsx)(s.p,{children:(0,n.jsx)(s.a,{href:"https://github.com/chenasraf/simple-scaffold/blob/bfee26f/src/types.ts#L260",children:"types.ts:260"})}),"\n",(0,n.jsx)(s.p,{children:(0,n.jsx)(s.a,{href:"https://github.com/chenasraf/simple-scaffold/blob/bfee26f/src/types.ts#L291",children:"types.ts:291"})}),"\n",(0,n.jsx)(s.h2,{id:"other",children:"Other"}),"\n",(0,n.jsx)(s.h3,{id:"loglevel-1",children:"LogLevel"}),"\n",(0,n.jsxs)(s.p,{children:["\u2022 ",(0,n.jsx)(s.code,{children:"Const"})," ",(0,n.jsx)(s.strong,{children:"LogLevel"}),": ",(0,n.jsx)(s.code,{children:"Object"})]}),"\n",(0,n.jsx)(s.h4,{id:"type-declaration-1",children:"Type declaration"}),"\n",(0,n.jsxs)(s.table,{children:[(0,n.jsx)(s.thead,{children:(0,n.jsxs)(s.tr,{children:[(0,n.jsx)(s.th,{style:{textAlign:"left"},children:"Name"}),(0,n.jsx)(s.th,{style:{textAlign:"left"},children:"Type"}),(0,n.jsx)(s.th,{style:{textAlign:"left"},children:"Description"})]})}),(0,n.jsxs)(s.tbody,{children:[(0,n.jsxs)(s.tr,{children:[(0,n.jsx)(s.td,{style:{textAlign:"left"},children:(0,n.jsx)(s.code,{children:"none"})}),(0,n.jsx)(s.td,{style:{textAlign:"left"},children:(0,n.jsx)(s.code,{children:'"none"'})}),(0,n.jsx)(s.td,{style:{textAlign:"left"},children:"Silent output"})]}),(0,n.jsxs)(s.tr,{children:[(0,n.jsx)(s.td,{style:{textAlign:"left"},children:(0,n.jsx)(s.code,{children:"debug"})}),(0,n.jsx)(s.td,{style:{textAlign:"left"},children:(0,n.jsx)(s.code,{children:'"debug"'})}),(0,n.jsx)(s.td,{style:{textAlign:"left"},children:"Debugging information. Very verbose and only recommended for troubleshooting."})]}),(0,n.jsxs)(s.tr,{children:[(0,n.jsx)(s.td,{style:{textAlign:"left"},children:(0,n.jsx)(s.code,{children:"info"})}),(0,n.jsx)(s.td,{style:{textAlign:"left"},children:(0,n.jsx)(s.code,{children:'"info"'})}),(0,n.jsxs)(s.td,{style:{textAlign:"left"},children:["The regular level of logging. Major actions are logged to show the scaffold progress. ",(0,n.jsx)(s.strong,{children:(0,n.jsx)(s.code,{children:"Default"})})," ",(0,n.jsx)(s.code,{children:"ts "})]})]}),(0,n.jsxs)(s.tr,{children:[(0,n.jsx)(s.td,{style:{textAlign:"left"},children:(0,n.jsx)(s.code,{children:"warning"})}),(0,n.jsx)(s.td,{style:{textAlign:"left"},children:(0,n.jsx)(s.code,{children:'"warning"'})}),(0,n.jsx)(s.td,{style:{textAlign:"left"},children:"Warnings such as when file fails to replace token values properly in template."})]}),(0,n.jsxs)(s.tr,{children:[(0,n.jsx)(s.td,{style:{textAlign:"left"},children:(0,n.jsx)(s.code,{children:"error"})}),(0,n.jsx)(s.td,{style:{textAlign:"left"},children:(0,n.jsx)(s.code,{children:'"error"'})}),(0,n.jsx)(s.td,{style:{textAlign:"left"},children:"Errors, such as missing files, bad replacement token syntax, or un-writable directories."})]})]})]}),"\n",(0,n.jsx)(s.h4,{id:"defined-in-8",children:"Defined in"}),"\n",(0,n.jsx)(s.p,{children:(0,n.jsx)(s.a,{href:"https://github.com/chenasraf/simple-scaffold/blob/bfee26f/src/types.ts#L260",children:"types.ts:260"})}),"\n",(0,n.jsx)(s.p,{children:(0,n.jsx)(s.a,{href:"https://github.com/chenasraf/simple-scaffold/blob/bfee26f/src/types.ts#L291",children:"types.ts:291"})}),"\n",(0,n.jsx)(s.hr,{}),"\n",(0,n.jsx)(s.h3,{id:"scaffoldconfigmap",children:"ScaffoldConfigMap"}),"\n",(0,n.jsxs)(s.p,{children:["\u01ac ",(0,n.jsx)(s.strong,{children:"ScaffoldConfigMap"}),": ",(0,n.jsx)(s.code,{children:"Record"}),"<",(0,n.jsx)(s.code,{children:"string"}),", ",(0,n.jsx)(s.a,{href:"/simple-scaffold/docs/api/interfaces/ScaffoldConfig",children:(0,n.jsx)(s.code,{children:"ScaffoldConfig"})}),">"]}),"\n",(0,n.jsx)(s.p,{children:"A mapping of scaffold template keys to their configurations."}),"\n",(0,n.jsxs)(s.p,{children:["Each configuration is a ",(0,n.jsx)(s.a,{href:"/simple-scaffold/docs/api/interfaces/ScaffoldConfig",children:"ScaffoldConfig"})," object."]}),"\n",(0,n.jsx)(s.p,{children:"The key is the name of the template, and the value is the configuration for that template."}),"\n",(0,n.jsx)(s.p,{children:'When no template key is provided to the scaffold command, the "default" template is used.'}),"\n",(0,n.jsx)(s.p,{children:(0,n.jsx)(s.strong,{children:(0,n.jsx)(s.code,{children:"See"})})}),"\n",(0,n.jsx)(s.p,{children:(0,n.jsx)(s.a,{href:"/simple-scaffold/docs/api/interfaces/ScaffoldConfig",children:"ScaffoldConfig"})}),"\n",(0,n.jsx)(s.h4,{id:"defined-in-9",children:"Defined in"}),"\n",(0,n.jsx)(s.p,{children:(0,n.jsx)(s.a,{href:"https://github.com/chenasraf/simple-scaffold/blob/bfee26f/src/types.ts#L373",children:"types.ts:373"})}),"\n",(0,n.jsx)(s.hr,{}),"\n",(0,n.jsx)(s.h3,{id:"scaffoldconfigfile",children:"ScaffoldConfigFile"}),"\n",(0,n.jsxs)(s.p,{children:["\u01ac ",(0,n.jsx)(s.strong,{children:"ScaffoldConfigFile"}),": ",(0,n.jsx)(s.code,{children:"AsyncResolver"}),"<",(0,n.jsx)(s.a,{href:"/simple-scaffold/docs/api/interfaces/ScaffoldCmdConfig",children:(0,n.jsx)(s.code,{children:"ScaffoldCmdConfig"})}),", ",(0,n.jsx)(s.a,{href:"/simple-scaffold/docs/api/modules#scaffoldconfigmap",children:(0,n.jsx)(s.code,{children:"ScaffoldConfigMap"})}),">"]}),"\n",(0,n.jsx)(s.p,{children:"The scaffold config file is either:"}),"\n",(0,n.jsxs)(s.ul,{children:["\n",(0,n.jsxs)(s.li,{children:["A ",(0,n.jsx)(s.a,{href:"/simple-scaffold/docs/api/modules#scaffoldconfigmap",children:"ScaffoldConfigMap"})," object"]}),"\n",(0,n.jsxs)(s.li,{children:["A function that returns a ",(0,n.jsx)(s.a,{href:"/simple-scaffold/docs/api/modules#scaffoldconfigmap",children:"ScaffoldConfigMap"})," object"]}),"\n",(0,n.jsxs)(s.li,{children:["A promise that resolves to a ",(0,n.jsx)(s.a,{href:"/simple-scaffold/docs/api/modules#scaffoldconfigmap",children:"ScaffoldConfigMap"})," object"]}),"\n",(0,n.jsxs)(s.li,{children:["A function that returns a promise that resolves to a ",(0,n.jsx)(s.a,{href:"/simple-scaffold/docs/api/modules#scaffoldconfigmap",children:"ScaffoldConfigMap"})," object"]}),"\n"]}),"\n",(0,n.jsx)(s.h4,{id:"defined-in-10",children:"Defined in"}),"\n",(0,n.jsx)(s.p,{children:(0,n.jsx)(s.a,{href:"https://github.com/chenasraf/simple-scaffold/blob/bfee26f/src/types.ts#L381",children:"types.ts:381"})}),"\n",(0,n.jsx)(s.hr,{}),"\n",(0,n.jsx)(s.h3,{id:"default",children:"default"}),"\n",(0,n.jsxs)(s.p,{children:["Renames and re-exports ",(0,n.jsx)(s.a,{href:"/simple-scaffold/docs/api/modules#scaffold",children:"Scaffold"})]})]})}function o(e={}){const{wrapper:s}={...(0,d.a)(),...e.components};return s?(0,n.jsx)(s,{...e,children:(0,n.jsx)(a,{...e})}):a(e)}},8672:(e,s,l)=>{l.d(s,{Z:()=>c,a:()=>r});var n=l(959);const d={},i=n.createContext(d);function r(e){const s=n.useContext(i);return n.useMemo((function(){return"function"==typeof e?e(s):{...s,...e}}),[s,e])}function c(e){let s;return s=e.disableParentContext?"function"==typeof e.components?e.components(d):e.components||d:r(e.components),n.createElement(i.Provider,{value:s},e.children)}}}]); \ No newline at end of file diff --git a/assets/js/runtime~main.8e7ce233.js b/assets/js/runtime~main.7e107033.js similarity index 95% rename from assets/js/runtime~main.8e7ce233.js rename to assets/js/runtime~main.7e107033.js index 9ff4061..4837abf 100644 --- a/assets/js/runtime~main.8e7ce233.js +++ b/assets/js/runtime~main.7e107033.js @@ -1 +1 @@ -(()=>{"use strict";var e,t,r,a,o,f={},n={};function d(e){var t=n[e];if(void 0!==t)return t.exports;var r=n[e]={id:e,loaded:!1,exports:{}};return f[e].call(r.exports,r,r.exports,d),r.loaded=!0,r.exports}d.m=f,d.c=n,e=[],d.O=(t,r,a,o)=>{if(!r){var f=1/0;for(i=0;i=o)&&Object.keys(d.O).every((e=>d.O[e](r[c])))?r.splice(c--,1):(n=!1,o0&&e[i-1][2]>o;i--)e[i]=e[i-1];e[i]=[r,a,o]},d.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return d.d(t,{a:t}),t},r=Object.getPrototypeOf?e=>Object.getPrototypeOf(e):e=>e.__proto__,d.t=function(e,a){if(1&a&&(e=this(e)),8&a)return e;if("object"==typeof e&&e){if(4&a&&e.__esModule)return e;if(16&a&&"function"==typeof e.then)return e}var o=Object.create(null);d.r(o);var f={};t=t||[null,r({}),r([]),r(r)];for(var n=2&a&&e;"object"==typeof n&&!~t.indexOf(n);n=r(n))Object.getOwnPropertyNames(n).forEach((t=>f[t]=()=>e[t]));return f.default=()=>e,d.d(o,f),o},d.d=(e,t)=>{for(var r in t)d.o(t,r)&&!d.o(e,r)&&Object.defineProperty(e,r,{enumerable:!0,get:t[r]})},d.f={},d.e=e=>Promise.all(Object.keys(d.f).reduce(((t,r)=>(d.f[r](e,t),t)),[])),d.u=e=>"assets/js/"+({53:"935f2afb",74:"4c5c6dbb",85:"1f391b9e",110:"4c5f7ef0",158:"af0552f4",189:"3bd150b0",237:"1df93b7f",306:"f6aebfbf",360:"e20f0e33",368:"a94703ab",414:"393be207",518:"a7bd4aaa",597:"5e8c322a",634:"dd1ef1bb",661:"5e95c892",683:"40bcb77d",813:"1004470c",879:"6cd1f720",882:"0d14a3de",902:"38e469bb",918:"17896441"}[e]||e)+"."+{53:"176563cc",74:"5eacaab7",85:"fb84bd49",110:"1eddde5d",158:"a9177571",189:"7f274eed",205:"a504205b",237:"195d85bd",306:"2d2a8d1f",360:"9355558a",368:"ce5eb4f8",414:"8d59245f",463:"1a7f0802",518:"29c729f3",597:"4a12ac30",634:"11bb3352",661:"35d85233",683:"8b969151",813:"bc0f48c6",879:"dde22d01",882:"a3aa7aad",902:"c2989604",918:"1fa4b72c"}[e]+".js",d.miniCssF=e=>{},d.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"==typeof window)return window}}(),d.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),a={},o="simple-scaffold-docs:",d.l=(e,t,r,f)=>{if(a[e])a[e].push(t);else{var n,c;if(void 0!==r)for(var b=document.getElementsByTagName("script"),i=0;i{n.onerror=n.onload=null,clearTimeout(u);var o=a[e];if(delete a[e],n.parentNode&&n.parentNode.removeChild(n),o&&o.forEach((e=>e(r))),t)return t(r)},u=setTimeout(s.bind(null,void 0,{type:"timeout",target:n}),12e4);n.onerror=s.bind(null,n.onerror),n.onload=s.bind(null,n.onload),c&&document.head.appendChild(n)}},d.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},d.p="/simple-scaffold/",d.gca=function(e){return e={17896441:"918","935f2afb":"53","4c5c6dbb":"74","1f391b9e":"85","4c5f7ef0":"110",af0552f4:"158","3bd150b0":"189","1df93b7f":"237",f6aebfbf:"306",e20f0e33:"360",a94703ab:"368","393be207":"414",a7bd4aaa:"518","5e8c322a":"597",dd1ef1bb:"634","5e95c892":"661","40bcb77d":"683","1004470c":"813","6cd1f720":"879","0d14a3de":"882","38e469bb":"902"}[e]||e,d.p+d.u(e)},(()=>{var e={303:0,532:0};d.f.j=(t,r)=>{var a=d.o(e,t)?e[t]:void 0;if(0!==a)if(a)r.push(a[2]);else if(/^(303|532)$/.test(t))e[t]=0;else{var o=new Promise(((r,o)=>a=e[t]=[r,o]));r.push(a[2]=o);var f=d.p+d.u(t),n=new Error;d.l(f,(r=>{if(d.o(e,t)&&(0!==(a=e[t])&&(e[t]=void 0),a)){var o=r&&("load"===r.type?"missing":r.type),f=r&&r.target&&r.target.src;n.message="Loading chunk "+t+" failed.\n("+o+": "+f+")",n.name="ChunkLoadError",n.type=o,n.request=f,a[1](n)}}),"chunk-"+t,t)}},d.O.j=t=>0===e[t];var t=(t,r)=>{var a,o,f=r[0],n=r[1],c=r[2],b=0;if(f.some((t=>0!==e[t]))){for(a in n)d.o(n,a)&&(d.m[a]=n[a]);if(c)var i=c(d)}for(t&&t(r);b{"use strict";var e,t,r,a,o,f={},n={};function d(e){var t=n[e];if(void 0!==t)return t.exports;var r=n[e]={id:e,loaded:!1,exports:{}};return f[e].call(r.exports,r,r.exports,d),r.loaded=!0,r.exports}d.m=f,d.c=n,e=[],d.O=(t,r,a,o)=>{if(!r){var f=1/0;for(i=0;i=o)&&Object.keys(d.O).every((e=>d.O[e](r[c])))?r.splice(c--,1):(n=!1,o0&&e[i-1][2]>o;i--)e[i]=e[i-1];e[i]=[r,a,o]},d.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return d.d(t,{a:t}),t},r=Object.getPrototypeOf?e=>Object.getPrototypeOf(e):e=>e.__proto__,d.t=function(e,a){if(1&a&&(e=this(e)),8&a)return e;if("object"==typeof e&&e){if(4&a&&e.__esModule)return e;if(16&a&&"function"==typeof e.then)return e}var o=Object.create(null);d.r(o);var f={};t=t||[null,r({}),r([]),r(r)];for(var n=2&a&&e;"object"==typeof n&&!~t.indexOf(n);n=r(n))Object.getOwnPropertyNames(n).forEach((t=>f[t]=()=>e[t]));return f.default=()=>e,d.d(o,f),o},d.d=(e,t)=>{for(var r in t)d.o(t,r)&&!d.o(e,r)&&Object.defineProperty(e,r,{enumerable:!0,get:t[r]})},d.f={},d.e=e=>Promise.all(Object.keys(d.f).reduce(((t,r)=>(d.f[r](e,t),t)),[])),d.u=e=>"assets/js/"+({53:"935f2afb",74:"4c5c6dbb",85:"1f391b9e",110:"4c5f7ef0",158:"af0552f4",189:"3bd150b0",237:"1df93b7f",306:"f6aebfbf",360:"e20f0e33",368:"a94703ab",414:"393be207",518:"a7bd4aaa",597:"5e8c322a",634:"dd1ef1bb",661:"5e95c892",683:"40bcb77d",813:"1004470c",879:"6cd1f720",882:"0d14a3de",902:"38e469bb",918:"17896441"}[e]||e)+"."+{53:"176563cc",74:"5eacaab7",85:"fb84bd49",110:"1eddde5d",158:"a7387875",189:"83e20e07",205:"a504205b",237:"195d85bd",306:"be876a01",360:"9355558a",368:"ce5eb4f8",414:"8d59245f",463:"1a7f0802",518:"29c729f3",597:"4a12ac30",634:"9a7f1119",661:"35d85233",683:"8b969151",813:"bc0f48c6",879:"dde22d01",882:"a3aa7aad",902:"c2989604",918:"1fa4b72c"}[e]+".js",d.miniCssF=e=>{},d.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"==typeof window)return window}}(),d.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),a={},o="simple-scaffold-docs:",d.l=(e,t,r,f)=>{if(a[e])a[e].push(t);else{var n,c;if(void 0!==r)for(var b=document.getElementsByTagName("script"),i=0;i{n.onerror=n.onload=null,clearTimeout(u);var o=a[e];if(delete a[e],n.parentNode&&n.parentNode.removeChild(n),o&&o.forEach((e=>e(r))),t)return t(r)},u=setTimeout(s.bind(null,void 0,{type:"timeout",target:n}),12e4);n.onerror=s.bind(null,n.onerror),n.onload=s.bind(null,n.onload),c&&document.head.appendChild(n)}},d.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},d.p="/simple-scaffold/",d.gca=function(e){return e={17896441:"918","935f2afb":"53","4c5c6dbb":"74","1f391b9e":"85","4c5f7ef0":"110",af0552f4:"158","3bd150b0":"189","1df93b7f":"237",f6aebfbf:"306",e20f0e33:"360",a94703ab:"368","393be207":"414",a7bd4aaa:"518","5e8c322a":"597",dd1ef1bb:"634","5e95c892":"661","40bcb77d":"683","1004470c":"813","6cd1f720":"879","0d14a3de":"882","38e469bb":"902"}[e]||e,d.p+d.u(e)},(()=>{var e={303:0,532:0};d.f.j=(t,r)=>{var a=d.o(e,t)?e[t]:void 0;if(0!==a)if(a)r.push(a[2]);else if(/^(303|532)$/.test(t))e[t]=0;else{var o=new Promise(((r,o)=>a=e[t]=[r,o]));r.push(a[2]=o);var f=d.p+d.u(t),n=new Error;d.l(f,(r=>{if(d.o(e,t)&&(0!==(a=e[t])&&(e[t]=void 0),a)){var o=r&&("load"===r.type?"missing":r.type),f=r&&r.target&&r.target.src;n.message="Loading chunk "+t+" failed.\n("+o+": "+f+")",n.name="ChunkLoadError",n.type=o,n.request=f,a[1](n)}}),"chunk-"+t,t)}},d.O.j=t=>0===e[t];var t=(t,r)=>{var a,o,f=r[0],n=r[1],c=r[2],b=0;if(f.some((t=>0!==e[t]))){for(a in n)d.o(n,a)&&(d.m[a]=n[a]);if(c)var i=c(d)}for(t&&t(r);bsimple-scaffold | Simple Scaffold - + diff --git a/docs/api/interfaces/ScaffoldCmdConfig/index.html b/docs/api/interfaces/ScaffoldCmdConfig/index.html index 8a0c63e..e62cd08 100644 --- a/docs/api/interfaces/ScaffoldCmdConfig/index.html +++ b/docs/api/interfaces/ScaffoldCmdConfig/index.html @@ -6,7 +6,7 @@ Interface: ScaffoldCmdConfig | Simple Scaffold - + @@ -19,55 +19,55 @@ Contains less and more specific options than Defined in -

types.ts:329

+

types.ts:329


templates

templates: string[]

The templates to use for generation

Defined in

-

types.ts:331

+

types.ts:331


output

output: string

The output path to write to

Defined in

-

types.ts:333

+

types.ts:333


subdir

subdir: boolean

Whether to create subfolder with the input name

Defined in

-

types.ts:335

+

types.ts:335


subdirHelper

Optional subdirHelper: string

Default transformer to apply to subfolder name when using subdir: true

Defined in

-

types.ts:337

+

types.ts:337


data

Optional data: Record<string, string>

Add custom data to the templates

Defined in

-

types.ts:339

+

types.ts:339


appendData

Optional appendData: Record<string, string>

Add custom data to the template in a CLI-friendly syntax (and not JSON)

Defined in

-

types.ts:341

+

types.ts:341


overwrite

overwrite: boolean

Enable to override output files, even if they already exist

Defined in

-

types.ts:343

+

types.ts:343


quiet

quiet: boolean

Silence logs, same as logLevel: "none"

Defined in

-

types.ts:345

+

types.ts:345


logLevel

logLevel: LogLevel

@@ -75,30 +75,30 @@ Contains less and more specific options than LogLevel

Defined in

-

types.ts:351

+

types.ts:351


dryRun

dryRun: boolean

Don't emit files. This is good for testing your scaffolds and making sure they don't fail, without having to write actual file contents or create directories.

Defined in

-

types.ts:353

+

types.ts:353


config

Optional config: string

Config file path to use

Defined in

-

types.ts:355

+

types.ts:355


key

Optional key: string

The key of the template to use

Defined in

-

types.ts:357

+

types.ts:357


git

Optional git: string

The git repository to use to fetch the config file

Defined in

-

types.ts:359

+

types.ts:359

\ No newline at end of file diff --git a/docs/api/interfaces/ScaffoldConfig/index.html b/docs/api/interfaces/ScaffoldConfig/index.html index 562b38f..99180f9 100644 --- a/docs/api/interfaces/ScaffoldConfig/index.html +++ b/docs/api/interfaces/ScaffoldConfig/index.html @@ -6,7 +6,7 @@ Interface: ScaffoldConfig | Simple Scaffold - + @@ -27,7 +27,7 @@

Name to be passed to the generated files. {{name}} and {{Name}} inside contents and file names will be replaced accordingly.

Defined in

-

types.ts:19

+

types.ts:19


templates

templates: string[]

@@ -36,7 +36,7 @@ or a glob pattern for multiple file matching easily.

Default

Current working directory

Defined in

-

types.ts:27

+

types.ts:27


output

output: FileResponse<string>

@@ -48,7 +48,7 @@ or a glob pattern for multiple file matching easily.

  • FileResponseHandler
  • Defined in

    -

    types.ts:37

    +

    types.ts:37


    subdir

    Optional subdir: boolean

    @@ -58,14 +58,14 @@ the directory name.

    Default

    false

    Defined in

    -

    types.ts:47

    +

    types.ts:47


    data

    Optional data: Record<string, any>

    Add custom data to the templates. By default, only your app name is included as {{name}} and {{Name}}.

    This can be any object that will be usable by Handlebars.

    Defined in

    -

    types.ts:54

    +

    types.ts:54


    overwrite

    Optional overwrite: FileResponse<boolean>

    @@ -81,7 +81,7 @@ a boolean for each file.

    Default

    false

    Defined in

    -

    types.ts:69

    +

    types.ts:69


    logLevel

    Optional logLevel: LogLevel

    @@ -93,7 +93,7 @@ of the same level or higher.

    Default

    2 (info)

    Defined in

    -

    types.ts:81

    +

    types.ts:81


    dryRun

    Optional dryRun: boolean

    @@ -102,7 +102,7 @@ actual file contents or create directories.

    Default

    false

    Defined in

    -

    types.ts:89

    +

    types.ts:89


    helpers

    Optional helpers: Record<string, HelperDelegate>

    @@ -126,7 +126,7 @@ and the value is the helper function itself. The signature of helpers is as foll
  • Templates
  • Defined in

    -

    types.ts:131

    +

    types.ts:131


    subdirHelper

    Optional subdirHelper: string

    @@ -140,7 +140,7 @@ transformation is done.

  • DefaultHelpers
  • Defined in

    -

    types.ts:142

    +

    types.ts:142

    Methods

    beforeWrite

    beforeWrite(content, rawContent, outputPath): undefined | string | Buffer | Promise<undefined | string | Buffer>

    @@ -155,6 +155,6 @@ you may run formatters on a file, fix output in edge-cases not supported by help

    The final output of the file contents-only, after further modifications - or undefined to use the original content (i.e. content.toString())

    Defined in

    -

    types.ts:158

    +

    types.ts:158

    \ No newline at end of file diff --git a/docs/api/modules/index.html b/docs/api/modules/index.html index d5c7704..ed711b9 100644 --- a/docs/api/modules/index.html +++ b/docs/api/modules/index.html @@ -6,7 +6,7 @@ simple-scaffold | Simple Scaffold - + @@ -47,7 +47,7 @@ pre-define the data and use a duplicated key.

  • DateHelpers
  • Defined in

    -

    scaffold.ts:57

    +

    scaffold.ts:57

    Config

    FileResponseHandler

    Ƭ FileResponseHandler<T>: (fullPath: string, basedir: string, basename: string) => T

    @@ -61,7 +61,7 @@ pre-define the data and use a duplicated key.

    Returns

    T

    Defined in

    -

    types.ts:305

    +

    types.ts:305


    FileResponse

    Ƭ FileResponse<T>: T | FileResponseHandler<T>

    @@ -78,7 +78,7 @@ Can either be:

    Type parameters

    Name
    T

    Defined in

    -

    types.ts:321

    +

    types.ts:321

    Helpers

    CaseHelpers

    Ƭ CaseHelpers: "camelCase" | "hyphenCase" | "kebabCase" | "lowerCase" | "pascalCase" | "snakeCase" | "startCase" | "upperCase"

    @@ -93,7 +93,7 @@ Can either be:

  • ScaffoldConfig.subdirHelper
  • Defined in

    -

    types.ts:189

    +

    types.ts:189


    DateHelpers

    Ƭ DateHelpers: "date" | "now"

    @@ -122,7 +122,7 @@ the current date.

  • ScaffoldConfig
  • Defined in

    -

    types.ts:236

    +

    types.ts:236


    DefaultHelpers

    Ƭ DefaultHelpers: CaseHelpers | DateHelpers

    @@ -137,13 +137,13 @@ replace My Name with my_name when producing the final
  • ScaffoldConfig
  • Defined in

    -

    types.ts:251

    +

    types.ts:251


    Helper

    Ƭ Helper: HelperDelegate

    Helper function, see https://handlebarsjs.com/guide/#custom-helpers

    Defined in

    -

    types.ts:258

    +

    types.ts:258

    Logging

    LogLevel

    Ƭ LogLevel: typeof LogLevel[keyof typeof LogLevel]

    @@ -156,16 +156,16 @@ For example, 2 or info are both valid.

    Default

    2 (info)

    Defined in

    -

    types.ts:260

    -

    types.ts:291

    +

    types.ts:260

    +

    types.ts:291

    Other

    LogLevel

    Const LogLevel: Object

    Type declaration

    NameTypeDescription
    none"none"Silent output
    debug"debug"Debugging information. Very verbose and only recommended for troubleshooting.
    info"info"The regular level of logging. Major actions are logged to show the scaffold progress. Default ts
    warning"warning"Warnings such as when file fails to replace token values properly in template.
    error"error"Errors, such as missing files, bad replacement token syntax, or un-writable directories.

    Defined in

    -

    types.ts:260

    -

    types.ts:291

    +

    types.ts:260

    +

    types.ts:291


    ScaffoldConfigMap

    Ƭ ScaffoldConfigMap: Record<string, ScaffoldConfig>

    @@ -176,7 +176,7 @@ For example, 2 or info are both valid.

    See

    ScaffoldConfig

    Defined in

    -

    types.ts:373

    +

    types.ts:373


    ScaffoldConfigFile

    Ƭ ScaffoldConfigFile: AsyncResolver<ScaffoldCmdConfig, ScaffoldConfigMap>

    @@ -188,7 +188,7 @@ For example, 2 or info are both valid.

  • A function that returns a promise that resolves to a ScaffoldConfigMap object
  • Defined in

    -

    types.ts:381

    +

    types.ts:381


    default

    Renames and re-exports Scaffold

    diff --git a/docs/usage/cli/index.html b/docs/usage/cli/index.html index f9a5c48..4b00012 100644 --- a/docs/usage/cli/index.html +++ b/docs/usage/cli/index.html @@ -6,7 +6,7 @@ CLI Usage | Simple Scaffold - + diff --git a/docs/usage/configuration_files/index.html b/docs/usage/configuration_files/index.html index e5efc70..28935b8 100644 --- a/docs/usage/configuration_files/index.html +++ b/docs/usage/configuration_files/index.html @@ -6,7 +6,7 @@ Configuration Files | Simple Scaffold - + diff --git a/docs/usage/examples/index.html b/docs/usage/examples/index.html index 193fad2..939ce64 100644 --- a/docs/usage/examples/index.html +++ b/docs/usage/examples/index.html @@ -6,7 +6,7 @@ Examples | Simple Scaffold - + diff --git a/docs/usage/index.html b/docs/usage/index.html index 0044157..404e50b 100644 --- a/docs/usage/index.html +++ b/docs/usage/index.html @@ -6,7 +6,7 @@ Usage | Simple Scaffold - + diff --git a/docs/usage/migration/index.html b/docs/usage/migration/index.html index ea8cc0d..c641d96 100644 --- a/docs/usage/migration/index.html +++ b/docs/usage/migration/index.html @@ -6,7 +6,7 @@ Migration | Simple Scaffold - + @@ -27,8 +27,7 @@ Scaffold which file to look for inside the git project. There is a default file which can find the file for you if it is in one of the supported filenames. -
  • verbose can now take the names debug, info, warn, error or none (case insensitive) or -as usual by using the numbering from before.
  • +
  • verbose can now take the names debug, info, warn, error or none (case insensitive).
  • --create-sub-folder (-s) has been renamed to --subdir (-s) in the CLI. The Node.js names have been changed as well.
  • --sub-folder-name-helper (-sh) has been renamed to --subdir-helper (-sh). The Node.js diff --git a/docs/usage/node/index.html b/docs/usage/node/index.html index 52d6f47..cde3957 100644 --- a/docs/usage/node/index.html +++ b/docs/usage/node/index.html @@ -6,7 +6,7 @@ Node.js Usage | Simple Scaffold - + diff --git a/docs/usage/templates/index.html b/docs/usage/templates/index.html index e38620d..d5fe860 100644 --- a/docs/usage/templates/index.html +++ b/docs/usage/templates/index.html @@ -6,7 +6,7 @@ Template Files | Simple Scaffold - + diff --git a/index.html b/index.html index dd9511b..1a552cd 100644 --- a/index.html +++ b/index.html @@ -6,7 +6,7 @@ Simple Scaffold | Simple Scaffold - + diff --git a/markdown-page/index.html b/markdown-page/index.html index a7c2d41..f34664c 100644 --- a/markdown-page/index.html +++ b/markdown-page/index.html @@ -6,7 +6,7 @@ Markdown page example | Simple Scaffold - +