Skip to content

Improve tasks CLI #821

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 26 commits into from
Aug 5, 2016
Merged
Changes from 1 commit
Commits
Show all changes
26 commits
Select commit Hold shift + click to select a range
45a548c
tasks: rewrite all test container sh scripts in node
etpinard Jul 19, 2016
1291888
tasks: use node script to run image/export on circleci
etpinard Jul 19, 2016
262e90d
fixup: docker pull testbed
etpinard Jul 29, 2016
0fd57ba
tasks: sub fs.existsSync for fs.statSync
etpinard Jul 19, 2016
3712e17
dry: look up container url in constants.js
etpinard Jul 19, 2016
5758129
tasks: rename watch_plotly.js -> watch.js
etpinard Jul 29, 2016
bac6685
tasks: move test syntax script to tasks/
etpinard Jul 29, 2016
f564a85
tasks: add common task util module
etpinard Jul 29, 2016
04096de
tasks: use common utils
etpinard Jul 29, 2016
7040e49
lint: group preprocess in sub-routines
etpinard Jul 29, 2016
5e04f37
lint: group stats in sub-routines
etpinard Jul 29, 2016
aca8fa0
tasks: hard code mapbox access token in constants.js
etpinard Jul 29, 2016
30c1b86
tasks: merge CI vs local run cmd logic in container command module
etpinard Jul 29, 2016
640bdb4
tasks: add docker run command
etpinard Jul 29, 2016
584e644
tasks: refactor pretest
etpinard Jul 29, 2016
0001833
tasks: use common module in container tasks
etpinard Jul 29, 2016
1c91068
rm sub-tasks on circle.yml that are now part of `pretest`
etpinard Jul 29, 2016
a793734
fixup: make container commands work on CI
etpinard Jul 29, 2016
d5cb921
tasks: a few stats.js fixups
etpinard Aug 2, 2016
f662025
tasks: merge format bundle make watchified bundle script
etpinard Aug 2, 2016
294cad0
DRY: use watchified bundle util in test dashboard server
etpinard Aug 2, 2016
c479fe6
rm useless eslintrc
etpinard Aug 2, 2016
8a4f5ee
tasks: add formatTime common util
etpinard Aug 4, 2016
e5ee342
tasks: add get time last modified util
etpinard Aug 4, 2016
7c0562f
lint & comment
etpinard Aug 5, 2016
cfda7d3
tasks: add sleep (try to make pretest make consistent)
etpinard Aug 5, 2016
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
54 changes: 32 additions & 22 deletions tasks/preprocess.js
Original file line number Diff line number Diff line change
@@ -1,35 +1,45 @@
var fs = require('fs-extra');

var sass = require('node-sass');

var constants = require('./util/constants');
var common = require('./util/common');
var pullCSS = require('./util/pull_css');
var pullFontSVG = require('./util/pull_font_svg');
var updateVersion = require('./util/update_version');
var constants = require('./util/constants');

// main
makeBuildCSS();
makeBuildFontSVG();
copyTopojsonFiles();
updateVersion(constants.pathToPlotlyCore);
updateVersion(constants.pathToPlotlyGeoAssetsSrc);

// convert scss to css
sass.render({
file: constants.pathToSCSS,
outputStyle: 'compressed'
}, function(err, result) {
if(err) console.log('SASS error');
// convert scss to css to js
function makeBuildCSS() {
sass.render({
file: constants.pathToSCSS,
outputStyle: 'compressed'
}, function(err, result) {
if(err) throw err;

// css to js
pullCSS(String(result.css), constants.pathToCSSBuild);
});
// css to js
pullCSS(String(result.css), constants.pathToCSSBuild);
});
}

// convert font svg into js
fs.readFile(constants.pathToFontSVG, function(err, data) {
pullFontSVG(data.toString(), constants.pathToFontSVGBuild);
});
function makeBuildFontSVG() {
fs.readFile(constants.pathToFontSVG, function(err, data) {
if(err) throw err;

// copy topojson files from sane-topojson to dist/
fs.copy(constants.pathToTopojsonSrc, constants.pathToTopojsonDist,
{ clobber: true },
function(err) { if(err) throw err; }
);
pullFontSVG(data.toString(), constants.pathToFontSVGBuild);
});
}

// inject package version into source index files
updateVersion(constants.pathToPlotlyCore);
updateVersion(constants.pathToPlotlyGeoAssetsSrc);
// copy topojson files from sane-topojson to dist/
function copyTopojsonFiles() {
fs.copy(constants.pathToTopojsonSrc, constants.pathToTopojsonDist,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🐄 separate lines for each arg?

{ clobber: true },
common.throwOnError
);
}