@atls/code-schematics 0.0.20 → 2.0.1

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.
Files changed (102) hide show
  1. package/CHANGELOG.md +11 -0
  2. package/dist/generated/index.d.ts +1 -0
  3. package/dist/generated/index.js +1 -0
  4. package/dist/generated/schematic-factory-export.d.ts +2 -0
  5. package/dist/generated/schematic-factory-export.js +6 -0
  6. package/dist/getters/index.d.ts +2 -0
  7. package/dist/getters/index.js +2 -0
  8. package/dist/getters/stream-report-callback.getter.d.ts +4 -0
  9. package/dist/getters/stream-report-callback.getter.js +20 -0
  10. package/dist/getters/stream-report-options.getter.d.ts +6 -0
  11. package/dist/getters/stream-report-options.getter.js +7 -0
  12. package/dist/helpers/events-log.helper.d.ts +2 -0
  13. package/dist/helpers/events-log.helper.js +20 -0
  14. package/dist/helpers/index.d.ts +3 -0
  15. package/dist/helpers/index.js +3 -0
  16. package/dist/helpers/prepare-tmp-dir.helper.d.ts +2 -0
  17. package/dist/helpers/prepare-tmp-dir.helper.js +8 -0
  18. package/dist/helpers/run-schematics.helper.d.ts +1 -0
  19. package/dist/helpers/run-schematics.helper.js +48 -0
  20. package/dist/helpers/write-tmp-schematic.helper.d.ts +2 -0
  21. package/dist/helpers/write-tmp-schematic.helper.js +11 -0
  22. package/dist/index.d.ts +4 -2
  23. package/dist/index.js +4 -18
  24. package/dist/schematic/index.d.ts +1 -0
  25. package/dist/schematic/index.js +1 -0
  26. package/dist/schematic/project/index.d.ts +1 -0
  27. package/dist/schematic/project/index.js +1 -0
  28. package/dist/schematic/project/project.factory.d.ts +2 -0
  29. package/dist/schematic/project/project.factory.js +11 -0
  30. package/dist/schematic/rules/index.d.ts +1 -0
  31. package/dist/schematic/rules/index.js +1 -0
  32. package/dist/schematic/rules/update-ts-config.rule.d.ts +2 -0
  33. package/dist/schematic/rules/update-ts-config.rule.js +7 -0
  34. package/dist/schematic/sources/generate-common.source.d.ts +2 -0
  35. package/dist/schematic/sources/generate-common.source.js +13 -0
  36. package/dist/schematic/sources/generate-project-specific.source.d.ts +2 -0
  37. package/dist/schematic/sources/generate-project-specific.source.js +19 -0
  38. package/dist/schematic/sources/index.d.ts +2 -0
  39. package/dist/schematic/sources/index.js +2 -0
  40. package/dist/schematic/utils/file.utils.d.ts +3 -0
  41. package/dist/schematic/utils/file.utils.js +6 -0
  42. package/dist/schematic/utils/gitignore.utils.d.ts +3 -0
  43. package/dist/schematic/utils/gitignore.utils.js +12 -0
  44. package/dist/schematic/utils/index.d.ts +5 -0
  45. package/dist/schematic/utils/index.js +5 -0
  46. package/dist/schematic/utils/json.utils.d.ts +6 -0
  47. package/dist/schematic/utils/json.utils.js +23 -0
  48. package/dist/schematic/utils/tsconfig.utils.d.ts +1 -0
  49. package/dist/schematic/utils/tsconfig.utils.js +5 -0
  50. package/dist/schematic/utils/yaml.utils.d.ts +5 -0
  51. package/dist/schematic/utils/yaml.utils.js +18 -0
  52. package/dist/scripts/build-steps/esbuild.build-step.d.ts +1 -0
  53. package/dist/scripts/build-steps/esbuild.build-step.js +17 -0
  54. package/dist/scripts/build-steps/index.d.ts +1 -0
  55. package/dist/scripts/build-steps/index.js +1 -0
  56. package/dist/scripts/exceptions/index.d.ts +1 -0
  57. package/dist/scripts/exceptions/index.js +1 -0
  58. package/dist/scripts/exceptions/undefined-build-result.exception.d.ts +3 -0
  59. package/dist/scripts/exceptions/undefined-build-result.exception.js +5 -0
  60. package/dist/scripts/getters/cjs-content.getter.d.ts +2 -0
  61. package/dist/scripts/getters/cjs-content.getter.js +4 -0
  62. package/dist/scripts/getters/encoded-content.getter.d.ts +1 -0
  63. package/dist/scripts/getters/encoded-content.getter.js +4 -0
  64. package/dist/scripts/getters/esbuild-config.getter.d.ts +2 -0
  65. package/dist/scripts/getters/esbuild-config.getter.js +32 -0
  66. package/dist/scripts/getters/generated-file-content.getter.d.ts +1 -0
  67. package/dist/scripts/getters/generated-file-content.getter.js +16 -0
  68. package/dist/scripts/getters/index.d.ts +4 -0
  69. package/dist/scripts/getters/index.js +4 -0
  70. package/dist/scripts/index.d.ts +1 -0
  71. package/dist/scripts/index.js +1 -0
  72. package/dist/scripts/schematic-build.script.d.ts +1 -0
  73. package/dist/scripts/schematic-build.script.js +72 -0
  74. package/dist/scripts/schematic-factory-build.script.d.ts +1 -0
  75. package/dist/scripts/schematic-factory-build.script.js +10 -0
  76. package/package.json +36 -6
  77. package/dist/index.d.ts.map +0 -1
  78. package/dist/index.js.map +0 -1
  79. package/dist/migration-engine.host.d.ts +0 -5
  80. package/dist/migration-engine.host.d.ts.map +0 -1
  81. package/dist/migration-engine.host.js +0 -11
  82. package/dist/migration-engine.host.js.map +0 -1
  83. package/dist/node-pnp-engine.host.d.ts +0 -17
  84. package/dist/node-pnp-engine.host.d.ts.map +0 -1
  85. package/dist/node-pnp-engine.host.js +0 -95
  86. package/dist/node-pnp-engine.host.js.map +0 -1
  87. package/dist/schematics.d.ts +0 -10
  88. package/dist/schematics.d.ts.map +0 -1
  89. package/dist/schematics.js +0 -95
  90. package/dist/schematics.js.map +0 -1
  91. package/dist/utils/collection.utils.d.ts +0 -7
  92. package/dist/utils/collection.utils.d.ts.map +0 -1
  93. package/dist/utils/collection.utils.js +0 -47
  94. package/dist/utils/collection.utils.js.map +0 -1
  95. package/dist/utils/index.d.ts +0 -3
  96. package/dist/utils/index.d.ts.map +0 -1
  97. package/dist/utils/index.js +0 -19
  98. package/dist/utils/index.js.map +0 -1
  99. package/dist/utils/resolve.utils.d.ts +0 -2
  100. package/dist/utils/resolve.utils.d.ts.map +0 -1
  101. package/dist/utils/resolve.utils.js +0 -27
  102. package/dist/utils/resolve.utils.js.map +0 -1
