@ama-openapi/create 14.0.0 → 14.0.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.
- package/package.json +13 -10
- package/src/generate-template.d.ts +4 -0
- package/src/generate-template.js +2 -2
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ama-openapi/create",
|
|
3
|
-
"version": "14.0.
|
|
3
|
+
"version": "14.0.3",
|
|
4
4
|
"publishConfig": {
|
|
5
5
|
"access": "public"
|
|
6
6
|
},
|
|
@@ -8,10 +8,13 @@
|
|
|
8
8
|
"keywords": [
|
|
9
9
|
"create"
|
|
10
10
|
],
|
|
11
|
-
"
|
|
11
|
+
"preferUnplugged": true,
|
|
12
|
+
"main": "./src/public_api.js",
|
|
13
|
+
"types": "./src/public_api.d.ts",
|
|
12
14
|
"exports": {
|
|
13
15
|
".": {
|
|
14
|
-
"default": "./src/
|
|
16
|
+
"default": "./src/public_api.js",
|
|
17
|
+
"types": "./src/public_api.d.ts"
|
|
15
18
|
},
|
|
16
19
|
"./package.json": {
|
|
17
20
|
"default": "./package.json"
|
|
@@ -27,7 +30,7 @@
|
|
|
27
30
|
"postbuild": "cpy 'package.json' 'dist' && patch-package-json-main"
|
|
28
31
|
},
|
|
29
32
|
"peerDependencies": {
|
|
30
|
-
"@o3r/telemetry": "~14.0.
|
|
33
|
+
"@o3r/telemetry": "~14.0.3",
|
|
31
34
|
"type-fest": "^5.3.1"
|
|
32
35
|
},
|
|
33
36
|
"peerDependenciesMeta": {
|
|
@@ -39,7 +42,7 @@
|
|
|
39
42
|
}
|
|
40
43
|
},
|
|
41
44
|
"dependencies": {
|
|
42
|
-
"@ama-openapi/core": "~14.0.
|
|
45
|
+
"@ama-openapi/core": "~14.0.3",
|
|
43
46
|
"ejs": "~3.1.9",
|
|
44
47
|
"globby": "^11.1.0",
|
|
45
48
|
"tslib": "^2.6.2",
|
|
@@ -52,11 +55,11 @@
|
|
|
52
55
|
"@nx/eslint-plugin": "~22.3.3",
|
|
53
56
|
"@nx/jest": "~22.3.3",
|
|
54
57
|
"@nx/js": "~22.3.3",
|
|
55
|
-
"@o3r/build-helpers": "~14.0.
|
|
56
|
-
"@o3r/eslint-config": "~14.0.
|
|
57
|
-
"@o3r/eslint-plugin": "~14.0.
|
|
58
|
-
"@o3r/telemetry": "~14.0.
|
|
59
|
-
"@o3r/test-helpers": "~14.0.
|
|
58
|
+
"@o3r/build-helpers": "~14.0.3",
|
|
59
|
+
"@o3r/eslint-config": "~14.0.3",
|
|
60
|
+
"@o3r/eslint-plugin": "~14.0.3",
|
|
61
|
+
"@o3r/telemetry": "~14.0.3",
|
|
62
|
+
"@o3r/test-helpers": "~14.0.3",
|
|
60
63
|
"@schematics/angular": "~21.0.2",
|
|
61
64
|
"@stylistic/eslint-plugin": "~5.6.0",
|
|
62
65
|
"@types/ejs": "^3.1.2",
|
|
@@ -12,6 +12,10 @@ export interface CreateOptions {
|
|
|
12
12
|
packageName: string;
|
|
13
13
|
/** Logger */
|
|
14
14
|
logger: typeof console;
|
|
15
|
+
/** Directory containing the templates */
|
|
16
|
+
templatesDirectory?: string;
|
|
17
|
+
/** Additional properties to be used in templates */
|
|
18
|
+
[key: string]: any;
|
|
15
19
|
}
|
|
16
20
|
/**
|
|
17
21
|
* Generate Template files
|
package/src/generate-template.js
CHANGED
|
@@ -33,7 +33,7 @@ const getGitIgnoreContent = async (options) => {
|
|
|
33
33
|
*/
|
|
34
34
|
const generateTemplate = async (options) => {
|
|
35
35
|
const { generatorDependencies, engines } = JSON.parse(await node_fs_1.promises.readFile((0, node_path_1.resolve)(__dirname, '..', 'package.json'), { encoding: 'utf8' }));
|
|
36
|
-
const templatesDirectory = (0, node_path_1.resolve)(__dirname, '..', 'templates');
|
|
36
|
+
const templatesDirectory = options.templatesDirectory || (0, node_path_1.resolve)(__dirname, '..', 'templates');
|
|
37
37
|
const regExpExtension = new RegExp(`\\${TEMPLATE_EXTENSION}$`);
|
|
38
38
|
const exportedFiles = [
|
|
39
39
|
'bundle',
|
|
@@ -62,7 +62,7 @@ const generateTemplate = async (options) => {
|
|
|
62
62
|
const outputPath = (0, node_path_1.resolve)(options.target, templatePath.replace(regExpExtension, ''));
|
|
63
63
|
const outputDirectory = (0, node_path_1.dirname)(outputPath);
|
|
64
64
|
if (!(0, node_fs_1.existsSync)(outputDirectory)) {
|
|
65
|
-
await node_fs_1.promises.mkdir(
|
|
65
|
+
await node_fs_1.promises.mkdir(outputDirectory, { recursive: true });
|
|
66
66
|
}
|
|
67
67
|
await node_fs_1.promises.writeFile(outputPath, content, { encoding: 'utf8' });
|
|
68
68
|
});
|