@aws/nx-plugin 0.90.0 → 0.91.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/generators.json +8 -0
- package/package.json +1 -1
- package/src/connection/generator.d.ts +2 -2
- package/src/connection/generator.js +19 -16
- package/src/connection/generator.js.map +1 -1
- package/src/mcp-server/generator-info.d.ts +8 -4
- package/src/mcp-server/generator-info.js +63 -15
- package/src/mcp-server/generator-info.js.map +1 -1
- package/src/preset/__snapshots__/generator.spec.ts.snap +1 -3
- package/src/ts/nx-generator/generator.d.ts +1 -1
- package/src/ts/react-website/runtime-config/__snapshots__/generator.spec.ts.snap +3 -1
- package/src/ts/react-website/runtime-config/files/app/components/RuntimeConfig/index.tsx.template +1 -1
- package/src/ts/strands-agent/react-connection/__snapshots__/generator.spec.ts.snap +376 -0
- package/src/ts/strands-agent/react-connection/files/src/components/__agentNameClassName__AgentClientProvider.tsx.template +117 -0
- package/src/ts/strands-agent/react-connection/files/src/hooks/use__agentNameClassName__Agent.tsx.template +18 -0
- package/src/ts/strands-agent/react-connection/generator.d.ts +10 -0
- package/src/ts/strands-agent/react-connection/generator.js +129 -0
- package/src/ts/strands-agent/react-connection/generator.js.map +1 -0
- package/src/ts/strands-agent/react-connection/schema.d.ts +15 -0
- package/src/ts/strands-agent/react-connection/schema.json +26 -0
- package/src/ts/strands-agent/react-connection/serve-local.d.ts +17 -0
- package/src/ts/strands-agent/react-connection/serve-local.js +45 -0
- package/src/ts/strands-agent/react-connection/serve-local.js.map +1 -0
- package/src/utils/ast.d.ts +3 -23
- package/src/utils/ast.js +21 -152
- package/src/utils/ast.js.map +1 -1
- package/src/utils/commands.d.ts +33 -0
- package/src/utils/commands.js +55 -0
- package/src/utils/commands.js.map +1 -0
- package/src/utils/config/__snapshots__/utils.spec.ts.snap +88 -0
- package/src/utils/config/utils.d.ts +2 -1
- package/src/utils/config/utils.js +47 -29
- package/src/utils/config/utils.js.map +1 -1
- package/src/utils/generators.d.ts +13 -0
- package/src/utils/generators.js +26 -0
- package/src/utils/generators.js.map +1 -0
- package/src/utils/nx.d.ts +4 -10
- package/src/utils/nx.js +5 -19
- package/src/utils/nx.js.map +1 -1
- package/src/utils/pkg-manager.d.ts +2 -22
- package/src/utils/pkg-manager.js +2 -7
- package/src/utils/pkg-manager.js.map +1 -1
|
@@ -1,15 +1,12 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.updateAwsNxPluginConfig = exports.readAwsNxPluginConfig = exports.ensureAwsNxPluginConfig = exports.AWS_NX_PLUGIN_CONFIG_FILE_NAME = void 0;
|
|
4
|
-
const tslib_1 = require("tslib");
|
|
5
4
|
/**
|
|
6
5
|
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
|
|
7
6
|
* SPDX-License-Identifier: Apache-2.0
|
|
8
7
|
*/
|
|
9
8
|
const devkit_1 = require("@nx/devkit");
|
|
10
|
-
const ts = tslib_1.__importStar(require("typescript"));
|
|
11
9
|
const ast_1 = require("../ast");
|
|
12
|
-
const typescript_1 = require("typescript");
|
|
13
10
|
const format_1 = require("../format");
|
|
14
11
|
const js_1 = require("../js");
|
|
15
12
|
exports.AWS_NX_PLUGIN_CONFIG_FILE_NAME = 'aws-nx-plugin.config.mts';
|
|
@@ -36,36 +33,57 @@ const readAwsNxPluginConfig = async (tree) => {
|
|
|
36
33
|
return await (0, js_1.importTypeScriptModule)(configTs);
|
|
37
34
|
};
|
|
38
35
|
exports.readAwsNxPluginConfig = readAwsNxPluginConfig;
|
|
36
|
+
const PLACEHOLDER = '"__PLACEHOLDER__"';
|
|
37
|
+
/**
|
|
38
|
+
* Use GritQL to set a top-level property in the export default object,
|
|
39
|
+
* then substitute the placeholder with the JSON-serialized value.
|
|
40
|
+
* Preserves all other properties (including JS expressions) untouched.
|
|
41
|
+
*/
|
|
42
|
+
const setConfigProperty = async (tree, filePath, key, value) => {
|
|
43
|
+
const json = JSON.stringify(value);
|
|
44
|
+
// Check if the property already exists using a named metavariable
|
|
45
|
+
// to avoid ambiguity with anonymous $_ in nested where clauses
|
|
46
|
+
const existsInSatisfies = await (0, ast_1.matchGritQL)(tree, filePath, `\`${key}: $val\` where { $val <: within \`export default $_ satisfies $_\` }`);
|
|
47
|
+
const existsInPlain = !existsInSatisfies &&
|
|
48
|
+
(await (0, ast_1.matchGritQL)(tree, filePath, `\`${key}: $val\` where { $val <: within \`export default $_\` }`));
|
|
49
|
+
if (existsInSatisfies || existsInPlain) {
|
|
50
|
+
// Replace only this property's value, scoped to the export default
|
|
51
|
+
const within = existsInSatisfies
|
|
52
|
+
? `within \`export default $_ satisfies $_\``
|
|
53
|
+
: `within \`export default $_\``;
|
|
54
|
+
await (0, ast_1.applyGritQL)(tree, filePath, `\`${key}: $old\` => \`${key}: ${PLACEHOLDER}\` where { $old <: ${within} }`);
|
|
55
|
+
}
|
|
56
|
+
else {
|
|
57
|
+
// Add the new property using GritQL's += (accumulate) operator.
|
|
58
|
+
// For non-empty objects, += appends correctly without double commas.
|
|
59
|
+
// For empty objects, += fails so we fall back to a direct replacement.
|
|
60
|
+
let added = await (0, ast_1.applyGritQL)(tree, filePath, `\`export default { $props } satisfies $type\` where { $props += \`, ${key}: ${PLACEHOLDER}\` }`);
|
|
61
|
+
if (!added) {
|
|
62
|
+
added = await (0, ast_1.applyGritQL)(tree, filePath, `\`export default { } satisfies $type\` => \`export default { ${key}: ${PLACEHOLDER} } satisfies $type\``);
|
|
63
|
+
}
|
|
64
|
+
if (!added) {
|
|
65
|
+
added = await (0, ast_1.applyGritQL)(tree, filePath, `\`export default { $props }\` where { $props += \`, ${key}: ${PLACEHOLDER}\` }`);
|
|
66
|
+
}
|
|
67
|
+
if (!added) {
|
|
68
|
+
await (0, ast_1.applyGritQL)(tree, filePath, `\`export default { }\` => \`export default { ${key}: ${PLACEHOLDER} }\``);
|
|
69
|
+
}
|
|
70
|
+
}
|
|
71
|
+
// Substitute the placeholder with the actual JSON value
|
|
72
|
+
const content = tree.read(filePath).toString();
|
|
73
|
+
tree.write(filePath, content.replace(PLACEHOLDER, json));
|
|
74
|
+
};
|
|
39
75
|
/**
|
|
40
76
|
* Update the aws nx plugin config file.
|
|
41
|
-
*
|
|
77
|
+
* Only the specified top-level keys are replaced; all other properties
|
|
78
|
+
* (including those containing JS expressions) are left untouched in source.
|
|
42
79
|
*/
|
|
43
80
|
const updateAwsNxPluginConfig = async (tree, configUpdate) => {
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
existingProps.set(prop.name.getText(), prop);
|
|
51
|
-
}
|
|
52
|
-
});
|
|
53
|
-
const properties = [];
|
|
54
|
-
for (const [key, value] of Object.entries(configUpdate)) {
|
|
55
|
-
properties.push(typescript_1.factory.createPropertyAssignment(key, (0, ast_1.jsonToAst)(value)));
|
|
56
|
-
}
|
|
57
|
-
existingObj.properties.forEach((prop) => {
|
|
58
|
-
if (ts.isPropertyAssignment(prop)) {
|
|
59
|
-
const name = prop.name.getText();
|
|
60
|
-
if (configUpdate[name] === undefined) {
|
|
61
|
-
properties.push(prop);
|
|
62
|
-
}
|
|
63
|
-
}
|
|
64
|
-
});
|
|
65
|
-
return typescript_1.factory.createObjectLiteralExpression(properties, true);
|
|
66
|
-
});
|
|
67
|
-
// Format the config nicely after an update
|
|
68
|
-
await (0, format_1.formatFilesInSubtree)(tree, exports.AWS_NX_PLUGIN_CONFIG_FILE_NAME);
|
|
81
|
+
const filePath = exports.AWS_NX_PLUGIN_CONFIG_FILE_NAME;
|
|
82
|
+
for (const [key, value] of Object.entries(configUpdate)) {
|
|
83
|
+
await setConfigProperty(tree, filePath, key, value);
|
|
84
|
+
}
|
|
85
|
+
// Prettier formats the result into properly indented TypeScript
|
|
86
|
+
await (0, format_1.formatFilesInSubtree)(tree, filePath);
|
|
69
87
|
};
|
|
70
88
|
exports.updateAwsNxPluginConfig = updateAwsNxPluginConfig;
|
|
71
89
|
//# sourceMappingURL=utils.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"utils.js","sourceRoot":"","sources":["../../../../../../packages/nx-plugin/src/utils/config/utils.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"utils.js","sourceRoot":"","sources":["../../../../../../packages/nx-plugin/src/utils/config/utils.ts"],"names":[],"mappings":";;;AAAA;;;GAGG;AACH,uCAAoE;AAEpE,gCAAkD;AAClD,sCAAiD;AACjD,8BAA+C;AAElC,QAAA,8BAA8B,GAAG,0BAA0B,CAAC;AAEzE;;GAEG;AACI,MAAM,uBAAuB,GAAG,KAAK,EAC1C,IAAU,EACkB,EAAE;IAC9B,IAAI,CAAC,IAAI,CAAC,MAAM,CAAC,sCAA8B,CAAC,EAAE,CAAC;QACjD,0DAA0D;QAC1D,IAAA,sBAAa,EAAC,IAAI,EAAE,IAAA,0BAAiB,EAAC,SAAS,EAAE,OAAO,CAAC,EAAE,GAAG,EAAE,EAAE,CAAC,CAAC;IACtE,CAAC;IACD,oEAAoE;IACpE,OAAO,MAAM,IAAA,6BAAqB,EAAC,IAAI,CAAE,CAAC;AAC5C,CAAC,CAAC;AATW,QAAA,uBAAuB,2BASlC;AAEF;;GAEG;AACI,MAAM,qBAAqB,GAAG,KAAK,EACxC,IAAU,EAC8B,EAAE;IAC1C,IAAI,CAAC,IAAI,CAAC,MAAM,CAAC,sCAA8B,CAAC,EAAE,CAAC;QACjD,OAAO,SAAS,CAAC;IACnB,CAAC;IACD,MAAM,QAAQ,GAAG,IAAI,CAAC,IAAI,CAAC,sCAA8B,EAAE,OAAO,CAAC,CAAC;IACpE,OAAO,MAAM,IAAA,2BAAsB,EAAC,QAAQ,CAAC,CAAC;AAChD,CAAC,CAAC;AARW,QAAA,qBAAqB,yBAQhC;AAEF,MAAM,WAAW,GAAG,mBAAmB,CAAC;AAExC;;;;GAIG;AACH,MAAM,iBAAiB,GAAG,KAAK,EAC7B,IAAU,EACV,QA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AAI,EACJ,QAAQ,EACR,gDAAgD,GAAG,KAAK,WAAW,MAAM,CAC1E,CAAC;QACJ,CAAC;IACH,CAAC;IAED,wDAAwD;IACxD,MAAM,OAAO,GAAG,IAAI,CAAC,IAAI,CAAC,QAAQ,CAAE,CAAC,QAAQ,EAAE,CAAC;IAChD,IAAI,CAAC,KAAK,CAAC,QAAQ,EAAE,OAAO,CAAC,OAAO,CAAC,WAAW,EAAE,IAAI,CAAC,CAAC,CAAC;AAC3D,CAAC,CAAC;AAEF;;;;GAIG;AACI,MAAM,uBAAuB,GAAG,KAAK,EAC1C,IAAU,EACV,YAAwC,EACzB,EAAE;IACjB,MAAM,QAAQ,GAAG,sCAA8B,CAAC;IAEhD,KAAK,MAAM,CAAC,GAAG,EAAE,KAAK,CAAC,IAAI,MAAM,CAAC,OAAO,CAAC,YAAY,CAAC,EAAE,CAAC;QACxD,MAAM,iBAAiB,CAAC,IAAI,EAAE,QAAQ,EAAE,GAAG,EAAE,KAAK,CAAC,CAAC;IACtD,CAAC;IAED,gEAAgE;IAChE,MAAM,IAAA,6BAAoB,EAAC,IAAI,EAAE,QAAQ,CAAC,CAAC;AAC7C,CAAC,CAAC;AAZW,QAAA,uBAAuB,2BAYlC"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
export interface GeneratorInfo {
|
|
2
|
+
readonly id: string;
|
|
3
|
+
readonly metric: string;
|
|
4
|
+
readonly resolvedFactoryPath: string;
|
|
5
|
+
readonly resolvedSchemaPath: string;
|
|
6
|
+
readonly hidden?: boolean;
|
|
7
|
+
readonly description: string;
|
|
8
|
+
readonly guidePages?: string[];
|
|
9
|
+
}
|
|
10
|
+
/**
|
|
11
|
+
* Build the list of generator info, resolving schema/factory paths relative to the given base directory.
|
|
12
|
+
*/
|
|
13
|
+
export declare const buildGeneratorInfoList: (baseDir: string) => GeneratorInfo[];
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.buildGeneratorInfoList = void 0;
|
|
4
|
+
const tslib_1 = require("tslib");
|
|
5
|
+
/**
|
|
6
|
+
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
|
|
7
|
+
* SPDX-License-Identifier: Apache-2.0
|
|
8
|
+
*/
|
|
9
|
+
const generators_json_1 = tslib_1.__importDefault(require("../../generators.json"));
|
|
10
|
+
const path = tslib_1.__importStar(require("path"));
|
|
11
|
+
/**
|
|
12
|
+
* Build the list of generator info, resolving schema/factory paths relative to the given base directory.
|
|
13
|
+
*/
|
|
14
|
+
const buildGeneratorInfoList = (baseDir) => Object.entries(generators_json_1.default.generators).map(([id, info]) => ({
|
|
15
|
+
id,
|
|
16
|
+
metric: info.metric,
|
|
17
|
+
resolvedFactoryPath: path.resolve(baseDir, info.factory),
|
|
18
|
+
resolvedSchemaPath: path.resolve(baseDir, info.schema),
|
|
19
|
+
description: info.description,
|
|
20
|
+
...('hidden' in info && info.hidden ? { hidden: info.hidden } : {}),
|
|
21
|
+
...('guidePages' in info && info.guidePages
|
|
22
|
+
? { guidePages: info.guidePages }
|
|
23
|
+
: {}),
|
|
24
|
+
}));
|
|
25
|
+
exports.buildGeneratorInfoList = buildGeneratorInfoList;
|
|
26
|
+
//# sourceMappingURL=generators.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"generators.js","sourceRoot":"","sources":["../../../../../packages/nx-plugin/src/utils/generators.ts"],"names":[],"mappings":";;;;AAAA;;;GAGG;AACH,oFAAmD;AACnD,mDAA6B;AAY7B;;GAEG;AACI,MAAM,sBAAsB,GAAG,CAAC,OAAe,EAAmB,EAAE,CACzE,MAAM,CAAC,OAAO,CAAE,yBAAsC,CAAC,UAAU,CAAC,CAAC,GAAG,CACpE,CAAC,CAAC,EAAE,EAAE,IAAI,CAAgB,EAAE,EAAE,CAAC,CAAC;IAC9B,EAAE;IACF,MAAM,EAAE,IAAI,CAAC,MAAM;IACnB,mBAAmB,EAAE,IAAI,CAAC,OAAO,CAAC,OAAO,EAAE,IAAI,CAAC,OAAO,CAAC;IACxD,kBAAkB,EAAE,IAAI,CAAC,OAAO,CAAC,OAAO,EAAE,IAAI,CAAC,MAAM,CAAC;IACtD,WAAW,EAAE,IAAI,CAAC,WAAW;IAC7B,GAAG,CAAC,QAAQ,IAAI,IAAI,IAAI,IAAI,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,MAAM,EAAE,IAAI,CAAC,MAAM,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;IACnE,GAAG,CAAC,YAAY,IAAI,IAAI,IAAI,IAAI,CAAC,UAAU;QACzC,CAAC,CAAC,EAAE,UAAU,EAAE,IAAI,CAAC,UAAU,EAAE;QACjC,CAAC,CAAC,EAAE,CAAC;CACR,CAAC,CACH,CAAC;AAbS,QAAA,sBAAsB,0BAa/B"}
|
package/src/utils/nx.d.ts
CHANGED
|
@@ -3,20 +3,14 @@
|
|
|
3
3
|
* SPDX-License-Identifier: Apache-2.0
|
|
4
4
|
*/
|
|
5
5
|
import { ProjectConfiguration, Tree } from '@nx/devkit';
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
readonly resolvedFactoryPath: string;
|
|
10
|
-
readonly resolvedSchemaPath: string;
|
|
11
|
-
readonly hidden?: boolean;
|
|
12
|
-
readonly description: string;
|
|
13
|
-
readonly guidePages?: string[];
|
|
14
|
-
}
|
|
6
|
+
import { type GeneratorInfo } from './generators';
|
|
7
|
+
export type NxGeneratorInfo = GeneratorInfo;
|
|
8
|
+
export { buildGeneratorInfoList } from './generators';
|
|
15
9
|
/**
|
|
16
10
|
* List Nx Plugin for AWS generators
|
|
17
11
|
* @param includeHidden include hidden generators (default false)
|
|
18
12
|
*/
|
|
19
|
-
export declare const listGenerators: (includeHidden?: boolean) =>
|
|
13
|
+
export declare const listGenerators: (includeHidden?: boolean) => GeneratorInfo[];
|
|
20
14
|
/**
|
|
21
15
|
* Return generator information. Call this from a generator method with __filename
|
|
22
16
|
*/
|
package/src/utils/nx.js
CHANGED
|
@@ -1,34 +1,20 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.addDependencyToTargetIfNotPresent = exports.addComponentGeneratorMetadata = exports.addGeneratorMetadata = exports.readProjectConfigurationUnqualified = exports.getPackageVersion = exports.getGeneratorInfo = exports.listGenerators = void 0;
|
|
3
|
+
exports.addDependencyToTargetIfNotPresent = exports.addComponentGeneratorMetadata = exports.addGeneratorMetadata = exports.readProjectConfigurationUnqualified = exports.getPackageVersion = exports.getGeneratorInfo = exports.listGenerators = exports.buildGeneratorInfoList = void 0;
|
|
4
4
|
const tslib_1 = require("tslib");
|
|
5
5
|
/**
|
|
6
6
|
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
|
|
7
7
|
* SPDX-License-Identifier: Apache-2.0
|
|
8
8
|
*/
|
|
9
9
|
const devkit_1 = require("@nx/devkit");
|
|
10
|
-
const generators_json_1 = tslib_1.__importDefault(require("../../generators.json"));
|
|
11
10
|
const package_json_1 = tslib_1.__importDefault(require("../../package.json"));
|
|
12
11
|
const path = tslib_1.__importStar(require("path"));
|
|
13
12
|
const npm_scope_1 = require("./npm-scope");
|
|
14
13
|
const names_1 = require("./names");
|
|
15
|
-
const
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
resolvedSchemaPath: path.resolve(__dirname, '..', '..', info.schema),
|
|
20
|
-
description: info.description,
|
|
21
|
-
...('hidden' in info && info.hidden
|
|
22
|
-
? {
|
|
23
|
-
hidden: info.hidden,
|
|
24
|
-
}
|
|
25
|
-
: {}),
|
|
26
|
-
...('guidePages' in info && info.guidePages
|
|
27
|
-
? {
|
|
28
|
-
guidePages: info.guidePages,
|
|
29
|
-
}
|
|
30
|
-
: {}),
|
|
31
|
-
}));
|
|
14
|
+
const generators_1 = require("./generators");
|
|
15
|
+
var generators_2 = require("./generators");
|
|
16
|
+
Object.defineProperty(exports, "buildGeneratorInfoList", { enumerable: true, get: function () { return generators_2.buildGeneratorInfoList; } });
|
|
17
|
+
const GENERATORS = (0, generators_1.buildGeneratorInfoList)(path.resolve(__dirname, '..', '..'));
|
|
32
18
|
/**
|
|
33
19
|
* List Nx Plugin for AWS generators
|
|
34
20
|
* @param includeHidden include hidden generators (default false)
|
package/src/utils/nx.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"nx.js","sourceRoot":"","sources":["../../../../../packages/nx-plugin/src/utils/nx.ts"],"names":[],"mappings":";;;;AAAA;;;GAGG;AACH,uCAMoB;AACpB,
|
|
1
|
+
{"version":3,"file":"nx.js","sourceRoot":"","sources":["../../../../../packages/nx-plugin/src/utils/nx.ts"],"names":[],"mappings":";;;;AAAA;;;GAGG;AACH,uCAMoB;AACpB,8EAA6C;AAC7C,mDAA6B;AAC7B,2CAA6D;AAC7D,mCAAsC;AACtC,6CAA0E;AAG1E,2CAAsD;AAA7C,oHAAA,sBAAsB,OAAA;AAE/B,MAAM,UAAU,GAAG,IAAA,mCAAsB,EAAC,IAAI,CAAC,OAAO,CAAC,SAAS,EAAE,IAAI,EAAE,IAAI,CAAC,CAAC,CAAC;AAE/E;;;GAGG;AACI,MAAM,cAAc,GAAG,CAAC,aAAa,GAAG,KAAK,EAAE,EAAE,CACtD,UAAU,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,aAAa,IAAI,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC;AAD1C,QAAA,cAAc,kBAC4B;AAEvD;;GAEG;AACI,MAAM,gBAAgB,GAAG,CAC9B,iBAAyB,EACR,EAAE;IACnB,MAAM,EAAE,GAAG,EAAE,IAAI,EAAE,GAAG,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,OAAO,CAAC,iBAAiB,CAAC,CAAC,CAAC;IAClE,MAAM,mBAAmB,GAAG,IAAI,CAAC,IAAI,CAAC,GAAG,EAAE,IAAI,CAAC,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,iCA8BxC;AAEF;;;GAGG;AACI,MAAM,iCAAiC,GAAG,CAC/C,OAA6B,EAC7B,MAAc,EACd,UAAkB,EAClB,EAAE;IACF,OAAO,CAAC,OAAO,KAAK,EAAE,CAAC;IACvB,OAAO,CAAC,OAAO,CAAC,MAAM,CAAC,KAAK,EAAE,CAAC;IAC/B,OAAO,CAAC,OAAO,CAAC,MAAM,CAAC,CAAC,SAAS,GAAG;QAClC,GAAG,CAAC,OAAO,CAAC,OAAO,CAAC,MAAM,CAAC,CAAC,SAAS,IAAI,EAAE,CAAC,CAAC,MAAM,CACjD,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,KAAK,UAAU,CACxB;QACD,UAAU;KACX,CAAC;AACJ,CAAC,CAAC;AAbW,QAAA,iCAAiC,qCAa5C"}
|
|
@@ -1,25 +1,5 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
*
|
|
4
|
-
* These follow the same conventions as the documentation site components:
|
|
5
|
-
* - `exec`: prefix for running local binaries (e.g. `npx nx`, `pnpm nx`, `bunx nx`)
|
|
6
|
-
* - `run`: prefix for running package.json scripts (e.g. `npm run build`, `pnpm build`)
|
|
7
|
-
*
|
|
8
|
-
* We maintain our own mappings rather than using Nx's `getPackageManagerCommand()`
|
|
9
|
-
* because:
|
|
10
|
-
* - pnpm `exec` returns `pnpm exec` but convention is `pnpm`
|
|
11
|
-
* - bun `exec` returns `bun` but convention is `bunx`
|
|
12
|
-
* - bun `run()` appends `-- undefined` when called without args
|
|
13
|
-
*
|
|
14
|
-
* @see docs/src/components/package-manager-exec-command.astro
|
|
15
|
-
* @see docs/src/components/package-manager-short-command.astro
|
|
16
|
-
*/
|
|
17
|
-
export interface PackageManagerDisplayCommands {
|
|
18
|
-
/** Prefix for running local binaries: npx, pnpm, yarn, bunx */
|
|
19
|
-
exec: string;
|
|
20
|
-
/** Prefix for running package.json scripts: `npm run`, pnpm, yarn, bun */
|
|
21
|
-
run: string;
|
|
22
|
-
}
|
|
1
|
+
import { type PackageManagerDisplayCommands } from './commands';
|
|
2
|
+
export type { PackageManagerDisplayCommands };
|
|
23
3
|
/**
|
|
24
4
|
* Returns display-friendly command prefixes for the detected package manager.
|
|
25
5
|
*/
|
package/src/utils/pkg-manager.js
CHANGED
|
@@ -6,15 +6,10 @@ exports.getPackageManagerDisplayCommands = void 0;
|
|
|
6
6
|
* SPDX-License-Identifier: Apache-2.0
|
|
7
7
|
*/
|
|
8
8
|
const devkit_1 = require("@nx/devkit");
|
|
9
|
-
const
|
|
10
|
-
npm: { exec: 'npx', run: 'npm run' },
|
|
11
|
-
pnpm: { exec: 'pnpm', run: 'pnpm' },
|
|
12
|
-
yarn: { exec: 'yarn', run: 'yarn' },
|
|
13
|
-
bun: { exec: 'bunx', run: 'bun' },
|
|
14
|
-
};
|
|
9
|
+
const commands_1 = require("./commands");
|
|
15
10
|
/**
|
|
16
11
|
* Returns display-friendly command prefixes for the detected package manager.
|
|
17
12
|
*/
|
|
18
|
-
const getPackageManagerDisplayCommands = (pm = (0, devkit_1.detectPackageManager)()) =>
|
|
13
|
+
const getPackageManagerDisplayCommands = (pm = (0, devkit_1.detectPackageManager)()) => commands_1.PACKAGE_MANAGER_COMMANDS[pm] ?? commands_1.PACKAGE_MANAGER_COMMANDS['npm'];
|
|
19
14
|
exports.getPackageManagerDisplayCommands = getPackageManagerDisplayCommands;
|
|
20
15
|
//# sourceMappingURL=pkg-manager.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"pkg-manager.js","sourceRoot":"","sources":["../../../../../packages/nx-plugin/src/utils/pkg-manager.ts"],"names":[],"mappings":";;;AAAA;;;GAGG;AACH,uCAAkD;
|
|
1
|
+
{"version":3,"file":"pkg-manager.js","sourceRoot":"","sources":["../../../../../packages/nx-plugin/src/utils/pkg-manager.ts"],"names":[],"mappings":";;;AAAA;;;GAGG;AACH,uCAAkD;AAClD,yCAGoB;AAIpB;;GAEG;AACI,MAAM,gCAAgC,GAAG,CAC9C,EAAE,GAAG,IAAA,6BAAoB,GAAE,EACI,EAAE,CACjC,mCAAwB,CAAC,EAAE,CAAC,IAAI,mCAAwB,CAAC,KAAK,CAAC,CAAC;AAHrD,QAAA,gCAAgC,oCAGqB"}
|