@ldsg/express-app-module-template-constants 0.3.45 → 0.3.47
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/template.json +6 -2
- package/package.json +3 -2
package/dist/template.json
CHANGED
|
@@ -1,8 +1,12 @@
|
|
|
1
1
|
{
|
|
2
2
|
"files": [
|
|
3
|
+
{
|
|
4
|
+
"path": "handlers.ts",
|
|
5
|
+
"content": "/**\n * 如下代码无实际意义,仅用于确保此应用正常编译,在构建应用时,此文件整体将被替换为如下格式:\n * export { handler as handler_abc } from \"@ldsg/abc\";\n * export { handler as handler_def } from \"@ldsg/def\";\n * export { handler as handler_123 } from \"@ldsg/123\";\n */\nexport { handler as handler_express_app } from \"@ldsg/express-app\";\n"
|
|
6
|
+
},
|
|
3
7
|
{
|
|
4
8
|
"path": "index.ts",
|
|
5
|
-
"content": "import { instantiateAppResource } from \"@ldsg/instantiate-app-resource\";\nimport {
|
|
9
|
+
"content": "import { instantiateAppResource } from \"@ldsg/instantiate-app-resource\";\nimport { ExpressAppResource } from \"@ldsg/express-app\";\nimport * as handlers from \"./handlers.js\";\nimport MANIFEST_JSON from \"./manifest.json\" with { type: \"json\" };\n\nconst { resourceRecords } = MANIFEST_JSON as any;\n\n/**\n * 将 handler 引入 app 并放入相应 handler 资源中\n * 使运行时无需通过 require(moduleId) 动态加载 handler 模块\n */\nconst wiredResourceRecords = (resourceRecords as any[]).map((resourceRecord: any) => {\n const { kind, id, settings } = resourceRecord;\n\n /**\n * handlers.ts 以 handler_<id> 为导出名,判定与取值必须用同一个 key\n */\n const handler = handlers[`handler_${id}`];\n\n if (kind === \"handler\" && handler) {\n return {\n ...resourceRecord,\n settings: {\n ...settings,\n handler,\n },\n };\n }\n\n return resourceRecord;\n});\n\nconst start = async () => {\n const appResource = (await instantiateAppResource({\n resourceRecords: wiredResourceRecords,\n })) as ExpressAppResource;\n\n const createExpressAppRes = appResource.createExpressApp();\n\n const { app } = createExpressAppRes;\n\n const port = process.env.PORT || \"3253\";\n\n app.listen(port, () => {\n console.log(`App listening on http://localhost:${port}`);\n\n console.log(`GraphQL listening on http://localhost:${port}/graphql`);\n });\n};\n\nstart();\n"
|
|
6
10
|
},
|
|
7
11
|
{
|
|
8
12
|
"path": "manifest.json",
|
|
@@ -10,7 +14,7 @@
|
|
|
10
14
|
},
|
|
11
15
|
{
|
|
12
16
|
"path": "package.json",
|
|
13
|
-
"content": "{\n \"name\": \"@ldsg/express-app-module-template\",\n \"version\": \"0.0.0\",\n \"private\": true,\n \"description\": \"\",\n \"license\": \"UNLICENSED\",\n \"author\": \"\",\n \"type\": \"module\",\n \"scripts\": {\n \"build\": \"vite build\",\n \"start\": \"node ./dist/index.js\",\n \"start:telemetry\": \"node --import @ldsg/opentelemetry-node ./dist/index.js\"\n },\n \"dependencies\": {\n \"@ldsg/
|
|
17
|
+
"content": "{\n \"name\": \"@ldsg/express-app-module-template\",\n \"version\": \"0.0.0\",\n \"private\": true,\n \"description\": \"\",\n \"license\": \"UNLICENSED\",\n \"author\": \"\",\n \"type\": \"module\",\n \"scripts\": {\n \"build\": \"vite build\",\n \"start\": \"node ./dist/index.js\",\n \"start:telemetry\": \"node --import @ldsg/opentelemetry-node ./dist/index.js\"\n },\n \"dependencies\": {\n \"@ldsg/express-app\": \"workspace:*\",\n \"@ldsg/instantiate-app-resource\": \"workspace:*\",\n \"@ldsg/opentelemetry-node\": \"workspace:*\",\n \"graphql\": \"^16.9.0\",\n \"graphql-middleware\": \"^6.1.35\",\n \"graphql-shield\": \"^7.6.5\"\n },\n \"devDependencies\": {\n \"@types/express\": \"^4.17.17\",\n \"@types/node\": \"^22.1.0\",\n \"typescript\": \"^5.5.4\",\n \"vite\": \"^7.1.7\"\n }\n}\n"
|
|
14
18
|
},
|
|
15
19
|
{
|
|
16
20
|
"path": "pnpm-workspace.yaml",
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ldsg/express-app-module-template-constants",
|
|
3
|
-
"version": "0.3.
|
|
3
|
+
"version": "0.3.47",
|
|
4
4
|
"description": "Constants generated from the app module template",
|
|
5
5
|
"keywords": [],
|
|
6
6
|
"license": "MIT",
|
|
@@ -18,7 +18,8 @@
|
|
|
18
18
|
"oxfmt": "latest",
|
|
19
19
|
"oxlint": "latest",
|
|
20
20
|
"tsx": "^4.19.3",
|
|
21
|
-
"typescript": "^5.8.3"
|
|
21
|
+
"typescript": "^5.8.3",
|
|
22
|
+
"@ldsg/express-app-module-template": "0.0.0"
|
|
22
23
|
},
|
|
23
24
|
"scripts": {
|
|
24
25
|
"build": "npm run clean && npm run generate && tsc --project tsconfig.build.json && npm run format",
|