Socket
Socket
Sign inDemoInstall

broccoli-css-lang-optimizer

Package Overview
Dependencies
51
Maintainers
1
Versions
9
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

Comparing version 1.0.0 to 1.1.0

test/fixtures/rtlLangs/input/styles/foo.css

2

build/lint.js
/* Copyright 2016 LinkedIn Corp. Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
 You may obtain a copy of
* the License at http://www.apache.org/licenses/LICENSE-2.0
*
*
* Unless required by applicable law or agreed to in writing, software distributed under

@@ -6,0 +6,0 @@ * the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND,

/* Copyright 2016 LinkedIn Corp. Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
 You may obtain a copy of
* the License at http://www.apache.org/licenses/LICENSE-2.0
*
*
* Unless required by applicable law or agreed to in writing, software distributed under

@@ -6,0 +6,0 @@ * the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND,

/* Copyright 2016 LinkedIn Corp. Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
 You may obtain a copy of
* the License at http://www.apache.org/licenses/LICENSE-2.0
*
*
* Unless required by applicable law or agreed to in writing, software distributed under

@@ -15,2 +15,3 @@ * the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND,

var langOptimizer = require("postcss-lang-optimizer");
var rtlcss = require("rtlcss");

@@ -32,3 +33,2 @@ function LangOptimizer(inputNode, options) {

};
PostCSSFilter.call(this, inputNode, postCSSOptions);

@@ -65,3 +65,10 @@ }

}
addOutputFile(langCSS, langFilename);
if (options.rtlLangs && options.rtlLangs.indexOf(lang) >= 0) {
rtlcss(options.rtlOptions).process(langCSS).then(function(result) {
addOutputFile(result.css, langFilename);
});
} else {
addOutputFile(langCSS, langFilename);
}
});

@@ -68,0 +75,0 @@ };

{
"name": "broccoli-css-lang-optimizer",
"description": "Extract Lang-specific CSS rulesets to lang-specific files.",
"version": "1.0.0",
"version": "1.1.0",
"author": "Chris Eppstein <chris@eppsteins.net>",

@@ -22,3 +22,4 @@ "main": "lib/langOptimizer.js",

"broccoli-postcss-sourcemaps": "^2.2.0-sourcemaps.0",
"postcss-lang-optimizer": "^1.1.0"
"postcss-lang-optimizer": "^1.1.0",
"rtlcss": "^1.7.3"
},

@@ -25,0 +26,0 @@ "devDependencies": {

@@ -42,5 +42,10 @@ # broccoli-css-lang-optimizer

// This property can also be set to a function that returns an array of langs.
langs: ["en", "de", "zh"]
langs: ["en", "de", "zh"],
// The folowing langs will be RTL processed with rtlcss. Highly
// recommend not setting `includeBaseFile` to `false` when using rtl flipping.
rtlLangs: ["ar", "he"],
// The following options will be passed to the rtlcss plugin:
rtlOptions: { }
}
```
/* Copyright 2016 LinkedIn Corp. Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
 You may obtain a copy of
* the License at http://www.apache.org/licenses/LICENSE-2.0
*
*
* Unless required by applicable law or agreed to in writing, software distributed under

@@ -133,2 +133,16 @@ * the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND,

});
it("flips rtl langs", function (done) {
var optimizer = LangOptimizer(fixtureSourceDir("rtlLangs"), {
rtlLangs: ["ar"]
});
var builder = new broccoli.Builder(optimizer);
build(builder)
.then(function(outputDir) {
diffDirs(outputDir, fixtureOutputDir("rtlLangs"), function() {
done();
});
});
});
});
SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc