create-qwik 1.9.1 → 2.0.0-alpha.0
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/dist/index.cjs +4 -4
- package/dist/starters/apps/base/.eslintignore +1 -1
- package/dist/starters/apps/base/.prettierignore +1 -1
- package/dist/starters/apps/base/.vscode/{qwik-city.code-snippets → qwik-router.code-snippets} +1 -1
- package/dist/starters/apps/base/README.md +4 -4
- package/dist/starters/apps/base/package.json +4 -5
- package/dist/starters/apps/base/src/entry.dev.tsx +1 -1
- package/dist/starters/apps/base/src/entry.preview.tsx +4 -5
- package/dist/starters/apps/base/src/entry.ssr.tsx +2 -2
- package/dist/starters/apps/base/src/routes/service-worker.ts +2 -2
- package/dist/starters/apps/base/tsconfig.json +2 -1
- package/dist/starters/apps/base/{vite.config.ts → vite.config.mts} +6 -6
- package/dist/starters/apps/empty/package.json +2 -2
- package/dist/starters/apps/empty/src/components/router-head/router-head.tsx +3 -19
- package/dist/starters/apps/empty/src/root.tsx +7 -7
- package/dist/starters/apps/empty/src/routes/index.tsx +2 -2
- package/dist/starters/apps/empty/src/routes/layout.tsx +2 -2
- package/dist/starters/apps/empty/src/routes/service-worker.ts +2 -2
- package/dist/starters/apps/library/.eslintignore +1 -1
- package/dist/starters/apps/library/package.json +3 -4
- package/dist/starters/apps/library/src/components/counter/counter.tsx +1 -1
- package/dist/starters/apps/library/src/components/logo/logo.tsx +1 -1
- package/dist/starters/apps/library/src/entry.dev.tsx +1 -1
- package/dist/starters/apps/library/src/entry.ssr.tsx +2 -2
- package/dist/starters/apps/library/tsconfig.json +1 -1
- package/dist/starters/apps/library/{vite.config.ts → vite.config.mts} +2 -2
- package/dist/starters/apps/playground/package.json +2 -2
- package/dist/starters/apps/playground/src/components/router-head/router-head.tsx +4 -16
- package/dist/starters/apps/playground/src/components/starter/counter/counter.tsx +2 -2
- package/dist/starters/apps/playground/src/components/starter/footer/footer.tsx +1 -1
- package/dist/starters/apps/playground/src/components/starter/gauge/index.tsx +1 -1
- package/dist/starters/apps/playground/src/components/starter/header/header.tsx +1 -1
- package/dist/starters/apps/playground/src/components/starter/hero/hero.tsx +2 -2
- package/dist/starters/apps/playground/src/components/starter/infobox/infobox.tsx +1 -1
- package/dist/starters/apps/playground/src/components/starter/next-steps/next-steps.tsx +1 -1
- package/dist/starters/apps/playground/src/root.tsx +7 -7
- package/dist/starters/apps/playground/src/routes/demo/flower/index.tsx +3 -3
- package/dist/starters/apps/playground/src/routes/demo/todolist/index.tsx +5 -5
- package/dist/starters/apps/playground/src/routes/index.tsx +2 -2
- package/dist/starters/apps/playground/src/routes/layout.tsx +4 -4
- package/dist/starters/apps/playground/src/routes/service-worker.ts +2 -2
- package/package.json +2 -2
package/dist/index.cjs
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* @license
|
|
3
|
-
* create-qwik
|
|
4
|
-
* Copyright
|
|
3
|
+
* create-qwik 2.0.0-alpha.0-dev+3624e5d
|
|
4
|
+
* Copyright QwikDev. 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/QwikDev/qwik/blob/main/LICENSE
|
|
7
7
|
*/
|
|
@@ -53,7 +53,7 @@ ${w.default.gray(yt)} ${n}
|
|
|
53
53
|
`):ee.error(Fe(String(a))+`
|
|
54
54
|
|
|
55
55
|
`)),s(!1)}),i.on("close",a=>{s(a===0)})}catch{s(!1)}});return{abort:async()=>{i&&i.kill("SIGINT")},install:r}}async function _r(n){let e=(0,Ei.join)(n,"package.json");return JSON.parse(await Fi.default.promises.readFile(e,"utf-8"))}async function Sr(n,e){let t=(0,Ei.join)(n,"package.json");await Fi.default.promises.writeFile(t,JSON.stringify(e,null,2)+`
|
|
56
|
-
`)}function jr(n){return new Promise(e=>setTimeout(e,n))}function Ir(n){n={...n};let e={name:n.name,version:n.version,description:n.description,scripts:n.scripts,dependencies:n.dependencies,devDependencies:n.devDependencies,main:n.main,qwik:n.qwik,module:n.module,types:n.types,exports:n.exports,files:n.files,engines:{node:"^18.17.0 || ^20.3.0 || >=21.0.0"}};Object.keys(e).forEach(
|
|
56
|
+
`)}function jr(n){return new Promise(e=>setTimeout(e,n))}function Ir(n){var i;n={...n};let e={name:n.name,version:n.version,description:n.description,scripts:n.scripts,dependencies:n.dependencies,devDependencies:n.devDependencies,main:n.main,qwik:n.qwik,module:n.module,types:n.types,exports:n.exports,files:n.files,engines:{node:((i=n.engines)==null?void 0:i.node)||"^18.17.0 || ^20.3.0 || >=21.0.0"}};Object.keys(e).forEach(r=>{delete n[r]}),delete n.__qwik__;let t=Object.keys(n).sort();for(let r of t)e[r]=n[r];return e}function Pr(n){return n.toLocaleLowerCase().split("-").map(e=>e.charAt(0).toUpperCase()+e.slice(1)).join(" ")}function Ye(){var n;return((n=(0,Br.default)())==null?void 0:n.name)||"npm"}function Lt(n){console.error(`
|
|
57
57
|
\u274C ${Fe(n)}
|
|
58
58
|
`),process.exit(1)}function Mr(){console.log(Ps(`
|
|
59
59
|
${ge("............")}
|
|
@@ -160,7 +160,7 @@ ${E.join(`
|
|
|
160
160
|
`;d.forEach(E=>{C+=E}),e.fail(C)}};let f={};o.conflicts=function(c,d){$("<string|object> [array|string]",[c,d],arguments.length),typeof c=="object"?Object.keys(c).forEach(C=>{o.conflicts(C,c[C])}):(n.global(c),f[c]||(f[c]=[]),Array.isArray(d)?d.forEach(C=>o.conflicts(c,C)):f[c].push(d))},o.getConflicting=()=>f,o.conflicting=function(c){Object.keys(c).forEach(d=>{f[d]&&f[d].forEach(C=>{C&&c[d]!==void 0&&c[C]!==void 0&&e.fail(i("Arguments %s and %s are mutually exclusive",d,C))})}),n.getInternalMethods().getParserConfiguration()["strip-dashed"]&&Object.keys(f).forEach(d=>{f[d].forEach(C=>{C&&c[t.Parser.camelCase(d)]!==void 0&&c[t.Parser.camelCase(C)]!==void 0&&e.fail(i("Arguments %s and %s are mutually exclusive",d,C))})})},o.recommendCommands=function(c,d){d=d.sort((g,B)=>B.length-g.length);let E=null,b=1/0;for(let g=0,B;(B=d[g])!==void 0;g++){let N=Ao(c,B);N<=3&&N<b&&(b=N,E=B)}E&&e.fail(i("Did you mean %s?",E))},o.reset=function(c){return s=Ke(s,d=>!c[d]),f=Ke(f,d=>!c[d]),o};let D=[];return o.freeze=function(){D.push({implied:s,conflicting:f})},o.unfreeze=function(){let c=D.pop();Ce(c,void 0,t),{implied:s,conflicting:f}=c},o}var Li=[],Vt;function On(n,e,t,i){Vt=i;let r={};if(Object.prototype.hasOwnProperty.call(n,"extends")){if(typeof n.extends!="string")return r;let o=/\.json|\..*rc$/.test(n.extends),s=null;if(o)s=oc(e,n.extends);else try{s=require.resolve(n.extends)}catch{return n}rc(s),Li.push(s),r=o?JSON.parse(Vt.readFileSync(s,"utf8")):require(n.extends),delete n.extends,r=On(r,Vt.path.dirname(s),t,Vt)}return Li=[],t?vo(r,n):Object.assign({},r,n)}function rc(n){if(Li.indexOf(n)>-1)throw new Y(`Circular extended configurations: '${n}'.`)}function oc(n,e){return Vt.path.resolve(n,e)}function vo(n,e){let t={};function i(r){return r&&typeof r=="object"&&!Array.isArray(r)}Object.assign(t,n);for(let r of Object.keys(e))i(e[r])&&i(t[r])?t[r]=vo(n[r],e[r]):t[r]=e[r];return t}var v=function(n,e,t,i,r){if(i==="m")throw new TypeError("Private method is not writable");if(i==="a"&&!r)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?n!==e||!r:!e.has(n))throw new TypeError("Cannot write private member to an object whose class did not declare it");return i==="a"?r.call(n,t):r?r.value=t:e.set(n,t),t},u=function(n,e,t,i){if(t==="a"&&!i)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?n!==e||!i:!e.has(n))throw new TypeError("Cannot read private member from an object whose class did not declare it");return t==="m"?i:t==="a"?i.call(n):i?i.value:e.get(n)},ue,ct,Ht,Oe,ye,_n,Ze,lt,Sn,_e,jn,Se,We,we,je,In,Pt,De,j,Pn,Mn,Ae,ft,Mt,Dt,Xe,Tn,T,ht,pt,dt,W,Nn,Re,se;function Go(n){return(e=[],t=n.process.cwd(),i)=>{let r=new Qi(e,t,i,n);return Object.defineProperty(r,"argv",{get:()=>r.parse(),enumerable:!0}),r.help(),r.version(),r}}var Bo=Symbol("copyDoubleDash"),Oo=Symbol("copyDoubleDash"),ki=Symbol("deleteFromParserHintObject"),_o=Symbol("emitWarning"),So=Symbol("freeze"),jo=Symbol("getDollarZero"),mt=Symbol("getParserConfiguration"),Io=Symbol("getUsageConfiguration"),zi=Symbol("guessLocale"),Po=Symbol("guessVersion"),Mo=Symbol("parsePositionalNumbers"),qi=Symbol("pkgUp"),et=Symbol("populateParserHintArray"),Tt=Symbol("populateParserHintSingleValueDictionary"),Ui=Symbol("populateParserHintArrayDictionary"),Vi=Symbol("populateParserHintDictionary"),Hi=Symbol("sanitizeKey"),Gi=Symbol("setKey"),Yi=Symbol("unfreeze"),To=Symbol("validateAsync"),No=Symbol("getCommandInstance"),Wo=Symbol("getContext"),Ro=Symbol("getHasOutput"),Lo=Symbol("getLoggerInstance"),ko=Symbol("getParseContext"),zo=Symbol("getUsageInstance"),qo=Symbol("getValidationInstance"),Wn=Symbol("hasParseCallback"),Uo=Symbol("isGlobalContext"),gt=Symbol("postProcess"),Vo=Symbol("rebase"),Ji=Symbol("reset"),Gt=Symbol("runYargsParserAndExecuteCommands"),Ki=Symbol("runValidation"),Ho=Symbol("setHasOutput"),Ct=Symbol("kTrackManuallySetKeys"),Qi=class{constructor(e=[],t,i,r){this.customScriptName=!1,this.parsed=!1,ue.set(this,void 0),ct.set(this,void 0),Ht.set(this,{commands:[],fullCommands:[]}),Oe.set(this,null),ye.set(this,null),_n.set(this,"show-hidden"),Ze.set(this,null),lt.set(this,!0),Sn.set(this,{}),_e.set(this,!0),jn.set(this,[]),Se.set(this,void 0),We.set(this,{}),we.set(this,!1),je.set(this,null),In.set(this,!0),Pt.set(this,void 0),De.set(this,""),j.set(this,void 0),Pn.set(this,void 0),Mn.set(this,{}),Ae.set(this,null),ft.set(this,null),Mt.set(this,{}),Dt.set(this,{}),Xe.set(this,void 0),Tn.set(this,!1),T.set(this,void 0),ht.set(this,!1),pt.set(this,!1),dt.set(this,!1),W.set(this,void 0),Nn.set(this,{}),Re.set(this,null),se.set(this,void 0),v(this,T,r,"f"),v(this,Xe,e,"f"),v(this,ct,t,"f"),v(this,Pn,i,"f"),v(this,Se,new $n(this),"f"),this.$0=this[jo](),this[Ji](),v(this,ue,u(this,ue,"f"),"f"),v(this,W,u(this,W,"f"),"f"),v(this,se,u(this,se,"f"),"f"),v(this,j,u(this,j,"f"),"f"),u(this,j,"f").showHiddenOpt=u(this,_n,"f"),v(this,Pt,this[Oo](),"f")}addHelpOpt(e,t){let i="help";return $("[string|boolean] [string]",[e,t],arguments.length),u(this,je,"f")&&(this[ki](u(this,je,"f")),v(this,je,null,"f")),e===!1&&t===void 0?this:(v(this,je,typeof e=="string"?e:i,"f"),this.boolean(u(this,je,"f")),this.describe(u(this,je,"f"),t||u(this,W,"f").deferY18nLookup("Show help")),this)}help(e,t){return this.addHelpOpt(e,t)}addShowHiddenOpt(e,t){if($("[string|boolean] [string]",[e,t],arguments.length),e===!1&&t===void 0)return this;let i=typeof e=="string"?e:u(this,_n,"f");return this.boolean(i),this.describe(i,t||u(this,W,"f").deferY18nLookup("Show hidden options")),u(this,j,"f").showHiddenOpt=i,this}showHidden(e,t){return this.addShowHiddenOpt(e,t)}alias(e,t){return $("<object|string|array> [string|array]",[e,t],arguments.length),this[Ui](this.alias.bind(this),"alias",e,t),this}array(e){return $("<array|string>",[e],arguments.length),this[et]("array",e),this[Ct](e),this}boolean(e){return $("<array|string>",[e],arguments.length),this[et]("boolean",e),this[Ct](e),this}check(e,t){return $("<function> [boolean]",[e,t],arguments.length),this.middleware((i,r)=>at(()=>e(i,r.getOptions()),o=>(o?(typeof o=="string"||o instanceof Error)&&u(this,W,"f").fail(o.toString(),o):u(this,W,"f").fail(u(this,T,"f").y18n.__("Argument check failed: %s",e.toString())),i),o=>(u(this,W,"f").fail(o.message?o.message:o.toString(),o),i)),!1,t),this}choices(e,t){return $("<object|string|array> [string|array]",[e,t],arguments.length),this[Ui](this.choices.bind(this),"choices",e,t),this}coerce(e,t){if($("<object|string|array> [function]",[e,t],arguments.length),Array.isArray(e)){if(!t)throw new Y("coerce callback must be provided");for(let i of e)this.coerce(i,t);return this}else if(typeof e=="object"){for(let i of Object.keys(e))this.coerce(i,e[i]);return this}if(!t)throw new Y("coerce callback must be provided");return u(this,j,"f").key[e]=!0,u(this,Se,"f").addCoerceMiddleware((i,r)=>{let o;return Object.prototype.hasOwnProperty.call(i,e)?at(()=>(o=r.getAliases(),t(i[e])),a=>{i[e]=a;let f=r.getInternalMethods().getParserConfiguration()["strip-aliased"];if(o[e]&&f!==!0)for(let D of o[e])i[D]=a;return i},a=>{throw new Y(a.message)}):i},e),this}conflicts(e,t){return $("<string|object> [string|array]",[e,t],arguments.length),u(this,se,"f").conflicts(e,t),this}config(e="config",t,i){return $("[object|string] [string|function] [function]",[e,t,i],arguments.length),typeof e=="object"&&!Array.isArray(e)?(e=On(e,u(this,ct,"f"),this[mt]()["deep-merge-config"]||!1,u(this,T,"f")),u(this,j,"f").configObjects=(u(this,j,"f").configObjects||[]).concat(e),this):(typeof t=="function"&&(i=t,t=void 0),this.describe(e,t||u(this,W,"f").deferY18nLookup("Path to JSON config file")),(Array.isArray(e)?e:[e]).forEach(r=>{u(this,j,"f").config[r]=i||!0}),this)}completion(e,t,i){return $("[string] [string|boolean|function] [function]",[e,t,i],arguments.length),typeof t=="function"&&(i=t,t=void 0),v(this,ye,e||u(this,ye,"f")||"completion","f"),!t&&t!==!1&&(t="generate completion script"),this.command(u(this,ye,"f"),t),i&&u(this,Oe,"f").registerFunction(i),this}command(e,t,i,r,o,s){return $("<string|array|object> [string|boolean] [function|object] [function] [array] [boolean|string]",[e,t,i,r,o,s],arguments.length),u(this,ue,"f").addHandler(e,t,i,r,o,s),this}commands(e,t,i,r,o,s){return this.command(e,t,i,r,o,s)}commandDir(e,t){$("<string> [object]",[e,t],arguments.length);let i=u(this,Pn,"f")||u(this,T,"f").require;return u(this,ue,"f").addDirectory(e,i,u(this,T,"f").getCallerFile(),t),this}count(e){return $("<array|string>",[e],arguments.length),this[et]("count",e),this[Ct](e),this}default(e,t,i){return $("<object|string|array> [*] [string]",[e,t,i],arguments.length),i&&(Mi(e,u(this,T,"f")),u(this,j,"f").defaultDescription[e]=i),typeof t=="function"&&(Mi(e,u(this,T,"f")),u(this,j,"f").defaultDescription[e]||(u(this,j,"f").defaultDescription[e]=u(this,W,"f").functionDescription(t)),t=t.call()),this[Tt](this.default.bind(this),"default",e,t),this}defaults(e,t,i){return this.default(e,t,i)}demandCommand(e=1,t,i,r){return $("[number] [number|string] [string|null|undefined] [string|null|undefined]",[e,t,i,r],arguments.length),typeof t!="number"&&(i=t,t=1/0),this.global("_",!1),u(this,j,"f").demandedCommands._={min:e,max:t,minMsg:i,maxMsg:r},this}demand(e,t,i){return Array.isArray(t)?(t.forEach(r=>{Ce(i,!0,u(this,T,"f")),this.demandOption(r,i)}),t=1/0):typeof t!="number"&&(i=t,t=1/0),typeof e=="number"?(Ce(i,!0,u(this,T,"f")),this.demandCommand(e,t,i,i)):Array.isArray(e)?e.forEach(r=>{Ce(i,!0,u(this,T,"f")),this.demandOption(r,i)}):typeof i=="string"?this.demandOption(e,i):(i===!0||typeof i>"u")&&this.demandOption(e),this}demandOption(e,t){return $("<object|string|array> [string]",[e,t],arguments.length),this[Tt](this.demandOption.bind(this),"demandedOptions",e,t),this}deprecateOption(e,t){return $("<string> [string|boolean]",[e,t],arguments.length),u(this,j,"f").deprecatedOptions[e]=t,this}describe(e,t){return $("<object|string|array> [string]",[e,t],arguments.length),this[Gi](e,!0),u(this,W,"f").describe(e,t),this}detectLocale(e){return $("<boolean>",[e],arguments.length),v(this,lt,e,"f"),this}env(e){return $("[string|boolean]",[e],arguments.length),e===!1?delete u(this,j,"f").envPrefix:u(this,j,"f").envPrefix=e||"",this}epilogue(e){return $("<string>",[e],arguments.length),u(this,W,"f").epilog(e),this}epilog(e){return this.epilogue(e)}example(e,t){return $("<string|array> [string]",[e,t],arguments.length),Array.isArray(e)?e.forEach(i=>this.example(...i)):u(this,W,"f").example(e,t),this}exit(e,t){v(this,we,!0,"f"),v(this,Ze,t,"f"),u(this,_e,"f")&&u(this,T,"f").process.exit(e)}exitProcess(e=!0){return $("[boolean]",[e],arguments.length),v(this,_e,e,"f"),this}fail(e){if($("<function|boolean>",[e],arguments.length),typeof e=="boolean"&&e!==!1)throw new Y("Invalid first argument. Expected function or boolean 'false'");return u(this,W,"f").failFn(e),this}getAliases(){return this.parsed?this.parsed.aliases:{}}async getCompletion(e,t){return $("<array> [function]",[e,t],arguments.length),t?u(this,Oe,"f").getCompletion(e,t):new Promise((i,r)=>{u(this,Oe,"f").getCompletion(e,(o,s)=>{o?r(o):i(s)})})}getDemandedOptions(){return $([],0),u(this,j,"f").demandedOptions}getDemandedCommands(){return $([],0),u(this,j,"f").demandedCommands}getDeprecatedOptions(){return $([],0),u(this,j,"f").deprecatedOptions}getDetectLocale(){return u(this,lt,"f")}getExitProcess(){return u(this,_e,"f")}getGroups(){return Object.assign({},u(this,We,"f"),u(this,Dt,"f"))}getHelp(){if(v(this,we,!0,"f"),!u(this,W,"f").hasCachedHelpMessage()){if(!this.parsed){let t=this[Gt](u(this,Xe,"f"),void 0,void 0,0,!0);if(J(t))return t.then(()=>u(this,W,"f").help())}let e=u(this,ue,"f").runDefaultBuilderOn(this);if(J(e))return e.then(()=>u(this,W,"f").help())}return Promise.resolve(u(this,W,"f").help())}getOptions(){return u(this,j,"f")}getStrict(){return u(this,ht,"f")}getStrictCommands(){return u(this,pt,"f")}getStrictOptions(){return u(this,dt,"f")}global(e,t){return $("<string|array> [boolean]",[e,t],arguments.length),e=[].concat(e),t!==!1?u(this,j,"f").local=u(this,j,"f").local.filter(i=>e.indexOf(i)===-1):e.forEach(i=>{u(this,j,"f").local.includes(i)||u(this,j,"f").local.push(i)}),this}group(e,t){$("<string|array> <string>",[e,t],arguments.length);let i=u(this,Dt,"f")[t]||u(this,We,"f")[t];u(this,Dt,"f")[t]&&delete u(this,Dt,"f")[t];let r={};return u(this,We,"f")[t]=(i||[]).concat(e).filter(o=>r[o]?!1:r[o]=!0),this}hide(e){return $("<string>",[e],arguments.length),u(this,j,"f").hiddenOptions.push(e),this}implies(e,t){return $("<string|object> [number|string|array]",[e,t],arguments.length),u(this,se,"f").implies(e,t),this}locale(e){return $("[string]",[e],arguments.length),e===void 0?(this[zi](),u(this,T,"f").y18n.getLocale()):(v(this,lt,!1,"f"),u(this,T,"f").y18n.setLocale(e),this)}middleware(e,t,i){return u(this,Se,"f").addMiddleware(e,!!t,i)}nargs(e,t){return $("<string|object|array> [number]",[e,t],arguments.length),this[Tt](this.nargs.bind(this),"narg",e,t),this}normalize(e){return $("<array|string>",[e],arguments.length),this[et]("normalize",e),this}number(e){return $("<array|string>",[e],arguments.length),this[et]("number",e),this[Ct](e),this}option(e,t){if($("<string|object> [object]",[e,t],arguments.length),typeof e=="object")Object.keys(e).forEach(i=>{this.options(i,e[i])});else{typeof t!="object"&&(t={}),this[Ct](e),u(this,Re,"f")&&(e==="version"||(t==null?void 0:t.alias)==="version")&&this[_o](['"version" is a reserved word.',"Please do one of the following:",'- Disable version with `yargs.version(false)` if using "version" as an option',"- Use the built-in `yargs.version` method instead (if applicable)","- Use a different option key","https://yargs.js.org/docs/#api-reference-version"].join(`
|
|
161
161
|
`),void 0,"versionWarning"),u(this,j,"f").key[e]=!0,t.alias&&this.alias(e,t.alias);let i=t.deprecate||t.deprecated;i&&this.deprecateOption(e,i);let r=t.demand||t.required||t.require;r&&this.demand(e,r),t.demandOption&&this.demandOption(e,typeof t.demandOption=="string"?t.demandOption:void 0),t.conflicts&&this.conflicts(e,t.conflicts),"default"in t&&this.default(e,t.default),t.implies!==void 0&&this.implies(e,t.implies),t.nargs!==void 0&&this.nargs(e,t.nargs),t.config&&this.config(e,t.configParser),t.normalize&&this.normalize(e),t.choices&&this.choices(e,t.choices),t.coerce&&this.coerce(e,t.coerce),t.group&&this.group(e,t.group),(t.boolean||t.type==="boolean")&&(this.boolean(e),t.alias&&this.boolean(t.alias)),(t.array||t.type==="array")&&(this.array(e),t.alias&&this.array(t.alias)),(t.number||t.type==="number")&&(this.number(e),t.alias&&this.number(t.alias)),(t.string||t.type==="string")&&(this.string(e),t.alias&&this.string(t.alias)),(t.count||t.type==="count")&&this.count(e),typeof t.global=="boolean"&&this.global(e,t.global),t.defaultDescription&&(u(this,j,"f").defaultDescription[e]=t.defaultDescription),t.skipValidation&&this.skipValidation(e);let o=t.describe||t.description||t.desc,s=u(this,W,"f").getDescriptions();(!Object.prototype.hasOwnProperty.call(s,e)||typeof o=="string")&&this.describe(e,o),t.hidden&&this.hide(e),t.requiresArg&&this.requiresArg(e)}return this}options(e,t){return this.option(e,t)}parse(e,t,i){$("[string|array] [function|boolean|object] [function]",[e,t,i],arguments.length),this[So](),typeof e>"u"&&(e=u(this,Xe,"f")),typeof t=="object"&&(v(this,ft,t,"f"),t=i),typeof t=="function"&&(v(this,Ae,t,"f"),t=!1),t||v(this,Xe,e,"f"),u(this,Ae,"f")&&v(this,_e,!1,"f");let r=this[Gt](e,!!t),o=this.parsed;return u(this,Oe,"f").setParsed(this.parsed),J(r)?r.then(s=>(u(this,Ae,"f")&&u(this,Ae,"f").call(this,u(this,Ze,"f"),s,u(this,De,"f")),s)).catch(s=>{throw u(this,Ae,"f")&&u(this,Ae,"f")(s,this.parsed.argv,u(this,De,"f")),s}).finally(()=>{this[Yi](),this.parsed=o}):(u(this,Ae,"f")&&u(this,Ae,"f").call(this,u(this,Ze,"f"),r,u(this,De,"f")),this[Yi](),this.parsed=o,r)}parseAsync(e,t,i){let r=this.parse(e,t,i);return J(r)?r:Promise.resolve(r)}parseSync(e,t,i){let r=this.parse(e,t,i);if(J(r))throw new Y(".parseSync() must not be used with asynchronous builders, handlers, or middleware");return r}parserConfiguration(e){return $("<object>",[e],arguments.length),v(this,Mn,e,"f"),this}pkgConf(e,t){$("<string> [string]",[e,t],arguments.length);let i=null,r=this[qi](t||u(this,ct,"f"));return r[e]&&typeof r[e]=="object"&&(i=On(r[e],t||u(this,ct,"f"),this[mt]()["deep-merge-config"]||!1,u(this,T,"f")),u(this,j,"f").configObjects=(u(this,j,"f").configObjects||[]).concat(i)),this}positional(e,t){$("<string> <object>",[e,t],arguments.length);let i=["default","defaultDescription","implies","normalize","choices","conflicts","coerce","type","describe","desc","description","alias"];t=Ke(t,(s,a)=>s==="type"&&!["string","number","boolean"].includes(a)?!1:i.includes(s));let r=u(this,Ht,"f").fullCommands[u(this,Ht,"f").fullCommands.length-1],o=r?u(this,ue,"f").cmdToParseOptions(r):{array:[],alias:{},default:{},demand:{}};return jt(o).forEach(s=>{let a=o[s];Array.isArray(a)?a.indexOf(e)!==-1&&(t[s]=!0):a[e]&&!(s in t)&&(t[s]=a[e])}),this.group(e,u(this,W,"f").getPositionalGroupName()),this.option(e,t)}recommendCommands(e=!0){return $("[boolean]",[e],arguments.length),v(this,Tn,e,"f"),this}required(e,t,i){return this.demand(e,t,i)}require(e,t,i){return this.demand(e,t,i)}requiresArg(e){return $("<array|string|object> [number]",[e],arguments.length),typeof e=="string"&&u(this,j,"f").narg[e]?this:(this[Tt](this.requiresArg.bind(this),"narg",e,NaN),this)}showCompletionScript(e,t){return $("[string] [string]",[e,t],arguments.length),e=e||this.$0,u(this,Pt,"f").log(u(this,Oe,"f").generateCompletionScript(e,t||u(this,ye,"f")||"completion")),this}showHelp(e){if($("[string|function]",[e],arguments.length),v(this,we,!0,"f"),!u(this,W,"f").hasCachedHelpMessage()){if(!this.parsed){let i=this[Gt](u(this,Xe,"f"),void 0,void 0,0,!0);if(J(i))return i.then(()=>{u(this,W,"f").showHelp(e)}),this}let t=u(this,ue,"f").runDefaultBuilderOn(this);if(J(t))return t.then(()=>{u(this,W,"f").showHelp(e)}),this}return u(this,W,"f").showHelp(e),this}scriptName(e){return this.customScriptName=!0,this.$0=e,this}showHelpOnFail(e,t){return $("[boolean|string] [string]",[e,t],arguments.length),u(this,W,"f").showHelpOnFail(e,t),this}showVersion(e){return $("[string|function]",[e],arguments.length),u(this,W,"f").showVersion(e),this}skipValidation(e){return $("<array|string>",[e],arguments.length),this[et]("skipValidation",e),this}strict(e){return $("[boolean]",[e],arguments.length),v(this,ht,e!==!1,"f"),this}strictCommands(e){return $("[boolean]",[e],arguments.length),v(this,pt,e!==!1,"f"),this}strictOptions(e){return $("[boolean]",[e],arguments.length),v(this,dt,e!==!1,"f"),this}string(e){return $("<array|string>",[e],arguments.length),this[et]("string",e),this[Ct](e),this}terminalWidth(){return $([],0),u(this,T,"f").process.stdColumns}updateLocale(e){return this.updateStrings(e)}updateStrings(e){return $("<object>",[e],arguments.length),v(this,lt,!1,"f"),u(this,T,"f").y18n.updateLocale(e),this}usage(e,t,i,r){if($("<string|null|undefined> [string|boolean] [function|object] [function]",[e,t,i,r],arguments.length),t!==void 0){if(Ce(e,null,u(this,T,"f")),(e||"").match(/^\$0( |$)/))return this.command(e,t,i,r);throw new Y(".usage() description must start with $0 if being used as alias for .command()")}else return u(this,W,"f").usage(e),this}usageConfiguration(e){return $("<object>",[e],arguments.length),v(this,Nn,e,"f"),this}version(e,t,i){let r="version";if($("[boolean|string] [string] [string]",[e,t,i],arguments.length),u(this,Re,"f")&&(this[ki](u(this,Re,"f")),u(this,W,"f").version(void 0),v(this,Re,null,"f")),arguments.length===0)i=this[Po](),e=r;else if(arguments.length===1){if(e===!1)return this;i=e,e=r}else arguments.length===2&&(i=t,t=void 0);return v(this,Re,typeof e=="string"?e:r,"f"),t=t||u(this,W,"f").deferY18nLookup("Show version number"),u(this,W,"f").version(i||void 0),this.boolean(u(this,Re,"f")),this.describe(u(this,Re,"f"),t),this}wrap(e){return $("<number|null|undefined>",[e],arguments.length),u(this,W,"f").wrap(e),this}[(ue=new WeakMap,ct=new WeakMap,Ht=new WeakMap,Oe=new WeakMap,ye=new WeakMap,_n=new WeakMap,Ze=new WeakMap,lt=new WeakMap,Sn=new WeakMap,_e=new WeakMap,jn=new WeakMap,Se=new WeakMap,We=new WeakMap,we=new WeakMap,je=new WeakMap,In=new WeakMap,Pt=new WeakMap,De=new WeakMap,j=new WeakMap,Pn=new WeakMap,Mn=new WeakMap,Ae=new WeakMap,ft=new WeakMap,Mt=new WeakMap,Dt=new WeakMap,Xe=new WeakMap,Tn=new WeakMap,T=new WeakMap,ht=new WeakMap,pt=new WeakMap,dt=new WeakMap,W=new WeakMap,Nn=new WeakMap,Re=new WeakMap,se=new WeakMap,Bo)](e){if(!e._||!e["--"])return e;e._.push.apply(e._,e["--"]);try{delete e["--"]}catch{}return e}[Oo](){return{log:(...e)=>{this[Wn]()||console.log(...e),v(this,we,!0,"f"),u(this,De,"f").length&&v(this,De,u(this,De,"f")+`
|
|
162
162
|
`,"f"),v(this,De,u(this,De,"f")+e.join(" "),"f")},error:(...e)=>{this[Wn]()||console.error(...e),v(this,we,!0,"f"),u(this,De,"f").length&&v(this,De,u(this,De,"f")+`
|
|
163
|
-
`,"f"),v(this,De,u(this,De,"f")+e.join(" "),"f")}}}[ki](e){jt(u(this,j,"f")).forEach(t=>{if((r=>r==="configObjects")(t))return;let i=u(this,j,"f")[t];Array.isArray(i)?i.includes(e)&&i.splice(i.indexOf(e),1):typeof i=="object"&&delete i[e]}),delete u(this,W,"f").getDescriptions()[e]}[_o](e,t,i){u(this,Sn,"f")[i]||(u(this,T,"f").process.emitWarning(e,t),u(this,Sn,"f")[i]=!0)}[So](){u(this,jn,"f").push({options:u(this,j,"f"),configObjects:u(this,j,"f").configObjects.slice(0),exitProcess:u(this,_e,"f"),groups:u(this,We,"f"),strict:u(this,ht,"f"),strictCommands:u(this,pt,"f"),strictOptions:u(this,dt,"f"),completionCommand:u(this,ye,"f"),output:u(this,De,"f"),exitError:u(this,Ze,"f"),hasOutput:u(this,we,"f"),parsed:this.parsed,parseFn:u(this,Ae,"f"),parseContext:u(this,ft,"f")}),u(this,W,"f").freeze(),u(this,se,"f").freeze(),u(this,ue,"f").freeze(),u(this,Se,"f").freeze()}[jo](){let e="",t;return/\b(node|iojs|electron)(\.exe)?$/.test(u(this,T,"f").process.argv()[0])?t=u(this,T,"f").process.argv().slice(1,2):t=u(this,T,"f").process.argv().slice(0,1),e=t.map(i=>{let r=this[Vo](u(this,ct,"f"),i);return i.match(/^(\/|([a-zA-Z]:)?\\)/)&&r.length<i.length?r:i}).join(" ").trim(),u(this,T,"f").getEnv("_")&&u(this,T,"f").getProcessArgvBin()===u(this,T,"f").getEnv("_")&&(e=u(this,T,"f").getEnv("_").replace(`${u(this,T,"f").path.dirname(u(this,T,"f").process.execPath())}/`,"")),e}[mt](){return u(this,Mn,"f")}[Io](){return u(this,Nn,"f")}[zi](){if(!u(this,lt,"f"))return;let e=u(this,T,"f").getEnv("LC_ALL")||u(this,T,"f").getEnv("LC_MESSAGES")||u(this,T,"f").getEnv("LANG")||u(this,T,"f").getEnv("LANGUAGE")||"en_US";this.locale(e.replace(/[.:].*/,""))}[Po](){return this[qi]().version||"unknown"}[Mo](e){let t=e["--"]?e["--"]:e._;for(let i=0,r;(r=t[i])!==void 0;i++)u(this,T,"f").Parser.looksLikeNumber(r)&&Number.isSafeInteger(Math.floor(parseFloat(`${r}`)))&&(t[i]=Number(r));return e}[qi](e){let t=e||"*";if(u(this,Mt,"f")[t])return u(this,Mt,"f")[t];let i={};try{let r=e||u(this,T,"f").mainFilename;!e&&u(this,T,"f").path.extname(r)&&(r=u(this,T,"f").path.dirname(r));let o=u(this,T,"f").findUp(r,(s,a)=>{if(a.includes("package.json"))return"package.json"});Ce(o,void 0,u(this,T,"f")),i=JSON.parse(u(this,T,"f").readFileSync(o,"utf8"))}catch{}return u(this,Mt,"f")[t]=i||{},u(this,Mt,"f")[t]}[et](e,t){t=[].concat(t),t.forEach(i=>{i=this[Hi](i),u(this,j,"f")[e].push(i)})}[Tt](e,t,i,r){this[Vi](e,t,i,r,(o,s,a)=>{u(this,j,"f")[o][s]=a})}[Ui](e,t,i,r){this[Vi](e,t,i,r,(o,s,a)=>{u(this,j,"f")[o][s]=(u(this,j,"f")[o][s]||[]).concat(a)})}[Vi](e,t,i,r,o){if(Array.isArray(i))i.forEach(s=>{e(s,r)});else if((s=>typeof s=="object")(i))for(let s of jt(i))e(s,i[s]);else o(t,this[Hi](i),r)}[Hi](e){return e==="__proto__"?"___proto___":e}[Gi](e,t){return this[Tt](this[Gi].bind(this),"key",e,t),this}[Yi](){var e,t,i,r,o,s,a,f,D,h,c,d;let C=u(this,jn,"f").pop();Ce(C,void 0,u(this,T,"f"));let E;e=this,t=this,i=this,r=this,o=this,s=this,a=this,f=this,D=this,h=this,c=this,d=this,{options:{set value(b){v(e,j,b,"f")}}.value,configObjects:E,exitProcess:{set value(b){v(t,_e,b,"f")}}.value,groups:{set value(b){v(i,We,b,"f")}}.value,output:{set value(b){v(r,De,b,"f")}}.value,exitError:{set value(b){v(o,Ze,b,"f")}}.value,hasOutput:{set value(b){v(s,we,b,"f")}}.value,parsed:this.parsed,strict:{set value(b){v(a,ht,b,"f")}}.value,strictCommands:{set value(b){v(f,pt,b,"f")}}.value,strictOptions:{set value(b){v(D,dt,b,"f")}}.value,completionCommand:{set value(b){v(h,ye,b,"f")}}.value,parseFn:{set value(b){v(c,Ae,b,"f")}}.value,parseContext:{set value(b){v(d,ft,b,"f")}}.value}=C,u(this,j,"f").configObjects=E,u(this,W,"f").unfreeze(),u(this,se,"f").unfreeze(),u(this,ue,"f").unfreeze(),u(this,Se,"f").unfreeze()}[To](e,t){return at(t,i=>(e(i),i))}getInternalMethods(){return{getCommandInstance:this[No].bind(this),getContext:this[Wo].bind(this),getHasOutput:this[Ro].bind(this),getLoggerInstance:this[Lo].bind(this),getParseContext:this[ko].bind(this),getParserConfiguration:this[mt].bind(this),getUsageConfiguration:this[Io].bind(this),getUsageInstance:this[zo].bind(this),getValidationInstance:this[qo].bind(this),hasParseCallback:this[Wn].bind(this),isGlobalContext:this[Uo].bind(this),postProcess:this[gt].bind(this),reset:this[Ji].bind(this),runValidation:this[Ki].bind(this),runYargsParserAndExecuteCommands:this[Gt].bind(this),setHasOutput:this[Ho].bind(this)}}[No](){return u(this,ue,"f")}[Wo](){return u(this,Ht,"f")}[Ro](){return u(this,we,"f")}[Lo](){return u(this,Pt,"f")}[ko](){return u(this,ft,"f")||{}}[zo](){return u(this,W,"f")}[qo](){return u(this,se,"f")}[Wn](){return!!u(this,Ae,"f")}[Uo](){return u(this,In,"f")}[gt](e,t,i,r){return i||J(e)||(t||(e=this[Bo](e)),(this[mt]()["parse-positional-numbers"]||this[mt]()["parse-positional-numbers"]===void 0)&&(e=this[Mo](e)),r&&(e=ut(e,this,u(this,Se,"f").getMiddleware(),!1))),e}[Ji](e={}){v(this,j,u(this,j,"f")||{},"f");let t={};t.local=u(this,j,"f").local||[],t.configObjects=u(this,j,"f").configObjects||[];let i={};t.local.forEach(s=>{i[s]=!0,(e[s]||[]).forEach(a=>{i[a]=!0})}),Object.assign(u(this,Dt,"f"),Object.keys(u(this,We,"f")).reduce((s,a)=>{let f=u(this,We,"f")[a].filter(D=>!(D in i));return f.length>0&&(s[a]=f),s},{})),v(this,We,{},"f");let r=["array","boolean","string","skipValidation","count","normalize","number","hiddenOptions"],o=["narg","key","alias","default","defaultDescription","config","choices","demandedOptions","demandedCommands","deprecatedOptions"];return r.forEach(s=>{t[s]=(u(this,j,"f")[s]||[]).filter(a=>!i[a])}),o.forEach(s=>{t[s]=Ke(u(this,j,"f")[s],a=>!i[a])}),t.envPrefix=u(this,j,"f").envPrefix,v(this,j,t,"f"),v(this,W,u(this,W,"f")?u(this,W,"f").reset(i):Eo(this,u(this,T,"f")),"f"),v(this,se,u(this,se,"f")?u(this,se,"f").reset(i):$o(this,u(this,W,"f"),u(this,T,"f")),"f"),v(this,ue,u(this,ue,"f")?u(this,ue,"f").reset():go(u(this,W,"f"),u(this,se,"f"),u(this,Se,"f"),u(this,T,"f")),"f"),u(this,Oe,"f")||v(this,Oe,wo(this,u(this,W,"f"),u(this,ue,"f"),u(this,T,"f")),"f"),u(this,Se,"f").reset(),v(this,ye,null,"f"),v(this,De,"","f"),v(this,Ze,null,"f"),v(this,we,!1,"f"),this.parsed=!1,this}[Vo](e,t){return u(this,T,"f").path.relative(e,t)}[Gt](e,t,i,r=0,o=!1){let s=!!i||o;e=e||u(this,Xe,"f"),u(this,j,"f").__=u(this,T,"f").y18n.__,u(this,j,"f").configuration=this[mt]();let a=!!u(this,j,"f").configuration["populate--"],f=Object.assign({},u(this,j,"f").configuration,{"populate--":!0}),D=u(this,T,"f").Parser.detailed(e,Object.assign({},u(this,j,"f"),{configuration:{"parse-positional-numbers":!1,...f}})),h=Object.assign(D.argv,u(this,ft,"f")),c,d=D.aliases,C=!1,E=!1;Object.keys(h).forEach(b=>{b===u(this,je,"f")&&h[b]?C=!0:b===u(this,Re,"f")&&h[b]&&(E=!0)}),h.$0=this.$0,this.parsed=D,r===0&&u(this,W,"f").clearCachedHelpMessage();try{if(this[zi](),t)return this[gt](h,a,!!i,!1);u(this,je,"f")&&[u(this,je,"f")].concat(d[u(this,je,"f")]||[]).filter(U=>U.length>1).includes(""+h._[h._.length-1])&&(h._.pop(),C=!0),v(this,In,!1,"f");let b=u(this,ue,"f").getCommands(),g=u(this,Oe,"f").completionKey in h,B=C||g||o;if(h._.length){if(b.length){let N;for(let U=r||0,k;h._[U]!==void 0;U++)if(k=String(h._[U]),b.includes(k)&&k!==u(this,ye,"f")){let V=u(this,ue,"f").runCommand(k,this,D,U+1,o,C||E||o);return this[gt](V,a,!!i,!1)}else if(!N&&k!==u(this,ye,"f")){N=k;break}!u(this,ue,"f").hasDefaultCommand()&&u(this,Tn,"f")&&N&&!B&&u(this,se,"f").recommendCommands(N,b)}u(this,ye,"f")&&h._.includes(u(this,ye,"f"))&&!g&&(u(this,_e,"f")&&Qe(!0),this.showCompletionScript(),this.exit(0))}if(u(this,ue,"f").hasDefaultCommand()&&!B){let N=u(this,ue,"f").runCommand(null,this,D,0,o,C||E||o);return this[gt](N,a,!!i,!1)}if(g){u(this,_e,"f")&&Qe(!0),e=[].concat(e);let N=e.slice(e.indexOf(`--${u(this,Oe,"f").completionKey}`)+1);return u(this,Oe,"f").getCompletion(N,(U,k)=>{if(U)throw new Y(U.message);(k||[]).forEach(V=>{u(this,Pt,"f").log(V)}),this.exit(0)}),this[gt](h,!a,!!i,!1)}if(u(this,we,"f")||(C?(u(this,_e,"f")&&Qe(!0),s=!0,this.showHelp("log"),this.exit(0)):E&&(u(this,_e,"f")&&Qe(!0),s=!0,u(this,W,"f").showVersion("log"),this.exit(0))),!s&&u(this,j,"f").skipValidation.length>0&&(s=Object.keys(h).some(N=>u(this,j,"f").skipValidation.indexOf(N)>=0&&h[N]===!0)),!s){if(D.error)throw new Y(D.error.message);if(!g){let N=this[Ki](d,{},D.error);i||(c=ut(h,this,u(this,Se,"f").getMiddleware(),!0)),c=this[To](N,c??h),J(c)&&!i&&(c=c.then(()=>ut(h,this,u(this,Se,"f").getMiddleware(),!1)))}}}catch(b){if(b instanceof Y)u(this,W,"f").fail(b.message,b);else throw b}return this[gt](c??h,a,!!i,!0)}[Ki](e,t,i,r){let o={...this.getDemandedOptions()};return s=>{if(i)throw new Y(i.message);u(this,se,"f").nonOptionCount(s),u(this,se,"f").requiredArguments(s,o);let a=!1;u(this,pt,"f")&&(a=u(this,se,"f").unknownCommands(s)),u(this,ht,"f")&&!a?u(this,se,"f").unknownArguments(s,e,t,!!r):u(this,dt,"f")&&u(this,se,"f").unknownArguments(s,e,{},!1,!1),u(this,se,"f").limitedChoices(s),u(this,se,"f").implications(s),u(this,se,"f").conflicting(s)}}[Ho](){v(this,we,!0,"f")}[Ct](e){if(typeof e=="string")u(this,j,"f").key[e]=!0;else for(let t of e)u(this,j,"f").key[t]=!0}};function Co(n){return!!n&&typeof n.getInternalMethods=="function"}var uc=Go(fo),Yo=uc;function ac(n,e){return Yo(n).strict().command("* <template> <outDir>","Create a new project powered by qwik",i=>i.positional("template",{type:"string",desc:"Starter template",choices:e}).positional("outDir",{type:"string",desc:"Directory of the project"}).option("force",{alias:"f",type:"boolean",default:!1,desc:"Overwrite target directory if it exists"}).option("installDeps",{alias:"i",default:!1,type:"boolean",desc:"Install dependencies"}).usage("npm create qwik@latest base ./my-project <options>")).argv}async function Xi(...n){let e=Ye(),t=await Bt("app"),i=t.standaloneTemplates.map(({id:d})=>d),r=ac(n,i),{force:o,installDeps:s,template:a}=r,f=r.outDir;sn(`Let's create a ${Rt(" Qwik App ")} \u2728 (v1.9.1)`),cc()?f=process.cwd():(f=gn(f),Zi.default.existsSync(f)&&Zi.default.readdirSync(f).length>0&&(o?await on(f):(ee.error(`Directory "${f}" already exists.`),ee.info("Please either remove this directory, choose another location or run the command again with '--force | -f' flag."),st(),process.exit(1))));let D=await Ot({outDir:f,appId:a,pkgManager:e,templateManager:t}),h=wt(),c=!1;return s&&(c=await dn(async()=>await rt(e,f).install,{pkgManager:e,spinner:h})),mn(e,D,c),D}function cc(){return lc()}function lc(){try{return process.cwd().startsWith("/home/projects/")}catch{}return!1}var Ln=require("node:path");var Rn=ae(require("node:fs"));var es=[["What's the best thing about a Boolean?","Even if you're wrong, you're only off by a bit."],["Why did the developer stay at home?","Because he couldn't find his keys."],["How many programmers does it take to change a lightbulb?","None that's a hardware problem"],["A user interface is like a joke.","If you have to explain it then it is not that good."],["['hip', 'hip']","(hip hip array)"],["A SQL query goes into a bar, walks up to two tables and asks:","'Can I JOIN you?'"],["Why did the developer go to therapy?","He had too many unresolved issues."],["Why do C# and Java developers keep breaking their keyboards?","Because they use a strongly typed language."],["What's the object-oriented way to become wealthy?","Inheritance"],["Where do programmers like to hangout?","The Foo Bar."],["Why do Java programmers wear glasses?","Because they don't C#"],["To understand what recursion is...","You must first understand what recursion is"],["The punchline often arrives before the set-up.","Do you know the problem with UDP jokes?"],["Why did the programmer quit his job?","Because he didn't get arrays."],["Why was the computer tired when it got home?","It had a hard drive."],["There are 10 types of people in this world...","Those who understand binary and those who don't"],["Why do programmers always mix up Halloween and Christmas?","Because Oct 31 == Dec 25"],["I was gonna tell you a joke about UDP...","...but you might not get it."],["Normal People: give me just a second","Developers: give me 1000 milliseconds!"],["Why do programmers prefer dark mode?","Because light attracts bugs."],["Why don't programmers like nature?","It has too many bugs."],["Why was the computer freezing?","It left its Windows open!"],["What did the Java code say to the C code?","You've got no class."],["Why do programmers prefer the outdoors?","Because it's free of bugs."],["Why do programmers love movies?","Because they can 'script' the ending."],["why do desert animals hate Qwik?","Because there's no hydration...."],["What can you do if you cannot push your git changes?","Use the --force, Luke"],["How did the developer announce he's getting married?","'She returned true!'"],["How many Prolog programmers does it take to change a lightbulb?","Yes."],["Why did the developer ground their kid?","They weren't telling the truthy"],["!false","It's funny 'cause it's true."],["Where did the parallel function wash its hands?","Async"],["How do functions break up?","They stop calling each other"],["Why did the functions stop calling each other?","Because they had constant arguments."],["What's the second movie about a database engineer called?","The SQL."],["What did the computer do at lunchtime?","NoSQL."],["Why doesn't Hollywood make more Big Data movies?","Had a byte!"],["What does a baby computer call his father?","Data!"],["I never tell the same joke twice","I have a DRY sense of humor."],["How do programming pirates pass method parameters?","ARRRRRGS."],["Why don't bachelors like Git?","Because they are afraid to commit."],["Why do astronauts use Linux?","They can't open Windows in space!"],["How do front end devs like their brownies?","GUI"],["What do hackers do on a boat?","Phishing."],["Why couldn't the HTML list be trusted?","There were LI's everywhere"],["To the person who invented zero:","Thank's for nothing!"],["What do you call a bee that lives in America?","A USB"],["want about to a race conditions hear joke?",""],["What is a Package Managers favorite holiday?","Dependency Day"],["Where do we get all of these dad jokes from?","A dad-a-base!"],["What advice do you give to a JS developer who has never played baseball?","Try catch."],["We don't have any DNS jokes, know why?","Because it may take 24 hours to get them"],["Why do Front-End Developers eat lunch alone?","Because they don't know how to join tables."],["How do you help JS errors?","You `console` them!"],["When do front end developers go out to eat?","On their lunch <br>."],["What do you call optimistic front-end developers?","Stack half-full developers."]];function Jo(){let n=Math.floor(Math.random()*es.length);return es[n]}async function ts(){let n=Ye(),e=await Bt("app"),t="./qwik-app";sn(`Let's create a ${Rt(" Qwik App ")} \u2728 (v1.9.1)`),await jr(500);let i=await xs({message:`Where would you like to create your new project? ${Ge("(Use '.' or './' for current directory)")}`,placeholder:t})||t;He(i)&&(st("Operation cancelled."),process.exit(0));let r=e.getBaseApp();if(!r)throw new Error("Base app not found");let o=e.templates.filter(B=>B.id!==r.id).sort((B,N)=>B.name.localeCompare(N.name)),s=gn(i.trim());r.target=s;let a=Nr(n,r);ee.info(`Creating new project in ${Rt(" "+s+" ")} ... \u{1F407}`);let f=null;if(Rn.default.existsSync(s)&&Rn.default.readdirSync(s).length>0){let B=await ii({message:`Directory "./${(0,Ln.relative)(process.cwd(),s)}" 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"}]});(He(B)||B==="exit")&&(st("Operation cancelled."),process.exit(0)),B==="replace"&&(f=on(s))}let D=await ii({message:"Select a starter",options:o.map(B=>{var N;return{label:B.name,value:B.id,hint:(N=B.pkgJson)==null?void 0:N.description}})});He(D)&&(st("Operation cancelled."),process.exit(0));let h=D,c=await nn({message:`Would you like to install ${n} dependencies?`,initialValue:!0});He(c)&&(st("Operation cancelled."),process.exit(0));let d=await nn({message:"Initialize a new git repository?",initialValue:!0});f&&await f;let C=c;if(!C)a.abort();else if(typeof a.success>"u")try{let B=await nn({message:"Finishing the install. Wanna hear a joke?",initialValue:!0});if(!He(B)&&B){let[N,U]=Jo();an(ge(`${N.trim()}
|
|
163
|
+
`,"f"),v(this,De,u(this,De,"f")+e.join(" "),"f")}}}[ki](e){jt(u(this,j,"f")).forEach(t=>{if((r=>r==="configObjects")(t))return;let i=u(this,j,"f")[t];Array.isArray(i)?i.includes(e)&&i.splice(i.indexOf(e),1):typeof i=="object"&&delete i[e]}),delete u(this,W,"f").getDescriptions()[e]}[_o](e,t,i){u(this,Sn,"f")[i]||(u(this,T,"f").process.emitWarning(e,t),u(this,Sn,"f")[i]=!0)}[So](){u(this,jn,"f").push({options:u(this,j,"f"),configObjects:u(this,j,"f").configObjects.slice(0),exitProcess:u(this,_e,"f"),groups:u(this,We,"f"),strict:u(this,ht,"f"),strictCommands:u(this,pt,"f"),strictOptions:u(this,dt,"f"),completionCommand:u(this,ye,"f"),output:u(this,De,"f"),exitError:u(this,Ze,"f"),hasOutput:u(this,we,"f"),parsed:this.parsed,parseFn:u(this,Ae,"f"),parseContext:u(this,ft,"f")}),u(this,W,"f").freeze(),u(this,se,"f").freeze(),u(this,ue,"f").freeze(),u(this,Se,"f").freeze()}[jo](){let e="",t;return/\b(node|iojs|electron)(\.exe)?$/.test(u(this,T,"f").process.argv()[0])?t=u(this,T,"f").process.argv().slice(1,2):t=u(this,T,"f").process.argv().slice(0,1),e=t.map(i=>{let r=this[Vo](u(this,ct,"f"),i);return i.match(/^(\/|([a-zA-Z]:)?\\)/)&&r.length<i.length?r:i}).join(" ").trim(),u(this,T,"f").getEnv("_")&&u(this,T,"f").getProcessArgvBin()===u(this,T,"f").getEnv("_")&&(e=u(this,T,"f").getEnv("_").replace(`${u(this,T,"f").path.dirname(u(this,T,"f").process.execPath())}/`,"")),e}[mt](){return u(this,Mn,"f")}[Io](){return u(this,Nn,"f")}[zi](){if(!u(this,lt,"f"))return;let e=u(this,T,"f").getEnv("LC_ALL")||u(this,T,"f").getEnv("LC_MESSAGES")||u(this,T,"f").getEnv("LANG")||u(this,T,"f").getEnv("LANGUAGE")||"en_US";this.locale(e.replace(/[.:].*/,""))}[Po](){return this[qi]().version||"unknown"}[Mo](e){let t=e["--"]?e["--"]:e._;for(let i=0,r;(r=t[i])!==void 0;i++)u(this,T,"f").Parser.looksLikeNumber(r)&&Number.isSafeInteger(Math.floor(parseFloat(`${r}`)))&&(t[i]=Number(r));return e}[qi](e){let t=e||"*";if(u(this,Mt,"f")[t])return u(this,Mt,"f")[t];let i={};try{let r=e||u(this,T,"f").mainFilename;!e&&u(this,T,"f").path.extname(r)&&(r=u(this,T,"f").path.dirname(r));let o=u(this,T,"f").findUp(r,(s,a)=>{if(a.includes("package.json"))return"package.json"});Ce(o,void 0,u(this,T,"f")),i=JSON.parse(u(this,T,"f").readFileSync(o,"utf8"))}catch{}return u(this,Mt,"f")[t]=i||{},u(this,Mt,"f")[t]}[et](e,t){t=[].concat(t),t.forEach(i=>{i=this[Hi](i),u(this,j,"f")[e].push(i)})}[Tt](e,t,i,r){this[Vi](e,t,i,r,(o,s,a)=>{u(this,j,"f")[o][s]=a})}[Ui](e,t,i,r){this[Vi](e,t,i,r,(o,s,a)=>{u(this,j,"f")[o][s]=(u(this,j,"f")[o][s]||[]).concat(a)})}[Vi](e,t,i,r,o){if(Array.isArray(i))i.forEach(s=>{e(s,r)});else if((s=>typeof s=="object")(i))for(let s of jt(i))e(s,i[s]);else o(t,this[Hi](i),r)}[Hi](e){return e==="__proto__"?"___proto___":e}[Gi](e,t){return this[Tt](this[Gi].bind(this),"key",e,t),this}[Yi](){var e,t,i,r,o,s,a,f,D,h,c,d;let C=u(this,jn,"f").pop();Ce(C,void 0,u(this,T,"f"));let E;e=this,t=this,i=this,r=this,o=this,s=this,a=this,f=this,D=this,h=this,c=this,d=this,{options:{set value(b){v(e,j,b,"f")}}.value,configObjects:E,exitProcess:{set value(b){v(t,_e,b,"f")}}.value,groups:{set value(b){v(i,We,b,"f")}}.value,output:{set value(b){v(r,De,b,"f")}}.value,exitError:{set value(b){v(o,Ze,b,"f")}}.value,hasOutput:{set value(b){v(s,we,b,"f")}}.value,parsed:this.parsed,strict:{set value(b){v(a,ht,b,"f")}}.value,strictCommands:{set value(b){v(f,pt,b,"f")}}.value,strictOptions:{set value(b){v(D,dt,b,"f")}}.value,completionCommand:{set value(b){v(h,ye,b,"f")}}.value,parseFn:{set value(b){v(c,Ae,b,"f")}}.value,parseContext:{set value(b){v(d,ft,b,"f")}}.value}=C,u(this,j,"f").configObjects=E,u(this,W,"f").unfreeze(),u(this,se,"f").unfreeze(),u(this,ue,"f").unfreeze(),u(this,Se,"f").unfreeze()}[To](e,t){return at(t,i=>(e(i),i))}getInternalMethods(){return{getCommandInstance:this[No].bind(this),getContext:this[Wo].bind(this),getHasOutput:this[Ro].bind(this),getLoggerInstance:this[Lo].bind(this),getParseContext:this[ko].bind(this),getParserConfiguration:this[mt].bind(this),getUsageConfiguration:this[Io].bind(this),getUsageInstance:this[zo].bind(this),getValidationInstance:this[qo].bind(this),hasParseCallback:this[Wn].bind(this),isGlobalContext:this[Uo].bind(this),postProcess:this[gt].bind(this),reset:this[Ji].bind(this),runValidation:this[Ki].bind(this),runYargsParserAndExecuteCommands:this[Gt].bind(this),setHasOutput:this[Ho].bind(this)}}[No](){return u(this,ue,"f")}[Wo](){return u(this,Ht,"f")}[Ro](){return u(this,we,"f")}[Lo](){return u(this,Pt,"f")}[ko](){return u(this,ft,"f")||{}}[zo](){return u(this,W,"f")}[qo](){return u(this,se,"f")}[Wn](){return!!u(this,Ae,"f")}[Uo](){return u(this,In,"f")}[gt](e,t,i,r){return i||J(e)||(t||(e=this[Bo](e)),(this[mt]()["parse-positional-numbers"]||this[mt]()["parse-positional-numbers"]===void 0)&&(e=this[Mo](e)),r&&(e=ut(e,this,u(this,Se,"f").getMiddleware(),!1))),e}[Ji](e={}){v(this,j,u(this,j,"f")||{},"f");let t={};t.local=u(this,j,"f").local||[],t.configObjects=u(this,j,"f").configObjects||[];let i={};t.local.forEach(s=>{i[s]=!0,(e[s]||[]).forEach(a=>{i[a]=!0})}),Object.assign(u(this,Dt,"f"),Object.keys(u(this,We,"f")).reduce((s,a)=>{let f=u(this,We,"f")[a].filter(D=>!(D in i));return f.length>0&&(s[a]=f),s},{})),v(this,We,{},"f");let r=["array","boolean","string","skipValidation","count","normalize","number","hiddenOptions"],o=["narg","key","alias","default","defaultDescription","config","choices","demandedOptions","demandedCommands","deprecatedOptions"];return r.forEach(s=>{t[s]=(u(this,j,"f")[s]||[]).filter(a=>!i[a])}),o.forEach(s=>{t[s]=Ke(u(this,j,"f")[s],a=>!i[a])}),t.envPrefix=u(this,j,"f").envPrefix,v(this,j,t,"f"),v(this,W,u(this,W,"f")?u(this,W,"f").reset(i):Eo(this,u(this,T,"f")),"f"),v(this,se,u(this,se,"f")?u(this,se,"f").reset(i):$o(this,u(this,W,"f"),u(this,T,"f")),"f"),v(this,ue,u(this,ue,"f")?u(this,ue,"f").reset():go(u(this,W,"f"),u(this,se,"f"),u(this,Se,"f"),u(this,T,"f")),"f"),u(this,Oe,"f")||v(this,Oe,wo(this,u(this,W,"f"),u(this,ue,"f"),u(this,T,"f")),"f"),u(this,Se,"f").reset(),v(this,ye,null,"f"),v(this,De,"","f"),v(this,Ze,null,"f"),v(this,we,!1,"f"),this.parsed=!1,this}[Vo](e,t){return u(this,T,"f").path.relative(e,t)}[Gt](e,t,i,r=0,o=!1){let s=!!i||o;e=e||u(this,Xe,"f"),u(this,j,"f").__=u(this,T,"f").y18n.__,u(this,j,"f").configuration=this[mt]();let a=!!u(this,j,"f").configuration["populate--"],f=Object.assign({},u(this,j,"f").configuration,{"populate--":!0}),D=u(this,T,"f").Parser.detailed(e,Object.assign({},u(this,j,"f"),{configuration:{"parse-positional-numbers":!1,...f}})),h=Object.assign(D.argv,u(this,ft,"f")),c,d=D.aliases,C=!1,E=!1;Object.keys(h).forEach(b=>{b===u(this,je,"f")&&h[b]?C=!0:b===u(this,Re,"f")&&h[b]&&(E=!0)}),h.$0=this.$0,this.parsed=D,r===0&&u(this,W,"f").clearCachedHelpMessage();try{if(this[zi](),t)return this[gt](h,a,!!i,!1);u(this,je,"f")&&[u(this,je,"f")].concat(d[u(this,je,"f")]||[]).filter(U=>U.length>1).includes(""+h._[h._.length-1])&&(h._.pop(),C=!0),v(this,In,!1,"f");let b=u(this,ue,"f").getCommands(),g=u(this,Oe,"f").completionKey in h,B=C||g||o;if(h._.length){if(b.length){let N;for(let U=r||0,k;h._[U]!==void 0;U++)if(k=String(h._[U]),b.includes(k)&&k!==u(this,ye,"f")){let V=u(this,ue,"f").runCommand(k,this,D,U+1,o,C||E||o);return this[gt](V,a,!!i,!1)}else if(!N&&k!==u(this,ye,"f")){N=k;break}!u(this,ue,"f").hasDefaultCommand()&&u(this,Tn,"f")&&N&&!B&&u(this,se,"f").recommendCommands(N,b)}u(this,ye,"f")&&h._.includes(u(this,ye,"f"))&&!g&&(u(this,_e,"f")&&Qe(!0),this.showCompletionScript(),this.exit(0))}if(u(this,ue,"f").hasDefaultCommand()&&!B){let N=u(this,ue,"f").runCommand(null,this,D,0,o,C||E||o);return this[gt](N,a,!!i,!1)}if(g){u(this,_e,"f")&&Qe(!0),e=[].concat(e);let N=e.slice(e.indexOf(`--${u(this,Oe,"f").completionKey}`)+1);return u(this,Oe,"f").getCompletion(N,(U,k)=>{if(U)throw new Y(U.message);(k||[]).forEach(V=>{u(this,Pt,"f").log(V)}),this.exit(0)}),this[gt](h,!a,!!i,!1)}if(u(this,we,"f")||(C?(u(this,_e,"f")&&Qe(!0),s=!0,this.showHelp("log"),this.exit(0)):E&&(u(this,_e,"f")&&Qe(!0),s=!0,u(this,W,"f").showVersion("log"),this.exit(0))),!s&&u(this,j,"f").skipValidation.length>0&&(s=Object.keys(h).some(N=>u(this,j,"f").skipValidation.indexOf(N)>=0&&h[N]===!0)),!s){if(D.error)throw new Y(D.error.message);if(!g){let N=this[Ki](d,{},D.error);i||(c=ut(h,this,u(this,Se,"f").getMiddleware(),!0)),c=this[To](N,c??h),J(c)&&!i&&(c=c.then(()=>ut(h,this,u(this,Se,"f").getMiddleware(),!1)))}}}catch(b){if(b instanceof Y)u(this,W,"f").fail(b.message,b);else throw b}return this[gt](c??h,a,!!i,!0)}[Ki](e,t,i,r){let o={...this.getDemandedOptions()};return s=>{if(i)throw new Y(i.message);u(this,se,"f").nonOptionCount(s),u(this,se,"f").requiredArguments(s,o);let a=!1;u(this,pt,"f")&&(a=u(this,se,"f").unknownCommands(s)),u(this,ht,"f")&&!a?u(this,se,"f").unknownArguments(s,e,t,!!r):u(this,dt,"f")&&u(this,se,"f").unknownArguments(s,e,{},!1,!1),u(this,se,"f").limitedChoices(s),u(this,se,"f").implications(s),u(this,se,"f").conflicting(s)}}[Ho](){v(this,we,!0,"f")}[Ct](e){if(typeof e=="string")u(this,j,"f").key[e]=!0;else for(let t of e)u(this,j,"f").key[t]=!0}};function Co(n){return!!n&&typeof n.getInternalMethods=="function"}var uc=Go(fo),Yo=uc;function ac(n,e){return Yo(n).strict().command("* <template> <outDir>","Create a new project powered by qwik",i=>i.positional("template",{type:"string",desc:"Starter template",choices:e}).positional("outDir",{type:"string",desc:"Directory of the project"}).option("force",{alias:"f",type:"boolean",default:!1,desc:"Overwrite target directory if it exists"}).option("installDeps",{alias:"i",default:!1,type:"boolean",desc:"Install dependencies"}).usage("npm create qwik@latest base ./my-project <options>")).argv}async function Xi(...n){let e=Ye(),t=await Bt("app"),i=t.standaloneTemplates.map(({id:d})=>d),r=ac(n,i),{force:o,installDeps:s,template:a}=r,f=r.outDir;sn(`Let's create a ${Rt(" Qwik App ")} \u2728 (v2.0.0-alpha.0-dev+3624e5d)`),cc()?f=process.cwd():(f=gn(f),Zi.default.existsSync(f)&&Zi.default.readdirSync(f).length>0&&(o?await on(f):(ee.error(`Directory "${f}" already exists.`),ee.info("Please either remove this directory, choose another location or run the command again with '--force | -f' flag."),st(),process.exit(1))));let D=await Ot({outDir:f,appId:a,pkgManager:e,templateManager:t}),h=wt(),c=!1;return s&&(c=await dn(async()=>await rt(e,f).install,{pkgManager:e,spinner:h})),mn(e,D,c),D}function cc(){return lc()}function lc(){try{return process.cwd().startsWith("/home/projects/")}catch{}return!1}var Ln=require("node:path");var Rn=ae(require("node:fs"));var es=[["What's the best thing about a Boolean?","Even if you're wrong, you're only off by a bit."],["Why did the developer stay at home?","Because he couldn't find his keys."],["How many programmers does it take to change a lightbulb?","None that's a hardware problem"],["A user interface is like a joke.","If you have to explain it then it is not that good."],["['hip', 'hip']","(hip hip array)"],["A SQL query goes into a bar, walks up to two tables and asks:","'Can I JOIN you?'"],["Why did the developer go to therapy?","He had too many unresolved issues."],["Why do C# and Java developers keep breaking their keyboards?","Because they use a strongly typed language."],["What's the object-oriented way to become wealthy?","Inheritance"],["Where do programmers like to hangout?","The Foo Bar."],["Why do Java programmers wear glasses?","Because they don't C#"],["To understand what recursion is...","You must first understand what recursion is"],["The punchline often arrives before the set-up.","Do you know the problem with UDP jokes?"],["Why did the programmer quit his job?","Because he didn't get arrays."],["Why was the computer tired when it got home?","It had a hard drive."],["There are 10 types of people in this world...","Those who understand binary and those who don't"],["Why do programmers always mix up Halloween and Christmas?","Because Oct 31 == Dec 25"],["I was gonna tell you a joke about UDP...","...but you might not get it."],["Normal People: give me just a second","Developers: give me 1000 milliseconds!"],["Why do programmers prefer dark mode?","Because light attracts bugs."],["Why don't programmers like nature?","It has too many bugs."],["Why was the computer freezing?","It left its Windows open!"],["What did the Java code say to the C code?","You've got no class."],["Why do programmers prefer the outdoors?","Because it's free of bugs."],["Why do programmers love movies?","Because they can 'script' the ending."],["why do desert animals hate Qwik?","Because there's no hydration...."],["What can you do if you cannot push your git changes?","Use the --force, Luke"],["How did the developer announce he's getting married?","'She returned true!'"],["How many Prolog programmers does it take to change a lightbulb?","Yes."],["Why did the developer ground their kid?","They weren't telling the truthy"],["!false","It's funny 'cause it's true."],["Where did the parallel function wash its hands?","Async"],["How do functions break up?","They stop calling each other"],["Why did the functions stop calling each other?","Because they had constant arguments."],["What's the second movie about a database engineer called?","The SQL."],["What did the computer do at lunchtime?","NoSQL."],["Why doesn't Hollywood make more Big Data movies?","Had a byte!"],["What does a baby computer call his father?","Data!"],["I never tell the same joke twice","I have a DRY sense of humor."],["How do programming pirates pass method parameters?","ARRRRRGS."],["Why don't bachelors like Git?","Because they are afraid to commit."],["Why do astronauts use Linux?","They can't open Windows in space!"],["How do front end devs like their brownies?","GUI"],["What do hackers do on a boat?","Phishing."],["Why couldn't the HTML list be trusted?","There were LI's everywhere"],["To the person who invented zero:","Thank's for nothing!"],["What do you call a bee that lives in America?","A USB"],["want about to a race conditions hear joke?",""],["What is a Package Managers favorite holiday?","Dependency Day"],["Where do we get all of these dad jokes from?","A dad-a-base!"],["What advice do you give to a JS developer who has never played baseball?","Try catch."],["We don't have any DNS jokes, know why?","Because it may take 24 hours to get them"],["Why do Front-End Developers eat lunch alone?","Because they don't know how to join tables."],["How do you help JS errors?","You `console` them!"],["When do front end developers go out to eat?","On their lunch <br>."],["What do you call optimistic front-end developers?","Stack half-full developers."]];function Jo(){let n=Math.floor(Math.random()*es.length);return es[n]}async function ts(){let n=Ye(),e=await Bt("app"),t="./qwik-app";sn(`Let's create a ${Rt(" Qwik App ")} \u2728 (v2.0.0-alpha.0-dev+3624e5d)`),await jr(500);let i=await xs({message:`Where would you like to create your new project? ${Ge("(Use '.' or './' for current directory)")}`,placeholder:t})||t;He(i)&&(st("Operation cancelled."),process.exit(0));let r=e.getBaseApp();if(!r)throw new Error("Base app not found");let o=e.templates.filter(B=>B.id!==r.id).sort((B,N)=>B.name.localeCompare(N.name)),s=gn(i.trim());r.target=s;let a=Nr(n,r);ee.info(`Creating new project in ${Rt(" "+s+" ")} ... \u{1F407}`);let f=null;if(Rn.default.existsSync(s)&&Rn.default.readdirSync(s).length>0){let B=await ii({message:`Directory "./${(0,Ln.relative)(process.cwd(),s)}" 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"}]});(He(B)||B==="exit")&&(st("Operation cancelled."),process.exit(0)),B==="replace"&&(f=on(s))}let D=await ii({message:"Select a starter",options:o.map(B=>{var N;return{label:B.name,value:B.id,hint:(N=B.pkgJson)==null?void 0:N.description}})});He(D)&&(st("Operation cancelled."),process.exit(0));let h=D,c=await nn({message:`Would you like to install ${n} dependencies?`,initialValue:!0});He(c)&&(st("Operation cancelled."),process.exit(0));let d=await nn({message:"Initialize a new git repository?",initialValue:!0});f&&await f;let C=c;if(!C)a.abort();else if(typeof a.success>"u")try{let B=await nn({message:"Finishing the install. Wanna hear a joke?",initialValue:!0});if(!He(B)&&B){let[N,U]=Jo();an(ge(`${N.trim()}
|
|
164
164
|
${U.trim()}`),"\u{1F648}")}}catch{}let E=wt();E.start("Creating App...");let b=await Ot({appId:h,outDir:s,pkgManager:n,templateManager:e});if(E.stop("App Created \u{1F430}"),d)if(Rn.default.existsSync((0,Ln.join)(s,".git")))ee.info("Git has already been initialized before. Skipping...");else{E.start("Git initializing...");try{let B=[];if(B.push(await $t("git",["init"],s).install),B.push(await $t("git",["add","-A"],s).install),B.push(await $t("git",["commit","-m","Initial commit \u26A1\uFE0F"],s).install),B.some(N=>N===!1))throw"";E.stop("Git initialized \u{1F3B2}")}catch{E.stop("Git failed to initialize"),ee.error(Fe("Git failed to initialize. You can do this manually by running: git init"))}}let g=!1;return C&&(g=await dn(async()=>{let B=await a.complete(b.outDir);return B&&await rt(n,b.outDir).install},{pkgManager:n,spinner:E})),mn(n,b,g),b}async function Ko(n){let e=Ye(),t=await Bt("app");return await Ot({appId:n.starterId,templateManager:t,outDir:n.outDir,pkgManager:e})}async function Dc(){Mr(),hc();try{let n=process.argv.slice(2);n.length>0?await Xi(...n):await ts()}catch(n){Lt(n.message||n)}}function hc(){let n=process.version,[e,t]=n.replace("v","").split(".");Number(e)<16?(console.error(Fe(`Qwik requires Node.js 16.8 or higher. You are currently running Node.js ${n}.`)),process.exit(1)):Number(e)===16?Number(t)<8&&console.warn(Is(`Node.js 16.8 or higher is recommended. You are currently running Node.js ${n}.`)):Number(e)===18&&Number(t)<11&&console.error(Fe(`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 ${n}. https://github.com/QwikDev/qwik/issues/3035`))}0&&(module.exports={createApp,runCli,runCreateCli,runCreateInteractiveCli});
|
|
165
165
|
/*! Bundled license information:
|
|
166
166
|
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
# Qwik
|
|
1
|
+
# Qwik App ⚡️
|
|
2
2
|
|
|
3
3
|
- [Qwik Docs](https://qwik.dev/)
|
|
4
4
|
- [Discord](https://qwik.dev/chat)
|
|
@@ -10,7 +10,7 @@
|
|
|
10
10
|
|
|
11
11
|
## Project Structure
|
|
12
12
|
|
|
13
|
-
This project is using Qwik with [
|
|
13
|
+
This project is using Qwik with [QwikRouter](https://qwik.dev/docs/). QwikRouter is just an extra set of tools on top of Qwik to make it easier to build a full site, including directory-based routing, layouts, and more.
|
|
14
14
|
|
|
15
15
|
Inside your project, you'll see the following directory structure:
|
|
16
16
|
|
|
@@ -24,7 +24,7 @@ Inside your project, you'll see the following directory structure:
|
|
|
24
24
|
└── ...
|
|
25
25
|
```
|
|
26
26
|
|
|
27
|
-
- `src/routes`: Provides the directory-based routing, which can include a hierarchy of `layout.tsx` layout files, and an `index.tsx` file as the page. Additionally, `index.ts` files are endpoints. Please see the [routing docs](https://qwik.dev/
|
|
27
|
+
- `src/routes`: Provides the directory-based routing, which can include a hierarchy of `layout.tsx` layout files, and an `index.tsx` file as the page. Additionally, `index.ts` files are endpoints. Please see the [routing docs](https://qwik.dev/docs/routing/) for more info.
|
|
28
28
|
|
|
29
29
|
- `src/components`: Recommended directory for components.
|
|
30
30
|
|
|
@@ -32,7 +32,7 @@ Inside your project, you'll see the following directory structure:
|
|
|
32
32
|
|
|
33
33
|
## Add Integrations and deployment
|
|
34
34
|
|
|
35
|
-
Use the `npm run qwik add` command to add additional integrations. Some examples of integrations includes: Cloudflare, Netlify or Express Server, and the [Static Site Generator (SSG)](https://qwik.dev/
|
|
35
|
+
Use the `npm run qwik add` command to add additional integrations. Some examples of integrations includes: Cloudflare, Netlify or Express Server, and the [Static Site Generator (SSG)](https://qwik.dev/docs/guides/static-site-generation/).
|
|
36
36
|
|
|
37
37
|
```shell
|
|
38
38
|
npm run qwik add # or `yarn qwik add`
|
|
@@ -16,18 +16,17 @@
|
|
|
16
16
|
"qwik": "qwik"
|
|
17
17
|
},
|
|
18
18
|
"devDependencies": {
|
|
19
|
-
"@
|
|
20
|
-
"@
|
|
19
|
+
"@qwik.dev/core": "^2.0.0-alpha.0",
|
|
20
|
+
"@qwik.dev/router": "^2.0.0-alpha.0",
|
|
21
21
|
"@types/eslint": "8.56.10",
|
|
22
22
|
"@types/node": "20.14.11",
|
|
23
23
|
"@typescript-eslint/eslint-plugin": "7.16.1",
|
|
24
24
|
"@typescript-eslint/parser": "7.16.1",
|
|
25
25
|
"eslint": "8.57.0",
|
|
26
|
-
"eslint-plugin-qwik": "^
|
|
26
|
+
"eslint-plugin-qwik": "^2.0.0-alpha.0",
|
|
27
27
|
"prettier": "3.3.3",
|
|
28
28
|
"typescript": "5.4.5",
|
|
29
|
-
"
|
|
30
|
-
"vite": "5.3.5",
|
|
29
|
+
"vite": "5.4.10",
|
|
31
30
|
"vite-tsconfig-paths": "^4.2.1"
|
|
32
31
|
},
|
|
33
32
|
"trustedDependencies": [
|
|
@@ -9,7 +9,7 @@
|
|
|
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 "@
|
|
12
|
+
import { render, type RenderOptions } from "@qwik.dev/core";
|
|
13
13
|
import Root from "./root";
|
|
14
14
|
|
|
15
15
|
export default function (opts: RenderOptions) {
|
|
@@ -10,12 +10,11 @@
|
|
|
10
10
|
* - https://vitejs.dev/config/preview-options.html#preview-options
|
|
11
11
|
*
|
|
12
12
|
*/
|
|
13
|
-
import {
|
|
14
|
-
|
|
15
|
-
// make sure qwikCityPlan is imported before entry
|
|
13
|
+
import { createQwikRouter } from "@qwik.dev/router/middleware/node";
|
|
14
|
+
// make sure qwikRouterConfig is imported before entry
|
|
16
15
|
import render from "./entry.ssr";
|
|
17
16
|
|
|
18
17
|
/**
|
|
19
|
-
* The default export is the
|
|
18
|
+
* The default export is the QwikRouter adapter used by Vite preview.
|
|
20
19
|
*/
|
|
21
|
-
export default
|
|
20
|
+
export default createQwikRouter({ render, qwikRouterConfig });
|
|
@@ -10,11 +10,11 @@
|
|
|
10
10
|
* - npm run build
|
|
11
11
|
*
|
|
12
12
|
*/
|
|
13
|
+
import { manifest } from "@qwik-client-manifest";
|
|
13
14
|
import {
|
|
14
15
|
renderToStream,
|
|
15
16
|
type RenderToStreamOptions,
|
|
16
|
-
} from "@
|
|
17
|
-
import { manifest } from "@qwik-client-manifest";
|
|
17
|
+
} from "@qwik.dev/core/server";
|
|
18
18
|
import Root from "./root";
|
|
19
19
|
|
|
20
20
|
export default function (opts: RenderToStreamOptions) {
|
|
@@ -2,12 +2,12 @@
|
|
|
2
2
|
* WHAT IS THIS FILE?
|
|
3
3
|
*
|
|
4
4
|
* The service-worker.ts file is used to have state of the art prefetching.
|
|
5
|
-
* https://qwik.dev/
|
|
5
|
+
* https://qwik.dev/docs/advanced/speculative-module-fetching/
|
|
6
6
|
*
|
|
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 "@
|
|
10
|
+
import { setupServiceWorker } from "@qwik.dev/router/service-worker";
|
|
11
11
|
|
|
12
12
|
setupServiceWorker();
|
|
13
13
|
|
|
@@ -5,10 +5,11 @@
|
|
|
5
5
|
"module": "ES2022",
|
|
6
6
|
"lib": ["es2022", "DOM", "WebWorker", "DOM.Iterable"],
|
|
7
7
|
"jsx": "react-jsx",
|
|
8
|
-
"jsxImportSource": "@
|
|
8
|
+
"jsxImportSource": "@qwik.dev/core",
|
|
9
9
|
"strict": true,
|
|
10
10
|
"forceConsistentCasingInFileNames": true,
|
|
11
11
|
"resolveJsonModule": true,
|
|
12
|
+
"allowImportingTsExtensions": true,
|
|
12
13
|
"moduleResolution": "Bundler",
|
|
13
14
|
"esModuleInterop": true,
|
|
14
15
|
"skipLibCheck": true,
|
|
@@ -2,9 +2,9 @@
|
|
|
2
2
|
* This is the base config for vite.
|
|
3
3
|
* When building, the adapter config is used which loads this file and extends it.
|
|
4
4
|
*/
|
|
5
|
+
import { qwikVite } from "@qwik.dev/core/optimizer";
|
|
6
|
+
import { qwikRouter } from "@qwik.dev/router/vite";
|
|
5
7
|
import { defineConfig, type UserConfig } from "vite";
|
|
6
|
-
import { qwikVite } from "@builder.io/qwik/optimizer";
|
|
7
|
-
import { qwikCity } from "@builder.io/qwik-city/vite";
|
|
8
8
|
import tsconfigPaths from "vite-tsconfig-paths";
|
|
9
9
|
import pkg from "./package.json";
|
|
10
10
|
|
|
@@ -17,11 +17,11 @@ const { dependencies = {}, devDependencies = {} } = pkg as any as {
|
|
|
17
17
|
errorOnDuplicatesPkgDeps(devDependencies, dependencies);
|
|
18
18
|
|
|
19
19
|
/**
|
|
20
|
-
* Note that Vite normally starts from `index.html` but the
|
|
20
|
+
* Note that Vite normally starts from `index.html` but the qwikRouter plugin makes start at `src/entry.ssr.tsx` instead.
|
|
21
21
|
*/
|
|
22
22
|
export default defineConfig(({ command, mode }): UserConfig => {
|
|
23
23
|
return {
|
|
24
|
-
plugins: [
|
|
24
|
+
plugins: [qwikRouter(), qwikVite(), tsconfigPaths()],
|
|
25
25
|
// This tells Vite which dependencies to pre-build in dev mode.
|
|
26
26
|
optimizeDeps: {
|
|
27
27
|
// Put problematic deps that break bundling here, mostly those with binaries.
|
|
@@ -84,8 +84,8 @@ function errorOnDuplicatesPkgDeps(
|
|
|
84
84
|
/qwik/i.test(value),
|
|
85
85
|
);
|
|
86
86
|
|
|
87
|
-
// any errors for missing "qwik-
|
|
88
|
-
// [PLUGIN_ERROR]: Invalid module "@qwik-
|
|
87
|
+
// any errors for missing "qwik-router-config"
|
|
88
|
+
// [PLUGIN_ERROR]: Invalid module "@qwik-router-config" is not a valid package
|
|
89
89
|
msg = `Move qwik packages ${qwikPkg.join(", ")} to devDependencies`;
|
|
90
90
|
|
|
91
91
|
if (qwikPkg.length > 0) {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
1
|
+
import { useDocumentHead, useLocation } from "@qwik.dev/router";
|
|
2
|
+
import { component$ } from "@qwik.dev/core";
|
|
3
3
|
|
|
4
4
|
/**
|
|
5
5
|
* The RouterHead component is placed inside of the document `<head>` element.
|
|
@@ -25,23 +25,7 @@ export const RouterHead = component$(() => {
|
|
|
25
25
|
))}
|
|
26
26
|
|
|
27
27
|
{head.styles.map((s) => (
|
|
28
|
-
<style
|
|
29
|
-
key={s.key}
|
|
30
|
-
{...s.props}
|
|
31
|
-
{...(s.props?.dangerouslySetInnerHTML
|
|
32
|
-
? {}
|
|
33
|
-
: { dangerouslySetInnerHTML: s.style })}
|
|
34
|
-
/>
|
|
35
|
-
))}
|
|
36
|
-
|
|
37
|
-
{head.scripts.map((s) => (
|
|
38
|
-
<script
|
|
39
|
-
key={s.key}
|
|
40
|
-
{...s.props}
|
|
41
|
-
{...(s.props?.dangerouslySetInnerHTML
|
|
42
|
-
? {}
|
|
43
|
-
: { dangerouslySetInnerHTML: s.script })}
|
|
44
|
-
/>
|
|
28
|
+
<style key={s.key} {...s.props} dangerouslySetInnerHTML={s.style} />
|
|
45
29
|
))}
|
|
46
30
|
</>
|
|
47
31
|
);
|
|
@@ -1,24 +1,24 @@
|
|
|
1
|
-
import { component$ } from "@
|
|
1
|
+
import { component$ } from "@qwik.dev/core";
|
|
2
|
+
import { isDev } from "@qwik.dev/core/build";
|
|
2
3
|
import {
|
|
3
|
-
|
|
4
|
+
QwikRouterProvider,
|
|
4
5
|
RouterOutlet,
|
|
5
6
|
ServiceWorkerRegister,
|
|
6
|
-
} from "@
|
|
7
|
+
} from "@qwik.dev/router";
|
|
7
8
|
import { RouterHead } from "./components/router-head/router-head";
|
|
8
|
-
import { isDev } from "@builder.io/qwik/build";
|
|
9
9
|
|
|
10
10
|
import "./global.css";
|
|
11
11
|
|
|
12
12
|
export default component$(() => {
|
|
13
13
|
/**
|
|
14
|
-
* The root of a
|
|
14
|
+
* The root of a QwikRouter site always start with the <QwikRouterProvider> component,
|
|
15
15
|
* immediately followed by the document's <head> and <body>.
|
|
16
16
|
*
|
|
17
17
|
* Don't remove the `<head>` and `<body>` elements.
|
|
18
18
|
*/
|
|
19
19
|
|
|
20
20
|
return (
|
|
21
|
-
<
|
|
21
|
+
<QwikRouterProvider>
|
|
22
22
|
<head>
|
|
23
23
|
<meta charset="utf-8" />
|
|
24
24
|
{!isDev && (
|
|
@@ -33,6 +33,6 @@ export default component$(() => {
|
|
|
33
33
|
<RouterOutlet />
|
|
34
34
|
{!isDev && <ServiceWorkerRegister />}
|
|
35
35
|
</body>
|
|
36
|
-
</
|
|
36
|
+
</QwikRouterProvider>
|
|
37
37
|
);
|
|
38
38
|
});
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import
|
|
1
|
+
import type { RequestHandler } from "@qwik.dev/router";
|
|
2
|
+
import { component$, Slot } from "@qwik.dev/core";
|
|
3
3
|
|
|
4
4
|
export const onGet: RequestHandler = async ({ cacheControl }) => {
|
|
5
5
|
// Control caching for this request for best performance and to reduce hosting costs:
|
|
@@ -2,12 +2,12 @@
|
|
|
2
2
|
* WHAT IS THIS FILE?
|
|
3
3
|
*
|
|
4
4
|
* The service-worker.ts file is used to have state of the art prefetching.
|
|
5
|
-
* https://qwik.dev/
|
|
5
|
+
* https://qwik.dev/docs/advanced/speculative-module-fetching/
|
|
6
6
|
*
|
|
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 "@
|
|
10
|
+
import { setupServiceWorker } from "@qwik.dev/router/service-worker";
|
|
11
11
|
|
|
12
12
|
setupServiceWorker();
|
|
13
13
|
|
|
@@ -33,18 +33,17 @@
|
|
|
33
33
|
"release": "np"
|
|
34
34
|
},
|
|
35
35
|
"devDependencies": {
|
|
36
|
-
"@
|
|
36
|
+
"@qwik.dev/core": "2.0.0-alpha.0",
|
|
37
37
|
"@types/eslint": "8.56.10",
|
|
38
38
|
"@types/node": "20.14.11",
|
|
39
39
|
"@typescript-eslint/eslint-plugin": "7.16.1",
|
|
40
40
|
"@typescript-eslint/parser": "7.16.1",
|
|
41
41
|
"eslint": "8.57.0",
|
|
42
|
-
"eslint-plugin-qwik": "
|
|
42
|
+
"eslint-plugin-qwik": "2.0.0-alpha.0",
|
|
43
43
|
"np": "^8.0.4",
|
|
44
44
|
"prettier": "3.3.3",
|
|
45
45
|
"typescript": "5.4.5",
|
|
46
|
-
"
|
|
47
|
-
"vite": "5.3.5",
|
|
46
|
+
"vite": "5.4.10",
|
|
48
47
|
"vite-tsconfig-paths": "^4.2.1"
|
|
49
48
|
},
|
|
50
49
|
"__qwik__": {
|
|
@@ -9,7 +9,7 @@
|
|
|
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 "@
|
|
12
|
+
import { render, type RenderOptions } from "@qwik.dev/core";
|
|
13
13
|
import Root from "./root";
|
|
14
14
|
|
|
15
15
|
export default function (opts: RenderOptions) {
|
|
@@ -10,11 +10,11 @@
|
|
|
10
10
|
* - npm run build
|
|
11
11
|
*
|
|
12
12
|
*/
|
|
13
|
+
import { manifest } from "@qwik-client-manifest";
|
|
13
14
|
import {
|
|
14
15
|
renderToStream,
|
|
15
16
|
type RenderToStreamOptions,
|
|
16
|
-
} from "@
|
|
17
|
-
import { manifest } from "@qwik-client-manifest";
|
|
17
|
+
} from "@qwik.dev/core/server";
|
|
18
18
|
import Root from "./root";
|
|
19
19
|
|
|
20
20
|
export default function (opts: RenderToStreamOptions) {
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
+
import { qwikVite } from "@qwik.dev/core/optimizer";
|
|
1
2
|
import { defineConfig } from "vite";
|
|
2
|
-
import pkg from "./package.json";
|
|
3
|
-
import { qwikVite } from "@builder.io/qwik/optimizer";
|
|
4
3
|
import tsconfigPaths from "vite-tsconfig-paths";
|
|
4
|
+
import pkg from "./package.json";
|
|
5
5
|
|
|
6
6
|
const { dependencies = {}, peerDependencies = {} } = pkg as any;
|
|
7
7
|
const makeRegex = (dep) => new RegExp(`^${dep}(/.*)?$`);
|
|
@@ -4,8 +4,8 @@
|
|
|
4
4
|
"type": "module",
|
|
5
5
|
"__qwik__": {
|
|
6
6
|
"priority": 2,
|
|
7
|
-
"displayName": "Playground App (Qwik
|
|
8
|
-
"
|
|
7
|
+
"displayName": "Playground App (Qwik + Qwik Router)",
|
|
8
|
+
"qwikRouter": true,
|
|
9
9
|
"docs": [
|
|
10
10
|
"https://qwik.dev/docs/getting-started/"
|
|
11
11
|
]
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { useDocumentHead, useLocation } from "@
|
|
1
|
+
import { useDocumentHead, useLocation } from "@qwik.dev/router";
|
|
2
2
|
|
|
3
|
-
import { component$ } from "@
|
|
3
|
+
import { component$ } from "@qwik.dev/core";
|
|
4
4
|
|
|
5
5
|
/**
|
|
6
6
|
* The RouterHead component is placed inside of the document `<head>` element.
|
|
@@ -26,23 +26,11 @@ export const RouterHead = component$(() => {
|
|
|
26
26
|
))}
|
|
27
27
|
|
|
28
28
|
{head.styles.map((s) => (
|
|
29
|
-
<style
|
|
30
|
-
key={s.key}
|
|
31
|
-
{...s.props}
|
|
32
|
-
{...(s.props?.dangerouslySetInnerHTML
|
|
33
|
-
? {}
|
|
34
|
-
: { dangerouslySetInnerHTML: s.style })}
|
|
35
|
-
/>
|
|
29
|
+
<style key={s.key} {...s.props} dangerouslySetInnerHTML={s.style} />
|
|
36
30
|
))}
|
|
37
31
|
|
|
38
32
|
{head.scripts.map((s) => (
|
|
39
|
-
<script
|
|
40
|
-
key={s.key}
|
|
41
|
-
{...s.props}
|
|
42
|
-
{...(s.props?.dangerouslySetInnerHTML
|
|
43
|
-
? {}
|
|
44
|
-
: { dangerouslySetInnerHTML: s.script })}
|
|
45
|
-
/>
|
|
33
|
+
<script key={s.key} {...s.props} dangerouslySetInnerHTML={s.script} />
|
|
46
34
|
))}
|
|
47
35
|
</>
|
|
48
36
|
);
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { component$, useSignal
|
|
2
|
-
import styles from "./counter.module.css";
|
|
1
|
+
import { $, component$, useSignal } from "@qwik.dev/core";
|
|
3
2
|
import Gauge from "../gauge";
|
|
3
|
+
import styles from "./counter.module.css";
|
|
4
4
|
|
|
5
5
|
export default component$(() => {
|
|
6
6
|
const count = useSignal(70);
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { component$ } from "@
|
|
2
|
-
import styles from "./hero.module.css";
|
|
1
|
+
import { component$ } from "@qwik.dev/core";
|
|
3
2
|
import ImgThunder from "../../../media/thunder.png?jsx";
|
|
3
|
+
import styles from "./hero.module.css";
|
|
4
4
|
|
|
5
5
|
export default component$(() => {
|
|
6
6
|
return (
|
|
@@ -1,24 +1,24 @@
|
|
|
1
|
-
import { component$ } from "@
|
|
2
|
-
import { isDev } from "@
|
|
1
|
+
import { component$ } from "@qwik.dev/core";
|
|
2
|
+
import { isDev } from "@qwik.dev/core/build";
|
|
3
3
|
import {
|
|
4
|
-
|
|
4
|
+
QwikRouterProvider,
|
|
5
5
|
RouterOutlet,
|
|
6
6
|
ServiceWorkerRegister,
|
|
7
|
-
} from "@
|
|
7
|
+
} from "@qwik.dev/router";
|
|
8
8
|
import { RouterHead } from "./components/router-head/router-head";
|
|
9
9
|
|
|
10
10
|
import "./global.css";
|
|
11
11
|
|
|
12
12
|
export default component$(() => {
|
|
13
13
|
/**
|
|
14
|
-
* The root of a
|
|
14
|
+
* The root of a QwikRouter site always start with the <QwikRouterProvider> component,
|
|
15
15
|
* immediately followed by the document's <head> and <body>.
|
|
16
16
|
*
|
|
17
17
|
* Don't remove the `<head>` and `<body>` elements.
|
|
18
18
|
*/
|
|
19
19
|
|
|
20
20
|
return (
|
|
21
|
-
<
|
|
21
|
+
<QwikRouterProvider>
|
|
22
22
|
<head>
|
|
23
23
|
<meta charset="utf-8" />
|
|
24
24
|
{!isDev && (
|
|
@@ -33,6 +33,6 @@ export default component$(() => {
|
|
|
33
33
|
<body lang="en">
|
|
34
34
|
<RouterOutlet />
|
|
35
35
|
</body>
|
|
36
|
-
</
|
|
36
|
+
</QwikRouterProvider>
|
|
37
37
|
);
|
|
38
38
|
});
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
+
import { type DocumentHead, useLocation } from "@qwik.dev/router";
|
|
1
2
|
import {
|
|
2
3
|
component$,
|
|
3
|
-
useVisibleTask$,
|
|
4
4
|
useStore,
|
|
5
5
|
useStylesScoped$,
|
|
6
|
-
|
|
7
|
-
|
|
6
|
+
useVisibleTask$,
|
|
7
|
+
} from "@qwik.dev/core";
|
|
8
8
|
import styles from "./flower.css?inline";
|
|
9
9
|
|
|
10
10
|
export default component$(() => {
|
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
import { component$ } from "@builder.io/qwik";
|
|
2
1
|
import {
|
|
3
2
|
type DocumentHead,
|
|
4
|
-
|
|
3
|
+
Form,
|
|
5
4
|
routeAction$,
|
|
6
|
-
|
|
5
|
+
routeLoader$,
|
|
7
6
|
z,
|
|
8
|
-
|
|
9
|
-
} from "@
|
|
7
|
+
zod$,
|
|
8
|
+
} from "@qwik.dev/router";
|
|
9
|
+
import { component$ } from "@qwik.dev/core";
|
|
10
10
|
import styles from "./todolist.module.css";
|
|
11
11
|
|
|
12
12
|
interface ListItem {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import
|
|
1
|
+
import type { DocumentHead } from "@qwik.dev/router";
|
|
2
|
+
import { component$ } from "@qwik.dev/core";
|
|
3
3
|
|
|
4
4
|
import Counter from "../components/starter/counter/counter";
|
|
5
5
|
import Hero from "../components/starter/hero/hero";
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { routeLoader$ } from "@
|
|
3
|
-
import
|
|
1
|
+
import type { RequestHandler } from "@qwik.dev/router";
|
|
2
|
+
import { routeLoader$ } from "@qwik.dev/router";
|
|
3
|
+
import { component$, Slot, useStyles$ } from "@qwik.dev/core";
|
|
4
4
|
|
|
5
|
-
import Header from "../components/starter/header/header";
|
|
6
5
|
import Footer from "../components/starter/footer/footer";
|
|
6
|
+
import Header from "../components/starter/header/header";
|
|
7
7
|
|
|
8
8
|
import styles from "./styles.css?inline";
|
|
9
9
|
|
|
@@ -2,12 +2,12 @@
|
|
|
2
2
|
* WHAT IS THIS FILE?
|
|
3
3
|
*
|
|
4
4
|
* The service-worker.ts file is used to have state of the art prefetching.
|
|
5
|
-
* https://qwik.dev/
|
|
5
|
+
* https://qwik.dev/docs/advanced/speculative-module-fetching/
|
|
6
6
|
*
|
|
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 "@
|
|
10
|
+
import { setupServiceWorker } from "@qwik.dev/router/service-worker";
|
|
11
11
|
|
|
12
12
|
setupServiceWorker();
|
|
13
13
|
|
package/package.json
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "create-qwik",
|
|
3
3
|
"description": "Interactive CLI for create Qwik projects and adding features.",
|
|
4
|
-
"version": "
|
|
5
|
-
"author": "
|
|
4
|
+
"version": "2.0.0-alpha.0",
|
|
5
|
+
"author": "Qwik Team",
|
|
6
6
|
"bin": "./create-qwik.cjs",
|
|
7
7
|
"bugs": "https://github.com/QwikDev/qwik/issues",
|
|
8
8
|
"devDependencies": {
|