@visulima/cerebro 3.0.0-alpha.13 → 3.0.0-alpha.15

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.
Files changed (40) hide show
  1. package/CHANGELOG.md +25 -0
  2. package/LICENSE.md +92 -91
  3. package/dist/commands/completion-command.d.ts +1 -1
  4. package/dist/commands/completion-command.js +5 -204
  5. package/dist/commands/help-command.d.ts +1 -1
  6. package/dist/commands/help-command.js +1 -262
  7. package/dist/commands/readme-command.d.ts +1 -1
  8. package/dist/commands/readme-command.js +32 -317
  9. package/dist/commands/version-command.d.ts +1 -1
  10. package/dist/commands/version-command.js +1 -18
  11. package/dist/index.d.ts +2 -2
  12. package/dist/index.js +1 -8
  13. package/dist/logger/create-pail-logger.js +1 -34
  14. package/dist/packem_chunks/has-new-version.js +1 -264
  15. package/dist/packem_shared/Cerebro-Cnr7AGMP.js +4 -0
  16. package/dist/packem_shared/VERBOSITY_QUIET-XPultrIA.js +1 -0
  17. package/dist/packem_shared/VisulimaError-Bh91XNXu.js +76 -0
  18. package/dist/packem_shared/cerebro-error-BnJTixb2.js +1 -0
  19. package/dist/packem_shared/index-B0BiusY7.js +6 -0
  20. package/dist/packem_shared/isVisulimaError-jVZgumOU-C4fgdbWg.js +1 -0
  21. package/dist/packem_shared/lazyNamed-DOmefeJM.js +1 -0
  22. package/dist/packem_shared/{plugin-manager.d-Du-YXFui.d.ts → plugin-manager.d-Dz-wu1tI.d.ts} +3 -0
  23. package/dist/packem_shared/renderError-B_XyYPKJ-B65kP-Ou.js +24 -0
  24. package/dist/packem_shared/runtime-process-DKHFvYkv.js +1 -0
  25. package/dist/plugins/error-handler-plugin.d.ts +1 -1
  26. package/dist/plugins/error-handler-plugin.js +1 -648
  27. package/dist/plugins/runtime-version-check-plugin.d.ts +1 -1
  28. package/dist/plugins/runtime-version-check-plugin.js +1 -77
  29. package/dist/plugins/update-notifier/update-notifier-plugin.d.ts +1 -1
  30. package/dist/plugins/update-notifier/update-notifier-plugin.js +1 -517
  31. package/dist/util/general/compile-cache.js +1 -16
  32. package/dist/util/general/heap-tuning.js +1 -91
  33. package/package.json +23 -23
  34. package/dist/packem_shared/Cerebro-C1h3DXwy.js +0 -3509
  35. package/dist/packem_shared/VERBOSITY_QUIET-Dp46zlLW.js +0 -10
  36. package/dist/packem_shared/VisulimaError-DA7QsCxH.js +0 -34
  37. package/dist/packem_shared/cerebro-error-GmJ3jN7Q.js +0 -16
  38. package/dist/packem_shared/index--1UArng3.js +0 -267
  39. package/dist/packem_shared/lazyNamed-B278Tf9_.js +0 -6
  40. package/dist/packem_shared/runtime-process-B6ZplyWn.js +0 -187
