From 1d48a87433f916ca70c8436094600b91466da5b4 Mon Sep 17 00:00:00 2001 From: arashagp Date: Sun, 29 Dec 2024 12:31:24 +0330 Subject: [PATCH 1/3] feat: migrate scripts to use wireit for improved build process --- .gitignore | 2 + package.json | 87 ++++++-- packages/snackbar/package.json | 61 ++++-- yarn.lock | 368 ++++++++++++++++++++++++++++++++- 4 files changed, 473 insertions(+), 45 deletions(-) diff --git a/.gitignore b/.gitignore index 90b1523..5dfd506 100644 --- a/.gitignore +++ b/.gitignore @@ -38,3 +38,5 @@ dist .env .tmp + +.wireit diff --git a/package.json b/package.json index 5ccb880..15a03c8 100644 --- a/package.json +++ b/package.json @@ -16,26 +16,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", @@ -60,7 +49,8 @@ "prettier": "^3.4.2", "prettier-plugin-packagejson": "^2.5.6", "prettier-plugin-tailwindcss": "^0.6.9", - "typescript": "^5.6.3" + "typescript": "^5.6.3", + "wireit": "^0.14.9" }, "dependenciesMeta": { "prettier-plugin-tailwindcss@0.6.9": { @@ -71,5 +61,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" + } } } diff --git a/packages/snackbar/package.json b/packages/snackbar/package.json index 64f374e..cb7aed0 100644 --- a/packages/snackbar/package.json +++ b/packages/snackbar/package.json @@ -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", @@ -70,9 +59,51 @@ "@alwatr/type-helper": "^5.0.0", "@nexim/typescript-config": "^1.0.1", "ava": "^6.2.0", - "typescript": "^5.6.3" + "typescript": "^5.6.3", + "wireit": "^0.14.9" }, "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 + } } } diff --git a/yarn.lock b/yarn.lock index 777e617..d70a63a 100644 --- a/yarn.lock +++ b/yarn.lock @@ -710,6 +710,15 @@ __metadata: languageName: node linkType: hard +"@isaacs/fs-minipass@npm:^4.0.0": + version: 4.0.1 + resolution: "@isaacs/fs-minipass@npm:4.0.1" + dependencies: + minipass: "npm:^7.0.4" + checksum: 10c0/c25b6dc1598790d5b55c0947a9b7d111cfa92594db5296c3b907e2f533c033666f692a3939eadac17b1c7c40d362d0b0635dc874cbfe3e70db7c2b07cc97a5d2 + languageName: node + linkType: hard + "@isaacs/string-locale-compare@npm:^1.1.0": version: 1.1.0 resolution: "@isaacs/string-locale-compare@npm:1.1.0" @@ -1061,6 +1070,7 @@ __metadata: ava: "npm:^6.2.0" lit: "npm:^3.2.1" typescript: "npm:^5.6.3" + wireit: "npm:^0.14.9" languageName: unknown linkType: soft @@ -1118,6 +1128,19 @@ __metadata: languageName: node linkType: hard +"@npmcli/agent@npm:^3.0.0": + version: 3.0.0 + resolution: "@npmcli/agent@npm:3.0.0" + dependencies: + agent-base: "npm:^7.1.0" + http-proxy-agent: "npm:^7.0.0" + https-proxy-agent: "npm:^7.0.1" + lru-cache: "npm:^10.0.1" + socks-proxy-agent: "npm:^8.0.3" + checksum: 10c0/efe37b982f30740ee77696a80c196912c274ecd2cb243bc6ae7053a50c733ce0f6c09fda085145f33ecf453be19654acca74b69e81eaad4c90f00ccffe2f9271 + languageName: node + linkType: hard + "@npmcli/arborist@npm:^7.5.4": version: 7.5.4 resolution: "@npmcli/arborist@npm:7.5.4" @@ -1172,6 +1195,15 @@ __metadata: languageName: node linkType: hard +"@npmcli/fs@npm:^4.0.0": + version: 4.0.0 + resolution: "@npmcli/fs@npm:4.0.0" + dependencies: + semver: "npm:^7.3.5" + checksum: 10c0/c90935d5ce670c87b6b14fab04a965a3b8137e585f8b2a6257263bd7f97756dd736cb165bb470e5156a9e718ecd99413dccc54b1138c1a46d6ec7cf325982fe5 + languageName: node + linkType: hard + "@npmcli/git@npm:^5.0.0": version: 5.0.8 resolution: "@npmcli/git@npm:5.0.8" @@ -1887,6 +1919,16 @@ __metadata: languageName: node linkType: hard +"anymatch@npm:~3.1.2": + version: 3.1.3 + resolution: "anymatch@npm:3.1.3" + dependencies: + normalize-path: "npm:^3.0.0" + picomatch: "npm:^2.0.4" + checksum: 10c0/57b06ae984bc32a0d22592c87384cd88fe4511b1dd7581497831c56d41939c8a001b28e7b853e1450f2bf61992dfcaa8ae2d0d161a0a90c4fb631ef07098fbac + languageName: node + linkType: hard + "aproba@npm:^1.0.3 || ^2.0.0, aproba@npm:^2.0.0": version: 2.0.0 resolution: "aproba@npm:2.0.0" @@ -2125,6 +2167,13 @@ __metadata: languageName: node linkType: hard +"balanced-match@npm:^3.0.0": + version: 3.0.1 + resolution: "balanced-match@npm:3.0.1" + checksum: 10c0/ac8dd63a5b260610c2cbda982f436e964c1b9ae8764d368a523769da40a31710abd6e19f0fdf1773c4ad7b2ea7ba7b285d547375dc723f6e754369835afc8e9f + languageName: node + linkType: hard + "before-after-hook@npm:^3.0.2": version: 3.0.2 resolution: "before-after-hook@npm:3.0.2" @@ -2144,6 +2193,13 @@ __metadata: languageName: node linkType: hard +"binary-extensions@npm:^2.0.0": + version: 2.3.0 + resolution: "binary-extensions@npm:2.3.0" + checksum: 10c0/75a59cafc10fb12a11d510e77110c6c7ae3f4ca22463d52487709ca7f18f69d886aa387557cc9864fbdb10153d0bdb4caacabf11541f55e89ed6e18d12ece2b5 + languageName: node + linkType: hard + "bindings@npm:^1.4.0": version: 1.5.0 resolution: "bindings@npm:1.5.0" @@ -2179,7 +2235,16 @@ __metadata: languageName: node linkType: hard -"braces@npm:^3.0.3": +"brace-expansion@npm:^4.0.0": + version: 4.0.0 + resolution: "brace-expansion@npm:4.0.0" + dependencies: + balanced-match: "npm:^3.0.0" + checksum: 10c0/6da74748109c4b23e63a1d6bf3a83ba55ba406ac9de1f2afd0c8a6e8630b086e0424b5134e1339e1d379cd0ab235942d3a93b8c54cac944a5205d4f7255eb067 + languageName: node + linkType: hard + +"braces@npm:^3.0.3, braces@npm:~3.0.2": version: 3.0.3 resolution: "braces@npm:3.0.3" dependencies: @@ -2220,6 +2285,26 @@ __metadata: languageName: node linkType: hard +"cacache@npm:^19.0.1": + version: 19.0.1 + resolution: "cacache@npm:19.0.1" + dependencies: + "@npmcli/fs": "npm:^4.0.0" + fs-minipass: "npm:^3.0.0" + glob: "npm:^10.2.2" + lru-cache: "npm:^10.0.1" + minipass: "npm:^7.0.3" + minipass-collect: "npm:^2.0.1" + minipass-flush: "npm:^1.0.5" + minipass-pipeline: "npm:^1.2.4" + p-map: "npm:^7.0.2" + ssri: "npm:^12.0.0" + tar: "npm:^7.4.3" + unique-filename: "npm:^4.0.0" + checksum: 10c0/01f2134e1bd7d3ab68be851df96c8d63b492b1853b67f2eecb2c37bb682d37cb70bb858a16f2f0554d3c0071be6dfe21456a1ff6fa4b7eed996570d6a25ffe9c + languageName: node + linkType: hard + "call-bind-apply-helpers@npm:^1.0.0": version: 1.0.1 resolution: "call-bind-apply-helpers@npm:1.0.1" @@ -2282,6 +2367,25 @@ __metadata: languageName: node linkType: hard +"chokidar@npm:^3.5.3": + version: 3.6.0 + resolution: "chokidar@npm:3.6.0" + dependencies: + anymatch: "npm:~3.1.2" + braces: "npm:~3.0.2" + fsevents: "npm:~2.3.2" + glob-parent: "npm:~5.1.2" + is-binary-path: "npm:~2.1.0" + is-glob: "npm:~4.0.1" + normalize-path: "npm:~3.0.0" + readdirp: "npm:~3.6.0" + dependenciesMeta: + fsevents: + optional: true + checksum: 10c0/8361dcd013f2ddbe260eacb1f3cb2f2c6f2b0ad118708a343a5ed8158941a39cb8fb1d272e0f389712e74ee90ce8ba864eece9e0e62b9705cb468a2f6d917462 + languageName: node + linkType: hard + "chownr@npm:^2.0.0": version: 2.0.0 resolution: "chownr@npm:2.0.0" @@ -2289,6 +2393,13 @@ __metadata: languageName: node linkType: hard +"chownr@npm:^3.0.0": + version: 3.0.0 + resolution: "chownr@npm:3.0.0" + checksum: 10c0/43925b87700f7e3893296c8e9c56cc58f926411cce3a6e5898136daaf08f08b9a8eb76d37d3267e707d0dcc17aed2e2ebdf5848c0c3ce95cf910a919935c1b10 + languageName: node + linkType: hard + "chunkd@npm:^2.0.1": version: 2.0.1 resolution: "chunkd@npm:2.0.1" @@ -2802,6 +2913,7 @@ __metadata: prettier-plugin-packagejson: "npm:^2.5.6" prettier-plugin-tailwindcss: "npm:^0.6.9" typescript: "npm:^5.6.3" + wireit: "npm:^0.14.9" dependenciesMeta: prettier-plugin-tailwindcss@0.6.9: unplugged: true @@ -3442,7 +3554,7 @@ __metadata: languageName: node linkType: hard -"fast-glob@npm:^3.2.9, fast-glob@npm:^3.3.2": +"fast-glob@npm:^3.2.11, fast-glob@npm:^3.2.9, fast-glob@npm:^3.3.2": version: 3.3.2 resolution: "fast-glob@npm:3.3.2" dependencies: @@ -3653,6 +3765,25 @@ __metadata: languageName: node linkType: hard +"fsevents@npm:~2.3.2": + version: 2.3.3 + resolution: "fsevents@npm:2.3.3" + dependencies: + node-gyp: "npm:latest" + checksum: 10c0/a1f0c44595123ed717febbc478aa952e47adfc28e2092be66b8ab1635147254ca6cfe1df792a8997f22716d4cbafc73309899ff7bfac2ac3ad8cf2e4ecc3ec60 + conditions: os=darwin + languageName: node + linkType: hard + +"fsevents@patch:fsevents@npm%3A~2.3.2#optional!builtin": + version: 2.3.3 + resolution: "fsevents@patch:fsevents@npm%3A2.3.3#optional!builtin::version=2.3.3&hash=df0bf1" + dependencies: + node-gyp: "npm:latest" + conditions: os=darwin + languageName: node + linkType: hard + "function-bind@npm:^1.1.2": version: 1.1.2 resolution: "function-bind@npm:1.1.2" @@ -3821,7 +3952,7 @@ __metadata: languageName: node linkType: hard -"glob-parent@npm:^5.1.2": +"glob-parent@npm:^5.1.2, glob-parent@npm:~5.1.2": version: 5.1.2 resolution: "glob-parent@npm:5.1.2" dependencies: @@ -3839,7 +3970,7 @@ __metadata: languageName: node linkType: hard -"glob@npm:^10.2.2, glob@npm:^10.3.10": +"glob@npm:^10.2.2, glob@npm:^10.3.10, glob@npm:^10.3.7": version: 10.4.5 resolution: "glob@npm:10.4.5" dependencies: @@ -4248,6 +4379,15 @@ __metadata: languageName: node linkType: hard +"is-binary-path@npm:~2.1.0": + version: 2.1.0 + resolution: "is-binary-path@npm:2.1.0" + dependencies: + binary-extensions: "npm:^2.0.0" + checksum: 10c0/a16eaee59ae2b315ba36fad5c5dcaf8e49c3e27318f8ab8fa3cdb8772bf559c8d1ba750a589c2ccb096113bb64497084361a25960899cb6172a6925ab6123d38 + languageName: node + linkType: hard + "is-boolean-object@npm:^1.2.0": version: 1.2.0 resolution: "is-boolean-object@npm:1.2.0" @@ -4351,7 +4491,7 @@ __metadata: languageName: node linkType: hard -"is-glob@npm:^4.0.0, is-glob@npm:^4.0.1, is-glob@npm:^4.0.3": +"is-glob@npm:^4.0.0, is-glob@npm:^4.0.1, is-glob@npm:^4.0.3, is-glob@npm:~4.0.1": version: 4.0.3 resolution: "is-glob@npm:4.0.3" dependencies: @@ -4719,6 +4859,13 @@ __metadata: languageName: node linkType: hard +"jsonc-parser@npm:^3.0.0": + version: 3.3.1 + resolution: "jsonc-parser@npm:3.3.1" + checksum: 10c0/269c3ae0a0e4f907a914bf334306c384aabb9929bd8c99f909275ebd5c2d3bc70b9bcd119ad794f339dec9f24b6a4ee9cd5a8ab2e6435e730ad4075388fc2ab6 + languageName: node + linkType: hard + "jsonfile@npm:^6.0.1": version: 6.1.0 resolution: "jsonfile@npm:6.1.0" @@ -4941,6 +5088,25 @@ __metadata: languageName: node linkType: hard +"make-fetch-happen@npm:^14.0.3": + version: 14.0.3 + resolution: "make-fetch-happen@npm:14.0.3" + dependencies: + "@npmcli/agent": "npm:^3.0.0" + cacache: "npm:^19.0.1" + http-cache-semantics: "npm:^4.1.1" + minipass: "npm:^7.0.2" + minipass-fetch: "npm:^4.0.0" + minipass-flush: "npm:^1.0.5" + minipass-pipeline: "npm:^1.2.4" + negotiator: "npm:^1.0.0" + proc-log: "npm:^5.0.0" + promise-retry: "npm:^2.0.1" + ssri: "npm:^12.0.0" + checksum: 10c0/c40efb5e5296e7feb8e37155bde8eb70bc57d731b1f7d90e35a092fde403d7697c56fb49334d92d330d6f1ca29a98142036d6480a12681133a0a1453164cb2f0 + languageName: node + linkType: hard + "matcher@npm:^5.0.0": version: 5.0.0 resolution: "matcher@npm:5.0.0" @@ -5062,6 +5228,21 @@ __metadata: languageName: node linkType: hard +"minipass-fetch@npm:^4.0.0": + version: 4.0.0 + resolution: "minipass-fetch@npm:4.0.0" + dependencies: + encoding: "npm:^0.1.13" + minipass: "npm:^7.0.3" + minipass-sized: "npm:^1.0.3" + minizlib: "npm:^3.0.1" + dependenciesMeta: + encoding: + optional: true + checksum: 10c0/7fa30ce7c373fb6f94c086b374fff1589fd7e78451855d2d06c2e2d9df936d131e73e952163063016592ed3081444bd8d1ea608533313b0149156ce23311da4b + languageName: node + linkType: hard + "minipass-flush@npm:^1.0.5": version: 1.0.5 resolution: "minipass-flush@npm:1.0.5" @@ -5105,7 +5286,7 @@ __metadata: languageName: node linkType: hard -"minipass@npm:^5.0.0 || ^6.0.2 || ^7.0.0, minipass@npm:^7.0.2, minipass@npm:^7.0.3, minipass@npm:^7.1.2": +"minipass@npm:^5.0.0 || ^6.0.2 || ^7.0.0, minipass@npm:^7.0.2, minipass@npm:^7.0.3, minipass@npm:^7.0.4, minipass@npm:^7.1.2": version: 7.1.2 resolution: "minipass@npm:7.1.2" checksum: 10c0/b0fd20bb9fb56e5fa9a8bfac539e8915ae07430a619e4b86ff71f5fc757ef3924b23b2c4230393af1eda647ed3d75739e4e0acb250a6b1eb277cf7f8fe449557 @@ -5122,6 +5303,16 @@ __metadata: languageName: node linkType: hard +"minizlib@npm:^3.0.1": + version: 3.0.1 + resolution: "minizlib@npm:3.0.1" + dependencies: + minipass: "npm:^7.0.4" + rimraf: "npm:^5.0.5" + checksum: 10c0/82f8bf70da8af656909a8ee299d7ed3b3372636749d29e105f97f20e88971be31f5ed7642f2e898f00283b68b701cc01307401cdc209b0efc5dd3818220e5093 + languageName: node + linkType: hard + "mkdirp@npm:^1.0.3": version: 1.0.4 resolution: "mkdirp@npm:1.0.4" @@ -5131,6 +5322,15 @@ __metadata: languageName: node linkType: hard +"mkdirp@npm:^3.0.1": + version: 3.0.1 + resolution: "mkdirp@npm:3.0.1" + bin: + mkdirp: dist/cjs/src/bin.js + checksum: 10c0/9f2b975e9246351f5e3a40dcfac99fcd0baa31fbfab615fe059fb11e51f10e4803c63de1f384c54d656e4db31d000e4767e9ef076a22e12a641357602e31d57d + languageName: node + linkType: hard + "ms@npm:^2.1.1, ms@npm:^2.1.3": version: 2.1.3 resolution: "ms@npm:2.1.3" @@ -5170,6 +5370,13 @@ __metadata: languageName: node linkType: hard +"negotiator@npm:^1.0.0": + version: 1.0.0 + resolution: "negotiator@npm:1.0.0" + checksum: 10c0/4c559dd52669ea48e1914f9d634227c561221dd54734070791f999c52ed0ff36e437b2e07d5c1f6e32909fc625fe46491c16e4a8f0572567d4dd15c3a4fda04b + languageName: node + linkType: hard + "neo-async@npm:^2.6.2": version: 2.6.2 resolution: "neo-async@npm:2.6.2" @@ -5249,6 +5456,26 @@ __metadata: languageName: node linkType: hard +"node-gyp@npm:latest": + version: 11.0.0 + resolution: "node-gyp@npm:11.0.0" + dependencies: + env-paths: "npm:^2.2.0" + exponential-backoff: "npm:^3.1.1" + glob: "npm:^10.3.10" + graceful-fs: "npm:^4.2.6" + make-fetch-happen: "npm:^14.0.3" + nopt: "npm:^8.0.0" + proc-log: "npm:^5.0.0" + semver: "npm:^7.3.5" + tar: "npm:^7.4.3" + which: "npm:^5.0.0" + bin: + node-gyp: bin/node-gyp.js + checksum: 10c0/a3b885bbee2d271f1def32ba2e30ffcf4562a3db33af06b8b365e053153e2dd2051b9945783c3c8e852d26a0f20f65b251c7e83361623383a99635c0280ee573 + languageName: node + linkType: hard + "nofilter@npm:^3.1.0": version: 3.1.0 resolution: "nofilter@npm:3.1.0" @@ -5278,6 +5505,17 @@ __metadata: languageName: node linkType: hard +"nopt@npm:^8.0.0": + version: 8.0.0 + resolution: "nopt@npm:8.0.0" + dependencies: + abbrev: "npm:^2.0.0" + bin: + nopt: bin/nopt.js + checksum: 10c0/19cb986f79abaca2d0f0b560021da7b32ee6fcc3de48f3eaeb0c324d36755c17754f886a754c091f01f740c17caf7d6aea8237b7fbaf39f476ae5e30a249f18f + languageName: node + linkType: hard + "normalize-package-data@npm:^6.0.0, normalize-package-data@npm:^6.0.1": version: 6.0.2 resolution: "normalize-package-data@npm:6.0.2" @@ -5289,7 +5527,7 @@ __metadata: languageName: node linkType: hard -"normalize-path@npm:^3.0.0": +"normalize-path@npm:^3.0.0, normalize-path@npm:~3.0.0": version: 3.0.0 resolution: "normalize-path@npm:3.0.0" checksum: 10c0/e008c8142bcc335b5e38cf0d63cfd39d6cf2d97480af9abdbe9a439221fd4d749763bab492a8ee708ce7a194bb00c9da6d0a115018672310850489137b3da046 @@ -5806,7 +6044,7 @@ __metadata: languageName: node linkType: hard -"picomatch@npm:^2.3.1": +"picomatch@npm:^2.0.4, picomatch@npm:^2.2.1, picomatch@npm:^2.3.1": version: 2.3.1 resolution: "picomatch@npm:2.3.1" checksum: 10c0/26c02b8d06f03206fc2ab8d16f19960f2ff9e81a658f831ecb656d8f17d9edc799e8364b1f4a7873e89d9702dff96204be0fa26fe4181f6843f040f819dac4be @@ -5967,6 +6205,13 @@ __metadata: languageName: node linkType: hard +"proc-log@npm:^5.0.0": + version: 5.0.0 + resolution: "proc-log@npm:5.0.0" + checksum: 10c0/bbe5edb944b0ad63387a1d5b1911ae93e05ce8d0f60de1035b218cdcceedfe39dbd2c697853355b70f1a090f8f58fe90da487c85216bf9671f9499d1a897e9e3 + languageName: node + linkType: hard + "proggy@npm:^2.0.0": version: 2.0.0 resolution: "proggy@npm:2.0.0" @@ -6005,6 +6250,17 @@ __metadata: languageName: node linkType: hard +"proper-lockfile@npm:^4.1.2": + version: 4.1.2 + resolution: "proper-lockfile@npm:4.1.2" + dependencies: + graceful-fs: "npm:^4.2.4" + retry: "npm:^0.12.0" + signal-exit: "npm:^3.0.2" + checksum: 10c0/2f265dbad15897a43110a02dae55105c04d356ec4ed560723dcb9f0d34bc4fb2f13f79bb930e7561be10278e2314db5aca2527d5d3dcbbdee5e6b331d1571f6d + languageName: node + linkType: hard + "proto-list@npm:~1.2.1": version: 1.2.4 resolution: "proto-list@npm:1.2.4" @@ -6097,6 +6353,15 @@ __metadata: languageName: node linkType: hard +"readdirp@npm:~3.6.0": + version: 3.6.0 + resolution: "readdirp@npm:3.6.0" + dependencies: + picomatch: "npm:^2.2.1" + checksum: 10c0/6fa848cf63d1b82ab4e985f4cf72bd55b7dcfd8e0a376905804e48c3634b7e749170940ba77b32804d5fe93b3cc521aa95a8d7e7d725f830da6d93f3669ce66b + languageName: node + linkType: hard + "reflect.getprototypeof@npm:^1.0.6": version: 1.0.8 resolution: "reflect.getprototypeof@npm:1.0.8" @@ -6213,6 +6478,17 @@ __metadata: languageName: node linkType: hard +"rimraf@npm:^5.0.5": + version: 5.0.10 + resolution: "rimraf@npm:5.0.10" + dependencies: + glob: "npm:^10.3.7" + bin: + rimraf: dist/esm/bin.mjs + checksum: 10c0/7da4fd0e15118ee05b918359462cfa1e7fe4b1228c7765195a45b55576e8c15b95db513b8466ec89129666f4af45ad978a3057a02139afba1a63512a2d9644cc + languageName: node + linkType: hard + "run-parallel@npm:^1.1.9": version: 1.2.0 resolution: "run-parallel@npm:1.2.0" @@ -6356,7 +6632,7 @@ __metadata: languageName: node linkType: hard -"signal-exit@npm:^3.0.0": +"signal-exit@npm:^3.0.0, signal-exit@npm:^3.0.2": version: 3.0.7 resolution: "signal-exit@npm:3.0.7" checksum: 10c0/25d272fa73e146048565e08f3309d5b942c1979a6f4a58a8c59d5fa299728e9c2fcd1a759ec870863b1fd38653670240cd420dad2ad9330c71f36608a6a1c912 @@ -6550,6 +6826,15 @@ __metadata: languageName: node linkType: hard +"ssri@npm:^12.0.0": + version: 12.0.0 + resolution: "ssri@npm:12.0.0" + dependencies: + minipass: "npm:^7.0.3" + checksum: 10c0/caddd5f544b2006e88fa6b0124d8d7b28208b83c72d7672d5ade44d794525d23b540f3396108c4eb9280dcb7c01f0bef50682f5b4b2c34291f7c5e211fd1417d + languageName: node + linkType: hard + "stable-hash@npm:^0.0.4": version: 0.0.4 resolution: "stable-hash@npm:0.0.4" @@ -6753,6 +7038,20 @@ __metadata: languageName: node linkType: hard +"tar@npm:^7.4.3": + version: 7.4.3 + resolution: "tar@npm:7.4.3" + dependencies: + "@isaacs/fs-minipass": "npm:^4.0.0" + chownr: "npm:^3.0.0" + minipass: "npm:^7.1.2" + minizlib: "npm:^3.0.1" + mkdirp: "npm:^3.0.1" + yallist: "npm:^5.0.0" + checksum: 10c0/d4679609bb2a9b48eeaf84632b6d844128d2412b95b6de07d53d8ee8baf4ca0857c9331dfa510390a0727b550fd543d4d1a10995ad86cdf078423fbb8d99831d + languageName: node + linkType: hard + "temp-dir@npm:^3.0.0": version: 3.0.0 resolution: "temp-dir@npm:3.0.0" @@ -7035,6 +7334,15 @@ __metadata: languageName: node linkType: hard +"unique-filename@npm:^4.0.0": + version: 4.0.0 + resolution: "unique-filename@npm:4.0.0" + dependencies: + unique-slug: "npm:^5.0.0" + checksum: 10c0/38ae681cceb1408ea0587b6b01e29b00eee3c84baee1e41fd5c16b9ed443b80fba90c40e0ba69627e30855570a34ba8b06702d4a35035d4b5e198bf5a64c9ddc + languageName: node + linkType: hard + "unique-slug@npm:^4.0.0": version: 4.0.0 resolution: "unique-slug@npm:4.0.0" @@ -7044,6 +7352,15 @@ __metadata: languageName: node linkType: hard +"unique-slug@npm:^5.0.0": + version: 5.0.0 + resolution: "unique-slug@npm:5.0.0" + dependencies: + imurmurhash: "npm:^0.1.4" + checksum: 10c0/d324c5a44887bd7e105ce800fcf7533d43f29c48757ac410afd42975de82cc38ea2035c0483f4de82d186691bf3208ef35c644f73aa2b1b20b8e651be5afd293 + languageName: node + linkType: hard + "universal-user-agent@npm:^7.0.0, universal-user-agent@npm:^7.0.2": version: 7.0.2 resolution: "universal-user-agent@npm:7.0.2" @@ -7235,6 +7552,17 @@ __metadata: languageName: node linkType: hard +"which@npm:^5.0.0": + version: 5.0.0 + resolution: "which@npm:5.0.0" + dependencies: + isexe: "npm:^3.1.1" + bin: + node-which: bin/which.js + checksum: 10c0/e556e4cd8b7dbf5df52408c9a9dd5ac6518c8c5267c8953f5b0564073c66ed5bf9503b14d876d0e9c7844d4db9725fb0dcf45d6e911e17e26ab363dc3965ae7b + languageName: node + linkType: hard + "wide-align@npm:^1.1.2, wide-align@npm:^1.1.5": version: 1.1.5 resolution: "wide-align@npm:1.1.5" @@ -7244,6 +7572,21 @@ __metadata: languageName: node linkType: hard +"wireit@npm:^0.14.9": + version: 0.14.9 + resolution: "wireit@npm:0.14.9" + dependencies: + brace-expansion: "npm:^4.0.0" + chokidar: "npm:^3.5.3" + fast-glob: "npm:^3.2.11" + jsonc-parser: "npm:^3.0.0" + proper-lockfile: "npm:^4.1.2" + bin: + wireit: bin/wireit.js + checksum: 10c0/0c80f6564e4a09b0f9a49aff75d44bb0c64f1988fd5580253fd6cf3de900d398207975ab20b4fbca51302583c4b4f0f74b7888cb2c5f08281b1611e182799003 + languageName: node + linkType: hard + "word-wrap@npm:^1.2.5": version: 1.2.5 resolution: "word-wrap@npm:1.2.5" @@ -7357,6 +7700,13 @@ __metadata: languageName: node linkType: hard +"yallist@npm:^5.0.0": + version: 5.0.0 + resolution: "yallist@npm:5.0.0" + checksum: 10c0/a499c81ce6d4a1d260d4ea0f6d49ab4da09681e32c3f0472dee16667ed69d01dae63a3b81745a24bd78476ec4fcf856114cb4896ace738e01da34b2c42235416 + languageName: node + linkType: hard + "yargs-parser@npm:^21.1.1": version: 21.1.1 resolution: "yargs-parser@npm:21.1.1" From f79ac933d72bdcc520c771ec7b6bd093ca918da5 Mon Sep 17 00:00:00 2001 From: arashagp Date: Sun, 29 Dec 2024 14:35:20 +0330 Subject: [PATCH 2/3] refactor: add write permission for publish-npm workflow --- .github/workflows/publish-npm.yml | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/.github/workflows/publish-npm.yml b/.github/workflows/publish-npm.yml index e7881fd..9852097 100644 --- a/.github/workflows/publish-npm.yml +++ b/.github/workflows/publish-npm.yml @@ -21,6 +21,7 @@ jobs: permissions: contents: read + id-token: write steps: - name: ⤵️ Checkout repository @@ -54,8 +55,11 @@ jobs: run: yarn build env: NODE_ENV: production + WIREIT_LOGGER: metrics - name: 🚀 Publish - run: yarn run publish --yes + run: yarn run publish -- --yes env: NODE_AUTH_TOKEN: ${{secrets.NPM_TOKEN}} + NPM_CONFIG_PROVENANCE: true + WIREIT_LOGGER: metrics From 532a809fa3f9129baf16b93c97da92644c11f1a0 Mon Sep 17 00:00:00 2001 From: "S. Amir Mohammad Najafi" Date: Sun, 29 Dec 2024 14:49:13 +0330 Subject: [PATCH 3/3] chore: enable wireit logger --- .github/workflows/build-lint-test.yaml | 7 ++++++- .github/workflows/release.yaml | 10 ++++++++++ .vscode/settings.json | 1 + 3 files changed, 17 insertions(+), 1 deletion(-) diff --git a/.github/workflows/build-lint-test.yaml b/.github/workflows/build-lint-test.yaml index 3bf87d6..8c9acc6 100644 --- a/.github/workflows/build-lint-test.yaml +++ b/.github/workflows/build-lint-test.yaml @@ -41,7 +41,6 @@ jobs: - name: 🏗 Cache Layer uses: actions/cache@v4 - # id: yarn_cache # use this to check for `cache-hit` (`steps.yarn-cache.outputs.cache-hit != 'true'`) with: path: ${{ steps.yarn_config.outputs.cache_folder }} key: ${{ runner.os }}-yarn-${{ hashFiles('yarn.lock') }} @@ -53,9 +52,15 @@ jobs: - name: 🚀 Build Typescript run: yarn build + env: + WIREIT_LOGGER: metrics - name: 🚀 Run ESLint run: yarn lint + env: + WIREIT_LOGGER: metrics - name: 🚀 Run Test run: yarn test + env: + WIREIT_LOGGER: metrics diff --git a/.github/workflows/release.yaml b/.github/workflows/release.yaml index 2f49188..9c4767b 100644 --- a/.github/workflows/release.yaml +++ b/.github/workflows/release.yaml @@ -60,16 +60,26 @@ jobs: - name: 🏗 Install dependencies run: yarn install --immutable + - name: 🗃️ Cache Wireit + uses: google/wireit@setup-github-actions-caching/v2 + - name: 🚀 Build Typescript run: yarn build + env: + WIREIT_LOGGER: metrics - name: 🚀 Run ESLint run: yarn lint + env: + WIREIT_LOGGER: metrics - name: 🧪 Run Test run: yarn test + env: + WIREIT_LOGGER: metrics - name: 🤖 Get Release run: yarn release -y env: GITHUB_TOKEN: ${{ secrets.BOT_TOKEN }} + WIREIT_LOGGER: metrics diff --git a/.vscode/settings.json b/.vscode/settings.json index b97ff87..1b68029 100644 --- a/.vscode/settings.json +++ b/.vscode/settings.json @@ -78,6 +78,7 @@ "toman", "tsbuildinfo", "vazirmatn", + "wireit", "اپلیکیشن", "بندیل", "سافاری",