@o3r/style-dictionary 12.5.0-prerelease.2 → 12.5.0-prerelease.20

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/migration.json ADDED
@@ -0,0 +1,10 @@
1
+ {
2
+ "$schema": "https://raw.githubusercontent.com/angular/angular-cli/master/packages/angular_devkit/schematics/collection-schema.json",
3
+ "schematics": {
4
+ "migration": {
5
+ "version": "*",
6
+ "description": "Migration of @o3r/style-dictionary to new scope",
7
+ "factory": "./schematics/ng-update/index#updateAll"
8
+ }
9
+ }
10
+ }
package/package.json CHANGED
@@ -1,6 +1,7 @@
1
1
  {
2
2
  "name": "@o3r/style-dictionary",
3
- "version": "12.5.0-prerelease.2",
3
+ "version": "12.5.0-prerelease.20",
4
+ "deprecated": "This package will be removed in Otter v14. Please use @ama-styling/style-dictionary instead.",
4
5
  "type": "module",
5
6
  "publishConfig": {
6
7
  "access": "public"
@@ -22,7 +23,7 @@
22
23
  "build:builders": "tsc -b tsconfig.builders.json --pretty && yarn generate-cjs-manifest",
23
24
  "build:source": "tsc -b tsconfig.build.json && yarn cpy package.json dist/",
24
25
  "build": "yarn nx build design",
25
- "prepare:build:builders": "yarn cpy 'schematics/**/*.json' dist/schematics && yarn cpy 'collection.json' dist && yarn copy:templates",
26
+ "prepare:build:builders": "yarn cpy 'schematics/**/*.json' dist/schematics && yarn cpy 'migration.json' dist && yarn cpy 'collection.json' dist && yarn copy:templates",
26
27
  "postbuild": "patch-package-json-main"
27
28
  },
28
29
  "exports": {
@@ -41,14 +42,14 @@
41
42
  "dependencies": {
42
43
  "@angular-devkit/architect": "~0.1902.0",
43
44
  "@angular-devkit/schematics": "~19.2.0",
44
- "@o3r/schematics": "^12.5.0-prerelease.2",
45
+ "@o3r/schematics": "^12.5.0-prerelease.20",
45
46
  "@schematics/angular": "~19.2.0",
46
47
  "tslib": "^2.6.2"
47
48
  },
48
49
  "peerDependencies": {
49
- "@o3r/core": "^12.5.0-prerelease.2",
50
- "@o3r/schematics": "^12.5.0-prerelease.2",
51
- "@o3r/telemetry": "^12.5.0-prerelease.2",
50
+ "@o3r/core": "^12.5.0-prerelease.20",
51
+ "@o3r/schematics": "^12.5.0-prerelease.20",
52
+ "@o3r/telemetry": "^12.5.0-prerelease.20",
52
53
  "style-dictionary": "^4.3.2",
53
54
  "type-fest": "^4.30.1"
54
55
  },
@@ -62,12 +63,6 @@
62
63
  "@o3r/telemetry": {
63
64
  "optional": true
64
65
  },
65
- "chokidar": {
66
- "optional": true
67
- },
68
- "globby": {
69
- "optional": true
70
- },
71
66
  "type-fest": {
72
67
  "optional": true
73
68
  }
@@ -82,28 +77,28 @@
82
77
  "@nx/eslint-plugin": "~20.8.0",
83
78
  "@nx/jest": "~20.8.0",
84
79
  "@nx/js": "~20.8.0",
85
- "@o3r/build-helpers": "^12.5.0-prerelease.2",
86
- "@o3r/core": "^12.5.0-prerelease.2",
87
- "@o3r/eslint-plugin": "^12.5.0-prerelease.2",
88
- "@o3r/telemetry": "^12.5.0-prerelease.2",
89
- "@o3r/test-helpers": "^12.5.0-prerelease.2",
80
+ "@o3r/build-helpers": "^12.5.0-prerelease.20",
81
+ "@o3r/core": "^12.5.0-prerelease.20",
82
+ "@o3r/eslint-plugin": "^12.5.0-prerelease.20",
83
+ "@o3r/telemetry": "^12.5.0-prerelease.20",
84
+ "@o3r/test-helpers": "^12.5.0-prerelease.20",
90
85
  "@schematics/angular": "~19.2.0",
91
86
  "@stylistic/eslint-plugin": "~3.1.0",
92
87
  "@types/jest": "~29.5.2",
93
88
  "@types/minimist": "^1.2.2",
94
89
  "@types/node": "^20.0.0",
95
90
  "@types/semver": "^7.3.13",
96
- "@typescript-eslint/parser": "~8.34.0",
91
+ "@typescript-eslint/parser": "~8.35.0",
97
92
  "angular-eslint": "~19.4.0",
98
93
  "babel-jest": "^29.7.0",
99
94
  "chokidar": "^4.0.3",
100
95
  "cpy-cli": "^5.0.0",
101
- "eslint": "~9.28.0",
96
+ "eslint": "~9.29.0",
102
97
  "eslint-import-resolver-node": "~0.3.9",
103
98
  "eslint-import-resolver-typescript": "~3.10.0",
104
- "eslint-plugin-import": "~2.31.0",
99
+ "eslint-plugin-import": "~2.32.0",
105
100
  "eslint-plugin-import-newlines": "~1.4.0",
106
- "eslint-plugin-jest": "~28.13.0",
101
+ "eslint-plugin-jest": "~28.14.0",
107
102
  "eslint-plugin-jsdoc": "~50.8.0",
108
103
  "eslint-plugin-prefer-arrow": "~1.2.3",
109
104
  "eslint-plugin-unicorn": "~56.0.0",
@@ -120,13 +115,17 @@
120
115
  "ts-node": "~10.9.2",
121
116
  "type-fest": "^4.30.1",
122
117
  "typescript": "~5.8.2",
123
- "typescript-eslint": "~8.34.0",
118
+ "typescript-eslint": "~8.35.0",
124
119
  "zone.js": "~0.15.0"
125
120
  },
126
121
  "engines": {
127
122
  "node": "^20.11.1 || >=22.0.0"
128
123
  },
129
124
  "schematics": "./collection.json",
125
+ "ng-update": {
126
+ "migrations": "./migration.json",
127
+ "requirements": "^12.0.0"
128
+ },
130
129
  "contributors": [
131
130
  {
132
131
  "name": "Yannick Adam",
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../schematics/ng-add/index.ts"],"names":[],"mappings":"AACA,OAAO,EAQL,IAAI,EAGL,MAAM,4BAA4B,CAAC;AAcpC,OAAO,KAAK,EACV,qBAAqB,EACtB,MAAM,UAAU,CAAC;AA0FlB;;;GAGG;AACH,eAAO,MAAM,KAAK,GAAI,SAAS,qBAAqB,SAA2C,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../schematics/ng-add/index.ts"],"names":[],"mappings":"AACA,OAAO,EAQL,IAAI,EAGL,MAAM,4BAA4B,CAAC;AAcpC,OAAO,KAAK,EACV,qBAAqB,EACtB,MAAM,UAAU,CAAC;AAuGlB;;;GAGG;AACH,eAAO,MAAM,KAAK,GAAI,SAAS,qBAAqB,SAA2C,CAAC"}
@@ -4,19 +4,27 @@ exports.ngAdd = void 0;
4
4
  const path = require("node:path");
5
5
  const schematics_1 = require("@angular-devkit/schematics");
6
6
  const schematics_2 = require("@o3r/schematics");
7
+ /**
8
+ * List of external dependencies to be added to the project as peer dependencies
9
+ */
10
+ const dependenciesToInstall = [];
11
+ /**
12
+ * List of external dependencies to be added to the project as dev dependencies
13
+ */
14
+ const devDependenciesToInstall = [
15
+ 'style-dictionary'
16
+ ];
7
17
  /**
8
18
  * Add Otter Style Dictionary process to an Angular Project
9
19
  * @param options
10
20
  */
11
21
  function ngAddFn(options) {
12
- const setup = async (tree, context) => {
13
- const devDependenciesToInstall = [
14
- 'style-dictionary'
15
- ];
16
- const depsInfo = (0, schematics_2.getO3rPeerDeps)(path.resolve(__dirname, '..', '..', 'package.json'), true);
17
- const workspaceProject = options.projectName ? (0, schematics_2.getWorkspaceConfig)(tree)?.projects[options.projectName] : undefined;
18
- const { NodeDependencyType } = await Promise.resolve().then(() => require('@schematics/angular/utility/dependencies'));
22
+ const setup = (tree, context) => {
19
23
  const packageJsonPath = path.resolve(__dirname, '..', '..', 'package.json');
24
+ const depsInfo = (0, schematics_2.getO3rPeerDeps)(packageJsonPath, true);
25
+ const workspaceProject = options.projectName ? (0, schematics_2.getWorkspaceConfig)(tree)?.projects[options.projectName] : undefined;
26
+ const projectDirectory = workspaceProject?.root || '.';
27
+ const projectPackageJson = tree.readJson(path.join(projectDirectory, 'package.json'));
20
28
  const dependencies = depsInfo.o3rPeerDeps.reduce((acc, dep) => {
21
29
  acc[dep] = {
22
30
  inManifest: [{
@@ -27,18 +35,19 @@ function ngAddFn(options) {
27
35
  };
28
36
  return acc;
29
37
  }, (0, schematics_2.getPackageInstallConfig)(packageJsonPath, tree, options.projectName, true, !!options.exactO3rVersion));
30
- Object.entries((0, schematics_2.getExternalDependenciesVersionRange)(devDependenciesToInstall, packageJsonPath, context.logger))
31
- .forEach(([dep, range]) => {
32
- dependencies[dep] = {
33
- inManifest: [{
34
- range,
35
- types: [NodeDependencyType.Dev]
36
- }]
37
- };
38
- });
38
+ const externalDependenciesInfo = (0, schematics_2.getExternalDependenciesInfo)({
39
+ devDependenciesToInstall,
40
+ dependenciesToInstall,
41
+ o3rPackageJsonPath: packageJsonPath,
42
+ projectPackageJson,
43
+ projectType: workspaceProject?.projectType
44
+ }, context.logger);
39
45
  return (0, schematics_2.setupDependencies)({
40
46
  projectName: options.projectName,
41
- dependencies,
47
+ dependencies: {
48
+ ...dependencies,
49
+ ...externalDependenciesInfo
50
+ },
42
51
  ngAddToRun: depsInfo.o3rPeerDeps
43
52
  });
44
53
  };
@@ -0,0 +1,6 @@
1
+ import type { Rule } from '@angular-devkit/schematics';
2
+ /**
3
+ * Update of Otter library V13.0
4
+ */
5
+ export declare const updateAll: (options: any) => Rule;
6
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../schematics/ng-update/index.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EACV,IAAI,EACL,MAAM,4BAA4B,CAAC;AA0BpC;;GAEG;AACH,eAAO,MAAM,SAAS,wBAMnB,CAAC"}
@@ -0,0 +1,34 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.updateAll = void 0;
4
+ const schematics_1 = require("@angular-devkit/schematics");
5
+ const schematics_2 = require("@o3r/schematics");
6
+ /**
7
+ * Rule to update the Style-dictionary configuration to new scope
8
+ * @param tree
9
+ * @param context
10
+ */
11
+ const updateStyleDictionaryConfig = (tree, context) => {
12
+ const excludes = ['**/node_modules/**', '**/.cache/**'];
13
+ const extensionMatcher = /config\.[mc]?js$/;
14
+ const configFiles = (0, schematics_2.getAllFilesInTree)(tree, '/', excludes)
15
+ .filter((filePath) => extensionMatcher.test(filePath));
16
+ configFiles.forEach((file) => {
17
+ const text = tree.readText(file);
18
+ if (text.includes('@o3r/style-dictionary')) {
19
+ context.logger.debug(`Update ${file}`);
20
+ tree.overwrite(file, text.replace(/o3r/g, 'ama'));
21
+ }
22
+ });
23
+ };
24
+ /**
25
+ * Update of Otter library V13.0
26
+ */
27
+ exports.updateAll = (0, schematics_2.createOtterSchematic)(() => (0, schematics_1.chain)([
28
+ updateStyleDictionaryConfig,
29
+ (_, context) => {
30
+ context.logger.warn('The package "@o3r/style-dictionary" is deprecated, please install "@ama-styling/style-dictionary" with the following command:');
31
+ context.logger.warn('ng add @ama-styling/style-dictionary');
32
+ }
33
+ ]));
34
+ //# sourceMappingURL=index.js.map