@windpress/oxide-parser 1.0.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.
- package/README.md +157 -0
- package/dist/index.d.mts +72 -0
- package/dist/index.d.mts.map +1 -0
- package/dist/index.mjs +88 -0
- package/dist/index.mjs.map +1 -0
- package/dist/oxide_parser-C3svwMjw.mjs +238 -0
- package/dist/oxide_parser-C3svwMjw.mjs.map +1 -0
- package/dist/oxide_parser.wasm +0 -0
- package/package.json +50 -0
package/README.md
ADDED
|
@@ -0,0 +1,157 @@
|
|
|
1
|
+
# Setup Guide for @windpress/oxide-parser
|
|
2
|
+
|
|
3
|
+
This guide will help you set up the project and configure GitHub Actions with OIDC trusted publishing.
|
|
4
|
+
|
|
5
|
+
## Prerequisites
|
|
6
|
+
|
|
7
|
+
1. **Rust and wasm-pack**
|
|
8
|
+
```bash
|
|
9
|
+
# Install Rust
|
|
10
|
+
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh
|
|
11
|
+
|
|
12
|
+
# Install wasm-pack
|
|
13
|
+
cargo install wasm-pack
|
|
14
|
+
```
|
|
15
|
+
|
|
16
|
+
2. **Node.js 18+**
|
|
17
|
+
- Download from [nodejs.org](https://nodejs.org/)
|
|
18
|
+
|
|
19
|
+
3. **pnpm** (recommended)
|
|
20
|
+
```bash
|
|
21
|
+
npm install -g pnpm
|
|
22
|
+
```
|
|
23
|
+
|
|
24
|
+
## Local Development
|
|
25
|
+
|
|
26
|
+
### 1. Install Dependencies
|
|
27
|
+
|
|
28
|
+
```bash
|
|
29
|
+
pnpm install
|
|
30
|
+
```
|
|
31
|
+
|
|
32
|
+
### 2. Build the Package
|
|
33
|
+
|
|
34
|
+
```bash
|
|
35
|
+
# Build WASM module
|
|
36
|
+
pnpm run build:wasm
|
|
37
|
+
|
|
38
|
+
# Build TypeScript
|
|
39
|
+
pnpm run build:ts
|
|
40
|
+
|
|
41
|
+
# Copy WASM files to dist
|
|
42
|
+
pnpm run copy-wasm
|
|
43
|
+
|
|
44
|
+
# Or build everything at once
|
|
45
|
+
pnpm run build
|
|
46
|
+
```
|
|
47
|
+
|
|
48
|
+
### 3. Run Development Server
|
|
49
|
+
|
|
50
|
+
```bash
|
|
51
|
+
pnpm run dev
|
|
52
|
+
```
|
|
53
|
+
|
|
54
|
+
This will start a Vite development server. Open the URL shown in your terminal to test the parser in the browser.
|
|
55
|
+
|
|
56
|
+
## GitHub Actions Setup with OIDC Trusted Publishing
|
|
57
|
+
|
|
58
|
+
### Step 1: Configure Trusted Publisher on npm
|
|
59
|
+
|
|
60
|
+
1. Go to your package page on [npmjs.com](https://www.npmjs.com)
|
|
61
|
+
2. Navigate to **Settings** → **Trusted Publisher** section
|
|
62
|
+
3. Click **GitHub Actions** button under "Select your publisher"
|
|
63
|
+
4. Fill in the configuration:
|
|
64
|
+
- **Organization or user**: Your GitHub username or organization (e.g., `wind-press`)
|
|
65
|
+
- **Repository**: Your repository name (e.g., `oxide-parser`)
|
|
66
|
+
- **Workflow filename**: `release.yaml`
|
|
67
|
+
- **Environment name**: Leave empty (optional)
|
|
68
|
+
|
|
69
|
+
5. Click **Save**
|
|
70
|
+
|
|
71
|
+

|
|
72
|
+
|
|
73
|
+
### Step 2: Repository Setup
|
|
74
|
+
|
|
75
|
+
The GitHub workflows are already configured in `.github/workflows/`:
|
|
76
|
+
- `ci.yaml` - Runs on every push/PR to main/develop branches
|
|
77
|
+
- `release.yaml` - Publishes to npm when you push a version tag
|
|
78
|
+
|
|
79
|
+
**No secrets needed!** The workflows use OpenID Connect (OIDC) for authentication.
|
|
80
|
+
|
|
81
|
+
### Step 3: Publishing a Release
|
|
82
|
+
|
|
83
|
+
1. Update version in `package.json` and `Cargo.toml`
|
|
84
|
+
2. Commit your changes
|
|
85
|
+
3. Create and push a git tag:
|
|
86
|
+
```bash
|
|
87
|
+
git tag v1.0.0
|
|
88
|
+
git push origin v1.0.0
|
|
89
|
+
```
|
|
90
|
+
|
|
91
|
+
4. GitHub Actions will automatically:
|
|
92
|
+
- Build the WASM module
|
|
93
|
+
- Build the TypeScript code
|
|
94
|
+
- Publish to npm using OIDC (no token needed!)
|
|
95
|
+
- Create a GitHub release with auto-generated notes
|
|
96
|
+
- Generate provenance attestations automatically
|
|
97
|
+
|
|
98
|
+
## Security Best Practices
|
|
99
|
+
|
|
100
|
+
### Restrict Token Access (Recommended)
|
|
101
|
+
|
|
102
|
+
After setting up trusted publishing:
|
|
103
|
+
|
|
104
|
+
1. Go to your package **Settings** → **Publishing access**
|
|
105
|
+
2. Select **"Require two-factor authentication and disallow tokens"**
|
|
106
|
+
3. Click **Update Package Settings**
|
|
107
|
+
|
|
108
|
+
This ensures your package can only be published via:
|
|
109
|
+
- Trusted publishers (GitHub Actions with OIDC)
|
|
110
|
+
- Manual publishes with 2FA
|
|
111
|
+
|
|
112
|
+
### What About Private Dependencies?
|
|
113
|
+
|
|
114
|
+
If your project has private npm dependencies, you can still use a read-only token for `npm ci`:
|
|
115
|
+
|
|
116
|
+
```yaml
|
|
117
|
+
- name: Install dependencies
|
|
118
|
+
run: pnpm install
|
|
119
|
+
env:
|
|
120
|
+
NODE_AUTH_TOKEN: ${{ secrets.NPM_READ_TOKEN }}
|
|
121
|
+
|
|
122
|
+
- name: Publish (uses OIDC, no token needed)
|
|
123
|
+
run: pnpm publish --access public
|
|
124
|
+
```
|
|
125
|
+
|
|
126
|
+
## Troubleshooting
|
|
127
|
+
|
|
128
|
+
### Workflow filename mismatch
|
|
129
|
+
- Ensure the workflow filename on npmjs.com matches exactly: `release.yaml` (not `release.yml`)
|
|
130
|
+
- Filenames are case-sensitive
|
|
131
|
+
|
|
132
|
+
### OIDC authentication fails
|
|
133
|
+
- Verify `id-token: write` permission is set in the workflow
|
|
134
|
+
- Confirm you're using GitHub-hosted runners (not self-hosted)
|
|
135
|
+
- Check that npm CLI version 11.5.1+ is being used
|
|
136
|
+
|
|
137
|
+
### Build fails
|
|
138
|
+
- Ensure Rust and wasm-pack are properly installed in CI
|
|
139
|
+
- Check that all build steps complete successfully before publish
|
|
140
|
+
|
|
141
|
+
## Workflow Features
|
|
142
|
+
|
|
143
|
+
### CI Workflow (`ci.yaml`)
|
|
144
|
+
- Runs on: Push to main/develop, Pull Requests
|
|
145
|
+
- Tests: Node.js 18, 20, 22
|
|
146
|
+
- Checks:
|
|
147
|
+
- WASM build
|
|
148
|
+
- TypeScript build
|
|
149
|
+
- Rust formatting (`cargo fmt`)
|
|
150
|
+
- Rust linting (`cargo clippy`)
|
|
151
|
+
|
|
152
|
+
### Release Workflow (`release.yaml`)
|
|
153
|
+
- Runs on: Version tags (v*)
|
|
154
|
+
- Actions:
|
|
155
|
+
- Builds WASM and TypeScript
|
|
156
|
+
- Publishes to npm with OIDC (automatic provenance)
|
|
157
|
+
- Creates GitHub release
|
package/dist/index.d.mts
ADDED
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
//#region src/index.d.ts
|
|
2
|
+
/**
|
|
3
|
+
* @windpress/oxide-parser
|
|
4
|
+
*
|
|
5
|
+
* Tailwind CSS Oxide parser WASM package for Vite and CDN usage.
|
|
6
|
+
* This package provides a fast, WASM-based parser for extracting
|
|
7
|
+
* Tailwind CSS candidates from your code.
|
|
8
|
+
*/
|
|
9
|
+
/**
|
|
10
|
+
* Initialize the WASM module
|
|
11
|
+
*
|
|
12
|
+
* This function must be called before using any parsing functions.
|
|
13
|
+
* It loads and initializes the WASM module.
|
|
14
|
+
*
|
|
15
|
+
* @param wasmUrl - Optional custom URL to the WASM file
|
|
16
|
+
* @returns Promise that resolves when initialization is complete
|
|
17
|
+
*
|
|
18
|
+
* @example
|
|
19
|
+
* ```typescript
|
|
20
|
+
* import { init, findTailwindCandidates } from '@windpress/oxide-parser';
|
|
21
|
+
*
|
|
22
|
+
* await init();
|
|
23
|
+
* const candidates = findTailwindCandidates('<div class="flex items-center">');
|
|
24
|
+
* ```
|
|
25
|
+
*/
|
|
26
|
+
declare function init(wasmUrl?: string): Promise<void>;
|
|
27
|
+
/**
|
|
28
|
+
* Find Tailwind CSS candidates in the provided input
|
|
29
|
+
*
|
|
30
|
+
* This function accepts either a single string or an array of strings.
|
|
31
|
+
* Always returns unique candidates (duplicates are automatically removed).
|
|
32
|
+
* - When given a string, returns unique candidates from that string
|
|
33
|
+
* - When given an array, returns unique candidates across all inputs
|
|
34
|
+
*
|
|
35
|
+
* @param input - Single string or array of strings to parse
|
|
36
|
+
* @returns Array of unique candidate strings
|
|
37
|
+
*
|
|
38
|
+
* @example Single string input
|
|
39
|
+
* ```typescript
|
|
40
|
+
* const candidates = findTailwindCandidates(`
|
|
41
|
+
* <div class="flex flex items-center p-4 bg-blue-500">
|
|
42
|
+
* <span class="text-white font-bold p-4">Hello</span>
|
|
43
|
+
* </div>
|
|
44
|
+
* `);
|
|
45
|
+
* // Returns: ['flex', 'items-center', 'p-4', 'bg-blue-500', 'text-white', 'font-bold']
|
|
46
|
+
* // Note: duplicates 'flex' and 'p-4' are automatically removed
|
|
47
|
+
* ```
|
|
48
|
+
*
|
|
49
|
+
* @example Array input (batch processing with unique results)
|
|
50
|
+
* ```typescript
|
|
51
|
+
* const results = findTailwindCandidates([
|
|
52
|
+
* '<div class="flex p-4">',
|
|
53
|
+
* '<span class="flex text-white">',
|
|
54
|
+
* '<button class="p-4 bg-blue-500">',
|
|
55
|
+
* ]);
|
|
56
|
+
* // Returns: ['flex', 'p-4', 'text-white', 'bg-blue-500']
|
|
57
|
+
* // Note: duplicates 'flex' and 'p-4' across inputs are automatically removed
|
|
58
|
+
* ```
|
|
59
|
+
*/
|
|
60
|
+
declare function findTailwindCandidates(input: string | string[]): string[];
|
|
61
|
+
/**
|
|
62
|
+
* Check if the WASM module is initialized
|
|
63
|
+
*
|
|
64
|
+
* @returns true if initialized, false otherwise
|
|
65
|
+
*/
|
|
66
|
+
declare function isInitialized(): boolean;
|
|
67
|
+
type TailwindCandidate = string;
|
|
68
|
+
type ParseResult = TailwindCandidate[];
|
|
69
|
+
type BatchParseResult = ParseResult[];
|
|
70
|
+
//#endregion
|
|
71
|
+
export { BatchParseResult, ParseResult, TailwindCandidate, init as default, init, findTailwindCandidates, isInitialized };
|
|
72
|
+
//# sourceMappingURL=index.d.mts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.mts","names":[],"sources":["../src/index.ts"],"sourcesContent":[],"mappings":";;AA6BA;AA2DA;AAeA;AAKA;AACA;AACA;;;;;;;;;;;;;;;;;;iBAjFsB,IAAA,oBAAwB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iBA2D9B,sBAAA;;;;;;iBAeA,aAAA,CAAA;KAKJ,iBAAA;KACA,WAAA,GAAc;KACd,gBAAA,GAAmB"}
|
package/dist/index.mjs
ADDED
|
@@ -0,0 +1,88 @@
|
|
|
1
|
+
//#region src/index.ts
|
|
2
|
+
/**
|
|
3
|
+
* @windpress/oxide-parser
|
|
4
|
+
*
|
|
5
|
+
* Tailwind CSS Oxide parser WASM package for Vite and CDN usage.
|
|
6
|
+
* This package provides a fast, WASM-based parser for extracting
|
|
7
|
+
* Tailwind CSS candidates from your code.
|
|
8
|
+
*/
|
|
9
|
+
let wasmModule = null;
|
|
10
|
+
let wasmInitialized = false;
|
|
11
|
+
/**
|
|
12
|
+
* Initialize the WASM module
|
|
13
|
+
*
|
|
14
|
+
* This function must be called before using any parsing functions.
|
|
15
|
+
* It loads and initializes the WASM module.
|
|
16
|
+
*
|
|
17
|
+
* @param wasmUrl - Optional custom URL to the WASM file
|
|
18
|
+
* @returns Promise that resolves when initialization is complete
|
|
19
|
+
*
|
|
20
|
+
* @example
|
|
21
|
+
* ```typescript
|
|
22
|
+
* import { init, findTailwindCandidates } from '@windpress/oxide-parser';
|
|
23
|
+
*
|
|
24
|
+
* await init();
|
|
25
|
+
* const candidates = findTailwindCandidates('<div class="flex items-center">');
|
|
26
|
+
* ```
|
|
27
|
+
*/
|
|
28
|
+
async function init(wasmUrl) {
|
|
29
|
+
if (wasmInitialized) return;
|
|
30
|
+
try {
|
|
31
|
+
const module = await import("./oxide_parser-C3svwMjw.mjs");
|
|
32
|
+
if (wasmUrl) await module.default(wasmUrl);
|
|
33
|
+
else await module.default();
|
|
34
|
+
wasmModule = module;
|
|
35
|
+
wasmInitialized = true;
|
|
36
|
+
} catch (error) {
|
|
37
|
+
throw new Error(`Failed to initialize WASM module: ${error instanceof Error ? error.message : "Unknown error"}`);
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
/**
|
|
41
|
+
* Find Tailwind CSS candidates in the provided input
|
|
42
|
+
*
|
|
43
|
+
* This function accepts either a single string or an array of strings.
|
|
44
|
+
* Always returns unique candidates (duplicates are automatically removed).
|
|
45
|
+
* - When given a string, returns unique candidates from that string
|
|
46
|
+
* - When given an array, returns unique candidates across all inputs
|
|
47
|
+
*
|
|
48
|
+
* @param input - Single string or array of strings to parse
|
|
49
|
+
* @returns Array of unique candidate strings
|
|
50
|
+
*
|
|
51
|
+
* @example Single string input
|
|
52
|
+
* ```typescript
|
|
53
|
+
* const candidates = findTailwindCandidates(`
|
|
54
|
+
* <div class="flex flex items-center p-4 bg-blue-500">
|
|
55
|
+
* <span class="text-white font-bold p-4">Hello</span>
|
|
56
|
+
* </div>
|
|
57
|
+
* `);
|
|
58
|
+
* // Returns: ['flex', 'items-center', 'p-4', 'bg-blue-500', 'text-white', 'font-bold']
|
|
59
|
+
* // Note: duplicates 'flex' and 'p-4' are automatically removed
|
|
60
|
+
* ```
|
|
61
|
+
*
|
|
62
|
+
* @example Array input (batch processing with unique results)
|
|
63
|
+
* ```typescript
|
|
64
|
+
* const results = findTailwindCandidates([
|
|
65
|
+
* '<div class="flex p-4">',
|
|
66
|
+
* '<span class="flex text-white">',
|
|
67
|
+
* '<button class="p-4 bg-blue-500">',
|
|
68
|
+
* ]);
|
|
69
|
+
* // Returns: ['flex', 'p-4', 'text-white', 'bg-blue-500']
|
|
70
|
+
* // Note: duplicates 'flex' and 'p-4' across inputs are automatically removed
|
|
71
|
+
* ```
|
|
72
|
+
*/
|
|
73
|
+
function findTailwindCandidates(input) {
|
|
74
|
+
if (!wasmInitialized || !wasmModule) throw new Error("WASM module not initialized. Call init() before using findTailwindCandidates()");
|
|
75
|
+
return wasmModule.findTailwindCandidates(input);
|
|
76
|
+
}
|
|
77
|
+
/**
|
|
78
|
+
* Check if the WASM module is initialized
|
|
79
|
+
*
|
|
80
|
+
* @returns true if initialized, false otherwise
|
|
81
|
+
*/
|
|
82
|
+
function isInitialized() {
|
|
83
|
+
return wasmInitialized;
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
//#endregion
|
|
87
|
+
export { init as default, init, findTailwindCandidates, isInitialized };
|
|
88
|
+
//# sourceMappingURL=index.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.mjs","names":["wasmModule: any"],"sources":["../src/index.ts"],"sourcesContent":["/**\n * @windpress/oxide-parser\n * \n * Tailwind CSS Oxide parser WASM package for Vite and CDN usage.\n * This package provides a fast, WASM-based parser for extracting\n * Tailwind CSS candidates from your code.\n */\n\n// Import the WASM module - this will be handled by the bundler or CDN\nlet wasmModule: any = null;\nlet wasmInitialized = false;\n\n/**\n * Initialize the WASM module\n * \n * This function must be called before using any parsing functions.\n * It loads and initializes the WASM module.\n * \n * @param wasmUrl - Optional custom URL to the WASM file\n * @returns Promise that resolves when initialization is complete\n * \n * @example\n * ```typescript\n * import { init, findTailwindCandidates } from '@windpress/oxide-parser';\n * \n * await init();\n * const candidates = findTailwindCandidates('<div class=\"flex items-center\">');\n * ```\n */\nexport async function init(wasmUrl?: string): Promise<void> {\n if (wasmInitialized) {\n return;\n }\n\n try {\n // Try to import from the pkg directory (for local builds)\n const module = await import('../pkg/oxide_parser.js');\n \n if (wasmUrl) {\n // If custom WASM URL provided, use it\n await module.default(wasmUrl);\n } else {\n // Auto-detect WASM location\n await module.default();\n }\n \n wasmModule = module;\n wasmInitialized = true;\n } catch (error) {\n throw new Error(\n `Failed to initialize WASM module: ${error instanceof Error ? error.message : 'Unknown error'}`\n );\n }\n}\n\n/**\n * Find Tailwind CSS candidates in the provided input\n * \n * This function accepts either a single string or an array of strings.\n * Always returns unique candidates (duplicates are automatically removed).\n * - When given a string, returns unique candidates from that string\n * - When given an array, returns unique candidates across all inputs\n * \n * @param input - Single string or array of strings to parse\n * @returns Array of unique candidate strings\n * \n * @example Single string input\n * ```typescript\n * const candidates = findTailwindCandidates(`\n * <div class=\"flex flex items-center p-4 bg-blue-500\">\n * <span class=\"text-white font-bold p-4\">Hello</span>\n * </div>\n * `);\n * // Returns: ['flex', 'items-center', 'p-4', 'bg-blue-500', 'text-white', 'font-bold']\n * // Note: duplicates 'flex' and 'p-4' are automatically removed\n * ```\n * \n * @example Array input (batch processing with unique results)\n * ```typescript\n * const results = findTailwindCandidates([\n * '<div class=\"flex p-4\">',\n * '<span class=\"flex text-white\">',\n * '<button class=\"p-4 bg-blue-500\">',\n * ]);\n * // Returns: ['flex', 'p-4', 'text-white', 'bg-blue-500']\n * // Note: duplicates 'flex' and 'p-4' across inputs are automatically removed\n * ```\n */\nexport function findTailwindCandidates(input: string | string[]): string[] {\n if (!wasmInitialized || !wasmModule) {\n throw new Error(\n 'WASM module not initialized. Call init() before using findTailwindCandidates()'\n );\n }\n\n return wasmModule.findTailwindCandidates(input);\n}\n\n/**\n * Check if the WASM module is initialized\n * \n * @returns true if initialized, false otherwise\n */\nexport function isInitialized(): boolean {\n return wasmInitialized;\n}\n\n// Export types\nexport type TailwindCandidate = string;\nexport type ParseResult = TailwindCandidate[];\nexport type BatchParseResult = ParseResult[];\n\n// Re-export for convenience\nexport { init as default };\n"],"mappings":";;;;;;;;AASA,IAAIA,aAAkB;AACtB,IAAI,kBAAkB;;;;;;;;;;;;;;;;;;AAmBtB,eAAsB,KAAK,SAAiC;AAC1D,KAAI,gBACF;AAGF,KAAI;EAEF,MAAM,SAAS,MAAM,OAAO;AAE5B,MAAI,QAEF,OAAM,OAAO,QAAQ,QAAQ;MAG7B,OAAM,OAAO,SAAS;AAGxB,eAAa;AACb,oBAAkB;UACX,OAAO;AACd,QAAM,IAAI,MACR,qCAAqC,iBAAiB,QAAQ,MAAM,UAAU,kBAC/E;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAqCL,SAAgB,uBAAuB,OAAoC;AACzE,KAAI,CAAC,mBAAmB,CAAC,WACvB,OAAM,IAAI,MACR,iFACD;AAGH,QAAO,WAAW,uBAAuB,MAAM;;;;;;;AAQjD,SAAgB,gBAAyB;AACvC,QAAO"}
|
|
@@ -0,0 +1,238 @@
|
|
|
1
|
+
//#region pkg/oxide_parser.js
|
|
2
|
+
let wasm;
|
|
3
|
+
let heap = new Array(128).fill(void 0);
|
|
4
|
+
heap.push(void 0, null, true, false);
|
|
5
|
+
function getObject(idx) {
|
|
6
|
+
return heap[idx];
|
|
7
|
+
}
|
|
8
|
+
let WASM_VECTOR_LEN = 0;
|
|
9
|
+
let cachedUint8ArrayMemory0 = null;
|
|
10
|
+
function getUint8ArrayMemory0() {
|
|
11
|
+
if (cachedUint8ArrayMemory0 === null || cachedUint8ArrayMemory0.byteLength === 0) cachedUint8ArrayMemory0 = new Uint8Array(wasm.memory.buffer);
|
|
12
|
+
return cachedUint8ArrayMemory0;
|
|
13
|
+
}
|
|
14
|
+
const cachedTextEncoder = new TextEncoder();
|
|
15
|
+
if (!("encodeInto" in cachedTextEncoder)) cachedTextEncoder.encodeInto = function(arg, view) {
|
|
16
|
+
const buf = cachedTextEncoder.encode(arg);
|
|
17
|
+
view.set(buf);
|
|
18
|
+
return {
|
|
19
|
+
read: arg.length,
|
|
20
|
+
written: buf.length
|
|
21
|
+
};
|
|
22
|
+
};
|
|
23
|
+
function passStringToWasm0(arg, malloc, realloc) {
|
|
24
|
+
if (realloc === void 0) {
|
|
25
|
+
const buf = cachedTextEncoder.encode(arg);
|
|
26
|
+
const ptr$1 = malloc(buf.length, 1) >>> 0;
|
|
27
|
+
getUint8ArrayMemory0().subarray(ptr$1, ptr$1 + buf.length).set(buf);
|
|
28
|
+
WASM_VECTOR_LEN = buf.length;
|
|
29
|
+
return ptr$1;
|
|
30
|
+
}
|
|
31
|
+
let len = arg.length;
|
|
32
|
+
let ptr = malloc(len, 1) >>> 0;
|
|
33
|
+
const mem = getUint8ArrayMemory0();
|
|
34
|
+
let offset = 0;
|
|
35
|
+
for (; offset < len; offset++) {
|
|
36
|
+
const code = arg.charCodeAt(offset);
|
|
37
|
+
if (code > 127) break;
|
|
38
|
+
mem[ptr + offset] = code;
|
|
39
|
+
}
|
|
40
|
+
if (offset !== len) {
|
|
41
|
+
if (offset !== 0) arg = arg.slice(offset);
|
|
42
|
+
ptr = realloc(ptr, len, len = offset + arg.length * 3, 1) >>> 0;
|
|
43
|
+
const view = getUint8ArrayMemory0().subarray(ptr + offset, ptr + len);
|
|
44
|
+
const ret = cachedTextEncoder.encodeInto(arg, view);
|
|
45
|
+
offset += ret.written;
|
|
46
|
+
ptr = realloc(ptr, len, offset, 1) >>> 0;
|
|
47
|
+
}
|
|
48
|
+
WASM_VECTOR_LEN = offset;
|
|
49
|
+
return ptr;
|
|
50
|
+
}
|
|
51
|
+
function isLikeNone(x) {
|
|
52
|
+
return x === void 0 || x === null;
|
|
53
|
+
}
|
|
54
|
+
let cachedDataViewMemory0 = null;
|
|
55
|
+
function getDataViewMemory0() {
|
|
56
|
+
if (cachedDataViewMemory0 === null || cachedDataViewMemory0.buffer.detached === true || cachedDataViewMemory0.buffer.detached === void 0 && cachedDataViewMemory0.buffer !== wasm.memory.buffer) cachedDataViewMemory0 = new DataView(wasm.memory.buffer);
|
|
57
|
+
return cachedDataViewMemory0;
|
|
58
|
+
}
|
|
59
|
+
let cachedTextDecoder = new TextDecoder("utf-8", {
|
|
60
|
+
ignoreBOM: true,
|
|
61
|
+
fatal: true
|
|
62
|
+
});
|
|
63
|
+
cachedTextDecoder.decode();
|
|
64
|
+
const MAX_SAFARI_DECODE_BYTES = 2146435072;
|
|
65
|
+
let numBytesDecoded = 0;
|
|
66
|
+
function decodeText(ptr, len) {
|
|
67
|
+
numBytesDecoded += len;
|
|
68
|
+
if (numBytesDecoded >= MAX_SAFARI_DECODE_BYTES) {
|
|
69
|
+
cachedTextDecoder = new TextDecoder("utf-8", {
|
|
70
|
+
ignoreBOM: true,
|
|
71
|
+
fatal: true
|
|
72
|
+
});
|
|
73
|
+
cachedTextDecoder.decode();
|
|
74
|
+
numBytesDecoded = len;
|
|
75
|
+
}
|
|
76
|
+
return cachedTextDecoder.decode(getUint8ArrayMemory0().subarray(ptr, ptr + len));
|
|
77
|
+
}
|
|
78
|
+
function getStringFromWasm0(ptr, len) {
|
|
79
|
+
ptr = ptr >>> 0;
|
|
80
|
+
return decodeText(ptr, len);
|
|
81
|
+
}
|
|
82
|
+
let heap_next = heap.length;
|
|
83
|
+
function addHeapObject(obj) {
|
|
84
|
+
if (heap_next === heap.length) heap.push(heap.length + 1);
|
|
85
|
+
const idx = heap_next;
|
|
86
|
+
heap_next = heap[idx];
|
|
87
|
+
heap[idx] = obj;
|
|
88
|
+
return idx;
|
|
89
|
+
}
|
|
90
|
+
function dropObject(idx) {
|
|
91
|
+
if (idx < 132) return;
|
|
92
|
+
heap[idx] = heap_next;
|
|
93
|
+
heap_next = idx;
|
|
94
|
+
}
|
|
95
|
+
function takeObject(idx) {
|
|
96
|
+
const ret = getObject(idx);
|
|
97
|
+
dropObject(idx);
|
|
98
|
+
return ret;
|
|
99
|
+
}
|
|
100
|
+
/**
|
|
101
|
+
* WASM-compatible function for JavaScript/TypeScript
|
|
102
|
+
*
|
|
103
|
+
* Finds Tailwind CSS candidates in the provided input.
|
|
104
|
+
* Accepts either a single string or an array of strings.
|
|
105
|
+
* Always returns unique candidates (duplicates are automatically removed).
|
|
106
|
+
*
|
|
107
|
+
* # Performance
|
|
108
|
+
* - Uses direct HashSet insertion to avoid intermediate allocations
|
|
109
|
+
* - Pre-allocates JS array for better performance
|
|
110
|
+
* - Single-pass extraction for array inputs
|
|
111
|
+
*
|
|
112
|
+
* # Arguments
|
|
113
|
+
* * `input` - Either a string or an array of strings
|
|
114
|
+
*
|
|
115
|
+
* # Returns
|
|
116
|
+
* JavaScript Array containing unique candidate strings, or empty array if input is invalid
|
|
117
|
+
*
|
|
118
|
+
* # Example (JavaScript)
|
|
119
|
+
* ```javascript
|
|
120
|
+
* import init, { findTailwindCandidates } from '@windpress/oxide-parser';
|
|
121
|
+
*
|
|
122
|
+
* await init();
|
|
123
|
+
*
|
|
124
|
+
* // Single string - returns unique candidates
|
|
125
|
+
* const candidates = findTailwindCandidates('<div class="flex flex items-center">');
|
|
126
|
+
* console.log(candidates); // ['flex', 'items-center'] (duplicates removed)
|
|
127
|
+
*
|
|
128
|
+
* // Array of strings - returns unique candidates from all inputs
|
|
129
|
+
* const batch = findTailwindCandidates([
|
|
130
|
+
* '<div class="flex p-4">',
|
|
131
|
+
* '<span class="flex text-white">'
|
|
132
|
+
* ]);
|
|
133
|
+
* console.log(batch); // ['flex', 'p-4', 'text-white'] (unique only)
|
|
134
|
+
* ```
|
|
135
|
+
* @param {any} input
|
|
136
|
+
* @returns {Array<any>}
|
|
137
|
+
*/
|
|
138
|
+
function findTailwindCandidates(input) {
|
|
139
|
+
return takeObject(wasm.findTailwindCandidates(addHeapObject(input)));
|
|
140
|
+
}
|
|
141
|
+
const EXPECTED_RESPONSE_TYPES = new Set([
|
|
142
|
+
"basic",
|
|
143
|
+
"cors",
|
|
144
|
+
"default"
|
|
145
|
+
]);
|
|
146
|
+
async function __wbg_load(module, imports) {
|
|
147
|
+
if (typeof Response === "function" && module instanceof Response) {
|
|
148
|
+
if (typeof WebAssembly.instantiateStreaming === "function") try {
|
|
149
|
+
return await WebAssembly.instantiateStreaming(module, imports);
|
|
150
|
+
} catch (e) {
|
|
151
|
+
if (module.ok && EXPECTED_RESPONSE_TYPES.has(module.type) && module.headers.get("Content-Type") !== "application/wasm") console.warn("`WebAssembly.instantiateStreaming` failed because your server does not serve Wasm with `application/wasm` MIME type. Falling back to `WebAssembly.instantiate` which is slower. Original error:\n", e);
|
|
152
|
+
else throw e;
|
|
153
|
+
}
|
|
154
|
+
const bytes = await module.arrayBuffer();
|
|
155
|
+
return await WebAssembly.instantiate(bytes, imports);
|
|
156
|
+
} else {
|
|
157
|
+
const instance = await WebAssembly.instantiate(module, imports);
|
|
158
|
+
if (instance instanceof WebAssembly.Instance) return {
|
|
159
|
+
instance,
|
|
160
|
+
module
|
|
161
|
+
};
|
|
162
|
+
else return instance;
|
|
163
|
+
}
|
|
164
|
+
}
|
|
165
|
+
function __wbg_get_imports() {
|
|
166
|
+
const imports = {};
|
|
167
|
+
imports.wbg = {};
|
|
168
|
+
imports.wbg.__wbg___wbindgen_string_get_e4f06c90489ad01b = function(arg0, arg1) {
|
|
169
|
+
const obj = getObject(arg1);
|
|
170
|
+
const ret = typeof obj === "string" ? obj : void 0;
|
|
171
|
+
var ptr1 = isLikeNone(ret) ? 0 : passStringToWasm0(ret, wasm.__wbindgen_export, wasm.__wbindgen_export2);
|
|
172
|
+
var len1 = WASM_VECTOR_LEN;
|
|
173
|
+
getDataViewMemory0().setInt32(arg0 + 4, len1, true);
|
|
174
|
+
getDataViewMemory0().setInt32(arg0 + 0, ptr1, true);
|
|
175
|
+
};
|
|
176
|
+
imports.wbg.__wbg___wbindgen_throw_b855445ff6a94295 = function(arg0, arg1) {
|
|
177
|
+
throw new Error(getStringFromWasm0(arg0, arg1));
|
|
178
|
+
};
|
|
179
|
+
imports.wbg.__wbg_from_a4ad7cbddd0d7135 = function(arg0) {
|
|
180
|
+
return addHeapObject(Array.from(getObject(arg0)));
|
|
181
|
+
};
|
|
182
|
+
imports.wbg.__wbg_get_7bed016f185add81 = function(arg0, arg1) {
|
|
183
|
+
const ret = getObject(arg0)[arg1 >>> 0];
|
|
184
|
+
return addHeapObject(ret);
|
|
185
|
+
};
|
|
186
|
+
imports.wbg.__wbg_isArray_96e0af9891d0945d = function(arg0) {
|
|
187
|
+
return Array.isArray(getObject(arg0));
|
|
188
|
+
};
|
|
189
|
+
imports.wbg.__wbg_length_cdd215e10d9dd507 = function(arg0) {
|
|
190
|
+
return getObject(arg0).length;
|
|
191
|
+
};
|
|
192
|
+
imports.wbg.__wbg_new_e17d9f43105b08be = function() {
|
|
193
|
+
return addHeapObject(new Array());
|
|
194
|
+
};
|
|
195
|
+
imports.wbg.__wbg_new_with_length_31d2669cb75c5215 = function(arg0) {
|
|
196
|
+
return addHeapObject(new Array(arg0 >>> 0));
|
|
197
|
+
};
|
|
198
|
+
imports.wbg.__wbg_set_c213c871859d6500 = function(arg0, arg1, arg2) {
|
|
199
|
+
getObject(arg0)[arg1 >>> 0] = takeObject(arg2);
|
|
200
|
+
};
|
|
201
|
+
imports.wbg.__wbindgen_cast_2241b6af4c4b2941 = function(arg0, arg1) {
|
|
202
|
+
return addHeapObject(getStringFromWasm0(arg0, arg1));
|
|
203
|
+
};
|
|
204
|
+
imports.wbg.__wbindgen_object_drop_ref = function(arg0) {
|
|
205
|
+
takeObject(arg0);
|
|
206
|
+
};
|
|
207
|
+
return imports;
|
|
208
|
+
}
|
|
209
|
+
function __wbg_finalize_init(instance, module) {
|
|
210
|
+
wasm = instance.exports;
|
|
211
|
+
__wbg_init.__wbindgen_wasm_module = module;
|
|
212
|
+
cachedDataViewMemory0 = null;
|
|
213
|
+
cachedUint8ArrayMemory0 = null;
|
|
214
|
+
return wasm;
|
|
215
|
+
}
|
|
216
|
+
function initSync(module) {
|
|
217
|
+
if (wasm !== void 0) return wasm;
|
|
218
|
+
if (typeof module !== "undefined") if (Object.getPrototypeOf(module) === Object.prototype) ({module} = module);
|
|
219
|
+
else console.warn("using deprecated parameters for `initSync()`; pass a single object instead");
|
|
220
|
+
const imports = __wbg_get_imports();
|
|
221
|
+
if (!(module instanceof WebAssembly.Module)) module = new WebAssembly.Module(module);
|
|
222
|
+
return __wbg_finalize_init(new WebAssembly.Instance(module, imports), module);
|
|
223
|
+
}
|
|
224
|
+
async function __wbg_init(module_or_path) {
|
|
225
|
+
if (wasm !== void 0) return wasm;
|
|
226
|
+
if (typeof module_or_path !== "undefined") if (Object.getPrototypeOf(module_or_path) === Object.prototype) ({module_or_path} = module_or_path);
|
|
227
|
+
else console.warn("using deprecated parameters for the initialization function; pass a single object instead");
|
|
228
|
+
if (typeof module_or_path === "undefined") module_or_path = new URL("oxide_parser_bg.wasm", import.meta.url);
|
|
229
|
+
const imports = __wbg_get_imports();
|
|
230
|
+
if (typeof module_or_path === "string" || typeof Request === "function" && module_or_path instanceof Request || typeof URL === "function" && module_or_path instanceof URL) module_or_path = fetch(module_or_path);
|
|
231
|
+
const { instance, module } = await __wbg_load(await module_or_path, imports);
|
|
232
|
+
return __wbg_finalize_init(instance, module);
|
|
233
|
+
}
|
|
234
|
+
var oxide_parser_default = __wbg_init;
|
|
235
|
+
|
|
236
|
+
//#endregion
|
|
237
|
+
export { oxide_parser_default as default, findTailwindCandidates, initSync };
|
|
238
|
+
//# sourceMappingURL=oxide_parser-C3svwMjw.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"oxide_parser-C3svwMjw.mjs","names":["ptr"],"sources":["../pkg/oxide_parser.js"],"sourcesContent":["let wasm;\n\nlet heap = new Array(128).fill(undefined);\n\nheap.push(undefined, null, true, false);\n\nfunction getObject(idx) { return heap[idx]; }\n\nlet WASM_VECTOR_LEN = 0;\n\nlet cachedUint8ArrayMemory0 = null;\n\nfunction getUint8ArrayMemory0() {\n if (cachedUint8ArrayMemory0 === null || cachedUint8ArrayMemory0.byteLength === 0) {\n cachedUint8ArrayMemory0 = new Uint8Array(wasm.memory.buffer);\n }\n return cachedUint8ArrayMemory0;\n}\n\nconst cachedTextEncoder = new TextEncoder();\n\nif (!('encodeInto' in cachedTextEncoder)) {\n cachedTextEncoder.encodeInto = function (arg, view) {\n const buf = cachedTextEncoder.encode(arg);\n view.set(buf);\n return {\n read: arg.length,\n written: buf.length\n };\n }\n}\n\nfunction passStringToWasm0(arg, malloc, realloc) {\n\n if (realloc === undefined) {\n const buf = cachedTextEncoder.encode(arg);\n const ptr = malloc(buf.length, 1) >>> 0;\n getUint8ArrayMemory0().subarray(ptr, ptr + buf.length).set(buf);\n WASM_VECTOR_LEN = buf.length;\n return ptr;\n }\n\n let len = arg.length;\n let ptr = malloc(len, 1) >>> 0;\n\n const mem = getUint8ArrayMemory0();\n\n let offset = 0;\n\n for (; offset < len; offset++) {\n const code = arg.charCodeAt(offset);\n if (code > 0x7F) break;\n mem[ptr + offset] = code;\n }\n\n if (offset !== len) {\n if (offset !== 0) {\n arg = arg.slice(offset);\n }\n ptr = realloc(ptr, len, len = offset + arg.length * 3, 1) >>> 0;\n const view = getUint8ArrayMemory0().subarray(ptr + offset, ptr + len);\n const ret = cachedTextEncoder.encodeInto(arg, view);\n\n offset += ret.written;\n ptr = realloc(ptr, len, offset, 1) >>> 0;\n }\n\n WASM_VECTOR_LEN = offset;\n return ptr;\n}\n\nfunction isLikeNone(x) {\n return x === undefined || x === null;\n}\n\nlet cachedDataViewMemory0 = null;\n\nfunction getDataViewMemory0() {\n if (cachedDataViewMemory0 === null || cachedDataViewMemory0.buffer.detached === true || (cachedDataViewMemory0.buffer.detached === undefined && cachedDataViewMemory0.buffer !== wasm.memory.buffer)) {\n cachedDataViewMemory0 = new DataView(wasm.memory.buffer);\n }\n return cachedDataViewMemory0;\n}\n\nlet cachedTextDecoder = new TextDecoder('utf-8', { ignoreBOM: true, fatal: true });\n\ncachedTextDecoder.decode();\n\nconst MAX_SAFARI_DECODE_BYTES = 2146435072;\nlet numBytesDecoded = 0;\nfunction decodeText(ptr, len) {\n numBytesDecoded += len;\n if (numBytesDecoded >= MAX_SAFARI_DECODE_BYTES) {\n cachedTextDecoder = new TextDecoder('utf-8', { ignoreBOM: true, fatal: true });\n cachedTextDecoder.decode();\n numBytesDecoded = len;\n }\n return cachedTextDecoder.decode(getUint8ArrayMemory0().subarray(ptr, ptr + len));\n}\n\nfunction getStringFromWasm0(ptr, len) {\n ptr = ptr >>> 0;\n return decodeText(ptr, len);\n}\n\nlet heap_next = heap.length;\n\nfunction addHeapObject(obj) {\n if (heap_next === heap.length) heap.push(heap.length + 1);\n const idx = heap_next;\n heap_next = heap[idx];\n\n heap[idx] = obj;\n return idx;\n}\n\nfunction dropObject(idx) {\n if (idx < 132) return;\n heap[idx] = heap_next;\n heap_next = idx;\n}\n\nfunction takeObject(idx) {\n const ret = getObject(idx);\n dropObject(idx);\n return ret;\n}\n/**\n * WASM-compatible function for JavaScript/TypeScript\n *\n * Finds Tailwind CSS candidates in the provided input.\n * Accepts either a single string or an array of strings.\n * Always returns unique candidates (duplicates are automatically removed).\n *\n * # Performance\n * - Uses direct HashSet insertion to avoid intermediate allocations\n * - Pre-allocates JS array for better performance\n * - Single-pass extraction for array inputs\n *\n * # Arguments\n * * `input` - Either a string or an array of strings\n *\n * # Returns\n * JavaScript Array containing unique candidate strings, or empty array if input is invalid\n *\n * # Example (JavaScript)\n * ```javascript\n * import init, { findTailwindCandidates } from '@windpress/oxide-parser';\n *\n * await init();\n *\n * // Single string - returns unique candidates\n * const candidates = findTailwindCandidates('<div class=\"flex flex items-center\">');\n * console.log(candidates); // ['flex', 'items-center'] (duplicates removed)\n *\n * // Array of strings - returns unique candidates from all inputs\n * const batch = findTailwindCandidates([\n * '<div class=\"flex p-4\">',\n * '<span class=\"flex text-white\">'\n * ]);\n * console.log(batch); // ['flex', 'p-4', 'text-white'] (unique only)\n * ```\n * @param {any} input\n * @returns {Array<any>}\n */\nexport function findTailwindCandidates(input) {\n const ret = wasm.findTailwindCandidates(addHeapObject(input));\n return takeObject(ret);\n}\n\nconst EXPECTED_RESPONSE_TYPES = new Set(['basic', 'cors', 'default']);\n\nasync function __wbg_load(module, imports) {\n if (typeof Response === 'function' && module instanceof Response) {\n if (typeof WebAssembly.instantiateStreaming === 'function') {\n try {\n return await WebAssembly.instantiateStreaming(module, imports);\n\n } catch (e) {\n const validResponse = module.ok && EXPECTED_RESPONSE_TYPES.has(module.type);\n\n if (validResponse && module.headers.get('Content-Type') !== 'application/wasm') {\n console.warn(\"`WebAssembly.instantiateStreaming` failed because your server does not serve Wasm with `application/wasm` MIME type. Falling back to `WebAssembly.instantiate` which is slower. Original error:\\n\", e);\n\n } else {\n throw e;\n }\n }\n }\n\n const bytes = await module.arrayBuffer();\n return await WebAssembly.instantiate(bytes, imports);\n\n } else {\n const instance = await WebAssembly.instantiate(module, imports);\n\n if (instance instanceof WebAssembly.Instance) {\n return { instance, module };\n\n } else {\n return instance;\n }\n }\n}\n\nfunction __wbg_get_imports() {\n const imports = {};\n imports.wbg = {};\n imports.wbg.__wbg___wbindgen_string_get_e4f06c90489ad01b = function(arg0, arg1) {\n const obj = getObject(arg1);\n const ret = typeof(obj) === 'string' ? obj : undefined;\n var ptr1 = isLikeNone(ret) ? 0 : passStringToWasm0(ret, wasm.__wbindgen_export, wasm.__wbindgen_export2);\n var len1 = WASM_VECTOR_LEN;\n getDataViewMemory0().setInt32(arg0 + 4 * 1, len1, true);\n getDataViewMemory0().setInt32(arg0 + 4 * 0, ptr1, true);\n };\n imports.wbg.__wbg___wbindgen_throw_b855445ff6a94295 = function(arg0, arg1) {\n throw new Error(getStringFromWasm0(arg0, arg1));\n };\n imports.wbg.__wbg_from_a4ad7cbddd0d7135 = function(arg0) {\n const ret = Array.from(getObject(arg0));\n return addHeapObject(ret);\n };\n imports.wbg.__wbg_get_7bed016f185add81 = function(arg0, arg1) {\n const ret = getObject(arg0)[arg1 >>> 0];\n return addHeapObject(ret);\n };\n imports.wbg.__wbg_isArray_96e0af9891d0945d = function(arg0) {\n const ret = Array.isArray(getObject(arg0));\n return ret;\n };\n imports.wbg.__wbg_length_cdd215e10d9dd507 = function(arg0) {\n const ret = getObject(arg0).length;\n return ret;\n };\n imports.wbg.__wbg_new_e17d9f43105b08be = function() {\n const ret = new Array();\n return addHeapObject(ret);\n };\n imports.wbg.__wbg_new_with_length_31d2669cb75c5215 = function(arg0) {\n const ret = new Array(arg0 >>> 0);\n return addHeapObject(ret);\n };\n imports.wbg.__wbg_set_c213c871859d6500 = function(arg0, arg1, arg2) {\n getObject(arg0)[arg1 >>> 0] = takeObject(arg2);\n };\n imports.wbg.__wbindgen_cast_2241b6af4c4b2941 = function(arg0, arg1) {\n // Cast intrinsic for `Ref(String) -> Externref`.\n const ret = getStringFromWasm0(arg0, arg1);\n return addHeapObject(ret);\n };\n imports.wbg.__wbindgen_object_drop_ref = function(arg0) {\n takeObject(arg0);\n };\n\n return imports;\n}\n\nfunction __wbg_finalize_init(instance, module) {\n wasm = instance.exports;\n __wbg_init.__wbindgen_wasm_module = module;\n cachedDataViewMemory0 = null;\n cachedUint8ArrayMemory0 = null;\n\n\n\n return wasm;\n}\n\nfunction initSync(module) {\n if (wasm !== undefined) return wasm;\n\n\n if (typeof module !== 'undefined') {\n if (Object.getPrototypeOf(module) === Object.prototype) {\n ({module} = module)\n } else {\n console.warn('using deprecated parameters for `initSync()`; pass a single object instead')\n }\n }\n\n const imports = __wbg_get_imports();\n\n if (!(module instanceof WebAssembly.Module)) {\n module = new WebAssembly.Module(module);\n }\n\n const instance = new WebAssembly.Instance(module, imports);\n\n return __wbg_finalize_init(instance, module);\n}\n\nasync function __wbg_init(module_or_path) {\n if (wasm !== undefined) return wasm;\n\n\n if (typeof module_or_path !== 'undefined') {\n if (Object.getPrototypeOf(module_or_path) === Object.prototype) {\n ({module_or_path} = module_or_path)\n } else {\n console.warn('using deprecated parameters for the initialization function; pass a single object instead')\n }\n }\n\n if (typeof module_or_path === 'undefined') {\n module_or_path = new URL('oxide_parser_bg.wasm', import.meta.url);\n }\n const imports = __wbg_get_imports();\n\n if (typeof module_or_path === 'string' || (typeof Request === 'function' && module_or_path instanceof Request) || (typeof URL === 'function' && module_or_path instanceof URL)) {\n module_or_path = fetch(module_or_path);\n }\n\n const { instance, module } = await __wbg_load(await module_or_path, imports);\n\n return __wbg_finalize_init(instance, module);\n}\n\nexport { initSync };\nexport default __wbg_init;\n"],"mappings":";AAAA,IAAI;AAEJ,IAAI,OAAO,IAAI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,gBAAgB;AACtC,KAAI,SAAS,OAAW,QAAO;AAG/B,KAAI,OAAO,mBAAmB,YAC1B,KAAI,OAAO,eAAe,eAAe,KAAK,OAAO,UACjD,EAAC,CAAC,kBAAkB;KAEpB,SAAQ,KAAK,4FAA4F;AAIjH,KAAI,OAAO,mBAAmB,YAC1B,kBAAiB,IAAI,IAAI,wBAAwB,OAAO,KAAK,IAAI;CAErE,MAAM,UAAU,mBAAmB;AAEnC,KAAI,OAAO,mBAAmB,YAAa,OAAO,YAAY,cAAc,0BAA0B,WAAa,OAAO,QAAQ,cAAc,0BAA0B,IACtK,kBAAiB,MAAM,eAAe;CAG1C,MAAM,EAAE,UAAU,WAAW,MAAM,WAAW,MAAM,gBAAgB,QAAQ;AAE5E,QAAO,oBAAoB,UAAU,OAAO;;AAIhD,2BAAe"}
|
|
Binary file
|
package/package.json
ADDED
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@windpress/oxide-parser",
|
|
3
|
+
"version": "1.0.0",
|
|
4
|
+
"description": "Tailwind CSS Oxide parser WASM package for Vite and CDN usage",
|
|
5
|
+
"type": "module",
|
|
6
|
+
"main": "./dist/index.mjs",
|
|
7
|
+
"module": "./dist/index.mjs",
|
|
8
|
+
"types": "./dist/index.d.mts",
|
|
9
|
+
"exports": {
|
|
10
|
+
".": "./dist/index.mjs",
|
|
11
|
+
"./package.json": "./package.json",
|
|
12
|
+
"./wasm": "./dist/oxide_parser.wasm"
|
|
13
|
+
},
|
|
14
|
+
"files": [
|
|
15
|
+
"dist",
|
|
16
|
+
"README.md",
|
|
17
|
+
"LICENSE"
|
|
18
|
+
],
|
|
19
|
+
"scripts": {
|
|
20
|
+
"build:wasm": "wasm-pack build --target web --out-dir pkg --release",
|
|
21
|
+
"build:ts": "tsdown",
|
|
22
|
+
"build": "npm run build:wasm && npm run build:ts && npm run copy-wasm",
|
|
23
|
+
"copy-wasm": "node scripts/copy-wasm.js",
|
|
24
|
+
"dev": "vite",
|
|
25
|
+
"preview": "vite preview"
|
|
26
|
+
},
|
|
27
|
+
"keywords": [
|
|
28
|
+
"tailwindcss",
|
|
29
|
+
"oxide",
|
|
30
|
+
"wasm",
|
|
31
|
+
"parser",
|
|
32
|
+
"vite",
|
|
33
|
+
"cdn",
|
|
34
|
+
"esm"
|
|
35
|
+
],
|
|
36
|
+
"author": "WindPress <hi@wind.press>",
|
|
37
|
+
"license": "MIT",
|
|
38
|
+
"devDependencies": {
|
|
39
|
+
"tsdown": "^0.16.6",
|
|
40
|
+
"typescript": "^5.7.2",
|
|
41
|
+
"vite": "^7.2.4"
|
|
42
|
+
},
|
|
43
|
+
"dependencies": {},
|
|
44
|
+
"sideEffects": false,
|
|
45
|
+
"repository": {
|
|
46
|
+
"type": "git",
|
|
47
|
+
"url": "https://github.com/wind-press/oxide-parser"
|
|
48
|
+
},
|
|
49
|
+
"packageManager": "pnpm@10.20.0+sha512.cf9998222162dd85864d0a8102e7892e7ba4ceadebbf5a31f9c2fce48dfce317a9c53b9f6464d1ef9042cba2e02ae02a9f7c143a2b438cd93c91840f0192b9dd"
|
|
50
|
+
}
|