fix(core): preset core should remove workspace.json (#9710)

This commit is contained in:
Craigory Coppola 2022-04-06 11:38:56 -04:00 committed by GitHub
parent 1fc0606eb3
commit 704b6c88e0
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 16 additions and 0 deletions

View File

@ -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, {

View File

@ -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}`);
}