Merge pull request #30 from kjin/js-core-packaging

Update js-core gulpfile and packaging
This commit is contained in:
Kelvin Jin 2017-09-15 10:00:02 -07:00 committed by GitHub
commit 1e8aa65c22
2 changed files with 13 additions and 7 deletions

View File

@ -62,9 +62,9 @@ function makeCompileFn(globs) {
.pipe(sourcemaps.init())
.pipe(tsProject)
.on('error', onError);
const jsmap = js.pipe(sourcemaps.write(jsCoreDir, {
const jsmap = js.pipe(sourcemaps.write('.', {
includeContent: false,
sourceRoot: path.resolve(jsCoreDir, '..')
sourceRoot: '..'
}));
const copy = gulp.src(copyGlob, { base: jsCoreDir });
return merge2([
@ -145,9 +145,11 @@ gulp.task('js.core.test.single', 'After dep tasks, runs individual files specifi
// util.env contains CLI arguments for the gulp task.
// Determine the path to the transpiled version of this TS file.
const getTranspiledPath = (file) => {
const dir = path.dirname(path.relative('.', file));
const dir = path.dirname(path.relative(jsCoreDir, file));
const basename = path.basename(file, '.ts');
return `${outDir}/${dir}/${basename}.js`;
const result = `${outDir}/${dir}/${basename}.js`;
console.log(result);
return result;
};
// Construct an instance of Mocha's runner API and feed it the path to the
// transpiled source.

View File

@ -15,6 +15,7 @@
"types": "src/index.ts",
"license": "Apache-2.0",
"devDependencies": {
"@types/lodash": "^4.14.73",
"@types/mocha": "^2.2.42",
"@types/node": "^8.0.25",
"clang-format": "^1.0.53",
@ -29,13 +30,16 @@
"scripts": {
"build": "npm run compile",
"clean": "gulp clean",
"compile": "gulp compile",
"compile": "gulp js.core.compile",
"format": "clang-format -i -style=\"{Language: JavaScript, BasedOnStyle: Google, ColumnLimit: 80}\" src/*.ts test/*.ts",
"lint": "tslint -c node_modules/google-ts-style/tslint.json -p . -t codeFrame --type-check",
"prepare": "npm run build",
"test": "gulp test"
},
"dependencies": {
"@types/lodash": "^4.14.73",
"lodash": "^4.17.4"
}
},
"files": [
"build/src/*.js"
]
}