Skip to content

Commit d205424

Browse files
committed
test(apps): verify patch and mangle integrations
1 parent 9f510d4 commit d205424

24 files changed

Lines changed: 731 additions & 220 deletions

.changeset/green-apps-serve.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"tailwindcss-patch": patch
3+
---
4+
5+
Resolve Tailwind CSS and Tailwind plugins from the configured project root when running in app workspaces.

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,3 +37,4 @@ vite.config.ts.timestamp-*.mjs
3737
config.ts.timestamp-*.mjs
3838
.vite-inspect
3939
apps/astro-app/.astro
40+
apps/vite-lit/types

apps/remix-app/app/entry.server.tsx

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,8 @@
66

77
import type { EntryContext } from '@remix-run/node'
88
import { PassThrough } from 'node:stream'
9-
import { Response } from '@remix-run/node'
109
import { RemixServer } from '@remix-run/react'
11-
import isbot from 'isbot'
10+
import { isbot } from 'isbot'
1211
import { renderToPipeableStream } from 'react-dom/server'
1312

1413
const ABORT_DELAY = 5_000

apps/remix-app/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
"scripts": {
1010
"build": "remix build",
1111
"dev": "remix dev",
12-
"start": "remix-serve build",
12+
"start": "remix-serve build/index.js",
1313
"typecheck": "tsc",
1414
"prepare": "tw-patch install",
1515
"tw-extract": "tw-patch extract"

apps/remix-app/remix.config.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
/** @type {import('@remix-run/dev').AppConfig} */
22
module.exports = {
33
ignoredRouteFiles: ['**/.*'],
4+
serverModuleFormat: 'cjs',
45
// appDirectory: "app",
56
// assetsBuildDirectory: "public/build",
67
// serverBuildPath: "build/index.js",

apps/vite-lit/package.json

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,9 @@
1414
],
1515
"scripts": {
1616
"dev": "vite",
17-
"_build": "tsc && vite build",
17+
"build": "tsc && vite build",
18+
"_build": "pnpm run build",
19+
"preview": "vite preview",
1820
"prepare": "tw-patch install",
1921
"tw-extract": "tw-patch extract"
2022
},

apps/vite-lit/src/my-element.ts

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -100,10 +100,6 @@ export class MyElement extends LitElement {
100100
`
101101
}
102102

103-
private _onClick() {
104-
this.count++
105-
}
106-
107103
static styles = css`
108104
:host {
109105
max-width: 1280px;

apps/vite-lit/tsconfig.json

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
"module": "ESNext",
77
"moduleResolution": "Node",
88
"strict": true,
9+
"rootDir": "./src",
910
"noFallthroughCasesInSwitch": true,
1011
"noImplicitReturns": true,
1112
"noUnusedLocals": true,
@@ -16,7 +17,8 @@
1617
"allowSyntheticDefaultImports": true,
1718
"forceConsistentCasingInFileNames": true,
1819
"isolatedModules": true,
19-
"skipLibCheck": true
20+
"skipLibCheck": true,
21+
"ignoreDeprecations": "6.0"
2022
},
2123
"references": [{ "path": "./tsconfig.node.json" }],
2224
"include": ["src/**/*.ts"]

apps/vite-lit/tsconfig.node.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
"compilerOptions": {
33
"composite": true,
44
"module": "ESNext",
5-
"moduleResolution": "Node",
5+
"moduleResolution": "Bundler",
66
"allowSyntheticDefaultImports": true
77
},
88
"include": ["vite.config.ts"]

apps/vite-lit/vite.config.ts

Lines changed: 7 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -2,14 +2,11 @@ import utwm from 'unplugin-tailwindcss-mangle/vite'
22
import { defineConfig } from 'vite'
33
// https://vitejs.dev/config/
44
export default defineConfig({
5-
build: {
6-
lib: {
7-
entry: 'src/my-element.ts',
8-
formats: ['es'],
9-
},
10-
rollupOptions: {
11-
external: /^lit/,
12-
},
13-
},
14-
plugins: [utwm()],
5+
plugins: [
6+
utwm({
7+
registry: {
8+
mapping: true,
9+
},
10+
}),
11+
],
1512
})

0 commit comments

Comments
 (0)