Skip to content
Merged
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
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
node_modules
.next
.next
.vercel
10 changes: 10 additions & 0 deletions .oxlintrc.jsonc
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,16 @@
"no-warning-comments": "off",
"sort-keys": "off",

"import/extensions": [
"error",
{
"ts": "always",
"tsx": "always",
"ignorePackages": true,
"checkTypeImports": true,
},
],

"vitest/no-conditional-in-test": "off",
"jest/no-conditional-in-test": "off",

Expand Down
2 changes: 1 addition & 1 deletion pages/api/webhook.ts → api/webhook.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { createNodeMiddleware, createProbot } from "probot";

import app from "../../index";
import app from "../index.ts";

// Requires:
// - APP_ID
Expand Down
5 changes: 2 additions & 3 deletions get-changed-packages.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,8 @@ import type {
PackageJSON as ChangesetPackageJSON,
} from "@changesets/types";
import type { Packages, Tool } from "@manypkg/get-packages";
import { safeLoad } from "js-yaml";
import jsYaml from "js-yaml";
import micromatch from "micromatch";
import fetch from "node-fetch";
import type { ProbotOctokit } from "probot";

interface PackageJSON extends ChangesetPackageJSON {
Expand Down Expand Up @@ -145,7 +144,7 @@ export const getChangedPackages = async ({

if (isPnpm) {
const pnpmWorkspaceContent = await fetchTextFile("pnpm-workspace.yaml");
const pnpmWorkspace = safeLoad(pnpmWorkspaceContent) as PnpmWorkspace;
const pnpmWorkspace = jsYaml.safeLoad(pnpmWorkspaceContent) as PnpmWorkspace;

tool = {
tool: "pnpm",
Expand Down
2 changes: 1 addition & 1 deletion index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import humanId from "human-id";
import markdownTable from "markdown-table";
import type { Probot, Context } from "probot";

import { getChangedPackages } from "./get-changed-packages";
import { getChangedPackages } from "./get-changed-packages.ts";

const getReleasePlanMessage = (releasePlan: ReleasePlan | null) => {
if (!releasePlan) return "";
Expand Down
4 changes: 4 additions & 0 deletions knip.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
{
"$schema": "./node_modules/knip/schema.json",
"entry": ["api/**/*.ts"]
}
5 changes: 0 additions & 5 deletions next-env.d.ts

This file was deleted.

9 changes: 1 addition & 8 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
"homepage": "https://github.com/apps/changeset-bot",
"license": "MIT",
"repository": "https://github.com/changesets/bot",
"type": "module",
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ts files are compiled to ESM but we don't have "type": "module", so probably the runtime is threading them as CJS so they error once they execute the first import.
Let's see if now works!

"scripts": {
"format": "oxfmt",
"format:check": "oxfmt --check",
Expand All @@ -29,22 +30,14 @@
"@types/markdown-table": "^2.0.0",
"@types/micromatch": "^4.0.1",
"@types/node": "^25.5.0",
"@types/node-fetch": "^2.5.5",
"@types/react": "^18.0.14",
"@types/react-dom": "^18.0.5",
"human-id": "^1.0.2",
"js-yaml": "^3.14.0",
"markdown-table": "^2.0.0",
"micromatch": "^4.0.2",
"next": "^12.1.6",
"node-fetch": "^2.6.1",
"probot": "^12.2.4",
"react": "^18.2.0",
"react-dom": "^18.2.0",
"typescript": "^6.0.2"
},
"devDependencies": {
"@tsconfig/next": "^2.0.6",
"knip": "^6.11.0",
"msw": "^2.12.14",
"oxfmt": "^0.42.0",
Expand Down
4 changes: 2 additions & 2 deletions test/index.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@ import { setupServer } from "msw/node";
import { Probot, ProbotOctokit } from "probot";
import { aroundEach, beforeAll, describe, it } from "vitest";

import type { PRContext } from "../index";
import changesetBot from "../index";
import type { PRContext } from "../index.ts";
import changesetBot from "../index.ts";

import pullRequestOpen from "./fixtures/pull_request.opened.json";
import pullRequestSynchronize from "./fixtures/pull_request.synchronize.json";
Expand Down
20 changes: 14 additions & 6 deletions tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,12 +1,20 @@
{
"extends": "@tsconfig/next/tsconfig.json",
"compilerOptions": {
"allowJs": false,
"tsBuildInfoFile": "node_modules/.cache/.tsbuildinfo",
"forceConsistentCasingInFileNames": true,
"target": "esnext",
"module": "node16",
"moduleResolution": "node16",
"noEmit": true,
"strict": true,
"moduleResolution": "bundler"
"forceConsistentCasingInFileNames": true,
"allowImportingTsExtensions": true,
"rewriteRelativeImportExtensions": true,
"skipLibCheck": true,
"lib": ["esnext"],
"allowJs": false,
"incremental": false,
"resolveJsonModule": true,
"isolatedModules": true
},
"include": ["next-env.d.ts", "**/*.ts", "**/*.tsx", ".next/types/**/*.ts"],
"include": ["**/*.ts"],
"exclude": ["node_modules"]
}
4 changes: 4 additions & 0 deletions vercel.json
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Added a vercel.json with a minimal configuration setting "framework": null.

This disables Vercel’s framework auto-detection, which was incorrectly identifying the project as Next.js after the migration to native serverless functions.

If the deployment still fails, check the Vercel dashboard → Project Settings → General → Framework Preset, and change it from “Next.js” to “Other”.

Note

I’m not very familiar with Vercel, so I used Claude to help identify potential causes for the log you shared.

Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
{
"$schema": "https://openapi.vercel.sh/vercel.json",
"framework": null
}
Loading