fix(core): preset core should remove workspace.json (#9710)
This commit is contained in:
parent
1fc0606eb3
commit
704b6c88e0
@ -167,6 +167,19 @@ describe('preset', () => {
|
|||||||
});
|
});
|
||||||
|
|
||||||
describe('core 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', () => {
|
describe('package manager workspaces', () => {
|
||||||
it('should be configured in package.json', async () => {
|
it('should be configured in package.json', async () => {
|
||||||
await presetGenerator(tree, {
|
await presetGenerator(tree, {
|
||||||
|
|||||||
@ -184,6 +184,9 @@ async function createPreset(tree: Tree, options: Schema) {
|
|||||||
setDefaultCollection(tree, '@nrwl/react-native');
|
setDefaultCollection(tree, '@nrwl/react-native');
|
||||||
} else if (options.preset === Preset.Core || options.preset === Preset.NPM) {
|
} else if (options.preset === Preset.Core || options.preset === Preset.NPM) {
|
||||||
setupPackageManagerWorkspaces(tree, options);
|
setupPackageManagerWorkspaces(tree, options);
|
||||||
|
if (options.preset === Preset.Core) {
|
||||||
|
tree.delete('workspace.json');
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
throw new Error(`Invalid preset ${options.preset}`);
|
throw new Error(`Invalid preset ${options.preset}`);
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user