@atolljs/cli 0.1.4 → 0.1.5
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 +4 -3
- package/dist/cli.js +15 -6
- package/package.json +1 -1
- package/src/templates.ts +17 -6
package/README.md
CHANGED
|
@@ -21,9 +21,10 @@ builds it automatically before staging.
|
|
|
21
21
|
|
|
22
22
|
```bash
|
|
23
23
|
atoll new <dir> [--framework react|vue|solid|svelte|node] [--pm npm]
|
|
24
|
-
Scaffold a fresh app: vite shell with COOP/COEP headers,
|
|
25
|
-
worker
|
|
26
|
-
|
|
24
|
+
Scaffold a fresh app: vite shell with COOP/COEP headers, the
|
|
25
|
+
@atolljs/vite plugin (worker entries are dev-bundled — no
|
|
26
|
+
fast-refresh in workers), a worker-rendered counter island,
|
|
27
|
+
hardened .npmrc — or a tsx Node service with a pooled worker.
|
|
27
28
|
|
|
28
29
|
atoll init
|
|
29
30
|
Wire Atoll into the current project: .npmrc, installs the @atolljs/*
|
package/dist/cli.js
CHANGED
|
@@ -577,22 +577,27 @@ var HEADERS = ` // SharedArrayBuffer is gated behind cross-origin isolation \u2
|
|
|
577
577
|
var SCAFFOLDS = {
|
|
578
578
|
react: {
|
|
579
579
|
deps: { react: "^19.3.0", "react-dom": "^19.3.0", "react-reconciler": "^0.34.0", "@atolljs/core": "^0.1.0", "@atolljs/react": "^0.1.0", "@atolljs/react-island": "^0.1.0", zod: "^4.6.5" },
|
|
580
|
-
devDeps: { vite: "^8.3.1", typescript: "^7.0.2", "@vitejs/plugin-react": "^6.1.1", "@types/react": "^19.3.0", "@types/react-dom": "^19.3.0" },
|
|
581
|
-
|
|
580
|
+
devDeps: { vite: "^8.3.1", typescript: "^7.0.2", "@vitejs/plugin-react": "^6.1.1", "@atolljs/vite": "^0.1.0", "@types/react": "^19.3.0", "@types/react-dom": "^19.3.0" },
|
|
581
|
+
// `exclude` replaces the plugin's default /node_modules/ — keep it, and
|
|
582
|
+
// add *.worker.*: fast-refresh injects `/@react-refresh` (which reads
|
|
583
|
+
// `window` unguarded) into every transformed module, including worker
|
|
584
|
+
// entries served as ?worker_file — that crashes the worker in dev.
|
|
585
|
+
vitePlugin: { pkg: "@vitejs/plugin-react", import_: `import react from '@vitejs/plugin-react';`, call: "react({ exclude: [/\\/node_modules\\//, /\\.worker\\./] })" }
|
|
582
586
|
},
|
|
583
587
|
vue: {
|
|
584
588
|
deps: { vue: "^3.5.43", "@atolljs/core": "^0.1.0", "@atolljs/vue": "^0.1.0", "@atolljs/vue-island": "^0.1.0", zod: "^4.6.5" },
|
|
585
|
-
devDeps: { vite: "^8.3.1", typescript: "^7.0.2", "@vitejs/plugin-vue": "^6.0.9" },
|
|
589
|
+
devDeps: { vite: "^8.3.1", typescript: "^7.0.2", "@vitejs/plugin-vue": "^6.0.9", "@atolljs/vite": "^0.1.0" },
|
|
586
590
|
vitePlugin: { pkg: "@vitejs/plugin-vue", import_: `import vue from '@vitejs/plugin-vue';`, call: "vue()" }
|
|
587
591
|
},
|
|
588
592
|
solid: {
|
|
589
593
|
deps: { "solid-js": "^1.9.15", "@atolljs/core": "^0.1.0", "@atolljs/solidjs": "^0.1.0", "@atolljs/solid-island": "^0.1.0", zod: "^4.6.5" },
|
|
590
|
-
devDeps: { vite: "^8.3.1", typescript: "^7.0.2", "vite-plugin-solid": "^2.11.14" },
|
|
594
|
+
devDeps: { vite: "^8.3.1", typescript: "^7.0.2", "vite-plugin-solid": "^2.11.14", "@atolljs/vite": "^0.1.0" },
|
|
595
|
+
atollCall: `atoll({ jsxImportSource: 'solid-js' })`,
|
|
591
596
|
vitePlugin: { pkg: "vite-plugin-solid", import_: `import solid from 'vite-plugin-solid';`, call: "solid()" }
|
|
592
597
|
},
|
|
593
598
|
svelte: {
|
|
594
599
|
deps: { svelte: "^5.57.1", "@atolljs/core": "^0.1.0", "@atolljs/svelte": "^0.1.0", "@atolljs/svelte-island": "^0.1.0", zod: "^4.6.5" },
|
|
595
|
-
devDeps: { vite: "^8.3.1", typescript: "^7.0.2", "@sveltejs/vite-plugin-svelte": "^7.3.1" },
|
|
600
|
+
devDeps: { vite: "^8.3.1", typescript: "^7.0.2", "@sveltejs/vite-plugin-svelte": "^7.3.1", "@atolljs/vite": "^0.1.0" },
|
|
596
601
|
vitePlugin: { pkg: "@sveltejs/vite-plugin-svelte", import_: `import { svelte } from '@sveltejs/vite-plugin-svelte';`, call: "svelte()" }
|
|
597
602
|
}
|
|
598
603
|
};
|
|
@@ -695,9 +700,13 @@ function viteConfig(fw) {
|
|
|
695
700
|
const plugin = spec.vitePlugin;
|
|
696
701
|
return `import { defineConfig } from 'vite';
|
|
697
702
|
${plugin?.import_ ?? ""}
|
|
703
|
+
import atoll from '@atolljs/vite';
|
|
698
704
|
|
|
699
705
|
export default defineConfig({
|
|
700
|
-
|
|
706
|
+
// atoll() serves worker entries as esbuild bundles (rebuild + respawn on
|
|
707
|
+
// change) \u2014 browser-plugin transforms like react fast-refresh can't leak
|
|
708
|
+
// into worker code.
|
|
709
|
+
plugins: [${plugin?.call ?? ""}, ${spec.atollCall ?? "atoll()"}],
|
|
701
710
|
${plugin ? ` // Worker bundles run their own rolldown pass \u2014 fresh plugin instances
|
|
702
711
|
// let the worker entry compile framework files too (worker-island apps).
|
|
703
712
|
worker: { plugins: () => [${plugin.call}] },
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atolljs/cli",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.5",
|
|
4
4
|
"description": "atoll — scaffold worker pools, shared-memory contracts, and framework islands (experimental)",
|
|
5
5
|
"homepage": "https://jwhenry3.github.io/atolljs/consumer/quickstart/",
|
|
6
6
|
"type": "module",
|
package/src/templates.ts
CHANGED
|
@@ -414,27 +414,34 @@ interface ScaffoldSpec {
|
|
|
414
414
|
deps: Record<string, string>;
|
|
415
415
|
devDeps: Record<string, string>;
|
|
416
416
|
vitePlugin?: { pkg: string; import_: string; call: string };
|
|
417
|
+
/** `atoll(…)` call args for the emitted config — e.g. solid needs its jsx runtime. */
|
|
418
|
+
atollCall?: string;
|
|
417
419
|
}
|
|
418
420
|
|
|
419
421
|
const SCAFFOLDS: Record<string, ScaffoldSpec> = {
|
|
420
422
|
react: {
|
|
421
423
|
deps: { react: '^19.3.0', 'react-dom': '^19.3.0', 'react-reconciler': '^0.34.0', '@atolljs/core': '^0.1.0', '@atolljs/react': '^0.1.0', '@atolljs/react-island': '^0.1.0', zod: '^4.6.5' },
|
|
422
|
-
devDeps: { vite: '^8.3.1', typescript: '^7.0.2', '@vitejs/plugin-react': '^6.1.1', '@types/react': '^19.3.0', '@types/react-dom': '^19.3.0' },
|
|
423
|
-
|
|
424
|
+
devDeps: { vite: '^8.3.1', typescript: '^7.0.2', '@vitejs/plugin-react': '^6.1.1', '@atolljs/vite': '^0.1.0', '@types/react': '^19.3.0', '@types/react-dom': '^19.3.0' },
|
|
425
|
+
// `exclude` replaces the plugin's default /node_modules/ — keep it, and
|
|
426
|
+
// add *.worker.*: fast-refresh injects `/@react-refresh` (which reads
|
|
427
|
+
// `window` unguarded) into every transformed module, including worker
|
|
428
|
+
// entries served as ?worker_file — that crashes the worker in dev.
|
|
429
|
+
vitePlugin: { pkg: '@vitejs/plugin-react', import_: `import react from '@vitejs/plugin-react';`, call: 'react({ exclude: [/\\/node_modules\\//, /\\.worker\\./] })' },
|
|
424
430
|
},
|
|
425
431
|
vue: {
|
|
426
432
|
deps: { vue: '^3.5.43', '@atolljs/core': '^0.1.0', '@atolljs/vue': '^0.1.0', '@atolljs/vue-island': '^0.1.0', zod: '^4.6.5' },
|
|
427
|
-
devDeps: { vite: '^8.3.1', typescript: '^7.0.2', '@vitejs/plugin-vue': '^6.0.9' },
|
|
433
|
+
devDeps: { vite: '^8.3.1', typescript: '^7.0.2', '@vitejs/plugin-vue': '^6.0.9', '@atolljs/vite': '^0.1.0' },
|
|
428
434
|
vitePlugin: { pkg: '@vitejs/plugin-vue', import_: `import vue from '@vitejs/plugin-vue';`, call: 'vue()' },
|
|
429
435
|
},
|
|
430
436
|
solid: {
|
|
431
437
|
deps: { 'solid-js': '^1.9.15', '@atolljs/core': '^0.1.0', '@atolljs/solidjs': '^0.1.0', '@atolljs/solid-island': '^0.1.0', zod: '^4.6.5' },
|
|
432
|
-
devDeps: { vite: '^8.3.1', typescript: '^7.0.2', 'vite-plugin-solid': '^2.11.14' },
|
|
438
|
+
devDeps: { vite: '^8.3.1', typescript: '^7.0.2', 'vite-plugin-solid': '^2.11.14', '@atolljs/vite': '^0.1.0' },
|
|
439
|
+
atollCall: `atoll({ jsxImportSource: 'solid-js' })`,
|
|
433
440
|
vitePlugin: { pkg: 'vite-plugin-solid', import_: `import solid from 'vite-plugin-solid';`, call: 'solid()' },
|
|
434
441
|
},
|
|
435
442
|
svelte: {
|
|
436
443
|
deps: { svelte: '^5.57.1', '@atolljs/core': '^0.1.0', '@atolljs/svelte': '^0.1.0', '@atolljs/svelte-island': '^0.1.0', zod: '^4.6.5' },
|
|
437
|
-
devDeps: { vite: '^8.3.1', typescript: '^7.0.2', '@sveltejs/vite-plugin-svelte': '^7.3.1' },
|
|
444
|
+
devDeps: { vite: '^8.3.1', typescript: '^7.0.2', '@sveltejs/vite-plugin-svelte': '^7.3.1', '@atolljs/vite': '^0.1.0' },
|
|
438
445
|
vitePlugin: { pkg: '@sveltejs/vite-plugin-svelte', import_: `import { svelte } from '@sveltejs/vite-plugin-svelte';`, call: 'svelte()' },
|
|
439
446
|
},
|
|
440
447
|
};
|
|
@@ -513,9 +520,13 @@ function viteConfig(fw: string): string {
|
|
|
513
520
|
const plugin = spec.vitePlugin;
|
|
514
521
|
return `import { defineConfig } from 'vite';
|
|
515
522
|
${plugin?.import_ ?? ''}
|
|
523
|
+
import atoll from '@atolljs/vite';
|
|
516
524
|
|
|
517
525
|
export default defineConfig({
|
|
518
|
-
|
|
526
|
+
// atoll() serves worker entries as esbuild bundles (rebuild + respawn on
|
|
527
|
+
// change) — browser-plugin transforms like react fast-refresh can't leak
|
|
528
|
+
// into worker code.
|
|
529
|
+
plugins: [${plugin?.call ?? ''}, ${spec.atollCall ?? 'atoll()'}],
|
|
519
530
|
${
|
|
520
531
|
plugin
|
|
521
532
|
? ` // Worker bundles run their own rolldown pass — fresh plugin instances
|