nwolverson / purescript-language-server

MIT License
184 stars 41 forks source link

Are the Node (dev)Dependencies correct? #151

Closed toastal closed 2 years ago

toastal commented 2 years ago

I've been somewhat maintaining the purescript-language-server for easy-purescript-nix (just opened the merge request for 0.15.6). To update this I'm running node2nix which is an order of magnitude slower than NPM so it can become very apparent when a lot extra dependencies are added.

I was really surprised to see the non-dev version downloading parcel and postcss stuff for a CLI tool. Is @parcel/config-default necessary? If I'm wrong, do close, but I want to double-check that there aren't extraneous deps for the prod build. Or perhaps there's a smaller bundling strategy?


Actually the tests have failed because of node-gyp--which wasn't previously needed. This seems to me like a red flag that maybe more is happening than should.

nwolverson commented 2 years ago

No, the parcel stuff shouldn't be there, I think parcel magically installs some things that have crept in here.

There is a bundled one-JS build now built with parcel which could be useful for some packaging alternative, but the dependencies should really only pop up on the build server

nwolverson commented 2 years ago

Pushed an update to package.json

toastal commented 2 years ago

Not to open a new issue, tests are still failing pulling from the git+https//..#hash. There is no server.js in the bundled tarball from Git. Was this supposed to be compiled before pushing? Or is this a result of me pulling from the Git repository because a new version hasn't been pushed to NPM? I could probably use spago2nix to solve this, but I very much know that Justin does not want any building/compiling if possible because it really slows down the whole easy part of easy-purescript-nix. Recently, I moved purs-tidy off of spago2nix in favor of NPM because it just downloads the script and then node2nix's Node runs it.

