Skip to content

Commit

Permalink
fix(hive/gateway): add missing package to the Docker bundle
Browse files Browse the repository at this point in the history
  • Loading branch information
ardatan committed Sep 11, 2024
1 parent cf3f609 commit dae87f5
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 6 deletions.
5 changes: 5 additions & 0 deletions .changeset/young-candles-bow.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@graphql-hive/gateway': patch
---

Add missing `@graphql-hive/gateway` package to the Docker bundle
4 changes: 3 additions & 1 deletion .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,9 @@ jobs:
matrix:
productname: [mesh-serve, hive-gateway]
needs: [stable]
if: contains(needs.stable.outputs.publishedPackages, '@graphql-mesh/serve-cli')
if:
contains(needs.stable.outputs.publishedPackages, '@graphql-mesh/serve-cli') ||
contains(needs.stable.outputs.publishedPackages, '@graphql-hive/gateway')
steps:
- name: Choose names
id: names
Expand Down
2 changes: 1 addition & 1 deletion packages/hive-gateway/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ RUN apt-get update && apt-get install -y \

RUN npm i \
uNetworking/uWebSockets.js#semver:^20 \
node-libcurl@npm:@ardatan/node-libcurl@^4.0.1 \
node-libcurl@npm:@ardatan/node-libcurl@^4.0.2 \
graphql@^16.9.0

#
Expand Down
12 changes: 8 additions & 4 deletions packages/hive-gateway/rollup.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,8 @@ console.log('Bundling...');
* ```
*/
const deps = {
'node_modules/@graphql-mesh/serve-cli/index': 'src/index.ts',
'node_modules/@graphql-hive/gateway/index': 'src/index.ts',
'node_modules/@graphql-mesh/serve-cli/index': '../serve-cli/index.ts',
'node_modules/@graphql-mesh/serve-runtime/index': '../serve-runtime/src/index.ts',
'node_modules/@graphql-mesh/include/hooks': '../include/src/hooks.ts',
// default transports should be in the container
Expand Down Expand Up @@ -115,16 +116,19 @@ function packagejson() {
name: 'packagejson',
generateBundle(_outputs, bundles) {
for (const bundle of Object.values(bundles).filter(
bundle => !!deps[bundle.name] && bundle.name.startsWith('node_modules/'),
bundle =>
!!deps[bundle.name] &&
(bundle.name.startsWith('node_modules/') || bundle.name.startsWith('node_modules\\')),
)) {
const dir = path.dirname(bundle.fileName);
const bundledFile = path.basename(bundle.fileName);
const bundledFile = path.basename(bundle.fileName).replace(/\\/g, '/');
const pkg = { type: 'module' };
if (bundledFile === 'index.mjs') {
pkg.main = bundledFile;
} else {
const mjsFile = path.basename(bundle.fileName, '.mjs').replace(/\\/g, '/');
// if the bundled file is not "index", then it's an exports path (like with @graphql-mesh/include/hooks)
pkg.exports = { [`./${path.basename(bundle.fileName, '.mjs')}`]: `./${bundledFile}` };
pkg.exports = { [`./${mjsFile}`]: `./${bundledFile}` };
}
this.emitFile({
type: 'asset',
Expand Down

0 comments on commit dae87f5

Please sign in to comment.