@twin.org/cli-core 0.0.1-next.1 → 0.0.1-next.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.
@@ -1,6 +1,6 @@
1
1
  'use strict';
2
2
 
3
- var core = require('@gtsc/core');
3
+ var core = require('@twin.org/core');
4
4
  var commander = require('commander');
5
5
  var node_readline = require('node:readline');
6
6
  var node_util = require('node:util');
@@ -10,7 +10,7 @@ var dotenv = require('dotenv');
10
10
  var node_child_process = require('node:child_process');
11
11
  var node_fs = require('node:fs');
12
12
  var promises = require('node:fs/promises');
13
- var crypto = require('@gtsc/crypto');
13
+ var crypto = require('@twin.org/crypto');
14
14
 
15
15
  function _interopNamespaceDefault(e) {
16
16
  var n = Object.create(null);
@@ -1,4 +1,4 @@
1
- import { I18n, ErrorHelper, Is, Coerce, ObjectHelper, GeneralError, Guards, Url, Converter } from '@gtsc/core';
1
+ import { I18n, ErrorHelper, Is, Coerce, ObjectHelper, GeneralError, Guards, Url, Converter } from '@twin.org/core';
2
2
  import { Command } from 'commander';
3
3
  import { clearLine, cursorTo } from 'node:readline';
4
4
  import { inspect } from 'node:util';
@@ -8,7 +8,7 @@ import * as dotenv from 'dotenv';
8
8
  import { exec, spawn } from 'node:child_process';
9
9
  import { statSync, accessSync, readFileSync } from 'node:fs';
10
10
  import { stat, access, readFile, mkdir, writeFile } from 'node:fs/promises';
11
- import { Bech32 } from '@gtsc/crypto';
11
+ import { Bech32 } from '@twin.org/crypto';
12
12
 
13
13
  // Copyright 2024 IOTA Stiftung.
14
14
  // SPDX-License-Identifier: Apache-2.0.
package/docs/changelog.md CHANGED
@@ -1,5 +1,5 @@
1
1
  # @twin.org/cli-core - Changelog
2
2
 
3
- ## v0.0.1
3
+ ## 0.0.1-next.1
4
4
 
5
5
  - Initial Release
@@ -1,7 +1,3 @@
1
- [**@twin.org/cli-core**](../overview.md) • **Docs**
2
-
3
- ***
4
-
5
1
  # Class: `abstract` CLIBase
6
2
 
7
3
  The main entry point for the CLI.
@@ -1,7 +1,3 @@
1
- [**@twin.org/cli-core**](../overview.md) • **Docs**
2
-
3
- ***
4
-
5
1
  # Class: CLIDisplay
6
2
 
7
3
  Display utilities for the CLI.
@@ -104,7 +100,7 @@ Display an error message.
104
100
 
105
101
  The error to display.
106
102
 
107
- • **lineBreaks**: `boolean`= `true`
103
+ • **lineBreaks**: `boolean` = `true`
108
104
 
109
105
  Whether to add a line break after the error.
110
106
 
@@ -148,7 +144,7 @@ The label for the value.
148
144
 
149
145
  The value to display.
150
146
 
151
- • **indentLevel**: `number`= `0`
147
+ • **indentLevel**: `number` = `0`
152
148
 
153
149
  The level of indentation.
154
150
 
@@ -230,15 +226,15 @@ Start the spinner.
230
226
 
231
227
  #### Parameters
232
228
 
233
- • **i18nMessage**: `string`= `"cli.progress.pleaseWait"`
229
+ • **i18nMessage**: `string` = `"cli.progress.pleaseWait"`
234
230
 
235
231
  The message to display with the spinner.
236
232
 
237
- • **spinnerCharacters**: `string`[]= `undefined`
233
+ • **spinnerCharacters**: `string`[] = `...`
238
234
 
239
235
  The characters to use in the spinner.
240
236
 
241
- • **interval**: `number`= `100`
237
+ • **interval**: `number` = `100`
242
238
 
243
239
  The interval for the spinner.
244
240
 
@@ -1,7 +1,3 @@
1
- [**@twin.org/cli-core**](../overview.md) • **Docs**
2
-
3
- ***
4
-
5
1
  # Class: CLIOptions
6
2
 
7
3
  Utilities for getting standard options.
@@ -1,7 +1,3 @@
1
- [**@twin.org/cli-core**](../overview.md) • **Docs**
2
-
3
- ***
4
-
5
1
  # Class: CLIParam
6
2
 
7
3
  Parameter utilities for the CLI.
@@ -66,7 +62,7 @@ The name of the option.
66
62
 
67
63
  The option value.
68
64
 
69
- • **allowEnvVar**: `boolean`= `true`
65
+ • **allowEnvVar**: `boolean` = `true`
70
66
 
71
67
  Allow the option to be read from an env var.
72
68
 
@@ -98,7 +94,7 @@ The name of the option.
98
94
 
99
95
  The option value.
100
96
 
101
- • **allowEnvVar**: `boolean`= `true`
97
+ • **allowEnvVar**: `boolean` = `true`
102
98
 
103
99
  Allow the option to be read from an env var.
104
100
 
@@ -130,11 +126,11 @@ The name of the option.
130
126
 
131
127
  The option value.
132
128
 
133
- • **allowEnvVar**: `boolean`= `true`
129
+ • **allowEnvVar**: `boolean` = `true`
134
130
 
135
131
  Allow the option to be read from an env var.
136
132
 
137
- • **minValue**: `number`= `0`
133
+ • **minValue**: `number` = `0`
138
134
 
139
135
  The minimum value.
140
136
 
@@ -170,11 +166,11 @@ The name of the option.
170
166
 
171
167
  The option value.
172
168
 
173
- • **allowEnvVar**: `boolean`= `true`
169
+ • **allowEnvVar**: `boolean` = `true`
174
170
 
175
171
  Allow the option to be read from an env var.
176
172
 
177
- • **minValue**: `number`= `0`
173
+ • **minValue**: `number` = `0`
178
174
 
179
175
  The minimum value.
180
176
 
@@ -210,11 +206,11 @@ The name of the option.
210
206
 
211
207
  The option value.
212
208
 
213
- • **allowEnvVar**: `boolean`= `true`
209
+ • **allowEnvVar**: `boolean` = `true`
214
210
 
215
211
  Allow the option to be read from an env var.
216
212
 
217
- • **minValue**: `bigint`= `undefined`
213
+ • **minValue**: `bigint` = `...`
218
214
 
219
215
  The minimum value.
220
216
 
@@ -250,7 +246,7 @@ The name of the option.
250
246
 
251
247
  The option value.
252
248
 
253
- • **allowEnvVar**: `boolean`= `true`
249
+ • **allowEnvVar**: `boolean` = `true`
254
250
 
255
251
  Allow the option to be read from an env var.
256
252
 
@@ -282,7 +278,7 @@ The name of the option.
282
278
 
283
279
  The option value.
284
280
 
285
- • **allowEnvVar**: `boolean`= `true`
281
+ • **allowEnvVar**: `boolean` = `true`
286
282
 
287
283
  Allow the option to be read from an env var.
288
284
 
@@ -314,7 +310,7 @@ The name of the option.
314
310
 
315
311
  The option value.
316
312
 
317
- • **allowEnvVar**: `boolean`= `true`
313
+ • **allowEnvVar**: `boolean` = `true`
318
314
 
319
315
  Allow the option to be read from an env var.
320
316
 
@@ -346,7 +342,7 @@ The name of the option.
346
342
 
347
343
  The option value.
348
344
 
349
- • **allowEnvVar**: `boolean`= `true`
345
+ • **allowEnvVar**: `boolean` = `true`
350
346
 
351
347
  Allow the option to be read from an env var.
352
348
 
@@ -378,7 +374,7 @@ The name of the option.
378
374
 
379
375
  The option value.
380
376
 
381
- • **allowEnvVar**: `boolean`= `true`
377
+ • **allowEnvVar**: `boolean` = `true`
382
378
 
383
379
  Allow the option to be read from an env var.
384
380
 
@@ -1,7 +1,3 @@
1
- [**@twin.org/cli-core**](../overview.md) • **Docs**
2
-
3
- ***
4
-
5
1
  # Class: CLIUtils
6
2
 
7
3
  Utilities function for helping in the CLI.
@@ -104,7 +100,7 @@ True if the dir exists.
104
100
 
105
101
  Read a JSON file and parse it.
106
102
 
107
- #### Type parameters
103
+ #### Type Parameters
108
104
 
109
105
  • **T** = `unknown`
110
106
 
@@ -128,7 +124,7 @@ The parsed JSON.
128
124
 
129
125
  Read a JSON file and parse it, synchronously.
130
126
 
131
- #### Type parameters
127
+ #### Type Parameters
132
128
 
133
129
  • **T** = `unknown`
134
130
 
@@ -240,7 +236,7 @@ Promise to wait for command execution to complete.
240
236
 
241
237
  Write a JSON file.
242
238
 
243
- #### Type parameters
239
+ #### Type Parameters
244
240
 
245
241
  • **T** = `unknown`
246
242
 
@@ -1,7 +1,3 @@
1
- [**@twin.org/cli-core**](../overview.md) • **Docs**
2
-
3
- ***
4
-
5
1
  # Function: addGlobalOptions()
6
2
 
7
3
  > **addGlobalOptions**(`program`, `supportsLang`, `supportsEnvFiles`): `void`
@@ -1,7 +1,3 @@
1
- [**@twin.org/cli-core**](../overview.md) • **Docs**
2
-
3
- ***
4
-
5
1
  # Function: initGlobalOptions()
6
2
 
7
3
  > **initGlobalOptions**(`localesDirectory`): `void`
@@ -1,7 +1,3 @@
1
- [**@twin.org/cli-core**](overview.md) • **Docs**
2
-
3
- ***
4
-
5
1
  # @twin.org/cli-core
6
2
 
7
3
  ## Classes
@@ -1,7 +1,3 @@
1
- [**@twin.org/cli-core**](../overview.md) • **Docs**
2
-
3
- ***
4
-
5
1
  # Interface: ICliOptions
6
2
 
7
3
  Options for the CLI.
@@ -1,7 +1,3 @@
1
- [**@twin.org/cli-core**](../overview.md) • **Docs**
2
-
3
- ***
4
-
5
1
  # Interface: ICliOutputOptionsConsole
6
2
 
7
3
  Options for the CLI Output for console.
@@ -1,7 +1,3 @@
1
- [**@twin.org/cli-core**](../overview.md) • **Docs**
2
-
3
- ***
4
-
5
1
  # Interface: ICliOutputOptionsEnv
6
2
 
7
3
  Options for the CLI Output for env.
@@ -1,7 +1,3 @@
1
- [**@twin.org/cli-core**](../overview.md) • **Docs**
2
-
3
- ***
4
-
5
1
  # Interface: ICliOutputOptionsJson
6
2
 
7
3
  Options for the CLI Output for JSON.
@@ -1,8 +1,4 @@
1
- [**@twin.org/cli-core**](../overview.md) **Docs**
2
-
3
- ***
4
-
5
- # Type alias: CliOutputOptions
1
+ # Type Alias: CliOutputOptions
6
2
 
7
3
  > **CliOutputOptions**: [`ICliOutputOptionsConsole`](../interfaces/ICliOutputOptionsConsole.md) & [`ICliOutputOptionsEnv`](../interfaces/ICliOutputOptionsEnv.md) & [`ICliOutputOptionsJson`](../interfaces/ICliOutputOptionsJson.md)
8
4
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@twin.org/cli-core",
3
- "version": "0.0.1-next.1",
3
+ "version": "0.0.1-next.2",
4
4
  "description": "Core classes for building a CLI",
5
5
  "repository": {
6
6
  "type": "git",
@@ -16,7 +16,7 @@
16
16
  "scripts": {
17
17
  "clean": "rimraf dist coverage",
18
18
  "build": "tspc",
19
- "merge-locales": "merge-locales",
19
+ "merge-locales": "copyfiles locales/en.json dist",
20
20
  "test": "vitest --run --config ./vitest.config.ts --no-cache",
21
21
  "coverage": "vitest --run --coverage --config ./vitest.config.ts --no-cache",
22
22
  "bundle:esm": "rollup --config rollup.config.mjs --environment MODULE:esm",
@@ -28,15 +28,14 @@
28
28
  "dist": "npm run clean && npm run build && npm run merge-locales && npm run test && npm run bundle && npm run docs"
29
29
  },
30
30
  "dependencies": {
31
- "@twin.org/core": "0.0.1-next.1",
32
- "@twin.org/crypto": "0.0.1-next.1",
31
+ "@twin.org/core": "0.0.1-next.2",
32
+ "@twin.org/crypto": "0.0.1-next.2",
33
33
  "@twin.org/nameof": "next",
34
34
  "chalk": "5.3.0",
35
35
  "commander": "12.1.0",
36
36
  "dotenv": "16.4.5"
37
37
  },
38
38
  "devDependencies": {
39
- "@gtsc/merge-locales": "next",
40
39
  "@twin.org/nameof-transformer": "next",
41
40
  "@types/node": "22.5.5",
42
41
  "@vitest/coverage-v8": "2.1.1",