$ pwd
/nix/store/nr3zkcvw1cv6hggm9fk9biyxw4pjcs08-node_purescript-language-server-0.15.6
$ cat lib/node_modules/purescript-language-server/cli.js 
#!/nix/store/z4771f9ksr1zginz2dakj9830ib1l5dz-nodejs-12.22.6/bin/node
require('./server.js');
$ tree lib/node_modules/purescript-language-server/
lib/node_modules/purescript-language-server/
├── CHANGELOG.md
├── cli.js
├── LICENSE.md
├── node_modules
│   ├── isexe
│   │   ├── index.js
│   │   ├── LICENSE
│   │   ├── mode.js
│   │   ├── package.json
│   │   ├── README.md
│   │   ├── test
│   │   │   └── basic.js
│   │   └── windows.js
│   ├── shell-quote
│   │   ├── CHANGELOG.md
│   │   ├── example
│   │   │   ├── env.js
│   │   │   ├── op.js
│   │   │   ├── parse.js
│   │   │   └── quote.js
│   │   ├── index.js
│   │   ├── LICENSE
│   │   ├── package.json
│   │   ├── readme.markdown
│   │   └── test
│   │       ├── comment.js
│   │       ├── env_fn.js
│   │       ├── env.js
│   │       ├── op.js
│   │       ├── parse.js
│   │       ├── quote.js
│   │       └── set.js
│   ├── uuid
│   │   ├── AUTHORS
│   │   ├── bin
│   │   │   └── uuid
│   │   ├── CHANGELOG.md
│   │   ├── index.js
│   │   ├── lib
│   │   │   ├── bytesToUuid.js
│   │   │   ├── md5-browser.js
│   │   │   ├── md5.js
│   │   │   ├── rng-browser.js
│   │   │   ├── rng.js
│   │   │   ├── sha1-browser.js
│   │   │   ├── sha1.js
│   │   │   └── v35.js
│   │   ├── LICENSE.md
│   │   ├── package.json
│   │   ├── README.md
│   │   ├── v1.js
│   │   ├── v3.js
│   │   ├── v4.js
│   │   └── v5.js
│   ├── vscode-jsonrpc
│   │   ├── lib
│   │   │   ├── cancellation.d.ts
│   │   │   ├── cancellation.js
│   │   │   ├── events.d.ts
│   │   │   ├── events.js
│   │   │   ├── is.d.ts
│   │   │   ├── is.js
│   │   │   ├── linkedMap.d.ts
│   │   │   ├── linkedMap.js
│   │   │   ├── main.d.ts
│   │   │   ├── main.js
│   │   │   ├── messageReader.d.ts
│   │   │   ├── messageReader.js
│   │   │   ├── messages.d.ts
│   │   │   ├── messages.js
│   │   │   ├── messageWriter.d.ts
│   │   │   ├── messageWriter.js
│   │   │   ├── pipeSupport.d.ts
│   │   │   ├── pipeSupport.js
│   │   │   ├── socketSupport.d.ts
│   │   │   └── socketSupport.js
│   │   ├── License.txt
│   │   ├── package.json
│   │   ├── README.md
│   │   ├── thirdpartynotices.txt
│   │   └── typings
│   │       └── thenable.d.ts
│   ├── vscode-languageserver
│   │   ├── bin
│   │   │   └── installServerIntoExtension
│   │   ├── lib
│   │   │   ├── callHierarchy.proposed.d.ts
│   │   │   ├── callHierarchy.proposed.js
│   │   │   ├── configuration.d.ts
│   │   │   ├── configuration.js
│   │   │   ├── files.d.ts
│   │   │   ├── files.js
│   │   │   ├── main.d.ts
│   │   │   ├── main.js
│   │   │   ├── progress.d.ts
│   │   │   ├── progress.js
│   │   │   ├── resolve.d.ts
│   │   │   ├── resolve.js
│   │   │   ├── sematicTokens.proposed.d.ts
│   │   │   ├── sematicTokens.proposed.js
│   │   │   ├── utils
│   │   │   │   ├── is.d.ts
│   │   │   │   ├── is.js
│   │   │   │   ├── is.js.map
│   │   │   │   ├── uuid.d.ts
│   │   │   │   ├── uuid.js
│   │   │   │   └── uuid.js.map
│   │   │   ├── workspaceFolders.d.ts
│   │   │   └── workspaceFolders.js
│   │   ├── License.txt
│   │   ├── package.json
│   │   ├── README.md
│   │   ├── thirdpartynotices.txt
│   │   └── typings
│   │       └── thenable.d.ts
│   ├── vscode-languageserver-protocol
│   │   ├── browser.d.ts
│   │   ├── browser.js
│   │   ├── lib
│   │   │   ├── browser
│   │   │   │   ├── main.d.ts
│   │   │   │   └── main.js
│   │   │   ├── common
│   │   │   │   ├── api.d.ts
│   │   │   │   ├── api.js
│   │   │   │   ├── connection.d.ts
│   │   │   │   ├── connection.js
│   │   │   │   ├── messages.d.ts
│   │   │   │   ├── messages.js
│   │   │   │   ├── protocol.callHierarchy.d.ts
│   │   │   │   ├── protocol.callHierarchy.js
│   │   │   │   ├── protocol.colorProvider.d.ts
│   │   │   │   ├── protocol.colorProvider.js
│   │   │   │   ├── protocol.configuration.d.ts
│   │   │   │   ├── protocol.configuration.js
│   │   │   │   ├── protocol.declaration.d.ts
│   │   │   │   ├── protocol.declaration.js
│   │   │   │   ├── protocol.d.ts
│   │   │   │   ├── protocol.fileOperations.d.ts
│   │   │   │   ├── protocol.fileOperations.js
│   │   │   │   ├── protocol.foldingRange.d.ts
│   │   │   │   ├── protocol.foldingRange.js
│   │   │   │   ├── protocol.implementation.d.ts
│   │   │   │   ├── protocol.implementation.js
│   │   │   │   ├── protocol.js
│   │   │   │   ├── protocol.linkedEditingRange.d.ts
│   │   │   │   ├── protocol.linkedEditingRange.js
│   │   │   │   ├── protocol.moniker.d.ts
│   │   │   │   ├── protocol.moniker.js
│   │   │   │   ├── protocol.progress.d.ts
│   │   │   │   ├── protocol.progress.js
│   │   │   │   ├── protocol.selectionRange.d.ts
│   │   │   │   ├── protocol.selectionRange.js
│   │   │   │   ├── protocol.semanticTokens.d.ts
│   │   │   │   ├── protocol.semanticTokens.js
│   │   │   │   ├── protocol.showDocument.d.ts
│   │   │   │   ├── protocol.showDocument.js
│   │   │   │   ├── protocol.typeDefinition.d.ts
│   │   │   │   ├── protocol.typeDefinition.js
│   │   │   │   ├── protocol.workspaceFolders.d.ts
│   │   │   │   ├── protocol.workspaceFolders.js
│   │   │   │   └── utils
│   │   │   │       ├── is.d.ts
│   │   │   │       └── is.js
│   │   │   └── node
│   │   │       ├── main.d.ts
│   │   │       └── main.js
│   │   ├── License.txt
│   │   ├── node.cmd
│   │   ├── node.d.ts
│   │   ├── node.js
│   │   ├── node_modules
│   │   │   └── vscode-jsonrpc
│   │   │       ├── browser.d.ts
│   │   │       ├── browser.js
│   │   │       ├── lib
│   │   │       │   ├── browser
│   │   │       │   │   ├── main.d.ts
│   │   │       │   │   ├── main.js
│   │   │       │   │   ├── ril.d.ts
│   │   │       │   │   └── ril.js
│   │   │       │   ├── common
│   │   │       │   │   ├── api.d.ts
│   │   │       │   │   ├── api.js
│   │   │       │   │   ├── cancellation.d.ts
│   │   │       │   │   ├── cancellation.js
│   │   │       │   │   ├── connection.d.ts
│   │   │       │   │   ├── connection.js
│   │   │       │   │   ├── disposable.d.ts
│   │   │       │   │   ├── disposable.js
│   │   │       │   │   ├── encoding.d.ts
│   │   │       │   │   ├── encoding.js
│   │   │       │   │   ├── events.d.ts
│   │   │       │   │   ├── events.js
│   │   │       │   │   ├── is.d.ts
│   │   │       │   │   ├── is.js
│   │   │       │   │   ├── linkedMap.d.ts
│   │   │       │   │   ├── linkedMap.js
│   │   │       │   │   ├── messageBuffer.d.ts
│   │   │       │   │   ├── messageBuffer.js
│   │   │       │   │   ├── messageReader.d.ts
│   │   │       │   │   ├── messageReader.js
│   │   │       │   │   ├── messages.d.ts
│   │   │       │   │   ├── messages.js
│   │   │       │   │   ├── messageWriter.d.ts
│   │   │       │   │   ├── messageWriter.js
│   │   │       │   │   ├── ral.d.ts
│   │   │       │   │   ├── ral.js
│   │   │       │   │   ├── semaphore.d.ts
│   │   │       │   │   └── semaphore.js
│   │   │       │   └── node
│   │   │       │       ├── main.d.ts
│   │   │       │       ├── main.js
│   │   │       │       ├── ril.d.ts
│   │   │       │       └── ril.js
│   │   │       ├── License.txt
│   │   │       ├── node.cmd
│   │   │       ├── node.d.ts
│   │   │       ├── node.js
│   │   │       ├── package.json
│   │   │       ├── README.md
│   │   │       ├── thirdpartynotices.txt
│   │   │       └── typings
│   │   │           └── thenable.d.ts
│   │   ├── package.json
│   │   ├── README.md
│   │   └── thirdpartynotices.txt
│   ├── vscode-languageserver-textdocument
│   │   ├── lib
│   │   │   ├── esm
│   │   │   │   ├── main.d.ts
│   │   │   │   └── main.js
│   │   │   ├── tsconfig.esm.tsbuildInfo
│   │   │   └── umd
│   │   │       ├── main.d.ts
│   │   │       └── main.js
│   │   ├── License.txt
│   │   ├── package.json
│   │   ├── README.md
│   │   └── tsconfig.esm.json
│   ├── vscode-languageserver-types
│   │   ├── lib
│   │   │   ├── esm
│   │   │   │   ├── main.d.ts
│   │   │   │   └── main.js
│   │   │   └── umd
│   │   │       ├── main.d.ts
│   │   │       └── main.js
│   │   ├── License.txt
│   │   ├── package.json
│   │   └── README.md
│   ├── vscode-uri
│   │   ├── lib
│   │   │   ├── esm
│   │   │   │   ├── index.d.ts
│   │   │   │   └── index.js
│   │   │   └── umd
│   │   │       ├── index.d.ts
│   │   │       └── index.js
│   │   ├── LICENSE.md
│   │   ├── package.json
│   │   └── README.md
│   └── which
│       ├── bin
│       │   └── node-which
│       ├── CHANGELOG.md
│       ├── LICENSE
│       ├── package.json
│       ├── README.md
│       └── which.js
├── package.json
├── package-lock.json
├── packages.dhall
├── README.md
├── spago.dhall
├── src
│   ├── IdePurescript
│   │   ├── Build.purs
│   │   ├── Completion.purs
│   │   ├── Exec.purs
│   │   ├── Modules.js
│   │   ├── Modules.purs
│   │   ├── PscErrors.purs
│   │   ├── PscIde.purs
│   │   ├── PscIdeServer.purs
│   │   ├── QuickFix.purs
│   │   ├── Regex.purs
│   │   └── Tokens.purs
│   └── LanguageServer
│       ├── Console.purs
│       ├── Console.ts
│       ├── DocumentStore.purs
│       ├── DocumentStore.ts
│       ├── Handlers.purs
│       ├── Handlers.ts
│       ├── IdePurescript
│       │   ├── Assist.purs
│       │   ├── Build.js
│       │   ├── Build.purs
│       │   ├── Clean.purs
│       │   ├── CodeActions.purs
│       │   ├── Commands.purs
│       │   ├── Completion.purs
│       │   ├── Config.purs
│       │   ├── FoldingRanges.purs
│       │   ├── Formatting.purs
│       │   ├── Imports.purs
│       │   ├── Main.js
│       │   ├── Main.purs
│       │   ├── References.purs
│       │   ├── Search.purs
│       │   ├── Server.purs
│       │   ├── SuggestionRank.purs
│       │   ├── Symbols.purs
│       │   ├── TODO
│       │   ├── Tooltips.purs
│       │   └── Types.purs
│       ├── Setup.purs
│       ├── Setup.ts
│       ├── TextDocument.purs
│       ├── TextDocument.ts
│       ├── Text.purs
│       ├── tsconfig.json
│       ├── Types.purs
│       ├── Uri.purs
│       ├── Uri.ts
│       ├── Window.purs
│       └── Window.ts
└── test
    └── Main.purs

49 directories, 281 files
nwolverson commented 2 years ago

The npm bundle is correct, server.js is built as part of the prepare script which is run as part of making the npm bundle as well as direct npm install.

0.15.7 is published now, can you try with that

toastal commented 2 years ago

Thanks for the speedy replies! The tests now pass.