create-inkan 0.0.0-stage → 0.9.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 +25 -2
- package/index.js +23 -0
- package/package.json +34 -4
package/README.md
CHANGED
|
@@ -1,3 +1,26 @@
|
|
|
1
|
-
#
|
|
1
|
+
# create-inkan
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
```sh
|
|
4
|
+
npm create inkan@latest
|
|
5
|
+
npm create inkan@latest my-api -- --store postgres --auth --frontend next
|
|
6
|
+
```
|
|
7
|
+
|
|
8
|
+
A new [inkan](https://github.com/inkanjs/inkan) app: routes with contracts and examples, a
|
|
9
|
+
store (memory, Postgres, Redis, MongoDB or MySQL), logins from `@inkanjs/auth` if you want
|
|
10
|
+
them, a Next.js or Vite frontend if you want one, tests and a CI workflow. Every project
|
|
11
|
+
passes `inkan check` and its own tests as it comes.
|
|
12
|
+
|
|
13
|
+
It asks what it needs. Options skip the questions:
|
|
14
|
+
|
|
15
|
+
| option | |
|
|
16
|
+
| --- | --- |
|
|
17
|
+
| `--store memory\|postgres\|redis\|mongo\|mysql` | where the data lives (memory) |
|
|
18
|
+
| `--auth`, `--no-auth` | logins and sessions (no) |
|
|
19
|
+
| `--frontend none\|next\|vite` | a frontend with the API under `/api` (none) |
|
|
20
|
+
| `--pm npm\|pnpm\|yarn\|bun` | who installs (the one that ran this) |
|
|
21
|
+
| `--no-install` | write the files only |
|
|
22
|
+
| `--yes` | the defaults for everything the options leave open |
|
|
23
|
+
| `--force` | write into a folder that is not empty |
|
|
24
|
+
|
|
25
|
+
This package is `inkan create app` of `@vxnsin/inkan` at the same version; with inkan
|
|
26
|
+
installed, `npx inkan create app` does the same.
|
package/index.js
ADDED
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
// npm create inkan [folder] -- [options]: hands everything to `inkan create app` of the
|
|
3
|
+
// @vxnsin/inkan this package depends on, at its own version, so the templates and the
|
|
4
|
+
// CLI that writes them always match. The work is all there; this only finds it.
|
|
5
|
+
|
|
6
|
+
import { spawnSync } from "node:child_process";
|
|
7
|
+
import { readFileSync } from "node:fs";
|
|
8
|
+
import { createRequire } from "node:module";
|
|
9
|
+
import { dirname, join } from "node:path";
|
|
10
|
+
|
|
11
|
+
const CORE = "@vxnsin/inkan";
|
|
12
|
+
|
|
13
|
+
const require = createRequire(import.meta.url);
|
|
14
|
+
const manifest = require.resolve(`${CORE}/package.json`);
|
|
15
|
+
const { bin } = JSON.parse(readFileSync(manifest, "utf8"));
|
|
16
|
+
const cli = join(dirname(manifest), typeof bin === "string" ? bin : bin.inkan);
|
|
17
|
+
|
|
18
|
+
const r = spawnSync(process.execPath, [cli, "create", "app", ...process.argv.slice(2)], { stdio: "inherit" });
|
|
19
|
+
if (r.error) {
|
|
20
|
+
console.error(`create-inkan: could not start ${CORE}: ${r.error.message}`);
|
|
21
|
+
process.exit(1);
|
|
22
|
+
}
|
|
23
|
+
process.exit(r.status ?? 1);
|
package/package.json
CHANGED
|
@@ -1,6 +1,36 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "create-inkan",
|
|
3
|
-
"version": "0.
|
|
4
|
-
"
|
|
5
|
-
"
|
|
6
|
-
|
|
3
|
+
"version": "0.9.0",
|
|
4
|
+
"description": "npm create inkan: a new inkan app with a store, auth, a frontend, tests and CI, from the inkan of the same version.",
|
|
5
|
+
"keywords": [
|
|
6
|
+
"inkan",
|
|
7
|
+
"create",
|
|
8
|
+
"starter",
|
|
9
|
+
"api",
|
|
10
|
+
"openapi"
|
|
11
|
+
],
|
|
12
|
+
"license": "MIT",
|
|
13
|
+
"author": "Vensin (https://github.com/vxnsin)",
|
|
14
|
+
"homepage": "https://github.com/inkanjs/inkan#readme",
|
|
15
|
+
"repository": {
|
|
16
|
+
"type": "git",
|
|
17
|
+
"url": "git+https://github.com/inkanjs/inkan.git",
|
|
18
|
+
"directory": "create"
|
|
19
|
+
},
|
|
20
|
+
"type": "module",
|
|
21
|
+
"bin": {
|
|
22
|
+
"create-inkan": "./index.js"
|
|
23
|
+
},
|
|
24
|
+
"files": [
|
|
25
|
+
"index.js"
|
|
26
|
+
],
|
|
27
|
+
"publishConfig": {
|
|
28
|
+
"access": "public"
|
|
29
|
+
},
|
|
30
|
+
"engines": {
|
|
31
|
+
"node": ">=22"
|
|
32
|
+
},
|
|
33
|
+
"dependencies": {
|
|
34
|
+
"@vxnsin/inkan": "0.9.0"
|
|
35
|
+
}
|
|
36
|
+
}
|