Skip to content

Commit

Permalink
Merge dd61dcd into 6b24654
Browse files Browse the repository at this point in the history
  • Loading branch information
Matt Gaunt committed Sep 9, 2018
2 parents 6b24654 + dd61dcd commit 67f1f42
Show file tree
Hide file tree
Showing 29 changed files with 1,159 additions and 2,453 deletions.
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
build/
build-*/
dist/
docs/

Expand Down
Binary file removed demo/hopin-logger-screenshots.png
Binary file not shown.
23 changes: 0 additions & 23 deletions demo/index.html

This file was deleted.

14 changes: 0 additions & 14 deletions demo/node.js

This file was deleted.

36 changes: 0 additions & 36 deletions gulp-tasks/build.js

This file was deleted.

11 changes: 0 additions & 11 deletions gulp-tasks/copy.js

This file was deleted.

11 changes: 0 additions & 11 deletions gulp-tasks/typescript-commonjs.js

This file was deleted.

25 changes: 0 additions & 25 deletions gulp-tasks/typescript-modules-and-browsers.js

This file was deleted.

11 changes: 0 additions & 11 deletions gulp-tasks/typescript-test.js

This file was deleted.

18 changes: 0 additions & 18 deletions gulp-tasks/utils/get-task-filepaths.js

This file was deleted.

14 changes: 0 additions & 14 deletions gulp-tasks/utils/glob-promise.js

This file was deleted.

49 changes: 0 additions & 49 deletions gulp-tasks/utils/module-to-bundle.js

This file was deleted.

13 changes: 0 additions & 13 deletions gulp-tasks/utils/npm-run.js

This file was deleted.

23 changes: 0 additions & 23 deletions gulp-tasks/utils/spawn-promise.js

This file was deleted.

56 changes: 27 additions & 29 deletions gulpfile.js
Original file line number Diff line number Diff line change
@@ -1,36 +1,34 @@
const gulp = require('gulp');
const path = require('path');
const fs = require('fs-extra');
const {setConfig} = require('@hopin/wbt-config');
const tsNode = require('@hopin/wbt-ts-node');
const tsBrowser = require('@hopin/wbt-ts-browser');

const getTaskFilepaths = require('./gulp-tasks/utils/get-task-filepaths');
const src = path.join(__dirname, 'src');
const dst = path.join(__dirname, 'build');

global.__buildConfig = {
src: path.join(__dirname, 'src'),
dest: path.join(__dirname, 'dist'),
temp: path.join(__dirname, 'build'),
};
setConfig(src, dst);

const loadTasks = () => {
const taskFiles = getTaskFilepaths();
for (const taskFilepath of taskFiles) {
const {task} = require(taskFilepath);
if (task) {
gulp.task(task);
}
}
};
const buildBrowserDir = path.join(__dirname, 'build-browser');
const buildNodeDir = path.join(__dirname, 'build-node');
const buildTestDir = path.join(__dirname, 'build-test');

loadTasks();
gulp.task('clean',
gulp.parallel(
() => fs.remove(buildBrowserDir),
() => fs.remove(buildNodeDir),
() => fs.remove(buildTestDir),
)
)

gulp.task('dev', (done) => {
return gulp.series([
'build',
])(done);
});

gulp.task('prod', (done) => {
process.env.NODE_ENV = 'production';

return gulp.series([
'build',
])(done);
});
gulp.task('build',
gulp.series(
'clean',
gulp.parallel(
tsNode.gulpBuild({src: 'node', dst: buildNodeDir, rootDir: 'src'}),
tsNode.gulpBuild({dst: buildTestDir, rootDir: 'src'}),
tsBrowser.gulpBuild('hopin', {src: 'browser', dst: buildBrowserDir, rootDir: 'src'}),
)
)
);

0 comments on commit 67f1f42

Please sign in to comment.