@o3r/schematics 10.0.0-next.23 → 10.0.0-next.24

Sign up to get free protection for your applications and to get access to all the features.
Files changed (29) hide show
  1. package/package.json +11 -10
  2. package/schematics/ng-add/index.js.map +1 -1
  3. package/schematics/ng-add/schema.json +1 -1
  4. package/src/modules/index.d.ts +1 -0
  5. package/src/modules/index.d.ts.map +1 -1
  6. package/src/modules/index.js +1 -0
  7. package/src/modules/index.js.map +1 -1
  8. package/src/modules/modules.display.rule.d.ts +35 -0
  9. package/src/modules/modules.display.rule.d.ts.map +1 -0
  10. package/src/modules/modules.display.rule.js +63 -0
  11. package/src/modules/modules.display.rule.js.map +1 -0
  12. package/src/modules/modules.helpers.d.ts +1 -8
  13. package/src/modules/modules.helpers.d.ts.map +1 -1
  14. package/src/modules/modules.helpers.js +1 -6
  15. package/src/modules/modules.helpers.js.map +1 -1
  16. package/src/tasks/package-manager/add-dev-dependency.d.ts +1 -0
  17. package/src/tasks/package-manager/add-dev-dependency.d.ts.map +1 -1
  18. package/src/tasks/package-manager/add-dev-dependency.js +3 -1
  19. package/src/tasks/package-manager/add-dev-dependency.js.map +1 -1
  20. package/src/tasks/package-manager/interfaces.d.ts +9 -0
  21. package/src/tasks/package-manager/interfaces.d.ts.map +1 -1
  22. package/src/tasks/package-manager/npm-install.d.ts +2 -1
  23. package/src/tasks/package-manager/npm-install.d.ts.map +1 -1
  24. package/src/tasks/package-manager/npm-install.js +3 -1
  25. package/src/tasks/package-manager/npm-install.js.map +1 -1
  26. package/src/utility/package-manager-runner.d.ts +10 -8
  27. package/src/utility/package-manager-runner.d.ts.map +1 -1
  28. package/src/utility/package-manager-runner.js +34 -12
  29. package/src/utility/package-manager-runner.js.map +1 -1
package/package.json CHANGED
@@ -1,8 +1,9 @@
1
1
  {
2
2
  "name": "@o3r/schematics",
3
- "version": "10.0.0-next.23",
3
+ "version": "10.0.0-next.24",
4
4
  "description": "Schematics module of the Otter framework",
5
5
  "main": "./src/public_api.js",
6
+ "typings": "./src/public_api.d.ts",
6
7
  "keywords": [
7
8
  "schematics",
8
9
  "otter"
@@ -58,13 +59,13 @@
58
59
  "@babel/core": "~7.23.0",
59
60
  "@babel/preset-typescript": "~7.23.0",
60
61
  "@compodoc/compodoc": "^1.1.19",
61
- "@nx/eslint-plugin": "~16.8.0",
62
- "@nx/jest": "~16.8.0",
63
- "@nx/js": "~16.8.0",
64
- "@nx/linter": "~16.8.0",
65
- "@o3r/build-helpers": "^10.0.0-next.23",
66
- "@o3r/dev-tools": "^10.0.0-next.23",
67
- "@o3r/eslint-plugin": "^10.0.0-next.23",
62
+ "@nx/eslint-plugin": "~16.10.0",
63
+ "@nx/jest": "~16.10.0",
64
+ "@nx/js": "~16.10.0",
65
+ "@nx/linter": "~16.10.0",
66
+ "@o3r/build-helpers": "^10.0.0-next.24",
67
+ "@o3r/dev-tools": "^10.0.0-next.24",
68
+ "@o3r/eslint-plugin": "^10.0.0-next.24",
68
69
  "@schematics/angular": "~16.2.0",
69
70
  "@types/jest": "~29.5.2",
70
71
  "@types/node": "^18.0.0",
@@ -80,9 +81,9 @@
80
81
  "eslint-plugin-unicorn": "^47.0.0",
81
82
  "jest": "~29.7.0",
82
83
  "jest-junit": "~16.0.0",
83
- "jsonc-eslint-parser": "~2.3.0",
84
+ "jsonc-eslint-parser": "~2.4.0",
84
85
  "jsonschema": "~1.4.1",
85
- "nx": "~16.8.0",
86
+ "nx": "~16.10.0",
86
87
  "rxjs": "^7.8.1",
87
88
  "ts-jest": "~29.1.1",
88
89
  "type-fest": "^3.12.0",
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../schematics/ng-add/index.ts"],"names":[],"mappings":";;;AACA,8BAA8B;AAC9B,kCAAkC;AAClC,+BAAqC;AAErC,gDAAgD;AAEhD;;GAEG;AACH,SAAgB,KAAK;IACnB,MAAM,sBAAsB,GAAG,CAAC,2BAA2B,EAAE,4BAA4B,EAAE,sBAAsB,EAAE,qBAAqB,EAAE,QAAQ,CAAC,CAAC;IACpJ,OAA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ACjD,OAAO,CAAC,MAAM,CAAC,IAAI,CAAC,cAAc,UAAU,GAAG,OAAO,IAAI,EAAE,EAAE,CAAC,CAAC;YAChE,eAAe,CAAC,eAAe,GAAG,EAAC,GAAG,eAAe,CAAC,eAAe,EAAE,CAAC,UAAU,CAAC,EAAE,OAAO,EAAC,CAAC;YAC9F,WAAW,GAAG,GAAG,WAAW,IAAI,UAAU,GAAG,OAAO,CAAC,CAAC,CAAC,GAAG,GAAG,OAAO,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC;SAC7E;QACD,OAAO,CAAC,OAAO,CAAC,IAAI,0BAAa,CAAC;YAChC,UAAU,EAAE,KAAK;YACjB,WAAW;YACX,KAAK,EAAE,KAAK;SACN,CAAC,CAAC,CAAC;QACX,MAAM,IAAA,oBAAa,EAAC,OAAO,CAAC,MAAM,CAAC,gBAAgB,EAAE,CAAC,CAAC;QACvD,IAAI,CAAC,SAAS,CAAC,gBAAgB,EAAE,IAAI,CAAC,SAAS,CAAC,eAAe,CAAC,CAAC,CAAC;QAClE,OAAO,GAAG,EAAE,CAAC,IAAI,CAAC;IACpB,CAAC,CAAC;AACJ,CAAC;AAxBD,sBAwBC"}
@@ -12,7 +12,7 @@
12
12
  }
13
13
  }
14
14
  },
15
- "additionalProperties": false,
15
+ "additionalProperties": true,
16
16
  "required": [
17
17
  ]
18
18
  }
@@ -1,3 +1,4 @@
1
1
  export * from './modules.constants';
2
2
  export * from './modules.helpers';
