create-qwik 1.1.5-dev20230614202914 → 1.1.5-dev20230616144423

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.5-dev20230614202914
3
+ * create-qwik 1.1.5-dev20230616144423
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 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-dev20230614202914)`),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-dev20230616144423)`),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-dev20230614202914",
3
+ "version": "1.1.5-dev20230616144423",
4
4
  "description": "Interactive CLI for create Qwik projects and adding features.",
5
5
  "bin": "./create-qwik.cjs",
6
6
  "main": "./index.cjs",
@@ -16,13 +16,13 @@
16
16
  "qwik": "qwik"
17
17
  },
18
18
  "devDependencies": {
19
- "@builder.io/qwik": "^1.1.5-dev20230614202914",
20
- "@builder.io/qwik-city": "^1.1.5-dev20230614202914",
19
+ "@builder.io/qwik": "1.1.5-dev20230616144423",
20
+ "@builder.io/qwik-city": "1.1.5-dev20230616144423",
21
21
  "@types/eslint": "8.40.2",
22
22
  "@types/node": "^20.2.5",
23
23
  "@typescript-eslint/eslint-plugin": "5.59.11",
24
24
  "@typescript-eslint/parser": "5.59.11",
25
- "eslint-plugin-qwik": "^1.1.5-dev20230614202914",
25
+ "eslint-plugin-qwik": "1.1.5-dev20230616144423",
26
26
  "eslint": "8.42.0",
27
27
  "undici": "5.22.1",
28
28
  "prettier": "2.8.8",
@@ -9,6 +9,16 @@
9
9
  gap: 40px;
10
10
  }
11
11
 
12
+ .hero-image {
13
+ width: 100%;
14
+ position: absolute;
15
+ height: auto;
16
+ object-fit: cover;
17
+ z-index: -1;
18
+ opacity: 0.2;
19
+ pointer-events: none;
20
+ }
21
+
12
22
  .hero p {
13
23
  color: white;
14
24
  margin: 0;
@@ -1,9 +1,11 @@
1
1
  import { component$ } from '@builder.io/qwik';
2
2
  import styles from './hero.module.css';
3
+ import ImgThunder from '~/media/thunder.png?jsx';
3
4
 
4
5
  export default component$(() => {
5
6
  return (
6
7
  <div class={['container', styles.hero]}>
8
+ <ImgThunder class={styles['hero-image']} />
7
9
  <h1>
8
10
  So <span class="highlight">fantastic</span>
9
11
  <br />