@karmaniverous/smoz 0.2.3 → 0.2.4
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/cjs/index.js +1095 -413
- package/dist/cli/index.cjs +95 -95
- package/dist/index.d.ts +409 -199
- package/dist/mjs/index.js +1091 -409
- package/package.json +186 -185
- package/templates/default/.editorconfig +8 -0
- package/templates/default/.gitattributes +3 -0
- package/templates/default/.prettierrc.json +4 -3
- package/templates/default/.vscode/settings.json +23 -23
- package/templates/default/README.md +21 -1
- package/templates/default/app/config/app.config.ts +14 -3
- package/templates/default/app/config/openapi.ts +2 -3
- package/templates/default/serverless.ts +20 -2
- package/templates/default/typedoc.json +1 -1
package/package.json
CHANGED
|
@@ -1,185 +1,186 @@
|
|
|
1
|
-
{
|
|
2
|
-
"author": "Jason Williscroft",
|
|
3
|
-
"auto-changelog": {
|
|
4
|
-
"output": "CHANGELOG.md",
|
|
5
|
-
"unreleased": true,
|
|
6
|
-
"commitLimit": false,
|
|
7
|
-
"hideCredit": true
|
|
8
|
-
},
|
|
9
|
-
"bin": {
|
|
10
|
-
"smoz": "dist/cli/index.cjs"
|
|
11
|
-
},
|
|
12
|
-
"bugs": {
|
|
13
|
-
"url": "https://github.com/karmaniverous/smoz/issues"
|
|
14
|
-
},
|
|
15
|
-
"dependencies": {
|
|
16
|
-
"@middy/core": "^6.4.5",
|
|
17
|
-
"@middy/http-content-negotiation": "^6.4.5",
|
|
18
|
-
"@middy/http-cors": "^6.4.5",
|
|
19
|
-
"@middy/http-error-handler": "^6.4.5",
|
|
20
|
-
"@middy/http-event-normalizer": "^6.4.5",
|
|
21
|
-
"@middy/http-header-normalizer": "^6.4.5",
|
|
22
|
-
"@middy/http-json-body-parser": "^6.4.5",
|
|
23
|
-
"@middy/http-response-serializer": "^6.4.5",
|
|
24
|
-
"aws-lambda": "^1.0.7",
|
|
25
|
-
"chokidar": "^4.0.3",
|
|
26
|
-
"commander": "^14.0.1",
|
|
27
|
-
"http-errors": "^2.0.0",
|
|
28
|
-
"package-directory": "^8.1.0",
|
|
29
|
-
"radash": "^12.1.1",
|
|
30
|
-
"zod": "^4.1.8"
|
|
31
|
-
},
|
|
32
|
-
"description": "John Galt Services back end.",
|
|
33
|
-
"devDependencies": {
|
|
34
|
-
"@
|
|
35
|
-
"@
|
|
36
|
-
"@
|
|
37
|
-
"@
|
|
38
|
-
"@
|
|
39
|
-
"@types/
|
|
40
|
-
"@types/
|
|
41
|
-
"@types/
|
|
42
|
-
"@
|
|
43
|
-
"
|
|
44
|
-
"
|
|
45
|
-
"eslint
|
|
46
|
-
"eslint-
|
|
47
|
-
"eslint-plugin-
|
|
48
|
-
"
|
|
49
|
-
"
|
|
50
|
-
"
|
|
51
|
-
"
|
|
52
|
-
"
|
|
53
|
-
"
|
|
54
|
-
"
|
|
55
|
-
"
|
|
56
|
-
"rollup
|
|
57
|
-
"
|
|
58
|
-
"serverless
|
|
59
|
-
"serverless-
|
|
60
|
-
"serverless-
|
|
61
|
-
"serverless-
|
|
62
|
-
"serverless-
|
|
63
|
-
"
|
|
64
|
-
"
|
|
65
|
-
"typedoc
|
|
66
|
-
"typedoc-plugin-
|
|
67
|
-
"typedoc-plugin-
|
|
68
|
-
"
|
|
69
|
-
"typescript
|
|
70
|
-
"
|
|
71
|
-
"
|
|
72
|
-
"
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
"
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
"
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
"
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
"
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
"
|
|
97
|
-
|
|
98
|
-
"
|
|
99
|
-
"serverless
|
|
100
|
-
"
|
|
101
|
-
"
|
|
102
|
-
"
|
|
103
|
-
"openapi
|
|
104
|
-
"
|
|
105
|
-
"
|
|
106
|
-
"
|
|
107
|
-
"
|
|
108
|
-
"
|
|
109
|
-
"
|
|
110
|
-
"
|
|
111
|
-
"
|
|
112
|
-
"
|
|
113
|
-
"
|
|
114
|
-
"
|
|
115
|
-
"
|
|
116
|
-
"
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
"
|
|
120
|
-
"
|
|
121
|
-
"
|
|
122
|
-
"
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
"
|
|
129
|
-
"
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
"npm run
|
|
138
|
-
"npm run
|
|
139
|
-
"npm run
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
"
|
|
144
|
-
"
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
"git
|
|
149
|
-
"git
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
"
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
"
|
|
163
|
-
"
|
|
164
|
-
"
|
|
165
|
-
"
|
|
166
|
-
"
|
|
167
|
-
"domain:
|
|
168
|
-
"
|
|
169
|
-
"
|
|
170
|
-
"lint
|
|
171
|
-
"
|
|
172
|
-
"
|
|
173
|
-
"
|
|
174
|
-
"release
|
|
175
|
-
"
|
|
176
|
-
"
|
|
177
|
-
"
|
|
178
|
-
"
|
|
179
|
-
"
|
|
180
|
-
"
|
|
181
|
-
"templates:
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
"
|
|
185
|
-
|
|
1
|
+
{
|
|
2
|
+
"author": "Jason Williscroft",
|
|
3
|
+
"auto-changelog": {
|
|
4
|
+
"output": "CHANGELOG.md",
|
|
5
|
+
"unreleased": true,
|
|
6
|
+
"commitLimit": false,
|
|
7
|
+
"hideCredit": true
|
|
8
|
+
},
|
|
9
|
+
"bin": {
|
|
10
|
+
"smoz": "dist/cli/index.cjs"
|
|
11
|
+
},
|
|
12
|
+
"bugs": {
|
|
13
|
+
"url": "https://github.com/karmaniverous/smoz/issues"
|
|
14
|
+
},
|
|
15
|
+
"dependencies": {
|
|
16
|
+
"@middy/core": "^6.4.5",
|
|
17
|
+
"@middy/http-content-negotiation": "^6.4.5",
|
|
18
|
+
"@middy/http-cors": "^6.4.5",
|
|
19
|
+
"@middy/http-error-handler": "^6.4.5",
|
|
20
|
+
"@middy/http-event-normalizer": "^6.4.5",
|
|
21
|
+
"@middy/http-header-normalizer": "^6.4.5",
|
|
22
|
+
"@middy/http-json-body-parser": "^6.4.5",
|
|
23
|
+
"@middy/http-response-serializer": "^6.4.5",
|
|
24
|
+
"aws-lambda": "^1.0.7",
|
|
25
|
+
"chokidar": "^4.0.3",
|
|
26
|
+
"commander": "^14.0.1",
|
|
27
|
+
"http-errors": "^2.0.0",
|
|
28
|
+
"package-directory": "^8.1.0",
|
|
29
|
+
"radash": "^12.1.1",
|
|
30
|
+
"zod": "^4.1.8"
|
|
31
|
+
},
|
|
32
|
+
"description": "John Galt Services back end.",
|
|
33
|
+
"devDependencies": {
|
|
34
|
+
"@rollup/plugin-alias": "^5.1.1",
|
|
35
|
+
"@dotenvx/dotenvx": "^1.49.0",
|
|
36
|
+
"@eslint/js": "^9.35.0",
|
|
37
|
+
"@rollup/plugin-typescript": "^12.1.4",
|
|
38
|
+
"@serverless/typescript": "^4.18.2",
|
|
39
|
+
"@types/aws-lambda": "^8.10.152",
|
|
40
|
+
"@types/fs-extra": "^11.0.4",
|
|
41
|
+
"@types/http-errors": "^2.0.5",
|
|
42
|
+
"@types/serverless": "^3.12.27",
|
|
43
|
+
"@vitest/coverage-v8": "^3.2.4",
|
|
44
|
+
"auto-changelog": "^2.5.0",
|
|
45
|
+
"eslint": "^9.35.0",
|
|
46
|
+
"eslint-config-prettier": "^10.1.8",
|
|
47
|
+
"eslint-plugin-prettier": "^5.5.4",
|
|
48
|
+
"eslint-plugin-simple-import-sort": "^12.1.1",
|
|
49
|
+
"fs-extra": "^11.3.1",
|
|
50
|
+
"knip": "^5.63.1",
|
|
51
|
+
"lefthook": "^1.13.0",
|
|
52
|
+
"pkg-dir": "^9.0.0",
|
|
53
|
+
"prettier": "^3.6.2",
|
|
54
|
+
"release-it": "^19.0.4",
|
|
55
|
+
"rimraf": "^6.0.1",
|
|
56
|
+
"rollup": "^4.50.1",
|
|
57
|
+
"rollup-plugin-dts": "^6.2.3",
|
|
58
|
+
"serverless": "^4.18.2",
|
|
59
|
+
"serverless-apigateway-log-retention": "^1.1.0",
|
|
60
|
+
"serverless-deployment-bucket": "^1.6.0",
|
|
61
|
+
"serverless-domain-manager": "^8.0.0",
|
|
62
|
+
"serverless-offline": "^14.4.0",
|
|
63
|
+
"serverless-plugin-common-excludes": "^4.0.0",
|
|
64
|
+
"tsx": "^4.20.5",
|
|
65
|
+
"typedoc": "^0.28.12",
|
|
66
|
+
"typedoc-plugin-mdn-links": "^5.0.9",
|
|
67
|
+
"typedoc-plugin-replace-text": "^4.2.0",
|
|
68
|
+
"typedoc-plugin-zod": "^1.4.2",
|
|
69
|
+
"typescript": "^5.9.2",
|
|
70
|
+
"typescript-eslint": "^8.43.0",
|
|
71
|
+
"vite-tsconfig-paths": "^5.1.4",
|
|
72
|
+
"vitest": "^3.2.4",
|
|
73
|
+
"zod-openapi": "^5.4.1"
|
|
74
|
+
},
|
|
75
|
+
"exports": {
|
|
76
|
+
".": {
|
|
77
|
+
"import": {
|
|
78
|
+
"types": "./dist/index.d.ts",
|
|
79
|
+
"default": "./dist/mjs/index.js"
|
|
80
|
+
},
|
|
81
|
+
"require": {
|
|
82
|
+
"types": "./dist/index.d.ts",
|
|
83
|
+
"default": "./dist/cjs/index.js"
|
|
84
|
+
}
|
|
85
|
+
},
|
|
86
|
+
"./serverless-plugin": {
|
|
87
|
+
"import": "./dist/mjs/serverless-plugin.js",
|
|
88
|
+
"require": "./dist/cjs/serverless-plugin.js"
|
|
89
|
+
},
|
|
90
|
+
"./package.json": "./package.json"
|
|
91
|
+
},
|
|
92
|
+
"files": [
|
|
93
|
+
"dist",
|
|
94
|
+
"templates"
|
|
95
|
+
],
|
|
96
|
+
"homepage": "https://github.com/karmaniverous/smoz#readme",
|
|
97
|
+
"keywords": [
|
|
98
|
+
"smoz",
|
|
99
|
+
"serverless",
|
|
100
|
+
"serverless-framework",
|
|
101
|
+
"aws-lambda",
|
|
102
|
+
"middy",
|
|
103
|
+
"openapi",
|
|
104
|
+
"openapi-3-1",
|
|
105
|
+
"zod",
|
|
106
|
+
"typescript",
|
|
107
|
+
"api-gateway",
|
|
108
|
+
"http-middleware",
|
|
109
|
+
"validation",
|
|
110
|
+
"schema-first",
|
|
111
|
+
"lambda-handlers",
|
|
112
|
+
"openapi-generator",
|
|
113
|
+
"api-docs",
|
|
114
|
+
"content-negotiation",
|
|
115
|
+
"cors",
|
|
116
|
+
"error-handling",
|
|
117
|
+
"toolkit"
|
|
118
|
+
],
|
|
119
|
+
"license": "BSD-3-Clause",
|
|
120
|
+
"main": "dist/cjs/index.js",
|
|
121
|
+
"module": "dist/mjs/index.js",
|
|
122
|
+
"name": "@karmaniverous/smoz",
|
|
123
|
+
"publishConfig": {
|
|
124
|
+
"access": "public"
|
|
125
|
+
},
|
|
126
|
+
"release-it": {
|
|
127
|
+
"git": {
|
|
128
|
+
"changelog": "npx auto-changelog --stdout --template https://raw.githubusercontent.com/release-it/release-it/main/templates/changelog-compact.hbs",
|
|
129
|
+
"commitMessage": "chore: release v${version}",
|
|
130
|
+
"requireBranch": "main"
|
|
131
|
+
},
|
|
132
|
+
"github": {
|
|
133
|
+
"release": true
|
|
134
|
+
},
|
|
135
|
+
"hooks": {
|
|
136
|
+
"after:init": [
|
|
137
|
+
"npm run lint",
|
|
138
|
+
"npm run test",
|
|
139
|
+
"npm run knip",
|
|
140
|
+
"npm run build"
|
|
141
|
+
],
|
|
142
|
+
"before:npm:release": [
|
|
143
|
+
"npx auto-changelog -p",
|
|
144
|
+
"npm run docs",
|
|
145
|
+
"git add -A"
|
|
146
|
+
],
|
|
147
|
+
"after:release": [
|
|
148
|
+
"git switch -c release/${version}",
|
|
149
|
+
"git push -u origin release/${version}",
|
|
150
|
+
"git switch ${branchName}"
|
|
151
|
+
]
|
|
152
|
+
},
|
|
153
|
+
"npm": {
|
|
154
|
+
"publish": true
|
|
155
|
+
}
|
|
156
|
+
},
|
|
157
|
+
"repository": {
|
|
158
|
+
"type": "git",
|
|
159
|
+
"url": "git+https://github.com/karmaniverous/smoz.git"
|
|
160
|
+
},
|
|
161
|
+
"scripts": {
|
|
162
|
+
"build": "rimraf dist && rollup --config rollup.config.ts --configPlugin @rollup/plugin-typescript",
|
|
163
|
+
"changelog": "auto-changelog",
|
|
164
|
+
"deploy": "tsx src/cli/index.ts register && serverless deploy",
|
|
165
|
+
"diagrams": "cd diagrams/src && plantuml -tpng -o ../out -r .",
|
|
166
|
+
"docs": "typedoc",
|
|
167
|
+
"domain:create": "serverless create_domain",
|
|
168
|
+
"domain:delete": "serverless delete_domain",
|
|
169
|
+
"knip": "knip",
|
|
170
|
+
"lint": "eslint .",
|
|
171
|
+
"lint:fix": "eslint --fix .",
|
|
172
|
+
"openapi": "tsx src/cli/index.ts register && tsx app/config/openapi && prettier -w app/generated/openapi.json",
|
|
173
|
+
"package": "tsx src/cli/index.ts register && serverless package",
|
|
174
|
+
"release": "dotenvx run -f .env.local -- release-it",
|
|
175
|
+
"release:pre": "dotenvx run -f .env.local -- release-it --no-git.requireBranch --github.prerelease --preRelease",
|
|
176
|
+
"remove": "serverless remove",
|
|
177
|
+
"smoz": "tsx src/cli/index.ts",
|
|
178
|
+
"stan:docs": "typedoc --emit none",
|
|
179
|
+
"test": "vitest run",
|
|
180
|
+
"typecheck": "tsx src/cli/index.ts register && tsc -p tsconfig.json --noEmit",
|
|
181
|
+
"templates:typecheck": "tsx scripts/templates-typecheck.ts",
|
|
182
|
+
"templates:lint": "eslint --fix -c templates/default/eslint.config.ts \"templates/default/**/*.{ts,tsx,js,jsx}\" \"templates/default/eslint.config.ts\""
|
|
183
|
+
},
|
|
184
|
+
"type": "module",
|
|
185
|
+
"version": "0.2.4"
|
|
186
|
+
}
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
-
{
|
|
2
|
-
"
|
|
3
|
-
|
|
1
|
+
{
|
|
2
|
+
"endOfLine": "lf",
|
|
3
|
+
"singleQuote": true
|
|
4
|
+
}
|
|
@@ -1,23 +1,23 @@
|
|
|
1
|
-
{
|
|
2
|
-
"[markdown]": {
|
|
3
|
-
"editor.wordWrap": "bounded"
|
|
4
|
-
},
|
|
5
|
-
"diffEditor.ignoreTrimWhitespace": false,
|
|
6
|
-
"editor.defaultFormatter": "esbenp.prettier-vscode",
|
|
7
|
-
"editor.formatOnPaste": true,
|
|
8
|
-
"editor.formatOnSave": true,
|
|
9
|
-
"eslint.useFlatConfig": true,
|
|
10
|
-
"eslint.validate": [
|
|
11
|
-
"javascript",
|
|
12
|
-
"javascriptreact",
|
|
13
|
-
"typescript",
|
|
14
|
-
"typescriptreact"
|
|
15
|
-
],
|
|
16
|
-
"
|
|
17
|
-
"git.
|
|
18
|
-
"
|
|
19
|
-
"javascript.updateImportsOnFileMove.enabled": "always",
|
|
20
|
-
"prettier.prettierPath": "./node_modules/prettier",
|
|
21
|
-
"prettier.singleQuote": true,
|
|
22
|
-
"yaml.format.singleQuote": true
|
|
23
|
-
}
|
|
1
|
+
{
|
|
2
|
+
"[markdown]": {
|
|
3
|
+
"editor.wordWrap": "bounded"
|
|
4
|
+
},
|
|
5
|
+
"diffEditor.ignoreTrimWhitespace": false,
|
|
6
|
+
"editor.defaultFormatter": "esbenp.prettier-vscode",
|
|
7
|
+
"editor.formatOnPaste": true,
|
|
8
|
+
"editor.formatOnSave": true,
|
|
9
|
+
"eslint.useFlatConfig": true,
|
|
10
|
+
"eslint.validate": [
|
|
11
|
+
"javascript",
|
|
12
|
+
"javascriptreact",
|
|
13
|
+
"typescript",
|
|
14
|
+
"typescriptreact"
|
|
15
|
+
],
|
|
16
|
+
"files.eol": "\n",
|
|
17
|
+
"git.autofetch": true,
|
|
18
|
+
"git.enableSmartCommit": true,
|
|
19
|
+
"javascript.preferences.importModuleSpecifierEnding": "minimal", "javascript.updateImportsOnFileMove.enabled": "always",
|
|
20
|
+
"prettier.prettierPath": "./node_modules/prettier",
|
|
21
|
+
"prettier.singleQuote": true,
|
|
22
|
+
"yaml.format.singleQuote": true
|
|
23
|
+
}
|
|
@@ -61,10 +61,30 @@ Tip: Commit `app/generated/register.*.ts` so typecheck is stable without running
|
|
|
61
61
|
- Generate OpenAPI
|
|
62
62
|
- Package or deploy with your preferred toolchain
|
|
63
63
|
|
|
64
|
+
## Params used by serverless.ts
|
|
65
|
+
|
|
66
|
+
This template references a few params from your app config:
|
|
67
|
+
|
|
68
|
+
- Global params (app/config/app.config.ts → global.params)
|
|
69
|
+
- `ESB_MINIFY` (boolean) — controls `build.esbuild.minify`
|
|
70
|
+
- `ESB_SOURCEMAP` (boolean) — controls `build.esbuild.sourcemap`
|
|
71
|
+
- `PROFILE`, `REGION`, `SERVICE_NAME`
|
|
72
|
+
- Stage params (app/config/app.config.ts → stage.params.<stage>)
|
|
73
|
+
- `DOMAIN_NAME` — used by the custom domain plugin config
|
|
74
|
+
- `DOMAIN_CERTIFICATE_ARN` — ACM certificate ARN for the domain
|
|
75
|
+
- `STAGE`
|
|
76
|
+
|
|
77
|
+
Where these are used:
|
|
78
|
+
|
|
79
|
+
- The esbuild block in `serverless.ts` reads `ESB_MINIFY` and `ESB_SOURCEMAP`
|
|
80
|
+
to toggle minification and sourcemaps.
|
|
81
|
+
- The `customDomain` section in `serverless.ts` reads `DOMAIN_NAME` and
|
|
82
|
+
`DOMAIN_CERTIFICATE_ARN`. Update these with your values or remove the
|
|
83
|
+
custom domain plugin if not needed.
|
|
84
|
+
|
|
64
85
|
## Path hygiene (cross‑platform)
|
|
65
86
|
|
|
66
87
|
Windows uses backslashes in paths, which can leak into string comparisons and generated artifacts. Normalize separators consistently using the helper exported by the toolkit:
|
|
67
|
-
|
|
68
88
|
```ts
|
|
69
89
|
import { toPosixPath } from '@karmaniverous/smoz';
|
|
70
90
|
|
|
@@ -12,11 +12,15 @@ export const APP_ROOT_ABS = toPosixPath(
|
|
|
12
12
|
export const app = App.create({
|
|
13
13
|
appRootAbs: APP_ROOT_ABS,
|
|
14
14
|
globalParamsSchema: z.object({
|
|
15
|
+
ESB_MINIFY: z.boolean(),
|
|
16
|
+
ESB_SOURCEMAP: z.boolean(),
|
|
15
17
|
PROFILE: z.string(),
|
|
16
18
|
REGION: z.string(),
|
|
17
19
|
SERVICE_NAME: z.string(),
|
|
18
20
|
}),
|
|
19
21
|
stageParamsSchema: z.object({
|
|
22
|
+
DOMAIN_CERTIFICATE_ARN: z.string(),
|
|
23
|
+
DOMAIN_NAME: z.string(),
|
|
20
24
|
STAGE: z.string(),
|
|
21
25
|
}),
|
|
22
26
|
eventTypeMapSchema: baseEventTypeMapSchema,
|
|
@@ -31,17 +35,24 @@ export const app = App.create({
|
|
|
31
35
|
},
|
|
32
36
|
global: {
|
|
33
37
|
params: {
|
|
38
|
+
ESB_MINIFY: false,
|
|
39
|
+
ESB_SOURCEMAP: true,
|
|
34
40
|
PROFILE: 'dev',
|
|
35
41
|
REGION: 'us-east-1',
|
|
36
42
|
SERVICE_NAME: 'my-smoz-app',
|
|
37
43
|
},
|
|
38
|
-
envKeys: ['PROFILE', 'REGION', 'SERVICE_NAME']
|
|
44
|
+
envKeys: ['PROFILE', 'REGION', 'SERVICE_NAME'],
|
|
39
45
|
},
|
|
40
46
|
stage: {
|
|
41
47
|
params: {
|
|
42
|
-
dev: {
|
|
48
|
+
dev: {
|
|
49
|
+
DOMAIN_CERTIFICATE_ARN:
|
|
50
|
+
'arn:aws:acm:us-east-1:000000000000:certificate/dev-placeholder',
|
|
51
|
+
DOMAIN_NAME: 'api.dev.example.test',
|
|
52
|
+
STAGE: 'dev',
|
|
53
|
+
},
|
|
43
54
|
},
|
|
44
|
-
envKeys: ['STAGE']
|
|
55
|
+
envKeys: ['STAGE'],
|
|
45
56
|
},
|
|
46
57
|
});
|
|
47
58
|
|
|
@@ -8,12 +8,11 @@ import { app } from '@/app/config/app.config';
|
|
|
8
8
|
/**
|
|
9
9
|
* Template note:
|
|
10
10
|
* - Templates do NOT commit generated register files under app/generated; they
|
|
11
|
-
* are declared via ambient types (templates/
|
|
11
|
+
* are declared via ambient types (templates/default/types/registers.d.ts) so
|
|
12
12
|
* TypeScript can typecheck without artifacts.
|
|
13
13
|
* - To ensure side effects still run (endpoint registration) and to satisfy
|
|
14
14
|
* noUncheckedSideEffectImports, import the register module as a namespace and
|
|
15
|
-
* reference it via `void`.
|
|
16
|
-
* - In real apps, `smoz init` seeds placeholders and `smoz register` rewrites
|
|
15
|
+
* reference it via `void`. * - In real apps, `smoz init` seeds placeholders and `smoz register` rewrites
|
|
17
16
|
* app/generated/register.*.ts at author time.
|
|
18
17
|
*/
|
|
19
18
|
import * as __register_openapi from '@/app/generated/register.openapi';
|
|
@@ -4,7 +4,7 @@ import { app } from '@/app/config/app.config';
|
|
|
4
4
|
/**
|
|
5
5
|
* Template note:
|
|
6
6
|
* - Templates do NOT commit generated register files under app/generated; they
|
|
7
|
-
* are declared via ambient types (templates/
|
|
7
|
+
* are declared via ambient types (templates/default/types/registers.d.ts) so
|
|
8
8
|
* TypeScript can typecheck without artifacts.
|
|
9
9
|
* - To ensure side effects still run (endpoint/serverless registration) and to
|
|
10
10
|
* satisfy noUncheckedSideEffectImports, import register modules as namespaces
|
|
@@ -16,7 +16,6 @@ import * as __register_functions from '@/app/generated/register.functions';
|
|
|
16
16
|
import * as __register_serverless from '@/app/generated/register.serverless';
|
|
17
17
|
void __register_functions;
|
|
18
18
|
void __register_serverless;
|
|
19
|
-
|
|
20
19
|
const config: AWS = {
|
|
21
20
|
service: '${param:SERVICE_NAME}',
|
|
22
21
|
frameworkVersion: '4',
|
|
@@ -108,6 +107,25 @@ const config: AWS = {
|
|
|
108
107
|
versionFunctions: false,
|
|
109
108
|
},
|
|
110
109
|
functions: app.buildAllServerlessFunctions() as NonNullable<AWS['functions']>,
|
|
110
|
+
// Optional esbuild configuration (parity with /app fixture):
|
|
111
|
+
// These booleans are driven by global params in app.config.ts:
|
|
112
|
+
// ESB_MINIFY, ESB_SOURCEMAP
|
|
113
|
+
build: {
|
|
114
|
+
esbuild: {
|
|
115
|
+
bundle: true,
|
|
116
|
+
// Param placeholders resolve at deploy/package time; assert to boolean for TS.
|
|
117
|
+
minify: '${param:ESB_MINIFY}' as unknown as boolean,
|
|
118
|
+
sourcemap: '${param:ESB_SOURCEMAP}' as unknown as boolean,
|
|
119
|
+
// This keeps the AWS SDK external and trims bundles.
|
|
120
|
+
exclude: ['@aws-sdk/*'],
|
|
121
|
+
target: 'node22',
|
|
122
|
+
platform: 'node',
|
|
123
|
+
// Avoid bundling require.resolve shims
|
|
124
|
+
define: {
|
|
125
|
+
'require.resolve': undefined,
|
|
126
|
+
},
|
|
127
|
+
},
|
|
128
|
+
},
|
|
111
129
|
};
|
|
112
130
|
|
|
113
131
|
export default config;
|