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

Better NPM worklet handling #63

Open
spessasus opened this issue Oct 13, 2024 · 3 comments
Open

Better NPM worklet handling #63

spessasus opened this issue Oct 13, 2024 · 3 comments
Labels
enhancement New feature or request help wanted Extra attention is needed

Comments

@spessasus
Copy link
Owner

Is your feature request related to a problem? Please describe.
Currently, the NPM users have to manually copy over the worklet_processor.min.js every update. This is not good, and there's no way to tell bundlers to import it from node_modules

Is your feature related to the sound library or the app/website?
spessasynth_lib

Describe the solution you'd like
Something better that the current implementation. I'm not good with npm or bundlers, so help would be appreciated!

@spessasus spessasus added enhancement New feature or request help wanted Extra attention is needed labels Oct 13, 2024
@gkiranps
Copy link

This is the low tech solution I am using.

GetLatestSpessaSynth.BAT

d:
CD D:\Source\Dependencies_JS\SpessaSynth-master

call npm i spessasynth_lib

echo "Xcopy... FROM NPM TO Webserver"

xcopy /E /D /Y ^
D:\Source\Dependencies_JS\SpessaSynth-master\node_modules\spessasynth_lib\*.* ^
D:\WebServer\public\dist\spessasynth_lib\

pause

You can omit /D in XCopy if you want to overwrite all the files.

###########################################################

A NPM solution might be to set an Environment variable for the user's Webserver public spessasynth_lib folder
and add a npm run command to publish it.

@spessasus
Copy link
Owner Author

Hi,
Thanks for the suggestion.
Unfortunately, it is not suitable for the following reasons:

  • This solution assumes that all users keep their distribution files in a folder called public/dist. That is not always the case. I, for example usually use a folder named production.
  • This solution does not work with MacOS and Linux as they don't use batch files.
  • The idea is for the module to not require copying manually at all. I essentially either want to make audioWorklet.addModule be treated like an es6 import and using the worklet processor inside the package, or somehow tell bundlers that they should adjust the path in the import so it points to the processor in the package.

@gkiranps
Copy link

Hi spessasus,

Would the npm run command work with the ENV variable for the webserver path (My Second Suggestion above.) work ? This would be platform independent . Even if the builder is able to get the worklet path right you still need to move the files from node_modules to the webserver .

Thanks,
PSRK

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

2 participants