@o3r/styling 13.0.0-prerelease.3 → 13.0.0-prerelease.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/package.json +7 -7
- package/schematics/ng-add/index.d.ts.map +1 -1
- package/schematics/ng-add/index.js +19 -51
- package/schematics/ng-add/schema.d.ts +2 -6
- package/schematics/ng-add/schema.d.ts.map +1 -1
- package/schematics/ng-add/theme-files/index.d.ts +0 -8
- package/schematics/ng-add/theme-files/index.d.ts.map +1 -1
- package/schematics/ng-add/theme-files/index.js +0 -23
- package/schematics/ng-add/updates-of-old-otter-scope/imports/mocks/angular.json +0 -11
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@o3r/styling",
|
|
3
|
-
"version": "13.0.0-prerelease.
|
|
3
|
+
"version": "13.0.0-prerelease.4",
|
|
4
4
|
"deprecated": "This package will be removed in Otter v14. Please use @ama-styling/style-dictionary instead.",
|
|
5
5
|
"publishConfig": {
|
|
6
6
|
"access": "public"
|
|
@@ -39,11 +39,11 @@
|
|
|
39
39
|
"@angular/common": "^20.0.0",
|
|
40
40
|
"@angular/core": "^20.0.0",
|
|
41
41
|
"@angular/material": "^20.0.0",
|
|
42
|
-
"@o3r/core": "^13.0.0-prerelease.
|
|
43
|
-
"@o3r/dynamic-content": "^13.0.0-prerelease.
|
|
44
|
-
"@o3r/extractors": "^13.0.0-prerelease.
|
|
45
|
-
"@o3r/logger": "^13.0.0-prerelease.
|
|
46
|
-
"@o3r/schematics": "^13.0.0-prerelease.
|
|
42
|
+
"@o3r/core": "^13.0.0-prerelease.4",
|
|
43
|
+
"@o3r/dynamic-content": "^13.0.0-prerelease.4",
|
|
44
|
+
"@o3r/extractors": "^13.0.0-prerelease.4",
|
|
45
|
+
"@o3r/logger": "^13.0.0-prerelease.4",
|
|
46
|
+
"@o3r/schematics": "^13.0.0-prerelease.4",
|
|
47
47
|
"@schematics/angular": "^20.0.0",
|
|
48
48
|
"@yarnpkg/cli": "^4.3.1",
|
|
49
49
|
"@yarnpkg/core": "^4.1.1",
|
|
@@ -132,7 +132,7 @@
|
|
|
132
132
|
}
|
|
133
133
|
},
|
|
134
134
|
"dependencies": {
|
|
135
|
-
"@o3r/schematics": "^13.0.0-prerelease.
|
|
135
|
+
"@o3r/schematics": "^13.0.0-prerelease.4",
|
|
136
136
|
"tslib": "^2.6.2"
|
|
137
137
|
},
|
|
138
138
|
"generatorDependencies": {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../schematics/ng-add/index.ts"],"names":[],"mappings":"AAEA,OAAO,EAEL,IAAI,EACL,MAAM,4BAA4B,CAAC;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../schematics/ng-add/index.ts"],"names":[],"mappings":"AAEA,OAAO,EAEL,IAAI,EACL,MAAM,4BAA4B,CAAC;AAWpC,OAAO,KAAK,EACV,qBAAqB,EACtB,MAAM,UAAU,CAAC;AAqDlB;;;;GAIG;AACH,eAAO,MAAM,KAAK,GAAI,SAAS,qBAAqB,SAA2C,CAAC"}
|
|
@@ -6,6 +6,7 @@ const path = require("node:path");
|
|
|
6
6
|
const schematics_1 = require("@angular-devkit/schematics");
|
|
7
7
|
const schematics_2 = require("@o3r/schematics");
|
|
8
8
|
const cms_adapter_1 = require("../cms-adapter");
|
|
9
|
+
const theme_files_1 = require("./theme-files");
|
|
9
10
|
/**
|
|
10
11
|
* List of external dependencies to be added to the project as peer dependencies
|
|
11
12
|
*/
|
|
@@ -24,64 +25,31 @@ const devDependenciesToInstall = [
|
|
|
24
25
|
'chokidar',
|
|
25
26
|
'sass-loader'
|
|
26
27
|
];
|
|
28
|
+
const packageJsonPath = path.resolve(__dirname, '..', '..', 'package.json');
|
|
27
29
|
/**
|
|
28
30
|
* Add Otter styling to an Angular Project
|
|
29
31
|
* Update the styling if the app/lib used otter v7
|
|
30
32
|
* @param options for the dependency installations
|
|
31
33
|
*/
|
|
32
34
|
function ngAddFn(options) {
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
options = { ...(0, schematics_2.getDefaultOptionsForSchematic)((0, schematics_2.getWorkspaceConfig)(tree), '@o3r/styling', 'ng-add', options), ...options };
|
|
36
|
-
const { updateThemeFiles, removeV7OtterAssetsInAngularJson } = await Promise.resolve().then(() => require('./theme-files'));
|
|
37
|
-
const depsInfo = (0, schematics_2.getO3rPeerDeps)(packageJsonPath);
|
|
38
|
-
if (options.enableMetadataExtract) {
|
|
39
|
-
depsInfo.o3rPeerDeps = [...depsInfo.o3rPeerDeps, '@o3r/extractors'];
|
|
40
|
-
}
|
|
41
|
-
const workspaceProject = options.projectName ? (0, schematics_2.getWorkspaceConfig)(tree)?.projects[options.projectName] : undefined;
|
|
42
|
-
const projectDirectory = workspaceProject?.root || '.';
|
|
43
|
-
const projectPackageJson = tree.readJson(path.posix.join(projectDirectory, 'package.json'));
|
|
44
|
-
const dependencies = depsInfo.o3rPeerDeps.reduce((acc, dep) => {
|
|
45
|
-
acc[dep] = {
|
|
46
|
-
inManifest: [{
|
|
47
|
-
range: `${options.exactO3rVersion ? '' : '~'}${depsInfo.packageVersion}`,
|
|
48
|
-
types: (0, schematics_2.getProjectNewDependenciesTypes)(workspaceProject)
|
|
49
|
-
}],
|
|
50
|
-
ngAddOptions: { exactO3rVersion: options.exactO3rVersion }
|
|
51
|
-
};
|
|
52
|
-
return acc;
|
|
53
|
-
}, (0, schematics_2.getPackageInstallConfig)(packageJsonPath, tree, options.projectName, false, !!options.exactO3rVersion));
|
|
54
|
-
const externalDependenciesInfo = (0, schematics_2.getExternalDependenciesInfo)({
|
|
55
|
-
devDependenciesToInstall,
|
|
56
|
-
dependenciesToInstall,
|
|
57
|
-
projectType: workspaceProject?.projectType,
|
|
58
|
-
projectPackageJson,
|
|
59
|
-
o3rPackageJsonPath: packageJsonPath
|
|
60
|
-
}, context.logger);
|
|
61
|
-
const schematicsDefaultOptions = {
|
|
62
|
-
useOtterTheming: undefined
|
|
63
|
-
};
|
|
64
|
-
return (0, schematics_1.chain)([
|
|
65
|
-
(0, schematics_2.removePackages)(['@otter/styling']),
|
|
66
|
-
(0, schematics_2.updateSassImports)('o3r'),
|
|
67
|
-
updateThemeFiles(__dirname, options),
|
|
68
|
-
removeV7OtterAssetsInAngularJson(options),
|
|
69
|
-
(0, schematics_2.setupDependencies)({
|
|
70
|
-
projectName: options.projectName,
|
|
71
|
-
dependencies: {
|
|
72
|
-
...dependencies,
|
|
73
|
-
...externalDependenciesInfo
|
|
74
|
-
},
|
|
75
|
-
ngAddToRun: depsInfo.o3rPeerDeps
|
|
76
|
-
}),
|
|
77
|
-
(0, schematics_2.registerPackageCollectionSchematics)(JSON.parse(fs.readFileSync(packageJsonPath).toString())),
|
|
78
|
-
(0, schematics_2.setupSchematicsParamsForProject)({
|
|
79
|
-
'@o3r/core:component': schematicsDefaultOptions,
|
|
80
|
-
'@o3r/core:component-presenter': schematicsDefaultOptions
|
|
81
|
-
}, options.projectName),
|
|
82
|
-
...(options.enableMetadataExtract ? [(0, cms_adapter_1.updateCmsAdapter)(options)] : [])
|
|
83
|
-
]);
|
|
35
|
+
const schematicsDefaultOptions = {
|
|
36
|
+
useOtterTheming: undefined
|
|
84
37
|
};
|
|
38
|
+
return (0, schematics_1.chain)([
|
|
39
|
+
(0, schematics_2.updateSassImports)('o3r'),
|
|
40
|
+
(0, theme_files_1.updateThemeFiles)(__dirname, options),
|
|
41
|
+
(0, schematics_2.registerPackageCollectionSchematics)(JSON.parse(fs.readFileSync(packageJsonPath).toString())),
|
|
42
|
+
(0, schematics_2.setupSchematicsParamsForProject)({
|
|
43
|
+
'@o3r/core:component': schematicsDefaultOptions,
|
|
44
|
+
'@o3r/core:component-presenter': schematicsDefaultOptions
|
|
45
|
+
}, options.projectName),
|
|
46
|
+
...(options.enableMetadataExtract ? [(0, cms_adapter_1.updateCmsAdapter)(options)] : []),
|
|
47
|
+
(0, schematics_2.ngAddDependenciesRule)(options, packageJsonPath, {
|
|
48
|
+
dependenciesToInstall,
|
|
49
|
+
devDependenciesToInstall,
|
|
50
|
+
additionalNgAddToRun: options.enableMetadataExtract ? ['@o3r/extractors'] : undefined
|
|
51
|
+
})
|
|
52
|
+
]);
|
|
85
53
|
}
|
|
86
54
|
/**
|
|
87
55
|
* Add Otter styling to an Angular Project
|
|
@@ -1,10 +1,6 @@
|
|
|
1
|
-
import type { SchematicOptionObject } from '@o3r/schematics';
|
|
2
|
-
export interface NgAddSchematicsSchema extends SchematicOptionObject {
|
|
3
|
-
/** Project name */
|
|
4
|
-
projectName?: string | undefined;
|
|
1
|
+
import type { NgAddOptions, SchematicOptionObject } from '@o3r/schematics';
|
|
2
|
+
export interface NgAddSchematicsSchema extends NgAddOptions, SchematicOptionObject {
|
|
5
3
|
/** Activate metadata extraction */
|
|
6
4
|
enableMetadataExtract: boolean;
|
|
7
|
-
/** Use a pinned version for otter packages */
|
|
8
|
-
exactO3rVersion?: boolean;
|
|
9
5
|
}
|
|
10
6
|
//# sourceMappingURL=schema.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"schema.d.ts","sourceRoot":"","sources":["../../../schematics/ng-add/schema.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,qBAAqB,EACtB,MAAM,iBAAiB,CAAC;AAEzB,MAAM,WAAW,qBAAsB,SAAQ,
|
|
1
|
+
{"version":3,"file":"schema.d.ts","sourceRoot":"","sources":["../../../schematics/ng-add/schema.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,YAAY,EACZ,qBAAqB,EACtB,MAAM,iBAAiB,CAAC;AAEzB,MAAM,WAAW,qBAAsB,SAAQ,YAAY,EAAE,qBAAqB;IAChF,mCAAmC;IACnC,qBAAqB,EAAE,OAAO,CAAC;CAChC"}
|
|
@@ -8,12 +8,4 @@ import { Rule } from '@angular-devkit/schematics';
|
|
|
8
8
|
export declare function updateThemeFiles(rootPath: string, options: {
|
|
9
9
|
projectName?: string | null | undefined;
|
|
10
10
|
}): Rule;
|
|
11
|
-
/**
|
|
12
|
-
* Update assets list in angular.json for styling
|
|
13
|
-
* @param options
|
|
14
|
-
* @param options.projectName
|
|
15
|
-
*/
|
|
16
|
-
export declare function removeV7OtterAssetsInAngularJson(options: {
|
|
17
|
-
projectName?: string | null | undefined;
|
|
18
|
-
}): Rule;
|
|
19
11
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../schematics/ng-add/theme-files/index.ts"],"names":[],"mappings":"AAIA,OAAO,EAML,IAAI,EAKL,MAAM,4BAA4B,CAAC;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../schematics/ng-add/theme-files/index.ts"],"names":[],"mappings":"AAIA,OAAO,EAML,IAAI,EAKL,MAAM,4BAA4B,CAAC;AAMpC;;;;;GAKG;AACH,wBAAgB,gBAAgB,CAAC,QAAQ,EAAE,MAAM,EAAE,OAAO,EAAE;IAAE,WAAW,CAAC,EAAE,MAAM,GAAG,IAAI,GAAG,SAAS,CAAA;CAAE,GAAG,IAAI,CA+C7G"}
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.updateThemeFiles = updateThemeFiles;
|
|
4
|
-
exports.removeV7OtterAssetsInAngularJson = removeV7OtterAssetsInAngularJson;
|
|
5
4
|
const path = require("node:path");
|
|
6
5
|
const core_1 = require("@angular-devkit/core");
|
|
7
6
|
const schematics_1 = require("@angular-devkit/schematics");
|
|
@@ -52,26 +51,4 @@ function updateThemeFiles(rootPath, options) {
|
|
|
52
51
|
return rule;
|
|
53
52
|
};
|
|
54
53
|
}
|
|
55
|
-
/**
|
|
56
|
-
* Update assets list in angular.json for styling
|
|
57
|
-
* @param options
|
|
58
|
-
* @param options.projectName
|
|
59
|
-
*/
|
|
60
|
-
function removeV7OtterAssetsInAngularJson(options) {
|
|
61
|
-
return (tree, context) => {
|
|
62
|
-
const workspace = (0, schematics_2.getWorkspaceConfig)(tree);
|
|
63
|
-
const projectName = options.projectName;
|
|
64
|
-
const workspaceProject = options.projectName ? workspace?.projects[options.projectName] : undefined;
|
|
65
|
-
// exit if not an application
|
|
66
|
-
if (!projectName || !workspace || !workspaceProject) {
|
|
67
|
-
context.logger.debug('This is not an application project. No need to search and remove old v7 otter styling assets reference.');
|
|
68
|
-
return;
|
|
69
|
-
}
|
|
70
|
-
if (workspaceProject.architect?.build?.options?.assets) {
|
|
71
|
-
workspaceProject.architect.build.options.assets = workspaceProject.architect.build.options.assets.filter((a) => !a.input || !a.input.includes('node_modules/@otter/styling/assets'));
|
|
72
|
-
}
|
|
73
|
-
workspace.projects[projectName] = workspaceProject;
|
|
74
|
-
(0, schematics_2.writeAngularJson)(tree, workspace);
|
|
75
|
-
};
|
|
76
|
-
}
|
|
77
54
|
//# sourceMappingURL=index.js.map
|