@tailwindcss/oxide 0.0.0-insiders.8fb9ae8f
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/Cargo.toml +18 -0
- package/build.rs +5 -0
- package/package.json +48 -0
- package/src/lib.rs +26 -0
package/Cargo.toml
ADDED
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
[package]
|
|
2
|
+
edition = "2021"
|
|
3
|
+
name = "tailwind-oxide"
|
|
4
|
+
version = "0.0.0"
|
|
5
|
+
|
|
6
|
+
[lib]
|
|
7
|
+
crate-type = ["cdylib"]
|
|
8
|
+
|
|
9
|
+
[dependencies]
|
|
10
|
+
# Default enable napi4 feature, see https://nodejs.org/api/n-api.html#node-api-version-matrix
|
|
11
|
+
napi = { version = "2.10.0", default-features = false, features = ["napi4"] }
|
|
12
|
+
napi-derive = "2.9.1"
|
|
13
|
+
tailwindcss-core = { path = "../core" }
|
|
14
|
+
rayon = "1.5.3"
|
|
15
|
+
|
|
16
|
+
[build-dependencies]
|
|
17
|
+
napi-build = "2.0.1"
|
|
18
|
+
|
package/build.rs
ADDED
package/package.json
ADDED
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@tailwindcss/oxide",
|
|
3
|
+
"version": "0.0.0-insiders.8fb9ae8f",
|
|
4
|
+
"main": "index.js",
|
|
5
|
+
"types": "index.d.ts",
|
|
6
|
+
"napi": {
|
|
7
|
+
"name": "tailwindcss-oxide",
|
|
8
|
+
"triples": {
|
|
9
|
+
"additional": [
|
|
10
|
+
"aarch64-apple-darwin",
|
|
11
|
+
"aarch64-unknown-linux-gnu",
|
|
12
|
+
"aarch64-unknown-linux-musl",
|
|
13
|
+
"aarch64-pc-windows-msvc",
|
|
14
|
+
"armv7-unknown-linux-gnueabihf",
|
|
15
|
+
"x86_64-unknown-linux-musl",
|
|
16
|
+
"x86_64-unknown-freebsd",
|
|
17
|
+
"i686-pc-windows-msvc"
|
|
18
|
+
]
|
|
19
|
+
}
|
|
20
|
+
},
|
|
21
|
+
"license": "MIT",
|
|
22
|
+
"devDependencies": {
|
|
23
|
+
"@napi-rs/cli": "^2.13.0"
|
|
24
|
+
},
|
|
25
|
+
"engines": {
|
|
26
|
+
"node": ">= 10"
|
|
27
|
+
},
|
|
28
|
+
"scripts": {
|
|
29
|
+
"artifacts": "napi artifacts",
|
|
30
|
+
"build": "napi build --platform --release",
|
|
31
|
+
"build:debug": "napi build --platform",
|
|
32
|
+
"prepublishOnly": "napi prepublish -t npm",
|
|
33
|
+
"version": "napi version"
|
|
34
|
+
},
|
|
35
|
+
"optionalDependencies": {
|
|
36
|
+
"@tailwindcss/oxide-win32-x64-msvc": "0.0.0-insiders.8fb9ae8f",
|
|
37
|
+
"@tailwindcss/oxide-darwin-x64": "0.0.0-insiders.8fb9ae8f",
|
|
38
|
+
"@tailwindcss/oxide-linux-x64-gnu": "0.0.0-insiders.8fb9ae8f",
|
|
39
|
+
"@tailwindcss/oxide-darwin-arm64": "0.0.0-insiders.8fb9ae8f",
|
|
40
|
+
"@tailwindcss/oxide-linux-arm64-gnu": "0.0.0-insiders.8fb9ae8f",
|
|
41
|
+
"@tailwindcss/oxide-linux-arm64-musl": "0.0.0-insiders.8fb9ae8f",
|
|
42
|
+
"@tailwindcss/oxide-win32-arm64-msvc": "0.0.0-insiders.8fb9ae8f",
|
|
43
|
+
"@tailwindcss/oxide-linux-arm-gnueabihf": "0.0.0-insiders.8fb9ae8f",
|
|
44
|
+
"@tailwindcss/oxide-linux-x64-musl": "0.0.0-insiders.8fb9ae8f",
|
|
45
|
+
"@tailwindcss/oxide-freebsd-x64": "0.0.0-insiders.8fb9ae8f",
|
|
46
|
+
"@tailwindcss/oxide-win32-ia32-msvc": "0.0.0-insiders.8fb9ae8f"
|
|
47
|
+
}
|
|
48
|
+
}
|
package/src/lib.rs
ADDED
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
use std::path::PathBuf;
|
|
2
|
+
|
|
3
|
+
#[macro_use]
|
|
4
|
+
extern crate napi_derive;
|
|
5
|
+
|
|
6
|
+
#[derive(Debug, Clone)]
|
|
7
|
+
#[napi(object)]
|
|
8
|
+
pub struct ChangedContent {
|
|
9
|
+
pub file: Option<String>,
|
|
10
|
+
pub content: Option<String>,
|
|
11
|
+
pub extension: String,
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
#[napi]
|
|
15
|
+
pub fn parse_candidate_strings_from_files(changed_content: Vec<ChangedContent>) -> Vec<String> {
|
|
16
|
+
tailwindcss_core::parse_candidate_strings_from_files(
|
|
17
|
+
changed_content
|
|
18
|
+
.into_iter()
|
|
19
|
+
.map(|changed_content| tailwindcss_core::ChangedContent {
|
|
20
|
+
file: changed_content.file.map(PathBuf::from),
|
|
21
|
+
content: changed_content.content,
|
|
22
|
+
extension: changed_content.extension,
|
|
23
|
+
})
|
|
24
|
+
.collect(),
|
|
25
|
+
)
|
|
26
|
+
}
|