Skip to content

Commit

Permalink
using nx/js plugin to manage tsc tasks and deps (#9530)
Browse files Browse the repository at this point in the history
  • Loading branch information
fungairino authored Nov 15, 2024
1 parent 72fa4c2 commit b77b4d9
Show file tree
Hide file tree
Showing 7 changed files with 1,396 additions and 147 deletions.
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"]
}
}
}
2 changes: 2 additions & 0 deletions knip.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,8 @@ const knipConfig = {
ignoreDependencies: [
// Provided for use in IDE. See discussion: https://github.com/pixiebrix/pixiebrix-extension/pull/9503
"prettier",
// Used in local nx development commands (like generators)
"@swc/helpers",
],
},
"libraries/*": {
Expand Down
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"
"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

0 comments on commit b77b4d9

Please sign in to comment.