@icebreakers/monorepo-templates 1.0.14 → 1.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/assets/.changeset/ledger.yaml +26 -0
- package/assets/.github/workflows/release.yml +35 -54
- package/assets/AGENTS.md +1 -1
- package/assets/package.json +15 -14
- package/assets/pnpm-workspace.yaml +8 -0
- package/assets/renovate.json +11 -0
- package/dist/cli.d.mts +1 -1
- package/package.json +1 -1
- package/templates/cli/package.json +1 -1
- package/templates/client/package.json +18 -18
- package/templates/client/tsconfig.app.json +0 -1
- package/templates/client/worker-configuration.d.ts +121 -13
- package/templates/server/package.json +6 -6
- package/templates/server/src/app.ts +3 -1
- package/templates/server/tsconfig.json +5 -4
- package/templates/server/tsconfig.worker.json +16 -0
- package/templates/server/vitest.config.ts +1 -4
- package/templates/server/worker-configuration.d.ts +121 -13
- package/templates/tsdown/vitest.config.ts +1 -4
- package/templates/vitepress/ai/llms-txt.md +6 -6
- package/templates/vitepress/en/repoctl/index.md +1 -1
- package/templates/vitepress/knowledge/index.md +1 -1
- package/templates/vitepress/monorepo/index.md +1 -1
- package/templates/vitepress/monorepo/publish.md +45 -217
- package/templates/vitepress/package.json +4 -4
- package/templates/vitepress/repoctl/index.md +1 -1
- package/templates/vitepress/thinking.md +1 -1
- package/templates/vitepress/tools/changeset.md +40 -63
- package/templates/vitepress/tools/index.md +10 -10
- package/templates/vue-lib/package.json +4 -4
- package/templates/vue-lib/vitest.config.ts +1 -1
- package/assets/.changeset/config.json +0 -21
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
"@icebreakers/monorepo-templates@1.1.0":
|
|
2
|
+
dir: packages/monorepo-templates
|
|
3
|
+
intents:
|
|
4
|
+
- pnpm-native-versioning
|
|
5
|
+
- release-ci-token
|
|
6
|
+
- repoctl-release-orchestration
|
|
7
|
+
- vitest-native-config
|
|
8
|
+
"@icebreakers/monorepo@5.1.0":
|
|
9
|
+
dir: packages/monorepo
|
|
10
|
+
intents:
|
|
11
|
+
- close-legacy-release-pr
|
|
12
|
+
- human-readable-release-notes
|
|
13
|
+
- pnpm-native-versioning
|
|
14
|
+
- publish-versioned-packages
|
|
15
|
+
- release-ci-token
|
|
16
|
+
- release-links
|
|
17
|
+
- release-npm-links
|
|
18
|
+
- release-npm-links-prepublish
|
|
19
|
+
- release-pr-body
|
|
20
|
+
- release-pr-layout
|
|
21
|
+
- release-test-isolation
|
|
22
|
+
- repoctl-release-orchestration
|
|
23
|
+
create-icebreaker@1.1.0:
|
|
24
|
+
dir: packages/create-icebreaker
|
|
25
|
+
intents:
|
|
26
|
+
- pnpm-native-versioning
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
# repoctl-managed: release/v2
|
|
1
2
|
name: Release
|
|
2
3
|
|
|
3
4
|
on:
|
|
@@ -9,20 +10,41 @@ on:
|
|
|
9
10
|
- rc
|
|
10
11
|
- next
|
|
11
12
|
workflow_dispatch:
|
|
13
|
+
inputs:
|
|
14
|
+
mode:
|
|
15
|
+
description: Release operation
|
|
16
|
+
required: true
|
|
17
|
+
default: auto
|
|
18
|
+
type: choice
|
|
19
|
+
options:
|
|
20
|
+
- auto
|
|
21
|
+
- prepare
|
|
22
|
+
- publish
|
|
23
|
+
- publish-unpublished
|
|
24
|
+
package:
|
|
25
|
+
description: Package used for unpublished-version recovery
|
|
26
|
+
required: false
|
|
27
|
+
type: string
|
|
28
|
+
version:
|
|
29
|
+
description: Version used for unpublished-version recovery
|
|
30
|
+
required: false
|
|
31
|
+
type: string
|
|
12
32
|
|
|
13
33
|
concurrency: ${{ github.workflow }}-${{ github.ref }}
|
|
34
|
+
|
|
14
35
|
env:
|
|
15
36
|
HUSKY: 0
|
|
37
|
+
NPM_CONFIG_PROVENANCE: true
|
|
38
|
+
npm_config_registry: https://registry.npmjs.org
|
|
16
39
|
|
|
17
40
|
permissions:
|
|
18
|
-
contents: write
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
id-token: write # to use OpenID Connect token for provenance (changesets/action)
|
|
41
|
+
contents: write
|
|
42
|
+
pull-requests: write
|
|
43
|
+
id-token: write
|
|
22
44
|
|
|
23
45
|
jobs:
|
|
24
46
|
release:
|
|
25
|
-
if: github.
|
|
47
|
+
if: github.event_name == 'push' || github.event_name == 'workflow_dispatch'
|
|
26
48
|
name: Release
|
|
27
49
|
runs-on: ubuntu-latest
|
|
28
50
|
steps:
|
|
@@ -36,56 +58,15 @@ jobs:
|
|
|
36
58
|
with:
|
|
37
59
|
node-version: 24
|
|
38
60
|
cache: pnpm
|
|
61
|
+
registry-url: https://registry.npmjs.org
|
|
39
62
|
|
|
40
63
|
- name: Install Dependencies
|
|
41
|
-
run: pnpm
|
|
42
|
-
|
|
43
|
-
- name: Create Release Pull Request or Publish to npm
|
|
44
|
-
id: changesets
|
|
45
|
-
uses: changesets/action@v1
|
|
46
|
-
with:
|
|
47
|
-
publish: pnpm exec repo release stable
|
|
48
|
-
env:
|
|
49
|
-
# this doesn't work but semantic-release works
|
|
50
|
-
# see https://github.com/sonofmagic/npm-lib-rollup-template/blob/main/.github/workflows/release.yml#L46
|
|
51
|
-
# NODE_AUTH_TOKEN: ${{secrets.NPM_TOKEN}}
|
|
52
|
-
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
|
53
|
-
# NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
|
|
54
|
-
npm_config_registry: https://registry.npmjs.org
|
|
55
|
-
# https://github.com/changesets/changesets/pull/1659
|
|
56
|
-
NPM_CONFIG_PROVENANCE: true
|
|
57
|
-
|
|
58
|
-
- name: Upload coverage reports to Codecov
|
|
59
|
-
uses: codecov/codecov-action@v7
|
|
60
|
-
env:
|
|
61
|
-
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
|
|
62
|
-
|
|
63
|
-
prerelease:
|
|
64
|
-
if: github.ref_name != 'main'
|
|
65
|
-
name: Prerelease
|
|
66
|
-
runs-on: ubuntu-latest
|
|
67
|
-
steps:
|
|
68
|
-
- name: Checkout Repo
|
|
69
|
-
uses: actions/checkout@v7
|
|
70
|
-
|
|
71
|
-
- uses: pnpm/action-setup@v6
|
|
72
|
-
|
|
73
|
-
- name: Setup Node.js environment
|
|
74
|
-
uses: actions/setup-node@v7
|
|
75
|
-
with:
|
|
76
|
-
node-version: 24
|
|
77
|
-
cache: pnpm
|
|
78
|
-
|
|
79
|
-
- name: Install Dependencies
|
|
80
|
-
run: pnpm i
|
|
81
|
-
|
|
82
|
-
- name: Configure Git
|
|
83
|
-
run: |
|
|
84
|
-
git config user.name "github-actions[bot]"
|
|
85
|
-
git config user.email "41898282+github-actions[bot]@users.noreply.github.com"
|
|
64
|
+
run: pnpm install --frozen-lockfile
|
|
86
65
|
|
|
87
|
-
- name:
|
|
88
|
-
run: pnpm exec repo release pre publish
|
|
66
|
+
- name: Run repo release CI
|
|
89
67
|
env:
|
|
90
|
-
|
|
91
|
-
|
|
68
|
+
GITHUB_TOKEN: ${{ github.token }}
|
|
69
|
+
REPO_RELEASE_MODE: ${{ inputs.mode || 'auto' }}
|
|
70
|
+
REPO_RELEASE_PACKAGE: ${{ inputs.package }}
|
|
71
|
+
REPO_RELEASE_VERSION: ${{ inputs.version }}
|
|
72
|
+
run: pnpm exec repo release ci
|
package/assets/AGENTS.md
CHANGED
|
@@ -40,7 +40,7 @@ When building TypeScript libraries (type-focused APIs or public type definitions
|
|
|
40
40
|
|
|
41
41
|
## Commit & Pull Request Guidelines
|
|
42
42
|
|
|
43
|
-
Commits must conform to Conventional Commit syntax; recent history uses prefixes like `feat`, `fix`, and `chore`. Example: `feat(server): add auth router`. Use `pnpm commit` (commitlint prompt) or ensure your manual message passes `pnpm commitlint --edit`. Before opening a PR, make sure `pnpm lint` and `pnpm test` succeed, link related issues, and provide screenshots or logs for user-facing changes. Touching publishable packages requires a
|
|
43
|
+
Commits must conform to Conventional Commit syntax; recent history uses prefixes like `feat`, `fix`, and `chore`. Example: `feat(server): add auth router`. Use `pnpm commit` (commitlint prompt) or ensure your manual message passes `pnpm commitlint --edit`. Before opening a PR, make sure `pnpm lint` and `pnpm test` succeed, link related issues, and provide screenshots or logs for user-facing changes. Touching publishable packages requires a pnpm change intent (`pnpm change`) so releases stay traceable.
|
|
44
44
|
|
|
45
45
|
For AI-generated or AI-assisted changes, use this verification order before commit or PR:
|
|
46
46
|
|
package/assets/package.json
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
"type": "module",
|
|
4
4
|
"version": "0.0.0",
|
|
5
5
|
"private": true,
|
|
6
|
-
"packageManager": "pnpm@11.
|
|
6
|
+
"packageManager": "pnpm@11.21.0",
|
|
7
7
|
"author": "ice breaker <hi@sonofmagic.top>",
|
|
8
8
|
"repository": {
|
|
9
9
|
"type": "git",
|
|
@@ -25,11 +25,14 @@
|
|
|
25
25
|
"tsd": "turbo run tsd",
|
|
26
26
|
"audit": "pnpm audit --audit-level=moderate",
|
|
27
27
|
"audit:fix": "pnpm audit --fix",
|
|
28
|
+
"cf-typegen": "pnpm --filter @icebreakers/client --filter @icebreakers/server run cf-typegen",
|
|
29
|
+
"cf-typegen:check": "pnpm --filter @icebreakers/client --filter @icebreakers/server run cf-typegen:check",
|
|
28
30
|
"typecheck": "turbo run typecheck",
|
|
29
31
|
"format": "eslint . --fix",
|
|
30
32
|
"validate": "pnpm run build && pnpm run lint && pnpm run typecheck && pnpm run tsd && pnpm run test",
|
|
31
|
-
"release": "
|
|
32
|
-
"
|
|
33
|
+
"release": "pnpm change",
|
|
34
|
+
"version-packages": "pnpm version -r",
|
|
35
|
+
"publish-packages": "repo release stable publish",
|
|
33
36
|
"release:pre": "repo release pre publish",
|
|
34
37
|
"------": "--------------",
|
|
35
38
|
"preinstall": "npx only-allow pnpm",
|
|
@@ -50,20 +53,18 @@
|
|
|
50
53
|
"--------": "----------------"
|
|
51
54
|
},
|
|
52
55
|
"devDependencies": {
|
|
53
|
-
"@
|
|
54
|
-
"@commitlint/cli": "^21.2.1",
|
|
55
|
-
"@icebreakers/changelog-github": "^2.0.0",
|
|
56
|
+
"@commitlint/cli": "^21.2.2",
|
|
56
57
|
"@icebreakers/monorepo": "workspace:*",
|
|
57
|
-
"@types/node": "^26.
|
|
58
|
-
"@types/semver": "^7.
|
|
58
|
+
"@types/node": "^26.2.0",
|
|
59
|
+
"@types/semver": "^7.8.0",
|
|
59
60
|
"@vitest/coverage-v8": "~4.1.10",
|
|
60
61
|
"ci-info": "^4.4.0",
|
|
61
62
|
"cross-env": "^10.1.0",
|
|
62
63
|
"defu": "^6.1.7",
|
|
63
|
-
"es-toolkit": "^1.
|
|
64
|
-
"eslint": "^10.
|
|
64
|
+
"es-toolkit": "^1.50.0",
|
|
65
|
+
"eslint": "^10.8.1",
|
|
65
66
|
"husky": "^9.1.7",
|
|
66
|
-
"lint-staged": "^17.
|
|
67
|
+
"lint-staged": "^17.3.0",
|
|
67
68
|
"only-allow": "^1.2.2",
|
|
68
69
|
"pathe": "^2.0.3",
|
|
69
70
|
"pkg-types": "^2.3.1",
|
|
@@ -71,10 +72,10 @@
|
|
|
71
72
|
"stylelint": "^17.14.1",
|
|
72
73
|
"tailwindcss": "^4.3.3",
|
|
73
74
|
"tsd": "^0.33.0",
|
|
74
|
-
"tsdown": "0.22.
|
|
75
|
+
"tsdown": "0.22.14",
|
|
75
76
|
"tslib": "^2.8.1",
|
|
76
|
-
"tsx": "^4.23.
|
|
77
|
-
"turbo": "^2.10.
|
|
77
|
+
"tsx": "^4.23.12",
|
|
78
|
+
"turbo": "^2.10.10",
|
|
78
79
|
"type-fest": "^5.8.0",
|
|
79
80
|
"typescript": "^6.0.3",
|
|
80
81
|
"vitest": "~4.1.10",
|
package/assets/renovate.json
CHANGED
|
@@ -23,6 +23,17 @@
|
|
|
23
23
|
"pin",
|
|
24
24
|
"digest"
|
|
25
25
|
]
|
|
26
|
+
},
|
|
27
|
+
{
|
|
28
|
+
"matchManagers": [
|
|
29
|
+
"npm"
|
|
30
|
+
],
|
|
31
|
+
"matchPackageNames": [
|
|
32
|
+
"wrangler",
|
|
33
|
+
"@cloudflare/vite-plugin"
|
|
34
|
+
],
|
|
35
|
+
"groupName": "Cloudflare Workers tooling",
|
|
36
|
+
"groupSlug": "cloudflare-workers-tooling"
|
|
26
37
|
}
|
|
27
38
|
]
|
|
28
39
|
}
|
package/dist/cli.d.mts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export {
|
|
1
|
+
export {}
|
package/package.json
CHANGED
|
@@ -11,27 +11,27 @@
|
|
|
11
11
|
"preview": "vite preview",
|
|
12
12
|
"deploy": "wrangler deploy",
|
|
13
13
|
"cf-typegen": "wrangler types",
|
|
14
|
-
"
|
|
15
|
-
"typecheck": "vue-tsc -b"
|
|
14
|
+
"cf-typegen:check": "wrangler types --check",
|
|
15
|
+
"typecheck": "pnpm cf-typegen:check && vue-tsc -b"
|
|
16
16
|
},
|
|
17
17
|
"dependencies": {
|
|
18
|
-
"@faker-js/faker": "^10.
|
|
19
|
-
"@tanstack/vue-query": "^5.101.
|
|
20
|
-
"@tanstack/vue-query-devtools": "^6.1.
|
|
21
|
-
"@tanstack/vue-table": "^
|
|
22
|
-
"@tanstack/vue-virtual": "^3.13.
|
|
18
|
+
"@faker-js/faker": "^10.6.0",
|
|
19
|
+
"@tanstack/vue-query": "^5.101.4",
|
|
20
|
+
"@tanstack/vue-query-devtools": "^6.1.38",
|
|
21
|
+
"@tanstack/vue-table": "^9.1.2",
|
|
22
|
+
"@tanstack/vue-virtual": "^3.13.35",
|
|
23
23
|
"@trpc/client": "^11.18.0",
|
|
24
24
|
"clsx": "^2.1.1",
|
|
25
|
-
"pinia": "^4.0.
|
|
25
|
+
"pinia": "^4.0.3",
|
|
26
26
|
"tailwind-merge": "^3.6.0",
|
|
27
|
-
"tailwind-variants": "^3.
|
|
28
|
-
"vue": "^3.5.
|
|
29
|
-
"vue-i18n": "^11.4.
|
|
27
|
+
"tailwind-variants": "^3.3.1",
|
|
28
|
+
"vue": "^3.5.41",
|
|
29
|
+
"vue-i18n": "^11.4.8",
|
|
30
30
|
"vue-router": "^5.2.0"
|
|
31
31
|
},
|
|
32
32
|
"devDependencies": {
|
|
33
|
-
"@cloudflare/vite-plugin": "^1.
|
|
34
|
-
"@hono/node-server": "^2.
|
|
33
|
+
"@cloudflare/vite-plugin": "^1.52.1",
|
|
34
|
+
"@hono/node-server": "^2.1.1",
|
|
35
35
|
"@hono/trpc-server": "^0.4.2",
|
|
36
36
|
"@tailwindcss/vite": "^4.3.3",
|
|
37
37
|
"@trpc/server": "^11.18.0",
|
|
@@ -39,14 +39,14 @@
|
|
|
39
39
|
"@vitejs/plugin-vue-jsx": "^5.1.6",
|
|
40
40
|
"@vue/tsconfig": "^0.9.1",
|
|
41
41
|
"consola": "^3.4.2",
|
|
42
|
-
"hono": "^4.
|
|
42
|
+
"hono": "^4.13.2",
|
|
43
43
|
"tailwindcss": "^4.3.3",
|
|
44
44
|
"typescript": "~6.0.3",
|
|
45
|
-
"vite": "^8.1
|
|
46
|
-
"vite-plugin-vue-devtools": "^8.1
|
|
45
|
+
"vite": "^8.2.1",
|
|
46
|
+
"vite-plugin-vue-devtools": "^8.2.1",
|
|
47
47
|
"vite-tsconfig-paths": "^6.1.1",
|
|
48
|
-
"vue-tsc": "3.3.
|
|
49
|
-
"wrangler": "^4.
|
|
48
|
+
"vue-tsc": "3.3.9",
|
|
49
|
+
"wrangler": "^4.123.0",
|
|
50
50
|
"zod": "^4.4.3"
|
|
51
51
|
}
|
|
52
52
|
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/* eslint-disable */
|
|
2
2
|
// Generated by Wrangler by running `wrangler types` (hash: bf05258867cf7490d4c96f4ea30bd0ef)
|
|
3
|
-
// Runtime types generated with workerd@1.
|
|
3
|
+
// Runtime types generated with workerd@1.20260811.1 2025-10-16 nodejs_compat
|
|
4
4
|
interface __BaseEnv_Env {
|
|
5
5
|
}
|
|
6
6
|
declare namespace Cloudflare {
|
|
@@ -435,6 +435,7 @@ interface ExecutionContext<Props = unknown> {
|
|
|
435
435
|
cache?: CacheContext;
|
|
436
436
|
readonly access?: CloudflareAccessContext;
|
|
437
437
|
tracing: Tracing;
|
|
438
|
+
abort(reason?: any): void;
|
|
438
439
|
}
|
|
439
440
|
type ExportedHandlerFetchHandler<Env = unknown, CfHostMetadata = unknown, Props = unknown> = (request: Request<CfHostMetadata, IncomingRequestCfProperties<CfHostMetadata>>, env: Env, ctx: ExecutionContext<Props>) => Response | Promise<Response>;
|
|
440
441
|
type ExportedHandlerConnectHandler<Env = unknown, Props = unknown> = (socket: Socket, env: Env, ctx: ExecutionContext<Props>) => void | Promise<void>;
|
|
@@ -2767,6 +2768,12 @@ interface TraceLog {
|
|
|
2767
2768
|
readonly timestamp: number;
|
|
2768
2769
|
readonly level: string;
|
|
2769
2770
|
readonly message: any;
|
|
2771
|
+
readonly errorInfo?: (TraceLogErrorInfo | null)[];
|
|
2772
|
+
}
|
|
2773
|
+
interface TraceLogErrorInfo {
|
|
2774
|
+
name: string;
|
|
2775
|
+
message: string;
|
|
2776
|
+
stack?: string;
|
|
2770
2777
|
}
|
|
2771
2778
|
interface TraceException {
|
|
2772
2779
|
readonly timestamp: number;
|
|
@@ -3307,18 +3314,26 @@ interface ContainerExecOptions {
|
|
|
3307
3314
|
cwd?: string;
|
|
3308
3315
|
env?: Record<string, string>;
|
|
3309
3316
|
user?: string;
|
|
3317
|
+
signal?: AbortSignal;
|
|
3318
|
+
pty?: boolean | ContainerExecPtyOptions;
|
|
3310
3319
|
stdin?: ReadableStream | "pipe";
|
|
3311
3320
|
stdout?: "pipe" | "ignore";
|
|
3312
3321
|
stderr?: "pipe" | "ignore" | "combined";
|
|
3313
3322
|
}
|
|
3323
|
+
interface ContainerExecPtyOptions {
|
|
3324
|
+
cols?: number;
|
|
3325
|
+
rows?: number;
|
|
3326
|
+
}
|
|
3314
3327
|
interface ExecProcess {
|
|
3315
3328
|
readonly stdin: WritableStream | null;
|
|
3316
3329
|
readonly stdout: ReadableStream | null;
|
|
3317
3330
|
readonly stderr: ReadableStream | null;
|
|
3318
3331
|
readonly pid: number;
|
|
3332
|
+
readonly isPty: boolean;
|
|
3319
3333
|
readonly exitCode: Promise<number>;
|
|
3320
3334
|
output(): Promise<ExecOutput>;
|
|
3321
3335
|
kill(signal?: number): void;
|
|
3336
|
+
resize(cols: number, rows: number): void;
|
|
3322
3337
|
}
|
|
3323
3338
|
interface Container {
|
|
3324
3339
|
get running(): boolean;
|
|
@@ -3365,6 +3380,11 @@ interface ContainerStartupOptions {
|
|
|
3365
3380
|
directorySnapshots?: ContainerDirectorySnapshotRestoreParams[];
|
|
3366
3381
|
containerSnapshot?: ContainerSnapshot;
|
|
3367
3382
|
}
|
|
3383
|
+
interface ContainerStartResources {
|
|
3384
|
+
vcpu: number;
|
|
3385
|
+
memoryMib: number;
|
|
3386
|
+
diskMb: number;
|
|
3387
|
+
}
|
|
3368
3388
|
/**
|
|
3369
3389
|
* The **`MessagePort`** interface of the Channel Messaging API represents one of the two ports of a MessageChannel, allowing messages to be sent from one port and listening out for them arriving at the other.
|
|
3370
3390
|
*
|
|
@@ -3505,11 +3525,13 @@ declare abstract class Performance {
|
|
|
3505
3525
|
interface Tracing {
|
|
3506
3526
|
enterSpan<T, A extends unknown[]>(name: string, callback: (span: Span, ...args: A) => T, ...args: A): T;
|
|
3507
3527
|
startActiveSpan<T, A extends unknown[]>(name: string, callback: (span: Span, ...args: A) => T, ...args: A): T;
|
|
3528
|
+
startSpan(name: string): Span;
|
|
3508
3529
|
Span: typeof Span;
|
|
3509
3530
|
}
|
|
3510
3531
|
declare abstract class Span {
|
|
3511
3532
|
get isTraced(): boolean;
|
|
3512
|
-
setAttribute(key: string, value
|
|
3533
|
+
setAttribute(key: string, value: boolean | number | string): this;
|
|
3534
|
+
setAttributes(attributes: Record<string, boolean | number | string | undefined>): this;
|
|
3513
3535
|
end(): void;
|
|
3514
3536
|
}
|
|
3515
3537
|
/**
|
|
@@ -4149,6 +4171,13 @@ type AiSearchListItemsParams = {
|
|
|
4149
4171
|
source?: string;
|
|
4150
4172
|
/** JSON-encoded Vectorize filter for metadata filtering. */
|
|
4151
4173
|
metadata_filter?: string;
|
|
4174
|
+
/** Filter items by their unique ID. Returns at most one item. */
|
|
4175
|
+
item_id?: string;
|
|
4176
|
+
/**
|
|
4177
|
+
* Filter items by their exact key (object key / filename). Keys are unique
|
|
4178
|
+
* per source, so combine with `source` to disambiguate across data sources.
|
|
4179
|
+
*/
|
|
4180
|
+
key?: string;
|
|
4152
4181
|
};
|
|
4153
4182
|
type AiSearchListItemsResponse = {
|
|
4154
4183
|
result: AiSearchItemInfo[];
|
|
@@ -12437,6 +12466,15 @@ interface Hyperdrive {
|
|
|
12437
12466
|
* for your database.
|
|
12438
12467
|
*/
|
|
12439
12468
|
readonly host: string;
|
|
12469
|
+
/*
|
|
12470
|
+
* A synthetic IPv4 address (in the reserved 240.0.0.0/4 range) that, like the
|
|
12471
|
+
* host field, is only valid within the context of the currently running
|
|
12472
|
+
* Worker and, when passed into the `connect()` function from the
|
|
12473
|
+
* "cloudflare:sockets" module, will connect to the Hyperdrive instance for
|
|
12474
|
+
* your database. This is provided for database drivers that require the host
|
|
12475
|
+
* to be an IP literal rather than a hostname.
|
|
12476
|
+
*/
|
|
12477
|
+
readonly ip: string;
|
|
12440
12478
|
/*
|
|
12441
12479
|
* The port that must be paired the the host field when connecting.
|
|
12442
12480
|
*/
|
|
@@ -13123,6 +13161,26 @@ declare namespace CloudflareWorkersModule {
|
|
|
13123
13161
|
timeout?: WorkflowTimeoutDuration | number;
|
|
13124
13162
|
sensitive?: WorkflowStepSensitivity;
|
|
13125
13163
|
};
|
|
13164
|
+
// Internal discriminators used only for `WorkflowStep.do` overload
|
|
13165
|
+
// resolution. They mirror `WorkflowStepConfig` but pin `retries.delay` to a
|
|
13166
|
+
// single kind so the callback context can be narrowed based on the shape of
|
|
13167
|
+
// the config argument (rather than on an inferred type parameter, which is
|
|
13168
|
+
// lost when the caller supplies an explicit return-type argument). Not
|
|
13169
|
+
// exported: they must not widen the public type surface.
|
|
13170
|
+
type WorkflowStepConfigWithStaticDelay = Omit<WorkflowStepConfig, 'retries'> & {
|
|
13171
|
+
retries?: {
|
|
13172
|
+
limit: number;
|
|
13173
|
+
delay: WorkflowDelayDuration | number;
|
|
13174
|
+
backoff?: WorkflowBackoff;
|
|
13175
|
+
};
|
|
13176
|
+
};
|
|
13177
|
+
type WorkflowStepConfigWithDelayFunction = Omit<WorkflowStepConfig, 'retries'> & {
|
|
13178
|
+
retries: {
|
|
13179
|
+
limit: number;
|
|
13180
|
+
delay: WorkflowDelayFunction;
|
|
13181
|
+
backoff?: WorkflowBackoff;
|
|
13182
|
+
};
|
|
13183
|
+
};
|
|
13126
13184
|
export type WorkflowStepRollbackConfig = Pick<WorkflowStepConfig, 'retries' | 'timeout'>;
|
|
13127
13185
|
export type WorkflowCronSchedule = {
|
|
13128
13186
|
/** Cron expression that triggered this event. */
|
|
@@ -13160,23 +13218,35 @@ declare namespace CloudflareWorkersModule {
|
|
|
13160
13218
|
sensitive?: WorkflowStepSensitivity;
|
|
13161
13219
|
};
|
|
13162
13220
|
};
|
|
13163
|
-
|
|
13164
|
-
|
|
13221
|
+
// The rollback handler receives the step context, so it mirrors the same
|
|
13222
|
+
// delay discriminant as the step callback: when the step was configured with
|
|
13223
|
+
// a dynamic delay function the resolved `config.retries.delay` is omitted,
|
|
13224
|
+
// otherwise it is present. `Delay` is threaded from the `WorkflowStep.do`
|
|
13225
|
+
// overload that matched the step config.
|
|
13226
|
+
export type WorkflowRollbackContext<T = unknown, Delay = WorkflowDelayDuration | number> = {
|
|
13227
|
+
ctx: WorkflowStepContext<Delay>;
|
|
13165
13228
|
error: Error;
|
|
13166
13229
|
output: T | undefined;
|
|
13167
13230
|
/** @deprecated Use `ctx.step.name` and `ctx.step.count` instead. */
|
|
13168
13231
|
stepName: string;
|
|
13169
13232
|
};
|
|
13170
|
-
export type WorkflowRollbackHandler<T = unknown> = (ctx: WorkflowRollbackContext<T>) => Promise<void>;
|
|
13171
|
-
export type WorkflowStepRollbackOptions<T = unknown> = {
|
|
13172
|
-
rollback: WorkflowRollbackHandler<T>;
|
|
13233
|
+
export type WorkflowRollbackHandler<T = unknown, Delay = WorkflowDelayDuration | number> = (ctx: WorkflowRollbackContext<T, Delay>) => Promise<void>;
|
|
13234
|
+
export type WorkflowStepRollbackOptions<T = unknown, Delay = WorkflowDelayDuration | number> = {
|
|
13235
|
+
rollback: WorkflowRollbackHandler<T, Delay>;
|
|
13173
13236
|
rollbackConfig?: WorkflowStepRollbackConfig;
|
|
13174
13237
|
};
|
|
13175
13238
|
export abstract class WorkflowStep {
|
|
13176
13239
|
do<T extends Rpc.Serializable<T>>(name: string, callback: (ctx: WorkflowStepContext) => Promise<T>, rollbackOptions?: WorkflowStepRollbackOptions<T>): Promise<T>;
|
|
13177
|
-
|
|
13178
|
-
|
|
13179
|
-
|
|
13240
|
+
// The config overloads discriminate on the shape of `config.retries.delay`
|
|
13241
|
+
// so the callback context reflects whether the resolved delay is present
|
|
13242
|
+
// (static delay) or omitted (dynamic delay function). Each has a single
|
|
13243
|
+
// type parameter, so an explicit return-type argument (`do<T>(...)`) still
|
|
13244
|
+
// resolves here. ORDERING IS LOAD-BEARING: the broad `WorkflowStepConfig`
|
|
13245
|
+
// fallback MUST remain last, otherwise it shadows the discriminating
|
|
13246
|
+
// overloads and narrowing is silently lost.
|
|
13247
|
+
do<T extends Rpc.Serializable<T>>(name: string, config: WorkflowStepConfigWithDelayFunction, callback: (ctx: WorkflowStepContext<WorkflowDelayFunction>) => Promise<T>, rollbackOptions?: WorkflowStepRollbackOptions<T, WorkflowDelayFunction>): Promise<T>;
|
|
13248
|
+
do<T extends Rpc.Serializable<T>>(name: string, config: WorkflowStepConfigWithStaticDelay, callback: (ctx: WorkflowStepContext<WorkflowDelayDuration | number>) => Promise<T>, rollbackOptions?: WorkflowStepRollbackOptions<T, WorkflowDelayDuration | number>): Promise<T>;
|
|
13249
|
+
do<T extends Rpc.Serializable<T>>(name: string, config: WorkflowStepConfig, callback: (ctx: WorkflowStepContext) => Promise<T>, rollbackOptions?: WorkflowStepRollbackOptions<T>): Promise<T>;
|
|
13180
13250
|
sleep: (name: string, duration: WorkflowSleepDuration) => Promise<void>;
|
|
13181
13251
|
sleepUntil: (name: string, timestamp: Date | number) => Promise<void>;
|
|
13182
13252
|
waitForEvent<T extends Rpc.Serializable<T>>(name: string, options: {
|
|
@@ -13951,11 +14021,12 @@ type MarkdownDocument = {
|
|
|
13951
14021
|
name: string;
|
|
13952
14022
|
blob: Blob;
|
|
13953
14023
|
};
|
|
14024
|
+
type OutputFormat = 'markdown' | 'text';
|
|
13954
14025
|
type ConversionResponse = {
|
|
13955
14026
|
id: string;
|
|
13956
14027
|
name: string;
|
|
13957
14028
|
mimeType: string;
|
|
13958
|
-
format:
|
|
14029
|
+
format: OutputFormat;
|
|
13959
14030
|
tokens: number;
|
|
13960
14031
|
data: string;
|
|
13961
14032
|
} | {
|
|
@@ -13972,7 +14043,11 @@ type EmbeddedImageConversionOptions = ImageConversionOptions & {
|
|
|
13972
14043
|
convert?: boolean;
|
|
13973
14044
|
maxConvertedImages?: number;
|
|
13974
14045
|
};
|
|
14046
|
+
type ConversionOutputOptions = {
|
|
14047
|
+
format?: OutputFormat;
|
|
14048
|
+
};
|
|
13975
14049
|
type ConversionOptions = {
|
|
14050
|
+
output?: ConversionOutputOptions;
|
|
13976
14051
|
html?: {
|
|
13977
14052
|
images?: EmbeddedImageConversionOptions & {
|
|
13978
14053
|
convertOGImage?: boolean;
|
|
@@ -14121,11 +14196,22 @@ declare namespace TailStream {
|
|
|
14121
14196
|
readonly message: string;
|
|
14122
14197
|
readonly stack?: string;
|
|
14123
14198
|
}
|
|
14124
|
-
interface
|
|
14199
|
+
interface TailStreamErrorInfo {
|
|
14200
|
+
readonly name: string;
|
|
14201
|
+
readonly message: string;
|
|
14202
|
+
readonly stack?: string;
|
|
14203
|
+
}
|
|
14204
|
+
type Log = {
|
|
14125
14205
|
readonly type: "log";
|
|
14126
14206
|
readonly level: "debug" | "error" | "info" | "log" | "warn";
|
|
14207
|
+
readonly errorInfo?: readonly (TailStreamErrorInfo | null)[];
|
|
14208
|
+
} & ({
|
|
14127
14209
|
readonly message: object;
|
|
14128
|
-
|
|
14210
|
+
readonly truncated?: false;
|
|
14211
|
+
} | {
|
|
14212
|
+
readonly message: string;
|
|
14213
|
+
readonly truncated: true;
|
|
14214
|
+
});
|
|
14129
14215
|
interface DroppedEventsDiagnostic {
|
|
14130
14216
|
readonly diagnosticsType: "droppedEvents";
|
|
14131
14217
|
readonly count: number;
|
|
@@ -14603,7 +14689,25 @@ declare abstract class Workflow<PARAMS = unknown> {
|
|
|
14603
14689
|
* @returns A promise that resolves with a list of handles for the created instances.
|
|
14604
14690
|
*/
|
|
14605
14691
|
public createBatch(batch: WorkflowInstanceCreateOptions<PARAMS>[]): Promise<WorkflowInstance[]>;
|
|
14692
|
+
/**
|
|
14693
|
+
* Delete a batch of Workflow instances and their stored state.
|
|
14694
|
+
* `deleteBatch` is limited to 100 instances at a time. Duplicate IDs are deleted once.
|
|
14695
|
+
* The result contains one entry for each input position; IDs that do not exist are returned as per-instance errors.
|
|
14696
|
+
* @param instanceIds IDs of the Workflow instances to delete
|
|
14697
|
+
* @returns A promise that resolves with the successfully deleted instances and any per-instance errors.
|
|
14698
|
+
*/
|
|
14699
|
+
public deleteBatch(instanceIds: string[]): Promise<WorkflowBatchDeleteResult>;
|
|
14606
14700
|
}
|
|
14701
|
+
type WorkflowBatchDeleteResult = {
|
|
14702
|
+
deleted: {
|
|
14703
|
+
id: string;
|
|
14704
|
+
}[];
|
|
14705
|
+
errors: {
|
|
14706
|
+
id: string;
|
|
14707
|
+
code: number;
|
|
14708
|
+
message: string;
|
|
14709
|
+
}[];
|
|
14710
|
+
};
|
|
14607
14711
|
type WorkflowDurationLabel = 'second' | 'minute' | 'hour' | 'day' | 'week' | 'month' | 'year';
|
|
14608
14712
|
type WorkflowSleepDuration = `${number} ${WorkflowDurationLabel}${'s' | ''}` | number;
|
|
14609
14713
|
type WorkflowRetentionDuration = WorkflowSleepDuration;
|
|
@@ -14690,6 +14794,10 @@ declare abstract class WorkflowInstance {
|
|
|
14690
14794
|
* @param options Options for the restart, including an optional step to restart from.
|
|
14691
14795
|
*/
|
|
14692
14796
|
public restart(options?: WorkflowInstanceRestartOptions): Promise<void>;
|
|
14797
|
+
/**
|
|
14798
|
+
* Delete the instance and its stored state.
|
|
14799
|
+
*/
|
|
14800
|
+
public delete(): Promise<void>;
|
|
14693
14801
|
/**
|
|
14694
14802
|
* Returns the current status of the instance.
|
|
14695
14803
|
*/
|
|
@@ -38,8 +38,8 @@
|
|
|
38
38
|
"lint:fix": "eslint . --fix",
|
|
39
39
|
"deploy": "wrangler deploy",
|
|
40
40
|
"cf-typegen": "wrangler types",
|
|
41
|
-
"
|
|
42
|
-
"typecheck": "tsc -p tsconfig.json"
|
|
41
|
+
"cf-typegen:check": "wrangler types --check",
|
|
42
|
+
"typecheck": "pnpm cf-typegen:check && tsc -p tsconfig.json && tsc -p tsconfig.worker.json"
|
|
43
43
|
},
|
|
44
44
|
"publishConfig": {
|
|
45
45
|
"exports": {
|
|
@@ -54,11 +54,11 @@
|
|
|
54
54
|
"types": "./dist/index.d.ts"
|
|
55
55
|
},
|
|
56
56
|
"devDependencies": {
|
|
57
|
-
"@hono/node-server": "^2.
|
|
57
|
+
"@hono/node-server": "^2.1.1",
|
|
58
58
|
"consola": "^3.4.2",
|
|
59
|
-
"hono": "^4.
|
|
60
|
-
"tsdown": "0.22.
|
|
61
|
-
"wrangler": "^4.
|
|
59
|
+
"hono": "^4.13.2",
|
|
60
|
+
"tsdown": "0.22.14",
|
|
61
|
+
"wrangler": "^4.123.0",
|
|
62
62
|
"zod": "^4.4.3"
|
|
63
63
|
}
|
|
64
64
|
}
|
|
@@ -136,7 +136,9 @@ function toCSSGradient(hour: number): string {
|
|
|
136
136
|
const app = new Hono()
|
|
137
137
|
|
|
138
138
|
app.get('*', async (c) => {
|
|
139
|
-
const request = c.req.raw
|
|
139
|
+
const request = c.req.raw as Request & {
|
|
140
|
+
cf?: { timezone?: string }
|
|
141
|
+
}
|
|
140
142
|
|
|
141
143
|
// Base HTML style
|
|
142
144
|
let html_style = `
|