@spree/cli 3.2.1 → 3.2.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/dist/index.js CHANGED
@@ -1,7 +1,7 @@
1
1
  #!/usr/bin/env node
2
2
  import { createRequire as __createRequire } from "node:module";
3
3
  const require = __createRequire(import.meta.url);
4
- var Ly=Object.create;var Fo=Object.defineProperty;var By=Object.getOwnPropertyDescriptor;var zy=Object.getOwnPropertyNames;var My=Object.getPrototypeOf,Fy=Object.prototype.hasOwnProperty;var be=(e=>typeof require<"u"?require:typeof Proxy<"u"?new Proxy(e,{get:(t,r)=>(typeof require<"u"?require:t)[r]}):e)(function(e){if(typeof require<"u")return require.apply(this,arguments);throw Error('Dynamic require of "'+e+'" is not supported')});var Gy=(e,t,r)=>()=>{if(r)throw r[0];try{return e&&(t=e(e=0)),t}catch(i){throw r=[i],i}};var P=(e,t)=>()=>{try{return t||e((t={exports:{}}).exports,t),t.exports}catch(r){throw t=0,r}};var Uy=(e,t,r,i)=>{if(t&&typeof t=="object"||typeof t=="function")for(let n of zy(t))!Fy.call(e,n)&&n!==r&&Fo(e,n,{get:()=>t[n],enumerable:!(i=By(t,n))||i.enumerable});return e};var L=(e,t,r)=>(r=e!=null?Ly(My(e)):{},Uy(t||!e||!e.__esModule?Fo(r,"default",{value:e,enumerable:!0}):r,e));var m,p=Gy(()=>{m={spree_admin_sdk_range:"^1.0.0-rc.1",spree_dashboard_core_range:"^1.0.0-rc.1",spree_dashboard_ui_range:"^1.0.0-rc.1"}});var gr=P(Jn=>{"use strict";p();var ni=class extends Error{constructor(t,r,i){super(i),Error.captureStackTrace(this,this.constructor),this.name=this.constructor.name,this.code=r,this.exitCode=t,this.nestedError=void 0}},Yn=class extends ni{constructor(t){super(1,"commander.invalidArgument",t),Error.captureStackTrace(this,this.constructor),this.name=this.constructor.name}};Jn.CommanderError=ni;Jn.InvalidArgumentError=Yn});var si=P(Zn=>{"use strict";p();var{InvalidArgumentError:Vy}=gr(),Xn=class{constructor(t,r){switch(this.description=r||"",this.variadic=!1,this.parseArg=void 0,this.defaultValue=void 0,this.defaultValueDescription=void 0,this.argChoices=void 0,t[0]){case"<":this.required=!0,this._name=t.slice(1,-1);break;case"[":this.required=!1,this._name=t.slice(1,-1);break;default:this.required=!0,this._name=t;break}this._name.endsWith("...")&&(this.variadic=!0,this._name=this._name.slice(0,-3))}name(){return this._name}_collectValue(t,r){return r===this.defaultValue||!Array.isArray(r)?[t]:(r.push(t),r)}default(t,r){return this.defaultValue=t,this.defaultValueDescription=r,this}argParser(t){return this.parseArg=t,this}choices(t){return this.argChoices=t.slice(),this.parseArg=(r,i)=>{if(!this.argChoices.includes(r))throw new Vy(`Allowed choices are ${this.argChoices.join(", ")}.`);return this.variadic?this._collectValue(r,i):r},this}argRequired(){return this.required=!0,this}argOptional(){return this.required=!1,this}};function Hy(e){let t=e.name()+(e.variadic===!0?"...":"");return e.required?"<"+t+">":"["+t+"]"}Zn.Argument=Xn;Zn.humanReadableArgName=Hy});var ts=P(es=>{"use strict";p();var{humanReadableArgName:Wy}=si(),Qn=class{constructor(){this.helpWidth=void 0,this.minWidthToWrap=40,this.sortSubcommands=!1,this.sortOptions=!1,this.showGlobalOptions=!1}prepareContext(t){this.helpWidth=this.helpWidth??t.helpWidth??80}visibleCommands(t){let r=t.commands.filter(n=>!n._hidden),i=t._getHelpCommand();return i&&!i._hidden&&r.push(i),this.sortSubcommands&&r.sort((n,s)=>n.name().localeCompare(s.name())),r}compareOptions(t,r){let i=n=>n.short?n.short.replace(/^-/,""):n.long.replace(/^--/,"");return i(t).localeCompare(i(r))}visibleOptions(t){let r=t.options.filter(n=>!n.hidden),i=t._getHelpOption();if(i&&!i.hidden){let n=i.short&&t._findOption(i.short),s=i.long&&t._findOption(i.long);!n&&!s?r.push(i):i.long&&!s?r.push(t.createOption(i.long,i.description)):i.short&&!n&&r.push(t.createOption(i.short,i.description))}return this.sortOptions&&r.sort(this.compareOptions),r}visibleGlobalOptions(t){if(!this.showGlobalOptions)return[];let r=[];for(let i=t.parent;i;i=i.parent){let n=i.options.filter(s=>!s.hidden);r.push(...n)}return this.sortOptions&&r.sort(this.compareOptions),r}visibleArguments(t){return t._argsDescription&&t.registeredArguments.forEach(r=>{r.description=r.description||t._argsDescription[r.name()]||""}),t.registeredArguments.find(r=>r.description)?t.registeredArguments:[]}subcommandTerm(t){let r=t.registeredArguments.map(i=>Wy(i)).join(" ");return t._name+(t._aliases[0]?"|"+t._aliases[0]:"")+(t.options.length?" [options]":"")+(r?" "+r:"")}optionTerm(t){return t.flags}argumentTerm(t){return t.name()}longestSubcommandTermLength(t,r){return r.visibleCommands(t).reduce((i,n)=>Math.max(i,this.displayWidth(r.styleSubcommandTerm(r.subcommandTerm(n)))),0)}longestOptionTermLength(t,r){return r.visibleOptions(t).reduce((i,n)=>Math.max(i,this.displayWidth(r.styleOptionTerm(r.optionTerm(n)))),0)}longestGlobalOptionTermLength(t,r){return r.visibleGlobalOptions(t).reduce((i,n)=>Math.max(i,this.displayWidth(r.styleOptionTerm(r.optionTerm(n)))),0)}longestArgumentTermLength(t,r){return r.visibleArguments(t).reduce((i,n)=>Math.max(i,this.displayWidth(r.styleArgumentTerm(r.argumentTerm(n)))),0)}commandUsage(t){let r=t._name;t._aliases[0]&&(r=r+"|"+t._aliases[0]);let i="";for(let n=t.parent;n;n=n.parent)i=n.name()+" "+i;return i+r+" "+t.usage()}commandDescription(t){return t.description()}subcommandDescription(t){return t.summary()||t.description()}optionDescription(t){let r=[];if(t.argChoices&&r.push(`choices: ${t.argChoices.map(i=>JSON.stringify(i)).join(", ")}`),t.defaultValue!==void 0&&(t.required||t.optional||t.isBoolean()&&typeof t.defaultValue=="boolean")&&r.push(`default: ${t.defaultValueDescription||JSON.stringify(t.defaultValue)}`),t.presetArg!==void 0&&t.optional&&r.push(`preset: ${JSON.stringify(t.presetArg)}`),t.envVar!==void 0&&r.push(`env: ${t.envVar}`),r.length>0){let i=`(${r.join(", ")})`;return t.description?`${t.description} ${i}`:i}return t.description}argumentDescription(t){let r=[];if(t.argChoices&&r.push(`choices: ${t.argChoices.map(i=>JSON.stringify(i)).join(", ")}`),t.defaultValue!==void 0&&r.push(`default: ${t.defaultValueDescription||JSON.stringify(t.defaultValue)}`),r.length>0){let i=`(${r.join(", ")})`;return t.description?`${t.description} ${i}`:i}return t.description}formatItemList(t,r,i){return r.length===0?[]:[i.styleTitle(t),...r,""]}groupItems(t,r,i){let n=new Map;return t.forEach(s=>{let a=i(s);n.has(a)||n.set(a,[])}),r.forEach(s=>{let a=i(s);n.has(a)||n.set(a,[]),n.get(a).push(s)}),n}formatHelp(t,r){let i=r.padWidth(t,r),n=r.helpWidth??80;function s(l,h){return r.formatItem(l,i,h,r)}let a=[`${r.styleTitle("Usage:")} ${r.styleUsage(r.commandUsage(t))}`,""],o=r.commandDescription(t);o.length>0&&(a=a.concat([r.boxWrap(r.styleCommandDescription(o),n),""]));let c=r.visibleArguments(t).map(l=>s(r.styleArgumentTerm(r.argumentTerm(l)),r.styleArgumentDescription(r.argumentDescription(l))));if(a=a.concat(this.formatItemList("Arguments:",c,r)),this.groupItems(t.options,r.visibleOptions(t),l=>l.helpGroupHeading??"Options:").forEach((l,h)=>{let y=l.map(g=>s(r.styleOptionTerm(r.optionTerm(g)),r.styleOptionDescription(r.optionDescription(g))));a=a.concat(this.formatItemList(h,y,r))}),r.showGlobalOptions){let l=r.visibleGlobalOptions(t).map(h=>s(r.styleOptionTerm(r.optionTerm(h)),r.styleOptionDescription(r.optionDescription(h))));a=a.concat(this.formatItemList("Global Options:",l,r))}return this.groupItems(t.commands,r.visibleCommands(t),l=>l.helpGroup()||"Commands:").forEach((l,h)=>{let y=l.map(g=>s(r.styleSubcommandTerm(r.subcommandTerm(g)),r.styleSubcommandDescription(r.subcommandDescription(g))));a=a.concat(this.formatItemList(h,y,r))}),a.join(`
4
+ var Ly=Object.create;var Fo=Object.defineProperty;var By=Object.getOwnPropertyDescriptor;var zy=Object.getOwnPropertyNames;var My=Object.getPrototypeOf,Fy=Object.prototype.hasOwnProperty;var be=(e=>typeof require<"u"?require:typeof Proxy<"u"?new Proxy(e,{get:(t,r)=>(typeof require<"u"?require:t)[r]}):e)(function(e){if(typeof require<"u")return require.apply(this,arguments);throw Error('Dynamic require of "'+e+'" is not supported')});var Gy=(e,t,r)=>()=>{if(r)throw r[0];try{return e&&(t=e(e=0)),t}catch(i){throw r=[i],i}};var P=(e,t)=>()=>{try{return t||e((t={exports:{}}).exports,t),t.exports}catch(r){throw t=0,r}};var Uy=(e,t,r,i)=>{if(t&&typeof t=="object"||typeof t=="function")for(let n of zy(t))!Fy.call(e,n)&&n!==r&&Fo(e,n,{get:()=>t[n],enumerable:!(i=By(t,n))||i.enumerable});return e};var L=(e,t,r)=>(r=e!=null?Ly(My(e)):{},Uy(t||!e||!e.__esModule?Fo(r,"default",{value:e,enumerable:!0}):r,e));var m,p=Gy(()=>{m={spree_admin_sdk_range:"^1.0.0-rc.1",spree_dashboard_core_range:"^1.0.0-rc.2",spree_dashboard_ui_range:"^1.0.0-rc.2"}});var gr=P(Jn=>{"use strict";p();var ni=class extends Error{constructor(t,r,i){super(i),Error.captureStackTrace(this,this.constructor),this.name=this.constructor.name,this.code=r,this.exitCode=t,this.nestedError=void 0}},Yn=class extends ni{constructor(t){super(1,"commander.invalidArgument",t),Error.captureStackTrace(this,this.constructor),this.name=this.constructor.name}};Jn.CommanderError=ni;Jn.InvalidArgumentError=Yn});var si=P(Zn=>{"use strict";p();var{InvalidArgumentError:Vy}=gr(),Xn=class{constructor(t,r){switch(this.description=r||"",this.variadic=!1,this.parseArg=void 0,this.defaultValue=void 0,this.defaultValueDescription=void 0,this.argChoices=void 0,t[0]){case"<":this.required=!0,this._name=t.slice(1,-1);break;case"[":this.required=!1,this._name=t.slice(1,-1);break;default:this.required=!0,this._name=t;break}this._name.endsWith("...")&&(this.variadic=!0,this._name=this._name.slice(0,-3))}name(){return this._name}_collectValue(t,r){return r===this.defaultValue||!Array.isArray(r)?[t]:(r.push(t),r)}default(t,r){return this.defaultValue=t,this.defaultValueDescription=r,this}argParser(t){return this.parseArg=t,this}choices(t){return this.argChoices=t.slice(),this.parseArg=(r,i)=>{if(!this.argChoices.includes(r))throw new Vy(`Allowed choices are ${this.argChoices.join(", ")}.`);return this.variadic?this._collectValue(r,i):r},this}argRequired(){return this.required=!0,this}argOptional(){return this.required=!1,this}};function Hy(e){let t=e.name()+(e.variadic===!0?"...":"");return e.required?"<"+t+">":"["+t+"]"}Zn.Argument=Xn;Zn.humanReadableArgName=Hy});var ts=P(es=>{"use strict";p();var{humanReadableArgName:Wy}=si(),Qn=class{constructor(){this.helpWidth=void 0,this.minWidthToWrap=40,this.sortSubcommands=!1,this.sortOptions=!1,this.showGlobalOptions=!1}prepareContext(t){this.helpWidth=this.helpWidth??t.helpWidth??80}visibleCommands(t){let r=t.commands.filter(n=>!n._hidden),i=t._getHelpCommand();return i&&!i._hidden&&r.push(i),this.sortSubcommands&&r.sort((n,s)=>n.name().localeCompare(s.name())),r}compareOptions(t,r){let i=n=>n.short?n.short.replace(/^-/,""):n.long.replace(/^--/,"");return i(t).localeCompare(i(r))}visibleOptions(t){let r=t.options.filter(n=>!n.hidden),i=t._getHelpOption();if(i&&!i.hidden){let n=i.short&&t._findOption(i.short),s=i.long&&t._findOption(i.long);!n&&!s?r.push(i):i.long&&!s?r.push(t.createOption(i.long,i.description)):i.short&&!n&&r.push(t.createOption(i.short,i.description))}return this.sortOptions&&r.sort(this.compareOptions),r}visibleGlobalOptions(t){if(!this.showGlobalOptions)return[];let r=[];for(let i=t.parent;i;i=i.parent){let n=i.options.filter(s=>!s.hidden);r.push(...n)}return this.sortOptions&&r.sort(this.compareOptions),r}visibleArguments(t){return t._argsDescription&&t.registeredArguments.forEach(r=>{r.description=r.description||t._argsDescription[r.name()]||""}),t.registeredArguments.find(r=>r.description)?t.registeredArguments:[]}subcommandTerm(t){let r=t.registeredArguments.map(i=>Wy(i)).join(" ");return t._name+(t._aliases[0]?"|"+t._aliases[0]:"")+(t.options.length?" [options]":"")+(r?" "+r:"")}optionTerm(t){return t.flags}argumentTerm(t){return t.name()}longestSubcommandTermLength(t,r){return r.visibleCommands(t).reduce((i,n)=>Math.max(i,this.displayWidth(r.styleSubcommandTerm(r.subcommandTerm(n)))),0)}longestOptionTermLength(t,r){return r.visibleOptions(t).reduce((i,n)=>Math.max(i,this.displayWidth(r.styleOptionTerm(r.optionTerm(n)))),0)}longestGlobalOptionTermLength(t,r){return r.visibleGlobalOptions(t).reduce((i,n)=>Math.max(i,this.displayWidth(r.styleOptionTerm(r.optionTerm(n)))),0)}longestArgumentTermLength(t,r){return r.visibleArguments(t).reduce((i,n)=>Math.max(i,this.displayWidth(r.styleArgumentTerm(r.argumentTerm(n)))),0)}commandUsage(t){let r=t._name;t._aliases[0]&&(r=r+"|"+t._aliases[0]);let i="";for(let n=t.parent;n;n=n.parent)i=n.name()+" "+i;return i+r+" "+t.usage()}commandDescription(t){return t.description()}subcommandDescription(t){return t.summary()||t.description()}optionDescription(t){let r=[];if(t.argChoices&&r.push(`choices: ${t.argChoices.map(i=>JSON.stringify(i)).join(", ")}`),t.defaultValue!==void 0&&(t.required||t.optional||t.isBoolean()&&typeof t.defaultValue=="boolean")&&r.push(`default: ${t.defaultValueDescription||JSON.stringify(t.defaultValue)}`),t.presetArg!==void 0&&t.optional&&r.push(`preset: ${JSON.stringify(t.presetArg)}`),t.envVar!==void 0&&r.push(`env: ${t.envVar}`),r.length>0){let i=`(${r.join(", ")})`;return t.description?`${t.description} ${i}`:i}return t.description}argumentDescription(t){let r=[];if(t.argChoices&&r.push(`choices: ${t.argChoices.map(i=>JSON.stringify(i)).join(", ")}`),t.defaultValue!==void 0&&r.push(`default: ${t.defaultValueDescription||JSON.stringify(t.defaultValue)}`),r.length>0){let i=`(${r.join(", ")})`;return t.description?`${t.description} ${i}`:i}return t.description}formatItemList(t,r,i){return r.length===0?[]:[i.styleTitle(t),...r,""]}groupItems(t,r,i){let n=new Map;return t.forEach(s=>{let a=i(s);n.has(a)||n.set(a,[])}),r.forEach(s=>{let a=i(s);n.has(a)||n.set(a,[]),n.get(a).push(s)}),n}formatHelp(t,r){let i=r.padWidth(t,r),n=r.helpWidth??80;function s(l,h){return r.formatItem(l,i,h,r)}let a=[`${r.styleTitle("Usage:")} ${r.styleUsage(r.commandUsage(t))}`,""],o=r.commandDescription(t);o.length>0&&(a=a.concat([r.boxWrap(r.styleCommandDescription(o),n),""]));let c=r.visibleArguments(t).map(l=>s(r.styleArgumentTerm(r.argumentTerm(l)),r.styleArgumentDescription(r.argumentDescription(l))));if(a=a.concat(this.formatItemList("Arguments:",c,r)),this.groupItems(t.options,r.visibleOptions(t),l=>l.helpGroupHeading??"Options:").forEach((l,h)=>{let y=l.map(g=>s(r.styleOptionTerm(r.optionTerm(g)),r.styleOptionDescription(r.optionDescription(g))));a=a.concat(this.formatItemList(h,y,r))}),r.showGlobalOptions){let l=r.visibleGlobalOptions(t).map(h=>s(r.styleOptionTerm(r.optionTerm(h)),r.styleOptionDescription(r.optionDescription(h))));a=a.concat(this.formatItemList("Global Options:",l,r))}return this.groupItems(t.commands,r.visibleCommands(t),l=>l.helpGroup()||"Commands:").forEach((l,h)=>{let y=l.map(g=>s(r.styleSubcommandTerm(r.subcommandTerm(g)),r.styleSubcommandDescription(r.subcommandDescription(g))));a=a.concat(this.formatItemList(h,y,r))}),a.join(`
5
5
  `)}displayWidth(t){return Go(t).length}styleTitle(t){return t}styleUsage(t){return t.split(" ").map(r=>r==="[options]"?this.styleOptionText(r):r==="[command]"?this.styleSubcommandText(r):r[0]==="["||r[0]==="<"?this.styleArgumentText(r):this.styleCommandText(r)).join(" ")}styleCommandDescription(t){return this.styleDescriptionText(t)}styleOptionDescription(t){return this.styleDescriptionText(t)}styleSubcommandDescription(t){return this.styleDescriptionText(t)}styleArgumentDescription(t){return this.styleDescriptionText(t)}styleDescriptionText(t){return t}styleOptionTerm(t){return this.styleOptionText(t)}styleSubcommandTerm(t){return t.split(" ").map(r=>r==="[options]"?this.styleOptionText(r):r[0]==="["||r[0]==="<"?this.styleArgumentText(r):this.styleSubcommandText(r)).join(" ")}styleArgumentTerm(t){return this.styleArgumentText(t)}styleOptionText(t){return t}styleArgumentText(t){return t}styleSubcommandText(t){return t}styleCommandText(t){return t}padWidth(t,r){return Math.max(r.longestOptionTermLength(t,r),r.longestGlobalOptionTermLength(t,r),r.longestSubcommandTermLength(t,r),r.longestArgumentTermLength(t,r))}preformatted(t){return/\n[^\S\r\n]/.test(t)}formatItem(t,r,i,n){let a=" ".repeat(2);if(!i)return a+t;let o=t.padEnd(r+t.length-n.displayWidth(t)),c=2,u=(this.helpWidth??80)-r-c-2,l;return u<this.minWidthToWrap||n.preformatted(i)?l=i:l=n.boxWrap(i,u).replace(/\n/g,`
6
6
  `+" ".repeat(r+c)),a+o+" ".repeat(c)+l.replace(/\n/g,`
7
7
  ${a}`)}boxWrap(t,r){if(r<this.minWidthToWrap)return t;let i=t.split(/\r\n|\n/),n=/[\s]*[^\s]+/g,s=[];return i.forEach(a=>{let o=a.match(n);if(o===null){s.push("");return}let c=[o.shift()],d=this.displayWidth(c[0]);o.forEach(u=>{let l=this.displayWidth(u);if(d+l<=r){c.push(u),d+=l;return}s.push(c.join(""));let h=u.trimStart();c=[h],d=this.displayWidth(h)}),s.push(c.join(""))}),s.join(`
@@ -49,12 +49,6 @@
49
49
  }
50
50
  },
51
51
  "files": {
52
- "includes": [
53
- "src/**",
54
- "*.ts",
55
- "index.html",
56
- "!src/routeTree.gen.ts",
57
- "!src/**/*.css"
58
- ]
52
+ "includes": ["src/**", "*.ts", "index.html", "!src/routeTree.gen.ts", "!src/**/*.css"]
59
53
  }
60
54
  }
@@ -17,9 +17,9 @@
17
17
  },
18
18
  "dependencies": {
19
19
  "@spree/admin-sdk": "^1.0.0-rc.1",
20
- "@spree/dashboard": "^1.0.0-rc.1",
21
- "@spree/dashboard-core": "^1.0.0-rc.1",
22
- "@spree/dashboard-ui": "^1.0.0-rc.1",
20
+ "@spree/dashboard": "^1.0.0-rc.2",
21
+ "@spree/dashboard-core": "^1.0.0-rc.2",
22
+ "@spree/dashboard-ui": "^1.0.0-rc.2",
23
23
  "@tanstack/react-query": "^5.100.9",
24
24
  "@tanstack/react-router": "^1.169.2",
25
25
  "react": "^19.2.6",