这是indexloc提供的服务,不要输入任何密码
Skip to content

Conversation

@j-ibarra
Copy link
Contributor

@j-ibarra j-ibarra commented Aug 2, 2025

continuation of #2281 to solve types.gen.ts

{
	name: "@hey-api/transformers",
	dates: true,
	bigInt: false,
	transformers: [decimalExpressions],
        typeTransformers: [decimalTypeTransformer],
}
export const decimalTypeTransformers: TypeTransformer = ({ schema, file }) => {
	if (schema.type !== "string" || schema.format !== "decimal") {
		return undefined;
	}

	file.import({
		module: "decimal.js",
		name: "Decimal",
	});

	return tsc.typeReferenceNode({ typeName: "Decimal" });
};

in types.gen.ts

import type { Decimal } from "decimal.js";

export type myResponse = {
	/**
	 * The amount to withdraw
	 */
	amount?: Decimal;
	/**
	 * The time the preview was created
	 */
	createdAt?: Date;
};

@bolt-new-by-stackblitz
Copy link

Review PR in StackBlitz Codeflow Run & review this pull request in StackBlitz Codeflow.

@changeset-bot
Copy link

changeset-bot bot commented Aug 2, 2025

🦋 Changeset detected

Latest commit: 2ac456f

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
@hey-api/openapi-ts Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@vercel
Copy link

vercel bot commented Aug 2, 2025

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
hey-api-docs ✅ Ready (Inspect) Visit Preview 💬 Add feedback Aug 3, 2025 6:04am

@codecov
Copy link

codecov bot commented Aug 2, 2025

Codecov Report

❌ Patch coverage is 0% with 10 lines in your changes missing coverage. Please review.
✅ Project coverage is 22.53%. Comparing base (073d56e) to head (2ac456f).
⚠️ Report is 10 commits behind head on main.

Files with missing lines Patch % Lines
...enapi-ts/src/plugins/@hey-api/typescript/plugin.ts 0.00% 10 Missing ⚠️
Additional details and impacted files
@@           Coverage Diff           @@
##             main    #2383   +/-   ##
=======================================
  Coverage   22.53%   22.53%           
=======================================
  Files         324      324           
  Lines       31840    31855   +15     
  Branches     1232     1234    +2     
=======================================
+ Hits         7174     7179    +5     
- Misses      24657    24667   +10     
  Partials        9        9           
Flag Coverage Δ
unittests 22.53% <0.00%> (+<0.01%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@pkg-pr-new
Copy link

pkg-pr-new bot commented Aug 2, 2025

Open in StackBlitz

npm i https://pkg.pr.new/hey-api/openapi-ts/@hey-api/nuxt@2383
npm i https://pkg.pr.new/hey-api/openapi-ts/@hey-api/openapi-ts@2383
npm i https://pkg.pr.new/hey-api/openapi-ts/@hey-api/vite-plugin@2383

commit: 2ac456f

@mrlubos mrlubos merged commit 27c8be7 into hey-api:main Aug 3, 2025
15 of 16 checks passed
@github-actions github-actions bot mentioned this pull request Aug 3, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants