Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Nx agents #20

Open
wants to merge 8 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
29 changes: 29 additions & 0 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
version: 2.1
orbs:
nx: nrwl/[email protected]
jobs:
main:
docker:
- image: cimg/node:lts-browsers
steps:
- checkout
- run: npx nx-cloud start-ci-run --distribute-on="3 linux-medium-js" --stop-agents-after="e2e-ci"
- restore_cache:
key: npm-dependencies-{{ checksum "pnpm-lock.yaml" }}
- run:
name: install dependencies
command: pnpm install --frozen-lockfile
- save_cache:
key: npm-dependencies-{{ checksum "pnpm-lock.yaml" }}
paths:
- node_modules
- ~/.cache/Cypress
- nx/set-shas

- run: pnpm nx affected --base=$NX_BASE --head=$NX_HEAD -t lint test build --parallel=3
- run: pnpm nx affected --base=$NX_BASE --head=$NX_HEAD -t e2e-ci --parallel=1
- run: pnpm nx affected --base=$NX_BASE --head=$NX_HEAD -t deploy --no-agents # run without distribution
workflows:
build:
jobs:
- main
3 changes: 2 additions & 1 deletion .vscode/extensions.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
"ms-vscode.vscode-typescript-tslint-plugin",
"esbenp.prettier-vscode",
"firsttris.vscode-jest-runner",
"dbaeumer.vscode-eslint"
"dbaeumer.vscode-eslint",
"ms-playwright.playwright"
]
}
13 changes: 12 additions & 1 deletion apps/admin-e2e/cypress.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,16 @@ import { defineConfig } from 'cypress';
import { nxE2EPreset } from '@nx/cypress/plugins/cypress-preset';

export default defineConfig({
e2e: nxE2EPreset(__dirname),
e2e: {
...nxE2EPreset(__filename, {
cypressDir: 'src',
bundler: 'vite',
webServerCommands: {
default: 'nx run admin:serve',
production: 'nx run admin:preview',
},
ciWebServerCommand: 'nx run admin:serve-static',
}),
baseUrl: 'http://localhost:4200',
},
});
21 changes: 1 addition & 20 deletions apps/admin-e2e/project.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,28 +4,9 @@
"sourceRoot": "apps/admin-e2e/src",
"projectType": "application",
"targets": {
"e2e": {
"executor": "@nx/cypress:cypress",
"options": {
"cypressConfig": "apps/admin-e2e/cypress.config.ts",
"devServerTarget": "admin:serve-static:development",
"testingType": "e2e"
},
"configurations": {
"production": {
"devServerTarget": "admin:serve-static:production"
},
"ci": {
"devServerTarget": "admin:serve-static-static"
}
}
},
"lint": {
"executor": "@nx/eslint:lint",
"outputs": ["{options.outputFile}"],
"options": {
"lintFilePatterns": ["apps/admin-e2e/**/*.{js,ts}"]
}
"outputs": ["{options.outputFile}"]
}
},
"tags": [],
Expand Down
13 changes: 13 additions & 0 deletions apps/admin-e2e/src/e2e/login.cy.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
import { getGreeting } from '../support/app.po';