@@ -1,91 +1 @@
1
- import { createRequire as __cjs_createRequire } from "node:module";
2
-
3
- const __cjs_require = __cjs_createRequire(import.meta.url);
4
-
5
- const __cjs_getProcess = typeof globalThis !== "undefined" && typeof globalThis.process !== "undefined" ? globalThis.process : process;
6
-
7
- const __cjs_getBuiltinModule = (module) => {
8
- // Check if we're in Node.js and version supports getBuiltinModule
9
- if (typeof __cjs_getProcess !== "undefined" && __cjs_getProcess.versions && __cjs_getProcess.versions.node) {
10
- const [major, minor] = __cjs_getProcess.versions.node.split(".").map(Number);
11
- // Node.js 20.16.0+ and 22.3.0+
12
- if (major > 22 || (major === 22 && minor >= 3) || (major === 20 && minor >= 16)) {
13
- return __cjs_getProcess.getBuiltinModule(module);
14
- }
15
- }
16
- // Fallback to createRequire
17
- return __cjs_require(module);
18
- };
19
-
20
- const {
21
- execFileSync
22
- } = __cjs_getBuiltinModule("node:child_process");
23
- const {
24
- totalmem
25
- } = __cjs_getBuiltinModule("node:os");
26
- import { f as getArgv, h as getExecPath, d as getEnv, e as exitProcess, i as getExecArgv } from '../../packem_shared/runtime-process-B6ZplyWn.js';
27
-
28
- const MAX_OLD_SPACE_RE = /--max-old-space-size=(\d+)/;
29
- const MAX_SEMI_SPACE_RE = /--max-semi-space-size=(\d+)/;
30
- const getDefaultMaxOldSpaceSize = (percent) => Math.floor(totalmem() / 1024 / 1024 * percent);
31
- const getSemiSpaceSize = (maxOldSpaceMiB) => {
32
- if (maxOldSpaceMiB <= 512) {
33
- return 4;
34
- }
35
- if (maxOldSpaceMiB <= 1024) {
36
- return 8;
37
- }
38
- if (maxOldSpaceMiB <= 2048) {
39
- return 16;
40
- }
41
- if (maxOldSpaceMiB <= 4096) {
42
- return 32;
43
- }
44
- if (maxOldSpaceMiB <= 8192) {
45
- return 64;
46
- }
47
- return Math.floor(Math.log2(maxOldSpaceMiB)) * 8;
48
- };
49
- const extractFlag = (regex, execArgv) => {
50
- for (const argument of execArgv) {
51
- const match = regex.exec(argument);
52
- if (match) {
53
- return Number.parseInt(match[1], 10);
54
- }
55
- }
56
- return void 0;
57
- };
58
- const applyHeapTuning = (options) => {
59
- const percent = options?.maxOldSpacePercent ?? 0.75;
60
- const execArgv = [...getExecArgv()];
61
- const argv = [...getArgv()];
62
- const existingOldSpace = extractFlag(MAX_OLD_SPACE_RE, execArgv);
63
- const existingSemiSpace = extractFlag(MAX_SEMI_SPACE_RE, execArgv);
64
- if (existingOldSpace !== void 0 && existingSemiSpace !== void 0) {
65
- return;
66
- }
67
- const oldSpace = existingOldSpace ?? getDefaultMaxOldSpaceSize(percent);
68
- const semiSpace = existingSemiSpace ?? getSemiSpaceSize(oldSpace);
69
- const extraFlags = [];
70
- if (existingOldSpace === void 0) {
71
- extraFlags.push(`--max-old-space-size=${String(oldSpace)}`);
72
- }
73
- if (existingSemiSpace === void 0) {
74
- extraFlags.push(`--max-semi-space-size=${String(semiSpace)}`);
75
- }
76
- if (extraFlags.length === 0) {
77
- return;
78
- }
79
- try {
80
- execFileSync(getExecPath(), [...extraFlags, ...execArgv, ...argv.slice(1)], {
81
- env: getEnv(),
82
- stdio: "inherit"
83
- });
84
- exitProcess(0);
85
- } catch (error) {
86
- const code = error.status;
87
- exitProcess(typeof code === "number" ? code : 1);
88
- }
89
- };
90
-
91
- export { applyHeapTuning };
1
+ var h=Object.defineProperty;var p=(e,s)=>h(e,"name",{value:s,configurable:!0});import{createRequire as x}from"node:module";import{f as b,h as z,i as j,d as M,e as d}from"../../packem_shared/runtime-process-DKHFvYkv.js";const _=x(import.meta.url),o=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,g=p(e=>{if(typeof o<"u"&&o.versions&&o.versions.node){const[s,t]=o.versions.node.split(".").map(Number);if(s>22||s===22&&t>=3||s===20&&t>=16)return o.getBuiltinModule(e)}return _(e)},"__cjs_getBuiltinModule"),{execFileSync:y}=g("node:child_process"),{totalmem:S}=g("node:os");var P=Object.defineProperty,n=p((e,s)=>P(e,"name",{value:s,configurable:!0}),"r");const T=/--max-old-space-size=(\d+)/,q=/--max-semi-space-size=(\d+)/,A=n(e=>Math.floor(S()/1024/1024*e),"getDefaultMaxOldSpaceSize"),E=n(e=>e<=512?4:e<=1024?8:e<=2048?16:e<=4096?32:e<=8192?64:Math.floor(Math.log2(e))*8,"getSemiSpaceSize"),f=n((e,s)=>{for(const t of s){const i=e.exec(t);if(i)return Number.parseInt(i[1],10)}},"extractFlag"),H=n(e=>{const s=e?.maxOldSpacePercent??.75,t=[...b()],i=[...z()],a=f(T,t),c=f(q,t);if(a!==void 0&&c!==void 0)return;const l=a??A(s),m=c??E(l),r=[];if(a===void 0&&r.push(`--max-old-space-size=${String(l)}`),c===void 0&&r.push(`--max-semi-space-size=${String(m)}`),r.length!==0)try{y(j(),[...r,...t,...i.slice(1)],{env:M(),stdio:"inherit"}),d(0)}catch(v){const u=v.status;d(typeof u=="number"?u:1)}},"applyHeapTuning");export{H as applyHeapTuning};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@visulima/cerebro",
3
- "version": "3.0.0-alpha.13",
3
+ "version": "3.0.0-alpha.15",
4
4
  "description": "A delightful toolkit for building cross-runtime CLIs for Node.js, Deno, and Bun.",
