elrh-cosca 0.2.2 → 0.2.4
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/README.md +16 -0
- package/dist/elrh-cosca.mjs +14 -0
- package/dist/types/functions/create-file-from-web-template.d.ts +1 -1
- package/dist/types/main.d.ts +3 -1
- package/dist/types/terminal/show-error.d.ts +1 -0
- package/dist/types/terminal/show-message.d.ts +1 -0
- package/package.json +1 -1
- package/test/cosca-test.js +7 -1
package/README.md
CHANGED
|
@@ -115,6 +115,22 @@ async function promptUser(question: string): Promise<boolean>
|
|
|
115
115
|
|
|
116
116
|
Prints out a `question` to the console and waits for the input. Returns `true` when `y` is pressed and `false` otherwise.
|
|
117
117
|
|
|
118
|
+
#### `showMessage`
|
|
119
|
+
|
|
120
|
+
```ts
|
|
121
|
+
async function showMessage(message: string, newlines: number = 1): Promise<void>
|
|
122
|
+
```
|
|
123
|
+
|
|
124
|
+
Prints out a `message` to `process.stdout` and adds the specified number of newlines after it (default is 1).
|
|
125
|
+
|
|
126
|
+
#### `showError`
|
|
127
|
+
|
|
128
|
+
```ts
|
|
129
|
+
async function showError(message: string, newlines: number = 1): Promise<void>
|
|
130
|
+
```
|
|
131
|
+
|
|
132
|
+
Prints out a `message` to `process.stderr` and adds the specified number of newlines after it (default is 1).
|
|
133
|
+
|
|
118
134
|
### List of other utils
|
|
119
135
|
|
|
120
136
|
#### `parseQualifiedPath`
|
package/dist/elrh-cosca.mjs
CHANGED
|
@@ -16401,12 +16401,26 @@ async function jl(a, l, i = !1) {
|
|
|
16401
16401
|
} else
|
|
16402
16402
|
console.log(`Updating '${a}' skipped.`);
|
|
16403
16403
|
}
|
|
16404
|
+
function Rl(a, l = 1) {
|
|
16405
|
+
process.stderr.write(a);
|
|
16406
|
+
for (let i = 0; i < l; i++)
|
|
16407
|
+
process.stderr.write(`
|
|
16408
|
+
`);
|
|
16409
|
+
}
|
|
16410
|
+
function Ul(a, l = 1) {
|
|
16411
|
+
process.stdout.write(a);
|
|
16412
|
+
for (let i = 0; i < l; i++)
|
|
16413
|
+
process.stdout.write(`
|
|
16414
|
+
`);
|
|
16415
|
+
}
|
|
16404
16416
|
export {
|
|
16405
16417
|
Il as createFileFromTemplate,
|
|
16406
16418
|
Nl as createFileFromWebTemplate,
|
|
16407
16419
|
Ia as parseQualifiedPath,
|
|
16408
16420
|
Qe as promptUser,
|
|
16409
16421
|
Na as resolvePackagePath,
|
|
16422
|
+
Rl as showError,
|
|
16423
|
+
Ul as showMessage,
|
|
16410
16424
|
Bl as updateConfigFile,
|
|
16411
16425
|
_l as updateJsonFile,
|
|
16412
16426
|
jl as updateTextFile
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare function createFileFromWebTemplate(
|
|
1
|
+
export declare function createFileFromWebTemplate(url: string, targetFile: string, force?: boolean): Promise<void>;
|
package/dist/types/main.d.ts
CHANGED
|
@@ -4,6 +4,8 @@ import { updateConfigFile } from './functions/update-config-file';
|
|
|
4
4
|
import { updateJsonFile } from './functions/update-json-file';
|
|
5
5
|
import { updateTextFile } from './functions/update-text-file';
|
|
6
6
|
import { promptUser } from './terminal/prompt-user';
|
|
7
|
+
import { showError } from './terminal/show-error';
|
|
8
|
+
import { showMessage } from './terminal/show-message';
|
|
7
9
|
import { parseQualifiedPath } from './utils/parse-qualified-path';
|
|
8
10
|
import { resolvePackagePath } from './utils/resolve-package-path';
|
|
9
|
-
export { createFileFromTemplate, createFileFromWebTemplate, updateConfigFile, updateJsonFile, updateTextFile, promptUser, parseQualifiedPath, resolvePackagePath, };
|
|
11
|
+
export { createFileFromTemplate, createFileFromWebTemplate, updateConfigFile, updateJsonFile, updateTextFile, promptUser, showError, showMessage, parseQualifiedPath, resolvePackagePath, };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function showError(message: string, linesAfter?: number): void;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function showMessage(message: string, linesAfter?: number): void;
|
package/package.json
CHANGED
package/test/cosca-test.js
CHANGED
|
@@ -3,10 +3,16 @@
|
|
|
3
3
|
// manual test script for COSCA functions
|
|
4
4
|
|
|
5
5
|
import {
|
|
6
|
-
createFileFromTemplate, createFileFromWebTemplate, promptUser,
|
|
6
|
+
createFileFromTemplate, createFileFromWebTemplate, promptUser, showError, showMessage,
|
|
7
|
+
updateConfigFile, updateJsonFile, updateTextFile
|
|
7
8
|
} from '../dist/elrh-cosca.mjs'
|
|
8
9
|
|
|
9
10
|
async function main() {
|
|
11
|
+
console.log('Test showMessage')
|
|
12
|
+
showMessage('Hello!')
|
|
13
|
+
console.log('Test showMessage')
|
|
14
|
+
showError('ERROR!')
|
|
15
|
+
|
|
10
16
|
console.log('Test promptUser')
|
|
11
17
|
const input = await promptUser('Is it today?')
|
|
12
18
|
console.log('User input:', input)
|