@nx/js 24.0.0-pr.37405.acdaf31 → 24.0.0-rc.1
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/dist/internal.d.ts +2 -0
- package/dist/internal.js +8 -2
- package/dist/node.d.ts +1 -0
- package/dist/node.js +6 -0
- package/dist/ready-signal.d.ts +1 -0
- package/dist/ready-signal.js +6 -0
- package/dist/src/executors/release-publish/release-publish.impl.js +44 -27
- package/dist/src/generators/init/init.js +3 -33
- package/dist/src/generators/init/schema.d.ts +0 -1
- package/dist/src/generators/library/library.d.ts +1 -1
- package/dist/src/generators/library/library.js +5 -18
- package/dist/src/generators/library/schema.d.ts +0 -5
- package/dist/src/generators/library/schema.json +0 -6
- package/dist/src/generators/setup-build/generator.js +0 -5
- package/dist/src/plugins/scripts/create-script-nodes.d.ts +24 -0
- package/dist/src/plugins/scripts/create-script-nodes.js +170 -0
- package/dist/src/plugins/scripts/node-plugin.d.ts +10 -0
- package/dist/src/plugins/scripts/node-plugin.js +52 -0
- package/dist/src/plugins/scripts/shebang.d.ts +13 -0
- package/dist/src/plugins/scripts/shebang.js +31 -0
- package/dist/src/plugins/scripts/target-name.d.ts +9 -0
- package/dist/src/plugins/scripts/target-name.js +19 -0
- package/dist/src/plugins/scripts/tsx-plugin.d.ts +3 -0
- package/dist/src/plugins/scripts/tsx-plugin.js +11 -0
- package/dist/src/plugins/typescript/build-typechecks.d.ts +8 -0
- package/dist/src/plugins/typescript/build-typechecks.js +45 -0
- package/dist/src/plugins/typescript/plugin.js +120 -39
- package/dist/src/plugins/typescript/typecheck-target.d.ts +58 -0
- package/dist/src/plugins/typescript/typecheck-target.js +86 -0
- package/dist/src/release/version-actions.js +21 -6
- package/dist/src/utils/add-linting-to-project.d.ts +0 -2
- package/dist/src/utils/add-linting-to-project.js +0 -3
- package/dist/src/utils/npm-config.js +18 -6
- package/dist/src/utils/swc/compile-swc.d.ts +2 -0
- package/dist/src/utils/swc/compile-swc.js +2 -1
- package/dist/src/utils/typescript/add-typescript-plugin.d.ts +22 -0
- package/dist/src/utils/typescript/add-typescript-plugin.js +145 -0
- package/dist/src/utils/typescript/ts-solution-setup.d.ts +1 -1
- package/dist/src/utils/typescript/ts-solution-setup.js +1 -10
- package/dist/tsx.d.ts +1 -0
- package/dist/tsx.js +6 -0
- package/package.json +35 -11
package/dist/internal.d.ts
CHANGED
|
@@ -7,6 +7,7 @@ export { PNPM_INSTALL_SETTINGS_INPUTS, PNPM_MAJOR_RUNTIME_INPUT, pnpmInstallSett
|
|
|
7
7
|
export { addPnpmDeployOutputCacheInputs } from './src/utils/pnpm-deploy-output-cache-inputs';
|
|
8
8
|
export type { MatchedTargetRef } from './src/utils/target-defaults-matching';
|
|
9
9
|
export { TS_SOLUTION_SETUP_TSCONFIG_INPUT, addProjectToTsSolutionWorkspace, assertNotUsingTsSolutionSetup, findRuntimeTsConfigName, getDefinedCustomConditionName, getProjectSourceRoot, getProjectType, isUsingTsSolutionSetup, shouldConfigureTsSolutionSetup, updateTsconfigFiles, } from './src/utils/typescript/ts-solution-setup';
|
|
10
|
+
export { ensureTypescriptPlugin, registerTypescriptPluginForTypecheck, } from './src/utils/typescript/add-typescript-plugin';
|
|
10
11
|
export { getTsConfigBaseOptions } from './src/utils/typescript/create-ts-config';
|
|
11
12
|
export { createTreeParseConfigHost, type TreeParseConfigHost, } from './src/utils/typescript/ts-config';
|
|
12
13
|
export { ensureTypescript } from './src/utils/typescript/ensure-typescript';
|
|
@@ -23,6 +24,7 @@ export { getNpmScope } from './src/utils/package-json/get-npm-scope';
|
|
|
23
24
|
export { getProjectPackageManagerWorkspaceState, getProjectPackageManagerWorkspaceStateWarningTask, } from './src/utils/package-manager-workspaces';
|
|
24
25
|
export { findNpmDependencies } from './src/utils/find-npm-dependencies';
|
|
25
26
|
export { addBuildAndWatchDepsTargets, isValidPackageJsonBuildConfig, } from './src/plugins/typescript/util';
|
|
27
|
+
export { createTypecheckTarget, selectTypecheckTsConfig, type TypecheckTargetOptions, } from './src/plugins/typescript/typecheck-target';
|
|
26
28
|
export { normalizeLinterOption, normalizeUnitTestRunnerOption, } from './src/utils/generator-prompts';
|
|
27
29
|
export { detectLinters } from './src/utils/linter';
|
|
28
30
|
export { addLintingToProject, type AddLintingToProjectOptions, } from './src/utils/add-linting-to-project';
|
package/dist/internal.js
CHANGED
|
@@ -5,8 +5,8 @@
|
|
|
5
5
|
// internal consumers and may change without semver protection. Consider it
|
|
6
6
|
// the @nx/js equivalent of `@nx/devkit/internal`.
|
|
7
7
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
8
|
-
exports.
|
|
9
|
-
exports.typesNodeVersion = exports.tsLibVersion = exports.swcNodeVersion = exports.swcHelpersVersion = exports.swcCoreVersion = exports.swcCliVersion = exports.prettierVersion = exports.esbuildVersion = exports.nxVersion = exports.releaseTasks = exports.addReleaseConfigForTsSolution = exports.addReleaseConfigForNonTsSolution = exports.addLocalRegistryScripts = exports.stripGlobToBaseDir = exports.getImportPath = exports.createGlobPatternsForDependencies = exports.addLintingToProject = exports.detectLinters = exports.normalizeUnitTestRunnerOption = exports.normalizeLinterOption = void 0;
|
|
8
|
+
exports.findNpmDependencies = exports.getProjectPackageManagerWorkspaceStateWarningTask = exports.getProjectPackageManagerWorkspaceState = exports.getNpmScope = exports.sortPackageJsonFields = exports.CopyAssetsHandler = exports.addSwcRegisterDependencies = exports.addSwcDependencies = exports.acknowledgeSwcBuildScripts = exports.addSwcTestConfig = exports.addSwcConfig = exports.createTmpTsConfig = exports.computeCompilerOptionsPaths = exports.calculateProjectDependencies = exports.calculateProjectBuildableDependencies = exports.compileTypeScript = exports.getNeededCompilerOptionOverrides = exports.isTypescriptVersionAtLeast = exports.getTsConfigModuleResolution = exports.getRangeMinimum = exports.ensureTypescript = exports.createTreeParseConfigHost = exports.getTsConfigBaseOptions = exports.registerTypescriptPluginForTypecheck = exports.ensureTypescriptPlugin = exports.updateTsconfigFiles = exports.shouldConfigureTsSolutionSetup = exports.isUsingTsSolutionSetup = exports.getProjectType = exports.getProjectSourceRoot = exports.getDefinedCustomConditionName = exports.findRuntimeTsConfigName = exports.assertNotUsingTsSolutionSetup = exports.addProjectToTsSolutionWorkspace = exports.TS_SOLUTION_SETUP_TSCONFIG_INPUT = exports.addPnpmDeployOutputCacheInputs = exports.shouldIncludePnpmMajorRuntimeInput = exports.pnpmInstallSettingsInputsForInferredTarget = exports.PNPM_MAJOR_RUNTIME_INPUT = exports.PNPM_INSTALL_SETTINGS_INPUTS = exports.isEsmProject = exports.walkTsconfigExtendsChain = exports.findProjectsNpmDependencies = exports.isBuiltinModuleImport = exports.TargetProjectLocator = exports.requireWithTsconfigFallback = exports.registerTsConfigPaths = exports.registerTsProject = exports.loadTsFile = exports.forceRegisterEsmLoader = void 0;
|
|
9
|
+
exports.typesNodeVersion = exports.tsLibVersion = exports.swcNodeVersion = exports.swcHelpersVersion = exports.swcCoreVersion = exports.swcCliVersion = exports.prettierVersion = exports.esbuildVersion = exports.nxVersion = exports.releaseTasks = exports.addReleaseConfigForTsSolution = exports.addReleaseConfigForNonTsSolution = exports.addLocalRegistryScripts = exports.stripGlobToBaseDir = exports.getImportPath = exports.createGlobPatternsForDependencies = exports.addLintingToProject = exports.detectLinters = exports.normalizeUnitTestRunnerOption = exports.normalizeLinterOption = exports.selectTypecheckTsConfig = exports.createTypecheckTarget = exports.isValidPackageJsonBuildConfig = exports.addBuildAndWatchDepsTargets = void 0;
|
|
10
10
|
// Re-exports of nx-source internals.
|
|
11
11
|
var internal_1 = require("@nx/devkit/internal");
|
|
12
12
|
Object.defineProperty(exports, "forceRegisterEsmLoader", { enumerable: true, get: function () { return internal_1.forceRegisterEsmLoader; } });
|
|
@@ -46,6 +46,9 @@ Object.defineProperty(exports, "getProjectType", { enumerable: true, get: functi
|
|
|
46
46
|
Object.defineProperty(exports, "isUsingTsSolutionSetup", { enumerable: true, get: function () { return ts_solution_setup_1.isUsingTsSolutionSetup; } });
|
|
47
47
|
Object.defineProperty(exports, "shouldConfigureTsSolutionSetup", { enumerable: true, get: function () { return ts_solution_setup_1.shouldConfigureTsSolutionSetup; } });
|
|
48
48
|
Object.defineProperty(exports, "updateTsconfigFiles", { enumerable: true, get: function () { return ts_solution_setup_1.updateTsconfigFiles; } });
|
|
49
|
+
var add_typescript_plugin_1 = require("./src/utils/typescript/add-typescript-plugin");
|
|
50
|
+
Object.defineProperty(exports, "ensureTypescriptPlugin", { enumerable: true, get: function () { return add_typescript_plugin_1.ensureTypescriptPlugin; } });
|
|
51
|
+
Object.defineProperty(exports, "registerTypescriptPluginForTypecheck", { enumerable: true, get: function () { return add_typescript_plugin_1.registerTypescriptPluginForTypecheck; } });
|
|
49
52
|
// TypeScript helpers. resolvePathsBaseUrl, extractTsConfigBase,
|
|
50
53
|
// tsConfigBaseOptions, addTsLibDependencies, and resolveModuleByImport ship via
|
|
51
54
|
// the public @nx/js entry. getTsConfigBaseOptions is public too, but is
|
|
@@ -94,6 +97,9 @@ Object.defineProperty(exports, "findNpmDependencies", { enumerable: true, get: f
|
|
|
94
97
|
var util_1 = require("./src/plugins/typescript/util");
|
|
95
98
|
Object.defineProperty(exports, "addBuildAndWatchDepsTargets", { enumerable: true, get: function () { return util_1.addBuildAndWatchDepsTargets; } });
|
|
96
99
|
Object.defineProperty(exports, "isValidPackageJsonBuildConfig", { enumerable: true, get: function () { return util_1.isValidPackageJsonBuildConfig; } });
|
|
100
|
+
var typecheck_target_1 = require("./src/plugins/typescript/typecheck-target");
|
|
101
|
+
Object.defineProperty(exports, "createTypecheckTarget", { enumerable: true, get: function () { return typecheck_target_1.createTypecheckTarget; } });
|
|
102
|
+
Object.defineProperty(exports, "selectTypecheckTsConfig", { enumerable: true, get: function () { return typecheck_target_1.selectTypecheckTsConfig; } });
|
|
97
103
|
// Generator helpers
|
|
98
104
|
var generator_prompts_1 = require("./src/utils/generator-prompts");
|
|
99
105
|
Object.defineProperty(exports, "normalizeLinterOption", { enumerable: true, get: function () { return generator_prompts_1.normalizeLinterOption; } });
|
package/dist/node.d.ts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { createNodes, createNodesV2, type NodeScriptsPluginOptions, } from './src/plugins/scripts/node-plugin';
|
package/dist/node.js
ADDED
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.createNodesV2 = exports.createNodes = void 0;
|
|
4
|
+
var node_plugin_1 = require("./src/plugins/scripts/node-plugin");
|
|
5
|
+
Object.defineProperty(exports, "createNodes", { enumerable: true, get: function () { return node_plugin_1.createNodes; } });
|
|
6
|
+
Object.defineProperty(exports, "createNodesV2", { enumerable: true, get: function () { return node_plugin_1.createNodesV2; } });
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { emitReadySignal } from '@nx/devkit';
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.emitReadySignal = void 0;
|
|
4
|
+
// The entry generated servers import to report readiness to Nx
|
|
5
|
+
var devkit_1 = require("@nx/devkit");
|
|
6
|
+
Object.defineProperty(exports, "emitReadySignal", { enumerable: true, get: function () { return devkit_1.emitReadySignal; } });
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.default = runExecutor;
|
|
4
4
|
const devkit_1 = require("@nx/devkit");
|
|
5
|
-
const
|
|
5
|
+
const internal_1 = require("@nx/devkit/internal");
|
|
6
6
|
const fs_1 = require("fs");
|
|
7
7
|
const npm_run_path_1 = require("npm-run-path");
|
|
8
8
|
const path_1 = require("path");
|
|
@@ -58,9 +58,7 @@ async function runExecutor(options, context) {
|
|
|
58
58
|
let isNpmInstalled = false;
|
|
59
59
|
try {
|
|
60
60
|
isNpmInstalled =
|
|
61
|
-
(0,
|
|
62
|
-
encoding: 'utf-8',
|
|
63
|
-
windowsHide: true,
|
|
61
|
+
(0, internal_1.safeExecFileSync)('npm', ['--version'], {
|
|
64
62
|
stdio: ['ignore', 'pipe', 'ignore'],
|
|
65
63
|
}).trim() !== '';
|
|
66
64
|
}
|
|
@@ -160,14 +158,38 @@ Please update the local dependency on "${depName}" to be a valid semantic versio
|
|
|
160
158
|
// Use bun info when bun is the package manager, otherwise use npm view
|
|
161
159
|
// (npm view works across npm/pnpm/yarn environments and is the established default)
|
|
162
160
|
const npmViewDistTagField = `dist-tags[${tag}]`;
|
|
163
|
-
const
|
|
164
|
-
?
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
161
|
+
const npmViewCommand = pm === 'bun'
|
|
162
|
+
? {
|
|
163
|
+
command: 'bun',
|
|
164
|
+
args: [
|
|
165
|
+
'info',
|
|
166
|
+
packageName,
|
|
167
|
+
'--json',
|
|
168
|
+
`--${registryConfigKey}=${registry}`,
|
|
169
|
+
],
|
|
170
|
+
}
|
|
171
|
+
: {
|
|
172
|
+
command: 'npm',
|
|
173
|
+
args: [
|
|
174
|
+
'view',
|
|
175
|
+
`${packageName}@${packageJson.version}`,
|
|
176
|
+
'name',
|
|
177
|
+
'version',
|
|
178
|
+
npmViewDistTagField,
|
|
179
|
+
'--json',
|
|
180
|
+
`--${registryConfigKey}=${registry}`,
|
|
181
|
+
],
|
|
182
|
+
};
|
|
183
|
+
const npmDistTagAddCommand = {
|
|
184
|
+
command: 'npm',
|
|
185
|
+
args: [
|
|
186
|
+
'dist-tag',
|
|
187
|
+
'add',
|
|
188
|
+
`${packageName}@${packageJson.version}`,
|
|
189
|
+
tag,
|
|
190
|
+
`--${registryConfigKey}=${registry}`,
|
|
191
|
+
],
|
|
192
|
+
};
|
|
171
193
|
/**
|
|
172
194
|
* In a dry-run scenario, it is most likely that all commands are being run with dry-run, therefore
|
|
173
195
|
* the most up to date/relevant version might not exist on disk for us to read and make the npm view
|
|
@@ -179,16 +201,15 @@ Please update the local dependency on "${depName}" to be a valid semantic versio
|
|
|
179
201
|
if (!isDryRun && !options.firstRelease) {
|
|
180
202
|
const currentVersion = packageJson.version;
|
|
181
203
|
try {
|
|
182
|
-
const result = (0,
|
|
204
|
+
const result = (0, internal_1.safeExecFileSync)(npmViewCommand.command, npmViewCommand.args, {
|
|
183
205
|
env: processEnv(true),
|
|
184
206
|
cwd: context.root,
|
|
185
207
|
stdio: ['ignore', 'pipe', 'pipe'],
|
|
186
|
-
windowsHide: true,
|
|
187
208
|
});
|
|
188
209
|
// `npm view`/`bun info` can exit 0 with empty stdout when the package exists in the registry but has
|
|
189
210
|
// no published versions or dist-tags yet (e.g. GitHub packages). Treat empty output the same as
|
|
190
211
|
// package not existing yet and continue to the publish step.
|
|
191
|
-
const output = result.
|
|
212
|
+
const output = result.trim();
|
|
192
213
|
let distTagVersion;
|
|
193
214
|
let versionExists;
|
|
194
215
|
if (!output) {
|
|
@@ -228,11 +249,10 @@ Please update the local dependency on "${depName}" to be a valid semantic versio
|
|
|
228
249
|
if (versionExists) {
|
|
229
250
|
try {
|
|
230
251
|
if (!isDryRun) {
|
|
231
|
-
(0,
|
|
252
|
+
(0, internal_1.safeExecFileSync)(npmDistTagAddCommand.command, npmDistTagAddCommand.args, {
|
|
232
253
|
env: processEnv(true),
|
|
233
254
|
cwd: context.root,
|
|
234
255
|
stdio: 'ignore',
|
|
235
|
-
windowsHide: true,
|
|
236
256
|
});
|
|
237
257
|
console.log(`Added the dist-tag ${tag} to v${currentVersion} for registry ${registry}.\n`);
|
|
238
258
|
}
|
|
@@ -323,25 +343,22 @@ Please update the local dependency on "${depName}" to be a valid semantic versio
|
|
|
323
343
|
function runPublish(ctx) {
|
|
324
344
|
const { pm, options, context, packageRoot, packageJson, registry, registryConfigKey, tag, isDryRun, isNpmInstalled, packageTxt, } = ctx;
|
|
325
345
|
const pmCommand = (0, devkit_1.getPackageManagerCommand)(pm);
|
|
326
|
-
const
|
|
327
|
-
pmCommand.publish(packageRoot, registry, registryConfigKey, tag),
|
|
328
|
-
];
|
|
346
|
+
const { command: publishCommand, args: publishArgs } = pmCommand.publishArgv(packageRoot, registry, registryConfigKey, tag);
|
|
329
347
|
if (options.otp) {
|
|
330
|
-
|
|
348
|
+
publishArgs.push(`--otp=${options.otp}`);
|
|
331
349
|
}
|
|
332
350
|
if (options.access) {
|
|
333
|
-
|
|
351
|
+
publishArgs.push(`--access=${options.access}`);
|
|
334
352
|
}
|
|
335
353
|
if (isDryRun) {
|
|
336
|
-
|
|
354
|
+
publishArgs.push(`--dry-run`);
|
|
337
355
|
}
|
|
338
356
|
try {
|
|
339
|
-
const output = (0,
|
|
357
|
+
const output = (0, internal_1.safeExecFileSync)(publishCommand, publishArgs, {
|
|
340
358
|
maxBuffer: LARGE_BUFFER,
|
|
341
359
|
env: processEnv(true),
|
|
342
360
|
cwd: context.root,
|
|
343
361
|
stdio: ['ignore', 'pipe', 'pipe'],
|
|
344
|
-
windowsHide: true,
|
|
345
362
|
});
|
|
346
363
|
// If in dry-run mode, the version on disk will not represent the version that would be published, so we scrub it from the output to avoid confusion.
|
|
347
364
|
const dryRunVersionPlaceholder = 'X.X.X-dry-run';
|
|
@@ -350,7 +367,7 @@ function runPublish(ctx) {
|
|
|
350
367
|
: `Published to ${registry} with tag "${tag}"`;
|
|
351
368
|
// bun publish does not support outputting JSON, so we need to modify and print the output string directly
|
|
352
369
|
if (pm === 'bun') {
|
|
353
|
-
let outputStr = output
|
|
370
|
+
let outputStr = output;
|
|
354
371
|
if (isDryRun) {
|
|
355
372
|
outputStr = outputStr.replace(new RegExp(`${packageJson.name}@${packageJson.version}`, 'g'), `${packageJson.name}@${dryRunVersionPlaceholder}`);
|
|
356
373
|
}
|
|
@@ -364,7 +381,7 @@ function runPublish(ctx) {
|
|
|
364
381
|
* We cannot JSON.parse the output directly because if the user is using lifecycle scripts, npm/pnpm will mix its publish output with the JSON output all on stdout.
|
|
365
382
|
* Additionally, we want to capture and show the lifecycle script outputs as beforeJsonData and afterJsonData and print them accordingly below.
|
|
366
383
|
*/
|
|
367
|
-
const { beforeJsonData, jsonData, afterJsonData } = (0, extract_npm_publish_json_data_1.extractNpmPublishJsonData)(output
|
|
384
|
+
const { beforeJsonData, jsonData, afterJsonData } = (0, extract_npm_publish_json_data_1.extractNpmPublishJsonData)(output);
|
|
368
385
|
if (!jsonData) {
|
|
369
386
|
console.error(`The ${pm} publish output data could not be extracted. Please report this issue on https://github.com/nrwl/nx`);
|
|
370
387
|
return {
|
|
@@ -5,8 +5,8 @@ exports.initGeneratorInternal = initGeneratorInternal;
|
|
|
5
5
|
const internal_1 = require("@nx/devkit/internal");
|
|
6
6
|
const devkit_1 = require("@nx/devkit");
|
|
7
7
|
const path_1 = require("path");
|
|
8
|
-
const plugin_1 = require("../../plugins/typescript/plugin");
|
|
9
8
|
const assert_supported_typescript_version_1 = require("../../utils/assert-supported-typescript-version");
|
|
9
|
+
const add_typescript_plugin_1 = require("../../utils/typescript/add-typescript-plugin");
|
|
10
10
|
const formatter_setup_1 = require("../../utils/formatter-setup");
|
|
11
11
|
const nx_formatter_internals_1 = require("../../utils/nx-formatter-internals");
|
|
12
12
|
const create_ts_config_1 = require("../../utils/typescript/create-ts-config");
|
|
@@ -36,39 +36,9 @@ async function initGenerator(tree, schema) {
|
|
|
36
36
|
async function initGeneratorInternal(tree, schema) {
|
|
37
37
|
(0, assert_supported_typescript_version_1.assertSupportedTypescriptVersion)(tree);
|
|
38
38
|
const tasks = [];
|
|
39
|
-
|
|
40
|
-
schema.addPlugin ??=
|
|
41
|
-
process.env.NX_ADD_PLUGINS !== 'false' &&
|
|
42
|
-
nxJson.useInferencePlugins !== false;
|
|
43
|
-
schema.addTsPlugin ??= schema.addPlugin;
|
|
39
|
+
schema.addTsPlugin ??= true;
|
|
44
40
|
if (schema.addTsPlugin) {
|
|
45
|
-
await (0,
|
|
46
|
-
typecheck: [
|
|
47
|
-
{ targetName: 'typecheck' },
|
|
48
|
-
{ targetName: 'tsc:typecheck' },
|
|
49
|
-
{ targetName: 'tsc-typecheck' },
|
|
50
|
-
],
|
|
51
|
-
build: [
|
|
52
|
-
{
|
|
53
|
-
targetName: 'build',
|
|
54
|
-
configName: 'tsconfig.lib.json',
|
|
55
|
-
buildDepsName: 'build-deps',
|
|
56
|
-
watchDepsName: 'watch-deps',
|
|
57
|
-
},
|
|
58
|
-
{
|
|
59
|
-
targetName: 'tsc:build',
|
|
60
|
-
configName: 'tsconfig.lib.json',
|
|
61
|
-
buildDepsName: 'tsc:build-deps',
|
|
62
|
-
watchDepsName: 'tsc:watch-deps',
|
|
63
|
-
},
|
|
64
|
-
{
|
|
65
|
-
targetName: 'tsc-build',
|
|
66
|
-
configName: 'tsconfig.lib.json',
|
|
67
|
-
buildDepsName: 'tsc-build-deps',
|
|
68
|
-
watchDepsName: 'tsc-watch-deps',
|
|
69
|
-
},
|
|
70
|
-
],
|
|
71
|
-
}, schema.updatePackageScripts);
|
|
41
|
+
await (0, add_typescript_plugin_1.addTypescriptPlugin)(tree, schema.updatePackageScripts);
|
|
72
42
|
}
|
|
73
43
|
if (schema.addTsConfigBase && !(0, ts_config_1.getRootTsConfigFileName)(tree)) {
|
|
74
44
|
if (schema.addTsPlugin) {
|
|
@@ -2,6 +2,6 @@ import { GeneratorCallback, Tree } from '@nx/devkit';
|
|
|
2
2
|
import type { LibraryGeneratorSchema, NormalizedLibraryGeneratorOptions } from './schema';
|
|
3
3
|
export declare function libraryGenerator(tree: Tree, schema: LibraryGeneratorSchema): Promise<GeneratorCallback>;
|
|
4
4
|
export declare function libraryGeneratorInternal(tree: Tree, schema: LibraryGeneratorSchema): Promise<GeneratorCallback>;
|
|
5
|
-
export type AddLintOptions = Pick<NormalizedLibraryGeneratorOptions, 'name' | 'linter' | 'projectRoot' | 'unitTestRunner' | 'js' | 'enableTypedLinting' | '
|
|
5
|
+
export type AddLintOptions = Pick<NormalizedLibraryGeneratorOptions, 'name' | 'linter' | 'projectRoot' | 'unitTestRunner' | 'js' | 'enableTypedLinting' | 'rootProject' | 'bundler' | 'isUsingTsSolutionConfig'>;
|
|
6
6
|
export declare function addLint(tree: Tree, options: AddLintOptions): Promise<GeneratorCallback>;
|
|
7
7
|
export default libraryGenerator;
|
|
@@ -26,7 +26,6 @@ const add_release_config_1 = require("./utils/add-release-config");
|
|
|
26
26
|
const defaultOutputDirectory = 'dist';
|
|
27
27
|
async function libraryGenerator(tree, schema) {
|
|
28
28
|
return await libraryGeneratorInternal(tree, {
|
|
29
|
-
addPlugin: false,
|
|
30
29
|
useProjectJson: true,
|
|
31
30
|
...schema,
|
|
32
31
|
});
|
|
@@ -34,7 +33,7 @@ async function libraryGenerator(tree, schema) {
|
|
|
34
33
|
async function libraryGeneratorInternal(tree, schema) {
|
|
35
34
|
(0, assert_supported_typescript_version_1.assertSupportedTypescriptVersion)(tree);
|
|
36
35
|
const tasks = [];
|
|
37
|
-
const addTsPlugin = (0, ts_solution_setup_1.shouldConfigureTsSolutionSetup)(tree
|
|
36
|
+
const addTsPlugin = (0, ts_solution_setup_1.shouldConfigureTsSolutionSetup)(tree);
|
|
38
37
|
tasks.push(await (0, init_1.default)(tree, {
|
|
39
38
|
...schema,
|
|
40
39
|
skipFormat: true,
|
|
@@ -72,7 +71,6 @@ async function libraryGeneratorInternal(tree, schema) {
|
|
|
72
71
|
includeLib: true,
|
|
73
72
|
skipFormat: true,
|
|
74
73
|
testEnvironment: options.testEnvironment,
|
|
75
|
-
addPlugin: options.addPlugin,
|
|
76
74
|
});
|
|
77
75
|
tasks.push(viteTask);
|
|
78
76
|
createOrEditViteConfig(tree, {
|
|
@@ -111,7 +109,6 @@ async function libraryGeneratorInternal(tree, schema) {
|
|
|
111
109
|
compiler: options.compiler === 'swc' ? 'swc' : 'babel',
|
|
112
110
|
passWithNoTests: options.passWithNoTests,
|
|
113
111
|
skipPackageJson: options.skipPackageJson,
|
|
114
|
-
addPlugin: options.addPlugin,
|
|
115
112
|
});
|
|
116
113
|
tasks.push(vitestTask);
|
|
117
114
|
}
|
|
@@ -255,13 +252,12 @@ async function addLint(tree, options) {
|
|
|
255
252
|
return (0, add_linting_to_project_1.addLintingToProject)(tree, {
|
|
256
253
|
linter: options.linter,
|
|
257
254
|
project: options.name,
|
|
258
|
-
addPlugin: options.addPlugin,
|
|
259
255
|
rootProject: options.rootProject,
|
|
260
256
|
unitTestRunner: options.unitTestRunner,
|
|
261
257
|
});
|
|
262
258
|
}
|
|
263
259
|
const { lintProjectGenerator } = (0, devkit_1.ensurePackage)('@nx/eslint', versions_1.nxVersion);
|
|
264
|
-
const { addOverrideToLintConfig, lintConfigHasOverride, isEslintConfigSupported, updateOverrideInLintConfig, addIgnoresToLintConfig,
|
|
260
|
+
const { addOverrideToLintConfig, lintConfigHasOverride, isEslintConfigSupported, updateOverrideInLintConfig, addIgnoresToLintConfig,
|
|
265
261
|
// nx-ignore-next-line
|
|
266
262
|
} = require('@nx/eslint/internal');
|
|
267
263
|
const projectConfiguration = (0, devkit_1.readProjectConfiguration)(tree, options.name);
|
|
@@ -273,9 +269,8 @@ async function addLint(tree, options) {
|
|
|
273
269
|
(0, devkit_1.joinPathFragments)(options.projectRoot, 'tsconfig.lib.json'),
|
|
274
270
|
],
|
|
275
271
|
unitTestRunner: options.unitTestRunner,
|
|
276
|
-
enableTypedLinting:
|
|
272
|
+
enableTypedLinting: options.enableTypedLinting,
|
|
277
273
|
rootProject: options.rootProject,
|
|
278
|
-
addPlugin: options.addPlugin,
|
|
279
274
|
// Since the build target is inferred now, we need to let the generator know to add @nx/dependency-checks regardless.
|
|
280
275
|
addPackageJsonDependencyChecks: options.bundler !== 'none',
|
|
281
276
|
});
|
|
@@ -552,13 +547,10 @@ function replaceJestConfig(tree, options) {
|
|
|
552
547
|
}
|
|
553
548
|
async function normalizeOptions(tree, options) {
|
|
554
549
|
await (0, internal_1.ensureRootProjectName)(options, 'library');
|
|
555
|
-
const nxJson = (0, devkit_1.readNxJson)(tree);
|
|
556
|
-
options.addPlugin ??=
|
|
557
|
-
process.env.NX_ADD_PLUGINS !== 'false' &&
|
|
558
|
-
nxJson.useInferencePlugins !== false;
|
|
559
550
|
options.linter = await (0, generator_prompts_1.normalizeLinterOption)(tree, options.linter);
|
|
560
|
-
const hasPlugin = (0, ts_solution_setup_1.isUsingTypeScriptPlugin)(tree);
|
|
561
551
|
const isUsingTsSolutionConfig = (0, ts_solution_setup_1.isUsingTsSolutionSetup)(tree);
|
|
552
|
+
// Outside TS solution setups the plugin may be registered for typecheck only.
|
|
553
|
+
const hasPlugin = isUsingTsSolutionConfig && (0, ts_solution_setup_1.isUsingTypeScriptPlugin)(tree);
|
|
562
554
|
if (isUsingTsSolutionConfig) {
|
|
563
555
|
options.unitTestRunner ??= (0, internal_1.isInteractive)()
|
|
564
556
|
? await (0, internal_1.selectPrompt)({
|
|
@@ -704,14 +696,9 @@ function getBuildExecutor(bundler) {
|
|
|
704
696
|
switch (bundler) {
|
|
705
697
|
case 'esbuild':
|
|
706
698
|
return `@nx/esbuild:esbuild`;
|
|
707
|
-
case 'rollup':
|
|
708
|
-
return `@nx/rollup:rollup`;
|
|
709
699
|
case 'swc':
|
|
710
700
|
case 'tsc':
|
|
711
701
|
return `@nx/js:${bundler}`;
|
|
712
|
-
case 'vite':
|
|
713
|
-
return `@nx/vite:build`;
|
|
714
|
-
case 'none':
|
|
715
702
|
default:
|
|
716
703
|
return undefined;
|
|
717
704
|
}
|
|
@@ -24,17 +24,12 @@ export interface LibraryGeneratorSchema {
|
|
|
24
24
|
publishable?: boolean;
|
|
25
25
|
buildable?: boolean;
|
|
26
26
|
enableTypedLinting?: boolean;
|
|
27
|
-
/**
|
|
28
|
-
* @deprecated Use `enableTypedLinting` instead. This option will be removed in Nx v24.
|
|
29
|
-
*/
|
|
30
|
-
setParserOptionsProject?: boolean;
|
|
31
27
|
config?: 'workspace' | 'project' | 'npm-scripts';
|
|
32
28
|
compiler?: Compiler;
|
|
33
29
|
bundler?: Bundler;
|
|
34
30
|
skipTypeCheck?: boolean;
|
|
35
31
|
minimal?: boolean;
|
|
36
32
|
rootProject?: boolean;
|
|
37
|
-
addPlugin?: boolean;
|
|
38
33
|
useProjectJson?: boolean;
|
|
39
34
|
useTscExecutor?: boolean;
|
|
40
35
|
/** @internal Only honored by the vitest setup. */
|
|
@@ -109,12 +109,6 @@
|
|
|
109
109
|
"description": "Whether to enable typed linting. For flat configs, this configures the recommended `parserOptions.projectService` and `tsconfigRootDir`. For legacy `.eslintrc` configs, this configures `parserOptions.project`. We do not enable this by default for lint performance reasons.",
|
|
110
110
|
"default": false
|
|
111
111
|
},
|
|
112
|
-
"setParserOptionsProject": {
|
|
113
|
-
"type": "boolean",
|
|
114
|
-
"description": "Deprecated alias for `enableTypedLinting`.",
|
|
115
|
-
"default": false,
|
|
116
|
-
"x-deprecated": "Use `enableTypedLinting` instead. This option will be removed in Nx v24."
|
|
117
|
-
},
|
|
118
112
|
"config": {
|
|
119
113
|
"type": "string",
|
|
120
114
|
"enum": ["workspace", "project", "npm-scripts"],
|
|
@@ -72,9 +72,6 @@ async function setupBuildGenerator(tree, options) {
|
|
|
72
72
|
}
|
|
73
73
|
options.tsConfig = tsConfigFile;
|
|
74
74
|
const isTsSolutionSetup = (0, ts_solution_setup_1.isUsingTsSolutionSetup)(tree);
|
|
75
|
-
const nxJson = (0, devkit_1.readNxJson)(tree);
|
|
76
|
-
const addPlugin = process.env.NX_ADD_PLUGINS !== 'false' &&
|
|
77
|
-
nxJson.useInferencePlugins !== false;
|
|
78
75
|
switch (options.bundler) {
|
|
79
76
|
case 'vite': {
|
|
80
77
|
const { viteConfigurationGenerator } = (0, devkit_1.ensurePackage)('@nx/vite', versions_1.nxVersion);
|
|
@@ -85,7 +82,6 @@ async function setupBuildGenerator(tree, options) {
|
|
|
85
82
|
uiFramework: 'none',
|
|
86
83
|
includeVitest: false,
|
|
87
84
|
includeLib: true,
|
|
88
|
-
addPlugin,
|
|
89
85
|
skipFormat: true,
|
|
90
86
|
});
|
|
91
87
|
tasks.push(task);
|
|
@@ -113,7 +109,6 @@ async function setupBuildGenerator(tree, options) {
|
|
|
113
109
|
project: options.project,
|
|
114
110
|
compiler: 'tsc',
|
|
115
111
|
format: isTsSolutionSetup ? ['esm'] : ['cjs', 'esm'],
|
|
116
|
-
addPlugin,
|
|
117
112
|
skipFormat: true,
|
|
118
113
|
skipValidation: true,
|
|
119
114
|
});
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { type CreateNodes, type TargetConfiguration } from '@nx/devkit';
|
|
2
|
+
import { type Shebang } from './shebang';
|
|
3
|
+
export interface ScriptPluginOptions {
|
|
4
|
+
/** Runs claimed scripts in watch mode as continuous targets. Defaults to `true`. */
|
|
5
|
+
watch?: boolean;
|
|
6
|
+
}
|
|
7
|
+
export interface ScriptPluginDefinition<T extends ScriptPluginOptions> {
|
|
8
|
+
/** Prefix of the plugin's cache file. */
|
|
9
|
+
cacheName: string;
|
|
10
|
+
technology: string;
|
|
11
|
+
/** Only files whose shebang the plugin claims become targets. */
|
|
12
|
+
claims(shebang: Shebang): boolean;
|
|
13
|
+
/** `file` is relative to the target's cwd. */
|
|
14
|
+
command(file: string, shebang: Shebang, watch: boolean): string;
|
|
15
|
+
/** Targets not tied to a shebang; claimed scripts win on name clashes. */
|
|
16
|
+
extraTargets?(projectRoot: string, workspaceRoot: string, options: T): Promise<ScriptTargets>;
|
|
17
|
+
}
|
|
18
|
+
export type ScriptTargets = Record<string, TargetConfiguration>;
|
|
19
|
+
export declare function createScriptNodes<T extends ScriptPluginOptions>(definition: ScriptPluginDefinition<T>): CreateNodes<T>;
|
|
20
|
+
/**
|
|
21
|
+
* Quotes a path for a shell command when the shell would split or expand it.
|
|
22
|
+
* Double quotes keep spaces intact in sh and cmd.exe; cmd.exe still expands `%VAR%`.
|
|
23
|
+
*/
|
|
24
|
+
export declare function quoteShellArg(arg: string): string;
|
|
@@ -0,0 +1,170 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.createScriptNodes = createScriptNodes;
|
|
4
|
+
exports.quoteShellArg = quoteShellArg;
|
|
5
|
+
const devkit_1 = require("@nx/devkit");
|
|
6
|
+
const internal_1 = require("@nx/devkit/internal");
|
|
7
|
+
const node_path_1 = require("node:path");
|
|
8
|
+
const shebang_1 = require("./shebang");
|
|
9
|
+
const target_name_1 = require("./target-name");
|
|
10
|
+
/** Specs, tests, stories and typings are never scripts. */
|
|
11
|
+
const SCRIPT_GLOB = '**/!(*.spec|*.test|*.stories|*.d).{js,cjs,mjs,ts,cts,mts}';
|
|
12
|
+
const PROJECT_MARKERS = ['package.json', 'project.json'];
|
|
13
|
+
function createScriptNodes(definition) {
|
|
14
|
+
return [
|
|
15
|
+
(0, internal_1.combineGlobPatterns)([
|
|
16
|
+
SCRIPT_GLOB,
|
|
17
|
+
...PROJECT_MARKERS.map((marker) => `**/${marker}`),
|
|
18
|
+
]),
|
|
19
|
+
async (files, options, context) => {
|
|
20
|
+
const scriptsByRoot = groupScriptsByProjectRoot(files, context.workspaceRoot, !!definition.extraTargets);
|
|
21
|
+
const projectRoots = [...scriptsByRoot.keys()];
|
|
22
|
+
if (!projectRoots.length) {
|
|
23
|
+
return [];
|
|
24
|
+
}
|
|
25
|
+
const cache = new internal_1.PluginCache((0, node_path_1.join)(internal_1.workspaceDataDirectory, `${definition.cacheName}-${(0, internal_1.hashObject)(options ?? {})}.hash`));
|
|
26
|
+
try {
|
|
27
|
+
const hashes = await (0, internal_1.calculateHashesForCreateNodes)(projectRoots, options ?? {}, context);
|
|
28
|
+
const results = [];
|
|
29
|
+
for (const [i, projectRoot] of projectRoots.entries()) {
|
|
30
|
+
const { marker, scripts } = scriptsByRoot.get(projectRoot);
|
|
31
|
+
// include/exclude can change which scripts a project gets without
|
|
32
|
+
// changing its contents.
|
|
33
|
+
const key = (0, internal_1.hashObject)([hashes[i], [...scripts].sort()]);
|
|
34
|
+
if (!cache.has(key)) {
|
|
35
|
+
cache.set(key, {
|
|
36
|
+
...(await definition.extraTargets?.(projectRoot, context.workspaceRoot, options)),
|
|
37
|
+
...createTargets(definition, context.workspaceRoot, projectRoot, scripts, options?.watch !== false),
|
|
38
|
+
});
|
|
39
|
+
}
|
|
40
|
+
const targets = cache.get(key);
|
|
41
|
+
if (Object.keys(targets).length) {
|
|
42
|
+
results.push([
|
|
43
|
+
scripts[0] ?? marker,
|
|
44
|
+
{ projects: { [projectRoot]: { root: projectRoot, targets } } },
|
|
45
|
+
]);
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
return results;
|
|
49
|
+
}
|
|
50
|
+
finally {
|
|
51
|
+
cache.writeToDisk();
|
|
52
|
+
}
|
|
53
|
+
},
|
|
54
|
+
];
|
|
55
|
+
}
|
|
56
|
+
/**
|
|
57
|
+
* Assigns each script to its nearest enclosing project root among the
|
|
58
|
+
* markers the plugin was handed, so `include`/`exclude` scope projects as well
|
|
59
|
+
* as scripts. Roots without scripts are kept only when `includeAllRoots` is set.
|
|
60
|
+
*/
|
|
61
|
+
function groupScriptsByProjectRoot(files, workspaceRoot, includeAllRoots) {
|
|
62
|
+
const handed = new Map();
|
|
63
|
+
const scripts = [];
|
|
64
|
+
for (const file of files) {
|
|
65
|
+
const name = (0, node_path_1.basename)(file);
|
|
66
|
+
if (!PROJECT_MARKERS.includes(name)) {
|
|
67
|
+
scripts.push(file);
|
|
68
|
+
continue;
|
|
69
|
+
}
|
|
70
|
+
const dir = (0, node_path_1.dirname)(file);
|
|
71
|
+
const entry = handed.get(dir) ?? {};
|
|
72
|
+
entry[name === 'project.json' ? 'projectJson' : 'packageJson'] = file;
|
|
73
|
+
handed.set(dir, entry);
|
|
74
|
+
}
|
|
75
|
+
// A package.json is a project root only where core's default package-json
|
|
76
|
+
// plugin makes one: in the package manager workspaces, or beside a
|
|
77
|
+
// project.json. The opt-in `nx/plugins/package-json` is not consulted.
|
|
78
|
+
const inWorkspaces = isInPackageManagerWorkspaces(workspaceRoot);
|
|
79
|
+
const markers = new Map();
|
|
80
|
+
for (const [dir, { packageJson, projectJson }] of handed) {
|
|
81
|
+
if (projectJson) {
|
|
82
|
+
markers.set(dir, projectJson);
|
|
83
|
+
}
|
|
84
|
+
else if (inWorkspaces(packageJson)) {
|
|
85
|
+
markers.set(dir, packageJson);
|
|
86
|
+
}
|
|
87
|
+
}
|
|
88
|
+
const byRoot = new Map();
|
|
89
|
+
if (includeAllRoots) {
|
|
90
|
+
for (const [root, marker] of markers) {
|
|
91
|
+
byRoot.set(root, { marker, scripts: [] });
|
|
92
|
+
}
|
|
93
|
+
}
|
|
94
|
+
for (const script of scripts) {
|
|
95
|
+
let dir = (0, node_path_1.dirname)(script);
|
|
96
|
+
while (!markers.has(dir) && dir !== '.') {
|
|
97
|
+
dir = (0, node_path_1.dirname)(dir);
|
|
98
|
+
}
|
|
99
|
+
if (!markers.has(dir)) {
|
|
100
|
+
continue;
|
|
101
|
+
}
|
|
102
|
+
if (!byRoot.has(dir)) {
|
|
103
|
+
byRoot.set(dir, { marker: markers.get(dir), scripts: [] });
|
|
104
|
+
}
|
|
105
|
+
byRoot.get(dir).scripts.push(script);
|
|
106
|
+
}
|
|
107
|
+
return byRoot;
|
|
108
|
+
}
|
|
109
|
+
function isInPackageManagerWorkspaces(workspaceRoot) {
|
|
110
|
+
return (0, internal_1.buildPackageJsonWorkspacesMatcher)((0, internal_1.buildPackageJsonPatterns)(workspaceRoot, (file) => (0, devkit_1.readJsonFile)((0, node_path_1.join)(workspaceRoot, file))));
|
|
111
|
+
}
|
|
112
|
+
function createTargets(definition, workspaceRoot, projectRoot, scripts, watch) {
|
|
113
|
+
const claimed = [];
|
|
114
|
+
for (const { file, header } of (0, internal_1.readShebangHeaders)(workspaceRoot, scripts)) {
|
|
115
|
+
const shebang = (0, shebang_1.parseShebang)((0, shebang_1.getShebangLine)(header));
|
|
116
|
+
if (!shebang || !definition.claims(shebang)) {
|
|
117
|
+
continue;
|
|
118
|
+
}
|
|
119
|
+
const { name, warnings } = (0, target_name_1.parseTargetName)(header);
|
|
120
|
+
for (const warning of warnings) {
|
|
121
|
+
(0, internal_1.emitPluginWorkerLog)('warn', `${file}: ${warning}.`);
|
|
122
|
+
}
|
|
123
|
+
claimed.push({
|
|
124
|
+
path: file,
|
|
125
|
+
relativePath: node_path_1.posix.relative(projectRoot, file),
|
|
126
|
+
shebang,
|
|
127
|
+
targetName: name,
|
|
128
|
+
});
|
|
129
|
+
}
|
|
130
|
+
const baseNameCounts = new Map();
|
|
131
|
+
for (const { relativePath } of claimed) {
|
|
132
|
+
const name = withoutExtension((0, node_path_1.basename)(relativePath));
|
|
133
|
+
baseNameCounts.set(name, (baseNameCounts.get(name) ?? 0) + 1);
|
|
134
|
+
}
|
|
135
|
+
const targets = {};
|
|
136
|
+
for (const script of claimed) {
|
|
137
|
+
const baseName = withoutExtension((0, node_path_1.basename)(script.relativePath));
|
|
138
|
+
const name = script.targetName ??
|
|
139
|
+
(baseNameCounts.get(baseName) > 1
|
|
140
|
+
? withoutExtension(script.relativePath)
|
|
141
|
+
: baseName);
|
|
142
|
+
targets[name] = createTarget(definition, projectRoot, script, watch);
|
|
143
|
+
}
|
|
144
|
+
return targets;
|
|
145
|
+
}
|
|
146
|
+
function createTarget(definition, projectRoot, { path, relativePath, shebang }, watch) {
|
|
147
|
+
return {
|
|
148
|
+
command: definition.command(quoteShellArg(node_path_1.posix.relative(projectRoot, path)), shebang, watch),
|
|
149
|
+
options: { cwd: projectRoot },
|
|
150
|
+
cache: false,
|
|
151
|
+
...(watch && { continuous: true }),
|
|
152
|
+
metadata: {
|
|
153
|
+
technologies: [definition.technology],
|
|
154
|
+
description: `Runs ${relativePath}`,
|
|
155
|
+
},
|
|
156
|
+
};
|
|
157
|
+
}
|
|
158
|
+
/**
|
|
159
|
+
* Quotes a path for a shell command when the shell would split or expand it.
|
|
160
|
+
* Double quotes keep spaces intact in sh and cmd.exe; cmd.exe still expands `%VAR%`.
|
|
161
|
+
*/
|
|
162
|
+
function quoteShellArg(arg) {
|
|
163
|
+
if (/^[\w@%+=:,./-]+$/.test(arg)) {
|
|
164
|
+
return arg;
|
|
165
|
+
}
|
|
166
|
+
return '"' + arg.replace(/(["\\$`])/g, '\\$1') + '"';
|
|
167
|
+
}
|
|
168
|
+
function withoutExtension(path) {
|
|
169
|
+
return path.slice(0, path.length - (0, node_path_1.extname)(path).length);
|
|
170
|
+
}
|