From 0a53e24c86fe0aa37d7b0aa72651ceb6cf3bbebc Mon Sep 17 00:00:00 2001 From: mofogasy Date: Fri, 13 Sep 2019 07:40:32 +0200 Subject: [PATCH] fix: bundle stylesheets with scss-bundle fixes: #179 --- package-lock.json | 269 ++++++++++++++++++++++++++++++++++++++++ package.json | 23 ++-- scss-bundle.config.json | 6 + 3 files changed, 282 insertions(+), 16 deletions(-) create mode 100644 scss-bundle.config.json diff --git a/package-lock.json b/package-lock.json index d3244ff97..ece032379 100644 --- a/package-lock.json +++ b/package-lock.json @@ -749,6 +749,18 @@ "defer-to-connect": "^1.0.1" } }, + "@types/archy": { + "version": "0.0.31", + "resolved": "https://bin.sbb.ch/artifactory/api/npm/npm/@types/archy/-/archy-0.0.31.tgz", + "integrity": "sha1-AWUKRkHn4dEdvWTtpC7smi+CnH8=", + "dev": true + }, + "@types/debug": { + "version": "4.1.5", + "resolved": "https://bin.sbb.ch/artifactory/api/npm/npm/@types/debug/-/debug-4.1.5.tgz", + "integrity": "sha1-sU76iFK3do2JiQZhPCP2iHE+As0=", + "dev": true + }, "@types/estree": { "version": "0.0.39", "resolved": "https://registry.npmjs.org/@types/estree/-/estree-0.0.39.tgz", @@ -761,6 +773,15 @@ "integrity": "sha512-EaObqwIvayI5a8dCzhFrjKzVwKLxjoG9T6Ppd5CEo07LRKfQ8Yokw54r5+Wq7FaBQ+yXRvQAYPrHwya1/UFt9g==", "dev": true }, + "@types/fs-extra": { + "version": "8.0.0", + "resolved": "https://bin.sbb.ch/artifactory/api/npm/npm/@types/fs-extra/-/fs-extra-8.0.0.tgz", + "integrity": "sha1-0+LDE8op+VBZ8ZjdYNH3dGQtSyU=", + "dev": true, + "requires": { + "@types/node": "*" + } + }, "@types/glob": { "version": "7.1.1", "resolved": "https://registry.npmjs.org/@types/glob/-/glob-7.1.1.tgz", @@ -787,6 +808,21 @@ "@types/jasmine": "*" } }, + "@types/lodash": { + "version": "4.14.138", + "resolved": "https://bin.sbb.ch/artifactory/api/npm/npm/@types/lodash/-/lodash-4.14.138.tgz", + "integrity": "sha1-NPUmQNc1gjAwg0TlecFbN42RmJ4=", + "dev": true + }, + "@types/lodash.debounce": { + "version": "4.0.6", + "resolved": "https://bin.sbb.ch/artifactory/api/npm/npm/@types/lodash.debounce/-/lodash.debounce-4.0.6.tgz", + "integrity": "sha1-xaIybNPvxGVmxH5MCqJI3A7lfWA=", + "dev": true, + "requires": { + "@types/lodash": "*" + } + }, "@types/minimatch": { "version": "3.0.3", "resolved": "https://registry.npmjs.org/@types/minimatch/-/minimatch-3.0.3.tgz", @@ -820,6 +856,15 @@ "@types/node": "*" } }, + "@types/sass": { + "version": "1.16.0", + "resolved": "https://bin.sbb.ch/artifactory/api/npm/npm/@types/sass/-/sass-1.16.0.tgz", + "integrity": "sha1-tBrBwX+mj/tX1D4jYEhu9Saz1X0=", + "dev": true, + "requires": { + "@types/node": "*" + } + }, "@types/selenium-webdriver": { "version": "3.0.14", "resolved": "https://registry.npmjs.org/@types/selenium-webdriver/-/selenium-webdriver-3.0.14.tgz", @@ -1238,6 +1283,12 @@ "integrity": "sha512-Y9J6ZjXtoYh8RnXVCMOU/ttDmk1aBjunq9vO0ta5x85WDQiQfUF9sIPBITdbiiIVcBo03Hi3jMxigBtsddlXRw==", "dev": true }, + "archy": { + "version": "1.0.0", + "resolved": "https://bin.sbb.ch/artifactory/api/npm/npm/archy/-/archy-1.0.0.tgz", + "integrity": "sha1-+cjBN1fMHde8N5rHeyxipcKGjEA=", + "dev": true + }, "arg": { "version": "4.1.0", "resolved": "https://registry.npmjs.org/arg/-/arg-4.1.0.tgz", @@ -4971,6 +5022,15 @@ "slash": "^1.0.0" } }, + "globs": { + "version": "0.1.4", + "resolved": "https://bin.sbb.ch/artifactory/api/npm/npm/globs/-/globs-0.1.4.tgz", + "integrity": "sha1-HRNjn2F05K5zp/k22n2aB59lfBw=", + "dev": true, + "requires": { + "glob": "^7.1.1" + } + }, "got": { "version": "9.6.0", "resolved": "https://registry.npmjs.org/got/-/got-9.6.0.tgz", @@ -6648,6 +6708,12 @@ "integrity": "sha512-Jt2MHrCNdtIe1W6co3tF5KXGRkzF+TYffiQstfXa04mrss9IKXzAAXYWak8LbZseAQY03sH2GzMCMU0ZOUc9bg==", "dev": true }, + "loglevel-plugin-prefix": { + "version": "0.8.4", + "resolved": "https://bin.sbb.ch/artifactory/api/npm/npm/loglevel-plugin-prefix/-/loglevel-plugin-prefix-0.8.4.tgz", + "integrity": "sha1-L+DgXxqCAxfZjYwSPmNMG9hP9kQ=", + "dev": true + }, "loose-envify": { "version": "1.4.0", "resolved": "https://registry.npmjs.org/loose-envify/-/loose-envify-1.4.0.tgz", @@ -8312,6 +8378,12 @@ "integrity": "sha1-6SQ0v6XqjBn0HN/UAddBo8gZ2Jc=", "dev": true }, + "pretty-bytes": { + "version": "5.3.0", + "resolved": "https://bin.sbb.ch/artifactory/api/npm/npm/pretty-bytes/-/pretty-bytes-5.3.0.tgz", + "integrity": "sha1-8oSeJ9t5+01s/iR2T8QTTxZZifI=", + "dev": true + }, "process": { "version": "0.11.10", "resolved": "https://registry.npmjs.org/process/-/process-0.11.10.tgz", @@ -9307,6 +9379,203 @@ "ajv-keywords": "^3.1.0" } }, + "scss-bundle": { + "version": "3.0.1", + "resolved": "https://bin.sbb.ch/artifactory/api/npm/npm/scss-bundle/-/scss-bundle-3.0.1.tgz", + "integrity": "sha1-Ccm2shWOCt5O438p9tsihYr/cgI=", + "dev": true, + "requires": { + "@types/archy": "^0.0.31", + "@types/debug": "^4.1.5", + "@types/fs-extra": "^8.0.0", + "@types/glob": "^7.1.1", + "@types/lodash.debounce": "^4.0.6", + "@types/sass": "^1.16.0", + "archy": "^1.0.0", + "chalk": "^2.4.2", + "chokidar": "^3.0.2", + "commander": "^3.0.0", + "fs-extra": "^8.1.0", + "globs": "^0.1.4", + "lodash.debounce": "^4.0.8", + "loglevel": "^1.6.3", + "loglevel-plugin-prefix": "^0.8.4", + "pretty-bytes": "^5.3.0", + "sass": "^1.22.9", + "tslib": "^1.10.0" + }, + "dependencies": { + "anymatch": { + "version": "3.1.0", + "resolved": "https://bin.sbb.ch/artifactory/api/npm/npm/anymatch/-/anymatch-3.1.0.tgz", + "integrity": "sha1-5gk1DlCpMTtHJ4my8U7zWAjuFNY=", + "dev": true, + "requires": { + "normalize-path": "^3.0.0", + "picomatch": "^2.0.4" + } + }, + "binary-extensions": { + "version": "2.0.0", + "resolved": "https://bin.sbb.ch/artifactory/api/npm/npm/binary-extensions/-/binary-extensions-2.0.0.tgz", + "integrity": "sha1-I8DfFPaogHf1+YbA0WfsA8PVU3w=", + "dev": true + }, + "braces": { + "version": "3.0.2", + "resolved": "https://bin.sbb.ch/artifactory/api/npm/npm/braces/-/braces-3.0.2.tgz", + "integrity": "sha1-NFThpGLujVmeI23zNs2epPiv4Qc=", + "dev": true, + "requires": { + "fill-range": "^7.0.1" + } + }, + "chalk": { + "version": "2.4.2", + "resolved": "https://bin.sbb.ch/artifactory/api/npm/npm/chalk/-/chalk-2.4.2.tgz", + "integrity": "sha1-zUJUFnelQzPPVBpJEIwUMrRMlCQ=", + "dev": true, + "requires": { + "ansi-styles": "^3.2.1", + "escape-string-regexp": "^1.0.5", + "supports-color": "^5.3.0" + } + }, + "chokidar": { + "version": "3.0.2", + "resolved": "https://bin.sbb.ch/artifactory/api/npm/npm/chokidar/-/chokidar-3.0.2.tgz", + "integrity": "sha1-DRzW0E6y3wMnRGGIzRNzajNn1oE=", + "dev": true, + "requires": { + "anymatch": "^3.0.1", + "braces": "^3.0.2", + "fsevents": "^2.0.6", + "glob-parent": "^5.0.0", + "is-binary-path": "^2.1.0", + "is-glob": "^4.0.1", + "normalize-path": "^3.0.0", + "readdirp": "^3.1.1" + } + }, + "commander": { + "version": "3.0.1", + "resolved": "https://bin.sbb.ch/artifactory/api/npm/npm/commander/-/commander-3.0.1.tgz", + "integrity": "sha1-RZWuw1MFJeZx+2+F+xc9+P+L9Xo=", + "dev": true + }, + "fill-range": { + "version": "7.0.1", + "resolved": "https://bin.sbb.ch/artifactory/api/npm/npm/fill-range/-/fill-range-7.0.1.tgz", + "integrity": "sha1-GRmmp8df44ssfHflGYU12prN2kA=", + "dev": true, + "requires": { + "to-regex-range": "^5.0.1" + } + }, + "fs-extra": { + "version": "8.1.0", + "resolved": "https://bin.sbb.ch/artifactory/api/npm/npm/fs-extra/-/fs-extra-8.1.0.tgz", + "integrity": "sha1-SdQ8RaiM2Wd2aMt74bRu/bjS4cA=", + "dev": true, + "requires": { + "graceful-fs": "^4.2.0", + "jsonfile": "^4.0.0", + "universalify": "^0.1.0" + } + }, + "fsevents": { + "version": "2.0.7", + "resolved": "https://bin.sbb.ch/artifactory/api/npm/npm/fsevents/-/fsevents-2.0.7.tgz", + "integrity": "sha1-OCybRDxsusTFcYfN2iOqO/HM/Co=", + "dev": true, + "optional": true + }, + "glob-parent": { + "version": "5.0.0", + "resolved": "https://bin.sbb.ch/artifactory/api/npm/npm/glob-parent/-/glob-parent-5.0.0.tgz", + "integrity": "sha1-HcmfDzmwBtPpLCwoQGg4Lwwg6VQ=", + "dev": true, + "requires": { + "is-glob": "^4.0.1" + } + }, + "graceful-fs": { + "version": "4.2.2", + "resolved": "https://bin.sbb.ch/artifactory/api/npm/npm/graceful-fs/-/graceful-fs-4.2.2.tgz", + "integrity": "sha1-bwlSYF0BQMHP2xOO0AV3W5LWewI=", + "dev": true + }, + "is-binary-path": { + "version": "2.1.0", + "resolved": "https://bin.sbb.ch/artifactory/api/npm/npm/is-binary-path/-/is-binary-path-2.1.0.tgz", + "integrity": "sha1-6h9/O4DwZCNug0cPhsCcJU+0Wwk=", + "dev": true, + "requires": { + "binary-extensions": "^2.0.0" + } + }, + "is-glob": { + "version": "4.0.1", + "resolved": "https://bin.sbb.ch/artifactory/api/npm/npm/is-glob/-/is-glob-4.0.1.tgz", + "integrity": "sha1-dWfb6fL14kZ7x3q4PEopSCQHpdw=", + "dev": true, + "requires": { + "is-extglob": "^2.1.1" + } + }, + "is-number": { + "version": "7.0.0", + "resolved": "https://bin.sbb.ch/artifactory/api/npm/npm/is-number/-/is-number-7.0.0.tgz", + "integrity": "sha1-dTU0W4lnNNX4DE0GxQlVUnoU8Ss=", + "dev": true + }, + "loglevel": { + "version": "1.6.4", + "resolved": "https://bin.sbb.ch/artifactory/api/npm/npm/loglevel/-/loglevel-1.6.4.tgz", + "integrity": "sha1-9Aj08Abbg1TQV33PbTNIWzy5DVY=", + "dev": true + }, + "normalize-path": { + "version": "3.0.0", + "resolved": "https://bin.sbb.ch/artifactory/api/npm/npm/normalize-path/-/normalize-path-3.0.0.tgz", + "integrity": "sha1-Dc1p/yOhybEf0JeDFmRKA4ghamU=", + "dev": true + }, + "readdirp": { + "version": "3.1.2", + "resolved": "https://bin.sbb.ch/artifactory/api/npm/npm/readdirp/-/readdirp-3.1.2.tgz", + "integrity": "sha1-+oXS0U1CiZIORnHerZZDGt0u54o=", + "dev": true, + "requires": { + "picomatch": "^2.0.4" + } + }, + "sass": { + "version": "1.22.12", + "resolved": "https://bin.sbb.ch/artifactory/api/npm/npm/sass/-/sass-1.22.12.tgz", + "integrity": "sha1-XL3ThyD/0YV9ppUzH67p9jS8tdc=", + "dev": true, + "requires": { + "chokidar": ">=2.0.0 <4.0.0" + } + }, + "to-regex-range": { + "version": "5.0.1", + "resolved": "https://bin.sbb.ch/artifactory/api/npm/npm/to-regex-range/-/to-regex-range-5.0.1.tgz", + "integrity": "sha1-FkjESq58jZiKMmAY7XL1tN0DkuQ=", + "dev": true, + "requires": { + "is-number": "^7.0.0" + } + }, + "tslib": { + "version": "1.10.0", + "resolved": "https://bin.sbb.ch/artifactory/api/npm/npm/tslib/-/tslib-1.10.0.tgz", + "integrity": "sha1-w8GflZc/sKYpc/sJ2Q2WHuQ+XIo=", + "dev": true + } + } + }, "select-hose": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/select-hose/-/select-hose-2.0.0.tgz", diff --git a/package.json b/package.json index 516c7da99..13d858915 100644 --- a/package.json +++ b/package.json @@ -14,17 +14,17 @@ "scripts": { "build-all": "run-s build app:common:build app:workbench-application-platform:build-now", "lint-all": "run-p -r lint app:common:lint app:workbench:lint app:workbench-application-platform:lint", - "build": "run-s build:*", "build:mouse-dispatcher": "ng build --prod @scion/mouse-dispatcher", "build:dimension": "ng build --prod @scion/dimension", - "build:viewport": "ng build --prod @scion/viewport && cp -r projects/scion/viewport/src/theme/** dist/scion/viewport", - "build:workbench": "ng build --prod @scion/workbench && cp -r projects/scion/workbench/src/theme/** dist/scion/workbench", + "build:viewport": "ng build --prod @scion/viewport", + "postbuild:viewport": "scss-bundle -e projects/scion/viewport/src/theme/_scrollbar.scss -o dist/scion/viewport/scrollbar.scss", + "build:workbench": "ng build --prod @scion/workbench", + "postbuild:workbench": "scss-bundle -e projects/scion/workbench/src/theme/_theming.scss -o dist/scion/workbench/theming.scss", "build:workbench-application-platform.api": "ng build --prod @scion/workbench-application-platform.api", "build:workbench-application-platform": "ng build --prod @scion/workbench-application-platform", "build:workbench-application.core": "ng build --prod @scion/workbench-application.core", "build:workbench-application.angular": "ng build --prod @scion/workbench-application.angular", - "test": "run-s test:*", "test-headless": "cross-env HEADLESS=true run-s test:*", "test:workbench": "ng test @scion/workbench", @@ -33,7 +33,6 @@ "test:workbench-application.angular": "ng test @scion/workbench-application.angular", "test:dimension": "ng test @scion/dimension", "test:viewport": "ng test @scion/viewport", - "lint": "run-p lint:*", "lint:workbench": "ng lint @scion/workbench", "lint:workbench-application-platform.api": "ng lint @scion/workbench-application-platform.api", @@ -43,45 +42,36 @@ "lint:mouse-dispatcher": "ng lint @scion/mouse-dispatcher", "lint:dimension": "ng lint @scion/dimension", "lint:viewport": "ng lint @scion/viewport", - "app:common:build": "ng build --prod app/common", "app:common:lint": "ng lint app/common", - "app:workbench:e2e": "ng e2e e2e/workbench", "app:workbench:e2e-headless": "cross-env HEADLESS=true ng e2e e2e/workbench --prod", "app:workbench:lint": "ng lint app/workbench/workbench-app && ng lint e2e/workbench", "app:workbench:serve": "ng serve app/workbench/workbench-app --aot", - "app:workbench-application-platform:e2e": "run-p -r app:workbench-application-platform:serve app:workbench-application-platform:await-then-protractor", "app:workbench-application-platform:e2e-headless": "cross-env HEADLESS=true run-p -r app:workbench-application-platform:serve app:workbench-application-platform:await-then-protractor", "app:workbench-application-platform:await-then-protractor": "run-s app:workbench-application-platform:await:* app:workbench-application-platform:e2e:run-protractor", "app:workbench-application-platform:build-now": "run-p --aggregate-output app:workbench-application-platform:build-now:*", "app:workbench-application-platform:lint": "run-p app:workbench-application-platform:lint:*", "app:workbench-application-platform:serve": "run-p -r app:workbench-application-platform:serve:*", - "app:workbench-application-platform:lint:specs": "ng lint e2e/workbench-application-platform", "app:workbench-application-platform:e2e:run-protractor": "ng e2e e2e/workbench-application-platform", - "app:workbench-application-platform:build-now:host-app": "ng build --configuration=now app/workbench-application-platform/host-app", "app:workbench-application-platform:lint:host-app": "ng lint app/workbench-application-platform/host-app", "app:workbench-application-platform:serve:host-app": "ng serve app/workbench-application-platform/host-app --aot --port 5000", "app:workbench-application-platform:await:host-app": "wait-on http-get://localhost:5000", - "app:workbench-application-platform:build-now:contact-app": "ng build --configuration=now app/workbench-application-platform/contact-app", "app:workbench-application-platform:lint:contact-app": "ng lint app/workbench-application-platform/contact-app", "app:workbench-application-platform:serve:contact-app": "ng serve app/workbench-application-platform/contact-app --aot --port 5001", "app:workbench-application-platform:await:contact-app": "wait-on http-get://localhost:5001", - "app:workbench-application-platform:build-now:communication-app": "ng build --configuration=now app/workbench-application-platform/communication-app", "app:workbench-application-platform:lint:communication-app": "ng lint app/workbench-application-platform/communication-app", "app:workbench-application-platform:serve:communication-app": "ng serve app/workbench-application-platform/communication-app --aot --port 5002", "app:workbench-application-platform:await:communication-app": "wait-on http-get://localhost:5002", - "app:workbench-application-platform:build-now:dev-tools-app": "ng build --configuration=now app/workbench-application-platform/dev-tools-app", "app:workbench-application-platform:lint:dev-tools-app": "ng lint app/workbench-application-platform/dev-tools-app", "app:workbench-application-platform:serve:dev-tools-app": "ng serve app/workbench-application-platform/dev-tools-app --aot --port 5003", "app:workbench-application-platform:await:dev-tools-app": "wait-on http-get://localhost:5003", - "app:workbench-application-platform:lint:testing-app": "ng lint app/workbench-application-platform/testing-app", "app:workbench-application-platform:serve:testing-app": "ng serve app/workbench-application-platform/testing-app --aot --port 5004", "app:workbench-application-platform:await:testing-app": "wait-on http-get://localhost:5004" @@ -113,6 +103,7 @@ "@types/jasminewd2": "2.0.6", "@types/node": "10.12.18", "codelyzer": "5.1.0", + "cross-env": "5.2.0", "jasmine-core": "3.4.0", "jasmine-spec-reporter": "4.2.1", "karma": "4.1.0", @@ -126,12 +117,12 @@ "protractor": "5.4.2", "puppeteer": "1.13.0", "rxjs-tslint": "0.1.7", + "scss-bundle": "3.0.1", "ts-node": "8.2.0", "tsickle": "0.35.0", "tslint": "5.12.1", "typescript": "3.4.5", - "wait-on": "3.2.0", - "cross-env": "5.2.0" + "wait-on": "3.2.0" }, "repository": { "type": "git", diff --git a/scss-bundle.config.json b/scss-bundle.config.json new file mode 100644 index 000000000..212e9d968 --- /dev/null +++ b/scss-bundle.config.json @@ -0,0 +1,6 @@ +{ + "bundlerOptions": { + "rootDir": ".", + "logLevel": "info" + } +}