@rxap/plugin-utilities 16.1.0-dev.2 → 16.1.0-dev.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/CHANGELOG.md +134 -0
- package/LICENSE.md +621 -0
- package/README.md +1 -1
- package/package.json +45 -31
- package/src/index.d.ts +9 -6
- package/src/index.js +11 -6
- package/src/index.js.map +1 -1
- package/src/lib/generators.d.ts +25 -0
- package/src/lib/generators.js +97 -0
- package/src/lib/generators.js.map +1 -0
- package/src/lib/get-direct-package-dependencies-for-project.js +5 -0
- package/src/lib/get-direct-package-dependencies-for-project.js.map +1 -1
- package/src/lib/guess-output-path.d.ts +3 -2
- package/src/lib/guess-output-path.js +20 -7
- package/src/lib/guess-output-path.js.map +1 -1
- package/src/lib/project-package-json.d.ts +2 -25
- package/src/lib/project-package-json.js +3 -2
- package/src/lib/project-package-json.js.map +1 -1
- package/src/lib/project-source-root-files.d.ts +3 -0
- package/src/lib/project-source-root-files.js +25 -0
- package/src/lib/project-source-root-files.js.map +1 -0
- package/src/lib/project-target.js +1 -1
- package/src/lib/project-target.js.map +1 -1
- package/src/lib/project.d.ts +1 -1
- package/src/lib/project.js +3 -1
- package/src/lib/project.js.map +1 -1
- package/src/lib/skip-non-generators-project.d.ts +3 -0
- package/src/lib/skip-non-generators-project.js +20 -0
- package/src/lib/skip-non-generators-project.js.map +1 -0
package/package.json
CHANGED
|
@@ -1,50 +1,64 @@
|
|
|
1
1
|
{
|
|
2
|
+
"version": "16.1.0-dev.20",
|
|
2
3
|
"name": "@rxap/plugin-utilities",
|
|
3
|
-
"version": "16.1.0-dev.2",
|
|
4
|
-
"type": "commonjs",
|
|
5
|
-
"publishConfig": {
|
|
6
|
-
"access": "public",
|
|
7
|
-
"directory": "../../../dist/packages/plugin/utilities"
|
|
8
|
-
},
|
|
9
|
-
"keywords": [
|
|
10
|
-
"rxap",
|
|
11
|
-
"packages",
|
|
12
|
-
"plugin",
|
|
13
|
-
"utilities"
|
|
14
|
-
],
|
|
15
|
-
"homepage": "https:/gitlab.com/rxap/packages/packages/plugin/utilities",
|
|
16
|
-
"bugs": {
|
|
17
|
-
"url": "https://gitlab.com/rxap/packages/-/issues",
|
|
18
|
-
"email": "incoming+rxap-packages-14898188-issue-@incoming.gitlab.com"
|
|
19
|
-
},
|
|
20
4
|
"license": "GPL-3.0-or-later",
|
|
21
|
-
"
|
|
22
|
-
"
|
|
23
|
-
"
|
|
24
|
-
"
|
|
5
|
+
"dependencies": {
|
|
6
|
+
"ignore": "^5.2.4",
|
|
7
|
+
"process": "0.11.10",
|
|
8
|
+
"semver": "^7.3.5",
|
|
9
|
+
"tslib": "2.6.2"
|
|
10
|
+
},
|
|
11
|
+
"peerDependencies": {
|
|
12
|
+
"@nx/devkit": "^16.5.0",
|
|
13
|
+
"@rxap/generator-utilities": "^1.1.0-dev.19",
|
|
14
|
+
"@rxap/node-utilities": "^1.1.0-dev.13",
|
|
15
|
+
"@rxap/workspace-utilities": "^0.1.0-dev.22",
|
|
16
|
+
"tslib": "2.6.2",
|
|
17
|
+
"@rxap/utilities": "16.0.0-dev.21"
|
|
25
18
|
},
|
|
26
19
|
"author": {
|
|
27
20
|
"name": "Merzough Münker",
|
|
28
21
|
"email": "mmuenker@digitaix.com"
|
|
29
22
|
},
|
|
30
|
-
"
|
|
31
|
-
"
|
|
32
|
-
"
|
|
33
|
-
"nx": "^16.5.0"
|
|
34
|
-
},
|
|
35
|
-
"dependencies": {
|
|
36
|
-
"ignore": "^5.2.4",
|
|
37
|
-
"tslib": "2.5.3"
|
|
23
|
+
"bugs": {
|
|
24
|
+
"url": "https://gitlab.com/rxap/packages/-/issues",
|
|
25
|
+
"email": "incoming+rxap-packages-14898188-issue-@incoming.gitlab.com"
|
|
38
26
|
},
|
|
27
|
+
"homepage": "https:/gitlab.com/rxap/packages/packages/plugin/utilities",
|
|
28
|
+
"keywords": [
|
|
29
|
+
"packages",
|
|
30
|
+
"plugin",
|
|
31
|
+
"plugin-utilities",
|
|
32
|
+
"rxap",
|
|
33
|
+
"utilities"
|
|
34
|
+
],
|
|
39
35
|
"nx-migrations": {
|
|
40
36
|
"packageGroup": [
|
|
37
|
+
{
|
|
38
|
+
"package": "@rxap/generator-utilities",
|
|
39
|
+
"version": "1.1.0-dev.19"
|
|
40
|
+
},
|
|
41
41
|
{
|
|
42
42
|
"package": "@rxap/node-utilities",
|
|
43
|
-
"version": "1.0
|
|
43
|
+
"version": "1.1.0-dev.13"
|
|
44
|
+
},
|
|
45
|
+
{
|
|
46
|
+
"package": "@rxap/workspace-utilities",
|
|
47
|
+
"version": "0.1.0-dev.22"
|
|
44
48
|
}
|
|
45
49
|
]
|
|
46
50
|
},
|
|
47
|
-
"
|
|
51
|
+
"publishConfig": {
|
|
52
|
+
"access": "public",
|
|
53
|
+
"directory": "../../../dist/packages/plugin/utilities"
|
|
54
|
+
},
|
|
55
|
+
"repository": {
|
|
56
|
+
"type": "git",
|
|
57
|
+
"url": "https://gitlab.com/rxap/packages.git",
|
|
58
|
+
"directory": "packages/plugin/utilities"
|
|
59
|
+
},
|
|
60
|
+
"type": "commonjs",
|
|
61
|
+
"gitHead": "786e69eb5b3d9ba24ef5d3c4972867da8082f25b",
|
|
48
62
|
"main": "./src/index.js",
|
|
49
63
|
"types": "./src/index.d.ts"
|
|
50
64
|
}
|
package/src/index.d.ts
CHANGED
|
@@ -1,10 +1,13 @@
|
|
|
1
|
-
export * from './lib/
|
|
1
|
+
export * from './lib/generators';
|
|
2
2
|
export * from './lib/get-all-package-dependencies-for-project';
|
|
3
|
-
export * from './lib/
|
|
4
|
-
export * from './lib/project';
|
|
5
|
-
export * from './lib/project-root-files';
|
|
3
|
+
export * from './lib/get-direct-package-dependencies-for-project';
|
|
6
4
|
export * from './lib/get-target-configuration-name-list';
|
|
7
5
|
export * from './lib/guess-output-path';
|
|
8
|
-
export * from './lib/
|
|
9
|
-
export * from './lib/project-target';
|
|
6
|
+
export * from './lib/project-package-json';
|
|
10
7
|
export * from './lib/project-package-name-mapping';
|
|
8
|
+
export * from './lib/project-root-files';
|
|
9
|
+
export * from './lib/project-source-root-files';
|
|
10
|
+
export * from './lib/project-target';
|
|
11
|
+
export * from './lib/project';
|
|
12
|
+
export * from './lib/skip-non-generators-project';
|
|
13
|
+
export * from './lib/yarn-run';
|
package/src/index.js
CHANGED
|
@@ -1,14 +1,19 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
const tslib_1 = require("tslib");
|
|
4
|
-
|
|
4
|
+
// region
|
|
5
|
+
tslib_1.__exportStar(require("./lib/generators"), exports);
|
|
5
6
|
tslib_1.__exportStar(require("./lib/get-all-package-dependencies-for-project"), exports);
|
|
6
|
-
tslib_1.__exportStar(require("./lib/
|
|
7
|
-
tslib_1.__exportStar(require("./lib/project"), exports);
|
|
8
|
-
tslib_1.__exportStar(require("./lib/project-root-files"), exports);
|
|
7
|
+
tslib_1.__exportStar(require("./lib/get-direct-package-dependencies-for-project"), exports);
|
|
9
8
|
tslib_1.__exportStar(require("./lib/get-target-configuration-name-list"), exports);
|
|
10
9
|
tslib_1.__exportStar(require("./lib/guess-output-path"), exports);
|
|
11
|
-
tslib_1.__exportStar(require("./lib/
|
|
12
|
-
tslib_1.__exportStar(require("./lib/project-target"), exports);
|
|
10
|
+
tslib_1.__exportStar(require("./lib/project-package-json"), exports);
|
|
13
11
|
tslib_1.__exportStar(require("./lib/project-package-name-mapping"), exports);
|
|
12
|
+
tslib_1.__exportStar(require("./lib/project-root-files"), exports);
|
|
13
|
+
tslib_1.__exportStar(require("./lib/project-source-root-files"), exports);
|
|
14
|
+
tslib_1.__exportStar(require("./lib/project-target"), exports);
|
|
15
|
+
tslib_1.__exportStar(require("./lib/project"), exports);
|
|
16
|
+
tslib_1.__exportStar(require("./lib/skip-non-generators-project"), exports);
|
|
17
|
+
tslib_1.__exportStar(require("./lib/yarn-run"), exports);
|
|
18
|
+
// endregion
|
|
14
19
|
//# sourceMappingURL=index.js.map
|
package/src/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../packages/plugin/utilities/src/index.ts"],"names":[],"mappings":";;;AAAA,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../packages/plugin/utilities/src/index.ts"],"names":[],"mappings":";;;AAAA,UAAU;AACV,2DAAiC;AACjC,yFAA+D;AAC/D,4FAAkE;AAClE,mFAAyD;AACzD,kEAAwC;AACxC,qEAA2C;AAC3C,6EAAmD;AACnD,mEAAyC;AACzC,0EAAgD;AAChD,+DAAqC;AACrC,wDAA8B;AAC9B,4EAAkD;AAClD,yDAA+B;AAC/B,YAAY"}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { ProjectConfiguration, Tree } from '@nx/devkit';
|
|
2
|
+
import { PackageJson } from '@rxap/workspace-utilities';
|
|
3
|
+
export interface PackageJsonWithGenerators extends PackageJson {
|
|
4
|
+
generators: string;
|
|
5
|
+
}
|
|
6
|
+
export declare function HasGeneratorProperty(packageJson: PackageJson): packageJson is PackageJsonWithGenerators;
|
|
7
|
+
export declare function GetGeneratorFilePath(projectRoot: string, packageJson: PackageJsonWithGenerators): string;
|
|
8
|
+
export declare function ExistsGeneratorFile(tree: Tree, projectRoot: string, packageJson: PackageJsonWithGenerators): boolean;
|
|
9
|
+
export interface GeneratorFile {
|
|
10
|
+
generators: Record<string, {
|
|
11
|
+
factory: string;
|
|
12
|
+
schema: string;
|
|
13
|
+
description: string;
|
|
14
|
+
}>;
|
|
15
|
+
schematics?: Record<string, {
|
|
16
|
+
factory: string;
|
|
17
|
+
schema: string;
|
|
18
|
+
description: string;
|
|
19
|
+
}>;
|
|
20
|
+
}
|
|
21
|
+
export declare function GetGeneratorFile(tree: Tree, projectRoot: string, packageJson: PackageJsonWithGenerators): GeneratorFile;
|
|
22
|
+
export declare function ProjectRootOrNameOrConfigurationToProjectRoot(tree: Tree, projectRootOrNameOrConfiguration: string | ProjectConfiguration): string;
|
|
23
|
+
export declare function GetGenerators(tree: Tree, projectRootOrNameOrConfiguration: string | ProjectConfiguration): GeneratorFile;
|
|
24
|
+
export declare function UpdateGenerators(tree: Tree, projectRootOrNameOrConfiguration: string | ProjectConfiguration, update: (generators: GeneratorFile) => GeneratorFile): void;
|
|
25
|
+
export declare function HasGenerators(tree: Tree, projectRootOrNameOrConfiguration: string | ProjectConfiguration): boolean;
|
|
@@ -0,0 +1,97 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.HasGenerators = exports.UpdateGenerators = exports.GetGenerators = exports.ProjectRootOrNameOrConfigurationToProjectRoot = exports.GetGeneratorFile = exports.ExistsGeneratorFile = exports.GetGeneratorFilePath = exports.HasGeneratorProperty = void 0;
|
|
4
|
+
const workspace_utilities_1 = require("@rxap/workspace-utilities");
|
|
5
|
+
const path_1 = require("path");
|
|
6
|
+
function HasGeneratorProperty(packageJson) {
|
|
7
|
+
return !!packageJson['generators'];
|
|
8
|
+
}
|
|
9
|
+
exports.HasGeneratorProperty = HasGeneratorProperty;
|
|
10
|
+
function GetGeneratorFilePath(projectRoot, packageJson) {
|
|
11
|
+
if (!packageJson['generators']) {
|
|
12
|
+
throw new Error(`The package.json of the project ${projectRoot} does not contains a generators property!`);
|
|
13
|
+
}
|
|
14
|
+
return (0, path_1.join)(projectRoot, packageJson['generators']);
|
|
15
|
+
}
|
|
16
|
+
exports.GetGeneratorFilePath = GetGeneratorFilePath;
|
|
17
|
+
function ExistsGeneratorFile(tree, projectRoot, packageJson) {
|
|
18
|
+
return tree.exists(GetGeneratorFilePath(projectRoot, packageJson));
|
|
19
|
+
}
|
|
20
|
+
exports.ExistsGeneratorFile = ExistsGeneratorFile;
|
|
21
|
+
function GetGeneratorFile(tree, projectRoot, packageJson) {
|
|
22
|
+
var _a;
|
|
23
|
+
const generatorFile = GetGeneratorFilePath(projectRoot, packageJson);
|
|
24
|
+
const content = (_a = tree.read(generatorFile)) === null || _a === void 0 ? void 0 : _a.toString('utf-8');
|
|
25
|
+
if (!content) {
|
|
26
|
+
throw new Error(`The generator file ${generatorFile} does not exists!`);
|
|
27
|
+
}
|
|
28
|
+
try {
|
|
29
|
+
return JSON.parse(content);
|
|
30
|
+
}
|
|
31
|
+
catch (e) {
|
|
32
|
+
throw new Error(`The generator file ${generatorFile} is not valid json!: ${e.message}`);
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
exports.GetGeneratorFile = GetGeneratorFile;
|
|
36
|
+
function ProjectRootOrNameOrConfigurationToProjectRoot(tree, projectRootOrNameOrConfiguration) {
|
|
37
|
+
if (typeof projectRootOrNameOrConfiguration === 'string') {
|
|
38
|
+
if (projectRootOrNameOrConfiguration.match(/^\/?([^/]+\/)+[^/]+/)) {
|
|
39
|
+
return projectRootOrNameOrConfiguration;
|
|
40
|
+
}
|
|
41
|
+
else {
|
|
42
|
+
const project = (0, workspace_utilities_1.GetProject)(tree, projectRootOrNameOrConfiguration);
|
|
43
|
+
if (project) {
|
|
44
|
+
return project.root;
|
|
45
|
+
}
|
|
46
|
+
else {
|
|
47
|
+
throw new Error(`The project ${projectRootOrNameOrConfiguration} does not exists!`);
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
else {
|
|
52
|
+
return projectRootOrNameOrConfiguration.root;
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
exports.ProjectRootOrNameOrConfigurationToProjectRoot = ProjectRootOrNameOrConfigurationToProjectRoot;
|
|
56
|
+
function GetGenerators(tree, projectRootOrNameOrConfiguration) {
|
|
57
|
+
const projectRoot = ProjectRootOrNameOrConfigurationToProjectRoot(tree, projectRootOrNameOrConfiguration);
|
|
58
|
+
const packageJson = (0, workspace_utilities_1.GetPackageJson)(tree, projectRoot);
|
|
59
|
+
if (!HasGeneratorProperty(packageJson)) {
|
|
60
|
+
throw new Error(`The project ${projectRoot} does not contains a generators property!`);
|
|
61
|
+
}
|
|
62
|
+
if (!ExistsGeneratorFile(tree, projectRoot, packageJson)) {
|
|
63
|
+
throw new Error(`The generator file ${GetGeneratorFilePath(projectRoot, packageJson)} does not exists!`);
|
|
64
|
+
}
|
|
65
|
+
return GetGeneratorFile(tree, projectRoot, packageJson);
|
|
66
|
+
}
|
|
67
|
+
exports.GetGenerators = GetGenerators;
|
|
68
|
+
function UpdateGenerators(tree, projectRootOrNameOrConfiguration, update) {
|
|
69
|
+
const projectRoot = ProjectRootOrNameOrConfigurationToProjectRoot(tree, projectRootOrNameOrConfiguration);
|
|
70
|
+
const packageJson = (0, workspace_utilities_1.GetPackageJson)(tree, projectRoot);
|
|
71
|
+
if (!HasGeneratorProperty(packageJson)) {
|
|
72
|
+
throw new Error(`The project ${projectRoot} does not contains a generators property!`);
|
|
73
|
+
}
|
|
74
|
+
if (!ExistsGeneratorFile(tree, projectRoot, packageJson)) {
|
|
75
|
+
throw new Error(`The generator file ${GetGeneratorFilePath(projectRoot, packageJson)} does not exists!`);
|
|
76
|
+
}
|
|
77
|
+
const generators = GetGeneratorFile(tree, projectRoot, packageJson);
|
|
78
|
+
tree.write(GetGeneratorFilePath(projectRoot, packageJson), JSON.stringify(update(generators), null, 2) + '\n');
|
|
79
|
+
}
|
|
80
|
+
exports.UpdateGenerators = UpdateGenerators;
|
|
81
|
+
function HasGenerators(tree, projectRootOrNameOrConfiguration) {
|
|
82
|
+
const projectRoot = ProjectRootOrNameOrConfigurationToProjectRoot(tree, projectRootOrNameOrConfiguration);
|
|
83
|
+
const packageJson = (0, workspace_utilities_1.GetPackageJson)(tree, projectRoot);
|
|
84
|
+
if (!HasGeneratorProperty(packageJson)) {
|
|
85
|
+
return false;
|
|
86
|
+
}
|
|
87
|
+
if (!ExistsGeneratorFile(tree, projectRoot, packageJson)) {
|
|
88
|
+
return false;
|
|
89
|
+
}
|
|
90
|
+
const generators = GetGeneratorFile(tree, projectRoot, packageJson);
|
|
91
|
+
if (!Object.keys(generators.generators).length) {
|
|
92
|
+
return false;
|
|
93
|
+
}
|
|
94
|
+
return true;
|
|
95
|
+
}
|
|
96
|
+
exports.HasGenerators = HasGenerators;
|
|
97
|
+
//# sourceMappingURL=generators.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"generators.js","sourceRoot":"","sources":["../../../../../../packages/plugin/utilities/src/lib/generators.ts"],"names":[],"mappings":"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"}
|
|
@@ -1,6 +1,9 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.getDirectPackageDependenciesForProject = void 0;
|
|
4
|
+
const fs_1 = require("fs");
|
|
5
|
+
const path_1 = require("path");
|
|
6
|
+
const project_1 = require("./project");
|
|
4
7
|
const project_package_json_1 = require("./project-package-json");
|
|
5
8
|
/**
|
|
6
9
|
* Get the direct package dependencies for the project.
|
|
@@ -24,7 +27,9 @@ function getDirectPackageDependenciesForProject(context, projectName = context.p
|
|
|
24
27
|
return projectGraph.dependencies[projectName]
|
|
25
28
|
.filter(dependency => !dependency.target.startsWith('npm:'))
|
|
26
29
|
.map(dependency => dependency.target)
|
|
30
|
+
.filter(name => (0, fs_1.existsSync)((0, path_1.join)(context.root, (0, project_1.GetProjectRoot)(context, name), 'package.json')))
|
|
27
31
|
.map(projectName => (0, project_package_json_1.readPackageJsonForProject)(context, projectName))
|
|
32
|
+
.filter(packageJson => !!packageJson.name && packageJson.version)
|
|
28
33
|
.reduce((acc, { name, version, }) => (Object.assign(Object.assign({}, acc), { [name]: version })), {});
|
|
29
34
|
}
|
|
30
35
|
exports.getDirectPackageDependenciesForProject = getDirectPackageDependenciesForProject;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"get-direct-package-dependencies-for-project.js","sourceRoot":"","sources":["../../../../../../packages/plugin/utilities/src/lib/get-direct-package-dependencies-for-project.ts"],"names":[],"mappings":";;;AACA,iEAAmE;AAEnE;;;;;;;GAOG;AACH,SAAgB,sCAAsC,CACpD,OAAwB,EACxB,WAAW,GAAG,OAAO,CAAC,WAAW;IAEjC,MAAM,EAAE,YAAY,EAAE,GAAG,OAAO,CAAC;IAEjC,IAAI,CAAC,YAAY,EAAE;QACjB,MAAM,IAAI,KAAK,CAAC,6FAA6F,CAAC,CAAC;KAChH;IAED,IAAI,CAAC,WAAW,EAAE;QAChB,MAAM,IAAI,KAAK,CAAC,2FAA2F,CAAC,CAAC;KAC9G;IAED,IAAI,CAAC,YAAY,CAAC,YAAY,CAAC,WAAW,CAAC,EAAE;QAC3C,MAAM,IAAI,KAAK,CAAC,eAAgB,WAAY,sCAAsC,CAAC,CAAC;KACrF;IAED,OAAO,YAAY,CAAC,YAAY,CAAC,WAAW,CAAC;SAC1C,MAAM,CAAC,UAAU,CAAC,EAAE,CAAC,CAAC,UAAU,CAAC,MAAM,CAAC,UAAU,CAAC,MAAM,CAAC,CAAC;SAC3D,GAAG,CAAC,UAAU,CAAC,EAAE,CAAC,UAAU,CAAC,MAAM,CAAC;SACpC,GAAG,CAAC,WAAW,CAAC,EAAE,CAAC,IAAA,gDAAyB,EAAC,OAAO,EAAE,WAAW,CAAC,CAAC;
|
|
1
|
+
{"version":3,"file":"get-direct-package-dependencies-for-project.js","sourceRoot":"","sources":["../../../../../../packages/plugin/utilities/src/lib/get-direct-package-dependencies-for-project.ts"],"names":[],"mappings":";;;AACA,2BAAgC;AAChC,+BAA4B;AAC5B,uCAA2C;AAC3C,iEAAmE;AAEnE;;;;;;;GAOG;AACH,SAAgB,sCAAsC,CACpD,OAAwB,EACxB,WAAW,GAAG,OAAO,CAAC,WAAW;IAEjC,MAAM,EAAE,YAAY,EAAE,GAAG,OAAO,CAAC;IAEjC,IAAI,CAAC,YAAY,EAAE;QACjB,MAAM,IAAI,KAAK,CAAC,6FAA6F,CAAC,CAAC;KAChH;IAED,IAAI,CAAC,WAAW,EAAE;QAChB,MAAM,IAAI,KAAK,CAAC,2FAA2F,CAAC,CAAC;KAC9G;IAED,IAAI,CAAC,YAAY,CAAC,YAAY,CAAC,WAAW,CAAC,EAAE;QAC3C,MAAM,IAAI,KAAK,CAAC,eAAgB,WAAY,sCAAsC,CAAC,CAAC;KACrF;IAED,OAAO,YAAY,CAAC,YAAY,CAAC,WAAW,CAAC;SAC1C,MAAM,CAAC,UAAU,CAAC,EAAE,CAAC,CAAC,UAAU,CAAC,MAAM,CAAC,UAAU,CAAC,MAAM,CAAC,CAAC;SAC3D,GAAG,CAAC,UAAU,CAAC,EAAE,CAAC,UAAU,CAAC,MAAM,CAAC;SACpC,MAAM,CAAC,IAAI,CAAC,EAAE,CAAC,IAAA,eAAU,EAAC,IAAA,WAAI,EAAC,OAAO,CAAC,IAAI,EAAE,IAAA,wBAAc,EAAC,OAAO,EAAE,IAAI,CAAC,EAAE,cAAc,CAAC,CAAC,CAAC;SAC7F,GAAG,CAAC,WAAW,CAAC,EAAE,CAAC,IAAA,gDAAyB,EAAC,OAAO,EAAE,WAAW,CAAQ,CAAC;SAC1E,MAAM,CAAC,WAAW,CAAC,EAAE,CAAC,CAAC,CAAC,WAAW,CAAC,IAAI,IAAI,WAAW,CAAC,OAAO,CAAC;SAChE,MAAM,CAAC,CACN,GAAG,EACH,EACE,IAAI,EACJ,OAAO,GAC2B,EACpC,EAAE,CAAC,iCACA,GAAG,KACN,CAAC,IAAI,CAAC,EAAE,OAAO,IACf,EAAE,EAAE,CAAC,CAAC;AACZ,CAAC;AAlCD,wFAkCC"}
|
|
@@ -1,2 +1,3 @@
|
|
|
1
|
-
import { ExecutorContext } from '@nx/devkit';
|
|
2
|
-
export declare function
|
|
1
|
+
import { ExecutorContext, TargetConfiguration } from '@nx/devkit';
|
|
2
|
+
export declare function GuessOutputPathFromContext(context: ExecutorContext, projectName?: string | undefined, configurationName?: string | undefined): string;
|
|
3
|
+
export declare function GuessOutputPath(projectRoot: string, buildTarget: TargetConfiguration, configurationName?: string): string;
|
|
@@ -1,9 +1,11 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.GuessOutputPath = void 0;
|
|
3
|
+
exports.GuessOutputPath = exports.GuessOutputPathFromContext = void 0;
|
|
4
|
+
const path_1 = require("path");
|
|
4
5
|
const get_target_configuration_name_list_1 = require("./get-target-configuration-name-list");
|
|
6
|
+
const project_1 = require("./project");
|
|
5
7
|
const project_target_1 = require("./project-target");
|
|
6
|
-
function
|
|
8
|
+
function GuessOutputPathFromContext(context, projectName = context.projectName, configurationName = context.configurationName) {
|
|
7
9
|
if (!projectName) {
|
|
8
10
|
throw new Error('The projectName is undefined. Ensure the projectName is passed into the executor context.');
|
|
9
11
|
}
|
|
@@ -11,21 +13,32 @@ function GuessOutputPath(context, projectName = context.projectName) {
|
|
|
11
13
|
if (!buildTarget) {
|
|
12
14
|
throw new Error(`Could not find target 'build' for project '${projectName}'`);
|
|
13
15
|
}
|
|
14
|
-
|
|
16
|
+
const projectRoot = (0, project_1.GetProjectRoot)(context, projectName);
|
|
17
|
+
return GuessOutputPath(projectRoot, buildTarget, configurationName);
|
|
18
|
+
}
|
|
19
|
+
exports.GuessOutputPathFromContext = GuessOutputPathFromContext;
|
|
20
|
+
function GuessOutputPath(projectRoot, buildTarget, configurationName) {
|
|
21
|
+
let outputPath = (0, get_target_configuration_name_list_1.GetTargetOptions)(buildTarget, configurationName)['outputPath'];
|
|
15
22
|
if (!outputPath) {
|
|
16
|
-
console.warn('Could not find outputPath in build target options.');
|
|
17
23
|
if (buildTarget.outputs && buildTarget.outputs.length) {
|
|
18
24
|
const [output] = buildTarget.outputs;
|
|
19
|
-
|
|
25
|
+
if (output.match(/\.[a-zA-Z]+$/)) {
|
|
26
|
+
outputPath = (0, path_1.dirname)(output);
|
|
27
|
+
}
|
|
28
|
+
else {
|
|
29
|
+
outputPath = output;
|
|
30
|
+
}
|
|
20
31
|
}
|
|
21
32
|
else {
|
|
22
|
-
|
|
33
|
+
outputPath = (0, path_1.join)('dist', projectRoot);
|
|
23
34
|
}
|
|
24
35
|
}
|
|
25
36
|
if (typeof outputPath !== 'string') {
|
|
26
37
|
throw new Error(`The outputPath is not a string. Found: ${outputPath}`);
|
|
27
38
|
}
|
|
28
|
-
return outputPath
|
|
39
|
+
return outputPath
|
|
40
|
+
.replace(/\{projectRoot}/, projectRoot)
|
|
41
|
+
.replace(/\{workspaceRoot}\//, '');
|
|
29
42
|
}
|
|
30
43
|
exports.GuessOutputPath = GuessOutputPath;
|
|
31
44
|
//# sourceMappingURL=guess-output-path.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"guess-output-path.js","sourceRoot":"","sources":["../../../../../../packages/plugin/utilities/src/lib/guess-output-path.ts"],"names":[],"mappings":";;;
|
|
1
|
+
{"version":3,"file":"guess-output-path.js","sourceRoot":"","sources":["../../../../../../packages/plugin/utilities/src/lib/guess-output-path.ts"],"names":[],"mappings":";;;AAIA,+BAGc;AACd,6FAAwE;AACxE,uCAA2C;AAC3C,qDAAoD;AAGpD,SAAgB,0BAA0B,CACxC,OAAwB,EACxB,WAAW,GAAG,OAAO,CAAC,WAAW,EACjC,iBAAiB,GAAG,OAAO,CAAC,iBAAiB;IAG7C,IAAI,CAAC,WAAW,EAAE;QAChB,MAAM,IAAI,KAAK,CAAC,2FAA2F,CAAC,CAAC;KAC9G;IAED,MAAM,WAAW,GAAG,IAAA,iCAAgB,EAAC,OAAO,EAAE,WAAW,EAAE,OAAO,CAAC,CAAC;IAEpE,IAAI,CAAC,WAAW,EAAE;QAChB,MAAM,IAAI,KAAK,CAAC,8CAA+C,WAAY,GAAG,CAAC,CAAC;KACjF;IAED,MAAM,WAAW,GAAG,IAAA,wBAAc,EAAC,OAAO,EAAE,WAAW,CAAC,CAAC;IAEzD,OAAO,eAAe,CAAC,WAAW,EAAE,WAAW,EAAE,iBAAiB,CAAC,CAAC;AAEtE,CAAC;AApBD,gEAoBC;AAED,SAAgB,eAAe,CAAC,WAAmB,EAAE,WAAgC,EAAE,iBAA0B;IAE/G,IAAI,UAAU,GAAG,IAAA,qDAAgB,EAAC,WAAW,EAAE,iBAAiB,CAAC,CAAC,YAAY,CAAC,CAAC;IAEhF,IAAI,CAAC,UAAU,EAAE;QACf,IAAI,WAAW,CAAC,OAAO,IAAI,WAAW,CAAC,OAAO,CAAC,MAAM,EAAE;YACrD,MAAM,CAAE,MAAM,CAAE,GAAG,WAAW,CAAC,OAAO,CAAC;YACvC,IAAI,MAAM,CAAC,KAAK,CAAC,cAAc,CAAC,EAAE;gBAChC,UAAU,GAAG,IAAA,cAAO,EAAC,MAAM,CAAC,CAAC;aAC9B;iBAAM;gBACL,UAAU,GAAG,MAAM,CAAC;aACrB;SACF;aAAM;YACL,UAAU,GAAG,IAAA,WAAI,EAAC,MAAM,EAAE,WAAW,CAAC,CAAC;SACxC;KACF;IAED,IAAI,OAAO,UAAU,KAAK,QAAQ,EAAE;QAClC,MAAM,IAAI,KAAK,CAAC,0CAA2C,UAAW,EAAE,CAAC,CAAC;KAC3E;IAED,OAAO,UAAU;SACd,OAAO,CAAC,gBAAgB,EAAE,WAAW,CAAC;SACtC,OAAO,CAAC,oBAAoB,EAAE,EAAE,CAAC,CAAC;AAEvC,CAAC;AAzBD,0CAyBC"}
|
|
@@ -1,23 +1,6 @@
|
|
|
1
1
|
import { ExecutorContext } from '@nx/devkit';
|
|
2
|
-
import { PackageJson } from '
|
|
3
|
-
export interface ProjectPackageJsonPerson {
|
|
4
|
-
name?: string;
|
|
5
|
-
email?: string;
|
|
6
|
-
url?: string;
|
|
7
|
-
}
|
|
2
|
+
import { PackageJson } from '@rxap/workspace-utilities';
|
|
8
3
|
export interface ProjectPackageJson extends PackageJson {
|
|
9
|
-
publishConfig?: {
|
|
10
|
-
access?: 'public' | 'restricted';
|
|
11
|
-
directory?: string;
|
|
12
|
-
};
|
|
13
|
-
author?: string | ProjectPackageJsonPerson;
|
|
14
|
-
keywords?: string[];
|
|
15
|
-
homepage?: string;
|
|
16
|
-
bugs?: {
|
|
17
|
-
url?: string;
|
|
18
|
-
email?: string;
|
|
19
|
-
};
|
|
20
|
-
contributors?: string[] | ProjectPackageJsonPerson[];
|
|
21
4
|
funding?: string | {
|
|
22
5
|
type: string;
|
|
23
6
|
url: string;
|
|
@@ -25,12 +8,6 @@ export interface ProjectPackageJson extends PackageJson {
|
|
|
25
8
|
type: string;
|
|
26
9
|
url: string;
|
|
27
10
|
}[];
|
|
28
|
-
repository?: string | {
|
|
29
|
-
type: string;
|
|
30
|
-
url: string;
|
|
31
|
-
directory?: string;
|
|
32
|
-
};
|
|
33
|
-
description?: string;
|
|
34
11
|
}
|
|
35
12
|
export declare function readPackageJsonForProject(context: ExecutorContext, projectName?: string | undefined): ProjectPackageJson;
|
|
36
|
-
export declare function writePackageJsonFormProject<T = ProjectPackageJson>(context: ExecutorContext, content: T, projectName?: string | undefined): void;
|
|
13
|
+
export declare function writePackageJsonFormProject<T extends ProjectPackageJson = ProjectPackageJson>(context: ExecutorContext, content: T, projectName?: string | undefined): void;
|
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.writePackageJsonFormProject = exports.readPackageJsonForProject = void 0;
|
|
4
|
-
const path_1 = require("path");
|
|
5
4
|
const node_utilities_1 = require("@rxap/node-utilities");
|
|
5
|
+
const workspace_utilities_1 = require("@rxap/workspace-utilities");
|
|
6
|
+
const path_1 = require("path");
|
|
6
7
|
const project_1 = require("./project");
|
|
7
8
|
function readPackageJsonForProject(context, projectName = context.projectName) {
|
|
8
9
|
const packageJsonPath = (0, path_1.join)(context.root, (0, project_1.GetProjectRoot)(context, projectName), 'package.json');
|
|
@@ -11,7 +12,7 @@ function readPackageJsonForProject(context, projectName = context.projectName) {
|
|
|
11
12
|
exports.readPackageJsonForProject = readPackageJsonForProject;
|
|
12
13
|
function writePackageJsonFormProject(context, content, projectName = context.projectName) {
|
|
13
14
|
const packageJsonPath = (0, path_1.join)(context.root, (0, project_1.GetProjectRoot)(context, projectName), 'package.json');
|
|
14
|
-
(0, node_utilities_1.writeJsonFile)(packageJsonPath, content);
|
|
15
|
+
(0, node_utilities_1.writeJsonFile)(packageJsonPath, (0, workspace_utilities_1.CleanupPackageJsonFile)(content));
|
|
15
16
|
}
|
|
16
17
|
exports.writePackageJsonFormProject = writePackageJsonFormProject;
|
|
17
18
|
//# sourceMappingURL=project-package-json.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"project-package-json.js","sourceRoot":"","sources":["../../../../../../packages/plugin/utilities/src/lib/project-package-json.ts"],"names":[],"mappings":";;;
|
|
1
|
+
{"version":3,"file":"project-package-json.js","sourceRoot":"","sources":["../../../../../../packages/plugin/utilities/src/lib/project-package-json.ts"],"names":[],"mappings":";;;AACA,yDAG8B;AAC9B,mEAGmC;AACnC,+BAA4B;AAC5B,uCAA2C;AAM3C,SAAgB,yBAAyB,CACvC,OAAwB,EACxB,WAAW,GAAG,OAAO,CAAC,WAAW;IAEjC,MAAM,eAAe,GAAG,IAAA,WAAI,EAAC,OAAO,CAAC,IAAI,EAAE,IAAA,wBAAc,EAAC,OAAO,EAAE,WAAW,CAAC,EAAE,cAAc,CAAC,CAAC;IACjG,OAAO,IAAA,yBAAQ,EAAC,eAAe,CAAC,CAAC;AACnC,CAAC;AAND,8DAMC;AAED,SAAgB,2BAA2B,CACzC,OAAwB,EACxB,OAAU,EACV,WAAW,GAAG,OAAO,CAAC,WAAW;IAEjC,MAAM,eAAe,GAAG,IAAA,WAAI,EAAC,OAAO,CAAC,IAAI,EAAE,IAAA,wBAAc,EAAC,OAAO,EAAE,WAAW,CAAC,EAAE,cAAc,CAAC,CAAC;IACjG,IAAA,8BAAa,EAAI,eAAe,EAAE,IAAA,4CAAsB,EAAC,OAAO,CAAC,CAAC,CAAC;AACrE,CAAC;AAPD,kEAOC"}
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import { ExecutorContext } from '@nx/devkit';
|
|
2
|
+
export declare function ReadFileFromProjectSourceRoot(context: ExecutorContext, fileName: string, requiredOrDefaultContent?: string | true): string;
|
|
3
|
+
export declare function WriteFileToProjectSourceRoot(context: ExecutorContext, fileName: string, content: string): void;
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.WriteFileToProjectSourceRoot = exports.ReadFileFromProjectSourceRoot = void 0;
|
|
4
|
+
const fs_1 = require("fs");
|
|
5
|
+
const path_1 = require("path");
|
|
6
|
+
const project_1 = require("./project");
|
|
7
|
+
function ReadFileFromProjectSourceRoot(context, fileName, requiredOrDefaultContent = '') {
|
|
8
|
+
const projectSourceRoot = (0, project_1.GetProjectSourceRoot)(context);
|
|
9
|
+
const filePath = (0, path_1.join)(context.root, projectSourceRoot, fileName);
|
|
10
|
+
if (!(0, fs_1.existsSync)(filePath)) {
|
|
11
|
+
if (requiredOrDefaultContent === true) {
|
|
12
|
+
throw new Error(`The file ${filePath} not exists!`);
|
|
13
|
+
}
|
|
14
|
+
return requiredOrDefaultContent;
|
|
15
|
+
}
|
|
16
|
+
return (0, fs_1.readFileSync)(filePath, 'utf-8');
|
|
17
|
+
}
|
|
18
|
+
exports.ReadFileFromProjectSourceRoot = ReadFileFromProjectSourceRoot;
|
|
19
|
+
function WriteFileToProjectSourceRoot(context, fileName, content) {
|
|
20
|
+
const projectSourceRoot = (0, project_1.GetProjectSourceRoot)(context);
|
|
21
|
+
const filePath = (0, path_1.join)(context.root, projectSourceRoot, fileName);
|
|
22
|
+
(0, fs_1.writeFileSync)(filePath, content);
|
|
23
|
+
}
|
|
24
|
+
exports.WriteFileToProjectSourceRoot = WriteFileToProjectSourceRoot;
|
|
25
|
+
//# sourceMappingURL=project-source-root-files.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"project-source-root-files.js","sourceRoot":"","sources":["../../../../../../packages/plugin/utilities/src/lib/project-source-root-files.ts"],"names":[],"mappings":";;;AACA,2BAIY;AACZ,+BAA4B;AAC5B,uCAAiD;AAEjD,SAAgB,6BAA6B,CAC3C,OAAwB,EACxB,QAAgB,EAChB,2BAA0C,EAAE;IAE5C,MAAM,iBAAiB,GAAG,IAAA,8BAAoB,EAAC,OAAO,CAAC,CAAC;IACxD,MAAM,QAAQ,GAAG,IAAA,WAAI,EAAC,OAAO,CAAC,IAAI,EAAE,iBAAiB,EAAE,QAAQ,CAAC,CAAC;IACjE,IAAI,CAAC,IAAA,eAAU,EAAC,QAAQ,CAAC,EAAE;QACzB,IAAI,wBAAwB,KAAK,IAAI,EAAE;YACrC,MAAM,IAAI,KAAK,CAAC,YAAa,QAAS,cAAc,CAAC,CAAC;SACvD;QACD,OAAO,wBAAwB,CAAC;KACjC;IACD,OAAO,IAAA,iBAAY,EAAC,QAAQ,EAAE,OAAO,CAAC,CAAC;AACzC,CAAC;AAdD,sEAcC;AAED,SAAgB,4BAA4B,CAAC,OAAwB,EAAE,QAAgB,EAAE,OAAe;IACtG,MAAM,iBAAiB,GAAG,IAAA,8BAAoB,EAAC,OAAO,CAAC,CAAC;IACxD,MAAM,QAAQ,GAAG,IAAA,WAAI,EAAC,OAAO,CAAC,IAAI,EAAE,iBAAiB,EAAE,QAAQ,CAAC,CAAC;IACjE,IAAA,kBAAa,EAAC,QAAQ,EAAE,OAAO,CAAC,CAAC;AACnC,CAAC;AAJD,oEAIC"}
|
|
@@ -7,7 +7,7 @@ function GetProjectTarget(context, projectName, targetName) {
|
|
|
7
7
|
const projectConfiguration = (0, project_1.GetProjectConfiguration)(context, projectName);
|
|
8
8
|
const targetConfiguration = projectConfiguration.targets ? projectConfiguration.targets[targetName] : undefined;
|
|
9
9
|
if (!targetConfiguration) {
|
|
10
|
-
throw new Error(`The target configuration for target '${targetName}' not found!`);
|
|
10
|
+
throw new Error(`The target configuration for target '${targetName}' in project '${projectName}' not found!`);
|
|
11
11
|
}
|
|
12
12
|
return targetConfiguration;
|
|
13
13
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"project-target.js","sourceRoot":"","sources":["../../../../../../packages/plugin/utilities/src/lib/project-target.ts"],"names":[],"mappings":";;;AACA,6FAAwE;AACxE,uCAAoD;AAEpD,SAAgB,gBAAgB,CAAC,OAAwB,EAAE,WAAmB,EAAE,UAAkB;IAChG,MAAM,oBAAoB,GAAG,IAAA,iCAAuB,EAAC,OAAO,EAAE,WAAW,CAAC,CAAC;IAE3E,MAAM,mBAAmB,GAAG,oBAAoB,CAAC,OAAO,CAAC,CAAC,CAAC,oBAAoB,CAAC,OAAO,CAAC,UAAU,CAAC,CAAC,CAAC,CAAC,SAAS,CAAC;IAEhH,IAAI,CAAC,mBAAmB,EAAE;QACxB,MAAM,IAAI,KAAK,CAAC,wCAAyC,UAAW,cAAc,CAAC,CAAC;
|
|
1
|
+
{"version":3,"file":"project-target.js","sourceRoot":"","sources":["../../../../../../packages/plugin/utilities/src/lib/project-target.ts"],"names":[],"mappings":";;;AACA,6FAAwE;AACxE,uCAAoD;AAEpD,SAAgB,gBAAgB,CAAC,OAAwB,EAAE,WAAmB,EAAE,UAAkB;IAChG,MAAM,oBAAoB,GAAG,IAAA,iCAAuB,EAAC,OAAO,EAAE,WAAW,CAAC,CAAC;IAE3E,MAAM,mBAAmB,GAAG,oBAAoB,CAAC,OAAO,CAAC,CAAC,CAAC,oBAAoB,CAAC,OAAO,CAAC,UAAU,CAAC,CAAC,CAAC,CAAC,SAAS,CAAC;IAEhH,IAAI,CAAC,mBAAmB,EAAE;QACxB,MAAM,IAAI,KAAK,CAAC,wCAAyC,UAAW,iBAAkB,WAAY,cAAc,CAAC,CAAC;KACnH;IAED,OAAO,mBAAmB,CAAC;AAC7B,CAAC;AAVD,4CAUC;AAED,SAAgB,uBAAuB,CACrC,OAAwB,EACxB,WAAmB,EACnB,UAAkB,EAClB,iBAAiB,GAAG,OAAO,CAAC,iBAAiB;IAE7C,MAAM,MAAM,GAAG,gBAAgB,CAAC,OAAO,EAAE,WAAW,EAAE,UAAU,CAAC,CAAC;IAClE,OAAO,IAAA,qDAAgB,EAAC,MAAM,EAAE,iBAAiB,CAAC,CAAC;AACrD,CAAC;AARD,0DAQC"}
|
package/src/lib/project.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import { ExecutorContext } from '@nx/devkit';
|
|
2
2
|
export declare function GetProjectConfiguration(context: ExecutorContext, projectName?: string | undefined): import("@nx/devkit").ProjectConfiguration;
|
|
3
3
|
export declare function GetProjectRoot(context: ExecutorContext, projectName?: string | undefined): string;
|
|
4
|
-
export declare function GetProjectSourceRoot(context: ExecutorContext, projectName?: string | undefined): string
|
|
4
|
+
export declare function GetProjectSourceRoot(context: ExecutorContext, projectName?: string | undefined): string;
|
package/src/lib/project.js
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.GetProjectSourceRoot = exports.GetProjectRoot = exports.GetProjectConfiguration = void 0;
|
|
4
|
+
const path_1 = require("path");
|
|
4
5
|
function GetProjectConfiguration(context, projectName = context.projectName) {
|
|
5
6
|
const { projectsConfigurations } = context;
|
|
6
7
|
if (!projectsConfigurations) {
|
|
@@ -22,8 +23,9 @@ function GetProjectRoot(context, projectName = context.projectName) {
|
|
|
22
23
|
}
|
|
23
24
|
exports.GetProjectRoot = GetProjectRoot;
|
|
24
25
|
function GetProjectSourceRoot(context, projectName = context.projectName) {
|
|
26
|
+
var _a;
|
|
25
27
|
const projectConfiguration = GetProjectConfiguration(context, projectName);
|
|
26
|
-
return projectConfiguration.sourceRoot;
|
|
28
|
+
return (_a = projectConfiguration.sourceRoot) !== null && _a !== void 0 ? _a : (0, path_1.join)(projectConfiguration.root, 'src');
|
|
27
29
|
}
|
|
28
30
|
exports.GetProjectSourceRoot = GetProjectSourceRoot;
|
|
29
31
|
//# sourceMappingURL=project.js.map
|
package/src/lib/project.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"project.js","sourceRoot":"","sources":["../../../../../../packages/plugin/utilities/src/lib/project.ts"],"names":[],"mappings":";;;
|
|
1
|
+
{"version":3,"file":"project.js","sourceRoot":"","sources":["../../../../../../packages/plugin/utilities/src/lib/project.ts"],"names":[],"mappings":";;;AACA,+BAA4B;AAE5B,SAAgB,uBAAuB,CAAC,OAAwB,EAAE,WAAW,GAAG,OAAO,CAAC,WAAW;IACjG,MAAM,EAAE,sBAAsB,EAAE,GAAG,OAAO,CAAC;IAE3C,IAAI,CAAC,sBAAsB,EAAE;QAC3B,MAAM,IAAI,KAAK,CACb,iHAAiH,CAAC,CAAC;KACtH;IAED,IAAI,CAAC,WAAW,EAAE;QAChB,MAAM,IAAI,KAAK,CAAC,2FAA2F,CAAC,CAAC;KAC9G;IAED,MAAM,oBAAoB,GAAG,sBAAsB,CAAC,QAAQ,CAAC,WAAW,CAAC,CAAC;IAE1E,IAAI,CAAC,oBAAoB,EAAE;QACzB,MAAM,IAAI,KAAK,CAAC,0CAA2C,WAAY,cAAc,CAAC,CAAC;KACxF;IAED,OAAO,oBAAoB,CAAC;AAC9B,CAAC;AAnBD,0DAmBC;AAED,SAAgB,cAAc,CAAC,OAAwB,EAAE,WAAW,GAAG,OAAO,CAAC,WAAW;IACxF,MAAM,oBAAoB,GAAG,uBAAuB,CAAC,OAAO,EAAE,WAAW,CAAC,CAAC;IAC3E,OAAO,oBAAoB,CAAC,IAAI,CAAC;AACnC,CAAC;AAHD,wCAGC;AAED,SAAgB,oBAAoB,CAAC,OAAwB,EAAE,WAAW,GAAG,OAAO,CAAC,WAAW;;IAC9F,MAAM,oBAAoB,GAAG,uBAAuB,CAAC,OAAO,EAAE,WAAW,CAAC,CAAC;IAC3E,OAAO,MAAA,oBAAoB,CAAC,UAAU,mCAAI,IAAA,WAAI,EAAC,oBAAoB,CAAC,IAAI,EAAE,KAAK,CAAC,CAAC;AACnF,CAAC;AAHD,oDAGC"}
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import { ProjectConfiguration, Tree } from '@nx/devkit';
|
|
2
|
+
import { SkipProjectOptions } from '@rxap/generator-utilities';
|
|
3
|
+
export declare function SkipNonGeneratorsProject(tree: Tree, options: SkipProjectOptions, project: ProjectConfiguration, projectName: string): boolean;
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.SkipNonGeneratorsProject = void 0;
|
|
4
|
+
const generator_utilities_1 = require("@rxap/generator-utilities");
|
|
5
|
+
const workspace_utilities_1 = require("@rxap/workspace-utilities");
|
|
6
|
+
const generators_1 = require("./generators");
|
|
7
|
+
function SkipNonGeneratorsProject(tree, options, project, projectName) {
|
|
8
|
+
if ((0, generator_utilities_1.SkipProject)(tree, options, project, projectName)) {
|
|
9
|
+
return true;
|
|
10
|
+
}
|
|
11
|
+
if (!(0, workspace_utilities_1.IsPluginProject)(project)) {
|
|
12
|
+
return true;
|
|
13
|
+
}
|
|
14
|
+
if (!(0, generators_1.HasGenerators)(tree, project)) {
|
|
15
|
+
return true;
|
|
16
|
+
}
|
|
17
|
+
return false;
|
|
18
|
+
}
|
|
19
|
+
exports.SkipNonGeneratorsProject = SkipNonGeneratorsProject;
|
|
20
|
+
//# sourceMappingURL=skip-non-generators-project.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"skip-non-generators-project.js","sourceRoot":"","sources":["../../../../../../packages/plugin/utilities/src/lib/skip-non-generators-project.ts"],"names":[],"mappings":";;;AAIA,mEAGmC;AACnC,mEAA4D;AAC5D,6CAA6C;AAE7C,SAAgB,wBAAwB,CACtC,IAAU,EACV,OAA2B,EAC3B,OAA6B,EAC7B,WAAmB;IAEnB,IAAI,IAAA,iCAAW,EAAC,IAAI,EAAE,OAAO,EAAE,OAAO,EAAE,WAAW,CAAC,EAAE;QACpD,OAAO,IAAI,CAAC;KACb;IACD,IAAI,CAAC,IAAA,qCAAe,EAAC,OAAO,CAAC,EAAE;QAC7B,OAAO,IAAI,CAAC;KACb;IACD,IAAI,CAAC,IAAA,0BAAa,EAAC,IAAI,EAAE,OAAO,CAAC,EAAE;QACjC,OAAO,IAAI,CAAC;KACb;IAED,OAAO,KAAK,CAAC;AACf,CAAC;AAjBD,4DAiBC"}
|