@@ -0,0 +1,72 @@
1
+ import { readdir } from 'fs/promises';
2
+ import { mkdir } from 'fs/promises';
3
+ import { writeFile } from 'fs/promises';
4
+ import { readFile } from 'fs/promises';
5
+ import { join } from 'path';
6
+ import { dirname } from 'path';
7
+ async function buildFileStructure(dirPath) {
8
+ const result = {};
9
+ const entries = await readdir(dirPath, { withFileTypes: true });
10
+ for (const entry of entries) {
11
+ const fullPath = join(dirPath, entry.name);
12
+ if (entry.isDirectory()) {
13
+ result[entry.name] = await buildFileStructure(fullPath);
14
+ }
15
+ else {
16
+ const content = await readFile(fullPath, 'utf-8');
17
+ result[entry.name] = Buffer.from(content).toString('base64');
18
+ }
19
+ }
20
+ return result;
21
+ }
22
+ function generateModuleContent(structure) {
23
+ const createStructureCode = (obj, indent = '') => {
24
+ let code = '';
25
+ for (const [key, value] of Object.entries(obj)) {
26
+ if (typeof value === 'string') {
27
+ code += `${indent}'${key}': '${value}',\n`;
28
+ }
29
+ else {
30
+ code += `${indent}'${key}': {\n`;
31
+ code += createStructureCode(value, `${indent} `);
32
+ code += `${indent}},\n`;
33
+ }
34
+ }
35
+ return code;
36
+ };
37
+ return `// Auto-generated file
38
+ /* eslint-disable */
39
+ export const assetsStructure = {
40
+ ${createStructureCode(structure, ' ')}
41
+ }
42
+
43
+ export async function writeFiles(baseDir: string) {
44
+ const { join } = await import('path')
45
+ const { mkdir, writeFile } = await import('fs/promises')
46
+
47
+ async function writeRecursive(obj: any, currentPath: string) {
48
+ for (const [key, value] of Object.entries(obj)) {
49
+ const fullPath = join(currentPath, key)
50
+
51
+ if (typeof value === 'string') {
52
+ await writeFile(
53
+ fullPath,
54
+ Buffer.from(value, 'base64').toString('utf-8')
55
+ )
56
+ } else {
57
+ await mkdir(fullPath, { recursive: true })
58
+ await writeRecursive(value, fullPath)
59
+ }
60
+ }
61
+ }
62
+
63
+ await writeRecursive(assetsStructure, baseDir)
64
+ }
65
+ `;
66
+ }
67
+ export async function generateSchematic(schematicDir, outputFile) {
68
+ const structure = await buildFileStructure(schematicDir);
69
+ const moduleContent = generateModuleContent(structure);
70
+ await mkdir(dirname(outputFile), { recursive: true });
71
+ await writeFile(outputFile, moduleContent);
72
+ }
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,10 @@
1
+ import { esbuildBuildStep } from './build-steps/index.js';
2
+ try {
3
+ await esbuildBuildStep();
4
+ }
5
+ catch (e) {
6
+ const error = e;
7
+ console.error('SchematicFactory build error!');
8
+ console.error(error.message);
9
+ }
10
+ console.info('SchematicFactory build successed');
package/package.json CHANGED
@@ -1,26 +1,56 @@
1
1
  {
2
2
  "name": "@atls/code-schematics",
3
- "version": "0.0.20",
3
+ "version": "2.0.1",
4
4
  "license": "BSD-3-Clause",
5
- "main": "dist/index.js",
5
+ "type": "module",
6
+ "exports": {
7
+ "./package.json": "./package.json",
8
+ ".": {
9
+ "import": "./dist/index.js",
10
+ "types": "./dist/index.d.ts",
11
+ "default": "./dist/index.js"
12
+ }
13
+ },
6
14
  "files": [
7
15
  "dist"
8
16
  ],
9
17
  "scripts": {
10
- "build": "yarn library build",
18
+ "build": "yarn run build:schematic-factory && yarn run build:library",
19
+ "build:library": "yarn library build",
20
+ "build:schematic-factory": "yarn node ./src/scripts/schematic-factory-build.script.ts",
11
21
  "prepack": "yarn run build",
12
22
  "postpack": "rm -rf dist"
13
23
  },
14
24
  "dependencies": {
15
- "@angular-devkit/core": "17.0.7",
16
- "@angular-devkit/schematics": "17.0.7"
25
+ "@angular-devkit/core": "19.1.5",
26
+ "@angular-devkit/schematics": "19.1.5",
27
+ "strip-json-comments": "3.1.1"
17
28
  },
18
29
  "devDependencies": {
30
+ "@atls/code-runtime": "2.1.4",
31
+ "@types/node": "22.9.0",
32
+ "@yarnpkg/cli": "4.5.1",
33
+ "@yarnpkg/core": "4.1.4",
34
+ "@yarnpkg/esbuild-plugin-pnp": "3.0.0-rc.15",
35
+ "@yarnpkg/fslib": "3.1.0",
36
+ "esbuild": "0.24.2",
19
37
  "rxjs": "7.8.1"
20
38
  },
39
+ "peerDependencies": {
40
+ "@yarnpkg/cli": "*",
41
+ "@yarnpkg/core": "*"
42
+ },
21
43
  "publishConfig": {
22
- "main": "dist/index.js",
44
+ "exports": {
45
+ "./package.json": "./package.json",
46
+ ".": {
47
+ "import": "./dist/index.js",
48
+ "types": "./dist/index.d.ts",
49
+ "default": "./dist/index.js"
50
+ }
51
+ },
23
52
  "typings": "dist/index.d.ts"
24
53
  },
54
+ "typecheckSkipLibCheck": true,
25
55
  "typings": "dist/index.d.ts"
26
56
  }
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,cAAc,CAAA"}
package/dist/index.js.map DELETED
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,+CAA4B"}
@@ -1,5 +0,0 @@
1
- import { NodePnpEngineHost } from './node-pnp-engine.host';
2
- export declare class MigrationEngineHost extends NodePnpEngineHost {
3
- protected _resolveCollectionPath(name: string): string;
4
- }
5
- //# sourceMappingURL=migration-engine.host.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"migration-engine.host.d.ts","sourceRoot":"","sources":["../src/migration-engine.host.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,MAAM,wBAAwB,CAAA;AAE1D,qBAAa,mBAAoB,SAAQ,iBAAiB;IAExD,SAAS,CAAC,sBAAsB,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM;CAGvD"}
@@ -1,11 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.MigrationEngineHost = void 0;
4
- const node_pnp_engine_host_1 = require("./node-pnp-engine.host");
5
- class MigrationEngineHost extends node_pnp_engine_host_1.NodePnpEngineHost {
6
- _resolveCollectionPath(name) {
7
- return name;
8
- }
9
- }
10
- exports.MigrationEngineHost = MigrationEngineHost;
11
- //# sourceMappingURL=migration-engine.host.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"migration-engine.host.js","sourceRoot":"","sources":["../src/migration-engine.host.ts"],"names":[],"mappings":";;;AAAA,iEAA0D;AAE1D,MAAa,mBAAoB,SAAQ,wCAAiB;IAE9C,sBAAsB,CAAC,IAAY;QAC3C,OAAO,IAAI,CAAA;IACb,CAAC;CACF;AALD,kDAKC"}
@@ -1,17 +0,0 @@
1
- import { RuleFactory } from '@angular-devkit/schematics/';
2
- import { FileSystemCollectionDesc } from '@angular-devkit/schematics/tools';
3
- import { FileSystemSchematicDesc } from '@angular-devkit/schematics/tools';
4
- import { FileSystemEngineHostBase } from '@angular-devkit/schematics/tools';
5
- export declare class NodePnpEngineHost extends FileSystemEngineHostBase {
6
- private readonly paths?;
7
- constructor(paths?: string[] | undefined);
8
- private resolve;
9
- protected _resolveCollectionPath(name: string, requester?: string): string;
10
- protected _resolveReferenceString(refString: string, parentPath: string): {
11
- ref: RuleFactory<{}>;
12
- path: string;
13
- } | null;
14
- protected _transformCollectionDescription(name: string, desc: Partial<FileSystemCollectionDesc>): FileSystemCollectionDesc;
15
- protected _transformSchematicDescription(name: string, _collection: FileSystemCollectionDesc, desc: Partial<FileSystemSchematicDesc>): FileSystemSchematicDesc;
16
- }
17
- //# sourceMappingURL=node-pnp-engine.host.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"node-pnp-engine.host.d.ts","sourceRoot":"","sources":["../src/node-pnp-engine.host.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,WAAW,EAAE,MAAkC,6BAA6B,CAAA;AACrF,OAAO,EAAE,wBAAwB,EAAE,MAAqB,kCAAkC,CAAA;AAC1F,OAAO,EAAE,uBAAuB,EAAE,MAAsB,kCAAkC,CAAA;AAI1F,OAAO,EAAE,wBAAwB,EAAE,MAAqB,kCAAkC,CAAA;AAK1F,qBAAa,iBAAkB,SAAQ,wBAAwB;IACjD,OAAO,CAAC,QAAQ,CAAC,KAAK,CAAC;gBAAN,KAAK,CAAC,sBAAU;IAI7C,OAAO,CAAC,OAAO;IA6Df,SAAS,CAAC,sBAAsB,CAAC,IAAI,EAAE,MAAM,EAAE,SAAS,CAAC,EAAE,MAAM,GAAG,MAAM;IAQ1E,SAAS,CAAC,uBAAuB,CAAC,SAAS,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM;;;;IAUvE,SAAS,CAAC,+BAA+B,CACvC,IAAI,EAAE,MAAM,EACZ,IAAI,EAAE,OAAO,CAAC,wBAAwB,CAAC,GACtC,wBAAwB;IAY3B,SAAS,CAAC,8BAA8B,CACtC,IAAI,EAAE,MAAM,EACZ,WAAW,EAAE,wBAAwB,EACrC,IAAI,EAAE,OAAO,CAAC,uBAAuB,CAAC,GACrC,uBAAuB;CAO3B"}
@@ -1,95 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.NodePnpEngineHost = void 0;
4
- const node_path_1 = require("node:path");
5
- const node_path_2 = require("node:path");
6
- const node_path_3 = require("node:path");
7
- const tools_1 = require("@angular-devkit/schematics/tools");
8
- const tools_2 = require("@angular-devkit/schematics/tools");
9
- const tools_3 = require("@angular-devkit/schematics/tools");
10
- const tools_4 = require("@angular-devkit/schematics/tools");
11
- const tools_5 = require("@angular-devkit/schematics/tools");
12
- const tools_6 = require("@angular-devkit/schematics/tools");
13
- const file_system_utility_1 = require("@angular-devkit/schematics/tools/file-system-utility");
14
- class NodePnpEngineHost extends tools_4.FileSystemEngineHostBase {
15
- paths;
16
- constructor(paths) {
17
- super();
18
- this.paths = paths;
19
- }
20
- resolve(name, requester, references = new Set()) {
21
- if (requester) {
22
- if (references.has(requester)) {
23
- references.add(requester);
24
- throw new Error(`Circular schematic reference detected: ${JSON.stringify(Array.from(references))}`);
25
- }
26
- else {
27
- references.add(requester);
28
- }
29
- }
30
- const relativeBase = requester ? (0, node_path_1.dirname)(requester) : process.cwd();
31
- let collectionPath;
32
- if (name.startsWith('.')) {
33
- name = (0, node_path_3.resolve)(relativeBase, name);
34
- }
35
- const resolveOptions = {
36
- paths: (requester ? [(0, node_path_1.dirname)(requester), ...(this.paths || [])] : this.paths)?.filter(Boolean),
37
- };
38
- try {
39
- const packageJsonPath = require.resolve((0, node_path_2.join)(name, 'package.json'), resolveOptions);
40
- const { schematics } = require(packageJsonPath);
41
- if (!schematics || typeof schematics !== 'string') {
42
- throw new tools_6.NodePackageDoesNotSupportSchematics(name);
43
- }
44
- collectionPath = this.resolve(schematics, packageJsonPath, references);
45
- }
46
- catch (e) {
47
- if (e.code !== 'MODULE_NOT_FOUND') {
48
- throw e;
49
- }
50
- }
51
- if (!collectionPath) {
52
- try {
53
- collectionPath = require.resolve(name, resolveOptions);
54
- }
55
- catch (e) {
56
- if (e.code !== 'MODULE_NOT_FOUND') {
57
- throw e;
58
- }
59
- }
60
- }
61
- if (!collectionPath) {
62
- throw new tools_2.CollectionCannotBeResolvedException(name);
63
- }
64
- return collectionPath;
65
- }
66
- _resolveCollectionPath(name, requester) {
67
- const collectionPath = this.resolve(name, requester);
68
- (0, file_system_utility_1.readJsonFile)(collectionPath);
69
- return collectionPath;
70
- }
71
- _resolveReferenceString(refString, parentPath) {
72
- const ref = new tools_1.ExportStringRef(refString, parentPath);
73
- if (!ref.ref) {
74
- return null;
75
- }
76
- return { ref: ref.ref, path: ref.module };
77
- }
78
- _transformCollectionDescription(name, desc) {
79
- if (!desc.schematics || typeof desc.schematics !== 'object') {
80
- throw new tools_3.CollectionMissingSchematicsMapException(name);
81
- }
82
- return {
83
- ...desc,
84
- name,
85
- };
86
- }
87
- _transformSchematicDescription(name, _collection, desc) {
88
- if (!desc.factoryFn || !desc.path || !desc.description) {
89
- throw new tools_5.SchematicMissingFieldsException(name);
90
- }
91
- return desc;
92
- }
93
- }
94
- exports.NodePnpEngineHost = NodePnpEngineHost;
95
- //# sourceMappingURL=node-pnp-engine.host.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"node-pnp-engine.host.js","sourceRoot":"","sources":["../src/node-pnp-engine.host.ts"],"names":[],"mappings":";;;AAAA,yCAAmE;AACnE,yCAAmE;AACnE,yCAAmE;AAKnE,4DAA0F;AAC1F,4DAA0F;AAC1F,4DAA0F;AAC1F,4DAA0F;AAC1F,4DAA0F;AAC1F,4DAA0F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,IAAuC;QAEvC,IAAI,CAAC,IAAI,CAAC,UAAU,IAAI,OAAO,IAAI,CAAC,UAAU,KAAK,QAAQ,EAAE;YAC3D,MAAM,IAAI,+CAAuC,CAAC,IAAI,CAAC,CAAA;SACxD;QAED,OAAO;YACL,GAAG,IAAI;YACP,IAAI;SACuB,CAAA;IAC/B,CAAC;IAGS,8BAA8B,CACtC,IAAY,EACZ,WAAqC,EACrC,IAAsC;QAEtC,IAAI,CAAC,IAAI,CAAC,SAAS,IAAI,CAAC,IAAI,CAAC,IAAI,IAAI,CAAC,IAAI,CAAC,WAAW,EAAE;YACtD,MAAM,IAAI,uCAA+B,CAAC,IAAI,CAAC,CAAA;SAChD;QAED,OAAO,IAA+B,CAAA;IACxC,CAAC;CACF;AA9GD,8CA8GC"}
@@ -1,10 +0,0 @@
1
- import { DryRunEvent } from '@angular-devkit/schematics';
2
- export declare class Schematics {
3
- private readonly cwd;
4
- private readonly force;
5
- private readonly dryRun;
6
- constructor(cwd: string, force?: boolean, dryRun?: boolean);
7
- init(schematic: string, options?: {}): Promise<DryRunEvent[]>;
8
- migrate(schematicName: string, migrationVersion: string, options?: {}): Promise<DryRunEvent[]>;
9
- }
10
- //# sourceMappingURL=schematics.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"schematics.d.ts","sourceRoot":"","sources":["../src/schematics.ts"],"names":[],"mappings":"AAKA,OAAO,EAAE,WAAW,EAAE,MAAc,4BAA4B,CAAA;AAWhE,qBAAa,UAAU;IAEnB,OAAO,CAAC,QAAQ,CAAC,GAAG;IACpB,OAAO,CAAC,QAAQ,CAAC,KAAK;IACtB,OAAO,CAAC,QAAQ,CAAC,MAAM;gBAFN,GAAG,EAAE,MAAM,EACX,KAAK,UAAQ,EACb,MAAM,UAAQ;IAG3B,IAAI,CAAC,SAAS,EAAE,MAAM,EAAE,OAAO,KAAK;IAoCpC,OAAO,CAAC,aAAa,EAAE,MAAM,EAAE,gBAAgB,EAAE,MAAM,EAAE,OAAO,KAAK;CA6D5E"}
@@ -1,95 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.Schematics = void 0;
4
- const node_path_1 = require("node:path");
5
- const node_path_2 = require("node:path");
6
- const node_1 = require("@angular-devkit/core/node");
7
- const tools_1 = require("@angular-devkit/schematics/tools");
8
- const core_1 = require("@angular-devkit/core");
9
- const rxjs_1 = require("rxjs");
10
- const migration_engine_host_1 = require("./migration-engine.host");
11
- const node_pnp_engine_host_1 = require("./node-pnp-engine.host");
12
- const utils_1 = require("./utils");
13
- const utils_2 = require("./utils");
14
- class Schematics {
15
- cwd;
16
- force;
17
- dryRun;
18
- constructor(cwd, force = false, dryRun = false) {
19
- this.cwd = cwd;
20
- this.force = force;
21
- this.dryRun = dryRun;
22
- }
23
- async init(schematic, options = {}) {
24
- const host = new core_1.virtualFs.ScopedHost(new node_1.NodeJsSyncHost(), this.cwd);
25
- const workflow = new tools_1.NodeWorkflow(host, {
26
- force: this.force,
27
- dryRun: this.dryRun,
28
- resolvePaths: [this.cwd],
29
- schemaValidation: true,
30
- engineHostCreator: ({ resolvePaths }) => new node_pnp_engine_host_1.NodePnpEngineHost(resolvePaths),
31
- });
32
- const collection = (0, utils_2.resolveSchematics)(this.cwd);
33
- const events = [];
34
- workflow.reporter.subscribe((event) => {
35
- events.push(event);
36
- });
37
- await workflow
38
- .execute({
39
- collection,
40
- schematic,
41
- options: {
42
- ...options,
43
- cwd: this.cwd,
44
- },
45
- allowPrivate: true,
46
- debug: true,
47
- })
48
- .toPromise();
49
- return events;
50
- }
51
- async migrate(schematicName, migrationVersion, options = {}) {
52
- const host = new core_1.virtualFs.ScopedHost(new node_1.NodeJsSyncHost(), this.cwd);
53
- const workflow = new tools_1.NodeWorkflow(host, {
54
- force: true,
55
- dryRun: false,
56
- engineHostCreator: ({ resolvePaths }) => new migration_engine_host_1.MigrationEngineHost(resolvePaths),
57
- });
58
- const events = [];
59
- workflow.reporter.subscribe((event) => {
60
- events.push(event);
61
- });
62
- const collections = (0, utils_1.expandCollections)(this.cwd, (0, utils_2.resolveSchematics)(this.cwd), schematicName);
63
- const migrations = collections
64
- .map((collection) => {
65
- const schematic = collection.description.schematics[schematicName];
66
- if (!schematic) {
67
- return [];
68
- }
69
- const migrationsPath = (0, node_path_2.join)((0, node_path_1.dirname)(collection.description.path), (0, node_path_1.dirname)(schematic.schema), 'migrations.json');
70
- const data = require(migrationsPath);
71
- return Object.keys(data.schematics)
72
- .map((key) => ({
73
- collection: migrationsPath,
74
- schematic: key,
75
- migration: data.schematics[key],
76
- }))
77
- .filter((config) => config.migration.version > migrationVersion);
78
- })
79
- .flat();
80
- for (const migration of migrations) {
81
- await (0, rxjs_1.lastValueFrom)(workflow.execute({
82
- collection: migration.collection,
83
- schematic: migration.schematic,
84
- debug: false,
85
- options: {
86
- ...options,
87
- cwd: this.cwd,
88
- },
89
- }));
90
- }
91
- return events;
92
- }
93
- }
94
- exports.Schematics = Schematics;
95
- //# sourceMappingURL=schematics.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"schematics.js","sourceRoot":"","sources":["../src/schematics.ts"],"names":[],"mappings":";;;AAAA,yCAA+C;AAC/C,yCAA+C;AAG/C,oDAA+D;AAE/D,4DAAsE;AACtE,+CAA0D;AAE1D,+BAA0C;AAE1C,mEAA6D;AAC7D,iEAA4D;AAC5D,mCAA6C;AAC7C,mCAA6C;AAE7C,MAAa,UAAU;IAEF;IACA;IACA;IAHnB,YACmB,GAAW,EACX,QAAQ,KAAK,EACb,SAAS,KAAK;QAFd,QAAG,GAAH,GAAG,CAAQ;QACX,UAAK,GAAL,KAAK,CAAQ;QACb,WAAM,GAAN,MAAM,CAAQ;IAC9B,CAAC;IAEJ,KAAK,CAAC,IAAI,CAAC,SAAiB,EAAE,OAAO,GAAG,EAAE;QACxC,MAAM,IAAI,GAAG,IAAI,gBAAS,CAAC,UAAU,CAAC,IAAI,qBAAc,EAAE,EAAE,IAAI,CAAC,GAAW,CAAC,CAAA;QAG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,UAAU,EAAE,SAAS,CAAC,UAAU;gBAChC,SAAS,EAAE,SAAS,CAAC,SAAS;gBAC9B,KAAK,EAAE,KAAK;gBACZ,OAAO,EAAE;oBACP,GAAG,OAAO;oBACV,GAAG,EAAE,IAAI,CAAC,GAAG;iBACd;aACF,CAAC,CACH,CAAA;SACF;QAED,OAAO,MAAM,CAAA;IACf,CAAC;CACF;AAxGD,gCAwGC"}
@@ -1,7 +0,0 @@
1
- import type { Collection } from '@angular-devkit/schematics';
2
- import type { FileSystemCollectionDescription } from '@angular-devkit/schematics/tools';
3
- import type { FileSystemSchematicDescription } from '@angular-devkit/schematics/tools';
4
- export declare const createCollection: (root: string, collectionName: string) => Collection<FileSystemCollectionDescription, FileSystemSchematicDescription>;
5
- export declare const expandCollection: (cwd: string, collectionName: string) => Array<Collection<FileSystemCollectionDescription, FileSystemSchematicDescription>>;
6
- export declare const expandCollections: (cwd: string, collectionName: string, schematicName: string) => Array<Collection<FileSystemCollectionDescription, FileSystemSchematicDescription>>;
7
- //# sourceMappingURL=collection.utils.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"collection.utils.d.ts","sourceRoot":"","sources":["../../src/utils/collection.utils.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAA2B,4BAA4B,CAAA;AACjF,OAAO,KAAK,EAAE,+BAA+B,EAAE,MAAM,kCAAkC,CAAA;AACvF,OAAO,KAAK,EAAE,8BAA8B,EAAE,MAAO,kCAAkC,CAAA;AASvF,eAAO,MAAM,gBAAgB,SACrB,MAAM,kBACI,MAAM,KACrB,WAAW,+BAA+B,EAAE,8BAA8B,CAY5E,CAAA;AAED,eAAO,MAAM,gBAAgB,QACtB,MAAM,kBACK,MAAM,KACrB,MAAM,WAAW,+BAA+B,EAAE,8BAA8B,CAAC,CAcnF,CAAA;AAED,eAAO,MAAM,iBAAiB,QACvB,MAAM,kBACK,MAAM,iBACP,MAAM,KACpB,MAAM,WAAW,+BAA+B,EAAE,8BAA8B,CAAC,CAkBnF,CAAA"}
@@ -1,47 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.expandCollections = exports.expandCollection = exports.createCollection = void 0;
4
- const node_1 = require("@angular-devkit/core/node");
5
- const tools_1 = require("@angular-devkit/schematics/tools");
6
- const core_1 = require("@angular-devkit/core");
7
- const core_2 = require("@angular-devkit/core");
8
- const core_3 = require("@angular-devkit/core");
9
- const schematics_1 = require("@angular-devkit/schematics");
10
- const createCollection = (root, collectionName) => {
11
- const fsHost = new core_3.virtualFs.ScopedHost(new node_1.NodeJsSyncHost(), (0, core_1.normalize)(root));
12
- const workflow = new tools_1.NodeWorkflow(fsHost, {
13
- force: false,
14
- dryRun: true,
15
- packageManager: 'yarn',
16
- root: (0, core_1.normalize)(root),
17
- registry: new core_2.schema.CoreSchemaRegistry(schematics_1.formats.standardFormats),
18
- });
19
- return workflow.engine.createCollection(collectionName);
20
- };
21
- exports.createCollection = createCollection;
22
- const expandCollection = (cwd, collectionName) => {
23
- const collection = (0, exports.createCollection)(cwd, collectionName);
24
- const collections = [collection];
25
- if (collection.baseDescriptions) {
26
- const baseCollections = collection.baseDescriptions
27
- .map((base) => (0, exports.expandCollection)(cwd, base.name))
28
- .flat();
29
- return [...collections, ...baseCollections];
30
- }
31
- return collections;
32
- };
33
- exports.expandCollection = expandCollection;
34
- const expandCollections = (cwd, collectionName, schematicName) => {
35
- const collections = (0, exports.expandCollection)(cwd, collectionName).reverse();
36
- const nested = collections.map((collection) => {
37
- const schematic = collection.description.schematics[schematicName];
38
- if (schematic && schematic.extends) {
39
- const [extendsCollection, extendsSchematic] = schematic.extends.split(':');
40
- return (0, exports.expandCollections)(cwd, extendsCollection, extendsSchematic);
41
- }
42
- return [];
43
- });
44
- return [...nested, collections].flat();
45
- };
46
- exports.expandCollections = expandCollections;
47
- //# sourceMappingURL=collection.utils.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"collection.utils.js","sourceRoot":"","s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BY,QAAA,gBAAgB,oBAiB5B;AAEM,MAAM,iBAAiB,GAAG,CAC/B,GAAW,EACX,cAAsB,EACtB,aAAqB,EAC+D,EAAE;IACtF,MAAM,WAAW,GAAG,IAAA,wBAAgB,EAAC,GAAG,EAAE,cAAc,CAAC,CAAC,OAAO,EAAE,CAAA;IAEnE,MAAM,MAAM,GAAG,WAAW,CAAC,GAAG,CAAC,CAC7B,UAAuF,EACvF,EAAE;QACF,MAAM,SAAS,GAAG,UAAU,CAAC,WAAW,CAAC,UAAU,CAAC,aAAa,CAAC,CAAA;QAElE,IAAI,SAAS,IAAI,SAAS,CAAC,OAAO,EAAE;YAClC,MAAM,CAAC,iBAAiB,EAAE,gBAAgB,CAAC,GAAG,SAAS,CAAC,OAAO,CAAC,KAAK,CAAC,GAAG,CAAC,CAAA;YAE1E,OAAO,IAAA,yBAAiB,EAAC,GAAG,EAAE,iBAAiB,EAAE,gBAAgB,CAAC,CAAA;SACnE;QAED,OAAO,EAAE,CAAA;IACX,CAAC,CAAC,CAAA;IAEF,OAAO,CAAC,GAAG,MAAM,EAAE,WAAW,CAAC,CAAC,IAAI,EAAE,CAAA;AACxC,CAAC,CAAA;AAtBY,QAAA,iBAAiB,qBAsB7B"}
@@ -1,3 +0,0 @@
1
- export * from './collection.utils';
2
- export * from './resolve.utils';
3
- //# sourceMappingURL=index.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/utils/index.ts"],"names":[],"mappings":"AAAA,cAAc,oBAAoB,CAAA;AAClC,cAAc,iBAAiB,CAAA"}
@@ -1,19 +0,0 @@
1
- "use strict";
2
- var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
- if (k2 === undefined) k2 = k;
4
- var desc = Object.getOwnPropertyDescriptor(m, k);
5
- if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
- desc = { enumerable: true, get: function() { return m[k]; } };
7
- }
8
- Object.defineProperty(o, k2, desc);
9
- }) : (function(o, m, k, k2) {
10
- if (k2 === undefined) k2 = k;
11
- o[k2] = m[k];
12
- }));
13
- var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
- for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
- };
16
- Object.defineProperty(exports, "__esModule", { value: true });
17
- __exportStar(require("./collection.utils"), exports);
18
- __exportStar(require("./resolve.utils"), exports);
19
- //# sourceMappingURL=index.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/utils/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,qDAAkC;AAClC,kDAA+B"}
@@ -1,2 +0,0 @@
1
- export declare const resolveSchematics: (cwd?: string) => string;
2
- //# sourceMappingURL=resolve.utils.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"resolve.utils.d.ts","sourceRoot":"","sources":["../../src/utils/resolve.utils.ts"],"names":[],"mappings":"AAmBA,eAAO,MAAM,iBAAiB,SAAU,MAAM,WAQ7C,CAAA"}
@@ -1,27 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.resolveSchematics = void 0;
4
- const node_path_1 = require("node:path");
5
- const node_path_2 = require("node:path");
6
- const dynamicRequire = eval('require');
7
- const findPnpApiPath = (cwd) => {
8
- if (process.versions.pnp) {
9
- return require('module').findPnpApi(__filename).resolveRequest('pnpapi', null);
10
- }
11
- return (0, node_path_2.join)(cwd || process.cwd(), '.pnp.cjs');
12
- };
13
- const setupPnp = (cwd) => {
14
- const pnpPath = findPnpApiPath(cwd);
15
- dynamicRequire(pnpPath).setup();
16
- };
17
- const resolveSchematics = (cwd) => {
18
- try {
19
- return (0, node_path_2.join)((0, node_path_1.dirname)(dynamicRequire.resolve('@atls/schematics')), '..');
20
- }
21
- catch (error) {
22
- setupPnp(cwd);
23
- return (0, node_path_2.join)((0, node_path_1.dirname)(dynamicRequire.resolve('@atls/schematics')), '..');
24
- }
25
- };
26
- exports.resolveSchematics = resolveSchematics;
27
- //# sourceMappingURL=resolve.utils.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"resolve.utils.js","sourceRoot":"","sources":["../../src/utils/resolve.utils.ts"],"names":[],"mappings":";;;AAAA,yCAAmC;AACnC,yCAAmC;AAEnC,MAAM,cAAc,GAAG,IAAI,CAAC,SAAS,CAAC,CAAA;AAEtC,MAAM,cAAc,GAAG,CAAC,GAAY,EAAE,EAAE;IACtC,IAAI,OAAO,CAAC,QAAQ,CAAC,GAAG,EAAE;QACxB,OAAO,OAAO,CAAC,QAAQ,CAAC,CAAC,UAAU,CAAC,UAAU,CAAC,CAAC,cAAc,CAAC,QAAQ,EAAE,IAAI,CAAC,CAAA;KAC/E;IAED,OAAO,IAAA,gBAAI,EAAC,GAAG,IAAI,OAAO,CAAC,GAAG,EAAE,EAAE,UAAU,CAAC,CAAA;AAC/C,CAAC,CAAA;AAED,MAAM,QAAQ,GAAG,CAAC,GAAY,EAAE,EAAE;IAChC,MAAM,OAAO,GAAG,cAAc,CAAC,GAAG,CAAC,CAAA;IAEnC,cAAc,CAAC,OAAO,CAAC,CAAC,KAAK,EAAE,CAAA;AACjC,CAAC,CAAA;AAEM,MAAM,iBAAiB,GAAG,CAAC,GAAY,EAAE,EAAE;IAChD,IAAI;QACF,OAAO,IAAA,gBAAI,EAAC,IAAA,mBAAO,EAAC,cAAc,CAAC,OAAO,CAAC,kBAAkB,CAAC,CAAC,EAAE,IAAI,CAAC,CAAA;KACvE;IAAC,OAAO,KAAK,EAAE;QACd,QAAQ,CAAC,GAAG,CAAC,CAAA;QAEb,OAAO,IAAA,gBAAI,EAAC,IAAA,mBAAO,EAAC,cAAc,CAAC,OAAO,CAAC,kBAAkB,CAAC,CAAC,EAAE,IAAI,CAAC,CAAA;KACvE;AACH,CAAC,CAAA;AARY,QAAA,iBAAiB,qBAQ7B"}