Skip to content

Commit

Permalink
feat(nx-spring-boot): migrate to Nrwl's DevKit executors/generators API
Browse files Browse the repository at this point in the history
BREAKING CHANGE: Nx workspace v11 is now the minimum version required to use this plugin.

In fact, all builders/schematics have been rewritten into executors/generators using its new `@nrwl/devkit` API.
  • Loading branch information
tinesoft committed Mar 30, 2021
1 parent 6144cfe commit 47231fd
Show file tree
Hide file tree
Showing 78 changed files with 930 additions and 1,002 deletions.
5 changes: 0 additions & 5 deletions __mocks__/child_process.js

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import {
runNxCommandAsync,
uniq,
} from '@nrwl/nx-plugin/testing';
import { toClassName } from '@nrwl/workspace';
import { names } from '@nrwl/devkit';

describe('nx-spring-boot e2e', () => {
it('should create nx-spring-boot with default options', async (done) => {
Expand Down Expand Up @@ -49,7 +49,7 @@ describe('nx-spring-boot e2e', () => {
`apps/${appName}/mvnw`,
`apps/${appName}/pom.xml`,
`apps/${appName}/HELP.md`,
`apps/${appName}/src/main/java/com/tinesoft/api/${toClassName(appName)}Application.java`)
`apps/${appName}/src/main/java/com/tinesoft/api/${names(appName).className}Application.java`)
).not.toThrow();

const pomXml = readFile(`apps/${appName}/pom.xml`);
Expand Down
9 changes: 8 additions & 1 deletion e2e/nx-spring-boot-e2e/tsconfig.spec.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,5 +5,12 @@
"module": "commonjs",
"types": ["jest", "node"]
},
"include": ["**/*.spec.ts", "**/*.d.ts"]
"include": [
"**/*.test.ts",
"**/*.spec.ts",
"**/*.spec.tsx",
"**/*.spec.js",
"**/*.spec.jsx",
"**/*.d.ts"
]
}
7 changes: 4 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -29,9 +29,9 @@
},
"private": true,
"dependencies": {
"inquirer": "^7.3.3",
"node-fetch": "^2.6.1",
"unzipper": "^0.10.11",
"inquirer": "^7.3.3"
"unzipper": "^0.10.11"
},
"devDependencies": {
"@commitlint/cli": "^11.0.0",
Expand Down Expand Up @@ -59,6 +59,7 @@
"eslint-config-prettier": "8.1.0",
"husky": "^4.3.0",
"jest": "26.2.2",
"jest-each": "^26.6.2",
"prettier": "2.2.1",
"semantic-release": "^17.3.0",
"ts-jest": "26.4.0",
Expand All @@ -75,4 +76,4 @@
"type": "git",
"url": "https://github.com/tinesoft/nxrocks.git"
}
}
}
9 changes: 9 additions & 0 deletions packages/nx-spring-boot/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
- [Prerequisite](#prerequisite)
- [Getting Started](#getting-started)
- [Plugin Usage](#plugin-usage)
- [Compatibility matrix with Nx](#compatibility-matrix-with-nx)

## Prerequisite

Expand Down Expand Up @@ -188,6 +189,14 @@ nx test your-boot-app
nx clean your-boot-app
```

## Compatibility matrix with Nx

Every Nx plugin relies on the underlying Nx Workspace it runs on. This table provides the compatibility matrix between major versions of Nx workspace and this plugin/

| Plugin Version | Nx Workspace version
| -------------- | ---------------------
| `>=v2.x.x` | `>=v11.x.x`
| `<=v1.3.1` | `<=v10.x.x`
## License

Copyright (c) 2020 Tine Kondo. Licensed under the MIT License (MIT)
45 changes: 0 additions & 45 deletions packages/nx-spring-boot/builders.json

This file was deleted.

13 changes: 0 additions & 13 deletions packages/nx-spring-boot/collection.json

This file was deleted.

44 changes: 44 additions & 0 deletions packages/nx-spring-boot/executors.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
{
"executors": {
"run": {
"implementation": "./src/builders/run/executor",
"schema": "./src/builders/run/schema.json",
"description": "Executor to run the application"
},
"serve": {
"implementation": "./src/builders/run/executor",
"schema": "./src/builders/serve/schema.json",
"description": "Executor to serve the application (alias to 'run' executor)"
},
"test": {
"implementation": "./src/builders/test/executor",
"schema": "./src/builders/test/schema.json",
"description": "Executor to test the application"
},
"clean": {
"implementation": "./src/builders/clean/executor",
"schema": "./src/builders/clean/schema.json",
"description": "Executor to clean the application"
},
"buildJar": {
"implementation": "./src/builders/build-jar/executor",
"schema": "./src/builders/build-jar/schema.json",
"description": "Executor to build the application's executable Jar"
},
"buildWar": {
"implementation": "./src/builders/build-war/executor",
"schema": "./src/builders/build-war/schema.json",
"description": "Executor to build the application's executable War"
},
"buildImage": {
"implementation": "./src/executors/build-image/executor",
"schema": "./src/executors/build-image/schema.json",
"description": "Executor to build the application's OCI image"
},
"buildInfo": {
"implementation": "./src/executors/build-info/executor",
"schema": "./src/executors/build-info/schema.json",
"description": "Executor to build the applications's build information"
}
}
}
12 changes: 12 additions & 0 deletions packages/nx-spring-boot/generators.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
{
"name": "nx-spring-boot",
"version": "0.0.1",
"generators": {
"application": {
"factory": "./src/generators/application/generator",
"schema": "./src/generators/application/schema.json",
"description": "Generator to generate the application",
"aliases": ["app"]
}
}
}
6 changes: 4 additions & 2 deletions packages/nx-spring-boot/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@
"access": "public"
},
"main": "src/index.js",
"schematics": "./collection.json",
"builders": "./builders.json",
"generators": "./generators.json",
"executors": "./executors.json",
"license": "MIT",
"author": "Tine Kondo ",
"repository": {
Expand All @@ -29,6 +29,8 @@
"java"
],
"dependencies": {
"@nrwl/workspace": "*",
"@nrwl/devkit": "*",
"node-fetch": "^2.6.1",
"unzipper": "^0.10.11"
}
Expand Down
77 changes: 0 additions & 77 deletions packages/nx-spring-boot/src/builders/build-image/builder.spec.ts

This file was deleted.

12 changes: 0 additions & 12 deletions packages/nx-spring-boot/src/builders/build-image/builder.ts

This file was deleted.

7 changes: 0 additions & 7 deletions packages/nx-spring-boot/src/builders/build-image/schema.d.ts

This file was deleted.

Loading

0 comments on commit 47231fd

Please sign in to comment.