@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 CHANGED
@@ -1,67 +1,68 @@
1
1
  {
2
- "name": "@rebuildjs/tailwindcss",
3
- "version": "0.1.15",
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.16.1",
39
- "esbuild": "^0.19.11",
40
- "postcss": "^8.4.33",
41
- "rebuildjs": "^0.34.3",
42
- "tailwindcss": "^3.4.1"
43
- },
44
- "devDependencies": {
45
- "c8": "^9.0.0",
46
- "check-dts": "^0.7.2",
47
- "esmock": "^2.6.0",
48
- "relementjs": "^0.44.1",
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
- }
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
- if (!rebuildjs__ready_(ctx)) return
52
- nullish__none_(tup(
53
- build_id_(ctx),
54
- rebuildjs__build_id_(ctx),
55
- server__output__relative_path_M_middleware_ctx_(app_ctx),
56
- ), async (
57
- build_id,
58
- rebuildjs__build_id,
59
- server__output__relative_path_M_middleware_ctx,
60
- )=>{
61
- try {
62
- for (const middleware_ctx of server__output__relative_path_M_middleware_ctx.values()) {
63
- await output__process(server__output_(middleware_ctx))
64
- await output__process(browser__output_(middleware_ctx))
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
- rebuild_tailwind_plugin__build_id__set(ctx, build_id)
67
- } catch (err) {
68
- if (err instanceof Cancel) return
69
- throw err
70
- }
71
- /**
72
- * @param {rebuildjs_metafile_T['outputs'][string]}output
73
- * @returns {Promise<void>}
74
- */
75
- async function output__process(
76
- output
77
- ) {
78
- const cssBundle = output?.cssBundle
79
- if (!cssBundle) return
80
- const cssBundle_path = join(cwd_(ctx), cssBundle)
81
- const esbuild_cssBundle = output.esbuild_cssBundle ?? cssBundle
82
- const esbuild_cssBundle_path = join(cwd_(ctx), esbuild_cssBundle)
83
- await file_exists__waitfor(
84
- esbuild_cssBundle_path,
85
- 1000,
86
- ()=>cmd(sleep(0)))
87
- const esbuild_cssBundle_map_path = esbuild_cssBundle_path + '.map'
88
- const esbuild_cssBundle_map_exists = await cmd(file_exists_(esbuild_cssBundle_map_path))
89
- const result = await cmd(postcss([
90
- tailwind({
91
- content: output.cssBundle_content.map(content__relative_path=>
92
- join(cwd_(ctx), content__relative_path))
93
- })
94
- ]).process(
95
- await cmd(readFile(esbuild_cssBundle_path)),
96
- {
97
- from: esbuild_cssBundle_path,
98
- to: cssBundle_path,
99
- map: esbuild_cssBundle_map_exists
100
- ? {
101
- prev: JSON.parse(await cmd(readFile(esbuild_cssBundle_path + '.map')))
102
- }
103
- : false,
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
- async function cmd(promise) {
111
- if (cancel_()) throw new Cancel()
112
- const rv = await promise
113
- if (cancel_()) {
114
- promise.cancel?.()
115
- throw new Cancel()
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
- return rv
118
- }
119
- function cancel_() {
120
- return (
121
- build_id_(ctx) !== build_id
122
- || rebuildjs__build_id_(ctx) !== rebuildjs__build_id
123
- || server__output__relative_path_M_middleware_ctx_(
124
- ctx) !== server__output__relative_path_M_middleware_ctx
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
  }