Skip to content

feat(tpc): build-time third-party-capital composables #81

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

Merged
merged 27 commits into from
Jun 12, 2024

Conversation

huang-julien
Copy link
Member

@huang-julien huang-julien commented Jun 4, 2024

This PR re-introduce TPC as dependency and not type provider. TPC will be used to generate all composables (and components if possible).

Composables and components will be generated at USER build-time and not at @nuxt/scripts.

steps:

  • review from Aurora team for the implementation
  • clean it
  • move TPC to peer-deps

optionnal:

  • refactor with magic-ast
  • do it for embed components

Copy link

vercel bot commented Jun 4, 2024

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

Name Status Preview Comments Updated (UTC)
scripts-docs ✅ Ready (Inspect) Visit Preview 💬 Add feedback Jun 11, 2024 11:23am
scripts-playground ✅ Ready (Inspect) Visit Preview 💬 Add feedback Jun 11, 2024 11:23am

Copy link
Contributor

@flashdesignory flashdesignory left a comment

Choose a reason for hiding this comment

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

This looks really interesting. There's definitely some Nuxt specific stuff that I am not too familiar with, but overall it makes sense.

I like it, assuming we're ok with the manual / semi-manual updates of the tpc package.

If I'm getting it right, the gist is that we're adding (or updating) tpc scripts in the registry and kinda "glueing it all together", right?

package.json Outdated
]
},
"peerDependencies": {
"third-party-capital": "^1.0.30"
Copy link
Collaborator

Choose a reason for hiding this comment

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

what is the rationale for this?

Copy link
Member Author

Choose a reason for hiding this comment

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

I moved it to peer dep so module managers won't enforce a specific version of tpc. User will be free to update tpc on their own.

I'll change it to >=1

Copy link
Collaborator

Choose a reason for hiding this comment

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

What's the issue with having it as a dependency though? It's not clear

Copy link
Member Author

Choose a reason for hiding this comment

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

Having it as a dependency prevent users from having for example tpc v1.2.30. If set in peerDeps tpc should be updatable by users without tpc's version being locked by @nuxt/scripts

Copy link
Collaborator

@harlan-zw harlan-zw Jun 11, 2024

Choose a reason for hiding this comment

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

Seems like a reasonable constraint to avoid breaking behaviours. If TPC introduces new scripts or config we'd need to add code to support them anyway.

Users can always override the version if they really need

@harlan-zw
Copy link
Collaborator

I'm still not convinced TPC in its current format will be worth maintaining with Nuxt Scripts in the long term but I'm happy to move this forward for the time being once comments are addressed.

Either way this is a nice solution to avoiding the runtime of TPC, great work @huang-julien 👏

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.

4 participants