Add graphql-compiler package
@@ -31,6 +31,7 @@ const babelOptions = require('./scripts/getBabelOptions')({
'fb-watchman': 'fb-watchman',
'fs': 'fs',
'graphql': 'graphql',
+ 'graphql-compiler': 'graphql-compiler',
'immutable': 'immutable',
'net': 'net',
'os': 'os',
@@ -208,6 +209,22 @@ const builds = [
},
],
},
+ {
+ package: 'graphql-compiler',
+ exports: {
+ index: 'GraphQLCompilerPublic.js',
+ },
+ bundles: [
+ {
+ entry: 'GraphQLCompilerPublic.js',
+ output: 'graphql-compiler',
+ libraryName: 'GraphQLCompiler',
+ libraryTarget: 'commonjs2',
+ target: 'node',
+ noMinify: true, // Note: uglify can't yet handle modern JS
+ },
+ ],
+ },
{
package: 'relay-runtime',
exports: {
@@ -229,21 +246,26 @@ gulp.task('clean', function() {
});
gulp.task('modules', function() {
- return es.merge(builds.map(build =>
- gulp.src([
+ return es.merge(builds.map(build => {
+ let sources = [
'*' + PACKAGES + '/' + build.package + '/**/*.js',
- // TODO: this is not a great way to share utility functions.
+ '!' + PACKAGES + '/**/__tests__/**/*.js',
+ '!' + PACKAGES + '/**/__mocks__/**/*.js',
+ ];
+ if (build.package !== 'graphql-compiler') {
+ sources.push(
'*' + PACKAGES + '/react-relay/classic/tools/*.js',
'*' + PACKAGES + '/react-relay/classic/util/*.js',
'*' + PACKAGES + '/react-relay/classic/__forks__/interface/*.js',
'*' + PACKAGES + '/react-relay/classic/interface/*.js',
- '*' + PACKAGES + '/relay-runtime/util/*.js',
- '!' + PACKAGES + '/**/__tests__/**/*.js',
- '!' + PACKAGES + '/**/__mocks__/**/*.js',
- ]).pipe(babel(babelOptions))
+ '*' + PACKAGES + '/relay-runtime/util/*.js'
+ );
+ }
+ return gulp.src(sources)
+ .pipe(babel(babelOptions))
.pipe(flatten())
- .pipe(gulp.dest(path.join(DIST, build.package, 'lib')))
- ));
+ .pipe(gulp.dest(path.join(DIST, build.package, 'lib')));
+ }));
});
gulp.task('copy-files', function() {
