-
-
Notifications
You must be signed in to change notification settings - Fork 1.9k
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
Improve tasks CLI #821
Changes from all commits
45a548c
1291888
262e90d
0fd57ba
3712e17
5758129
bac6685
f564a85
04096de
7040e49
5e04f37
aca8fa0
30c1b86
640bdb4
584e644
0001833
1c91068
a793734
d5cb921
f662025
294cad0
c479fe6
8a4f5ee
e5ee342
7c0562f
cfda7d3
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -9,20 +9,17 @@ machine: | |
services: | ||
- docker | ||
|
||
|
||
dependencies: | ||
pre: | ||
- docker pull plotly/testbed:latest | ||
post: | ||
- npm run cibuild | ||
- npm run pretest | ||
- docker run -d --name mytestbed -v $PWD:/var/www/streambed/image_server/plotly.js -p 9010:9010 plotly/testbed:latest | ||
- sudo ./tasks/run_in_testbed.sh mytestbed "cp -f test/image/index.html ../server_app/index.html" | ||
- wget --server-response --spider --tries=8 --retry-connrefused http://localhost:9010/ping | ||
|
||
test: | ||
override: | ||
- sudo ./tasks/run_in_testbed.sh mytestbed "export CIRCLECI=1 && node test/image/compare_pixels_test.js" | ||
- sudo ./tasks/run_in_testbed.sh mytestbed "node test/image/export_test.js" | ||
- npm run test-image | ||
- npm run test-export | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. the local vs CI differences are now handled at the task-runner script level. |
||
- npm run citest-jasmine | ||
- npm run test-bundle | ||
- npm run test-syntax | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -27,21 +27,21 @@ | |
"stats": "node tasks/stats.js", | ||
"build": "npm run preprocess && npm run bundle && npm run header && npm run stats", | ||
"cibuild": "npm run preprocess && node tasks/cibundle.js", | ||
"watch": "node tasks/watch_plotly.js", | ||
"watch": "node tasks/watch.js", | ||
"lint": "eslint . || true", | ||
"lint-fix": "eslint . --fix", | ||
"pretest": "node tasks/pretest.js", | ||
"test-jasmine": "karma start test/jasmine/karma.conf.js", | ||
"citest-jasmine": "karma start test/jasmine/karma.ciconf.js", | ||
"test-image": "./tasks/test_image.sh", | ||
"test-export": "./tasks/test_export.sh", | ||
"test-syntax": "node test/syntax_test.js", | ||
"test-image": "node tasks/test_image.js", | ||
"test-export": "node tasks/test_export.js", | ||
"test-syntax": "node tasks/test_syntax.js", | ||
"test-bundle": "node tasks/test_bundle.js", | ||
"test": "npm run citest-jasmine && npm run test-image && npm run test-syntax && npm run test-bundle", | ||
"start-test_dashboard": "node devtools/test_dashboard/server.js", | ||
"start-image_viewer": "node devtools/image_viewer/server.js", | ||
"start": "npm run start-test_dashboard", | ||
"baseline": "./tasks/baseline.sh", | ||
"baseline": "node tasks/baseline.js", | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Who needs |
||
"preversion": "npm-link-check && npm dedupe", | ||
"version": "npm run build && git add -A dist src build", | ||
"postversion": "git push && git push --tags" | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
var constants = require('./util/constants'); | ||
var common = require('./util/common'); | ||
var containerCommands = require('./util/container_commands'); | ||
|
||
var msg = [ | ||
'Generating baseline image(s) using build/plotly.js from', | ||
common.getTimeLastModified(constants.pathToPlotlyBuild), | ||
'\n' | ||
].join(' '); | ||
|
||
var cmd = containerCommands.getRunCmd( | ||
process.env.CIRCLECI, | ||
'node test/image/make_baseline.js ' + process.argv.slice(2).join(' ') | ||
); | ||
|
||
console.log(msg); | ||
common.execCmd(cmd); |
This file was deleted.
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,35 +1,47 @@ | ||
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, | ||
{ clobber: true }, | ||
common.throwOnError | ||
); | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
all these ⏫ are now part of
npm run pretest