create-qwik 1.1.5-dev20230624194124 → 1.1.5-dev20230625145153

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.
Files changed (57) hide show
  1. package/index.cjs +3 -3
  2. package/package.json +1 -1
  3. package/starters/apps/base/.eslintrc.cjs +23 -23
  4. package/starters/apps/base/package.json +3 -3
  5. package/starters/apps/base/src/entry.dev.tsx +2 -2
  6. package/starters/apps/base/src/entry.preview.tsx +3 -3
  7. package/starters/apps/base/src/entry.ssr.tsx +7 -4
  8. package/starters/apps/base/src/global.css +3 -3
  9. package/starters/apps/base/src/routes/service-worker.ts +3 -3
  10. package/starters/apps/base/vite.config.ts +5 -5
  11. package/starters/apps/basic/src/components/router-head/router-head.tsx +2 -2
  12. package/starters/apps/basic/src/components/starter/counter/counter.tsx +12 -6
  13. package/starters/apps/basic/src/components/starter/footer/footer.tsx +3 -3
  14. package/starters/apps/basic/src/components/starter/gauge/index.tsx +9 -3
  15. package/starters/apps/basic/src/components/starter/header/header.tsx +16 -7
  16. package/starters/apps/basic/src/components/starter/hero/hero.tsx +16 -11
  17. package/starters/apps/basic/src/components/starter/icons/qwik.tsx +7 -1
  18. package/starters/apps/basic/src/components/starter/infobox/infobox.tsx +2 -2
  19. package/starters/apps/basic/src/components/starter/next-steps/next-steps.tsx +25 -15
  20. package/starters/apps/basic/src/global.css +3 -3
  21. package/starters/apps/basic/src/root.tsx +8 -4
  22. package/starters/apps/basic/src/routes/demo/flower/flower.css +3 -1
  23. package/starters/apps/basic/src/routes/demo/flower/index.tsx +12 -7
  24. package/starters/apps/basic/src/routes/demo/todolist/index.tsx +8 -6
  25. package/starters/apps/basic/src/routes/index.tsx +10 -10
  26. package/starters/apps/basic/src/routes/layout.tsx +6 -6
  27. package/starters/apps/basic/src/routes/service-worker.ts +3 -3
  28. package/starters/apps/basic/src/routes/styles.css +4 -4
  29. package/starters/apps/empty/src/components/router-head/router-head.tsx +2 -2
  30. package/starters/apps/empty/src/root.tsx +8 -4
  31. package/starters/apps/empty/src/routes/index.tsx +5 -5
  32. package/starters/apps/empty/src/routes/layout.tsx +2 -2
  33. package/starters/apps/empty/src/routes/service-worker.ts +3 -3
  34. package/starters/apps/library/.eslintrc.cjs +21 -21
  35. package/starters/apps/library/src/components/counter/counter.tsx +1 -1
  36. package/starters/apps/library/src/components/logo/logo.tsx +1 -1
  37. package/starters/apps/library/src/entry.dev.tsx +2 -2
  38. package/starters/apps/library/src/entry.ssr.tsx +6 -3
  39. package/starters/apps/library/src/index.ts +2 -2
  40. package/starters/apps/library/src/root.tsx +2 -2
  41. package/starters/apps/library/vite.config.ts +6 -6
  42. package/starters/apps/site-with-visual-cms/src/components/builder-registry.ts +5 -5
  43. package/starters/apps/site-with-visual-cms/src/components/counter/counter.tsx +6 -6
  44. package/starters/apps/site-with-visual-cms/src/components/footer/footer.tsx +2 -2
  45. package/starters/apps/site-with-visual-cms/src/components/gauge/index.tsx +9 -3
  46. package/starters/apps/site-with-visual-cms/src/components/header/header.tsx +15 -6
  47. package/starters/apps/site-with-visual-cms/src/components/icons/qwik.tsx +7 -1
  48. package/starters/apps/site-with-visual-cms/src/components/router-head/router-head.tsx +2 -2
  49. package/starters/apps/site-with-visual-cms/src/entry.dev.tsx +2 -2
  50. package/starters/apps/site-with-visual-cms/src/entry.preview.tsx +3 -3
  51. package/starters/apps/site-with-visual-cms/src/entry.ssr.tsx +7 -4
  52. package/starters/apps/site-with-visual-cms/src/global.css +3 -3
  53. package/starters/apps/site-with-visual-cms/src/root.tsx +8 -4
  54. package/starters/apps/site-with-visual-cms/src/routes/[...index]/index.tsx +11 -7
  55. package/starters/apps/site-with-visual-cms/src/routes/layout.tsx +3 -3
  56. package/starters/apps/site-with-visual-cms/src/routes/service-worker.ts +3 -3
  57. package/starters/apps/site-with-visual-cms/vite.config.ts +4 -4
