New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

kuma-base

Package Overview
Dependencies
Maintainers
2
Versions
89
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

kuma-base - npm Package Compare versions

Comparing version 1.14.0 to 1.15.0

jsvars/alipay.js

65

gulpfile.js

@@ -7,2 +7,4 @@ const gulp = require('gulp');

const assign = require('object-assign');
const Less = require('less');
const rimraf = require('rimraf');

@@ -12,2 +14,3 @@ const LessPluginAutoPrefix = require('less-plugin-autoprefix');

const LessPluginFunctions = require('less-plugin-functions');
const fs = require('fs');
const autoprefixPlugin = new LessPluginAutoPrefix({

@@ -94,3 +97,3 @@ browsers: [

affix: ['', 'hover', 'focus', 'dark-4', 'dark-5', 'dark-5', 'dark-6', 'dark-7',
'alpha-2', 'alpha-3', 'alpha-4', 'alpha-5', 'alpha-6', 'alpha-7', 'alpha-8', 'alpha-9']
'alpha-2', 'alpha-3', 'alpha-4', 'alpha-5', 'alpha-6', 'alpha-7', 'alpha-8', 'alpha-9']
}, {

@@ -176,2 +179,60 @@ prefix: ['normal', 'dark', 'white'],

gulp.task('default', ['server', 'watch', 'dev-less']);
gulp.task('default', ['server', 'watch', 'dev-less']);
const getVariablesFromLess = (files = []) => {
const lessVariables = {};
files.forEach((file) => {
const filePath = `./variables/${file}.less`;
const fileContent = fs.readFileSync(filePath, 'utf8');
const matches = fileContent.match(/@(.+):/g);
matches.forEach((item) => {
lessVariables[item.replace(/[:@]/g, '')] = true;
})
});
return lessVariables;
}
const getThemes = () => {
const files = fs.readdirSync('./theme');
return files.map(file => file.replace('.less', ''));
}
gulp.task('js-vars', function () {
const vars = getVariablesFromLess(['border', 'colors', 'shadow', 'size', 'transition']);
let themeFinished = 0;
const themes = getThemes();
themes.forEach((theme) => {
gulp.src('./templates/extract-vars.less')
.pipe(ejs({
vars: Object.keys(vars),
theme: theme,
}))
.pipe(less(lessDevConfig))
.pipe(rename(`${theme}.css`))
.pipe(gulp.dest('./jsvars'))
.on('end', function () {
themeFinished += 1;
if (themeFinished === themes.length) {
themes.forEach((th) => {
const cssFile = fs.readFileSync(`./jsvars/${th}.css`, 'utf8');
const matches = cssFile.match(/\.(.+) {\n\s+color: (.+)\n}/g);
const varsArr = [];
matches.forEach((match) => {
match.replace(/\.(.+) {\n\s+color: (.+);\n}/, (match, $1, $2) => {
varsArr.push({ key: `@${$1}`, value: $2 })
})
});
gulp.src('./templates/extract-vars.js')
.pipe(ejs({
vars: varsArr
}))
.pipe(rename(`${th}.js`))
.pipe(gulp.dest('./jsvars'))
.on('end', () => {
rimraf(`./jsvars/${th}.css`, () => { });
});
})
}
})
});
});
# history
## 1.15.0
* `CHANGED` support js vars export
## 1.13.0

@@ -4,0 +8,0 @@

8

package.json
{
"name": "kuma-base",
"version": "1.14.0",
"version": "1.15.0",
"description": "base for kuma",

@@ -8,3 +8,3 @@ "main": "index.js",

"start": "gulp makefiles & gulp",
"pub": "gulp makefiles & npm publish"
"pub": "gulp makefiles & gulp js-vars & npm publish"
},

@@ -31,5 +31,7 @@ "repository": {

"less-plugin-inline-urls": "~1.1.0",
"object-assign": "^4.1.1"
"less-vars-to-js": "^1.2.1",
"object-assign": "^4.1.1",
"rimraf": "^2.6.2"
},
"dependencies": {}
}
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