@nx/devkit
Advanced tools
Comparing version 17.0.0-rc.0 to 17.0.0-rc.1
{ | ||
"name": "@nx/devkit", | ||
"version": "17.0.0-rc.0", | ||
"version": "17.0.0-rc.1", | ||
"private": false, | ||
@@ -37,3 +37,3 @@ "description": "The Nx Devkit is used to customize Nx for different technologies and use cases. It contains many utility functions for reading and writing files, updating configuration, working with Abstract Syntax Trees(ASTs), and more.", | ||
"semver": "7.5.3", | ||
"@nrwl/devkit": "17.0.0-rc.0" | ||
"@nrwl/devkit": "17.0.0-rc.1" | ||
}, | ||
@@ -40,0 +40,0 @@ "peerDependencies": { |
@@ -10,5 +10,12 @@ "use strict"; | ||
async function determineArtifactNameAndDirectoryOptions(tree, options) { | ||
if (!options.nameAndDirectoryFormat && | ||
(process.env.NX_INTERACTIVE !== 'true' || !isTTY())) { | ||
options.nameAndDirectoryFormat = 'derived'; | ||
} | ||
const formats = getNameAndDirectoryOptionFormats(tree, options); | ||
const format = options.nameAndDirectoryFormat ?? (await determineFormat(formats, options)); | ||
validateResolvedProject(tree, formats[format]?.project, options, formats[format]?.directory); | ||
if (format === 'derived' && options.callingGenerator) { | ||
logDeprecationMessage(options, formats); | ||
} | ||
return { | ||
@@ -24,6 +31,2 @@ ...formats[format], | ||
} | ||
if (process.env.NX_INTERACTIVE !== 'true' || !isTTY()) { | ||
logDeprecationMessage(options, formats); | ||
return 'derived'; | ||
} | ||
const asProvidedDescription = `As provided: ${formats['as-provided'].filePath}`; | ||
@@ -52,5 +55,2 @@ const asProvidedSelectedValue = formats['as-provided'].filePath; | ||
}).then(({ format }) => format === asProvidedSelectedValue ? 'as-provided' : 'derived'); | ||
if (result === 'derived' && options.callingGenerator) { | ||
logDeprecationMessage(options, formats); | ||
} | ||
return result; | ||
@@ -57,0 +57,0 @@ } |
@@ -44,1 +44,5 @@ import type { ProjectType } from 'nx/src/config/workspace-json-project-json'; | ||
}>; | ||
/** | ||
* Function for setting cwd during testing | ||
*/ | ||
export declare function setCwd(path: string): void; |
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.determineProjectNameAndRootOptions = void 0; | ||
exports.setCwd = exports.determineProjectNameAndRootOptions = void 0; | ||
const enquirer_1 = require("enquirer"); | ||
@@ -9,3 +9,3 @@ const path_1 = require("path"); | ||
const names_1 = require("../utils/names"); | ||
const { joinPathFragments, normalizePath, logger, readJson, readNxJson, updateNxJson, stripIndents, workspaceRoot, } = (0, nx_1.requireNx)(); | ||
const { joinPathFragments, normalizePath, logger, readJson, stripIndents, workspaceRoot, } = (0, nx_1.requireNx)(); | ||
const deprecationWarning = stripIndents ` | ||
@@ -203,7 +203,2 @@ In Nx 18, generating projects will no longer derive the name and root. | ||
function getNpmScope(tree) { | ||
const nxJson = readNxJson(tree); | ||
// TODO(v17): Remove reading this from nx.json | ||
if (nxJson?.npmScope) { | ||
return nxJson.npmScope; | ||
} | ||
const { name } = tree.exists('package.json') | ||
@@ -228,1 +223,8 @@ ? readJson(tree, 'package.json') | ||
} | ||
/** | ||
* Function for setting cwd during testing | ||
*/ | ||
function setCwd(path) { | ||
process.env.INIT_CWD = (0, path_1.join)(workspaceRoot, path); | ||
} | ||
exports.setCwd = setCwd; |
@@ -32,2 +32,8 @@ "use strict"; | ||
}; | ||
// ensure local registry from process is not interfering with the install | ||
// when we start the process from temp folder the local registry would override the custom registry | ||
if (process.env.npm_config_registry && | ||
process.env.npm_config_registry.match(/^https:\/\/registry\.(npmjs\.org|yarnpkg\.com)/)) { | ||
delete process.env.npm_config_registry; | ||
} | ||
(0, child_process_1.execSync)(pmc.install, execSyncOptions); | ||
@@ -34,0 +40,0 @@ } |
@@ -9,3 +9,3 @@ import type { Tree } from 'nx/src/generators/tree'; | ||
* ```typescript | ||
* { appsDir: 'apps', libsDir: 'libs', npmScope: 'myorg' } | ||
* { appsDir: 'apps', libsDir: 'libs' } | ||
* ``` | ||
@@ -18,6 +18,2 @@ * @param tree - file system tree | ||
standaloneAsDefault: boolean; | ||
/** | ||
* @deprecated This will be removed in Nx 17. Use {@link getNpmScope} instead. | ||
*/ | ||
npmScope: string; | ||
}; | ||
@@ -24,0 +20,0 @@ /** |
@@ -13,3 +13,3 @@ "use strict"; | ||
* ```typescript | ||
* { appsDir: 'apps', libsDir: 'libs', npmScope: 'myorg' } | ||
* { appsDir: 'apps', libsDir: 'libs' } | ||
* ``` | ||
@@ -25,3 +25,2 @@ * @param tree - file system tree | ||
inOrderOfPreference(tree, ['libs', 'packages'], '.'), | ||
npmScope: nxJson?.npmScope, | ||
standaloneAsDefault: true, | ||
@@ -28,0 +27,0 @@ }; |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Environment variable access
Supply chain riskPackage accesses environment variables, which may be a sign of credential stuffing or data theft.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
153729
4082
27
+ Added@nrwl/devkit@17.0.0-rc.1(transitive)
- Removed@nrwl/devkit@17.0.0-rc.0(transitive)
Updated@nrwl/devkit@17.0.0-rc.1