@emarketeer/ts-microservice-commons 9.0.0 → 10.1.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/build-handlers.js +15 -4
- package/package.json +13 -13
package/dist/build-handlers.js
CHANGED
|
@@ -135,14 +135,24 @@ if (!fs__namespace.existsSync(absoluteHandlersDir)) {
|
|
|
135
135
|
console.error(`Handlers directory not found: ${absoluteHandlersDir}`);
|
|
136
136
|
process.exit(1);
|
|
137
137
|
}
|
|
138
|
+
// Packages that some services use and others don't. When a consuming service
|
|
139
|
+
// declares them in package.json we bundle them; otherwise we mark them external
|
|
140
|
+
// so esbuild doesn't fail trying to resolve a transitive import that will never
|
|
141
|
+
// run. Extend this list as new conditional deps surface.
|
|
142
|
+
const optionalDependencies = ['chromium-bidi'];
|
|
143
|
+
function resolveExternalOptionalDeps() {
|
|
144
|
+
const pkg = JSON.parse(fs__namespace.readFileSync(path__namespace.join(rootDir, 'package.json'), 'utf8'));
|
|
145
|
+
const deps = pkg.dependencies ?? {};
|
|
146
|
+
return optionalDependencies.filter(dep => !(dep in deps));
|
|
147
|
+
}
|
|
138
148
|
async function main() {
|
|
139
149
|
const entryPoints = await findEntryPoints(absoluteHandlersDir);
|
|
140
150
|
if (entryPoints.length === 0) {
|
|
141
151
|
if (allowEmpty) {
|
|
142
152
|
// Log the resolved absolute path so a misrouted --handlers-dir (typo'd
|
|
143
153
|
// to a real-but-empty sibling directory) is visible in CI output.
|
|
144
|
-
console.warn(`No handlers found in ${handlersDir} (resolved: ${absoluteHandlersDir}), `
|
|
145
|
-
|
|
154
|
+
console.warn(`No handlers found in ${handlersDir} (resolved: ${absoluteHandlersDir}), ` +
|
|
155
|
+
'skipping build (--allow-empty)');
|
|
146
156
|
return;
|
|
147
157
|
}
|
|
148
158
|
console.error(`No handlers found in ${handlersDir}. Pass --allow-empty to suppress this error.`);
|
|
@@ -173,7 +183,8 @@ async function main() {
|
|
|
173
183
|
'tedious',
|
|
174
184
|
'pg-query-stream',
|
|
175
185
|
'libsql',
|
|
176
|
-
'mariadb'
|
|
186
|
+
'mariadb',
|
|
187
|
+
...resolveExternalOptionalDeps()
|
|
177
188
|
],
|
|
178
189
|
plugins: [recapDevHandlerWrapper, ...defaultPlugins]
|
|
179
190
|
});
|
|
@@ -191,7 +202,7 @@ main().catch(err => {
|
|
|
191
202
|
else {
|
|
192
203
|
// Print the full stack (and `cause` chain) so non-esbuild errors are
|
|
193
204
|
// diagnosable in CI output rather than being collapsed to the message.
|
|
194
|
-
console.error(err instanceof Error ?
|
|
205
|
+
console.error(err instanceof Error ? err.stack ?? err : err);
|
|
195
206
|
}
|
|
196
207
|
process.exit(1);
|
|
197
208
|
});
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@emarketeer/ts-microservice-commons",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "10.1.0",
|
|
4
4
|
"description": "",
|
|
5
5
|
"keywords": [],
|
|
6
6
|
"bin": {
|
|
@@ -119,22 +119,22 @@
|
|
|
119
119
|
},
|
|
120
120
|
"dependencies": {
|
|
121
121
|
"@emarketeer/esbuild-plugin-tsc": "^0.4.1",
|
|
122
|
-
"@types/jest": "
|
|
123
|
-
"@typescript-eslint/eslint-plugin": "
|
|
124
|
-
"@typescript-eslint/parser": "
|
|
122
|
+
"@types/jest": "29.5.14",
|
|
123
|
+
"@typescript-eslint/eslint-plugin": "5.62.0",
|
|
124
|
+
"@typescript-eslint/parser": "5.62.0",
|
|
125
125
|
"cross-env": "^6.0.0",
|
|
126
126
|
"cross-spawn": "^7.0.1",
|
|
127
127
|
"esbuild": "^0.25.2",
|
|
128
128
|
"eslint": "7.32.0",
|
|
129
|
-
"eslint-config-airbnb-base": "
|
|
130
|
-
"eslint-plugin-import": "
|
|
131
|
-
"eslint-plugin-jest": "
|
|
132
|
-
"eslint-plugin-sonarjs": "
|
|
133
|
-
"jest": "
|
|
134
|
-
"jest-circus": "
|
|
135
|
-
"jest-extended": "
|
|
136
|
-
"ts-jest": "
|
|
137
|
-
"typescript": "
|
|
129
|
+
"eslint-config-airbnb-base": "15.0.0",
|
|
130
|
+
"eslint-plugin-import": "2.32.0",
|
|
131
|
+
"eslint-plugin-jest": "27.9.0",
|
|
132
|
+
"eslint-plugin-sonarjs": "0.11.0",
|
|
133
|
+
"jest": "29.7.0",
|
|
134
|
+
"jest-circus": "29.7.0",
|
|
135
|
+
"jest-extended": "3.2.4",
|
|
136
|
+
"ts-jest": "29.4.9",
|
|
137
|
+
"typescript": "5.9.3"
|
|
138
138
|
},
|
|
139
139
|
"devDependencies": {
|
|
140
140
|
"@robmarr/rollup-plugin-shebang": "^1.0.1",
|