@atls/code-schematics 1.0.0 → 2.0.2
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/CHANGELOG.md +23 -0
- package/dist/generated/index.d.ts +1 -0
- package/dist/generated/index.js +1 -0
- package/dist/generated/schematic-factory-export.d.ts +2 -0
- package/dist/generated/schematic-factory-export.js +6 -0
- package/dist/getters/index.d.ts +2 -0
- package/dist/getters/index.js +2 -0
- package/dist/getters/stream-report-callback.getter.d.ts +4 -0
- package/dist/getters/stream-report-callback.getter.js +20 -0
- package/dist/getters/stream-report-options.getter.d.ts +6 -0
- package/dist/getters/stream-report-options.getter.js +7 -0
- package/dist/helpers/events-log.helper.d.ts +2 -0
- package/dist/helpers/events-log.helper.js +20 -0
- package/dist/helpers/index.d.ts +3 -0
- package/dist/helpers/index.js +3 -0
- package/dist/helpers/prepare-tmp-dir.helper.d.ts +2 -0
- package/dist/helpers/prepare-tmp-dir.helper.js +8 -0
- package/dist/helpers/run-schematics.helper.d.ts +1 -0
- package/dist/helpers/run-schematics.helper.js +48 -0
- package/dist/helpers/write-tmp-schematic.helper.d.ts +2 -0
- package/dist/helpers/write-tmp-schematic.helper.js +11 -0
- package/dist/index.d.ts +4 -1
- package/dist/index.js +4 -1
- package/dist/schematic/index.d.ts +1 -0
- package/dist/schematic/index.js +1 -0
- package/dist/schematic/project/index.d.ts +1 -0
- package/dist/schematic/project/index.js +1 -0
- package/dist/schematic/project/project.factory.d.ts +2 -0
- package/dist/schematic/project/project.factory.js +11 -0
- package/dist/schematic/rules/index.d.ts +1 -0
- package/dist/schematic/rules/index.js +1 -0
- package/dist/schematic/rules/update-ts-config.rule.d.ts +2 -0
- package/dist/schematic/rules/update-ts-config.rule.js +7 -0
- package/dist/schematic/sources/generate-common.source.d.ts +2 -0
- package/dist/schematic/sources/generate-common.source.js +13 -0
- package/dist/schematic/sources/generate-project-specific.source.d.ts +2 -0
- package/dist/schematic/sources/generate-project-specific.source.js +19 -0
- package/dist/schematic/sources/index.d.ts +2 -0
- package/dist/schematic/sources/index.js +2 -0
- package/dist/schematic/utils/file.utils.d.ts +3 -0
- package/dist/schematic/utils/file.utils.js +6 -0
- package/dist/schematic/utils/gitignore.utils.d.ts +3 -0
- package/dist/schematic/utils/gitignore.utils.js +12 -0
- package/dist/schematic/utils/index.d.ts +5 -0
- package/dist/schematic/utils/index.js +5 -0
- package/dist/schematic/utils/json.utils.d.ts +6 -0
- package/dist/schematic/utils/json.utils.js +23 -0
- package/dist/schematic/utils/tsconfig.utils.d.ts +1 -0
- package/dist/schematic/utils/tsconfig.utils.js +5 -0
- package/dist/schematic/utils/yaml.utils.d.ts +5 -0
- package/dist/schematic/utils/yaml.utils.js +18 -0
- package/dist/scripts/build-steps/esbuild.build-step.d.ts +1 -0
- package/dist/scripts/build-steps/esbuild.build-step.js +17 -0
- package/dist/scripts/build-steps/index.d.ts +1 -0
- package/dist/scripts/build-steps/index.js +1 -0
- package/dist/scripts/exceptions/index.d.ts +1 -0
- package/dist/scripts/exceptions/index.js +1 -0
- package/dist/scripts/exceptions/undefined-build-result.exception.d.ts +3 -0
- package/dist/scripts/exceptions/undefined-build-result.exception.js +5 -0
- package/dist/scripts/getters/cjs-content.getter.d.ts +2 -0
- package/dist/scripts/getters/cjs-content.getter.js +4 -0
- package/dist/scripts/getters/encoded-content.getter.d.ts +1 -0
- package/dist/scripts/getters/encoded-content.getter.js +4 -0
- package/dist/scripts/getters/esbuild-config.getter.d.ts +2 -0
- package/dist/scripts/getters/esbuild-config.getter.js +32 -0
- package/dist/scripts/getters/generated-file-content.getter.d.ts +1 -0
- package/dist/scripts/getters/generated-file-content.getter.js +16 -0
- package/dist/scripts/getters/index.d.ts +4 -0
- package/dist/scripts/getters/index.js +4 -0
- package/dist/scripts/index.d.ts +1 -0
- package/dist/scripts/index.js +1 -0
- package/dist/scripts/schematic-build.script.d.ts +1 -0
- package/dist/scripts/schematic-build.script.js +72 -0
- package/dist/scripts/schematic-factory-build.script.d.ts +1 -0
- package/dist/scripts/schematic-factory-build.script.js +10 -0
- package/package.json +19 -4
- package/dist/migration-engine.host.d.ts +0 -4
- package/dist/migration-engine.host.js +0 -6
- package/dist/node-pnp-engine.host.d.ts +0 -16
- package/dist/node-pnp-engine.host.js +0 -89
- package/dist/schematics.d.ts +0 -9
- package/dist/schematics.js +0 -87
- package/dist/utils/collection.utils.d.ts +0 -6
- package/dist/utils/collection.utils.js +0 -40
- package/dist/utils/index.d.ts +0 -2
- package/dist/utils/index.js +0 -2
- package/dist/utils/resolve.utils.d.ts +0 -1
- package/dist/utils/resolve.utils.js +0 -22
|
@@ -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,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atls/code-schematics",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "2.0.2",
|
|
4
4
|
"license": "BSD-3-Clause",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"exports": {
|
|
@@ -15,17 +15,31 @@
|
|
|
15
15
|
"dist"
|
|
16
16
|
],
|
|
17
17
|
"scripts": {
|
|
18
|
-
"build": "yarn
|
|
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",
|
|
19
21
|
"prepack": "yarn run build",
|
|
20
22
|
"postpack": "rm -rf dist"
|
|
21
23
|
},
|
|
22
24
|
"dependencies": {
|
|
23
|
-
"@angular-devkit/core": "
|
|
24
|
-
"@angular-devkit/schematics": "
|
|
25
|
+
"@angular-devkit/core": "19.1.5",
|
|
26
|
+
"@angular-devkit/schematics": "19.1.5",
|
|
27
|
+
"strip-json-comments": "3.1.1"
|
|
25
28
|
},
|
|
26
29
|
"devDependencies": {
|
|
30
|
+
"@atls/code-runtime": "2.1.7",
|
|
31
|
+
"@types/node": "22.13.10",
|
|
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",
|
|
27
37
|
"rxjs": "7.8.1"
|
|
28
38
|
},
|
|
39
|
+
"peerDependencies": {
|
|
40
|
+
"@yarnpkg/cli": "*",
|
|
41
|
+
"@yarnpkg/core": "*"
|
|
42
|
+
},
|
|
29
43
|
"publishConfig": {
|
|
30
44
|
"exports": {
|
|
31
45
|
"./package.json": "./package.json",
|
|
@@ -37,5 +51,6 @@
|
|
|
37
51
|
},
|
|
38
52
|
"typings": "dist/index.d.ts"
|
|
39
53
|
},
|
|
54
|
+
"typecheckSkipLibCheck": true,
|
|
40
55
|
"typings": "dist/index.d.ts"
|
|
41
56
|
}
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
import type { FileSystemSchematicDesc } from '@angular-devkit/schematics/tools';
|
|
2
|
-
import { RuleFactory } from '@angular-devkit/schematics/';
|
|
3
|
-
import { FileSystemCollectionDesc } 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
|
-
}
|
|
@@ -1,89 +0,0 @@
|
|
|
1
|
-
import { dirname } from 'node:path';
|
|
2
|
-
import { join } from 'node:path';
|
|
3
|
-
import { resolve } from 'node:path';
|
|
4
|
-
import { ExportStringRef } from '@angular-devkit/schematics/tools';
|
|
5
|
-
import { CollectionCannotBeResolvedException } from '@angular-devkit/schematics/tools';
|
|
6
|
-
import { CollectionMissingSchematicsMapException } from '@angular-devkit/schematics/tools';
|
|
7
|
-
import { FileSystemEngineHostBase } from '@angular-devkit/schematics/tools';
|
|
8
|
-
import { SchematicMissingFieldsException } from '@angular-devkit/schematics/tools';
|
|
9
|
-
import { NodePackageDoesNotSupportSchematics } from '@angular-devkit/schematics/tools';
|
|
10
|
-
import { readJsonFile } from '@angular-devkit/schematics/tools/file-system-utility';
|
|
11
|
-
export class NodePnpEngineHost extends FileSystemEngineHostBase {
|
|
12
|
-
constructor(paths) {
|
|
13
|
-
super();
|
|
14
|
-
this.paths = paths;
|
|
15
|
-
}
|
|
16
|
-
resolve(name, requester, references = new Set()) {
|
|
17
|
-
if (requester) {
|
|
18
|
-
if (references.has(requester)) {
|
|
19
|
-
references.add(requester);
|
|
20
|
-
throw new Error(`Circular schematic reference detected: ${JSON.stringify(Array.from(references))}`);
|
|
21
|
-
}
|
|
22
|
-
else {
|
|
23
|
-
references.add(requester);
|
|
24
|
-
}
|
|
25
|
-
}
|
|
26
|
-
const relativeBase = requester ? dirname(requester) : process.cwd();
|
|
27
|
-
let collectionPath;
|
|
28
|
-
if (name.startsWith('.')) {
|
|
29
|
-
name = resolve(relativeBase, name);
|
|
30
|
-
}
|
|
31
|
-
const resolveOptions = {
|
|
32
|
-
paths: (requester ? [dirname(requester), ...(this.paths || [])] : this.paths)?.filter(Boolean),
|
|
33
|
-
};
|
|
34
|
-
try {
|
|
35
|
-
const packageJsonPath = require.resolve(join(name, 'package.json'), resolveOptions);
|
|
36
|
-
const { schematics } = require(packageJsonPath);
|
|
37
|
-
if (!schematics || typeof schematics !== 'string') {
|
|
38
|
-
throw new NodePackageDoesNotSupportSchematics(name);
|
|
39
|
-
}
|
|
40
|
-
collectionPath = this.resolve(schematics, packageJsonPath, references);
|
|
41
|
-
}
|
|
42
|
-
catch (e) {
|
|
43
|
-
if (e.code !== 'MODULE_NOT_FOUND') {
|
|
44
|
-
throw e;
|
|
45
|
-
}
|
|
46
|
-
}
|
|
47
|
-
if (!collectionPath) {
|
|
48
|
-
try {
|
|
49
|
-
collectionPath = require.resolve(name, resolveOptions);
|
|
50
|
-
}
|
|
51
|
-
catch (e) {
|
|
52
|
-
if (e.code !== 'MODULE_NOT_FOUND') {
|
|
53
|
-
throw e;
|
|
54
|
-
}
|
|
55
|
-
}
|
|
56
|
-
}
|
|
57
|
-
if (!collectionPath) {
|
|
58
|
-
throw new CollectionCannotBeResolvedException(name);
|
|
59
|
-
}
|
|
60
|
-
return collectionPath;
|
|
61
|
-
}
|
|
62
|
-
_resolveCollectionPath(name, requester) {
|
|
63
|
-
const collectionPath = this.resolve(name, requester);
|
|
64
|
-
readJsonFile(collectionPath);
|
|
65
|
-
return collectionPath;
|
|
66
|
-
}
|
|
67
|
-
_resolveReferenceString(refString, parentPath) {
|
|
68
|
-
const ref = new ExportStringRef(refString, parentPath);
|
|
69
|
-
if (!ref.ref) {
|
|
70
|
-
return null;
|
|
71
|
-
}
|
|
72
|
-
return { ref: ref.ref, path: ref.module };
|
|
73
|
-
}
|
|
74
|
-
_transformCollectionDescription(name, desc) {
|
|
75
|
-
if (!desc.schematics || typeof desc.schematics !== 'object') {
|
|
76
|
-
throw new CollectionMissingSchematicsMapException(name);
|
|
77
|
-
}
|
|
78
|
-
return {
|
|
79
|
-
...desc,
|
|
80
|
-
name,
|
|
81
|
-
};
|
|
82
|
-
}
|
|
83
|
-
_transformSchematicDescription(name, _collection, desc) {
|
|
84
|
-
if (!desc.factoryFn || !desc.path || !desc.description) {
|
|
85
|
-
throw new SchematicMissingFieldsException(name);
|
|
86
|
-
}
|
|
87
|
-
return desc;
|
|
88
|
-
}
|
|
89
|
-
}
|
package/dist/schematics.d.ts
DELETED
|
@@ -1,9 +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
|
-
}
|
package/dist/schematics.js
DELETED
|
@@ -1,87 +0,0 @@
|
|
|
1
|
-
import { dirname } from 'node:path';
|
|
2
|
-
import { join } from 'node:path';
|
|
3
|
-
import { NodeJsSyncHost } from '@angular-devkit/core/node';
|
|
4
|
-
import { NodeWorkflow } from '@angular-devkit/schematics/tools';
|
|
5
|
-
import { virtualFs } from '@angular-devkit/core';
|
|
6
|
-
import { lastValueFrom } from 'rxjs';
|
|
7
|
-
import { MigrationEngineHost } from './migration-engine.host.js';
|
|
8
|
-
import { NodePnpEngineHost } from './node-pnp-engine.host.js';
|
|
9
|
-
import { expandCollections } from './utils/index.js';
|
|
10
|
-
import { resolveSchematics } from './utils/index.js';
|
|
11
|
-
export class Schematics {
|
|
12
|
-
constructor(cwd, force = false, dryRun = false) {
|
|
13
|
-
this.cwd = cwd;
|
|
14
|
-
this.force = force;
|
|
15
|
-
this.dryRun = dryRun;
|
|
16
|
-
}
|
|
17
|
-
async init(schematic, options = {}) {
|
|
18
|
-
const host = new virtualFs.ScopedHost(new NodeJsSyncHost(), this.cwd);
|
|
19
|
-
const workflow = new NodeWorkflow(host, {
|
|
20
|
-
force: this.force,
|
|
21
|
-
dryRun: this.dryRun,
|
|
22
|
-
resolvePaths: [this.cwd],
|
|
23
|
-
schemaValidation: true,
|
|
24
|
-
engineHostCreator: ({ resolvePaths }) => new NodePnpEngineHost(resolvePaths),
|
|
25
|
-
});
|
|
26
|
-
const collection = resolveSchematics(this.cwd);
|
|
27
|
-
const events = [];
|
|
28
|
-
workflow.reporter.subscribe((event) => {
|
|
29
|
-
events.push(event);
|
|
30
|
-
});
|
|
31
|
-
await workflow
|
|
32
|
-
.execute({
|
|
33
|
-
collection,
|
|
34
|
-
schematic,
|
|
35
|
-
options: {
|
|
36
|
-
...options,
|
|
37
|
-
cwd: this.cwd,
|
|
38
|
-
},
|
|
39
|
-
allowPrivate: true,
|
|
40
|
-
debug: true,
|
|
41
|
-
})
|
|
42
|
-
.toPromise();
|
|
43
|
-
return events;
|
|
44
|
-
}
|
|
45
|
-
async migrate(schematicName, migrationVersion, options = {}) {
|
|
46
|
-
const host = new virtualFs.ScopedHost(new NodeJsSyncHost(), this.cwd);
|
|
47
|
-
const workflow = new NodeWorkflow(host, {
|
|
48
|
-
force: true,
|
|
49
|
-
dryRun: false,
|
|
50
|
-
engineHostCreator: ({ resolvePaths }) => new MigrationEngineHost(resolvePaths),
|
|
51
|
-
});
|
|
52
|
-
const events = [];
|
|
53
|
-
workflow.reporter.subscribe((event) => {
|
|
54
|
-
events.push(event);
|
|
55
|
-
});
|
|
56
|
-
const collections = expandCollections(this.cwd, resolveSchematics(this.cwd), schematicName);
|
|
57
|
-
const migrations = collections
|
|
58
|
-
.map((collection) => {
|
|
59
|
-
const schematic = collection.description.schematics[schematicName];
|
|
60
|
-
if (!schematic) {
|
|
61
|
-
return [];
|
|
62
|
-
}
|
|
63
|
-
const migrationsPath = join(dirname(collection.description.path), dirname(schematic.schema), 'migrations.json');
|
|
64
|
-
const data = require(migrationsPath);
|
|
65
|
-
return Object.keys(data.schematics)
|
|
66
|
-
.map((key) => ({
|
|
67
|
-
collection: migrationsPath,
|
|
68
|
-
schematic: key,
|
|
69
|
-
migration: data.schematics[key],
|
|
70
|
-
}))
|
|
71
|
-
.filter((config) => config.migration.version > migrationVersion);
|
|
72
|
-
})
|
|
73
|
-
.flat();
|
|
74
|
-
for (const migration of migrations) {
|
|
75
|
-
await lastValueFrom(workflow.execute({
|
|
76
|
-
collection: migration.collection,
|
|
77
|
-
schematic: migration.schematic,
|
|
78
|
-
debug: false,
|
|
79
|
-
options: {
|
|
80
|
-
...options,
|
|
81
|
-
cwd: this.cwd,
|
|
82
|
-
},
|
|
83
|
-
}));
|
|
84
|
-
}
|
|
85
|
-
return events;
|
|
86
|
-
}
|
|
87
|
-
}
|
|
@@ -1,6 +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>>;
|
|
@@ -1,40 +0,0 @@
|
|
|
1
|
-
import { NodeJsSyncHost } from '@angular-devkit/core/node';
|
|
2
|
-
import { NodeWorkflow } from '@angular-devkit/schematics/tools';
|
|
3
|
-
import { normalize } from '@angular-devkit/core';
|
|
4
|
-
import { schema } from '@angular-devkit/core';
|
|
5
|
-
import { virtualFs } from '@angular-devkit/core';
|
|
6
|
-
import { formats } from '@angular-devkit/schematics';
|
|
7
|
-
export const createCollection = (root, collectionName) => {
|
|
8
|
-
const fsHost = new virtualFs.ScopedHost(new NodeJsSyncHost(), normalize(root));
|
|
9
|
-
const workflow = new NodeWorkflow(fsHost, {
|
|
10
|
-
force: false,
|
|
11
|
-
dryRun: true,
|
|
12
|
-
packageManager: 'yarn',
|
|
13
|
-
root: normalize(root),
|
|
14
|
-
registry: new schema.CoreSchemaRegistry(formats.standardFormats),
|
|
15
|
-
});
|
|
16
|
-
return workflow.engine.createCollection(collectionName);
|
|
17
|
-
};
|
|
18
|
-
export const expandCollection = (cwd, collectionName) => {
|
|
19
|
-
const collection = createCollection(cwd, collectionName);
|
|
20
|
-
const collections = [collection];
|
|
21
|
-
if (collection.baseDescriptions) {
|
|
22
|
-
const baseCollections = collection.baseDescriptions
|
|
23
|
-
.map((base) => expandCollection(cwd, base.name))
|
|
24
|
-
.flat();
|
|
25
|
-
return [...collections, ...baseCollections];
|
|
26
|
-
}
|
|
27
|
-
return collections;
|
|
28
|
-
};
|
|
29
|
-
export const expandCollections = (cwd, collectionName, schematicName) => {
|
|
30
|
-
const collections = expandCollection(cwd, collectionName).reverse();
|
|
31
|
-
const nested = collections.map((collection) => {
|
|
32
|
-
const schematic = collection.description.schematics[schematicName];
|
|
33
|
-
if (schematic && schematic.extends) {
|
|
34
|
-
const [extendsCollection, extendsSchematic] = schematic.extends.split(':');
|
|
35
|
-
return expandCollections(cwd, extendsCollection, extendsSchematic);
|
|
36
|
-
}
|
|
37
|
-
return [];
|
|
38
|
-
});
|
|
39
|
-
return [...nested, collections].flat();
|
|
40
|
-
};
|
package/dist/utils/index.d.ts
DELETED
package/dist/utils/index.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export declare const resolveSchematics: (cwd?: string) => string;
|
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
import { dirname } from 'node:path';
|
|
2
|
-
import { join } from 'node:path';
|
|
3
|
-
const dynamicRequire = eval('require');
|
|
4
|
-
const findPnpApiPath = (cwd) => {
|
|
5
|
-
if (process.versions.pnp) {
|
|
6
|
-
return require('module').findPnpApi(__filename).resolveRequest('pnpapi', null);
|
|
7
|
-
}
|
|
8
|
-
return join(cwd || process.cwd(), '.pnp.cjs');
|
|
9
|
-
};
|
|
10
|
-
const setupPnp = (cwd) => {
|
|
11
|
-
const pnpPath = findPnpApiPath(cwd);
|
|
12
|
-
dynamicRequire(pnpPath).setup();
|
|
13
|
-
};
|
|
14
|
-
export const resolveSchematics = (cwd) => {
|
|
15
|
-
try {
|
|
16
|
-
return join(dirname(dynamicRequire.resolve('@atls/schematics')), '..');
|
|
17
|
-
}
|
|
18
|
-
catch (error) {
|
|
19
|
-
setupPnp(cwd);
|
|
20
|
-
return join(dirname(dynamicRequire.resolve('@atls/schematics')), '..');
|
|
21
|
-
}
|
|
22
|
-
};
|