Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Replace Bun with pnpm #306

Merged
merged 27 commits into from
Jan 27, 2025
Merged
Show file tree
Hide file tree
Changes from 22 commits
Commits
Show all changes
27 commits
Select commit Hold shift + click to select a range
004ad9b
Refactor package.json to replace bun with pnpm for script commands an…
sakit0 Jan 13, 2025
81cc8f4
Replace bun with pnpm in CI workflows and related scripts
sakit0 Jan 13, 2025
61c40fe
Update CONTRIBUTING.md to replace bun with pnpm in setup instructions
sakit0 Jan 13, 2025
4bf10c3
Replace bun with pnpm and update test imports to use vitest
sakit0 Jan 13, 2025
e97b398
Remove "type" field from package.json and set package manager to pnpm…
sakit0 Jan 13, 2025
ceb7c4b
Add @supabase/auth-js dependency to package.json and update pnpm-lock…
sakit0 Jan 13, 2025
3f8695c
Refactor package.json to format trustedDependencies array
sakit0 Jan 13, 2025
838e31c
Merge remote-tracking branch 'upstream/main' into chore/migrate-bun-t…
sakit0 Jan 20, 2025
721a65f
update pnpm-lock.yaml
sakit0 Jan 20, 2025
c34fd84
Add pnpm workspace configuration file
sakit0 Jan 20, 2025
fd71a60
update pnpm-lock.yaml
sakit0 Jan 20, 2025
9c54833
Update biome.json to ignore additional package directory
sakit0 Jan 20, 2025
0fa0398
Add overrides for @supabase/auth-js to package.json
sakit0 Jan 20, 2025
9115cbf
Update @supabase/auth-js version to 2.64.4 and remove overrides from …
sakit0 Jan 20, 2025
f89842b
Refactor timeout references to use NodeJS.Timeout type
sakit0 Jan 20, 2025
603bf19
Add @opentelemetry/api-logs and @opentelemetry/sdk-logs dependencies …
sakit0 Jan 20, 2025
17ed60e
fix format
sakit0 Jan 20, 2025
ca8d013
Add @opentelemetry/sdk-trace-base dependency to package.json and pnpm…
sakit0 Jan 20, 2025
c23cc6b
fix format
sakit0 Jan 20, 2025
250ad64
Add zod dependency to package.json and pnpm-lock.yaml
sakit0 Jan 20, 2025
e59a841
Add gaxios dependency to package.json and pnpm-lock.yaml
sakit0 Jan 20, 2025
81b86f9
fix(package): update version specifiers to remove caret (^) for consi…
sakit0 Jan 20, 2025
2675db8
Add new dependency decision for MIT-0 license in dependency_decisions…
sakit0 Jan 20, 2025
7641944
fix(dependency_decisions): update MIT-0 license entry for clarity and…
sakit0 Jan 20, 2025
7f12b1c
fix(dependency_decisions): remove quotes around MIT-0 license for con…
sakit0 Jan 20, 2025
9e1ecb0
Merge remote-tracking branch 'upstream/main' into chore/migrate-bun-t…
sakit0 Jan 27, 2025
95f2964
Add cookie override to package.json
sakit0 Jan 27, 2025
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
6 changes: 3 additions & 3 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,9 @@ jobs:
uses: biomejs/[email protected]
with:
version: 1.9.4
- uses: oven-sh/setup-bun@v2
- run: bun install
- uses: pnpm/action-setup@v4
- run: pnpm install
- name: Run Biome
run: biome ci .
- name: Test
run: bun test --coverage
run: pnpm test --coverage
10 changes: 4 additions & 6 deletions .github/workflows/license.yml
Original file line number Diff line number Diff line change
Expand Up @@ -53,11 +53,11 @@ jobs:
with:
path: |
.github/workflows/license.yml
bun.lockb
pnpm-lock.yaml
config/dependency_decisions.yml
config/license_finder.yml
package.json
key: license-${{ runner.os }}-${{ hashFiles('.github/workflows/license.yml', 'bun.lockb', 'config/dependency_decisions.yml', 'config/license_finder.yml', 'package.json') }}
key: license-${{ runner.os }}-${{ hashFiles('.github/workflows/license.yml', 'pnpm-lock.yaml', 'config/dependency_decisions.yml', 'config/license_finder.yml', 'package.json') }}
- name: Determine if files changed
id: determine
run: |
Expand All @@ -66,11 +66,9 @@ jobs:
else
echo "files_changed=true" >> "$GITHUB_OUTPUT"
fi
- uses: oven-sh/setup-bun@v2
- uses: pnpm/action-setup@v4
if: steps.determine.outputs.files_changed == 'true'
with:
bun-version-file: "package.json"
- run: bun install
- run: pnpm install
if: steps.determine.outputs.files_changed == 'true'
- uses: ruby/setup-ruby@v1
if: steps.determine.outputs.files_changed == 'true'
Expand Down
2 changes: 1 addition & 1 deletion .zed/settings.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"formatter": {
"external": {
"command": "bunx",
"command": "pnpm dlx",
"arguments": [
"@biomejs/biome",
"check",
Expand Down
10 changes: 5 additions & 5 deletions .zed/tasks.json
Original file line number Diff line number Diff line change
@@ -1,28 +1,28 @@
[
{
"label": "biome",
"command": "bunx @biomejs/biome check --write $ZED_WORKTREE_ROOT",
"command": "pnpm dlx @biomejs/biome check --write $ZED_WORKTREE_ROOT",
"allow_concurrent_runs": false
},
{
"label": "dev",
"command": "bun dev",
"command": "pnpm dev",
"allow_concurrent_runs": false
},
{
"label": "drizzle studio",
"command": "bunx drizzle-kit studio",
"command": "pnpm dlx drizzle-kit studio",
"allow_concurrent_runs": false
},
{
"label": "tsc",
"command": "bun tsc",
"command": "pnpm tsc",
"allow_concurrent_runs": false,
"hide": "on_success"
},
{
"label": "npm-check-updates",
"command": "bunx npm-check-updates",
"command": "pnpm dlx npm-check-updates",
"allow_concurrent_runs": false
},
{
Expand Down
6 changes: 3 additions & 3 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ To set up a development environment, please follow these steps:

### 2. Prerequisites

- Bun (Version: >= 1.1.17)
- pnpm (Version: 10.0.0)

### 3. Set up your .env file

Expand All @@ -27,13 +27,13 @@ To set up a development environment, please follow these steps:
### 4. Install dependencies

```sh
bun install
pnpm install
```

### 5. Start developing and watch for code changes

```sh
bun dev
pnpm dev
```

## Issues and feature requests
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { expect, test } from "bun:test";
import { expect, test } from "vitest";
import type { ConnectorObject } from "../connector/types";
import type { GiselleNode } from "../giselle-node/types";
import { allFlowEdges } from "./utils";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ export const GraphProvider: FC<PropsWithChildren<GraphProviderProps>> = ({
const isInitialMount = useRef(true);
const stateRef = useRef({ graph: defaultGraph });
const [state, setState] = useState(stateRef.current);
const timeoutRef = useRef<Timer | null>(null);
const timeoutRef = useRef<NodeJS.Timeout | null>(null);

const enhancedDispatch: EnhancedDispatch = useCallback(
async (action) => {
Expand Down
2 changes: 1 addition & 1 deletion app/webhooks/github-backup/command.test.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { expect, test } from "bun:test";
import { expect, test } from "vitest";
import { parseCommand } from "./command";

test("parseCommand", () => {
Expand Down
2 changes: 1 addition & 1 deletion app/webhooks/github/command.test.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { expect, test } from "bun:test";
import { expect, test } from "vitest";
import { parseCommand } from "./command";

test("parseCommand", () => {
Expand Down
2 changes: 1 addition & 1 deletion biome.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,6 @@
"clientKind": "git"
},
"files": {
"ignore": ["deprecated", "packages/sdk-nextjs"]
"ignore": ["deprecated", "packages/sdk-nextjs", "packages/sdk/dist"]
}
}
Binary file removed bun.lockb
Binary file not shown.
6 changes: 3 additions & 3 deletions deploy-trigger
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,9 @@ sed -i '' -e 's/"next": ".*"/"next": "'$NEXTJS_STABLE_VERSION'"/' \
echo "Replacing package.json with stable version."

rm -rf node_modules
bun i
pnpm i

bunx trigger.dev@beta deploy --env $ENV
pnpm dlx trigger.dev@beta deploy --env $ENV

# Revert the changes to the package.json file
sed -i '' -e 's/"next": ".*"/"next": "'$NEXTJS_BETA_VERSION'"/' \
Expand All @@ -33,4 +33,4 @@ sed -i '' -e 's/"next": ".*"/"next": "'$NEXTJS_BETA_VERSION'"/' \
echo "Reverting package.json to beta version."

rm -rf node_modules
bun i
pnpm i
4 changes: 2 additions & 2 deletions lib/signed-cookie.test.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { beforeAll, describe, expect, mock, test } from "bun:test";
import { beforeAll, describe, expect, test, vi } from "vitest";
import { getCookie, setCookie } from "./signed-cookie";

// Mock Next.js cookies
Expand All @@ -14,7 +14,7 @@ const mockCookieStore = {
},
};

mock.module("next/headers", () => ({
vi.mock("next/headers", () => ({
cookies: () => mockCookieStore,
}));

Expand Down
25 changes: 17 additions & 8 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,16 +3,17 @@
"version": "0.1.0",
"private": true,
"scripts": {
"predev": "bun prepare-font.js",
"predev": "node prepare-font.js",
"dev": "SENTRY_SUPPRESS_TURBOPACK_WARNING=1 next dev --turbopack",
"dev-debug": "LOGLEVEL=debug bun run dev",
"dev-debug": "LOGLEVEL=debug pnpm run dev",
"prebuild": "node prepare-font.js",
"build": "next build",
"start": "next start",
"check": "bunx @biomejs/biome check --write .",
"lint": "next lint"
"check": "pnpm dlx @biomejs/biome check --write .",
"lint": "next lint",
"test": "vitest"
},
"packageManager": "[email protected]",
"packageManager": "[email protected]",
"dependencies": {
"@ai-sdk/anthropic": "1.0.5",
"@ai-sdk/google": "1.0.10",
Expand All @@ -27,11 +28,14 @@
"@octokit/request-error": "6.1.5",
"@octokit/webhooks": "13.3.0",
"@opentelemetry/api": "1.9.0",
"@opentelemetry/api-logs": "0.57.1",
"@opentelemetry/exporter-logs-otlp-http": "0.54.2",
"@opentelemetry/exporter-metrics-otlp-http": "0.52.1",
"@opentelemetry/resources": "1.30.0",
"@opentelemetry/sdk-logs": "0.57.1",
"@opentelemetry/sdk-metrics": "1.24.1",
"@opentelemetry/sdk-node": "0.51.1",
"@opentelemetry/sdk-trace-base": "1.30.1",
"@opentelemetry/semantic-conventions": "1.28.0",
"@paralleldrive/cuid2": "2.2.2",
"@radix-ui/react-accordion": "1.2.2",
Expand All @@ -51,6 +55,7 @@
"@radix-ui/react-tooltip": "1.1.4",
"@sentry/nextjs": "8.34.0",
"@sentry/wizard": "3.38.0",
"@supabase/auth-js": "2.64.4",
"@supabase/ssr": "0.4.0",
"@supabase/supabase-js": "2.45.0",
"@valibot/to-json-schema": "1.0.0-beta.3",
Expand All @@ -69,6 +74,7 @@
"cva": "1.0.0-beta.1",
"drizzle-orm": "0.32.1",
"framer-motion": "12.0.0-alpha.0",
"gaxios": "6.7.1",
"google-auth-library": "9.15.0",
"googleapis": "144.0.0",
"handlebars": "4.7.8",
Expand All @@ -93,24 +99,27 @@
"tiny-invariant": "1.3.3",
"ts-pattern": "5.2.0",
"unstructured-client": "0.18.1",
"valibot": "0.37.0"
"valibot": "0.37.0",
"zod": "3.24.1"
},
"devDependencies": {
"@biomejs/biome": "1.9.4",
"@octokit/openapi-types": "22.2.0",
"@octokit/webhooks-types": "7.6.1",
"@radix-ui/react-hover-card": "1.1.2",
"@tailwindcss/typography": "0.5.15",
"@types/bun": "1.1.13",
"@types/node": "22.10.5",
"@types/react": "19.0.4",
"@types/react-dom": "19.0.2",
"@vitest/coverage-v8": "2.1.8",
"drizzle-kit": "0.23.0",
"pino-pretty": "13.0.0",
"postcss": "8.4.49",
"tailwindcss": "3.4.17",
"turbo": "2.0.9",
"typescript": "5.6.2"
"typescript": "5.6.2",
"vite-tsconfig-paths": "5.1.4",
"vitest": "2.1.8"
},
"trustedDependencies": ["@sentry/cli"]
}
2 changes: 1 addition & 1 deletion packages/contexts/graph.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -236,7 +236,7 @@ export function GraphContextProvider({
const graphRef = useRef(defaultGraph);
const [graph, setGraph] = useState(graphRef.current);
const [graphUrl, setGraphUrl] = useState(defaultGraphUrl);
const persistTimeoutRef = useRef<Timer | null>(null);
const persistTimeoutRef = useRef<NodeJS.Timeout | null>(null);
const isPendingPersistRef = useRef(false);
const persist = useCallback(async () => {
isPendingPersistRef.current = false;
Expand Down
4 changes: 2 additions & 2 deletions packages/lib/graph.test.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { describe, expect, test } from "bun:test";
import { describe, expect, test } from "vitest";
import type { Flow, Graph } from "../types";
import { deriveFlows, isLatestVersion, migrateGraph } from "./graph";

Expand Down Expand Up @@ -199,7 +199,7 @@ describe("migrateGraph", () => {
nodes: [],
artifacts: [],
} as unknown as Graph);
expect(after).toContainKey("version");
expect(after).toHaveProperty("version");
});
test("migrate to 2024-12-10", () => {
const after = migrateGraph({
Expand Down
2 changes: 1 addition & 1 deletion packages/lib/prompts.test.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { describe, expect, test } from "bun:test";
import HandleBars from "handlebars";
import { describe, expect, test } from "vitest";
import { textGenerationPrompt } from "./prompts";

describe("textGenerationPrompt template", () => {
Expand Down
2 changes: 1 addition & 1 deletion packages/lib/utils.test.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { describe, expect, test } from "bun:test";
import { describe, expect, test } from "vitest";
import { pathJoin, pathnameToFilename } from "./utils";

describe("pathJoin", () => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ export function WorkflowDesignerProvider({
}),
);
const [workflowData, setWorkflowData] = useState(data);
const persistTimeoutRef = useRef<Timer | null>(null);
const persistTimeoutRef = useRef<NodeJS.Timeout | null>(null);
const isPendingPersistRef = useRef(false);

const saveWorkflowData = useCallback(async () => {
Expand Down
Loading
Loading