@rebuildjs/tailwindcss 0.8.1 → 0.8.3
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/package.json +65 -66
- package/rebuild_tailwind_plugin/index.js +34 -34
package/package.json
CHANGED
|
@@ -1,68 +1,67 @@
|
|
|
1
1
|
{
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
"sideEffects": false
|
|
2
|
+
"name": "@rebuildjs/tailwindcss",
|
|
3
|
+
"version": "0.8.3",
|
|
4
|
+
"description": "Tailwindcss integration with rebuildjs",
|
|
5
|
+
"keywords": [
|
|
6
|
+
"tailwindcss",
|
|
7
|
+
"reactive",
|
|
8
|
+
"multi page apps",
|
|
9
|
+
"web app",
|
|
10
|
+
"web server",
|
|
11
|
+
"esbuild",
|
|
12
|
+
"rmemo",
|
|
13
|
+
"ctx-core"
|
|
14
|
+
],
|
|
15
|
+
"homepage": "https://github.com/rebuildjs/tailwindcss#readme",
|
|
16
|
+
"bugs": {
|
|
17
|
+
"url": "https://github.com/rebuildjs/tailwindcss/issues"
|
|
18
|
+
},
|
|
19
|
+
"repository": {
|
|
20
|
+
"type": "git",
|
|
21
|
+
"url": "https://github.com/rebuildjs/tailwindcss.git"
|
|
22
|
+
},
|
|
23
|
+
"license": "Apache-2.0",
|
|
24
|
+
"author": "Brian Takita",
|
|
25
|
+
"type": "module",
|
|
26
|
+
"files": [
|
|
27
|
+
"*.d.ts",
|
|
28
|
+
"*.js",
|
|
29
|
+
"*.json",
|
|
30
|
+
"rebuild_tailwind_plugin"
|
|
31
|
+
],
|
|
32
|
+
"types": "./index.d.ts",
|
|
33
|
+
"exports": {
|
|
34
|
+
".": "./index.js",
|
|
35
|
+
"./package.json": "./package.json"
|
|
36
|
+
},
|
|
37
|
+
"dependencies": {
|
|
38
|
+
"ctx-core": "^5.38.1",
|
|
39
|
+
"esbuild": "^0.20.0",
|
|
40
|
+
"postcss": "^8.4.34",
|
|
41
|
+
"rebuildjs": "^0.56.1",
|
|
42
|
+
"tailwindcss": "^3.4.1"
|
|
43
|
+
},
|
|
44
|
+
"devDependencies": {
|
|
45
|
+
"c8": "^9.1.0",
|
|
46
|
+
"check-dts": "^0.7.2",
|
|
47
|
+
"esmock": "^2.6.3",
|
|
48
|
+
"relementjs": "^0.64.2",
|
|
49
|
+
"tsx": "^4.7.0",
|
|
50
|
+
"typescript": "next",
|
|
51
|
+
"uvu": "^0.5.6"
|
|
52
|
+
},
|
|
53
|
+
"publishConfig": {
|
|
54
|
+
"access": "public",
|
|
55
|
+
"cache": "~/.npm"
|
|
56
|
+
},
|
|
57
|
+
"sideEffects": false,
|
|
58
|
+
"scripts": {
|
|
59
|
+
"build": ":",
|
|
60
|
+
"clean": ":",
|
|
61
|
+
"exec": "$@",
|
|
62
|
+
"test": "pnpm test:unit && pnpm test:types",
|
|
63
|
+
"test:types": "check-dts",
|
|
64
|
+
"test:unit": "NODE_OPTIONS=--loader=esmock tsx node_modules/uvu/bin.js . '\\.test\\.(ts|js)$'",
|
|
65
|
+
"test:unit:coverage": "c8 pnpm test:unit"
|
|
66
|
+
}
|
|
68
67
|
}
|
|
@@ -145,18 +145,6 @@ export function rebuild_tailwind_plugin_(config) {
|
|
|
145
145
|
basename(output__relative_path, '.js')
|
|
146
146
|
.split('-')
|
|
147
147
|
.slice(-1)[0]
|
|
148
|
-
metafile_updated = !cssBundle.includes('_' + output_hash)
|
|
149
|
-
const annotated_cssBundle =
|
|
150
|
-
metafile_updated
|
|
151
|
-
? cssBundle__annotate(cssBundle, '_' + output_hash)
|
|
152
|
-
: cssBundle
|
|
153
|
-
output.cssBundle = annotated_cssBundle
|
|
154
|
-
if (metafile_updated) {
|
|
155
|
-
metafile.outputs[annotated_cssBundle] = metafile.outputs[cssBundle]
|
|
156
|
-
metafile.outputs[annotated_cssBundle + '.map'] = metafile.outputs[cssBundle + '.map']
|
|
157
|
-
}
|
|
158
|
-
const annotated_cssBundle_path = join(cwd_(app_ctx), annotated_cssBundle)
|
|
159
|
-
const annotated_cssBundle_map_path = join(cwd_(app_ctx), annotated_cssBundle) + '.map'
|
|
160
148
|
const tailwind_instance = tailwind({
|
|
161
149
|
...config?.tailwindcss_config,
|
|
162
150
|
content: [
|
|
@@ -165,35 +153,47 @@ export function rebuild_tailwind_plugin_(config) {
|
|
|
165
153
|
...(config?.content ?? [])
|
|
166
154
|
]
|
|
167
155
|
})
|
|
168
|
-
const result = await
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
156
|
+
const result = await file_exists__waitfor(
|
|
157
|
+
async ()=>cmd(
|
|
158
|
+
postcss(
|
|
159
|
+
config?.postcss_plugin_a1_?.(tailwind_instance)
|
|
160
|
+
?? [tailwind_instance]
|
|
161
|
+
).process(
|
|
162
|
+
await readFile(esbuild_cssBundle_path),
|
|
163
|
+
{
|
|
164
|
+
from: esbuild_cssBundle_path,
|
|
165
|
+
to: join(cwd_(app_ctx), cssBundle),
|
|
166
|
+
map: esbuild_cssBundle_map_exists
|
|
167
|
+
? {
|
|
168
|
+
prev: await file_json__parse__wait(esbuild_cssBundle_map_path)
|
|
169
|
+
}
|
|
170
|
+
: false,
|
|
171
|
+
})))
|
|
172
|
+
metafile_updated = !cssBundle.includes('_' + output_hash)
|
|
173
|
+
const annotated_cssBundle =
|
|
174
|
+
metafile_updated
|
|
175
|
+
? cssBundle__annotate(cssBundle, '_' + output_hash)
|
|
176
|
+
: cssBundle
|
|
177
|
+
const annotated_cssBundle_path = join(cwd_(app_ctx), annotated_cssBundle)
|
|
178
|
+
const annotated_cssBundle_map_path = join(cwd_(app_ctx), annotated_cssBundle) + '.map'
|
|
184
179
|
await cmd(writeFile(annotated_cssBundle_path, result.css))
|
|
185
180
|
const map_json = result.map ? JSON.stringify(result.map) : null
|
|
186
181
|
if (map_json) {
|
|
187
182
|
await cmd(writeFile(annotated_cssBundle_map_path, map_json))
|
|
188
|
-
await
|
|
189
|
-
readFile(annotated_cssBundle_map_path)
|
|
183
|
+
await file_exists__waitfor(()=>
|
|
184
|
+
cmd(readFile(annotated_cssBundle_map_path))
|
|
190
185
|
.then(buf=>'' + buf === map_json),
|
|
191
|
-
5_000)
|
|
186
|
+
5_000)
|
|
192
187
|
}
|
|
193
|
-
await
|
|
194
|
-
readFile(annotated_cssBundle_path)
|
|
188
|
+
await file_exists__waitfor(()=>
|
|
189
|
+
cmd(readFile(annotated_cssBundle_path))
|
|
195
190
|
.then(buf=>'' + buf === result.css),
|
|
196
|
-
5_000)
|
|
191
|
+
5_000)
|
|
192
|
+
output.cssBundle = annotated_cssBundle
|
|
193
|
+
if (metafile_updated) {
|
|
194
|
+
metafile.outputs[annotated_cssBundle] = metafile.outputs[cssBundle]
|
|
195
|
+
metafile.outputs[annotated_cssBundle + '.map'] = metafile.outputs[cssBundle + '.map']
|
|
196
|
+
}
|
|
197
197
|
return metafile_updated
|
|
198
198
|
}
|
|
199
199
|
async function file_json__parse__wait(path) {
|