@adamlui/scss-to-css 2.4.3 → 2.4.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE.md +1 -1
- package/README.md +9 -6
- package/dist/cli/lib/color.js +7 -2
- package/dist/cli/lib/jsdelivr.js +2 -2
- package/dist/cli/lib/language.js +4 -11
- package/dist/cli/lib/log.js +19 -16
- package/dist/cli/lib/pkg.js +1 -2
- package/dist/cli/lib/settings.js +32 -27
- package/dist/cli/lib/string.js +11 -0
- package/dist/data/messages.json +1 -0
- package/dist/data/package-data.json +2 -6
- package/docs/README.md +9 -6
- package/docs/SECURITY.md +9 -2
- package/package.json +11 -8
package/LICENSE.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# 🏛️ MIT License
|
|
2
2
|
|
|
3
|
-
**Copyright © 2024 [Adam Lui](https://github.com/adamlui) & contributors
|
|
3
|
+
**Copyright © 2024 [Adam Lui](https://github.com/adamlui) & contributors**
|
|
4
4
|
|
|
5
5
|
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
|
|
6
6
|
|
package/README.md
CHANGED
|
@@ -29,16 +29,16 @@
|
|
|
29
29
|
|
|
30
30
|
### Recursively compile all SCSS files into minified CSS
|
|
31
31
|
|
|
32
|
-
<a href="https://
|
|
32
|
+
<a href="https://npm-compare.com/@adamlui/scss-to-css/#timeRange=ALL">
|
|
33
33
|
<img height=31 src="https://img.shields.io/npm/dm/%40adamlui%2Fscss-to-css?logo=npm&color=af68ff&logoColor=white&labelColor=464646&style=for-the-badge"></a>
|
|
34
|
-
<a href="https://github.com/adamlui/js-utils/releases/tag/scss-to-css-2.4.
|
|
35
|
-
<img height=31 src="https://img.shields.io/badge/Latest_Build-2.4.
|
|
34
|
+
<a href="https://github.com/adamlui/js-utils/releases/tag/scss-to-css-2.4.5">
|
|
35
|
+
<img height=31 src="https://img.shields.io/badge/Latest_Build-2.4.5-44cc11.svg?logo=icinga&logoColor=white&labelColor=464646&style=for-the-badge"></a>
|
|
36
36
|
<a href="#%EF%B8%8F-mit-license">
|
|
37
|
-
<img height=31 src="https://img.shields.io/badge/License-MIT-
|
|
37
|
+
<img height=31 src="https://img.shields.io/badge/License-MIT-f99b27.svg?logo=internetarchive&logoColor=white&labelColor=464646&style=for-the-badge"></a>
|
|
38
38
|
<a href="https://www.npmjs.com/package/@adamlui/scss-to-css?activeTab=code">
|
|
39
39
|
<img height=31 src="https://img.shields.io/npm/unpacked-size/%40adamlui%2Fscss-to-css?style=for-the-badge&logo=ebox&logoColor=white&color=blue&labelColor=464646"></a>
|
|
40
40
|
<a href="https://sonarcloud.io/component_measures?metric=vulnerabilities&selected=adamlui_js-utils%3Ascss-to-css&id=adamlui_js-utils">
|
|
41
|
-
<img height=31 src="https://img.shields.io/badge/dynamic/json?url=https%3A%2F%2Fsonarcloud.io%2Fapi%2Fmeasures%2Fcomponent%3Fcomponent%3Dadamlui_scss-to-css%3Asrc%2Fscss-to-css.js%26metricKeys%3Dvulnerabilities&query=%24.component.measures.0.value&style=for-the-badge&logo=sonar&logoColor=white&labelColor=464646&label=Vulnerabilities&color=
|
|
41
|
+
<img height=31 src="https://img.shields.io/badge/dynamic/json?url=https%3A%2F%2Fsonarcloud.io%2Fapi%2Fmeasures%2Fcomponent%3Fcomponent%3Dadamlui_scss-to-css%3Asrc%2Fscss-to-css.js%26metricKeys%3Dvulnerabilities&query=%24.component.measures.0.value&style=for-the-badge&logo=sonar&logoColor=white&labelColor=464646&label=Vulnerabilities&color=ffef00"></a>
|
|
42
42
|
<a href="https://github.com/toolleeo/cli-apps/#conversion">
|
|
43
43
|
<img height=31 src="https://img.shields.io/badge/Mentioned_in-Awesome-ff69b4?logo=awesomelists&logoColor=white&labelColor=464646&style=for-the-badge"></a>
|
|
44
44
|
|
|
@@ -337,8 +337,11 @@ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLI
|
|
|
337
337
|
|
|
338
338
|
<img height=6px width="100%" src="https://cdn.jsdelivr.net/gh/adamlui/scss-to-css@7e4a141/assets/images/separators/aqua-gradient.png">
|
|
339
339
|
|
|
340
|
-
<picture><source media="(prefers-color-scheme: dark)" srcset="https://cdn.jsdelivr.net/gh/adamlui/
|
|
340
|
+
[<picture><source media="(prefers-color-scheme: dark)" srcset="https://cdn.jsdelivr.net/gh/adamlui/js-utils@21bf981/assets/images/icons/home/white/icon32x27.png"><img height=13 src="https://cdn.jsdelivr.net/gh/adamlui/js-utils@21bf981/assets/images/icons/home/dark-gray/icon32x27.png"></picture>][js-utils]
|
|
341
|
+
[**More JavaScript utilities**][js-utils] /
|
|
341
342
|
<a href="https://github.com/adamlui/scss-to-css/discussions">Discuss</a> /
|
|
342
343
|
<a href="https://github.com/adamlui/scss-to-css/issues">Report bug</a> /
|
|
343
344
|
<a href="mailto:security@tidelift.com">Report vulnerability</a> /
|
|
344
345
|
<a href="#top">Back to top ↑</a>
|
|
346
|
+
|
|
347
|
+
[js-utils]: https://github.com/adamlui/js-utils/#readme
|
package/dist/cli/lib/color.js
CHANGED
|
@@ -2,7 +2,7 @@ const color = module.exports = {
|
|
|
2
2
|
nc: '\x1b[0m',
|
|
3
3
|
hex: {
|
|
4
4
|
br: '#ff0000', by: '#ffff00', bo: '#ffa500', bg: '#00ff00',
|
|
5
|
-
bw: '#ffffff', gry: '#808080', blk: '#000000', tlBG: '#
|
|
5
|
+
bw: '#ffffff', gry: '#808080', blk: '#000000', tlBG: '#00ffff'
|
|
6
6
|
},
|
|
7
7
|
schemes: {
|
|
8
8
|
get default() {
|
|
@@ -28,4 +28,9 @@ const color = module.exports = {
|
|
|
28
28
|
}
|
|
29
29
|
|
|
30
30
|
for (const hexKey of Object.keys(color.hex)) // add color[hexKey] getters that return ANSI
|
|
31
|
-
Object.defineProperty(color, hexKey, {
|
|
31
|
+
Object.defineProperty(color, hexKey, {
|
|
32
|
+
get: () => {
|
|
33
|
+
const ansi = color.hexToANSI(color.hex[hexKey])
|
|
34
|
+
return hexKey.endsWith('BG') ? ansi.replace('[38;', '[48;') : ansi
|
|
35
|
+
}
|
|
36
|
+
})
|
package/dist/cli/lib/jsdelivr.js
CHANGED
|
@@ -3,8 +3,8 @@ module.exports = {
|
|
|
3
3
|
getPkgVerURL(version) {
|
|
4
4
|
version ||= cli.version ||= require('./pkg').getVer('local') || 'none'
|
|
5
5
|
const verTag = !/^\d+\.\d+\.\d+$/.test(version) ? 'latest' : `v${version}`
|
|
6
|
-
return `${cli.urls.jsdelivr
|
|
6
|
+
return `${cli.urls.jsdelivr}@${verTag}`
|
|
7
7
|
},
|
|
8
8
|
|
|
9
|
-
getCommitURL(hash = 'latest') { return `${cli.urls.jsdelivr
|
|
9
|
+
getCommitURL(hash = 'latest') { return `${cli.urls.jsdelivr}@${hash}` }
|
|
10
10
|
}
|
package/dist/cli/lib/language.js
CHANGED
|
@@ -19,7 +19,7 @@ module.exports = {
|
|
|
19
19
|
try { return JSON.parse(fs.readFileSync(localeCache, 'utf8')) } catch (err) {}
|
|
20
20
|
|
|
21
21
|
// Discover pkg _locales
|
|
22
|
-
const localesDir = path.resolve(__dirname, '../../../_locales')
|
|
22
|
+
const localesDir = path.resolve(__dirname, '../../../data/_locales')
|
|
23
23
|
if (!fs.existsSync(localesDir)) return ['en']
|
|
24
24
|
const locales = fs.readdirSync(localesDir, { withFileTypes: true })
|
|
25
25
|
.filter(entry => entry.isDirectory()).map(entry => entry.name)
|
|
@@ -62,18 +62,11 @@ module.exports = {
|
|
|
62
62
|
if (env.msgs && langCode == cli.lang) return env.msgs // don't re-fetch same msgs
|
|
63
63
|
|
|
64
64
|
let msgs = data.flatten( // local ones
|
|
65
|
-
require(`../../${ env.modes.dev ? '../_locales/en' : 'data' }/messages.json`))
|
|
65
|
+
require(`../../${ env.modes.dev ? '../data/_locales/en' : 'data' }/messages.json`))
|
|
66
66
|
|
|
67
67
|
if (!langCode.startsWith('en')) { // fetch non-English msgs from jsDelivr
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
`${cli.urls.jsdelivr.jsutils}@${cli.commitHashes.data}/assets/data/non-latin-locales.json`
|
|
71
|
-
)).json()
|
|
72
|
-
if (nonLatinLocales.includes(langCode.split('-')[0]) && !env.supports.unicode)
|
|
73
|
-
return msgs // en ones
|
|
74
|
-
} catch (err) {
|
|
75
|
-
log.debug(`Failed to fetch non-Latin locales: ${err}`)
|
|
76
|
-
}
|
|
68
|
+
if (require('non-latin-locales').includes(langCode.split('_')[0]) && !env.supports.unicode)
|
|
69
|
+
return msgs // EN ones
|
|
77
70
|
const msgBaseURL = `${require('./jsdelivr').getCommitURL(cli.commitHashes.locales)}/_locales`
|
|
78
71
|
let msgURL = `${msgBaseURL}/${langCode}/messages.json`, msgFetchesTried = 0
|
|
79
72
|
while (msgFetchesTried < 3)
|
package/dist/cli/lib/log.js
CHANGED
|
@@ -38,16 +38,18 @@ module.exports = {
|
|
|
38
38
|
}
|
|
39
39
|
},
|
|
40
40
|
|
|
41
|
-
debug(msg) {
|
|
41
|
+
debug(msg, { type } = {}) {
|
|
42
42
|
if (!env.modes.debug) return
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
this.
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
43
|
+
if (type == 'config') { // append config data
|
|
44
|
+
this.argIdx ??= env.args.findIndex(arg => /^--?(?:V|debug(?:[-_]?mode)?)$/.test(arg))
|
|
45
|
+
if (this.argIdx +1 < env.args.length && !env.args[this.argIdx +1].startsWith('-')) // use --debug [targetKey]
|
|
46
|
+
this.key ??= env.args[this.argIdx +1].replace('-', '_')
|
|
47
|
+
if (this.key)
|
|
48
|
+
this.val = cli.config[this.key] || `cli.config key "${this.key}" ${cli.msgs.warn_notFound.toLowerCase()}`
|
|
49
|
+
else
|
|
50
|
+
this.val = cli.config
|
|
51
|
+
msg += `\n${colors.gry}${JSON.stringify(this.val)}${colors.nc}`
|
|
52
|
+
}
|
|
51
53
|
console.debug(`\n${colors.by}DEBUG:`, msg, colors.nc)
|
|
52
54
|
},
|
|
53
55
|
|
|
@@ -59,18 +61,18 @@ module.exports = {
|
|
|
59
61
|
`${cli.prefix}${cli.msgs.prefix_source}: ${cli.urls.src}`
|
|
60
62
|
],
|
|
61
63
|
usage: [
|
|
62
|
-
`\n${this.colors.bw}o ${cli.msgs.helpSection_usage}:${this.colors.nc}`,
|
|
64
|
+
`\n${this.colors.bw}o ${cli.msgs.helpSection_usage.toLowerCase()}:${this.colors.nc}`,
|
|
63
65
|
` ${this.colors.bw}» ${this.colors.bg}${cli.cmdFormat}${this.colors.nc}`
|
|
64
66
|
],
|
|
65
67
|
pathArgs: [
|
|
66
|
-
`\n${this.colors.bw}o ${cli.msgs.helpSection_pathArgs}:${this.colors.nc}`,
|
|
68
|
+
`\n${this.colors.bw}o ${cli.msgs.helpSection_pathArgs.toLowerCase()}:${this.colors.nc}`,
|
|
67
69
|
` [inputPath] ${cli.msgs.inputPathDesc_main}, ${
|
|
68
70
|
cli.msgs.inputPathDesc_extra}.`,
|
|
69
71
|
` [outputPath] ${cli.msgs.outputPathDesc_main}, ${
|
|
70
72
|
cli.msgs.outputPathDesc_extra}`
|
|
71
73
|
],
|
|
72
74
|
flags: [
|
|
73
|
-
`\n${this.colors.bw}o ${cli.msgs.helpSection_flags}:${this.colors.nc}`,
|
|
75
|
+
`\n${this.colors.bw}o ${cli.msgs.helpSection_flags.toLowerCase()}:${this.colors.nc}`,
|
|
74
76
|
` -n, --dry-run ${cli.msgs.optionDesc_dryRun}.`,
|
|
75
77
|
` -d, --include-dotfolders ${cli.msgs.optionDesc_dotfolders}.`,
|
|
76
78
|
` -S, --no-source-maps ${cli.msgs.optionDesc_noSourceMaps}.`,
|
|
@@ -81,7 +83,7 @@ module.exports = {
|
|
|
81
83
|
` -q, --quiet ${cli.msgs.optionDesc_quiet}.`
|
|
82
84
|
],
|
|
83
85
|
params: [
|
|
84
|
-
`\n${this.colors.bw}o ${cli.msgs.helpSection_params}:${this.colors.nc}`,
|
|
86
|
+
`\n${this.colors.bw}o ${cli.msgs.helpSection_params.toLowerCase()}:${this.colors.nc}`,
|
|
85
87
|
`--ignores="dir/,file1.scss,file2.sass" ${cli.msgs.optionDesc_ignores}.`,
|
|
86
88
|
`--comment="comment" ${cli.msgs.optionDesc_commentMain}. ${
|
|
87
89
|
cli.msgs.optionDesc_commentExtra}.`,
|
|
@@ -89,11 +91,11 @@ module.exports = {
|
|
|
89
91
|
` --config="path/to/file" ${cli.msgs.optionDesc_config}.`
|
|
90
92
|
],
|
|
91
93
|
cmds: [
|
|
92
|
-
`\n${this.colors.bw}o ${cli.msgs.helpSection_cmds}:${this.colors.nc}`,
|
|
94
|
+
`\n${this.colors.bw}o ${cli.msgs.helpSection_cmds.toLowerCase()}:${this.colors.nc}`,
|
|
93
95
|
` -i, --init ${cli.msgs.optionDesc_init}.`,
|
|
94
96
|
` -h, --help ${cli.msgs.optionDesc_help}.`,
|
|
95
97
|
` -v, --version ${cli.msgs.optionDesc_version}.`,
|
|
96
|
-
`
|
|
98
|
+
` --stats ${cli.msgs.optionDesc_stats}.`,
|
|
97
99
|
` -V, --debug ${cli.msgs.optionDesc_debug}.`
|
|
98
100
|
]
|
|
99
101
|
}
|
|
@@ -131,7 +133,8 @@ module.exports = {
|
|
|
131
133
|
console.info(`\n${
|
|
132
134
|
cli.msgs.info_moreHelp}, ${cli.msgs.info_type} ${
|
|
133
135
|
colors.bw}${cli.name.split('/')[1]} --<docs|help>${colors.nc} ${
|
|
134
|
-
cli.msgs.info_or} ${cli.msgs.info_visit}\n${
|
|
136
|
+
cli.msgs.info_or} ${cli.msgs.info_visit}\n${
|
|
137
|
+
colors.by}${cli.urls.docs}${colors.nc}`
|
|
135
138
|
)
|
|
136
139
|
},
|
|
137
140
|
|
package/dist/cli/lib/pkg.js
CHANGED
|
@@ -26,7 +26,6 @@ module.exports = {
|
|
|
26
26
|
.map(({ day: date, downloads }) => ({ date, downloads }))
|
|
27
27
|
|
|
28
28
|
} else if (/^py/i.test(ecosystem)) { // fetch from endpoints.pepyProjects
|
|
29
|
-
let rows = []
|
|
30
29
|
const pepyURL = `${endpoints.pepyProjects}/${pkgName}`
|
|
31
30
|
log.info(`Fetching PyPI/mirror stats for ${pkgName}${
|
|
32
31
|
env.modes.debug ? ` from\n${log.colors.bw}${pepyURL}` : '' }...\n`)
|
|
@@ -40,7 +39,7 @@ module.exports = {
|
|
|
40
39
|
if (data[3]?.project) downloads = data[3].project.downloads
|
|
41
40
|
} catch (err) {}
|
|
42
41
|
}
|
|
43
|
-
rows = Object.entries(downloads)
|
|
42
|
+
const rows = Object.entries(downloads)
|
|
44
43
|
.sort(([a], [b]) => new Date(b) - new Date(a)) // new ⇅ old
|
|
45
44
|
.slice(0, maxDays) // cap rows
|
|
46
45
|
.map(([date, data]) => ({ date, ...data }))
|
package/dist/cli/lib/settings.js
CHANGED
|
@@ -54,16 +54,17 @@ module.exports = {
|
|
|
54
54
|
cli.config[key] ??= ctrl.defaultVal ?? ( ctrl.type == 'param' ? '' : false )
|
|
55
55
|
})
|
|
56
56
|
cli.defaultsSet = true
|
|
57
|
-
log.debug('All cli.config default vals set!')
|
|
57
|
+
log.debug('All cli.config default vals set!', { type: 'config' })
|
|
58
58
|
}
|
|
59
59
|
|
|
60
60
|
if (!cli.configPathTried) { // init config file path
|
|
61
|
-
const
|
|
62
|
-
|
|
63
|
-
if (configArg) {
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
61
|
+
const configIdx = env.args.findIndex(arg => this.controls.config.regex.test(arg)),
|
|
62
|
+
configArg = configIdx !== -1 ? env.args[configIdx] : null
|
|
63
|
+
if (configArg) {
|
|
64
|
+
const inputPath = configArg.includes('=') ? configArg.split('=')[1]?.trim() || ''
|
|
65
|
+
: (configIdx +1 < env.args.length && !env.args[configIdx +1].startsWith('-')) ?
|
|
66
|
+
env.args[configIdx +1]
|
|
67
|
+
: ''
|
|
67
68
|
cli.configPath = path.isAbsolute(inputPath) ? inputPath : path.resolve(process.cwd(), inputPath)
|
|
68
69
|
if (!fs.existsSync(cli.configPath))
|
|
69
70
|
log.configURLandExit(`${cli.msgs.error_configFileNotFound}:`, cli.configPath)
|
|
@@ -85,20 +86,21 @@ module.exports = {
|
|
|
85
86
|
;(arguments.length ? inputCtrlKeys : Object.keys(fileConfig)).forEach(key => {
|
|
86
87
|
if (!(key in fileConfig)) return
|
|
87
88
|
const val = fileConfig[key], ctrl = this.controls[key]
|
|
88
|
-
if (!ctrl) {
|
|
89
|
-
if (
|
|
89
|
+
if (!ctrl) { // allow config-only keys
|
|
90
|
+
if (module.exports.configOnlyKeys?.includes(key)) return cli.config[key] = val
|
|
91
|
+
else if (this.configFileKeyWhitelist && !this.configFileKeyWhitelist.includes(key))
|
|
90
92
|
log.invalidConfigKey(key)
|
|
91
93
|
return
|
|
92
94
|
} else if (key.startsWith('legacy_') && ctrl.replacedBy) {
|
|
93
95
|
if (this.isNegKey(key) != this.isNegKey(ctrl.replacedBy))
|
|
94
|
-
cli.config[ctrl.replacedBy] = !val
|
|
96
|
+
cli.config[ctrl.replacedBy] = !val // assign opposite val to current key
|
|
95
97
|
else // assign direct val to current key
|
|
96
98
|
cli.config[ctrl.replacedBy] = val
|
|
97
99
|
return log.configKeyReplacedBy(key, ctrl.replacedBy, val)
|
|
98
100
|
}
|
|
99
101
|
cli.config[key] = val
|
|
100
102
|
})
|
|
101
|
-
if (!arguments.length) log.debug('Config file loaded!')
|
|
103
|
+
if (!arguments.length) log.debug('Config file loaded!', { type: 'config' })
|
|
102
104
|
} catch (err) {
|
|
103
105
|
log.configURLandExit(`${cli.msgs.error_failedToLoadConfigFile}:`, cli.configPath, `\n${err.message}`) }
|
|
104
106
|
|
|
@@ -106,8 +108,8 @@ module.exports = {
|
|
|
106
108
|
const arg = env.args[i]
|
|
107
109
|
if (/^[^-]|--?(?:config|debug)/.test(arg) && arg != 'init') continue
|
|
108
110
|
const ctrlKey = Object.keys(this.controls).find(key => this.controls[key]?.regex?.test(arg))
|
|
109
|
-
if (!ctrlKey
|
|
110
|
-
if (!inputCtrlKeys.includes(ctrlKey))
|
|
111
|
+
if (!ctrlKey) log.errorAndExit(`[${arg}] ${cli.msgs.error_notRecognized}.`)
|
|
112
|
+
if (!inputCtrlKeys.includes(ctrlKey)) continue // don't process env.args when load() specific keys
|
|
111
113
|
if (ctrlKey.startsWith('legacy_')) { log.argDoesNothing(arg) ; continue }
|
|
112
114
|
const ctrl = this.controls[ctrlKey]
|
|
113
115
|
if (ctrl.mode) // set cli.config.mode to mode name
|
|
@@ -117,42 +119,45 @@ module.exports = {
|
|
|
117
119
|
cli.config[ctrlKey] =
|
|
118
120
|
arg.includes('=') ? arg.split('=')[1]?.trim() || '' // =val
|
|
119
121
|
: (i +1 < env.args.length && !env.args[i +1].startsWith('-')) ? env.args[++i] // dashless val
|
|
120
|
-
:
|
|
122
|
+
: true // val-less --param passed
|
|
121
123
|
else // flag/cmd
|
|
122
124
|
cli.config[ctrlKey] = true
|
|
123
125
|
}
|
|
124
126
|
}
|
|
125
|
-
|
|
126
|
-
if (!arguments.length) log.debug('Args parsed!')
|
|
127
|
+
if (!arguments.length) log.debug('Args parsed!', { type: 'config' })
|
|
127
128
|
|
|
128
129
|
this.parseValidateConfig(inputCtrlKeys)
|
|
129
|
-
if (!arguments.length) log.debug('All cli.config vals parsed/validated!')
|
|
130
|
+
if (!arguments.length) log.debug('All cli.config vals parsed/validated!', { type: 'config' })
|
|
130
131
|
|
|
131
132
|
return inputCtrlKeys.length == 1 ? cli.config[inputCtrlKeys[0]] : cli.config
|
|
132
133
|
},
|
|
133
134
|
|
|
134
135
|
parseValidateConfig(ctrlKeys = Object.keys(this.controls)) {
|
|
135
|
-
const language = require('./language')
|
|
136
136
|
for (const key of [].concat(ctrlKeys)) {
|
|
137
137
|
const ctrl = this.controls[key], configVal = cli.config[key]
|
|
138
138
|
|
|
139
139
|
if (ctrl.parser && !ctrl.parsed) {
|
|
140
140
|
cli.config[key] = ctrl.parser(configVal) ; ctrl.parsed = true }
|
|
141
141
|
|
|
142
|
+
if (ctrl.type == 'param' && ctrl.valRequired != false && configVal === true)
|
|
143
|
+
log.errorAndExit(`[${key}] ${ cli.msgs.error_requiresVal || 'requires a value' }.`)
|
|
144
|
+
|
|
142
145
|
if (ctrl.valType) ({
|
|
143
|
-
positiveInt() {
|
|
144
|
-
const numVal = parseInt(configVal, 10)
|
|
145
|
-
if (isNaN(numVal) || numVal < 1)
|
|
146
|
-
log.errorAndExit(`[${key}] ${cli.msgs.error_nonPositiveNum}: ${configVal}`)
|
|
147
|
-
cli.config[key] = numVal
|
|
148
|
-
},
|
|
149
146
|
filepath() {
|
|
150
|
-
if (configVal && !
|
|
151
|
-
|
|
147
|
+
if (configVal && (!ctrl.allowText || require('./string').looksLikePath(configVal))
|
|
148
|
+
&& !fs.existsSync(configVal)
|
|
149
|
+
) log.errorAndExit(`[${key}] ${
|
|
150
|
+
cli.msgs.error_invalidFilepath || 'must be a valid existing file path. Got' }: ${configVal}`)
|
|
152
151
|
},
|
|
153
152
|
langCode() {
|
|
154
|
-
if (configVal && !language.validateLangCode(configVal))
|
|
153
|
+
if (configVal && !require('./language').validateLangCode(configVal))
|
|
155
154
|
log.errorAndExit(`[${key}] ${cli.msgs.error_invalidLangCode}: ${configVal}`)
|
|
155
|
+
},
|
|
156
|
+
positiveInt() {
|
|
157
|
+
const numVal = parseInt(configVal, 10)
|
|
158
|
+
if (numVal && isNaN(numVal) || numVal < 1)
|
|
159
|
+
log.errorAndExit(`[${key}] ${cli.msgs.error_nonPositiveNum}: ${configVal}`)
|
|
160
|
+
cli.config[key] = numVal
|
|
156
161
|
}
|
|
157
162
|
})[ctrl.valType]()
|
|
158
163
|
}
|
package/dist/cli/lib/string.js
CHANGED
|
@@ -1,3 +1,14 @@
|
|
|
1
|
+
const path = require('path')
|
|
2
|
+
|
|
1
3
|
module.exports = {
|
|
4
|
+
|
|
5
|
+
looksLikePath(str) { return typeof str == 'string' && (path.isAbsolute(str) || /^\.\.?[\\/]/.test(str)) },
|
|
6
|
+
|
|
7
|
+
looksLikeURL(str) {
|
|
8
|
+
if (!str || typeof str != 'string') return false
|
|
9
|
+
try { return /^https?:$/.test(new URL(str).protocol) }
|
|
10
|
+
catch (err) { return false }
|
|
11
|
+
},
|
|
12
|
+
|
|
2
13
|
toTitleCase(str) { return str.toLowerCase().replace(/\b\w/g, char => char.toUpperCase()) }
|
|
3
14
|
}
|
package/dist/data/messages.json
CHANGED
|
@@ -6,6 +6,7 @@
|
|
|
6
6
|
"error_readingLocalPkgVer": { "message": "Error reading local package version" },
|
|
7
7
|
"error_notRecognized": { "message": "not recognized" },
|
|
8
8
|
"error_nonPositiveNum": { "message": "argument can only be > 0" },
|
|
9
|
+
"error_requiresVal": { "message": "requires a value" },
|
|
9
10
|
"error_invalidFilepath": { "message": "must be a valid existing file path. Got" },
|
|
10
11
|
"error_invalidLangCode": { "message": "is an invalid language code" },
|
|
11
12
|
"error_invalidURL": { "message": "Invalid URL" },
|
|
@@ -8,15 +8,11 @@
|
|
|
8
8
|
"config": "https://github.com/adamlui/scss-to-css/blob/main/scss-to-css.config.mjs",
|
|
9
9
|
"docs": "https://github.com/adamlui/scss-to-css/tree/main/docs",
|
|
10
10
|
"github": "https://github.com/adamlui/scss-to-css",
|
|
11
|
-
"jsdelivr":
|
|
12
|
-
"jsutils": "https://cdn.jsdelivr.net/gh/adamlui/js-utils",
|
|
13
|
-
"pkg": "https://cdn.jsdelivr.net/gh/adamlui/scss-to-css"
|
|
14
|
-
},
|
|
11
|
+
"jsdelivr": "https://cdn.jsdelivr.net/gh/adamlui/scss-to-css",
|
|
15
12
|
"npm": "https://www.npmjs.com/package/@adamlui/scss-to-css",
|
|
16
13
|
"src": "https://github.com/adamlui/scss-to-css/tree/main/src"
|
|
17
14
|
},
|
|
18
15
|
"commitHashes": {
|
|
19
|
-
"
|
|
20
|
-
"locales": "fd35208"
|
|
16
|
+
"locales": "00c65f5"
|
|
21
17
|
}
|
|
22
18
|
}
|
package/docs/README.md
CHANGED
|
@@ -29,16 +29,16 @@
|
|
|
29
29
|
|
|
30
30
|
### Recursively compile all SCSS files into minified CSS
|
|
31
31
|
|
|
32
|
-
<a href="https://
|
|
32
|
+
<a href="https://npm-compare.com/@adamlui/scss-to-css/#timeRange=ALL">
|
|
33
33
|
<img height=31 src="https://img.shields.io/npm/dm/%40adamlui%2Fscss-to-css?logo=npm&color=af68ff&logoColor=white&labelColor=464646&style=for-the-badge"></a>
|
|
34
|
-
<a href="https://github.com/adamlui/js-utils/releases/tag/scss-to-css-2.4.
|
|
35
|
-
<img height=31 src="https://img.shields.io/badge/Latest_Build-2.4.
|
|
34
|
+
<a href="https://github.com/adamlui/js-utils/releases/tag/scss-to-css-2.4.5">
|
|
35
|
+
<img height=31 src="https://img.shields.io/badge/Latest_Build-2.4.5-44cc11.svg?logo=icinga&logoColor=white&labelColor=464646&style=for-the-badge"></a>
|
|
36
36
|
<a href="#%EF%B8%8F-mit-license">
|
|
37
|
-
<img height=31 src="https://img.shields.io/badge/License-MIT-
|
|
37
|
+
<img height=31 src="https://img.shields.io/badge/License-MIT-f99b27.svg?logo=internetarchive&logoColor=white&labelColor=464646&style=for-the-badge"></a>
|
|
38
38
|
<a href="https://www.npmjs.com/package/@adamlui/scss-to-css?activeTab=code">
|
|
39
39
|
<img height=31 src="https://img.shields.io/npm/unpacked-size/%40adamlui%2Fscss-to-css?style=for-the-badge&logo=ebox&logoColor=white&color=blue&labelColor=464646"></a>
|
|
40
40
|
<a href="https://sonarcloud.io/component_measures?metric=vulnerabilities&selected=adamlui_js-utils%3Ascss-to-css&id=adamlui_js-utils">
|
|
41
|
-
<img height=31 src="https://img.shields.io/badge/dynamic/json?url=https%3A%2F%2Fsonarcloud.io%2Fapi%2Fmeasures%2Fcomponent%3Fcomponent%3Dadamlui_scss-to-css%3Asrc%2Fscss-to-css.js%26metricKeys%3Dvulnerabilities&query=%24.component.measures.0.value&style=for-the-badge&logo=sonar&logoColor=white&labelColor=464646&label=Vulnerabilities&color=
|
|
41
|
+
<img height=31 src="https://img.shields.io/badge/dynamic/json?url=https%3A%2F%2Fsonarcloud.io%2Fapi%2Fmeasures%2Fcomponent%3Fcomponent%3Dadamlui_scss-to-css%3Asrc%2Fscss-to-css.js%26metricKeys%3Dvulnerabilities&query=%24.component.measures.0.value&style=for-the-badge&logo=sonar&logoColor=white&labelColor=464646&label=Vulnerabilities&color=ffef00"></a>
|
|
42
42
|
<a href="https://github.com/toolleeo/cli-apps/#conversion">
|
|
43
43
|
<img height=31 src="https://img.shields.io/badge/Mentioned_in-Awesome-ff69b4?logo=awesomelists&logoColor=white&labelColor=464646&style=for-the-badge"></a>
|
|
44
44
|
|
|
@@ -337,8 +337,11 @@ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLI
|
|
|
337
337
|
|
|
338
338
|
<img height=6px width="100%" src="https://cdn.jsdelivr.net/gh/adamlui/scss-to-css@7e4a141/assets/images/separators/aqua-gradient.png">
|
|
339
339
|
|
|
340
|
-
<picture><source media="(prefers-color-scheme: dark)" srcset="https://cdn.jsdelivr.net/gh/adamlui/
|
|
340
|
+
[<picture><source media="(prefers-color-scheme: dark)" srcset="https://cdn.jsdelivr.net/gh/adamlui/js-utils@21bf981/assets/images/icons/home/white/icon32x27.png"><img height=13 src="https://cdn.jsdelivr.net/gh/adamlui/js-utils@21bf981/assets/images/icons/home/dark-gray/icon32x27.png"></picture>][js-utils]
|
|
341
|
+
[**More JavaScript utilities**][js-utils] /
|
|
341
342
|
<a href="https://github.com/adamlui/scss-to-css/discussions">Discuss</a> /
|
|
342
343
|
<a href="https://github.com/adamlui/scss-to-css/issues">Report bug</a> /
|
|
343
344
|
<a href="mailto:security@tidelift.com">Report vulnerability</a> /
|
|
344
345
|
<a href="#top">Back to top ↑</a>
|
|
346
|
+
|
|
347
|
+
[js-utils]: https://github.com/adamlui/js-utils/#readme
|
package/docs/SECURITY.md
CHANGED
|
@@ -21,6 +21,13 @@
|
|
|
21
21
|
</h6>
|
|
22
22
|
</div>
|
|
23
23
|
|
|
24
|
-
# 🛡️ Security
|
|
24
|
+
# 🛡️ Security policy
|
|
25
25
|
|
|
26
|
-
If you find a vulnerability, please e-mail <security@
|
|
26
|
+
If you find a vulnerability, please e-mail <security@kudoai.com>.
|
|
27
|
+
|
|
28
|
+
<!-- FOOTER -->
|
|
29
|
+
|
|
30
|
+
<hr>
|
|
31
|
+
|
|
32
|
+
<picture><source media="(prefers-color-scheme: dark)" srcset="https://cdn.jsdelivr.net/gh/adamlui/js-utils@97977cb/assets/images/icons/home/white/icon32x27.png"><img height=13 src="https://cdn.jsdelivr.net/gh/adamlui/js-utils@97977cb/assets/images/icons/home/dark-gray/icon32x27.png"></picture> <a href=https://github.com/adamlui/js-utils/#readme>**js-utils**</a> /
|
|
33
|
+
<a href="mailto:security@kudoai.com">Report vulnerability</a>
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@adamlui/scss-to-css",
|
|
3
|
-
"version": "2.4.
|
|
3
|
+
"version": "2.4.5",
|
|
4
4
|
"description": "Recursively compile all SCSS files into minified CSS",
|
|
5
5
|
"author": {
|
|
6
6
|
"name": "Adam Lui",
|
|
@@ -71,19 +71,22 @@
|
|
|
71
71
|
"url": "https://github.com/adamlui/scss-to-css/issues"
|
|
72
72
|
},
|
|
73
73
|
"dependencies": {
|
|
74
|
-
"console-table-printer": "^2.
|
|
74
|
+
"console-table-printer": "^2.16.1",
|
|
75
75
|
"is-unicode-supported": "^2.1.0",
|
|
76
76
|
"node-clipboardy": "^1.0.3",
|
|
77
|
-
"
|
|
77
|
+
"non-latin-locales": "^1.0.1",
|
|
78
|
+
"sass": "^1.101.0"
|
|
78
79
|
},
|
|
79
80
|
"devDependencies": {
|
|
80
|
-
"@eslint/
|
|
81
|
-
"@eslint/
|
|
81
|
+
"@eslint/js": "^10.0.1",
|
|
82
|
+
"@eslint/json": "^2.0.1",
|
|
83
|
+
"@eslint/markdown": "^8.0.3",
|
|
82
84
|
"@stylistic/eslint-plugin": "^5.10.0",
|
|
83
85
|
"copyfiles": "^2.4.1",
|
|
84
|
-
"eslint": "^
|
|
85
|
-
"eslint-plugin-import": "^
|
|
86
|
-
"eslint-plugin-regexp": "^3.1.
|
|
86
|
+
"eslint": "^10.3.0",
|
|
87
|
+
"eslint-plugin-import-x": "^4.17.1",
|
|
88
|
+
"eslint-plugin-regexp": "^3.1.1",
|
|
89
|
+
"globals": "^17.7.0",
|
|
87
90
|
"husky": "^9.1.7"
|
|
88
91
|
}
|
|
89
92
|
}
|