Skip to content

Conversation

@userquin
Copy link
Member

@userquin userquin commented Sep 24, 2025

This PR includes:

  • use tsdown to build the lib
  • use relatives paths to import modules, right now there are a few imports using src/** or **/
  • add composables, components, directives, types, utils and template-compiler-options, unimport and unplugin-vue-components new subpackage exports (not just types) => NOTE: use unimport to auto-import components and directives and unplugin-vue-components to auto-import components (on Nuxt the is no need for components)
  • this PR should be breaking: now utils/template-compiler-options not being exported by @tresjs/core => @tresjs/core/template-compiler-options: NOTE: added back templateCompilerOptions to the default subpackage export.
  • removed package.json content from dist/index.js via define: included define in the playground
  • fixed tsconfig.node.json files to allow resolve stuff from the corresponding src/** files
  • update docs to use @tresjs/core from src or dist root folders: current version using @tresjs/core from node_modules (there is some circular dependency with tresjs/cientos and/or @tresjs/leches)

I still need to (maybe @danielroe can help on this 👇 ):

  • ✔️ do some cleanup at root vite.config.ts, removed all build stuff: the banner moved to the tsdown config file.
  • ✔️ I also need to export TresJSCoreVersion somewhere, maybe at utils and barrel.
  • ✔️ check import.meta.env.MODE at logger module, failing at dev in the docs: not yet sure why still resolving from root dist folder when it should resolve from src root folder, check import.meta.env.MODE error error below => FIXED: we need to add @tresjs/** to build.transpile to avoid interpreting the packages during build
  • ✔️ remove root d.ts files, not needed => using typesVersions
  • add directives to the docs (this must go to another PR)
  • add new section for unimport andunplugin-vue-components (this should go to another PR)
import.meta.env.MODE error import.meta.env.MODE error

@tresjs/core subpackage exports
new @tresjs/core subpackage exports

@netlify
Copy link

netlify bot commented Sep 24, 2025

Deploy Preview for tresjs-docs ready!

Name Link
🔨 Latest commit e25c121
🔍 Latest deploy log https://app.netlify.com/projects/tresjs-docs/deploys/68d67669ac35500008edd828
😎 Deploy Preview https://deploy-preview-1094--tresjs-docs.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

@pkg-pr-new
Copy link

pkg-pr-new bot commented Sep 24, 2025

Open in StackBlitz

npm i https://pkg.pr.new/@tresjs/core@1094

commit: e25c121

@userquin
Copy link
Member Author

userquin commented Sep 24, 2025

There is some circular dependency, docs using @tresjs/core from node_modules, I just added some hack to resolve the package from src (dev/build/prepare commands) or dist (typecheck command) root folders.

@userquin
Copy link
Member Author

userquin commented Sep 24, 2025

@alvarosabu we should check prefixes at unimport and unplugin-vue-components, we need to check there is no collision with other @tresjs/** packages, maybe instead Tres prefix we can use TresCore: useXXX => useTresCoreXXX for composables and for directives at unplugin-vue-components

@alvarosabu
Copy link
Member

Hi @userquin thanks for taking the time, as always, to help us out here with the Typescript nightmare 🙈

I'd love to better understand the core motivation behind these changes. Are we primarily addressing the
Node16 moduleResolution issues shown in https://arethetypeswrong.github.io/?p=@tresjs/core@5.0.2?

I notice we're tackling three different areas simultaneously 😅, which makes it harder to evaluate each change
independently. Could we potentially break this into separate PRs to make review and testing more manageable?

  • Updating to tsdown
  • Subpackage exports
  • DX improvements with auto-import

add composables, components, directives, types, utils and template-compiler-options, unimport and unplugin-vue-components new subpackage exports (not just types) => NOTE: use unimport to auto-import components and directives and unplugin-vue-components to auto-import components (on Nuxt the is no need for components)

Regarding the barrel exports, this might have been something we should have addressed in V5. I'm wondering
if anyone is actually using these additional exports, as they seem to create maintenance overhead.. @userquin Are the components and composables exports necessary for the Nuxt module to work correctly?

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