create-qwik 0.22.0 → 0.22.1

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.22.0
3
+ * create-qwik 0.22.1
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
@@ -88,4 +88,4 @@ ${N("\u251C"+"\u2500".repeat(r+2)+"\u256F")}
88
88
  `).trim()+`
89
89
  `,type:"modify"})}catch{D.files.push({path:t,content:r,type:"create"})}}async function Hu(D,e){let r=(await V()).find(n=>n.id===e.integration);if(!r)throw new Error(`Unable to find integration "${e.integration}"`);let s={files:[],installedDeps:{}};e.installDeps&&(s.installedDeps={...r.pkgJson.dependencies,...r.pkgJson.devDependencies}),await Ku(s,e,r.dir,e.rootDir);let i=async n=>{let c=Object.keys(s.installedDeps).length>0,a=ou();n&&a.start(`Updating app${c?" and installing dependencies":""}...`);let p=!0;try{let l=new Set(s.files.map(C=>(0,Me.dirname)(C.path)));for(let C of Array.from(l))try{Yu.default.mkdirSync(C,{recursive:!0})}catch{}let F=Promise.all(s.files.map(async C=>{await Yu.default.promises.writeFile(C.path,C.content)}));if(e.installDeps&&Object.keys(s.installedDeps).length>0){let{install:C}=Uu(D,e.rootDir);p=await C}if(await F,n&&a.stop("App updated"),!p){let C=`${uu(` ${D} install failed `)}
90
90
  You might need to run "${b(`${D} install`)}" manually inside the root of the project.`;j.error(C)}}catch(l){n&&a.stop("App updated"),L(String(l))}};return{rootDir:e.rootDir,integration:r,updates:s,commit:i}}async function Zu(D,e){rr()?e=process.cwd():(e=Xu(e),Z.default.existsSync(e)&&L(`Directory "${e}" already exists. Please either remove this directory, or choose another location.`));let t=M(),s=await Q({starterId:D,outDir:e});return Qu(t,s,!1),s}function Qu(D,e,t){let r=process.cwd()===e.outDir,s=(0,_.relative)(process.cwd(),e.outDir),i=[];r?i.push(`\u{1F984} ${Du(" Success! ")}`):i.push(`\u{1F984} ${Du(" Success! ")} ${b("Project created in")} ${aD(A(s))} ${b("directory")}`),i.push(""),i.push(`\u{1F430} ${b("Next steps:")}`),r||i.push(` cd ${s}`),t||i.push(` ${D} install`),i.push(` ${D} start`),i.push("");let u=D!=="npm"?`${D} qwik add`:"npm run qwik add";return i.push(`\u{1F90D} ${b("Integrations? Add Netlify, Cloudflare, Tailwind...")}`),i.push(` ${u}`),i.push(""),i.push(GD(e.docs)),i.push(`\u{1F440} ${b("Presentations, Podcasts and Videos:")}`),i.push(" https://qwik.builder.io/media/"),i.push(""),i.join(`
