@nx/plugin 0.0.0-pr-22179-271588f
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +22 -0
- package/README.md +72 -0
- package/executors.json +10 -0
- package/generators.d.ts +6 -0
- package/generators.js +9 -0
- package/generators.json +49 -0
- package/index.d.ts +0 -0
- package/index.js +0 -0
- package/migrations.json +40 -0
- package/package.json +44 -0
- package/src/executors/e2e/e2e.impl.d.ts +6 -0
- package/src/executors/e2e/e2e.impl.js +43 -0
- package/src/executors/e2e/schema.d.ts +6 -0
- package/src/executors/e2e/schema.json +220 -0
- package/src/generators/create-package/create-package.d.ts +5 -0
- package/src/generators/create-package/create-package.js +112 -0
- package/src/generators/create-package/files/create-framework-package/bin/index.ts__tmpl__ +27 -0
- package/src/generators/create-package/files/e2e/__cliName__.spec.ts__tmpl__ +56 -0
- package/src/generators/create-package/schema.d.ts +19 -0
- package/src/generators/create-package/schema.json +79 -0
- package/src/generators/create-package/utils/normalize-schema.d.ts +8 -0
- package/src/generators/create-package/utils/normalize-schema.js +22 -0
- package/src/generators/e2e-project/e2e.d.ts +6 -0
- package/src/generators/e2e-project/e2e.js +144 -0
- package/src/generators/e2e-project/files/src/__pluginName__.spec.ts__tmpl__ +66 -0
- package/src/generators/e2e-project/files/tsconfig.json__tmpl__ +6 -0
- package/src/generators/e2e-project/schema.d.ts +15 -0
- package/src/generators/e2e-project/schema.json +57 -0
- package/src/generators/executor/executor.d.ts +6 -0
- package/src/generators/executor/executor.js +126 -0
- package/src/generators/executor/files/executor/executor.spec.ts.template +11 -0
- package/src/generators/executor/files/executor/executor.ts.template +11 -0
- package/src/generators/executor/files/executor/schema.d.ts.template +1 -0
- package/src/generators/executor/files/executor/schema.json.template +9 -0
- package/src/generators/executor/files/hasher/hasher.spec.ts.template +23 -0
- package/src/generators/executor/files/hasher/hasher.ts.template +12 -0
- package/src/generators/executor/schema.d.ts +17 -0
- package/src/generators/executor/schema.json +76 -0
- package/src/generators/generator/files/generator/generator.spec.ts.template +20 -0
- package/src/generators/generator/files/generator/generator.ts.template +26 -0
- package/src/generators/generator/files/generator/schema.d.ts.template +3 -0
- package/src/generators/generator/files/generator/schema.json.template +18 -0
- package/src/generators/generator/generator.d.ts +6 -0
- package/src/generators/generator/generator.js +127 -0
- package/src/generators/generator/schema.d.ts +16 -0
- package/src/generators/generator/schema.json +70 -0
- package/src/generators/lint-checks/generator.d.ts +7 -0
- package/src/generators/lint-checks/generator.js +187 -0
- package/src/generators/lint-checks/schema.d.ts +4 -0
- package/src/generators/lint-checks/schema.json +31 -0
- package/src/generators/migration/files/migration/__name__.spec.ts__tmpl__ +17 -0
- package/src/generators/migration/files/migration/__name__.ts__tmpl__ +6 -0
- package/src/generators/migration/migration.d.ts +5 -0
- package/src/generators/migration/migration.js +135 -0
- package/src/generators/migration/schema.d.ts +16 -0
- package/src/generators/migration/schema.json +68 -0
- package/src/generators/plugin/files/plugin/src/index.ts__tmpl__ +0 -0
- package/src/generators/plugin/plugin.d.ts +5 -0
- package/src/generators/plugin/plugin.js +107 -0
- package/src/generators/plugin/schema.d.ts +20 -0
- package/src/generators/plugin/schema.json +104 -0
- package/src/generators/plugin/utils/normalize-schema.d.ts +13 -0
- package/src/generators/plugin/utils/normalize-schema.js +44 -0
- package/src/generators/preset/generator.d.ts +3 -0
- package/src/generators/preset/generator.js +58 -0
- package/src/generators/preset/schema.d.ts +4 -0
- package/src/generators/preset/schema.json +30 -0
- package/src/migrations/update-15-0-0/specify-output-capture.d.ts +2 -0
- package/src/migrations/update-15-0-0/specify-output-capture.js +53 -0
- package/src/migrations/update-15-9-0/jest-29-configs.d.ts +3 -0
- package/src/migrations/update-15-9-0/jest-29-configs.js +147 -0
- package/src/migrations/update-15-9-0/jest-29-tests.d.ts +5 -0
- package/src/migrations/update-15-9-0/jest-29-tests.js +61 -0
- package/src/migrations/update-16-0-0/cli-in-schema-json.d.ts +3 -0
- package/src/migrations/update-16-0-0/cli-in-schema-json.js +135 -0
- package/src/migrations/update-16-0-0-add-nx-packages/update-16-0-0-add-nx-packages.d.ts +2 -0
- package/src/migrations/update-16-0-0-add-nx-packages/update-16-0-0-add-nx-packages.js +9 -0
- package/src/migrations/update-16-2-0/replace-e2e-executor.d.ts +2 -0
- package/src/migrations/update-16-2-0/replace-e2e-executor.js +32 -0
- package/src/utils/has-generator.d.ts +2 -0
- package/src/utils/has-generator.js +16 -0
- package/src/utils/testing-utils/async-commands.d.ts +28 -0
- package/src/utils/testing-utils/async-commands.js +50 -0
- package/src/utils/testing-utils/commands.d.ts +17 -0
- package/src/utils/testing-utils/commands.js +63 -0
- package/src/utils/testing-utils/index.d.ts +5 -0
- package/src/utils/testing-utils/index.js +8 -0
- package/src/utils/testing-utils/nx-project.d.ts +25 -0
- package/src/utils/testing-utils/nx-project.js +70 -0
- package/src/utils/testing-utils/paths.d.ts +15 -0
- package/src/utils/testing-utils/paths.js +32 -0
- package/src/utils/testing-utils/utils.d.ts +80 -0
- package/src/utils/testing-utils/utils.js +144 -0
- package/src/utils/versions.d.ts +2 -0
- package/src/utils/versions.js +5 -0
- package/testing.d.ts +1 -0
- package/testing.js +4 -0
package/LICENSE
ADDED
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
(The MIT License)
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2017-2023 Narwhal Technologies Inc.
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining
|
|
6
|
+
a copy of this software and associated documentation files (the
|
|
7
|
+
'Software'), to deal in the Software without restriction, including
|
|
8
|
+
without limitation the rights to use, copy, modify, merge, publish,
|
|
9
|
+
distribute, sublicense, and/or sell copies of the Software, and to
|
|
10
|
+
permit persons to whom the Software is furnished to do so, subject to
|
|
11
|
+
the following conditions:
|
|
12
|
+
|
|
13
|
+
The above copyright notice and this permission notice shall be
|
|
14
|
+
included in all copies or substantial portions of the Software.
|
|
15
|
+
|
|
16
|
+
THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND,
|
|
17
|
+
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
|
18
|
+
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
|
|
19
|
+
IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
|
|
20
|
+
CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
|
|
21
|
+
TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
|
|
22
|
+
SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
package/README.md
ADDED
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
<p style="text-align: center;">
|
|
2
|
+
<picture>
|
|
3
|
+
<source media="(prefers-color-scheme: dark)" srcset="https://raw.githubusercontent.com/nrwl/nx/master/images/nx-dark.svg">
|
|
4
|
+
<img alt="Nx - Smart Monorepos · Fast CI" src="https://raw.githubusercontent.com/nrwl/nx/master/images/nx-light.svg" width="100%">
|
|
5
|
+
</picture>
|
|
6
|
+
</p>
|
|
7
|
+
|
|
8
|
+
<div style="text-align: center;">
|
|
9
|
+
|
|
10
|
+
[](https://circleci.com/gh/nrwl/nx)
|
|
11
|
+
[]()
|
|
12
|
+
[](https://www.npmjs.com/@nx/workspace)
|
|
13
|
+
[]()
|
|
14
|
+
[](http://commitizen.github.io/cz-cli/)
|
|
15
|
+
[](https://gitter.im/nrwl-nx/community?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge)
|
|
16
|
+
[](https://go.nx.dev/community)
|
|
17
|
+
|
|
18
|
+
</div>
|
|
19
|
+
|
|
20
|
+
|
|
21
|
+
<hr>
|
|
22
|
+
|
|
23
|
+
# Nx: Smart Monorepos · Fast CI
|
|
24
|
+
|
|
25
|
+
Nx is a build system with built-in tooling and advanced CI capabilities. It helps you maintain and scale monorepos, both locally and on CI.
|
|
26
|
+
|
|
27
|
+
## What is It?
|
|
28
|
+
|
|
29
|
+
It's an Nx plugin used to build other Nx plugins.
|
|
30
|
+
|
|
31
|
+
Check out the list of community plugins and the documentation on how to create one using `create-nx-plugin` here: [https://nx.dev/community](https://nx.dev/community)
|
|
32
|
+
|
|
33
|
+
## Getting Started
|
|
34
|
+
|
|
35
|
+
### Creating an Nx Workspace
|
|
36
|
+
|
|
37
|
+
**Using `npx`**
|
|
38
|
+
|
|
39
|
+
```bash
|
|
40
|
+
npx create-nx-workspace
|
|
41
|
+
```
|
|
42
|
+
|
|
43
|
+
**Using `npm init`**
|
|
44
|
+
|
|
45
|
+
```bash
|
|
46
|
+
npm init nx-workspace
|
|
47
|
+
```
|
|
48
|
+
|
|
49
|
+
**Using `yarn create`**
|
|
50
|
+
|
|
51
|
+
```bash
|
|
52
|
+
yarn create nx-workspace
|
|
53
|
+
```
|
|
54
|
+
|
|
55
|
+
### Adding Nx to an Existing Repository
|
|
56
|
+
|
|
57
|
+
Run:
|
|
58
|
+
|
|
59
|
+
```bash
|
|
60
|
+
npx nx@latest init
|
|
61
|
+
```
|
|
62
|
+
|
|
63
|
+
## Documentation & Resources
|
|
64
|
+
|
|
65
|
+
- [Nx.Dev: Documentation, Guides, Tutorials](https://nx.dev)
|
|
66
|
+
- [Intro to Nx](https://nx.dev/getting-started/intro)
|
|
67
|
+
- [Official Nx YouTube Channel](https://www.youtube.com/@NxDevtools)
|
|
68
|
+
- [Blog Posts About Nx](https://blog.nrwl.io/nx/home)
|
|
69
|
+
|
|
70
|
+
<p style="text-align: center;"><a href="https://nx.dev/#learning-materials" target="_blank" rel="noreferrer"><img src="https://raw.githubusercontent.com/nrwl/nx/master/images/nx-courses-and-videos.svg"
|
|
71
|
+
width="100%" alt="Nx - Smart Monorepos · Fast CI"></a></p>
|
|
72
|
+
|
package/executors.json
ADDED
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
{
|
|
2
|
+
"executors": {
|
|
3
|
+
"e2e": {
|
|
4
|
+
"implementation": "./src/executors/e2e/e2e.impl",
|
|
5
|
+
"schema": "./src/executors/e2e/schema.json",
|
|
6
|
+
"description": "Creates and runs the E2E tests for an Nx Plugin.",
|
|
7
|
+
"x-deprecated": "@nx/plugin:e2e is deprecated and will be removed in Nx v19. Use @nx/jest:jest instead."
|
|
8
|
+
}
|
|
9
|
+
}
|
|
10
|
+
}
|
package/generators.d.ts
ADDED
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
export * from './src/generators/create-package/create-package';
|
|
2
|
+
export * from './src/generators/e2e-project/e2e';
|
|
3
|
+
export * from './src/generators/executor/executor';
|
|
4
|
+
export * from './src/generators/generator/generator';
|
|
5
|
+
export * from './src/generators/plugin/plugin';
|
|
6
|
+
export * from './src/generators/migration/migration';
|
package/generators.js
ADDED
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const tslib_1 = require("tslib");
|
|
4
|
+
tslib_1.__exportStar(require("./src/generators/create-package/create-package"), exports);
|
|
5
|
+
tslib_1.__exportStar(require("./src/generators/e2e-project/e2e"), exports);
|
|
6
|
+
tslib_1.__exportStar(require("./src/generators/executor/executor"), exports);
|
|
7
|
+
tslib_1.__exportStar(require("./src/generators/generator/generator"), exports);
|
|
8
|
+
tslib_1.__exportStar(require("./src/generators/plugin/plugin"), exports);
|
|
9
|
+
tslib_1.__exportStar(require("./src/generators/migration/migration"), exports);
|
package/generators.json
ADDED
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "nx/plugin",
|
|
3
|
+
"version": "0.1",
|
|
4
|
+
"extends": ["@nx/workspace"],
|
|
5
|
+
"generators": {
|
|
6
|
+
"plugin": {
|
|
7
|
+
"factory": "./src/generators/plugin/plugin#pluginGeneratorInternal",
|
|
8
|
+
"schema": "./src/generators/plugin/schema.json",
|
|
9
|
+
"description": "Create a Nx Plugin."
|
|
10
|
+
},
|
|
11
|
+
"create-package": {
|
|
12
|
+
"factory": "./src/generators/create-package/create-package#createPackageGeneratorInternal",
|
|
13
|
+
"schema": "./src/generators/create-package/schema.json",
|
|
14
|
+
"description": "Create a package which can be used by npx to create a new workspace"
|
|
15
|
+
},
|
|
16
|
+
"e2e-project": {
|
|
17
|
+
"factory": "./src/generators/e2e-project/e2e#e2eProjectGeneratorInternal",
|
|
18
|
+
"schema": "./src/generators/e2e-project/schema.json",
|
|
19
|
+
"description": "Create a E2E application for a Nx Plugin."
|
|
20
|
+
},
|
|
21
|
+
"migration": {
|
|
22
|
+
"factory": "./src/generators/migration/migration#migrationGeneratorInternal",
|
|
23
|
+
"schema": "./src/generators/migration/schema.json",
|
|
24
|
+
"description": "Create a migration for an Nx Plugin."
|
|
25
|
+
},
|
|
26
|
+
"generator": {
|
|
27
|
+
"factory": "./src/generators/generator/generator#generatorGeneratorInternal",
|
|
28
|
+
"schema": "./src/generators/generator/schema.json",
|
|
29
|
+
"description": "Create a generator for an Nx Plugin."
|
|
30
|
+
},
|
|
31
|
+
"executor": {
|
|
32
|
+
"factory": "./src/generators/executor/executor#executorGeneratorInternal",
|
|
33
|
+
"schema": "./src/generators/executor/schema.json",
|
|
34
|
+
"description": "Create an executor for an Nx Plugin."
|
|
35
|
+
},
|
|
36
|
+
"plugin-lint-checks": {
|
|
37
|
+
"factory": "./src/generators/lint-checks/generator",
|
|
38
|
+
"schema": "./src/generators/lint-checks/schema.json",
|
|
39
|
+
"description": "Adds linting configuration to validate common json files for nx plugins."
|
|
40
|
+
},
|
|
41
|
+
"preset": {
|
|
42
|
+
"factory": "./src/generators/preset/generator",
|
|
43
|
+
"schema": "./src/generators/preset/schema.json",
|
|
44
|
+
"description": "Initializes a workspace with an nx-plugin inside of it. Use as: `create-nx-workspace --preset @nx/plugin`.",
|
|
45
|
+
"hidden": true,
|
|
46
|
+
"x-use-standalone-layout": true
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
}
|
package/index.d.ts
ADDED
|
File without changes
|
package/index.js
ADDED
|
File without changes
|
package/migrations.json
ADDED
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
{
|
|
2
|
+
"generators": {
|
|
3
|
+
"update-15-0-0": {
|
|
4
|
+
"cli": "nx",
|
|
5
|
+
"version": "15.0.0-beta.0",
|
|
6
|
+
"description": "Migrates executor schema files to v2",
|
|
7
|
+
"factory": "./src/migrations/update-15-0-0/specify-output-capture"
|
|
8
|
+
},
|
|
9
|
+
"update-configs-jest-29": {
|
|
10
|
+
"version": "15.9.0-beta.0",
|
|
11
|
+
"cli": "nx",
|
|
12
|
+
"description": "Update nx plugin jest configs to support jest 29 changes (https://jestjs.io/docs/upgrading-to-jest29)",
|
|
13
|
+
"factory": "./src/migrations/update-15-9-0/jest-29-configs"
|
|
14
|
+
},
|
|
15
|
+
"update-tests-jest-29": {
|
|
16
|
+
"version": "15.9.0-beta.0",
|
|
17
|
+
"cli": "nx",
|
|
18
|
+
"description": "Update nx plugin jest test files to support jest 29 changes (https://jestjs.io/docs/upgrading-to-jest29)",
|
|
19
|
+
"factory": "./src/migrations/update-15-9-0/jest-29-tests"
|
|
20
|
+
},
|
|
21
|
+
"update-remove-cli-prop": {
|
|
22
|
+
"version": "16.0.0-beta.1",
|
|
23
|
+
"cli": "nx",
|
|
24
|
+
"description": "Removes CLI property within schema.json files and moves generators and schematics to the proper root node in migrations.json",
|
|
25
|
+
"factory": "./src/migrations/update-16-0-0/cli-in-schema-json"
|
|
26
|
+
},
|
|
27
|
+
"update-16-0-0-add-nx-packages": {
|
|
28
|
+
"cli": "nx",
|
|
29
|
+
"version": "16.0.0-beta.1",
|
|
30
|
+
"description": "Replace @nrwl/nx-plugin with @nx/plugin",
|
|
31
|
+
"implementation": "./src/migrations/update-16-0-0-add-nx-packages/update-16-0-0-add-nx-packages"
|
|
32
|
+
},
|
|
33
|
+
"update-16-2-0-replace-e2e-executor": {
|
|
34
|
+
"cli": "nx",
|
|
35
|
+
"version": "16.2.0-beta.0",
|
|
36
|
+
"description": "Replace @nx/plugin:e2e with @nx/jest",
|
|
37
|
+
"implementation": "./src/migrations/update-16-2-0/replace-e2e-executor"
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
}
|
package/package.json
ADDED
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@nx/plugin",
|
|
3
|
+
"version": "0.0.0-pr-22179-271588f",
|
|
4
|
+
"private": false,
|
|
5
|
+
"description": "This plugin is used to create Nx plugins! It contains generators for generating common plugin features like generators, executors, migrations and more.",
|
|
6
|
+
"repository": {
|
|
7
|
+
"type": "git",
|
|
8
|
+
"url": "https://github.com/nrwl/nx.git",
|
|
9
|
+
"directory": "packages/plugin"
|
|
10
|
+
},
|
|
11
|
+
"keywords": [
|
|
12
|
+
"Monorepo",
|
|
13
|
+
"Nx",
|
|
14
|
+
"CLI"
|
|
15
|
+
],
|
|
16
|
+
"main": "./index.js",
|
|
17
|
+
"types": "./index.d.ts",
|
|
18
|
+
"author": "Nrwl",
|
|
19
|
+
"license": "MIT",
|
|
20
|
+
"bugs": {
|
|
21
|
+
"url": "https://github.com/nrwl/nx/issues"
|
|
22
|
+
},
|
|
23
|
+
"homepage": "https://nx.dev",
|
|
24
|
+
"generators": "./generators.json",
|
|
25
|
+
"executors": "./executors.json",
|
|
26
|
+
"ng-update": {
|
|
27
|
+
"requirements": {},
|
|
28
|
+
"migrations": "./migrations.json"
|
|
29
|
+
},
|
|
30
|
+
"dependencies": {
|
|
31
|
+
"@phenomnomnominal/tsquery": "~5.0.1",
|
|
32
|
+
"fs-extra": "^11.1.0",
|
|
33
|
+
"tslib": "^2.3.0",
|
|
34
|
+
"@nx/devkit": "0.0.0-pr-22179-271588f",
|
|
35
|
+
"@nx/jest": "0.0.0-pr-22179-271588f",
|
|
36
|
+
"@nx/js": "0.0.0-pr-22179-271588f",
|
|
37
|
+
"@nx/eslint": "0.0.0-pr-22179-271588f",
|
|
38
|
+
"@nrwl/nx-plugin": "0.0.0-pr-22179-271588f"
|
|
39
|
+
},
|
|
40
|
+
"publishConfig": {
|
|
41
|
+
"access": "public"
|
|
42
|
+
},
|
|
43
|
+
"type": "commonjs"
|
|
44
|
+
}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import type { ExecutorContext } from '@nx/devkit';
|
|
2
|
+
import type { NxPluginE2EExecutorOptions } from './schema';
|
|
3
|
+
export declare function nxPluginE2EExecutor(options: NxPluginE2EExecutorOptions, context: ExecutorContext): AsyncGenerator<{
|
|
4
|
+
success: boolean;
|
|
5
|
+
}>;
|
|
6
|
+
export default nxPluginE2EExecutor;
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.nxPluginE2EExecutor = void 0;
|
|
4
|
+
const devkit_1 = require("@nx/devkit");
|
|
5
|
+
const jest_impl_1 = require("@nx/jest/src/executors/jest/jest.impl");
|
|
6
|
+
// TODO(v19): remove this
|
|
7
|
+
async function* nxPluginE2EExecutor(options, context) {
|
|
8
|
+
const { target, ...jestOptions } = options;
|
|
9
|
+
devkit_1.output.warn({
|
|
10
|
+
title: `"@nx/plugin:e2e" is deprecated and will be removed in Nx 19`,
|
|
11
|
+
bodyLines: [
|
|
12
|
+
'Use the "@nx/jest:jest" executor instead and set the following:',
|
|
13
|
+
`"dependsOn": ["${target}"]`,
|
|
14
|
+
],
|
|
15
|
+
});
|
|
16
|
+
let success;
|
|
17
|
+
for await (const _ of runBuildTarget(target, context)) {
|
|
18
|
+
try {
|
|
19
|
+
success = await runTests(jestOptions, context);
|
|
20
|
+
}
|
|
21
|
+
catch (e) {
|
|
22
|
+
devkit_1.logger.error(e.message);
|
|
23
|
+
success = false;
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
return { success };
|
|
27
|
+
}
|
|
28
|
+
exports.nxPluginE2EExecutor = nxPluginE2EExecutor;
|
|
29
|
+
async function* runBuildTarget(buildTarget, context) {
|
|
30
|
+
const { project, target, configuration } = (0, devkit_1.parseTargetString)(buildTarget, context);
|
|
31
|
+
const buildTargetOptions = (0, devkit_1.readTargetOptions)({ project, target, configuration }, context);
|
|
32
|
+
const targetSupportsWatch = Object.keys(buildTargetOptions).includes('watch');
|
|
33
|
+
for await (const output of await (0, devkit_1.runExecutor)({ project, target, configuration }, targetSupportsWatch ? { watch: false } : {}, context)) {
|
|
34
|
+
if (!output.success)
|
|
35
|
+
throw new Error('Could not compile application files.');
|
|
36
|
+
yield output.success;
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
async function runTests(jestOptions, context) {
|
|
40
|
+
const { success } = await (0, jest_impl_1.jestExecutor)({ ...jestOptions, watch: false }, context);
|
|
41
|
+
return success;
|
|
42
|
+
}
|
|
43
|
+
exports.default = nxPluginE2EExecutor;
|
|
@@ -0,0 +1,220 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 2,
|
|
3
|
+
"outputCapture": "direct-nodejs",
|
|
4
|
+
"title": "Nx Plugin Playground Target",
|
|
5
|
+
"description": "Creates a playground for a Nx Plugin.",
|
|
6
|
+
"cli": "nx",
|
|
7
|
+
"type": "object",
|
|
8
|
+
"properties": {
|
|
9
|
+
"target": {
|
|
10
|
+
"description": "The build target for the Nx Plugin project.",
|
|
11
|
+
"type": "string",
|
|
12
|
+
"x-priority": "important"
|
|
13
|
+
},
|
|
14
|
+
"jestConfig": {
|
|
15
|
+
"type": "string",
|
|
16
|
+
"description": "Jest config file.",
|
|
17
|
+
"x-completion-type": "file",
|
|
18
|
+
"x-completion-glob": "jest.config@(.js|.ts)",
|
|
19
|
+
"x-priority": "important"
|
|
20
|
+
},
|
|
21
|
+
"tsSpecConfig": {
|
|
22
|
+
"type": "string",
|
|
23
|
+
"description": "The tsconfig file for specs.",
|
|
24
|
+
"x-deprecated": "Use the `tsconfig` property for `ts-jest` in the e2e project `jest.config.js` file. It will be removed in the next major release.",
|
|
25
|
+
"x-completion-type": "file",
|
|
26
|
+
"x-completion-glob": "tsconfig.*.json",
|
|
27
|
+
"x-priority": "important"
|
|
28
|
+
},
|
|
29
|
+
"codeCoverage": {
|
|
30
|
+
"description": "Indicates that test coverage information should be collected and reported in the output. (https://jestjs.io/docs/cli#--coverageboolean)",
|
|
31
|
+
"type": "boolean",
|
|
32
|
+
"aliases": ["coverage"]
|
|
33
|
+
},
|
|
34
|
+
"config": {
|
|
35
|
+
"description": "The path to a Jest config file specifying how to find and execute tests. If no `rootDir` is set in the config, the directory containing the config file is assumed to be the `rootDir` for the project. This can also be a JSON-encoded value which Jest will use as configuration.",
|
|
36
|
+
"type": "string"
|
|
37
|
+
},
|
|
38
|
+
"clearCache": {
|
|
39
|
+
"description": "Deletes the Jest cache directory and then exits without running tests. Will delete Jest's default cache directory. _Note: clearing the cache will reduce performance_.",
|
|
40
|
+
"type": "boolean"
|
|
41
|
+
},
|
|
42
|
+
"detectOpenHandles": {
|
|
43
|
+
"description": "Attempt to collect and print open handles preventing Jest from exiting cleanly (https://jestjs.io/docs/cli#--detectopenhandles)",
|
|
44
|
+
"type": "boolean"
|
|
45
|
+
},
|
|
46
|
+
"logHeapUsage": {
|
|
47
|
+
"description": "Logs the heap usage after every test. Useful to debug memory leaks. Use together with --runInBand and --expose-gc in node.",
|
|
48
|
+
"type": "boolean"
|
|
49
|
+
},
|
|
50
|
+
"detectLeaks": {
|
|
51
|
+
"description": "**EXPERIMENTAL**: Detect memory leaks in tests. After executing a test, it will try to garbage collect the global object used, and fail if it was leaked",
|
|
52
|
+
"type": "boolean"
|
|
53
|
+
},
|
|
54
|
+
"testFile": {
|
|
55
|
+
"description": "The name of the file to test.",
|
|
56
|
+
"type": "string",
|
|
57
|
+
"x-completion-type": "file",
|
|
58
|
+
"x-completion-glob": "**/*.+(spec|test).+(ts|js)"
|
|
59
|
+
},
|
|
60
|
+
"tsConfig": {
|
|
61
|
+
"description": "The name of the Typescript configuration file. Set the tsconfig option in the jest config file. ",
|
|
62
|
+
"type": "string",
|
|
63
|
+
"x-deprecated": "Use the ts-jest configuration options in the jest config file instead."
|
|
64
|
+
},
|
|
65
|
+
"setupFile": {
|
|
66
|
+
"description": "The name of a setup file used by Jest. (use Jest config file https://jestjs.io/docs/en/configuration#setupfilesafterenv-array)",
|
|
67
|
+
"type": "string",
|
|
68
|
+
"x-deprecated": "Use the setupFilesAfterEnv option in the jest config file. https://jestjs.io/docs/en/configuration#setupfilesafterenv-array"
|
|
69
|
+
},
|
|
70
|
+
"bail": {
|
|
71
|
+
"alias": "b",
|
|
72
|
+
"description": "Exit the test suite immediately after `n` number of failing tests. (https://jestjs.io/docs/cli#--bail)",
|
|
73
|
+
"oneOf": [
|
|
74
|
+
{
|
|
75
|
+
"type": "number"
|
|
76
|
+
},
|
|
77
|
+
{
|
|
78
|
+
"type": "boolean"
|
|
79
|
+
}
|
|
80
|
+
]
|
|
81
|
+
},
|
|
82
|
+
"ci": {
|
|
83
|
+
"description": "Whether to run Jest in continuous integration (CI) mode. This option is on by default in most popular CI environments. It will prevent snapshots from being written unless explicitly requested. (https://jestjs.io/docs/cli#--ci)",
|
|
84
|
+
"type": "boolean"
|
|
85
|
+
},
|
|
86
|
+
"color": {
|
|
87
|
+
"alias": "colors",
|
|
88
|
+
"description": "Forces test results output color highlighting (even if `stdout` is not a TTY). Set to false if you would like to have no colors. (https://jestjs.io/docs/cli#--colors)",
|
|
89
|
+
"type": "boolean"
|
|
90
|
+
},
|
|
91
|
+
"findRelatedTests": {
|
|
92
|
+
"description": "Find and run the tests that cover a comma separated list of source files that were passed in as arguments. (https://jestjs.io/docs/cli#--findrelatedtests-spaceseparatedlistofsourcefiles)",
|
|
93
|
+
"type": "string"
|
|
94
|
+
},
|
|
95
|
+
"json": {
|
|
96
|
+
"description": "Prints the test results in `JSON`. This mode will send all other test output and user messages to `stderr`. (https://jestjs.io/docs/cli#--json)",
|
|
97
|
+
"type": "boolean"
|
|
98
|
+
},
|
|
99
|
+
"maxWorkers": {
|
|
100
|
+
"alias": "w",
|
|
101
|
+
"description": "Specifies the maximum number of workers the worker-pool will spawn for running tests. This defaults to the number of the cores available on your machine. Useful for CI. (its usually best not to override this default) (https://jestjs.io/docs/cli#--maxworkersnumstring)",
|
|
102
|
+
"oneOf": [
|
|
103
|
+
{
|
|
104
|
+
"type": "number"
|
|
105
|
+
},
|
|
106
|
+
{
|
|
107
|
+
"type": "string"
|
|
108
|
+
}
|
|
109
|
+
]
|
|
110
|
+
},
|
|
111
|
+
"onlyChanged": {
|
|
112
|
+
"alias": "o",
|
|
113
|
+
"description": "Attempts to identify which tests to run based on which files have changed in the current repository. Only works if you're running tests in a `git` or `hg` repository at the moment. (https://jestjs.io/docs/cli#--onlychanged)",
|
|
114
|
+
"type": "boolean"
|
|
115
|
+
},
|
|
116
|
+
"changedSince": {
|
|
117
|
+
"description": "Runs tests related to the changes since the provided branch or commit hash. If the current branch has diverged from the given branch, then only changes made locally will be tested. (https://jestjs.io/docs/cli#--changedsince)",
|
|
118
|
+
"type": "string"
|
|
119
|
+
},
|
|
120
|
+
"outputFile": {
|
|
121
|
+
"description": "Write test results to a file when the `--json` option is also specified. (https://jestjs.io/docs/cli#--outputfilefilename)",
|
|
122
|
+
"type": "string"
|
|
123
|
+
},
|
|
124
|
+
"passWithNoTests": {
|
|
125
|
+
"description": "Will not fail if no tests are found (for example while using `--testPathPattern`.) (https://jestjs.io/docs/cli#--passwithnotests)",
|
|
126
|
+
"type": "boolean"
|
|
127
|
+
},
|
|
128
|
+
"runInBand": {
|
|
129
|
+
"alias": "i",
|
|
130
|
+
"description": "Run all tests serially in the current process (rather than creating a worker pool of child processes that run tests). This is sometimes useful for debugging, but such use cases are pretty rare. Useful for CI. (https://jestjs.io/docs/cli#--runinband)",
|
|
131
|
+
"type": "boolean",
|
|
132
|
+
"default": true
|
|
133
|
+
},
|
|
134
|
+
"showConfig": {
|
|
135
|
+
"description": "Print your Jest config and then exits. (https://jestjs.io/docs/en/cli#--showconfig)",
|
|
136
|
+
"type": "boolean"
|
|
137
|
+
},
|
|
138
|
+
"silent": {
|
|
139
|
+
"description": "Prevent tests from printing messages through the console. (https://jestjs.io/docs/cli#--silent)",
|
|
140
|
+
"type": "boolean"
|
|
141
|
+
},
|
|
142
|
+
"testNamePattern": {
|
|
143
|
+
"alias": "t",
|
|
144
|
+
"description": "Run only tests with a name that matches the regex pattern. (https://jestjs.io/docs/cli#--testnamepatternregex)",
|
|
145
|
+
"type": "string"
|
|
146
|
+
},
|
|
147
|
+
"testPathIgnorePatterns": {
|
|
148
|
+
"description": "An array of regexp pattern strings that is matched against all tests paths before executing the test. Only run those tests with a path that does not match with the provided regexp expressions. (https://jestjs.io/docs/cli#--testpathignorepatternsregexarray)",
|
|
149
|
+
"type": "array",
|
|
150
|
+
"items": {
|
|
151
|
+
"type": "string"
|
|
152
|
+
}
|
|
153
|
+
},
|
|
154
|
+
"testPathPattern": {
|
|
155
|
+
"description": "An array of regexp pattern strings that is matched against all tests paths before executing the test. (https://jestjs.io/docs/cli#--testpathpatternregex)",
|
|
156
|
+
"type": "array",
|
|
157
|
+
"items": {
|
|
158
|
+
"type": "string"
|
|
159
|
+
},
|
|
160
|
+
"default": []
|
|
161
|
+
},
|
|
162
|
+
"colors": {
|
|
163
|
+
"description": "Forces test results output highlighting even if stdout is not a TTY. (https://jestjs.io/docs/cli#--colors)",
|
|
164
|
+
"type": "boolean"
|
|
165
|
+
},
|
|
166
|
+
"reporters": {
|
|
167
|
+
"description": "Run tests with specified reporters. Reporter options are not available via CLI. Example with multiple reporters: `jest --reporters=\"default\" --reporters=\"jest-junit\"`. (https://jestjs.io/docs/cli#--reporters)",
|
|
168
|
+
"type": "array",
|
|
169
|
+
"items": {
|
|
170
|
+
"type": "string"
|
|
171
|
+
}
|
|
172
|
+
},
|
|
173
|
+
"verbose": {
|
|
174
|
+
"description": "Display individual test results with the test suite hierarchy. (https://jestjs.io/docs/cli#--verbose)",
|
|
175
|
+
"type": "boolean"
|
|
176
|
+
},
|
|
177
|
+
"coverageReporters": {
|
|
178
|
+
"description": "A list of reporter names that Jest uses when writing coverage reports. Any istanbul reporter.",
|
|
179
|
+
"type": "array",
|
|
180
|
+
"items": {
|
|
181
|
+
"type": "string"
|
|
182
|
+
}
|
|
183
|
+
},
|
|
184
|
+
"coverageDirectory": {
|
|
185
|
+
"description": "The directory where Jest should output its coverage files.",
|
|
186
|
+
"type": "string"
|
|
187
|
+
},
|
|
188
|
+
"testResultsProcessor": {
|
|
189
|
+
"description": "Node module that implements a custom results processor. (https://jestjs.io/docs/en/configuration#testresultsprocessor-string)",
|
|
190
|
+
"type": "string"
|
|
191
|
+
},
|
|
192
|
+
"updateSnapshot": {
|
|
193
|
+
"alias": "u",
|
|
194
|
+
"description": "Use this flag to re-record snapshots. Can be used together with a test suite pattern or with `--testNamePattern` to re-record snapshot for test matching the pattern. (https://jestjs.io/docs/cli#--updatesnapshot)",
|
|
195
|
+
"type": "boolean"
|
|
196
|
+
},
|
|
197
|
+
"useStderr": {
|
|
198
|
+
"description": "Divert all output to stderr.",
|
|
199
|
+
"type": "boolean"
|
|
200
|
+
},
|
|
201
|
+
"watch": {
|
|
202
|
+
"description": "Watch files for changes and rerun tests related to changed files. If you want to re-run all tests when a file has changed, use the `--watchAll` option. (https://jestjs.io/docs/cli#--watch)",
|
|
203
|
+
"type": "boolean"
|
|
204
|
+
},
|
|
205
|
+
"watchAll": {
|
|
206
|
+
"description": "Watch files for changes and rerun all tests when something changes. If you want to re-run only the tests that depend on the changed files, use the `--watch` option. (https://jestjs.io/docs/cli#--watchall)",
|
|
207
|
+
"type": "boolean"
|
|
208
|
+
},
|
|
209
|
+
"testLocationInResults": {
|
|
210
|
+
"description": "Adds a location field to test results. Used to report location of a test in a reporter. { \"column\": 4, \"line\": 5 } (https://jestjs.io/docs/cli#--testlocationinresults)",
|
|
211
|
+
"type": "boolean"
|
|
212
|
+
},
|
|
213
|
+
"testTimeout": {
|
|
214
|
+
"description": "Default timeout of a test in milliseconds. Default value: `5000`. (https://jestjs.io/docs/cli#--testtimeoutnumber)",
|
|
215
|
+
"type": "number"
|
|
216
|
+
}
|
|
217
|
+
},
|
|
218
|
+
"additionalProperties": false,
|
|
219
|
+
"required": ["target", "jestConfig"]
|
|
220
|
+
}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import { GeneratorCallback, Tree } from '@nx/devkit';
|
|
2
|
+
import { CreatePackageSchema } from './schema';
|
|
3
|
+
export declare function createPackageGenerator(host: Tree, schema: CreatePackageSchema): Promise<GeneratorCallback>;
|
|
4
|
+
export declare function createPackageGeneratorInternal(host: Tree, schema: CreatePackageSchema): Promise<GeneratorCallback>;
|
|
5
|
+
export default createPackageGenerator;
|