Skip to content

Commit 649013d

Browse files
committed
chore: wip
1 parent b2b1915 commit 649013d

File tree

12 files changed

+123
-8
lines changed

12 files changed

+123
-8
lines changed

.stacks/api/nitro.config.ts

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
import { defineNitroConfig } from 'nitropack'
2+
// import { deploy } from '@stacksjs/config'
3+
import { alias } from '@stacksjs/alias'
4+
// import { resolve } from '@stacksjs/path'
5+
6+
// eslint-disable-next-line no-console
7+
console.log('here', alias)
8+
9+
export default defineNitroConfig({
10+
// alias,
11+
preset: 'aws-lambda',
12+
srcDir: './',
13+
})

.stacks/api/package.json

Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
{
2+
"name": "api",
3+
"type": "module",
4+
"version": "0.51.0",
5+
"packageManager": "pnpm@7.27.0",
6+
"description": "The Stacks generated API server.",
7+
"author": "Chris Breuer",
8+
"license": "MIT",
9+
"funding": "https://github.com/sponsors/chrisbbreuer",
10+
"homepage": "https://github.com/stacksjs/stacks/tree/main/.stacks#readme",
11+
"repository": {
12+
"type": "git",
13+
"url": "git+https://github.com/stacksjs/stacks.git",
14+
"directory": "./.stacks/api"
15+
},
16+
"bugs": {
17+
"url": "https://github.com/stacksjs/stacks/issues"
18+
},
19+
"keywords": [
20+
"api",
21+
"vite",
22+
"composables",
23+
"headless",
24+
"modern",
25+
"typescript"
26+
],
27+
"contributors": [
28+
"Chris Breuer <chris@ow3.org>"
29+
],
30+
"engines": {
31+
"node": ">=v18.14.0",
32+
"pnpm": ">=7.27.0"
33+
},
34+
"scripts": {
35+
"dev": "npx nitropack dev",
36+
"build": "npx nitropack build",
37+
"preview": "",
38+
"deploy": ""
39+
},
40+
"dependencies": {
41+
"@stacksjs/alias": "workspace:*",
42+
"@stacksjs/config": "workspace:*",
43+
"@stacksjs/path": "workspace:*",
44+
"@stacksjs/server": "workspace:*"
45+
}
46+
}

.stacks/api/routes/index.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
export default defineEventHandler(() => '.stacks is amazing!')

.stacks/core/server/src/nitro.config.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,5 +2,6 @@ import { defineNitroConfig } from 'nitropack'
22
import { projectPath } from '@stacksjs/path'
33

44
export default defineNitroConfig({
5+
preset: 'aws-lambda',
56
srcDir: projectPath(),
67
})

.stacks/core/types/src/deploy.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,8 @@ export interface DeployOptions {
44
*
55
* The host to deploy to.
66
*
7-
* @default string 'netlify'
7+
* @default string 'aws'
88
* @see https://stacksjs.dev/docs/components
99
*/
10-
driver: 'netlify' | 'vercel'
10+
driver: 'netlify' | 'vercel' | 'aws' | 'cloudflare' | 'azure' | 'digital-ocean'
1111
}

config/deploy.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,5 +8,5 @@ import type { DeployOptions } from '@stacksjs/types'
88
* you have any questions, feel free to reach out via Discord or GitHub Discussions.
99
*/
1010
export default <DeployOptions> {
11-
driver: 'netlify',
11+
driver: 'aws',
1212
}

config/docs.ts

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,29 @@
11
import { type DocsConfig } from '@stacksjs/types'
22
import { frameworkPath } from '@stacksjs/path'
3+
import type { PluginOption } from 'vite'
34
import services from './services'
45

6+
function CustomHmr(): PluginOption {
7+
return {
8+
name: 'custom-hmr',
9+
enforce: 'post',
10+
// HMR
11+
handleHotUpdate({ file, server }) {
12+
// eslint-disable-next-line no-console
13+
console.log('file', file)
14+
// eslint-disable-next-line no-console
15+
console.log('server', server)
16+
17+
// console.log('reloading json file...')
18+
19+
server.ws.send({
20+
type: 'full-reload',
21+
path: '*',
22+
})
23+
},
24+
}
25+
}
26+
527
/**
628
* **Documentation Options**
729
*
@@ -11,7 +33,13 @@ import services from './services'
1133
*/
1234
export default <DocsConfig> {
1335
vite: {
36+
server: {
37+
port: 3335,
38+
},
1439
root: frameworkPath('docs'),
40+
plugins: [
41+
CustomHmr(),
42+
],
1543
},
1644
outDir: frameworkPath('docs/dist'),
1745
lang: 'en-US',

pnpm-lock.yaml

Lines changed: 12 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

pnpm-workspace.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
packages:
2+
- ./.stacks/api
23
- ./.stacks/buddy
34
- ./.stacks/core/*
45
- ./.stacks/components/*

routes/index.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,4 +3,4 @@ import { defineEventHandler } from 'h3'
33

44
// console.log('HelloWorld', HelloWorld)
55

6-
export default defineEventHandler(() => '<h1>stacks loves nitro!</h1>')
6+
export default defineEventHandler(() => '<h1>I love Stacks!</h1>')

0 commit comments

Comments
 (0)