Skip to content

Commit

Permalink
apacheGH-34567: [JS] Improve build and do not generate bin/bin dire…
Browse files Browse the repository at this point in the history
…ctory

Signed-off-by: abetomo <abe@enzou.tokyo>
  • Loading branch information
abetomo committed Jul 11, 2023
1 parent 05620b1 commit 3d36e8c
Show file tree
Hide file tree
Showing 3 changed files with 1 addition and 25 deletions.
6 changes: 1 addition & 5 deletions js/gulp/closure-task.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@ import path from 'path';
import { mkdirp } from 'mkdirp';
import sourcemaps from 'gulp-sourcemaps';
import { memoizeTask } from './memoize-task.js';
import { compileBinFiles } from './typescript-task.js';

import closureCompiler from 'google-closure-compiler';
const compiler = closureCompiler.gulp();
Expand Down Expand Up @@ -54,10 +53,7 @@ export const closureTask = ((cache) => memoizeTask(cache, async function closure
fs.promises.writeFile(entry_point, generateUMDExportAssignment(srcAbsolute, exportedImports))
]);

return await Promise.all([
runClosureCompileAsObservable().toPromise(),
compileBinFiles(target, format).toPromise()
]);
return await runClosureCompileAsObservable().toPromise();

function runClosureCompileAsObservable() {
return observableFromStreams(
Expand Down
8 changes: 0 additions & 8 deletions js/gulp/typescript-task.js
Original file line number Diff line number Diff line change
Expand Up @@ -34,19 +34,11 @@ export const typescriptTask = ((cache) => memoizeTask(cache, function typescript
const out = targetDir(target, format);
const tsconfigPath = path.join(`tsconfig`, `tsconfig.${tsconfigName(target, format)}.json`);
return compileTypescript(out, tsconfigPath)
.pipe(mergeWith(compileBinFiles(target, format)))
.pipe(takeLast(1))
.pipe(share({ connector: () => new ReplaySubject(), resetOnError: false, resetOnComplete: false, resetOnRefCountZero: false }))
}))({});

export default typescriptTask;

export function compileBinFiles(target, format) {
const out = targetDir(target, format);
const tsconfigPath = path.join(`tsconfig`, `tsconfig.${tsconfigName('bin', 'cjs')}.json`);
return compileTypescript(path.join(out, 'bin'), tsconfigPath, { target });
}

function compileTypescript(out, tsconfigPath, tsconfigOverrides) {
const tsProject = ts.createProject(tsconfigPath, { typescript: tsc, ...tsconfigOverrides });
const { stream: { js, dts } } = observableFromStreams(
Expand Down
12 changes: 0 additions & 12 deletions js/tsconfig/tsconfig.bin.cjs.json

This file was deleted.

0 comments on commit 3d36e8c

Please sign in to comment.