5
5
  "keywords": [
6
6
  "ansi",
@@ -35,6 +35,11 @@
35
35
  "bugs": {
36
36
  "url": "https://github.com/visulima/visulima/issues"
37
37
  },
38
+ "license": "MIT",
39
+ "author": {
40
+ "name": "Daniel Bannert",
41
+ "email": "d.bannert@anolilab.de"
42
+ },
38
43
  "repository": {
39
44
  "type": "git",
40
45
  "url": "git+https://github.com/visulima/visulima.git",
@@ -50,13 +55,19 @@
50
55
  "url": "https://anolilab.com/support"
51
56
  }
52
57
  ],
53
- "license": "MIT",
54
- "author": {
55
- "name": "Daniel Bannert",
56
- "email": "d.bannert@anolilab.de"
57
- },
58
- "sideEffects": false,
58
+ "files": [
59
+ "dist",
60
+ "README.md",
61
+ "CHANGELOG.md",
62
+ "LICENSE.md"
63
+ ],
64
+ "os": [
65
+ "darwin",
66
+ "linux",
67
+ "win32"
68
+ ],
59
69
  "type": "module",
70
+ "sideEffects": false,
60
71
  "exports": {
61
72
  ".": {
62
73
  "types": "./dist/index.d.ts",
@@ -104,12 +115,10 @@
104
115
  },
105
116
  "./package.json": "./package.json"
106
117
  },
107
- "files": [
108
- "dist",
109
- "README.md",
110
- "CHANGELOG.md",
111
- "LICENSE.md"
112
- ],
118
+ "publishConfig": {
119
+ "access": "public",
120
+ "provenance": true
121
+ },
113
122
  "dependencies": {
114
123
  "@visulima/colorize": "2.0.0-alpha.10",
115
124
  "@visulima/tabular": "4.0.0-alpha.11",
@@ -119,7 +128,7 @@
119
128
  "@bomb.sh/tab": "0.0.15",
120
129
  "@visulima/boxen": "3.0.0-alpha.10",
121
130
  "@visulima/find-cache-dir": "3.0.0-alpha.9",
122
- "@visulima/pail": "4.0.0-alpha.12",
131
+ "@visulima/pail": "4.0.0-alpha.13",
123
132
  "github-slugger": "2.0.0"
124
133
  },
125
134
  "peerDependenciesMeta": {
@@ -141,14 +150,5 @@
141
150
  },
142
151
  "engines": {
143
152
  "node": "^22.14.0 || >=24.10.0"
144
- },
145
- "os": [
146
- "darwin",
147
- "linux",
148
- "win32"
149
- ],
150
- "publishConfig": {
151
- "access": "public",
152
- "provenance": true
153
153
  }
154
154
  }