Skip to content

Commit cde2bc8

Browse files
authored
Update dependencies + fix issue with nav scroll + add Matomo tracking script (graphprotocol#235)
* Update dependencies + fix issue with nav scroll * Update dependencies * Add Matomo tracking script * Fix workflows that use `google-github-actions/get-gke-credentials` * Make tracking script more readable * Update dependencies * Update tracking script
1 parent 3bb6d27 commit cde2bc8

16 files changed

+1501
-1328
lines changed

.dockerignore

+10-4
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,15 @@
1+
Dockerfile
2+
.dockerignore
3+
docker-compose.yml
4+
node_modules
5+
npm-debug.log*
6+
yarn-debug.log*
7+
yarn-error.log*
8+
README.md
9+
build
10+
.next
111
.git
212
.github
3-
**/node_modules
4-
**/README.md
5-
**/build
6-
docker-compose.yml
713
.k8s
814
.terraform
915
.npmrc

.github/workflows/ci-cd-production.yml

+6-2
Original file line numberDiff line numberDiff line change
@@ -42,12 +42,16 @@ jobs:
4242
- name: Checkout the repo
4343
uses: actions/checkout@v2
4444

45+
- name: Authenticate to GCP
46+
uses: google-github-actions/auth@v1
47+
with:
48+
credentials_json: ${{ secrets.GCP_SA_KEY_PRODUCTION }}
49+
4550
- name: Set up kubectl
46-
uses: google-github-actions/get-gke-credentials@main
51+
uses: google-github-actions/get-gke-credentials@v1
4752
with:
4853
cluster_name: hosted-service
4954
location: us-central1-a
50-
credentials: ${{ secrets.GCP_SA_KEY_PRODUCTION }}
5155

5256
- name: Set a new k8s image and apply the manifests
5357
run: .github/scripts/kustomize-apply.sh production $APP_NAME=$BASE_IMAGE:$GITHUB_SHA

.github/workflows/ci-cd-staging.yml

+6-2
Original file line numberDiff line numberDiff line change
@@ -43,12 +43,16 @@ jobs:
4343
- name: Checkout the repo
4444
uses: actions/checkout@v2
4545

46+
- name: Authenticate to GCP
47+
uses: google-github-actions/auth@v1
48+
with:
49+
credentials_json: ${{ secrets.GCP_SA_KEY_STAGING }}
50+
4651
- name: Set up kubectl
47-
uses: google-github-actions/get-gke-credentials@main
52+
uses: google-github-actions/get-gke-credentials@v1
4853
with:
4954
cluster_name: hosted-service
5055
location: us-central1-a
51-
credentials: ${{ secrets.GCP_SA_KEY_STAGING }}
5256

5357
- name: Set a new k8s image and apply the manifests
5458
run: .github/scripts/kustomize-apply.sh staging $APP_NAME=$BASE_IMAGE:$GITHUB_SHA

.gitignore

+1
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ yalc.lock
1818
# misc
1919
.DS_Store
2020
*.pem
21+
.vscode
2122

2223
# debug
2324
npm-debug.log*

layout/MDXLayoutNav.tsx

+6
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,12 @@ const DesktopWrapper = ({ children }: PropsWithChildren<{}>) => {
4545
}}
4646
>
4747
{children}
48+
<div
49+
sx={{
50+
height: 'var(--gds-header-height-visible)',
51+
transition: enableTransition ? buildTransition('height' as any, '400ms') : undefined,
52+
}}
53+
/>
4854
</div>
4955
)
5056
}

layout/MDXLayoutOutline.tsx

+6
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,12 @@ export const MDXLayoutOutline = () => {
6767
})}
6868
</Text>
6969
</nav>
70+
<div
71+
sx={{
72+
height: 'var(--gds-header-height-visible)',
73+
transition: enableTransition ? buildTransition('height' as any, '400ms') : undefined,
74+
}}
75+
/>
7076
</div>
7177
)
7278
}

next.config.mjs

