Skip to content

Commit

Permalink
Aligned build with other spec projects. (#4)
Browse files Browse the repository at this point in the history
  • Loading branch information
michaelstaib authored Jan 22, 2024
1 parent c7aad44 commit 0efb543
Show file tree
Hide file tree
Showing 16 changed files with 2,580 additions and 1,586 deletions.
37 changes: 37 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
name: CI
on:
push:
branches:
- main
pull_request:
branches:
- main
jobs:
test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/setup-node@v1
with:
node-version: "16.x"
- run: npm ci
- run: npm run test
publish:
if: github.ref == 'refs/heads/main'
needs: test
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
with:
fetch-depth: 0
- uses: actions/setup-node@v1
with:
node-version: "16.x"
- run: npm ci
- run: npm run build
- uses: peaceiris/actions-gh-pages@v3
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
keep_files: true
user_name: "github-actions[bot]"
user_email: "github-actions[bot]@users.noreply.github.com"
13 changes: 13 additions & 0 deletions .github/workflows/prettier.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
name: Prettier formatting
on: [push, pull_request]

jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/setup-node@v1
with:
node-version: "16.x"
- run: npm ci
- run: npm run format:check
11 changes: 8 additions & 3 deletions ROADMAP.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,10 @@

## Mission

_Provide a specification that allows to build GraphQL Gateways and GraphQL composition tooling with different
implementations and technology stacks to interact freely if GraphQL composition tooling and GraphQL gateways are compliant._
_Provide a specification that allows to build GraphQL Gateways and GraphQL
composition tooling with different implementations and technology stacks to
interact freely if GraphQL composition tooling and GraphQL gateways are
compliant._

## Guiding principles

Expand All @@ -12,7 +14,10 @@ implementations and technology stacks to interact freely if GraphQL composition

## Version 1.0

Version 1 aims to codify a minimal core specification that specifies a set of subgraph and supergraph directives. Further, it aims to codify the core composition and execution algorithms for GraphQL composition tooling and GraphQL gateways.
Version 1 aims to codify a minimal core specification that specifies a set of
subgraph and supergraph directives. Further, it aims to codify the core
composition and execution algorithms for GraphQL composition tooling and GraphQL
gateways.

In layout and structure version 1.0 should lay a foundation for future
development and standardization.
Expand Down
4 changes: 0 additions & 4 deletions build.js

This file was deleted.

105 changes: 105 additions & 0 deletions build.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,105 @@
#!/bin/bash -e
# This script publishes the GraphQL specification document to the web.

# Determine if this is a tagged release
GITTAG=$(git tag --points-at HEAD)

# Build the specification draft document
echo "Building spec draft"
mkdir -p public/draft
spec-md --metadata spec/metadata.json --githubSource "https://github.com/graphql/graphql-over-http/blame/main/" spec/GraphQLCompositeSchemas.md > public/draft/index.html

# If this is a tagged commit, also build the release document
if [ -n "$GITTAG" ]; then
echo "Building spec release $GITTAG"
mkdir -p "public/$GITTAG"
spec-md --metadata spec/metadata.json --githubSource "https://github.com/graphql/graphql-over-http/blame/$GITTAG/" spec/GraphQLCompositeSchemas.md > "public/$GITTAG/index.html"
fi

# Create the index file
echo "Rebuilding: / (index)"
HTML="<html>
<head>
<title>GraphQL Composite Schemas Specification Versions</title>
<style>
body {
color: #333333;
font: 13pt/18pt Cambria, 'Palatino Linotype', Palatino, 'Liberation Serif', serif;
margin: 6rem auto 3rem;
max-width: 780px;
}
@media (min-width: 1240px) {
body {
padding-right: 300px;
}
}
a {
color: #3B5998;
text-decoration: none;
}
a:hover {
text-decoration: underline;
}
h1 {
font-size: 1.5em;
margin: 8rem 0 2em;
}
td {
padding-bottom: 5px;
}
td + td {
padding-left: 2ch;
}
</style>
</head>
<body>
<h1>GraphQL Composite Schemas</h1>
<table>"

# Include latest draft
GITDATE=$(git show -s --format=%cd --date=format:"%a, %b %-d, %Y" HEAD)
HTML="$HTML
<tr>
<td><em>Prerelease</em></td>
<td><a href=\"./draft\" keep-hash>Working Draft</a></td>
<td>$GITDATE</td>
<td></td>
</tr>"

GITHUB_RELEASES="https://github.com/graphql/graphql-composite-schemas-spec/releases/tag"
for GITTAG in $(git tag -l --sort='-*committerdate') ; do
VERSIONYEAR=${GITTAG: -4}
TAGTITLE="${GITTAG%$VERSIONYEAR} $VERSIONYEAR"
TAGGEDCOMMIT=$(git rev-list -1 "$GITTAG")
GITDATE=$(git show -s --format=%cd --date=format:"%a, %b %-d, %Y" $TAGGEDCOMMIT)

HTML="$HTML
<tr>"

[ -z $HAS_LATEST_RELEASE ] && HTML="$HTML
<td><em>Latest Release</em></td>" || HTML="$HTML
<td></td>"
HAS_LATEST_RELEASE=1

HTML="$HTML
<td><a href=\"./$GITTAG\" keep-hash>$TAGTITLE</a></td>
<td>$GITDATE</td>
<td><a href=\"$GITHUB_RELEASES/$GITTAG\">Release Notes</a></td>
</tr>"
done

HTML="$HTML
</table>
<script>
var links = document.getElementsByTagName('a');
for (var i = 0; i < links.length; i++) {
if (links[i].hasAttribute('keep-hash')) {
links[i].href += location.hash;
links[i].removeAttribute('keep-hash');
}
}
</script>
</body>
</html>"

echo $HTML > "public/index.html"
10 changes: 10 additions & 0 deletions cspell.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,12 @@ words:
- parallelization
- structs
- subselection
- supergraph
- subraphs
- mergeable
- birthdate
- Satisfiability
- SchemaCoordinate
# Fictional characters / examples
- alderaan
- hagrid
Expand All @@ -21,3 +27,7 @@ words:
- tatooine
- zuck
- zuckerberg

ignoreWords:
- Aremergeable
- FXXXX
Loading

0 comments on commit 0efb543

Please sign in to comment.