diff --git a/.github/ISSUE_TEMPLATE/bug_report.md b/.github/ISSUE_TEMPLATE/bug_report.md index e72f59b..776ba27 100644 --- a/.github/ISSUE_TEMPLATE/bug_report.md +++ b/.github/ISSUE_TEMPLATE/bug_report.md @@ -38,7 +38,7 @@ What actually happened. - **OS:** [e.g. macOS 14.5] - **Browser / Runtime:** [e.g. Chrome 125, Node 18.18.2] -- **Package Version:** [`@austinserb/react-zero-ui@1.0.21`] +- **Package Version:** [`@react-zero-ui/core@1.0.21`] --- diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 338bc05..6713304 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -55,7 +55,7 @@ jobs: - name: Install Playwright browsers (if cache miss) if: steps.pw-cache.outputs.cache-hit != 'true' - run: pnpm --filter @austinserb/react-zero-ui exec playwright install --with-deps + run: pnpm --filter @react-zero-ui/core exec playwright install --with-deps - name: Save Playwright cache if: steps.pw-cache.outputs.cache-hit != 'true' diff --git a/.release-please-manifest.json b/.release-please-manifest.json index cb93513..44be411 100644 --- a/.release-please-manifest.json +++ b/.release-please-manifest.json @@ -1,6 +1,6 @@ { "packages": { - "packages/core": { "package-name": "@austinserb/react-zero-ui", "release-type": "node" }, + "packages/core": { "package-name": "@react-zero-ui/core", "release-type": "node" }, "packages/cli": { "package-name": "create-zero-ui", "release-type": "node" } }, "monorepo-tags": true, diff --git a/AGENTS.md b/AGENTS.md index 9c1a7f3..7da2c6d 100644 --- a/AGENTS.md +++ b/AGENTS.md @@ -37,7 +37,6 @@ const [staleValue, setValue] = useUI<'open' | 'closed'>('sidebar', 'closed'); - ✅ Do **NOT** use the first value from `useUI()` for logic — it DOES NOT UPDATE. - ✅ You can call setters **from anywhere** in the app — no prop drilling or context needed. - ✅ Tailwind classes must use `key-value:` pattern: - - `theme-dark:bg-black` - `accent-blue:text-blue-500` - `sidebar-open:translate-x-0` diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index f10b9fc..33f2ce3 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -23,7 +23,7 @@ Stay **pre-rendered, declarative, and brutally fast.** ``` packages/ -├── core → @austinserb/react-zero-ui (library logic + postcss) +├── core → @react-zero-ui/core (library logic + postcss) └── cli → create-zero-ui (npx installer) ``` @@ -43,11 +43,11 @@ pnpm test # runs all tests (unit + E2E) ## ✅ Contribution Flow -### 1. [Start a Discussion](https://github.com/Austin1serb/React-Zero-UI/discussions) +### 1. [Start a Discussion](https://github.com/react-zero-ui/core/discussions) For questions, proposals, or early feedback. Share ideas before building. -### 2. [Open an Issue](https://github.com/Austin1serb/React-Zero-UI/issues) +### 2. [Open an Issue](https://github.com/react-zero-ui/core/issues) Use the templates. diff --git a/README.md b/README.md index 46a14f1..d1fe727 100644 --- a/README.md +++ b/README.md @@ -4,14 +4,14 @@ Pre‑render your UI once, flip a `data-*` attribute to update — that's it. -npm version npm version License: MIT ![CI](https://github.com/austin1serb/react-zero-ui/actions/workflows/ci.yml/badge.svg?branch=main) +npm version npm version License: MIT ![CI](https://github.com/react-zero-ui/core/actions/workflows/ci.yml/badge.svg?branch=main) --- ## 📚 Quick Links - [⚡️ Quick Start](#️-quick-start) -- [🏄‍♂️ Usage](#-usage) +- [🏄 Usage](#-usage) - [🧬 How it works](#-how-it-works) - [✅ Features](#-features) - [🏗 Best Practices](#-best-practices) @@ -20,11 +20,11 @@ Pre‑render your UI once, flip a `data-*` attribute to update — that's it. ## 🚀 Live Demo -| Example | Link | What it shows | Link to Code | -| --------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------- | -| Interactive menu with render tracker | Main Demo↗ | Compare Zero‑UI vs. React side‑by‑side while toggling a menu. | Github | -| React benchmark (10 000 nested nodes) | React 10k↗ | How long the traditional React render path takes. | Github | -| Zero‑UI benchmark (10 000 nested nodes) | Zero‑UI 10k↗ | Identical DOM, but powered by Zero‑UI's `data-*` switch. | Github | +| Example | Link | What it shows | Link to Code | +| --------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------- | +| Interactive menu with render tracker | Main Demo↗ | Compare Zero‑UI vs. React side‑by‑side while toggling a menu. | Github | +| React benchmark (10 000 nested nodes) | React 10k↗ | How long the traditional React render path takes. | Github | +| Zero‑UI benchmark (10 000 nested nodes) | Zero‑UI 10k↗ | Identical DOM, but powered by Zero‑UI's `data-*` switch. | Github | --- @@ -114,7 +114,7 @@ export default { --- -## 🏄‍♂️ Usage +## 🏄 Usage ![react zero ui usage explained](docs/assets/useui-explained.webp) diff --git a/examples/demo/package.json b/examples/demo/package.json index f644810..51a6cd5 100644 --- a/examples/demo/package.json +++ b/examples/demo/package.json @@ -15,7 +15,7 @@ "clean": "rm -rf .next" }, "dependencies": { - "@austinserb/react-zero-ui": "^1.0.21", + "@react-zero-ui/core": "^0.1.0", "@vercel/analytics": "^1.5.0", "clsx": "^2.1.1", "motion": "^12.16.0", diff --git a/examples/demo/postcss.config.mjs b/examples/demo/postcss.config.mjs index 2e0aa24..646f33b 100644 --- a/examples/demo/postcss.config.mjs +++ b/examples/demo/postcss.config.mjs @@ -1,5 +1,5 @@ // postcss.config.mjs -const config = { plugins: ['@austinserb/react-zero-ui/postcss', '@tailwindcss/postcss'] }; +const config = { plugins: ['@react-zero-ui/core/postcss', '@tailwindcss/postcss'] }; export default config; diff --git a/examples/demo/src/app/(test)/ZeroState.tsx b/examples/demo/src/app/(test)/ZeroState.tsx index f2ab007..6b3ca2e 100644 --- a/examples/demo/src/app/(test)/ZeroState.tsx +++ b/examples/demo/src/app/(test)/ZeroState.tsx @@ -1,6 +1,6 @@ 'use client'; -import useUI from '@austinserb/react-zero-ui'; +import useUI from '@react-zero-ui/core'; import { useRenderTracker } from './ReactTracker'; export function TestComponentZero() { diff --git a/examples/demo/src/app/(test)/page.tsx b/examples/demo/src/app/(test)/page.tsx index 03cea52..bb91f00 100644 --- a/examples/demo/src/app/(test)/page.tsx +++ b/examples/demo/src/app/(test)/page.tsx @@ -3,7 +3,7 @@ import { Icon } from '@/app/components/Icon'; import { TestComponentWithState } from './ReactState'; import { TestComponentZero } from './ZeroState'; -import { useUI } from '@austinserb/react-zero-ui'; +import { useUI } from '@react-zero-ui/core'; export default function Page() { const [, setActive] = useUI<'react' | 'zero'>('active', 'zero'); diff --git a/examples/demo/src/app/components/MobileMenu.tsx b/examples/demo/src/app/components/MobileMenu.tsx index 808fc13..3034bbd 100644 --- a/examples/demo/src/app/components/MobileMenu.tsx +++ b/examples/demo/src/app/components/MobileMenu.tsx @@ -1,5 +1,5 @@ 'use client'; -import useUI from '@austinserb/react-zero-ui'; +import useUI from '@react-zero-ui/core'; import clsx from 'clsx'; import Link from 'next/link'; diff --git a/examples/demo/src/app/components/MobileMenuButton.tsx b/examples/demo/src/app/components/MobileMenuButton.tsx index 0c004cc..99d99ac 100644 --- a/examples/demo/src/app/components/MobileMenuButton.tsx +++ b/examples/demo/src/app/components/MobileMenuButton.tsx @@ -3,7 +3,7 @@ import clsx from 'clsx'; import { useMotionValueEvent } from 'motion/react'; import { useScroll } from 'motion/react'; -import useUI from '@austinserb/react-zero-ui'; +import useUI from '@react-zero-ui/core'; import { useIsMobile } from '@/hooks/useIsMobile'; import { DotMenuIcon } from './DotMenuIcon'; diff --git a/examples/demo/src/app/components/TopBar.tsx b/examples/demo/src/app/components/TopBar.tsx index 16bae8e..d1ccfa5 100644 --- a/examples/demo/src/app/components/TopBar.tsx +++ b/examples/demo/src/app/components/TopBar.tsx @@ -45,7 +45,7 @@ export const TopBarV2: React.FC = () => { ))}
  • ` to drive the UI instantly 👉 Live Demo: [https://react-zero-ui.vercel.app](https://react-zero-ui.vercel.app) -👉 Package: [https://www.npmjs.com/package/@austinserb/react-zero-ui](https://www.npmjs.com/package/@austinserb/react-zero-ui) +👉 Package: [https://www.npmjs.com/package/@react-zero-ui/core](https://www.npmjs.com/package/@react-zero-ui/core) --- @@ -52,11 +52,11 @@ That's it — you'll get: Powered by: ```json -"@austinserb/react-zero-ui": "^1.0.21" +"@react-zero-ui/core": "^1.0.21" ``` Full docs and live benchmarks: -👉 [https://github.com/austin1serb/react-zero-ui](https://github.com/austin1serb/react-zero-ui) +👉 [https://github.com/react-zero-ui/core](https://github.com/react-zero-ui/core) --- @@ -64,7 +64,7 @@ Full docs and live benchmarks: ## 🏄‍♂️ Usage -![react zero ui usage explained](https://raw.githubusercontent.com/Austin1serb/React-Zero-UI/main/docs/assets/useui-explained.webp) +![react zero ui usage explained](https://raw.githubusercontent.com/react-zero-ui/core/main/docs/assets/useui-explained.webp) --- diff --git a/packages/cli/bin.js b/packages/cli/bin.js index d030542..50d806c 100755 --- a/packages/cli/bin.js +++ b/packages/cli/bin.js @@ -15,13 +15,14 @@ const exec = (cmd, args) => spawnSync(pm, [cmd, ...args], { cwd: target, stdio: if (!existsSync(resolve(target, 'package.json'))) exec('init', ['-y']); /* 2️⃣ runtime dependency */ -exec(pm === 'yarn' ? 'add' : 'install', ['@austinserb/react-zero-ui']); +exec(pm === 'yarn' ? 'add' : 'install', ['@react-zero-ui/core']); /* 3️⃣ dev deps */ +// TODO figure out if we can do it without tailwindcss and only the postcss plugin exec(pm === 'yarn' ? 'add' : 'install', ['postcss', 'tailwindcss', '@tailwindcss/postcss', '--save-dev']); /* 4️⃣ handoff */ -const { default: zeroUiCli } = await import('@austinserb/react-zero-ui/cli'); +const { default: zeroUiCli } = await import('@react-zero-ui/core/cli'); if (typeof zeroUiCli === 'function') { zeroUiCli(process.argv.slice(3)); console.log(`\n🎉 Zero-UI installed. Run \`${pm} run dev\`!\n`); diff --git a/packages/cli/package.json b/packages/cli/package.json index 93450b1..f0e89ff 100644 --- a/packages/cli/package.json +++ b/packages/cli/package.json @@ -1,6 +1,6 @@ { "name": "create-zero-ui", - "version": "1.0.6", + "version": "1.0.7", "type": "module", "main": "./bin.js", "bin": { @@ -16,7 +16,7 @@ "LICENSE" ], "dependencies": { - "@austinserb/react-zero-ui": "^1.0.21", + "@react-zero-ui/core": "^0.1.0", "postcss": "^8.4.27", "tailwindcss": "^4.0.0", "@tailwindcss/postcss": "^4.1.8" diff --git a/packages/core/README.md b/packages/core/README.md index 65859b6..c507db1 100644 --- a/packages/core/README.md +++ b/packages/core/README.md @@ -4,7 +4,7 @@ Pre‑render your UI once, flip a `data-*` attribute to update — that's it. -npm version npm version License: MIT ![CI](https://github.com/austin1serb/react-zero-ui/actions/workflows/ci.yml/badge.svg?branch=main) +npm version npm version License: MIT ![CI](https://github.com/react-zero-ui/core/actions/workflows/ci.yml/badge.svg?branch=main) --- @@ -20,11 +20,11 @@ Pre‑render your UI once, flip a `data-*` attribute to update — that's it. ## 🚀 Live Demo -| Example | Link | What it shows | Link to Code | -| --------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------- | -| Interactive menu with render tracker | Main Demo↗ | Compare Zero‑UI vs. React side‑by‑side while toggling a menu. | Github | -| React benchmark (10 000 nested nodes) | React 10k↗ | How long the traditional React render path takes. | Github | -| Zero‑UI benchmark (10 000 nested nodes) | Zero‑UI 10k↗ | Identical DOM, but powered by Zero‑UI's `data-*` switch. | Github | +| Example | Link | What it shows | Link to Code | +| --------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------- | +| Interactive menu with render tracker | Main Demo↗ | Compare Zero‑UI vs. React side‑by‑side while toggling a menu. | Github | +| React benchmark (10 000 nested nodes) | React 10k↗ | How long the traditional React render path takes. | Github | +| Zero‑UI benchmark (10 000 nested nodes) | Zero‑UI 10k↗ | Identical DOM, but powered by Zero‑UI's `data-*` switch. | Github | --- @@ -66,7 +66,7 @@ That's it — the CLI patch‑installs the required Babel & PostCSS plugins and ### Manual Install ```bash -npm install @austinserb/react-zero-ui +npm install @react-zero-ui/core ``` Then follow **Setup →** for your bundler. @@ -79,7 +79,7 @@ Then follow **Setup →** for your bundler. ```js // vite.config.* -import { zeroUIPlugin } from '@austinserb/react-zero-ui/vite'; +import { zeroUIPlugin } from '@react-zero-ui/core/vite'; export default { // ❗️Remove the default `tailwindcss()` plugin — Zero‑UI extends it internally @@ -93,7 +93,7 @@ export default { ```tsx // app/layout.tsx - import { bodyAttributes } from '@austinserb/react-zero-ui/attributes'; + import { bodyAttributes } from '@react-zero-ui/core/attributes'; // or: import { bodyAttributes } from '../.zero-ui/attributes'; export default function RootLayout({ children }) { @@ -109,14 +109,14 @@ export default { ```js // postcss.config.js - module.exports = { plugins: { '@austinserb/react-zero-ui/postcss': {}, tailwindcss: {} } }; + module.exports = { plugins: { '@react-zero-ui/core/postcss': {}, tailwindcss: {} } }; ``` --- ## 🏄‍♂️ Usage -![react zero ui usage explained](https://raw.githubusercontent.com/Austin1serb/React-Zero-UI/main/docs/assets/useui-explained.webp) +![react zero ui usage explained](https://raw.githubusercontent.com/react-zero-ui/core/main/docs/assets/useui-explained.webp) --- diff --git a/packages/core/__tests__/e2e/cli-next.spec.js b/packages/core/__tests__/e2e/cli-next.spec.js index f2a6103..e7af76d 100644 --- a/packages/core/__tests__/e2e/cli-next.spec.js +++ b/packages/core/__tests__/e2e/cli-next.spec.js @@ -27,7 +27,8 @@ test('Next CLI scaffolds .zero-ui + tsconfig + postcss', async () => { await expect .poll(() => { if (!existsSync(post)) return false; - return readFileSync(post, 'utf8').includes('@austinserb/react-zero-ui/postcss'); + return readFileSync(post, 'utf8').includes('@react-zero-ui/core/postcss'); }) .toBeTruthy(); + console.log('[Next CLI] Next CLI completed'); }); diff --git a/packages/core/__tests__/e2e/cli-vite.spec.js b/packages/core/__tests__/e2e/cli-vite.spec.js index 54320ea..d6f5303 100644 --- a/packages/core/__tests__/e2e/cli-vite.spec.js +++ b/packages/core/__tests__/e2e/cli-vite.spec.js @@ -22,8 +22,8 @@ test('Vite CLI scaffolds .zero-ui + vite.config', async () => { .poll(() => { if (!existsSync(vite)) return false; const src = readFileSync(vite, 'utf8'); - return /from ['"]@austinserb\/react-zero-ui\/vite['"]/.test(src) && /\bplugins:\s*\[.*zeroUI\(\).*]/s.test(src); + return /from ['"]@react-zero-ui\/core\/vite['"]/.test(src) && /\bplugins:\s*\[.*zeroUI\(\).*]/s.test(src); }) .toBeTruthy(); - console.log('[Vite CLI] vite', vite); + console.log('[Vite CLI] vite CLI completed'); }); diff --git a/packages/core/__tests__/fixtures/next/app/page.tsx b/packages/core/__tests__/fixtures/next/app/page.tsx index d9b5f61..64f0332 100644 --- a/packages/core/__tests__/fixtures/next/app/page.tsx +++ b/packages/core/__tests__/fixtures/next/app/page.tsx @@ -1,6 +1,6 @@ 'use client'; -import useUI from '@austinserb/react-zero-ui'; +import useUI from '@react-zero-ui/core'; import { useEffect, useState } from 'react'; // Component that automatically cycles through themes using useEffect diff --git a/packages/core/__tests__/fixtures/next/postcss.config.mjs b/packages/core/__tests__/fixtures/next/postcss.config.mjs index 1e85909..35c0d77 100644 --- a/packages/core/__tests__/fixtures/next/postcss.config.mjs +++ b/packages/core/__tests__/fixtures/next/postcss.config.mjs @@ -1,5 +1,5 @@ // postcss.config.mjs const config = { - plugins: ["@austinserb/react-zero-ui/postcss", '@tailwindcss/postcss'] + plugins: ["@react-zero-ui/core/postcss", '@tailwindcss/postcss'] }; export default config; \ No newline at end of file diff --git a/packages/core/__tests__/fixtures/vite/src/App.tsx b/packages/core/__tests__/fixtures/vite/src/App.tsx index bc485e9..94491ee 100644 --- a/packages/core/__tests__/fixtures/vite/src/App.tsx +++ b/packages/core/__tests__/fixtures/vite/src/App.tsx @@ -1,5 +1,5 @@ 'use client'; -import useUI from '@austinserb/react-zero-ui'; +import useUI from '@react-zero-ui/core'; import './App.css'; const App: React.FC = () => { diff --git a/packages/core/__tests__/fixtures/vite/vite.config.ts b/packages/core/__tests__/fixtures/vite/vite.config.ts index d364ac0..3b300ec 100644 --- a/packages/core/__tests__/fixtures/vite/vite.config.ts +++ b/packages/core/__tests__/fixtures/vite/vite.config.ts @@ -1,4 +1,4 @@ -import zeroUI from "@austinserb/react-zero-ui/vite"; +import zeroUI from "@react-zero-ui/core/vite"; import { defineConfig } from 'vite'; import react from '@vitejs/plugin-react'; diff --git a/packages/core/__tests__/unit/cli.test.cjs b/packages/core/__tests__/unit/cli.test.cjs index e9b3b6c..57a862e 100644 --- a/packages/core/__tests__/unit/cli.test.cjs +++ b/packages/core/__tests__/unit/cli.test.cjs @@ -164,9 +164,9 @@ test('CLI script installs correct dependencies', async () => { const pkg = JSON.parse(fs.readFileSync('package.json', 'utf-8')); // Handle production dependency - if (process.argv.slice(2).includes('@austinserb/react-zero-ui') && !process.argv.slice(2).includes('--save-dev')) { + if (process.argv.slice(2).includes('@react-zero-ui/core') && !process.argv.slice(2).includes('--save-dev')) { if (!pkg.dependencies) pkg.dependencies = {}; - pkg.dependencies['@austinserb/react-zero-ui'] = '^1.0.0'; + pkg.dependencies['@react-zero-ui/core'] = '^1.0.0'; } // Handle dev dependencies @@ -204,7 +204,7 @@ test('CLI script installs correct dependencies', async () => { console.log('NPM calls:', npmCalls); assert(npmCalls.includes('install'), 'npm install should be called'); - assert(npmCalls.includes('@austinserb/react-zero-ui'), 'Should install react-zero-ui'); + assert(npmCalls.includes('@react-zero-ui/core'), 'Should install react-zero-ui'); assert(npmCalls.includes('tailwindcss'), 'Should install tailwindcss'); assert(npmCalls.includes('postcss'), 'Should install postcss'); assert(npmCalls.includes('@tailwindcss/postcss'), 'Should install @tailwindcss/postcss'); @@ -214,7 +214,7 @@ test('CLI script installs correct dependencies', async () => { const finalPackageJson = JSON.parse(fs.readFileSync(path.join(testDir, 'package.json'), 'utf-8')); // Updated assertion - react-zero-ui should be in dependencies (production), not devDependencies - assert(finalPackageJson.dependencies['@austinserb/react-zero-ui'], 'react-zero-ui should be in dependencies'); + assert(finalPackageJson.dependencies['@react-zero-ui/core'], 'react-zero-ui should be in dependencies'); assert(finalPackageJson.devDependencies['tailwindcss'], 'tailwindcss should be in devDependencies'); assert(finalPackageJson.devDependencies['postcss'], 'postcss should be in devDependencies'); assert(finalPackageJson.devDependencies['@tailwindcss/postcss'], '@tailwindcss/postcss should be in devDependencies'); @@ -300,7 +300,7 @@ test('CLI script imports and executes library CLI', async () => { // Create package.json for the mock module const mockPackageJson = { - name: '@austinserb/react-zero-ui', + name: '@react-zero-ui/core', main: 'index.js', exports: { './cli': { types: './cli.d.ts', require: './cli.cjs', import: './cli.cjs' } }, }; @@ -346,7 +346,7 @@ test('Library CLI initializes project correctly', async () => { fs.mkdirSync(componentDir, { recursive: true }); const testComponent = ` -import { useUI } from '@austinserb/react-zero-ui'; +import { useUI } from '@react-zero-ui/core'; export function TestComponent() { const [count, setCount] = useUI(0); @@ -576,7 +576,7 @@ test('CLI script returns appropriate exit codes', async () => { fs.writeFileSync(path.join(nodeModulesDir, 'cli.cjs'), mockCLI); - const mockPackageJson = { name: '@austinserb/react-zero-ui', exports: { './cli': { require: './cli.cjs', import: './cli.cjs' } } }; + const mockPackageJson = { name: '@react-zero-ui/core', exports: { './cli': { require: './cli.cjs', import: './cli.cjs' } } }; fs.writeFileSync(path.join(nodeModulesDir, 'package.json'), JSON.stringify(mockPackageJson)); const originalPath = process.env.PATH; @@ -631,7 +631,7 @@ test('Library CLI processes useUI hooks correctly', async () => { fs.mkdirSync(componentsDir, { recursive: true }); const component1 = ` -import { useUI } from '@austinserb/react-zero-ui'; +import { useUI } from '@react-zero-ui/core'; export function Counter() { const [count, setCount] = useUI(0); @@ -649,7 +649,7 @@ export function Counter() { `; const component2 = ` -import { useUI } from '@austinserb/react-zero-ui'; +import { useUI } from '@react-zero-ui/core'; export function Toggle() { const [isOpen, setIsOpen] = useUI(false); diff --git a/packages/core/__tests__/unit/index.test.cjs b/packages/core/__tests__/unit/index.test.cjs index e1690f7..efeb47c 100644 --- a/packages/core/__tests__/unit/index.test.cjs +++ b/packages/core/__tests__/unit/index.test.cjs @@ -835,7 +835,7 @@ test('PostCSS config - creates new .js config for Next.js project', async () => console.log('\n📄 Generated PostCSS config:'); console.log(configContent); - assert(configContent.includes('@austinserb/react-zero-ui/postcss'), 'Should include Zero-UI plugin'); + assert(configContent.includes('@react-zero-ui/core/postcss'), 'Should include Zero-UI plugin'); assert(configContent.includes('@tailwindcss/postcss'), 'Should include Tailwind plugin'); assert(configContent.includes('module.exports'), 'Should use CommonJS format'); } finally { @@ -871,7 +871,7 @@ test('PostCSS config - updates existing .js config', async () => { console.log('\n📄 Updated PostCSS config:'); console.log(updatedContent); - assert(updatedContent.includes('@austinserb/react-zero-ui/postcss'), 'Should add Zero-UI plugin'); + assert(updatedContent.includes('@react-zero-ui/core/postcss'), 'Should add Zero-UI plugin'); assert(updatedContent.includes('autoprefixer'), 'Should preserve existing plugins'); assert(updatedContent.includes('@tailwindcss/postcss'), 'Should preserve Tailwind'); } finally { @@ -909,7 +909,7 @@ export default config;`; console.log('\n📄 Updated .mjs PostCSS config:'); console.log(updatedContent); - assert(updatedContent.includes('@austinserb/react-zero-ui/postcss'), 'Should add Zero-UI plugin'); + assert(updatedContent.includes('@react-zero-ui/core/postcss'), 'Should add Zero-UI plugin'); assert(updatedContent.includes('export default'), 'Should preserve ES module format'); assert(updatedContent.includes('autoprefixer'), 'Should preserve existing plugins'); } finally { @@ -931,7 +931,7 @@ test('PostCSS config - skips if Zero-UI already configured', async () => { // Create PostCSS config with Zero-UI already configured const existingConfig = `module.exports = { plugins: { - '@austinserb/react-zero-ui/postcss': {}, + '@react-zero-ui/core/postcss': {}, '@tailwindcss/postcss': {} } };`; @@ -986,12 +986,12 @@ test('PostCSS config - handles complex existing configs w/comments', async () => console.log('\n📄 Complex config update:'); console.log(updatedContent); - assert(updatedContent.includes('@austinserb/react-zero-ui/postcss'), 'Should add Zero-UI plugin'); + assert(updatedContent.includes('@react-zero-ui/core/postcss'), 'Should add Zero-UI plugin'); assert(updatedContent.includes('postcss-flexbugs-fixes'), 'Should preserve existing plugins'); assert(updatedContent.includes('postcss-preset-env'), 'Should preserve complex plugin configs'); // Verify Zero-UI comes before other plugins - const zeroUiIndex = updatedContent.indexOf('@austinserb/react-zero-ui/postcss'); + const zeroUiIndex = updatedContent.indexOf('@react-zero-ui/core/postcss'); const tailwindIndex = updatedContent.indexOf('@tailwindcss/postcss'); assert(zeroUiIndex < tailwindIndex, 'Zero-UI should come before Tailwind'); } finally { @@ -1044,7 +1044,7 @@ export default config;` const updatedJsContent = fs.readFileSync('postcss.config.js', 'utf-8'); const updatedMjsContent = fs.readFileSync('postcss.config.mjs', 'utf-8'); - assert(updatedJsContent.includes('@austinserb/react-zero-ui/postcss'), 'Should modify .js config'); + assert(updatedJsContent.includes('@react-zero-ui/core/postcss'), 'Should modify .js config'); assert.equal(originalMjsContent, updatedMjsContent, 'Should not modify .mjs config when .js exists'); } finally { process.chdir(originalCwd); @@ -1079,7 +1079,7 @@ export default defineConfig({ console.log('\n📄 Updated Vite config:'); console.log(updatedContent); - assert(updatedContent.includes('@austinserb/react-zero-ui/vite'), 'Should add Zero-UI import'); + assert(updatedContent.includes('@react-zero-ui/core/vite'), 'Should add Zero-UI import'); assert(updatedContent.includes('zeroUI()'), 'Should add zeroUI plugin'); assert(updatedContent.includes('react()'), 'Should preserve existing plugins'); } finally { @@ -1116,7 +1116,7 @@ export default defineConfig({ console.log('\n📄 Vite config with Tailwind replaced:'); console.log(updatedContent); - assert(updatedContent.includes('@austinserb/react-zero-ui/vite'), 'Should add Zero-UI import'); + assert(updatedContent.includes('@react-zero-ui/core/vite'), 'Should add Zero-UI import'); assert(updatedContent.includes('zeroUI()'), 'Should add zeroUI plugin'); assert(!updatedContent.includes('@tailwindcss/vite'), 'Should remove Tailwind import'); assert(!updatedContent.includes('tailwindcss()'), 'Should replace Tailwind plugin'); @@ -1216,7 +1216,7 @@ test('Vite config - skips if zeroUI already configured', async () => { // Create Vite config with zeroUI already configured const existingConfig = `import { defineConfig } from 'vite' import react from '@vitejs/plugin-react' -import zeroUI from '@austinserb/react-zero-ui/vite' +import zeroUI from '@react-zero-ui/core/vite' export default defineConfig({ plugins: [ @@ -1298,7 +1298,7 @@ export default defineConfig({ console.log('\n📄 Complex config update:'); console.log(updatedContent); - assert(updatedContent.includes('@austinserb/react-zero-ui/vite'), 'Should add Zero-UI import'); + assert(updatedContent.includes('@react-zero-ui/core/vite'), 'Should add Zero-UI import'); assert(updatedContent.includes('zeroUI()'), 'Should add zeroUI plugin'); assert(!updatedContent.includes('@tailwindcss/vite'), 'Should remove Tailwind import'); assert(!updatedContent.includes('tailwindcss()'), 'Should replace Tailwind plugin'); @@ -1379,7 +1379,7 @@ export default config`; console.log('\n📄 Variable assignment config:'); console.log(updatedContent); - assert(updatedContent.includes('@austinserb/react-zero-ui/vite'), 'Should add Zero-UI import'); + assert(updatedContent.includes('@react-zero-ui/core/vite'), 'Should add Zero-UI import'); assert(updatedContent.includes('zeroUI()'), 'Should add zeroUI plugin'); assert(!updatedContent.includes('tailwindcss()'), 'Should replace Tailwind plugin'); } finally { @@ -1446,7 +1446,7 @@ export default defineConfig({ const updatedContent = fs.readFileSync('vite.config.ts', 'utf-8'); console.log(updatedContent); - assert(updatedContent.includes('@austinserb/react-zero-ui/vite'), 'Should add Zero-UI import'); + assert(updatedContent.includes('@react-zero-ui/core/vite'), 'Should add Zero-UI import'); assert(updatedContent.includes('zeroUI()'), 'Should add zeroUI plugin'); assert(updatedContent.includes('plugins:'), 'Should add plugins array'); } finally { @@ -1477,7 +1477,7 @@ export default defineConfig({ const updatedContent = fs.readFileSync('vite.config.ts', 'utf-8'); console.log(updatedContent); - assert(updatedContent.includes('@austinserb/react-zero-ui/vite'), 'Should add Zero-UI import'); + assert(updatedContent.includes('@react-zero-ui/core/vite'), 'Should add Zero-UI import'); assert(updatedContent.includes('zeroUI()'), 'Should add zeroUI plugin to empty array'); } finally { process.chdir(originalCwd); diff --git a/packages/core/package.json b/packages/core/package.json index b58dbad..b1ea194 100644 --- a/packages/core/package.json +++ b/packages/core/package.json @@ -1,7 +1,7 @@ { - "name": "@austinserb/react-zero-ui", - "version": "1.0.21", - "description": "Zero re-render UI state management for React", + "name": "@react-zero-ui/core", + "version": "0.1.0", + "description": "Zero re-render, global UI state management for React", "private": false, "type": "module", "main": "./src/index.js", @@ -58,13 +58,13 @@ "license": "MIT", "repository": { "type": "git", - "url": "git+https://github.com/austin1serb/react-zero-ui.git", + "url": "git+https://github.com/react-zero-ui/core.git", "directory": "packages/core" }, "bugs": { - "url": "https://github.com/austin1serb/react-zero-ui/issues" + "url": "https://github.com/react-zero-ui/core/issues" }, - "homepage": "https://github.com/austin1serb/react-zero-ui#readme", + "homepage": "https://github.com/react-zero-ui/core#readme", "engines": { "node": ">=18.0.0" }, diff --git a/packages/core/src/postcss/helpers.cjs b/packages/core/src/postcss/helpers.cjs index bdd8ca7..c4d38da 100644 --- a/packages/core/src/postcss/helpers.cjs +++ b/packages/core/src/postcss/helpers.cjs @@ -247,7 +247,7 @@ async function patchPostcssConfig() { isESModule = true; } - const zeroUiPlugin = '@austinserb/react-zero-ui/postcss'; + const zeroUiPlugin = '@react-zero-ui/core/postcss'; let createMjs = false; @@ -294,7 +294,7 @@ export default { } else if (updatedConfig === null) { const configFileName = path.basename(postcssConfigPath); console.log(`[Zero-UI] PostCSS config exists but missing Zero-UI plugin.`); - console.warn(`[Zero-UI] Please manually add "@austinserb/react-zero-ui/postcss" before Tailwind in your ${configFileName}`); + console.warn(`[Zero-UI] Please manually add "@react-zero-ui/core/postcss" before Tailwind in your ${configFileName}`); } } @@ -321,7 +321,7 @@ async function patchViteConfig() { return; // No Vite config found, skip patching } - const zeroUiPlugin = '@austinserb/react-zero-ui/vite'; + const zeroUiPlugin = '@react-zero-ui/core/vite'; try { // Read existing config diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index b5542c2..8df8a7a 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -19,16 +19,16 @@ importers: version: 11.1.0(eslint@9.29.0(jiti@2.4.2)) prettier: specifier: ^3.5.3 - version: 3.5.3 + version: 3.6.1 release-please: specifier: ^17.0.0 version: 17.1.0 packages/cli: dependencies: - '@austinserb/react-zero-ui': - specifier: ^1.0.21 - version: 1.0.21(@tailwindcss/postcss@4.1.10)(postcss@8.5.6)(react@19.1.0)(tailwindcss@4.1.10) + '@react-zero-ui/core': + specifier: ^0.1.0 + version: 0.1.0(@tailwindcss/postcss@4.1.10)(postcss@8.5.6)(react@19.1.0)(tailwindcss@4.1.10) '@tailwindcss/postcss': specifier: ^4.1.8 version: 4.1.10 @@ -68,7 +68,7 @@ importers: devDependencies: '@playwright/test': specifier: ^1.53.0 - version: 1.53.0 + version: 1.53.1 packages: @@ -80,15 +80,6 @@ packages: resolution: {integrity: sha512-30iZtAPgz+LTIYoeivqYo853f02jBYSd5uGnGpkFV0M3xOt9aN73erkgYAmZU43x4VfqcnLxW9Kpg3R5LC4YYw==} engines: {node: '>=6.0.0'} - '@austinserb/react-zero-ui@1.0.21': - resolution: {integrity: sha512-AHWH6uTn4j2FHF8ewUglX6PEiUAud92UzHsdz7tZ45pBc1+GKmayl0NvraccEIp+dITUHgwS3WYvoWjexp4JXw==} - engines: {node: '>=18.0.0'} - peerDependencies: - '@tailwindcss/postcss': ^4.1.10 - postcss: ^8.5.5 - react: '>=16.8.0' - tailwindcss: ^4.1.10 - '@babel/code-frame@7.27.1': resolution: {integrity: sha512-cjQ7ZlQ0Mv3b47hABuTevyTuYN4i+loJKGeV9flcCgIK37cCXRh+L1bd3iBHlynerhQ7BhCkn2BPbQUL+rGqFg==} engines: {node: '>=6.9.0'} @@ -147,8 +138,8 @@ packages: resolution: {integrity: sha512-qIbV0/JZr7iSDjqAc60IqbLdsj9GDt16xQtWD+B78d/HAlvysGdZZ6rpJHGAc2T0FQx1X6thsSPdnoiGKdNtdg==} engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0} - '@eslint/core@0.15.0': - resolution: {integrity: sha512-b7ePw78tEWWkpgZCDYkbqDOP8dmM6qe+AOC6iuJqlq1R/0ahMAeH3qynpnqKFGkMltrp44ohV4ubGyvLX28tzw==} + '@eslint/core@0.15.1': + resolution: {integrity: sha512-bkOp+iumZCCbt1K1CmWf0R9pM5yKpDv+ZXtvSyQpudrI9kuFLp+bM2WOPXImuD/ceQuaa8f5pj93Y7zyECIGNA==} engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0} '@eslint/eslintrc@3.3.1': @@ -163,8 +154,8 @@ packages: resolution: {integrity: sha512-RBMg5FRL0I0gs51M/guSAj5/e14VQ4tpZnQNWwuDT66P14I43ItmPfIZRhO9fUVIPOAQXU47atlywZ/czoqFPA==} engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0} - '@eslint/plugin-kit@0.3.2': - resolution: {integrity: sha512-4SaFZCNfJqvk/kenHpI8xvN42DMaoycy4PzKc5otHxRswww1kAt82OlBuwRVLofCACCTZEcla2Ydxv8scMXaTg==} + '@eslint/plugin-kit@0.3.3': + resolution: {integrity: sha512-1+WqvgNMhmlAambTvT3KPtCl/Ibr68VldY2XY40SL1CE0ZXiakFR/cbTspaF5HsnpDMvcYYoJHfl4980NBjGag==} engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0} '@google-automations/git-file-utils@3.0.0': @@ -280,11 +271,20 @@ packages: '@octokit/types@13.10.0': resolution: {integrity: sha512-ifLaO34EbbPj0Xgro4G5lP5asESjwHracYJvVaPIyXMuiuXLlhic3S47cBdTb+jfODkTE5YtGCLt3Ay3+J97sA==} - '@playwright/test@1.53.0': - resolution: {integrity: sha512-15hjKreZDcp7t6TL/7jkAo6Df5STZN09jGiv5dbP9A6vMVncXRqE7/B2SncsyOwrkZRBH2i6/TPOL8BVmm3c7w==} + '@playwright/test@1.53.1': + resolution: {integrity: sha512-Z4c23LHV0muZ8hfv4jw6HngPJkbbtZxTkxPNIg7cJcTc9C28N/p2q7g3JZS2SiKBBHJ3uM1dgDye66bB7LEk5w==} engines: {node: '>=18'} hasBin: true + '@react-zero-ui/core@0.1.0': + resolution: {integrity: sha512-ZaFumt9DKsuubhcJHyC6j/JKhF430Q2DYKhetNfgDDYFisLhc2k9Wd+SHuSaxAJjoRmFJlW+jaGzvk0BLtvY6Q==} + engines: {node: '>=18.0.0'} + peerDependencies: + '@tailwindcss/postcss': ^4.1.10 + postcss: ^8.5.5 + react: '>=16.8.0' + tailwindcss: ^4.1.10 + '@tailwindcss/node@4.1.10': resolution: {integrity: sha512-2ACf1znY5fpRBwRhMgj9ZXvb2XZW8qs+oTfotJ2C5xR0/WNL7UHZ7zXl6s+rUqedL1mNi+0O+WQr5awGowS3PQ==} @@ -585,8 +585,8 @@ packages: emoji-regex@8.0.0: resolution: {integrity: sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A==} - enhanced-resolve@5.18.1: - resolution: {integrity: sha512-ZSW3ma5GkcQBIpwZTSRAI8N71Uuwgs93IezB7mf7R60tC8ZbJideoDNKjHn2O9KIlx6rkGTTEk1xUCK2E1Y2Yg==} + enhanced-resolve@5.18.2: + resolution: {integrity: sha512-6Jw4sE1maoRJo3q8MsSIn2onJFbLTOjY9hlx4DZXmOKvLRd1Ok2kXmAGXaafL2+ijsJZ1ClYbl/pmqr9+k4iUQ==} engines: {node: '>=10.13.0'} entities@4.5.0: @@ -1097,13 +1097,13 @@ packages: picocolors@1.1.1: resolution: {integrity: sha512-xceH2snhtb5M9liqDsmEw56le376mTZkEX/jEb/RxNFyegNul7eNslCXP9FDj/Lcu0X8KEyMceP2ntpaHrDEVA==} - playwright-core@1.53.0: - resolution: {integrity: sha512-mGLg8m0pm4+mmtB7M89Xw/GSqoNC+twivl8ITteqvAndachozYe2ZA7srU6uleV1vEdAHYqjq+SV8SNxRRFYBw==} + playwright-core@1.53.1: + resolution: {integrity: sha512-Z46Oq7tLAyT0lGoFx4DOuB1IA9D1TPj0QkYxpPVUnGDqHHvDpCftu1J2hM2PiWsNMoZh8+LQaarAWcDfPBc6zg==} engines: {node: '>=18'} hasBin: true - playwright@1.53.0: - resolution: {integrity: sha512-ghGNnIEYZC4E+YtclRn4/p6oYbdPiASELBIYkBXfaTVKreQUYbMUYQDwS12a8F0/HtIjr/CkGjtwABeFPGcS4Q==} + playwright@1.53.1: + resolution: {integrity: sha512-LJ13YLr/ocweuwxyGf1XNFWIU4M2zUSo149Qbp+A4cpwDjsxRPj7k6H25LBrEHiEwxvRbD8HdwvQmRMSvquhYw==} engines: {node: '>=18'} hasBin: true @@ -1115,8 +1115,8 @@ packages: resolution: {integrity: sha512-vkcDPrRZo1QZLbn5RLGPpg/WmIQ65qoWWhcGKf/b5eplkkarX0m9z8ppCat4mlOqUsWpyNuYgO3VRyrYHSzX5g==} engines: {node: '>= 0.8.0'} - prettier@3.5.3: - resolution: {integrity: sha512-QQtaxnoDJeAkDvDKWCLiwIXkTgRhwYDEQCghU9Z6q03iyek/rxRh/2lC3HB7P8sWT2xC/y5JDctPLBIGzHKbhw==} + prettier@3.6.1: + resolution: {integrity: sha512-5xGWRa90Sp2+x1dQtNpIpeOQpTDBs9cZDmA/qs2vDNN2i18PdapqY7CmBeyLlMuGqXJRIOPaCaVZTLNQRWUH/A==} engines: {node: '>=14'} hasBin: true @@ -1372,19 +1372,6 @@ snapshots: '@jridgewell/gen-mapping': 0.3.8 '@jridgewell/trace-mapping': 0.3.25 - '@austinserb/react-zero-ui@1.0.21(@tailwindcss/postcss@4.1.10)(postcss@8.5.6)(react@19.1.0)(tailwindcss@4.1.10)': - dependencies: - '@babel/generator': 7.27.5 - '@babel/parser': 7.27.5 - '@babel/traverse': 7.27.4 - '@babel/types': 7.27.6 - '@tailwindcss/postcss': 4.1.10 - postcss: 8.5.6 - react: 19.1.0 - tailwindcss: 4.1.10 - transitivePeerDependencies: - - supports-color - '@babel/code-frame@7.27.1': dependencies: '@babel/helper-validator-identifier': 7.27.1 @@ -1456,7 +1443,7 @@ snapshots: dependencies: '@types/json-schema': 7.0.15 - '@eslint/core@0.15.0': + '@eslint/core@0.15.1': dependencies: '@types/json-schema': 7.0.15 @@ -1478,9 +1465,9 @@ snapshots: '@eslint/object-schema@2.1.6': {} - '@eslint/plugin-kit@0.3.2': + '@eslint/plugin-kit@0.3.3': dependencies: - '@eslint/core': 0.15.0 + '@eslint/core': 0.15.1 levn: 0.4.1 '@google-automations/git-file-utils@3.0.0': @@ -1596,14 +1583,27 @@ snapshots: dependencies: '@octokit/openapi-types': 24.2.0 - '@playwright/test@1.53.0': + '@playwright/test@1.53.1': dependencies: - playwright: 1.53.0 + playwright: 1.53.1 + + '@react-zero-ui/core@0.1.0(@tailwindcss/postcss@4.1.10)(postcss@8.5.6)(react@19.1.0)(tailwindcss@4.1.10)': + dependencies: + '@babel/generator': 7.27.5 + '@babel/parser': 7.27.5 + '@babel/traverse': 7.27.4 + '@babel/types': 7.27.6 + '@tailwindcss/postcss': 4.1.10 + postcss: 8.5.6 + react: 19.1.0 + tailwindcss: 4.1.10 + transitivePeerDependencies: + - supports-color '@tailwindcss/node@4.1.10': dependencies: '@ampproject/remapping': 2.3.0 - enhanced-resolve: 5.18.1 + enhanced-resolve: 5.18.2 jiti: 2.4.2 lightningcss: 1.30.1 magic-string: 0.30.17 @@ -1874,7 +1874,7 @@ snapshots: emoji-regex@8.0.0: {} - enhanced-resolve@5.18.1: + enhanced-resolve@5.18.2: dependencies: graceful-fs: 4.2.11 tapable: 2.2.2 @@ -1931,7 +1931,7 @@ snapshots: '@eslint/core': 0.14.0 '@eslint/eslintrc': 3.3.1 '@eslint/js': 9.29.0 - '@eslint/plugin-kit': 0.3.2 + '@eslint/plugin-kit': 0.3.3 '@humanfs/node': 0.16.6 '@humanwhocodes/module-importer': 1.0.1 '@humanwhocodes/retry': 0.4.3 @@ -2357,11 +2357,11 @@ snapshots: picocolors@1.1.1: {} - playwright-core@1.53.0: {} + playwright-core@1.53.1: {} - playwright@1.53.0: + playwright@1.53.1: dependencies: - playwright-core: 1.53.0 + playwright-core: 1.53.1 optionalDependencies: fsevents: 2.3.2 @@ -2373,7 +2373,7 @@ snapshots: prelude-ls@1.2.1: {} - prettier@3.5.3: {} + prettier@3.6.1: {} punycode@2.3.1: {}