Skip to content
Open
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
Original file line number Diff line number Diff line change
@@ -1,36 +1,34 @@
name: unit-test
name: integration

on:
pull_request:
branches:
- release
- master

jobs:
integration:
runs-on: ubuntu-latest

if: "! contains(toJSON(github.event.commits.*.message), '[skip actions]')"

steps:
- name: Checkout repo
uses: actions/checkout@v3

- uses: pnpm/action-setup@v2
with:
version: 7

- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v3
uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node-version }}
cache: "pnpm"

- name: Install deps
run: pnpm install
- name: Checkout repo
uses: actions/checkout@v4

- name: Install bun
uses: oven-sh/setup-bun@v1

- name: Install dependencies
run: bun install

- name: Lint package
run: pnpm run lint
run: bun run lint

- name: Run unit test
run: pnpm run test
run: bun run test
24 changes: 10 additions & 14 deletions .github/workflows/publish-beta-to-npm.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,27 +9,23 @@ jobs:
runs-on: ubuntu-latest
if: "! contains(toJSON(github.event.commits.*.message), '[skip ci]')"
steps:
- name: Checkout release branch code
uses: actions/checkout@v3
with:
fetch-depth: 1

- uses: pnpm/action-setup@v2
with:
version: 7

- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node-version }}
cache: "pnpm"
registry-url: "https://registry.npmjs.org"
registry-url: 'https://registry.npmjs.org'

- name: Checkout repo
uses: actions/checkout@v4

- name: Install bun
uses: oven-sh/setup-bun@v1

- name: Install deps
run: pnpm install
- name: Install dependencies
run: bun install

- name: Build
run: pnpm build
run: bun run build

- name: Publish to NPM
run: |
Expand Down
24 changes: 10 additions & 14 deletions .github/workflows/publish-to-npm.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,27 +8,23 @@ jobs:
publish-to-npm:
runs-on: ubuntu-latest
steps:
- name: Checkout release branch code
uses: actions/checkout@v3
with:
fetch-depth: 1

- uses: pnpm/action-setup@v2
with:
version: 7

- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node-version }}
cache: "pnpm"
registry-url: "https://registry.npmjs.org"
registry-url: 'https://registry.npmjs.org'

- name: Checkout repo
uses: actions/checkout@v4

- name: Install bun
uses: oven-sh/setup-bun@v1

- name: Install deps
run: pnpm install
- name: Install dependencies
run: bun install

- name: Build
run: pnpm build
run: bun run build

- name: Publish to NPM
run: npm publish
Expand Down
1 change: 0 additions & 1 deletion .vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
"gitbook",
"jianchao",
"Metas",
"pnpm",
"predebug",
"skypesky"
]
Expand Down
Binary file added bun.lockb
Binary file not shown.
3 changes: 3 additions & 0 deletions knip.config.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
export default {
entry: ['src/cli/index.{js,ts}'],
};
32 changes: 17 additions & 15 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -29,21 +29,23 @@
"dist"
],
"scripts": {
"reinstall": "rimraf node_modules && pnpm install",
"predebug": "npm run build",
"preinstall": "npx only-allow bun",
"reinstall": "rimraf node_modules && bun install",
"predebug": "bun run build",
"debug": "node ./dist/index.js",
"lint": "eslint src/**/*.ts",
"lint:fix": "npm run lint -- --fix",
"lint:fix": "bun run lint -- --fix",
"test": "jest --forceExit --detectOpenHandles",
"coverage": "npm run test -- --coverage",
"coverage": "bun run test -- --coverage",
"clean": "rimraf dist",
"prebuild": "npm run clean",
"prebuild": "bun run clean",
"build": "node esbuild.config.cjs",
"build:watch": "npm run build -- -w",
"deploy": "npm run build && npm uninstall -g to-where-cli && npm install -g . -f",
"build:watch": "bun run build -- -w",
"deploy": "bun run build && npm uninstall -g to-where-cli && npm install -g . -f",
"deploy:remote": "npm uninstall -g to-where-cli && npm install -g to-where-cli",
"verify": "npm run lint && npm run test",
"bump-version": "ver-bump -f package.json -n",
"verify": "bun run lint && bun run test",
"depcheck": "knip --fix",
"bump-version": "ver-bump -f -n -b package.json",
"show:version": "npm show to-where-cli version"
},
"dependencies": {
Expand All @@ -62,30 +64,30 @@
"open": "^8.4.0",
"prompts": "^2.4.2",
"shelljs.exec": "^1.1.8",
"ufo": "^1.5.3",
"url-join": "4.0.1"
},
"devDependencies": {
"@types/chalk": "^2.2.0",
"@types/commander": "^2.12.2",
"@types/fs-extra": "^9.0.13",
"@types/jest": "^29.2.2",
"@types/js-yaml": "^4.0.5",
"@types/lodash": "^4.14.187",
"@types/node": "^18.11.7",
"@types/node": "^22.5.3",
"@types/open": "^6.2.1",
"@types/prompts": "^2.4.2",
"@types/shelljs.exec": "^1.1.0",
"@types/shelljs.exec": "^1.1.3",
"@types/url-join": "^4.0.1",
"@typescript-eslint/eslint-plugin": "^5.42.1",
"@typescript-eslint/parser": "^5.42.1",
"esbuild": "^0.16.4",
"eslint": "8",
"jest": "^29.3.1",
"jest-environment-jsdom": "^29.3.1",
"knip": "^5.29.2",
"only-allow": "^1.2.1",
"rimraf": "^3.0.2",
"ts-jest": "^29.0.3",
"ts-node": "^10.9.1",
"typescript": "^4.8.4",
"typescript": "^5.5.4",
"ver-bump": "^1.1.8"
}
}
Loading