@ldsg/constants 0.3.42 → 0.3.44
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.d.ts +3 -267
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +5 -14
- package/package.json +2 -6
- package/dist/app-manifest.json +0 -658
- package/dist/base-resource-kinds.json +0 -1
- package/dist/files-in-app-template-module.json +0 -165
- package/dist/files-in-handler-template-module.json +0 -57
- package/dist/resource-definition-related-resource-records.json +0 -646
|
@@ -1,165 +0,0 @@
|
|
|
1
|
-
[
|
|
2
|
-
{
|
|
3
|
-
"path": "index.ts",
|
|
4
|
-
"data": "import { createApp } from \"@ldsg/create-app\";\nimport MANIFEST_JSON from \"./manifest.json\" with { type: \"json\" };\n\nconst { resourceRecords } = MANIFEST_JSON as any;\n\nconst start = async () => {\n const app = await createApp({\n resourceRecords,\n });\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"
|
|
5
|
-
},
|
|
6
|
-
{
|
|
7
|
-
"path": "manifest.json",
|
|
8
|
-
"data": {
|
|
9
|
-
"resourceRecords": [
|
|
10
|
-
{
|
|
11
|
-
"id": "resource-definition-resource-definition",
|
|
12
|
-
"kind": "resource_definition",
|
|
13
|
-
"parentId": "root",
|
|
14
|
-
"settings": {
|
|
15
|
-
"title": "资源定义资源定义",
|
|
16
|
-
"description": "",
|
|
17
|
-
"kind": "resource_definition",
|
|
18
|
-
"parentKind": ""
|
|
19
|
-
}
|
|
20
|
-
},
|
|
21
|
-
{
|
|
22
|
-
"id": "resource-definition-resource-handler",
|
|
23
|
-
"kind": "handler",
|
|
24
|
-
"parentId": "resource-definition-resource-definition",
|
|
25
|
-
"settings": {
|
|
26
|
-
"title": "资源定义实例化资源处理程序",
|
|
27
|
-
"description": "",
|
|
28
|
-
"code": "export * from \"@ldsg/resource-definition\";",
|
|
29
|
-
"dependencies": [
|
|
30
|
-
{
|
|
31
|
-
"name": "@ldsg/resource-definition"
|
|
32
|
-
}
|
|
33
|
-
]
|
|
34
|
-
}
|
|
35
|
-
},
|
|
36
|
-
{
|
|
37
|
-
"id": "handler-resource-definition",
|
|
38
|
-
"kind": "resource_definition",
|
|
39
|
-
"parentId": "root",
|
|
40
|
-
"settings": {
|
|
41
|
-
"title": "处理程序资源定义",
|
|
42
|
-
"description": "主要包含引入模块列表与相应的处理程序代码,处理程序类型资源无子级资源。",
|
|
43
|
-
"kind": "handler",
|
|
44
|
-
"parentKind": ""
|
|
45
|
-
}
|
|
46
|
-
},
|
|
47
|
-
{
|
|
48
|
-
"id": "handler-resource-handler",
|
|
49
|
-
"kind": "handler",
|
|
50
|
-
"parentId": "handler-resource-definition",
|
|
51
|
-
"settings": {
|
|
52
|
-
"title": "处理程序实例化资源处理程序",
|
|
53
|
-
"description": "包含处理程序相应的模块,此模块主要通过",
|
|
54
|
-
"code": "export * from \"@ldsg/handler\";",
|
|
55
|
-
"dependencies": [
|
|
56
|
-
{
|
|
57
|
-
"name": "@ldsg/handler"
|
|
58
|
-
}
|
|
59
|
-
]
|
|
60
|
-
}
|
|
61
|
-
},
|
|
62
|
-
{
|
|
63
|
-
"id": "application-resource-definition",
|
|
64
|
-
"kind": "resource_definition",
|
|
65
|
-
"parentId": "root",
|
|
66
|
-
"settings": {
|
|
67
|
-
"title": "应用资源定义",
|
|
68
|
-
"description": "",
|
|
69
|
-
"kind": "application",
|
|
70
|
-
"parentKind": ""
|
|
71
|
-
}
|
|
72
|
-
},
|
|
73
|
-
{
|
|
74
|
-
"id": "application-resource-handler",
|
|
75
|
-
"kind": "handler",
|
|
76
|
-
"parentId": "application-resource-definition",
|
|
77
|
-
"settings": {
|
|
78
|
-
"title": "应用实例化资源处理程序",
|
|
79
|
-
"description": "",
|
|
80
|
-
"code": "export * from \"@ldsg/application\";",
|
|
81
|
-
"dependencies": [
|
|
82
|
-
{
|
|
83
|
-
"name": "@ldsg/application"
|
|
84
|
-
}
|
|
85
|
-
]
|
|
86
|
-
}
|
|
87
|
-
},
|
|
88
|
-
{
|
|
89
|
-
"id": "main-app",
|
|
90
|
-
"kind": "application",
|
|
91
|
-
"parentId": "root",
|
|
92
|
-
"settings": {
|
|
93
|
-
"title": "主要应用",
|
|
94
|
-
"description": ""
|
|
95
|
-
}
|
|
96
|
-
}
|
|
97
|
-
]
|
|
98
|
-
}
|
|
99
|
-
},
|
|
100
|
-
{
|
|
101
|
-
"path": "package.json",
|
|
102
|
-
"data": {
|
|
103
|
-
"name": "@ldsg/app-template",
|
|
104
|
-
"version": "0.0.0",
|
|
105
|
-
"private": true,
|
|
106
|
-
"description": "",
|
|
107
|
-
"license": "UNLICENSED",
|
|
108
|
-
"author": "",
|
|
109
|
-
"type": "module",
|
|
110
|
-
"scripts": {
|
|
111
|
-
"build": "vite build",
|
|
112
|
-
"start": "node ./dist/index.js",
|
|
113
|
-
"start:telemetry": "node --import @ldsg/opentelemetry-node ./dist/index.js"
|
|
114
|
-
},
|
|
115
|
-
"dependencies": {
|
|
116
|
-
"@ldsg/create-app": "workspace:*",
|
|
117
|
-
"@ldsg/opentelemetry-node": "workspace:*",
|
|
118
|
-
"graphql": "^16.9.0",
|
|
119
|
-
"graphql-middleware": "^6.1.35",
|
|
120
|
-
"graphql-shield": "^7.6.5"
|
|
121
|
-
},
|
|
122
|
-
"devDependencies": {
|
|
123
|
-
"@types/express": "^4.17.17",
|
|
124
|
-
"@types/node": "^22.1.0",
|
|
125
|
-
"typescript": "^5.5.4",
|
|
126
|
-
"vite": "^7.1.7"
|
|
127
|
-
}
|
|
128
|
-
}
|
|
129
|
-
},
|
|
130
|
-
{
|
|
131
|
-
"path": "pnpm-workspace.yaml",
|
|
132
|
-
"data": "packages:\n - \"handlers/*\"\n"
|
|
133
|
-
},
|
|
134
|
-
{
|
|
135
|
-
"path": "tsconfig.json",
|
|
136
|
-
"data": {
|
|
137
|
-
"compilerOptions": {
|
|
138
|
-
"module": "NodeNext",
|
|
139
|
-
"declaration": true,
|
|
140
|
-
"removeComments": true,
|
|
141
|
-
"emitDecoratorMetadata": true,
|
|
142
|
-
"experimentalDecorators": true,
|
|
143
|
-
"allowSyntheticDefaultImports": true,
|
|
144
|
-
"target": "esnext",
|
|
145
|
-
"sourceMap": true,
|
|
146
|
-
"outDir": "./dist",
|
|
147
|
-
"baseUrl": "./",
|
|
148
|
-
"incremental": true,
|
|
149
|
-
"skipLibCheck": true,
|
|
150
|
-
"strictNullChecks": false,
|
|
151
|
-
"noImplicitAny": false,
|
|
152
|
-
"strictBindCallApply": false,
|
|
153
|
-
"forceConsistentCasingInFileNames": false,
|
|
154
|
-
"noFallthroughCasesInSwitch": false,
|
|
155
|
-
"resolveJsonModule": true,
|
|
156
|
-
"esModuleInterop": true
|
|
157
|
-
},
|
|
158
|
-
"include": ["./*.ts"]
|
|
159
|
-
}
|
|
160
|
-
},
|
|
161
|
-
{
|
|
162
|
-
"path": "vite.config.ts",
|
|
163
|
-
"data": "import { defineConfig } from \"vite\";\n\nexport default defineConfig({\n build: {\n outDir: \"dist\",\n ssr: \"index.ts\",\n commonjsOptions: {\n /**\n * 把 workspace 符号链接的 CJS 依赖(如 @ldsg/*)也转成 ESM 一并打包\n */\n include: [/.*/],\n },\n rollupOptions: {\n output: {\n inlineDynamicImports: true,\n },\n },\n },\n ssr: {\n /**\n * 全量打包依赖进单文件,运行时无需 node_modules\n */\n noExternal: true,\n },\n plugins: [\n {\n /**\n * 把仅在桌面端使用的包(如 got@8 内引用的 electron)替换为空模块,\n * 避免服务端 bundle 启动时因找不到该包而报错\n */\n name: \"ldsg:shim-server-externals\",\n enforce: \"pre\",\n resolveId(id) {\n if (id === \"electron\") return \"\\0ldsg-shim:electron\";\n return null;\n },\n load(id) {\n if (id === \"\\0ldsg-shim:electron\") return \"export default {};\";\n return null;\n },\n },\n {\n /**\n * rollup 的 CJS interop 会把 graphql-compose 的 ObjectTypeComposer 类加上数字后缀\n * (如 ObjectTypeComposer2),破坏 graphql-compose-mongoose 基于 constructor.name\n * 的字符串校验(Second arg for Resolver count() should be instance of ObjectTypeComposer)。\n * 这里在产物里把类名恢复为 ObjectTypeComposer。\n */\n name: \"ldsg:restore-cjs-class-names\",\n enforce: \"post\",\n generateBundle(_options, bundle) {\n for (const file of Object.values(bundle)) {\n if (file.type === \"chunk\" && typeof file.code === \"string\") {\n file.code = file.code.replace(/\\bObjectTypeComposer\\d*\\b/g, \"ObjectTypeComposer\");\n }\n }\n },\n },\n ],\n});\n"
|
|
164
|
-
}
|
|
165
|
-
]
|
|
@@ -1,57 +0,0 @@
|
|
|
1
|
-
[
|
|
2
|
-
{
|
|
3
|
-
"path": "index.ts",
|
|
4
|
-
"data": "export const handler = () => {};\n"
|
|
5
|
-
},
|
|
6
|
-
{
|
|
7
|
-
"path": "package.json",
|
|
8
|
-
"data": {
|
|
9
|
-
"name": "@ldsg/handler-template",
|
|
10
|
-
"version": "0.0.0",
|
|
11
|
-
"private": true,
|
|
12
|
-
"description": "",
|
|
13
|
-
"license": "UNLICENSED",
|
|
14
|
-
"files": ["dist/"],
|
|
15
|
-
"main": "dist/index.js",
|
|
16
|
-
"types": "dist",
|
|
17
|
-
"scripts": {
|
|
18
|
-
"build": "tsc"
|
|
19
|
-
},
|
|
20
|
-
"dependencies": {},
|
|
21
|
-
"devDependencies": {
|
|
22
|
-
"@types/express": "^4.17.17",
|
|
23
|
-
"@types/node": "^22.1.0",
|
|
24
|
-
"ts-loader": "^9.5.1",
|
|
25
|
-
"tslib": "^2.6.3",
|
|
26
|
-
"typescript": "^5.5.4"
|
|
27
|
-
}
|
|
28
|
-
}
|
|
29
|
-
},
|
|
30
|
-
{
|
|
31
|
-
"path": "tsconfig.json",
|
|
32
|
-
"data": {
|
|
33
|
-
"compilerOptions": {
|
|
34
|
-
"module": "commonjs",
|
|
35
|
-
"declaration": true,
|
|
36
|
-
"removeComments": true,
|
|
37
|
-
"emitDecoratorMetadata": true,
|
|
38
|
-
"experimentalDecorators": true,
|
|
39
|
-
"allowSyntheticDefaultImports": true,
|
|
40
|
-
"target": "ES2021",
|
|
41
|
-
"sourceMap": true,
|
|
42
|
-
"outDir": "./dist",
|
|
43
|
-
"baseUrl": "./",
|
|
44
|
-
"incremental": true,
|
|
45
|
-
"skipLibCheck": true,
|
|
46
|
-
"strictNullChecks": false,
|
|
47
|
-
"noImplicitAny": false,
|
|
48
|
-
"strictBindCallApply": false,
|
|
49
|
-
"forceConsistentCasingInFileNames": false,
|
|
50
|
-
"noFallthroughCasesInSwitch": false,
|
|
51
|
-
"resolveJsonModule": true,
|
|
52
|
-
"esModuleInterop": true
|
|
53
|
-
},
|
|
54
|
-
"include": ["./index.ts"]
|
|
55
|
-
}
|
|
56
|
-
}
|
|
57
|
-
]
|