Skip to content

DRAFT: migrate from wireit to nx #5567

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

Draft
wants to merge 2 commits into
base: main
Choose a base branch
from
Draft
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
13 changes: 13 additions & 0 deletions .env.example
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
# NX settings
NX_PREFER_TS_NODE=true
NX_NATIVE_COMMAND_RUNNER=false
NX_INTERACTIVE=false

# Optional NX settings
NX_VERBOSE_LOGGING=true
NX_SKIP_NX_CACHE=false
NX_PERF_LOGGING=false

# Default dev environment settings
NODE_ENV=development
WATCH_MODE=true
7 changes: 5 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,9 @@ build-storybook.log
tach-results.*
.gitconfig
.env
.nx/workspace-data
.cursor/rules/nx-rules.mdc
.github/instructions/nx.instructions.md

# documentation
documentation/components/searchIndex.json
Expand All @@ -25,7 +28,7 @@ lib
# build artifacts
custom-elements.json

!packages/icons-workflow/bin/build.js
!packages/icons*/bin/build.js
!packages/icons-workflow/src/DefaultIcon.ts

packages/*/src/**/*.css.js
Expand Down Expand Up @@ -61,7 +64,7 @@ tools/**/*.test-vrt.ts
!tools/base/src/version.d.ts

# cache directories
.wireit
.nx/cache
.eslintcache
.stylelintcache

Expand Down
181 changes: 181 additions & 0 deletions nx.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,181 @@
{
"$schema": "./node_modules/nx/schemas/nx-schema.json",
"cli": {
"analytics": false,
"packageManager": "yarn",
"warnings": {
"versionMismatch": true
}
},
"namedInputs": {
"eslint": [
"{workspaceRoot}/.eslintrc.json",
"{workspaceRoot}/.eslintignore",
{ "externalDependencies": ["eslint"] }
],
"prettier": [
"{workspaceRoot}/.prettierrc.yaml",
{ "externalDependencies": ["prettier"] }
],
"stories": ["{projectRoot}/stories/*.js"],
"stylelint": [
"{workspaceRoot}/.stylelintignore",
"{workspaceRoot}/.stylelintrc.json",
{ "externalDependencies": ["stylelint"] }
]
},
"targetDefaults": {
"build": {
"dependsOn": ["setup", "build:ts", "build:types"]
},
"build:css": {
"cache": true,
"executor": "nx:run-commands",
"inputs": [
"{projectRoot}/**/*.css",
"{workspaceRoot}/scripts/build-css.js",
"{workspaceRoot}/scripts/css-tools.js"
],
"options": {
"command": "node ./scripts/build-css.js"
},
"outputs": [
"{projectRoot}/**/*.css.ts",
"{projectRoot}/**/*.css.ts"
]
},
"build:ts": {
"cache": true,
"dependsOn": ["setup"],
"executor": "nx:run-commands",
"inputs": [
"{projectRoot}/**/*.ts",
"!{projectRoot}/**/*.d.ts",
"{workspaceRoot}/scripts/build-ts.js"
],
"options": {
"command": "node ./scripts/build-ts.js"
},
"outputs": [
"{projectRoot}/**/*.js",
"{projectRoot}/**/*.js.map",
"!{projectRoot}/bin/*.js"
]
},
"build:types": {
"cache": true,
"dependsOn": ["setup"],
"executor": "nx:run-commands",
"inputs": ["{projectRoot}/tsconfig.json", "{projectRoot}/**/*.ts"],
"options": {
"command": "tsc --build tsconfig.json --pretty",
"cwd": "{projectRoot}"
},
"outputs": [
"{projectRoot}/**/*.d.ts",
"{projectRoot}/**/tsconfig.tsbuildinfo",
"!{projectRoot}/**/local.d.ts",
"!{projectRoot}/src/version.d.ts"
]
},
"clean": {
"cache": true,
"dependsOn": ["clean:ts"]
},
"clean:ts": {
"cache": true,
"executor": "nx:run-commands",
"options": {
"command": "rimraf {projectRoot}/tsconfig.tsbuildinfo"
}
},
"format": {
"dependsOn": ["format:css", "format:ts", "format:js"]
},
"format:css": {
"executor": "nx:run-commands",
"inputs": [
"{projectRoot}/*.css",
"{projectRoot}/**/*.css",
"stylelint",
"prettier"
],
"options": {
"commands": [
"stylelint --fix --cache --allow-empty-input {projectRoot}/*.css {projectRoot}/**/*.css",
"prettier --cache --no-error-on-unmatched-pattern --ignore-unknown --log-level silent --write {projectRoot}/*.css {projectRoot}/**/*.css"
],
"parallel": false
}
},
"format:js": {
"executor": "nx:run-commands",
"inputs": [
"{projectRoot}/*.js",
"{projectRoot}/**/*.js",
"eslint",
"prettier"
],
"options": {
"commands": [
"eslint --fix --format pretty --cache --no-error-on-unmatched-pattern --quiet {projectRoot}/**/*.js",
"prettier --cache --no-error-on-unmatched-pattern --ignore-unknown --log-level silent --write {projectRoot}/**/*.js"
],
"parallel": false
}
},
"format:ts": {
"executor": "nx:run-commands",
"inputs": [
"{projectRoot}/*.ts",
"{projectRoot}/**/*.ts",
"eslint",
"prettier"
],
"options": {
"commands": [
"eslint --fix --format pretty --cache --no-error-on-unmatched-pattern --quiet {projectRoot}/**/*.ts",
"prettier --cache --no-error-on-unmatched-pattern --ignore-unknown --log-level silent --write {projectRoot}/**/*.ts"
],
"parallel": false
}
},
"lint": {
"dependsOn": ["lint:css", "lint:ts", "lint:js", "lint:lit"]
},
"lint:css": {
"executor": "nx:run-commands",
"inputs": [
"{projectRoot}/*.css",
"{projectRoot}/**/*.css",
"stylelint"
],
"options": {
"command": "stylelint --cache --allow-empty-input {projectRoot}/*.css {projectRoot}/**/*.css || exit 0"
}
},
"lint:js": {
"executor": "nx:run-commands",
"inputs": ["{projectRoot}/*.js", "{projectRoot}/**/*.js", "eslint"],
"options": {
"command": "eslint --format pretty --cache --no-error-on-unmatched-pattern {projectRoot}/**/*.ts || exit 0"
}
},
"lint:lit": {
"executor": "nx:run-commands",
"options": {
"command": "lit-analyzer"
}
},
"lint:ts": {
"executor": "nx:run-commands",
"inputs": ["{projectRoot}/*.ts", "{projectRoot}/**/*.ts", "eslint"],
"options": {
"command": "eslint --format pretty --cache --no-error-on-unmatched-pattern {projectRoot}/**/*.ts || exit 0"
}
},
"setup": {
"dependsOn": ["build:css"]
}
}
}
Loading
Loading