Skip to content

Commit

Permalink
feat: remove deprecated workspace-lint (#82)
Browse files Browse the repository at this point in the history
  • Loading branch information
meeroslav authored Apr 28, 2023
1 parent daaa5a7 commit 310bb52
Show file tree
Hide file tree
Showing 91 changed files with 21,697 additions and 22,927 deletions.
1 change: 0 additions & 1 deletion .github/workflows/ci-integration-test-install-commands.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@ jobs:
echo "install commands end"
parallel-commands: |
node -e "const f = require('fs'); if(f.existsSync('./install-commands-success')) console.log('install-commands success'); else { throw new Error('install commands did not run!');}"
npx nx workspace-lint
npx nx format:check
parallel-commands-on-agents: |
node -e "const f = require('fs'); if(f.existsSync('./install-commands-success')) console.log('install-commands success on agent.'); else { throw new Error('install commands did not run!');}"
Expand Down
3 changes: 1 addition & 2 deletions .github/workflows/ci-integration-test-npm-windows.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,7 @@ jobs:
runs-on: windows-latest
working-directory: ./integration-tests/npm
parallel-commands: |
npx nx workspace-lint
npx nx format:check
# npx nx format:check
parallel-commands-on-agents: |
npx nx affected --target=lint --parallel=3
npx nx affected --target=test --parallel=3 --ci --code-coverage
Expand Down
1 change: 0 additions & 1 deletion .github/workflows/ci-integration-test-npm.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@ jobs:
with:
working-directory: ./integration-tests/npm
parallel-commands: |
npx nx workspace-lint
npx nx format:check
parallel-commands-on-agents: |
npx nx affected --target=lint --parallel=3
Expand Down
1 change: 0 additions & 1 deletion .github/workflows/ci-integration-test-pnpm.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@ jobs:
with:
working-directory: ./integration-tests/pnpm
parallel-commands: |
npx nx workspace-lint
npx nx format:check
parallel-commands-on-agents: |
npx nx affected --target=lint --parallel=3
Expand Down
1 change: 0 additions & 1 deletion .github/workflows/ci-integration-test-yarn-berry.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@ jobs:
with:
working-directory: ./integration-tests/yarn-berry
parallel-commands: |
yarn nx workspace-lint
yarn nx format:check
parallel-commands-on-agents: |
yarn nx affected --target=lint --parallel=3
Expand Down
1 change: 0 additions & 1 deletion .github/workflows/ci-integration-test-yarn.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@ jobs:
with:
working-directory: ./integration-tests/yarn
parallel-commands: |
yarn nx workspace-lint
yarn nx format:check
parallel-commands-on-agents: |
yarn nx affected --target=lint --parallel=3
Expand Down
3 changes: 2 additions & 1 deletion .github/workflows/nx-cloud-agents.yml
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@ on:

env:
NX_CLOUD_DISTRIBUTED_EXECUTION: true
NX_CLOUD_DISTRIBUTED_EXECUTION_AGENT_COUNT: ${{ inputs.number-of-agents }}
NX_BRANCH: ${{ github.event.number || github.ref_name }}
NX_CLOUD_ACCESS_TOKEN: ${{ secrets.NX_CLOUD_ACCESS_TOKEN }}
NX_CLOUD_AUTH_TOKEN: ${{ secrets.NX_CLOUD_AUTH_TOKEN }}
Expand Down Expand Up @@ -96,7 +97,7 @@ jobs:
# Install pnpm with exact version provided by consumer or fallback to latest
- name: Install PNPM
if: steps.package_manager.outputs.name == 'pnpm'
uses: pnpm/action-setup@v2.2.4
uses: pnpm/action-setup@v2
with:
version: ${{ inputs.pnpm-version || 'latest' }}

Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/nx-cloud-main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,7 @@ jobs:
# Install pnpm with exact version provided by consumer or fallback to latest
- name: Install PNPM
if: steps.package_manager.outputs.name == 'pnpm'
uses: pnpm/action-setup@v2.2.4
uses: pnpm/action-setup@v2
with:
version: ${{ inputs.pnpm-version || 'latest' }}

Expand Down
13 changes: 6 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -60,13 +60,12 @@ concurrency:
jobs:
main:
name: Nx Cloud - Main Job
uses: nrwl/ci/.github/workflows/nx-cloud-main.yml@v0.11.4
uses: nrwl/ci/.github/workflows/nx-cloud-main.yml@v0.12.0
with:
# NOTE: Here we are using the special `nx-cloud record` command to ensure that any commands we run that do not go through the cloud task runner natively
# (i.e. anything that starts with `nx run`/`nx run-many`/`nx affected --target`), are still captured in the Nx Cloud UI and Github App comment for
# easier troubleshooting. See more here: https://nx.dev/nx-cloud/set-up/record-commands#recording-non-nx-commands
parallel-commands: |
npx nx-cloud record -- npx nx workspace-lint
npx nx-cloud record -- npx nx format:check
parallel-commands-on-agents: |
npx nx affected --target=lint --parallel=3
Expand All @@ -75,7 +74,7 @@ jobs:
agents:
name: Nx Cloud - Agents
uses: nrwl/ci/.github/workflows/nx-cloud-agents.yml@v0.11.4
uses: nrwl/ci/.github/workflows/nx-cloud-agents.yml@v0.12.0
with:
number-of-agents: 3
```
Expand Down Expand Up @@ -110,15 +109,15 @@ concurrency:
jobs:
main:
name: Nx Cloud - Main Job
uses: nrwl/ci/.github/workflows/nx-cloud-main.yml@v0.11.4
uses: nrwl/ci/.github/workflows/nx-cloud-main.yml@v0.12.0
secrets:
NX_CLOUD_ACCESS_TOKEN: ${{ secrets.NX_CLOUD_ACCESS_TOKEN }}
NX_CLOUD_AUTH_TOKEN: ${{ secrets.NX_CLOUD_AUTH_TOKEN }}
with: ...
agents:
name: Nx Cloud - Agents
uses: nrwl/ci/.github/workflows/nx-cloud-agents.yml@v0.11.4
uses: nrwl/ci/.github/workflows/nx-cloud-agents.yml@v0.12.0
secrets:
NX_CLOUD_ACCESS_TOKEN: ${{ secrets.NX_CLOUD_ACCESS_TOKEN }}
NX_CLOUD_AUTH_TOKEN: ${{ secrets.NX_CLOUD_AUTH_TOKEN }}
Expand All @@ -134,7 +133,7 @@ See the annotated configuration below for all explicitly supported secret values
<!-- start configuration-options-for-the-main-job -->

```yaml
- uses: nrwl/ci/.github/workflows/nx-cloud-main.yml@v0.11.4
- uses: nrwl/ci/.github/workflows/nx-cloud-main.yml@v0.12.0
# [OPTIONAL] Explicitly supported secret values which can be passed into the workflow from your outer workflow run.
#
# NOTE: You cannot access values from ${{ secrets }} beyond what is explicitly specified here because of the limitations of reusable Github workflows
Expand Down Expand Up @@ -249,7 +248,7 @@ See the annotated configuration below for all explicitly supported secret values
<!-- start configuration-options-for-agent-jobs -->
```yaml
- uses: nrwl/ci/.github/workflows/nx-cloud-agents.yml@v0.11.4
- uses: nrwl/ci/.github/workflows/nx-cloud-agents.yml@v0.12.0
# [OPTIONAL] Explicitly supported secret values which can be passed into the workflow from your outer workflow run.
#
# NOTE: You cannot access values from ${{ secrets }} beyond what is explicitly specified here because of the limitations of reusable Github workflows
Expand Down
1 change: 1 addition & 0 deletions integration-tests/npm/.eslintignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
node_modules
8 changes: 4 additions & 4 deletions integration-tests/npm/.eslintrc.json
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
{
"root": true,
"ignorePatterns": ["**/*"],
"plugins": ["@nrwl/nx"],
"plugins": ["@nx"],
"overrides": [
{
"files": ["*.ts", "*.tsx", "*.js", "*.jsx"],
"rules": {
"@nrwl/nx/enforce-module-boundaries": [
"@nx/enforce-module-boundaries": [
"error",
{
"enforceBuildableLibDependency": true,
Expand All @@ -23,12 +23,12 @@
},
{
"files": ["*.ts", "*.tsx"],
"extends": ["plugin:@nrwl/nx/typescript"],
"extends": ["plugin:@nx/typescript"],
"rules": {}
},
{
"files": ["*.js", "*.jsx"],
"extends": ["plugin:@nrwl/nx/javascript"],
"extends": ["plugin:@nx/javascript"],
"rules": {}
}
]
Expand Down
1 change: 1 addition & 0 deletions integration-tests/npm/.prettierignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,4 @@

/dist
/coverage
package-lock.json
10 changes: 5 additions & 5 deletions integration-tests/npm/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,9 @@ These capabilities include generating applications, libraries, etc as well as th
Below are our core plugins:

- [React](https://reactjs.org)
- `npm install --save-dev @nrwl/react`
- `npm install --save-dev @nx/react`
- Web (no framework frontends)
- `npm install --save-dev @nrwl/web`
- `npm install --save-dev @nx/web`
- [Angular](https://angular.io)
- `npm install --save-dev @nrwl/angular`
- [Nest](https://nestjs.com)
Expand All @@ -31,15 +31,15 @@ There are also many [community plugins](https://nx.dev/community) you could add.

## Generate an application

Run `nx g @nrwl/react:app my-app` to generate an application.
Run `nx g @nx/react:app my-app` to generate an application.

> You can use any of the plugins above to generate applications as well.
When using Nx, you can create multiple applications and libraries in the same workspace.

## Generate a library

Run `nx g @nrwl/react:lib my-lib` to generate a library.
Run `nx g @nx/react:lib my-lib` to generate a library.

> You can also use any of the plugins above to generate libraries as well.
Expand All @@ -51,7 +51,7 @@ Run `nx serve my-app` for a dev server. Navigate to http://localhost:4200/. The

## Code scaffolding

Run `nx g @nrwl/react:component my-component --project=my-app` to generate a new component.
Run `nx g @nx/react:component my-component --project=my-app` to generate a new component.

## Build

Expand Down
7 changes: 4 additions & 3 deletions integration-tests/npm/apps/react-app-e2e/project.json
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
{
"root": "apps/react-app-e2e",
"name": "react-app-e2e",
"$schema": "../../node_modules/nx/schemas/project-schema.json",
"sourceRoot": "apps/react-app-e2e/src",
"projectType": "application",
"targets": {
"e2e": {
"executor": "@nrwl/cypress:cypress",
"executor": "@nx/cypress:cypress",
"options": {
"cypressConfig": "apps/react-app-e2e/cypress.json",
"devServerTarget": "react-app:serve:development"
Expand All @@ -16,7 +17,7 @@
}
},
"lint": {
"executor": "@nrwl/linter:eslint",
"executor": "@nx/linter:eslint",
"outputs": ["{options.outputFile}"],
"options": {
"lintFilePatterns": ["apps/react-app-e2e/**/*.{js,ts}"]
Expand Down
2 changes: 1 addition & 1 deletion integration-tests/npm/apps/react-app/.babelrc
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"presets": [
[
"@nrwl/react/babel",
"@nx/react/babel",
{
"runtime": "automatic"
}
Expand Down
2 changes: 1 addition & 1 deletion integration-tests/npm/apps/react-app/.eslintrc.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"extends": ["plugin:@nrwl/nx/react", "../../.eslintrc.json"],
"extends": ["plugin:@nx/react", "../../.eslintrc.json"],
"ignorePatterns": ["!**/*"],
"overrides": [
{
Expand Down
9 changes: 5 additions & 4 deletions integration-tests/npm/apps/react-app/jest.config.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
module.exports = {
/* eslint-disable */
export default {
displayName: 'react-app',
preset: '../../jest.preset.ts',
preset: '../../jest.preset.js',
transform: {
'^(?!.*\\.(js|jsx|ts|tsx|css|json)$)': '@nrwl/react/plugins/jest',
'^.+\\.[tj]sx?$': 'babel-jest',
'^(?!.*\\.(js|jsx|ts|tsx|css|json)$)': '@nx/react/plugins/jest',
'^.+\\.[tj]sx?$': ['babel-jest', { presets: ['@nx/react/babel'] }],
},
moduleFileExtensions: ['ts', 'tsx', 'js', 'jsx'],
coverageDirectory: '../../coverage/apps/react-app',
Expand Down
15 changes: 8 additions & 7 deletions integration-tests/npm/apps/react-app/project.json
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
{
"root": "apps/react-app",
"name": "react-app",
"$schema": "../../node_modules/nx/schemas/project-schema.json",
"sourceRoot": "apps/react-app/src",
"projectType": "application",
"targets": {
"build": {
"executor": "@nrwl/web:webpack",
"executor": "@nx/webpack:webpack",
"outputs": ["{options.outputPath}"],
"defaultConfiguration": "production",
"options": {
Expand All @@ -21,7 +22,7 @@
],
"styles": ["apps/react-app/src/styles.css"],
"scripts": [],
"webpackConfig": "@nrwl/react/plugins/webpack"
"webpackConfig": "@nx/react/plugins/webpack"
},
"configurations": {
"development": {
Expand All @@ -47,7 +48,7 @@
}
},
"serve": {
"executor": "@nrwl/web:dev-server",
"executor": "@nx/webpack:dev-server",
"defaultConfiguration": "development",
"options": {
"buildTarget": "react-app:build",
Expand All @@ -64,15 +65,15 @@
}
},
"lint": {
"executor": "@nrwl/linter:eslint",
"executor": "@nx/linter:eslint",
"outputs": ["{options.outputFile}"],
"options": {
"lintFilePatterns": ["apps/react-app/**/*.{ts,tsx,js,jsx}"]
}
},
"test": {
"executor": "@nrwl/jest:jest",
"outputs": ["coverage/apps/react-app"],
"executor": "@nx/jest:jest",
"outputs": ["{workspaceRoot}/coverage/apps/react-app"],
"options": {
"jestConfig": "apps/react-app/jest.config.ts",
"passWithNoTests": true
Expand Down
4 changes: 2 additions & 2 deletions integration-tests/npm/apps/react-app/tsconfig.app.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@
"types": ["node"]
},
"files": [
"../../node_modules/@nrwl/react/typings/cssmodule.d.ts",
"../../node_modules/@nrwl/react/typings/image.d.ts"
"../../node_modules/@nx/react/typings/cssmodule.d.ts",
"../../node_modules/@nx/react/typings/image.d.ts"
],
"exclude": [
"jest.config.ts",
Expand Down
4 changes: 2 additions & 2 deletions integration-tests/npm/apps/react-app/tsconfig.spec.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
"**/*.d.ts"
],
"files": [
"../../node_modules/@nrwl/react/typings/cssmodule.d.ts",
"../../node_modules/@nrwl/react/typings/image.d.ts"
"../../node_modules/@nx/react/typings/cssmodule.d.ts",
"../../node_modules/@nx/react/typings/image.d.ts"
]
}
4 changes: 2 additions & 2 deletions integration-tests/npm/jest.config.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
const { getJestProjects } = require('@nrwl/jest');
const { getJestProjects } = require('@nx/jest');

module.exports = {
export default {
projects: getJestProjects(),
};
15 changes: 15 additions & 0 deletions integration-tests/npm/jest.preset.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
const nxPreset = require('@nx/jest/preset').default;

module.exports = {
...nxPreset,
/* TODO: Update to latest Jest snapshotFormat
* By default Nx has kept the older style of Jest Snapshot formats
* to prevent breaking of any existing tests with snapshots.
* It's recommend you update to the latest format.
* You can do this by removing snapshotFormat property
* and running tests with --update-snapshot flag.
* Example: "nx affected --targets=test --update-snapshot"
* More info: https://jestjs.io/docs/upgrading-to-jest29#snapshot-format
*/
snapshotFormat: { escapeString: true, printBasicPrototype: true },
};
3 changes: 0 additions & 3 deletions integration-tests/npm/jest.preset.ts

This file was deleted.

Loading

0 comments on commit 310bb52

Please sign in to comment.