Skip to content

Commit

Permalink
Add integration workflow w/ Bun
Browse files Browse the repository at this point in the history
  • Loading branch information
webpro committed Oct 9, 2023
1 parent d50df65 commit 20fd0b2
Show file tree
Hide file tree
Showing 2 changed files with 68 additions and 0 deletions.
26 changes: 26 additions & 0 deletions .github/workflows/integration.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
name: Run Knip in external projects

on:
workflow_dispatch:
push:

jobs:
integration:
name: integration
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: oven-sh/setup-bun@v1
- run: git apply bun-compat.diff
- run: bun install
- run: bun run build
- run: bun link

- name: Test Knip against create-typescript-app
uses: actions/checkout@v3
with:
repository: JoshuaKGoldberg/create-typescript-app
path: create-typescript-app
- run: bun install
- run: bun link knip
- run: bun knip
42 changes: 42 additions & 0 deletions bun-compat.diff
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
diff --git a/package.json b/package.json
index e39a2b6..c6b3ed2 100644
--- a/package.json
+++ b/package.json
@@ -44,6 +44,7 @@
"dependencies": {
"@ericcornelissen/bash-parser": "^0.5.2",
"@npmcli/map-workspaces": "^3.0.4",
+ "@pkgjs/parseargs": "github:pkgjs/parseargs",
"@pnpm/logger": "5.0.0",
"@pnpm/workspace.pkgs-graph": "2.0.6",
"@snyk/github-codeowners": "^1.1.0",
@@ -74,6 +75,7 @@
"@types/minimist": "1.2.3",
"@types/node": "20.8.3",
"@types/npmcli__map-workspaces": "3.0.2",
+ "@types/pkgjs__parseargs": "0.10.1",
"@types/webpack": "5.28.3",
"@typescript-eslint/eslint-plugin": "6.7.4",
"@typescript-eslint/parser": "6.7.4",
diff --git a/scripts/create-new-plugin.ts b/scripts/create-new-plugin.ts
index d6c8cb6..cfc5a04 100644
--- a/scripts/create-new-plugin.ts
+++ b/scripts/create-new-plugin.ts
@@ -1,6 +1,6 @@
import fs from 'node:fs/promises';
import path from 'node:path';
-import { parseArgs } from 'node:util';
+import { parseArgs } from '@pkgjs/parseargs';

const {
values: { name },
diff --git a/src/util/cli-arguments.ts b/src/util/cli-arguments.ts
index 48be9e8..77c1b01 100644
--- a/src/util/cli-arguments.ts
+++ b/src/util/cli-arguments.ts
@@ -1,4 +1,4 @@
-import { parseArgs } from 'node:util';
+import { parseArgs } from '@pkgjs/parseargs';

export const helpText = `✂️ Find unused files, dependencies and exports in your JavaScript and TypeScript projects

0 comments on commit 20fd0b2

Please sign in to comment.