Skip to content

Commit

Permalink
refactor: upgrade to rsbuild 1.0
Browse files Browse the repository at this point in the history
  • Loading branch information
tmkx committed Aug 10, 2024
1 parent 50a96ac commit fa4d1e8
Show file tree
Hide file tree
Showing 102 changed files with 3,842 additions and 3,633 deletions.
13 changes: 13 additions & 0 deletions .changeset/beige-actors-cough.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
---
"@webx-kit/modernjs-plugin": patch
"@webx-kit/rsbuild-plugin": patch
"@webx-kit/chrome-types": patch
"@webx-kit/core-plugin": patch
"create-webx": patch
"@webx-kit/test-utils": patch
"@webx-kit/messaging": patch
"@webx-kit/runtime": patch
"@webx-kit/storage": patch
---

upgrade to rsbuild 1.0
3 changes: 2 additions & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ jobs:
runs-on: ${{ matrix.os }}
env:
NX_REJECT_UNKNOWN_LOCAL_CACHE: '0'
NX_SKIP_NX_CACHE: ${{ vars.NX_SKIP_NX_CACHE }}

steps:
- uses: actions/checkout@v4
Expand Down Expand Up @@ -56,7 +57,7 @@ jobs:
- name: Install deps
run: |
pnpm i --frozen-lockfile
pnpm playwright install chromium
pnpm playwright install chromium --with-deps
- if: ${{ matrix.os == 'ubuntu-latest' }}
name: Replace with tarball
Expand Down
24 changes: 12 additions & 12 deletions apps/ai-assistant/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,32 +7,32 @@
"lint:type": "tsc --noEmit"
},
"dependencies": {
"@google/generative-ai": "^0.14.1",
"@trpc/client": "11.0.0-rc.461",
"@trpc/server": "11.0.0-rc.461",
"@google/generative-ai": "^0.16.0",
"@trpc/client": "11.0.0-rc.477",
"@trpc/server": "11.0.0-rc.477",
"@webx-kit/messaging": "workspace:^",
"@webx-kit/runtime": "workspace:^",
"@webx-kit/storage": "workspace:^",
"clsx": "^2.1.1",
"jotai": "^2.9.0",
"lucide-react": "^0.408.0",
"jotai": "^2.9.2",
"lucide-react": "^0.427.0",
"react": "^18.3.1",
"react-aria-components": "^1.2.1",
"react-aria-components": "^1.3.1",
"react-dom": "^18.3.1",
"zod": "^3.23.8"
},
"devDependencies": {
"@modern-js/app-tools": "^2.55.0",
"@types/chrome": "^0.0.268",
"@types/node": "^20.14.10",
"@modern-js/app-tools": "^2.58.0",
"@types/chrome": "^0.0.269",
"@types/node": "^22.2.0",
"@types/react": "^18.3.3",
"@types/react-dom": "^18.3.0",
"@webx-kit/modernjs-plugin": "workspace:^",
"tailwind-merge": "^2.4.0",
"tailwind-variants": "^0.2.1",
"tailwindcss": "^3.4.4",
"tailwindcss": "^3.4.9",
"tailwindcss-animate": "^1.0.7",
"tailwindcss-react-aria-components": "^1.1.3",
"typescript": "^5.5.3"
"tailwindcss-react-aria-components": "^1.1.4",
"typescript": "^5.5.4"
}
}
30 changes: 15 additions & 15 deletions apps/switchy-pi/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,36 +7,36 @@
"lint:type": "tsc --noEmit"
},
"dependencies": {
"@react-aria/interactions": "^3.21.3",
"@trpc/client": "11.0.0-rc.461",
"@trpc/server": "11.0.0-rc.461",
"@react-aria/interactions": "^3.22.1",
"@trpc/client": "11.0.0-rc.477",
"@trpc/server": "11.0.0-rc.477",
"@webx-kit/messaging": "workspace:^",
"@webx-kit/runtime": "workspace:^",
"@webx-kit/storage": "workspace:^",
"clsx": "^2.1.1",
"jotai": "^2.9.0",
"jotai": "^2.9.2",
"jotai-effect": "^1.0.0",
"lucide-react": "^0.408.0",
"lucide-react": "^0.427.0",
"react": "^18.3.1",
"react-aria": "^3.33.1",
"react-aria-components": "^1.2.1",
"react-aria": "^3.34.1",
"react-aria-components": "^1.3.1",
"react-dom": "^18.3.1",
"react-hook-form": "^7.52.1",
"react-router-dom": "^6.24.1",
"react-hook-form": "^7.52.2",
"react-router-dom": "^6.26.0",
"zod": "^3.23.8"
},
"devDependencies": {
"@modern-js/app-tools": "^2.55.0",
"@types/chrome": "^0.0.268",
"@types/node": "^20.14.10",
"@modern-js/app-tools": "^2.58.0",
"@types/chrome": "^0.0.269",
"@types/node": "^22.2.0",
"@types/react": "^18.3.3",
"@types/react-dom": "^18.3.0",
"@webx-kit/modernjs-plugin": "workspace:^",
"tailwind-merge": "^2.4.0",
"tailwind-variants": "^0.2.1",
"tailwindcss": "^3.4.4",
"tailwindcss": "^3.4.9",
"tailwindcss-animate": "^1.0.7",
"tailwindcss-react-aria-components": "^1.1.3",
"typescript": "^5.5.3"
"tailwindcss-react-aria-components": "^1.1.4",
"typescript": "^5.5.4"
}
}
12 changes: 8 additions & 4 deletions apps/switchy-pi/src/components/table/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -82,13 +82,17 @@ export function Column(props: ColumnProps) {
export function TableHeader<T extends object>(props: TableHeaderProps<T>) {
let { selectionBehavior, selectionMode, allowsDragging } = useTableOptions();

const headerClassnames =
'sticky top-0 z-10 bg-gray-100/60 dark:bg-zinc-700/60 backdrop-blur-md supports-[-moz-appearance:none]:bg-gray-100 dark:supports-[-moz-appearance:none]:bg-zinc-700 forced-colors:bg-[Canvas] rounded-t-lg border-b dark:border-b-zinc-700';
const className = props.className;
return (
<AriaTableHeader
{...props}
className={twMerge(
'sticky top-0 z-10 bg-gray-100/60 dark:bg-zinc-700/60 backdrop-blur-md supports-[-moz-appearance:none]:bg-gray-100 dark:supports-[-moz-appearance:none]:bg-zinc-700 forced-colors:bg-[Canvas] rounded-t-lg border-b dark:border-b-zinc-700',
props.className
)}
className={
typeof className === 'function'
? (values) => twMerge(headerClassnames, className(values))
: twMerge(headerClassnames, className)
}
>
{/* Add extra columns for drag and drop and selection. */}
{allowsDragging && <Column />}
Expand Down
2 changes: 1 addition & 1 deletion docs/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,6 @@
"preview": "vitepress preview"
},
"devDependencies": {
"vitepress": "^1.3.1"
"vitepress": "^1.3.2"
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -19,4 +19,6 @@ release/
output/
log/

modern.config.local.*

.env
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
{
"name": "@webx-kit/example-react-rsbuild",
"name": "@webx-kit/example-react-webpack",
"private": true,
"scripts": {
"dev": "rsbuild dev",
"build": "rsbuild build",
"dev": "modern dev",
"build": "modern build",
"test": "playwright test",
"lint:type": "tsc --noEmit"
},
Expand All @@ -13,17 +13,15 @@
"react-dom": "^18.3.1"
},
"devDependencies": {
"@modern-js/app-tools": "^2.58.0",
"@playwright/test": "^1.45.1",
"@rsbuild/core": "catalog:",
"@rsbuild/plugin-less": "catalog:",
"@rsbuild/plugin-react": "catalog:",
"@types/chrome": "^0.0.268",
"@types/node": "^20.14.10",
"@types/chrome": "^0.0.269",
"@types/node": "^22.2.0",
"@types/react": "^18.3.3",
"@types/react-dom": "^18.3.0",
"@webx-kit/rsbuild-plugin": "workspace:^",
"@webx-kit/modernjs-plugin": "workspace:^",
"@webx-kit/test-utils": "workspace:^",
"tailwindcss": "^3.4.4",
"typescript": "^5.5.3"
"tailwindcss": "^3.4.9",
"typescript": "^5.5.4"
}
}
File renamed without changes.
File renamed without changes
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import { defineManifest } from '@webx-kit/rsbuild-plugin/manifest';
import { defineManifest } from '@webx-kit/modernjs-plugin/manifest';

export default defineManifest(() => ({
manifest_version: 3,
name: 'WebX Kit React Rsbuild Demo',
name: 'WebX Kit React Demo',
version: '0.0.0',
icons: {
512: 'public/logo.png',
Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { getPixelUnitDefaultTheme } from '@webx-kit/rsbuild-plugin/tailwind';
import { getPixelUnitDefaultTheme } from '@webx-kit/modernjs-plugin/tailwind';
import type { Config } from 'tailwindcss';
import plugin from 'tailwindcss/plugin';

Expand Down
File renamed without changes.
2 changes: 0 additions & 2 deletions examples/react/.gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,4 @@ release/
output/
log/

modern.config.local.*

.env
18 changes: 10 additions & 8 deletions examples/react/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@
"name": "@webx-kit/example-react",
"private": true,
"scripts": {
"dev": "modern dev",
"build": "modern build",
"dev": "rsbuild dev",
"build": "rsbuild build",
"test": "playwright test",
"lint:type": "tsc --noEmit"
},
Expand All @@ -13,15 +13,17 @@
"react-dom": "^18.3.1"
},
"devDependencies": {
"@modern-js/app-tools": "^2.55.0",
"@playwright/test": "^1.45.1",
"@types/chrome": "^0.0.268",
"@types/node": "^20.14.10",
"@rsbuild/core": "catalog:",
"@rsbuild/plugin-less": "catalog:",
"@rsbuild/plugin-react": "catalog:",
"@types/chrome": "^0.0.269",
"@types/node": "^22.2.0",
"@types/react": "^18.3.3",
"@types/react-dom": "^18.3.0",
"@webx-kit/modernjs-plugin": "workspace:^",
"@webx-kit/rsbuild-plugin": "workspace:^",
"@webx-kit/test-utils": "workspace:^",
"tailwindcss": "^3.4.4",
"typescript": "^5.5.3"
"tailwindcss": "^3.4.9",
"typescript": "^5.5.4"
}
}
File renamed without changes.
4 changes: 2 additions & 2 deletions examples/react/src/manifest.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import { defineManifest } from '@webx-kit/modernjs-plugin/manifest';
import { defineManifest } from '@webx-kit/rsbuild-plugin/manifest';

export default defineManifest(() => ({
manifest_version: 3,
name: 'WebX Kit React Demo',
name: 'WebX Kit React Rsbuild Demo',
version: '0.0.0',
icons: {
512: 'public/logo.png',
Expand Down
Original file line number Diff line number Diff line change
@@ -1 +1,3 @@
/// <reference types="@rsbuild/core/types" />

declare module '*.svg';
2 changes: 1 addition & 1 deletion examples/react/tailwind.config.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { getPixelUnitDefaultTheme } from '@webx-kit/modernjs-plugin/tailwind';
import { getPixelUnitDefaultTheme } from '@webx-kit/rsbuild-plugin/tailwind';
import type { Config } from 'tailwindcss';
import plugin from 'tailwindcss/plugin';

Expand Down
20 changes: 11 additions & 9 deletions examples/solid/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,24 +2,26 @@
"name": "@webx-kit/example-solid",
"private": true,
"scripts": {
"dev": "modern dev",
"build": "modern build",
"dev": "rsbuild dev",
"build": "rsbuild build",
"test": "playwright test",
"lint:type": "tsc --noEmit"
},
"dependencies": {
"@webx-kit/runtime": "workspace:^",
"solid-js": "^1.8.18"
"solid-js": "^1.8.20"
},
"devDependencies": {
"@modern-js/app-tools": "^2.55.0",
"@playwright/test": "^1.45.1",
"@rsbuild/core": "catalog:",
"@rsbuild/plugin-babel": "catalog:",
"@rsbuild/plugin-less": "catalog:",
"@rsbuild/plugin-solid": "catalog:",
"@types/chrome": "^0.0.268",
"@types/node": "^20.14.10",
"@webx-kit/modernjs-plugin": "workspace:^",
"@types/chrome": "^0.0.269",
"@types/node": "^22.2.0",
"@webx-kit/rsbuild-plugin": "workspace:^",
"@webx-kit/test-utils": "workspace:^",
"tailwindcss": "^3.4.4",
"typescript": "^5.5.3"
"tailwindcss": "^3.4.9",
"typescript": "^5.5.4"
}
}
Original file line number Diff line number Diff line change
@@ -1,11 +1,16 @@
import { appTools, defineConfig } from '@modern-js/app-tools';
import { defineConfig } from '@rsbuild/core';
import { pluginBabel } from '@rsbuild/plugin-babel';
import { pluginLess } from '@rsbuild/plugin-less';
import { pluginSolid } from '@rsbuild/plugin-solid';
import { webxPlugin } from '@webx-kit/modernjs-plugin';
import { webxPlugin } from '@webx-kit/rsbuild-plugin';

// https://modernjs.dev/en/configure/app/usage
export default defineConfig({
plugins: [
appTools(),
pluginBabel({
include: /\.(?:jsx|tsx)$/,
}),
pluginLess(),
pluginSolid(),
webxPlugin({
background: './src/background/index.ts',
contentScripts: {
Expand All @@ -14,9 +19,13 @@ export default defineConfig({
},
}),
],
builderPlugins: [pluginSolid()],
source: {
entry: {
options: './src/pages/options/index.tsx',
popup: './src/pages/popup/index.tsx',
},
},
output: {
disableSvgr: true,
copy: [
{
from: './public',
Expand Down
2 changes: 1 addition & 1 deletion examples/solid/src/manifest.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { defineManifest } from '@webx-kit/modernjs-plugin/manifest';
import { defineManifest } from '@webx-kit/rsbuild-plugin/manifest';

export default defineManifest(() => ({
manifest_version: 3,
Expand Down
2 changes: 0 additions & 2 deletions examples/solid/src/modern-app-env.d.ts

This file was deleted.

3 changes: 3 additions & 0 deletions examples/solid/src/webx-env.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
/// <reference types="@rsbuild/core/types" />

declare module '*.svg';
2 changes: 1 addition & 1 deletion examples/solid/tailwind.config.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { getPixelUnitDefaultTheme } from '@webx-kit/modernjs-plugin/tailwind';
import { getPixelUnitDefaultTheme } from '@webx-kit/rsbuild-plugin/tailwind';
import type { Config } from 'tailwindcss';
import plugin from 'tailwindcss/plugin';

Expand Down
Loading

0 comments on commit fa4d1e8

Please sign in to comment.