create-crank 0.1.0 → 0.1.2
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 +17 -13
- package/bin/create.js +6 -6
- package/package.json +8 -7
package/README.md
CHANGED
|
@@ -1,41 +1,45 @@
|
|
|
1
1
|
# create-crank
|
|
2
2
|
|
|
3
|
-
Create a new [Crank.js](https://crank.js.org) project.
|
|
3
|
+
Create a new [Crank.js](https://crank.js.org) project powered by [Shovel](https://github.com/bikeshaving/shovel).
|
|
4
4
|
|
|
5
5
|
## Usage
|
|
6
6
|
|
|
7
7
|
```bash
|
|
8
|
-
npm create crank
|
|
8
|
+
npm create crank
|
|
9
9
|
```
|
|
10
10
|
|
|
11
|
-
|
|
11
|
+
Or with a project name:
|
|
12
12
|
|
|
13
13
|
```bash
|
|
14
|
-
npm create
|
|
14
|
+
npm create crank my-app
|
|
15
15
|
```
|
|
16
16
|
|
|
17
17
|
## Options
|
|
18
18
|
|
|
19
19
|
All options are passed through to `create-shovel`:
|
|
20
20
|
|
|
21
|
+
```
|
|
22
|
+
--template <name> hello-world, api, static-site, full-stack
|
|
23
|
+
--jsx / --no-jsx Use JSX syntax or tagged template literals
|
|
24
|
+
--typescript / --no-typescript
|
|
25
|
+
--platform <name> node, bun, cloudflare
|
|
26
|
+
```
|
|
27
|
+
|
|
28
|
+
Skip all prompts:
|
|
29
|
+
|
|
21
30
|
```bash
|
|
22
|
-
|
|
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
|
|
31
|
+
npm create crank my-app -- --template full-stack --no-jsx --typescript --platform bun
|
|
30
32
|
```
|
|
31
33
|
|
|
32
34
|
## What you get
|
|
33
35
|
|
|
34
36
|
A Crank.js project with:
|
|
35
37
|
|
|
36
|
-
- Server-rendered JSX
|
|
38
|
+
- Server-rendered components (JSX or tagged template literals)
|
|
39
|
+
- Router-based routing with `@b9g/router`
|
|
37
40
|
- [Shovel](https://github.com/bikeshaving/shovel) for builds and dev server
|
|
38
41
|
- TypeScript support (optional)
|
|
42
|
+
- ESLint configuration
|
|
39
43
|
- Deploy to Node.js, Bun, or Cloudflare Workers
|
|
40
44
|
|
|
41
45
|
## Learn more
|
package/bin/create.js
CHANGED
|
@@ -3,15 +3,15 @@ import {spawn} from "child_process";
|
|
|
3
3
|
|
|
4
4
|
const args = process.argv.slice(2);
|
|
5
5
|
|
|
6
|
-
//
|
|
7
|
-
if (!args.includes("--
|
|
8
|
-
args.push("--
|
|
6
|
+
// Always use Crank framework
|
|
7
|
+
if (!args.includes("--framework")) {
|
|
8
|
+
args.push("--framework", "crank");
|
|
9
9
|
}
|
|
10
10
|
|
|
11
|
-
// Run create-shovel with the args
|
|
12
|
-
|
|
11
|
+
// Run create-shovel with the args. --yes skips the second install prompt
|
|
12
|
+
// (the user already confirmed installing create-crank).
|
|
13
|
+
spawn("npx", ["--yes", "create-shovel", ...args], {
|
|
13
14
|
stdio: "inherit",
|
|
14
|
-
shell: true,
|
|
15
15
|
}).on("exit", (code) => {
|
|
16
16
|
process.exit(code ?? 0);
|
|
17
17
|
});
|
package/package.json
CHANGED
|
@@ -1,13 +1,8 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "create-crank",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.2",
|
|
4
4
|
"description": "Create a new Crank.js project",
|
|
5
5
|
"license": "MIT",
|
|
6
|
-
"repository": {
|
|
7
|
-
"type": "git",
|
|
8
|
-
"url": "https://github.com/bikeshaving/crank.git",
|
|
9
|
-
"directory": "packages/create-crank"
|
|
10
|
-
},
|
|
11
6
|
"type": "module",
|
|
12
7
|
"bin": {
|
|
13
8
|
"create-crank": "./bin/create.js"
|
|
@@ -22,5 +17,11 @@
|
|
|
22
17
|
"scaffold",
|
|
23
18
|
"starter",
|
|
24
19
|
"template"
|
|
25
|
-
]
|
|
20
|
+
],
|
|
21
|
+
"repository": {
|
|
22
|
+
"type": "git",
|
|
23
|
+
"url": "git+https://github.com/bikeshaving/crank.git",
|
|
24
|
+
"directory": "packages/create-crank"
|
|
25
|
+
},
|
|
26
|
+
"homepage": "https://crank.js.org"
|
|
26
27
|
}
|