Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@lrnwebcomponents/materializecss-styles

Package Overview
Dependencies
Maintainers
4
Versions
111
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@lrnwebcomponents/materializecss-styles - npm Package Compare versions

Comparing version 2.6.7 to 2.6.8

102

gulpfile.js

@@ -17,30 +17,48 @@ const gulp = require("gulp");

replace(
/extends\s+PolymerElement\s+{/g,
/\/\* REQUIRED FOR TOOLING DO NOT TOUCH \*\//g,
(classStatement, character, jsFile) => {
// extract the templateUrl and styleUrl with regex. Would prefer to do
// this by require'ing materializecss-styles.js and asking it directly, but without
// node.js support for ES modules, we're stuck with this.
const oneLineFile = jsFile
.slice(character)
.split("\n")
.join(" ");
const [
,
templateUrl
] = /templateUrl\([^)]*\)\s*{\s*return\s+"([^"]+)"/.exec(oneLineFile);
// pull these off the package wcfactory files area
let html = fs
.readFileSync(path.join("./src", templateUrl))
.readFileSync(path.join("./", packageJson.wcfactory.files.html))
.toString()
.trim();
html = decomment(html);
let props = "{}";
// pull together styles from url
const [
,
styleUrl
] = /styleUrl\([^)]*\)\s*{\s*return\s+"([^"]+)"/.exec(oneLineFile);
const styleFilePath = path.join("./src", styleUrl);
let cssResult = fs.readFileSync(styleFilePath);
let haxString = "";
if (packageJson.wcfactory.useHAX) {
let HAXProps = fs.readFileSync(
path.join("./", packageJson.wcfactory.files.hax)
);
haxString = `
// haxProperty definition
static get haxProperties() {
return ${HAXProps};
}`;
}
let rawprops = "{}";
rawprops = fs.readFileSync(
path.join("./", packageJson.wcfactory.files.properties)
);
let props = `${rawprops}`,
comma = props
.replace(/\/\*[\s\S]*?\*\//g, "")
.replace(/\/\/.*/g, "")
.replace(/[\{\s\n\}]/g, "");
(props = props.replace(/\"type\": \"(\w+)\"/g, '"type": $1')),
(superprops =
comma === "" ? `...super.properties` : `...super.properties,`);
props = props.replace(/\{([\s\n]*)/, `{$1$1${superprops}$1$1`);
let cssResult = "";
if (
packageJson.wcfactory.useSass &&
packageJson.wcfactory.files.scss
) {
const sass = require("node-sass");
cssResult += sass.renderSync({
file: path.join("./", packageJson.wcfactory.files.scss)
}).css;
} else if (packageJson.wcfactory.files.css) {
cssResult += fs.readFileSync(
path.join("./", packageJson.wcfactory.files.css)
);
}

@@ -73,12 +91,13 @@ cssResult = stripCssComments(cssResult).trim();

return `${classStatement}
static get template() {
return `${litResult}
// render function
render() {
return html\`
<style>
${cssResult}
</style>
${styleResult}
${html}\`;
}
${haxString}
// properties available to the custom element for data binding
static get properties() {
static get properties() {
return ${props};

@@ -91,3 +110,10 @@ }`;

});
// run polymer build to generate everything fully
gulp.task("build", () => {
const spawn = require("child_process").spawn;
let child = spawn("polymer", ["build"]);
return child.on("close", function(code) {
console.log("child process exited with code " + code);
});
});
// run polymer analyze to generate documentation

@@ -109,3 +135,3 @@ gulp.task("analyze", () => {

gulp
.src("./" + packageJson.wcfactory.elementName + ".js")
.src("./build/es6/" + packageJson.wcfactory.elementName + ".js")
.pipe(

@@ -117,3 +143,10 @@ rename({

.pipe(gulp.dest("./"));
gulp
.src("./build/es5-amd/" + packageJson.wcfactory.elementName + ".js")
.pipe(
rename({
suffix: ".amd"
})
)
.pipe(gulp.dest("./"));
return gulp

@@ -149,2 +182,5 @@ .src("./" + packageJson.wcfactory.elementName + ".js")

gulp.task("default", gulp.series("merge", "analyze", "compile", "sourcemaps"));
gulp.task(
"default",
gulp.series("merge", "analyze", "build", "compile", "sourcemaps")
);

@@ -9,3 +9,3 @@ {

},
"version": "2.6.7",
"version": "2.6.8",
"description": "Materialize CSS style class names",

@@ -37,4 +37,4 @@ "repository": {

"devDependencies": {
"@lrnwebcomponents/deduping-fix": "^2.4.0",
"@lrnwebcomponents/storybook-utilities": "^2.6.7",
"@lrnwebcomponents/deduping-fix": "^2.6.8",
"@lrnwebcomponents/storybook-utilities": "^2.6.8",
"@polymer/iron-component-page": "github:PolymerElements/iron-component-page",

@@ -54,3 +54,3 @@ "@polymer/iron-demo-helpers": "3.1.0",

},
"gitHead": "ebc614039b22880d72344a5053498821f17a7c6b"
"gitHead": "4b0ed220b7dbf4f4f3e0ef4f32c50c60dd3a8be5"
}
SocketSocket SOC 2 Logo

Product

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

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc