create-qwik 1.1.2 → 1.1.4
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 1.1.
|
|
3
|
+
* create-qwik 1.1.4
|
|
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
|
|
@@ -99,4 +99,4 @@ ${T("\u251C"+"\u2500".repeat(r+2)+"\u256F")}
|
|
|
99
99
|
`+s.trim()+`
|
|
100
100
|
`;e.files.push({path:D,content:i,type:"modify"})}catch{e.files.push({path:D,content:r,type:"create"})}}async function De(e,t){let r=(await U()).find(n=>n.id===t.integration);if(!r)throw new Error(`Unable to find integration "${t.integration}"`);let s={files:[],installedDeps:{},installedScripts:Object.keys(r.pkgJson.scripts||{})};t.installDeps&&(s.installedDeps={...r.pkgJson.dependencies,...r.pkgJson.devDependencies}),await ee(s,t,r.dir,t.rootDir);let i=async n=>{let a=Object.keys(s.installedDeps).length>0,c=lu();n&&c.start(`Updating app${a?" and installing dependencies":""}...`);let p=!0;try{let l=new Set(s.files.map(C=>(0,qt.dirname)(C.path)));for(let C of Array.from(l))try{te.default.mkdirSync(C,{recursive:!0})}catch{}let F=Promise.all(s.files.map(async C=>{await te.default.promises.writeFile(C.path,C.content)}));if(t.installDeps&&Object.keys(s.installedDeps).length>0){let{install:C}=ue(e,t.rootDir);p=await C}if(await F,n&&c.stop("App updated"),!p){let C=`${ru(` ${e} install failed `)}
|
|
101
101
|
You might need to run "${S(`${e} install`)}" manually inside the root of the project.`;$.error(C)}}catch(l){n&&c.stop("App updated"),G(String(l))}};return{rootDir:t.rootDir,integration:r,updates:s,commit:i}}var Vt=y(require("os"));async function re(e,t){nr()?t=process.cwd():(t=ie(t),X.default.existsSync(t)&&G(`Directory "${t}" already exists. Please either remove this directory, or choose another location.`));let D=N(),s=await uu({starterId:e,outDir:t});return se(D,s,!1),s}function se(e,t,D){let r=process.cwd()===t.outDir,s=(0,_.relative)(process.cwd(),t.outDir),i=[];r?i.push(`\u{1F984} ${fu(" Success! ")}`):i.push(`\u{1F984} ${fu(" Success! ")} ${S("Project created in")} ${Ce(k(s))} ${S("directory")}`),i.push(""),i.push(`\u{1F430} ${S("Next steps:")}`),r||i.push(` cd ${s}`),D||i.push(` ${e} install`),i.push(` ${e} start`),i.push("");let u=e!=="npm"?`${e} qwik add`:"npm run qwik add";return i.push(`\u{1F90D} ${S("Integrations? Add Netlify, Cloudflare, Tailwind...")}`),i.push(` ${u}`),i.push(""),i.push(Rt(t.docs)),i.push(`\u{1F440} ${S("Presentations, Podcasts and Videos:")}`),i.push(" https://qwik.builder.io/media/"),i.push(""),i.join(`
|
|
102
|
-
`)}async function uu(e){let t=N();if(!Lt(e.starterId))throw new Error("Missing starter id");if(!Lt(e.outDir))throw new Error("Missing outDir");if(!(0,_.isAbsolute)(e.outDir))throw new Error("outDir must be an absolute path");X.default.existsSync(e.outDir)||X.default.mkdirSync(decodeURIComponent(e.outDir),{recursive:!0});let D={starterId:e.starterId,outDir:e.outDir,docs:[]},r=(await U()).filter(i=>i.type==="app");if(e.starterId==="library"){let i=r.find(u=>u.id==="library");if(!i)throw new Error("Unable to find base app");await Wt(t,D,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===e.starterId);if(!u)throw new Error(`Invalid starter id "${e.starterId}". It can only be one of${r.map(n=>` "${n.id}"`)}.`);await Wt(t,D,i,u)}return D}async function Wt(e,t,D,r){t.docs.push(...D.docs);let s=r??D,i=Ot({...D.pkgJson,name:`my-${s.pkgJson.name}`,description:s.pkgJson.description,scripts:void 0,dependencies:void 0,devDependencies:void 0});await jt(t.outDir,i);let u=(0,_.join)(t.outDir,"README.md");await X.default.promises.writeFile(u,""),await(await De(e,{rootDir:t.outDir,integration:D.id,installDeps:!1})).commit(!1),r&&(t.docs.push(...r.docs),await(await De(e,{rootDir:t.outDir,integration:r.id,installDeps:!1})).commit(!1))}function Lt(e){return typeof e=="string"&&e.trim().length>0}function ie(e){return e.startsWith("~/")?(0,_.resolve)(Vt.default.homedir(),e):(0,_.resolve)(process.cwd(),e)}function nr(){return or()}function or(){try{return process.cwd().startsWith("/home/projects/")}catch{}return!1}var eu=y(require("fs")),hu=require("path");async function ne(){Pe(`Let's create a ${gu(" Qwik App ")} \u2728 (v1.1.
|
|
102
|
+
`)}async function uu(e){let t=N();if(!Lt(e.starterId))throw new Error("Missing starter id");if(!Lt(e.outDir))throw new Error("Missing outDir");if(!(0,_.isAbsolute)(e.outDir))throw new Error("outDir must be an absolute path");X.default.existsSync(e.outDir)||X.default.mkdirSync(decodeURIComponent(e.outDir),{recursive:!0});let D={starterId:e.starterId,outDir:e.outDir,docs:[]},r=(await U()).filter(i=>i.type==="app");if(e.starterId==="library"){let i=r.find(u=>u.id==="library");if(!i)throw new Error("Unable to find base app");await Wt(t,D,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===e.starterId);if(!u)throw new Error(`Invalid starter id "${e.starterId}". It can only be one of${r.map(n=>` "${n.id}"`)}.`);await Wt(t,D,i,u)}return D}async function Wt(e,t,D,r){t.docs.push(...D.docs);let s=r??D,i=Ot({...D.pkgJson,name:`my-${s.pkgJson.name}`,description:s.pkgJson.description,scripts:void 0,dependencies:void 0,devDependencies:void 0});await jt(t.outDir,i);let u=(0,_.join)(t.outDir,"README.md");await X.default.promises.writeFile(u,""),await(await De(e,{rootDir:t.outDir,integration:D.id,installDeps:!1})).commit(!1),r&&(t.docs.push(...r.docs),await(await De(e,{rootDir:t.outDir,integration:r.id,installDeps:!1})).commit(!1))}function Lt(e){return typeof e=="string"&&e.trim().length>0}function ie(e){return e.startsWith("~/")?(0,_.resolve)(Vt.default.homedir(),e):(0,_.resolve)(process.cwd(),e)}function nr(){return or()}function or(){try{return process.cwd().startsWith("/home/projects/")}catch{}return!1}var eu=y(require("fs")),hu=require("path");async function ne(){Pe(`Let's create a ${gu(" Qwik App ")} \u2728 (v1.1.4)`),await It(500);let e="./qwik-app",t=await Te({message:`Where would you like to create your new project? ${T("(Use '.' or './' for current directory)")}`,placeholder:e})||e;M(t)&&(Z("Operation cancelled."),process.exit(0));let D=N(),s=(await U()).filter(B=>B.type==="app"),i=s.find(B=>B.id==="base"),u=s.filter(B=>B.id!==i.id),n=Nt(D,i),a=ie(t.trim());$.info(`Creating new project in ${gu(" "+a+" ")} ... \u{1F407}`);let c=null;if(eu.default.existsSync(a)&&eu.default.readdirSync(a).length>0){let B=await Nu({message:`Directory "./${(0,hu.relative)(process.cwd(),a)}" already exists and is not empty. 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"}]});(M(B)||B==="exit")&&(Z("Operation cancelled."),process.exit(0)),B==="replace"&&(c=eu.default.promises.rm(a,{recursive:!0}))}let p=await Nu({message:"Select a starter",options:u.map(B=>{var tu;return{label:B.name,value:B.id,hint:(tu=B.pkgJson)==null?void 0:tu.description}})});M(p)&&(Z("Operation cancelled."),process.exit(0));let l=p,F=await Mu({message:`Would you like to install ${D} dependencies?`,initialValue:!0});M(F)&&(Z("Operation cancelled."),process.exit(0));let C=await Mu({message:"Initialize a new git repository?",initialValue:!0});c&&await c;let w=F;w||n.abort();let R={starterId:l,outDir:a},O=lu();O.start("Creating App...");let mu=await uu(R);if(O.stop("App Created \u{1F430}"),C)if(eu.default.existsSync((0,hu.join)(a,".git")))$.info("Git has already been initialized before. Skipping...");else{O.start("Git initializing...");try{let B=[];if(B.push(await z("git",["init"],a).install),B.push(await z("git",["add","-A"],a).install),B.push(await z("git",["commit","-m","Initial commit \u26A1\uFE0F"],a).install),B.some(tu=>tu===!1))throw"";O.stop("Git initialized \u{1F3B2}")}catch{O.stop("Git failed to initialize"),$.error(x("Git failed to initialize. You can do this manually by running: git init"))}}let Eu=!1;return w&&(O.start(`Installing ${D} dependencies...`),Eu=await n.complete(mu.outDir),O.stop(`${Eu?"Installed":"Failed to install"} ${D} dependencies \u{1F4CB}`)),Pt(se(D,mu,Eu),"Result"),qu("Happy coding! \u{1F407}"),mu}async function ar(){console.clear(),Tt(),cr();try{let e=process.argv.slice(2);e.length>=2?await re(e[0],e[1]):await ne()}catch(e){G(e.message||e)}}function cr(){let e=process.version,[t,D]=e.replace("v","").split(".");Number(t)<16?(console.error(x(`Qwik requires Node.js 16.8 or higher. You are currently running Node.js ${e}.`)),process.exit(1)):Number(t)===16?Number(D)<8&&console.warn(me(`Node.js 16.8 or higher is recommended. You are currently running Node.js ${e}.`)):Number(t)===18&&Number(D)<11&&console.error(x(`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 ${e}. https://github.com/BuilderIO/qwik/issues/3035`))}0&&(module.exports={createApp,runCli,runCreateCli,runCreateInteractiveCli});
|
package/package.json
CHANGED
|
@@ -16,15 +16,15 @@
|
|
|
16
16
|
"qwik": "qwik"
|
|
17
17
|
},
|
|
18
18
|
"devDependencies": {
|
|
19
|
-
"@builder.io/qwik": "^1.1.
|
|
20
|
-
"@builder.io/qwik-city": "^1.1.
|
|
19
|
+
"@builder.io/qwik": "^1.1.4",
|
|
20
|
+
"@builder.io/qwik-city": "^1.1.4",
|
|
21
21
|
"@types/eslint": "8.37.0",
|
|
22
|
-
"@types/node": "^20.1.
|
|
23
|
-
"@typescript-eslint/eslint-plugin": "5.59.
|
|
24
|
-
"@typescript-eslint/parser": "5.59.
|
|
25
|
-
"eslint-plugin-qwik": "^1.1.
|
|
22
|
+
"@types/node": "^20.1.4",
|
|
23
|
+
"@typescript-eslint/eslint-plugin": "5.59.5",
|
|
24
|
+
"@typescript-eslint/parser": "5.59.5",
|
|
25
|
+
"eslint-plugin-qwik": "^1.1.4",
|
|
26
26
|
"eslint": "8.40.0",
|
|
27
|
-
"undici": "5.22.
|
|
27
|
+
"undici": "5.22.1",
|
|
28
28
|
"prettier": "2.8.8",
|
|
29
29
|
"typescript": "5.0.4",
|
|
30
30
|
"vite": "4.3.5",
|
|
@@ -32,14 +32,14 @@
|
|
|
32
32
|
"release": "np"
|
|
33
33
|
},
|
|
34
34
|
"devDependencies": {
|
|
35
|
-
"@builder.io/qwik": "1.1.
|
|
35
|
+
"@builder.io/qwik": "1.1.4",
|
|
36
36
|
"@types/eslint": "8.37.0",
|
|
37
|
-
"@types/node": "^20.1.
|
|
38
|
-
"@typescript-eslint/eslint-plugin": "5.59.
|
|
39
|
-
"@typescript-eslint/parser": "5.59.
|
|
37
|
+
"@types/node": "^20.1.4",
|
|
38
|
+
"@typescript-eslint/eslint-plugin": "5.59.5",
|
|
39
|
+
"@typescript-eslint/parser": "5.59.5",
|
|
40
40
|
"eslint-plugin-qwik": "latest",
|
|
41
41
|
"eslint": "8.40.0",
|
|
42
|
-
"undici": "5.22.
|
|
42
|
+
"undici": "5.22.1",
|
|
43
43
|
"np": "7.6.1",
|
|
44
44
|
"prettier": "2.8.8",
|
|
45
45
|
"typescript": "5.0.4",
|