elrh-cosca 0.2.1 → 0.2.3
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.
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function fetchFile(url: string): Promise<string>;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function createFileFromWebTemplate(webSource: string, targetFile: string, force?: boolean): Promise<void>;
|
package/dist/types/main.d.ts
CHANGED
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
import { createFileFromTemplate } from './functions/create-file-from-template';
|
|
2
|
+
import { createFileFromWebTemplate } from './functions/create-file-from-web-template';
|
|
2
3
|
import { updateConfigFile } from './functions/update-config-file';
|
|
3
4
|
import { updateJsonFile } from './functions/update-json-file';
|
|
4
5
|
import { updateTextFile } from './functions/update-text-file';
|
|
5
6
|
import { promptUser } from './terminal/prompt-user';
|
|
6
7
|
import { parseQualifiedPath } from './utils/parse-qualified-path';
|
|
7
8
|
import { resolvePackagePath } from './utils/resolve-package-path';
|
|
8
|
-
export { createFileFromTemplate, updateConfigFile, updateJsonFile, updateTextFile, promptUser, parseQualifiedPath, resolvePackagePath, };
|
|
9
|
+
export { createFileFromTemplate, createFileFromWebTemplate, updateConfigFile, updateJsonFile, updateTextFile, promptUser, parseQualifiedPath, resolvePackagePath, };
|
package/package.json
CHANGED
package/test/cosca-test.js
CHANGED
|
@@ -1,12 +1,18 @@
|
|
|
1
|
-
#!/usr/bin/env node
|
|
1
|
+
#!/usr/bin/env node
|
|
2
2
|
|
|
3
3
|
// manual test script for COSCA functions
|
|
4
4
|
|
|
5
|
-
import {
|
|
6
|
-
createFileFromTemplate, promptUser,
|
|
5
|
+
import {
|
|
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)
|
|
@@ -14,6 +20,9 @@ async function main() {
|
|
|
14
20
|
console.log('\nTest createFileFromTemplate')
|
|
15
21
|
await createFileFromTemplate('vitest:README.md', 'test/snapshots/test.file1')
|
|
16
22
|
await createFileFromTemplate('elrh-cosca:test/fixtures/text-file.txt', 'test/snapshots/test.file2')
|
|
23
|
+
|
|
24
|
+
console.log('\nTest createFileFromWebTemplate')
|
|
25
|
+
await createFileFromWebTemplate('https://raw.githubusercontent.com/AloisSeckar/nuxt-spec/refs/heads/main/config/vitest.config.ts.template', 'test/snapshots/test.file3')
|
|
17
26
|
|
|
18
27
|
console.log('\nTest updateConfigFile')
|
|
19
28
|
await updateConfigFile('test/fixtures/config-file-default.ts', { compatibilityDate: '2025-08-26', extends: ['nuxt-iignis'], cosca: { exists: true, data: ['some', 'other'], raw: 'war' } })
|
|
@@ -26,6 +35,6 @@ async function main() {
|
|
|
26
35
|
}
|
|
27
36
|
|
|
28
37
|
main().catch((err) => {
|
|
29
|
-
console.error(
|
|
38
|
+
console.error(err)
|
|
30
39
|
process.exit(1)
|
|
31
40
|
})
|