@douyinfe/semi-scss-compile 2.61.0-alpha.1 → 2.61.0-beta.0

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.
Files changed (2) hide show
  1. package/README.md +82 -0
  2. package/package.json +2 -2
package/README.md ADDED
@@ -0,0 +1,82 @@
1
+ > A Scss compile tool for Semi Design
2
+
3
+ ## Description
4
+
5
+ There are mainly the following two usage scenarios:
6
+
7
+ - For Sever side consumption in Semi Design System.When publishing the theme, call the script on the Node side to
8
+ compile the custom theme package into a complete semi.css file
9
+ - Before publish `@douyinfe/semi-foundation`,construct a complete semi.css file
10
+
11
+ ## Usage
12
+
13
+ ### Command Line
14
+
15
+ ```shell
16
+ npm i -g @douyinfe/semi-scss-compile
17
+
18
+ semi-build-scss --foundation="path/to/foundation" --theme="path/to/theme" --icon="path/to/'@douyinfe/semi-icons'" --output="path/to/output.css" --min
19
+
20
+ # or for short
21
+
22
+ semi-build-scss -f "path/to/foundation" -t "path/to/theme" -i "path/to/'@douyinfe/semi-icons'" -o "path/to/output.css" -m
23
+
24
+ ```
25
+
26
+ ### JS API
27
+
28
+ ```js
29
+
30
+ const { compile } = require('@douyinfe/semi-scss-compile');
31
+ const path = require('path');
32
+
33
+ function resolve(dir) {
34
+ return path.join(__dirname, '../..', dir);
35
+ }
36
+
37
+ //eg
38
+
39
+ compile({
40
+ foundationPath: resolve('semi-foundation/'),
41
+ themePath: resolve('semi-theme-default/'),
42
+ iconPath: resolve('node_modules/@douyinfe/semi-icons'),
43
+ outputPath: resolve('semi-ui/dist/css/semi.min.css'),
44
+ isMin: true
45
+ });
46
+
47
+ compile({
48
+ foundationPath: resolve('semi-foundation/'),
49
+ themePath: resolve('semi-theme-default/'),
50
+ iconPath: resolve('node_modules/@douyinfe/semi-icons'),
51
+ outputPath: resolve('semi-ui/dist/css/semi.css'),
52
+ isMin: false
53
+ });
54
+ ```
55
+
56
+ ### Advanced API
57
+
58
+ ```js
59
+ const { generateScssMap, writeFile, compilerFromScssMap } = require('@douyinfe/semi-scss-compile');
60
+ const fs = require('fs-extra');
61
+
62
+ const isMin = false;
63
+ const scssMap = generateScssMap("path/to/foundation", "path/to/theme", "path/to/'@douyinfe/semi-icons'");
64
+ const tempDir = writeFile(scssMap);
65
+ const result = compilerFromScssMap(path.join(tempDir, 'index.scss'), isMin);
66
+ fs.outputFileSync(outputPath, result.css);
67
+
68
+ ```
69
+
70
+ ## Maintainers
71
+
72
+ <table>
73
+ <tbody>
74
+ <tr>
75
+ <td align="center"><a href="https://github.com/DouyinFE/semi-design"><img src="https://sf6-cdn-tos.douyinstatic.com/obj/eden-cn/ptlz_zlp/ljhwZthlaukjlkulzlp/SemiLogo.jpg" width="100px;" alt="" style="max-width:100%;"><br><sub><b>Semi Teams</b></sub></a></td>
76
+ </tr>
77
+ </tbody>
78
+ </table>
79
+
80
+ ## License
81
+
82
+ MIT
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@douyinfe/semi-scss-compile",
3
- "version": "2.61.0-alpha.1",
3
+ "version": "2.61.0-beta.0",
4
4
  "description": "compile semi scss to css",
5
5
  "author": "daiqiang@bytedance.com",
6
6
  "license": "MIT",
@@ -33,5 +33,5 @@
33
33
  "rimraf": "^3.0.2",
34
34
  "typescript": "^4.4.4"
35
35
  },
36
- "gitHead": "ba06de12d059c24363f1ef151dbf4076ea3969a5"
36
+ "gitHead": "dc543a10bb997bbff4d0a98268a4a1de6b3f31ca"
37
37
  }