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
129 changes: 2 additions & 127 deletions bun.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

68 changes: 68 additions & 0 deletions e2e/dependency-audit.test.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@
import { describe, it, expect } from 'vitest'
import { readFileSync } from 'fs'
import path from 'path'

function readPkg(relPath: string) {
const full = path.resolve(__dirname, '..', relPath, 'package.json')
return JSON.parse(readFileSync(full, 'utf-8'))
}

describe('P0 dependency audit', () => {
describe('unlisted dependencies are declared', () => {
it('@workkit/astro has @standard-schema/spec in devDependencies', () => {
const pkg = readPkg('integrations/astro')
expect(pkg.devDependencies).toHaveProperty('@standard-schema/spec')
})

it('@workkit/hono has zod in devDependencies', () => {
const pkg = readPkg('integrations/hono')
expect(pkg.devDependencies).toHaveProperty('zod')
})
})

describe('unused runtime dependencies are removed', () => {
it('@workkit/cache has no @workkit/types in dependencies', () => {
const pkg = readPkg('packages/cache')
expect(pkg.dependencies ?? {}).not.toHaveProperty('@workkit/types')
})

it('@workkit/cache has no @workkit/errors in dependencies', () => {
const pkg = readPkg('packages/cache')
expect(pkg.dependencies ?? {}).not.toHaveProperty('@workkit/errors')
})

it('@workkit/crypto has no @workkit/types in dependencies', () => {
const pkg = readPkg('packages/crypto')
expect(pkg.dependencies ?? {}).not.toHaveProperty('@workkit/types')
})

it('@workkit/crypto has no @workkit/errors in dependencies', () => {
const pkg = readPkg('packages/crypto')
expect(pkg.dependencies ?? {}).not.toHaveProperty('@workkit/errors')
})
})

describe('CLI template deps are in devDependencies, not dependencies', () => {
const templateDeps = ['@workkit/types', '@workkit/errors', '@workkit/env', '@workkit/d1']

for (const dep of templateDeps) {
it(`workkit CLI has ${dep} in devDependencies, not dependencies`, () => {
const pkg = readPkg('packages/cli')
expect(pkg.dependencies ?? {}).not.toHaveProperty(dep)
expect(pkg.devDependencies).toHaveProperty(dep)
})
}
})

describe('@standard-schema/spec is a peerDep in remix, not a dep', () => {
it('@workkit/remix has @standard-schema/spec in peerDependencies', () => {
const pkg = readPkg('integrations/remix')
expect(pkg.peerDependencies).toHaveProperty('@standard-schema/spec')
})

it('@workkit/remix does not have @standard-schema/spec in dependencies', () => {
const pkg = readPkg('integrations/remix')
expect(pkg.dependencies ?? {}).not.toHaveProperty('@standard-schema/spec')
})
})
})
9 changes: 2 additions & 7 deletions integrations/astro/package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "@workkit/astro",
"version": "0.0.1",
"description": "Astro integration for Cloudflare Pages — typed env access, binding helpers, middleware",
"description": "Astro integration for Cloudflare Pages \u2014 typed env access, binding helpers, middleware",
"license": "MIT",
"author": "Bikash Dash <beeeku>",
"repository": {
Expand Down Expand Up @@ -43,12 +43,7 @@
"astro": ">=4.0.0"
},
"devDependencies": {
"@cloudflare/workers-types": "^4.20250310.0",
"@standard-schema/spec": "^1.1.0",
"bunup": "0.16.31",
"expect-type": "^1.1.0",
"typescript": "^5.7.0",
"vitest": "^3.0.0"
"@standard-schema/spec": "^1.1.0"
},
"keywords": [
"cloudflare",
Expand Down
7 changes: 1 addition & 6 deletions integrations/hono/package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "@workkit/hono",
"version": "0.0.1",
"description": "Hono middleware that integrates workkit utilities — env validation, error handling, rate limiting, caching",
"description": "Hono middleware that integrates workkit utilities \u2014 env validation, error handling, rate limiting, caching",
"license": "MIT",
"author": "Bikash Dash <beeeku>",
"repository": {
Expand Down Expand Up @@ -43,12 +43,7 @@
"hono": ">=4.0.0"
},
"devDependencies": {
"@cloudflare/workers-types": "^4.20250310.0",
"bunup": "0.16.31",
"expect-type": "^1.1.0",
"hono": "^4.7.0",
"typescript": "^5.7.0",
"vitest": "^3.0.0",
"zod": "^3.24.0"
},
"keywords": [
Expand Down
Loading
Loading