create-qwik 2.0.0-alpha.9 → 2.0.0-beta.2
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/README.md +1 -1
- package/dist/index.cjs +4 -22
- package/dist/starters/apps/base/eslint.config.js +73 -0
- package/dist/starters/apps/base/package.json +9 -8
- package/dist/starters/apps/base/src/entry.ssr.tsx +0 -2
- package/dist/starters/apps/base/tsconfig.json +3 -2
- package/dist/starters/apps/base/vite.config.mts +1 -1
- package/dist/starters/apps/empty/src/root.tsx +1 -6
- package/dist/starters/apps/library/README.md +1 -1
- package/dist/starters/apps/library/eslint.config.js +68 -0
- package/dist/starters/apps/library/package.json +7 -7
- package/dist/starters/apps/library/src/entry.ssr.tsx +1 -5
- package/dist/starters/apps/library/vite.config.mts +1 -1
- package/dist/starters/apps/playground/src/root.tsx +1 -6
- package/dist/starters/apps/playground/src/routes/demo/flower/index.tsx +1 -0
- package/dist/starters/apps/playground/src/routes/layout.tsx +1 -13
- package/package.json +1 -2
- package/dist/starters/apps/base/.eslintignore +0 -38
- package/dist/starters/apps/base/.eslintrc.cjs +0 -42
- package/dist/starters/apps/base/src/routes/service-worker.ts +0 -17
- package/dist/starters/apps/empty/src/routes/layout.tsx +0 -17
- package/dist/starters/apps/empty/src/routes/service-worker.ts +0 -18
- package/dist/starters/apps/library/.eslintignore +0 -31
- package/dist/starters/apps/library/.eslintrc.cjs +0 -40
- package/dist/starters/apps/playground/src/routes/service-worker.ts +0 -18
package/README.md
CHANGED
package/dist/index.cjs
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* @license
|
|
3
|
-
* create-qwik 2.0.0-
|
|
3
|
+
* create-qwik 2.0.0-beta.2-dev+3ddc6c7
|
|
4
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
|
|
@@ -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 Sr(n){let e=(0,Ei.join)(n,"package.json");return JSON.parse(await bi.default.promises.readFile(e,"utf-8"))}async function jr(n,e){let t=(0,Ei.join)(n,"package.json");await bi.default.promises.writeFile(t,JSON.stringify(e,null,2)+`
|
|
56
|
-
`)}function Ir(n){return new Promise(e=>setTimeout(e,n))}function Pr(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 Mr(n){return n.toLocaleLowerCase().split("-").map(e=>e.charAt(0).toUpperCase()+e.slice(1)).join(" ")}function Ye(){var n;return((n=(0,Or.default)())==null?void 0:n.name)||"
|
|
56
|
+
`)}function Ir(n){return new Promise(e=>setTimeout(e,n))}function Pr(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 Mr(n){return n.toLocaleLowerCase().split("-").map(e=>e.charAt(0).toUpperCase()+e.slice(1)).join(" ")}function Ye(){var n;return((n=(0,Or.default)())==null?void 0:n.name)||"pnpm"}function kt(n){console.error(`
|
|
57
57
|
\u274C ${Fe(n)}
|
|
58
58
|
`),process.exit(1)}function Tr(){console.log(Ms(`
|
|
59
59
|
${ge("............")}
|
|
@@ -96,7 +96,7 @@ ${Ge(Ca+Br.repeat(r+2)+Fa)}
|
|
|
96
96
|
`+o.trim()+`
|
|
97
97
|
`,a=i.installDeps===!0;n.files.push({path:t,content:a?s:r,type:a?"modify":"overwrite"})}catch{n.files.push({path:t,content:r,type:"create"})}}async function Ai(n,e){let i=(await Dn()).find(a=>a.id===e.integration);if(!i)throw new Error(`Unable to find integration "${e.integration}"`);let r={files:[],installedDeps:{},installedScripts:Object.keys(i.pkgJson.scripts||{})};e.installDeps&&(r.installedDeps={...i.pkgJson.dependencies,...i.pkgJson.devDependencies}),await wi(r,e,i.dir,e.rootDir,i.alwaysInRoot);let o=async a=>{let f=Object.keys(r.installedDeps).length>0,D=wt();a&&D.start(`Updating app${f?" and installing dependencies":""}...`);let h=!0;try{let c=new Set(r.files.map(C=>(0,Rr.dirname)(C.path)));for(let C of Array.from(c))try{xi.default.mkdirSync(C,{recursive:!0})}catch{}let p=Promise.all(r.files.map(async C=>{await xi.default.promises.writeFile(C.path,C.content)}));if(e.installDeps&&Object.keys(r.installedDeps).length>0){let{install:C}=rt(n,e.rootDir);h=await C}if(await p,a&&D.stop("App updated"),!h){let C=`${on(` ${n} install failed `)}
|
|
98
98
|
You might need to run "${be(`${n} install`)}" manually inside the root of the project.`;ee.error(C)}}catch(c){a&&D.stop("App updated"),kt(String(c))}};return{rootDir:e.rootDir,integration:i,updates:r,commit:o}}function _a(n){return typeof n=="string"&&n.trim().length>0}function Sa(n){if(!_a(n.outDir))throw new Error("Missing outDir");if(!(0,pn.isAbsolute)(n.outDir))throw new Error("outDir must be an absolute path")}async function Ot(n){let{appId:e,outDir:t,pkgManager:i,templateManager:r}=n,{baseApp:o,starterApp:s}=r.getBootstrapApps(e);Sa(n),hn.default.existsSync(t)||hn.default.mkdirSync(decodeURIComponent(t),{recursive:!0});let a=await ja({baseApp:o,starterApp:s,pkgManager:i,outDir:t});return{starterId:n.appId,outDir:t,pkgManager:i,docs:a}}async function ja({baseApp:n,starterApp:e,outDir:t,pkgManager:i}){let r=[...n.docs],o=e??n,s=Pr({...n.pkgJson,name:`my-${o.pkgJson.name}`,description:o.pkgJson.description,scripts:void 0,dependencies:void 0,devDependencies:void 0});await jr(t,s);let a=(0,pn.join)(t,"README.md");return await hn.default.promises.writeFile(a,""),await(await Ai(i,{rootDir:t,integration:n.id,installDeps:!1})).commit(!1),e&&(r.push(...e.docs),await(await Ai(i,{rootDir:t,integration:e.id,installDeps:!1})).commit(!1)),r}var Xi=ae(require("node:fs"));async function dn(n,{pkgManager:e,spinner:t}){t.start(`Installing ${e} dependencies...`);let i=await n();return t.stop(`${i?"Installed":"Failed to install"} ${e} dependencies \u{1F4CB}`),i}function Lr(n){let e=[];return n.length>0&&(e.push(`\u{1F4C4} ${be("Relevant docs:")}`),n.forEach(t=>{e.push(` ${t}`)})),e.push(""),e.push(`\u{1F4AC} ${be("Questions? Start the conversation at:")}`),e.push(" https://qwik.dev/chat"),e.push(" https://twitter.com/QwikDev"),e.push(""),e.join(`
|
|
99
|
-
`)}var kr=require("node:path");function mn(n,e,t){let i=process.cwd()===e.outDir,r=(0,kr.relative)(process.cwd(),e.outDir),o=[];i?o.push(`\u{1F984} ${ui(" Success! ")}`):o.push(`\u{1F984} ${ui(" Success! ")} ${be("Project created in")} ${js(ge(r))} ${be("directory")}`),o.push("");let s=n!=="npm"?`${n} qwik add`:"npm run qwik add";o.push(`\u{1F90D} ${be("Integrations? Add Netlify, Cloudflare, Tailwind...")}`),o.push(` ${s}`),o.push(""),o.push(Lr(e.docs)),o.push(`\u{1F440} ${be("Presentations, Podcasts and Videos:")}`),o.push(" https://qwik.dev/media/"),o.push(""),o.push(`\u{1F430} ${be("Next steps:")}`),i||o.push(` cd ${r}`),t||o.push(` ${n} install`),o.push(` ${n} start`),o.push(""),cn(o.join(`
|
|
99
|
+
`)}var kr=require("node:path");function mn(n,e,t){let i=process.cwd()===e.outDir,r=(0,kr.relative)(process.cwd(),e.outDir),o=[];i?o.push(`\u{1F984} ${ui(" Success! ")}`):o.push(`\u{1F984} ${ui(" Success! ")} ${be("Project created in")} ${js(ge(r))} ${be("directory")}`),o.push("");let s=n!=="npm"?`${n} qwik add`:"npm run qwik add";o.push(`\u{1F90D} ${be("Integrations? Add Netlify, Cloudflare, Tailwind...")}`),o.push(` ${s}`),o.push(""),o.push(Lr(e.docs)),o.push(`\u{1F440} ${be("Presentations, Podcasts and Videos:")}`),o.push(" https://qwik.dev/media/"),o.push(""),o.push(`\u{1F430} ${be("Next steps:")}`),i||o.push(` cd ${r}`),t||o.push(` ${n} install`),n==="deno"?o.push(" deno task start"):o.push(` ${n} start`),o.push(""),cn(o.join(`
|
|
100
100
|
`),"Result"),ri("Happy coding! \u{1F389}")}var $i,Ia="library",gn="base",zt=class extends Error{constructor(e,t){super(),this.message=`Invalid app id "${e}". It can only be one of${t.map(i=>` "${i.id}"`)}.`}},_t=async n=>{$i||($i=await Dn());let e=$i.filter(s=>s.type===n),t=e.filter(s=>s.id!==gn);function i(s,a=!0){return a?t.find(f=>f.id===s):e.find(f=>f.id===s)}function r(){return i(gn,!1)}function o(s){if(s===Ia){let h=i(s);if(!h)throw new zt(s,t);return{baseApp:h}}let f=i(gn,!1),D=i(s);if(!f)throw new zt(gn,t);if(!D)throw new zt(s,t);return{baseApp:f,starterApp:D}}return{templates:e,standaloneTemplates:t,getAppById:i,getBootstrapApps:o,getBaseApp:r}};var vi=require("path"),zr=ae(require("node:os"));function Cn(n){return n.startsWith("~/")?(0,vi.resolve)(zr.default.homedir(),n):(0,vi.resolve)(process.cwd(),n)}var $n=require("assert");var Pa={right:Ra,center:La},Ma=0,Fn=1,Ta=2,bn=3,Bi=class{constructor(e){var t;this.width=e.width,this.wrap=(t=e.wrap)!==null&&t!==void 0?t:!0,this.rows=[]}span(...e){let t=this.div(...e);t.span=!0}resetOutput(){this.rows=[]}div(...e){if(e.length===0&&this.div(""),this.wrap&&this.shouldApplyLayoutDSL(...e)&&typeof e[0]=="string")return this.applyLayoutDSL(e[0]);let t=e.map(i=>typeof i=="string"?this.colFromString(i):i);return this.rows.push(t),t}shouldApplyLayoutDSL(...e){return e.length===1&&typeof e[0]=="string"&&/[\t\n]/.test(e[0])}applyLayoutDSL(e){let t=e.split(`
|
|
101
101
|
`).map(r=>r.split(" ")),i=0;return t.forEach(r=>{r.length>1&&Ee.stringWidth(r[0])>i&&(i=Math.min(Math.floor(this.width*.5),Ee.stringWidth(r[0])))}),t.forEach(r=>{this.div(...r.map((o,s)=>({text:o.trim(),padding:this.measurePadding(o),width:s===0&&r.length>1?i:void 0})))}),this.rows[this.rows.length-1]}colFromString(e){return{text:e,padding:this.measurePadding(e)}}measurePadding(e){let t=Ee.stripAnsi(e);return[0,t.match(/\s*$/)[0].length,0,t.match(/^\s*/)[0].length]}toString(){let e=[];return this.rows.forEach(t=>{this.rowToString(t,e)}),e.filter(t=>!t.hidden).map(t=>t.text).join(`
|
|
102
102
|
`)}rowToString(e,t){return this.rasterize(e).forEach((i,r)=>{let o="";i.forEach((s,a)=>{let{width:f}=e[a],D=this.negatePadding(e[a]),h=s;if(D>Ee.stringWidth(s)&&(h+=" ".repeat(D-Ee.stringWidth(s))),e[a].align&&e[a].align!=="left"&&this.wrap){let p=Pa[e[a].align];h=p(h,D),Ee.stringWidth(h)<D&&(h+=" ".repeat((f||0)-Ee.stringWidth(h)-1))}let c=e[a].padding||[0,0,0,0];c[bn]&&(o+=" ".repeat(c[bn])),o+=qr(e[a],h,"| "),o+=h,o+=qr(e[a],h," |"),c[Fn]&&(o+=" ".repeat(c[Fn])),r===0&&t.length>0&&(o=this.renderInline(o,t[t.length-1]))}),t.push({text:o.replace(/ +$/,""),span:e.span})}),t}renderInline(e,t){let i=e.match(/^ */),r=i?i[0].length:0,o=t.text,s=Ee.stringWidth(o.trimRight());return t.span?this.wrap?r<s?e:(t.hidden=!0,o.trimRight()+" ".repeat(r-s)+e.trimLeft()):(t.hidden=!0,o+e):e}rasterize(e){let t=[],i=this.columnWidths(e),r;return e.forEach((o,s)=>{o.width=i[s],this.wrap?r=Ee.wrap(o.text,this.negatePadding(o),{hard:!0}).split(`
|
|
@@ -160,31 +160,13 @@ ${E.join(`
|
|
|
160
160
|
`;p.forEach(E=>{C+=E}),e.fail(C)}};let f={};o.conflicts=function(c,p){$("<string|object> [array|string]",[c,p],arguments.length),typeof c=="object"?Object.keys(c).forEach(C=>{o.conflicts(C,c[C])}):(n.global(c),f[c]||(f[c]=[]),Array.isArray(p)?p.forEach(C=>o.conflicts(c,C)):f[c].push(p))},o.getConflicting=()=>f,o.conflicting=function(c){Object.keys(c).forEach(p=>{f[p]&&f[p].forEach(C=>{C&&c[p]!==void 0&&c[C]!==void 0&&e.fail(i("Arguments %s and %s are mutually exclusive",p,C))})}),n.getInternalMethods().getParserConfiguration()["strip-dashed"]&&Object.keys(f).forEach(p=>{f[p].forEach(C=>{C&&c[t.Parser.camelCase(p)]!==void 0&&c[t.Parser.camelCase(C)]!==void 0&&e.fail(i("Arguments %s and %s are mutually exclusive",p,C))})})},o.recommendCommands=function(c,p){p=p.sort((g,B)=>B.length-g.length);let E=null,b=1/0;for(let g=0,B;(B=p[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,p=>!c[p]),f=Ke(f,p=>!c[p]),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 ki=[],Vt;function _n(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=ac(e,n.extends);else try{s=require.resolve(n.extends)}catch{return n}uc(s),ki.push(s),r=o?JSON.parse(Vt.readFileSync(s,"utf8")):require(n.extends),delete n.extends,r=_n(r,Vt.path.dirname(s),t,Vt)}return ki=[],t?Bo(r,n):Object.assign({},r,n)}function uc(n){if(ki.indexOf(n)>-1)throw new Y(`Circular extended configurations: '${n}'.`)}function ac(n,e){return Vt.path.resolve(n,e)}function Bo(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]=Bo(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,Sn,Ze,lt,jn,_e,In,Se,We,we,je,Pn,Mt,De,j,Mn,Tn,xe,ft,Tt,Dt,Xe,Nn,T,ht,pt,dt,W,Wn,Re,se;function Yo(n){return(e=[],t=n.process.cwd(),i)=>{let r=new Zi(e,t,i,n);return Object.defineProperty(r,"argv",{get:()=>r.parse(),enumerable:!0}),r.help(),r.version(),r}}var Oo=Symbol("copyDoubleDash"),_o=Symbol("copyDoubleDash"),zi=Symbol("deleteFromParserHintObject"),So=Symbol("emitWarning"),jo=Symbol("freeze"),Io=Symbol("getDollarZero"),mt=Symbol("getParserConfiguration"),Po=Symbol("getUsageConfiguration"),qi=Symbol("guessLocale"),Mo=Symbol("guessVersion"),To=Symbol("parsePositionalNumbers"),Ui=Symbol("pkgUp"),et=Symbol("populateParserHintArray"),Nt=Symbol("populateParserHintSingleValueDictionary"),Vi=Symbol("populateParserHintArrayDictionary"),Hi=Symbol("populateParserHintDictionary"),Gi=Symbol("sanitizeKey"),Yi=Symbol("setKey"),Ji=Symbol("unfreeze"),No=Symbol("validateAsync"),Wo=Symbol("getCommandInstance"),Ro=Symbol("getContext"),Lo=Symbol("getHasOutput"),ko=Symbol("getLoggerInstance"),zo=Symbol("getParseContext"),qo=Symbol("getUsageInstance"),Uo=Symbol("getValidationInstance"),Rn=Symbol("hasParseCallback"),Vo=Symbol("isGlobalContext"),gt=Symbol("postProcess"),Ho=Symbol("rebase"),Ki=Symbol("reset"),Gt=Symbol("runYargsParserAndExecuteCommands"),Qi=Symbol("runValidation"),Go=Symbol("setHasOutput"),Ct=Symbol("kTrackManuallySetKeys"),Zi=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),Sn.set(this,"show-hidden"),Ze.set(this,null),lt.set(this,!0),jn.set(this,{}),_e.set(this,!0),In.set(this,[]),Se.set(this,void 0),We.set(this,{}),we.set(this,!1),je.set(this,null),Pn.set(this,!0),Mt.set(this,void 0),De.set(this,""),j.set(this,void 0),Mn.set(this,void 0),Tn.set(this,{}),xe.set(this,null),ft.set(this,null),Tt.set(this,{}),Dt.set(this,{}),Xe.set(this,void 0),Nn.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),Wn.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,Mn,i,"f"),v(this,Se,new vn(this),"f"),this.$0=this[Io](),this[Ki](),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,Sn,"f"),v(this,Mt,this[_o](),"f")}addHelpOpt(e,t){let i="help";return $("[string|boolean] [string]",[e,t],arguments.length),u(this,je,"f")&&(this[zi](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,Sn,"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[Vi](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[Vi](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=_n(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,Mn,"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&&(Ti(e,u(this,T,"f")),u(this,j,"f").defaultDescription[e]=i),typeof t=="function"&&(Ti(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[Nt](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[Nt](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[Yi](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[qi](),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[Nt](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[So](['"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[jo](),typeof e>"u"&&(e=u(this,Xe,"f")),typeof t=="object"&&(v(this,ft,t,"f"),t=i),typeof t=="function"&&(v(this,xe,t,"f"),t=!1),t||v(this,Xe,e,"f"),u(this,xe,"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,xe,"f")&&u(this,xe,"f").call(this,u(this,Ze,"f"),s,u(this,De,"f")),s)).catch(s=>{throw u(this,xe,"f")&&u(this,xe,"f")(s,this.parsed.argv,u(this,De,"f")),s}).finally(()=>{this[Ji](),this.parsed=o}):(u(this,xe,"f")&&u(this,xe,"f").call(this,u(this,Ze,"f"),r,u(this,De,"f")),this[Ji](),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,Tn,e,"f"),this}pkgConf(e,t){$("<string> [string]",[e,t],arguments.length);let i=null,r=this[Ui](t||u(this,ct,"f"));return r[e]&&typeof r[e]=="object"&&(i=_n(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 It(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,Nn,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[Nt](this.requiresArg.bind(this),"narg",e,NaN),this)}showCompletionScript(e,t){return $("[string] [string]",[e,t],arguments.length),e=e||this.$0,u(this,Mt,"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,Wn,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[zi](u(this,Re,"f")),u(this,W,"f").version(void 0),v(this,Re,null,"f")),arguments.length===0)i=this[Mo](),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,Sn=new WeakMap,Ze=new WeakMap,lt=new WeakMap,jn=new WeakMap,_e=new WeakMap,In=new WeakMap,Se=new WeakMap,We=new WeakMap,we=new WeakMap,je=new WeakMap,Pn=new WeakMap,Mt=new WeakMap,De=new WeakMap,j=new WeakMap,Mn=new WeakMap,Tn=new WeakMap,xe=new WeakMap,ft=new WeakMap,Tt=new WeakMap,Dt=new WeakMap,Xe=new WeakMap,Nn=new WeakMap,T=new WeakMap,ht=new WeakMap,pt=new WeakMap,dt=new WeakMap,W=new WeakMap,Wn=new WeakMap,Re=new WeakMap,se=new WeakMap,Oo)](e){if(!e._||!e["--"])return e;e._.push.apply(e._,e["--"]);try{delete e["--"]}catch{}return e}[_o](){return{log:(...e)=>{this[Rn]()||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[Rn]()||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")}}}[zi](e){It(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]}[So](e,t,i){u(this,jn,"f")[i]||(u(this,T,"f").process.emitWarning(e,t),u(this,jn,"f")[i]=!0)}[jo](){u(this,In,"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,xe,"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()}[Io](){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[Ho](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,Tn,"f")}[Po](){return u(this,Wn,"f")}[qi](){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(/[.:].*/,""))}[Mo](){return this[Ui]().version||"unknown"}[To](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}[Ui](e){let t=e||"*";if(u(this,Tt,"f")[t])return u(this,Tt,"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,Tt,"f")[t]=i||{},u(this,Tt,"f")[t]}[et](e,t){t=[].concat(t),t.forEach(i=>{i=this[Gi](i),u(this,j,"f")[e].push(i)})}[Nt](e,t,i,r){this[Hi](e,t,i,r,(o,s,a)=>{u(this,j,"f")[o][s]=a})}[Vi](e,t,i,r){this[Hi](e,t,i,r,(o,s,a)=>{u(this,j,"f")[o][s]=(u(this,j,"f")[o][s]||[]).concat(a)})}[Hi](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 It(i))e(s,i[s]);else o(t,this[Gi](i),r)}[Gi](e){return e==="__proto__"?"___proto___":e}[Yi](e,t){return this[Nt](this[Yi].bind(this),"key",e,t),this}[Ji](){var e,t,i,r,o,s,a,f,D,h,c,p;let C=u(this,In,"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,p=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,xe,b,"f")}}.value,parseContext:{set value(b){v(p,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()}[No](e,t){return at(t,i=>(e(i),i))}getInternalMethods(){return{getCommandInstance:this[Wo].bind(this),getContext:this[Ro].bind(this),getHasOutput:this[Lo].bind(this),getLoggerInstance:this[ko].bind(this),getParseContext:this[zo].bind(this),getParserConfiguration:this[mt].bind(this),getUsageConfiguration:this[Po].bind(this),getUsageInstance:this[qo].bind(this),getValidationInstance:this[Uo].bind(this),hasParseCallback:this[Rn].bind(this),isGlobalContext:this[Vo].bind(this),postProcess:this[gt].bind(this),reset:this[Ki].bind(this),runValidation:this[Qi].bind(this),runYargsParserAndExecuteCommands:this[Gt].bind(this),setHasOutput:this[Go].bind(this)}}[Wo](){return u(this,ue,"f")}[Ro](){return u(this,Ht,"f")}[Lo](){return u(this,we,"f")}[ko](){return u(this,Mt,"f")}[zo](){return u(this,ft,"f")||{}}[qo](){return u(this,W,"f")}[Uo](){return u(this,se,"f")}[Rn](){return!!u(this,xe,"f")}[Vo](){return u(this,Pn,"f")}[gt](e,t,i,r){return i||J(e)||(t||(e=this[Oo](e)),(this[mt]()["parse-positional-numbers"]||this[mt]()["parse-positional-numbers"]===void 0)&&(e=this[To](e)),r&&(e=ut(e,this,u(this,Se,"f").getMiddleware(),!1))),e}[Ki](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):vo(this,u(this,W,"f"),u(this,T,"f")),"f"),v(this,ue,u(this,ue,"f")?u(this,ue,"f").reset():Co(u(this,W,"f"),u(this,se,"f"),u(this,Se,"f"),u(this,T,"f")),"f"),u(this,Oe,"f")||v(this,Oe,xo(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}[Ho](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,p=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[qi](),t)return this[gt](h,a,!!i,!1);u(this,je,"f")&&[u(this,je,"f")].concat(p[u(this,je,"f")]||[]).filter(U=>U.length>1).includes(""+h._[h._.length-1])&&(h._.pop(),C=!0),v(this,Pn,!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,Nn,"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,Mt,"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[Qi](p,{},D.error);i||(c=ut(h,this,u(this,Se,"f").getMiddleware(),!0)),c=this[No](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)}[Qi](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)}}[Go](){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 Fo(n){return!!n&&typeof n.getInternalMethods=="function"}var cc=Yo(Do),Jo=cc;function lc(n,e){return Jo(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 es(...n){let e=Ye(),t=await _t("app"),i=t.standaloneTemplates.map(({id:p})=>p),r=lc(n,i),{force:o,installDeps:s,template:a}=r,f=r.outDir;rn(`Let's create a ${Lt(" Qwik App ")} \u2728 (v2.0.0-alpha.9-dev+56ed5bd)`),fc()?f=process.cwd():(f=Cn(f),Xi.default.existsSync(f)&&Xi.default.readdirSync(f).length>0&&(o?await un(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 fc(){return Dc()}function Dc(){try{return process.cwd().startsWith("/home/projects/")}catch{}return!1}var kn=require("node:path");var Ln=ae(require("node:fs"));var ts=[["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 Ko(){let n=Math.floor(Math.random()*ts.length);return ts[n]}async function ns(){let n=Ye(),e=await _t("app"),t="./qwik-app";rn(`Let's create a ${Lt(" Qwik App ")} \u2728 (v2.0.0-alpha.9-dev+56ed5bd)`),await Ir(500);let i=await $s({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=Cn(i.trim());r.target=s;let a=Wr(n,r);ee.info(`Creating new project in ${Lt(" "+s+" ")} ... \u{1F407}`);let f=null;if(Ln.default.existsSync(s)&&Ln.default.readdirSync(s).length>0){let B=await si({message:`Directory "./${(0,kn.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=un(s))}let D=await si({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 sn({message:`Would you like to install ${n} dependencies?`,initialValue:!0});He(c)&&(st("Operation cancelled."),process.exit(0));let p=await sn({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 sn({message:"Finishing the install. Wanna hear a joke?",initialValue:!0});if(!He(B)&&B){let[N,U]=Ko();cn(ge(`${N.trim()}
|
|
163
|
+
`,"f"),v(this,De,u(this,De,"f")+e.join(" "),"f")}}}[zi](e){It(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]}[So](e,t,i){u(this,jn,"f")[i]||(u(this,T,"f").process.emitWarning(e,t),u(this,jn,"f")[i]=!0)}[jo](){u(this,In,"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,xe,"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()}[Io](){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[Ho](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,Tn,"f")}[Po](){return u(this,Wn,"f")}[qi](){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(/[.:].*/,""))}[Mo](){return this[Ui]().version||"unknown"}[To](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}[Ui](e){let t=e||"*";if(u(this,Tt,"f")[t])return u(this,Tt,"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,Tt,"f")[t]=i||{},u(this,Tt,"f")[t]}[et](e,t){t=[].concat(t),t.forEach(i=>{i=this[Gi](i),u(this,j,"f")[e].push(i)})}[Nt](e,t,i,r){this[Hi](e,t,i,r,(o,s,a)=>{u(this,j,"f")[o][s]=a})}[Vi](e,t,i,r){this[Hi](e,t,i,r,(o,s,a)=>{u(this,j,"f")[o][s]=(u(this,j,"f")[o][s]||[]).concat(a)})}[Hi](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 It(i))e(s,i[s]);else o(t,this[Gi](i),r)}[Gi](e){return e==="__proto__"?"___proto___":e}[Yi](e,t){return this[Nt](this[Yi].bind(this),"key",e,t),this}[Ji](){var e,t,i,r,o,s,a,f,D,h,c,p;let C=u(this,In,"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,p=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,xe,b,"f")}}.value,parseContext:{set value(b){v(p,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()}[No](e,t){return at(t,i=>(e(i),i))}getInternalMethods(){return{getCommandInstance:this[Wo].bind(this),getContext:this[Ro].bind(this),getHasOutput:this[Lo].bind(this),getLoggerInstance:this[ko].bind(this),getParseContext:this[zo].bind(this),getParserConfiguration:this[mt].bind(this),getUsageConfiguration:this[Po].bind(this),getUsageInstance:this[qo].bind(this),getValidationInstance:this[Uo].bind(this),hasParseCallback:this[Rn].bind(this),isGlobalContext:this[Vo].bind(this),postProcess:this[gt].bind(this),reset:this[Ki].bind(this),runValidation:this[Qi].bind(this),runYargsParserAndExecuteCommands:this[Gt].bind(this),setHasOutput:this[Go].bind(this)}}[Wo](){return u(this,ue,"f")}[Ro](){return u(this,Ht,"f")}[Lo](){return u(this,we,"f")}[ko](){return u(this,Mt,"f")}[zo](){return u(this,ft,"f")||{}}[qo](){return u(this,W,"f")}[Uo](){return u(this,se,"f")}[Rn](){return!!u(this,xe,"f")}[Vo](){return u(this,Pn,"f")}[gt](e,t,i,r){return i||J(e)||(t||(e=this[Oo](e)),(this[mt]()["parse-positional-numbers"]||this[mt]()["parse-positional-numbers"]===void 0)&&(e=this[To](e)),r&&(e=ut(e,this,u(this,Se,"f").getMiddleware(),!1))),e}[Ki](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):vo(this,u(this,W,"f"),u(this,T,"f")),"f"),v(this,ue,u(this,ue,"f")?u(this,ue,"f").reset():Co(u(this,W,"f"),u(this,se,"f"),u(this,Se,"f"),u(this,T,"f")),"f"),u(this,Oe,"f")||v(this,Oe,xo(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}[Ho](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,p=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[qi](),t)return this[gt](h,a,!!i,!1);u(this,je,"f")&&[u(this,je,"f")].concat(p[u(this,je,"f")]||[]).filter(U=>U.length>1).includes(""+h._[h._.length-1])&&(h._.pop(),C=!0),v(this,Pn,!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,Nn,"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,Mt,"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[Qi](p,{},D.error);i||(c=ut(h,this,u(this,Se,"f").getMiddleware(),!0)),c=this[No](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)}[Qi](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)}}[Go](){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 Fo(n){return!!n&&typeof n.getInternalMethods=="function"}var cc=Yo(Do),Jo=cc;function lc(n,e){return Jo(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 es(...n){let e=Ye(),t=await _t("app"),i=t.standaloneTemplates.map(({id:p})=>p),r=lc(n,i),{force:o,installDeps:s,template:a}=r,f=r.outDir;rn(`Let's create a ${Lt(" Qwik App ")} \u2728 (v2.0.0-beta.2-dev+3ddc6c7)`),fc()?f=process.cwd():(f=Cn(f),Xi.default.existsSync(f)&&Xi.default.readdirSync(f).length>0&&(o?await un(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 fc(){return Dc()}function Dc(){try{return process.cwd().startsWith("/home/projects/")}catch{}return!1}var kn=require("node:path");var Ln=ae(require("node:fs"));var ts=[["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 Ko(){let n=Math.floor(Math.random()*ts.length);return ts[n]}async function ns(){let n=Ye(),e=await _t("app"),t="./qwik-app";rn(`Let's create a ${Lt(" Qwik App ")} \u2728 (v2.0.0-beta.2-dev+3ddc6c7)`),await Ir(500);let i=await $s({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=Cn(i.trim());r.target=s;let a=Wr(n,r);ee.info(`Creating new project in ${Lt(" "+s+" ")} ... \u{1F407}`);let f=null;if(Ln.default.existsSync(s)&&Ln.default.readdirSync(s).length>0){let B=await si({message:`Directory "./${(0,kn.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=un(s))}let D=await si({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 sn({message:`Would you like to install ${n} dependencies?`,initialValue:!0});He(c)&&(st("Operation cancelled."),process.exit(0));let p=await sn({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 sn({message:"Finishing the install. Wanna hear a joke?",initialValue:!0});if(!He(B)&&B){let[N,U]=Ko();cn(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}"),p)if(Ln.default.existsSync((0,kn.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 Qo(n){let e=Ye(),t=await _t("app");return await Ot({appId:n.starterId,templateManager:t,outDir:n.outDir,pkgManager:e})}async function pc(){Tr(),dc();try{let n=process.argv.slice(2);n.length>0?await es(...n):await ns()}catch(n){kt(n.message||n)}}function dc(){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(Ps(`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
|
|
|
167
167
|
yargs-parser/build/lib/string-utils.js:
|
|
168
|
-
(**
|
|
169
|
-
* @license
|
|
170
|
-
* Copyright (c) 2016, Contributors
|
|
171
|
-
* SPDX-License-Identifier: ISC
|
|
172
|
-
*)
|
|
173
|
-
|
|
174
168
|
yargs-parser/build/lib/tokenize-arg-string.js:
|
|
175
|
-
(**
|
|
176
|
-
* @license
|
|
177
|
-
* Copyright (c) 2016, Contributors
|
|
178
|
-
* SPDX-License-Identifier: ISC
|
|
179
|
-
*)
|
|
180
|
-
|
|
181
169
|
yargs-parser/build/lib/yargs-parser-types.js:
|
|
182
|
-
(**
|
|
183
|
-
* @license
|
|
184
|
-
* Copyright (c) 2016, Contributors
|
|
185
|
-
* SPDX-License-Identifier: ISC
|
|
186
|
-
*)
|
|
187
|
-
|
|
188
170
|
yargs-parser/build/lib/yargs-parser.js:
|
|
189
171
|
(**
|
|
190
172
|
* @license
|
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
import js from "@eslint/js";
|
|
2
|
+
import globals from "globals";
|
|
3
|
+
import tseslint from "typescript-eslint";
|
|
4
|
+
import { globalIgnores } from "eslint/config";
|
|
5
|
+
import { qwikEslint9Plugin } from "eslint-plugin-qwik";
|
|
6
|
+
|
|
7
|
+
const ignores = [
|
|
8
|
+
"**/*.log",
|
|
9
|
+
"**/.DS_Store",
|
|
10
|
+
"**/*.",
|
|
11
|
+
".vscode/settings.json",
|
|
12
|
+
"**/.history",
|
|
13
|
+
"**/.yarn",
|
|
14
|
+
"**/bazel-*",
|
|
15
|
+
"**/bazel-bin",
|
|
16
|
+
"**/bazel-out",
|
|
17
|
+
"**/bazel-qwik",
|
|
18
|
+
"**/bazel-testlogs",
|
|
19
|
+
"**/dist",
|
|
20
|
+
"**/dist-dev",
|
|
21
|
+
"**/lib",
|
|
22
|
+
"**/lib-types",
|
|
23
|
+
"**/etc",
|
|
24
|
+
"**/external",
|
|
25
|
+
"**/node_modules",
|
|
26
|
+
"**/temp",
|
|
27
|
+
"**/tsc-out",
|
|
28
|
+
"**/tsdoc-metadata.json",
|
|
29
|
+
"**/target",
|
|
30
|
+
"**/output",
|
|
31
|
+
"**/rollup.config.js",
|
|
32
|
+
"**/build",
|
|
33
|
+
"**/.cache",
|
|
34
|
+
"**/.vscode",
|
|
35
|
+
"**/.rollup.cache",
|
|
36
|
+
"**/dist",
|
|
37
|
+
"**/tsconfig.tsbuildinfo",
|
|
38
|
+
"**/vite.config.ts",
|
|
39
|
+
"**/*.spec.tsx",
|
|
40
|
+
"**/*.spec.ts",
|
|
41
|
+
"**/.netlify",
|
|
42
|
+
"**/pnpm-lock.yaml",
|
|
43
|
+
"**/package-lock.json",
|
|
44
|
+
"**/yarn.lock",
|
|
45
|
+
"**/server",
|
|
46
|
+
"eslint.config.js",
|
|
47
|
+
];
|
|
48
|
+
|
|
49
|
+
export default tseslint.config(
|
|
50
|
+
globalIgnores(ignores),
|
|
51
|
+
js.configs.recommended,
|
|
52
|
+
tseslint.configs.recommended,
|
|
53
|
+
qwikEslint9Plugin.configs.recommended,
|
|
54
|
+
{
|
|
55
|
+
languageOptions: {
|
|
56
|
+
globals: {
|
|
57
|
+
...globals.browser,
|
|
58
|
+
...globals.node,
|
|
59
|
+
...globals.es2021,
|
|
60
|
+
...globals.serviceworker,
|
|
61
|
+
},
|
|
62
|
+
parserOptions: {
|
|
63
|
+
projectService: true,
|
|
64
|
+
tsconfigRootDir: import.meta.dirname,
|
|
65
|
+
},
|
|
66
|
+
},
|
|
67
|
+
},
|
|
68
|
+
{
|
|
69
|
+
rules: {
|
|
70
|
+
"@typescript-eslint/no-explicit-any": "off",
|
|
71
|
+
},
|
|
72
|
+
},
|
|
73
|
+
);
|
|
@@ -16,17 +16,18 @@
|
|
|
16
16
|
"qwik": "qwik"
|
|
17
17
|
},
|
|
18
18
|
"devDependencies": {
|
|
19
|
-
"@qwik.dev/core": "^2.0.0-
|
|
20
|
-
"@qwik.dev/router": "^2.0.0-
|
|
21
|
-
"@
|
|
19
|
+
"@qwik.dev/core": "^2.0.0-beta.2",
|
|
20
|
+
"@qwik.dev/router": "^2.0.0-beta.2",
|
|
21
|
+
"@eslint/js": "latest",
|
|
22
22
|
"@types/node": "20.14.11",
|
|
23
|
-
"
|
|
24
|
-
"
|
|
25
|
-
"eslint": "
|
|
26
|
-
"
|
|
23
|
+
"typescript-eslint": "8.26.1",
|
|
24
|
+
"eslint": "9.25.1",
|
|
25
|
+
"eslint-plugin-qwik": "^2.0.0-beta.2",
|
|
26
|
+
"globals": "16.0.0",
|
|
27
27
|
"prettier": "3.4.2",
|
|
28
28
|
"typescript": "5.8.2",
|
|
29
|
-
"
|
|
29
|
+
"typescript-plugin-css-modules": "latest",
|
|
30
|
+
"vite": "6.2.6",
|
|
30
31
|
"vite-tsconfig-paths": "^4.2.1"
|
|
31
32
|
},
|
|
32
33
|
"engines": {
|
|
@@ -10,7 +10,6 @@
|
|
|
10
10
|
* - npm run build
|
|
11
11
|
*
|
|
12
12
|
*/
|
|
13
|
-
import { manifest } from "@qwik-client-manifest";
|
|
14
13
|
import {
|
|
15
14
|
renderToStream,
|
|
16
15
|
type RenderToStreamOptions,
|
|
@@ -19,7 +18,6 @@ import Root from "./root";
|
|
|
19
18
|
|
|
20
19
|
export default function (opts: RenderToStreamOptions) {
|
|
21
20
|
return renderToStream(<Root />, {
|
|
22
|
-
manifest,
|
|
23
21
|
...opts,
|
|
24
22
|
// Use container attributes to set attributes on the html tag.
|
|
25
23
|
containerAttributes: {
|
|
@@ -19,8 +19,9 @@
|
|
|
19
19
|
"noEmit": true,
|
|
20
20
|
"paths": {
|
|
21
21
|
"~/*": ["./src/*"]
|
|
22
|
-
}
|
|
22
|
+
},
|
|
23
|
+
/* if you do not use CSS modules, remove this line and delete the typescript-plugin-css-modules module from package.json */
|
|
24
|
+
"plugins": [{ "name": "typescript-plugin-css-modules" }]
|
|
23
25
|
},
|
|
24
|
-
"files": ["./.eslintrc.cjs"],
|
|
25
26
|
"include": ["src", "./*.d.ts", "./*.config.ts"]
|
|
26
27
|
}
|
|
@@ -21,7 +21,7 @@ errorOnDuplicatesPkgDeps(devDependencies, dependencies);
|
|
|
21
21
|
*/
|
|
22
22
|
export default defineConfig(({ command, mode }): UserConfig => {
|
|
23
23
|
return {
|
|
24
|
-
plugins: [qwikRouter(), qwikVite(), tsconfigPaths()],
|
|
24
|
+
plugins: [qwikRouter(), qwikVite(), tsconfigPaths({ root: "." })],
|
|
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.
|
|
@@ -1,9 +1,5 @@
|
|
|
1
1
|
import { component$, isDev } from "@qwik.dev/core";
|
|
2
|
-
import {
|
|
3
|
-
QwikRouterProvider,
|
|
4
|
-
RouterOutlet,
|
|
5
|
-
ServiceWorkerRegister,
|
|
6
|
-
} from "@qwik.dev/router";
|
|
2
|
+
import { QwikRouterProvider, RouterOutlet } from "@qwik.dev/router";
|
|
7
3
|
import { RouterHead } from "./components/router-head/router-head";
|
|
8
4
|
|
|
9
5
|
import "./global.css";
|
|
@@ -30,7 +26,6 @@ export default component$(() => {
|
|
|
30
26
|
</head>
|
|
31
27
|
<body lang="en">
|
|
32
28
|
<RouterOutlet />
|
|
33
|
-
{!isDev && <ServiceWorkerRegister />}
|
|
34
29
|
</body>
|
|
35
30
|
</QwikRouterProvider>
|
|
36
31
|
);
|
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
- [Qwik on GitHub](https://github.com/QwikDev/qwik)
|
|
6
6
|
- [@QwikDev](https://twitter.com/QwikDev)
|
|
7
7
|
- [Vite](https://vitejs.dev/)
|
|
8
|
-
- [Partytown](https://partytown.
|
|
8
|
+
- [Partytown](https://partytown.qwik.dev/)
|
|
9
9
|
- [Mitosis](https://github.com/BuilderIO/mitosis)
|
|
10
10
|
- [Builder.io](https://www.builder.io/)
|
|
11
11
|
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
import js from "@eslint/js";
|
|
2
|
+
import globals from "globals";
|
|
3
|
+
import tseslint from "typescript-eslint";
|
|
4
|
+
import { globalIgnores } from "eslint/config";
|
|
5
|
+
import { qwikEslint9Plugin } from "eslint-plugin-qwik";
|
|
6
|
+
|
|
7
|
+
const ignores = [
|
|
8
|
+
"**/*.log",
|
|
9
|
+
"**/.DS_Store",
|
|
10
|
+
"**/*.",
|
|
11
|
+
".vscode/settings.json",
|
|
12
|
+
"**/.history",
|
|
13
|
+
"**/.yarn",
|
|
14
|
+
"**/bazel-*",
|
|
15
|
+
"**/bazel-bin",
|
|
16
|
+
"**/bazel-out",
|
|
17
|
+
"**/bazel-qwik",
|
|
18
|
+
"**/bazel-testlogs",
|
|
19
|
+
"**/dist",
|
|
20
|
+
"**/dist-dev",
|
|
21
|
+
"**/lib",
|
|
22
|
+
"**/lib-types",
|
|
23
|
+
"**/etc",
|
|
24
|
+
"**/external",
|
|
25
|
+
"**/node_modules",
|
|
26
|
+
"**/temp",
|
|
27
|
+
"**/tsc-out",
|
|
28
|
+
"**/tsdoc-metadata.json",
|
|
29
|
+
"**/target",
|
|
30
|
+
"**/output",
|
|
31
|
+
"**/rollup.config.js",
|
|
32
|
+
"**/build",
|
|
33
|
+
"**/.cache",
|
|
34
|
+
"**/.vscode",
|
|
35
|
+
"**/.rollup.cache",
|
|
36
|
+
"**/dist",
|
|
37
|
+
"**/tsconfig.tsbuildinfo",
|
|
38
|
+
"**/vite.config.ts",
|
|
39
|
+
"**/*.spec.tsx",
|
|
40
|
+
"**/*.spec.ts",
|
|
41
|
+
"**/.netlify",
|
|
42
|
+
"**/pnpm-lock.yaml",
|
|
43
|
+
"**/package-lock.json",
|
|
44
|
+
"**/yarn.lock",
|
|
45
|
+
"**/server",
|
|
46
|
+
"eslint.config.js",
|
|
47
|
+
];
|
|
48
|
+
|
|
49
|
+
export default tseslint.config(
|
|
50
|
+
globalIgnores(ignores),
|
|
51
|
+
js.configs.recommended,
|
|
52
|
+
tseslint.configs.recommended,
|
|
53
|
+
qwikEslint9Plugin.configs.recommended,
|
|
54
|
+
{
|
|
55
|
+
languageOptions: {
|
|
56
|
+
globals: {
|
|
57
|
+
...globals.browser,
|
|
58
|
+
...globals.node,
|
|
59
|
+
...globals.es2021,
|
|
60
|
+
...globals.serviceworker,
|
|
61
|
+
},
|
|
62
|
+
parserOptions: {
|
|
63
|
+
projectService: true,
|
|
64
|
+
tsconfigRootDir: import.meta.dirname,
|
|
65
|
+
},
|
|
66
|
+
},
|
|
67
|
+
},
|
|
68
|
+
);
|
|
@@ -33,17 +33,17 @@
|
|
|
33
33
|
"release": "np"
|
|
34
34
|
},
|
|
35
35
|
"devDependencies": {
|
|
36
|
-
"@qwik.dev/core": "2.0.0-
|
|
37
|
-
"@
|
|
36
|
+
"@qwik.dev/core": "2.0.0-beta.2",
|
|
37
|
+
"@eslint/js": "latest",
|
|
38
38
|
"@types/node": "20.14.11",
|
|
39
|
-
"
|
|
40
|
-
"
|
|
41
|
-
"eslint": "
|
|
42
|
-
"
|
|
39
|
+
"typescript-eslint": "8.26.1",
|
|
40
|
+
"eslint": "9.25.1",
|
|
41
|
+
"eslint-plugin-qwik": "2.0.0-beta.2",
|
|
42
|
+
"globals": "16.0.0",
|
|
43
43
|
"np": "^8.0.4",
|
|
44
44
|
"prettier": "3.4.2",
|
|
45
45
|
"typescript": "5.8.2",
|
|
46
|
-
"vite": "
|
|
46
|
+
"vite": "6.2.6",
|
|
47
47
|
"vite-tsconfig-paths": "^4.2.1"
|
|
48
48
|
},
|
|
49
49
|
"__qwik__": {
|
|
@@ -10,7 +10,6 @@
|
|
|
10
10
|
* - npm run build
|
|
11
11
|
*
|
|
12
12
|
*/
|
|
13
|
-
import { manifest } from "@qwik-client-manifest";
|
|
14
13
|
import {
|
|
15
14
|
renderToStream,
|
|
16
15
|
type RenderToStreamOptions,
|
|
@@ -18,8 +17,5 @@ import {
|
|
|
18
17
|
import Root from "./root";
|
|
19
18
|
|
|
20
19
|
export default function (opts: RenderToStreamOptions) {
|
|
21
|
-
return renderToStream(<Root />,
|
|
22
|
-
manifest,
|
|
23
|
-
...opts,
|
|
24
|
-
});
|
|
20
|
+
return renderToStream(<Root />, opts);
|
|
25
21
|
}
|
|
@@ -1,9 +1,5 @@
|
|
|
1
1
|
import { component$, isDev } from "@qwik.dev/core";
|
|
2
|
-
import {
|
|
3
|
-
QwikRouterProvider,
|
|
4
|
-
RouterOutlet,
|
|
5
|
-
ServiceWorkerRegister,
|
|
6
|
-
} from "@qwik.dev/router";
|
|
2
|
+
import { QwikRouterProvider, RouterOutlet } from "@qwik.dev/router";
|
|
7
3
|
import { RouterHead } from "./components/router-head/router-head";
|
|
8
4
|
|
|
9
5
|
import "./global.css";
|
|
@@ -27,7 +23,6 @@ export default component$(() => {
|
|
|
27
23
|
/>
|
|
28
24
|
)}
|
|
29
25
|
<RouterHead />
|
|
30
|
-
{!isDev && <ServiceWorkerRegister />}
|
|
31
26
|
</head>
|
|
32
27
|
<body lang="en">
|
|
33
28
|
<RouterOutlet />
|
|
@@ -1,23 +1,11 @@
|
|
|
1
|
-
import type { RequestHandler } from "@qwik.dev/router";
|
|
2
|
-
import { routeLoader$ } from "@qwik.dev/router";
|
|
3
1
|
import { component$, Slot, useStyles$ } from "@qwik.dev/core";
|
|
2
|
+
import { routeLoader$ } from "@qwik.dev/router";
|
|
4
3
|
|
|
5
4
|
import Footer from "../components/starter/footer/footer";
|
|
6
5
|
import Header from "../components/starter/header/header";
|
|
7
6
|
|
|
8
7
|
import styles from "./styles.css?inline";
|
|
9
8
|
|
|
10
|
-
export const onGet: RequestHandler = async ({ cacheControl }) => {
|
|
11
|
-
// Control caching for this request for best performance and to reduce hosting costs:
|
|
12
|
-
// https://qwik.dev/docs/caching/
|
|
13
|
-
cacheControl({
|
|
14
|
-
// Always serve a cached response by default, up to a week stale
|
|
15
|
-
staleWhileRevalidate: 60 * 60 * 24 * 7,
|
|
16
|
-
// Max once every 5 seconds, revalidate on the server to get a fresh version of this page
|
|
17
|
-
maxAge: 5,
|
|
18
|
-
});
|
|
19
|
-
};
|
|
20
|
-
|
|
21
9
|
export const useServerTimeLoader = routeLoader$(() => {
|
|
22
10
|
return {
|
|
23
11
|
date: new Date().toISOString(),
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "create-qwik",
|
|
3
3
|
"description": "Interactive CLI for create Qwik projects and adding features.",
|
|
4
|
-
"version": "2.0.0-
|
|
4
|
+
"version": "2.0.0-beta.2",
|
|
5
5
|
"author": "Qwik Team",
|
|
6
6
|
"bin": "./create-qwik.cjs",
|
|
7
7
|
"bugs": "https://github.com/QwikDev/qwik/issues",
|
|
@@ -25,7 +25,6 @@
|
|
|
25
25
|
],
|
|
26
26
|
"homepage": "https://qwik.dev/",
|
|
27
27
|
"keywords": [
|
|
28
|
-
"builder.io",
|
|
29
28
|
"generator",
|
|
30
29
|
"qwik",
|
|
31
30
|
"starters",
|
|
@@ -1,38 +0,0 @@
|
|
|
1
|
-
**/*.log
|
|
2
|
-
**/.DS_Store
|
|
3
|
-
*.
|
|
4
|
-
.vscode/settings.json
|
|
5
|
-
.history
|
|
6
|
-
.yarn
|
|
7
|
-
bazel-*
|
|
8
|
-
bazel-bin
|
|
9
|
-
bazel-out
|
|
10
|
-
bazel-qwik
|
|
11
|
-
bazel-testlogs
|
|
12
|
-
dist
|
|
13
|
-
dist-dev
|
|
14
|
-
lib
|
|
15
|
-
lib-types
|
|
16
|
-
etc
|
|
17
|
-
external
|
|
18
|
-
node_modules
|
|
19
|
-
temp
|
|
20
|
-
tsc-out
|
|
21
|
-
tsdoc-metadata.json
|
|
22
|
-
target
|
|
23
|
-
output
|
|
24
|
-
rollup.config.js
|
|
25
|
-
build
|
|
26
|
-
.cache
|
|
27
|
-
.vscode
|
|
28
|
-
.rollup.cache
|
|
29
|
-
dist
|
|
30
|
-
tsconfig.tsbuildinfo
|
|
31
|
-
vite.config.mts
|
|
32
|
-
*.spec.tsx
|
|
33
|
-
*.spec.ts
|
|
34
|
-
.netlify
|
|
35
|
-
pnpm-lock.yaml
|
|
36
|
-
package-lock.json
|
|
37
|
-
yarn.lock
|
|
38
|
-
server
|
|
@@ -1,42 +0,0 @@
|
|
|
1
|
-
module.exports = {
|
|
2
|
-
root: true,
|
|
3
|
-
env: {
|
|
4
|
-
browser: true,
|
|
5
|
-
es2021: true,
|
|
6
|
-
node: true,
|
|
7
|
-
},
|
|
8
|
-
extends: [
|
|
9
|
-
"eslint:recommended",
|
|
10
|
-
"plugin:@typescript-eslint/recommended",
|
|
11
|
-
"plugin:qwik/recommended",
|
|
12
|
-
],
|
|
13
|
-
parser: "@typescript-eslint/parser",
|
|
14
|
-
parserOptions: {
|
|
15
|
-
tsconfigRootDir: __dirname,
|
|
16
|
-
project: ["./tsconfig.json"],
|
|
17
|
-
ecmaVersion: 2021,
|
|
18
|
-
sourceType: "module",
|
|
19
|
-
ecmaFeatures: {
|
|
20
|
-
jsx: true,
|
|
21
|
-
},
|
|
22
|
-
},
|
|
23
|
-
plugins: ["@typescript-eslint"],
|
|
24
|
-
rules: {
|
|
25
|
-
"@typescript-eslint/no-explicit-any": "off",
|
|
26
|
-
"@typescript-eslint/explicit-module-boundary-types": "off",
|
|
27
|
-
"@typescript-eslint/no-inferrable-types": "off",
|
|
28
|
-
"@typescript-eslint/no-non-null-assertion": "off",
|
|
29
|
-
"@typescript-eslint/no-empty-interface": "off",
|
|
30
|
-
"@typescript-eslint/no-namespace": "off",
|
|
31
|
-
"@typescript-eslint/no-empty-function": "off",
|
|
32
|
-
"@typescript-eslint/no-this-alias": "off",
|
|
33
|
-
"@typescript-eslint/ban-types": "off",
|
|
34
|
-
"@typescript-eslint/ban-ts-comment": "off",
|
|
35
|
-
"prefer-spread": "off",
|
|
36
|
-
"no-case-declarations": "off",
|
|
37
|
-
"no-console": "off",
|
|
38
|
-
"@typescript-eslint/no-unused-vars": ["error"],
|
|
39
|
-
"@typescript-eslint/consistent-type-imports": "warn",
|
|
40
|
-
"@typescript-eslint/no-unnecessary-condition": "warn",
|
|
41
|
-
},
|
|
42
|
-
};
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
/*
|
|
2
|
-
* WHAT IS THIS FILE?
|
|
3
|
-
*
|
|
4
|
-
* The service-worker.ts file is used to have state of the art prefetching.
|
|
5
|
-
* https://qwik.dev/docs/advanced/speculative-module-fetching/
|
|
6
|
-
*
|
|
7
|
-
* Qwik uses a service worker to speed up your site and reduce latency, ie, not used in the traditional way of offline.
|
|
8
|
-
* You can also use this file to add more functionality that runs in the service worker.
|
|
9
|
-
*/
|
|
10
|
-
import { setupServiceWorker } from "@qwik.dev/router/service-worker";
|
|
11
|
-
|
|
12
|
-
setupServiceWorker();
|
|
13
|
-
|
|
14
|
-
self.addEventListener("install", () => self.skipWaiting());
|
|
15
|
-
self.addEventListener("activate", (ev) => ev.waitUntil(self.clients.claim()));
|
|
16
|
-
|
|
17
|
-
declare const self: ServiceWorkerGlobalScope;
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
import type { RequestHandler } from "@qwik.dev/router";
|
|
2
|
-
import { component$, Slot } from "@qwik.dev/core";
|
|
3
|
-
|
|
4
|
-
export const onGet: RequestHandler = async ({ cacheControl }) => {
|
|
5
|
-
// Control caching for this request for best performance and to reduce hosting costs:
|
|
6
|
-
// https://qwik.dev/docs/caching/
|
|
7
|
-
cacheControl({
|
|
8
|
-
// Always serve a cached response by default, up to a week stale
|
|
9
|
-
staleWhileRevalidate: 60 * 60 * 24 * 7,
|
|
10
|
-
// Max once every 5 seconds, revalidate on the server to get a fresh version of this page
|
|
11
|
-
maxAge: 5,
|
|
12
|
-
});
|
|
13
|
-
};
|
|
14
|
-
|
|
15
|
-
export default component$(() => {
|
|
16
|
-
return <Slot />;
|
|
17
|
-
});
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
/*
|
|
2
|
-
* WHAT IS THIS FILE?
|
|
3
|
-
*
|
|
4
|
-
* The service-worker.ts file is used to have state of the art prefetching.
|
|
5
|
-
* https://qwik.dev/docs/advanced/speculative-module-fetching/
|
|
6
|
-
*
|
|
7
|
-
* Qwik uses a service worker to speed up your site and reduce latency, ie, not used in the traditional way of offline.
|
|
8
|
-
* You can also use this file to add more functionality that runs in the service worker.
|
|
9
|
-
*/
|
|
10
|
-
import { setupServiceWorker } from "@qwik.dev/router/service-worker";
|
|
11
|
-
|
|
12
|
-
setupServiceWorker();
|
|
13
|
-
|
|
14
|
-
addEventListener("install", () => self.skipWaiting());
|
|
15
|
-
|
|
16
|
-
addEventListener("activate", () => self.clients.claim());
|
|
17
|
-
|
|
18
|
-
declare const self: ServiceWorkerGlobalScope;
|
|
@@ -1,31 +0,0 @@
|
|
|
1
|
-
**/*.log
|
|
2
|
-
**/.DS_Store
|
|
3
|
-
*.
|
|
4
|
-
.vscode/settings.json
|
|
5
|
-
.history
|
|
6
|
-
.yarn
|
|
7
|
-
bazel-*
|
|
8
|
-
bazel-bin
|
|
9
|
-
bazel-out
|
|
10
|
-
bazel-qwik
|
|
11
|
-
bazel-testlogs
|
|
12
|
-
dist
|
|
13
|
-
dist-dev
|
|
14
|
-
lib
|
|
15
|
-
lib-types
|
|
16
|
-
etc
|
|
17
|
-
external
|
|
18
|
-
node_modules
|
|
19
|
-
temp
|
|
20
|
-
tsc-out
|
|
21
|
-
tsdoc-metadata.json
|
|
22
|
-
target
|
|
23
|
-
output
|
|
24
|
-
rollup.config.js
|
|
25
|
-
build
|
|
26
|
-
.cache
|
|
27
|
-
.vscode
|
|
28
|
-
.rollup.cache
|
|
29
|
-
dist
|
|
30
|
-
tsconfig.tsbuildinfo
|
|
31
|
-
vite.config.mts
|
|
@@ -1,40 +0,0 @@
|
|
|
1
|
-
module.exports = {
|
|
2
|
-
root: true,
|
|
3
|
-
env: {
|
|
4
|
-
browser: true,
|
|
5
|
-
es2021: true,
|
|
6
|
-
node: true,
|
|
7
|
-
},
|
|
8
|
-
extends: [
|
|
9
|
-
"eslint:recommended",
|
|
10
|
-
"plugin:@typescript-eslint/recommended",
|
|
11
|
-
"plugin:qwik/recommended",
|
|
12
|
-
],
|
|
13
|
-
parser: "@typescript-eslint/parser",
|
|
14
|
-
parserOptions: {
|
|
15
|
-
tsconfigRootDir: __dirname,
|
|
16
|
-
project: ["./tsconfig.json"],
|
|
17
|
-
ecmaVersion: 2021,
|
|
18
|
-
sourceType: "module",
|
|
19
|
-
ecmaFeatures: {
|
|
20
|
-
jsx: true,
|
|
21
|
-
},
|
|
22
|
-
},
|
|
23
|
-
plugins: ["@typescript-eslint"],
|
|
24
|
-
rules: {
|
|
25
|
-
"@typescript-eslint/no-explicit-any": "off",
|
|
26
|
-
"@typescript-eslint/explicit-module-boundary-types": "off",
|
|
27
|
-
"@typescript-eslint/no-inferrable-types": "off",
|
|
28
|
-
"@typescript-eslint/no-non-null-assertion": "off",
|
|
29
|
-
"@typescript-eslint/no-empty-interface": "off",
|
|
30
|
-
"@typescript-eslint/no-namespace": "off",
|
|
31
|
-
"@typescript-eslint/no-empty-function": "off",
|
|
32
|
-
"@typescript-eslint/no-this-alias": "off",
|
|
33
|
-
"@typescript-eslint/ban-types": "off",
|
|
34
|
-
"@typescript-eslint/ban-ts-comment": "off",
|
|
35
|
-
"prefer-spread": "off",
|
|
36
|
-
"no-case-declarations": "off",
|
|
37
|
-
"no-console": "off",
|
|
38
|
-
"@typescript-eslint/no-unused-vars": ["error"],
|
|
39
|
-
},
|
|
40
|
-
};
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
/*
|
|
2
|
-
* WHAT IS THIS FILE?
|
|
3
|
-
*
|
|
4
|
-
* The service-worker.ts file is used to have state of the art prefetching.
|
|
5
|
-
* https://qwik.dev/docs/advanced/speculative-module-fetching/
|
|
6
|
-
*
|
|
7
|
-
* Qwik uses a service worker to speed up your site and reduce latency, ie, not used in the traditional way of offline.
|
|
8
|
-
* You can also use this file to add more functionality that runs in the service worker.
|
|
9
|
-
*/
|
|
10
|
-
import { setupServiceWorker } from "@qwik.dev/router/service-worker";
|
|
11
|
-
|
|
12
|
-
setupServiceWorker();
|
|
13
|
-
|
|
14
|
-
addEventListener("install", () => self.skipWaiting());
|
|
15
|
-
|
|
16
|
-
addEventListener("activate", () => self.clients.claim());
|
|
17
|
-
|
|
18
|
-
declare const self: ServiceWorkerGlobalScope;
|