Skip to content

Commit

Permalink
fix: handle api-check, ci and prepubilsh tasks from gulp
Browse files Browse the repository at this point in the history
* update npm scripts to reflect new gulp tasks
* update travis.yml
  • Loading branch information
joneff committed Sep 30, 2019
1 parent cc4104f commit 71175b2
Show file tree
Hide file tree
Showing 6 changed files with 43 additions and 11 deletions.
3 changes: 3 additions & 0 deletions .travis.yml
Expand Up @@ -26,6 +26,9 @@ before_install:
before_script:
- lerna bootstrap --concurrency=1

script:
- npm run ci

after_success:
- ./build/publish.sh

Expand Down
6 changes: 4 additions & 2 deletions package.json
Expand Up @@ -24,7 +24,8 @@
"lint": "./build/foreach.sh lint",
"api": "./build/foreach.sh api",
"api-check": "./build/foreach.sh api-check",
"test": "./build/foreach.sh test && npm run karma-single && npm run visual-test",
"ci": "./build/foreach.sh ci:full && npm run karma-single && npm run visual-test",
"ci:theme": "./build/foreach.sh ci",
"visual-test": "./build/visual-test.sh",
"create-screenshots": "./build/create-screenshots.sh",
"karma-watch": "karma start --auto-watch --no-single-run",
Expand All @@ -37,7 +38,8 @@
},
"ghooks": {
"pre-commit": "npm run lint",
"commit-msg": "validate-commit-msg"
"commit-msg": "validate-commit-msg",
"pre-push": "npm run ci:theme"
},
"validate-commit-msg": {
"types": [
Expand Down
7 changes: 4 additions & 3 deletions packages/bootstrap/package.json
Expand Up @@ -27,10 +27,11 @@
"dart:swatches": "gulp dart:swatches",
"lint": "gulp lint",
"api": "gulp api",
"api-check": "npm run api && git diff --exit-code --quiet -- docs/ || (echo -e '\\033[0;31mERROR: API docs are out of date' && exit 1)",
"api-check": "gulp api:check",
"ci": "gulp ci",
"ci:full": "gulp ci",
"embed-assets": "gulp assets",
"test": "npm run lint && npm run build && npm run api-check",
"prepublishOnly": "./build/embed-dependencies 'bootstrap' '@progress/kendo-theme-default' && npm run build && npm run swatches",
"prepublishOnly": "./build/embed-dependencies 'bootstrap' '@progress/kendo-theme-default' && gulp prepublish",
"postpublish": "rm -rf modules && git checkout scss"
},
"peerDependencies": {
Expand Down
7 changes: 4 additions & 3 deletions packages/default/package.json
Expand Up @@ -26,11 +26,12 @@
"dart:swatches": "gulp dart:swatches",
"lint": "gulp lint",
"api": "gulp api",
"api-check": "npm run api && git diff --exit-code --quiet -- docs/ || (echo -e '\\033[0;31mERROR: API docs are out of date' && exit 1)",
"api-check": "gulp api:check",
"ci": "gulp ci",
"ci:full": "gulp ci",
"embed-assets": "gulp assets",
"test": "npm run lint && npm run build && npm run api-check",
"twbs-compat": "gulp sass --file ./build/twbs-compat.scss",
"prepublishOnly": "npm run build && npm run swatches"
"prepublishOnly": "gulp prepublish"
},
"devDependencies": {
"@progress/kendo-theme-tasks": "^0.3.0",
Expand Down
7 changes: 4 additions & 3 deletions packages/material/package.json
Expand Up @@ -28,10 +28,11 @@
"dart:swatches": "gulp dart:swatches",
"lint": "gulp lint",
"api": "gulp api",
"api-check": "npm run api && git diff --exit-code --quiet -- docs/ || (echo -e '\\033[0;31mERROR: API docs are out of date' && exit 1)",
"api-check": "gulp api:check",
"ci": "gulp ci",
"ci:full": "gulp ci",
"embed-assets": "gulp assets",
"test": "npm run lint && npm run build && npm run api-check",
"prepublishOnly": "./build/embed-dependencies '@progress/kendo-theme-default' && npm run build && npm run swatches",
"prepublishOnly": "./build/embed-dependencies '@progress/kendo-theme-default' && gulp prepublish",
"postpublish": "rm -rf modules && git checkout scss"
},
"devDependencies": {
Expand Down
24 changes: 24 additions & 0 deletions packages/theme-tasks/gulpfile.js
Expand Up @@ -2,6 +2,7 @@

const fs = require("fs");
const path = require("path");
const cp = require("child_process");
const glob = require("glob");
const gulp = require("gulp");
const logger = require("gulplog");
Expand Down Expand Up @@ -117,6 +118,7 @@ gulp.task('sass:swatches', function() {
sass.compiler = require("node-sass");
return build(paths.sass.swatches, paths.sass.dist, fullSassOptions);
});
gulp.task('sass:prepublish', gulp.series("sass", "sass:swatches"));
// #endregion


Expand All @@ -137,6 +139,7 @@ gulp.task('dart:swatches', function() {
sass.compiler = require("sass");
return build(paths.sass.swatches, paths.sass.dist, fullSassOptions);
});
gulp.task('dart:prepublish', gulp.series("dart", "dart:swatches"));
// #endregion


Expand Down Expand Up @@ -205,6 +208,27 @@ gulp.task("api", function() {
return gulp.src(paths.sass.src)
.pipe(sassdoc());
});
gulp.task("api:check", function() {
//git diff --exit-code --quiet -- docs/
return gulp.task("api")().promise.then(function() {
let status = cp.spawnSync("git", [ "diff", "--exit-code", "--quiet", "--", "docs/" ]) .status;

if (status !== 0) {
throw new Error("API docs are out of date");
}
});
});
// #endregion


// #region ci
gulp.task("ci", gulp.series("lint", "sass", "dart", "api:check"));
gulp.task("ci:full", gulp.series("lint", "sass", "dart", "api:check"));
// #endregion


// #region prepublish
gulp.task("prepublish", gulp.series("sass:prepublish"));
// #endregion


Expand Down

0 comments on commit 71175b2

Please sign in to comment.