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
47 changes: 47 additions & 0 deletions .changeset/5483-5439-dts-config-wiring.md
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
---
'@object-ui/components': patch
'@object-ui/fields': patch
'@object-ui/plugin-ai': patch
'@object-ui/plugin-calendar': patch
'@object-ui/plugin-charts': patch
'@object-ui/plugin-chatbot': patch
'@object-ui/plugin-dashboard': patch
'@object-ui/plugin-designer': patch
'@object-ui/plugin-detail': patch
'@object-ui/plugin-editor': patch
'@object-ui/plugin-form': patch
'@object-ui/plugin-gantt': patch
'@object-ui/plugin-grid': patch
'@object-ui/plugin-kanban': patch
'@object-ui/plugin-list': patch
'@object-ui/plugin-map': patch
'@object-ui/plugin-markdown': patch
'@object-ui/plugin-report': patch
'@object-ui/plugin-timeline': patch
'@object-ui/plugin-tree': patch
'@object-ui/plugin-view': patch
---

Published typings from every `vite-plugin-dts` package now carry an explicit extension on
every relative specifier, and a type error in the declaration build now fails the build
instead of being printed and ignored (objectui#5439, objectui#5483).

**Consumers on `moduleResolution: nodenext` or `node16` may see NEW type errors, and that
is the fix working.** These packages re-export mostly through NAMED re-exports —
`export { useObjectChat } from './useObjectChat'`. TypeScript could not follow the
extensionless hop, but it still DECLARED the name, so the symbol resolved to a silent
`any`. Nothing errored; consumers simply got no types. With the extension emitted, the
symbol carries its real type, and any call site that was relying on the `any` now type
checks for the first time. This is the mode that produced the 21 residual `TS7006` on
`@object-ui/app-shell` reported against objectui#5365 — a type hole that opened quietly,
unlike objectui#5365's own `export * from './ui'` packages where the same defect surfaced
immediately as `TS2305: has no exported member`.

410 extensionless relative specifiers across 19 packages were emitted before this change;
the count is now 0 in all 22 packages that build typings through `vite-plugin-dts`.
`@object-ui/fields` was already clean — its sources write explicit `.js` specifiers — and
is wired so it stays that way.

The second half changes no emitted output today: 22/22 packages built green unmodified, so
making the declaration step's exit code honest turns nothing red. It changes what a FUTURE
regression does — print and exit 0, versus fail the build.
4 changes: 4 additions & 0 deletions packages/components/vite.config.ts
Original file line numberDiff line numberDiff line change
Expand Up@@ -12,6 +12,7 @@ import dts from 'vite-plugin-dts';
import { resolve } from 'path';

import { createDtsExplicitExtensions } from '../../scripts/vite-dts-explicit-extensions.ts';
import { createDtsFailOnTypeErrors } from '../../scripts/vite-dts-fail-on-type-errors.ts';

export default defineConfig({
plugins: [
Expand All@@ -35,6 +36,9 @@ export default defineConfig({
// verdict about specifier-preserving `.js` builds — correctly never
// scanned this package. See the module header for the full argument.
...createDtsExplicitExtensions({ packageDir: __dirname }),
// A type error the declaration program already found and printed used to
// leave `vite build` exiting 0 — objectui#5370 / #5483. This makes it fatal.
...createDtsFailOnTypeErrors({ packageDir: __dirname }),
}),
],
resolve: {
Expand Down
14 changes: 14 additions & 0 deletions packages/fields/vite.config.ts
Original file line numberDiff line numberDiff line change
Expand Up@@ -3,6 +3,8 @@ import react from '@vitejs/plugin-react';
import dts from 'vite-plugin-dts';
import path from 'path';

import { createDtsExplicitExtensions } from '../../scripts/vite-dts-explicit-extensions.ts';

export default defineConfig({
plugins: [
react(),
Expand All@@ -14,6 +16,18 @@ export default defineConfig({
// this package's `rootDir` — which would emit TS6059 rootDir errors.
compilerOptions: { rootDir: path.resolve(__dirname, 'src'), paths: {} },
aliasesExclude: [/^@object-ui\//],
// Relative specifiers in the EMITTED typings get their explicit extension
// here — objectui#5365 / #5439. A NAMED re-export through an extensionless
// hop still declares the name under `nodenext` and silently types it `any`.
...createDtsExplicitExtensions({ packageDir: __dirname }),
// Deliberately NOT spreading `createDtsFailOnTypeErrors` here, unlike the
// other 21 `dts(` call sites — objectui#5483. This package's build script is
// `tsc && vite build && node scripts/build-css.mjs`, and that leading `tsc` is
// not redundant: it is what makes a type error fatal for this package, and it
// exits non-zero BEFORE `vite build` ever runs, so a dts-leg exit code could
// never be what decides this build. Drop the `tsc &&` prefix and this package
// owes the factory instead — `scripts/__tests__/vite-dts-wiring-ratchet.test.ts`
// reads that script and fails here if the prefix goes away.
}),
],
resolve: {
Expand Down
10 changes: 10 additions & 0 deletions packages/plugin-ai/vite.config.ts
Original file line numberDiff line numberDiff line change
Expand Up@@ -3,6 +3,9 @@ import react from '@vitejs/plugin-react';
import dts from 'vite-plugin-dts';
import { resolve } from 'path';

import { createDtsExplicitExtensions } from '../../scripts/vite-dts-explicit-extensions.ts';
import { createDtsFailOnTypeErrors } from '../../scripts/vite-dts-fail-on-type-errors.ts';

export default defineConfig({
plugins: [
react(),
Expand All@@ -16,6 +19,13 @@ export default defineConfig({
aliasesExclude: [/^@object-ui\//],
include: ['src'],
exclude: ['**/*.test.ts', '**/*.test.tsx', 'node_modules'],
// Relative specifiers in the EMITTED typings get their explicit extension
// here — objectui#5365 / #5439. A NAMED re-export through an extensionless
// hop still declares the name under `nodenext` and silently types it `any`.
...createDtsExplicitExtensions({ packageDir: __dirname }),
// A type error the declaration program already found and printed used to
// leave `vite build` exiting 0 — objectui#5370 / #5483. This makes it fatal.
...createDtsFailOnTypeErrors({ packageDir: __dirname }),
}),
],
resolve: {
Expand Down
10 changes: 10 additions & 0 deletions packages/plugin-calendar/vite.config.ts
Original file line numberDiff line numberDiff line change
Expand Up@@ -11,6 +11,9 @@ import react from '@vitejs/plugin-react';
import dts from 'vite-plugin-dts';
import { resolve } from 'path';

import { createDtsExplicitExtensions } from '../../scripts/vite-dts-explicit-extensions.ts';
import { createDtsFailOnTypeErrors } from '../../scripts/vite-dts-fail-on-type-errors.ts';

export default defineConfig({
test: {
globals: true,
Expand All@@ -30,6 +33,13 @@ export default defineConfig({
aliasesExclude: [/^@object-ui\//],
include: ['src'],
exclude: ['**/*.test.ts', '**/*.test.tsx', 'node_modules'],
// Relative specifiers in the EMITTED typings get their explicit extension
// here — objectui#5365 / #5439. A NAMED re-export through an extensionless
// hop still declares the name under `nodenext` and silently types it `any`.
...createDtsExplicitExtensions({ packageDir: __dirname }),
// A type error the declaration program already found and printed used to
// leave `vite build` exiting 0 — objectui#5370 / #5483. This makes it fatal.
...createDtsFailOnTypeErrors({ packageDir: __dirname }),
}),
],
resolve: {
Expand Down
10 changes: 10 additions & 0 deletions packages/plugin-charts/vite.config.ts
Original file line numberDiff line numberDiff line change
Expand Up@@ -11,6 +11,9 @@ import react from '@vitejs/plugin-react';
import dts from 'vite-plugin-dts';
import { resolve } from 'path';

import { createDtsExplicitExtensions } from '../../scripts/vite-dts-explicit-extensions.ts';
import { createDtsFailOnTypeErrors } from '../../scripts/vite-dts-fail-on-type-errors.ts';

export default defineConfig({
plugins: [
react(),
Expand All@@ -24,6 +27,13 @@ export default defineConfig({
aliasesExclude: [/^@object-ui\//],
include: ['src'],
exclude: ['**/*.test.ts', '**/*.test.tsx', 'node_modules'],
// Relative specifiers in the EMITTED typings get their explicit extension
// here — objectui#5365 / #5439. A NAMED re-export through an extensionless
// hop still declares the name under `nodenext` and silently types it `any`.
...createDtsExplicitExtensions({ packageDir: __dirname }),
// A type error the declaration program already found and printed used to
// leave `vite build` exiting 0 — objectui#5370 / #5483. This makes it fatal.
...createDtsFailOnTypeErrors({ packageDir: __dirname }),
}),
],
resolve: {
Expand Down
10 changes: 10 additions & 0 deletions packages/plugin-chatbot/vite.config.ts
Original file line numberDiff line numberDiff line change
Expand Up@@ -11,6 +11,9 @@ import react from '@vitejs/plugin-react';
import dts from 'vite-plugin-dts';
import { resolve } from 'path';

import { createDtsExplicitExtensions } from '../../scripts/vite-dts-explicit-extensions.ts';
import { createDtsFailOnTypeErrors } from '../../scripts/vite-dts-fail-on-type-errors.ts';

export default defineConfig({
plugins: [
react(),
Expand All@@ -24,6 +27,13 @@ export default defineConfig({
aliasesExclude: [/^@object-ui\//],
include: ['src'],
exclude: ['**/*.test.ts', '**/*.test.tsx', 'node_modules'],
// Relative specifiers in the EMITTED typings get their explicit extension
// here — objectui#5365 / #5439. A NAMED re-export through an extensionless
// hop still declares the name under `nodenext` and silently types it `any`.
...createDtsExplicitExtensions({ packageDir: __dirname }),
// A type error the declaration program already found and printed used to
// leave `vite build` exiting 0 — objectui#5370 / #5483. This makes it fatal.
...createDtsFailOnTypeErrors({ packageDir: __dirname }),
}),
],
resolve: {
Expand Down
10 changes: 10 additions & 0 deletions packages/plugin-dashboard/vite.config.ts
Original file line numberDiff line numberDiff line change
Expand Up@@ -3,6 +3,9 @@ import react from '@vitejs/plugin-react';
import dts from 'vite-plugin-dts';
import { resolve } from 'path';

import { createDtsExplicitExtensions } from '../../scripts/vite-dts-explicit-extensions.ts';
import { createDtsFailOnTypeErrors } from '../../scripts/vite-dts-fail-on-type-errors.ts';

export default defineConfig({
plugins: [
react(),
Expand All@@ -16,6 +19,13 @@ export default defineConfig({
aliasesExclude: [/^@object-ui\//],
include: ['src'],
exclude: ['**/*.test.ts', '**/*.test.tsx', 'node_modules'],
// Relative specifiers in the EMITTED typings get their explicit extension
// here — objectui#5365 / #5439. A NAMED re-export through an extensionless
// hop still declares the name under `nodenext` and silently types it `any`.
...createDtsExplicitExtensions({ packageDir: __dirname }),
// A type error the declaration program already found and printed used to
// leave `vite build` exiting 0 — objectui#5370 / #5483. This makes it fatal.
...createDtsFailOnTypeErrors({ packageDir: __dirname }),
}),
],
resolve: {
Expand Down
10 changes: 10 additions & 0 deletions packages/plugin-designer/vite.config.ts
Original file line numberDiff line numberDiff line change
Expand Up@@ -3,6 +3,9 @@ import react from '@vitejs/plugin-react';
import dts from 'vite-plugin-dts';
import { resolve } from 'path';

import { createDtsExplicitExtensions } from '../../scripts/vite-dts-explicit-extensions.ts';
import { createDtsFailOnTypeErrors } from '../../scripts/vite-dts-fail-on-type-errors.ts';

export default defineConfig({
plugins: [
react(),
Expand All@@ -16,6 +19,13 @@ export default defineConfig({
aliasesExclude: [/^@object-ui\//],
include: ['src'],
exclude: ['**/*.test.ts', '**/*.test.tsx', 'node_modules'],
// Relative specifiers in the EMITTED typings get their explicit extension
// here — objectui#5365 / #5439. A NAMED re-export through an extensionless
// hop still declares the name under `nodenext` and silently types it `any`.
...createDtsExplicitExtensions({ packageDir: __dirname }),
// A type error the declaration program already found and printed used to
// leave `vite build` exiting 0 — objectui#5370 / #5483. This makes it fatal.
...createDtsFailOnTypeErrors({ packageDir: __dirname }),
}),
],
resolve: {
Expand Down
10 changes: 10 additions & 0 deletions packages/plugin-detail/vite.config.ts
Original file line numberDiff line numberDiff line change
Expand Up@@ -3,6 +3,9 @@ import react from '@vitejs/plugin-react';
import dts from 'vite-plugin-dts';
import { resolve } from 'path';

import { createDtsExplicitExtensions } from '../../scripts/vite-dts-explicit-extensions.ts';
import { createDtsFailOnTypeErrors } from '../../scripts/vite-dts-fail-on-type-errors.ts';

export default defineConfig({
plugins: [
react(),
Expand All@@ -16,6 +19,13 @@ export default defineConfig({
aliasesExclude: [/^@object-ui\//],
outDir: 'dist',
tsconfigPath: './tsconfig.json',
// Relative specifiers in the EMITTED typings get their explicit extension
// here — objectui#5365 / #5439. A NAMED re-export through an extensionless
// hop still declares the name under `nodenext` and silently types it `any`.
...createDtsExplicitExtensions({ packageDir: __dirname }),
// A type error the declaration program already found and printed used to
// leave `vite build` exiting 0 — objectui#5370 / #5483. This makes it fatal.
...createDtsFailOnTypeErrors({ packageDir: __dirname }),
}),
],
resolve: {
Expand Down
10 changes: 10 additions & 0 deletions packages/plugin-editor/vite.config.ts
Original file line numberDiff line numberDiff line change
Expand Up@@ -11,6 +11,9 @@ import react from '@vitejs/plugin-react';
import dts from 'vite-plugin-dts';
import { resolve } from 'path';

import { createDtsExplicitExtensions } from '../../scripts/vite-dts-explicit-extensions.ts';
import { createDtsFailOnTypeErrors } from '../../scripts/vite-dts-fail-on-type-errors.ts';

export default defineConfig({
plugins: [
react(),
Expand All@@ -23,6 +26,13 @@ export default defineConfig({
compilerOptions: { rootDir: resolve(__dirname, 'src'), paths: {} },
aliasesExclude: [/^@object-ui\//],
include: ['src'],
// Relative specifiers in the EMITTED typings get their explicit extension
// here — objectui#5365 / #5439. A NAMED re-export through an extensionless
// hop still declares the name under `nodenext` and silently types it `any`.
...createDtsExplicitExtensions({ packageDir: __dirname }),
// A type error the declaration program already found and printed used to
// leave `vite build` exiting 0 — objectui#5370 / #5483. This makes it fatal.
...createDtsFailOnTypeErrors({ packageDir: __dirname }),
}),
],
resolve: {
Expand Down
10 changes: 10 additions & 0 deletions packages/plugin-form/vite.config.ts
Original file line numberDiff line numberDiff line change
Expand Up@@ -3,6 +3,9 @@ import react from '@vitejs/plugin-react';
import dts from 'vite-plugin-dts';
import { resolve } from 'path';

import { createDtsExplicitExtensions } from '../../scripts/vite-dts-explicit-extensions.ts';
import { createDtsFailOnTypeErrors } from '../../scripts/vite-dts-fail-on-type-errors.ts';

export default defineConfig({
plugins: [
react(),
Expand All@@ -15,6 +18,13 @@ export default defineConfig({
compilerOptions: { rootDir: resolve(__dirname, 'src'), paths: {} },
aliasesExclude: [/^@object-ui\//],
include: ['src'],
// Relative specifiers in the EMITTED typings get their explicit extension
// here — objectui#5365 / #5439. A NAMED re-export through an extensionless
// hop still declares the name under `nodenext` and silently types it `any`.
...createDtsExplicitExtensions({ packageDir: __dirname }),
// A type error the declaration program already found and printed used to
// leave `vite build` exiting 0 — objectui#5370 / #5483. This makes it fatal.
...createDtsFailOnTypeErrors({ packageDir: __dirname }),
}),
],
resolve: {
Expand Down
10 changes: 10 additions & 0 deletions packages/plugin-gantt/vite.config.ts
Original file line numberDiff line numberDiff line change
Expand Up@@ -11,6 +11,9 @@ import react from '@vitejs/plugin-react';
import dts from 'vite-plugin-dts';
import { resolve } from 'path';

import { createDtsExplicitExtensions } from '../../scripts/vite-dts-explicit-extensions.ts';
import { createDtsFailOnTypeErrors } from '../../scripts/vite-dts-fail-on-type-errors.ts';

export default defineConfig({
plugins: [
react(),
Expand All@@ -24,6 +27,13 @@ export default defineConfig({
aliasesExclude: [/^@object-ui\//],
include: ['src'],
exclude: ['**/*.test.ts', '**/*.test.tsx', 'node_modules'],
// Relative specifiers in the EMITTED typings get their explicit extension
// here — objectui#5365 / #5439. A NAMED re-export through an extensionless
// hop still declares the name under `nodenext` and silently types it `any`.
...createDtsExplicitExtensions({ packageDir: __dirname }),
// A type error the declaration program already found and printed used to
// leave `vite build` exiting 0 — objectui#5370 / #5483. This makes it fatal.
...createDtsFailOnTypeErrors({ packageDir: __dirname }),
}),
],
resolve: {
Expand Down
10 changes: 10 additions & 0 deletions packages/plugin-grid/vite.config.ts
Original file line numberDiff line numberDiff line change
Expand Up@@ -3,6 +3,9 @@ import react from '@vitejs/plugin-react';
import dts from 'vite-plugin-dts';
import { resolve } from 'path';

import { createDtsExplicitExtensions } from '../../scripts/vite-dts-explicit-extensions.ts';
import { createDtsFailOnTypeErrors } from '../../scripts/vite-dts-fail-on-type-errors.ts';

export default defineConfig({
plugins: [
react(),
Expand All@@ -15,6 +18,13 @@ export default defineConfig({
// this package's `rootDir` — which would emit TS6059 rootDir errors.
compilerOptions: { rootDir: resolve(__dirname, 'src'), paths: {} },
aliasesExclude: [/^@object-ui\//],
// Relative specifiers in the EMITTED typings get their explicit extension
// here — objectui#5365 / #5439. A NAMED re-export through an extensionless
// hop still declares the name under `nodenext` and silently types it `any`.
...createDtsExplicitExtensions({ packageDir: __dirname }),
// A type error the declaration program already found and printed used to
// leave `vite build` exiting 0 — objectui#5370 / #5483. This makes it fatal.
...createDtsFailOnTypeErrors({ packageDir: __dirname }),
}),
],
resolve: {
Expand Down
10 changes: 10 additions & 0 deletions packages/plugin-kanban/vite.config.ts
Original file line numberDiff line numberDiff line change
Expand Up@@ -11,6 +11,9 @@ import react from '@vitejs/plugin-react';
import dts from 'vite-plugin-dts';
import { resolve } from 'path';

import { createDtsExplicitExtensions } from '../../scripts/vite-dts-explicit-extensions.ts';
import { createDtsFailOnTypeErrors } from '../../scripts/vite-dts-fail-on-type-errors.ts';

export default defineConfig({
plugins: [
react(),
Expand All@@ -24,6 +27,13 @@ export default defineConfig({
aliasesExclude: [/^@object-ui\//],
include: ['src'],
exclude: ['**/*.test.ts', '**/*.test.tsx', 'node_modules'],
// Relative specifiers in the EMITTED typings get their explicit extension
// here — objectui#5365 / #5439. A NAMED re-export through an extensionless
// hop still declares the name under `nodenext` and silently types it `any`.
...createDtsExplicitExtensions({ packageDir: __dirname }),
// A type error the declaration program already found and printed used to
// leave `vite build` exiting 0 — objectui#5370 / #5483. This makes it fatal.
...createDtsFailOnTypeErrors({ packageDir: __dirname }),
}),
],
resolve: {
Expand Down
Loading
Loading