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

using nx/js plugin to manage tsc tasks and deps #9530

Merged
merged 6 commits into from
Nov 15, 2024
Merged
Show file tree
Hide file tree
Changes from 2 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
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -151,7 +151,7 @@ jobs:
node-version-file: applications/browser-extension/package.json
cache: npm
- run: npm ci
- run: npm run build:typecheck
- run: npm run typecheck

lint:
runs-on: ubuntu-latest
Expand Down
9 changes: 9 additions & 0 deletions applications/browser-extension/project.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
{
"targets": {
"build": {
"outputs": ["{workspaceRoot}/dist"],
"cache": true,
"dependsOn": ["^build"]
}
}
Comment on lines +2 to +8
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is here to tell nx to cache the extension project's build task (since it overrides the workspace one provided by the nx/js plugin)

}
4 changes: 1 addition & 3 deletions libraries/util-debug/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,7 @@
"test": "TZ=UTC jest",
"test:ci": "TZ=UTC jest",
"lint": "eslint src --ext js,jsx,ts,tsx --quiet --report-unused-disable-directives",
"lint:fast": "ESLINT_NO_IMPORTS=1 eslint src --ext js,jsx,ts,tsx --quiet",
"build": "tsc --build",
"build:typecheck": "tsc --build"
Comment on lines -10 to -11
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

these two are now provided by the "nx/js" plugin

"lint:fast": "ESLINT_NO_IMPORTS=1 eslint src --ext js,jsx,ts,tsx --quiet"
},
"main": "./dist/index.js",
"typings": "./dist/index.d.ts",
Expand Down
31 changes: 18 additions & 13 deletions nx.json
Original file line number Diff line number Diff line change
@@ -1,28 +1,33 @@
{
"$schema": "./node_modules/nx/schemas/nx-schema.json",
"targetDefaults": {
"build": {
"dependsOn": ["^build"],
"outputs": ["{workspaceRoot}/dist"],
"cache": true
},
"test": {
"dependsOn": ["^build:typecheck"],
"dependsOn": ["typecheck"],
"cache": true
},
"test:ci": {
"dependsOn": ["^build:typecheck"],
"dependsOn": ["typecheck"],
"cache": true
},
"lint": {
"dependsOn": ["^build:typecheck"],
"cache": true
},
"build:typecheck": {
"dependsOn": ["^build:typecheck"],
"dependsOn": ["typecheck"],
"cache": true
}
},
"defaultBase": "main",
"defaultProject": "@pixiebrix/extension"
"defaultProject": "@pixiebrix/extension",
"plugins": [
{
"plugin": "@nx/js/typescript",
"options": {
"typecheck": {
"targetName": "typecheck"
},
"build": {
"targetName": "build",
"configName": "tsconfig.lib.json"
}
}
}
]
}
Loading
Loading