From f5df9660d1c4b977ff31adc3e69ccc50896191fa Mon Sep 17 00:00:00 2001 From: paco <34928425+pacocoursey@users.noreply.github.com> Date: Tue, 12 Mar 2024 19:57:33 -0700 Subject: [PATCH] v0.3 (#261) * build setup improvements * fix builds, update deps * update dep * update test workflow * bump actions in e2e * 0.3.0-beta.1 --- .github/workflows/e2e.yml | 8 +- .github/workflows/test.yml | 8 +- examples/example/package.json | 2 +- examples/tailwind/package.json | 2 +- examples/with-app-dir/package.json | 22 +- .../src/components/ThemeToggle.tsx | 4 +- .../__tests__/index.test.tsx | 87 +- .../jest.config.js | 0 next-themes/package.json | 29 + .../next-themes => next-themes}/src/index.tsx | 52 +- .../next-themes => next-themes}/src/types.ts | 6 +- next-themes/tsconfig.json | 20 + .../tsup.config.js | 8 +- package.json | 12 +- packages/next-themes/.babelrc | 23 - packages/next-themes/package.json | 42 - packages/next-themes/tsconfig.json | 29 - pnpm-lock.yaml | 5370 ++++------------- pnpm-workspace.yaml | 2 +- 19 files changed, 1375 insertions(+), 4351 deletions(-) rename {packages/next-themes => next-themes}/__tests__/index.test.tsx (81%) rename {packages/next-themes => next-themes}/jest.config.js (100%) create mode 100644 next-themes/package.json rename {packages/next-themes => next-themes}/src/index.tsx (89%) rename {packages/next-themes => next-themes}/src/types.ts (96%) create mode 100644 next-themes/tsconfig.json rename {packages/next-themes => next-themes}/tsup.config.js (70%) delete mode 100644 packages/next-themes/.babelrc delete mode 100644 packages/next-themes/package.json delete mode 100644 packages/next-themes/tsconfig.json diff --git a/.github/workflows/e2e.yml b/.github/workflows/e2e.yml index ec66c26..0d7a63b 100644 --- a/.github/workflows/e2e.yml +++ b/.github/workflows/e2e.yml @@ -8,13 +8,13 @@ jobs: timeout-minutes: 5 runs-on: ubuntu-latest steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 - - uses: pnpm/action-setup@v2 + - uses: pnpm/action-setup@v3 with: version: 8 - - uses: actions/setup-node@v2 + - uses: actions/setup-node@v3 with: node-version: 18.x cache: 'pnpm' @@ -31,7 +31,7 @@ jobs: - name: Cache Playwright Browsers for Playwright's Version id: cache-playwright-browsers - uses: actions/cache@v3 + uses: actions/cache@v4 with: path: ~/.cache/ms-playwright key: playwright-browsers-${{ env.PLAYWRIGHT_VERSION }} diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 7308ae6..eddb9dd 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -7,15 +7,15 @@ jobs: name: Run Unit Tests runs-on: ubuntu-latest steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 - - uses: pnpm/action-setup@v2 + - uses: pnpm/action-setup@v3 with: version: 8 - - uses: actions/setup-node@v3 + - uses: actions/setup-node@v4 with: - node-version: 18.x + node-version: 20.x cache: 'pnpm' - run: pnpm install diff --git a/examples/example/package.json b/examples/example/package.json index 10f47c5..19b4337 100644 --- a/examples/example/package.json +++ b/examples/example/package.json @@ -7,7 +7,7 @@ "start": "next start" }, "dependencies": { - "next": "12.2.2", + "next": "^13.4.19", "next-themes": "workspace:*", "react": "18.2.0", "react-dom": "18.2.0" diff --git a/examples/tailwind/package.json b/examples/tailwind/package.json index 6204afc..1b532c9 100644 --- a/examples/tailwind/package.json +++ b/examples/tailwind/package.json @@ -7,7 +7,7 @@ "start": "next start" }, "dependencies": { - "next": "12.2.2", + "next": "^13.4.19", "next-themes": "workspace:*", "react": "18.2.0", "react-dom": "18.2.0" diff --git a/examples/with-app-dir/package.json b/examples/with-app-dir/package.json index 67428f0..95ea513 100644 --- a/examples/with-app-dir/package.json +++ b/examples/with-app-dir/package.json @@ -1,24 +1,20 @@ { "name": "with-app-dir", - "version": "0.1.0", - "private": true, + "version": "1.0.0", "scripts": { "dev": "next dev", "build": "next build", - "start": "next start", - "lint": "next lint" + "start": "next start" }, "dependencies": { - "@types/node": "20.5.7", - "@types/react": "^18.2.21", - "@types/react-dom": "18.2.7", - "autoprefixer": "10.4.15", "next": "^13.4.19", "next-themes": "workspace:*", - "postcss": "8.4.28", "react": "18.2.0", - "react-dom": "18.2.0", - "tailwindcss": "3.3.3", - "typescript": "^5.2.2" + "react-dom": "18.2.0" + }, + "devDependencies": { + "autoprefixer": "10.4.15", + "postcss": "8.4.28", + "tailwindcss": "3.3.3" } -} \ No newline at end of file +} diff --git a/examples/with-app-dir/src/components/ThemeToggle.tsx b/examples/with-app-dir/src/components/ThemeToggle.tsx index a177d49..37a103f 100644 --- a/examples/with-app-dir/src/components/ThemeToggle.tsx +++ b/examples/with-app-dir/src/components/ThemeToggle.tsx @@ -3,13 +3,13 @@ import { useTheme } from 'next-themes' function ThemeToggle() { - const { theme, setTheme } = useTheme() + const { theme, resolvedTheme, setTheme } = useTheme() return (