@adamlui/scss-to-css 1.10.0 โ 1.10.1
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/README.md +6 -6
- package/dist/cli.min.js +3 -2
- package/docs/README.md +6 -6
- package/package.json +3 -3
package/README.md
CHANGED
|
@@ -29,7 +29,7 @@
|
|
|
29
29
|
|
|
30
30
|
<a href="https://www.npmjs.com/package/@adamlui/scss-to-css"><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>
|
|
31
31
|
<a href="#%EF%B8%8F-mit-license"><img height=31 src="https://img.shields.io/badge/License-MIT-orange.svg?logo=internetarchive&logoColor=white&labelColor=464646&style=for-the-badge"></a>
|
|
32
|
-
<a href="https://github.com/adamlui/js-utils/releases/tag/scss-to-css-1.10.
|
|
32
|
+
<a href="https://github.com/adamlui/js-utils/releases/tag/scss-to-css-1.10.1"><img height=31 src="https://img.shields.io/badge/Latest_Build-1.10.1-44cc11.svg?logo=icinga&logoColor=white&labelColor=464646&style=for-the-badge"></a>
|
|
33
33
|
<a href="https://www.npmjs.com/package/@adamlui/scss-to-css?activeTab=code"><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>
|
|
34
34
|
<a href="https://sonarcloud.io/component_measures?metric=new_vulnerabilities&id=adamlui_scss-to-css:node.js/src/scss-to-css.js"><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%3Anode.js%2Fsrc%2Fscss-to-css.js%26metricKeys%3Dvulnerabilities&query=%24.component.measures.0.value&style=for-the-badge&logo=sonarcloud&logoColor=white&labelColor=464646&label=Vulnerabilities&color=gold"></a>
|
|
35
35
|
<a href="https://github.com/toolleeo/cli-apps#conversion"><img height=31 src="https://img.shields.io/badge/Mentioned_in-Awesome-c4a2bd?logo=awesomelists&logoColor=white&labelColor=464646&style=for-the-badge"></a>
|
|
@@ -74,7 +74,7 @@ Sample output:
|
|
|
74
74
|
|
|
75
75
|
<img src="https://cdn.jsdelivr.net/gh/adamlui/scss-to-css@b74edea/node.js/media/images/screenshots/cli/scss-to-css-docs-cmd-output.png">
|
|
76
76
|
|
|
77
|
-
|
|
77
|
+
**๐ Note:** Source maps are also generated by default unless `-S` or `--no-source-maps` is passed.
|
|
78
78
|
|
|
79
79
|
#
|
|
80
80
|
|
|
@@ -87,7 +87,7 @@ $ scss-to-css [input_path] [output_path]
|
|
|
87
87
|
- `[input_path]`: Path to SCSS file or directory containing SCSS files to be compiled, relative to the current working directory.
|
|
88
88
|
- `[output_path]`: Path to file or directory where CSS + source map files will be stored, relative to original file location (if not provided, `css/` is used).
|
|
89
89
|
|
|
90
|
-
|
|
90
|
+
**๐ Note:** If folders are passed, files will be processed recursively unless `-R` or `--no-recursion` is passed.
|
|
91
91
|
|
|
92
92
|
#
|
|
93
93
|
|
|
@@ -129,7 +129,7 @@ Specify both **input and output** directories (outputs to `output_folder/`):
|
|
|
129
129
|
$ scss-to-css input_folder output_folder
|
|
130
130
|
```
|
|
131
131
|
|
|
132
|
-
|
|
132
|
+
**๐ Note:** Output CSS is minified unless `-M` or `--no-minify` is passed.
|
|
133
133
|
|
|
134
134
|
#
|
|
135
135
|
|
|
@@ -185,7 +185,7 @@ const scssToCSS = require('@adamlui/scss-to-css');
|
|
|
185
185
|
|
|
186
186
|
### `compile(input[, options])`
|
|
187
187
|
|
|
188
|
-
Compiles SCSS based on the string input supplied.
|
|
188
|
+
๐ก Compiles SCSS based on the string input supplied.
|
|
189
189
|
|
|
190
190
|
If **source code** is passed, it is directly compiled, then an object containing `srcPath` + `code` + `srcMap` + `error` is returned:
|
|
191
191
|
|
|
@@ -233,7 +233,7 @@ Name | Type | Desciption
|
|
|
233
233
|
|
|
234
234
|
### `findSCSS(searchDir[, options])`
|
|
235
235
|
|
|
236
|
-
Searches for all SCSS files within the `searchDir` string passed (useful for discovering what files [`compile()`](#compileinput-options) will process) and returns an array containing their filepaths.
|
|
236
|
+
๐ก Searches for all SCSS files within the `searchDir` string passed (useful for discovering what files [`compile()`](#compileinput-options) will process) and returns an array containing their filepaths.
|
|
237
237
|
|
|
238
238
|
Options are boolean, passed as object properties. For example:
|
|
239
239
|
|
package/dist/cli.min.js
CHANGED
|
@@ -12,12 +12,13 @@ Global version: `+k),console.info("Local version: "+e)}else{const[p="",q=""]=pro
|
|
|
12
12
|
${br}Error: First argument can only be an existing file or directory.`+`
|
|
13
13
|
'${e}' does not exist.`+nc),console.info(`
|
|
14
14
|
${bg}Example valid command:
|
|
15
|
-
ยป scss-to-css . output.min.css`+nc),printHelpCmdAndDocURL(),process.exit(1))}const s=e.endsWith(".scss")?[e]:scssToCSS.findSCSS(e,{recursive:!config.noRecursion,verbose:!config.quietMode,ignoreFiles:(config.ignoreFiles?.split(",")??[]).map(e=>e.trim())});if(config.dryRun)0<s.length?(console.info(`
|
|
15
|
+
ยป scss-to-css . output.min.css`+nc),printHelpCmdAndDocURL(),process.exit(1))}const s=e.endsWith(".scss")&&!fs.statSync(e).isDirectory()?[e]:scssToCSS.findSCSS(e,{recursive:!config.noRecursion,verbose:!config.quietMode,ignoreFiles:(config.ignoreFiles?.split(",")??[]).map(e=>e.trim())});if(config.dryRun)0<s.length?(console.info(`
|
|
16
16
|
${by}SCSS files to be compiled:`+nc),s.forEach(e=>console.info(e))):console.info(by+`
|
|
17
17
|
No SCSS files will be compiled.`+nc);else{const y=[],z=s.map(e=>{var s=scssToCSS.compile(e,{verbose:!config.quietMode,minify:!config.noMinify,sourceMaps:!config.noSourceMaps,comment:config.comment?.replace(/\\n/g,"\n")});return s.error&&y.push(e),s}).filter(e=>!e.error);if(0<z?.length){const D=1<z.length?"s":"";printIfNotQuiet(`
|
|
18
18
|
${bg}Compilation complete!`+nc),printIfNotQuiet(bw+z.length+" CSS file"+D+(config.noSourceMaps?"":` + ${z.length} source map`+D)+" generated."+nc)}else printIfNotQuiet(`
|
|
19
19
|
${by}No SCSS files processed.`+nc);0<y.length&&(printIfNotQuiet(`
|
|
20
|
-
`+br+y.length+" file"+(1<y.length?"s":"")+" failed to compile:"+nc),y.forEach(e=>printIfNotQuiet(e))),0==z?.length&&process.exit(0),
|
|
20
|
+
`+br+y.length+" file"+(1<y.length?"s":"")+" failed to compile:"+nc),y.forEach(e=>printIfNotQuiet(e))),0==z?.length&&process.exit(0),1==z?.length?(console.log(`
|
|
21
|
+
`+(bw+z[0].code+nc)),config.copy&&(printIfNotQuiet("\nCopying to clipboard..."),ncp.writeSync(z[0].code))):(printIfNotQuiet(`
|
|
21
22
|
Writing to file${1<z?.length?"s":""}...`),z?.forEach(({code:e,srcMap:s,srcPath:o})=>{var n=path.join(path.dirname(o),/(?:src|s[ac]ss)$/.test(path.dirname(o))?"../"+(q||"css"):q.endsWith(".css")?path.dirname(q):q||"css"),o=(q.endsWith(".css")&&p.endsWith(".scss")?path.basename(q).replace(/(\.min)?\.css$/,""):path.basename(o,".scss"))+".min.css",o=path.join(n,o);fs.existsSync(n)||fs.mkdirSync(n,{recursive:!0}),fs.writeFileSync(o,e,"utf8"),config.noSourceMaps||fs.writeFileSync(o+".map",JSON.stringify(s),"utf8")}))}}function printHelpSections(e=["header","usage","pathArgs","flags","paramOptions","infoCmds"]){var s=`[106m[30m ${pkgName.replace(/^@[^/]+\//,"")} ${nc} `;const o={header:[`
|
|
22
23
|
โ `+s+copyright,s+"Source: "+srcURL],usage:[`
|
|
23
24
|
${bw}o Usage:`+nc,` ${bw}ยป `+(bg+cmdFormat+nc)],pathArgs:[`
|
package/docs/README.md
CHANGED
|
@@ -29,7 +29,7 @@
|
|
|
29
29
|
|
|
30
30
|
<a href="https://www.npmjs.com/package/@adamlui/scss-to-css"><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>
|
|
31
31
|
<a href="#%EF%B8%8F-mit-license"><img height=31 src="https://img.shields.io/badge/License-MIT-orange.svg?logo=internetarchive&logoColor=white&labelColor=464646&style=for-the-badge"></a>
|
|
32
|
-
<a href="https://github.com/adamlui/js-utils/releases/tag/scss-to-css-1.10.
|
|
32
|
+
<a href="https://github.com/adamlui/js-utils/releases/tag/scss-to-css-1.10.1"><img height=31 src="https://img.shields.io/badge/Latest_Build-1.10.1-44cc11.svg?logo=icinga&logoColor=white&labelColor=464646&style=for-the-badge"></a>
|
|
33
33
|
<a href="https://www.npmjs.com/package/@adamlui/scss-to-css?activeTab=code"><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>
|
|
34
34
|
<a href="https://sonarcloud.io/component_measures?metric=new_vulnerabilities&id=adamlui_scss-to-css:node.js/src/scss-to-css.js"><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%3Anode.js%2Fsrc%2Fscss-to-css.js%26metricKeys%3Dvulnerabilities&query=%24.component.measures.0.value&style=for-the-badge&logo=sonarcloud&logoColor=white&labelColor=464646&label=Vulnerabilities&color=gold"></a>
|
|
35
35
|
<a href="https://github.com/toolleeo/cli-apps#conversion"><img height=31 src="https://img.shields.io/badge/Mentioned_in-Awesome-c4a2bd?logo=awesomelists&logoColor=white&labelColor=464646&style=for-the-badge"></a>
|
|
@@ -74,7 +74,7 @@ Sample output:
|
|
|
74
74
|
|
|
75
75
|
<img src="https://cdn.jsdelivr.net/gh/adamlui/scss-to-css@b74edea/node.js/media/images/screenshots/cli/scss-to-css-docs-cmd-output.png">
|
|
76
76
|
|
|
77
|
-
|
|
77
|
+
**๐ Note:** Source maps are also generated by default unless `-S` or `--no-source-maps` is passed.
|
|
78
78
|
|
|
79
79
|
#
|
|
80
80
|
|
|
@@ -87,7 +87,7 @@ $ scss-to-css [input_path] [output_path]
|
|
|
87
87
|
- `[input_path]`: Path to SCSS file or directory containing SCSS files to be compiled, relative to the current working directory.
|
|
88
88
|
- `[output_path]`: Path to file or directory where CSS + source map files will be stored, relative to original file location (if not provided, `css/` is used).
|
|
89
89
|
|
|
90
|
-
|
|
90
|
+
**๐ Note:** If folders are passed, files will be processed recursively unless `-R` or `--no-recursion` is passed.
|
|
91
91
|
|
|
92
92
|
#
|
|
93
93
|
|
|
@@ -129,7 +129,7 @@ Specify both **input and output** directories (outputs to `output_folder/`):
|
|
|
129
129
|
$ scss-to-css input_folder output_folder
|
|
130
130
|
```
|
|
131
131
|
|
|
132
|
-
|
|
132
|
+
**๐ Note:** Output CSS is minified unless `-M` or `--no-minify` is passed.
|
|
133
133
|
|
|
134
134
|
#
|
|
135
135
|
|
|
@@ -185,7 +185,7 @@ const scssToCSS = require('@adamlui/scss-to-css');
|
|
|
185
185
|
|
|
186
186
|
### `compile(input[, options])`
|
|
187
187
|
|
|
188
|
-
Compiles SCSS based on the string input supplied.
|
|
188
|
+
๐ก Compiles SCSS based on the string input supplied.
|
|
189
189
|
|
|
190
190
|
If **source code** is passed, it is directly compiled, then an object containing `srcPath` + `code` + `srcMap` + `error` is returned:
|
|
191
191
|
|
|
@@ -233,7 +233,7 @@ Name | Type | Desciption
|
|
|
233
233
|
|
|
234
234
|
### `findSCSS(searchDir[, options])`
|
|
235
235
|
|
|
236
|
-
Searches for all SCSS files within the `searchDir` string passed (useful for discovering what files [`compile()`](#compileinput-options) will process) and returns an array containing their filepaths.
|
|
236
|
+
๐ก Searches for all SCSS files within the `searchDir` string passed (useful for discovering what files [`compile()`](#compileinput-options) will process) and returns an array containing their filepaths.
|
|
237
237
|
|
|
238
238
|
Options are boolean, passed as object properties. For example:
|
|
239
239
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@adamlui/scss-to-css",
|
|
3
|
-
"version": "1.10.
|
|
3
|
+
"version": "1.10.1",
|
|
4
4
|
"description": "Recursively compile all SCSS files into minified CSS",
|
|
5
5
|
"author": {
|
|
6
6
|
"name": "Adam Lui",
|
|
@@ -55,9 +55,9 @@
|
|
|
55
55
|
},
|
|
56
56
|
"dependencies": {
|
|
57
57
|
"node-clipboardy": "^1.0.3",
|
|
58
|
-
"sass": "^1.77.
|
|
58
|
+
"sass": "^1.77.2"
|
|
59
59
|
},
|
|
60
60
|
"devDependencies": {
|
|
61
|
-
"@adamlui/minify.js": "^1.
|
|
61
|
+
"@adamlui/minify.js": "^1.7.0"
|
|
62
62
|
}
|
|
63
63
|
}
|