@rebuildjs/tailwindcss 0.1.15 → 0.1.17
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 +66 -65
- package/rebuild_tailwind_plugin/index.js +79 -75
package/package.json
CHANGED
|
@@ -1,67 +1,68 @@
|
|
|
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
|
-
|
|
2
|
+
"name": "@rebuildjs/tailwindcss",
|
|
3
|
+
"version": "0.1.17",
|
|
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
|
+
"scripts": {
|
|
38
|
+
"build": ":",
|
|
39
|
+
"clean": ":",
|
|
40
|
+
"exec": "$@",
|
|
41
|
+
"prepublishOnly": "pnpm clean && pnpm build && pnpm test",
|
|
42
|
+
"test": "pnpm test:unit && pnpm test:types",
|
|
43
|
+
"test:types": "check-dts",
|
|
44
|
+
"test:unit": "NODE_OPTIONS=--loader=esmock tsx node_modules/uvu/bin.js . '\\.test\\.(ts|js)$'",
|
|
45
|
+
"test:unit:coverage": "c8 pnpm test:unit"
|
|
46
|
+
},
|
|
47
|
+
"dependencies": {
|
|
48
|
+
"ctx-core": "^5.16.1",
|
|
49
|
+
"esbuild": "^0.19.11",
|
|
50
|
+
"postcss": "^8.4.33",
|
|
51
|
+
"rebuildjs": "^0.34.4",
|
|
52
|
+
"tailwindcss": "^3.4.1"
|
|
53
|
+
},
|
|
54
|
+
"devDependencies": {
|
|
55
|
+
"c8": "^9.0.0",
|
|
56
|
+
"check-dts": "^0.7.2",
|
|
57
|
+
"esmock": "^2.6.0",
|
|
58
|
+
"relementjs": "^0.45.0",
|
|
59
|
+
"tsx": "^4.7.0",
|
|
60
|
+
"typescript": "next",
|
|
61
|
+
"uvu": "^0.5.6"
|
|
62
|
+
},
|
|
63
|
+
"publishConfig": {
|
|
64
|
+
"access": "public",
|
|
65
|
+
"cache": "~/.npm"
|
|
66
|
+
},
|
|
67
|
+
"sideEffects": false
|
|
67
68
|
}
|
|
@@ -47,84 +47,88 @@ export function rebuild_tailwind_plugin_() {
|
|
|
47
47
|
return setup
|
|
48
48
|
function tailwind__build$_() {
|
|
49
49
|
return be(app_ctx, ctx=>
|
|
50
|
-
run(memo_(
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
50
|
+
run(memo_(tailwind__build$=>{
|
|
51
|
+
r()
|
|
52
|
+
return tailwind__build$
|
|
53
|
+
function r() {
|
|
54
|
+
if (!rebuildjs__ready_(ctx)) return
|
|
55
|
+
nullish__none_(tup(
|
|
56
|
+
build_id_(ctx),
|
|
57
|
+
rebuildjs__build_id_(ctx),
|
|
58
|
+
server__output__relative_path_M_middleware_ctx_(app_ctx),
|
|
59
|
+
), async (
|
|
60
|
+
build_id,
|
|
61
|
+
rebuildjs__build_id,
|
|
62
|
+
server__output__relative_path_M_middleware_ctx,
|
|
63
|
+
)=>{
|
|
64
|
+
try {
|
|
65
|
+
for (const middleware_ctx of server__output__relative_path_M_middleware_ctx.values()) {
|
|
66
|
+
await output__process(server__output_(middleware_ctx))
|
|
67
|
+
await output__process(browser__output_(middleware_ctx))
|
|
68
|
+
}
|
|
69
|
+
rebuild_tailwind_plugin__build_id__set(ctx, build_id)
|
|
70
|
+
} catch (err) {
|
|
71
|
+
if (err instanceof Cancel) return
|
|
72
|
+
throw err
|
|
65
73
|
}
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
}))
|
|
105
|
-
await cmd(writeFile(cssBundle_path, result.css))
|
|
106
|
-
if (result.map) {
|
|
107
|
-
await cmd(writeFile(cssBundle_path + '.map', JSON.stringify(result.map)))
|
|
74
|
+
/**
|
|
75
|
+
* @param {rebuildjs_metafile_T['outputs'][string]}output
|
|
76
|
+
* @returns {Promise<void>}
|
|
77
|
+
*/
|
|
78
|
+
async function output__process(
|
|
79
|
+
output
|
|
80
|
+
) {
|
|
81
|
+
const cssBundle = output?.cssBundle
|
|
82
|
+
if (!cssBundle) return
|
|
83
|
+
const cssBundle_path = join(cwd_(ctx), cssBundle)
|
|
84
|
+
const esbuild_cssBundle = output.esbuild_cssBundle ?? cssBundle
|
|
85
|
+
const esbuild_cssBundle_path = join(cwd_(ctx), esbuild_cssBundle)
|
|
86
|
+
await file_exists__waitfor(
|
|
87
|
+
esbuild_cssBundle_path,
|
|
88
|
+
1000,
|
|
89
|
+
()=>cmd(sleep(0)))
|
|
90
|
+
const esbuild_cssBundle_map_path = esbuild_cssBundle_path + '.map'
|
|
91
|
+
const esbuild_cssBundle_map_exists = await cmd(file_exists_(esbuild_cssBundle_map_path))
|
|
92
|
+
const result = await cmd(postcss([
|
|
93
|
+
tailwind({
|
|
94
|
+
content: output.cssBundle_content.map(content__relative_path=>
|
|
95
|
+
join(cwd_(ctx), content__relative_path))
|
|
96
|
+
})
|
|
97
|
+
]).process(
|
|
98
|
+
await cmd(readFile(esbuild_cssBundle_path)),
|
|
99
|
+
{
|
|
100
|
+
from: esbuild_cssBundle_path,
|
|
101
|
+
to: cssBundle_path,
|
|
102
|
+
map: esbuild_cssBundle_map_exists
|
|
103
|
+
? {
|
|
104
|
+
prev: JSON.parse(await cmd(readFile(esbuild_cssBundle_path + '.map')))
|
|
105
|
+
}
|
|
106
|
+
: false,
|
|
107
|
+
}))
|
|
108
|
+
await cmd(writeFile(cssBundle_path, result.css))
|
|
109
|
+
if (result.map) {
|
|
110
|
+
await cmd(writeFile(cssBundle_path + '.map', JSON.stringify(result.map)))
|
|
111
|
+
}
|
|
108
112
|
}
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
113
|
+
async function cmd(promise) {
|
|
114
|
+
if (cancel_()) throw new Cancel()
|
|
115
|
+
const rv = await promise
|
|
116
|
+
if (cancel_()) {
|
|
117
|
+
promise.cancel?.()
|
|
118
|
+
throw new Cancel()
|
|
119
|
+
}
|
|
120
|
+
return rv
|
|
116
121
|
}
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
})
|
|
122
|
+
function cancel_() {
|
|
123
|
+
return (
|
|
124
|
+
build_id_(ctx) !== build_id
|
|
125
|
+
|| rebuildjs__build_id_(ctx) !== rebuildjs__build_id
|
|
126
|
+
|| server__output__relative_path_M_middleware_ctx_(
|
|
127
|
+
ctx) !== server__output__relative_path_M_middleware_ctx
|
|
128
|
+
)
|
|
129
|
+
}
|
|
130
|
+
})
|
|
131
|
+
}
|
|
128
132
|
})), { id: 'tailwind__build$', ns: 'app' })
|
|
129
133
|
}
|
|
130
134
|
}
|