Skip to content

Commit

Permalink
build: simplify how GraphQL schema is downloaded from the Pontoon ser…
Browse files Browse the repository at this point in the history
…ver (#1000)
  • Loading branch information
MikkCZ authored Feb 9, 2025
1 parent a91ab5c commit 18f2905
Show file tree
Hide file tree
Showing 6 changed files with 568 additions and 213 deletions.
14 changes: 11 additions & 3 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,10 @@ watch:
graphql_generate:
npm run graphql:generate

.PHONY: graphql_download_schema
graphql_download_schema:
npm run graphql:download

.PHONY: bump_version
bump_version:
npm version "$(bump)"
Expand All @@ -46,13 +50,17 @@ test_in_container:
watch_in_container:
bash ./scripts/run-in-container.sh make watch

.PHONY: graphql_download_schema_in_container
graphql_download_schema_in_container:
bash ./scripts/run-in-container.sh make graphql_download_schema

.PHONY: graphql_generate_in_container
graphql_generate_in_container:
bash ./scripts/run-in-container.sh make graphql_generate

.PHONY: export_pontoon_graphql_schema
export_pontoon_graphql_schema:
CONTAINER_IMAGE='docker.io/library/python:3.13-bookworm' bash ./scripts/run-in-container.sh 'bash ./scripts/export-pontoon-graphql-schema.sh ./src/pontoon.graphql'
.PHONY: update_pontoon_graphql_schema
update_pontoon_graphql_schema:
make graphql_download_schema_in_container
make graphql_generate_in_container

.PHONY: bump_version_in_container
Expand Down
200 changes: 200 additions & 0 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 2 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@
"webpack:watch:chromium": "cross-env MODE=development TARGET_BROWSER=chromium webpack --config ./configs/webpack.config.ts --watch",
"jest:run": "jest --ci --config ./configs/jest.config.ts",
"watch": "npm-run-all build:clean --parallel webpack:watch:*",
"graphql:download": "get-graphql-schema https://pontoon.mozilla.org/graphql/ > ./src/pontoon.graphql",
"graphql:generate": "graphql-codegen --config ./configs/codegen.yml"
},
"dependencies": {
Expand Down Expand Up @@ -87,6 +88,7 @@
"eslint-plugin-testing-library": "^7.1.1",
"flush-promises": "^1.0.2",
"generate-json-webpack-plugin": "^2.0.0",
"get-graphql-schema": "^2.1.2",
"graphql-request": "^6.1.0",
"html-webpack-plugin": "^5.6.3",
"jest": "^28.1.3",
Expand Down
22 changes: 0 additions & 22 deletions scripts/export-pontoon-graphql-schema.sh

This file was deleted.

Loading

0 comments on commit 18f2905

Please sign in to comment.