@tailor-platform/sdk 1.50.1 → 1.51.1
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/CHANGELOG.md +60 -0
- package/README.md +1 -0
- package/agent-skills/tailor-sdk/SKILL.md +2 -0
- package/dist/{actor-BeIEiPYM.d.mts → actor-Nag62ZDM.d.mts} +2 -3
- package/dist/application-Bcx-FbDE.mjs +4 -0
- package/dist/{application-CZMzt9jL.mjs → application-Z-fNwyZB.mjs} +50 -14
- package/dist/application-Z-fNwyZB.mjs.map +1 -0
- package/dist/authconnection-BDFTabLQ.d.mts +39 -0
- package/dist/authconnection-BUko4V6H.mjs +16 -0
- package/dist/authconnection-BUko4V6H.mjs.map +1 -0
- package/dist/{brand-D-d15jx3.mjs → brand-Ll48SMXe.mjs} +1 -1
- package/dist/{brand-D-d15jx3.mjs.map → brand-Ll48SMXe.mjs.map} +1 -1
- package/dist/chunk-DLeslSnM.mjs +21 -0
- package/dist/cli/index.d.mts +0 -1
- package/dist/cli/index.mjs +16 -16
- package/dist/cli/lib.d.mts +6 -7
- package/dist/cli/lib.mjs +8 -8
- package/dist/cli/skills.d.mts +0 -1
- package/dist/cli/skills.mjs +1 -1
- package/dist/{client-_kHh0Pip.mjs → client-BwV17byk.mjs} +4 -4
- package/dist/{client-_kHh0Pip.mjs.map → client-BwV17byk.mjs.map} +1 -1
- package/dist/{client-CPW1N1Rs.mjs → client-D_a50aIg.mjs} +1 -1
- package/dist/configure/index.d.mts +5 -5
- package/dist/configure/index.mjs +4 -4
- package/dist/configure/index.mjs.map +1 -1
- package/dist/context-BP5BUdcq.mjs +25 -0
- package/dist/context-BP5BUdcq.mjs.map +1 -0
- package/dist/context-BXDgEQK9.d.mts +68 -0
- package/dist/{crashreport-DHJuSmUc.mjs → crashreport-C4EbRoku.mjs} +1 -1
- package/dist/{crashreport-CvmdFs4i.mjs → crashreport-DauPOrKn.mjs} +5 -5
- package/dist/{crashreport-CvmdFs4i.mjs.map → crashreport-DauPOrKn.mjs.map} +1 -1
- package/dist/{enum-constants-C3KSpsYj.mjs → enum-constants-DI85-fPE.mjs} +1 -1
- package/dist/{enum-constants-C3KSpsYj.mjs.map → enum-constants-DI85-fPE.mjs.map} +1 -1
- package/dist/{errors-pMPXghkO.mjs → errors-C4cJ0M2K.mjs} +1 -1
- package/dist/{errors-pMPXghkO.mjs.map → errors-C4cJ0M2K.mjs.map} +1 -1
- package/dist/{field-DLSIuMTu.mjs → field-BY2vbJ8f.mjs} +1 -1
- package/dist/{field-DLSIuMTu.mjs.map → field-BY2vbJ8f.mjs.map} +1 -1
- package/dist/file-BE5Sy7lP.mjs +54 -0
- package/dist/file-BE5Sy7lP.mjs.map +1 -0
- package/dist/file-Dc4_QrlQ.d.mts +206 -0
- package/dist/{file-utils-DjNi_3U_.mjs → file-utils-BM8t5jCy.mjs} +20 -10
- package/dist/file-utils-BM8t5jCy.mjs.map +1 -0
- package/dist/iconv-BFNfdlIS.d.mts +122 -0
- package/dist/iconv-D0yL88Il.mjs +64 -0
- package/dist/iconv-D0yL88Il.mjs.map +1 -0
- package/dist/idp-B1b4O7ia.d.mts +161 -0
- package/dist/idp-CM7N7iID.mjs +76 -0
- package/dist/idp-CM7N7iID.mjs.map +1 -0
- package/dist/{index-C--7W0UO.d.mts → index-BD99GoHO.d.mts} +4 -5
- package/dist/{index-nV4ZC_Ve.d.mts → index-BXwAT_oE.d.mts} +2 -3
- package/dist/{index-BQ4oi0AI.d.mts → index-CYAZkd4b.d.mts} +2 -3
- package/dist/{index-BjXN1SdY.d.mts → index-CfSjuxzK.d.mts} +2 -3
- package/dist/index-Dy3ZH5Wm.d.mts +46 -0
- package/dist/{index-VJW98BSy.d.mts → index-aiIbrFGw.d.mts} +2 -3
- package/dist/{interceptor-DTNS0EtF.mjs → interceptor-Cr3kZWMc.mjs} +1 -1
- package/dist/{interceptor-DTNS0EtF.mjs.map → interceptor-Cr3kZWMc.mjs.map} +1 -1
- package/dist/{job-M3Avv_SV.mjs → job-4GOnasfT.mjs} +2 -2
- package/dist/{job-M3Avv_SV.mjs.map → job-4GOnasfT.mjs.map} +1 -1
- package/dist/kysely/index.d.mts +0 -1
- package/dist/{kysely-type-B8aRz_oC.mjs → kysely-type-BUoVDC5r.mjs} +2 -2
- package/dist/{kysely-type-B8aRz_oC.mjs.map → kysely-type-BUoVDC5r.mjs.map} +1 -1
- package/dist/{logger-DTNAMYGy.mjs → logger-B1g4I9wT.mjs} +1 -1
- package/dist/{logger-DTNAMYGy.mjs.map → logger-B1g4I9wT.mjs.map} +1 -1
- package/dist/{mock-BfL09ULZ.mjs → mock-B2t5gDMl.mjs} +11 -5
- package/dist/mock-B2t5gDMl.mjs.map +1 -0
- package/dist/{multiline-e3IpANmS.mjs → multiline-G1yF18OH.mjs} +1 -1
- package/dist/{multiline-e3IpANmS.mjs.map → multiline-G1yF18OH.mjs.map} +1 -1
- package/dist/package-json-CAGKAJff.mjs +4 -0
- package/dist/{package-json-6Px8bDpG.mjs → package-json-ZL0MkZOO.mjs} +1 -1
- package/dist/{package-json-6Px8bDpG.mjs.map → package-json-ZL0MkZOO.mjs.map} +1 -1
- package/dist/plugin/builtin/enum-constants/index.d.mts +1 -2
- package/dist/plugin/builtin/enum-constants/index.mjs +1 -1
- package/dist/plugin/builtin/file-utils/index.d.mts +1 -2
- package/dist/plugin/builtin/file-utils/index.mjs +1 -1
- package/dist/plugin/builtin/kysely-type/index.d.mts +1 -2
- package/dist/plugin/builtin/kysely-type/index.mjs +1 -1
- package/dist/plugin/builtin/seed/index.d.mts +1 -2
- package/dist/plugin/builtin/seed/index.mjs +1 -1
- package/dist/plugin/index.d.mts +2 -3
- package/dist/{repl-editor-jZ493eQI.mjs → repl-editor-yAjwS5_M.mjs} +1 -1
- package/dist/{repl-editor-jZ493eQI.mjs.map → repl-editor-yAjwS5_M.mjs.map} +1 -1
- package/dist/runtime/authconnection.d.mts +2 -0
- package/dist/runtime/authconnection.mjs +4 -0
- package/dist/runtime/context.d.mts +2 -0
- package/dist/runtime/context.mjs +4 -0
- package/dist/runtime/file.d.mts +2 -0
- package/dist/runtime/file.mjs +4 -0
- package/dist/runtime/globals.d.mts +103 -0
- package/dist/runtime/globals.mjs +2 -0
- package/dist/runtime/iconv.d.mts +2 -0
- package/dist/runtime/iconv.mjs +4 -0
- package/dist/runtime/idp.d.mts +2 -0
- package/dist/runtime/idp.mjs +4 -0
- package/dist/runtime/index.d.mts +9 -0
- package/dist/runtime/index.mjs +10 -0
- package/dist/runtime/secretmanager.d.mts +2 -0
- package/dist/runtime/secretmanager.mjs +4 -0
- package/dist/runtime/workflow.d.mts +2 -0
- package/dist/runtime/workflow.mjs +4 -0
- package/dist/{runtime-DgsMnMrO.mjs → runtime-CyX4zeod.mjs} +55 -32
- package/dist/runtime-CyX4zeod.mjs.map +1 -0
- package/dist/{schema-C5QjYEc-.mjs → schema-DBq6hr6h.mjs} +3 -3
- package/dist/{schema-C5QjYEc-.mjs.map → schema-DBq6hr6h.mjs.map} +1 -1
- package/dist/{secret-file-BHpxGyNf.mjs → secret-file-DnbmTWec.mjs} +1 -1
- package/dist/{secret-file-BHpxGyNf.mjs.map → secret-file-DnbmTWec.mjs.map} +1 -1
- package/dist/secretmanager-CQTTuCmn.mjs +25 -0
- package/dist/secretmanager-CQTTuCmn.mjs.map +1 -0
- package/dist/secretmanager-Cjq3s2aU.d.mts +55 -0
- package/dist/seed/index.d.mts +0 -1
- package/dist/{seed-DjfAn0BC.mjs → seed-kNk-xLoB.mjs} +7 -2
- package/dist/{seed-DjfAn0BC.mjs.map → seed-kNk-xLoB.mjs.map} +1 -1
- package/dist/{service-DCgJxdg1.mjs → service-DHgJ4YEF.mjs} +3 -3
- package/dist/{service-DCgJxdg1.mjs.map → service-DHgJ4YEF.mjs.map} +1 -1
- package/dist/{tailor-db-field-4bMLe25-.d.mts → tailor-db-field-BhWvOyky.d.mts} +1 -2
- package/dist/{telemetry-C1Y56L5E.mjs → telemetry-C8xKz3GM.mjs} +2 -2
- package/dist/{telemetry-C1Y56L5E.mjs.map → telemetry-C8xKz3GM.mjs.map} +1 -1
- package/dist/telemetry-DQl47E1s.mjs +4 -0
- package/dist/types-BnphjkIJ.mjs +5 -0
- package/dist/{types-sir9UPht.mjs → types-Duhhsx3R.mjs} +2 -2
- package/dist/{types-sir9UPht.mjs.map → types-Duhhsx3R.mjs.map} +1 -1
- package/dist/utils/test/index.d.mts +3 -4
- package/dist/utils/test/index.mjs +1 -1
- package/dist/utils/test/index.mjs.map +1 -1
- package/dist/vitest/environment.d.mts +0 -1
- package/dist/vitest/environment.mjs +1 -1
- package/dist/vitest/index.d.mts +2 -3
- package/dist/vitest/index.mjs +3 -3
- package/dist/vitest/index.mjs.map +1 -1
- package/dist/vitest/setup.d.mts +0 -1
- package/dist/vitest/setup.mjs +1 -1
- package/dist/workflow-DJRr-0nl.mjs +39 -0
- package/dist/workflow-DJRr-0nl.mjs.map +1 -0
- package/dist/workflow-DV_88JEf.d.mts +96 -0
- package/dist/{workflow.generated-OYAu_6zX.d.mts → workflow.generated-DV87DJfO.d.mts} +2 -3
- package/docs/cli/application.md +1 -1
- package/docs/cli/tailordb.md +9 -8
- package/docs/cli-reference.md +17 -16
- package/docs/configuration.md +1 -0
- package/docs/generator/builtin.md +2 -0
- package/docs/runtime.md +113 -0
- package/docs/testing.md +21 -0
- package/package.json +53 -9
- package/dist/application-CZMzt9jL.mjs.map +0 -1
- package/dist/application-v_E2W-Fz.mjs +0 -4
- package/dist/file-utils-DjNi_3U_.mjs.map +0 -1
- package/dist/mock-BfL09ULZ.mjs.map +0 -1
- package/dist/package-json-7sRXVndJ.mjs +0 -4
- package/dist/runtime-DgsMnMrO.mjs.map +0 -1
- package/dist/telemetry-C13VIFpT.mjs +0 -4
- package/dist/types-DoIG6Nij.mjs +0 -5
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,65 @@
|
|
|
1
1
|
# @tailor-platform/sdk
|
|
2
2
|
|
|
3
|
+
## 1.51.1
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- [#1241](https://github.com/tailor-platform/sdk/pull/1241) [`4c40f74`](https://github.com/tailor-platform/sdk/commit/4c40f741318cdbc940a1b7db288751de50e8f680) Thanks [@remiposo](https://github.com/remiposo)! - `tailor-sdk deploy` now waits for the application's GraphQL schema composition to succeed before returning. Composition errors that previously only surfaced via `tailor-sdk workspace app health` are now raised by `deploy` itself.
|
|
8
|
+
|
|
9
|
+
- [#1216](https://github.com/tailor-platform/sdk/pull/1216) [`7f3aa30`](https://github.com/tailor-platform/sdk/commit/7f3aa308732ac4cac4c8671ce57733a8328d37d9) Thanks [@renovate](https://github.com/apps/renovate)! - fix(deps): update dependency @clack/prompts to v1.4.0
|
|
10
|
+
|
|
11
|
+
- [#1219](https://github.com/tailor-platform/sdk/pull/1219) [`77bf0b7`](https://github.com/tailor-platform/sdk/commit/77bf0b71a1f92be4987be5ab344cecc9985c88a2) Thanks [@renovate](https://github.com/apps/renovate)! - fix(deps): update dependency globals to v17.6.0
|
|
12
|
+
|
|
13
|
+
- [#1220](https://github.com/tailor-platform/sdk/pull/1220) [`36b3bce`](https://github.com/tailor-platform/sdk/commit/36b3bceca39899c8fb0d57b4c0d467c2f0fe491e) Thanks [@renovate](https://github.com/apps/renovate)! - fix(deps): update dependency graphql to v16.14.0
|
|
14
|
+
|
|
15
|
+
- [#1249](https://github.com/tailor-platform/sdk/pull/1249) [`2e11bc2`](https://github.com/tailor-platform/sdk/commit/2e11bc28e76fca4874b9d35454e86253ca53b920) Thanks [@renovate](https://github.com/apps/renovate)! - fix(deps): update dependency zod to v4.4.3
|
|
16
|
+
|
|
17
|
+
- [#1246](https://github.com/tailor-platform/sdk/pull/1246) [`4d3f2d4`](https://github.com/tailor-platform/sdk/commit/4d3f2d4eb7d5f1a7bdcd3a078075f89d4b2048ab) Thanks [@toiroakr](https://github.com/toiroakr)! - Cap parallel bundling of resolvers, executors, and workflow jobs to avoid OOM/SIGTERM on CI runners with many resolvers. Concurrency defaults to `os.cpus().length` and can be overridden via the `TAILOR_BUNDLE_CONCURRENCY` env var.
|
|
18
|
+
|
|
19
|
+
## 1.51.0
|
|
20
|
+
|
|
21
|
+
### Minor Changes
|
|
22
|
+
|
|
23
|
+
- [#1131](https://github.com/tailor-platform/sdk/pull/1131) [`c62c3b0`](https://github.com/tailor-platform/sdk/commit/c62c3b0a78761cff859ccac5af23d2e8dd0f996a) Thanks [@toiroakr](https://github.com/toiroakr)! - Add `@tailor-platform/sdk/runtime` — typed wrappers for the Tailor Platform Function runtime APIs (`tailor.iconv`, `tailor.secretmanager`, `tailor.authconnection`, `tailor.idp`, `tailor.workflow`, `tailor.context`, and `tailordb.file`). The wrappers and their types are fully self-contained, so you can use them without activating any ambient globals.
|
|
24
|
+
|
|
25
|
+
```ts
|
|
26
|
+
import {
|
|
27
|
+
iconv,
|
|
28
|
+
secretmanager,
|
|
29
|
+
idp,
|
|
30
|
+
file,
|
|
31
|
+
} from "@tailor-platform/sdk/runtime";
|
|
32
|
+
|
|
33
|
+
const utf8 = iconv.convert(sjisBuffer, "Shift_JIS", "UTF-8");
|
|
34
|
+
const apiKey = await secretmanager.getSecret("my-vault", "API_KEY");
|
|
35
|
+
const client = new idp.Client({ namespace: "my-namespace" });
|
|
36
|
+
const { metadata } = await file.upload(
|
|
37
|
+
"ns",
|
|
38
|
+
"Document",
|
|
39
|
+
"attachment",
|
|
40
|
+
recordId,
|
|
41
|
+
bytes
|
|
42
|
+
);
|
|
43
|
+
```
|
|
44
|
+
|
|
45
|
+
The SDK no longer depends on the external `@tailor-platform/function-types` package; its declarations are now vendored inside the SDK. For backwards compatibility the ambient `tailor.*` / `tailordb.*` types are still activated automatically when you import from `@tailor-platform/sdk`, so existing code keeps type-checking with no changes. This implicit activation will be removed in v2.0 — new code is encouraged to use the typed wrappers from `@tailor-platform/sdk/runtime`, or to opt into the globals explicitly via `import "@tailor-platform/sdk/runtime/globals"` (or by listing the entry in `tsconfig.json`'s `compilerOptions.types`).
|
|
46
|
+
|
|
47
|
+
The capital-cased `Tailordb` ambient namespace (`Tailordb.QueryResult`, `Tailordb.CommandType`, `Tailordb.Client`) is preserved as a `@deprecated` alias of the new lowercase `tailordb.*` namespace for source-level compatibility with `@tailor-platform/function-types`. It will be removed in v2.0; run `pnpm dlx @tailor-platform/sdk-codemod v2/tailordb-namespace` to migrate. The `@tailor-platform/function-types` declarations are vendored inside the SDK and activated automatically, so you can simply remove `@tailor-platform/function-types` from your `package.json` (and from `tsconfig.json` `compilerOptions.types` if listed) once you've upgraded.
|
|
48
|
+
|
|
49
|
+
Other test-mock changes from `@tailor-platform/sdk/vitest`:
|
|
50
|
+
|
|
51
|
+
- Breaking: when an `openDownloadStream` (or `toFileStream()`) call consumes a queued mock result, raw `Uint8Array` / `ArrayBuffer` payloads are now rejected. Enqueue a structured iterable of `StreamValue` items (`{ type: "metadata" }`, `{ type: "chunk", data, position }`, `{ type: "complete" }`) so test streams stay aligned with the platform's structured stream contract. The shorthand `Uint8Array` enqueue is still accepted by `download` / `downloadAsBase64`.
|
|
52
|
+
|
|
53
|
+
### Patch Changes
|
|
54
|
+
|
|
55
|
+
- [#1215](https://github.com/tailor-platform/sdk/pull/1215) [`65ffd8a`](https://github.com/tailor-platform/sdk/commit/65ffd8a84c377fe91f7632784716a6322fab4c33) Thanks [@renovate](https://github.com/apps/renovate)! - fix(deps): update @opentelemetry
|
|
56
|
+
|
|
57
|
+
- [#1199](https://github.com/tailor-platform/sdk/pull/1199) [`1b6d0d8`](https://github.com/tailor-platform/sdk/commit/1b6d0d8678d02ed6f6ea79dad48fc3ba23978fbe) Thanks [@toiroakr](https://github.com/toiroakr)! - **Fix**: `tailor-sdk tailordb truncate` and the `exec.mjs` generated by the built-in `seedPlugin` no longer touch namespaces declared with `{ external: true }`.
|
|
58
|
+
|
|
59
|
+
- `tailor-sdk tailordb truncate --all` now only truncates namespaces the current app actually owns; namespaces declared with `{ external: true }` are skipped. This also covers the `--truncate` path of `seed/exec.mjs`, so its `seed:reset` no longer wipes a sibling app's data.
|
|
60
|
+
- `tailor-sdk tailordb truncate --namespace <name>` now rejects an external namespace with a dedicated error pointing the user to the owning app, instead of the generic "not found in config" message.
|
|
61
|
+
- The generated `seed/exec.mjs` now starts with an `@generated` header to discourage hand-edits, since the entire file is regenerated on every `sdk generate`.
|
|
62
|
+
|
|
3
63
|
## 1.50.1
|
|
4
64
|
|
|
5
65
|
### Patch Changes
|
package/README.md
CHANGED
|
@@ -85,6 +85,7 @@ the installed SDK version. Files are copied (not symlinked) so they survive
|
|
|
85
85
|
|
|
86
86
|
### Guides
|
|
87
87
|
|
|
88
|
+
- [Runtime API](./docs/runtime.md) - Typed wrappers for `tailor.iconv`, `tailor.secretmanager`, `tailor.idp`, `tailor.workflow`, `tailor.context`, `tailor.authconnection`, and `tailordb.file`
|
|
88
89
|
- [Testing Guide](./docs/testing.md) - Unit and E2E testing patterns
|
|
89
90
|
- [CLI Reference](./docs/cli-reference.md) - Command-line interface documentation
|
|
90
91
|
|
|
@@ -17,6 +17,7 @@ Use these files as the single source of truth:
|
|
|
17
17
|
- `node_modules/@tailor-platform/sdk/docs/cli-reference.md`
|
|
18
18
|
- `node_modules/@tailor-platform/sdk/docs/cli/*.md`
|
|
19
19
|
- `node_modules/@tailor-platform/sdk/docs/testing.md`
|
|
20
|
+
- `node_modules/@tailor-platform/sdk/docs/runtime.md`
|
|
20
21
|
|
|
21
22
|
## Working Rules
|
|
22
23
|
|
|
@@ -32,3 +33,4 @@ Use these files as the single source of truth:
|
|
|
32
33
|
- Service details: `docs/services/*.md`
|
|
33
34
|
- CLI commands: `docs/cli-reference.md` and `docs/cli/*.md`
|
|
34
35
|
- Testing patterns: `docs/testing.md`
|
|
36
|
+
- Runtime API wrappers (`tailor.iconv`, `tailor.secretmanager`, `tailor.idp`, `tailor.workflow`, `tailor.context`, `tailor.authconnection`, `tailordb.file`): `docs/runtime.md`
|
|
@@ -1,5 +1,4 @@
|
|
|
1
|
-
|
|
2
|
-
import { Bt as InferredAttributeMap, zt as InferredAttributeList } from "./tailor-db-field-4bMLe25-.mjs";
|
|
1
|
+
import { Bt as InferredAttributeMap, zt as InferredAttributeList } from "./tailor-db-field-BhWvOyky.mjs";
|
|
3
2
|
|
|
4
3
|
//#region src/types/env.d.ts
|
|
5
4
|
interface Env {}
|
|
@@ -27,4 +26,4 @@ type TailorActor = {
|
|
|
27
26
|
};
|
|
28
27
|
//#endregion
|
|
29
28
|
export { Env as n, TailorEnv as r, TailorActor as t };
|
|
30
|
-
//# sourceMappingURL=actor-
|
|
29
|
+
//# sourceMappingURL=actor-Nag62ZDM.d.mts.map
|
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
|
|
2
|
-
import { n as isSdkBranded } from "./brand-
|
|
3
|
-
import { u as initOAuth2Client } from "./client-
|
|
4
|
-
import { a as parseBoolean, n as logger, r as styles } from "./logger-
|
|
5
|
-
import { n as enumConstantsPlugin, t as EnumConstantsGeneratorID } from "./enum-constants-
|
|
6
|
-
import { t as multiline } from "./multiline-
|
|
7
|
-
import { n as fileUtilsPlugin, t as FileUtilsGeneratorID } from "./file-utils-
|
|
8
|
-
import { n as kyselyTypePlugin, t as KyselyGeneratorID } from "./kysely-type-
|
|
9
|
-
import { n as seedPlugin, r as isPluginGeneratedType, t as SeedGeneratorID } from "./seed-
|
|
10
|
-
import { t as readPackageJson } from "./package-json-
|
|
11
|
-
import { n as tightenSecretFilePermissions, r as writeSecretFile } from "./secret-file-
|
|
2
|
+
import { n as isSdkBranded } from "./brand-Ll48SMXe.mjs";
|
|
3
|
+
import { u as initOAuth2Client } from "./client-BwV17byk.mjs";
|
|
4
|
+
import { a as parseBoolean, n as logger, r as styles } from "./logger-B1g4I9wT.mjs";
|
|
5
|
+
import { n as enumConstantsPlugin, t as EnumConstantsGeneratorID } from "./enum-constants-DI85-fPE.mjs";
|
|
6
|
+
import { t as multiline } from "./multiline-G1yF18OH.mjs";
|
|
7
|
+
import { n as fileUtilsPlugin, t as FileUtilsGeneratorID } from "./file-utils-BM8t5jCy.mjs";
|
|
8
|
+
import { n as kyselyTypePlugin, t as KyselyGeneratorID } from "./kysely-type-BUoVDC5r.mjs";
|
|
9
|
+
import { n as seedPlugin, r as isPluginGeneratedType, t as SeedGeneratorID } from "./seed-kNk-xLoB.mjs";
|
|
10
|
+
import { t as readPackageJson } from "./package-json-ZL0MkZOO.mjs";
|
|
11
|
+
import { n as tightenSecretFilePermissions, r as writeSecretFile } from "./secret-file-DnbmTWec.mjs";
|
|
12
12
|
import { createRequire } from "node:module";
|
|
13
13
|
import { z } from "zod";
|
|
14
14
|
import * as fs$1 from "node:fs";
|
|
@@ -28,6 +28,7 @@ import * as fs from "node:fs/promises";
|
|
|
28
28
|
import { parseSync } from "oxc-parser";
|
|
29
29
|
import * as inflection from "inflection";
|
|
30
30
|
import * as globals from "globals";
|
|
31
|
+
import pLimit from "p-limit";
|
|
31
32
|
|
|
32
33
|
//#region src/parser/app-config/schema.ts
|
|
33
34
|
const envValueSchema = z.union([
|
|
@@ -3754,6 +3755,41 @@ function createAuthService(config, tailorDBServices, externalTailorDBNamespaces)
|
|
|
3754
3755
|
};
|
|
3755
3756
|
}
|
|
3756
3757
|
|
|
3758
|
+
//#endregion
|
|
3759
|
+
//#region src/cli/shared/bundle-concurrency.ts
|
|
3760
|
+
/**
|
|
3761
|
+
* Resolve the maximum number of bundle operations to run in parallel.
|
|
3762
|
+
*
|
|
3763
|
+
* Resolution order:
|
|
3764
|
+
* 1. `TAILOR_BUNDLE_CONCURRENCY` env var (positive integer)
|
|
3765
|
+
* 2. `os.cpus().length`, clamped to at least 1
|
|
3766
|
+
*
|
|
3767
|
+
* Each `rolldown.build` invocation drives its own module graph and Rust thread
|
|
3768
|
+
* pool, so unbounded parallelism can exhaust native memory on constrained
|
|
3769
|
+
* runners (e.g. ubuntu-latest GitHub Actions runners with hundreds of
|
|
3770
|
+
* resolvers). Capping at CPU count keeps the worst case predictable.
|
|
3771
|
+
* @returns Concurrency cap (always >= 1)
|
|
3772
|
+
*/
|
|
3773
|
+
function resolveBundleConcurrency() {
|
|
3774
|
+
const envValue = process.env.TAILOR_BUNDLE_CONCURRENCY;
|
|
3775
|
+
if (envValue !== void 0) {
|
|
3776
|
+
const trimmed = envValue.trim();
|
|
3777
|
+
if (trimmed !== "" && /^[1-9]\d*$/.test(trimmed)) return Number.parseInt(trimmed, 10);
|
|
3778
|
+
}
|
|
3779
|
+
return Math.max(1, os.cpus().length);
|
|
3780
|
+
}
|
|
3781
|
+
/**
|
|
3782
|
+
* Run an async worker over each item with the bundle-concurrency cap applied.
|
|
3783
|
+
* Results are returned in the same order as the input items.
|
|
3784
|
+
* @param items - Items to process
|
|
3785
|
+
* @param worker - Async worker function
|
|
3786
|
+
* @returns Worker results in input order
|
|
3787
|
+
*/
|
|
3788
|
+
function withBundleConcurrency(items, worker) {
|
|
3789
|
+
const limit = pLimit(resolveBundleConcurrency());
|
|
3790
|
+
return Promise.all(items.map((item) => limit(() => worker(item))));
|
|
3791
|
+
}
|
|
3792
|
+
|
|
3757
3793
|
//#endregion
|
|
3758
3794
|
//#region src/cli/shared/runtime-exprs.ts
|
|
3759
3795
|
/**
|
|
@@ -3994,7 +4030,7 @@ async function bundleExecutors(options) {
|
|
|
3994
4030
|
} catch {
|
|
3995
4031
|
tsconfig = void 0;
|
|
3996
4032
|
}
|
|
3997
|
-
const results = await
|
|
4033
|
+
const results = await withBundleConcurrency(executors, (executor) => bundleSingleExecutor(executor, outputDir, tsconfig, triggerContext, cache, inlineSourcemap));
|
|
3998
4034
|
for (const [name, code] of results) bundledCode.set(name, code);
|
|
3999
4035
|
logger.log(`${styles.success("Bundled")} ${styles.info("\"executor\"")}`);
|
|
4000
4036
|
return bundledCode;
|
|
@@ -4191,7 +4227,7 @@ async function bundleResolvers(namespace, config, triggerContext, cache, inlineS
|
|
|
4191
4227
|
} catch {
|
|
4192
4228
|
tsconfig = void 0;
|
|
4193
4229
|
}
|
|
4194
|
-
const results = await
|
|
4230
|
+
const results = await withBundleConcurrency(resolvers, (resolver) => bundleSingleResolver(resolver, outputDir, tsconfig, triggerContext, cache, inlineSourcemap));
|
|
4195
4231
|
for (const [name, code] of results) bundledCode.set(name, code);
|
|
4196
4232
|
logger.log(`${styles.success("Bundled")} ${styles.info(`"${namespace}"`)}`);
|
|
4197
4233
|
return bundledCode;
|
|
@@ -4514,7 +4550,7 @@ async function bundleWorkflowJobs(allJobs, mainJobNames, env = {}, triggerContex
|
|
|
4514
4550
|
} catch {
|
|
4515
4551
|
tsconfig = void 0;
|
|
4516
4552
|
}
|
|
4517
|
-
const results = await
|
|
4553
|
+
const results = await withBundleConcurrency(usedJobs, (job) => bundleSingleJob(job, usedJobs, outputDir, tsconfig, env, triggerContext, cache, inlineSourcemap));
|
|
4518
4554
|
const bundledCode = /* @__PURE__ */ new Map();
|
|
4519
4555
|
for (const [name, code] of results) bundledCode.set(name, code);
|
|
4520
4556
|
logger.log(`${styles.success("Bundled")} ${styles.info("\"workflow-job\"")}`);
|
|
@@ -5345,4 +5381,4 @@ async function loadApplication(params) {
|
|
|
5345
5381
|
|
|
5346
5382
|
//#endregion
|
|
5347
5383
|
export { loadConfigPath as C, saveUserTokens as D, resolveTokens as E, writePlatformConfig as O, loadAccessToken as S, readPlatformConfig as T, getDistDir as _, WorkflowJobSchema as a, deleteUserTokens as b, ExecutorSchema as c, buildResolverOperationHookExpr as d, OAuth2ClientSchema as f, createBundleCache as g, loadFilesWithIgnores as h, resolveInlineSourcemap as i, INVOKER_EXPR as l, stringifyFunction as m, generatePluginFilesIfNeeded as n, ResolverSchema as o, TailorDBTypeSchema as p, loadApplication as r, createExecutorService as s, defineApplication as t, buildExecutorArgsExpr as u, hashFile as v, loadWorkspaceId as w, fetchLatestToken as x, loadConfig as y };
|
|
5348
|
-
//# sourceMappingURL=application-
|
|
5384
|
+
//# sourceMappingURL=application-Z-fNwyZB.mjs.map
|