Skip to content

Commit

Permalink
fix(sass support): latest sass now throws an eerro if semi colons are…
Browse files Browse the repository at this point in the history
… presnet, removing them from the style manifest. fixes issue #301
  • Loading branch information
webark committed Dec 11, 2018
1 parent 302be39 commit 697e48c
Show file tree
Hide file tree
Showing 4 changed files with 49 additions and 4 deletions.
10 changes: 10 additions & 0 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -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 = {

Expand Down Expand Up @@ -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)'
});
Expand Down
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
3 changes: 1 addition & 2 deletions tests/dummy/app/sass/nested/styles.sass
Original file line number Diff line number Diff line change
@@ -1,3 +1,2 @@
&
color: rgb(0, 2, 0);

color: rgb(0, 2, 0)
39 changes: 37 additions & 2 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -741,6 +741,15 @@ aot-test-generators@^0.1.0:
dependencies:
jsesc "^2.5.0"

[email protected]:
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"
Expand Down Expand Up @@ -1980,7 +1989,7 @@ [email protected], 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==
Expand Down Expand Up @@ -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"
Expand Down Expand Up @@ -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"
Expand Down Expand Up @@ -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"

[email protected]:
version "1.7.0"
resolved "https://registry.yarnpkg.com/css-parse/-/css-parse-1.7.0.tgz#321f6cf73782a6ff751111390fc05e2c657d8c9b"
Expand Down Expand Up @@ -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==
Expand Down Expand Up @@ -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"
Expand Down

0 comments on commit 697e48c

Please sign in to comment.