
Security News
TypeScript is Porting Its Compiler to Go for 10x Faster Builds
TypeScript is porting its compiler to Go, delivering 10x faster builds, lower memory usage, and improved editor performance for a smoother developer experience.
flow-scripts
Advanced tools
Utility tools for Flow.
$ npm install flow-scripts --save-dev
$ flow-scripts stub
By default, running Flow on startup will read all the files under node_modules
. Ignoring the node_modules
directory isn't a good idea because Flow looks in there to a) ensure you've actually installed your dependencies and b) find Flow libdefs for packages which might have included them, and Flow will throw a module not found error. Refer to this issue for an in-depth discussion on the topic.
The workaround is to ignore the node_modules
directory but manually include the libdefs inside the flow-typed
directory or provide a stub for it. This script automatically generates the stubs required for the dependencies
in package.json
that are missing in the libdefs fetched from the flow-typed install
command.
By adding the script to an npm script postinstall
hook, when new packages are installed, it will be automatically added into flow-typed/
.
In package.json
, add to the postinstall
hook:
...
"scripts": {
"postinstall": "flow-scripts stub"
},
...
In the project directory, run:
$ flow-typed install
$ flow-scripts stub
This will do the following:
flow-typed
repo for compatible libdefs and downloade them. Detailed explanation can be found on the Flow website.dependencies
in package.json
that are missing in the libdefs fetched from the flow-typed install
command and write them into flow-typed/package-dep-libdefs.js
.Testing this library is tricky because it relies on a real project that has multiple dependencies in package.json
. Hence we create a mock project in the test-project
folder that has some common JS dependencies defined and symlink the flow-scripts
library within that project to our development file in the root folder. Run the commands within that mock project to test that the library is actually working as intended.
$ cd test-project
$ npm install # or yarn install
$ npm link ../
$ flow-scripts stub # flow-typed/package-dep-libdefs.js file should be generated
FAQs
Utility scripts for Flowtypes
The npm package flow-scripts receives a total of 67 weekly downloads. As such, flow-scripts popularity was classified as not popular.
We found that flow-scripts demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 2 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
TypeScript is porting its compiler to Go, delivering 10x faster builds, lower memory usage, and improved editor performance for a smoother developer experience.
Research
Security News
The Socket Research Team has discovered six new malicious npm packages linked to North Korea’s Lazarus Group, designed to steal credentials and deploy backdoors.
Security News
Socket CEO Feross Aboukhadijeh discusses the open web, open source security, and how Socket tackles software supply chain attacks on The Pair Program podcast.