Adjust scripts
This commit is contained in:
parent
2094357ae4
commit
fdada7bace
9
.github/workflows/format.yml
vendored
9
.github/workflows/format.yml
vendored
@ -21,7 +21,14 @@ jobs:
|
|||||||
uses: ./
|
uses: ./
|
||||||
|
|
||||||
- name: 📦 Install Dependencies
|
- name: 📦 Install Dependencies
|
||||||
run: bun install
|
run: |
|
||||||
|
mkdir -p dist
|
||||||
|
bun run bun_as:npm
|
||||||
|
bun run bun_as:npx
|
||||||
|
echo "$(realpath -e dist)" >> "${GITHUB_PATH}"
|
||||||
|
PATH="${PATH}:$(realpath -e dist)"
|
||||||
|
test -s bun.lock || bun run 'modules:lock'
|
||||||
|
bun install --frozen-lockfile
|
||||||
|
|
||||||
- name: 🧹 Format
|
- name: 🧹 Format
|
||||||
run: |
|
run: |
|
||||||
|
|||||||
9
.github/workflows/test.yml
vendored
9
.github/workflows/test.yml
vendored
@ -36,7 +36,14 @@ jobs:
|
|||||||
no-cache: true
|
no-cache: true
|
||||||
|
|
||||||
- name: Install dependencies
|
- name: Install dependencies
|
||||||
run: bun install
|
run: |
|
||||||
|
mkdir -p dist
|
||||||
|
bun run bun_as:npm
|
||||||
|
bun run bun_as:npx
|
||||||
|
echo "$(realpath -e dist)" >> "${GITHUB_PATH}"
|
||||||
|
PATH="${PATH}:$(realpath -e dist)"
|
||||||
|
test -s bun.lock || bun run 'modules:lock'
|
||||||
|
bun install --frozen-lockfile
|
||||||
|
|
||||||
- name: Run tests
|
- name: Run tests
|
||||||
run: bun test --coverage
|
run: bun test --coverage
|
||||||
|
|||||||
@ -1,4 +1,5 @@
|
|||||||
[install]
|
[install]
|
||||||
|
linker = "hoisted"
|
||||||
saveTextLockfile = true
|
saveTextLockfile = true
|
||||||
[test]
|
[test]
|
||||||
preload = ["./tests/init.suite.ts"]
|
preload = ["./tests/init.suite.ts"]
|
||||||
|
|||||||
20
package.json
20
package.json
@ -17,14 +17,20 @@
|
|||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
"author": "xHyroM",
|
"author": "xHyroM",
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"format": "prettier --write src *.yml *.json *.md",
|
"postinstall": "npx -- patch-package",
|
||||||
"modules:lock": "npm install --no-fund --package-lock-only",
|
"bun_as:npm": "printf >| dist/npm -- '%s\\n' '#!/usr/bin/env sh' '' 'exec bunx --bun -- npm \"$@\"' && chmod a+rx dist/npm",
|
||||||
|
"bun_as:npx": "printf >| dist/npx -- '%s\\n' '#!/usr/bin/env sh' '' 'exec bunx --bun --package=npm -- \"npx\" \"$@\"' && chmod a+rx dist/npx",
|
||||||
|
"format": "npx -- prettier --write src *.yml *.json *.md",
|
||||||
"modules:clean": "npm ci --no-fund",
|
"modules:clean": "npm ci --no-fund",
|
||||||
"modules:patch": "npm x patch-package",
|
"modules:lock:npm": "npm install --no-fund --ignore-scripts --package-lock-only",
|
||||||
"modules": "npm run modules:clean && npm run modules:patch",
|
"modules:lock:bun": "rm -f bun.lock; bun install --lockfile-only",
|
||||||
"build": "esbuild --target=node24 --outfile=dist/setup/index.js --bundle --keep-names --minify --platform=node --format=cjs --banner:js=\"var import_meta_url = require('url').pathToFileURL(__filename).href;\" --define:import.meta.url=import_meta_url src/index.ts && esbuild --target=node24 --outfile=dist/cache-save/index.js --bundle --keep-names --minify --platform=node --format=cjs --banner:js=\"var import_meta_url = require('url').pathToFileURL(__filename).href;\" --define:import.meta.url=import_meta_url src/cache-save.ts",
|
"modules:lock": "npm run modules:lock:npm && npm run modules:lock:bun",
|
||||||
"build:tests": "esbuild --bundle --platform=node --format=esm --target=node24 --outfile=tests/build/tests.mjs --external:node:* --packages=external tests/bundled.suite.ts",
|
"modules": "npm run modules:lock:npm && npm run modules:clean",
|
||||||
"tests:bundle": "node --test tests/build/tests.mjs",
|
"build:cache-save": "npx -- esbuild --target=node24 --outfile=dist/cache-save/index.js --bundle --keep-names --minify --platform=node --format=cjs src/cache-save.ts",
|
||||||
|
"build:setup": "npx -- esbuild --target=node24 --outfile=dist/setup/index.js --bundle --keep-names --minify --platform=node --format=cjs --banner:js=\"var import_meta_url = require('url').pathToFileURL(__filename).href;\" --define:import.meta.url=import_meta_url src/index.ts",
|
||||||
|
"build:tests": "npx -- esbuild --bundle --platform=node --format=esm --target=node24 --outfile=tests/build/tests.mjs --external:node:* --packages=external tests/bundled.suite.ts",
|
||||||
|
"build": "npm run build:cache-save && npm run build:setup",
|
||||||
|
"tests:bundle": "npm run build:tests && node --test tests/build/tests.mjs",
|
||||||
"start": "npm run build && node dist/setup/index.js"
|
"start": "npm run build && node dist/setup/index.js"
|
||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user