create-qwik 0.15.1 → 0.15.2-dev20221208113418
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/index.cjs
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* @license
|
|
3
|
-
* create-qwik 0.15.
|
|
3
|
+
* create-qwik 0.15.2-dev20221208113418
|
|
4
4
|
* Copyright Builder.io, Inc. All Rights Reserved.
|
|
5
5
|
* Use of this source code is governed by an MIT-style license that can be
|
|
6
6
|
* found in the LICENSE file at https://github.com/BuilderIO/qwik/blob/main/LICENSE
|
|
@@ -125,7 +125,7 @@ ${m.bgRed(` ${t} install failed `)}
|
|
|
125
125
|
|
|
126
126
|
You might need to run "${m.green(`${t} install`)}" manually inside the root of the project.
|
|
127
127
|
|
|
128
|
-
`;console.error(g)}}catch(f){u&&u.fail(),Ve(String(f))}};return{rootDir:e.rootDir,integration:i,updates:s,commit:n}}async function zi(t,e){Lp()?e=process.cwd():(e=Xi(e),$t.default.existsSync(e)&&Ve(`Directory "${e}" already exists. Please either remove this directory, or choose another location.`));let r=Ie(),s=await kt({starterId:t,outDir:e});return Zi(r,s,!1),s}function Zi(t,e,r){console.log(""),console.log("");let i=process.cwd()===e.outDir,s=(0,Ce.relative)(process.cwd(),e.outDir);console.log(i?`\u{1F984} ${m.bgMagenta(" Success! ")}`:`\u{1F984} ${m.bgMagenta(" Success! ")} ${m.cyan("Project created in")} ${m.bold(m.magenta(s))} ${m.cyan("directory")}`),console.log(""),console.log(`\u{1F430} ${m.cyan("Next steps:")}`),i||console.log(` cd ${s}`),r||console.log(` ${t} install`),console.log(` ${t} start`),console.log("");let n=t!=="npm"?`${t} qwik add`:"npm run qwik add";console.log(`\u{1F50C} ${m.cyan("Integrations? Add Netlify, Cloudflare, Tailwind...")}`),console.log(` ${n}`),console.log(""),On(e.docs),console.log(`\u{1F4FA} ${m.cyan("Presentations, Podcasts and Videos:")}`),console.log(" https://qwik.builder.io/media/"),console.log("")}async function kt(t){let e=Ie();if(!sl(t.starterId))throw new Error("Missing starter id");if(!sl(t.outDir))throw new Error("Missing outDir");if(!(0,Ce.isAbsolute)(t.outDir))throw new Error("outDir must be an absolute path");$t.default.existsSync(t.outDir)||$t.default.mkdirSync(t.outDir,{recursive:!0});let r={starterId:t.starterId,outDir:t.outDir,docs:[]},i=(await Je()).filter(n=>n.type==="app");if(t.starterId==="library"){let n=i.find(o=>o.id==="library");if(!n)throw new Error("Unable to find base app");await il(e,r,n)}else{let n=i.find(a=>a.id==="base");if(!n)throw new Error("Unable to find base app");let o=i.find(a=>a.id===t.starterId);if(!o)throw new Error(`Invalid starter id "${t.starterId}". It can only be one of${i.map(a=>` "${a.id}"`)}.`);await il(e,r,n,o)}return r}async function il(t,e,r,i){e.docs.push(...r.docs);let s=i??r,n=En({...r.pkgJson,name:`my-${s.pkgJson.name}`,description:s.pkgJson.description,scripts:void 0,dependencies:void 0,devDependencies:void 0});await Sn(e.outDir,n);let o=(0,Ce.join)(e.outDir,"README.md");await $t.default.promises.writeFile(o,""),await(await Ki(t,{rootDir:e.outDir,integration:r.id,installDeps:!1})).commit(!1),i&&(e.docs.push(...i.docs),await(await Ki(t,{rootDir:e.outDir,integration:i.id,installDeps:!1})).commit(!1))}function sl(t){return typeof t=="string"&&t.trim().length>0}function Xi(t){return(0,Ce.resolve)(process.cwd(),t)}function Lp(){return Fp()}function Fp(){try{return process.cwd().startsWith("/home/projects/")}catch{}return!1}var un=A(require("fs")),$c=require("path"),Jt=A(Pc());async function hn(){W0(),console.log(""),console.clear(),console.log(""),console.log(`\u{1F430} ${m.cyan("Let's create a")} ${m.bold(m.magenta("Qwik"))} ${m.cyan("app")} \u{1F407} ${m.dim("v0.15.
|
|
128
|
+
`;console.error(g)}}catch(f){u&&u.fail(),Ve(String(f))}};return{rootDir:e.rootDir,integration:i,updates:s,commit:n}}async function zi(t,e){Lp()?e=process.cwd():(e=Xi(e),$t.default.existsSync(e)&&Ve(`Directory "${e}" already exists. Please either remove this directory, or choose another location.`));let r=Ie(),s=await kt({starterId:t,outDir:e});return Zi(r,s,!1),s}function Zi(t,e,r){console.log(""),console.log("");let i=process.cwd()===e.outDir,s=(0,Ce.relative)(process.cwd(),e.outDir);console.log(i?`\u{1F984} ${m.bgMagenta(" Success! ")}`:`\u{1F984} ${m.bgMagenta(" Success! ")} ${m.cyan("Project created in")} ${m.bold(m.magenta(s))} ${m.cyan("directory")}`),console.log(""),console.log(`\u{1F430} ${m.cyan("Next steps:")}`),i||console.log(` cd ${s}`),r||console.log(` ${t} install`),console.log(` ${t} start`),console.log("");let n=t!=="npm"?`${t} qwik add`:"npm run qwik add";console.log(`\u{1F50C} ${m.cyan("Integrations? Add Netlify, Cloudflare, Tailwind...")}`),console.log(` ${n}`),console.log(""),On(e.docs),console.log(`\u{1F4FA} ${m.cyan("Presentations, Podcasts and Videos:")}`),console.log(" https://qwik.builder.io/media/"),console.log("")}async function kt(t){let e=Ie();if(!sl(t.starterId))throw new Error("Missing starter id");if(!sl(t.outDir))throw new Error("Missing outDir");if(!(0,Ce.isAbsolute)(t.outDir))throw new Error("outDir must be an absolute path");$t.default.existsSync(t.outDir)||$t.default.mkdirSync(t.outDir,{recursive:!0});let r={starterId:t.starterId,outDir:t.outDir,docs:[]},i=(await Je()).filter(n=>n.type==="app");if(t.starterId==="library"){let n=i.find(o=>o.id==="library");if(!n)throw new Error("Unable to find base app");await il(e,r,n)}else{let n=i.find(a=>a.id==="base");if(!n)throw new Error("Unable to find base app");let o=i.find(a=>a.id===t.starterId);if(!o)throw new Error(`Invalid starter id "${t.starterId}". It can only be one of${i.map(a=>` "${a.id}"`)}.`);await il(e,r,n,o)}return r}async function il(t,e,r,i){e.docs.push(...r.docs);let s=i??r,n=En({...r.pkgJson,name:`my-${s.pkgJson.name}`,description:s.pkgJson.description,scripts:void 0,dependencies:void 0,devDependencies:void 0});await Sn(e.outDir,n);let o=(0,Ce.join)(e.outDir,"README.md");await $t.default.promises.writeFile(o,""),await(await Ki(t,{rootDir:e.outDir,integration:r.id,installDeps:!1})).commit(!1),i&&(e.docs.push(...i.docs),await(await Ki(t,{rootDir:e.outDir,integration:i.id,installDeps:!1})).commit(!1))}function sl(t){return typeof t=="string"&&t.trim().length>0}function Xi(t){return(0,Ce.resolve)(process.cwd(),t)}function Lp(){return Fp()}function Fp(){try{return process.cwd().startsWith("/home/projects/")}catch{}return!1}var un=A(require("fs")),$c=require("path"),Jt=A(Pc());async function hn(){W0(),console.log(""),console.clear(),console.log(""),console.log(`\u{1F430} ${m.cyan("Let's create a")} ${m.bold(m.magenta("Qwik"))} ${m.cyan("app")} \u{1F407} ${m.dim("v0.15.2-dev20221208113418")}`),console.log("");let t=Ie(),r=(await Je()).filter(S=>S.type==="app"),i=r.find(S=>S.id==="base"),s=r.filter(S=>S.id!==i.id),n=tl(t,i),o=await(0,Jt.default)({type:"text",name:"outDir",message:"Where would you like to create your new project?",initial:"./qwik-app"},{onCancel:()=>{console.log(""),process.exit(1)}});console.log("");let a=Xi(o.outDir.trim()),l=null;if(un.default.existsSync(a)){let S=await(0,Jt.default)({type:"select",name:"outDirChoice",message:`Directory "./${(0,$c.relative)(process.cwd(),a)}" already exists. What would you like to do?`,choices:[{title:"Do not overwrite this directory and exit",value:"exit"},{title:"Overwrite and replace this directory",value:"replace"}],hint:"(use \u2193\u2191 arrows, hit enter)"},{onCancel:async()=>{console.log(m.dim(` - Exited without modifying "${a}"`)+`
|
|
129
129
|
`),await n.abort(),process.exit(1)}});console.log(""),S.outDirChoice==="replace"?l=un.default.promises.rm(a,{recursive:!0}):(console.log(m.dim(` - Exited without modifying "${a}"`)+`
|
|
130
130
|
`),await n.abort(),process.exit(1))}let u=await(0,Jt.default)({type:"select",name:"starterId",message:"Select a starter",choices:s.map(S=>{var w;return{title:S.name,value:S.id,description:"\u2514\u2500"+((w=S.pkgJson)==null?void 0:w.description)}}),hint:"(use \u2193\u2191 arrows, hit enter)"},{onCancel:async()=>{console.log(""),await n.abort(),process.exit(1)}});console.log("");let p=u.starterId,f=await(0,Jt.default)({type:"confirm",name:"runInstall",message:`Would you like to install ${t} dependencies?`,initial:!0},{onCancel:async()=>{console.log(""),await n.abort(),process.exit(1)}});console.log(""),l&&await l;let d=f.runInstall,v=await kt({starterId:p,outDir:a}),b=await n.complete(d,v.outDir);return Zi(t,v,b),v}function W0(){let t=process.version,[e,r]=t.replace("v","").split(".");Number(e)<16?(console.error(m.red(`Qwik requires Node.js 16.8 or higher. You are currently running Node.js ${t}.`)),process.exit(1)):Number(e)===16&&Number(r)<8&&console.warn(m.yellow(`Node.js 16.8 or higher is recommended. You are currently running Node.js ${t}.`))}async function G0(){try{let t=process.argv.slice(2);t.length>=2?await zi(t[0],t[1]):await hn()}catch(t){Ve(t.message||t)}}0&&(module.exports={createApp,runCli,runCreateCli,runCreateInteractiveCli});
|
|
131
131
|
/*! safe-buffer. MIT License. Feross Aboukhadijeh <https://feross.org/opensource> */
|
package/package.json
CHANGED
|
@@ -16,13 +16,13 @@
|
|
|
16
16
|
"qwik": "qwik"
|
|
17
17
|
},
|
|
18
18
|
"devDependencies": {
|
|
19
|
-
"@builder.io/qwik": "0.15.
|
|
19
|
+
"@builder.io/qwik": "0.15.2-dev20221208113418",
|
|
20
20
|
"@builder.io/qwik-city": "0.0.128",
|
|
21
21
|
"@types/eslint": "8.4.10",
|
|
22
22
|
"@types/node": "latest",
|
|
23
23
|
"@typescript-eslint/eslint-plugin": "5.45.0",
|
|
24
24
|
"@typescript-eslint/parser": "5.45.0",
|
|
25
|
-
"eslint-plugin-qwik": "0.15.
|
|
25
|
+
"eslint-plugin-qwik": "0.15.2-dev20221208113418",
|
|
26
26
|
"eslint": "8.28.0",
|
|
27
27
|
"node-fetch": "3.3.0",
|
|
28
28
|
"prettier": "2.8.0",
|