Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

WIP: Publish types in build package #1832

Closed
wants to merge 2 commits into from

Conversation

jelhan
Copy link
Contributor

@jelhan jelhan commented Feb 20, 2024

This changes the publish setup to build the types with Glint in declarations directory and publish them.

The published package still contains TypeScript files. They are not transpiled to JavaScript before publishing. But they weren't before. So that's not a regression.

Not a TypeScript expert here. Mainly copied the setup from Ember Bootstrap.

@jelhan
Copy link
Contributor Author

jelhan commented Feb 21, 2024

This is still not fully working. The structure of declarations folder is not as expected. It is (simplified):

  • declarations/
    • addon/
      • template-registry.d.ts
      • helpers/
        • t.d.ts
    • addon-test-support/
      • set-locale.d.ts
    • tests/
      • test-helper.d.ts

But I think it should be

  • declarations/
    • template-registry.d.ts
    • helpers/
      • t.d.ts
    • test-support/
      • set-locale.d.ts

The wrong structure breaks type lookup in consuming applications.

I'm not sure why it's wrong. The TypeScript configuration looks the same as for Ember Bootstrap. And in Ember Bootstrap it is working fine.

Keeping it in WIP until we figured that one out.

"*": {
"*": [
"declarations/*",
"declarations/*/index.d.ts"
Copy link
Contributor Author

Choose a reason for hiding this comment

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

@ijlee2
Copy link
Contributor

ijlee2 commented Feb 26, 2024

@jelhan I used ember-cli to check how it now creates a v1 addon with TypeScript. You can check the commits in #1835.

When I ran npm publish --dry-run in ember-intl, I saw that the unpacked size will increase due to the addition of declaration files. So I wonder if there's really a benefit of removing ember-cli-typescript in a v1 addon, when this could potentially introduce regressions. What do you think?

@ijlee2
Copy link
Contributor

ijlee2 commented May 20, 2024

Will close this in favor of #1885.

@ijlee2 ijlee2 closed this May 20, 2024
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.

None yet

2 participants