Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
packages:
- '.'

allowBuilds:
'@parcel/watcher': false
esbuild: false
lmdb: false
msgpackr-extract: false
5 changes: 4 additions & 1 deletion packages/schematics/angular/workspace/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ import {
} from '@angular-devkit/schematics';
import { execSync } from 'node:child_process';
import { latestVersions } from '../utility/latest-versions';
import { Schema as WorkspaceOptions } from './schema';
import { PackageManager, Schema as WorkspaceOptions } from './schema';

export default function (options: WorkspaceOptions): Rule {
return () => {
Expand Down Expand Up @@ -48,6 +48,9 @@ export default function (options: WorkspaceOptions): Rule {
return mergeWith(
apply(url('./files'), [
options.minimal ? filter((path) => !path.endsWith('editorconfig.template')) : noop(),
packageManager !== PackageManager.Pnpm
? filter((path) => !path.endsWith('pnpm-workspace.yaml.template'))
: noop(),
applyTemplates({
utils: strings,
...options,
Expand Down
13 changes: 12 additions & 1 deletion packages/schematics/angular/workspace/index_spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
import { SchematicTestRunner } from '@angular-devkit/schematics/testing';
import { parse as parseJson } from 'jsonc-parser';
import { latestVersions } from '../utility/latest-versions';
import { Schema as WorkspaceOptions } from './schema';
import { PackageManager, Schema as WorkspaceOptions } from './schema';

describe('Workspace Schematic', () => {
const schematicRunner = new SchematicTestRunner(
Expand Down Expand Up @@ -38,6 +38,17 @@ describe('Workspace Schematic', () => {
'/tsconfig.json',
]),
);
expect(files).not.toContain('/pnpm-workspace.yaml');
});

it('should create pnpm-workspace.yaml with allowBuilds when packageManager is pnpm', async () => {
const tree = await schematicRunner.runSchematic('workspace', {
...defaultOptions,
packageManager: PackageManager.Pnpm,
});
expect(tree.exists('/pnpm-workspace.yaml')).toBeTrue();
const content = tree.readContent('/pnpm-workspace.yaml');
expect(content).toContain('allowBuilds:');
});

it('should set the name in package.json', async () => {
Expand Down
Loading