post-processing icon indicating copy to clipboard operation
post-processing copied to clipboard

fix: package exports using api extractor

Open userquin opened this issue 1 year ago • 2 comments

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

userquin avatar Jan 12 '25 16:01 userquin

Open in Stackblitz

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

commit: b7bc903

pkg-pr-new[bot] avatar Jan 12 '25 17:01 pkg-pr-new[bot]

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

userquin avatar Jan 12 '25 19:01 userquin