@fusion.dev/create-helix-app 0.0.0-dev
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/LICENSE +21 -0
- package/README.md +33 -0
- package/bin.mjs +37 -0
- package/package.json +38 -0
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 Fusion Development Group
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
ADDED
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
# @fusion.dev/create-helix-app
|
|
2
|
+
|
|
3
|
+
Starts a Helix project.
|
|
4
|
+
|
|
5
|
+
```sh
|
|
6
|
+
npm create @fusion.dev/helix-app@latest my-app
|
|
7
|
+
```
|
|
8
|
+
|
|
9
|
+
Named without a template, it lists the templates and writes nothing: a
|
|
10
|
+
scaffolder that picks for you writes a project you didn't choose. Name one after
|
|
11
|
+
`--`, which is how `npm create` passes a flag on rather than reading it itself:
|
|
12
|
+
|
|
13
|
+
```sh
|
|
14
|
+
npm create @fusion.dev/helix-app@latest my-app -- --template react-vite
|
|
15
|
+
```
|
|
16
|
+
|
|
17
|
+
| Template | What it is |
|
|
18
|
+
|---|---|
|
|
19
|
+
| `react-vite` | React and TypeScript on Vite. The shortest path to a running component. |
|
|
20
|
+
| `react-nextjs` | React and TypeScript on the Next.js App Router, elements registered once. |
|
|
21
|
+
|
|
22
|
+
This is `helix new` from
|
|
23
|
+
[`@fusion.dev/helix-cli`](https://www.npmjs.com/package/@fusion.dev/helix-cli),
|
|
24
|
+
reached from somewhere with no project yet. A project that already has Helix
|
|
25
|
+
installed can run `npx helix new` instead, and gets the same templates.
|
|
26
|
+
|
|
27
|
+
**Scoped because the plain name is taken.** `create-helix-app` on npm belongs to
|
|
28
|
+
an unrelated project, so `npm create helix-app` runs somebody else's code.
|
|
29
|
+
`npm create @fusion.dev/helix-app` resolves to this package and no other.
|
|
30
|
+
|
|
31
|
+
[Documentation](https://helix.fusion.dev)
|
|
32
|
+
|
|
33
|
+
MIT
|
package/bin.mjs
ADDED
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
/**
|
|
3
|
+
* `npm create @fusion.dev/helix-app`: `helix new` for somebody with no project
|
|
4
|
+
* yet.
|
|
5
|
+
*
|
|
6
|
+
* **One implementation, two doors.** The scaffolding belongs to the binary, and
|
|
7
|
+
* this is the door for a reader with nothing installed: npm fetches this
|
|
8
|
+
* package, the command it depends on, the binary for their machine and the
|
|
9
|
+
* templates, and this runs `helix new` against the templates it came with.
|
|
10
|
+
* Nothing here copies or substitutes, which is the part that would drift from
|
|
11
|
+
* the other door.
|
|
12
|
+
*
|
|
13
|
+
* **It names the templates rather than letting the binary look.** `helix new`
|
|
14
|
+
* walks up from where it is run for a `node_modules` holding them, and the
|
|
15
|
+
* directory a reader runs this in has none: npm installed everything into its
|
|
16
|
+
* own cache. So this hands over the package it resolved, which is the one
|
|
17
|
+
* versioned with the binary beside it. `HELIX_TEMPLATES` already set wins, as it
|
|
18
|
+
* does everywhere else it is read.
|
|
19
|
+
*/
|
|
20
|
+
import { spawnSync } from 'node:child_process'
|
|
21
|
+
import { createRequire } from 'node:module'
|
|
22
|
+
import { dirname } from 'node:path'
|
|
23
|
+
|
|
24
|
+
const require = createRequire(import.meta.url)
|
|
25
|
+
const templates = dirname(require.resolve('@fusion.dev/helix-templates/templates.json'))
|
|
26
|
+
const helix = require.resolve('@fusion.dev/helix-cli/bin.mjs')
|
|
27
|
+
|
|
28
|
+
const { status, error } = spawnSync(process.execPath, [helix, 'new', ...process.argv.slice(2)], {
|
|
29
|
+
env: { ...process.env, HELIX_TEMPLATES: process.env.HELIX_TEMPLATES ?? templates },
|
|
30
|
+
stdio: 'inherit',
|
|
31
|
+
})
|
|
32
|
+
/* A status means it ran, whatever `error` says: see the same line in the shim. */
|
|
33
|
+
if (error && status === null) {
|
|
34
|
+
console.error(`create-helix-app: could not run helix: ${error.message}`)
|
|
35
|
+
process.exit(70)
|
|
36
|
+
}
|
|
37
|
+
process.exit(status ?? 70)
|
package/package.json
ADDED
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@fusion.dev/create-helix-app",
|
|
3
|
+
"description": "Starts a Helix project: `npm create @fusion.dev/helix-app`, which is `helix new` for somebody with no project yet.",
|
|
4
|
+
"version": "0.0.0-dev",
|
|
5
|
+
"license": "MIT",
|
|
6
|
+
"author": "Ross Sheppard <ross.sheppard@fusion.dev>",
|
|
7
|
+
"repository": {
|
|
8
|
+
"directory": "helix/create-app",
|
|
9
|
+
"type": "git",
|
|
10
|
+
"url": "git+https://github.com/project-fusion/fusion.git"
|
|
11
|
+
},
|
|
12
|
+
"type": "module",
|
|
13
|
+
"files": [
|
|
14
|
+
"bin.mjs"
|
|
15
|
+
],
|
|
16
|
+
"bin": {
|
|
17
|
+
"create-helix-app": "./bin.mjs"
|
|
18
|
+
},
|
|
19
|
+
"scripts": {
|
|
20
|
+
"test": "bun test"
|
|
21
|
+
},
|
|
22
|
+
"bugs": "https://github.com/project-fusion/fusion/issues",
|
|
23
|
+
"dependencies": {
|
|
24
|
+
"@fusion.dev/helix-cli": "0.24.1",
|
|
25
|
+
"@fusion.dev/helix-templates": "0.24.1"
|
|
26
|
+
},
|
|
27
|
+
"homepage": "https://fusion.dev",
|
|
28
|
+
"keywords": [
|
|
29
|
+
"helix",
|
|
30
|
+
"create",
|
|
31
|
+
"scaffold",
|
|
32
|
+
"template",
|
|
33
|
+
"design-system"
|
|
34
|
+
],
|
|
35
|
+
"publishConfig": {
|
|
36
|
+
"access": "restricted"
|
|
37
|
+
}
|
|
38
|
+
}
|