round-core 0.2.1 → 0.2.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +2 -9
- package/package.json +57 -54
- package/src/cli.js +79 -6
package/README.md
CHANGED
|
@@ -149,9 +149,9 @@ export function Counter() {
|
|
|
149
149
|
|
|
150
150
|
- `signal(0)` creates a reactive value initialized to 0
|
|
151
151
|
|
|
152
|
-
-
|
|
152
|
+
- Calling `count()` reads the current value and subscribes the DOM
|
|
153
153
|
|
|
154
|
-
-
|
|
154
|
+
- Calling `count(newValue)` writes a new value and updates only the subscribed nodes
|
|
155
155
|
|
|
156
156
|
- The component function runs once — only the text node updates when count changes
|
|
157
157
|
|
|
@@ -712,13 +712,6 @@ The CLI is intended for day-to-day development:
|
|
|
712
712
|
|
|
713
713
|
Run `round -h` to see available commands.
|
|
714
714
|
|
|
715
|
-
## Performance
|
|
716
|
-
|
|
717
|
-
RoundJS sits in a powerful "middle ground" of performance:
|
|
718
|
-
|
|
719
|
-
- **vs React**: Round's fine-grained reactivity is **massively faster** (>30x in micro-benchmarks) than React's component-level reconciliation. DOM updates are surgical and don't require diffing a virtual tree.
|
|
720
|
-
- **vs Preact Signals**: While highly optimized, RoundJS signals are currently slightly slower than Preact Signals (~10x difference in raw signal-to-signal updates), as Preact utilizes more aggressive internal optimizations. However, for most real-world applications, RoundJS provides more than enough performance.
|
|
721
|
-
|
|
722
715
|
## Status
|
|
723
716
|
|
|
724
717
|
Round is under active development and the API is still stabilizing. The README is currently the primary documentation; a dedicated documentation site will be built later using Round itself.
|
package/package.json
CHANGED
|
@@ -1,54 +1,57 @@
|
|
|
1
|
-
{
|
|
2
|
-
"name": "round-core",
|
|
3
|
-
"version": "0.2.
|
|
4
|
-
"description": "A lightweight frontend framework for SPA with signals and fine grained reactivity",
|
|
5
|
-
"
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
"
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
"
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
"
|
|
29
|
-
"
|
|
30
|
-
},
|
|
31
|
-
"
|
|
32
|
-
"
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
"bench
|
|
36
|
-
"bench:
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
"
|
|
41
|
-
"
|
|
42
|
-
"
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
"
|
|
46
|
-
"
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
"
|
|
52
|
-
"
|
|
53
|
-
|
|
54
|
-
|
|
1
|
+
{
|
|
2
|
+
"name": "round-core",
|
|
3
|
+
"version": "0.2.2",
|
|
4
|
+
"description": "A lightweight frontend framework for SPA with signals and fine grained reactivity",
|
|
5
|
+
"workspaces": [
|
|
6
|
+
"packages/*"
|
|
7
|
+
],
|
|
8
|
+
"main": "./src/index.js",
|
|
9
|
+
"types": "./src/index.d.ts",
|
|
10
|
+
"readme": "README.md",
|
|
11
|
+
"exports": {
|
|
12
|
+
".": {
|
|
13
|
+
"types": "./src/index.d.ts",
|
|
14
|
+
"default": "./src/index.js"
|
|
15
|
+
},
|
|
16
|
+
"./vite-plugin": {
|
|
17
|
+
"types": "./src/compiler/vite-plugin.d.ts",
|
|
18
|
+
"default": "./src/compiler/vite-plugin.js"
|
|
19
|
+
}
|
|
20
|
+
},
|
|
21
|
+
"files": [
|
|
22
|
+
"src",
|
|
23
|
+
"README.md",
|
|
24
|
+
"LICENSE"
|
|
25
|
+
],
|
|
26
|
+
"type": "module",
|
|
27
|
+
"icon": "Round.png",
|
|
28
|
+
"repository": {
|
|
29
|
+
"url": "https://github.com/ZtaMDev/RoundJS.git"
|
|
30
|
+
},
|
|
31
|
+
"bin": {
|
|
32
|
+
"round": "./src/cli.js"
|
|
33
|
+
},
|
|
34
|
+
"scripts": {
|
|
35
|
+
"bench": "bun run --cwd benchmarks bench",
|
|
36
|
+
"bench:build": "bun run --cwd benchmarks bench:build",
|
|
37
|
+
"bench:runtime": "bun run --cwd benchmarks bench:runtime"
|
|
38
|
+
},
|
|
39
|
+
"keywords": [
|
|
40
|
+
"framework",
|
|
41
|
+
"spa",
|
|
42
|
+
"signals",
|
|
43
|
+
"vite"
|
|
44
|
+
],
|
|
45
|
+
"author": "Round Framework Team",
|
|
46
|
+
"license": "MIT",
|
|
47
|
+
"dependencies": {
|
|
48
|
+
"vite": "^5.0.0"
|
|
49
|
+
},
|
|
50
|
+
"devDependencies": {
|
|
51
|
+
"@types/node": "latest",
|
|
52
|
+
"bun-types": "latest",
|
|
53
|
+
"eslint": "^9.39.2",
|
|
54
|
+
"prettier": "^3.7.4",
|
|
55
|
+
"vitest": "^1.6.0"
|
|
56
|
+
}
|
|
57
|
+
}
|
package/src/cli.js
CHANGED
|
@@ -211,15 +211,33 @@ async function runInit({ name }) {
|
|
|
211
211
|
|
|
212
212
|
const projectDir = path.resolve(process.cwd(), name);
|
|
213
213
|
const srcDir = path.join(projectDir, 'src');
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
214
|
+
const vscodeDir = path.join(projectDir, '.vscode');
|
|
215
|
+
const vscodeSettingsPath = path.join(vscodeDir, 'settings.json');
|
|
217
216
|
const pkgPath = path.join(projectDir, 'package.json');
|
|
218
217
|
const configPath = path.join(projectDir, 'round.config.json');
|
|
219
218
|
const viteConfigPath = path.join(projectDir, 'vite.config.js');
|
|
219
|
+
const prettierConfigPath = path.join(projectDir, '.prettierrc');
|
|
220
|
+
const eslintConfigPath = path.join(projectDir, 'eslint.config.js');
|
|
220
221
|
const appRoundPath = path.join(srcDir, 'app.round');
|
|
221
222
|
const counterRoundPath = path.join(srcDir, 'counter.round');
|
|
222
223
|
|
|
224
|
+
ensureDir(srcDir);
|
|
225
|
+
ensureDir(vscodeDir);
|
|
226
|
+
|
|
227
|
+
writeFileIfMissing(vscodeSettingsPath, JSON.stringify({
|
|
228
|
+
"eslint.validate": [
|
|
229
|
+
"javascript",
|
|
230
|
+
"javascriptreact",
|
|
231
|
+
"round"
|
|
232
|
+
],
|
|
233
|
+
"prettier.documentSelectors": [
|
|
234
|
+
"**/*.round"
|
|
235
|
+
],
|
|
236
|
+
"[round]": {
|
|
237
|
+
"editor.defaultFormatter": "esbenp.prettier-vscode"
|
|
238
|
+
}
|
|
239
|
+
}, null, 4) + '\n');
|
|
240
|
+
|
|
223
241
|
writeFileIfMissing(pkgPath, JSON.stringify({
|
|
224
242
|
name,
|
|
225
243
|
private: true,
|
|
@@ -228,16 +246,71 @@ async function runInit({ name }) {
|
|
|
228
246
|
scripts: {
|
|
229
247
|
dev: 'round dev',
|
|
230
248
|
build: 'round build',
|
|
231
|
-
preview: 'round preview'
|
|
249
|
+
preview: 'round preview',
|
|
250
|
+
lint: 'eslint src',
|
|
251
|
+
format: 'prettier --write src'
|
|
232
252
|
},
|
|
233
253
|
dependencies: {
|
|
234
|
-
'round-core': '^
|
|
254
|
+
'round-core': '^' + getRoundVersion(),
|
|
255
|
+
'@round-core/shared': '^1.0.0'
|
|
235
256
|
},
|
|
236
257
|
devDependencies: {
|
|
237
|
-
|
|
258
|
+
'@round-core/lint': '^0.1.0',
|
|
259
|
+
'@round-core/prettier': '^0.1.0',
|
|
260
|
+
'eslint': '^9.39.2',
|
|
261
|
+
'espree': '^10.0.0',
|
|
262
|
+
'globals': '^17.0.0',
|
|
263
|
+
'prettier': '^3.7.4',
|
|
264
|
+
'vite': '^5.0.0'
|
|
238
265
|
}
|
|
239
266
|
}, null, 4) + '\n');
|
|
240
267
|
|
|
268
|
+
writeFileIfMissing(prettierConfigPath, JSON.stringify({
|
|
269
|
+
plugins: ["@round-core/prettier"],
|
|
270
|
+
overrides: [
|
|
271
|
+
{
|
|
272
|
+
files: "*.round",
|
|
273
|
+
options: {
|
|
274
|
+
parser: "round"
|
|
275
|
+
}
|
|
276
|
+
}
|
|
277
|
+
]
|
|
278
|
+
}, null, 4) + '\n');
|
|
279
|
+
|
|
280
|
+
const eslintConfigContent = `import lintPlugin from '@round-core/lint';
|
|
281
|
+
import globals from 'globals';
|
|
282
|
+
import * as espree from 'espree';
|
|
283
|
+
|
|
284
|
+
export default [
|
|
285
|
+
{
|
|
286
|
+
files: ["**/*.round"],
|
|
287
|
+
plugins: {
|
|
288
|
+
'@round-core/lint': lintPlugin
|
|
289
|
+
},
|
|
290
|
+
processor: lintPlugin.processors['.round'],
|
|
291
|
+
rules: {
|
|
292
|
+
"no-unused-vars": "warn",
|
|
293
|
+
"no-undef": "error"
|
|
294
|
+
},
|
|
295
|
+
languageOptions: {
|
|
296
|
+
parser: espree,
|
|
297
|
+
ecmaVersion: "latest",
|
|
298
|
+
sourceType: "module",
|
|
299
|
+
globals: {
|
|
300
|
+
...globals.browser,
|
|
301
|
+
...globals.node,
|
|
302
|
+
},
|
|
303
|
+
parserOptions: {
|
|
304
|
+
ecmaFeatures: {
|
|
305
|
+
jsx: true
|
|
306
|
+
}
|
|
307
|
+
}
|
|
308
|
+
}
|
|
309
|
+
}
|
|
310
|
+
];
|
|
311
|
+
`;
|
|
312
|
+
writeFileIfMissing(eslintConfigPath, eslintConfigContent);
|
|
313
|
+
|
|
241
314
|
writeFileIfMissing(configPath, JSON.stringify({
|
|
242
315
|
mode,
|
|
243
316
|
entry: './src/app.round',
|