Skip to content

Commit 0b84899

Browse files
authored
feat: update to node-v22 (#15)
* update to node-v22 * remove unused test
1 parent 8fdd63d commit 0b84899

32 files changed

+154
-389
lines changed

.release-please-config.json

Lines changed: 8 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,9 @@
11
{
2-
"release-type": "node",
3-
"monorepo-tags": true,
4-
"include-component-in-tag": true,
5-
"packages": {
6-
"packages/core": {
7-
"package-name": "@react-zero-ui/core",
8-
"release-type": "node"
9-
},
10-
"packages/cli": {
11-
"package-name": "create-zero-ui",
12-
"release-type": "node"
13-
}
14-
}
15-
}
2+
"release-type": "node",
3+
"monorepo-tags": true,
4+
"include-component-in-tag": true,
5+
"packages": {
6+
"packages/core": { "package-name": "@react-zero-ui/core", "release-type": "node" },
7+
"packages/cli": { "package-name": "create-zero-ui", "release-type": "node" }
8+
}
9+
}

README.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -20,10 +20,10 @@ Pre‑render your UI once, flip a `data-*` attribute to update — that's it.
2020

2121
## 🚀 Live Demo
2222

23-
| Example | Link | What it shows | Link to Code |
24-
| --- | --- | --- | --- |
25-
| 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> |
26-
| 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> |
23+
| Example | Link | What it shows | Link to Code |
24+
| --------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------- |
25+
| 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> |
26+
| 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> |
2727
| 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> |
2828

2929
---

examples/demo/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,4 +33,4 @@
3333
"tailwindcss": "^4.1.10",
3434
"typescript": "^5"
3535
}
36-
}
36+
}

package.json

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,9 @@
22
"name": "react-zero-ui-monorepo",
33
"private": true,
44
"type": "module",
5+
"engines": {
6+
"node": ">=22"
7+
},
58
"workspaces": [
69
"packages/*"
710
],
Lines changed: 11 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,15 @@
1-
import { bodyAttributes } from "@zero-ui/attributes";import './globals.css';
1+
import { bodyAttributes } from '@zero-ui/attributes';
2+
import './globals.css';
23

34
export default function RootLayout({ children }) {
4-
return (
5-
<html lang="en">
6-
<body {...bodyAttributes}
7-
className="bg-red test-ww this is to test the body tag"
8-
id="88">
5+
return (
6+
<html lang="en">
7+
<body
8+
{...bodyAttributes}
9+
className="bg-red test-ww this is to test the body tag"
10+
id="88">
911
{children}
1012
</body>
11-
</html>);
12-
13-
}
13+
</html>
14+
);
15+
}

packages/core/__tests__/helpers/loadCli.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ import path from 'node:path';
44

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

16-
// The init.cjs exports a cli function, so call it
16+
// The init.js exports a cli function, so call it
1717

1818
if (typeof mod === 'function') {
1919
return await Promise.resolve(mod(args)); // run the CLI
2020
} else if (typeof mod.default === 'function') {
2121
return await Promise.resolve(mod.default(args)); // run the CLI (ESM default export)
2222
} else {
23-
throw new Error('Could not find CLI function in init.cjs');
23+
throw new Error('Could not find CLI function in init.js');
2424
}
2525
} finally {
2626
process.chdir(originalCwd); // Always restore original directory

packages/core/__tests__/helpers/resetProjectState.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
import fs from 'node:fs';
33
import path from 'node:path';
44
import { rmSync } from 'node:fs';
5-
import { overwriteFile } from './overwriteFile';
5+
import { overwriteFile } from './overwriteFile.js';
66

77
/**
88
* Reset everything the Zero-UI CLI generates inside a fixture.

packages/core/__tests__/unit/ast.test.cjs

Lines changed: 0 additions & 243 deletions
This file was deleted.

packages/core/__tests__/unit/cli.test.cjs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ function cleanupTestDir(testDir) {
5656
function runCLIScript(targetDir, timeout = 30000) {
5757
return new Promise((resolve, reject) => {
5858
// Updated path to the correct CLI script location
59-
const binScript = path.resolve(__dirname, '../../../cli/bin.js');
59+
const binScript = path.resolve(__dirname, '../../../cli/bin');
6060

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

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

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

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

356356
try {
357-
const { runZeroUiInit } = require('../../dist/cli/postInstall.cjs');
357+
const { runZeroUiInit } = require('../../dist/cli/postInstall');
358358

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

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

528528
const originalConsoleLog = console.log;
529529
const logMessages = [];

0 commit comments

Comments
 (0)