Skip to content

Commit dae87f5

Browse files
committed
fix(hive/gateway): add missing package to the Docker bundle
1 parent cf3f609 commit dae87f5

File tree

4 files changed

+17
-6
lines changed

4 files changed

+17
-6
lines changed

.changeset/young-candles-bow.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
'@graphql-hive/gateway': patch
3+
---
4+
5+
Add missing `@graphql-hive/gateway` package to the Docker bundle

.github/workflows/release.yml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,9 @@ jobs:
2929
matrix:
3030
productname: [mesh-serve, hive-gateway]
3131
needs: [stable]
32-
if: contains(needs.stable.outputs.publishedPackages, '@graphql-mesh/serve-cli')
32+
if:
33+
contains(needs.stable.outputs.publishedPackages, '@graphql-mesh/serve-cli') ||
34+
contains(needs.stable.outputs.publishedPackages, '@graphql-hive/gateway')
3335
steps:
3436
- name: Choose names
3537
id: names

packages/hive-gateway/Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ RUN apt-get update && apt-get install -y \
99

1010
RUN npm i \
1111
uNetworking/uWebSockets.js#semver:^20 \
12-
node-libcurl@npm:@ardatan/node-libcurl@^4.0.1 \
12+
node-libcurl@npm:@ardatan/node-libcurl@^4.0.2 \
1313
graphql@^16.9.0
1414

1515
#

packages/hive-gateway/rollup.config.js

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,8 @@ console.log('Bundling...');
3737
* ```
3838
*/
3939
const deps = {
40-
'node_modules/@graphql-mesh/serve-cli/index': 'src/index.ts',
40+
'node_modules/@graphql-hive/gateway/index': 'src/index.ts',
41+
'node_modules/@graphql-mesh/serve-cli/index': '../serve-cli/index.ts',
4142
'node_modules/@graphql-mesh/serve-runtime/index': '../serve-runtime/src/index.ts',
4243
'node_modules/@graphql-mesh/include/hooks': '../include/src/hooks.ts',
4344
// default transports should be in the container
@@ -115,16 +116,19 @@ function packagejson() {
115116
name: 'packagejson',
116117
generateBundle(_outputs, bundles) {
117118
for (const bundle of Object.values(bundles).filter(
118-
bundle => !!deps[bundle.name] && bundle.name.startsWith('node_modules/'),
119+
bundle =>
120+
!!deps[bundle.name] &&
121+
(bundle.name.startsWith('node_modules/') || bundle.name.startsWith('node_modules\\')),
119122
)) {
120123
const dir = path.dirname(bundle.fileName);
121-
const bundledFile = path.basename(bundle.fileName);
124+
const bundledFile = path.basename(bundle.fileName).replace(/\\/g, '/');
122125
const pkg = { type: 'module' };
123126
if (bundledFile === 'index.mjs') {
124127
pkg.main = bundledFile;
125128
} else {
129+
const mjsFile = path.basename(bundle.fileName, '.mjs').replace(/\\/g, '/');
126130
// if the bundled file is not "index", then it's an exports path (like with @graphql-mesh/include/hooks)
127-
pkg.exports = { [`./${path.basename(bundle.fileName, '.mjs')}`]: `./${bundledFile}` };
131+
pkg.exports = { [`./${mjsFile}`]: `./${bundledFile}` };
128132
}
129133
this.emitFile({
130134
type: 'asset',

0 commit comments

Comments
 (0)