Skip to content

Commit

Permalink
fix(js): preset should use packages folder (nrwl#10691)
Browse files Browse the repository at this point in the history
  • Loading branch information
AgentEnder authored Jun 10, 2022
1 parent 66846f7 commit 6132ad7
Showing 1 changed file with 8 additions and 5 deletions.
13 changes: 8 additions & 5 deletions packages/workspace/src/generators/preset/preset.ts
Original file line number Diff line number Diff line change
Expand Up @@ -33,11 +33,7 @@ export const presetSchematic = convertNxGenerator(presetGenerator);
export default presetGenerator;

async function createPreset(tree: Tree, options: Schema) {
if (
options.preset === Preset.Empty ||
options.preset === Preset.Apps ||
options.preset === Preset.TS
) {
if (options.preset === Preset.Empty || options.preset === Preset.Apps) {
return;
} else if (options.preset === Preset.Angular) {
const {
Expand Down Expand Up @@ -178,6 +174,13 @@ async function createPreset(tree: Tree, options: Schema) {
if (options.preset === Preset.Core) {
tree.delete('workspace.json');
}
} else if (options.preset === Preset.TS) {
const c = readWorkspaceConfiguration(tree);
c.workspaceLayout = {
appsDir: 'packages',
libsDir: 'packages',
};
updateWorkspaceConfiguration(tree, c);
} else {
throw new Error(`Invalid preset ${options.preset}`);
}
Expand Down

0 comments on commit 6132ad7

Please sign in to comment.