@visulima/cerebro 3.0.0-alpha.14 → 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 (31) hide show
  1. package/CHANGELOG.md +18 -0
  2. package/LICENSE.md +6 -0
  3. package/dist/commands/completion-command.js +5 -204
  4. package/dist/commands/help-command.js +1 -262
  5. package/dist/commands/readme-command.js +32 -317
  6. package/dist/commands/version-command.js +1 -18
  7. package/dist/index.js +1 -8
  8. package/dist/logger/create-pail-logger.js +1 -34
  9. package/dist/packem_chunks/has-new-version.js +1 -264
  10. package/dist/packem_shared/Cerebro-Cnr7AGMP.js +4 -0
  11. package/dist/packem_shared/VERBOSITY_QUIET-XPultrIA.js +1 -0
  12. package/dist/packem_shared/VisulimaError-Bh91XNXu.js +76 -0
  13. package/dist/packem_shared/cerebro-error-BnJTixb2.js +1 -0
  14. package/dist/packem_shared/index-B0BiusY7.js +6 -0
  15. package/dist/packem_shared/isVisulimaError-jVZgumOU-C4fgdbWg.js +1 -0
  16. package/dist/packem_shared/lazyNamed-DOmefeJM.js +1 -0
  17. package/dist/packem_shared/renderError-B_XyYPKJ-B65kP-Ou.js +24 -0
  18. package/dist/packem_shared/runtime-process-DKHFvYkv.js +1 -0
  19. package/dist/plugins/error-handler-plugin.js +1 -648
  20. package/dist/plugins/runtime-version-check-plugin.js +1 -77
  21. package/dist/plugins/update-notifier/update-notifier-plugin.js +1 -517
  22. package/dist/util/general/compile-cache.js +1 -16
  23. package/dist/util/general/heap-tuning.js +1 -91
  24. package/package.json +23 -23
  25. package/dist/packem_shared/Cerebro-C1h3DXwy.js +0 -3509
  26. package/dist/packem_shared/VERBOSITY_QUIET-Dp46zlLW.js +0 -10
  27. package/dist/packem_shared/VisulimaError-DA7QsCxH.js +0 -34
  28. package/dist/packem_shared/cerebro-error-GmJ3jN7Q.js +0 -16
  29. package/dist/packem_shared/index--1UArng3.js +0 -267
  30. package/dist/packem_shared/lazyNamed-B278Tf9_.js +0 -6
  31. package/dist/packem_shared/runtime-process-B6ZplyWn.js +0 -187
