Skip to content

Commit 8d53ada

Browse files
committed
feat: 支持将样式编译成二进制文件
1 parent 7f2ab36 commit 8d53ada

File tree

9 files changed

+1711
-17
lines changed

9 files changed

+1711
-17
lines changed

.vscode/settings.json

Lines changed: 67 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,70 @@
11
{
22
"rust-analyzer.showUnlinkedFileNotification": false,
3-
"editor.tabSize": 2
3+
"editor.tabSize": 2,
4+
"files.associations": {
5+
"string": "cpp",
6+
"istream": "cpp",
7+
"locale": "cpp",
8+
"tuple": "cpp",
9+
"vector": "cpp",
10+
"__bit_reference": "cpp",
11+
"__config": "cpp",
12+
"__hash_table": "cpp",
13+
"__locale": "cpp",
14+
"__node_handle": "cpp",
15+
"__split_buffer": "cpp",
16+
"__threading_support": "cpp",
17+
"__tree": "cpp",
18+
"__verbose_abort": "cpp",
19+
"any": "cpp",
20+
"array": "cpp",
21+
"bitset": "cpp",
22+
"cctype": "cpp",
23+
"charconv": "cpp",
24+
"clocale": "cpp",
25+
"cmath": "cpp",
26+
"complex": "cpp",
27+
"condition_variable": "cpp",
28+
"csignal": "cpp",
29+
"cstdarg": "cpp",
30+
"cstddef": "cpp",
31+
"cstdint": "cpp",
32+
"cstdio": "cpp",
33+
"cstdlib": "cpp",
34+
"cstring": "cpp",
35+
"ctime": "cpp",
36+
"cwchar": "cpp",
37+
"cwctype": "cpp",
38+
"deque": "cpp",
39+
"execution": "cpp",
40+
"forward_list": "cpp",
41+
"fstream": "cpp",
42+
"initializer_list": "cpp",
43+
"iomanip": "cpp",
44+
"ios": "cpp",
45+
"iosfwd": "cpp",
46+
"iostream": "cpp",
47+
"limits": "cpp",
48+
"list": "cpp",
49+
"map": "cpp",
50+
"mutex": "cpp",
51+
"new": "cpp",
52+
"optional": "cpp",
53+
"ostream": "cpp",
54+
"ratio": "cpp",
55+
"regex": "cpp",
56+
"set": "cpp",
57+
"span": "cpp",
58+
"sstream": "cpp",
59+
"stack": "cpp",
60+
"stdexcept": "cpp",
61+
"streambuf": "cpp",
62+
"string_view": "cpp",
63+
"typeinfo": "cpp",
64+
"unordered_map": "cpp",
65+
"unordered_set": "cpp",
66+
"valarray": "cpp",
67+
"variant": "cpp",
68+
"algorithm": "cpp"
69+
}
470
}

Cargo.lock

Lines changed: 44 additions & 11 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@ style = "0.1.0"
2525
pcre2 = "0.2.6"
2626
regex = "1.10.3"
2727
swc_core = { version = "0.90.24", features = ["__common", "ecma_transforms_typescript", "ecma_ast", "ecma_plugin_transform", "ecma_utils", "ecma_parser", "ecma_visit", "ecma_codegen", "__testing_transform"]}
28+
flatbuffers = "24.3.25"
2829

2930
[build-dependencies]
3031
napi-build = "2.0.1"

flatbuffers/stylesheet.fbs

Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
namespace Styles;
2+
3+
table String {
4+
value:string;
5+
}
6+
7+
table Integer {
8+
value:uint32;
9+
}
10+
11+
union Value {
12+
String,
13+
Integer,
14+
Object
15+
}
16+
17+
table KeyValue {
18+
key:string;
19+
value:Value;
20+
}
21+
22+
table Object {
23+
fields:[KeyValue];
24+
}
25+
26+
table DeclarationTuple {
27+
property_id:uint8;
28+
value:Value;
29+
}
30+
31+
table Selector {
32+
string_value:string;
33+
integer_value:uint32;
34+
is_string:bool;
35+
}
36+
37+
table Style {
38+
declarations:[DeclarationTuple];
39+
media:uint32;
40+
selector:[Selector];
41+
}
42+
43+
table StyleSheet {
44+
fonts:[string];
45+
keyframes:[string];
46+
medias:[string];
47+
styles:[Style];
48+
}
49+
50+
root_type StyleSheet;

0 commit comments

Comments
 (0)