From 697e48c7b1455e3e49699881b186e0cbf7ed344d Mon Sep 17 00:00:00 2001 From: Mark David Avery Date: Tue, 11 Dec 2018 13:47:11 -0800 Subject: [PATCH] fix(sass support): latest sass now throws an eerro if semi colons are presnet, removing them from the style manifest. fixes issue #301 --- index.js | 10 +++++++ package.json | 1 + tests/dummy/app/sass/nested/styles.sass | 3 +- yarn.lock | 39 +++++++++++++++++++++++-- 4 files changed, 49 insertions(+), 4 deletions(-) diff --git a/index.js b/index.js index 61cd6fe..d6061d1 100644 --- a/index.js +++ b/index.js @@ -5,6 +5,7 @@ var Merge = require('broccoli-merge-trees'); var ProcessStyles = require('./lib/pod-style.js'); var ExtractNames = require('./lib/pod-names.js'); var StyleManifest = require('broccoli-style-manifest'); +var Replace = require('broccoli-replace'); module.exports = { @@ -165,6 +166,15 @@ module.exports = { annotation: 'StyleManifest (ember-component-css combining all style files that there are extensions for)' }); + // this is due to sass spcifically not allowing for ANY semicolons. + styleManifest = new Replace(styleManifest, { + files: ['**/*.sass'], + patterns: [{ + match: /;/g, + replacement: '', + }], + }); + tree = new Merge([podStyles, styleManifest, tree].filter(Boolean), { annotation: 'Merge (ember-component-css merge namespacedStyles with style manafest)' }); diff --git a/package.json b/package.json index eac3c15..291a5a1 100644 --- a/package.json +++ b/package.json @@ -29,6 +29,7 @@ "broccoli-merge-trees": "^3.0.2", "broccoli-persistent-filter": "^2.1.1", "broccoli-plugin": "^1.3.1", + "broccoli-replace": "^0.12.0", "broccoli-style-manifest": "^1.5.2", "ember-cli-babel": "^7.1.4", "ember-getowner-polyfill": "^2.2.0", diff --git a/tests/dummy/app/sass/nested/styles.sass b/tests/dummy/app/sass/nested/styles.sass index a46923a..b150908 100644 --- a/tests/dummy/app/sass/nested/styles.sass +++ b/tests/dummy/app/sass/nested/styles.sass @@ -1,3 +1,2 @@ & - color: rgb(0, 2, 0); - + color: rgb(0, 2, 0) diff --git a/yarn.lock b/yarn.lock index e9c58c8..8dcfc8b 100644 --- a/yarn.lock +++ b/yarn.lock @@ -741,6 +741,15 @@ aot-test-generators@^0.1.0: dependencies: jsesc "^2.5.0" +applause@1.2.2: + version "1.2.2" + resolved "https://registry.yarnpkg.com/applause/-/applause-1.2.2.tgz#a8468579e81f67397bb5634c29953bedcd0f56c0" + integrity sha1-qEaFeegfZzl7tWNMKZU77c0PVsA= + dependencies: + cson-parser "^1.1.0" + js-yaml "^3.3.0" + lodash "^3.10.0" + aproba@^1.0.3: version "1.2.0" resolved "https://registry.yarnpkg.com/aproba/-/aproba-1.2.0.tgz#6802e6264efd18c790a1b0d517f0f2627bf2c94a" @@ -1980,7 +1989,7 @@ broccoli-node-info@1.1.0, broccoli-node-info@^1.1.0: resolved "https://registry.yarnpkg.com/broccoli-node-info/-/broccoli-node-info-1.1.0.tgz#3aa2e31e07e5bdb516dd25214f7c45ba1c459412" integrity sha1-OqLjHgflvbUW3SUhT3xFuhxFlBI= -broccoli-persistent-filter@^1.1.6, broccoli-persistent-filter@^1.4.3: +broccoli-persistent-filter@^1.1.6, broccoli-persistent-filter@^1.2.0, broccoli-persistent-filter@^1.4.3: version "1.4.6" resolved "https://registry.yarnpkg.com/broccoli-persistent-filter/-/broccoli-persistent-filter-1.4.6.tgz#80762d19000880a77da33c34373299c0f6a3e615" integrity sha512-0RejLwoC95kv4kta8KAa+FmECJCK78Qgm8SRDEK7YyU0N9Cx6KpY3UCDy9WELl3mCXLN8TokNxc7/hp3lL4lfw== @@ -2049,6 +2058,15 @@ broccoli-postcss-single@^2.0.0: object-assign "^4.1.1" postcss "^7.0.0" +broccoli-replace@^0.12.0: + version "0.12.0" + resolved "https://registry.yarnpkg.com/broccoli-replace/-/broccoli-replace-0.12.0.tgz#36460a984c45c61731638c53068b0ab12ea8fdb7" + integrity sha1-NkYKmExFxhcxY4xTBosKsS6o/bc= + dependencies: + applause "1.2.2" + broccoli-persistent-filter "^1.2.0" + minimatch "^3.0.0" + broccoli-sass-source-maps@^4.0.0: version "4.0.0" resolved "https://registry.yarnpkg.com/broccoli-sass-source-maps/-/broccoli-sass-source-maps-4.0.0.tgz#1ee4c10a810b10955b0502e28f85ab672f5961a2" @@ -2539,6 +2557,11 @@ codependency@^0.1.3: dependencies: semver "5.0.1" +coffee-script@^1.10.0: + version "1.12.7" + resolved "https://registry.yarnpkg.com/coffee-script/-/coffee-script-1.12.7.tgz#c05dae0cb79591d05b3070a8433a98c9a89ccc53" + integrity sha512-fLeEhqwymYat/MpTPUjSKHVYYl0ec2mOyALEMLmzr5i1isuG+6jfI2j2d5oBO3VIzgUXgBVIcOT9uH1TFxBckw== + collection-visit@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/collection-visit/-/collection-visit-1.0.0.tgz#4bc0373c164bc3291b4d368c829cf1a80a59dca0" @@ -2959,6 +2982,13 @@ crypto-random-string@^1.0.0: resolved "https://registry.yarnpkg.com/crypto-random-string/-/crypto-random-string-1.0.0.tgz#a230f64f568310e1498009940790ec99545bca7e" integrity sha1-ojD2T1aDEOFJgAmUB5DsmVRbyn4= +cson-parser@^1.1.0: + version "1.3.5" + resolved "https://registry.yarnpkg.com/cson-parser/-/cson-parser-1.3.5.tgz#7ec675e039145533bf2a6a856073f1599d9c2d24" + integrity sha1-fsZ14DkUVTO/KmqFYHPxWZ2cLSQ= + dependencies: + coffee-script "^1.10.0" + css-parse@1.7.x: version "1.7.0" resolved "https://registry.yarnpkg.com/css-parse/-/css-parse-1.7.0.tgz#321f6cf73782a6ff751111390fc05e2c657d8c9b" @@ -5475,7 +5505,7 @@ js-tokens@^3.0.2: resolved "https://registry.yarnpkg.com/js-tokens/-/js-tokens-3.0.2.tgz#9866df395102130e38f7f996bceb65443209c25b" integrity sha1-mGbfOVECEw449/mWvOtlRDIJwls= -js-yaml@^3.12.0, js-yaml@^3.2.5, js-yaml@^3.2.7: +js-yaml@^3.12.0, js-yaml@^3.2.5, js-yaml@^3.2.7, js-yaml@^3.3.0: version "3.12.0" resolved "https://registry.yarnpkg.com/js-yaml/-/js-yaml-3.12.0.tgz#eaed656ec8344f10f527c6bfa1b6e2244de167d1" integrity sha512-PIt2cnwmPfL4hKNwqeiuz4bKfnzHTBv6HyVgjahA6mPLwPDzjDWrplJBMjHUFxku/N3FlmrbyPclad+I+4mJ3A== @@ -6181,6 +6211,11 @@ lodash.values@~2.3.0: dependencies: lodash.keys "~2.3.0" +lodash@^3.10.0: + version "3.10.1" + resolved "https://registry.yarnpkg.com/lodash/-/lodash-3.10.1.tgz#5bf45e8e49ba4189e17d482789dfd15bd140b7b6" + integrity sha1-W/Rejkm6QYnhfUgnid/RW9FAt7Y= + lodash@^4.17.10, lodash@^4.17.11, lodash@^4.17.4, lodash@^4.17.5, lodash@^4.2.1, lodash@^4.3.0, lodash@^4.6.1: version "4.17.11" resolved "https://registry.yarnpkg.com/lodash/-/lodash-4.17.11.tgz#b39ea6229ef607ecd89e2c8df12536891cac9b8d"