@dimah-s3/cli 0.4.1
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 +64 -0
- package/dist/index.js +726 -0
- package/dist/index.js.map +1 -0
- package/dist/snapshot/transform.js +50 -0
- package/dist/snapshot/transform.js.map +1 -0
- package/dist/templates/catalog.json +9 -0
- package/dist/templates/nextjs/.env.example +5 -0
- package/dist/templates/nextjs/README.md +31 -0
- package/dist/templates/nextjs/_gitignore +29 -0
- package/dist/templates/nextjs/app/api/s3/[...s3]/route.ts +4 -0
- package/dist/templates/nextjs/app/globals.css +130 -0
- package/dist/templates/nextjs/app/layout.tsx +40 -0
- package/dist/templates/nextjs/app/page.tsx +30 -0
- package/dist/templates/nextjs/components/s3-provider.tsx +9 -0
- package/dist/templates/nextjs/components/theme-provider.tsx +11 -0
- package/dist/templates/nextjs/components.json +27 -0
- package/dist/templates/nextjs/eslint.config.js +9 -0
- package/dist/templates/nextjs/lib/s3-client.ts +12 -0
- package/dist/templates/nextjs/lib/s3.ts +11 -0
- package/dist/templates/nextjs/lib/utils.ts +1 -0
- package/dist/templates/nextjs/next-env.d.ts +7 -0
- package/dist/templates/nextjs/next.config.ts +5 -0
- package/dist/templates/nextjs/package.json +40 -0
- package/dist/templates/nextjs/postcss.config.mjs +7 -0
- package/dist/templates/nextjs/tsconfig.json +31 -0
- package/package.json +64 -0
package/README.md
ADDED
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
# `@dimah-s3/cli`
|
|
2
|
+
|
|
3
|
+
Scaffold an official [dimah-s3](https://dimah-s3.vercel.app) starter.
|
|
4
|
+
|
|
5
|
+
## Usage
|
|
6
|
+
|
|
7
|
+
```bash
|
|
8
|
+
npx @dimah-s3/cli@latest create my-app
|
|
9
|
+
pnpm dlx @dimah-s3/cli@latest create my-app
|
|
10
|
+
```
|
|
11
|
+
|
|
12
|
+
Scaffold into the current directory (the folder name becomes the package name):
|
|
13
|
+
|
|
14
|
+
```bash
|
|
15
|
+
npx @dimah-s3/cli@latest create .
|
|
16
|
+
```
|
|
17
|
+
|
|
18
|
+
Non-interactive:
|
|
19
|
+
|
|
20
|
+
```bash
|
|
21
|
+
npx @dimah-s3/cli@latest create my-app --yes --template nextjs
|
|
22
|
+
```
|
|
23
|
+
|
|
24
|
+
### Options
|
|
25
|
+
|
|
26
|
+
| Flag | Description |
|
|
27
|
+
| ---------------------------- | --------------------------------------------------------- |
|
|
28
|
+
| `-t, --template <id>` | Template id (`nextjs`) |
|
|
29
|
+
| `--package-manager <pm>` | `pnpm` \| `npm` \| `yarn` \| `bun` (default: detected) |
|
|
30
|
+
| `--install` / `--no-install` | Install dependencies (default: prompt / yes with `--yes`) |
|
|
31
|
+
| `--git` / `--no-git` | Initialize git (default: prompt / yes with `--yes`) |
|
|
32
|
+
| `--overwrite` | Replace the contents of a non-empty directory |
|
|
33
|
+
| `-y, --yes` | Skip prompts and use defaults |
|
|
34
|
+
| `--version` | Print the CLI version |
|
|
35
|
+
|
|
36
|
+
### Behavior
|
|
37
|
+
|
|
38
|
+
- **Project name** is required with `--yes` or on a non-TTY (CI / piped input).
|
|
39
|
+
Interactive runs still prompt when the directory argument is omitted.
|
|
40
|
+
- **Other prompts** are only used on an interactive terminal. Non-interactive
|
|
41
|
+
sessions fall back to defaults for template / install / git.
|
|
42
|
+
- **Non-empty target:** the run stops unless `--overwrite` is passed (or the
|
|
43
|
+
prompt is confirmed). Overwriting clears the directory contents but keeps
|
|
44
|
+
`.git` and `.env`, and never removes the directory itself.
|
|
45
|
+
- **Failed install:** the project is kept and the final instructions tell you to
|
|
46
|
+
install manually; the exit code is still non-zero.
|
|
47
|
+
- **Git:** initializes on `main` and makes an initial commit. Skipped when the
|
|
48
|
+
target is already inside a repository.
|
|
49
|
+
|
|
50
|
+
### Exit codes
|
|
51
|
+
|
|
52
|
+
| Code | Meaning |
|
|
53
|
+
| ----- | ---------------------------- |
|
|
54
|
+
| `0` | Success |
|
|
55
|
+
| `1` | Failure |
|
|
56
|
+
| `130` | Cancelled (Ctrl+C or a "no") |
|
|
57
|
+
|
|
58
|
+
## Templates
|
|
59
|
+
|
|
60
|
+
Templates ship inside the CLI package (snapshotted from [`templates/`](../../templates) at build time).
|
|
61
|
+
|
|
62
|
+
## License
|
|
63
|
+
|
|
64
|
+
MIT
|