@fusion.dev/helix-templates 0.25.1 → 0.30.0

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
@@ -28,12 +28,14 @@ the graph, which wants the packages public first.
28
28
  ## Reading it yourself
29
29
 
30
30
  ```js
31
- import { findTemplate, PROJECT_NAME, templates } from '@fusion.dev/helix-templates'
31
+ import { findTemplate, HELIX_VERSION, PROJECT_NAME, templates } from '@fusion.dev/helix-templates'
32
32
  ```
33
33
 
34
34
  `templates` is the register, in the order a chooser should offer them. Each entry
35
- names the files whose contents carry `PROJECT_NAME`, which a scaffolder replaces
36
- with the project's own. The payloads sit under `templates/<id>/` in this package.
35
+ names the files a scaffolder substitutes in: `PROJECT_NAME` becomes the project's
36
+ own name, and `HELIX_VERSION` becomes this package's version, which is the Helix
37
+ the templates were published with. The payloads sit under `templates/<id>/` in
38
+ this package.
37
39
 
38
40
  **The named files are named rather than discovered.** Scanning every file for the
39
41
  placeholder would rewrite a template that merely mentions it in prose, and a
package/dist/index.d.ts CHANGED
@@ -40,8 +40,8 @@ export interface Template {
40
40
  *
41
41
  * **There is no build-free HTML template, and that is a fact about the packages
42
42
  * rather than an omission.** `@fusion.dev/helix`'s published entry re-exports
43
- * bare specifiers — `@fusion.dev/helix-core`, ninety-odd
44
- * `@fusion.dev/helix-headless/*` subpaths, `lit` and its own graph — which a
43
+ * bare specifiers (`@fusion.dev/helix-core`, ninety-odd
44
+ * `@fusion.dev/helix-headless/*` subpaths, `lit` and its own graph), which a
45
45
  * browser cannot resolve without an import map covering all of it. An import map
46
46
  * that large is a build artifact wearing a template's clothes. The honest
47
47
  * build-free story is a CDN that rewrites the graph, which wants the packages
@@ -50,5 +50,15 @@ export interface Template {
50
50
  export declare const templates: readonly Template[];
51
51
  /** The placeholder a scaffolder replaces with the project's name. */
52
52
  export declare const PROJECT_NAME = "__PROJECT_NAME__";
53
+ /**
54
+ * The placeholder a scaffolder replaces with this package's own version.
55
+ *
56
+ * **Which is the Helix a template was published with**, every Helix package
57
+ * sharing one version, so a template asks for the components it shipped beside
58
+ * and no release has to remember to update it. Written by hand, both templates
59
+ * asked for `^0.0.9`, which under a zero major admits `0.0.9` alone, and a new
60
+ * project installed that release while 0.25.0 was current.
61
+ */
62
+ export declare const HELIX_VERSION = "__HELIX_VERSION__";
53
63
  /** The one template with this id, or `undefined` where there is none. */
54
64
  export declare const findTemplate: (id: string) => Template | undefined;
package/dist/index.js CHANGED
@@ -13,4 +13,5 @@ export const templates = [
13
13
  },
14
14
  ];
15
15
  export const PROJECT_NAME = '__PROJECT_NAME__';
16
+ export const HELIX_VERSION = '__HELIX_VERSION__';
16
17
  export const findTemplate = (id) => templates.find((one) => one.id === id);
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@fusion.dev/helix-templates",
3
3
  "description": "Starter templates for Helix, as data. Read by `helix new` and by `npm create @fusion.dev/helix-app`.",
4
- "version": "0.25.1",
4
+ "version": "0.30.0",
5
5
  "license": "MIT",
6
6
  "author": "Ross Sheppard <ross.sheppard@fusion.dev>",
7
7
  "repository": {
@@ -26,11 +26,16 @@
26
26
  ],
27
27
  "sideEffects": false,
28
28
  "scripts": {
29
- "build": "bun run register && tsc -p tsconfig.build.json && tsc -p tsconfig.types.json",
29
+ "build": "tsc -p tsconfig.build.json && tsc -p tsconfig.types.json",
30
30
  "register": "bun scripts/build-register.mjs",
31
- "typecheck": "bun run register && tsc -p tsconfig.json --noEmit"
31
+ "test": "bun run test:pure",
32
+ "test:pure": "bun test pure.spec",
33
+ "typecheck": "tsc -p tsconfig.json --noEmit"
32
34
  },
33
35
  "bugs": "https://github.com/project-fusion/fusion/issues",
36
+ "devDependencies": {
37
+ "@fusion.dev/scripts": "0.0.0-dev"
38
+ },
34
39
  "homepage": "https://fusion.dev",
35
40
  "keywords": [
36
41
  "helix",
@@ -5,7 +5,11 @@ import type { ReactNode } from 'react'
5
5
  `:not(:defined)` rules that keep a tag from arriving unstyled. */
6
6
  import '@fusion.dev/helix-styles/helix.css'
7
7
 
8
- import { HelixElements } from './helix-elements.js'
8
+ /* Extensionless, unlike the libraries this imports. Turbopack does not map a
9
+ `.js` specifier back to the `.tsx` beside it, which is webpack's
10
+ `extensionAlias` and has no equivalent there, so `./helix-elements.js` fails
11
+ the first `next build` with "Module not found". */
12
+ import { HelixElements } from './helix-elements'
9
13
 
10
14
  export const metadata: Metadata = { title: '__PROJECT_NAME__' }
11
15
  export const viewport: Viewport = { initialScale: 1, width: 'device-width' }
@@ -3,7 +3,7 @@
3
3
  *
4
4
  * Helix events are props: `onhelix-before-change` reaches `helix-before-change`.
5
5
  * Anything needing a handler is a client component, the same as any other React
6
- * app — this page needs none.
6
+ * app: this page needs none.
7
7
  */
8
8
  export default function Page() {
9
9
  return (
@@ -9,13 +9,16 @@
9
9
  "start": "next start"
10
10
  },
11
11
  "dependencies": {
12
- "@fusion.dev/helix": "^0.0.9",
13
- "@fusion.dev/helix-styles": "^0.4.1",
14
- "next": "^16.0.0",
12
+ "@fusion.dev/helix": "^__HELIX_VERSION__",
13
+ "@fusion.dev/helix-styles": "^__HELIX_VERSION__",
14
+ "next": "^16.3.0",
15
15
  "react": "^19.2.0",
16
16
  "react-dom": "^19.2.0"
17
17
  },
18
18
  "devDependencies": {
19
- "typescript": "^5.9.0"
19
+ "@types/node": "^22.10.0",
20
+ "@types/react": "^19.2.0",
21
+ "@types/react-dom": "^19.2.0",
22
+ "typescript": "^7.0.2"
20
23
  }
21
24
  }
@@ -9,14 +9,16 @@
9
9
  "preview": "vite preview"
10
10
  },
11
11
  "dependencies": {
12
- "@fusion.dev/helix": "^0.0.9",
13
- "@fusion.dev/helix-styles": "^0.4.1",
12
+ "@fusion.dev/helix": "^__HELIX_VERSION__",
13
+ "@fusion.dev/helix-styles": "^__HELIX_VERSION__",
14
14
  "react": "^19.2.0",
15
15
  "react-dom": "^19.2.0"
16
16
  },
17
17
  "devDependencies": {
18
- "@vitejs/plugin-react": "^5.0.0",
19
- "typescript": "^5.9.0",
20
- "vite": "^7.0.0"
18
+ "@types/react": "^19.2.0",
19
+ "@types/react-dom": "^19.2.0",
20
+ "@vitejs/plugin-react": "^6.1.1",
21
+ "typescript": "^7.0.2",
22
+ "vite": "^8.3.0"
21
23
  }
22
24
  }
@@ -8,11 +8,14 @@
8
8
  ],
9
9
  "module": "ESNext",
10
10
  "moduleResolution": "bundler",
11
+ "noEmit": true,
11
12
  "skipLibCheck": true,
12
13
  "strict": true,
13
14
  "target": "ES2023",
14
- "verbatimModuleSyntax": true,
15
- "noEmit": true
15
+ "types": [
16
+ "vite/client"
17
+ ],
18
+ "verbatimModuleSyntax": true
16
19
  },
17
20
  "include": [
18
21
  "src",
package/templates.json CHANGED
@@ -21,5 +21,6 @@
21
21
  ],
22
22
  "title": "React (Next.js)"
23
23
  }
24
- ]
24
+ ],
25
+ "version": "__HELIX_VERSION__"
25
26
  }