@cloudwerk/create-app 0.1.2 → 0.2.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/dist/index.js +3 -3
- package/package.json +2 -2
- package/template-api/_gitignore +1 -0
- package/template-api/app/route.ts +1 -2
- package/template-api/package.json.tmpl +4 -1
- package/template-api/tsconfig.json +7 -2
- package/template-api/wrangler.toml.tmpl +6 -1
- package/template-hono-jsx/_gitignore +1 -0
- package/template-hono-jsx/app/components/counter.tsx +5 -2
- package/template-hono-jsx/app/globals.css +1 -0
- package/template-hono-jsx/app/layout.tsx +18 -0
- package/template-hono-jsx/app/page.tsx +40 -4
- package/template-hono-jsx/app/route.ts +1 -2
- package/template-hono-jsx/cloudwerk.config.ts +4 -0
- package/template-hono-jsx/global.d.ts +6 -0
- package/template-hono-jsx/package.json.tmpl +7 -1
- package/template-hono-jsx/tsconfig.json +7 -2
- package/template-hono-jsx/wrangler.toml.tmpl +10 -1
- package/template-react/_gitignore +1 -0
- package/template-react/app/components/counter.tsx +5 -2
- package/template-react/app/globals.css +1 -0
- package/template-react/app/layout.tsx +18 -0
- package/template-react/app/page.tsx +40 -4
- package/template-react/app/route.ts +1 -2
- package/template-react/cloudwerk.config.ts +4 -0
- package/template-react/global.d.ts +6 -0
- package/template-react/package.json.tmpl +7 -1
- package/template-react/tsconfig.json +7 -2
- package/template-react/wrangler.toml.tmpl +10 -1
package/dist/index.js
CHANGED
|
@@ -178,9 +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.
|
|
183
|
-
var UI_VERSION = "0.
|
|
181
|
+
var CORE_VERSION = "0.14.0";
|
|
182
|
+
var CLI_VERSION = "0.14.0";
|
|
183
|
+
var UI_VERSION = "0.14.0";
|
|
184
184
|
|
|
185
185
|
// src/scaffold.ts
|
|
186
186
|
function getTemplateDir(renderer) {
|
package/package.json
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@cloudwerk/create-app",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.2.0",
|
|
4
4
|
"description": "Create a new Cloudwerk app",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
7
7
|
"url": "https://github.com/squirrelsoft-dev/cloudwerk.git",
|
|
8
|
-
"directory": "
|
|
8
|
+
"directory": "packages/create-app"
|
|
9
9
|
},
|
|
10
10
|
"type": "module",
|
|
11
11
|
"bin": {
|
package/template-api/_gitignore
CHANGED
|
@@ -6,7 +6,10 @@
|
|
|
6
6
|
"scripts": {
|
|
7
7
|
"dev": "cloudwerk dev",
|
|
8
8
|
"build": "cloudwerk build",
|
|
9
|
-
"
|
|
9
|
+
"preview": "cloudwerk deploy --env preview",
|
|
10
|
+
"preview:teardown": "wrangler delete --env preview",
|
|
11
|
+
"deploy": "cloudwerk deploy",
|
|
12
|
+
"bindings": "cloudwerk bindings"
|
|
10
13
|
},
|
|
11
14
|
"dependencies": {
|
|
12
15
|
"@cloudwerk/core": "^{{coreVersion}}",
|
|
@@ -8,7 +8,12 @@
|
|
|
8
8
|
"skipLibCheck": true,
|
|
9
9
|
"declaration": true,
|
|
10
10
|
"outDir": "./dist",
|
|
11
|
-
"rootDir": "./app"
|
|
11
|
+
"rootDir": "./app",
|
|
12
|
+
"baseUrl": ".",
|
|
13
|
+
"paths": {
|
|
14
|
+
"@cloudwerk/core/bindings": ["./.cloudwerk/types/bindings.d.ts"],
|
|
15
|
+
"@cloudwerk/core/context": ["./.cloudwerk/types/context.d.ts"]
|
|
16
|
+
}
|
|
12
17
|
},
|
|
13
|
-
"include": ["app/**/*", "cloudwerk.config.ts"]
|
|
18
|
+
"include": [".cloudwerk/types/**/*", "app/**/*", "cloudwerk.config.ts"]
|
|
14
19
|
}
|
|
@@ -1,6 +1,11 @@
|
|
|
1
1
|
name = "{{name}}"
|
|
2
2
|
main = "dist/index.js"
|
|
3
|
-
compatibility_date = "2024-
|
|
3
|
+
compatibility_date = "2024-09-23"
|
|
4
|
+
compatibility_flags = ["nodejs_compat"]
|
|
5
|
+
account_id = "your_account_id"
|
|
4
6
|
|
|
5
7
|
[build]
|
|
6
8
|
command = "npm run build"
|
|
9
|
+
|
|
10
|
+
[env.preview]
|
|
11
|
+
name = "{{name}}-preview"
|
|
@@ -6,8 +6,11 @@ export default function Counter() {
|
|
|
6
6
|
const [count, setCount] = useState(0)
|
|
7
7
|
|
|
8
8
|
return (
|
|
9
|
-
<button
|
|
10
|
-
|
|
9
|
+
<button
|
|
10
|
+
onClick={() => setCount((c) => c + 1)}
|
|
11
|
+
class="px-6 py-3 bg-gray-100 dark:bg-gray-800 hover:bg-gray-200 dark:hover:bg-gray-700 rounded-lg font-medium transition-colors"
|
|
12
|
+
>
|
|
13
|
+
Count is {count}
|
|
11
14
|
</button>
|
|
12
15
|
)
|
|
13
16
|
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
@import "tailwindcss";
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import type { LayoutProps } from '@cloudwerk/core'
|
|
2
|
+
import globals from './globals.css?url'
|
|
3
|
+
|
|
4
|
+
export default function RootLayout({ children }: LayoutProps) {
|
|
5
|
+
return (
|
|
6
|
+
<html lang="en">
|
|
7
|
+
<head>
|
|
8
|
+
<meta charset="utf-8" />
|
|
9
|
+
<meta name="viewport" content="width=device-width, initial-scale=1" />
|
|
10
|
+
<title>Cloudwerk App</title>
|
|
11
|
+
<link rel="stylesheet" href={globals} />
|
|
12
|
+
</head>
|
|
13
|
+
<body class="bg-gray-50 dark:bg-gray-900 text-gray-900 dark:text-gray-100 min-h-screen">
|
|
14
|
+
{children}
|
|
15
|
+
</body>
|
|
16
|
+
</html>
|
|
17
|
+
)
|
|
18
|
+
}
|
|
@@ -2,9 +2,45 @@ import Counter from './components/counter'
|
|
|
2
2
|
|
|
3
3
|
export default function HomePage() {
|
|
4
4
|
return (
|
|
5
|
-
<
|
|
6
|
-
|
|
7
|
-
<
|
|
8
|
-
|
|
5
|
+
<main class="flex flex-col items-center justify-center min-h-screen p-8">
|
|
6
|
+
{/* Logo/Brand */}
|
|
7
|
+
<div class="mb-8">
|
|
8
|
+
<h1 class="text-5xl font-bold bg-gradient-to-r from-orange-500 to-yellow-500 bg-clip-text text-transparent">
|
|
9
|
+
Cloudwerk
|
|
10
|
+
</h1>
|
|
11
|
+
</div>
|
|
12
|
+
|
|
13
|
+
{/* Tagline */}
|
|
14
|
+
<p class="text-xl text-gray-600 dark:text-gray-400 mb-8 text-center max-w-md">
|
|
15
|
+
Full-stack framework for Cloudflare Workers
|
|
16
|
+
</p>
|
|
17
|
+
|
|
18
|
+
{/* Counter Demo */}
|
|
19
|
+
<div class="mb-12">
|
|
20
|
+
<Counter />
|
|
21
|
+
</div>
|
|
22
|
+
|
|
23
|
+
{/* Quick Links */}
|
|
24
|
+
<div class="flex gap-4 text-sm">
|
|
25
|
+
<a
|
|
26
|
+
href="https://cloudwerk.dev/docs"
|
|
27
|
+
class="text-orange-500 hover:text-orange-600 underline underline-offset-4"
|
|
28
|
+
>
|
|
29
|
+
Documentation
|
|
30
|
+
</a>
|
|
31
|
+
<span class="text-gray-300 dark:text-gray-700">|</span>
|
|
32
|
+
<a
|
|
33
|
+
href="https://github.com/cloudwerk/cloudwerk"
|
|
34
|
+
class="text-orange-500 hover:text-orange-600 underline underline-offset-4"
|
|
35
|
+
>
|
|
36
|
+
GitHub
|
|
37
|
+
</a>
|
|
38
|
+
</div>
|
|
39
|
+
|
|
40
|
+
{/* Edit hint */}
|
|
41
|
+
<p class="mt-16 text-sm text-gray-400 dark:text-gray-600">
|
|
42
|
+
Edit <code class="bg-gray-100 dark:bg-gray-800 px-2 py-1 rounded">app/page.tsx</code> to get started
|
|
43
|
+
</p>
|
|
44
|
+
</main>
|
|
9
45
|
)
|
|
10
46
|
}
|
|
@@ -6,7 +6,10 @@
|
|
|
6
6
|
"scripts": {
|
|
7
7
|
"dev": "cloudwerk dev",
|
|
8
8
|
"build": "cloudwerk build",
|
|
9
|
-
"
|
|
9
|
+
"preview": "cloudwerk deploy --env preview",
|
|
10
|
+
"preview:teardown": "wrangler delete --env preview",
|
|
11
|
+
"deploy": "cloudwerk deploy",
|
|
12
|
+
"bindings": "cloudwerk bindings"
|
|
10
13
|
},
|
|
11
14
|
"dependencies": {
|
|
12
15
|
"@cloudwerk/core": "^{{coreVersion}}",
|
|
@@ -15,7 +18,10 @@
|
|
|
15
18
|
"hono": "^4.0.0"
|
|
16
19
|
},
|
|
17
20
|
"devDependencies": {
|
|
21
|
+
"@tailwindcss/vite": "^4.1.18",
|
|
22
|
+
"tailwindcss": "^4.1.18",
|
|
18
23
|
"typescript": "^5.0.0",
|
|
24
|
+
"vite": "^6.0.0",
|
|
19
25
|
"wrangler": "^4.0.0"
|
|
20
26
|
},
|
|
21
27
|
"engines": {
|
|
@@ -10,7 +10,12 @@
|
|
|
10
10
|
"outDir": "./dist",
|
|
11
11
|
"rootDir": "./app",
|
|
12
12
|
"jsx": "react-jsx",
|
|
13
|
-
"jsxImportSource": "hono/jsx"
|
|
13
|
+
"jsxImportSource": "hono/jsx",
|
|
14
|
+
"baseUrl": ".",
|
|
15
|
+
"paths": {
|
|
16
|
+
"@cloudwerk/core/bindings": ["./.cloudwerk/types/bindings.d.ts"],
|
|
17
|
+
"@cloudwerk/core/context": ["./.cloudwerk/types/context.d.ts"]
|
|
18
|
+
}
|
|
14
19
|
},
|
|
15
|
-
"include": ["app/**/*", "cloudwerk.config.ts"]
|
|
20
|
+
"include": [".cloudwerk/types/**/*", "app/**/*", "cloudwerk.config.ts", "global.d.ts"]
|
|
16
21
|
}
|
|
@@ -1,6 +1,15 @@
|
|
|
1
1
|
name = "{{name}}"
|
|
2
2
|
main = "dist/index.js"
|
|
3
|
-
compatibility_date = "2024-
|
|
3
|
+
compatibility_date = "2024-09-23"
|
|
4
|
+
compatibility_flags = ["nodejs_compat"]
|
|
5
|
+
account_id = "your_account_id"
|
|
6
|
+
|
|
7
|
+
[assets]
|
|
8
|
+
directory = "./dist/static"
|
|
9
|
+
binding = "ASSETS"
|
|
4
10
|
|
|
5
11
|
[build]
|
|
6
12
|
command = "npm run build"
|
|
13
|
+
|
|
14
|
+
[env.preview]
|
|
15
|
+
name = "{{name}}-preview"
|
|
@@ -6,8 +6,11 @@ export default function Counter() {
|
|
|
6
6
|
const [count, setCount] = useState(0)
|
|
7
7
|
|
|
8
8
|
return (
|
|
9
|
-
<button
|
|
10
|
-
|
|
9
|
+
<button
|
|
10
|
+
onClick={() => setCount((c) => c + 1)}
|
|
11
|
+
className="px-6 py-3 bg-gray-100 dark:bg-gray-800 hover:bg-gray-200 dark:hover:bg-gray-700 rounded-lg font-medium transition-colors"
|
|
12
|
+
>
|
|
13
|
+
Count is {count}
|
|
11
14
|
</button>
|
|
12
15
|
)
|
|
13
16
|
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
@import "tailwindcss";
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import type { LayoutProps } from '@cloudwerk/core'
|
|
2
|
+
import globals from './globals.css?url'
|
|
3
|
+
|
|
4
|
+
export default function RootLayout({ children }: LayoutProps) {
|
|
5
|
+
return (
|
|
6
|
+
<html lang="en">
|
|
7
|
+
<head>
|
|
8
|
+
<meta charSet="utf-8" />
|
|
9
|
+
<meta name="viewport" content="width=device-width, initial-scale=1" />
|
|
10
|
+
<title>Cloudwerk App</title>
|
|
11
|
+
<link rel="stylesheet" href={globals} />
|
|
12
|
+
</head>
|
|
13
|
+
<body className="bg-gray-50 dark:bg-gray-900 text-gray-900 dark:text-gray-100 min-h-screen">
|
|
14
|
+
{children}
|
|
15
|
+
</body>
|
|
16
|
+
</html>
|
|
17
|
+
)
|
|
18
|
+
}
|
|
@@ -2,9 +2,45 @@ import Counter from './components/counter'
|
|
|
2
2
|
|
|
3
3
|
export default function HomePage() {
|
|
4
4
|
return (
|
|
5
|
-
<
|
|
6
|
-
|
|
7
|
-
<
|
|
8
|
-
|
|
5
|
+
<main className="flex flex-col items-center justify-center min-h-screen p-8">
|
|
6
|
+
{/* Logo/Brand */}
|
|
7
|
+
<div className="mb-8">
|
|
8
|
+
<h1 className="text-5xl font-bold bg-gradient-to-r from-orange-500 to-yellow-500 bg-clip-text text-transparent">
|
|
9
|
+
Cloudwerk
|
|
10
|
+
</h1>
|
|
11
|
+
</div>
|
|
12
|
+
|
|
13
|
+
{/* Tagline */}
|
|
14
|
+
<p className="text-xl text-gray-600 dark:text-gray-400 mb-8 text-center max-w-md">
|
|
15
|
+
Full-stack framework for Cloudflare Workers
|
|
16
|
+
</p>
|
|
17
|
+
|
|
18
|
+
{/* Counter Demo */}
|
|
19
|
+
<div className="mb-12">
|
|
20
|
+
<Counter />
|
|
21
|
+
</div>
|
|
22
|
+
|
|
23
|
+
{/* Quick Links */}
|
|
24
|
+
<div className="flex gap-4 text-sm">
|
|
25
|
+
<a
|
|
26
|
+
href="https://cloudwerk.dev/docs"
|
|
27
|
+
className="text-orange-500 hover:text-orange-600 underline underline-offset-4"
|
|
28
|
+
>
|
|
29
|
+
Documentation
|
|
30
|
+
</a>
|
|
31
|
+
<span className="text-gray-300 dark:text-gray-700">|</span>
|
|
32
|
+
<a
|
|
33
|
+
href="https://github.com/cloudwerk/cloudwerk"
|
|
34
|
+
className="text-orange-500 hover:text-orange-600 underline underline-offset-4"
|
|
35
|
+
>
|
|
36
|
+
GitHub
|
|
37
|
+
</a>
|
|
38
|
+
</div>
|
|
39
|
+
|
|
40
|
+
{/* Edit hint */}
|
|
41
|
+
<p className="mt-16 text-sm text-gray-400 dark:text-gray-600">
|
|
42
|
+
Edit <code className="bg-gray-100 dark:bg-gray-800 px-2 py-1 rounded">app/page.tsx</code> to get started
|
|
43
|
+
</p>
|
|
44
|
+
</main>
|
|
9
45
|
)
|
|
10
46
|
}
|
|
@@ -6,7 +6,10 @@
|
|
|
6
6
|
"scripts": {
|
|
7
7
|
"dev": "cloudwerk dev",
|
|
8
8
|
"build": "cloudwerk build",
|
|
9
|
-
"
|
|
9
|
+
"preview": "cloudwerk deploy --env preview",
|
|
10
|
+
"preview:teardown": "wrangler delete --env preview",
|
|
11
|
+
"deploy": "cloudwerk deploy",
|
|
12
|
+
"bindings": "cloudwerk bindings"
|
|
10
13
|
},
|
|
11
14
|
"dependencies": {
|
|
12
15
|
"@cloudwerk/core": "^{{coreVersion}}",
|
|
@@ -17,9 +20,12 @@
|
|
|
17
20
|
"react-dom": "^19.0.0"
|
|
18
21
|
},
|
|
19
22
|
"devDependencies": {
|
|
23
|
+
"@tailwindcss/vite": "^4.1.18",
|
|
20
24
|
"@types/react": "^19.0.0",
|
|
21
25
|
"@types/react-dom": "^19.0.0",
|
|
26
|
+
"tailwindcss": "^4.1.18",
|
|
22
27
|
"typescript": "^5.0.0",
|
|
28
|
+
"vite": "^6.0.0",
|
|
23
29
|
"wrangler": "^4.0.0"
|
|
24
30
|
},
|
|
25
31
|
"engines": {
|
|
@@ -10,7 +10,12 @@
|
|
|
10
10
|
"outDir": "./dist",
|
|
11
11
|
"rootDir": "./app",
|
|
12
12
|
"jsx": "react-jsx",
|
|
13
|
-
"jsxImportSource": "react"
|
|
13
|
+
"jsxImportSource": "react",
|
|
14
|
+
"baseUrl": ".",
|
|
15
|
+
"paths": {
|
|
16
|
+
"@cloudwerk/core/bindings": ["./.cloudwerk/types/bindings.d.ts"],
|
|
17
|
+
"@cloudwerk/core/context": ["./.cloudwerk/types/context.d.ts"]
|
|
18
|
+
}
|
|
14
19
|
},
|
|
15
|
-
"include": ["app/**/*", "cloudwerk.config.ts"]
|
|
20
|
+
"include": [".cloudwerk/types/**/*", "app/**/*", "cloudwerk.config.ts", "global.d.ts"]
|
|
16
21
|
}
|
|
@@ -1,6 +1,15 @@
|
|
|
1
1
|
name = "{{name}}"
|
|
2
2
|
main = "dist/index.js"
|
|
3
|
-
compatibility_date = "2024-
|
|
3
|
+
compatibility_date = "2024-09-23"
|
|
4
|
+
compatibility_flags = ["nodejs_compat"]
|
|
5
|
+
account_id = "your_account_id"
|
|
6
|
+
|
|
7
|
+
[assets]
|
|
8
|
+
directory = "./dist/static"
|
|
9
|
+
binding = "ASSETS"
|
|
4
10
|
|
|
5
11
|
[build]
|
|
6
12
|
command = "npm run build"
|
|
13
|
+
|
|
14
|
+
[env.preview]
|
|
15
|
+
name = "{{name}}-preview"
|