package/index.cjs CHANGED
@@ -1,6 +1,6 @@
1
1
  /**
2
2
  * @license
3
- * create-qwik 1.1.5-dev20230624194124
3
+ * create-qwik 1.1.5-dev20230625145153
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,7 +88,7 @@ ${T("\u251C"+"\u2500".repeat(r+2)+"\u256F")}
88
88
  `))}if(!n){let a=`${ou(` ${e} install failed `)}
89
89
  You might need to run ${S(`"${e} install"`)} manually inside the root of the project.
90
90
 
91
- `;B.error(a)}return n}}}function tr(e){let t="create-qwik-"+Math.round(Math.random()*Number.MAX_SAFE_INTEGER).toString(36).toLowerCase(),D=j.default.join(Mt.default.tmpdir(),t);try{q.default.mkdirSync(D)}catch(i){B.error(`\u274C ${x(String(i))}`)}let r=j.default.join(e.dir,"package.json"),s=j.default.join(D,"package.json");return q.default.copyFileSync(r,s),{tmpInstallDir:D}}var b=y(require("fs"),1),tu=require("path");async function ee(e,t,D,r){let s=await b.default.promises.readdir(D);await Promise.all(s.map(async i=>{let u=i==="gitignore"?".gitignore":i,n=(0,tu.extname)(u),a=(0,tu.join)(D,i),c=(0,tu.join)(r,u),p=await b.default.promises.stat(a);p.isDirectory()?await ee(e,t,a,c):p.isFile()&&(u==="package.json"?await Dr(e,a,c):u==="README.md"?await sr(e,a,c):u===".gitignore"?await ir(e,a,c):n===".css"?await nr(e,a,c):b.default.existsSync(c)?e.files.push({path:c,content:await b.default.promises.readFile(a,"utf-8"),type:"overwrite"}):e.files.push({path:c,content:await b.default.promises.readFile(a),type:"create"}))}))}async function Dr(e,t,D){var u;let r=await b.default.promises.readFile(t,"utf-8"),s=JSON.parse(r),i=["scripts","dependencies","devDependencies"];try{let n=JSON.parse(await b.default.promises.readFile(D,"utf-8"));if(i.forEach(a=>{rr(s,n,a)}),(u=n.scripts)!=null&&u.qwik){let a=n.scripts.qwik;delete n.scripts.qwik,n.scripts.qwik=a}e.files.push({path:D,content:JSON.stringify(n,null,2)+`
91
+ `;B.error(a)}return n}}}function tr(e){let t="create-qwik-"+Math.round(Math.random()*Number.MAX_SAFE_INTEGER).toString(36).toLowerCase(),D=j.default.join(Mt.default.tmpdir(),t);try{q.default.mkdirSync(D)}catch(i){B.error(`\u274C ${x(String(i))}`)}let r=j.default.join(e.dir,"package.json"),s=j.default.join(D,"package.json");return q.default.copyFileSync(r,s),{tmpInstallDir:D}}var b=y(require("fs"),1),tu=require("path");async function ee(e,t,D,r){let s=await b.default.promises.readdir(D);await Promise.all(s.map(async i=>{let u=i==="gitignore"?".gitignore":i,n=(0,tu.extname)(u),a=(0,tu.join)(D,i),c=(0,tu.join)(r,u),p=await b.default.promises.stat(a);p.isDirectory()?await ee(e,t,a,c):p.isFile()&&(u==="package.json"?await Dr(e,a,c):u==="README.md"?await sr(e,a,c):u===".gitignore"||u===".prettierignore"||u===".eslintignore"?await ir(e,a,c):n===".css"?await nr(e,a,c):b.default.existsSync(c)?e.files.push({path:c,content:await b.default.promises.readFile(a),type:"overwrite"}):e.files.push({path:c,content:await b.default.promises.readFile(a),type:"create"}))}))}async function Dr(e,t,D){var u;let r=await b.default.promises.readFile(t,"utf-8"),s=JSON.parse(r),i=["scripts","dependencies","devDependencies"];try{let n=JSON.parse(await b.default.promises.readFile(D,"utf-8"));if(i.forEach(a=>{rr(s,n,a)}),(u=n.scripts)!=null&&u.qwik){let a=n.scripts.qwik;delete n.scripts.qwik,n.scripts.qwik=a}e.files.push({path:D,content:JSON.stringify(n,null,2)+`
92
92
  `,type:"modify"})}catch{e.files.push({path:D,content:r,type:"create"})}}function rr(e,t,D){if(e[D]){t[D]?Object.assign(t[D],{...e[D]}):t[D]={...e[D]};let r={},s=Object.keys(t[D]).sort();for(let i of s)r[i]=t[D][i];t[D]=r}}async function sr(e,t,D){let r=await b.default.promises.readFile(t,"utf-8"),s,i="";try{i=await b.default.promises.readFile(D,"utf-8"),i=i.trim()+`
93
93
 
94
94
  `+r,s="modify"}catch{i=r,s="create"}let u=N();u!=="npm"&&(i=i.replace(/npm run/g,u)),e.files.push({path:D,content:i.trim()+`
@@ -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 K()).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=hu();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}=eu(e,t.rootDir);p=await C}if(await F,n&&c.stop("App updated"),!p){let C=`${ou(` ${e} install failed `)}
101
101
  You might need to run "${S(`${e} install`)}" manually inside the root of the project.`;B.error(C)}}catch(l){n&&c.stop("App updated"),U(String(l))}};return{rootDir:t.rootDir,integration:r,updates:s,commit:i}}var Vt=y(require("os"));async function re(e,t){or()?t=process.cwd():(t=ie(t),Du.default.existsSync(t)&&U(`Directory "${t}" already exists. Please either remove this directory, or choose another location.`));let D=N(),s=await ru({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} ${$u(" Success! ")}`):i.push(`\u{1F984} ${$u(" 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 ru(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");Du.default.existsSync(e.outDir)||Du.default.mkdirSync(decodeURIComponent(e.outDir),{recursive:!0});let D={starterId:e.starterId,outDir:e.outDir,docs:[]},r=(await K()).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 It(t.outDir,i);let u=(0,_.join)(t.outDir,"README.md");await Du.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 or(){return ar()}function ar(){try{return process.cwd().startsWith("/home/projects/")}catch{}return!1}var Y=y(require("fs")),su=require("path");async function ne(){Pe(`Let's create a ${fu(" Qwik App ")} \u2728 (v1.1.5-dev20230624194124)`),await jt(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)&&(uu("Operation cancelled."),process.exit(0));let D=N(),s=(await K()).filter($=>$.type==="app"),i=s.find($=>$.id==="base"),u=s.filter($=>$.id!==i.id),n=Nt(D,i),a=ie(t.trim());B.info(`Creating new project in ${fu(" "+a+" ")} ... \u{1F407}`);let c=null;if(Y.default.existsSync(a)&&Y.default.readdirSync(a).length>0){let $=await qu({message:`Directory "./${(0,su.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:"Remove contents of this directory"}]});(M($)||$==="exit")&&(uu("Operation cancelled."),process.exit(0)),$==="replace"&&(c=Y.default.promises.readdir(a).then(W=>Promise.all(W.map(Jt=>Y.default.promises.rm((0,su.join)(a,Jt),{recursive:!0})))))}let p=await qu({message:"Select a starter",options:u.map($=>{var W;return{label:$.name,value:$.id,hint:(W=$.pkgJson)==null?void 0:W.description}})});M(p)&&(uu("Operation cancelled."),process.exit(0));let l=p,F=await Nu({message:`Would you like to install ${D} dependencies?`,initialValue:!0});M(F)&&(uu("Operation cancelled."),process.exit(0));let C=await Nu({message:"Initialize a new git repository?",initialValue:!0});c&&await c;let w=F;w||n.abort();let R={starterId:l,outDir:a},O=hu();O.start("Creating App...");let iu=await ru(R);if(O.stop("App Created \u{1F430}"),C)if(Y.default.existsSync((0,su.join)(a,".git")))B.info("Git has already been initialized before. Skipping...");else{O.start("Git initializing...");try{let $=[];if($.push(await G("git",["init"],a).install),$.push(await G("git",["add","-A"],a).install),$.push(await G("git",["commit","-m","Initial commit \u26A1\uFE0F"],a).install),$.some(W=>W===!1))throw"";O.stop("Git initialized \u{1F3B2}")}catch{O.stop("Git failed to initialize"),B.error(x("Git failed to initialize. You can do this manually by running: git init"))}}let H=!1;return w&&(O.start(`Installing ${D} dependencies...`),H=await n.complete(iu.outDir),H&&(H=await eu(D,iu.outDir).install),O.stop(`${H?"Installed":"Failed to install"} ${D} dependencies \u{1F4CB}`)),Pt(se(D,iu,H),"Result"),Wu("Happy coding! \u{1F407}"),iu}async function cr(){console.clear(),Tt(),lr();try{let e=process.argv.slice(2);e.length>=2?await re(e[0],e[1]):await ne()}catch(e){U(e.message||e)}}function lr(){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});
102
+ `)}async function ru(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");Du.default.existsSync(e.outDir)||Du.default.mkdirSync(decodeURIComponent(e.outDir),{recursive:!0});let D={starterId:e.starterId,outDir:e.outDir,docs:[]},r=(await K()).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 It(t.outDir,i);let u=(0,_.join)(t.outDir,"README.md");await Du.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 or(){return ar()}function ar(){try{return process.cwd().startsWith("/home/projects/")}catch{}return!1}var Y=y(require("fs")),su=require("path");async function ne(){Pe(`Let's create a ${fu(" Qwik App ")} \u2728 (v1.1.5-dev20230625145153)`),await jt(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)&&(uu("Operation cancelled."),process.exit(0));let D=N(),s=(await K()).filter($=>$.type==="app"),i=s.find($=>$.id==="base"),u=s.filter($=>$.id!==i.id),n=Nt(D,i),a=ie(t.trim());B.info(`Creating new project in ${fu(" "+a+" ")} ... \u{1F407}`);let c=null;if(Y.default.existsSync(a)&&Y.default.readdirSync(a).length>0){let $=await qu({message:`Directory "./${(0,su.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:"Remove contents of this directory"}]});(M($)||$==="exit")&&(uu("Operation cancelled."),process.exit(0)),$==="replace"&&(c=Y.default.promises.readdir(a).then(W=>Promise.all(W.map(Jt=>Y.default.promises.rm((0,su.join)(a,Jt),{recursive:!0})))))}let p=await qu({message:"Select a starter",options:u.map($=>{var W;return{label:$.name,value:$.id,hint:(W=$.pkgJson)==null?void 0:W.description}})});M(p)&&(uu("Operation cancelled."),process.exit(0));let l=p,F=await Nu({message:`Would you like to install ${D} dependencies?`,initialValue:!0});M(F)&&(uu("Operation cancelled."),process.exit(0));let C=await Nu({message:"Initialize a new git repository?",initialValue:!0});c&&await c;let w=F;w||n.abort();let R={starterId:l,outDir:a},O=hu();O.start("Creating App...");let iu=await ru(R);if(O.stop("App Created \u{1F430}"),C)if(Y.default.existsSync((0,su.join)(a,".git")))B.info("Git has already been initialized before. Skipping...");else{O.start("Git initializing...");try{let $=[];if($.push(await G("git",["init"],a).install),$.push(await G("git",["add","-A"],a).install),$.push(await G("git",["commit","-m","Initial commit \u26A1\uFE0F"],a).install),$.some(W=>W===!1))throw"";O.stop("Git initialized \u{1F3B2}")}catch{O.stop("Git failed to initialize"),B.error(x("Git failed to initialize. You can do this manually by running: git init"))}}let H=!1;return w&&(O.start(`Installing ${D} dependencies...`),H=await n.complete(iu.outDir),H&&(H=await eu(D,iu.outDir).install),O.stop(`${H?"Installed":"Failed to install"} ${D} dependencies \u{1F4CB}`)),Pt(se(D,iu,H),"Result"),Wu("Happy coding! \u{1F407}"),iu}async function cr(){console.clear(),Tt(),lr();try{let e=process.argv.slice(2);e.length>=2?await re(e[0],e[1]):await ne()}catch(e){U(e.message||e)}}function lr(){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
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "create-qwik",
3
- "version": "1.1.5-dev20230624194124",
3
+ "version": "1.1.5-dev20230625145153",
4
4
  "description": "Interactive CLI for create Qwik projects and adding features.",
5
5
  "bin": "./create-qwik.cjs",
6
6
  "main": "./index.cjs",
@@ -6,37 +6,37 @@ module.exports = {
6
6
  node: true,
7
7
  },
8
8
  extends: [
9
- 'eslint:recommended',
10
- 'plugin:@typescript-eslint/recommended',
11
- 'plugin:qwik/recommended',
9
+ "eslint:recommended",
10
+ "plugin:@typescript-eslint/recommended",
11
+ "plugin:qwik/recommended",
12
12
  ],
13
- parser: '@typescript-eslint/parser',
13
+ parser: "@typescript-eslint/parser",
14
14
  parserOptions: {
15
15
  tsconfigRootDir: __dirname,
16
- project: ['./tsconfig.json'],
16
+ project: ["./tsconfig.json"],
17
17
  ecmaVersion: 2021,
18
- sourceType: 'module',
18
+ sourceType: "module",
19
19
  ecmaFeatures: {
20
20
  jsx: true,
21
21
  },
22
22
  },
23
- plugins: ['@typescript-eslint'],
23
+ plugins: ["@typescript-eslint"],
24
24
  rules: {
25
- '@typescript-eslint/no-explicit-any': 'off',
26
- '@typescript-eslint/explicit-module-boundary-types': 'off',
27
- '@typescript-eslint/no-inferrable-types': 'off',
28
- '@typescript-eslint/no-non-null-assertion': 'off',
29
- '@typescript-eslint/no-empty-interface': 'off',
30
- '@typescript-eslint/no-namespace': 'off',
31
- '@typescript-eslint/no-empty-function': 'off',
32
- '@typescript-eslint/no-this-alias': 'off',
33
- '@typescript-eslint/ban-types': 'off',
34
- '@typescript-eslint/ban-ts-comment': 'off',
35
- 'prefer-spread': 'off',
36
- 'no-case-declarations': 'off',
37
- 'no-console': 'off',
38
- '@typescript-eslint/no-unused-vars': ['error'],
39
- '@typescript-eslint/consistent-type-imports': 'warn',
40
- '@typescript-eslint/no-unnecessary-condition': 'warn',
25
+ "@typescript-eslint/no-explicit-any": "off",
26
+ "@typescript-eslint/explicit-module-boundary-types": "off",
27
+ "@typescript-eslint/no-inferrable-types": "off",
28
+ "@typescript-eslint/no-non-null-assertion": "off",
29
+ "@typescript-eslint/no-empty-interface": "off",
30
+ "@typescript-eslint/no-namespace": "off",
31
+ "@typescript-eslint/no-empty-function": "off",
32
+ "@typescript-eslint/no-this-alias": "off",
33
+ "@typescript-eslint/ban-types": "off",
34
+ "@typescript-eslint/ban-ts-comment": "off",
35
+ "prefer-spread": "off",
36
+ "no-case-declarations": "off",
37
+ "no-console": "off",
38
+ "@typescript-eslint/no-unused-vars": ["error"],
39
+ "@typescript-eslint/consistent-type-imports": "warn",
40
+ "@typescript-eslint/no-unnecessary-condition": "warn",
41
41
  },
42
42
  };
@@ -16,13 +16,13 @@
16
16
  "qwik": "qwik"
17
17
  },
18
18
  "devDependencies": {
19
- "@builder.io/qwik": "1.1.5-dev20230624194124",
20
- "@builder.io/qwik-city": "1.1.5-dev20230624194124",
19
+ "@builder.io/qwik": "1.1.5-dev20230625145153",
20
+ "@builder.io/qwik-city": "1.1.5-dev20230625145153",
21
21
  "@types/eslint": "8.40.2",
22
22
  "@types/node": "^20.3.1",
23
23
  "@typescript-eslint/eslint-plugin": "5.60.0",
24
24
  "@typescript-eslint/parser": "5.60.0",
25
- "eslint-plugin-qwik": "1.1.5-dev20230624194124",
25
+ "eslint-plugin-qwik": "1.1.5-dev20230625145153",
26
26
  "eslint": "8.43.0",
27
27
  "undici": "5.22.1",
28
28
  "prettier": "2.8.8",
@@ -9,8 +9,8 @@
9
9
  * - More code is transferred to the browser than in SSR mode.
10
10
  * - Optimizer/Serialization/Deserialization code is not exercised!
11
11
  */
