@visulima/cerebro 1.1.16 → 1.1.18

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/CHANGELOG.md CHANGED
@@ -1,3 +1,41 @@
1
+ ## @visulima/cerebro [1.1.18](https://github.com/visulima/visulima/compare/@visulima/cerebro@1.1.17...@visulima/cerebro@1.1.18) (2024-09-07)
2
+
3
+ ### Bug Fixes
4
+
5
+ * fixed broken chunk splitting from packem ([1aaf277](https://github.com/visulima/visulima/commit/1aaf27779292d637923c5f8a220e18606e78caa2))
6
+
7
+
8
+ ### Dependencies
9
+
10
+ * **@visulima/boxen:** upgraded to 1.0.16
11
+ * **@visulima/colorize:** upgraded to 1.4.8
12
+ * **@visulima/find-cache-dir:** upgraded to 1.0.9
13
+ * **@visulima/pail:** upgraded to 2.1.7
14
+ * **@visulima/path:** upgraded to 1.0.7
15
+
16
+ ## @visulima/cerebro [1.1.17](https://github.com/visulima/visulima/compare/@visulima/cerebro@1.1.16...@visulima/cerebro@1.1.17) (2024-09-07)
17
+
18
+ ### Bug Fixes
19
+
20
+ * added types support for node10 ([604583f](https://github.com/visulima/visulima/commit/604583fa3c24b950fafad45d17e7a1333040fd76))
21
+
22
+ ### Styles
23
+
24
+ * cs fixes ([f5c4af7](https://github.com/visulima/visulima/commit/f5c4af7cfa9fc79b6d3fa60c1e48d88bffab5a08))
25
+
26
+ ### Miscellaneous Chores
27
+
28
+ * update dev dependencies ([0738f98](https://github.com/visulima/visulima/commit/0738f9810478bb215ce4b2571dc8874c4c503089))
29
+
30
+
31
+ ### Dependencies
32
+
33
+ * **@visulima/boxen:** upgraded to 1.0.15
34
+ * **@visulima/colorize:** upgraded to 1.4.7
35
+ * **@visulima/find-cache-dir:** upgraded to 1.0.8
36
+ * **@visulima/pail:** upgraded to 2.1.6
37
+ * **@visulima/path:** upgraded to 1.0.6
38
+
1
39
  ## @visulima/cerebro [1.1.16](https://github.com/visulima/visulima/compare/@visulima/cerebro@1.1.15...@visulima/cerebro@1.1.16) (2024-08-30)
2
40
 
3
41
  ### Bug Fixes
package/LICENSE.md CHANGED
@@ -114,14 +114,14 @@ Repository: git+https://github.com/visulima/visulima.git
114
114
  > Repository: sindresorhus/binary-extensions
115
115
  >
116
116
  > > MIT License
117
- > >
117
+ > >
118
118
  > > Copyright (c) Sindre Sorhus <sindresorhus@gmail.com> (https://sindresorhus.com)
119
119
  > > Copyright (c) Paul Miller (https://paulmillr.com)
120
- > >
120
+ > >
121
121
  > > Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
122
- > >
122
+ > >
123
123
  > > The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
124
- > >
124
+ > >
125
125
  > > THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
126
126
 
127
127
  ---------------------------------------
package/dist/index.d.cts CHANGED
@@ -146,4 +146,6 @@ declare class Cli implements Cli$1 {
146
146
  type OutputType = 1 | 2 | 4;
147
147
  type VERBOSITY_LEVEL = 16 | 32 | 64 | 128 | 256;
148
148
 
149
- export { type ArgumentDefinition, type Cli$1 as Cli, type CliOptions, type Command, type Extension, type OptionDefinition, type OutputType, type Toolbox, type VERBOSITY_LEVEL, Cli as default };
149
+ export { type ArgumentDefinition, type Cli$1 as Cli, type CliOptions, type Command, type Extension, type OptionDefinition, type OutputType, type Toolbox, type VERBOSITY_LEVEL, };
150
+
151
+ export = Cli;
package/dist/index.d.ts CHANGED
@@ -146,4 +146,6 @@ declare class Cli implements Cli$1 {
146
146
  type OutputType = 1 | 2 | 4;
147
147
  type VERBOSITY_LEVEL = 16 | 32 | 64 | 128 | 256;
148
148
 
149
- export { type ArgumentDefinition, type Cli$1 as Cli, type CliOptions, type Command, type Extension, type OptionDefinition, type OutputType, type Toolbox, type VERBOSITY_LEVEL, Cli as default };
149
+ export { type ArgumentDefinition, type Cli$1 as Cli, type CliOptions, type Command, type Extension, type OptionDefinition, type OutputType, type Toolbox, type VERBOSITY_LEVEL, };
150
+
151
+ export = Cli;
package/dist/index.mjs CHANGED
@@ -1 +1 @@
1
- import{C as f}from"./shared/default-CAx52jvz.mjs";export{f as default};
1
+ import{Cli as f}from"./shared/default-B8Kkk6oF.mjs";export{f as default};
@@ -7,4 +7,4 @@ ${t.map(e=>e.optionList?new Se(e).toString():new _e(e).toString()).join(`
7
7
  - ${P.join(` \r
8
8
  - `)}`),this.logger.error(`"${h.command}" is not an available command.${S}`)}else this.logger.error(h);return o?L(1):void 0}const s=r.command??this.defaultCommand,i=this.commands.get(s);if(typeof i.execute!="function")return this.logger.error(`Command "${i.name}" has no function to execute.`),o?L(1):void 0;const l=r.argv;this.logger.debug(`command '${s}' found, parsing command args: ${l.join(", ")}`);let p=wt([...i.options??[],...O]);p.forEach(h=>{if(h.multiple&&h.lazyMultiple)throw new Error(`Argument "${h.name}" cannot have both multiple and lazyMultiple options, please choose one.`)}),i.argument&&(this.logger.debug("command has positional argument, parsing them..."),p=[{defaultOption:!0,description:i.argument?.description,group:"positionals",multiple:!0,name:E,type:i.argument?.type,typeLabel:i.argument?.typeLabel},...p]);const u=me(p,{argv:lt(l,i.options??[]),camelCase:!0,partial:!0,stopAtFirstUnknown:!0}),b=ot(l,i.options??[]),f={...u,_all:{...u._all,...b}};this.validateCommandOptions(p,f,i);const g=new Ye(i.name,i);g.runtime=this,await this.registerExtensions(g),await this.updateNotifier(g);const{_all:N,positionals:Q}=f;return N[E]&&delete N[E],g.argument=Q?.[E]??[],g.argv=this.argv,g.options={...N,...n},this.mapNegatableOptions(g,i),this.mapImpliesOptions(g,i),this.validateCommandArgsForConflicts(p,g.options,i),this.logger.debug("command options parsed from options:"),this.logger.debug(JSON.stringify(g.options,null,2)),this.logger.debug("command argument parsed from argument:"),this.logger.debug(JSON.stringify(g.argument,null,2)),await this.prepareToolboxResult(f,g,i),o?L(0):void 0}validateDoubleOptions(e){if(Array.isArray(e.options)){const o=e.options.reduce((r,s)=>{const i=`${s.name}-${s.alias}`;return r[i]||(r[i]=[]),r[i].push(s),r},{}),n=Object.values(o).filter(r=>r.length>1);let a="";if(n.forEach(r=>{const s=r[0],i=r[1];let l="alias";s.name===i.name&&(l="name",s.alias===i.alias&&(l+=" and alias")),a+=`Cannot add option ${l} "${JSON.stringify(i)}" to command "${e.name}" due to conflicting option ${JSON.stringify(s)}
9
9
  `}),a.length>0)throw new Error(a)}}addCoreExtensions(){this.addExtension({execute:v(e=>{e.logger=this.logger},"execute"),name:"logger"})}async prepareToolboxResult(e,o,n){if(e.global?.help){this.logger.debug("'--help' option found, running 'help' for given command...");const a=this.commands.get("help");if(!a)throw new Error("Help command not found.");await a.execute(o);return}if(e.global?.version||e.global?.V){this.logger.debug("'--version' option found, running 'version' for given command...");const a=this.commands.get("version");if(!a)throw new Error("Version command not found.");await a.execute(o);return}await n.execute(o)}async updateNotifier({logger:e}){if(this.updateNotifierOptions?.alwaysRun||!(d.NO_UPDATE_NOTIFIER||d.NODE_ENV==="test"||this.argv.includes("--no-update-notifier")||Vt)&&this.updateNotifierOptions){e.raw("Checking for updates...");const o=await(await import("../chunks/has-new-version.mjs").then(n=>n.default))(this.updateNotifierOptions);if(o){const n="Update available "+re(this.packageVersion+"")+ae(" → ")+se(o);this.logger.error(oe(n,{borderColor:v(a=>ie(a),"borderColor"),borderStyle:"round",margin:1,padding:1,textAlignment:"center"}))}}}validateCommandOptions(e,o,n){const a=bt(e,o);if(a.length>0)throw new Error(`You called the command "${n.name}" without the required options: ${a.map(r=>r.name).join(", ")}`);if(o._unknown&&o._unknown.length>0){const r=[];if(o._unknown.forEach(s=>{const i=s.startsWith("--");let l=`Found unknown ${i?"option":"argument"} "${s}"`;if(i){const p=F(s.replace("--",""),[...(n.options??[]).map(u=>u.name),...O.map(u=>u.name)]);if(p.length>0){const[u,...b]=p.map(f=>`--${f}`);l+=b.length>0?`, did you mean ${u} or ${b.join(", ")}?`:`, did you mean ${u}?`}}r.push(l)}),r.length>0)throw new Error(r.join(`
10
- `))}}validateCommandArgsForConflicts(e,o,n){const a=e.filter(r=>r.conflicts!==void 0);if(a.length>0){const r=a.find(s=>Array.isArray(s.conflicts)?s.conflicts.some(i=>o[i]!==void 0)&&o[s.name]!==void 0:o[s.conflicts]!==void 0&&o[s.name]!==void 0);if(r)throw new Error(`You called the command "${n.name}" with conflicting options: ${r.name} and ${typeof r.conflicts=="string"?r.conflicts:r.conflicts?.join(", ")}`)}}addNegatableOption(e){Array.isArray(e.options)&&e.options.forEach(o=>{if(o.name.startsWith("no-")&&!e.options.some(n=>n.name===o.name.replace("no-",""))){if(o.type!==Boolean){this.logger.debug(`Cannot add negated option "${o.name}" to command "${e.name}" because it is not a boolean.`);return}const n={...o,defaultValue:o.defaultValue===void 0?!0:!o.defaultValue,name:`${o.name.replace("no-","")}`};e.options.push(n)}})}async registerExtensions(e){const o=v(async n=>typeof n.execute!="function"?(this.logger.warn(`Skipped ${n.name} because execute is not a function.`),null):(await n.execute(e),null),"callback");for(const n of this.extensions)await o(n)}mapNegatableOptions(e,o){Object.entries(e.options).forEach(([n,a])=>{if(/^no\w+/.test(n)){const r=Bt(n.replace("no",""));this.logger.debug(`mapping negated option "${n}" to "${r}"`),e.options[r]=!a,o.options?.forEach(s=>{s.name===r&&(s.__negated__=!0)})}})}mapImpliesOptions(e,o){Object.keys(e.options).forEach(n=>{const a=o.options?.find(r=>r.__camelCaseName__===n&&r.__negated__===void 0&&r.implies!==void 0);if(a?.implies){const r=a.implies;Object.entries(r).forEach(([s,i])=>{if(e.options[s]===void 0)e.options[s]=i;else{const l=o.options?.find(p=>p.name===s);(l?.defaultValue===void 0||e.options[s]===l.defaultValue)&&(e.options[s]=i)}})}})}}export{Zt as C};
10
+ `))}}validateCommandArgsForConflicts(e,o,n){const a=e.filter(r=>r.conflicts!==void 0);if(a.length>0){const r=a.find(s=>Array.isArray(s.conflicts)?s.conflicts.some(i=>o[i]!==void 0)&&o[s.name]!==void 0:o[s.conflicts]!==void 0&&o[s.name]!==void 0);if(r)throw new Error(`You called the command "${n.name}" with conflicting options: ${r.name} and ${typeof r.conflicts=="string"?r.conflicts:r.conflicts?.join(", ")}`)}}addNegatableOption(e){Array.isArray(e.options)&&e.options.forEach(o=>{if(o.name.startsWith("no-")&&!e.options.some(n=>n.name===o.name.replace("no-",""))){if(o.type!==Boolean){this.logger.debug(`Cannot add negated option "${o.name}" to command "${e.name}" because it is not a boolean.`);return}const n={...o,defaultValue:o.defaultValue===void 0?!0:!o.defaultValue,name:`${o.name.replace("no-","")}`};e.options.push(n)}})}async registerExtensions(e){const o=v(async n=>typeof n.execute!="function"?(this.logger.warn(`Skipped ${n.name} because execute is not a function.`),null):(await n.execute(e),null),"callback");for(const n of this.extensions)await o(n)}mapNegatableOptions(e,o){Object.entries(e.options).forEach(([n,a])=>{if(/^no\w+/.test(n)){const r=Bt(n.replace("no",""));this.logger.debug(`mapping negated option "${n}" to "${r}"`),e.options[r]=!a,o.options?.forEach(s=>{s.name===r&&(s.__negated__=!0)})}})}mapImpliesOptions(e,o){Object.keys(e.options).forEach(n=>{const a=o.options?.find(r=>r.__camelCaseName__===n&&r.__negated__===void 0&&r.implies!==void 0);if(a?.implies){const r=a.implies;Object.entries(r).forEach(([s,i])=>{if(e.options[s]===void 0)e.options[s]=i;else{const l=o.options?.find(p=>p.name===s);(l?.defaultValue===void 0||e.options[s]===l.defaultValue)&&(e.options[s]=i)}})}})}}export{Zt as Cli};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@visulima/cerebro",
3
- "version": "1.1.16",
3
+ "version": "1.1.18",
4
4
  "description": "A delightful toolkit for building Node-powered CLIs.",
5
5
  "keywords": [
6
6
  "command",
@@ -31,9 +31,12 @@
31
31
  "yargs"
32
32
  ],
33
33
  "homepage": "https://visulima.com/packages/cerebro",
34
+ "bugs": {
35
+ "url": "https://github.com/visulima/visulima/issues"
36
+ },
34
37
  "repository": {
35
38
  "type": "git",
36
- "url": "https://github.com/visulima/visulima.git",
39
+ "url": "git+https://github.com/visulima/visulima.git",
37
40
  "directory": "packages/cerebro"
38
41
  },
39
42
  "funding": [
@@ -69,6 +72,13 @@
69
72
  "main": "dist/index.cjs",
70
73
  "module": "dist/index.mjs",
71
74
  "types": "dist/index.d.ts",
75
+ "typesVersions": {
76
+ "*": {
77
+ "*": [
78
+ "./dist/index.d.ts"
79
+ ]
80
+ }
81
+ },
72
82
  "files": [
73
83
  "dist",
74
84
  "README.md",
@@ -76,10 +86,10 @@
76
86
  "LICENSE.md"
77
87
  ],
78
88
  "dependencies": {
79
- "@visulima/boxen": "1.0.14",
80
- "@visulima/colorize": "1.4.6",
81
- "@visulima/find-cache-dir": "1.0.7",
82
- "@visulima/pail": "2.1.5",
89
+ "@visulima/boxen": "1.0.16",
90
+ "@visulima/colorize": "1.4.8",
91
+ "@visulima/find-cache-dir": "1.0.9",
92
+ "@visulima/pail": "2.1.7",
83
93
  "cli-table3": "^0.6.5",
84
94
  "command-line-args": "^6.0.0",
85
95
  "fastest-levenshtein": "^1.0.16"
@@ -89,6 +99,7 @@
89
99
  "@anolilab/prettier-config": "^5.0.14",
90
100
  "@anolilab/semantic-release-pnpm": "^1.1.3",
91
101
  "@anolilab/semantic-release-preset": "^9.0.0",
102
+ "@arethetypeswrong/cli": "^0.15.4",
92
103
  "@babel/core": "^7.25.2",
93
104
  "@eslint-types/deprecation": "^2.0.0",
94
105
  "@eslint-types/import": "^2.29.1",
@@ -96,12 +107,12 @@
96
107
  "@eslint-types/typescript-eslint": "^7.5.0",
97
108
  "@eslint-types/unicorn": "^52.0.0",
98
109
  "@rushstack/eslint-plugin-security": "^0.8.2",
99
- "@total-typescript/ts-reset": "^0.6.0",
110
+ "@total-typescript/ts-reset": "^0.6.1",
100
111
  "@types/command-line-args": "^5.2.3",
101
112
  "@types/node": "18.19.15",
102
113
  "@visulima/nextra-theme-docs": "4.0.26",
103
- "@visulima/packem": "^1.0.0-alpha.86",
104
- "@visulima/path": "1.0.5",
114
+ "@visulima/packem": "^1.0.0-alpha.95",
115
+ "@visulima/path": "1.0.7",
105
116
  "@vitest/coverage-v8": "^2.0.5",
106
117
  "camelcase": "8.0.0",
107
118
  "conventional-changelog-conventionalcommits": "8.0.0",
@@ -150,6 +161,7 @@
150
161
  "build:prod": "cross-env NODE_ENV=production packem build",
151
162
  "clean": "rimraf node_modules dist .eslintcache",
152
163
  "dev": "pnpm run build --watch",
164
+ "lint:attw": "attw --pack",
153
165
  "lint:eslint": "eslint . --ext js,cjs,mjs,jsx,ts,tsx,json,yaml,yml,md,mdx --max-warnings=0 --config .eslintrc.cjs",
154
166
  "lint:eslint:fix": "eslint . --ext js,cjs,mjs,jsx,ts,tsx,json,yaml,yml,md,mdx --max-warnings=0 --config .eslintrc.cjs --fix",
155
167
  "lint:package-json": "publint --strict",