Skip to content

Commit

Permalink
ship es2015 commonJS in main package to avoid confusion
Browse files Browse the repository at this point in the history
  • Loading branch information
trxcllnt committed Jan 11, 2018
1 parent 74e828a commit 6ff18e9
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 9 deletions.
2 changes: 1 addition & 1 deletion js/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -178,7 +178,7 @@ The base `apache-arrow` package includes all the compilation targets for conveni
The targets are also published under the `@apache-arrow` namespace:

```sh
npm install apache-arrow # <-- combined es5/CommonJS + UMD, es2015/ESModules + UMD, and TypeScript package
npm install apache-arrow # <-- combined es5/UMD, es2015/CommonJS/ESModules/UMD, and TypeScript package
npm install @apache-arrow/ts # standalone TypeScript package
npm install @apache-arrow/es5-cjs # standalone es5/CommonJS package
npm install @apache-arrow/es5-esm # standalone es5/ESModules package
Expand Down
8 changes: 4 additions & 4 deletions js/gulp/arrow-task.js
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,8 @@ const { Observable, ReplaySubject } = require('rxjs');

const arrowTask = ((cache) => memoizeTask(cache, function copyMain(target, format) {
const out = targetDir(target);
const srcGlob = `src/**/*.ts`;
const es5Glob = `${targetDir(`es5`, `cjs`)}/**/*.js`;
const dtsGlob = `${targetDir(`es2015`, `cjs`)}/**/*.ts`;
const cjsGlob = `${targetDir(`es2015`, `cjs`)}/**/*.js`;
const esmGlob = `${targetDir(`es2015`, `esm`)}/**/*.js`;
const es5UmdGlob = `${targetDir(`es5`, `umd`)}/**/*.js`;
const es5UmdMaps = `${targetDir(`es5`, `umd`)}/**/*.map`;
Expand All @@ -38,8 +38,8 @@ const arrowTask = ((cache) => memoizeTask(cache, function copyMain(target, forma
const ch_ext = (ext) => gulpRename((p) => { p.extname = ext; });
const append = (ap) => gulpRename((p) => { p.basename += ap; });
return Observable.forkJoin(
observableFromStreams(gulp.src(srcGlob), gulp.dest(out)), // copy src ts files
observableFromStreams(gulp.src(es5Glob), gulp.dest(out)), // copy es5 cjs files
observableFromStreams(gulp.src(dtsGlob), gulp.dest(out)), // copy d.ts files
observableFromStreams(gulp.src(cjsGlob), gulp.dest(out)), // copy es2015 cjs files
observableFromStreams(gulp.src(esmGlob), ch_ext(`.mjs`), gulp.dest(out)), // copy es2015 esm files and rename to `.mjs`
observableFromStreams(gulp.src(es5UmdGlob), append(`.es5.min`), gulp.dest(out)), // copy es5 umd files and add `.min`
observableFromStreams(gulp.src(es5UmdMaps), gulp.dest(out)), // copy es5 umd sourcemap files, but don't rename
Expand Down
6 changes: 3 additions & 3 deletions js/gulp/package-task.js
Original file line number Diff line number Diff line change
Expand Up @@ -46,8 +46,8 @@ const createMainPackageJson = (target, format) => (orig) => ({
name: npmPkgName,
main: mainExport,
module: `${mainExport}.mjs`,
browser: `${mainExport}.es5.min.js`,
[`browser:es2015`]: `${mainExport}.es2015.min.js`,
dist: `${mainExport}.es5.min.js`,
[`dist:es2015`]: `${mainExport}.es2015.min.js`,
[`@std/esm`]: { esm: `mjs` }
});

Expand All @@ -67,7 +67,7 @@ const createScopedPackageJSON = (target, format) => (({ name, ...orig }) =>
(xs, key) => ({ ...xs, [key]: xs[key] || orig[key] }),
{ name: `${npmOrgName}/${packageName(target, format)}`,
version: undefined, main: `${mainExport}.js`, types: `${mainExport}.d.ts`,
browser: undefined, [`browser:es2015`]: undefined, module: undefined, [`@std/esm`]: undefined }
dist: undefined, [`dist:es2015`]: undefined, module: undefined, [`@std/esm`]: undefined }
)
)
);
Expand Down
2 changes: 1 addition & 1 deletion js/gulp/test-task.js
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ argv.update && jestArgv.push(`-u`);
argv.verbose && jestArgv.push(`--verbose`);
argv.coverage && jestArgv.push(`--coverage`);

const debugArgv = [`--runInBand`, `--env`, `jest-environment-node-debug`];
const debugArgv = [`--runInBand`, `--env`, `node-debug`];
const jest = require.resolve(path.join(`..`, `node_modules`, `.bin`, `jest`));
const testOptions = {
env: { ...process.env },
Expand Down

0 comments on commit 6ff18e9

Please sign in to comment.