91
- `)}async function Q(D){let e=M();if(!Ne(D.starterId))throw new Error("Missing starter id");if(!Ne(D.outDir))throw new Error("Missing outDir");if(!(0,_.isAbsolute)(D.outDir))throw new Error("outDir must be an absolute path");Z.default.existsSync(D.outDir)||Z.default.mkdirSync(D.outDir,{recursive:!0});let t={starterId:D.starterId,outDir:D.outDir,docs:[]},r=(await V()).filter(i=>i.type==="app");if(D.starterId==="library"){let i=r.find(u=>u.id==="library");if(!i)throw new Error("Unable to find base app");await Re(e,t,i)}else{let i=r.find(n=>n.id==="base");if(!i)throw new Error("Unable to find base app");let u=r.find(n=>n.id===D.starterId);if(!u)throw new Error(`Invalid starter id "${D.starterId}". It can only be one of${r.map(n=>` "${n.id}"`)}.`);await Re(e,t,i,u)}return t}async function Re(D,e,t,r){e.docs.push(...t.docs);let s=r??t,i=WD({...t.pkgJson,name:`my-${s.pkgJson.name}`,description:s.pkgJson.description,scripts:void 0,dependencies:void 0,devDependencies:void 0});await ND(e.outDir,i);let u=(0,_.join)(e.outDir,"README.md");await Z.default.promises.writeFile(u,""),await(await Hu(D,{rootDir:e.outDir,integration:t.id,installDeps:!1})).commit(!1),r&&(e.docs.push(...r.docs),await(await Hu(D,{rootDir:e.outDir,integration:r.id,installDeps:!1})).commit(!1))}function Ne(D){return typeof D=="string"&&D.trim().length>0}function Xu(D){return(0,_.resolve)(process.cwd(),D)}function rr(){return sr()}function sr(){try{return process.cwd().startsWith("/home/projects/")}catch{}return!1}var uD=$(require("fs")),qe=require("path");async function DD(){OD(`Let's create a ${CD(" Qwik App ")} \u2728 (v0.22.0)`),await qD(500);let D="./qwik-app",e=await jD({message:"Where would you like to create your new project?",placeholder:D,validate(y){if(y.trim()==="."||y.trim()==="./")return"Please don't use '.' or './' and let qwik create the directory for you."}})||D;P(e)&&(H("Operation cancelled."),process.exit(0));let t=M(),s=(await V()).filter(y=>y.type==="app"),i=s.find(y=>y.id==="base"),u=s.filter(y=>y.id!==i.id),n=Pe(t,i),c=Xu(e.trim()),a=null;if(uD.default.existsSync(c)){let y=await ju({message:`Directory "./${(0,qe.relative)(process.cwd(),c)}" already exists. What would you like to do?`,options:[{value:"exit",label:"Do not overwrite this directory and exit"},{value:"replace",label:"Overwrite and replace this directory"}]});(P(y)||y==="exit")&&(H("Operation cancelled."),process.exit(0)),y==="replace"&&(a=uD.default.promises.rm(c,{recursive:!0}))}let p=await ju({message:"Select a starter",options:u.map(y=>{var eD;return{label:y.name,value:y.id,hint:(eD=y.pkgJson)==null?void 0:eD.description}})});P(p)&&(H("Operation cancelled."),process.exit(0));let l=p,F=await ID({message:`Would you like to install ${t} dependencies?`,initialValue:!0});P(F)&&(H("Operation cancelled."),process.exit(0)),a&&await a;let C=F,B={starterId:l,outDir:c},I=ou();I.start("Creating App");let U=await Q(B);I.stop("Created App \u{1F430}");let pu=!1;return C&&(I.start("Installing dependencies"),pu=await n.complete(C,U.outDir),I.stop(`${pu?"Installed":"Failed to install"} dependencies \u{1F4CB}`)),JD(Qu(t,U,pu),"Result"),Iu("Happy coding! \u{1F407}"),U}async function ir(){console.clear(),VD(),nr();try{let D=process.argv.slice(2);D.length>=2?await Zu(D[0],D[1]):await DD()}catch(D){L(D.message||D)}}function nr(){let D=process.version,[e,t]=D.replace("v","").split(".");Number(e)<16?(console.error(T(`Qwik requires Node.js 16.8 or higher. You are currently running Node.js ${D}.`)),process.exit(1)):Number(e)===16?Number(t)<8&&console.warn(lD(`Node.js 16.8 or higher is recommended. You are currently running Node.js ${D}.`)):Number(e)===18&&Number(t)<11&&console.error(T(`Node.js 18.11 or higher is REQUIRED. From Node 18.0.0 to 18.11.0, there is a bug preventing correct behaviour of Qwik. You are currently running Node.js ${D}. https://github.com/BuilderIO/qwik/issues/3035`))}0&&(module.exports={createApp,runCli,runCreateCli,runCreateInteractiveCli});
91
+ `)}async function Q(D){let e=M();if(!Ne(D.starterId))throw new Error("Missing starter id");if(!Ne(D.outDir))throw new Error("Missing outDir");if(!(0,_.isAbsolute)(D.outDir))throw new Error("outDir must be an absolute path");Z.default.existsSync(D.outDir)||Z.default.mkdirSync(D.outDir,{recursive:!0});let t={starterId:D.starterId,outDir:D.outDir,docs:[]},r=(await V()).filter(i=>i.type==="app");if(D.starterId==="library"){let i=r.find(u=>u.id==="library");if(!i)throw new Error("Unable to find base app");await Re(e,t,i)}else{let i=r.find(n=>n.id==="base");if(!i)throw new Error("Unable to find base app");let u=r.find(n=>n.id===D.starterId);if(!u)throw new Error(`Invalid starter id "${D.starterId}". It can only be one of${r.map(n=>` "${n.id}"`)}.`);await Re(e,t,i,u)}return t}async function Re(D,e,t,r){e.docs.push(...t.docs);let s=r??t,i=WD({...t.pkgJson,name:`my-${s.pkgJson.name}`,description:s.pkgJson.description,scripts:void 0,dependencies:void 0,devDependencies:void 0});await ND(e.outDir,i);let u=(0,_.join)(e.outDir,"README.md");await Z.default.promises.writeFile(u,""),await(await Hu(D,{rootDir:e.outDir,integration:t.id,installDeps:!1})).commit(!1),r&&(e.docs.push(...r.docs),await(await Hu(D,{rootDir:e.outDir,integration:r.id,installDeps:!1})).commit(!1))}function Ne(D){return typeof D=="string"&&D.trim().length>0}function Xu(D){return(0,_.resolve)(process.cwd(),D)}function rr(){return sr()}function sr(){try{return process.cwd().startsWith("/home/projects/")}catch{}return!1}var uD=$(require("fs")),qe=require("path");async function DD(){OD(`Let's create a ${CD(" Qwik App ")} \u2728 (v0.22.1)`),await qD(500);let D="./qwik-app",e=await jD({message:"Where would you like to create your new project?",placeholder:D,validate(y){if(y.trim()==="."||y.trim()==="./")return"Please don't use '.' or './' and let qwik create the directory for you."}})||D;P(e)&&(H("Operation cancelled."),process.exit(0));let t=M(),s=(await V()).filter(y=>y.type==="app"),i=s.find(y=>y.id==="base"),u=s.filter(y=>y.id!==i.id),n=Pe(t,i),c=Xu(e.trim()),a=null;if(uD.default.existsSync(c)){let y=await ju({message:`Directory "./${(0,qe.relative)(process.cwd(),c)}" already exists. What would you like to do?`,options:[{value:"exit",label:"Do not overwrite this directory and exit"},{value:"replace",label:"Overwrite and replace this directory"}]});(P(y)||y==="exit")&&(H("Operation cancelled."),process.exit(0)),y==="replace"&&(a=uD.default.promises.rm(c,{recursive:!0}))}let p=await ju({message:"Select a starter",options:u.map(y=>{var eD;return{label:y.name,value:y.id,hint:(eD=y.pkgJson)==null?void 0:eD.description}})});P(p)&&(H("Operation cancelled."),process.exit(0));let l=p,F=await ID({message:`Would you like to install ${t} dependencies?`,initialValue:!0});P(F)&&(H("Operation cancelled."),process.exit(0)),a&&await a;let C=F,B={starterId:l,outDir:c},I=ou();I.start("Creating App");let U=await Q(B);I.stop("Created App \u{1F430}");let pu=!1;return C&&(I.start("Installing dependencies"),pu=await n.complete(C,U.outDir),I.stop(`${pu?"Installed":"Failed to install"} dependencies \u{1F4CB}`)),JD(Qu(t,U,pu),"Result"),Iu("Happy coding! \u{1F407}"),U}async function ir(){console.clear(),VD(),nr();try{let D=process.argv.slice(2);D.length>=2?await Zu(D[0],D[1]):await DD()}catch(D){L(D.message||D)}}function nr(){let D=process.version,[e,t]=D.replace("v","").split(".");Number(e)<16?(console.error(T(`Qwik requires Node.js 16.8 or higher. You are currently running Node.js ${D}.`)),process.exit(1)):Number(e)===16?Number(t)<8&&console.warn(lD(`Node.js 16.8 or higher is recommended. You are currently running Node.js ${D}.`)):Number(e)===18&&Number(t)<11&&console.error(T(`Node.js 18.11 or higher is REQUIRED. From Node 18.0.0 to 18.11.0, there is a bug preventing correct behaviour of Qwik. You are currently running Node.js ${D}. https://github.com/BuilderIO/qwik/issues/3035`))}0&&(module.exports={createApp,runCli,runCreateCli,runCreateInteractiveCli});
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "create-qwik",
3
- "version": "0.22.0",
3
+ "version": "0.22.1",
4
4
  "description": "Interactive CLI for create Qwik projects and adding features.",
