Commit d3a61fd
perf(build): gate .d.ts emission on OS_SKIP_DTS; fix optional AI plugin skip
Part 1 — OS_SKIP_DTS build-time gating (default behavior unchanged):
- 12 tsup configs: dts: true → dts: !process.env.OS_SKIP_DTS
- packages/spec/package.json: skip the separate BUILD_DTS=true tsup pass
when OS_SKIP_DTS is set (the ~80–90s DTS pass)
- packages/cli/package.json: when OS_SKIP_DTS is set, deps have no .d.ts, so
build with --noCheck --declaration false to still emit runnable JS
(full typecheck preserved by default)
- turbo.json: declare OS_SKIP_DTS in globalEnv (Turbo 2.x strict env mode
otherwise filters it out; also part of the cache key)
Image build (OS_SKIP_DTS=1): framework turbo run build ~5m03s → ~1m12s.
Part 2 — fix optional AI plugin "failed to start" false alarm:
serve.ts loads @objectstack/service-ai and optional @objectstack/service-ai-studio
via importFromHost() and is meant to silently skip when absent. ESM throws
"Cannot find package '...'" (code on err.code, not in message), which the old
guard didn't match, so control-plane hosts logged a scary error on every boot.
Detect missing module via err.code === 'ERR_MODULE_NOT_FOUND' and also match
"Cannot find package". Applied to both the AIService and AIStudio guards.
Refs objectstack-ai/cloud#107
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>1 parent e1478fe commit d3a61fd
16 files changed
Lines changed: 25 additions & 16 deletions
File tree
- packages
- cli
- src/commands
- core
- metadata-core
- metadata-fs
- metadata
- platform-objects
- plugins/plugin-webhooks
- runtime
- services
- service-cluster-redis
- service-cluster
- service-datasource
- spec
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
9 | 9 | | |
10 | 10 | | |
11 | 11 | | |
12 | | - | |
| 12 | + | |
13 | 13 | | |
14 | 14 | | |
15 | 15 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1377 | 1377 | | |
1378 | 1378 | | |
1379 | 1379 | | |
1380 | | - | |
| 1380 | + | |
| 1381 | + | |
| 1382 | + | |
| 1383 | + | |
| 1384 | + | |
1381 | 1385 | | |
1382 | 1386 | | |
1383 | 1387 | | |
| |||
1401 | 1405 | | |
1402 | 1406 | | |
1403 | 1407 | | |
1404 | | - | |
| 1408 | + | |
| 1409 | + | |
| 1410 | + | |
| 1411 | + | |
| 1412 | + | |
1405 | 1413 | | |
1406 | 1414 | | |
1407 | 1415 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
17 | 17 | | |
18 | 18 | | |
19 | 19 | | |
20 | | - | |
| 20 | + | |
21 | 21 | | |
22 | 22 | | |
23 | 23 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
13 | 13 | | |
14 | 14 | | |
15 | 15 | | |
16 | | - | |
| 16 | + | |
17 | 17 | | |
18 | 18 | | |
19 | 19 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
7 | 7 | | |
8 | 8 | | |
9 | 9 | | |
10 | | - | |
| 10 | + | |
11 | 11 | | |
12 | 12 | | |
13 | 13 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
7 | 7 | | |
8 | 8 | | |
9 | 9 | | |
10 | | - | |
| 10 | + | |
11 | 11 | | |
12 | 12 | | |
13 | 13 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
11 | 11 | | |
12 | 12 | | |
13 | 13 | | |
14 | | - | |
| 14 | + | |
15 | 15 | | |
16 | 16 | | |
17 | 17 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
17 | 17 | | |
18 | 18 | | |
19 | 19 | | |
20 | | - | |
| 20 | + | |
21 | 21 | | |
22 | 22 | | |
23 | 23 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
7 | 7 | | |
8 | 8 | | |
9 | 9 | | |
10 | | - | |
| 10 | + | |
11 | 11 | | |
12 | 12 | | |
13 | 13 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
7 | 7 | | |
8 | 8 | | |
9 | 9 | | |
10 | | - | |
| 10 | + | |
11 | 11 | | |
12 | 12 | | |
13 | 13 | | |
| |||
0 commit comments