create-crank 0.1.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 +44 -0
- package/bin/create.js +17 -0
- package/package.json +26 -0
package/README.md
ADDED
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
# create-crank
|
|
2
|
+
|
|
3
|
+
Create a new [Crank.js](https://crank.js.org) project.
|
|
4
|
+
|
|
5
|
+
## Usage
|
|
6
|
+
|
|
7
|
+
```bash
|
|
8
|
+
npm create crank my-app
|
|
9
|
+
```
|
|
10
|
+
|
|
11
|
+
This is a shortcut for:
|
|
12
|
+
|
|
13
|
+
```bash
|
|
14
|
+
npm create shovel my-app --template crank
|
|
15
|
+
```
|
|
16
|
+
|
|
17
|
+
## Options
|
|
18
|
+
|
|
19
|
+
All options are passed through to `create-shovel`:
|
|
20
|
+
|
|
21
|
+
```bash
|
|
22
|
+
# Skip TypeScript prompt
|
|
23
|
+
npm create crank my-app --typescript
|
|
24
|
+
npm create crank my-app --no-typescript
|
|
25
|
+
|
|
26
|
+
# Skip platform prompt
|
|
27
|
+
npm create crank my-app --platform node
|
|
28
|
+
npm create crank my-app --platform bun
|
|
29
|
+
npm create crank my-app --platform cloudflare
|
|
30
|
+
```
|
|
31
|
+
|
|
32
|
+
## What you get
|
|
33
|
+
|
|
34
|
+
A Crank.js project with:
|
|
35
|
+
|
|
36
|
+
- Server-rendered JSX components using `@b9g/crank/html`
|
|
37
|
+
- [Shovel](https://github.com/bikeshaving/shovel) for builds and dev server
|
|
38
|
+
- TypeScript support (optional)
|
|
39
|
+
- Deploy to Node.js, Bun, or Cloudflare Workers
|
|
40
|
+
|
|
41
|
+
## Learn more
|
|
42
|
+
|
|
43
|
+
- [Crank.js Documentation](https://crank.js.org)
|
|
44
|
+
- [Shovel Documentation](https://github.com/bikeshaving/shovel)
|
package/bin/create.js
ADDED
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
import {spawn} from "child_process";
|
|
3
|
+
|
|
4
|
+
const args = process.argv.slice(2);
|
|
5
|
+
|
|
6
|
+
// Add --template crank if no --template specified
|
|
7
|
+
if (!args.includes("--template")) {
|
|
8
|
+
args.push("--template", "crank");
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
// Run create-shovel with the args
|
|
12
|
+
spawn("npx", ["create-shovel", ...args], {
|
|
13
|
+
stdio: "inherit",
|
|
14
|
+
shell: true,
|
|
15
|
+
}).on("exit", (code) => {
|
|
16
|
+
process.exit(code ?? 0);
|
|
17
|
+
});
|
package/package.json
ADDED
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "create-crank",
|
|
3
|
+
"version": "0.1.0",
|
|
4
|
+
"description": "Create a new Crank.js project",
|
|
5
|
+
"license": "MIT",
|
|
6
|
+
"repository": {
|
|
7
|
+
"type": "git",
|
|
8
|
+
"url": "https://github.com/bikeshaving/crank.git",
|
|
9
|
+
"directory": "packages/create-crank"
|
|
10
|
+
},
|
|
11
|
+
"type": "module",
|
|
12
|
+
"bin": {
|
|
13
|
+
"create-crank": "./bin/create.js"
|
|
14
|
+
},
|
|
15
|
+
"files": [
|
|
16
|
+
"bin"
|
|
17
|
+
],
|
|
18
|
+
"keywords": [
|
|
19
|
+
"crank",
|
|
20
|
+
"crankjs",
|
|
21
|
+
"create",
|
|
22
|
+
"scaffold",
|
|
23
|
+
"starter",
|
|
24
|
+
"template"
|
|
25
|
+
]
|
|
26
|
+
}
|