5
5
  "bin": "./create-qwik.cjs",
6
6
  "main": "./index.cjs",
@@ -16,20 +16,18 @@
16
16
  "qwik": "qwik"
17
17
  },
18
18
  "devDependencies": {
19
- "@builder.io/qwik": "0.22.0",
20
- "@builder.io/qwik-city": "0.6.2",
19
+ "@builder.io/qwik": "0.22.1",
20
+ "@builder.io/qwik-city": "0.6.3",
21
21
  "@types/eslint": "8.21.2",
22
22
  "@types/node": "^18.15.3",
23
- "@types/node-fetch": "latest",
24
23
  "@typescript-eslint/eslint-plugin": "5.55.0",
25
24
  "@typescript-eslint/parser": "5.55.0",
26
- "eslint-plugin-qwik": "0.22.0",
25
+ "eslint-plugin-qwik": "0.22.1",
27
26
  "eslint": "8.36.0",
28
- "node-fetch": "3.3.0",
29
27
  "undici": "5.21.0",
30
28
  "prettier": "2.8.4",
31
- "typescript": "4.9.5",
32
- "vite": "4.1.4",
29
+ "typescript": "5.0.2",
30
+ "vite": "4.2.0",
33
31
  "vite-tsconfig-paths": "3.5.0"
34
32
  },
35
33
  "engines": {
@@ -32,20 +32,18 @@
32
32
  "release": "np"
33
33
  },
34
34
  "devDependencies": {
35
- "@builder.io/qwik": "0.22.0",
35
+ "@builder.io/qwik": "0.22.1",
36
36
  "@types/eslint": "8.21.2",
37
37
  "@types/node": "^18.15.3",
38
- "@types/node-fetch": "latest",
39
38
  "@typescript-eslint/eslint-plugin": "5.55.0",
40
39
  "@typescript-eslint/parser": "5.55.0",
41
40
  "eslint-plugin-qwik": "latest",
42
41
  "eslint": "8.36.0",
43
- "node-fetch": "3.3.0",
44
42
  "undici": "5.21.0",
45
43
  "np": "7.6.1",
46
44
  "prettier": "2.8.4",
47
- "typescript": "4.9.5",
48
- "vite": "4.1.4"
45
+ "typescript": "5.0.2",
46
+ "vite": "4.2.0"
49
47
  },
50
48
  "__qwik__": {
51
49
  "displayName": "Component library",