Skip to content

Commit

Permalink
merge in all updates, bump to nx 13.9
Browse files Browse the repository at this point in the history
  • Loading branch information
ZachJW34 committed Mar 26, 2022
1 parent 26d7db4 commit 05b9309
Show file tree
Hide file tree
Showing 65 changed files with 1,170 additions and 1,744 deletions.
4 changes: 2 additions & 2 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ orbs:
jobs:
all:
docker:
- image: cypress/base:14.17.3
- image: cypress/base:16.14.0
steps:
- checkout
- node/install-packages:
Expand All @@ -17,7 +17,7 @@ jobs:
no_output_timeout: 40m
affected:
docker:
- image: cypress/base:14.17.3
- image: cypress/base:16.14.0
steps:
- checkout
- node/install-packages:
Expand Down
12 changes: 4 additions & 8 deletions apps/nuxt-e2e/tests/nuxt.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ describe('nuxt e2e', () => {
Snapshots: 0 total
`);

const e2eResult = await runNxCommandAsync(`e2e ${appName}-e2e --headless`);
const e2eResult = await runNxCommandAsync(`e2e ${appName}-e2e`);
expect(e2eResult.stdout).toContain('All specs passed!');

await runNxCommandAsync(`build ${appName}`);
Expand All @@ -52,9 +52,7 @@ describe('nuxt e2e', () => {
)
).not.toThrow();

const prodE2eResult = await runNxCommandAsync(
`e2e ${appName}-e2e --prod --headless`
);
const prodE2eResult = await runNxCommandAsync(`e2e ${appName}-e2e --prod`);
expect(prodE2eResult.stdout).toContain('All specs passed!');
}, 300000);

Expand Down Expand Up @@ -84,8 +82,7 @@ describe('nuxt e2e', () => {
`dist/apps/${appName}/dist/.nojekyll`,
`dist/apps/${appName}/dist/200.html`,
`dist/apps/${appName}/dist/favicon.ico`,
`dist/apps/${appName}/dist/index.html`,
`dist/apps/${appName}/dist/README.md`
`dist/apps/${appName}/dist/index.html`
)
).not.toThrow();
}, 300000);
Expand Down Expand Up @@ -134,8 +131,7 @@ describe('nuxt e2e', () => {
`dist/apps/subdir/${appName}/dist/.nojekyll`,
`dist/apps/subdir/${appName}/dist/200.html`,
`dist/apps/subdir/${appName}/dist/favicon.ico`,
`dist/apps/subdir/${appName}/dist/index.html`,
`dist/apps/subdir/${appName}/dist/README.md`
`dist/apps/subdir/${appName}/dist/index.html`
)
).not.toThrow();
}, 300000);
Expand Down
4 changes: 3 additions & 1 deletion apps/vite-e2e/project.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,5 +10,7 @@
"jestConfig": "apps/vite-e2e/jest.config.js"
}
}
}
},
"tags": [],
"implicitDependencies": ["vite"]
}
2 changes: 1 addition & 1 deletion apps/vite-e2e/tests/vite.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ describe('vite e2e', () => {
// see: https://github.com/vitejs/vite/issues/2944
expect(buildResult.stdout).toContain(`dist/apps/${appName}/assets/logo`);

const e2eResult = await runNxCommandAsync(`e2e ${appName}-e2e --headless`);
const e2eResult = await runNxCommandAsync(`e2e ${appName}-e2e`);
expect(e2eResult.stdout).toContain('All specs passed!');
}, 200000);
});
Expand Down
2 changes: 1 addition & 1 deletion apps/vue-e2e/tests/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ export async function testGeneratedApp(
}

if (options.e2e) {
const e2eResult = await runNxCommandAsync(`e2e ${appName}-e2e --headless`);
const e2eResult = await runNxCommandAsync(`e2e ${appName}-e2e`);
expect(e2eResult.stdout).toContain('All specs passed!');
}

Expand Down
38 changes: 19 additions & 19 deletions apps/vue-e2e/tests/vue-2.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import {
} from '@nrwl/nx-plugin/testing';
import { runNxProdCommandAsync, testGeneratedApp } from './utils';

describe.skip('vue 2 e2e', () => {
describe('vue 2 e2e', () => {
describe('app', () => {
beforeAll(() => {
ensureNxProject('@nx-plus/vue', 'dist/libs/vue');
Expand Down Expand Up @@ -200,12 +200,12 @@ describe.skip('vue 2 e2e', () => {
expect(() =>
checkFilesExist(
`dist/libs/${lib}/demo.html`,
`dist/libs/${lib}/${lib}.common.js`,
`dist/libs/${lib}/${lib}.common.js.map`,
`dist/libs/${lib}/${lib}.umd.js`,
`dist/libs/${lib}/${lib}.umd.js.map`,
`dist/libs/${lib}/${lib}.umd.min.js`,
`dist/libs/${lib}/${lib}.umd.min.js.map`,
`dist/libs/${lib}/build.common.js`,
`dist/libs/${lib}/build.common.js.map`,
`dist/libs/${lib}/build.umd.js`,
`dist/libs/${lib}/build.umd.js.map`,
`dist/libs/${lib}/build.umd.min.js`,
`dist/libs/${lib}/build.umd.min.js.map`,
`dist/libs/${lib}/package.json`,
`dist/libs/${lib}/README.md`
)
Expand All @@ -228,16 +228,16 @@ describe.skip('vue 2 e2e', () => {
);
expect(() =>
checkFilesExist(
`dist/libs/${lib}/${lib}.common.js`,
`dist/libs/${lib}/${lib}.common.js.map`
`dist/libs/${lib}/build.common.js`,
`dist/libs/${lib}/build.common.js.map`
)
).not.toThrow();
expect(() =>
checkFilesExist(
`dist/libs/${lib}/${lib}.umd.js`,
`dist/libs/${lib}/${lib}.umd.js.map`,
`dist/libs/${lib}/${lib}.umd.min.js`,
`dist/libs/${lib}/${lib}.umd.min.js.map`
`dist/libs/${lib}/build.umd.js`,
`dist/libs/${lib}/build.umd.js.map`,
`dist/libs/${lib}/build.umd.min.js`,
`dist/libs/${lib}/build.umd.min.js.map`
)
).toThrow();
}, 300000);
Expand All @@ -255,12 +255,12 @@ describe.skip('vue 2 e2e', () => {
expect(() =>
checkFilesExist(
`dist/libs/subdir/${lib}/demo.html`,
`dist/libs/subdir/${lib}/subdir-${lib}.common.js`,
`dist/libs/subdir/${lib}/subdir-${lib}.common.js.map`,
`dist/libs/subdir/${lib}/subdir-${lib}.umd.js`,
`dist/libs/subdir/${lib}/subdir-${lib}.umd.js.map`,
`dist/libs/subdir/${lib}/subdir-${lib}.umd.min.js`,
`dist/libs/subdir/${lib}/subdir-${lib}.umd.min.js.map`,
`dist/libs/subdir/${lib}/build.common.js`,
`dist/libs/subdir/${lib}/build.common.js.map`,
`dist/libs/subdir/${lib}/build.umd.js`,
`dist/libs/subdir/${lib}/build.umd.js.map`,
`dist/libs/subdir/${lib}/build.umd.min.js`,
`dist/libs/subdir/${lib}/build.umd.min.js.map`,
`dist/libs/subdir/${lib}/package.json`
)
).not.toThrow();
Expand Down
24 changes: 12 additions & 12 deletions apps/vue-e2e/tests/vue-3.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -160,12 +160,12 @@ describe('vue 3 e2e', () => {
expect(() =>
checkFilesExist(
`dist/libs/${lib}/demo.html`,
`dist/libs/${lib}/${lib}.common.js`,
`dist/libs/${lib}/${lib}.common.js.map`,
`dist/libs/${lib}/${lib}.umd.js`,
`dist/libs/${lib}/${lib}.umd.js.map`,
`dist/libs/${lib}/${lib}.umd.min.js`,
`dist/libs/${lib}/${lib}.umd.min.js.map`,
`dist/libs/${lib}/build.common.js`,
`dist/libs/${lib}/build.common.js.map`,
`dist/libs/${lib}/build.umd.js`,
`dist/libs/${lib}/build.umd.js.map`,
`dist/libs/${lib}/build.umd.min.js`,
`dist/libs/${lib}/build.umd.min.js.map`,
`dist/libs/${lib}/package.json`,
`dist/libs/${lib}/README.md`
)
Expand All @@ -188,16 +188,16 @@ describe('vue 3 e2e', () => {
);
expect(() =>
checkFilesExist(
`dist/libs/${lib}/${lib}.common.js`,
`dist/libs/${lib}/${lib}.common.js.map`
`dist/libs/${lib}/build.common.js`,
`dist/libs/${lib}/build.common.js.map`
)
).not.toThrow();
expect(() =>
checkFilesExist(
`dist/libs/${lib}/${lib}.umd.js`,
`dist/libs/${lib}/${lib}.umd.js.map`,
`dist/libs/${lib}/${lib}.umd.min.js`,
`dist/libs/${lib}/${lib}.umd.min.js.map`
`dist/libs/${lib}/build.umd.js`,
`dist/libs/${lib}/build.umd.js.map`,
`dist/libs/${lib}/build.umd.min.js`,
`dist/libs/${lib}/build.umd.min.js.map`
)
).toThrow();
}, 300000);
Expand Down
2 changes: 1 addition & 1 deletion libs/docusaurus/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
If you have not already, [create an Nx workspace](https://github.com/nrwl/nx#creating-an-nx-workspace) with the following:

```
npx create-nx-workspace@^12.0.0
npx create-nx-workspace@^13.0.0
```

## Getting Started
Expand Down
4 changes: 2 additions & 2 deletions libs/docusaurus/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@nx-plus/docusaurus",
"version": "12.4.3",
"version": "13.0.0",
"main": "src/index.js",
"generators": "./generators.json",
"executors": "./executors.json",
Expand Down Expand Up @@ -28,6 +28,6 @@
"@nrwl/workspace": "^13.0.0"
},
"dependencies": {
"@nrwl/devkit": "^13.0.0"
"@nrwl/devkit": "^13.9.3"
}
}
11 changes: 3 additions & 8 deletions libs/docusaurus/project.json
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
"outputs": ["coverage/libs/docusaurus"]
},
"build": {
"executor": "@nrwl/node:package",
"executor": "@nrwl/js:tsc",
"options": {
"outputPath": "dist/libs/docusaurus",
"tsConfig": "libs/docusaurus/tsconfig.lib.json",
Expand All @@ -41,17 +41,12 @@
},
{
"input": "./libs/docusaurus",
"glob": "collection.json",
"glob": "generators.json",
"output": "."
},
{
"input": "./libs/docusaurus",
"glob": "builders.json",
"output": "."
},
{
"input": "./libs/docusaurus",
"glob": "migrations.json",
"glob": "executors.json",
"output": "."
}
],
Expand Down
4 changes: 2 additions & 2 deletions libs/docusaurus/src/executors/browser/executor.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ export default async function* runExecutor(
) {
const projectRoot = path.join(
context.root,
context.workspace.projects[context.projectName].root
context.workspace.projects[context.projectName ?? ''].root
);

try {
Expand All @@ -24,9 +24,9 @@ export default async function* runExecutor(
success: true,
};
} catch (err) {
console.error(err);
yield {
success: false,
error: err,
};
}
}
2 changes: 1 addition & 1 deletion libs/docusaurus/src/executors/dev-server/executor.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ export default async function* runExecutor(
) {
const projectRoot = path.join(
context.root,
context.workspace.projects[context.projectName].root
context.workspace.projects[context.projectName ?? ''].root
);
const port = options.port.toString();

Expand Down
14 changes: 6 additions & 8 deletions libs/docusaurus/src/generators/application/generator.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ describe('docusaurus schematic', () => {
await applicationGenerator(appTree, options);

const config = readProjectConfiguration(appTree, 'my-app');
const { build, serve } = config.targets;
const { build, serve } = config.targets || {};

expect(config.root).toBe('apps/my-app');
expect(build.executor).toBe('@nx-plus/docusaurus:browser');
Expand All @@ -76,23 +76,21 @@ describe('docusaurus schematic', () => {
.map((file) => `apps/my-app/${file}`)
.forEach((path) => expect(appTree.exists(path)).toBeTruthy());

expect(appTree.read('.gitignore').toString()).toContain(stripIndents`
expect(appTree.read('.gitignore', 'utf-8')).toContain(stripIndents`
# Generated Docusaurus files
.docusaurus/
.cache-loader/
`);

expect(appTree.read('.prettierignore').toString()).toContain(
'.docusaurus/'
);
expect(appTree.read('.prettierignore', 'utf-8')).toContain('.docusaurus/');
});

