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
4 changes: 4 additions & 0 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,10 @@ jobs:
uses: ./.github/actions/setup
- name: lint
run: pnpm run lint
- name: typecheck
run: pnpm run typecheck
- name: license-header
run: pnpm run license-header -- --check
test:
runs-on: ubuntu-latest
steps:
Expand Down
10 changes: 0 additions & 10 deletions .prettierignore

This file was deleted.

49 changes: 49 additions & 0 deletions biome.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
{
"$schema": "https://biomejs.dev/schemas/2.5.0/schema.json",
"vcs": {
"enabled": true,
"clientKind": "git",
"useIgnoreFile": true
},
"files": {
"ignoreUnknown": true,
"includes": [
"**",
"!**/dist",
"!packages/knit-test-spec/spec",
"!packages/knit-test-spec/buf",
"!**/tsconfig*.json"
]
},
"formatter": {
"indentStyle": "space"
},
"linter": {
"rules": {
"preset": "recommended",
"style": {
"useTemplate": "off",
"useConst": "off",
"noParameterAssign": "off",
"useSingleVarDeclarator": "off",
"useNumberNamespace": "off",
"noUnusedTemplateLiteral": "off"
},
"correctness": {
"noSwitchDeclarations": "off"
},
"suspicious": {
"noDoubleEquals": "off",
"noFallthroughSwitchClause": "off"
}
}
},
"overrides": [
{
"includes": ["**/*.test.ts", "**/src/testing/**", "**/tsup.config.ts"],
"linter": {
"enabled": false
}
}
]
}
17 changes: 11 additions & 6 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,19 +8,24 @@
"scripts": {
"clean": "turbo run clean --no-daemon --cache-dir=.turbo",
"build": "turbo run build --no-daemon --cache-dir=.turbo",
"lint": "turbo run lint --no-daemon --cache-dir=.turbo",
"attw": "turbo run attw --no-daemon --cache-dir=.turbo",
"test": "turbo run test --no-daemon --cache-dir=.turbo",
"test:watch": "turbo run test:watch --no-daemon --cache-dir=.turbo",
"typecheck": "turbo run typecheck --no-daemon --cache-dir=.turbo",
"buf:generate": "turbo run buf:generate --no-daemon --cache-dir=.turbo",
"format": "prettier --write \"**/*.{ts,tsx,md}\""
"lint": "biome lint --error-on-warnings",
"format": "biome format --write",
"license-header": "license-header --ignore 'packages/*/dist/**' --ignore 'packages/knit-test-spec/spec/**' --ignore 'packages/knit-test-spec/buf/**' --ignore 'packages/knit-test-spec/proto/**'"
},
"licenseHeader": {
"licenseType": "apache",
"yearRange": "2023-2024",
"copyrightHolder": "Buf Technologies, Inc."
},
"devDependencies": {
"@types/node": "^25.9.3",
"eslint-config-custom": "workspace:*",
"jest": "^30.4.2",
"prettier": "^3.8.4",
"ts-jest": "^29.4.11",
"@biomejs/biome": "^2.5.0",
"@bufbuild/license-header": "^0.0.4",
"turbo": "^2.9.18",
"typescript": "^6.0.3",
"@arethetypeswrong/cli": "^0.18.3"
Expand Down
121 changes: 0 additions & 121 deletions packages/eslint-config-custom/index.js

This file was deleted.

13 changes: 0 additions & 13 deletions packages/eslint-config-custom/license-header

This file was deleted.

28 changes: 0 additions & 28 deletions packages/eslint-config-custom/package.json

This file was deleted.

2 changes: 1 addition & 1 deletion packages/knit-test-spec/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,4 +16,4 @@
"@bufbuild/protoc-gen-es": "^2.12.0",
"@bufbuild/protoc-gen-knit-ts": "workspace:*"
}
}
}
22 changes: 0 additions & 22 deletions packages/knit/eslint.config.mjs

This file was deleted.

54 changes: 0 additions & 54 deletions packages/knit/jest.config.js

This file was deleted.

12 changes: 6 additions & 6 deletions packages/knit/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,11 @@
"type": "module",
"scripts": {
"clean": "rm -rf ./dist/* .turbo/*",
"lint": "eslint .",
"attw": "attw --pack",
"test": "NODE_OPTIONS=--experimental-vm-modules ../../node_modules/.bin/jest",
"test:watch": "pnpm run build:esm+types --watch & pnpm run test --watchAll",
"typecheck": "tsc --noEmit -p tsconfig.test.json",
"test": "tsx --test $(find src -type f -path '*.test.ts')",

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

This could be "test": "tsx --test 'src/**/*.test.ts'",, letting tsx/node expand the glob. All actively versions of Node.js support it. But we should bump the engine min constraint along with this change, and I didn't want to do that. find works well enough here.

"test:watch": "tsx --watch --test $(find src -type f -path '*.test.ts')",
"test:update-snapshots": "tsx --test --test-update-snapshots $(find src -type f -path '*.test.ts')",
"build:esm": "tsup --format esm",
"build:cjs": "tsup --format cjs && mv ./dist/cjs/index.d.cts ./dist/cjs/index.d.ts && mv ./dist/cjs/gateway/index.d.cts ./dist/cjs/gateway/index.d.ts",
"build": "pnpm run build:esm && pnpm run build:cjs"
Expand Down Expand Up @@ -58,10 +59,9 @@
"devDependencies": {
"@buf/bufbuild_knit.bufbuild_es": "2.12.0-20250213130123-9561c696fd69.1",
"@bufbuild/knit-test-spec": "workspace:*",
"@jest/globals": "^30.4.1",
"eslint-config-custom": "workspace:*",
"tsconfig": "workspace:*",
"tsup": "^8.5.1"
"tsup": "^8.5.1",
"tsx": "^4.22.4"
},
"files": [
"dist/**"
Expand Down
2 changes: 1 addition & 1 deletion packages/knit/src/alias.ts
Original file line number Diff line number Diff line change
Expand Up @@ -81,5 +81,5 @@ export function getAlias(
if (!(aliasSymbol in v && "value" in v)) {
return undefined;
}
return { alias: v[aliasSymbol] as string, value: v["value"] };
return { alias: v[aliasSymbol] as string, value: v.value };
}
Loading
Loading