@ama-sdk/schematics 12.5.0-prerelease.3 → 12.5.0-prerelease.30
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 +18 -21
- package/schematics/ng-add/index.d.ts.map +1 -1
- package/schematics/ng-add/index.js +43 -27
- package/schematics/ng-update/typescript/v12.3/coverage-ignore.js +1 -1
- package/schematics/typescript/core/openapi-codegen-typescript/target/typescriptFetch-openapi-generator-tests.jar +0 -0
- package/schematics/typescript/core/openapi-codegen-typescript/target/typescriptFetch-openapi-generator.jar +0 -0
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ama-sdk/schematics",
|
|
3
|
-
"version": "12.5.0-prerelease.
|
|
3
|
+
"version": "12.5.0-prerelease.30",
|
|
4
4
|
"publishConfig": {
|
|
5
5
|
"access": "public"
|
|
6
6
|
},
|
|
@@ -54,9 +54,6 @@
|
|
|
54
54
|
"@openapitools/openapi-generator-cli": {
|
|
55
55
|
"optional": true
|
|
56
56
|
},
|
|
57
|
-
"openapi-types": {
|
|
58
|
-
"optional": true
|
|
59
|
-
},
|
|
60
57
|
"type-fest": {
|
|
61
58
|
"optional": true
|
|
62
59
|
},
|
|
@@ -65,12 +62,12 @@
|
|
|
65
62
|
}
|
|
66
63
|
},
|
|
67
64
|
"peerDependencies": {
|
|
68
|
-
"@ama-sdk/core": "^12.5.0-prerelease.
|
|
65
|
+
"@ama-sdk/core": "^12.5.0-prerelease.30",
|
|
69
66
|
"@angular-devkit/core": "^19.0.0",
|
|
70
67
|
"@angular-devkit/schematics-cli": "^19.0.0",
|
|
71
68
|
"@angular/cli": "^19.0.0",
|
|
72
|
-
"@o3r/schematics": "^12.5.0-prerelease.
|
|
73
|
-
"@o3r/telemetry": "^12.5.0-prerelease.
|
|
69
|
+
"@o3r/schematics": "^12.5.0-prerelease.30",
|
|
70
|
+
"@o3r/telemetry": "^12.5.0-prerelease.30",
|
|
74
71
|
"@openapitools/openapi-generator-cli": "^2.15.0",
|
|
75
72
|
"openapi-types": "^12.0.0",
|
|
76
73
|
"ts-node": "~10.9.2",
|
|
@@ -80,7 +77,7 @@
|
|
|
80
77
|
"dependencies": {
|
|
81
78
|
"@angular-devkit/core": "~19.2.0",
|
|
82
79
|
"@angular-devkit/schematics": "~19.2.0",
|
|
83
|
-
"@o3r/schematics": "^12.5.0-prerelease.
|
|
80
|
+
"@o3r/schematics": "^12.5.0-prerelease.30",
|
|
84
81
|
"chokidar": "^4.0.3",
|
|
85
82
|
"globby": "^11.1.0",
|
|
86
83
|
"js-yaml": "^4.1.0",
|
|
@@ -91,17 +88,17 @@
|
|
|
91
88
|
"tslib": "^2.6.2"
|
|
92
89
|
},
|
|
93
90
|
"devDependencies": {
|
|
94
|
-
"@ama-sdk/core": "^12.5.0-prerelease.
|
|
91
|
+
"@ama-sdk/core": "^12.5.0-prerelease.30",
|
|
95
92
|
"@angular-devkit/schematics-cli": "~19.2.0",
|
|
96
93
|
"@angular/cli": "~19.2.0",
|
|
97
94
|
"@eslint-community/eslint-plugin-eslint-comments": "^4.4.0",
|
|
98
95
|
"@nx/eslint-plugin": "~20.8.0",
|
|
99
96
|
"@nx/jest": "~20.8.0",
|
|
100
|
-
"@o3r/build-helpers": "^12.5.0-prerelease.
|
|
101
|
-
"@o3r/eslint-plugin": "^12.5.0-prerelease.
|
|
102
|
-
"@o3r/telemetry": "^12.5.0-prerelease.
|
|
103
|
-
"@o3r/test-helpers": "^12.5.0-prerelease.
|
|
104
|
-
"@openapitools/openapi-generator-cli": "~2.
|
|
97
|
+
"@o3r/build-helpers": "^12.5.0-prerelease.30",
|
|
98
|
+
"@o3r/eslint-plugin": "^12.5.0-prerelease.30",
|
|
99
|
+
"@o3r/telemetry": "^12.5.0-prerelease.30",
|
|
100
|
+
"@o3r/test-helpers": "^12.5.0-prerelease.30",
|
|
101
|
+
"@openapitools/openapi-generator-cli": "~2.21.0",
|
|
105
102
|
"@schematics/angular": "~19.2.0",
|
|
106
103
|
"@stylistic/eslint-plugin": "~3.1.0",
|
|
107
104
|
"@types/jest": "~29.5.2",
|
|
@@ -111,17 +108,17 @@
|
|
|
111
108
|
"@types/node": "^20.0.0",
|
|
112
109
|
"@types/pid-from-port": "^1.1.0",
|
|
113
110
|
"@types/semver": "^7.3.13",
|
|
114
|
-
"@typescript-eslint/parser": "~8.
|
|
111
|
+
"@typescript-eslint/parser": "~8.35.0",
|
|
115
112
|
"angular-eslint": "~19.4.0",
|
|
116
113
|
"commit-and-tag-version": "^12.0.0",
|
|
117
114
|
"copyfiles": "^2.4.1",
|
|
118
115
|
"cpy-cli": "^5.0.0",
|
|
119
|
-
"eslint": "~9.
|
|
116
|
+
"eslint": "~9.30.0",
|
|
120
117
|
"eslint-import-resolver-node": "~0.3.9",
|
|
121
118
|
"eslint-import-resolver-typescript": "~3.10.0",
|
|
122
|
-
"eslint-plugin-import": "~2.
|
|
119
|
+
"eslint-plugin-import": "~2.32.0",
|
|
123
120
|
"eslint-plugin-import-newlines": "~1.4.0",
|
|
124
|
-
"eslint-plugin-jest": "~28.
|
|
121
|
+
"eslint-plugin-jest": "~28.14.0",
|
|
125
122
|
"eslint-plugin-jsdoc": "~50.8.0",
|
|
126
123
|
"eslint-plugin-prefer-arrow": "~1.2.3",
|
|
127
124
|
"eslint-plugin-unicorn": "~56.0.0",
|
|
@@ -141,16 +138,16 @@
|
|
|
141
138
|
"ts-node": "~10.9.2",
|
|
142
139
|
"type-fest": "^4.30.1",
|
|
143
140
|
"typescript": "~5.8.2",
|
|
144
|
-
"typescript-eslint": "~8.
|
|
141
|
+
"typescript-eslint": "~8.35.0"
|
|
145
142
|
},
|
|
146
143
|
"generatorDependencies": {
|
|
147
|
-
"@angular-eslint/eslint-plugin": "
|
|
144
|
+
"@angular-eslint/eslint-plugin": "~19.2.0",
|
|
148
145
|
"@commitlint/cli": "^19.0.0",
|
|
149
146
|
"@commitlint/config-conventional": "^19.0.0",
|
|
150
147
|
"@swc/cli": "~0.7.7",
|
|
151
148
|
"@swc/core": "~1.12.0",
|
|
152
149
|
"@swc/helpers": "~0.5.0",
|
|
153
|
-
"@typescript-eslint/eslint-plugin": "~8.
|
|
150
|
+
"@typescript-eslint/eslint-plugin": "~8.35.0",
|
|
154
151
|
"jest-junit": "~16.0.0",
|
|
155
152
|
"lint-staged": "^15.0.0",
|
|
156
153
|
"minimist": "^1.2.6",
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../schematics/ng-add/index.ts"],"names":[],"mappings":"AAOA,OAAO,EAGL,IAAI,EAGL,MAAM,4BAA4B,CAAC;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../schematics/ng-add/index.ts"],"names":[],"mappings":"AAOA,OAAO,EAGL,IAAI,EAGL,MAAM,4BAA4B,CAAC;AAqBpC,OAAO,KAAK,EACV,qBAAqB,EACtB,MAAM,UAAU,CAAC;AAqBlB;;;;GAIG;AACH,eAAO,MAAM,wBAAwB,EAAE,IAwCtC,CAAC;AA6GF;;;GAGG;AACH,eAAO,MAAM,KAAK,GAAI,MAAM,qBAAqB,SAAwC,CAAC"}
|
|
@@ -8,17 +8,28 @@ const schematics_1 = require("@angular-devkit/schematics");
|
|
|
8
8
|
const schematics_2 = require("@o3r/schematics");
|
|
9
9
|
const rxjs_1 = require("rxjs");
|
|
10
10
|
const node_install_1 = require("../helpers/node-install");
|
|
11
|
-
const
|
|
11
|
+
const rootPackageJsonPath = '/package.json';
|
|
12
|
+
const schematicsPackageJsonPath = path.resolve(__dirname, '..', '..', 'package.json');
|
|
12
13
|
const swaggerIgnorePath = '/.swagger-codegen-ignore';
|
|
13
14
|
const openApiIgnorePath = '/.openapi-generator-ignore';
|
|
14
15
|
const openApiConfigPath = 'openapitools.json';
|
|
16
|
+
/**
|
|
17
|
+
* List of external dependencies to be added to the project as peer dependencies
|
|
18
|
+
*/
|
|
19
|
+
const dependenciesToInstall = [];
|
|
20
|
+
/**
|
|
21
|
+
* List of external dependencies to be added to the project as dev dependencies
|
|
22
|
+
*/
|
|
23
|
+
const devDependenciesToInstall = [
|
|
24
|
+
'@openapitools/openapi-generator-cli'
|
|
25
|
+
];
|
|
15
26
|
/**
|
|
16
27
|
* Rule to update package.json scripts using yeoman generator from `@ama-sdk/generator-sdk`
|
|
17
28
|
* @param tree Tree
|
|
18
29
|
* @param context SchematicContext
|
|
19
30
|
*/
|
|
20
31
|
const updatePackageJsonScripts = (tree, context) => {
|
|
21
|
-
const packageJson = tree.readJson(
|
|
32
|
+
const packageJson = tree.readJson(rootPackageJsonPath);
|
|
22
33
|
if (!(0, core_1.isJsonObject)(packageJson)) {
|
|
23
34
|
context.logger.error('Failed to read correctly the package.json');
|
|
24
35
|
return tree;
|
|
@@ -42,7 +53,7 @@ const updatePackageJsonScripts = (tree, context) => {
|
|
|
42
53
|
return acc;
|
|
43
54
|
}, packageJson.scripts);
|
|
44
55
|
packageJson.scripts = scripts;
|
|
45
|
-
tree.overwrite(
|
|
56
|
+
tree.overwrite(rootPackageJsonPath, JSON.stringify(packageJson, null, 2));
|
|
46
57
|
return tree;
|
|
47
58
|
};
|
|
48
59
|
exports.updatePackageJsonScripts = updatePackageJsonScripts;
|
|
@@ -57,7 +68,10 @@ const createOpenApiToolsConfig = (tree) => {
|
|
|
57
68
|
const openApiDefaultStorageDir = '.openapi-generator';
|
|
58
69
|
if (tree.exists(openApiConfigPath)) {
|
|
59
70
|
const openapitoolsConfig = tree.readJson(openApiConfigPath);
|
|
60
|
-
openapitoolsConfig['generator-cli'] = {
|
|
71
|
+
openapitoolsConfig['generator-cli'] = {
|
|
72
|
+
storageDir: openApiDefaultStorageDir, ...openapitoolsConfig['generator-cli'],
|
|
73
|
+
version: openApiGeneratorVersion
|
|
74
|
+
};
|
|
61
75
|
tree.overwrite(openApiConfigPath, JSON.stringify(openapitoolsConfig));
|
|
62
76
|
}
|
|
63
77
|
else {
|
|
@@ -74,22 +88,25 @@ const createOpenApiToolsConfig = (tree) => {
|
|
|
74
88
|
};
|
|
75
89
|
/**
|
|
76
90
|
* Install the npm open api generator cli package
|
|
77
|
-
* @param
|
|
78
|
-
* @param context
|
|
91
|
+
* @param options
|
|
79
92
|
*/
|
|
80
|
-
const
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
+
const installDependencies = (options) => {
|
|
94
|
+
return (tree, context) => {
|
|
95
|
+
const workspaceProject = options.projectName ? (0, schematics_2.getWorkspaceConfig)(tree)?.projects[options.projectName] : undefined;
|
|
96
|
+
const projectDirectory = workspaceProject?.root || '.';
|
|
97
|
+
const projectPackageJson = tree.readJson(path.posix.join(projectDirectory, 'package.json'));
|
|
98
|
+
const externalDependenciesInfo = (0, schematics_2.getExternalDependenciesInfo)({
|
|
99
|
+
devDependenciesToInstall: devDependenciesToInstall,
|
|
100
|
+
dependenciesToInstall: dependenciesToInstall,
|
|
101
|
+
o3rPackageJsonPath: schematicsPackageJsonPath,
|
|
102
|
+
projectPackageJson,
|
|
103
|
+
projectType: workspaceProject?.projectType
|
|
104
|
+
}, context.logger);
|
|
105
|
+
return (0, schematics_2.setupDependencies)({
|
|
106
|
+
projectName: options.projectName,
|
|
107
|
+
dependencies: externalDependenciesInfo
|
|
108
|
+
});
|
|
109
|
+
};
|
|
93
110
|
};
|
|
94
111
|
/**
|
|
95
112
|
* Replace the swagger ignore file with an openapi one
|
|
@@ -128,17 +145,16 @@ const registerPackageSchematics = async (tree, context) => {
|
|
|
128
145
|
};
|
|
129
146
|
/**
|
|
130
147
|
* Add Otter ama-sdk-schematics to a Project
|
|
148
|
+
* @param options
|
|
131
149
|
*/
|
|
132
|
-
function ngAddFn() {
|
|
133
|
-
return (
|
|
150
|
+
function ngAddFn(options) {
|
|
151
|
+
return () => (0, schematics_1.chain)([
|
|
134
152
|
registerPackageSchematics,
|
|
135
153
|
exports.updatePackageJsonScripts,
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
}
|
|
141
|
-
])(tree, context);
|
|
154
|
+
replaceSwaggerIgnore,
|
|
155
|
+
installDependencies(options),
|
|
156
|
+
createOpenApiToolsConfig
|
|
157
|
+
]);
|
|
142
158
|
}
|
|
143
159
|
/**
|
|
144
160
|
* Add Otter ama-sdk-schematics to a Project
|
|
@@ -51,7 +51,7 @@ const updateJestConfigCoveragePathIgnorePatterns = (tree, context) => {
|
|
|
51
51
|
const match = line.match(/^ */);
|
|
52
52
|
const numberSpaces = match ? match[0].length : 0;
|
|
53
53
|
const newNumber = (numberSpaces - numberSpaces % 2) / 2;
|
|
54
|
-
return line.replace(/^ */,
|
|
54
|
+
return line.replace(/^ */, ' '.repeat(newNumber));
|
|
55
55
|
})
|
|
56
56
|
.join('\n');
|
|
57
57
|
tree.overwrite(filePath, content);
|
|
Binary file
|