create-raclette-app 0.0.3 → 0.0.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.js +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -9,4 +9,4 @@ var Ae=Object.create;var z=Object.defineProperty;var Be=Object.getOwnPropertyDes
|
|
|
9
9
|
Next steps:`)),console.log(h.default.white(` cd ${n.projectName}`)),console.log(h.default.white(" yarn install")),console.log(h.default.white(" yarn dev")),console.log(h.default.white(`
|
|
10
10
|
Happy coding! \u{1F9C0}`))},lt=async e=>{console.log(h.default.blue(`\u{1F9C0} Welcome to Raclette App Interactive Setup!
|
|
11
11
|
`));let t=await Oe({message:"What is your project name?",default:e||"my-raclette-app",validate:l=>l.trim()?!0:"Project name is required"}),n=await Oe({message:"Enter your GitLab deploy token for .npmrc (leave empty to skip, but 'yarn install' won't work):",validate:l=>l&&!l.match(/^[a-zA-Z0-9_-]+$/)?"Deploy token should only contain alphanumeric characters, hyphens, and underscores":!0}),r=await Ee({message:"Do you want to include the raclette dashboard (highly recommended)?",default:!0}),o={projectName:t,deployToken:n||void 0,includeDashboard:r};return console.log(h.default.blue(`
|
|
12
|
-
\u{1F4CB} Configuration Summary:`)),console.log(h.default.white(` Project: ${o.projectName}`)),console.log(h.default.white(` Deploy Token: ${o.deployToken?"\u2713 Provided":"\u2717 Skipped"}`)),console.log(h.default.white(` Include raclette dashboard: ${o.includeDashboard}`)),await Ee({message:"Proceed with this configuration?",default:!0})||(console.log(h.default.yellow("Setup cancelled.")),process.exit(0)),o},ct=async(e,t)=>{let n=B.join(
|
|
12
|
+
\u{1F4CB} Configuration Summary:`)),console.log(h.default.white(` Project: ${o.projectName}`)),console.log(h.default.white(` Deploy Token: ${o.deployToken?"\u2713 Provided":"\u2717 Skipped"}`)),console.log(h.default.white(` Include raclette dashboard: ${o.includeDashboard}`)),await Ee({message:"Proceed with this configuration?",default:!0})||(console.log(h.default.yellow("Setup cancelled.")),process.exit(0)),o},ct=async(e,t)=>{let n=B.join(import.meta.dirname,"templates");console.log(h.default.blue("\u{1F4C1} Copying template files...")),await y.copy(n,e),await it(e,t)},it=async(e,t)=>{console.log(h.default.blue("\u{1F504} Processing template files..."));let n=await at(e);for(let r of n){let o=B.extname(r);[".png",".jpg",".jpeg",".gif",".ico",".woff",".woff2",".ttf",".eot"].includes(o)||await ut(r,t)}},at=async e=>{let t=[],n=async r=>{let o=await y.readdir(r);for(let s of o){let l=B.join(r,s);(await y.stat(l)).isDirectory()?s!=="node_modules"&&s!==".git"&&!s.startsWith(".")&&await n(l):t.push(l)}};return await n(e),t},ut=async(e,t)=>{if(!await y.pathExists(e))return;let n=await y.readFile(e,"utf-8");n=n.replace(/{{PROJECT_NAME}}/g,t.projectName),n=n.replace(/{{PROJECT_NAME_KEBAB}}/g,ft(t.projectName)),n=n.replace(/{{DEPLOY_TOKEN}}/g,t.deployToken||""),t.includeDashboard!==void 0&&(n=n.replace(/{{#if INCLUDE_DASHBOARD}}([\s\S]*?){{\/if}}/g,t.includeDashboard?"$1":""),n=n.replace(/^\s*\n/gm,"")),await y.writeFile(e,n)},ft=e=>e.replace(/([a-z])([A-Z])/g,"$1-$2").replace(/[\s_]+/g,"-").toLowerCase();var Re=new ht;Re.name("create-raclette-app").description("Create a new raclette application - interactive prompts").version("1.0.0").action(async()=>{try{await je(void 0,!0)}catch(e){console.error(Me.default.red("Error creating Raclette app:"),e),process.exit(1)}});Re.parse();
|