Skip to content

Conversation

@zxbodya
Copy link
Contributor

@zxbodya zxbodya commented Oct 24, 2025

Introducing a build step before package publishing, so sources can be updated to use more modern syntax and eventually migrate to TypeScript.

Changes:

  • renaming grafana folder to src
  • using grafana as output target for tsc output, this way - paths for published files would remain unchanged, ensuring backward compatibility
  • moving index.js export to part of src folder, updating index.js at package root to point to grafana/index.js (so it is backward compatible if file happens to be used directly)
  • for now, disabling d.ts output in tsconfig - it is to be enabled separately when actually converting sources to TypeScript

@zxbodya zxbodya marked this pull request as ready for review October 24, 2025 18:52
"description": "A grafana dashboard generator",
"main": "index.js",
"main": "grafana/index.js",
"types": "grafana/index.d.ts",
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This doesn't seem to point to anything?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I see grafana is generated by ts with npm run prepublish?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Correct, the grafana is to be generated by tsc on prepublish

package.json Outdated
"@types/jest": "^30.0.0",
"@types/node": "^24.9.1",
"@types/node-fetch": "^2.6.13",
"@types/tape": "^5.8.1",
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Doesn't look like we're using tape anymore so can we remove @types/tape?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good point, let me remove it

@@ -0,0 +1,10 @@
{
"extends": "./tsconfig.json",
// Visit https://aka.ms/tsconfig to read more about this file
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

json doesn't support comments like these. Can you confirm that the ts is interpreting tsconfig.build.json and tsconfig.json as JS instead of JSON?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

tsconfig is actually using JSONC - this comment, btw, and most of the config here, was generated by running tsc --init

@albertyw albertyw merged commit 9cd94e2 into uber:master Oct 24, 2025
7 checks passed
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