Summary
A downstream package that exports an inferred Toolcraft command tree emits public declarations containing bare import("toolcraft-schema") references. With toolcraft@0.0.102, toolcraft-schema is bundled beneath Toolcraft, so those references are not resolvable from the downstream package unless it separately declares toolcraft-schema as a direct dependency.
This makes Toolcraft's inferred public types depend on transitive hoisting that the current published package layout no longer provides.
Reproduction
Package library-a:
import { defineCommand, defineGroup, S } from "toolcraft";
export const root = defineGroup({
name: "example",
children: [
defineCommand({
name: "hello",
params: S.Object({ name: S.String() }),
handler: async ({ params }) => ({ greeting: params.name }),
}),
],
});
Build declarations and inspect the output. It contains types such as:
import("toolcraft-schema").ObjectSchema<...>
Then:
- Publish/pack
library-a with only toolcraft@0.0.102 declared.
- Install it into a clean consumer.
- Run TypeScript with
skipLibCheck: false.
- The consumer cannot resolve
toolcraft-schema, because the published Toolcraft archive places it at node_modules/toolcraft/node_modules/toolcraft-schema rather than at a location reachable from library-a's declaration file.
The current workaround is for every downstream library exporting inferred command trees to declare the exact toolcraft-schema version directly.
Expected behavior
A package should be able to export an inferred Toolcraft tree while declaring Toolcraft itself, without knowing that generated declarations leak a separately named schema package.
Possible fixes include:
- make public Toolcraft types refer to schema types through
toolcraft re-exports;
- expose an annotation/helper whose emitted declaration does not contain bare
toolcraft-schema imports;
- or document and encode
toolcraft-schema as a peer/direct dependency contract rather than a bundled implementation detail.
Acceptance criteria
A packed downstream library exporting an inferred command tree compiles in a clean consumer with skipLibCheck: false and both exactOptionalPropertyTypes modes, without the downstream library adding an otherwise undocumented direct toolcraft-schema dependency.
Summary
A downstream package that exports an inferred Toolcraft command tree emits public declarations containing bare
import("toolcraft-schema")references. Withtoolcraft@0.0.102,toolcraft-schemais bundled beneath Toolcraft, so those references are not resolvable from the downstream package unless it separately declarestoolcraft-schemaas a direct dependency.This makes Toolcraft's inferred public types depend on transitive hoisting that the current published package layout no longer provides.
Reproduction
Package
library-a:Build declarations and inspect the output. It contains types such as:
Then:
library-awith onlytoolcraft@0.0.102declared.skipLibCheck: false.toolcraft-schema, because the published Toolcraft archive places it atnode_modules/toolcraft/node_modules/toolcraft-schemarather than at a location reachable fromlibrary-a's declaration file.The current workaround is for every downstream library exporting inferred command trees to declare the exact
toolcraft-schemaversion directly.Expected behavior
A package should be able to export an inferred Toolcraft tree while declaring Toolcraft itself, without knowing that generated declarations leak a separately named schema package.
Possible fixes include:
toolcraftre-exports;toolcraft-schemaimports;toolcraft-schemaas a peer/direct dependency contract rather than a bundled implementation detail.Acceptance criteria
A packed downstream library exporting an inferred command tree compiles in a clean consumer with
skipLibCheck: falseand bothexactOptionalPropertyTypesmodes, without the downstream library adding an otherwise undocumented directtoolcraft-schemadependency.