Copy src/**file.js to lib/**file.js.flow for auto-exporting flow annotations#30
Copy src/**file.js to lib/**file.js.flow for auto-exporting flow annotations#30nodkz wants to merge 1 commit intofacebookarchive:masterfrom
src/**file.js to lib/**file.js.flow for auto-exporting flow annotations#30Conversation
…annotations Describe classes via `flow-typed` is too lazy and it may stale with time. The moreover types are already in the code. So let export them, like it done in `graphql-js`. Related: graphql/graphql-js#412
|
It's unfortunately not as simple as that here. Because these files are using Want to give that a shot? It's definitely more involved but perhaps worth it. FWIW, this library has changed very little in the last couple years so I think there's little risk of it going too stale on flow-typed :) |
|
@zpao I tried to do it like in var rename = require('gulp-rename');
var moduleMapFile = require('fbjs/module-map');
var fbjsConfigurePreset = require('babel-preset-fbjs/configure');
gulp.task('flow', function() {
return gulp
.src(paths.src)
.pipe(babel({
presets: [
fbjsConfigurePreset({
// autoImport: false,
target: 'flow',
rewriteModules: {map: moduleMapFile},
}),
],
}))
.pipe(flatten())
.pipe(rename({extname: '.js.flow'}))
.pipe(gulp.dest(paths.lib));
});It requires too much time for this trivial task from me. Too much unknowns 🤗 Even I'm not sure npm install correct packages or not without |
|
I can do it (I wrote it for the other projects and know fbjs), but it might be a little while.
On May 31 2017, at 11:45 pm, Pavel Chertorogov <notifications@github.com> wrote:
@zpao I tried to do it like in draft-js. But got following error:
ReferenceError: [BABEL] /Users/nod/www/_sandbox/emitter/src/BaseEventEmitter.js: Unknown option: direct.presets
at Logger.error (/Users/nod/www/_sandbox/emitter/node_modules/babel-core/lib/transformation/file/logger.js:58:11)
at OptionManager.mergeOptions (/Users/nod/www/_sandbox/emitter/node_modules/babel-core/lib/transformation/file/options/option-manager.js:126:29)
at OptionManager.init (/Users/nod/www/_sandbox/emitter/node_modules/babel-core/lib/transformation/file/options/option-manager.js:216:10)
var rename = require('gulp-rename');
var moduleMapFile = require('fbjs/module-map');
var fbjsConfigurePreset = require('babel-preset-fbjs/configure');
gulp.task('flow', function() {
return gulp
.src(paths.src)
.pipe(babel({
presets: [
fbjsConfigurePreset({
// autoImport: false,
target: 'flow',
rewriteModules: {map: moduleMapFile},
}),
],
}))
.pipe(flatten())
.pipe(rename({extname: '.js.flow'}))
.pipe(gulp.dest(paths.lib));
});
It requires too much time for this trivial task from me. Too much unknowns 🤗 Even I'm not sure npm install correct packages or not without yarn.lock.
Anyway, without better knowledge of your build process, I'll waste my time.
Can you do it yourself? It will be a good lesson for me.
—You are receiving this because you were mentioned.Reply to this email directly, view it on GitHub, or mute the thread.
|
Describe classes via
flow-typedis too lazy and it may stale with time.The moreover types are already in the code. So let export them, like it done in
graphql-js.Related: graphql/graphql-js#412