12
- import { render, type RenderOptions } from '@builder.io/qwik';
13
- import Root from './root';
12
+ import { render, type RenderOptions } from "@builder.io/qwik";
13
+ import Root from "./root";
14
14
 
15
15
  export default function (opts: RenderOptions) {
16
16
  return render(document, <Root />, opts);
@@ -10,9 +10,9 @@
10
10
  * - https://vitejs.dev/config/preview-options.html#preview-options
11
11
  *
12
12
  */
13
- import { createQwikCity } from '@builder.io/qwik-city/middleware/node';
14
- import qwikCityPlan from '@qwik-city-plan';
15
- import render from './entry.ssr';
13
+ import { createQwikCity } from "@builder.io/qwik-city/middleware/node";
14
+ import qwikCityPlan from "@qwik-city-plan";
15
+ import render from "./entry.ssr";
16
16
 
17
17
  /**
18
18
  * The default export is the QwikCity adapter used by Vite preview.
@@ -10,9 +10,12 @@
10
10
  * - npm run build
11
11
  *
12
12
  */
13
- import { renderToStream, type RenderToStreamOptions } from '@builder.io/qwik/server';
14
- import { manifest } from '@qwik-client-manifest';
15
- import Root from './root';
13
+ import {
14
+ renderToStream,
15
+ type RenderToStreamOptions,
16
+ } from "@builder.io/qwik/server";
17
+ import { manifest } from "@qwik-client-manifest";
18
+ import Root from "./root";
16
19
 
17
20
  export default function (opts: RenderToStreamOptions) {
18
21
  return renderToStream(<Root />, {
@@ -20,7 +23,7 @@ export default function (opts: RenderToStreamOptions) {
20
23
  ...opts,
21
24
  // Use container attributes to set attributes on the html tag.
22
25
  containerAttributes: {
23
- lang: 'en-us',
26
+ lang: "en-us",
24
27
  ...opts.containerAttributes,
25
28
  },
26
29
  });
@@ -10,9 +10,9 @@ html {
10
10
  -moz-tab-size: 4;
11
11
  -o-tab-size: 4;
12
12
  tab-size: 4;
13
- font-family: ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto,
14
- 'Helvetica Neue', Arial, 'Noto Sans', sans-serif, 'Apple Color Emoji', 'Segoe UI Emoji',
15
- 'Segoe UI Symbol', 'Noto Color Emoji';
13
+ font-family: ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont,
14
+ "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans", sans-serif,
15
+ "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji";
16
16
  }
17
17
 
18
18
  body {
@@ -7,11 +7,11 @@
7
7
  * Qwik uses a service worker to speed up your site and reduce latency, ie, not used in the traditional way of offline.
8
8
  * You can also use this file to add more functionality that runs in the service worker.
9
9
  */
10
- import { setupServiceWorker } from '@builder.io/qwik-city/service-worker';
10
+ import { setupServiceWorker } from "@builder.io/qwik-city/service-worker";
11
11
 
12
12
  setupServiceWorker();
13
13
 
14
- self.addEventListener('install', () => self.skipWaiting());
15
- self.addEventListener('activate', (ev) => ev.waitUntil(self.clients.claim()));
14
+ self.addEventListener("install", () => self.skipWaiting());
15
+ self.addEventListener("activate", (ev) => ev.waitUntil(self.clients.claim()));
16
16
 
17
17
  declare const self: ServiceWorkerGlobalScope;
@@ -1,14 +1,14 @@
1
- import { defineConfig } from 'vite';
2
- import { qwikVite } from '@builder.io/qwik/optimizer';
3
- import { qwikCity } from '@builder.io/qwik-city/vite';
4
- import tsconfigPaths from 'vite-tsconfig-paths';
1
+ import { defineConfig } from "vite";
2
+ import { qwikVite } from "@builder.io/qwik/optimizer";
3
+ import { qwikCity } from "@builder.io/qwik-city/vite";
4
+ import tsconfigPaths from "vite-tsconfig-paths";
5
5
 
6
6
  export default defineConfig(() => {
7
7
  return {
8
8
  plugins: [qwikCity(), qwikVite(), tsconfigPaths()],
9
9
  preview: {
10
10
  headers: {
11
- 'Cache-Control': 'public, max-age=600',
11
+ "Cache-Control": "public, max-age=600",
12
12
  },
13
13
  },
14
14
  };
@@ -1,5 +1,5 @@
1
- import { component$ } from '@builder.io/qwik';
2
- import { useDocumentHead, useLocation } from '@builder.io/qwik-city';
1
+ import { component$ } from "@builder.io/qwik";
2
+ import { useDocumentHead, useLocation } from "@builder.io/qwik-city";
3
3
 
4
4
  /**
5
5
  * The RouterHead component is placed inside of the document `<head>` element.
@@ -1,6 +1,6 @@
1
- import { component$, useSignal, $ } from '@builder.io/qwik';
2
- import styles from './counter.module.css';
3
- import Gauge from '../gauge';
1
+ import { component$, useSignal, $ } from "@builder.io/qwik";
2
+ import styles from "./counter.module.css";
3
+ import Gauge from "../gauge";
4
4
 
5
5
  export default component$(() => {
6
6
  const count = useSignal(70);
@@ -13,12 +13,18 @@ export default component$(() => {
13
13
  });
14
14
 
15
15
  return (
16
- <div class={styles['counter-wrapper']}>
17
- <button class="button-dark button-small" onClick$={() => setCount(count.value - 1)}>
16
+ <div class={styles["counter-wrapper"]}>
17
+ <button
18
+ class="button-dark button-small"
19
+ onClick$={() => setCount(count.value - 1)}
20
+ >
18
21
  -
19
22
  </button>
20
23
  <Gauge value={count.value} />
21
- <button class="button-dark button-small" onClick$={() => setCount(count.value + 1)}>
24
+ <button
25
+ class="button-dark button-small"
26
+ onClick$={() => setCount(count.value + 1)}
27
+ >
22
28
  +
23
29
  </button>
24
30
  </div>
@@ -1,6 +1,6 @@
1
- import { component$ } from '@builder.io/qwik';
2
- import { useServerTimeLoader } from '~/routes/layout';
3
- import styles from './footer.module.css';
1
+ import { component$ } from "@builder.io/qwik";
2
+ import { useServerTimeLoader } from "~/routes/layout";
3
+ import styles from "./footer.module.css";
4
4
 
5
5
  export default component$(() => {
6
6
  const serverTime = useServerTimeLoader();
@@ -1,5 +1,5 @@
1
- import { component$ } from '@builder.io/qwik';
2
- import styles from './gauge.module.css';
1
+ import { component$ } from "@builder.io/qwik";
2
+ import styles from "./gauge.module.css";
3
3
 
4
4
  export default component$(({ value = 50 }: { value?: number }) => {
5
5
  const safeValue = value < 0 || value > 100 ? 50 : value;
@@ -14,7 +14,13 @@ export default component$(({ value = 50 }: { value?: number }) => {
14
14
  </linearGradient>
15
15
  </defs>
16
16
 
17
- <circle r="56" cx="60" cy="60" stroke-width="8" style="fill: #000; stroke: #0000"></circle>
17
+ <circle
18
+ r="56"
19
+ cx="60"
20
+ cy="60"
21
+ stroke-width="8"
22
+ style="fill: #000; stroke: #0000"
23
+ ></circle>
18
24
 
19
25
  <circle
20
26
  r="56"
@@ -1,11 +1,11 @@
1
- import { component$ } from '@builder.io/qwik';
2
- import { QwikLogo } from '../icons/qwik';
3
- import styles from './header.module.css';
1
+ import { component$ } from "@builder.io/qwik";
2
+ import { QwikLogo } from "../icons/qwik";
3
+ import styles from "./header.module.css";
4
4
 
5
5
  export default component$(() => {
6
6
  return (
7
7
  <header class={styles.header}>
8
- <div class={['container', styles.wrapper]}>
8
+ <div class={["container", styles.wrapper]}>
9
9
  <div class={styles.logo}>
10
10
  <a href="/" title="qwik">
11
11
  <QwikLogo height={50} width={143} />
@@ -13,17 +13,26 @@ export default component$(() => {
13
13
  </div>
14
14
  <ul>
15
15
  <li>
16
- <a href="https://qwik.builder.io/docs/components/overview/" target="_blank">
16
+ <a
17
+ href="https://qwik.builder.io/docs/components/overview/"
18
+ target="_blank"
19
+ >
17
20
  Docs
18
21
  </a>
19
22
  </li>
20
23
  <li>
21
- <a href="https://qwik.builder.io/examples/introduction/hello-world/" target="_blank">
24
+ <a
25
+ href="https://qwik.builder.io/examples/introduction/hello-world/"
26
+ target="_blank"
27
+ >
22
28
  Examples
23
29
  </a>
24
30
  </li>
25
31
  <li>
26
- <a href="https://qwik.builder.io/tutorial/welcome/overview/" target="_blank">
32
+ <a
33
+ href="https://qwik.builder.io/tutorial/welcome/overview/"
34
+ target="_blank"
35
+ >
27
36
  Tutorials
28
37
  </a>
29
38
  </li>
@@ -1,18 +1,18 @@
1
- import { component$ } from '@builder.io/qwik';
2
- import styles from './hero.module.css';
3
- import ImgThunder from '~/media/thunder.png?jsx';
1
+ import { component$ } from "@builder.io/qwik";
2
+ import styles from "./hero.module.css";
3
+ import ImgThunder from "~/media/thunder.png?jsx";
4
4
 
5
5
  export default component$(() => {
6
6
  return (
7
- <div class={['container', styles.hero]}>
8
- <ImgThunder class={styles['hero-image']} />
7
+ <div class={["container", styles.hero]}>
8
+ <ImgThunder class={styles["hero-image"]} />
9
9
  <h1>
10
10
  So <span class="highlight">fantastic</span>
11
11
  <br />
12
12
  to have <span class="highlight">you</span> here
13
13
  </h1>
14
14
  <p>Have fun building your App with Qwik.</p>
15
- <div class={styles['button-group']}>
15
+ <div class={styles["button-group"]}>
16
16
  <button
17
17
  onClick$={async () => {
18
18
  const defaults = {
@@ -21,7 +21,7 @@ export default component$(() => {
21
21
  gravity: 0,
22
22
  decay: 0.95,
23
23
  startVelocity: 30,
24
- colors: ['006ce9', 'ac7ff4', '18b6f6', '713fc2', 'ffffff'],
24
+ colors: ["006ce9", "ac7ff4", "18b6f6", "713fc2", "ffffff"],
25
25
  origin: {
26
26
  x: 0.5,
27
27
  y: 0.35,
@@ -33,10 +33,11 @@ export default component$(() => {
33
33
  if ((globalThis as any).confetti) {
34
34
  return resolve((globalThis as any).confetti as any);
35
35
  }
36
- const script = document.createElement('script');
36
+ const script = document.createElement("script");
37
37
  script.src =
38
- 'https://cdn.jsdelivr.net/npm/canvas-confetti@1.5.1/dist/confetti.browser.min.js';
39
- script.onload = () => resolve((globalThis as any).confetti as any);
38
+ "https://cdn.jsdelivr.net/npm/canvas-confetti@1.5.1/dist/confetti.browser.min.js";
39
+ script.onload = () =>
40
+ resolve((globalThis as any).confetti as any);
40
41
  script.onerror = reject;
41
42
  document.head.appendChild(script);
42
43
  script.remove();
@@ -68,7 +69,11 @@ export default component$(() => {
68
69
  >
69
70
  Time to celebrate
70
71
  </button>
71
- <a href="https://qwik.builder.io/docs" target="_blank" class="button button-dark">
72
+ <a
73
+ href="https://qwik.builder.io/docs"
74
+ target="_blank"
75
+ class="button button-dark"
76
+ >
72
77
  Explore the docs
73
78
  </a>
74
79
  </div>
@@ -1,4 +1,10 @@
1
- export const QwikLogo = ({ width = 100, height = 35 }: { width?: number; height?: number }) => (
1
+ export const QwikLogo = ({
2
+ width = 100,
3
+ height = 35,
4
+ }: {
5
+ width?: number;
6
+ height?: number;
7
+ }) => (
2
8
  <svg
3
9
  width={width}
4
10
  height={height}
@@ -1,5 +1,5 @@
1
- import { Slot, component$ } from '@builder.io/qwik';
2
- import styles from './infobox.module.css';
1
+ import { Slot, component$ } from "@builder.io/qwik";
2
+ import styles from "./infobox.module.css";
3
3
 
4
4
  export default component$(() => {
5
5
  return (
@@ -1,29 +1,31 @@
1
- import { component$, $, useOnWindow, useSignal } from '@builder.io/qwik';
2
- import styles from './next-steps.module.css';
1
+ import { component$, $, useOnWindow, useSignal } from "@builder.io/qwik";
2
+ import styles from "./next-steps.module.css";
3
3
 
4
4
  export const GETTING_STARTED_STEPS = [
5
5
  {
6
- message: "Press and hold the <b>ALT</b> key to activate 'Click-to-Source' mode",
6
+ message:
7
+ "Press and hold the <b>ALT</b> key to activate 'Click-to-Source' mode",
7
8
  },
8
9
  {
9
- message: 'Select the title of this page while keeping the <b>ALT</b> key pressed',
10
+ message:
11
+ "Select the title of this page while keeping the <b>ALT</b> key pressed",
10
12
  hint: 'Edit the title and save the changes. If your editor does not open, have a look at <a href="https://github.com/yyx990803/launch-editor#supported-editors" target="_blank">this page</a> to set the correct <code>LAUNCH_EDITOR</code> value.',
11
13
  },
12
14
  {
13
15
  message:
14
- '<b>Update</b> now the <code>routeLoader$</code> defined in the <code>src/routes//layout.tsx</code> file',
15
- hint: 'Instead of returning the current date, you could return any possible string.<br />The output is displayed in the footer.',
16
+ "<b>Update</b> now the <code>routeLoader$</code> defined in the <code>src/routes//layout.tsx</code> file",
17
+ hint: "Instead of returning the current date, you could return any possible string.<br />The output is displayed in the footer.",
16
18
  },
17
19
  {
18
- message: 'Create a <b>new Route</b> called <code>/me</code>',
20
+ message: "Create a <b>new Route</b> called <code>/me</code>",
19
21
  hint: 'Create a new directory called <code>me</code> in <code>src/routes</code>. Within this directory create a <code>index.tsx</code> file or copy the <code>src/routes/index.tsx</code> file. Your new route is now accessible <a href="/me" target="_blank">here</a> ✨',
20
22
  },
21
23
  {
22
- message: 'Time to have a look at <b>Forms</b>',
24
+ message: "Time to have a look at <b>Forms</b>",
23
25
  hint: 'Open <a href="/demo/todolist" target="_blank">the TODO list App</a> and add some items to the list. Try the same with disabled JavaScript 🐰',
24
26
  },
25
27
  {
26
- message: '<b>Congratulations!</b> You are now familiar with the basics! 🎉',
28
+ message: "<b>Congratulations!</b> You are now familiar with the basics! 🎉",
27
29
  hint: "If you need further info on how to use qwik, have a look at <a href='https://qwik.builder.io' target='_blank'>qwik.builder.io</a> or join the <a href='https://qwik.builder.io/chat' target='_blank'>Discord channel</a>.",
28
30
  },
29
31
  ];
@@ -32,9 +34,9 @@ export default component$(() => {
32
34
  const gettingStartedStep = useSignal(0);
33
35
 
34
36
  useOnWindow(
35
- 'keydown',
37
+ "keydown",
36
38
  $((e) => {
37
- if ((e as KeyboardEvent).key === 'Alt') {
39
+ if ((e as KeyboardEvent).key === "Alt") {
38
40
  gettingStartedStep.value = 1;
39
41
  }
40
42
  })
@@ -50,19 +52,27 @@ export default component$(() => {
50
52
  <div class={styles.gettingstarted}>
51
53
  <div
52
54
  class={styles.intro}
53
- dangerouslySetInnerHTML={GETTING_STARTED_STEPS[gettingStartedStep.value].message}
55
+ dangerouslySetInnerHTML={
56
+ GETTING_STARTED_STEPS[gettingStartedStep.value].message
57
+ }
54
58
  />
55
59
  <span
56
60
  class={styles.hint}
57
- dangerouslySetInnerHTML={GETTING_STARTED_STEPS[gettingStartedStep.value].hint}
61
+ dangerouslySetInnerHTML={
62
+ GETTING_STARTED_STEPS[gettingStartedStep.value].hint
63
+ }
58
64
  />
59
65
  </div>
60
66
  {gettingStartedStep.value + 1 < GETTING_STARTED_STEPS.length ? (
61
67
  <button class="button-dark" onClick$={() => gettingStartedStep.value++}>
62
- Continue with Step {gettingStartedStep.value + 2} of {GETTING_STARTED_STEPS.length}
68
+ Continue with Step {gettingStartedStep.value + 2} of{" "}
69
+ {GETTING_STARTED_STEPS.length}
63
70
  </button>
64
71
  ) : (
65
- <button class="button-dark" onClick$={() => (gettingStartedStep.value = 0)}>
72
+ <button
73
+ class="button-dark"
74
+ onClick$={() => (gettingStartedStep.value = 0)}
75
+ >
66
76
  Re-Start
67
77
  </button>
68
78
  )}
@@ -22,9 +22,9 @@ html {
22
22
  -moz-tab-size: 4;
23
23
  -o-tab-size: 4;
24
24
  tab-size: 4;
25
- font-family: ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto,
26
- 'Helvetica Neue', Arial, 'Noto Sans', sans-serif, 'Apple Color Emoji', 'Segoe UI Emoji',
27
- 'Segoe UI Symbol', 'Noto Color Emoji';
25
+ font-family: ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont,
26
+ "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans", sans-serif,
27
+ "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji";
28
28
  }
29
29
 
30
30
  body {
@@ -1,8 +1,12 @@
1
- import { component$ } from '@builder.io/qwik';
2
- import { QwikCityProvider, RouterOutlet, ServiceWorkerRegister } from '@builder.io/qwik-city';
3
- import { RouterHead } from './components/router-head/router-head';
1
+ import { component$ } from "@builder.io/qwik";
2
+ import {
3
+ QwikCityProvider,
4
+ RouterOutlet,
5
+ ServiceWorkerRegister,
6
+ } from "@builder.io/qwik-city";
7
+ import { RouterHead } from "./components/router-head/router-head";
4
8
 
5
- import './global.css';
9
+ import "./global.css";
6
10
 
7
11
  export default component$(() => {
8
12
  /**
@@ -31,7 +31,9 @@ h1 {
31
31
  display: block;
32
32
  width: var(--size);
33
33
  height: var(--size);
34
- transform: rotateZ(calc(var(--rotation) * var(--state) * (var(--center) - var(--index))));
34
+ transform: rotateZ(
35
+ calc(var(--rotation) * var(--state) * (var(--center) - var(--index)))
36
+ );
35
37
  transition-property: transform, border-color;
36
38
  transition-duration: 5s;
37
39
  transition-timing-function: ease-in-out;