@@ -1,252 +1,36 @@
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
- existsSync
22
- } = __cjs_getBuiltinModule("node:fs");
23
- const {
24
- readFile,
25
- mkdir,
26
- writeFile
27
- } = __cjs_getBuiltinModule("node:fs/promises");
28
- const {
29
- resolve,
30
- join,
31
- dirname
32
- } = __cjs_getBuiltinModule("node:path");
33
- import GithubSlugger from 'github-slugger';
34
- import { c as commandLineUsage } from '../packem_shared/index--1UArng3.js';
35
- import { g as getCwd, a as getVersions, b as getPlatform, c as getArch } from '../packem_shared/runtime-process-B6ZplyWn.js';
36
-
37
- const slugger = new GithubSlugger();
38
- const slugify = (text) => slugger.slug(text);
39
- const compact = (array) => array.filter(Boolean);
40
- const uniqBy = (array, keyFunction) => {
41
- const seen = /* @__PURE__ */ new Set();
42
- const result = [];
43
- for (const item of array) {
44
- const key = keyFunction(item);
45
- if (!seen.has(key)) {
46
- seen.add(key);
47
- result.push(item);
48
- }
49
- }
50
- return result;
51
- };
52
- const formatCommandUsage = (command, cliName) => {
53
- const fullPath = command.commandPath ? [...command.commandPath, command.name] : [command.name];
54
- const commandId = fullPath.join(" ");
55
- if (command.argument) {
56
- const argumentName = command.argument.name.toUpperCase();
57
- const argumentString = command.argument.required ? argumentName : `[${argumentName}]`;
58
- return `${cliName} ${commandId} ${argumentString}`;
59
- }
60
- return `${cliName} ${commandId}`;
61
- };
62
- const addEnvironmentVariables = (command, usageGroups) => {
63
- if (!Array.isArray(command.env) || command.env.length === 0) {
64
- return;
65
- }
66
- const visibleEnvVariables = command.env.filter((envVariable) => !envVariable.hidden);
67
- if (visibleEnvVariables.length > 0) {
68
- usageGroups.push({
69
- content: visibleEnvVariables.map((envVariable) => [envVariable.name, envVariable.description ?? ""]),
70
- header: " Environment Variables "
71
- });
72
- }
73
- };
74
- const formatCommandHelp = (command, cliName) => {
75
- const usageGroups = [];
76
- const fullCommandPath = command.commandPath ? [...command.commandPath, command.name] : [command.name];
77
- const commandDisplay = fullCommandPath.join(" ");
78
- const hasArgument = Boolean(command.argument);
79
- const hasOptions = Boolean(command.options);
80
- usageGroups.push({
81
- content: `${cliName} ${commandDisplay}${hasArgument ? " [positional arguments]" : ""}${hasOptions ? " [options]" : ""}`,
82
- header: " Usage "
83
- });
84
- if (command.description) {
85
- usageGroups.push({ content: command.description, header: " Description " });
86
- }
87
- if (command.argument) {
88
- usageGroups.push({ header: "Command Positional Arguments", isArgument: true, optionList: [command.argument] });
89
- }
90
- if (Array.isArray(command.options) && command.options.length > 0) {
91
- usageGroups.push({
92
- header: " Command Options ",
93
- optionList: command.options.filter((option) => !option.hidden)
94
- });
95
- }
96
- addEnvironmentVariables(command, usageGroups);
97
- if (command.alias !== void 0 && command.alias.length > 0) {
98
- const alias = Array.isArray(command.alias) ? command.alias : [command.alias];
99
- usageGroups.splice(1, 0, {
100
- content: alias,
101
- header: "Alias(es)"
102
- });
103
- }
104
- if (Array.isArray(command.examples) && command.examples.length > 0) {
105
- usageGroups.push({
106
- content: command.examples,
107
- header: "Examples"
108
- });
109
- }
110
- return commandLineUsage(usageGroups);
111
- };
112
- const renderCommand = (command, cliName) => {
113
- const title = command.description?.trim().split("\n")[0] ?? "";
114
- const usage = formatCommandUsage(command, cliName);
115
- const helpText = formatCommandHelp(command, cliName);
116
- return compact([`## \`${usage}\``, title, `\`\`\`
117
- ${helpText.trim()}
118
- \`\`\``]).join("\n\n");
119
- };
120
- const generateUsage = (cliName, packageName, version, nodeVersion) => {
121
- const versionFlags = ["--version", "-V"];
122
- const versionFlagsString = `(${versionFlags.join("|")})`;
123
- const platform = getPlatform();
124
- const arch = getArch();
125
- return `\`\`\`sh-session
126
- $ npm install -g ${packageName}
127
- $ ${cliName} COMMAND
1
+ var O=Object.defineProperty;var f=(e,t)=>O(e,"name",{value:t,configurable:!0});import{createRequire as L}from"node:module";import U from"github-slugger";import{p as G}from"../packem_shared/index-B0BiusY7.js";import{g as F,a as M,b as W,c as z}from"../packem_shared/runtime-process-DKHFvYkv.js";const N=L(import.meta.url),g=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,A=f(e=>{if(typeof g<"u"&&g.versions&&g.versions.node){const[t,n]=g.versions.node.split(".").map(Number);if(t>22||t===22&&n>=3||t===20&&n>=16)return g.getBuiltinModule(e)}return N(e)},"__cjs_getBuiltinModule"),{existsSync:v}=A("node:fs"),{readFile:T,mkdir:k,writeFile:B}=A("node:fs/promises"),{resolve:P,join:V,dirname:q}=A("node:path");var H=Object.defineProperty,c=f((e,t)=>H(e,"name",{value:t,configurable:!0}),"m");const I=new U,C=c(e=>I.slug(e),"slugify"),J=c(e=>e.filter(Boolean),"compact"),K=c((e,t)=>{const n=new Set,o=[];for(const r of e){const i=t(r);n.has(i)||(n.add(i),o.push(r))}return o},"uniqBy"),D=c((e,t)=>{const n=(e.commandPath?[...e.commandPath,e.name]:[e.name]).join(" ");if(e.argument){const o=e.argument.name.toUpperCase(),r=e.argument.required?o:`[${o}]`;return`${t} ${n} ${r}`}return`${t} ${n}`},"formatCommandUsage"),Q=c((e,t)=>{if(!Array.isArray(e.env)||e.env.length===0)return;const n=e.env.filter(o=>!o.hidden);n.length>0&&t.push({content:n.map(o=>[o.name,o.description??""]),header:" Environment Variables "})},"addEnvironmentVariables"),X=c((e,t)=>{const n=[],o=(e.commandPath?[...e.commandPath,e.name]:[e.name]).join(" "),r=!!e.argument,i=!!e.options;if(n.push({content:`${t} ${o}${r?" [positional arguments]":""}${i?" [options]":""}`,header:" Usage "}),e.description&&n.push({content:e.description,header:" Description "}),e.argument&&n.push({header:"Command Positional Arguments",isArgument:!0,optionList:[e.argument]}),Array.isArray(e.options)&&e.options.length>0&&n.push({header:" Command Options ",optionList:e.options.filter(a=>!a.hidden)}),Q(e,n),e.alias!==void 0&&e.alias.length>0){const a=Array.isArray(e.alias)?e.alias:[e.alias];n.splice(1,0,{content:a,header:"Alias(es)"})}return Array.isArray(e.examples)&&e.examples.length>0&&n.push({content:e.examples,header:"Examples"}),G(n)},"formatCommandHelp"),Y=c((e,t)=>{const n=e.description?.trim().split(`
2
+ `)[0]??"",o=D(e,t),r=X(e,t);return J([`## \`${o}\``,n,`\`\`\`
3
+ ${r.trim()}
4
+ \`\`\``]).join(`
5
+
6
+ `)},"renderCommand"),Z=c((e,t,n,o)=>{const r=`(${["--version","-V"].join("|")})`,i=W(),a=z();return`\`\`\`sh-session
7
+ $ npm install -g ${t}
8
+ $ ${e} COMMAND
128
9
  running command...
129
- $ ${cliName} ${versionFlagsString}
130
- ${packageName}/${version ?? "unknown"} ${platform}-${arch} node-v${nodeVersion}
131
- $ ${cliName} --help [COMMAND]
10
+ $ ${e} ${r}
11
+ ${t}/${n??"unknown"} ${i}-${a} node-v${o}
12
+ $ ${e} --help [COMMAND]
132
13
  USAGE
133
- $ ${cliName} COMMAND
14
+ $ ${e} COMMAND
134
15
  ...
135
16
  \`\`\`
136
- `;
137
- };
138
- const generateCommands = (commands, cliName, _options) => {
139
- const commandList = commands.map((command) => {
140
- const usage = formatCommandUsage(command, cliName);
141
- return `* [\`${usage}\`](#${slugify(usage)})`;
142
- });
143
- const commandDocumentation = commands.map((command) => renderCommand(command, cliName)).map((s) => `${s.trim()}
144
- `);
145
- return [...commandList, "", ...commandDocumentation].join("\n").trim();
146
- };
147
- const writeFileWithDirectory = async (filePath, content) => {
148
- const directory = dirname(filePath);
149
- if (!existsSync(directory)) {
150
- await mkdir(directory, { recursive: true });
151
- }
152
- await writeFile(filePath, content, "utf8");
153
- };
154
- const generateMultiCommands = async (commands, outputDirectory, cliName, options) => {
155
- const groupedCommands = /* @__PURE__ */ new Map();
156
- for (const command of commands) {
157
- const group = command.group ?? "__Other";
158
- const groupCommands = groupedCommands.get(group) ?? [];
159
- groupCommands.push(command);
160
- groupedCommands.set(group, groupCommands);
161
- }
162
- const groups = Array.from(groupedCommands.entries(), ([group, groupCommands]) => {
163
- if (group === "__Other") {
164
- return ["Other", groupCommands];
165
- }
166
- return [group, groupCommands];
167
- });
168
- await Promise.all(
169
- groups.map(async ([group, groupCommands]) => {
170
- const groupPath = group.replaceAll(":", "/");
171
- const filePath = join(".", outputDirectory, `${groupPath}.md`);
172
- const bin = `\`${cliName} ${group}\``;
173
- const document = `${[bin, "=".repeat(bin.length), "", `Commands in the ${group} group.`, "", generateCommands(groupCommands, cliName)].join("\n").trim()}
174
- `;
175
- if (!options.dryRun) {
176
- await writeFileWithDirectory(resolve(getCwd(), filePath), document);
177
- }
178
- })
179
- );
180
- const topicLinks = groups.map(([group]) => {
181
- const groupPath = group.replaceAll(":", "/");
182
- return `* [\`${cliName} ${group}\`](${outputDirectory}/${groupPath}.md)`;
183
- });
184
- return `${["# Command Topics\n", ...topicLinks].join("\n").trim()}
185
- `;
186
- };
187
- const normalizeLineEndings = (text) => text.replaceAll("\r\n", "\n").replaceAll("\r", "\n");
188
- const generateTableOfContents = (readme) => {
189
- const normalizedReadme = normalizeLineEndings(readme);
190
- const toc = normalizedReadme.split("\n").filter((line) => line.startsWith("# ")).map((line) => line.trim().slice(2)).map((line) => `* [${line}](#${slugify(line)})`);
191
- return toc.join("\n");
192
- };
193
- const escapeRegex = (string_) => string_.replaceAll(/[.*+?^${}()|[\]\\]/g, String.raw`\$&`);
194
- const replaceTag = (readme, tag, body) => {
195
- const normalizedReadme = normalizeLineEndings(readme);
196
- const tagStart = `<!-- ${tag} -->`;
197
- const tagStop = `<!-- ${tag}stop -->`;
198
- if (normalizedReadme.includes(tagStart) && normalizedReadme.includes(tagStop)) {
199
- const escapedStart = escapeRegex(tagStart);
200
- const escapedStop = escapeRegex(tagStop);
201
- const tagPattern = new RegExp(String.raw`${escapedStart}(.|\n)*${escapedStop}`, "m");
202
- return normalizedReadme.replace(tagPattern, `${tagStart}
203
- ${body}
204
- ${tagStop}`);
205
- }
206
- return normalizedReadme.replace(tagStart, `${tagStart}
207
- ${body}
208
- ${tagStop}`);
209
- };
210
- const readmeCommand = {
211
- description: "Generate README documentation for CLI commands",
212
- execute: async ({ logger, options, runtime }) => {
213
- const cliName = runtime.getCliName();
214
- const packageName = runtime.getPackageName() ?? cliName;
215
- const packageVersion = runtime.getPackageVersion();
216
- const versions = getVersions();
217
- const nodeVersion = versions.node ?? "unknown";
218
- const readmeOptions = {
219
- aliases: options.aliases,
220
- dryRun: options.dryRun,
221
- multi: options.multi,
222
- outputDir: options.outputDir ?? "docs",
223
- readmePath: options.readmePath ?? "README.md",
224
- version: options.version ?? packageVersion ?? void 0
225
- };
226
- const commandsMap = runtime.getCommands();
227
- const commands = [...commandsMap.values()].filter((c) => !c.hidden).filter((c) => {
228
- if (readmeOptions.aliases) {
229
- return true;
230
- }
231
- return c.name === commandsMap.get(c.name)?.name;
232
- }).toSorted((a, b) => {
233
- const aPath = a.commandPath ? [...a.commandPath, a.name].join(" ") : a.name;
234
- const bPath = b.commandPath ? [...b.commandPath, b.name].join(" ") : b.name;
235
- return aPath.localeCompare(bPath);
236
- });
237
- const uniqueCommands = uniqBy(commands, (c) => {
238
- const path = c.commandPath ? [...c.commandPath, c.name].join(" ") : c.name;
239
- return path;
240
- });
241
- logger.debug(`Processing ${String(uniqueCommands.length)} commands for README generation`);
242
- let readme;
243
- const readmePath = resolve(getCwd(), readmeOptions.readmePath ?? "README.md");
244
- if (existsSync(readmePath)) {
245
- const rawReadme = await readFile(readmePath, "utf8");
246
- readme = normalizeLineEndings(rawReadme);
247
- } else {
248
- logger.warn(`README file not found at ${readmePath}, creating template`);
249
- readme = `# ${packageName}
17
+ `},"generateUsage"),b=c((e,t,n)=>{const o=e.map(i=>{const a=D(i,t);return`* [\`${a}\`](#${C(a)})`}),r=e.map(i=>Y(i,t)).map(i=>`${i.trim()}
18
+ `);return[...o,"",...r].join(`
19
+ `).trim()},"generateCommands"),R=c(async(e,t)=>{const n=q(e);v(n)||await k(n,{recursive:!0}),await B(e,t,"utf8")},"writeFileWithDirectory"),ee=c(async(e,t,n,o)=>{const r=new Map;for(const a of e){const s=a.group??"__Other",l=r.get(s)??[];l.push(a),r.set(s,l)}const i=Array.from(r.entries(),([a,s])=>a==="__Other"?["Other",s]:[a,s]);return await Promise.all(i.map(async([a,s])=>{const l=a.replaceAll(":","/"),$=V(".",t,`${l}.md`),d=`\`${n} ${a}\``,p=`${[d,"=".repeat(d.length),"",`Commands in the ${a} group.`,"",b(s,n,o)].join(`
20
+ `).trim()}
21
+ `;o.dryRun||await R(P(M(),$),p)})),`${[`# Command Topics
22
+ `,...i.map(([a])=>{const s=a.replaceAll(":","/");return`* [\`${n} ${a}\`](${t}/${s}.md)`})].join(`
23
+ `).trim()}
24
+ `},"generateMultiCommands"),w=c(e=>e.replaceAll(`\r
25
+ `,`
26
+ `).replaceAll("\r",`
27
+ `),"normalizeLineEndings"),te=c(e=>w(e).split(`
28
+ `).filter(t=>t.startsWith("# ")).map(t=>t.trim().slice(2)).map(t=>`* [${t}](#${C(t)})`).join(`
29
+ `),"generateTableOfContents"),E=c(e=>e.replaceAll(/[.*+?^${}()|[\]\\]/g,String.raw`\$&`),"escapeRegex"),y=c((e,t,n)=>{const o=w(e),r=`<!-- ${t} -->`,i=`<!-- ${t}stop -->`;if(o.includes(r)&&o.includes(i)){const a=E(r),s=E(i),l=new RegExp(String.raw`${a}(.|\n)*${s}`,"m");return o.replace(l,`${r}
30
+ ${n}
31
+ ${i}`)}return o.replace(r,`${r}
32
+ ${n}
33
+ ${i}`)},"replaceTag"),se={description:"Generate README documentation for CLI commands",execute:c(async({logger:e,options:t,runtime:n})=>{const o=n.getCliName(),r=n.getPackageName()??o,i=n.getPackageVersion(),a=F().node??"unknown",s={aliases:t.aliases,dryRun:t.dryRun,multi:t.multi,nestedTopicsDepth:t.nestedTopicsDepth,outputDir:t.outputDir??"docs",readmePath:t.readmePath??"README.md",repositoryPrefix:t.repositoryPrefix,version:t.version??i??void 0},l=n.getCommands(),$=[...l.values()].filter(m=>!m.hidden).filter(m=>s.aliases?!0:m.name===l.get(m.name)?.name).toSorted((m,h)=>{const _=m.commandPath?[...m.commandPath,m.name].join(" "):m.name,S=h.commandPath?[...h.commandPath,h.name].join(" "):h.name;return _.localeCompare(S)}),d=K($,m=>m.commandPath?[...m.commandPath,m.name].join(" "):m.name);e.debug(`Processing ${String(d.length)} commands for README generation`);let p;const u=P(M(),s.readmePath??"README.md");if(v(u)){const m=await T(u,"utf8");p=w(m)}else e.warn(`README file not found at ${u}, creating template`),p=`# ${r}
250
34
 
251
35
  <!-- usage -->
252
36
  <!-- usagestop -->
@@ -256,75 +40,6 @@ const readmeCommand = {
256
40
 
257
41
  <!-- toc -->
258
42
  <!-- tocstop -->
259
- `;
260
- }
261
- const outputDirectory = readmeOptions.outputDir ?? "docs";
262
- const version = readmeOptions.version ?? packageVersion ?? "unknown";
263
- readme = replaceTag(readme, "usage", generateUsage(cliName, packageName, version, nodeVersion));
264
- readme = replaceTag(
265
- readme,
266
- "commands",
267
- readmeOptions.multi ? await generateMultiCommands(uniqueCommands, outputDirectory, cliName, readmeOptions) : generateCommands(uniqueCommands, cliName)
268
- );
269
- readme = replaceTag(readme, "toc", generateTableOfContents(readme));
270
- readme = `${readme.trimEnd()}
271
- `;
272
- if (readmeOptions.dryRun) {
273
- logger.info("Dry run mode - README not written");
274
- logger.info(`Generated README content:
275
- ${readme}`);
276
- } else {
277
- await writeFileWithDirectory(readmePath, readme);
278
- logger.info(`README generated successfully at ${readmePath}`);
279
- }
280
- },
281
- name: "readme",
282
- options: [
283
- {
284
- description: "Include aliases in command list",
285
- name: "aliases",
286
- type: Boolean
287
- },
288
- {
289
- description: "Show what would be generated without writing files",
290
- name: "dry-run",
291
- type: Boolean
292
- },
293
- {
294
- description: "Generate multi-file documentation by command groups",
295
- name: "multi",
296
- type: Boolean
297
- },
298
- {
299
- description: "Maximum depth for nested topics when using multi-file mode",
300
- name: "nested-topics-depth",
301
- type: Number
302
- },
303
- {
304
- description: "Output directory for multi-file documentation",
305
- name: "output-dir",
306
- type: String,
307
- typeLabel: "{underline directory}"
308
- },
309
- {
310
- description: "Path to README file to generate",
311
- name: "readme-path",
312
- type: String,
313
- typeLabel: "{underline path}"
314
- },
315
- {
316
- description: "Repository prefix for code links",
317
- name: "repository-prefix",
318
- type: String,
319
- typeLabel: "{underline prefix}"
320
- },
321
- {
322
- description: "Version to use in generated documentation",
323
- name: "version",
324
- type: String,
325
- typeLabel: "{underline version}"
326
- }
327
- ]
328
- };
329
-
330
- export { readmeCommand as default };
43
+ `;const j=s.outputDir??"docs",x=s.version??i??"unknown";p=y(p,"usage",Z(o,r,x,a)),p=y(p,"commands",s.multi?await ee(d,j,o,s):b(d,o,s)),p=y(p,"toc",te(p)),p=`${p.trimEnd()}
44
+ `,s.dryRun?(e.info("Dry run mode - README not written"),e.info(`Generated README content:
45
+ ${p}`)):(await R(u,p),e.info(`README generated successfully at ${u}`))},"execute"),name:"readme",options:[{description:"Include aliases in command list",name:"aliases",type:Boolean},{description:"Show what would be generated without writing files",name:"dry-run",type:Boolean},{description:"Generate multi-file documentation by command groups",name:"multi",type:Boolean},{description:"Maximum depth for nested topics when using multi-file mode",name:"nested-topics-depth",type:Number},{description:"Output directory for multi-file documentation",name:"output-dir",type:String,typeLabel:"{underline directory}"},{description:"Path to README file to generate",name:"readme-path",type:String,typeLabel:"{underline path}"},{description:"Repository prefix for code links",name:"repository-prefix",type:String,typeLabel:"{underline prefix}"},{description:"Version to use in generated documentation",name:"version",type:String,typeLabel:"{underline version}"}]};export{se as default};
@@ -1,18 +1 @@
1
- const versionCommand = {
2
- alias: ["v", "V"],
3
- description: "Output the version number",
4
- execute: ({ logger, runtime }) => {
5
- const version = runtime.getPackageVersion();
6
- if (version === void 0) {
7
- logger.warn("Unknown version");
8
- logger.debug("The version number was not provided by the cli constructor.");
9
- } else {
10
- logger.info(version);
11
- }
12
- },
13
- name: "version",
14
- options: [],
15
- usage: []
16
- };
17
-
18
- export { versionCommand as default };
1
+ var t=Object.defineProperty;var r=(e,n)=>t(e,"name",{value:n,configurable:!0});var i=Object.defineProperty,a=r((e,n)=>i(e,"name",{value:n,configurable:!0}),"s");const u={alias:["v","V"],description:"Output the version number",execute:a(({logger:e,runtime:n})=>{const o=n.getPackageVersion();o===void 0?(e.warn("Unknown version"),e.debug("The version number was not provided by the cli constructor.")):e.info(o)},"execute"),name:"version",options:[],usage:[]};export{u as default};
package/dist/index.js CHANGED
@@ -1,8 +1 @@
1
- import { Cli } from './packem_shared/Cerebro-C1h3DXwy.js';
2
- export { VERBOSITY_DEBUG, VERBOSITY_NORMAL, VERBOSITY_QUIET, VERBOSITY_VERBOSE } from './packem_shared/VERBOSITY_QUIET-Dp46zlLW.js';
3
- export { lazyNamed } from './packem_shared/lazyNamed-B278Tf9_.js';
4
- export { VisulimaError } from './packem_shared/VisulimaError-DA7QsCxH.js';
5
-
6
- const createCerebro = (name, options) => new Cli(name, options);
7
-
8
- export { Cli as Cerebro, createCerebro };
1
+ var a=Object.defineProperty;var o=(r,e)=>a(r,"name",{value:e,configurable:!0});import{Cli as t}from"./packem_shared/Cerebro-Cnr7AGMP.js";import{VERBOSITY_DEBUG as R,VERBOSITY_NORMAL as V,VERBOSITY_QUIET as b,VERBOSITY_VERBOSE as c}from"./packem_shared/VERBOSITY_QUIET-XPultrIA.js";import{lazyNamed as n}from"./packem_shared/lazyNamed-DOmefeJM.js";import{p as S}from"./packem_shared/isVisulimaError-jVZgumOU-C4fgdbWg.js";var E=Object.defineProperty,m=o((r,e)=>E(r,"name",{value:e,configurable:!0}),"t");const f=m((r,e)=>new t(r,e),"createCerebro");export{t as Cerebro,R as VERBOSITY_DEBUG,V as VERBOSITY_NORMAL,b as VERBOSITY_QUIET,c as VERBOSITY_VERBOSE,S as VisulimaError,f as createCerebro,n as lazyNamed};
@@ -1,34 +1 @@
1
- import CallerProcessor from '@visulima/pail/processor/caller';
2
- import MessageFormatterProcessor from '@visulima/pail/processor/message-formatter';
3
- import { createPail } from '@visulima/pail/server';
4
- import { VERBOSITY_DEBUG, VERBOSITY_QUIET } from '../packem_shared/VERBOSITY_QUIET-Dp46zlLW.js';
5
- import { d as getEnv } from '../packem_shared/runtime-process-B6ZplyWn.js';
6
-
7
- const createPailLogger = (options) => {
8
- const cerebroLevelToPailLevel = {
9
- 16: "informational",
10
- 32: "informational",
11
- 64: "trace",
12
- 128: "debug",
13
- 256: "debug"
14
- };
15
- const processors = [new MessageFormatterProcessor()];
16
- const env = getEnv();
17
- const outputLevel = env.CEREBRO_OUTPUT_LEVEL;
18
- if (outputLevel === String(128) || outputLevel === String(VERBOSITY_DEBUG)) {
19
- processors.push(new CallerProcessor());
20
- }
21
- const envLogLevel = (outputLevel && cerebroLevelToPailLevel[outputLevel]) ?? "informational";
22
- const loggerOptions = {
23
- ...options,
24
- logLevel: options?.logLevel ?? envLogLevel,
25
- processors: options?.processors ? [...processors, ...options.processors] : processors
26
- };
27
- const logger = createPail(loggerOptions);
28
- if (outputLevel === String(VERBOSITY_QUIET)) {
29
- logger.disable();
30
- }
31
- return logger;
32
- };
33
-
34
- export { createPailLogger as default };
1
+ var l=Object.defineProperty;var i=(o,r)=>l(o,"name",{value:r,configurable:!0});import m from"@visulima/pail/processor/caller";import c from"@visulima/pail/processor/message-formatter";import{createPail as f}from"@visulima/pail/server";import{VERBOSITY_DEBUG as g,VERBOSITY_QUIET as p}from"../packem_shared/VERBOSITY_QUIET-XPultrIA.js";import{d as E}from"../packem_shared/runtime-process-DKHFvYkv.js";var u=Object.defineProperty,d=i((o,r)=>u(o,"name",{value:r,configurable:!0}),"i");const B=d(o=>{const r={16:"informational",32:"informational",64:"trace",128:"debug",256:"debug"},t=[new c],e=E().CEREBRO_OUTPUT_LEVEL;(e===String(128)||e===String(g))&&t.push(new m);const n=(e&&r[e])??"informational",s={...o,logLevel:o?.logLevel??n,processors:o?.processors?[...t,...o.processors]:t},a=f(s);return e===String(p)&&a.disable(),a},"createPailLogger");export{B as default};