@ankhzet/starter 1.3.0 → 1.4.0

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.
@@ -11,7 +11,7 @@
11
11
  "package.json",
12
12
  "src/**/*.ts",
13
13
  "src/**/*.tsx",
14
- "build",
14
+ "dist",
15
15
  "*.md"
16
16
  ],
17
17
  "exports": {
package/CHANGELOG.md CHANGED
@@ -1,5 +1,17 @@
1
1
  # @ankhzet/starter
2
2
 
3
+ ## 1.4.0
4
+
5
+ ### Minor Changes
6
+
7
+ - Fix release
8
+
9
+ ### Patch Changes
10
+
11
+ - Updated dependencies
12
+ - @ankhzet/eventual@1.2.0
13
+ - @ankhzet/utils@1.18.0
14
+
3
15
  ## 1.3.0
4
16
 
5
17
  ### Minor Changes
@@ -0,0 +1 @@
1
+ export { }
package/dist/index.js ADDED
@@ -0,0 +1,262 @@
1
+ import { CommandLineAction as e, CommandLineParser as t } from "@rushstack/ts-command-line";
2
+ import n from "terminal-kit";
3
+ import { dirname as r, join as i, resolve as a, sep as o } from "node:path";
4
+ import { mkdir as s, opendir as c, readFile as l, writeFile as u } from "node:fs/promises";
5
+ import { pick as d, ucFirst as f } from "@ankhzet/utils";
6
+ import { execSync as p } from "node:child_process";
7
+ //#region src/Shell.ts
8
+ var m = class {
9
+ #e;
10
+ #t;
11
+ #n;
12
+ constructor(e) {
13
+ this.#t = e, this.#n = process.env.SHELL || "/bin/sh", this.#e = this.getProfile(), this.exec("git -v"), this.exec("nvm -v");
14
+ }
15
+ getProfile() {
16
+ let e = process.env.HOME, t = p(`${this.#n} -lixc exit 2>&1`, {
17
+ cwd: this.#t,
18
+ shell: this.#n,
19
+ env: process.env,
20
+ encoding: "buffer"
21
+ }).toString(), n = [...new Set((t.match(/^\+([^>\n]+)> (?:source|\.) /gim) || []).map((e) => e.match(/^\+([^:>]+)(?::\d+)?>/)?.[1]).filter((e) => !!(e && e[0] === "/")).map((t) => `. ${e ? t.replace(e, "~") : t}`))];
22
+ return n.join(" && ") + (n.length ? " && " : "");
23
+ }
24
+ execChain(e) {
25
+ for (let t of e) this.exec(t);
26
+ }
27
+ exec(e) {
28
+ return p(this.#e + e, {
29
+ cwd: this.#t,
30
+ shell: this.#n,
31
+ env: process.env,
32
+ stdio: "inherit",
33
+ encoding: "buffer"
34
+ });
35
+ }
36
+ }, h = n.terminal, g = {
37
+ global: ["type"],
38
+ package: [
39
+ "name",
40
+ "author",
41
+ "repository",
42
+ "description",
43
+ "node"
44
+ ],
45
+ npm: ["registry", "scopes"]
46
+ }, _ = class {
47
+ name;
48
+ target;
49
+ constructor(e, t) {
50
+ this.name = e, this.target = t || e;
51
+ }
52
+ async run() {
53
+ try {
54
+ await this.doRun();
55
+ } finally {
56
+ await h.asyncCleanup();
57
+ }
58
+ }
59
+ async doRun() {
60
+ let e = i(await this.findRoot(r(new URL(import.meta.url).pathname)), ".templates"), t = a(process.cwd(), this.target);
61
+ await s(t, { recursive: !0 });
62
+ let n = new m(t);
63
+ h.white("Base directory:\n"), h.green(" %s\n", e), h.white("Target directory:\n"), h.green(" %s\n", t);
64
+ let c = await this.getData(), d = [], f = i(e, `create-${c.type}`), p = (e) => e.replace(f + o, "");
65
+ await this.walk(f, async (e) => void d.push(e));
66
+ let _ = h.progressBar({
67
+ width: 120,
68
+ title: `Processing files 0/${d.length}:`,
69
+ titleSize: 30,
70
+ eta: !0,
71
+ percent: !0
72
+ });
73
+ try {
74
+ let e = 0;
75
+ for (let n of d) {
76
+ if (!c.registry && n.match(/\.npmrc$/)) continue;
77
+ let a = p(n), o = i(t, a), f = r(o);
78
+ h.deleteLine(-1).eraseLine(), h.gray("%s\n", a), await new Promise((e) => setTimeout(e, 10));
79
+ let m = await l(n, {
80
+ encoding: "utf-8",
81
+ flag: "r"
82
+ }), v = m.replace(/\{(\w+)-([^}]+)}/g, (e, t, r) => {
83
+ if (g[t]?.includes(r)) {
84
+ if (r in c) return c[r];
85
+ throw Error(`Unknown ${t} parameter: "${r}" (${n})\n${m}`);
86
+ }
87
+ throw Error(`Glob ${t} des not have parameter "${r}" (${n})\n${m}`);
88
+ });
89
+ await s(f, { recursive: !0 }), await u(o, v, { encoding: "utf-8" }), e++, _.update({
90
+ progress: e / d.length,
91
+ title: `Processing files ${e}/${d.length}:`
92
+ });
93
+ }
94
+ } catch (e) {
95
+ throw h("\n"), _.stop(), e;
96
+ }
97
+ n.execChain([
98
+ "git init",
99
+ "git add .",
100
+ "git commit -m 'chore: initial commit' || True"
101
+ ]), n.execChain([
102
+ "chmod +x .bin/*",
103
+ "(nvm use && pnpm install 2>/dev/null) || True",
104
+ ".bin/init"
105
+ ]), h("\nDone.\n");
106
+ }
107
+ async getData() {
108
+ let e = {}, t = {
109
+ author: () => "anon",
110
+ name: () => {
111
+ let [t] = (e.author?.trim() || "").split(" ") || [""];
112
+ return t?.includes("@") && (t = t.split("@")[0]), `@${t}/${this.name}`.toLowerCase();
113
+ },
114
+ repository: () => `https://github.com/${(e.name || "").replace("@", "")}`,
115
+ description: () => this.name,
116
+ type: () => "lib",
117
+ node: () => process.version.replace(/^v/i, ""),
118
+ registry: () => "http://verdaccio.local:4873",
119
+ scopes: () => e.registry ? "torque" : !1
120
+ }, n = {
121
+ scopes: (t) => t.split(/[\s,;]/).map((t) => t && `@${t}:registry=${e.registry}/`).join("\n"),
122
+ registry: (e) => e.replace(/^https?:\/\//, "")
123
+ }, r = {
124
+ author: "package author (Name email@example.com)",
125
+ name: "package name (name or @scope/name)",
126
+ repository: "package upstream origin",
127
+ description: "package description",
128
+ type: "package type ([lib])",
129
+ node: "target NodeJs version",
130
+ registry: "custom NPM registry (or type \"none\")",
131
+ scopes: "scopes on custom registry ([\\s,;])"
132
+ }, i = [this.name], a = [
133
+ this.name,
134
+ "https://",
135
+ "https://github.com/"
136
+ ];
137
+ for (let [n, o] of Object.entries(t)) {
138
+ if ((e[n] ?? !1) !== !1) continue;
139
+ let t = o?.() ?? "";
140
+ if (t === !1) {
141
+ e[n] = "";
142
+ continue;
143
+ }
144
+ switch (n) {
145
+ case "type":
146
+ e[n] = t;
147
+ break;
148
+ default: {
149
+ h(`Please enter ${r[n] || n}${t ? ` [${t}]` : ""}: `);
150
+ let o = await this.getInput({
151
+ history: i,
152
+ autoComplete: a,
153
+ autoCompleteMenu: !0
154
+ });
155
+ h("\n"), o ? o === "none" ? e[n] = "" : (i.push(o), e[n] = o) : (i.push(t), e[n] = t);
156
+ }
157
+ }
158
+ }
159
+ for (let [t, r] of Object.entries(n)) e[t] = r(e[t] || "");
160
+ for (let [t, n] of Object.entries(g)) h.white(`${f(t)} data: `).cyan(JSON.stringify(d(e, n), null, 2)).cyan("\n");
161
+ return e;
162
+ }
163
+ async getInput(e) {
164
+ let { abort: t, promise: n } = h.inputField({
165
+ ...e,
166
+ cancelable: !0
167
+ }), r = (e, n) => {
168
+ (n.indexOf("CTRL_C") >= 0 || n.indexOf("CTRL_D") >= 0) && (console.log(e.replace("CTRL_", "^")), h.off("key", r), t(), process.exit());
169
+ };
170
+ return h.on("key", r), await n;
171
+ }
172
+ async walk(e, t) {
173
+ let n = await c(e, { encoding: "utf-8" });
174
+ for await (let e of n) {
175
+ let n = i(e.parentPath, e.name);
176
+ if (e.isFile()) {
177
+ if (!1 === await t(n)) break;
178
+ } else if (e.isDirectory()) {
179
+ if (e.name === "." || e.name === "..") continue;
180
+ await this.walk(n, t);
181
+ }
182
+ }
183
+ }
184
+ async findRoot(e) {
185
+ try {
186
+ if (JSON.parse((await l(i(e, "package.json"))).toString())?.name !== "@ankhzet/starter") throw Error();
187
+ return e;
188
+ } catch {
189
+ let t = r(e);
190
+ if (t !== e) return this.findRoot(t);
191
+ throw Error("Failed to find root directory");
192
+ }
193
+ }
194
+ }, v = /* @__PURE__ */ function(e) {
195
+ return e[e.All = 0] = "All", e[e.Info = 1] = "Info", e[e.Warning = 2] = "Warning", e[e.Error = 3] = "Error", e;
196
+ }({}), y = {
197
+ 1: "info",
198
+ 2: "warn",
199
+ 3: "error"
200
+ }, b = class {
201
+ level;
202
+ #e;
203
+ constructor(e = 0) {
204
+ this.level = e, this.#e = Object.fromEntries(Object.entries(y).map(([e, t]) => [e, console[t].bind(console)]));
205
+ }
206
+ setLevel(e) {
207
+ this.level = e;
208
+ }
209
+ log(e, ...t) {
210
+ if (e < this.level) return;
211
+ let n = this.#e[e];
212
+ n && n(...t);
213
+ }
214
+ }, x = class extends e {
215
+ #e;
216
+ constructor(e) {
217
+ super({
218
+ actionName: "create",
219
+ summary: "Create a package from template",
220
+ documentation: "Choose package options and scaffold complete directory structure"
221
+ }), this.#e = e;
222
+ }
223
+ async onExecuteAsync() {
224
+ try {
225
+ await new _(this._name.value, this._target.values.join(" ")).run();
226
+ } catch (e) {
227
+ if (e && e instanceof Error) this.#e.log(v.Error, e.stack);
228
+ else if (e === "abort") return;
229
+ throw e;
230
+ }
231
+ }
232
+ onDefineParameters() {
233
+ this._name = this.defineStringParameter({
234
+ parameterLongName: "--name",
235
+ parameterShortName: "-n",
236
+ argumentName: "NAME",
237
+ description: "Package name",
238
+ required: !0
239
+ }), this._target = this.defineCommandLineRemainder({ description: "Target directory" });
240
+ }
241
+ };
242
+ //#endregion
243
+ //#region src/index.ts
244
+ await new class extends t {
245
+ #e;
246
+ constructor() {
247
+ super({
248
+ toolFilename: "starter",
249
+ toolDescription: "Scaffold a package."
250
+ }), this.#e = new b(), this.addAction(new x(this.#e)), this._verbose = this.defineFlagParameter({
251
+ parameterLongName: "--verbose",
252
+ parameterShortName: "-v",
253
+ description: "Verbose output to console (info)"
254
+ });
255
+ }
256
+ onExecuteAsync() {
257
+ return this.#e.setLevel(this._verbose.value ? v.All : v.Warning), super.onExecuteAsync();
258
+ }
259
+ }().executeAsync();
260
+ //#endregion
261
+
262
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","names":["#profile","#cwd","#shell","#map","#logger","#logger"],"sources":["../src/Shell.ts","../src/Creator.ts","../src/Logger.ts","../src/CreateAction.ts","../src/CLI.ts","../src/index.ts"],"sourcesContent":["import { execSync } from 'node:child_process';\n\nexport class Shell {\n readonly #profile: string;\n readonly #cwd: string;\n readonly #shell: string;\n\n public constructor(cwd: string) {\n this.#cwd = cwd;\n this.#shell = process.env.SHELL || '/bin/sh';\n this.#profile = this.getProfile();\n\n this.exec(`git -v`);\n this.exec(`nvm -v`);\n }\n\n protected getProfile(): string {\n const home = process.env.HOME;\n const cmd = `${this.#shell} -lixc exit 2>&1`;\n const all = execSync(cmd, {\n cwd: this.#cwd,\n shell: this.#shell,\n env: process.env,\n encoding: 'buffer',\n }).toString();\n\n const sources = [...new Set((\n (all.match(/^\\+([^>\\n]+)> (?:source|\\.) /gmi) || [])\n .map((source) => source.match(/^\\+([^:>]+)(?::\\d+)?>/)?.[1])\n .filter((item): item is string => !!(item && item[0] === '/'))\n .map((item) => `. ${home ? item.replace(home, '~') : item}`)\n ))];\n\n return sources.join(' && ') + (sources.length ? ' && ' : '');\n }\n\n public execChain(commands: string[]) {\n for (const command of commands) {\n this.exec(command);\n }\n }\n\n public exec(command: string): Buffer {\n return execSync(this.#profile + command, {\n cwd: this.#cwd,\n shell: this.#shell,\n env: process.env,\n stdio: 'inherit',\n encoding: 'buffer',\n });\n }\n}\n","import kit, { type Terminal } from 'terminal-kit';\nimport { dirname, join, resolve, sep } from 'node:path';\nimport { mkdir, opendir, readFile, writeFile } from 'node:fs/promises';\nimport { pick, ucFirst } from '@ankhzet/utils';\nimport { Shell } from './Shell';\n\ntype DataBits = 'type' | 'name' | 'author' | 'repository' | 'description' | 'node' | 'registry' | 'scopes';\n\nconst terminal = kit.terminal;\nconst mapping: Record<string, DataBits[]> = {\n global: ['type'],\n package: ['name', 'author', 'repository', 'description', 'node'],\n npm: ['registry', 'scopes'],\n};\n\nexport class Creator {\n private readonly name: string;\n private readonly target: string;\n\n public constructor(name: string, target: string) {\n this.name = name;\n this.target = target || name;\n }\n\n public async run() {\n try {\n await this.doRun();\n } finally {\n await terminal.asyncCleanup();\n }\n }\n\n protected async doRun() {\n const root = await this.findRoot(dirname((new URL(import.meta.url)).pathname));\n const base = join(root, '.templates');\n const target = resolve(process.cwd(), this.target);\n\n await mkdir(target, { recursive: true });\n\n const shell = new Shell(target);\n\n terminal.white('Base directory:\\n');\n terminal.green('\\t%s\\n', base);\n\n terminal.white('Target directory:\\n');\n terminal.green('\\t%s\\n', target);\n\n const data = await this.getData();\n\n const files: string[] = [];\n const templates = join(base, `create-${data.type!}`);\n const relative = (pathname: string) => pathname.replace(templates + sep, '');\n await this.walk(templates, async (pathname) => void files.push(pathname));\n\n const progressBar = terminal.progressBar({\n width: 120,\n title: `Processing files 0/${files.length}:`,\n titleSize: 30,\n eta: true,\n percent: true,\n });\n\n try {\n let progress = 0;\n\n for (const pathname of files) {\n if (!data.registry && pathname.match(/\\.npmrc$/)) {\n continue;\n }\n\n const relativePath = relative(pathname);\n const targetPath = join(target, relativePath);\n const targetDir = dirname(targetPath);\n terminal.deleteLine(-1).eraseLine()\n terminal.gray('%s\\n', relativePath);\n await new Promise((resolve) => setTimeout(resolve, 10));\n const contents = await readFile(pathname, { encoding: 'utf-8', flag: 'r' });\n\n const updated = contents.replace(/\\{(\\w+)-([^}]+)}/g, (_, glob: string, key: keyof typeof data) => {\n if (mapping[glob]?.includes(key)) {\n if (key in data) {\n return data[key]!;\n }\n\n throw new Error(`Unknown ${glob} parameter: \"${key}\" (${pathname})\\n${contents}`);\n }\n\n throw new Error(`Glob ${glob} des not have parameter \"${key}\" (${pathname})\\n${contents}`);\n });\n\n await mkdir(targetDir, { recursive: true });\n await writeFile(targetPath, updated, { encoding: 'utf-8' });\n\n progress++;\n\n progressBar.update({\n progress: progress / files.length,\n title: `Processing files ${progress}/${files.length}:`,\n });\n }\n } catch (e) {\n terminal('\\n');\n progressBar.stop();\n throw e;\n }\n\n shell.execChain([\n 'git init',\n 'git add .',\n 'git commit -m \\'chore: initial commit\\' || True',\n ]);\n\n shell.execChain([\n 'chmod +x .bin/*',\n '(nvm use && pnpm install 2>/dev/null) || True', // initial install\n '.bin/init', // true install (noop if prev was successful)\n ]);\n\n terminal('\\nDone.\\n');\n }\n\n protected async getData(): Promise<Record<DataBits, string | undefined>> {\n const data: Record<DataBits, string | undefined> = {} as Record<DataBits, string | undefined>;\n const defaults: Record<DataBits, () => string | false> = {\n author: () => 'anon',\n name: () => {\n let [author] = (data.author?.trim() || '').split(' ') || [''];\n\n if (author?.includes('@')) {\n author = author.split('@')[0];\n }\n\n return `@${author}/${this.name}`.toLowerCase();\n },\n repository: () => `https://github.com/${(data.name || '').replace('@', '')}`,\n description: () => this.name,\n type: () => 'lib',\n node: () => process.version.replace(/^v/i, ''),\n registry: () => 'http://verdaccio.local:4873',\n scopes: () => data.registry ? 'torque' : false,\n };\n const post: Partial<Record<DataBits, (value: string) => string | undefined>> = {\n scopes: (value) => value.split(/[\\s,;]/).map((scope) => scope && `@${scope}:registry=${data.registry}/`).join('\\n'),\n registry: (value) => value.replace(/^https?:\\/\\//, '')\n };\n const labels: Record<string, string | undefined> = {\n author: 'package author (Name email@example.com)',\n name: 'package name (name or @scope/name)',\n repository: 'package upstream origin',\n description: 'package description',\n type: 'package type ([lib])',\n node: 'target NodeJs version',\n registry: `custom NPM registry (or type \"none\")`,\n scopes: 'scopes on custom registry ([\\\\s,;])',\n };\n const history: string[] = [this.name];\n const autoComplete = [this.name, 'https://', 'https://github.com/'];\n\n for (const [name, value] of Object.entries(defaults) as [DataBits, () => string | false | undefined][]) {\n if ((data[name] ?? false) !== false) {\n continue;\n }\n\n const current = value?.() ?? '';\n\n if (current === false) {\n data[name] = '';\n continue;\n }\n\n switch (name) {\n case 'type': {\n data[name] = current;\n break;\n }\n\n default: {\n terminal(`Please enter ${labels[name] || name}${current ? ` [${current}]` : ''}: `);\n\n const input = await this.getInput({\n history,\n autoComplete,\n autoCompleteMenu: true,\n });\n\n terminal('\\n');\n\n if (input) {\n if (input === 'none') {\n data[name] = '';\n } else {\n history.push(input);\n data[name] = input;\n }\n } else {\n history.push(current);\n data[name] = current;\n }\n }\n }\n }\n\n for (const [name, processor] of Object.entries(post) as [DataBits, (value: string) => string][]) {\n data[name] = processor(data[name] || '');\n }\n\n for (const [name, keys] of Object.entries(mapping)) {\n terminal.white(`${ucFirst(name)} data: `).cyan(JSON.stringify(pick(data, keys), null, 2)).cyan('\\n');\n }\n\n return data;\n }\n\n protected async getInput(options: Terminal.InputFieldOptions) {\n const { abort, promise } = terminal.inputField({\n ...options,\n cancelable: true,\n });\n const handler = (name: string, matches: string[]) => {\n if ((matches.indexOf('CTRL_C') >= 0) || (matches.indexOf('CTRL_D') >= 0)) {\n console.log(name.replace('CTRL_', '^'))\n terminal.off('key', handler);\n abort();\n process.exit();\n }\n };\n terminal.on('key', handler);\n\n return await promise;\n }\n\n protected async walk(directory: string, consumer: (entry: string) => Promise<void | boolean>) {\n const dir = await opendir(directory, { encoding: 'utf-8' });\n\n for await (const entry of dir) {\n const pathname = join(entry.parentPath, entry.name);\n\n if (entry.isFile()) {\n if (false === await consumer(pathname)) {\n break;\n }\n } else if (entry.isDirectory()) {\n if (entry.name === '.' || entry.name === '..') {\n continue;\n }\n\n await this.walk(pathname, consumer);\n }\n }\n }\n\n protected async findRoot(directory: string): Promise<string> {\n try {\n const json = JSON.parse((await readFile(join(directory, 'package.json'))).toString());\n\n if (json?.name !== '@ankhzet/starter') {\n // noinspection ExceptionCaughtLocallyJS\n throw new Error();\n }\n\n return directory;\n } catch (e) {\n const base = dirname(directory);\n\n if (base !== directory) {\n return this.findRoot(base);\n }\n\n throw new Error('Failed to find root directory');\n }\n }\n}\n","export enum LogLevels {\n All,\n Info,\n Warning,\n Error,\n}\n\nexport type LogLevel = LogLevels.Info | LogLevels.Warning | LogLevels.Error;\n\nconst map: Record<LogLevel, 'info' | 'warn' | 'error'> = {\n [LogLevels.Info]: 'info',\n [LogLevels.Warning]: 'warn',\n [LogLevels.Error]: 'error',\n}\n\nexport class Logger {\n public level: LogLevels;\n readonly #map: Record<LogLevel, (...data: any) => void>;\n\n public constructor(level: LogLevels = LogLevels.All) {\n this.level = level;\n this.#map = Object.fromEntries(Object.entries(map).map(([level, name]) => (\n [level, console[name].bind(console)]\n ))) as Record<LogLevel, (...data: any) => void>;\n }\n\n public setLevel(level: LogLevels) {\n this.level = level;\n }\n\n public log(level: LogLevel, ...data: any[]) {\n if (level < this.level) {\n return;\n }\n\n const logger = this.#map[level];\n\n if (logger) {\n logger(...data);\n }\n }\n}\n","import type { CommandLineStringParameter , CommandLineRemainder } from '@rushstack/ts-command-line';\nimport { CommandLineAction } from '@rushstack/ts-command-line';\nimport type { Logger } from './Logger';\nimport { Creator } from './Creator';\nimport { LogLevels } from './Logger';\n\nexport class CreateAction extends CommandLineAction {\n declare private _name: CommandLineStringParameter;\n declare private _target: CommandLineRemainder;\n\n readonly #logger: Logger;\n\n public constructor(logger: Logger) {\n super({\n actionName: 'create',\n summary: 'Create a package from template',\n documentation: 'Choose package options and scaffold complete directory structure'\n });\n this.#logger = logger;\n }\n\n protected async onExecuteAsync(): Promise<void> {\n try {\n await (new Creator(this._name.value!, this._target.values.join(' '))).run()\n } catch (e) {\n if (e && e instanceof Error) {\n this.#logger.log(LogLevels.Error, e.stack);\n } else if (e === 'abort') {\n return;\n }\n\n throw e;\n }\n }\n\n protected onDefineParameters(): void {\n this._name = this.defineStringParameter({\n parameterLongName: '--name',\n parameterShortName: '-n',\n argumentName: 'NAME',\n description: 'Package name',\n required: true,\n });\n this._target = this.defineCommandLineRemainder({\n description: 'Target directory',\n });\n }\n}\n","import type { CommandLineFlagParameter } from '@rushstack/ts-command-line';\nimport { CommandLineParser } from '@rushstack/ts-command-line';\nimport { CreateAction } from './CreateAction';\nimport { Logger, LogLevels } from './Logger';\n\nexport class CLI extends CommandLineParser {\n readonly #logger: Logger;\n declare private _verbose: CommandLineFlagParameter;\n\n public constructor() {\n super({\n toolFilename: 'starter',\n toolDescription: 'Scaffold a package.'\n });\n this.#logger = new Logger();\n\n this.addAction(new CreateAction(this.#logger));\n this._verbose = this.defineFlagParameter({\n parameterLongName: '--verbose',\n parameterShortName: '-v',\n description: 'Verbose output to console (info)'\n });\n }\n\n protected onExecuteAsync(): Promise<void> {\n this.#logger.setLevel(this._verbose.value ? LogLevels.All : LogLevels.Warning);\n return super.onExecuteAsync();\n }\n}\n","import { CLI } from './CLI';\n\nawait (new CLI()).executeAsync();\n"],"mappings":";;;;;;;AAEA,IAAa,IAAb,MAAmB;CACf;CACA;CACA;CAEA,YAAmB,GAAa;EAM5B,AALA,KAAKC,KAAO,GACZ,KAAKC,KAAS,QAAQ,IAAI,SAAS,WACnC,KAAKF,KAAW,KAAK,WAAW,GAEhC,KAAK,KAAK,QAAQ,GAClB,KAAK,KAAK,QAAQ;CACtB;CAEA,aAA+B;EAC3B,IAAM,IAAO,QAAQ,IAAI,MAEnB,IAAM,EAAS,GADN,KAAKE,GAAO,mBACD;GACtB,KAAK,KAAKD;GACV,OAAO,KAAKC;GACZ,KAAK,QAAQ;GACb,UAAU;EACd,CAAC,EAAE,SAAS,GAEN,IAAU,CAAC,GAAG,IAAI,KACnB,EAAI,MAAM,iCAAiC,KAAK,CAAC,GAC7C,KAAK,MAAW,EAAO,MAAM,uBAAuB,IAAI,EAAE,EAC1D,QAAQ,MAAyB,CAAC,EAAE,KAAQ,EAAK,OAAO,IAAI,EAC5D,KAAK,MAAS,KAAK,IAAO,EAAK,QAAQ,GAAM,GAAG,IAAI,GAAM,CAClE,CAAC;EAEF,OAAO,EAAQ,KAAK,MAAM,KAAK,EAAQ,SAAS,SAAS;CAC7D;CAEA,UAAiB,GAAoB;EACjC,KAAK,IAAM,KAAW,GAClB,KAAK,KAAK,CAAO;CAEzB;CAEA,KAAY,GAAyB;EACjC,OAAO,EAAS,KAAKF,KAAW,GAAS;GACrC,KAAK,KAAKC;GACV,OAAO,KAAKC;GACZ,KAAK,QAAQ;GACb,OAAO;GACP,UAAU;EACd,CAAC;CACL;AACJ,GC3CM,IAAW,EAAI,UACf,IAAsC;CACxC,QAAQ,CAAC,MA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,cDGc,EAAkB;CACvC;CAGA,cAAqB;EAQjB,AAPA,MAAM;GACF,cAAc;GACd,iBAAiB;EACrB,CAAC,GACD,KAAKC,KAAU,IAAI,EAAO,GAE1B,KAAK,UAAU,IAAI,EAAa,KAAKA,EAAO,CAAC,GAC7C,KAAK,WAAW,KAAK,oBAAoB;GACrC,mBAAmB;GACnB,oBAAoB;GACpB,aAAa;EACjB,CAAC;CACL;CAEA,iBAA0C;EAEtC,OADA,KAAKA,GAAQ,SAAS,KAAK,SAAS,QAAQ,EAAU,MAAM,EAAU,OAAO,GACtE,MAAM,eAAe;CAChC;AACJ,EC1Be,EAAG,aAAa"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ankhzet/starter",
3
- "version": "1.3.0",
3
+ "version": "1.4.0",
4
4
  "author": "AnkhZet ankhzet@gmail.com",
5
5
  "description": "AnkhZet package starter kit",
6
6
  "license": "MIT",
@@ -12,7 +12,7 @@
12
12
  "src/**/*.ts",
13
13
  "src/**/*.tsx",
14
14
  ".templates/**",
15
- "build",
15
+ "dist",
16
16
  "*.md"
17
17
  ],
18
18
  "exports": {
@@ -28,8 +28,8 @@
28
28
  "dependencies": {
29
29
  "@rushstack/ts-command-line": "^5.3.9",
30
30
  "terminal-kit": "^2.11.7",
31
- "@ankhzet/eventual": "1.1.0",
32
- "@ankhzet/utils": "1.17.0"
31
+ "@ankhzet/eventual": "1.2.0",
32
+ "@ankhzet/utils": "1.18.0"
33
33
  },
34
34
  "devDependencies": {
35
35
  "@types/node": "^24.12.2",