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

fix: package exports using api extractor #169

Draft
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

userquin
Copy link
Member

@userquin userquin commented Jan 12, 2025

This PR using latest vite-plugin-dts and using @microsoft/api-extractor (rollupTypes: true) to generate only 1 dts, 1 js and 1 cjs files.

Right now WebStorm/IntelliJ intellisense not working, VSCode autocompletion working fine.

We will need to add some stuff in the build for JetBrains IDE.

image

NOTE: missing three and postprocessing dependencies in the plyaground, it is working fine, no need to change anything in the sfc files.

Looks like latest dts plugin will require moving script lang stuff to sfc script, some components will require to create a ts module since it is exporting some symbols (for example EffectComposer sfc) and sfc script cannot export ts modules (no idea if it will fail on build time, the error comes from eslint):

ESLint error

image

Without changing Pixelation sfc, VSCode not showing auto completion, you can revert the changes, rebuild the package and the tgz and use this playground: https://github.com/userquin/tresjs-post-processing-playground

From this PR from root folder:

nr build && pnpm pack

then in the playground

pnpm remove @tresjs/post-processing
// override tgz
// rm -rf ./tresjs-post-processing-2.0.0.tgz
// cp -p <path-to-pr-folder>/tresjs-post-processing-2.0.0.tgz .
cp -rf <path-to-pr-folder>/tresjs-post-processing-2.0.0.tgz .
pnpm add ./tresjs-post-processing-2.0.0.tgz

Copy link

pkg-pr-new bot commented Jan 12, 2025

Open in Stackblitz

npm i https://pkg.pr.new/@tresjs/post-processing@169

commit: b7bc903

@userquin userquin marked this pull request as ready for review January 12, 2025 17:28
@userquin userquin requested a review from alvarosabu as a code owner January 12, 2025 17:28
@userquin userquin marked this pull request as draft January 12, 2025 19:36
@userquin
Copy link
Member Author

userquin commented Jan 12, 2025

Looks like current version (main) works fine in VSCode:

  • rollupTypes is breaking stuff for webstorm
  • without rollupTypes, types are broken for node16

We should move this package to ESM only and removing node10 types support. If you check the tsconfig files in my playground we only use Bundler (you can use pnpm create vite + vue/vue-ts...)

I'm going to prepare a PR for ESM only (or maybe here, there is no way to fix node16 types without rollupTypes).

thx for the investigation @brc-dd

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.

1 participant