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

feat: publish types as module defs #9248

Merged
merged 1 commit into from
Mar 10, 2024
Merged

feat: publish types as module defs #9248

merged 1 commit into from
Mar 10, 2024

Conversation

runspired
Copy link
Contributor

@runspired runspired commented Mar 10, 2024

converts .d.ts files from es-module syntax to declare-module syntax, inserting references as needed. This will make using canary types possible.

does a simple string parse for now, with some error guards to alert us to whether we need an AST.

To use the types, apps will have to declare all of the EmberData packages that the ember-data package brings and configure them as types sources.

package.json:

    "ember-data": "5.4.0-alpha.33",
    "@ember-data/store": "5.4.0-alpha.33",
    "@ember-data/model": "5.4.0-alpha.33",
    "@ember-data/adapter": "5.4.0-alpha.33",
    "@ember-data/graph": "5.4.0-alpha.33",
    "@ember-data/json-api": "5.4.0-alpha.33",
    "@ember-data/legacy-compat": "5.4.0-alpha.33",
    "@ember-data/request": "5.4.0-alpha.33",
    "@ember-data/request-utils": "5.4.0-alpha.33",
    "@ember-data/serializer": "5.4.0-alpha.33",
    "@ember-data/tracking": "5.4.0-alpha.33",
    "@warp-drive/core-types": "0.0.0-alpha.19",

tsconfig.json

"types": [
      "ember-source/types",
      "ember-data/unstable-preview-types",
      "@ember-data/store/unstable-preview-types",
      "@ember-data/model/unstable-preview-types",
      "@ember-data/adapter/unstable-preview-types",
      "@ember-data/graph/unstable-preview-types",
      "@ember-data/json-api/unstable-preview-types",
      "@ember-data/legacy-compat/unstable-preview-types",
      "@ember-data/request/unstable-preview-types",
      "@ember-data/request-utils/unstable-preview-types",
      "@ember-data/serializer//unstable-preview-types",
      "@ember-data/tracking/unstable-preview-types",
      "@warp-drive/core-types/unstable-preview-types",
    ],

@runspired runspired added 🎯 canary PR is targeting canary (default) 🏷️ feat This PR introduces a new feature labels Mar 10, 2024
@runspired runspired self-assigned this Mar 10, 2024
@runspired runspired merged commit e89a3d4 into main Mar 10, 2024
16 of 18 checks passed
@runspired runspired deleted the update-publish branch March 10, 2024 10:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🎯 canary PR is targeting canary (default) 🏷️ feat This PR introduces a new feature
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

1 participant