Skip to content

Commit

Permalink
fix(core): preset core should remove workspace.json (#9710)
Browse files Browse the repository at this point in the history
  • Loading branch information
AgentEnder committed Apr 6, 2022
1 parent 1fc0606 commit 704b6c8
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 0 deletions.
13 changes: 13 additions & 0 deletions packages/workspace/src/generators/preset/preset.spec.ts
Expand Up @@ -167,6 +167,19 @@ describe('preset', () => {
});

describe('core preset', () => {
it('should not contain workspace.json or angular.json', async () => {
await presetGenerator(tree, {
name: 'proj',
preset: Preset.Core,
linter: 'eslint',
cli: 'nx',
standaloneConfig: false,
packageManager: 'npm',
});
expect(tree.exists('workspace.json')).toBeFalsy();
expect(tree.exists('angular.json')).toBeFalsy();
});

describe('package manager workspaces', () => {
it('should be configured in package.json', async () => {
await presetGenerator(tree, {
Expand Down
3 changes: 3 additions & 0 deletions packages/workspace/src/generators/preset/preset.ts
Expand Up @@ -184,6 +184,9 @@ async function createPreset(tree: Tree, options: Schema) {
setDefaultCollection(tree, '@nrwl/react-native');
} else if (options.preset === Preset.Core || options.preset === Preset.NPM) {
setupPackageManagerWorkspaces(tree, options);
if (options.preset === Preset.Core) {
tree.delete('workspace.json');
}
} else {
throw new Error(`Invalid preset ${options.preset}`);
}
Expand Down

0 comments on commit 704b6c8

Please sign in to comment.