create-qwik 2.0.0-beta.4 → 2.0.0-beta.6
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 +2 -2
- package/dist/starters/apps/base/package.json +3 -3
- package/dist/starters/apps/base/src/entry.preview.tsx +1 -3
- package/dist/starters/apps/base/src/entry.ssr.tsx +3 -7
- package/dist/starters/apps/library/package.json +2 -2
- package/dist/starters/apps/library/src/root.tsx +7 -1
- package/dist/starters/apps/library/vite.config.mts +3 -2
- package/package.json +1 -1
- package/dist/starters/apps/library/src/entry.dev.tsx +0 -17
- package/dist/starters/apps/library/src/entry.ssr.tsx +0 -21
package/dist/index.cjs
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* @license
|
|
3
|
-
* create-qwik 2.0.0-beta.
|
|
3
|
+
* create-qwik 2.0.0-beta.6-dev+c42693f
|
|
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
|
|
@@ -160,7 +160,7 @@ ${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-beta.4-dev+9849dcf)`),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.4-dev+9849dcf)`),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.6-dev+c42693f)`),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.6-dev+c42693f)`),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
|
|
|
@@ -16,13 +16,13 @@
|
|
|
16
16
|
"qwik": "qwik"
|
|
17
17
|
},
|
|
18
18
|
"devDependencies": {
|
|
19
|
-
"@qwik.dev/core": "^2.0.0-beta.
|
|
20
|
-
"@qwik.dev/router": "^2.0.0-beta.
|
|
19
|
+
"@qwik.dev/core": "^2.0.0-beta.6",
|
|
20
|
+
"@qwik.dev/router": "^2.0.0-beta.6",
|
|
21
21
|
"@eslint/js": "latest",
|
|
22
22
|
"@types/node": "24.0.4",
|
|
23
23
|
"typescript-eslint": "8.26.1",
|
|
24
24
|
"eslint": "9.25.1",
|
|
25
|
-
"eslint-plugin-qwik": "^2.0.0-beta.
|
|
25
|
+
"eslint-plugin-qwik": "^2.0.0-beta.6",
|
|
26
26
|
"globals": "16.0.0",
|
|
27
27
|
"prettier": "3.5.3",
|
|
28
28
|
"typescript": "5.8.3",
|
|
@@ -10,12 +10,10 @@
|
|
|
10
10
|
* - https://vitejs.dev/config/preview-options.html#preview-options
|
|
11
11
|
*
|
|
12
12
|
*/
|
|
13
|
-
import qwikRouterConfig from "@qwik-router-config";
|
|
14
13
|
import { createQwikRouter } from "@qwik.dev/router/middleware/node";
|
|
15
|
-
// make sure qwikRouterConfig is imported before entry
|
|
16
14
|
import render from "./entry.ssr";
|
|
17
15
|
|
|
18
16
|
/**
|
|
19
17
|
* The default export is the QwikRouter adapter used by Vite preview.
|
|
20
18
|
*/
|
|
21
|
-
export default createQwikRouter({ render
|
|
19
|
+
export default createQwikRouter({ render });
|
|
@@ -1,14 +1,10 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* WHAT IS THIS FILE?
|
|
3
3
|
*
|
|
4
|
-
* SSR
|
|
5
|
-
* entry point will be the common one.
|
|
6
|
-
*
|
|
7
|
-
* - Server (express, cloudflare...)
|
|
8
|
-
* - npm run start
|
|
9
|
-
* - npm run preview
|
|
10
|
-
* - npm run build
|
|
4
|
+
* SSR renderer function, used for all build/dev targets except client-only.
|
|
11
5
|
*
|
|
6
|
+
* Note that except for client-only, this is the only place the Qwik renderer is called.
|
|
7
|
+
* On the client, containers resume and do not call render.
|
|
12
8
|
*/
|
|
13
9
|
import {
|
|
14
10
|
renderToStream,
|
|
@@ -33,12 +33,12 @@
|
|
|
33
33
|
"release": "np"
|
|
34
34
|
},
|
|
35
35
|
"devDependencies": {
|
|
36
|
-
"@qwik.dev/core": "2.0.0-beta.
|
|
36
|
+
"@qwik.dev/core": "2.0.0-beta.6",
|
|
37
37
|
"@eslint/js": "latest",
|
|
38
38
|
"@types/node": "24.0.4",
|
|
39
39
|
"typescript-eslint": "8.26.1",
|
|
40
40
|
"eslint": "9.25.1",
|
|
41
|
-
"eslint-plugin-qwik": "2.0.0-beta.
|
|
41
|
+
"eslint-plugin-qwik": "2.0.0-beta.6",
|
|
42
42
|
"globals": "16.0.0",
|
|
43
43
|
"np": "^8.0.4",
|
|
44
44
|
"prettier": "3.5.3",
|
|
@@ -6,9 +6,15 @@ export default () => {
|
|
|
6
6
|
<>
|
|
7
7
|
<head>
|
|
8
8
|
<meta charset="utf-8" />
|
|
9
|
-
<title>Qwik
|
|
9
|
+
<title>Qwik Library Starter</title>
|
|
10
10
|
</head>
|
|
11
11
|
<body>
|
|
12
|
+
<h1>Qwik Library Starter</h1>
|
|
13
|
+
<p>
|
|
14
|
+
This is a Qwik library starter. Make your components and export them
|
|
15
|
+
from `src/index.ts`. This playground app will not be bundled with your
|
|
16
|
+
library.
|
|
17
|
+
</p>
|
|
12
18
|
<Logo />
|
|
13
19
|
<Counter />
|
|
14
20
|
</body>
|
|
@@ -12,8 +12,9 @@ export default defineConfig(() => {
|
|
|
12
12
|
build: {
|
|
13
13
|
target: "es2020",
|
|
14
14
|
lib: {
|
|
15
|
-
entry: "./src/index
|
|
16
|
-
formats: ["es", "cjs"],
|
|
15
|
+
entry: "./src/index",
|
|
16
|
+
formats: ["es", "cjs"] as const,
|
|
17
|
+
// This adds .qwik so all files are processed by the optimizer
|
|
17
18
|
fileName: (format, entryName) =>
|
|
18
19
|
`${entryName}.qwik.${format === "es" ? "mjs" : "cjs"}`,
|
|
19
20
|
},
|
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-beta.
|
|
4
|
+
"version": "2.0.0-beta.6",
|
|
5
5
|
"author": "Qwik Team",
|
|
6
6
|
"bin": "./create-qwik.cjs",
|
|
7
7
|
"bugs": "https://github.com/QwikDev/qwik/issues",
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
/*
|
|
2
|
-
* WHAT IS THIS FILE?
|
|
3
|
-
*
|
|
4
|
-
* Development entry point using only client-side modules:
|
|
5
|
-
* - Do not use this mode in production!
|
|
6
|
-
* - No SSR
|
|
7
|
-
* - No portion of the application is pre-rendered on the server.
|
|
8
|
-
* - All of the application is running eagerly in the browser.
|
|
9
|
-
* - More code is transferred to the browser than in SSR mode.
|
|
10
|
-
* - Optimizer/Serialization/Deserialization code is not exercised!
|
|
11
|
-
*/
|
|
12
|
-
import { render, type RenderOptions } from "@qwik.dev/core";
|
|
13
|
-
import Root from "./root";
|
|
14
|
-
|
|
15
|
-
export default function (opts: RenderOptions) {
|
|
16
|
-
return render(document, <Root />, opts);
|
|
17
|
-
}
|
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* WHAT IS THIS FILE?
|
|
3
|
-
*
|
|
4
|
-
* SSR entry point, in all cases the application is rendered outside the browser, this
|
|
5
|
-
* entry point will be the common one.
|
|
6
|
-
*
|
|
7
|
-
* - Server (express, cloudflare...)
|
|
8
|
-
* - npm run start
|
|
9
|
-
* - npm run preview
|
|
10
|
-
* - npm run build
|
|
11
|
-
*
|
|
12
|
-
*/
|
|
13
|
-
import {
|
|
14
|
-
renderToStream,
|
|
15
|
-
type RenderToStreamOptions,
|
|
16
|
-
} from "@qwik.dev/core/server";
|
|
17
|
-
import Root from "./root";
|
|
18
|
-
|
|
19
|
-
export default function (opts: RenderToStreamOptions) {
|
|
20
|
-
return renderToStream(<Root />, opts);
|
|
21
|
-
}
|