describe('--directory', () => {
it('should update workspace.json and generate files', async () => {
await applicationGenerator(appTree, { ...options, directory: 'subdir' });

const config = readProjectConfiguration(appTree, 'subdir-my-app');
const { build } = config.targets;
const { build } = config.targets || {};

expect(config.root).toBe('apps/subdir/my-app');
expect(build.options).toEqual({ outputPath: 'dist/apps/subdir/my-app' });
Expand All @@ -105,7 +103,7 @@ describe('docusaurus schematic', () => {

describe('workspaceLayout', () => {
beforeEach(() => {
const nxJson = JSON.parse(appTree.read('nx.json').toString());
const nxJson = JSON.parse(appTree.read('nx.json', 'utf-8') || '');
const updateNxJson = {
...nxJson,
workspaceLayout: { appsDir: 'custom-apps-dir' },
Expand All @@ -117,7 +115,7 @@ describe('docusaurus schematic', () => {
await applicationGenerator(appTree, options);

const config = readProjectConfiguration(appTree, 'my-app');
const { build } = config.targets;
const { build } = config.targets || {};

expect(config.root).toBe('custom-apps-dir/my-app');
expect(build.options).toEqual({
Expand Down
13 changes: 5 additions & 8 deletions libs/docusaurus/src/generators/application/generator.ts
Original file line number Diff line number Diff line change
Expand Up @@ -66,10 +66,8 @@ function updateGitIgnore(host: Tree) {

if (!host.exists(gitIgnorePath)) return;

const gitIgnoreSource = host
.read(gitIgnorePath)
.toString('utf-8')
.trimRight();
const gitIgnoreSource = host.read(gitIgnorePath, 'utf-8')?.trimRight() ?? '';

const ignorePatterns = ['.docusaurus/', '.cache-loader/'].filter(
(ip) => !gitIgnoreSource.includes(ip)
);
Expand All @@ -95,10 +93,9 @@ function updatePrettierIgnore(host: Tree) {

if (!host.exists(prettierIgnorePath)) return;

const prettierIgnoreSource = host
.read(prettierIgnorePath)
.toString('utf-8')
.trimRight();
const prettierIgnoreSource =
host.read(prettierIgnorePath, 'utf-8')?.trimRight() ?? '';

const ignorePattern = '.docusaurus/';

if (prettierIgnoreSource.includes(ignorePattern)) return;
Expand Down
6 changes: 3 additions & 3 deletions libs/nuxt/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
If you have not already, [create an Nx workspace](https://github.com/nrwl/nx#creating-an-nx-workspace) with the following:

```
npx create-nx-workspace@^12.0.0
npx create-nx-workspace@^13.0.0
```

### Peer Dependencies
Expand All @@ -31,10 +31,10 @@ If you have not already, install peer dependencies with the following:

```
# npm
npm install @nrwl/cypress@^12.0.0 @nrwl/jest@^12.0.0 @nrwl/linter@^12.0.0 --save-dev
npm install @nrwl/cypress@^13.0.0 @nrwl/jest@^13.0.0 @nrwl/linter@^13.0.0 --save-dev
# yarn
yarn add @nrwl/cypress@^12.0.0 @nrwl/jest@^12.0.0 @nrwl/linter@^12.0.0 --dev
yarn add @nrwl/cypress@^13.0.0 @nrwl/jest@^13.0.0 @nrwl/linter@^13.0.0 --dev
```

## Getting Started
Expand Down
Loading

0 comments on commit 05b9309

Please sign in to comment.