3
+ export * from './modules.display.rule';
3
4
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/modules/index.ts"],"names":[],"mappings":"AAAA,cAAc,qBAAqB,CAAC;AACpC,cAAc,mBAAmB,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/modules/index.ts"],"names":[],"mappings":"AAAA,cAAc,qBAAqB,CAAC;AACpC,cAAc,mBAAmB,CAAC;AAClC,cAAc,wBAAwB,CAAC"}
@@ -3,4 +3,5 @@ Object.defineProperty(exports, "__esModule", { value: true });
3
3
  const tslib_1 = require("tslib");
4
4
  tslib_1.__exportStar(require("./modules.constants"), exports);
5
5
  tslib_1.__exportStar(require("./modules.helpers"), exports);
6
+ tslib_1.__exportStar(require("./modules.display.rule"), exports);
6
7
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/modules/index.ts"],"names":[],"mappings":";;;AAAA,8DAAoC;AACpC,4DAAkC"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/modules/index.ts"],"names":[],"mappings":";;;AAAA,8DAAoC;AACpC,4DAAkC;AAClC,iEAAuC"}
@@ -0,0 +1,35 @@
1
+ import type { Rule } from '@angular-devkit/schematics';
2
+ /** Options for the Display Module rule */
3
+ export interface DisplayModuleListOptions {
4
+ /**
5
+ * List of whitelisted scopes
6
+ * @default {@see OTTER_MODULE_SUPPORTED_SCOPES}
7
+ */
8
+ scopeWhitelist: string[] | readonly string[];
9
+ /**
10
+ * Keyword to search for Otter modules
11
+ * @default {@see OTTER_MODULE_KEYWORD}
12
+ */
13
+ keyword: string;
14
+ /** Display only the Otter modules with CMS administration */
15
+ onlyCmsModules: boolean;
16
+ /** Display only the Otter modules that are not already installed */
17
+ onlyNotInstalledModules: boolean;
18
+ /** Name of the package where to install add the dependency */
19
+ packageName: string;
20
+ }
21
+ /**
22
+ * Display the list of available Otter modules
23
+ * @param options Options of the Display Module list
24
+ */
25
+ export declare function displayModuleListRule(options?: Partial<DisplayModuleListOptions>): Rule;
26
+ /**
27
+ * @deprecated will be removed in v10, please use {@link displayModuleListRule} instead
28
+ * Display the list of available Otter modules
29
+ * @param keyword
30
+ * @param scopeWhitelist
31
+ * @param onlyCmsModules
32
+ * @param onlyNotInstalledModules
33
+ */
34
+ export declare function displayModuleList(keyword: string, scopeWhitelist: string[] | readonly string[], onlyCmsModules?: boolean, onlyNotInstalledModules?: boolean): Rule;
35
+ //# sourceMappingURL=modules.display.rule.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"modules.display.rule.d.ts","sourceRoot":"","sources":["../../../src/modules/modules.display.rule.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,4BAA4B,CAAC;AAMvD,0CAA0C;AAC1C,MAAM,WAAW,wBAAwB;IACvC;;;OAGG;IACH,cAAc,EAAE,MAAM,EAAE,GAAG,SAAS,MAAM,EAAE,CAAC;IAC7C;;;OAGG;IACH,OAAO,EAAE,MAAM,CAAC;IAChB,6DAA6D;IAC7D,cAAc,EAAE,OAAO,CAAC;IACxB,oEAAoE;IACpE,uBAAuB,EAAE,OAAO,CAAC;IACjC,8DAA8D;IAC9D,WAAW,EAAE,MAAM,CAAC;CACrB;AAED;;;GAGG;AACH,wBAAgB,qBAAqB,CAAC,OAAO,CAAC,EAAE,OAAO,CAAC,wBAAwB,CAAC,GAAG,IAAI,CAkCvF;AAED;;;;;;;GAOG;AACH,wBAAgB,iBAAiB,CAAC,OAAO,EAAE,MAAM,EAAE,cAAc,EAAE,MAAM,EAAE,GAAG,SAAS,MAAM,EAAE,EAAE,cAAc,UAAQ,EAAE,uBAAuB,UAAQ,QAOvJ"}
@@ -0,0 +1,63 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.displayModuleList = exports.displayModuleListRule = void 0;
4
+ const node_os_1 = require("node:os");
5
+ const modules_constants_1 = require("./modules.constants");
6
+ const utility_1 = require("../utility");
7
+ const modules_helpers_1 = require("./modules.helpers");
8
+ /**
9
+ * Display the list of available Otter modules
10
+ * @param options Options of the Display Module list
11
+ */
12
+ function displayModuleListRule(options) {
13
+ const scopeWhitelist = options?.scopeWhitelist || modules_constants_1.OTTER_MODULE_SUPPORTED_SCOPES;
14
+ const keyword = options?.keyword || modules_constants_1.OTTER_MODULE_KEYWORD;
15
+ return async (tree, context) => {
16
+ const { OTTER_KEYWORD_CMS } = await Promise.resolve().then(() => require('@o3r/schematics'));
17
+ const tagMap = { [OTTER_KEYWORD_CMS]: 'CMS enabler' };
18
+ // const { getAvailableModulesWithLatestPackage, formatModuleDescription, getWorkspaceConfig, getPackageManagerExecutor } = await import('@o3r/schematics');
19
+ const workspaceConfig = (0, utility_1.getWorkspaceConfig)(tree);
20
+ try {
21
+ const modules = await (0, modules_helpers_1.getAvailableModulesWithLatestPackage)(keyword, {
22
+ scopeWhitelist,
23
+ onlyNotInstalled: !!options?.onlyNotInstalledModules,
24
+ logger: context.logger,
25
+ workspaceConfig
26
+ });
27
+ const message = modules
28
+ .filter((mod) => !options?.onlyCmsModules || mod.keywords?.includes(OTTER_KEYWORD_CMS))
29
+ .map((mod) => (0, modules_helpers_1.formatModuleDescription)(mod, (0, utility_1.getPackageManagerExecutor)(workspaceConfig, options?.packageName), tagMap))
30
+ .filter((msg) => !!msg)
31
+ .join(node_os_1.EOL + node_os_1.EOL);
32
+ if (message) {
33
+ context.logger.info('The following modules are now available for your application, add them according to your needs:');
34
+ // eslint-disable-next-line @typescript-eslint/restrict-plus-operands
35
+ context.logger.info(node_os_1.EOL + message);
36
+ }
37
+ }
38
+ catch (e) {
39
+ context.logger.debug('Error during the module discovery', e);
40
+ context.logger.error('List of Otter modules unavailable');
41
+ }
42
+ return () => tree;
43
+ };
44
+ }
45
+ exports.displayModuleListRule = displayModuleListRule;
46
+ /**
47
+ * @deprecated will be removed in v10, please use {@link displayModuleListRule} instead
48
+ * Display the list of available Otter modules
49
+ * @param keyword
50
+ * @param scopeWhitelist
51
+ * @param onlyCmsModules
52
+ * @param onlyNotInstalledModules
53
+ */
54
+ function displayModuleList(keyword, scopeWhitelist, onlyCmsModules = false, onlyNotInstalledModules = false) {
55
+ return displayModuleListRule({
56
+ keyword,
57
+ onlyCmsModules,
58
+ onlyNotInstalledModules,
59
+ scopeWhitelist
60
+ });
61
+ }
62
+ exports.displayModuleList = displayModuleList;
63
+ //# sourceMappingURL=modules.display.rule.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;iBACtB,IAAI,CAAC,aAAG,GAAG,aAAG,CAAC,CAAC;YACnB,IAAI,OAAO,EAAE;gBACX,OAAO,CAAC,MAAM,CAAC,IAAI,CAAC,iGAAiG,CAAC,CAAC;gBACvH,qEAAqE;gBACrE,OAAO,CAAC,MAAM,CAAC,IAAI,CAAC,aAAG,GAAG,OAAO,CAAC,CAAC;aACpC;SACF;QAAC,OAAO,CAAM,EAAE;YACf,OAAO,CAAC,MAAM,CAAC,KAAK,CAAC,mCAAmC,EAAE,CAAC,CAAC,CAAC;YAC7D,OAAO,CAAC,MAAM,CAAC,KAAK,CAAC,mCAAmC,CAAC,CAAC;SAC3D;QACD,OAAO,GAAG,EAAE,CAAC,IAAI,CAAC;IACpB,CAAC,CAAC;AACJ,CAAC;AAlCD,sDAkCC;AAED;;;;;;;GAOG;AACH,SAAgB,iBAAiB,CAAC,OAAe,EAAE,cAA4C,EAAE,cAAc,GAAG,KAAK,EAAE,uBAAuB,GAAG,KAAK;IACtJ,OAAO,qBAAqB,CAAC;QAC3B,OAAO;QACP,cAAc;QACd,uBAAuB;QACvB,cAAc;KACf,CAAC,CAAC;AACL,CAAC;AAPD,8CAOC"}
@@ -3,7 +3,6 @@ import type { logging } from '@angular-devkit/core';
3
3
  import { PackageManagerOptions, SupportedPackageManagerExecutors } from '../utility';
