This PR bootstraps a typescript-codegen package with a lightweight AST that we can grow overtime. Additionally, we now generate a version.ts that looks something like:
export SDK_VERSION = "0.0.12";
AI Description
This pull request introduces a new feature to the TypeScript SDK, enabling the generation of a version.ts file that exports a constant SDK_VERSION. This constant can be used by various utilities to dynamically import the version, allowing for customisation of the user agent.
Changes
generators/typescript/codegen/.depcheckrc.json: Added a new file with configuration for the depcheck tool, specifying the dependencies to ignore.
generators/typescript/codegen/.prettierrc.cjs: Added a new file that exports the configuration for the prettier tool.
generators/typescript/codegen/package.json: Added a new file containing package metadata and configuration for the TypeScript SDK generator.
generators/typescript/codegen/src/ast/CodeBlock.ts: Added a new file that defines the CodeBlock class, which extends the AstNode class and provides functionality for writing code blocks.
generators/typescript/codegen/src/ast/Type.ts: Added a new file that defines the Type class, which extends the AstNode class and represents a C# parameter to a method.
generators/typescript/codegen/src/ast/Variable.ts: Added a new file that defines the Variable class, which extends the AstNode class and represents a variable with various attributes.
generators/typescript/codegen/src/ast/core/AstNode.ts: Added a new file that defines the AstNode class, which extends the AbstractAstNode class and serves as a base class for other AST nodes.
generators/typescript/codegen/src/ast/core/Writer.ts: Added a new file that defines the Writer class, which extends the AbstractWriter class and provides functionality for writing code.
generators/typescript/codegen/src/ast/core/index.ts: Added a new file that exports the AstNode and Writer classes from their respective files.
generators/typescript/codegen/src/ast/index.ts: Added a new file that exports the CodeBlock, Type, and Variable classes, as well as the AstNode and Writer classes from the core module.
generators/typescript/codegen/src/index.ts: Added a new file that exports the ts module and the AstNode and Writer classes from the core module.
generators/typescript/codegen/src/typescript.ts: Added a new file that exports the codeblock and variable functions, as well as various modules from the ast directory.
generators/typescript/codegen/tsconfig.json: Added a new file that extends the shared TypeScript configuration and specifies compiler options, include paths, and references to other packages.
generators/typescript/codegen/vitest.config.ts: Added a new file that exports the default configuration for Vitest, a testing framework.
generators/typescript/sdk/CHANGELOG.md: Updated the changelog to include a new entry for version 0.39.7, describing the addition of the version.ts file and the SDK_VERSION constant.
generators/typescript/sdk/VERSION: Updated the version number from 0.39.6 to 0.39.7.
generators/typescript/sdk/generator/package.json: Added a new dependency on the @fern-api/typescript-codegen package.
generators/typescript/sdk/generator/src/SdkGenerator.ts: Added a new import for the VersionFileGenerator class and a new code block that creates an instance of VersionFileGenerator and calls its generate method.
generators/typescript/sdk/generator/src/version/VersionFileGenerator.ts: Added a new file that defines the VersionFileGenerator class, which generates the version.ts file and exports the SDK_VERSION constant.
generators/typescript/sdk/generator/tsconfig.json: Added a new reference to the codegen package.
generators/typescript/sdk/generator/tsconfig.json: Added a new reference to the codegen package.
pnpm-lock.yaml: Added new entries for the generators/typescript/codegen and generators/typescript/express/cli packages, specifying their dependencies and versions.
seed/ts-sdk/alias-extends/src/version.ts: Added a new file that exports the SDK_VERSION constant with the value "0.0.1".
seed/ts-sdk/alias/src/version.ts: Added a new file that exports the SDK_VERSION constant with the value "0.0.1".
seed/ts-sdk/any-auth/src/version.ts: Added a new file that exports the SDK_VERSION constant with the value "0.0.1".
seed/ts-sdk/api-wide-base-path/src/version.ts: Added a new file that exports the SDK_VERSION constant with the value "0.0.1".
seed/ts-sdk/audiences/no-custom-config/src/version.ts: Added a new file that exports the SDK_VERSION constant with the value "0.0.1".
seed/ts-sdk/audiences/with-partner-audience/src/version.ts: Added a new file that exports the SDK_VERSION constant with the value "0.0.1".
seed/ts-sdk/auth-environment-variables/src/version.ts: Added a new file that exports the SDK_VERSION constant with the value "0.0.1".
seed/ts-sdk/basic-auth-environment-variables/src/version.ts: Added a new file that exports the SDK_VERSION constant with the value "0.0.1".
seed/ts-sdk/basic-auth/src/version.ts: Added a new file that exports the SDK_VERSION constant with the value "0.0.1".
This PR bootstraps a
typescript-codegen
package with a lightweight AST that we can grow overtime. Additionally, we now generate aversion.ts
that looks something like:AI Description
This pull request introduces a new feature to the TypeScript SDK, enabling the generation of a
version.ts
file that exports a constantSDK_VERSION
. This constant can be used by various utilities to dynamically import the version, allowing for customisation of the user agent.Changes
depcheck
tool, specifying the dependencies to ignore.prettier
tool.CodeBlock
class, which extends theAstNode
class and provides functionality for writing code blocks.Type
class, which extends theAstNode
class and represents a C# parameter to a method.Variable
class, which extends theAstNode
class and represents a variable with various attributes.AstNode
class, which extends theAbstractAstNode
class and serves as a base class for other AST nodes.Writer
class, which extends theAbstractWriter
class and provides functionality for writing code.AstNode
andWriter
classes from their respective files.CodeBlock
,Type
, andVariable
classes, as well as theAstNode
andWriter
classes from the core module.ts
module and theAstNode
andWriter
classes from the core module.codeblock
andvariable
functions, as well as various modules from theast
directory.version.ts
file and theSDK_VERSION
constant.@fern-api/typescript-codegen
package.VersionFileGenerator
class and a new code block that creates an instance ofVersionFileGenerator
and calls itsgenerate
method.VersionFileGenerator
class, which generates theversion.ts
file and exports theSDK_VERSION
constant.codegen
package.codegen
package.generators/typescript/codegen
andgenerators/typescript/express/cli
packages, specifying their dependencies and versions.SDK_VERSION
constant with the value "0.0.1".SDK_VERSION
constant with the value "0.0.1".SDK_VERSION
constant with the value "0.0.1".SDK_VERSION
constant with the value "0.0.1".SDK_VERSION
constant with the value "0.0.1".SDK_VERSION
constant with the value "0.0.1".SDK_VERSION
constant with the value "0.0.1".SDK_VERSION
constant with the value "0.0.1".SDK_VERSION
constant with the value "0.0.1".