Skip to content

Commit

Permalink
fix(core): ensure correct $schema path is generated when adding proje…
Browse files Browse the repository at this point in the history
…ct configuration (#15463)

(cherry picked from commit 02a450e)
  • Loading branch information
leosvelperez authored and FrozenPandaz committed Mar 8, 2023
1 parent e8bcf9b commit ef5a979
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -147,7 +147,7 @@ exports[`app at the root should accept numbers in the path 1`] = `"src/9-website
exports[`app nested should create project configs 1`] = `
Object {
"$schema": "../node_modules/nx/schemas/project-schema.json",
"$schema": "../../../node_modules/nx/schemas/project-schema.json",
"name": "my-dir-my-app",
"prefix": "proj",
"projectType": "application",
Expand Down Expand Up @@ -296,7 +296,7 @@ Object {
exports[`app not nested should create project configs 1`] = `
Object {
"$schema": "../node_modules/nx/schemas/project-schema.json",
"$schema": "../../node_modules/nx/schemas/project-schema.json",
"name": "my-app",
"prefix": "proj",
"projectType": "application",
Expand Down
1 change: 1 addition & 0 deletions packages/nx/src/generators/utils/project-configuration.ts
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,7 @@ export function addProjectConfiguration(
);
}

delete (projectConfiguration as any).$schema;
writeJson(tree, projectConfigFile, {
name: projectName,
$schema: getRelativeProjectJsonSchemaPath(tree, projectConfiguration),
Expand Down

0 comments on commit ef5a979

Please sign in to comment.