4
4
  /**
5
5
  * Determine if the given keyword is an Otter tag
6
- *
7
6
  * @param keyword Keyword to identify
8
7
  * @param expect tag expected for the Otter keyword
9
8
  */
@@ -12,20 +11,17 @@ export declare const isOtterTag: <T extends string | undefined>(keyword: any, ex
12
11
  export interface AvailableModuleOptions extends PackageManagerOptions {
13
12
  /**
14
13
  * Determine if only the packages that are NOT installed should be returned
15
- *
16
14
  * @default false
17
15
  */
18
16
  onlyNotInstalled?: boolean;
19
17
  /**
20
18
  * Npm Registry to fetch to get the package information
21
- *
22
19
  * @default registry.npmjs.org
23
20
  */
24
21
  npmRegistryToFetch?: string;
25
22
  }
26
23
  /**
27
24
  * Get Available Otter modules on NPMjs.org
28
- *
29
25
  * @param keyword Keyword to search for Otter modules
30
26
  * @param scopeWhitelist List of whitelisted scopes
31
27
  * @param options
@@ -35,7 +31,6 @@ export declare function getAvailableModules(keyword: string, scopeWhitelist: str
35
31
  export interface AvailableModuleOptionsWithLatestPackage extends AvailableModuleOptions {
36
32
  /**
37
33
  * List of whitelisted scopes
38
- *
39
34
  * @default {@see OTTER_MODULE_SUPPORTED_SCOPES}
40
35
  */
41
36
  scopeWhitelist?: string[] | readonly string[];
@@ -43,18 +38,16 @@ export interface AvailableModuleOptionsWithLatestPackage extends AvailableModule
43
38
  /**
44
39
  * Get Available Otter modules on NPMjs.org and get latest package information
45
40
  * Similar to {@link getAvailableModules} with additional calls to retrieve all the package's information
46
- *
47
41
  * @param keyword Keyword to search for Otter modules
48
42
  * @param options
49
43
  */
50
44
  export declare function getAvailableModulesWithLatestPackage(keyword: string | undefined, options: AvailableModuleOptionsWithLatestPackage): Promise<NpmRegistryPackage[]>;
51
45
  /**
52
46
  * Format a module description to be displayed in the terminal
53
- *
54
47
  * @param npmPackage Npm Package to display
55
48
  * @param runner runner according to the context
56
49
  * @param keywordTags Mapping of the NPM package Keywords and a displayed tag
57
50
  * @param logger Logger to use to report package read failure (as debug message)
58
51
  */
59
- export declare function formatModuleDescription(npmPackage: NpmRegistryPackage, runner?: SupportedPackageManagerExecutors, keywordTags?: Record<string, string>, logger?: logging.LoggerApi): string;
52
+ export declare function formatModuleDescription(npmPackage: NpmRegistryPackage, runner?: SupportedPackageManagerExecutors | string, keywordTags?: Record<string, string>, logger?: logging.LoggerApi): string;
60
53
  //# sourceMappingURL=modules.helpers.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"modules.helpers.d.ts","sourceRoot":"","sources":["../../../src/modules/modules.helpers.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,kBAAkB,EAAuH,MAAM,qBAAqB,CAAC;AAG9K,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,sBAAsB,CAA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M,YAAY,CAAC;AAkDxG;;;;GAIG;AACH,eAAO,MAAM,UAAU,0CAA2C,GAAG,+EAGpE,CAAC;AAEF,+CAA+C;AAC/C,MAAM,WAAW,sBAAuB,SAAQ,qBAAqB;IACnE;;;OAGG;IACH,gBAAgB,CAAC,EAAE,OAAO,CAAC;IAE3B;;;OAGG;IACH,kBAAkB,CAAC,EAAE,MAAM,CAAC;CAC7B;AAED;;;;;GAKG;AACH,wBAAsB,mBAAmB,CAAC,OAAO,EAAE,MAAM,EAAE,cAAc,EAAE,MAAM,EAAE,GAAG,SAAS,MAAM,EAAE,EAAE,OAAO,CAAC,EAAE,sBAAsB,GAAG,OAAO,CAAC,kBAAkB,EAAE,CAAC,CAsBxK;AAED,gEAAgE;AAChE,MAAM,WAAW,uCAAwC,SAAQ,sBAAsB;IACrF;;;OAGG;IACH,cAAc,CAAC,EAAE,MAAM,EAAE,GAAG,SAAS,MAAM,EAAE,CAAC;CAC/C;AAED;;;;;GAKG;AACH,wBAAsB,oCAAoC,CAAC,OAAO,oBAA+B,EAAE,OAAO,EAAE,uCAAuC,GAAG,OAAO,CAAC,kBAAkB,EAAE,CAAC,CAoBlL;AAED;;;;;;GAMG;AACH,wBAAgB,uBAAuB,CACnC,UAAU,EAAE,kBAAkB,EAC9B,MAAM,GAAE,gCAAgC,GAAG,MAAc,EACzD,WAAW,GAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAM,EACxC,MAAM,CAAC,EAAE,OAAO,CAAC,SAAS,UA8B7B"}
@@ -25,7 +25,6 @@ async function promiseGetRequest(url) {
25
25
  }
26
26
  /**
27
27
  * Execute NPM search command if not run with other client
28
- *
29
28
  * @param search search text
30
29
  * @param packageManager Package manager to use, determined automatically if not specified
31
30
  * @param packageManagerOptions
@@ -35,7 +34,7 @@ async function npmSearchExec(search, packageManagerOptions, logger) {
35
34
  const manager = (0, utility_1.getPackageManager)(packageManagerOptions);
36
35
  switch (manager) {
37
36
  case 'npm': {
38
- const remoteModulesPromise = (0, node_util_1.promisify)(node_child_process_1.exec)(`npm search "${search}" --json`);
37
+ const remoteModulesPromise = (0, node_util_1.promisify)(node_child_process_1.execFile)('npm', ['search', search, '--json']);
39
38
  try {
40
39
  const results = JSON.parse((await remoteModulesPromise).stdout);
41
40
  return results
@@ -60,7 +59,6 @@ async function npmSearchExec(search, packageManagerOptions, logger) {
60
59
  }
61
60
  /**
62
61
  * Determine if the given keyword is an Otter tag
63
- *
64
62
  * @param keyword Keyword to identify
65
63
  * @param expect tag expected for the Otter keyword
66
64
  */
@@ -71,7 +69,6 @@ const isOtterTag = (keyword, expect) => {
71
69
  exports.isOtterTag = isOtterTag;
72
70
  /**
73
71
  * Get Available Otter modules on NPMjs.org
74
- *
75
72
  * @param keyword Keyword to search for Otter modules
76
73
  * @param scopeWhitelist List of whitelisted scopes
77
74
  * @param options
@@ -101,7 +98,6 @@ exports.getAvailableModules = getAvailableModules;
101
98
  /**
102
99
  * Get Available Otter modules on NPMjs.org and get latest package information
103
100
  * Similar to {@link getAvailableModules} with additional calls to retrieve all the package's information
104
- *
105
101
  * @param keyword Keyword to search for Otter modules
106
102
  * @param options
107
103
  */
@@ -127,7 +123,6 @@ async function getAvailableModulesWithLatestPackage(keyword = modules_constants_
127
123
  exports.getAvailableModulesWithLatestPackage = getAvailableModulesWithLatestPackage;
128
124
  /**
129
125
  * Format a module description to be displayed in the terminal
130
- *
131
126
  * @param npmPackage Npm Package to display
132
127
  * @param runner runner according to the context
133
128
  * @param keywordTags Mapping of the NPM package Keywords and a displayed tag
@@ -1 +1 @@
1
- {"version":3,"file":"modules.helpers.js","sourceRoot":"","sources":["../../../src/modules/modules.helpers.ts"],"names":[],"mappings":";;;AAAA,2DAA8K;AAI9K,gEAAoE;AACpE,mCAAmC;AACnC,2CAAiC;AACjC,qCAA8B;AAC9B,8BAA8B;AAC9B,kCAAkC;AAClC,yCAAsC;AACtC,2DAA0C;AAC1C,+BAA+B;AAC/B,wCAAwG;AAExG,MAAM,oBAAoB,GAAG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,KAAK,GAAG;QACZ,KAAK,CAAC,IAAI,CAAC,GAAG,MAAM,WAAW,KAAK,CAAC,IAAI,CAAC,UAAU,CAAC,IAAI,CAAC,EAAE,CAAC,GAAG,eAAe;QAC/E,KAAK,CAAC,MAAM,CAAC,UAAU,CAAC,WAAW,IAAI,kBAAkB,CAAC;QAC1D,GAAG,CAAC,UAAU,CAAC,KAAK,EAAE,GAAG,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,MAAM,CAAC,IAAI,CAAC,eAAe,UAAU,CAAC,KAAK,CAAC,GAAG,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC;QAC7F,GAAG,CAAC,KAAK,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC,SAAS,KAAK,CAAC,GAAG,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC;KAC3F,CAAC;IACF,OAAO,KAAK,CAAC,IAAI,CAAC,aAAG,CAAC,CAAC;AACzB,CAAC;AAlCD,0DAkCC"}
@@ -5,6 +5,7 @@ import { NodePackageInstallTaskOptions } from './interfaces';
5
5
  */
6
6
  export declare class AddDevInstall extends NodePackageInstallTask {
7
7
  quiet: boolean;
8
+ force: boolean;
8
9
  constructor(options?: NodePackageInstallTaskOptions);
9
10
  /** @inheritdoc */
10
11
  toConfiguration(): {
@@ -1 +1 @@
1
- {"version":3,"file":"add-dev-dependency.d.ts","sourceRoot":"","sources":["../../../../src/tasks/package-manager/add-dev-dependency.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,sBAAsB,EAAE,MAAM,kCAAkC,CAAC;AAG1E,OAAO,EAAE,6BAA6B,EAAE,MAAM,cAAc,CAAC;AAE7D;;GAEG;AACH,qBAAa,aAAc,SAAQ,sBAAsB;IAChD,KAAK,UAAS;gBAET,OAAO,CAAC,EAAE,6BAA6B;IASnD,kBAAkB;IACX,eAAe;;;;;;;;;;;;;CAYvB"}
1
+ {"version":3,"file":"add-dev-dependency.d.ts","sourceRoot":"","sources":["../../../../src/tasks/package-manager/add-dev-dependency.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,sBAAsB,EAAE,MAAM,kCAAkC,CAAC;AAG1E,OAAO,EAAE,6BAA6B,EAAE,MAAM,cAAc,CAAC;AAE7D;;GAEG;AACH,qBAAa,aAAc,SAAQ,sBAAsB;IAChD,KAAK,UAAS;IACd,KAAK,UAAS;gBAET,OAAO,CAAC,EAAE,6BAA6B;IAUnD,kBAAkB;IACX,eAAe;;;;;;;;;;;;;CAYvB"}
@@ -11,10 +11,12 @@ class AddDevInstall extends tasks_1.NodePackageInstallTask {
11
11
  constructor(options) {
12
12
  super(options);
13
13
  this.quiet = false;
14
+ this.force = false;
14
15
  this.packageManager = (0, utility_1.getPackageManager)({
15
16
  workspaceConfig: options?.tree && (0, utility_1.getWorkspaceConfig)(options.tree),
16
17
  enforcedNpmManager: options?.packageName
17
18
  });
19
+ this.force = !!options?.force;
18
20
  }
19
21
  /** @inheritdoc */
20
22
  toConfiguration() {
@@ -25,7 +27,7 @@ class AddDevInstall extends tasks_1.NodePackageInstallTask {
25
27
  options: {
26
28
  ...defaultConfig.options,
27
29
  command: 'install',
28
- packageName: `${this.packageName} ${this.packageManager === 'yarn' ? '--prefer-dev' : '--save-dev'}`
30
+ packageName: `${this.packageName} ${this.packageManager === 'yarn' ? '--prefer-dev' : '--save-dev'}${this.force && this.packageManager === 'npm' ? ' --force' : ''}`
29
31
  }
30
32
  };
31
33
  }
@@ -1 +1 @@
1
- {"version":3,"file":"add-dev-dependency.js","sourceRoot":"","sources":["../../../../src/tasks/package-manager/add-dev-dependency.ts"],"names":[],"mappings":";;;AAAA,4DAA0E;AAC1E,sFAA2F;AAC3F,2CAAsE;AAGtE;;GAEG;AACH,MAAa,aAAc,SAAQ,8BAAsB;IAGvD,YAAY,OAAuC;QACjD,KAAK,CAAC,OAAc,CAAC,CAAC;QAHjB,UAAK,GAAG,KAAK,CAAC;QAInB,IAAI,CAAC,cAAc,GAAG,IAAA,2BAAiB,EAAC;YACtC,eAAe,EAAE,OAAO,EAAE,IAAI,IAAI,IAAA,4BAAkB,EAAC,OAAO,CAAC,IAAI,CAAC;YAClE,kBAAkB,EAAE,OAAO,EAAE,WAAW;SACzC,CAAC,CAAC;IACL,CAAC;IAGD,kBAAkB;IACX,eAAe;QACpB,MAAM,aAAa,GAAG,KAAK,CAAC,eAAe,EAAE,CAAC;QAC9C,OAAO;YACL,GAAG,aAAa;YAChB,IAAI,EAAE,yBAAe;YACrB,OAAO,EAAE;gBACP,GAAG,aAAa,CAAC,OAAO;gBACxB,OAAO,EAAE,SAAS;gBAClB,WAAW,EAAE,GAAG,IAAI,CAAC,WAAY,IAAI,IAAI,CAAC,cAAc,KAAK,MAAM,CAAC,CAAC,CAAC,cAAc,CAAC,CAAC,CAAC,YAAY,EAAE;aACtG;SACF,CAAC;IACJ,CAAC;CACF;AAzBD,sCAyBC"}
1
+ {"version":3,"file":"add-dev-dependency.js","sourceRoot":"","sources":["../../../../src/tasks/package-manager/add-dev-dependency.ts"],"names":[],"mappings":";;;AAAA,4DAA0E;AAC1E,sFAA2F;AAC3F,2CAAsE;AAGtE;;GAEG;AACH,MAAa,aAAc,SAAQ,8BAAsB;IAIvD,YAAY,OAAuC;QACjD,KAAK,CAAC,OAAc,CAAC,CAAC;QAJjB,UAAK,GAAG,KAAK,CAAC;QACd,UAAK,GAAG,KAAK,CAAC;QAInB,IAAI,CAAC,cAAc,GAAG,IAAA,2BAAiB,EAAC;YACtC,eAAe,EAAE,OAAO,EAAE,IAAI,IAAI,IAAA,4BAAkB,EAAC,OAAO,CAAC,IAAI,CAAC;YAClE,kBAAkB,EAAE,OAAO,EAAE,WAAW;SACzC,CAAC,CAAC;QACH,IAAI,CAAC,KAAK,GAAG,CAAC,CAAC,OAAO,EAAE,KAAK,CAAC;IAChC,CAAC;IAGD,kBAAkB;IACX,eAAe;QACpB,MAAM,aAAa,GAAG,KAAK,CAAC,eAAe,EAAE,CAAC;QAC9C,OAAO;YACL,GAAG,aAAa;YAChB,IAAI,EAAE,yBAAe;YACrB,OAAO,EAAE;gBACP,GAAG,aAAa,CAAC,OAAO;gBACxB,OAAO,EAAE,SAAS;gBAClB,WAAW,EAAE,GAAG,IAAI,CAAC,WAAY,IAAI,IAAI,CAAC,cAAc,KAAK,MAAM,CAAC,CAAC,CAAC,cAAc,CAAC,CAAC,CAAC,YAAY,GAAG,IAAI,CAAC,KAAK,IAAI,IAAI,CAAC,cAAc,KAAK,KAAK,CAAC,CAAC,CAAC,UAAU,CAAC,CAAC,CAAC,EAAE,EAAE;aACtK;SACF,CAAC;IACJ,CAAC;CACF;AA3BD,sCA2BC"}
@@ -3,12 +3,21 @@ import { Tree } from '@angular-devkit/schematics';
3
3
  * Duplication of the interface not exposed by the @angular-devkit/schematics
4
4
  */
5
5
  export interface NodePackageInstallTaskOptions {
6
+ /** Tree */
6
7
  tree?: Tree;
8
+ /** Package Manager */
7
9
  packageManager?: 'yarn' | 'npm' | '';
10
+ /** Package Name */
8
11
  packageName?: string;
12
+ /** Current working directory */
9
13
  workingDirectory?: string;
14
+ /** quiet argument to package manager command */
10
15
  quiet?: boolean;
16
+ /** Hide output */
11
17
  hideOutput?: boolean;
18
+ /** Allow post/pre-install script run */
12
19
  allowScripts?: boolean;
20
+ /** force install */
21
+ force?: boolean;
13
22
  }
14
23
  //# sourceMappingURL=interfaces.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"interfaces.d.ts","sourceRoot":"","sources":["../../../../src/tasks/package-manager/interfaces.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,4BAA4B,CAAC;AAElD;;GAEG;AACH,MAAM,WAAW,6BAA6B;IAC5C,IAAI,CAAC,EAAE,IAAI,CAAC;IACZ,cAAc,CAAC,EAAE,MAAM,GAAG,KAAK,GAAG,EAAE,CAAC;IACrC,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAC1B,KAAK,CAAC,EAAE,OAAO,CAAC;IAChB,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,YAAY,CAAC,EAAE,OAAO,CAAC;CACxB"}
1
+ {"version":3,"file":"interfaces.d.ts","sourceRoot":"","sources":["../../../../src/tasks/package-manager/interfaces.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,4BAA4B,CAAC;AAElD;;GAEG;AACH,MAAM,WAAW,6BAA6B;IAC5C,WAAW;IACX,IAAI,CAAC,EAAE,IAAI,CAAC;IACZ,sBAAsB;IACtB,cAAc,CAAC,EAAE,MAAM,GAAG,KAAK,GAAG,EAAE,CAAC;IACrC,mBAAmB;IACnB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,gCAAgC;IAChC,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAC1B,gDAAgD;IAChD,KAAK,CAAC,EAAE,OAAO,CAAC;IAChB,mBAAmB;IACnB,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,wCAAwC;IACxC,YAAY,CAAC,EAAE,OAAO,CAAC;IACvB,oBAAoB;IACpB,KAAK,CAAC,EAAE,OAAO,CAAC;CACjB"}
@@ -5,6 +5,7 @@ import type { NodePackageInstallTaskOptions } from './interfaces';
5
5
  */
6
6
  export declare class NpmInstall extends NodePackageInstallTask {
7
7
  quiet: boolean;
8
+ force: boolean;
8
9
  constructor(options?: NodePackageInstallTaskOptions);
9
10
  /** @inheritdoc */
10
11
  toConfiguration(): {
@@ -12,7 +13,7 @@ export declare class NpmInstall extends NodePackageInstallTask {
12
13
  options: {
13
14
  command: string;
14
15
  quiet: boolean;
15
- packageManager: string | undefined;
16
+ packageManager: string;
16
17
  hideOutput?: boolean | undefined;
17
18
  workingDirectory?: string | undefined;
18
19
  packageName?: string | undefined;
@@ -1 +1 @@
1
- {"version":3,"file":"npm-install.d.ts","sourceRoot":"","sources":["../../../../src/tasks/package-manager/npm-install.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,sBAAsB,EAAE,MAAM,kCAAkC,CAAC;AAC1E,OAAO,KAAK,EAAE,6BAA6B,EAAE,MAAM,cAAc,CAAC;AAIlE;;GAEG;AACH,qBAAa,UAAW,SAAQ,sBAAsB;IAC7C,KAAK,UAAS;gBAET,OAAO,CAAC,EAAE,6BAA6B;IAQnD,kBAAkB;IACX,eAAe;;;;;;;;;;;;;CAavB"}
1
+ {"version":3,"file":"npm-install.d.ts","sourceRoot":"","sources":["../../../../src/tasks/package-manager/npm-install.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,sBAAsB,EAAE,MAAM,kCAAkC,CAAC;AAC1E,OAAO,KAAK,EAAE,6BAA6B,EAAE,MAAM,cAAc,CAAC;AAIlE;;GAEG;AACH,qBAAa,UAAW,SAAQ,sBAAsB;IAC7C,KAAK,UAAS;IACd,KAAK,UAAS;gBAET,OAAO,CAAC,EAAE,6BAA6B;IASnD,kBAAkB;IACX,eAAe;;;;;;;;;;;;;CAavB"}
@@ -11,10 +11,12 @@ class NpmInstall extends tasks_1.NodePackageInstallTask {
11
11
  constructor(options) {
12
12
  super(options);
13
13
  this.quiet = false;
14
+ this.force = false;
14
15
  this.packageManager = (0, utility_1.getPackageManager)({
15
16
  workspaceConfig: options?.tree && (0, utility_1.getWorkspaceConfig)(options.tree),
16
17
  enforcedNpmManager: options?.packageName
17
18
  });
19
+ this.force = !!options?.force;
18
20
  }
19
21
  /** @inheritdoc */
20
22
  toConfiguration() {
@@ -26,7 +28,7 @@ class NpmInstall extends tasks_1.NodePackageInstallTask {
26
28
  ...config.options,
27
29
  command: 'install',
28
30
  quiet: this.quiet,
29
- packageManager: this.packageManager
31
+ packageManager: `${this.packageManager}${this.force && this.packageManager === 'npm' ? ' --force' : ''}`
30
32
  }
31
33
  };
32
34
  }
@@ -1 +1 @@
1
- {"version":3,"file":"npm-install.js","sourceRoot":"","sources":["../../../../src/tasks/package-manager/npm-install.ts"],"names":[],"mappings":";;;AAAA,4DAA0E;AAE1E,2CAAsE;AACtE,sFAA2F;AAE3F;;GAEG;AACH,MAAa,UAAW,SAAQ,8BAAsB;IAGpD,YAAY,OAAuC;QACjD,KAAK,CAAC,OAAc,CAAC,CAAC;QAHjB,UAAK,GAAG,KAAK,CAAC;QAInB,IAAI,CAAC,cAAc,GAAG,IAAA,2BAAiB,EAAC;YACtC,eAAe,EAAE,OAAO,EAAE,IAAI,IAAI,IAAA,4BAAkB,EAAC,OAAO,CAAC,IAAI,CAAC;YAClE,kBAAkB,EAAE,OAAO,EAAE,WAAW;SACzC,CAAC,CAAC;IACL,CAAC;IAED,kBAAkB;IACX,eAAe;QACpB,MAAM,MAAM,GAAG,KAAK,CAAC,eAAe,EAAE,CAAC;QACvC,OAAO;YACL,GAAG,MAAM;YACT,IAAI,EAAE,yBAAe;YACrB,OAAO,EAAE;gBACP,GAAG,MAAM,CAAC,OAAO;gBACjB,OAAO,EAAE,SAAS;gBAClB,KAAK,EAAE,IAAI,CAAC,KAAK;gBACjB,cAAc,EAAE,IAAI,CAAC,cAAc;aACpC;SACF,CAAC;IACJ,CAAC;CACF;AAzBD,gCAyBC"}
1
+ {"version":3,"file":"npm-install.js","sourceRoot":"","sources":["../../../../src/tasks/package-manager/npm-install.ts"],"names":[],"mappings":";;;AAAA,4DAA0E;AAE1E,2CAAsE;AACtE,sFAA2F;AAE3F;;GAEG;AACH,MAAa,UAAW,SAAQ,8BAAsB;IAIpD,YAAY,OAAuC;QACjD,KAAK,CAAC,OAAc,CAAC,CAAC;QAJjB,UAAK,GAAG,KAAK,CAAC;QACd,UAAK,GAAG,KAAK,CAAC;QAInB,IAAI,CAAC,cAAc,GAAG,IAAA,2BAAiB,EAAC;YACtC,eAAe,EAAE,OAAO,EAAE,IAAI,IAAI,IAAA,4BAAkB,EAAC,OAAO,CAAC,IAAI,CAAC;YAClE,kBAAkB,EAAE,OAAO,EAAE,WAAW;SACzC,CAAC,CAAC;QACH,IAAI,CAAC,KAAK,GAAG,CAAC,CAAC,OAAO,EAAE,KAAK,CAAC;IAChC,CAAC;IAED,kBAAkB;IACX,eAAe;QACpB,MAAM,MAAM,GAAG,KAAK,CAAC,eAAe,EAAE,CAAC;QACvC,OAAO;YACL,GAAG,MAAM;YACT,IAAI,EAAE,yBAAe;YACrB,OAAO,EAAE;gBACP,GAAG,MAAM,CAAC,OAAO;gBACjB,OAAO,EAAE,SAAS;gBAClB,KAAK,EAAE,IAAI,CAAC,KAAK;gBACjB,cAAc,EAAE,GAAG,IAAI,CAAC,cAAe,GAAG,IAAI,CAAC,KAAK,IAAI,IAAI,CAAC,cAAc,KAAK,KAAK,CAAC,CAAC,CAAC,UAAU,CAAC,CAAC,CAAC,EAAE,EAAE;aAC1G;SACF,CAAC;IACJ,CAAC;CACF;AA3BD,gCA2BC"}
@@ -17,38 +17,40 @@ export interface PackageManagerOptions {
17
17
  }
18
18
  /**
19
19
  * Determine if the given packager manager is supported
20
- *
21
20
  * @param name Name of the package manager
22
21
  */
23
22
  export declare function isSupportedPackageManager(name?: any): name is SupportedPackageManagers;
24
23
  /**
25
24
  * Get package manager used in runs
26
25
  * Defaults to the package manager setup in process.env if no package manager set in angular.json
27
- *
28
26
  * @param options Option to determine the final package manager
29
27
  */
30
28
  export declare function getPackageManager(options?: PackageManagerOptions): SupportedPackageManagers;
31
29
  /**
32
30
  * Get command to run scripts with your package manager
33
- *
34
31
  * @param workspaceConfig Workspace configuration
32
+ * @param packageName Name of the package of the workspace to run the script (name from package.json)
35
33
  */
36
- export declare function getPackageManagerRunner(workspaceConfig?: WorkspaceSchema | string | null): SupportedPackageManagerRunners;
34
+ export declare function getPackageManagerRunner(workspaceConfig?: WorkspaceSchema | string | null, packageName?: string | undefined): SupportedPackageManagerRunners | string;
37
35
  /**
38
36
  * Get command to execute bin command with your package manager
39
- *
40
37
  * @param workspaceConfig Workspace configuration
38
+ * @param packageName Name of the package of the workspace to execute the command
41
39
  */
42
- export declare function getPackageManagerExecutor(workspaceConfig?: WorkspaceSchema | string | null): SupportedPackageManagerExecutors;
40
+ export declare function getPackageManagerExecutor(workspaceConfig?: WorkspaceSchema | string | null, packageName?: string | undefined): SupportedPackageManagerExecutors | string;
41
+ /**
42
+ * Determine if the given package is installed
43
+ * @param packageName name of the package to check
44
+ * @returns
45
+ */
46
+ export declare function isPackageInstalled(packageName: string): boolean;
43
47
  /**
44
48
  * Get package manager version
45
- *
46
49
  * @param options Option to determine the final package manager
47
50
  */
48
51
  export declare function getPackageManagerVersion(options?: PackageManagerOptions): string | undefined;
49
52
  /**
50
53
  * Get package manager information
51
- *
52
54
  * @param options Option to determine the final package manager
53
55
  */
54
56
  export declare function getPackageManagerInfo(options?: PackageManagerOptions): {
@@ -1 +1 @@
1
- {"version":3,"file":"package-manager-runner.d.ts","sourceRoot":"","sources":["../../../src/utility/package-manager-runner.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,sBAAsB,CAAC;AAE/C,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,eAAe,CAAC;AAErD,mCAAmC;AACnC,MAAM,MAAM,wBAAwB,GAAG,KAAK,GAAG,MAAM,CAAC;AAEtD,mCAAmC;AACnC,MAAM,MAAM,8BAA8B,GAAG,GAAG,wBAAwB,MAAM,GAAG,MAAM,CAAC;AAExF,mCAAmC;AACnC,MAAM,MAAM,gCAAgC,GAAG,GAAG,wBAAwB,OAAO,GAAG,MAAM,GAAG,KAAK,CAAC;AAEnG,0CAA0C;AAC1C,MAAM,WAAW,qBAAqB;IACpC,8BAA8B;IAC9B,eAAe,CAAC,EAAE,eAAe,GAAG,MAAM,GAAG,IAAI,CAAC;IAElD,4DAA4D;IAC5D,kBAAkB,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAEnC,8DAA8D;IAC9D,MAAM,CAAC,EAAE,OAAO,CAAC,SAAS,CAAC;CAC5B;AAED;;;;GAIG;AACH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C;CAC5B;AAED;;;GAGG;AACH,wBAAgB,yBAAyB,CAAC,IAAI,CAAC,EAAE,GAAG,GAAG,IAAI,IAAI,wBAAwB,CAEtF;AAYD;;;;GAIG;AACH,wBAAgB,iBAAiB,CAAC,OAAO,CAAC,EAAE,qBAAqB,4BAWhE;AAED;;;;GAIG;AACH,wBAAgB,uBAAuB,CAAC,eAAe,CAAC,EAAE,eAAe,GAAG,MAAM,GAAG,IAAI,EAAE,WAAW,CAAC,EAAE,MAAM,GAAG,SAAS,GAAG,8BAA8B,GAAG,MAAM,CAMpK;AAED;;;;GAIG;AACH,wBAAgB,yBAAyB,CAAC,eAAe,CAAC,EAAE,eAAe,GAAG,MAAM,GAAG,IAAI,EAAE,WAAW,CAAC,EAAE,MAAM,GAAG,SAAS,GAAG,gCAAgC,GAAG,MAAM,CAMxK;AAED;;;;GAIG;AACH,wBAAgB,kBAAkB,CAAC,WAAW,EAAE,MAAM,WAMrD;AAED;;;GAGG;AACH,wBAAgB,wBAAwB,CAAC,OAAO,CAAC,EAAE,qBAAqB,GAAG,MAAM,GAAG,SAAS,CAiB5F;AAED;;;GAGG;AACH,wBAAgB,qBAAqB,CAAC,OAAO,CAAC,EAAE,qBAAqB;;;EAKpE"}
@@ -1,10 +1,14 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.getPackageManagerInfo = exports.getPackageManagerVersion = exports.getPackageManagerExecutor = exports.getPackageManagerRunner = exports.getPackageManager = exports.isSupportedPackageManager = void 0;
3
+ exports.getPackageManagerInfo = exports.getPackageManagerVersion = exports.isPackageInstalled = exports.getPackageManagerExecutor = exports.getPackageManagerRunner = exports.getPackageManager = exports.isSupportedPackageManager = void 0;
4
+ const node_path_1 = require("node:path");
4
5
  const node_child_process_1 = require("node:child_process");
6
+ const PACKAGE_MANAGER_WORKSPACE_MAPPING = {
7
+ npm: '--workspace',
8
+ yarn: 'workspace'
9
+ };
5
10
  /**
6
11
  * Determine if the given packager manager is supported
7
- *
8
12
  * @param name Name of the package manager
9
13
  */
10
14
  function isSupportedPackageManager(name) {
@@ -13,7 +17,6 @@ function isSupportedPackageManager(name) {
13
17
  exports.isSupportedPackageManager = isSupportedPackageManager;
14
18
  /**
15
19
  * Get the Package Manager
16
- *
17
20
  * @param enforcedNpmManager package manager to enforce
18
21
  */
19
22
  function getPackageManagerName(enforcedNpmManager) {
@@ -24,7 +27,6 @@ function getPackageManagerName(enforcedNpmManager) {
24
27
  /**
25
28
  * Get package manager used in runs
26
29
  * Defaults to the package manager setup in process.env if no package manager set in angular.json
27
- *
28
30
  * @param options Option to determine the final package manager
29
31
  */
30
32
  function getPackageManager(options) {
@@ -42,25 +44,46 @@ function getPackageManager(options) {
42
44
  exports.getPackageManager = getPackageManager;
43
45
  /**
44
46
  * Get command to run scripts with your package manager
45
- *
46
47
  * @param workspaceConfig Workspace configuration
48
+ * @param packageName Name of the package of the workspace to run the script (name from package.json)
47
49
  */
48
- function getPackageManagerRunner(workspaceConfig) {
49
- return getPackageManager({ workspaceConfig }) + ' run';
50
+ function getPackageManagerRunner(workspaceConfig, packageName) {
51
+ const pckManager = getPackageManager({ workspaceConfig });
52
+ if (!packageName) {
53
+ return `${pckManager} run`;
54
+ }
55
+ return `${pckManager} ${PACKAGE_MANAGER_WORKSPACE_MAPPING[pckManager]} ${packageName} run`;
50
56
  }
51
57
  exports.getPackageManagerRunner = getPackageManagerRunner;
52
58
  /**
53
59
  * Get command to execute bin command with your package manager
54
- *
55
60
  * @param workspaceConfig Workspace configuration
61
+ * @param packageName Name of the package of the workspace to execute the command
56
62
  */
57
- function getPackageManagerExecutor(workspaceConfig) {
58
- return getPackageManager({ workspaceConfig }) + ' exec';
63
+ function getPackageManagerExecutor(workspaceConfig, packageName) {
64
+ const pckManager = getPackageManager({ workspaceConfig });
65
+ if (!packageName) {
66
+ return `${pckManager} exec`;
67
+ }
68
+ return `${pckManager} ${PACKAGE_MANAGER_WORKSPACE_MAPPING[pckManager]} ${packageName} exec`;
59
69
  }
60
70
  exports.getPackageManagerExecutor = getPackageManagerExecutor;
71
+ /**
72
+ * Determine if the given package is installed
73
+ * @param packageName name of the package to check
74
+ * @returns
75
+ */
76
+ function isPackageInstalled(packageName) {
77
+ try {
78
+ return !!require.resolve(node_path_1.posix.join(packageName, 'package.json'));
79
+ }
80
+ catch {
81
+ return false;
82
+ }
83
+ }
84
+ exports.isPackageInstalled = isPackageInstalled;
61
85
  /**
62
86
  * Get package manager version
63
- *
64
87
  * @param options Option to determine the final package manager
65
88
  */
66
89
  function getPackageManagerVersion(options) {
@@ -85,7 +108,6 @@ function getPackageManagerVersion(options) {
85
108
  exports.getPackageManagerVersion = getPackageManagerVersion;
86
109
  /**
87
110
  * Get package manager information
88
- *
89
111
  * @param options Option to determine the final package manager
90
112
  */
91
113
  function getPackageManagerInfo(options) {
@@ -1 +1 @@
1
- {"version":3,"file":"package-manager-runner.js","sourceRoot":"","sources":["../../../src/utility/package-manager-runner.ts"],"names":[],"mappings":";;;AACA,2DAA8C;AAwB9C;;;;GAIG;AACH,SAAgB,yBAAyB,CAAC,IAAU;IAClD,OAAO,IAAI,KAAK,MAAM,IAAI,IAAI,KAAK,KAAK,CAAC;AAC3C,CAAC;AAFD,8DAEC;AAED;;;;GAIG;AACH,SAAS,qBAAqB,CAAC,kBAA6C;IAC1E,MAAM,uBAAuB,GAAG,yBAAyB,CAAC,OAAO,CAAC,GAAG,EAAE,wBAAwB,CAAC,IAAI,OAAO,CAAC,GAAG,CAAC,wBAAwB,CAAC;IACzI,MAAM,qBAAqB,GAAG,OAAO,CAAC,GAAG,EAAE,YAAY,EAAE,QAAQ,CAAC,MAAM,CAAC,IAAI,MAAM,CAAC;IACpF,OAAO,kBAAkB,IAAI,uBAAuB,IAAI,qBAAqB,IAAI,KAAK,CAAC;AACzF,CAAC;AAED;;;;;GAKG;AACH,SAAgB,iBAAiB,CAAC,OAA+B;IAC/D,IAAI,2BAA+C,CAAC;IACpD,IAAI,OAAO,EAAE,eAAe,EA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d,uGAAuG;gBACvG,gEAAgE;gBAChE,kBAAkB,EAAE,GAAG;gBACvB,gEAAgE;gBAChE,0BAA0B,EAAE,OAAO;aACpC;SACF,CAAC,CAAC,IAAI,EAAE,CAAC;KACX;IAAC,MAAM;QACN,OAAO,SAAS,CAAC;KAClB;AACH,CAAC;AAjBD,4DAiBC;AAED;;;;GAIG;AACH,SAAgB,qBAAqB,CAAC,OAA+B;IACnE,OAAO;QACL,IAAI,EAAE,iBAAiB,CAAC,OAAO,CAAC;QAChC,OAAO,EAAE,wBAAwB,CAAC,OAAO,CAAC;KAC3C,CAAC;AACJ,CAAC;AALD,sDAKC"}
1
+ {"version":3,"file":"package-manager-runner.js","sourceRoot":"","sources":["../../../src/utility/package-manager-runner.ts"],"names":[],"mappings":";;;AAAA,yCAAkC;AAElC,2DAA8C;AAY9C,MAAM,iCAAiC,GAA6C;IAClF,GAAG,EAAE,aAAa;IAClB,IAAI,EAAE,WAAW;CAClB,CAAC;AAcF;;;GAGG;AACH,SAAgB,yBAAyB,CAAC,IAAU;IAClD,OAAO,IAAI,KAAK,MAAM,IAAI,IAAI,KAAK,KAAK,CAAC;AAC3C,CAAC;AAFD,8DAEC;AAED;;;GAGG;AACH,SAAS,qBAAqB,CAAC,kBAA6C;IAC1E,MAAM,uBAAuB,GAAG,yBAAyB,CAAC,OAAO,CAAC,GAAG,EAAE,wBAAwB,CAAC,IAAI,OAAO,CAAC,GAAG,CAAC,wBAAwB,CAAC;IACzI,MAAM,qBAAqB,GAAG,OAAO,CAAC,GAAG,EAAE,YAAY,EAAE,QAAQ,CAAC,MAAM,CAAC,IAAI,MAAM,CAAC;IACpF,OAAO,kBAAkB,IAAI,uBAAuB,IAAI,qBAAqB,IAAI,KAAK,CAAC;AACzF,CAAC;AAED;;;;GAIG;AACH,SAAgB,iBAAiB,CAAC,OAA+B;IAC/D,IAAI,2BAA+C,CAAC;IACpD,IAAI,OAAO,EAAE,eAAe,EAAE;QAC5B,MAAM,cAAc,GAAG,CAA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