describe('admin', () => {
beforeEach(() => cy.visit('/'));

it('should display welcome message', () => {
// Custom command example, see `../support/commands.ts` file
cy.login('[email protected]', 'myPassword');

// Function helper example, see `../support/app.po.ts` file
getGreeting().contains('Welcome admin');
});
});
5 changes: 1 addition & 4 deletions apps/admin/project.json
Original file line number Diff line number Diff line change
Expand Up @@ -63,10 +63,7 @@
},
"lint": {
"executor": "@nx/eslint:lint",
"outputs": ["{options.outputFile}"],
"options": {
"lintFilePatterns": ["apps/admin/**/*.{ts,tsx,js,jsx}"]
}
"outputs": ["{options.outputFile}"]
},
"serve-static": {
"executor": "@nx/web:file-server",
Expand Down
3 changes: 0 additions & 3 deletions apps/cart-e2e/project.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,6 @@
},
"lint": {
"executor": "@nx/eslint:lint",
"options": {
"lintFilePatterns": ["apps/cart-e2e/**/*.{ts,tsx,js,jsx}"]
},
"outputs": ["{options.outputFile}"]
}
},
Expand Down
3 changes: 0 additions & 3 deletions apps/cart/project.json
Original file line number Diff line number Diff line change
Expand Up @@ -93,9 +93,6 @@
},
"lint": {
"executor": "@nx/eslint:lint",
"options": {
"lintFilePatterns": ["apps/cart/**/*.{ts,tsx,js,jsx}"]
},
"outputs": ["{options.outputFile}"]
},
"test": {
Expand Down
5 changes: 1 addition & 4 deletions apps/landing-page-e2e/project.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,10 +22,7 @@
},
"lint": {
"executor": "@nx/eslint:lint",
"outputs": ["{options.outputFile}"],
"options": {
"lintFilePatterns": ["apps/landing-page-e2e/**/*.{js,ts}"]
}
"outputs": ["{options.outputFile}"]
}
},
"tags": [],
Expand Down
5 changes: 1 addition & 4 deletions apps/landing-page/project.json
Original file line number Diff line number Diff line change
Expand Up @@ -72,10 +72,7 @@
},
"lint": {
"executor": "@nx/eslint:lint",
"outputs": ["{options.outputFile}"],
"options": {
"lintFilePatterns": ["apps/landing-page/**/*.{ts,tsx,js,jsx}"]
}
"outputs": ["{options.outputFile}"]
},
"test": {
"executor": "@nx/jest:jest",
Expand Down
6 changes: 0 additions & 6 deletions libs/cart/cart-page/project.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,6 @@
"targets": {
"lint": {
"executor": "@nx/eslint:lint",
"options": {
"lintFilePatterns": [
"libs/cart/cart-page/src/**/*.ts",
"libs/cart/cart-page/src/**/*.html"
]
},
"outputs": ["{options.outputFile}"]
},
"test": {
Expand Down
3 changes: 2 additions & 1 deletion libs/shared/assets/project.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,6 @@
"$schema": "../../../node_modules/nx/schemas/project-schema.json",
"sourceRoot": "libs/shared/assets/src",
"projectType": "library",
"tags": ["type:assets", "scope:shared"]
"tags": ["type:assets", "scope:shared"],
"targets": {}
}
9 changes: 1 addition & 8 deletions libs/shared/cart/state/project.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,6 @@
"targets": {
"lint": {
"executor": "@nx/eslint:lint",
"options": {
"lintFilePatterns": [
"libs/shared/cart/state/src/**/*.ts",
"libs/shared/cart/state/src/**/*.html"
]
},
"outputs": ["{options.outputFile}"]
},
"test": {
Expand All @@ -23,7 +17,6 @@
"outputs": ["{workspaceRoot}/coverage/libs/shared/cart/state"]
}
},
"generators": {
},
"generators": {},
"tags": ["scope:shared", "type:state"]
}
6 changes: 0 additions & 6 deletions libs/shared/e2e-utils/project.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,6 @@
"targets": {
"lint": {
"executor": "@nx/eslint:lint",
"options": {
"lintFilePatterns": [
"libs/shared/e2e-utils/src/**/*.ts",
"libs/shared/e2e-utils/src/**/*.html"
]
},
"outputs": ["{options.outputFile}"]
}
},
Expand Down
6 changes: 0 additions & 6 deletions libs/shared/header/project.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,6 @@
"targets": {
"lint": {
"executor": "@nx/eslint:lint",
"options": {
"lintFilePatterns": [
"libs/shared/header/src/**/*.ts",
"libs/shared/header/src/**/*.html"
]
},
"outputs": ["{options.outputFile}"]
},
"test": {
Expand Down
6 changes: 0 additions & 6 deletions libs/shared/product/data/project.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,6 @@
"targets": {
"lint": {
"executor": "@nx/eslint:lint",
"options": {
"lintFilePatterns": [
"libs/shared/product/data/src/**/*.ts",
"libs/shared/product/data/src/**/*.html"
]
},
"outputs": ["{options.outputFile}"]
}
},
Expand Down
6 changes: 0 additions & 6 deletions libs/shared/product/state/project.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,6 @@
"targets": {
"lint": {
"executor": "@nx/eslint:lint",
"options": {
"lintFilePatterns": [
"libs/shared/product/state/src/**/*.ts",
"libs/shared/product/state/src/**/*.html"
]
},
"outputs": ["{options.outputFile}"]
},
"test": {
Expand Down
6 changes: 0 additions & 6 deletions libs/shared/product/types/project.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,6 @@
"targets": {
"lint": {
"executor": "@nx/eslint:lint",
"options": {
"lintFilePatterns": [
"libs/shared/product/types/src/**/*.ts",
"libs/shared/product/types/src/**/*.html"
]
},
"outputs": ["{options.outputFile}"]
},
"build": {
Expand Down
6 changes: 0 additions & 6 deletions libs/shared/product/ui/project.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,6 @@
"targets": {
"lint": {
"executor": "@nx/eslint:lint",
"options": {
"lintFilePatterns": [
"libs/shared/product/ui/src/**/*.ts",
"libs/shared/product/ui/src/**/*.html"
]
},
"outputs": ["{options.outputFile}"]
},
"test": {
Expand Down
56 changes: 56 additions & 0 deletions migrations.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
{
"migrations": [
{
"cli": "nx",
"version": "17.3.0-beta.6",
"description": "Updates the nx wrapper.",
"implementation": "./src/migrations/update-17-3-0/update-nxw",
"package": "nx",
"name": "17.3.0-update-nx-wrapper"
},
{
"version": "17.2.0-beta.0",
"description": "Simplify eslintFilePatterns",
"implementation": "./src/migrations/update-17-2-0/simplify-eslint-patterns",
"package": "@nx/eslint",
"name": "simplify-eslint-patterns"
},
{
"version": "17.2.9",
"description": "Move executor options to target defaults",
"implementation": "./src/migrations/update-17-2-9/move-options-to-target-defaults",
"package": "@nx/eslint",
"name": "move-options-to-target-defaults"
},
{
"version": "17.2.0-beta.10",
"description": "Update vite config.",
"implementation": "./src/migrations/update-17-2-0/update-vite-config",
"package": "@nx/vite",
"name": "update-vite-config"
},
{
"version": "17.3.0-beta.0",
"description": "Move the vitest coverage thresholds in their own object if exists and add reporters.",
"implementation": "./src/migrations/update-17-3-0/vitest-coverage-and-reporters",
"package": "@nx/vite",
"name": "vitest-coverage-and-reporters"
},
{
"cli": "nx",
"version": "18.0.0-beta.0",
"description": "Add NX_MF_DEV_SERVER_STATIC_REMOTES to inputs for task hashing when '@nx/webpack:webpack' is used for Module Federation.",
"factory": "./src/migrations/update-18-0-0/add-mf-env-var-to-target-defaults",
"package": "@nx/react",
"name": "add-module-federation-env-var-to-target-defaults"
},
{
"cli": "nx",
"version": "17.2.1-beta.0",
"description": "Add webpack.config.js file when webpackConfig is not defined",
"implementation": "./src/migrations/update-17-2-1/webpack-config-setup",
"package": "@nx/webpack",
"name": "update-17-2-1-webpack-config-setup"
}
]
}
Loading