Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 18 additions & 0 deletions .github/workflows/ci-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -207,6 +207,24 @@ jobs:
shell: bash
run: |
./scripts/run-test-codegen-configurations.sh -t

verify-frontend-bundle-latest:
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Would it be more efficient to include this as a step in the codegen unit tests CI job instead of spinning up another job? Not sure if it matters since the CI jobs on these runners are free minutes?

runs-on: macos-13
needs: [changes]
if: ${{ needs.changes.outputs.codegen == 'true' }}
timeout-minutes: 5
name: Verify Frontend Bundle Latest - macOS
steps:
- name: Checkout Repo
uses: actions/checkout@v3
- name: Build JS Bundle
shell: bash
working-directory: apollo-ios-codegen/Sources/GraphQLCompiler/JavaScript
run: npm install && ./auto_rollup.sh
- name: Verify Latest
shell: bash
run: |
git diff --exit-code

run-cocoapods-integration-tests:
runs-on: macos-13
Expand Down

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
#!/usr/bin/env bash
set -e

SCRIPT_DIR=$( cd -- "$( dirname -- "${BASH_SOURCE[0]}" )" &> /dev/null && pwd )
output_file="$SCRIPT_DIR/../ApolloCodegenFrontendBundle.swift"
$( cd "$SCRIPT_DIR" && rollup -c )
cd "$SCRIPT_DIR" && npm run build
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Use the package version of rollup instead of needing a global installation of it.

minJS=$(cat "$SCRIPT_DIR/dist/ApolloCodegenFrontend.bundle.js")
printf "%s%s%s" "let ApolloCodegenFrontendBundle: String = #\"" "$minJS" "\"#" > $output_file
printf "%s%s%s" "let ApolloCodegenFrontendBundle: String = #\"" "$minJS" "\"#" > "$output_file"
exit 0
Original file line number Diff line number Diff line change
Expand Up @@ -6,27 +6,27 @@
"license": "MIT",
"author": "Apollo GraphQL <[email protected]>",
"scripts": {
"build": "rollup --config",
"build": "rollup --config --bundleConfigAsCjs",
"test": "jest"
},
"engines": {
"npm": ">=7"
},
"dependencies": {
"graphql": "17.0.0-alpha.3",
"graphql": "17.0.0-alpha.2",
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is the solution to fixing the Node error in the description. I do not believe we need anything in alpha.3 - all our codegen tests still pass.

"tslib": "^2.3.0"
},
"devDependencies": {
"@rollup/plugin-node-resolve": "15.2.3",
"@rollup/plugin-replace": "5.0.5",
"@rollup/plugin-typescript": "11.1.5",
"@types/common-tags": "1.8.4",
"@types/jest": "26.0.24",
"@types/jest": "29.5.10",
"common-tags": "1.8.2",
"jest": "26.6.3",
"rollup": "2.79.1",
"rollup-plugin-terser": "7.0.2",
"ts-jest": "26.5.6",
"typescript": "4.9.5"
"jest": "29.7.0",
"rollup": "4.6.1",
"@rollup/plugin-terser": "0.4.4",
"ts-jest": "29.1.1",
"typescript": "5.3.2"
}
}
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import typescript from "@rollup/plugin-typescript";
import { nodeResolve } from "@rollup/plugin-node-resolve";
import replace from "@rollup/plugin-replace";
import { terser } from "rollup-plugin-terser";
import terser from "@rollup/plugin-terser";

/** @type {import('rollup').RollupOptions} */
const options = {
Expand All @@ -21,6 +21,7 @@ const options = {
dedupe: ["graphql"],
}),
replace({
preventAssignment: true,
"process.env.NODE_ENV": JSON.stringify("production"),
}),
terser({
Expand Down