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

chore: update Nx #5

Merged
merged 2 commits into from
Aug 6, 2024
Merged
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
10 changes: 8 additions & 2 deletions .eslintrc.json
Original file line number Diff line number Diff line change
Expand Up @@ -29,12 +29,18 @@
{
"files": ["*.ts", "*.tsx"],
"extends": ["plugin:@nx/typescript"],
"rules": {}
"rules": {
"@typescript-eslint/no-extra-semi": "error",
"no-extra-semi": "off"
}
},
{
"files": ["*.js", "*.jsx"],
"extends": ["plugin:@nx/javascript"],
"rules": {}
"rules": {
"@typescript-eslint/no-extra-semi": "error",
"no-extra-semi": "off"
}
},
{
"files": ["*.spec.ts", "*.spec.tsx", "*.spec.js", "*.spec.jsx"],
Expand Down
47 changes: 26 additions & 21 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,24 +13,29 @@ permissions:

jobs:
main:
name: Nx Cloud - Main Job
uses: nrwl/ci/.github/workflows/nx-cloud-main.yml@v0.14.0
with:
node-version: 20.10.0
main-branch-name: main
number-of-agents: 3
init-commands: |
pnpm exec nx-cloud start-ci-run --stop-agents-after="build" --agent-count=3
parallel-commands: |
pnpm exec nx-cloud record -- pnpm exec nx format:check
parallel-commands-on-agents: |
pnpm exec nx affected --target=lint --parallel=3
pnpm exec nx affected --target=test --parallel=3 --ci --code-coverage
pnpm exec nx affected --target=build --parallel=3

agents:
name: Nx Cloud - Agents
uses: nrwl/ci/.github/workflows/nx-cloud-agents.yml@v0.14.0
with:
node-version: 20.10.0
number-of-agents: 3
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0

- uses: pnpm/action-setup@v4

# This enables task distribution via Nx Cloud
# Run this command as early as possible, before dependencies are installed
# Learn more at https://nx.dev/ci/reference/nx-cloud-cli#npx-nxcloud-startcirun
- run: pnpm dlx nx-cloud start-ci-run --distribute-on="3 linux-medium-js" --stop-agents-after="build"

# Cache node_modules
- uses: actions/setup-node@v4
with:
node-version: 20
cache: 'pnpm'

- run: pnpm install --frozen-lockfile
- uses: nrwl/nx-set-shas@v4

# Prepend any command with "nx-cloud record --" to record its logs to Nx Cloud
# - run: pnpm exec nx-cloud record -- echo Hello World
# Nx Affected runs only tasks affected by the changes in this PR/commit. Learn more: https://nx.dev/ci/features/affected
- run: pnpm exec nx affected -t lint test build
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -39,4 +39,5 @@ testem.log
Thumbs.db

.nx/cache
.nx/workspace-data
nx-cloud.env
2 changes: 2 additions & 0 deletions .prettierignore
Original file line number Diff line number Diff line change
Expand Up @@ -7,3 +7,5 @@ tmp
/.nx/cache

pnpm-lock.yaml

/.nx/workspace-data
7 changes: 3 additions & 4 deletions apps/web/project.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
"$schema": "../../node_modules/nx/schemas/project-schema.json",
"sourceRoot": "apps/web/src",
"projectType": "application",
"tags": [],
"targets": {
"build": {
"executor": "@nx/webpack:webpack",
Expand Down Expand Up @@ -64,8 +65,7 @@
}
},
"lint": {
"executor": "@nx/eslint:lint",
"outputs": ["{options.outputFile}"]
"executor": "@nx/eslint:lint"
},
"test": {
"executor": "@nx/jest:jest",
Expand All @@ -74,6 +74,5 @@
"jestConfig": "apps/web/jest.config.ts"
}
}
},
"tags": []
}
}
22 changes: 10 additions & 12 deletions nx.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,18 +6,6 @@
"dependsOn": ["^build"],
"inputs": ["production", "^production"]
},
"lint": {
"cache": true,
"inputs": [
"default",
"{workspaceRoot}/.eslintrc.json",
"{workspaceRoot}/.eslintignore",
"{workspaceRoot}/eslint.config.js"
]
},
"e2e": {
"cache": true
},
"@nx/jest:jest": {
"cache": true,
"inputs": ["default", "^production", "{workspaceRoot}/jest.preset.js"],
Expand All @@ -30,6 +18,15 @@
"codeCoverage": true
}
}
},
"@nx/eslint:lint": {
"cache": true,
"inputs": [
"default",
"{workspaceRoot}/.eslintrc.json",
"{workspaceRoot}/.eslintignore",
"{workspaceRoot}/eslint.config.js"
]
}
},
"namedInputs": {
Expand Down Expand Up @@ -64,5 +61,6 @@
}
}
},
"useInferencePlugins": false,
"nxCloudAccessToken": "NDVmNWIyZjMtODIxNi00ZDFjLTg5OGUtMTcyM2Y1MWRmY2I5fHJlYWQ="
}
60 changes: 30 additions & 30 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
"sync-schemas": "ts-node ./tools/scripts/sync-schemas.ts"
},
"private": true,
"packageManager": "pnpm@8.14.0",
"packageManager": "pnpm@9.6.0+sha256.dae0f7e822c56b20979bb5965e3b73b8bdabb6b8b8ef121da6d857508599ca35",
"dependencies": {
"@beeman/preset-anchor": "^2.0.0",
"@coral-xyz/anchor": "^0.29.0",
Expand All @@ -23,57 +23,57 @@
"@mantine/modals": "^7.4.1",
"@mantine/notifications": "^7.4.1",
"@mantine/spotlight": "^7.4.1",
"@nx/devkit": "17.2.8",
"@nx/devkit": "19.5.6",
"@pubkeyapp/wallet-adapter-mantine-ui": "^2.3.0",
"@solana/spl-token": "^0.3.11",
"@solana/wallet-adapter-base": "^0.9.23",
"@solana/wallet-adapter-react": "^0.15.35",
"@solana/wallet-adapter-react-ui": "^0.9.34",
"@solana/wallet-adapter-solflare": "^0.6.28",
"@solana/web3.js": "^1.88.0",
"@swc/helpers": "~0.5.3",
"@swc/helpers": "0.5.12",
"@tabler/icons-react": "^2.45.0",
"@tanstack/react-query": "^5.17.9",
"clsx": "^2.1.0",
"core-js": "^3.35.0",
"core-js": "3.36.1",
"create-nx-workspace": "17.2.8",
"dayjs": "^1.11.10",
"jotai": "^2.6.1",
"react": "18.2.0",
"react-dom": "18.2.0",
"react": "18.3.1",
"react-dom": "18.3.1",
"react-router-dom": "^6.21.1",
"timeago-react": "^3.0.6",
"tslib": "^2.6.2"
},
"devDependencies": {
"@babel/core": "^7.23.7",
"@babel/preset-react": "^7.23.3",
"@nx/eslint": "17.2.8",
"@nx/eslint-plugin": "17.2.8",
"@nx/jest": "17.2.8",
"@nx/js": "17.2.8",
"@nx/plugin": "17.2.8",
"@nx/react": "17.2.8",
"@nx/rollup": "17.2.8",
"@nx/webpack": "17.2.8",
"@nx/workspace": "17.2.8",
"@nx/eslint": "19.5.6",
"@nx/eslint-plugin": "19.5.6",
"@nx/jest": "19.5.6",
"@nx/js": "19.5.6",
"@nx/plugin": "19.5.6",
"@nx/react": "19.5.6",
"@nx/rollup": "19.5.6",
"@nx/webpack": "19.5.6",
"@nx/workspace": "19.5.6",
"@pmmmwh/react-refresh-webpack-plugin": "^0.5.11",
"@rollup/plugin-url": "^8.0.2",
"@svgr/rollup": "^8.1.0",
"@rollup/plugin-url": "8.0.2",
"@svgr/rollup": "8.1.0",
"@svgr/webpack": "^8.1.0",
"@swc-node/register": "~1.6.8",
"@swc/cli": "~0.1.63",
"@swc/core": "~1.3.102",
"@testing-library/react": "14.1.2",
"@swc-node/register": "1.9.2",
"@swc/cli": "0.3.14",
"@swc/core": "1.5.7",
"@testing-library/react": "15.0.6",
"@types/jest": "^29.5.11",
"@types/node": "20.10.8",
"@types/react": "18.2.47",
"@types/react-dom": "18.2.18",
"@typescript-eslint/eslint-plugin": "^6.18.1",
"@typescript-eslint/parser": "^6.18.1",
"@types/node": "18.19.9",
"@types/react": "18.3.1",
"@types/react-dom": "18.3.0",
"@typescript-eslint/eslint-plugin": "7.18.0",
"@typescript-eslint/parser": "7.18.0",
"babel-jest": "^29.7.0",
"commander": "^11.1.0",
"eslint": "8.56.0",
"eslint": "8.57.0",
"eslint-config-prettier": "^9.1.0",
"eslint-plugin-import": "2.29.1",
"eslint-plugin-jsx-a11y": "6.8.0",
Expand All @@ -84,15 +84,15 @@
"jest-environment-jsdom": "^29.7.0",
"json-schema-to-typescript": "^13.1.1",
"lint-staged": "^15.2.0",
"nx": "17.2.8",
"postcss": "^8.4.33",
"nx": "19.5.6",
"postcss": "8.4.38",
"postcss-preset-mantine": "^1.12.3",
"postcss-simple-vars": "^7.0.1",
"prettier": "^2.6.2",
"react-refresh": "^0.14.0",
"ts-jest": "^29.1.1",
"ts-node": "10.9.2",
"typescript": "~5.3.3",
"typescript": "5.5.4",
"url-loader": "^4.1.1",
"verdaccio": "^5.29.0"
},
Expand Down
3 changes: 1 addition & 2 deletions packages/core/project.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,7 @@
"tags": [],
"targets": {
"lint": {
"executor": "@nx/eslint:lint",
"outputs": ["{options.outputFile}"]
"executor": "@nx/eslint:lint"
},
"build": {
"executor": "@nx/rollup:rollup",
Expand Down
9 changes: 4 additions & 5 deletions packages/create-pubkey-ui-app/project.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@
"$schema": "../../node_modules/nx/schemas/project-schema.json",
"sourceRoot": "packages/create-pubkey-ui-app/bin",
"projectType": "library",
"tags": [],
"implicitDependencies": ["generators"],
"targets": {
"build": {
"executor": "@nx/js:tsc",
Expand All @@ -19,8 +21,7 @@
"dependsOn": ["build"]
},
"lint": {
"executor": "@nx/eslint:lint",
"outputs": ["{options.outputFile}"]
"executor": "@nx/eslint:lint"
},
"test": {
"executor": "@nx/jest:jest",
Expand All @@ -29,7 +30,5 @@
"jestConfig": "packages/create-pubkey-ui-app/jest.config.ts"
}
}
},
"tags": [],
"implicitDependencies": ["generators"]
}
}
7 changes: 3 additions & 4 deletions packages/generators-e2e/project.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
"$schema": "../../node_modules/nx/schemas/project-schema.json",
"projectType": "application",
"sourceRoot": "packages/generators-e2e/src",
"implicitDependencies": ["generators"],
"targets": {
"e2e": {
"executor": "@nx/jest:jest",
Expand All @@ -14,9 +15,7 @@
"dependsOn": ["^build"]
},
"lint": {
"executor": "@nx/eslint:lint",
"outputs": ["{options.outputFile}"]
"executor": "@nx/eslint:lint"
}
},
"implicitDependencies": ["generators"]
}
}
2 changes: 2 additions & 0 deletions packages/generators/jest.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,6 @@ export default {
transformIgnorePatterns: ['node_modules/(?!.*\\.d.ts$)'],
moduleFileExtensions: ['ts', 'js', 'html'],
coverageDirectory: '../../coverage/packages/generators',
testEnvironment: 'node',
testTimeout: 30000,
}
8 changes: 4 additions & 4 deletions packages/generators/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,12 @@
"name": "@pubkey-ui/generators",
"version": "0.0.1",
"dependencies": {
"@nx/devkit": "17.2.8",
"tslib": "^2.3.0",
"@nx/js": "17.2.8",
"@nx/react": "17.2.8",
"@nx/react": "19.5.6",
"@nx/devkit": "19.5.6",
"@nx/js": "19.5.6",
"@beeman/preset-anchor": "2.0.0",
"@nx/eslint": "17.2.8"
"@nx/eslint": "19.5.6"
},
"type": "commonjs",
"main": "./src/index.js",
Expand Down
7 changes: 3 additions & 4 deletions packages/generators/project.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
"$schema": "../../node_modules/nx/schemas/project-schema.json",
"sourceRoot": "packages/generators/src",
"projectType": "library",
"tags": [],
"targets": {
"build": {
"executor": "@nx/js:tsc",
Expand Down Expand Up @@ -41,8 +42,7 @@
"dependsOn": ["build"]
},
"lint": {
"executor": "@nx/eslint:lint",
"outputs": ["{options.outputFile}"]
"executor": "@nx/eslint:lint"
},
"test": {
"executor": "@nx/jest:jest",
Expand All @@ -51,6 +51,5 @@
"jestConfig": "packages/generators/jest.config.ts"
}
}
},
"tags": []
}
}
Loading