Skip to content

Commit

Permalink
feat(core): include PR review notes
Browse files Browse the repository at this point in the history
  • Loading branch information
meeroslav committed Apr 4, 2023
1 parent 7fc2e8a commit d330fa6
Show file tree
Hide file tree
Showing 7 changed files with 53 additions and 136 deletions.
9 changes: 4 additions & 5 deletions docs/generated/devkit/nrwl_devkit.md
Original file line number Diff line number Diff line change
Expand Up @@ -1433,7 +1433,7 @@ Returns the list of outputs that will be cached.

### getPackageManagerCommand

**getPackageManagerCommand**(`packageManager?`, `root?`): `PackageManagerCommands`
**getPackageManagerCommand**(`packageManager?`): `PackageManagerCommands`

Returns commands for the package manager used in the workspace.
By default, the package manager is derived based on the lock file,
Expand All @@ -1447,10 +1447,9 @@ execSync(`${getPackageManagerCommand().addDev} my-dev-package`);

#### Parameters

| Name | Type | Default value |
| :--------------- | :-------------------------------------------------------------------- | :-------------- |
| `packageManager` | [`PackageManager`](../../devkit/documents/nrwl_devkit#packagemanager) | `undefined` |
| `root` | `string` | `workspaceRoot` |
| Name | Type |
| :--------------- | :-------------------------------------------------------------------- |
| `packageManager` | [`PackageManager`](../../devkit/documents/nrwl_devkit#packagemanager) |

#### Returns

Expand Down
9 changes: 4 additions & 5 deletions docs/generated/packages/devkit/documents/nrwl_devkit.md
Original file line number Diff line number Diff line change
Expand Up @@ -1433,7 +1433,7 @@ Returns the list of outputs that will be cached.

### getPackageManagerCommand

**getPackageManagerCommand**(`packageManager?`, `root?`): `PackageManagerCommands`
**getPackageManagerCommand**(`packageManager?`): `PackageManagerCommands`

Returns commands for the package manager used in the workspace.
By default, the package manager is derived based on the lock file,
Expand All @@ -1447,10 +1447,9 @@ execSync(`${getPackageManagerCommand().addDev} my-dev-package`);

#### Parameters

| Name | Type | Default value |
| :--------------- | :-------------------------------------------------------------------- | :-------------- |
| `packageManager` | [`PackageManager`](../../devkit/documents/nrwl_devkit#packagemanager) | `undefined` |
| `root` | `string` | `workspaceRoot` |
| Name | Type |
| :--------------- | :-------------------------------------------------------------------- |
| `packageManager` | [`PackageManager`](../../devkit/documents/nrwl_devkit#packagemanager) |

#### Returns

Expand Down
1 change: 0 additions & 1 deletion e2e/storybook/src/storybook-nested.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@ describe('Storybook generators and executors for standalone workspaces - using R

beforeAll(() => {
// create a workspace with a single react app at the root
// TODO @meeroslav: we always need to pass in `packageManager` here, otherwise `runCreateWorkspace` will use `npm` by default
runCreateWorkspace(wsName, {
preset: 'react-standalone',
appName,
Expand Down
76 changes: 22 additions & 54 deletions e2e/workspace-create-npm/src/create-nx-workspace-npm.test.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
import {
checkFilesExist,
cleanupProject,
e2eCwd,
getPackageManagerCommand,
getSelectedPackageManager,
packageInstall,
readJson,
Expand All @@ -11,15 +9,16 @@ import {
runCreateWorkspace,
uniq,
} from '@nrwl/e2e/utils';
import { execSync } from 'child_process';

describe('create-nx-workspace --preset=npm', () => {
const wsName = uniq('npm');

let originalVerbose;
let originalDaemon;

beforeAll(() => {
originalVerbose = process.env.NX_VERBOSE_LOGGING;
process.env.NX_VERBOSE_LOGGING = 'true';
originalDaemon = process.env.NX_DAEMON;
process.env.NX_DAEMON = 'false';

runCreateWorkspace(wsName, {
preset: 'npm',
packageManager: getSelectedPackageManager(),
Expand All @@ -28,14 +27,11 @@ describe('create-nx-workspace --preset=npm', () => {

afterEach(() => {
runCommand(`git reset --hard HEAD`);
execSync(`${getPackageManagerCommand().runNx} reset`, {
cwd: `${e2eCwd}/${wsName}`,
stdio: 'pipe',
});
runCommand(`git clean -fd`);
});

afterAll(() => {
process.env.NX_VERBOSE_LOGGING = originalVerbose;
process.env.NX_DAEMON = originalDaemon;
cleanupProject({ skipReset: true });
});

Expand All @@ -44,9 +40,7 @@ describe('create-nx-workspace --preset=npm', () => {
const appName = uniq('my-app');

expect(() => {
runCLI(
`generate @nrwl/angular:app ${appName} --skipPackageJson --no-interactive`
);
runCLI(`generate @nrwl/angular:app ${appName} --no-interactive`);
}).not.toThrowError();
checkFilesExist('tsconfig.base.json');
}, 1_000_000);
Expand All @@ -56,9 +50,7 @@ describe('create-nx-workspace --preset=npm', () => {
const libName = uniq('lib');

expect(() => {
runCLI(
`generate @nrwl/angular:lib ${libName} --skipPackageJson --no-interactive`
);
runCLI(`generate @nrwl/angular:lib ${libName} --no-interactive`);
}).not.toThrowError();
checkFilesExist('tsconfig.base.json');
const tsconfig = readJson(`tsconfig.base.json`);
Expand All @@ -73,9 +65,7 @@ describe('create-nx-workspace --preset=npm', () => {
const libName = uniq('lib');

expect(() =>
runCLI(
`generate @nrwl/js:library ${libName} --skipPackageJson --no-interactive`
)
runCLI(`generate @nrwl/js:library ${libName} --no-interactive`)
).not.toThrowError();
checkFilesExist('tsconfig.base.json');
const tsconfig = readJson(`tsconfig.base.json`);
Expand All @@ -90,9 +80,7 @@ describe('create-nx-workspace --preset=npm', () => {
const appName = uniq('my-app');

expect(() =>
runCLI(
`generate @nrwl/web:app ${appName} --skipPackageJson --no-interactive`
)
runCLI(`generate @nrwl/web:app ${appName} --no-interactive`)
).not.toThrowError();
checkFilesExist('tsconfig.base.json');
});
Expand All @@ -103,9 +91,7 @@ describe('create-nx-workspace --preset=npm', () => {
const appName = uniq('my-app');

expect(() => {
runCLI(
`generate @nrwl/react:app ${appName} --skipPackageJson --no-interactive`
);
runCLI(`generate @nrwl/react:app ${appName} --no-interactive`);
}).not.toThrowError();
checkFilesExist('tsconfig.base.json');
});
Expand All @@ -116,9 +102,7 @@ describe('create-nx-workspace --preset=npm', () => {
const libName = uniq('lib');

expect(() => {
runCLI(
`generate @nrwl/react:lib ${libName} --skipPackageJson --no-interactive`
);
runCLI(`generate @nrwl/react:lib ${libName} --no-interactive`);
}).not.toThrowError();
checkFilesExist('tsconfig.base.json');
const tsconfig = readJson(`tsconfig.base.json`);
Expand All @@ -133,9 +117,7 @@ describe('create-nx-workspace --preset=npm', () => {
const appName = uniq('my-app');

expect(() => {
runCLI(
`generate @nrwl/next:app ${appName} --skipPackageJson --no-interactive`
);
runCLI(`generate @nrwl/next:app ${appName} --no-interactive`);
}).not.toThrowError();
checkFilesExist('tsconfig.base.json');
});
Expand All @@ -146,9 +128,7 @@ describe('create-nx-workspace --preset=npm', () => {
const libName = uniq('lib');

expect(() => {
runCLI(
`generate @nrwl/next:lib ${libName} --skipPackageJson --no-interactive`
);
runCLI(`generate @nrwl/next:lib ${libName} --no-interactive`);
}).not.toThrowError();
checkFilesExist('tsconfig.base.json');
const tsconfig = readJson(`tsconfig.base.json`);
Expand All @@ -164,7 +144,7 @@ describe('create-nx-workspace --preset=npm', () => {

expect(() => {
runCLI(
`generate @nrwl/react-native:app ${appName} --install=false --skipPackageJson --no-interactive`
`generate @nrwl/react-native:app ${appName} --install=false --no-interactive`
);
}).not.toThrowError();
checkFilesExist('tsconfig.base.json');
Expand All @@ -176,9 +156,7 @@ describe('create-nx-workspace --preset=npm', () => {
const libName = uniq('lib');

expect(() => {
runCLI(
`generate @nrwl/react-native:lib ${libName} --skipPackageJson --no-interactive`
);
runCLI(`generate @nrwl/react-native:lib ${libName} --no-interactive`);
}).not.toThrowError();
checkFilesExist('tsconfig.base.json');
const tsconfig = readJson(`tsconfig.base.json`);
Expand All @@ -193,9 +171,7 @@ describe('create-nx-workspace --preset=npm', () => {
const appName = uniq('my-app');

expect(() => {
runCLI(
`generate @nrwl/node:app ${appName} --skipPackageJson --no-interactive`
);
runCLI(`generate @nrwl/node:app ${appName} --no-interactive`);
}).not.toThrowError();
checkFilesExist('tsconfig.base.json');
});
Expand All @@ -206,9 +182,7 @@ describe('create-nx-workspace --preset=npm', () => {
const libName = uniq('lib');

expect(() => {
runCLI(
`generate @nrwl/node:lib ${libName} --skipPackageJson --no-interactive`
);
runCLI(`generate @nrwl/node:lib ${libName} --no-interactive`);
}).not.toThrowError();
checkFilesExist('tsconfig.base.json');
const tsconfig = readJson(`tsconfig.base.json`);
Expand All @@ -223,9 +197,7 @@ describe('create-nx-workspace --preset=npm', () => {
const appName = uniq('my-app');

expect(() => {
runCLI(
`generate @nrwl/nest:app ${appName} --skipPackageJson --no-interactive`
);
runCLI(`generate @nrwl/nest:app ${appName} --no-interactive`);
}).not.toThrowError();
checkFilesExist('tsconfig.base.json');
});
Expand All @@ -236,9 +208,7 @@ describe('create-nx-workspace --preset=npm', () => {
const libName = uniq('lib');

expect(() => {
runCLI(
`generate @nrwl/nest:lib ${libName} --skipPackageJson --no-interactive`
);
runCLI(`generate @nrwl/nest:lib ${libName} --no-interactive`);
}).not.toThrowError();
checkFilesExist('tsconfig.base.json');
const tsconfig = readJson(`tsconfig.base.json`);
Expand All @@ -253,9 +223,7 @@ describe('create-nx-workspace --preset=npm', () => {
const appName = uniq('my-app');

expect(() => {
runCLI(
`generate @nrwl/express:app ${appName} --skipPackageJson --no-interactive`
);
runCLI(`generate @nrwl/express:app ${appName} --no-interactive`);
}).not.toThrowError();
checkFilesExist('tsconfig.base.json');
});
Expand Down
Loading

0 comments on commit d330fa6

Please sign in to comment.