@rxap/plugin-utilities 1.0.1-dev.0

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 ADDED
@@ -0,0 +1,10 @@
1
+ # Change Log
2
+
3
+ All notable changes to this project will be documented in this file.
4
+ See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
5
+
6
+ ## 1.0.1-dev.0 (2023-07-10)
7
+
8
+ ### Bug Fixes
9
+
10
+ - restructure and merge mono repos packages, schematics, plugins and nest ([653b4cd](https://gitlab.com/rxap/packages/commit/653b4cd39fc92d322df9b3959651fea0aa6079da))
package/GETSTARTED.md ADDED
File without changes
package/GUIDES.md ADDED
File without changes
package/README.md ADDED
@@ -0,0 +1,21 @@
1
+ # @rxap/plugin-utilities
2
+
3
+ [![npm version](https://img.shields.io/npm/v/@rxap/plugin-utilities?style=flat-square)](https://www.npmjs.com/package/@rxap/plugin-utilities)
4
+ [![commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg?style=flat-square)](https://commitizen.github.io/cz-cli/)
5
+ [![styled with prettier](https://img.shields.io/badge/styled_with-prettier-ff69b4.svg?style=flat-square)](https://github.com/prettier/prettier)
6
+ ![Libraries.io dependency status for latest release, scoped npm package](https://img.shields.io/librariesio/release/npm/@rxap/plugin-utilities)
7
+ ![npm](https://img.shields.io/npm/dm/@rxap/plugin-utilities)
8
+ ![NPM](https://img.shields.io/npm/l/@rxap/plugin-utilities)
9
+
10
+ - [Installation](#installation)
11
+
12
+ # Installation
13
+
14
+ **Add the package to your workspace:**
15
+ ```bash
16
+ yarn add @rxap/plugin-utilities
17
+ ```
18
+ **Install peer dependencies:**
19
+ ```bash
20
+ yarn add
21
+ ```
package/package.json ADDED
@@ -0,0 +1,45 @@
1
+ {
2
+ "name": "@rxap/plugin-utilities",
3
+ "version": "1.0.1-dev.0",
4
+ "type": "commonjs",
5
+ "publishConfig": {
6
+ "access": "public",
7
+ "directory": "../../../dist/packages/plugin/utilities"
8
+ },
9
+ "keywords": [
10
+ "rxap"
11
+ ],
12
+ "homepage": "https:/gitlab.com/rxap/packages/packages/plugin/utilities",
13
+ "bugs": {
14
+ "url": "https://gitlab.com/rxap/packages/-/issues",
15
+ "email": "incoming+rxap-packages-14898188-issue-@incoming.gitlab.com"
16
+ },
17
+ "license": "GPL-3.0-or-later",
18
+ "repository": {
19
+ "type": "git",
20
+ "url": "https://gitlab.com/rxap/packages.git",
21
+ "directory": "packages/plugin/utilities"
22
+ },
23
+ "author": {
24
+ "name": "Merzough Münker",
25
+ "email": "mmuenker@digitaix.com"
26
+ },
27
+ "peerDependencies": {
28
+ "@nx/devkit": "^16.3.2",
29
+ "@rxap/node-utilities": "^1.0.1-dev.0",
30
+ "nx": "^16.3.0"
31
+ },
32
+ "dependencies": {
33
+ "tslib": "2.5.3"
34
+ },
35
+ "nx-migrations": {
36
+ "packageGroup": [
37
+ {
38
+ "package": "@rxap/node-utilities",
39
+ "version": "1.0.1-dev.0"
40
+ }
41
+ ]
42
+ },
43
+ "main": "./src/index.js",
44
+ "types": "./src/index.d.ts"
45
+ }
package/src/index.d.ts ADDED
@@ -0,0 +1,7 @@
1
+ export * from './lib/get-direct-package-dependencies-for-project';
2
+ export * from './lib/project-package-json';
3
+ export * from './lib/project';
4
+ export * from './lib/project-root-files';
5
+ export * from './lib/get-target-configuration-name-list';
6
+ export * from './lib/guess-output-path';
7
+ export * from './lib/yarn-run';
package/src/index.js ADDED
@@ -0,0 +1,11 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ const tslib_1 = require("tslib");
4
+ tslib_1.__exportStar(require("./lib/get-direct-package-dependencies-for-project"), exports);
5
+ tslib_1.__exportStar(require("./lib/project-package-json"), exports);
6
+ tslib_1.__exportStar(require("./lib/project"), exports);
7
+ tslib_1.__exportStar(require("./lib/project-root-files"), exports);
8
+ tslib_1.__exportStar(require("./lib/get-target-configuration-name-list"), exports);
9
+ tslib_1.__exportStar(require("./lib/guess-output-path"), exports);
10
+ tslib_1.__exportStar(require("./lib/yarn-run"), exports);
11
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../packages/plugin/utilities/src/index.ts"],"names":[],"mappings":";;;AAAA,4FAAkE;AAClE,qEAA2C;AAC3C,wDAA8B;AAC9B,mEAAyC;AACzC,mFAAyD;AACzD,kEAAwC;AACxC,yDAA+B"}
@@ -0,0 +1,10 @@
1
+ import { ExecutorContext } from '@nx/devkit';
2
+ /**
3
+ * Get the direct package dependencies for the project.
4
+ *
5
+ * The direct package dependencies are the dependent projects that are directly referenced by the project.
6
+ *
7
+ * @param context
8
+ * @param projectName
9
+ */
10
+ export declare function getDirectPackageDependenciesForProject(context: ExecutorContext, projectName?: string | undefined): Record<string, string>;
@@ -0,0 +1,28 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.getDirectPackageDependenciesForProject = void 0;
4
+ const project_package_json_1 = require("./project-package-json");
5
+ /**
6
+ * Get the direct package dependencies for the project.
7
+ *
8
+ * The direct package dependencies are the dependent projects that are directly referenced by the project.
9
+ *
10
+ * @param context
11
+ * @param projectName
12
+ */
13
+ function getDirectPackageDependenciesForProject(context, projectName = context.projectName) {
14
+ const { projectGraph } = context;
15
+ if (!projectGraph) {
16
+ throw new Error('The projectGraph is undefined. Ensure the projectGraph is passed into the executor context.');
17
+ }
18
+ if (!projectName) {
19
+ throw new Error('The projectName is undefined. Ensure the projectName is passed into the executor context.');
20
+ }
21
+ return projectGraph.dependencies[projectName]
22
+ .filter(dependency => !dependency.target.startsWith('npm:'))
23
+ .map(dependency => dependency.target)
24
+ .map(projectName => (0, project_package_json_1.readPackageJsonForProject)(context, projectName))
25
+ .reduce((acc, { name, version, }) => (Object.assign(Object.assign({}, acc), { [name]: version })), {});
26
+ }
27
+ exports.getDirectPackageDependenciesForProject = getDirectPackageDependenciesForProject;
28
+ //# sourceMappingURL=get-direct-package-dependencies-for-project.js.map
@@ -0,0 +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,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;SACnE,MAAM,CAAC,CACN,GAAG,EACH,EACE,IAAI,EACJ,OAAO,GACR,EACD,EAAE,CAAC,iCACA,GAAG,KACN,CAAC,IAAI,CAAC,EAAE,OAAO,IACf,EAAE,EAAE,CAAC,CAAC;AACZ,CAAC;AA5BD,wFA4BC"}
@@ -0,0 +1,5 @@
1
+ import { ProjectConfiguration, TargetConfiguration } from '@nx/devkit';
2
+ export declare function GetTargetConfigurationNameList(projectConfiguration: ProjectConfiguration, targetName: string): string[];
3
+ export declare function CreateConfigurationMapMatchingWithTarget(projectConfiguration: ProjectConfiguration, targetName: string): Record<string, Record<string, unknown>>;
4
+ export declare function GetTarget(projectConfiguration: ProjectConfiguration, targetName: string): TargetConfiguration<any>;
5
+ export declare function GetTargetOptions<T = Record<string, unknown>>(buildTarget: TargetConfiguration, configurationName?: string): T;
@@ -0,0 +1,36 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.GetTargetOptions = exports.GetTarget = exports.CreateConfigurationMapMatchingWithTarget = exports.GetTargetConfigurationNameList = void 0;
4
+ function GetTargetConfigurationNameList(projectConfiguration, targetName) {
5
+ var _a;
6
+ const configurationNameList = [];
7
+ if (projectConfiguration.targets && projectConfiguration.targets[targetName]) {
8
+ return Object.keys((_a = projectConfiguration.targets[targetName].configurations) !== null && _a !== void 0 ? _a : {});
9
+ }
10
+ return configurationNameList;
11
+ }
12
+ exports.GetTargetConfigurationNameList = GetTargetConfigurationNameList;
13
+ function CreateConfigurationMapMatchingWithTarget(projectConfiguration, targetName) {
14
+ return GetTargetConfigurationNameList(projectConfiguration, 'build')
15
+ .reduce((acc, configurationName) => (Object.assign(Object.assign({}, acc), { [configurationName]: {} })), {});
16
+ }
17
+ exports.CreateConfigurationMapMatchingWithTarget = CreateConfigurationMapMatchingWithTarget;
18
+ function GetTarget(projectConfiguration, targetName) {
19
+ if (projectConfiguration.targets && projectConfiguration.targets[targetName]) {
20
+ return projectConfiguration.targets[targetName];
21
+ }
22
+ throw new Error(`Could not find target '${targetName}' for project '${projectConfiguration.name}'`);
23
+ }
24
+ exports.GetTarget = GetTarget;
25
+ function GetTargetOptions(buildTarget, configurationName) {
26
+ var _a;
27
+ const options = (_a = buildTarget.options) !== null && _a !== void 0 ? _a : {};
28
+ if (configurationName) {
29
+ if (buildTarget.configurations && buildTarget.configurations[configurationName]) {
30
+ Object.assign(options, buildTarget.configurations[configurationName]);
31
+ }
32
+ }
33
+ return options;
34
+ }
35
+ exports.GetTargetOptions = GetTargetOptions;
36
+ //# sourceMappingURL=get-target-configuration-name-list.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"get-target-configuration-name-list.js","sourceRoot":"","sources":["../../../../../../packages/plugin/utilities/src/lib/get-target-configuration-name-list.ts"],"names":[],"mappings":";;;AAKA,SAAgB,8BAA8B,CAC5C,oBAA0C,EAC1C,UAAkB;;IAElB,MAAM,qBAAqB,GAAa,EAAE,CAAC;IAC3C,IAAI,oBAAoB,CAAC,OAAO,IAAI,oBAAoB,CAAC,OAAO,CAAC,UAAU,CAAC,EAAE;QAC5E,OAAO,MAAM,CAAC,IAAI,CAAC,MAAA,oBAAoB,CAAC,OAAO,CAAC,UAAU,CAAC,CAAC,cAAc,mCAAI,EAAE,CAAC,CAAC;KACnF;IACD,OAAO,qBAAqB,CAAC;AAC/B,CAAC;AATD,wEASC;AAED,SAAgB,wCAAwC,CACtD,oBAA0C,EAC1C,UAAkB;IAElB,OAAO,8BAA8B,CAAC,oBAAoB,EAAE,OAAO,CAAC;SACjE,MAAM,CAAC,CAAC,GAAG,EAAE,iBAAiB,EAAE,EAAE,CAAC,iCAC/B,GAAG,KACN,CAAC,iBAAiB,CAAC,EAAE,EAAE,IACvB,EAAE,EAAE,CAAC,CAAC;AACZ,CAAC;AATD,4FASC;AAED,SAAgB,SAAS,CAAC,oBAA0C,EAAE,UAAkB;IACtF,IAAI,oBAAoB,CAAC,OAAO,IAAI,oBAAoB,CAAC,OAAO,CAAC,UAAU,CAAC,EAAE;QAC5E,OAAO,oBAAoB,CAAC,OAAO,CAAC,UAAU,CAAC,CAAC;KACjD;IACD,MAAM,IAAI,KAAK,CAAC,0BAA2B,UAAW,kBAAmB,oBAAoB,CAAC,IAAK,GAAG,CAAC,CAAC;AAC1G,CAAC;AALD,8BAKC;AAED,SAAgB,gBAAgB,CAC9B,WAAgC,EAChC,iBAA0B;;IAE1B,MAAM,OAAO,GAAG,MAAA,WAAW,CAAC,OAAO,mCAAI,EAAE,CAAC;IAC1C,IAAI,iBAAiB,EAAE;QACrB,IAAI,WAAW,CAAC,cAAc,IAAI,WAAW,CAAC,cAAc,CAAC,iBAAiB,CAAC,EAAE;YAC/E,MAAM,CAAC,MAAM,CAAC,OAAO,EAAE,WAAW,CAAC,cAAc,CAAC,iBAAiB,CAAC,CAAC,CAAC;SACvE;KACF;IACD,OAAO,OAAO,CAAC;AACjB,CAAC;AAXD,4CAWC"}
@@ -0,0 +1,2 @@
1
+ import { ExecutorContext } from '@nx/devkit';
2
+ export declare function GuessOutputPath(context: ExecutorContext): string;
@@ -0,0 +1,32 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.GuessOutputPath = void 0;
4
+ const project_1 = require("./project");
5
+ const get_target_configuration_name_list_1 = require("./get-target-configuration-name-list");
6
+ function GuessOutputPath(context) {
7
+ const project = (0, project_1.GetProjectConfiguration)(context);
8
+ if (!project.targets) {
9
+ throw new Error(`Could not guess the output path. The project ${project.name} does not have any targets`);
10
+ }
11
+ const buildTarget = project.targets['build'];
12
+ if (!buildTarget) {
13
+ throw new Error(`Could not find target 'build' for project '${project.name}'`);
14
+ }
15
+ let outputPath = (0, get_target_configuration_name_list_1.GetTargetOptions)(buildTarget, context.configurationName)['outputPath'];
16
+ if (!outputPath) {
17
+ console.warn('Could not find outputPath in build target options.');
18
+ if (buildTarget.outputs && buildTarget.outputs.length) {
19
+ const [output] = buildTarget.outputs;
20
+ outputPath = output;
21
+ }
22
+ else {
23
+ throw new Error('Could not find outputPath in build target options and target outputs are not defined.');
24
+ }
25
+ }
26
+ if (typeof outputPath !== 'string') {
27
+ throw new Error(`The outputPath is not a string. Found: ${outputPath}`);
28
+ }
29
+ return outputPath;
30
+ }
31
+ exports.GuessOutputPath = GuessOutputPath;
32
+ //# sourceMappingURL=guess-output-path.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"guess-output-path.js","sourceRoot":"","sources":["../../../../../../packages/plugin/utilities/src/lib/guess-output-path.ts"],"names":[],"mappings":";;;AAAA,uCAAoD;AAEpD,6FAAwE;AAGxE,SAAgB,eAAe,CAAC,OAAwB;IAEtD,MAAM,OAAO,GAAG,IAAA,iCAAuB,EAAC,OAAO,CAAC,CAAC;IAEjD,IAAI,CAAC,OAAO,CAAC,OAAO,EAAE;QACpB,MAAM,IAAI,KAAK,CAAC,gDAAiD,OAAO,CAAC,IAAK,4BAA4B,CAAC,CAAC;KAC7G;IAED,MAAM,WAAW,GAAG,OAAO,CAAC,OAAO,CAAC,OAAO,CAAC,CAAC;IAE7C,IAAI,CAAC,WAAW,EAAE;QAChB,MAAM,IAAI,KAAK,CAAC,8CAA+C,OAAO,CAAC,IAAK,GAAG,CAAC,CAAC;KAClF;IAED,IAAI,UAAU,GAAG,IAAA,qDAAgB,EAAC,WAAW,EAAE,OAAO,CAAC,iBAAiB,CAAC,CAAC,YAAY,CAAC,CAAC;IAExF,IAAI,CAAC,UAAU,EAAE;QACf,OAAO,CAAC,IAAI,CAAC,oDAAoD,CAAC,CAAC;QACnE,IAAI,WAAW,CAAC,OAAO,IAAI,WAAW,CAAC,OAAO,CAAC,MAAM,EAAE;YACrD,MAAM,CAAE,MAAM,CAAE,GAAG,WAAW,CAAC,OAAO,CAAC;YACvC,UAAU,GAAG,MAAM,CAAC;SACrB;aAAM;YACL,MAAM,IAAI,KAAK,CAAC,uFAAuF,CAAC,CAAC;SAC1G;KACF;IAED,IAAI,OAAO,UAAU,KAAK,QAAQ,EAAE;QAClC,MAAM,IAAI,KAAK,CAAC,0CAA2C,UAAW,EAAE,CAAC,CAAC;KAC3E;IAED,OAAO,UAAU,CAAC;AAEpB,CAAC;AAhCD,0CAgCC"}
@@ -0,0 +1,36 @@
1
+ import { ExecutorContext } from '@nx/devkit';
2
+ import { PackageJson } from 'nx/src/utils/package-json';
3
+ export interface ProjectPackageJsonPerson {
4
+ name?: string;
5
+ email?: string;
6
+ url?: string;
7
+ }
8
+ 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
+ funding?: string | {
22
+ type: string;
23
+ url: string;
24
+ } | string[] | {
25
+ type: string;
26
+ url: string;
27
+ }[];
28
+ repository?: string | {
29
+ type: string;
30
+ url: string;
31
+ directory?: string;
32
+ };
33
+ description?: string;
34
+ }
35
+ 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;
@@ -0,0 +1,17 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.writePackageJsonFormProject = exports.readPackageJsonForProject = void 0;
4
+ const path_1 = require("path");
5
+ const node_utilities_1 = require("@rxap/node-utilities");
6
+ const project_1 = require("./project");
7
+ function readPackageJsonForProject(context, projectName = context.projectName) {
8
+ const packageJsonPath = (0, path_1.join)(context.root, (0, project_1.GetProjectRoot)(context, projectName), 'package.json');
9
+ return (0, node_utilities_1.jsonFile)(packageJsonPath);
10
+ }
11
+ exports.readPackageJsonForProject = readPackageJsonForProject;
12
+ function writePackageJsonFormProject(context, content, projectName = context.projectName) {
13
+ 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
+ }
16
+ exports.writePackageJsonFormProject = writePackageJsonFormProject;
17
+ //# sourceMappingURL=project-package-json.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"project-package-json.js","sourceRoot":"","sources":["../../../../../../packages/plugin/utilities/src/lib/project-package-json.ts"],"names":[],"mappings":";;;AAEA,+BAA4B;AAC5B,yDAG8B;AAC9B,uCAA2C;AAuB3C,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,OAAO,CAAC,CAAC;AAC7C,CAAC;AAPD,kEAOC"}
@@ -0,0 +1,3 @@
1
+ import { ExecutorContext } from '@nx/devkit';
2
+ export declare function readFileFromProjectRoot(context: ExecutorContext, fileName: string, requiredOrDefaultContent?: string | true): string;
3
+ export declare function writeFileToProjectRoot(context: ExecutorContext, fileName: string, content: string): void;
@@ -0,0 +1,25 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.writeFileToProjectRoot = exports.readFileFromProjectRoot = void 0;
4
+ const project_1 = require("./project");
5
+ const path_1 = require("path");
6
+ const fs_1 = require("fs");
7
+ function readFileFromProjectRoot(context, fileName, requiredOrDefaultContent = '') {
8
+ const projectRoot = (0, project_1.GetProjectRoot)(context);
9
+ const filePath = (0, path_1.join)(projectRoot, 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.readFileFromProjectRoot = readFileFromProjectRoot;
19
+ function writeFileToProjectRoot(context, fileName, content) {
20
+ const projectRoot = (0, project_1.GetProjectRoot)(context);
21
+ const filePath = (0, path_1.join)(projectRoot, fileName);
22
+ (0, fs_1.writeFileSync)(filePath, content);
23
+ }
24
+ exports.writeFileToProjectRoot = writeFileToProjectRoot;
25
+ //# sourceMappingURL=project-root-files.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"project-root-files.js","sourceRoot":"","sources":["../../../../../../packages/plugin/utilities/src/lib/project-root-files.ts"],"names":[],"mappings":";;;AACA,uCAA2C;AAC3C,+BAA4B;AAC5B,2BAIY;AAEZ,SAAgB,uBAAuB,CACrC,OAAwB,EACxB,QAAgB,EAChB,2BAA0C,EAAE;IAE5C,MAAM,WAAW,GAAG,IAAA,wBAAc,EAAC,OAAO,CAAC,CAAC;IAC5C,MAAM,QAAQ,GAAG,IAAA,WAAI,EAAC,WAAW,EAAE,QAAQ,CAAC,CAAC;IAC7C,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,0DAcC;AAED,SAAgB,sBAAsB,CAAC,OAAwB,EAAE,QAAgB,EAAE,OAAe;IAChG,MAAM,WAAW,GAAG,IAAA,wBAAc,EAAC,OAAO,CAAC,CAAC;IAC5C,MAAM,QAAQ,GAAG,IAAA,WAAI,EAAC,WAAW,EAAE,QAAQ,CAAC,CAAC;IAC7C,IAAA,kBAAa,EAAC,QAAQ,EAAE,OAAO,CAAC,CAAC;AACnC,CAAC;AAJD,wDAIC"}
@@ -0,0 +1,4 @@
1
+ import { ExecutorContext } from '@nx/devkit';
2
+ export declare function GetProjectConfiguration(context: ExecutorContext, projectName?: string | undefined): import("@nx/devkit").ProjectConfiguration;
3
+ export declare function GetProjectRoot(context: ExecutorContext, projectName?: string | undefined): string;
4
+ export declare function GetProjectSourceRoot(context: ExecutorContext, projectName?: string | undefined): string | undefined;
@@ -0,0 +1,29 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.GetProjectSourceRoot = exports.GetProjectRoot = exports.GetProjectConfiguration = void 0;
4
+ function GetProjectConfiguration(context, projectName = context.projectName) {
5
+ const { projectsConfigurations } = context;
6
+ if (!projectsConfigurations) {
7
+ throw new Error('The projectsConfigurations is undefined. Ensure the projectsConfigurations is passed into the executor context.');
8
+ }
9
+ if (!projectName) {
10
+ throw new Error('The projectName is undefined. Ensure the projectName is passed into the executor context.');
11
+ }
12
+ const projectConfiguration = projectsConfigurations.projects[projectName];
13
+ if (!projectConfiguration) {
14
+ throw new Error(`The project configuration for project '${projectName}' not found!`);
15
+ }
16
+ return projectConfiguration;
17
+ }
18
+ exports.GetProjectConfiguration = GetProjectConfiguration;
19
+ function GetProjectRoot(context, projectName = context.projectName) {
20
+ const projectConfiguration = GetProjectConfiguration(context, projectName);
21
+ return projectConfiguration.root;
22
+ }
23
+ exports.GetProjectRoot = GetProjectRoot;
24
+ function GetProjectSourceRoot(context, projectName = context.projectName) {
25
+ const projectConfiguration = GetProjectConfiguration(context, projectName);
26
+ return projectConfiguration.sourceRoot;
27
+ }
28
+ exports.GetProjectSourceRoot = GetProjectSourceRoot;
29
+ //# sourceMappingURL=project.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"project.js","sourceRoot":"","sources":["../../../../../../packages/plugin/utilities/src/lib/project.ts"],"names":[],"mappings":";;;AAEA,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,oBAAoB,CAAC,UAAU,CAAC;AACzC,CAAC;AAHD,oDAGC"}
@@ -0,0 +1 @@
1
+ export declare function YarnRun(args: string[]): Promise<unknown>;
@@ -0,0 +1,27 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.YarnRun = void 0;
4
+ const child_process_1 = require("child_process");
5
+ function YarnRun(args) {
6
+ console.log(`$ yarn ${args.join(' ')}`);
7
+ return new Promise((resolve, reject) => {
8
+ const s = (0, child_process_1.spawn)('yarn', args, {
9
+ stdio: ['ignore', 'pipe', 'inherit'],
10
+ shell: true,
11
+ });
12
+ s.on('error', (err) => {
13
+ if (err.code === 'ENOENT') {
14
+ console.error('Yarn must be installed to use the CLI.');
15
+ }
16
+ else {
17
+ reject(err);
18
+ }
19
+ });
20
+ s.stdout.on('data', (data) => {
21
+ console.log(data.toString('utf-8'));
22
+ });
23
+ s.on('close', resolve);
24
+ });
25
+ }
26
+ exports.YarnRun = YarnRun;
27
+ //# sourceMappingURL=yarn-run.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"yarn-run.js","sourceRoot":"","sources":["../../../../../../packages/plugin/utilities/src/lib/yarn-run.ts"],"names":[],"mappings":";;;AAAA,iDAAsC;AAEtC,SAAgB,OAAO,CAAC,IAAc;IACpC,OAAO,CAAC,GAAG,CAAC,UAAW,IAAI,CAAC,IAAI,CAAC,GAAG,CAAE,EAAE,CAAC,CAAC;IAC1C,OAAO,IAAI,OAAO,CAAC,CAAC,OAAO,EAAE,MAAM,EAAE,EAAE;QACrC,MAAM,CAAC,GAAG,IAAA,qBAAK,EACb,MAAM,EACN,IAAI,EACJ;YACE,KAAK,EAAE,CAAE,QAAQ,EAAE,MAAM,EAAE,SAAS,CAAE;YACtC,KAAK,EAAE,IAAI;SACZ,CACF,CAAC;QACF,CAAC,CAAC,EAAE,CAAC,OAAO,EAAE,CAAC,GAA8B,EAAE,EAAE;YAC/C,IAAI,GAAG,CAAC,IAAI,KAAK,QAAQ,EAAE;gBACzB,OAAO,CAAC,KAAK,CAAC,wCAAwC,CAAC,CAAC;aACzD;iBAAM;gBACL,MAAM,CAAC,GAAG,CAAC,CAAC;aACb;QACH,CAAC,CAAC,CAAC;QACH,CAAC,CAAC,MAAM,CAAC,EAAE,CAAC,MAAM,EAAE,CAAC,IAAY,EAAE,EAAE;YACnC,OAAO,CAAC,GAAG,CAAC,IAAI,CAAC,QAAQ,CAAC,OAAO,CAAC,CAAC,CAAC;QACtC,CAAC,CAAC,CAAC;QACH,CAAC,CAAC,EAAE,CAAC,OAAO,EAAE,OAAO,CAAC,CAAC;IACzB,CAAC,CAAC,CAAC;AACL,CAAC;AAvBD,0BAuBC"}