Skip to content

Commit

Permalink
fix(nxls): take default options into account when prefilling as-provi…
Browse files Browse the repository at this point in the history
…ded options (nrwl#1943)
  • Loading branch information
MaxKless authored Nov 20, 2023
1 parent 2637fc3 commit 73662b2
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,9 @@ export const nameAndDirectoryProcessor: SchemaProcessor = (
return schema;
}

const nadfDefault = schema.options.find(
(opt) => opt.name === 'nameAndDirectoryFormat'
)?.default;
return {
...schema,
options: schema.options.map((option) => {
Expand Down Expand Up @@ -47,7 +50,7 @@ export const nameAndDirectoryProcessor: SchemaProcessor = (
...schema.context,
prefillValues: {
...(schema.context?.prefillValues ?? {}),
nameAndDirectoryFormat: 'as-provided',
nameAndDirectoryFormat: `${nadfDefault}` ?? 'as-provided',
},
},
};
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,9 @@ export const projectNameAndRootProcessor: SchemaProcessor = (
};
}

const pnarfDefault = schema.options.find(
(opt) => opt.name === 'projectNameAndRootFormat'
)?.default;
return {
...schema,
options: schema.options.map((option) => {
Expand All @@ -60,7 +63,7 @@ export const projectNameAndRootProcessor: SchemaProcessor = (
...schema.context,
prefillValues: {
...(schema.context?.prefillValues ?? {}),
projectNameAndRootFormat: 'as-provided',
projectNameAndRootFormat: `${pnarfDefault}` ?? 'as-provided',
},
},
};
Expand Down

0 comments on commit 73662b2

Please sign in to comment.