From 26e2fea4dcde970c200eafcdf36533761a20b991 Mon Sep 17 00:00:00 2001 From: Dale Sande Date: Wed, 16 Oct 2019 14:43:06 -0700 Subject: [PATCH] fix: update package scripts --- template/gulpfile.js | 18 ++++++++++++++++++ template/package.temp | 17 ++++++++++++----- 2 files changed, 30 insertions(+), 5 deletions(-) diff --git a/template/gulpfile.js b/template/gulpfile.js index 1fabec85..b89e2d24 100644 --- a/template/gulpfile.js +++ b/template/gulpfile.js @@ -210,6 +210,24 @@ gulp.task('processDev', function() { ); }); +// task for Development Sass processing +gulp.task('reprocessClean', function() { + // set path to where Sass files are located to be processed + return gulp.src('./altImports/**/*.scss') + + // PostCss polyfill pipeline for CSS Custom Properties (CSS variables) + .pipe(postcss([ + + selectorReplace({ + before: [":host", "&(:not(.is-touching))", "&(.focus-visible)"], + after: ["&", "&:not(.is-touching)", "&.focus-visible"], + }) + ])) + + // Output final CSS in destination + .pipe(gulp.dest('./altImports/')); +}); + // Sass watcher gulp.task('sassWatch', function() { gulp.watch( diff --git a/template/package.temp b/template/package.temp index d1098b46..62a465c3 100644 --- a/template/package.temp +++ b/template/package.temp @@ -67,6 +67,7 @@ "jsonlint": "^1.6.3", "lodash": "^4.17.11", "mocha": "^6.1.4", + "npm-run-all": "^4.1.5", "npm-watch": "^0.6.0", "postcss": "^7.0.17", "postcss-custom-properties": "^8.0.10", @@ -86,21 +87,27 @@ "sassRender-w": ".src/**/*.scss" }, "scripts": { - "build": "npm run sassRender | npm run cssLint | npm run jsonLint", + "build": "npm-run-all sassRender cssLint jsonLint", "buildTokens": "node scripts/tokenScript.js", "copyFonts": "copyfiles -f ./node_modules/@alaskaairux/orion-web-core-style-sheets/dist/fonts/*.* ./demo/fonts/", "cssLint": "stylelint './src/*.css'", "dev": "npm-watch buildTokens | npm-watch sassRender-w", - "dist": "npm run distTokens | npm run sassRender | npm run cssLint | npm run jsonLint", + "dist": "npm-run-all distTokens sassRender cssLint jsonLint", "distJS": "copyfiles -u 1 -V './src/**/*.js' ./dist", "distTokens": "node scripts/tokenScriptCustom.js", "jsonLint": "jsonlint -q ./src/shape.json", "sassRender": "sass-render src/*.css src/tokens/*.scss", "sassRender-w": "sass-render -w src/**/*.{scss,css}", - "stylefluxCanonical": "styleflux -o ./src/altImports/canonical/*.css", - "stylefluxVariable": "styleflux -o ./src/altImports/variable/*.css", + "stylefluxCanonical": "styleflux -o ./altImports/canonical/*.css", + "stylefluxVariable": "styleflux -o ./altImports/variable/*.css", "sweep": "rm -rf ./altImports ./temp ./demo/css ./demo/fonts ./dist ./src/tokens | rm ./demo/sass/*token*.scss ./src/*.css ./src/*-css.js", - "test": "npm run cssLint | npm run jsonLint | yamllint .travis.yml" + "test": "npm-run-all cssLint jsonLint yamltest", + "processSrc": "gulp processSrc", + "processImportsCanonical": "gulp processImportsCanonical", + "processImportsVariable": "gulp processImportsVariable", + "reprocessClean": "gulp reprocessClean", + "ciBuild": "npm-run-all buildTokens processSrc processImportsCanonical processImportsVariable stylefluxCanonical stylefluxVariable reprocessClean distTokens sassRender distJS", + "devBuild": "npm-run-all buildTokens processSrc distTokens sassRender distJS" }, "husky": { "hooks": {