+2-2
Original file line numberDiff line numberDiff line change
@@ -22,10 +22,10 @@ const withMDX = mdx({
2222

2323
export default withMDX({
2424
env,
25-
basePath: env.BASE_PATH,
2625
pageExtensions: ['tsx', 'mdx'],
27-
trailingSlash: true,
2826
reactStrictMode: true,
27+
basePath: env.BASE_PATH,
28+
trailingSlash: true,
2929

3030
async redirects() {
3131
return [

package.json

+29-33
Original file line numberDiff line numberDiff line change
@@ -12,65 +12,61 @@
1212
"prettier": "prettier . --write",
1313
"prettier:check": "prettier . --check",
1414
"typecheck": "tsc --noEmit",
15-
"docker:build": "DOCKER_BUILDKIT=1 docker build . -t docs",
15+
"docker:build": "DOCKER_BUILDKIT=1 docker build . -t docs --no-cache",
1616
"docker:up": "docker run --rm -it -p 3000:80 -v \"$(pwd)/nginx.conf:/etc/nginx/nginx.conf\" docs",
1717
"docker:clean": "docker builder prune",
1818
"prepare": "husky install && chmod +x .husky/*",
1919
"pre-commit": "lint-staged --concurrent false",
2020
"pre-push": "yarn build"
2121
},
2222
"dependencies": {
23-
"@docsearch/react": "^3.2.1",
24-
"@edgeandnode/components": "^23.1.3",
25-
"@emotion/react": "^11.10.0",
26-
"@mdx-js/loader": "^2.1.3",
27-
"@mdx-js/react": "^2.1.3",
28-
"@next/mdx": "^12.2.5",
29-
"@radix-ui/react-collapsible": "1.0.0",
30-
"@radix-ui/react-popover": "^1.0.0",
31-
"@radix-ui/react-visually-hidden": "^1.0.0",
32-
"@reach/auto-id": "^0.17.0",
23+
"@docsearch/react": "^3.3.0",
24+
"@edgeandnode/components": "^24.0.5",
25+
"@emotion/react": "^11.10.5",
26+
"@mdx-js/loader": "^2.1.5",
27+
"@mdx-js/react": "^2.1.5",
28+
"@next/mdx": "^12.3.4",
29+
"@radix-ui/react-collapsible": "1.0.1",
30+
"@radix-ui/react-popover": "^1.0.2",
31+
"@radix-ui/react-visually-hidden": "^1.0.1",
32+
"@reach/auto-id": "^0.18.0",
3333
"lodash-es": "^4.17.21",
34-
"next": "^12.2.5",
35-
"next-seo": "^5.5.0",
34+
"next": "^12.3.4",
35+
"next-seo": "^5.14.1",
3636
"prism-react-renderer": "^1.3.5",
3737
"react": "^17.0.2",
3838
"react-dom": "^17.0.2",
39-
"react-intersection-observer": "^9.4.0",
39+
"react-intersection-observer": "^9.4.1",
4040
"react-use": "^17.4.0",
4141
"remark-gfm": "^3.0.1",
42-
"theme-ui": "^0.12.1",
43-
"use-bus": "^2.5.1"
42+
"theme-ui": "^0.15.4",
43+
"use-bus": "^2.5.2"
4444
},
4545
"devDependencies": {
46-
"@edgeandnode/eslint-config": "^1.0.3",
47-
"@sindresorhus/slugify": "^2.1.0",
48-
"@svgr/webpack": "^6.3.1",
46+
"@edgeandnode/eslint-config": "^1.1.0",
47+
"@sindresorhus/slugify": "^2.1.1",
48+
"@svgr/webpack": "^6.5.1",
4949
"@types/color": "^3.0.3",
5050
"@types/lodash-es": "^4.17.6",
51-
"@types/node": "^16.11.56",
52-
"@types/react": "^17.0.48",
53-
"@types/react-dom": "^17.0.17",
54-
"acorn": "^8.8.0",
51+
"@types/node": "^16.18.3",
52+
"@types/react": "^17.0.52",
53+
"@types/react-dom": "^17.0.18",
54+
"acorn": "^8.8.1",
5555
"acorn-jsx": "^5.3.2",
56-
"eslint": "^8.23.0",
57-
"husky": "^8.0.1",
56+
"eslint": "^8.28.0",
57+
"husky": "^8.0.2",
5858
"lint-staged": "^13.0.3",
5959
"path": "^0.12.7",
60-
"prettier": "^2.7.1",
60+
"prettier": "^2.8.0",
6161
"remark-frontmatter": "^4.0.1",
62-
"remark-mdx-frontmatter": "^2.0.3",
62+
"remark-mdx-frontmatter": "^2.1.1",
6363
"serialize-as-code": "^2.0.2",
64-
"typescript": "4.8.2",
64+
"typescript": "4.9.3",
6565
"unist-util-visit": "^4.1.1",
6666
"url": "^0.11.0"
6767
},
6868
"resolutions": {
69-
"@types/react": "^17.0.48",
70-
"@types/react-dom": "^17.0.17"
71-
},
72-
"engines": {
73-
"node": ">=16"
69+
"@types/react": "^17.0.52"
7470
},
7571
"lint-staged": {
7672
"**/*.{js,jsx,ts,tsx,mjs}": "eslint --fix",

pages/[locale]/[...404].tsx

+1-1
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ export const getStaticProps: GetStaticProps = async (context) => {
2929
}
3030
}
3131

32-
const NotFoundPage: NextPage<{}> = () => {
32+
const NotFoundPage: NextPage = () => {
3333
const { t } = useI18n()
3434

3535
return (

pages/_app.tsx

+9
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ import { AppProps } from 'next/app'
33
import Head from 'next/head'
44
import NextLink from 'next/link'
55
import { useRouter } from 'next/router'
6+
import Script from 'next/script'
67
import { DefaultSeo, DefaultSeoProps } from 'next-seo'
78
import { useCallback, useMemo, useState } from 'react'
89
import useBus from 'use-bus'
@@ -105,6 +106,14 @@ const MyApp = ({ Component, pageProps }: AppProps) => {
105106

106107
return (
107108
<>
109+
<Script id="tracking" type="module">{`
110+
const _paq = window._paq = window._paq || [];
111+
_paq.push(['trackPageView'], ['enableLinkTracking'], ['setTrackerUrl', 'https://thegraph.matomo.cloud/matomo.php'], ['setSiteId', '1']);
112+
const g = document.createElement('script');
113+
g.async = true;
114+
g.src = '//cdn.matomo.cloud/thegraph.matomo.cloud/matomo.js';
115+
document.body.append(g);
116+
`}</Script>
108117
<I18nProvider
109118
supportedLocales={supportedLocales}
110119
translations={translations}

pages/en/developing/assemblyscript-api.mdx

+1
Original file line numberDiff line numberDiff line change
@@ -457,6 +457,7 @@ export function handleTransfer(event: TransferEvent) {
457457
let erc20Symbol = contract.symbol()
458458
}
459459
```
460+
460461
`Transfer` is aliased to `TransferEvent` here to avoid a naming conflict with the entity type
461462

462463
As long as the `ERC20Contract` on Ethereum has a public read-only function called `symbol`, it can be called with `.symbol()`. For public state variables a method with the same name is created automatically.

pages/en/firehose.mdx

+1-1
Original file line numberDiff line numberDiff line change
@@ -8,4 +8,4 @@ Firehose integrations have been built for Ethereum (and many EVM chains), NEAR,
88

99
Graph Node integrations have been built for multiple chains, so subgraphs can stream data from a Firehose to power performant and scaleable indexing. Firehose also powers [substreams](/substreams), a new transformation technology built by The Graph core developers.
1010

11-
Visit the [firehose documentation](https://firehose.streamingfast.io/) to learn more.
11+
Visit the [firehose documentation](https://firehose.streamingfast.io/) to learn more.

pages/en/querying/graphql-api.mdx

+2-2
Original file line numberDiff line numberDiff line change
@@ -339,10 +339,10 @@ If a block is provided, the metadata is as of that block, if not the latest inde
339339

340340
`deployment` is a unique ID, corresponding to the IPFS CID of the `subgraph.yaml` file.
341341

342-
`block` provides information about the latest block (taking into account any block constraints passed to _meta):
342+
`block` provides information about the latest block (taking into account any block constraints passed to \_meta):
343+
343344
- hash: the hash of the block
344345
- number: the block number
345346
- timestamp: the timestamp of the block, if available (this is currently only available for subgraphs indexing EVM networks)
346347

347348
`hasIndexingErrors` is a boolean identifying whether the subgraph encountered indexing errors at some past block
348-

pages/en/substreams.mdx

-1
Original file line numberDiff line numberDiff line change
@@ -7,4 +7,3 @@ Substreams is a new technology developed by The Graph protocol core developers,
77
Visit the [substreams documentation](https://substreams.streamingfast.io/) to learn more and to get started building substreams.
88

99
<VideoEmbed youtube="K-nhC2FCB5k" />
10-

tsconfig.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"compilerOptions": {
3-
"target": "es5",
3+
"target": "es6",
44
"lib": ["dom", "dom.iterable", "esnext"],
55
"allowJs": true,
66
"skipLibCheck": true,

0 commit comments

Comments
 (0)