create-fluixi 0.1.0-alpha.8 → 0.1.0-alpha.9

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 CHANGED
@@ -24,13 +24,20 @@ pnpm create fluixi my-app
24
24
  yarn create fluixi my-app
25
25
  ```
26
26
 
27
- It prompts for a project name and a **mode**, or take them on the command line:
27
+ It prompts for a project name, a **mode** and an **authoring format**, or takes them on the
28
+ command line:
28
29
 
29
30
  ```bash
30
- create-fluixi my-app --ssr # SSR app (@fluixi/start: file routing + SSR + hydration)
31
- create-fluixi my-app --spa # SPA (vite + @fluixi/vite-plugin)
31
+ create-fluixi my-app --ssr # SSR app (@fluixi/start: file routing + SSR + hydration)
32
+ create-fluixi my-app --spa # SPA (vite + @fluixi/vite-plugin)
33
+
34
+ create-fluixi my-app --spa --html # same app, html`` templates instead of JSX
32
35
  ```
33
36
 
37
+ `--jsx` (default) or `--html` picks how you write components. The html`` variant is
38
+ JSX-free — plain `.ts` files, no `jsxImportSource`, and [`@fluixi/ts-plugin`](../ts-plugin)
39
+ wired up so the editor still understands the templates. Both compile to the same thing.
40
+
34
41
  Then:
35
42
 
36
43
  ```bash
@@ -46,6 +53,9 @@ pnpm dev
46
53
  | **SSR** | [`@fluixi/start`](../start) + [`@fluixi/cli`](../cli) | `src/entry-{server,client}`, `src/routes/`, `fluixi.config.ts` |
47
54
  | **SPA** | `vite` + [`@fluixi/vite-plugin`](../vite-plugin) | `src/main.tsx` → `render(() => <App/>)` |
48
55
 
56
+ Each comes in a JSX and an html`` variant (`template-ssr`, `template-ssr-html`, and the same
57
+ two for SPA).
58
+
49
59
  Both pin `@fluixi/*` to the `next` dist-tag and set `jsxImportSource: "@fluixi/jsx"`.
50
60
 
51
61
  ## 🧱 Scaffolding pieces
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "create-fluixi",
3
- "version": "0.1.0-alpha.8",
3
+ "version": "0.1.0-alpha.9",
4
4
  "license": "MIT",
5
5
  "description": "Scaffold a new Fluixi app — `npm create fluixi <dir>`.",
6
6
  "type": "module",
@@ -2,5 +2,12 @@ import { defineConfig } from 'vite';
2
2
  import { fluixi } from '@fluixi/vite-plugin';
3
3
 
4
4
  export default defineConfig({
5
- plugins: [fluixi()],
5
+ plugins: [
6
+ fluixi({
7
+ // Where a capitalised tag with no import in scope comes from. One pattern covers
8
+ // the whole folder, so a new component needs no config — `fluixi g component Card`
9
+ // and `<Card />` just works. Delete this if you'd rather import every component.
10
+ resolve: [{ match: /^([A-Z]\w+)$/, module: '/src/components/$1.tsx' }],
11
+ }),
12
+ ],
6
13
  });
@@ -2,5 +2,12 @@ import { defineConfig } from 'vite';
2
2
  import { fluixi } from '@fluixi/vite-plugin';
3
3
 
4
4
  export default defineConfig({
5
- plugins: [fluixi()],
5
+ plugins: [
6
+ fluixi({
7
+ // Where a capitalised tag with no import in scope comes from. One pattern covers
8
+ // the whole folder, so a new component needs no config — `fluixi g component Card`
9
+ // and `<Card />` just works. Delete this if you'd rather import every component.
10
+ resolve: [{ match: /^([A-Z]\w+)$/, module: '/src/components/$1.ts' }],
11
+ }),
12
+ ],
6
13
  });
@@ -3,6 +3,10 @@ import { nodeAdapter } from '@fluixi/start/adapter';
3
3
 
4
4
  export default defineConfig({
5
5
  port: 3000,
6
+ // Where a capitalised tag with no import in scope comes from. One pattern covers
7
+ // the whole folder, so a new component needs no config — `fluixi g component Card`
8
+ // and `<Card />` just works. Delete this if you'd rather import every component.
9
+ resolve: [{ match: /^([A-Z]\w+)$/, module: '/src/components/$1.tsx' }],
6
10
  // `pnpm start` runs a Node process from this directory, so the framework stays an
7
11
  // import rather than being copied into dist/server. Swap in a deploy adapter —
8
12
  // cloudflare, netlify, vercel — to get the layout that platform expects.
@@ -3,6 +3,10 @@ import { nodeAdapter } from '@fluixi/start/adapter';
3
3
 
4
4
  export default defineConfig({
5
5
  port: 3000,
6
+ // Where a capitalised tag with no import in scope comes from. One pattern covers
7
+ // the whole folder, so a new component needs no config — `fluixi g component Card`
8
+ // and `<Card />` just works. Delete this if you'd rather import every component.
9
+ resolve: [{ match: /^([A-Z]\w+)$/, module: '/src/components/$1.ts' }],
6
10
  // `pnpm start` runs a Node process from this directory, so the framework stays an
7
11
  // import rather than being copied into dist/server. Swap in a deploy adapter —
8
12
  // cloudflare, netlify, vercel — to get the layout that platform expects.