macil / flow-copy-source Goto Github PK
View Code? Open in Web Editor NEWScript to copy javascript files and append ".flow" to the filename
License: MIT License
Script to copy javascript files and append ".flow" to the filename
License: MIT License
3.3.0
to 3.3.1
.π¨ View failing branch.
This version is covered by your current version range and after updating it in your project the build failed.
chokidar is a direct dependency of this project, and it is very likely causing it to break. If other packages depend on yours, this update is probably also breaking those in turn.
The new version differs by 6 commits.
1cbbef6
Release 3.3.1.
cd77e94
Update readdirp.
7c79e45
Update fsevents.
63ac031
Bump dtslint.
3728d37
Bump dtslint from 1.0.2 to 2.0.0 (#947)
74cbc36
Update docs.
See the full diff
There is a collection of frequently asked questions. If those donβt help, you can always ask the humans behind Greenkeeper.
Your Greenkeeper Bot π΄
I came across this on my journey learning how to export my own npm module's flow types. While this module does save a lot of "hand jamming", it also copies EVERY *.{js,mjs,jsx} even if they don't have the Flow Type annotation comment (e.g. // @flow
or /* @flow */
) thus "bloating" the lib/ or dist/ folders. The most simplistic and elegant approach I came up with was to use a simple one-liner script in my package.json
"scripts": {
"build": "babel src/ -d lib/ && yarn copy-flow-source",
"copy-flow-source": "for f in `grep --include=\\*.js -rlw src/ -e '^//\\s*@flow'`; do cp ${f} lib/${f#*/}.flow; done;",
...
}
This would be a nice feature to add to your module, however I'm not sure kefir read contents of files like grep can. This way we follow the philosophy of keeping modules as lean as possible.
Currently the --ignore param pipes a string straight into the ignore node of the options object. This works well where you want to ignore a single path. However as the ignore property accepts an array for multiple paths, there is no way to pass multiple ignore paths in via the --ignore option.
I've noticed that the babel-cli does allow this behavior via a comma delimited list. It would be great if this behavior was allow in this library as well.
babel
does this, and when I just run flow-copy-source
, flow
doesn't appear to be able to find the correct files until I rename all the .jsx.flow
files to .js.flow
.
I guess flow-copy-source
has some watch commands, but I don't use them, and its old version of chokidar
depends on an old version of fsevents
which doesn't build on Node 12.
Some of my react components are redirected for backward compatibility. But it breaks flow:
src/fields/InputSelect/InputSelect.js
:
export default from '../../organisms/InputSelect/InputSelect'
Error:
node_modules/.bin/flow
Error ββββββββββββββββββββββββββββββββ node_modules/***/lib/fields/InputSelect/InputSelect.js.flow:1:21
Unexpected string
1β export default from '../../organisms/InputSelect/InputSelect'
2β
Is it a flow
bug, or flow-copy-source
?
Given a file structure of:
src/index.js
src/index.test.js
And the running of the command:
yarn flow-copy-source -i **/*.test.js src lib
The src/index.test.js
file will still be copied.
Would be helpful to remove any .flow
files that are no longer in the source.
It may be a basic question, what is the best way to use this script?
Can it be integrated with Babel?
13.2.2
to 13.2.4
.π¨ View failing branch.
This version is covered by your current version range and after updating it in your project the build failed.
yargs is a direct dependency of this project, and it is very likely causing it to break. If other packages depend on yours, this update is probably also breaking those in turn.
The new version differs by 14 commits.
a6e67f1
chore(release): 13.2.4
fc13476
chore: update standard-verison dependency
bf46813
fix(i18n): rename unclear 'implication failed' to 'missing dependent arguments' (#1317)
a3a5d05
docs: fix a broken link to MS Terminology Search (#1341)
b4f8018
build: add .versionrc that hides test/build
0c39183
chore(release): 13.2.3
08e0746
chore: update deps (#1340)
843e939
docs: make --no-
boolean prefix easier to find in the docs (#1338)
84cac07
docs: restore removed changelog of v13.2.0 (#1337)
b20db65
fix(deps): upgrade cliui for compatibility with latest chalk. (#1330)
c294d1b
test: accept differently formatted output (#1327)
ac3f10c
chore: move .hbs templates into .js to facilitate webpacking (#1320)
0295132
fix: address issues with dutch translation (#1316)
9f2468e
doc: clarify parserConfiguration object structure (#1309)
See the full diff
There is a collection of frequently asked questions. If those donβt help, you can always ask the humans behind Greenkeeper.
Your Greenkeeper Bot π΄
Would be nice if your dev environment depends on up-to-date flow files.
If you use webpack or babel to (for example) import
some png
files into your project, you can then use name_mapper
in your .flowconfig
so Flow better understands what's going on.
It would be great if flow-copy-source
could replace image imports with an import of the mapped stub when generating .js.flow
files.
I'm running the following command
flow-copy-src ./src ./build -i **/index.js
And receive the following error
[ { Error: ENOTDIR: not a directory, unlink '/local/path/src/index.js/index.js.flow'
at Error (native)
errno: -20,
code: 'ENOTDIR',
syscall: 'unlink',
path: '/local/path/src/index.js/index.js.flow' } ]
But if I run this glob
manually - looking at the way src/kefir-glob
is invoked from 'flowCopySource- like so:
new Glob('/*.js?(x)', {cwd: './src', strict: true, ignore: '/index.js})
I get the correct list of file I want to be copied.
I haven't gone further into the behaviour of flowCopySource
, but this seems incorrect behaviour.
I've created my own script to do mimic the behaviour of this lib, using fs-extra
to copy the files, without implementing kefir
which works without issue.
Am I missing something? Holding it wrong?
Thanks in advance!
A declarative, efficient, and flexible JavaScript library for building user interfaces.
π Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. πππ
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google β€οΈ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.