You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Add the ability to generate the TypeScript SDK as a standalone npm package by automatically creating a package.json (and optionally tsconfig.json) in the output directory. This would make the generated SDK publishable to npm and immediately installable in any TypeScript/JavaScript project.
Current behavior
The generated TypeScript SDK is a set of .ts files that must live inside an existing project. Users need to manually set up package.json, tsconfig.json, and install the gqlkit-ts runtime dependency. The generated builder/index.ts re-exports from gqlkit-ts, which must already be available in the project's node_modules.
Proposed behavior
Add flags like --npm-name and --npm-version that, when provided:
Generate a package.json in the output directory with the given package name, version, and gqlkit-ts as a dependency
Generate a tsconfig.json with sensible defaults for a library package
Generate a root index.ts barrel file that re-exports all public types
Make the SDK directory a fully independent npm package
Summary
Add the ability to generate the TypeScript SDK as a standalone npm package by automatically creating a
package.json(and optionallytsconfig.json) in the output directory. This would make the generated SDK publishable to npm and immediately installable in any TypeScript/JavaScript project.Current behavior
The generated TypeScript SDK is a set of
.tsfiles that must live inside an existing project. Users need to manually set uppackage.json,tsconfig.json, and install thegqlkit-tsruntime dependency. The generatedbuilder/index.tsre-exports fromgqlkit-ts, which must already be available in the project'snode_modules.Proposed behavior
Add flags like
--npm-nameand--npm-versionthat, when provided:package.jsonin the output directory with the given package name, version, andgqlkit-tsas a dependencytsconfig.jsonwith sensible defaults for a library packageindex.tsbarrel file that re-exports all public typesExample
This would generate:
Usage after generation
Other projects could then install it:
npm install @yourorg/myapi-sdk # or from a git repo / local path npm install ./my-sdkWhy
npm installwithout copying files