@webpixels/css
Advanced tools
Comparing version 2.0.0-beta.14 to 2.0.0-beta.15
29
bin.js
#!/usr/bin/env node | ||
var myArgs = process.argv.slice(2); | ||
var cmd = myArgs[0]; | ||
var arg1 = myArgs[1]; | ||
var arg2 = myArgs[2]; | ||
const args = process.argv.slice(2); | ||
const argv = require('minimist')(args); | ||
if(cmd == '--version'){ | ||
var cmd = args[0]; | ||
var name = args[1]; | ||
var dist = argv.dist; | ||
if(cmd == '--version' || cmd == '--v'){ | ||
console.log('Show current version'); | ||
@@ -18,14 +20,17 @@ } | ||
if(cmd == 'make:theme'){ | ||
if(arg1 == undefined){ | ||
console.log('Please specify a theme name. Ex: npx webpixels make-theme --purple'); | ||
if(name == undefined){ | ||
console.log('Please specify a theme name. Ex: npx webpixels make:theme awesome'); | ||
return; | ||
} | ||
var make = require('./cli/make.js'); | ||
if(arg2 != undefined){ | ||
make.makeTheme(arg1, arg2); | ||
if(dist == undefined){ | ||
console.log('Please specify the location of you Sass files. Ex: scss/'); | ||
return; | ||
} | ||
make.makeTheme(arg1); | ||
var newCmd = require('./cli/make.js'); | ||
newCmd.makeTheme(name, dist); | ||
return; | ||
} |
@@ -0,5 +1,35 @@ | ||
const path = require('path'); | ||
const fs = require('fs-extra'); | ||
const replace = require('replace-in-file'); | ||
module.exports = { | ||
makeTheme(name = '--starter') { | ||
console.log('Creating new theme ' + name); | ||
}, | ||
makeTheme(name = 'starter', dist = 'scss') { | ||
const sourceFolder = 'stubs/theme-starter/'; | ||
const destinationFolder = dist+'/themes/'; | ||
const replaceString = 'THEME_STARTER'; | ||
const themeName = name; | ||
async function copyAndReplace() { | ||
try { | ||
// Copy the 'theme-starter' folder to 'dist' | ||
await fs.copy(sourceFolder+'theme', destinationFolder+themeName); | ||
await fs.copy(sourceFolder+'_theme.scss', destinationFolder+'_'+themeName+'.scss'); | ||
// Perform find and replace | ||
const options = { | ||
files: path.join(destinationFolder, '**', '*.*'), // Match all files | ||
from: new RegExp(replaceString, 'g'), | ||
to: themeName, | ||
}; | ||
const changes = await replace(options); | ||
console.log(`The ${name} theme has been created and stored in ${destinationFolder}`); | ||
} catch (error) { | ||
console.error('Error:', error); | ||
} | ||
} | ||
copyAndReplace(); | ||
} | ||
} |
{ | ||
"name": "@webpixels/css", | ||
"description": "Utility and component-centric design system based on Bootstrap for fast, responsive UI development.", | ||
"version": "2.0.0-beta.14", | ||
"version": "2.0.0-beta.15", | ||
"version_short": "2.0", | ||
@@ -36,3 +36,3 @@ "license": "MIT", | ||
}, | ||
"bin": { | ||
"bin": { | ||
"webpixels": "./bin.js" | ||
@@ -62,3 +62,5 @@ }, | ||
"find-unused-sass-variables": "^4.0.4", | ||
"fs-extra": "^11.1.1", | ||
"install": "^0.13.0", | ||
"minimist": "^1.2.8", | ||
"nodemon": "^2.0.7", | ||
@@ -70,2 +72,3 @@ "npm": "^8.19.2", | ||
"purgecss": "^4.0.3", | ||
"replace-in-file": "^7.0.1", | ||
"sass": "^1.62.1", | ||
@@ -72,0 +75,0 @@ "serve": "^14.0.1", |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Debug access
Supply chain riskUses debug, reflection and dynamic code execution features.
Found 1 instance in 1 package
Filesystem access
Supply chain riskAccesses the file system, and could potentially read sensitive data.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
162
6070974
18
65693
2