mirror of
https://github.com/tenrok/bootstrap.git
synced 2026-06-17 19:21:23 +03:00
tweaking
This commit is contained in:
+1
-1
@@ -35,7 +35,7 @@
|
|||||||
"css-prefix-main": "postcss --config build/postcss.config.js --replace \"dist/css/*.css\" \"!dist/css/*.rtl*.css\" \"!dist/css/*.min.css\"",
|
"css-prefix-main": "postcss --config build/postcss.config.js --replace \"dist/css/*.css\" \"!dist/css/*.rtl*.css\" \"!dist/css/*.min.css\"",
|
||||||
"css-prefix-examples": "postcss --config build/postcss.config.js --replace \"site/content/**/*.css\"",
|
"css-prefix-examples": "postcss --config build/postcss.config.js --replace \"site/content/**/*.css\"",
|
||||||
"css-prefix-examples-rtl": "cross-env-shell NODE_ENV=RTL postcss --config build/postcss.config.js --dir \"site/content/docs/$npm_package_config_version_short/examples/\" --ext \".rtl.css\" --base \"site/content/docs/$npm_package_config_version_short/examples/\" \"site/content/docs/$npm_package_config_version_short/examples/{blog,carousel,dashboard,cheatsheet}/*.css\" \"!site/content/docs/$npm_package_config_version_short/examples/{blog,carousel,dashboard,cheatsheet}/*.rtl.css\"",
|
"css-prefix-examples-rtl": "cross-env-shell NODE_ENV=RTL postcss --config build/postcss.config.js --dir \"site/content/docs/$npm_package_config_version_short/examples/\" --ext \".rtl.css\" --base \"site/content/docs/$npm_package_config_version_short/examples/\" \"site/content/docs/$npm_package_config_version_short/examples/{blog,carousel,dashboard,cheatsheet}/*.css\" \"!site/content/docs/$npm_package_config_version_short/examples/{blog,carousel,dashboard,cheatsheet}/*.rtl.css\"",
|
||||||
"css-test": "node test-scss/index.js -v -r",
|
"css-test": "node test-scss/index.js -v",
|
||||||
"js": "npm-run-all js-compile js-minify",
|
"js": "npm-run-all js-compile js-minify",
|
||||||
"js-compile": "npm-run-all --aggregate-output --parallel js-compile-*",
|
"js-compile": "npm-run-all --aggregate-output --parallel js-compile-*",
|
||||||
"js-compile-standalone": "rollup --environment BUNDLE:false --config build/rollup.config.js --sourcemap",
|
"js-compile-standalone": "rollup --environment BUNDLE:false --config build/rollup.config.js --sourcemap",
|
||||||
|
|||||||
+34
-14
@@ -1,19 +1,36 @@
|
|||||||
|
#!/usr/bin/env node
|
||||||
/* eslint-env node */
|
/* eslint-env node */
|
||||||
|
|
||||||
|
/*!
|
||||||
|
* Script to run custom unit scss tests.
|
||||||
|
*
|
||||||
|
* At the time this script was created, dart-sass js api didn't support 'quiet' option,
|
||||||
|
* and on every failing assertion, the script was breaking
|
||||||
|
*
|
||||||
|
* In addition, the usage of karma/jasmine runner was not possible,
|
||||||
|
* as it needed much configuration
|
||||||
|
* and at least in windows 10, was having conflict with the fsevents module
|
||||||
|
*
|
||||||
|
* Two available options when we ar using this script
|
||||||
|
* * -v => makes output verbose.
|
||||||
|
* In opposite case it just informs when it is done, and only if the execution has assertion errors
|
||||||
|
*/
|
||||||
|
|
||||||
'use strict'
|
'use strict'
|
||||||
|
|
||||||
const path = require('path')
|
let exitStatus = 0
|
||||||
|
const errors = []
|
||||||
|
const process = require('node:process')
|
||||||
|
const BE_VERBOSE = process.argv.includes('-v')
|
||||||
|
|
||||||
|
const fs = require('fs')
|
||||||
const helpers = require('./helpers')
|
const helpers = require('./helpers')
|
||||||
const sassTrue = require('sass-true')
|
const sassTrue = require('sass-true')
|
||||||
const fs = require('fs')
|
|
||||||
const { exec } = require('child_process')
|
const { exec } = require('child_process')
|
||||||
const process = require('node:process')
|
|
||||||
let exitStatus = 0
|
const rootDir = 'test-scss'
|
||||||
const BE_VERBOSE = process.argv.includes('-v')
|
const outputFile = rootDir + '/index.css'
|
||||||
const DELETE_OUTPUT_FILE = process.argv.includes('-r')
|
const sassScript = `sass --style expanded --quiet --no-source-map --no-error-css ${rootDir}/index.spec.scss:${outputFile}`
|
||||||
const errors = []
|
|
||||||
const sassScript = 'sass --style expanded --quiet --no-source-map --no-error-css test-scss/index.spec.scss:test-scss/index.css'
|
|
||||||
const sassFile = path.join(__dirname, 'index.css')
|
|
||||||
|
|
||||||
const describeModule = function (module) {
|
const describeModule = function (module) {
|
||||||
helpers.printModule(module.module)
|
helpers.printModule(module.module)
|
||||||
@@ -39,13 +56,17 @@ const describeModule = function (module) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
helpers.print('Start scss tests... \n', 0, helpers.colors.Green, true)
|
||||||
|
// eslint-disable-next-line no-unused-vars
|
||||||
exec(sassScript, (error, stdout, stderr) => {
|
exec(sassScript, (error, stdout, stderr) => {
|
||||||
|
|
||||||
if (error) {
|
if (error) {
|
||||||
helpers.print(`error: ${error.message}`)
|
helpers.print(`error: ${error.message}`)
|
||||||
process.exit(1)
|
process.exit(1)
|
||||||
}
|
}
|
||||||
|
|
||||||
const modules = sassTrue.parse(fs.readFileSync(sassFile).toString())
|
const cssFile = fs.readFileSync(outputFile).toString()
|
||||||
|
const modules = sassTrue.parse(cssFile)
|
||||||
|
|
||||||
for (const module of modules) {
|
for (const module of modules) {
|
||||||
describeModule(module)
|
describeModule(module)
|
||||||
@@ -59,9 +80,8 @@ exec(sassScript, (error, stdout, stderr) => {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (DELETE_OUTPUT_FILE) {
|
fs.unlinkSync(outputFile)
|
||||||
fs.unlinkSync(sassFile)
|
helpers.print('End scss tests', 0, helpers.colors.Green, true)
|
||||||
}
|
|
||||||
|
|
||||||
process.exit(exitStatus)
|
process.exit(exitStatus)
|
||||||
})
|
})
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user