Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 8 additions & 14 deletions .release-please-config.json
Original file line number Diff line number Diff line change
@@ -1,15 +1,9 @@
{
"release-type": "node",
"monorepo-tags": true,
"include-component-in-tag": true,
"packages": {
"packages/core": {
"package-name": "@react-zero-ui/core",
"release-type": "node"
},
"packages/cli": {
"package-name": "create-zero-ui",
"release-type": "node"
}
}
}
"release-type": "node",
"monorepo-tags": true,
"include-component-in-tag": true,
"packages": {
"packages/core": { "package-name": "@react-zero-ui/core", "release-type": "node" },
"packages/cli": { "package-name": "create-zero-ui", "release-type": "node" }
}
}
8 changes: 4 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,10 @@ 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 | <a href="https://zero-ui.dev/" target="_blank" rel="noopener noreferrer"><strong>Main Demoβ†—</strong></a> | Compare Zero‑UI vs. React side‑by‑side while toggling a menu. | <a href="https://github.com/react-zero-ui/core/tree/main/examples/demo" target="_blank" rel="noopener noreferrer">Github</a> |
| React benchmark (10 000 nested nodes) | <a href="https://zero-ui.dev/react" target="_blank" rel="noopener noreferrer"><strong>React 10k↗</strong></a> | How long the traditional React render path takes. | <a href="https://github.com/react-zero-ui/core/tree/main/examples/demo/src/app/react" target="_blank" rel="noopener noreferrer">Github</a> |
| Example | Link | What it shows | Link to Code |
| --------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------- |
| Interactive menu with render tracker | <a href="https://zero-ui.dev/" target="_blank" rel="noopener noreferrer"><strong>Main Demoβ†—</strong></a> | Compare Zero‑UI vs. React side‑by‑side while toggling a menu. | <a href="https://github.com/react-zero-ui/core/tree/main/examples/demo" target="_blank" rel="noopener noreferrer">Github</a> |
| React benchmark (10 000 nested nodes) | <a href="https://zero-ui.dev/react" target="_blank" rel="noopener noreferrer"><strong>React 10k↗</strong></a> | How long the traditional React render path takes. | <a href="https://github.com/react-zero-ui/core/tree/main/examples/demo/src/app/react" target="_blank" rel="noopener noreferrer">Github</a> |
| Zero‑UI benchmark (10β€―000 nested nodes) | <a href="https://zero-ui.dev/zero-ui" target="_blank" rel="noopener noreferrer"><strong style="text-align: nowrap;">Zero‑UI 10kβ†—</strong></a> | Identical DOM, but powered by Zero‑UI's `data-*` switch. | <a href="https://github.com/react-zero-ui/core/tree/main/examples/demo/src/app/zero-ui" target="_blank" rel="noopener noreferrer">Github</a> |

---
Expand Down
2 changes: 1 addition & 1 deletion examples/demo/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -33,4 +33,4 @@
"tailwindcss": "^4.1.10",
"typescript": "^5"
}
}
}
3 changes: 3 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,9 @@
"name": "react-zero-ui-monorepo",
"private": true,
"type": "module",
"engines": {
"node": ">=22"
},
"workspaces": [
"packages/*"
],
Expand Down
20 changes: 11 additions & 9 deletions packages/core/__tests__/fixtures/next/app/layout.tsx
Original file line number Diff line number Diff line change
@@ -1,13 +1,15 @@
import { bodyAttributes } from "@zero-ui/attributes";import './globals.css';
import { bodyAttributes } from '@zero-ui/attributes';
import './globals.css';

export default function RootLayout({ children }) {
return (
<html lang="en">
<body {...bodyAttributes}
className="bg-red test-ww this is to test the body tag"
id="88">
return (
<html lang="en">
<body
{...bodyAttributes}
className="bg-red test-ww this is to test the body tag"
id="88">
{children}
</body>
</html>);

}
</html>
);
}
6 changes: 3 additions & 3 deletions packages/core/__tests__/helpers/loadCli.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import path from 'node:path';

export async function loadCliFromFixture(fixtureDir) {
const r = createRequire(path.join(fixtureDir, 'package.json'));
const modulePath = r.resolve('../../../dist/cli/init.cjs'); // get the path
const modulePath = r.resolve('../../../dist/cli/init.js'); // get the path
const mod = r(modulePath); // actually require the module
console.log('[Global Setup] Loaded CLI from fixture:', modulePath);
// Return a wrapper function that changes directory before running CLI
Expand All @@ -13,14 +13,14 @@ export async function loadCliFromFixture(fixtureDir) {
try {
process.chdir(fixtureDir); // Change to fixture directory

// The init.cjs exports a cli function, so call it
// The init.js exports a cli function, so call it

if (typeof mod === 'function') {
return await Promise.resolve(mod(args)); // run the CLI
} else if (typeof mod.default === 'function') {
return await Promise.resolve(mod.default(args)); // run the CLI (ESM default export)
} else {
throw new Error('Could not find CLI function in init.cjs');
throw new Error('Could not find CLI function in init.js');
}
} finally {
process.chdir(originalCwd); // Always restore original directory
Expand Down
2 changes: 1 addition & 1 deletion packages/core/__tests__/helpers/resetProjectState.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
import fs from 'node:fs';
import path from 'node:path';
import { rmSync } from 'node:fs';
import { overwriteFile } from './overwriteFile';
import { overwriteFile } from './overwriteFile.js';

/**
* Reset everything the Zero-UI CLI generates inside a fixture.
Expand Down
243 changes: 0 additions & 243 deletions packages/core/__tests__/unit/ast.test.cjs

This file was deleted.

8 changes: 4 additions & 4 deletions packages/core/__tests__/unit/cli.test.cjs
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ function cleanupTestDir(testDir) {
function runCLIScript(targetDir, timeout = 30000) {
return new Promise((resolve, reject) => {
// Updated path to the correct CLI script location
const binScript = path.resolve(__dirname, '../../../cli/bin.js');
const binScript = path.resolve(__dirname, '../../../cli/bin');

const child = spawn('node', [binScript, '.'], { cwd: targetDir, stdio: ['pipe', 'pipe', 'pipe'] });

Expand Down Expand Up @@ -296,7 +296,7 @@ export function TestComponent() {
fs.writeFileSync(path.join(componentDir, 'TestComponent.jsx'), testComponent);

// Import and run the library CLI directly
const { runZeroUiInit } = require('../../dist/cli/postInstall.cjs');
const { runZeroUiInit } = require('../../dist/cli/postInstall');

// Mock console to capture output
const originalConsoleLog = console.log;
Expand Down Expand Up @@ -354,7 +354,7 @@ test('Library CLI handles errors gracefully', async () => {
};

try {
const { runZeroUiInit } = require('../../dist/cli/postInstall.cjs');
const { runZeroUiInit } = require('../../dist/cli/postInstall');

// This should complete without errors in most cases
await runZeroUiInit();
Expand Down Expand Up @@ -523,7 +523,7 @@ export function Toggle() {
fs.writeFileSync(path.join(componentsDir, 'Toggle.jsx'), component2);

// Import and run the library CLI
const { runZeroUiInit } = require('../../dist/cli/postInstall.cjs');
const { runZeroUiInit } = require('../../dist/cli/postInstall');

const originalConsoleLog = console.log;
const logMessages = [];
Expand Down
Loading