You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Mar 20, 2023. It is now read-only.
After seeing that the graphql-ws package is now a supported fetcher option merged in with PR #755, I was excited to try this functionality.
I want to use this new functionality that isn't yet offered in the NPM package, and I know that the volunteer team is waiting until another PR in graphql/graphql-js is merged before publishing another version of this package to NPM. I'm not arguing against this decision.
A mitigation that might help users waiting for this functionality is to better support git-based installs of this library. The two most popular package managers, NPM and Yarn, both offer ways to install packages from a git repository. However, this repository is configured in a way that does not conventionally build. The entry point to this package is not dist/index,js, and the built files are saved in a folder at ./resources/npmDist.
I do not know why the package does not build to a root-level ./dist folder, and upon publish, uses a .npmignore file to ignore ./src, but it makes supporting git-based installs a bit more difficult. Is there any reason to using the arbitrary directory ./resources/npmDist? Couldn't the custom-build script instead build to ./dist? That would eliminate the need to copy some files in the build script anyways.
With some ignore files in a particular configuration, NPM will only see build artifacts, and GitHub will only see source artifacts.
.gitignore
# ... Current ignores
dist
.npmignore
src
# Any other src files you don't want to distribute with the NPM package
Using a prepare script in the package.json will tell NPM what to do when being installed from a git repository. However, this script is also ran before some other hooks:
Runs any time before the package is packed, i.e. during npm publish and npm pack
Runs BEFORE the package is packed
Runs BEFORE the package is published
Runs on local npm install without any arguments
Run AFTER prepublish, but BEFORE prepublishOnly
This could possibly break some current workflows if not integrated properly with the current build process.
Some other methods are offered in this answer from Stack Overflow, some of which could possibly be integrated with the current build process, which takes place in the ./resources folder using build-npm.js.
After seeing that the
graphql-ws
package is now a supported fetcher option merged in with PR #755, I was excited to try this functionality.I want to use this new functionality that isn't yet offered in the NPM package, and I know that the volunteer team is waiting until another PR in graphql/graphql-js is merged before publishing another version of this package to NPM. I'm not arguing against this decision.
A mitigation that might help users waiting for this functionality is to better support git-based installs of this library. The two most popular package managers, NPM and Yarn, both offer ways to install packages from a git repository. However, this repository is configured in a way that does not conventionally build. The entry point to this package is not
dist/index,js
, and the built files are saved in a folder at./resources/npmDist
.I do not know why the package does not build to a root-level
./dist
folder, and upon publish, uses a.npmignore
file to ignore./src
, but it makes supporting git-based installs a bit more difficult. Is there any reason to using the arbitrary directory./resources/npmDist
? Couldn't the custom-build script instead build to./dist
? That would eliminate the need to copy some files in the build script anyways.With some ignore files in a particular configuration, NPM will only see build artifacts, and GitHub will only see source artifacts.
.gitignore
.npmignore
Using a
prepare
script in thepackage.json
will tell NPM what to do when being installed from a git repository. However, this script is also ran before some other hooks:npm publish
andnpm pack
npm install
without any argumentsprepublish
, but BEFOREprepublishOnly
This could possibly break some current workflows if not integrated properly with the current build process.
Some other methods are offered in this answer from Stack Overflow, some of which could possibly be integrated with the current build process, which takes place in the
./resources
folder usingbuild-npm.js
.Any thoughts? This would mitigate #746.
The text was updated successfully, but these errors were encountered: