@cloudwerk/create-app 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 +68 -0
- package/dist/index.js +6 -4
- package/package.json +1 -1
- package/template-api/cloudwerk.config.ts +1 -3
- package/template-api/package.json.tmpl +1 -0
- package/template-hono-jsx/app/{routes/page.tsx → page.tsx} +1 -1
- package/template-hono-jsx/cloudwerk.config.ts +0 -1
- package/template-hono-jsx/package.json.tmpl +1 -0
- package/template-react/app/{routes/page.tsx → page.tsx} +1 -1
- package/template-react/cloudwerk.config.ts +0 -1
- package/template-react/package.json.tmpl +1 -0
- /package/template-api/app/{routes/route.ts → route.ts} +0 -0
- /package/template-hono-jsx/app/{routes/route.ts → route.ts} +0 -0
- /package/template-react/app/{routes/route.ts → route.ts} +0 -0
package/README.md
ADDED
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
# @cloudwerk/create-app
|
|
2
|
+
|
|
3
|
+
Scaffold a new Cloudwerk project with a single command.
|
|
4
|
+
|
|
5
|
+
## Usage
|
|
6
|
+
|
|
7
|
+
```bash
|
|
8
|
+
npx @cloudwerk/create-app my-app
|
|
9
|
+
```
|
|
10
|
+
|
|
11
|
+
Or with a specific package manager:
|
|
12
|
+
|
|
13
|
+
```bash
|
|
14
|
+
pnpm create @cloudwerk/app my-app
|
|
15
|
+
npm create @cloudwerk/app my-app
|
|
16
|
+
yarn create @cloudwerk/app my-app
|
|
17
|
+
```
|
|
18
|
+
|
|
19
|
+
## Options
|
|
20
|
+
|
|
21
|
+
```
|
|
22
|
+
Usage: create-cloudwerk-app [options] <project-name>
|
|
23
|
+
|
|
24
|
+
Options:
|
|
25
|
+
-r, --renderer <type> UI renderer (hono-jsx, react, none)
|
|
26
|
+
-V, --version Output version number
|
|
27
|
+
-h, --help Display help
|
|
28
|
+
```
|
|
29
|
+
|
|
30
|
+
## Templates
|
|
31
|
+
|
|
32
|
+
| Renderer | Description |
|
|
33
|
+
|----------|-------------|
|
|
34
|
+
| `hono-jsx` | Full-stack app with Hono JSX (default) |
|
|
35
|
+
| `react` | Full-stack app with React SSR |
|
|
36
|
+
| `none` | API-only backend, no UI rendering |
|
|
37
|
+
|
|
38
|
+
## Examples
|
|
39
|
+
|
|
40
|
+
```bash
|
|
41
|
+
# Interactive mode (prompts for renderer)
|
|
42
|
+
npx @cloudwerk/create-app my-app
|
|
43
|
+
|
|
44
|
+
# Hono JSX template (default)
|
|
45
|
+
npx @cloudwerk/create-app my-app --renderer hono-jsx
|
|
46
|
+
|
|
47
|
+
# React template
|
|
48
|
+
npx @cloudwerk/create-app my-app --renderer react
|
|
49
|
+
|
|
50
|
+
# API-only template
|
|
51
|
+
npx @cloudwerk/create-app my-app --renderer none
|
|
52
|
+
```
|
|
53
|
+
|
|
54
|
+
## What's Included
|
|
55
|
+
|
|
56
|
+
Each template includes:
|
|
57
|
+
- Pre-configured `cloudwerk.config.ts`
|
|
58
|
+
- Example routes in `app/routes/`
|
|
59
|
+
- TypeScript configuration
|
|
60
|
+
- Development scripts (`dev`, `build`)
|
|
61
|
+
|
|
62
|
+
## Documentation
|
|
63
|
+
|
|
64
|
+
For full documentation, visit: https://github.com/squirrelsoft-dev/cloudwerk
|
|
65
|
+
|
|
66
|
+
## Part of Cloudwerk
|
|
67
|
+
|
|
68
|
+
This package is part of the [Cloudwerk](https://github.com/squirrelsoft-dev/cloudwerk) monorepo.
|
package/dist/index.js
CHANGED
|
@@ -178,8 +178,9 @@ function printSuccessBanner(projectName, projectPath, pm) {
|
|
|
178
178
|
}
|
|
179
179
|
|
|
180
180
|
// src/versions.ts
|
|
181
|
-
var CORE_VERSION = "0.
|
|
182
|
-
var CLI_VERSION = "0.
|
|
181
|
+
var CORE_VERSION = "0.7.2";
|
|
182
|
+
var CLI_VERSION = "0.7.2";
|
|
183
|
+
var UI_VERSION = "0.7.2";
|
|
183
184
|
|
|
184
185
|
// src/scaffold.ts
|
|
185
186
|
function getTemplateDir(renderer) {
|
|
@@ -188,7 +189,7 @@ function getTemplateDir(renderer) {
|
|
|
188
189
|
return path2.resolve(__dirname, "..", templateName);
|
|
189
190
|
}
|
|
190
191
|
function processTemplate(content, values) {
|
|
191
|
-
return content.replace(/\{\{name\}\}/g, values.name).replace(/\{\{coreVersion\}\}/g, values.coreVersion).replace(/\{\{cliVersion\}\}/g, values.cliVersion);
|
|
192
|
+
return content.replace(/\{\{name\}\}/g, values.name).replace(/\{\{coreVersion\}\}/g, values.coreVersion).replace(/\{\{cliVersion\}\}/g, values.cliVersion).replace(/\{\{uiVersion\}\}/g, values.uiVersion);
|
|
192
193
|
}
|
|
193
194
|
function isTemplateFile(fileName) {
|
|
194
195
|
return fileName.endsWith(".tmpl");
|
|
@@ -216,7 +217,8 @@ async function scaffold(projectName, options = {}) {
|
|
|
216
217
|
const templateValues = {
|
|
217
218
|
name: projectName,
|
|
218
219
|
coreVersion: CORE_VERSION,
|
|
219
|
-
cliVersion: CLI_VERSION
|
|
220
|
+
cliVersion: CLI_VERSION,
|
|
221
|
+
uiVersion: UI_VERSION
|
|
220
222
|
};
|
|
221
223
|
logger.info(`Creating ${projectName}...`);
|
|
222
224
|
try {
|
package/package.json
CHANGED
|
File without changes
|
|
File without changes
|
|
File without changes
|