Skip to content

Commit

Permalink
feat: migrate scripts to use wireit for improved build process
Browse files Browse the repository at this point in the history
  • Loading branch information
arashagp committed Dec 29, 2024
1 parent e1561da commit 7260708
Show file tree
Hide file tree
Showing 2 changed files with 108 additions and 34 deletions.
84 changes: 64 additions & 20 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,26 +13,15 @@
"packages/*"
],
"scripts": {
"b": "yarn run build",
"build": "lerna run build",
"c": "yarn run clean",
"cb": "yarn run clean && yarn run build",
"clean": "git add -v . && git clean -d -x -f --exclude=node_modules --exclude='*.env' --exclude=_data --exclude='.pnp*' --exclude=.yarn",
"f": "yarn run format",
"format": "yarn run format:prettier && yarn run format:eslint",
"format:eslint": "yarn run lint:es --fix",
"format:prettier": "prettier . --ignore-path .prettierignore --write",
"l": "yarn run lint",
"lint": "yarn run lint:es & yarn run lint:ts",
"lint:es": "eslint . --config .eslintrc.json --ext .ts --ext .js --ext .cjs --ext .mjs --ignore-path .prettierignore",
"lint:ts": "lerna run build:ts",
"publish": "lerna publish from-package",
"pull": "git pull",
"release": "lerna version",
"rl": "yarn run pull && yarn run clean && yarn run build && yarn run test && yarn run release",
"t": "yarn run test",
"test": "lerna run test",
"upd": "yarn set version latest; yarn up '*'; yarn up '*' -R; yarn dlx @yarnpkg/sdks vscode; yarn dedupe"
"build": "wireit",
"clean": "wireit",
"format": "wireit",
"lint": "wireit",
"lint:es": "wireit",
"publish": "wireit",
"release": "wireit",
"test": "wireit",
"upd": "yarn set version latest && yarn up '*' && yarn up '*' -R && yarn dlx @yarnpkg/sdks vscode && yarn dedupe"
},
"devDependencies": {
"@lerna-lite/changed": "^3.10.1",
Expand Down Expand Up @@ -68,5 +57,60 @@
"engines": {
"node": ">=18.16.0",
"yarn": ">=4.0.0"
},
"wireit": {
"build": {
"command": "lerna run build"
},
"clean": {
"command": "git add -v . && git clean -d -x -f --exclude=node_modules --exclude='*.env' --exclude=_data --exclude='.pnp*' --exclude=.yarn"
},
"format": {
"dependencies": [
"format:eslint"
]
},
"format:eslint": {
"command": "yarn run lint:es -- --fix",
"dependencies": [
"format:prettier"
]
},
"format:prettier": {
"command": "prettier . --ignore-path .prettierignore --write"
},
"lint": {
"dependencies": [
"lint:es",
"lint:ts"
]
},
"lint:es": {
"command": "eslint . --config .eslintrc.json --ext .ts --ext .js --ext .cjs --ext .mjs --ignore-path .prettierignore --cache-location .eslintcache --cache --color"
},
"lint:ts": {
"command": "tsc --build"
},
"publish": {
"command": "lerna publish from-package"
},
"release": {
"command": "gh workflow list --json id,name,path | jq -r '.[] | select(.path == \".github/workflows/release.yaml\") | .id' | xargs -r gh workflow run",
"dependencies": [
"push"
]
},
"pull": {
"command": "git pull -v"
},
"push": {
"command": "git push -v",
"dependencies": [
"pull"
]
},
"test": {
"command": "lerna run test"
}
}
}
58 changes: 44 additions & 14 deletions packages/snackbar/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -41,20 +41,9 @@
"!demo/**/*"
],
"scripts": {
"b": "yarn run build",
"build": "yarn run build:ts && yarn run build:es",
"build:es": "nano-build --preset=module",
"build:ts": "tsc --build",
"c": "yarn run clean",
"cb": "yarn run clean && yarn run build",
"clean": "rm -rfv dist *.tsbuildinfo",
"d": "yarn run build:es && yarn node --enable-source-maps --trace-warnings",
"t": "yarn run test",
"test": "NODE_OPTIONS=\"$NODE_OPTIONS --enable-source-maps --experimental-vm-modules\" ava",
"w": "yarn run watch",
"watch": "yarn run watch:ts & yarn run watch:es",
"watch:es": "yarn run build:es --watch",
"watch:ts": "yarn run build:ts --watch --preserveWatchOutput"
"build": "wireit",
"test": "wireit",
"watch": "wireit"
},
"dependencies": {
"@alwatr/flux": "^4.0.2",
Expand All @@ -74,5 +63,46 @@
},
"publishConfig": {
"access": "public"
},
"wireit": {
"test": {
"command": "NODE_OPTIONS=\"$NODE_OPTIONS --enable-source-maps --experimental-vm-modules\" ava"
},
"build": {
"dependencies": [
"build:type",
"build:es"
]
},
"build:es": {
"command": "nano-build --preset=module",
"files": [
"src",
"tsconfig.json"
],
"clean": "if-file-deleted",
"output": [
"dist/es",
"tsconfig.tsbuildinfo"
]
},
"build:type": {
"command": "tsc --build"
},
"watch": {
"dependencies": [
"watch:ts"
]
},
"watch:ts": {
"command": "tsc --build --watch --preserveWatchOutput",
"dependencies": [
"watch:es"
]
},
"watch:es": {
"command": "nano-build --preset=module -- --watch",
"service": true
}
}
}

0 comments on commit 7260708

Please sign in to comment.