@nx/devkit
Advanced tools
Comparing version 16.8.0 to 16.9.0-beta.0
{ | ||
"name": "@nx/devkit", | ||
"version": "16.8.0", | ||
"version": "16.9.0-beta.0", | ||
"private": false, | ||
@@ -31,3 +31,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.", | ||
"dependencies": { | ||
"@nrwl/devkit": "16.8.0", | ||
"@nrwl/devkit": "16.9.0-beta.0", | ||
"ejs": "^3.1.7", | ||
@@ -50,3 +50,3 @@ "enquirer": "~2.3.6", | ||
"type": "commonjs", | ||
"gitHead": "af53c7cfb21c0ebc7be2dab33b712f8d10bc81f7" | ||
"gitHead": "822fb12c3f0bbaeb6d4a6fbc6cb1064a291e907f" | ||
} |
@@ -11,3 +11,3 @@ <p style="text-align: center;"><img src="https://raw.githubusercontent.com/nrwl/nx/master/images/nx.png" width="600" alt="Nx - Smart, Fast and Extensible Build System"></p> | ||
[![Join the chat at https://gitter.im/nrwl-nx/community](https://badges.gitter.im/nrwl-nx/community.svg)](https://gitter.im/nrwl-nx/community?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge) | ||
[![Join us @nx/community on slack](https://img.shields.io/badge/slack-%40nrwl%2Fcommunity-brightgreen)](https://join.slack.com/t/nrwlcommunity/shared_invite/enQtNzU5MTE4OTQwOTk0LTgxY2E0ZWYzMWE0YzA5ZDA2MWM1NDVhNmI2ZWMyYmZhNWJiODk3MjkxZjY3MzU5ZjRmM2NmNWU1OTgyZmE4Mzc) | ||
[![Join us on the Official Nx Discord Server](https://simpleicons.org/icons/discord.svg)](https://go.nx.dev/community) | ||
@@ -14,0 +14,0 @@ </div> |
@@ -30,4 +30,4 @@ "use strict"; | ||
ws.calculateDefaultProjectName(context.cwd, { version: 2, projects: context.projectsConfigurations.projects }, context.nxJsonConfiguration); | ||
return combineOptionsForExecutor({}, configuration ?? targetConfiguration.defaultConfiguration ?? '', targetConfiguration, schema, defaultProject, (0, path_1.relative)(context.cwd, context.root)); | ||
return combineOptionsForExecutor({}, configuration ?? targetConfiguration.defaultConfiguration ?? '', targetConfiguration, schema, defaultProject, (0, path_1.relative)(context.root, context.cwd)); | ||
} | ||
exports.readTargetOptions = readTargetOptions; |
@@ -9,9 +9,15 @@ "use strict"; | ||
const { joinPathFragments, normalizePath, logger, readJson, readNxJson, updateNxJson, stripIndents, } = (0, nx_1.requireNx)(); | ||
const deprecationWarning = stripIndents ` | ||
In Nx 18, generating projects will no longer derive the name and root. | ||
Please provide the exact project name and root in the future.`; | ||
async function determineProjectNameAndRootOptions(tree, options) { | ||
validateName(options.name, options.projectNameAndRootFormat); | ||
const formats = getProjectNameAndRootFormats(tree, options); | ||
const configuredDefault = getDefaultProjectNameAndRootFormat(tree); | ||
if (configuredDefault === 'derived') { | ||
logger.warn(deprecationWarning + '\n' + getExample(options.callingGenerator, formats)); | ||
} | ||
const format = options.projectNameAndRootFormat ?? | ||
(getDefaultProjectNameAndRootFormat(tree) === 'as-provided' | ||
? 'as-provided' | ||
: await determineFormat(tree, formats, options.callingGenerator)); | ||
configuredDefault ?? | ||
(await determineFormat(tree, formats, options.callingGenerator)); | ||
return { | ||
@@ -43,2 +49,5 @@ ...formats[format], | ||
} | ||
function getExample(callingGenerator, formats) { | ||
return `Example: nx g ${callingGenerator} ${formats['as-provided'].projectName} --directory ${formats['as-provided'].projectRoot}`; | ||
} | ||
async function determineFormat(tree, formats, callingGenerator) { | ||
@@ -75,5 +84,2 @@ if (!formats.derived) { | ||
}).then(({ format }) => format === asProvidedSelectedValue ? 'as-provided' : 'derived'); | ||
const deprecationWarning = stripIndents ` | ||
In Nx 18, generating projects will no longer derive the name and root. | ||
Please provide the exact project name and root in the future.`; | ||
if (result === 'as-provided' && callingGenerator) { | ||
@@ -94,3 +100,3 @@ const { saveDefault } = await (0, enquirer_1.prompt)({ | ||
else { | ||
const example = `Example: nx g ${callingGenerator} ${formats[result].projectName} --directory ${formats[result].projectRoot}`; | ||
const example = getExample(callingGenerator, formats); | ||
logger.warn(deprecationWarning + '\n' + example); | ||
@@ -108,3 +114,3 @@ } | ||
const nxJson = readNxJson(tree); | ||
return nxJson.workspaceLayout?.projectNameAndRootFormat ?? 'derived'; | ||
return nxJson.workspaceLayout?.projectNameAndRootFormat; | ||
} | ||
@@ -111,0 +117,0 @@ function getProjectNameAndRootFormats(tree, options) { |
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
No v1
QualityPackage is not semver >=1. This means it is not stable and does not support ^ ranges.
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
180185
4565
1
+ Added@nrwl/devkit@16.9.0-beta.0(transitive)
- Removed@nrwl/devkit@16.8.0(transitive)
Updated@nrwl/devkit@16.9.0-beta.0