Skip to content

Commit

Permalink
build: update dependencies (#173)
Browse files Browse the repository at this point in the history
* build: change ubuntu to windows in github actions

* test: increase timeout for navigation

* build: update dependencies

Replace deprecated babel-eslint with @babel/eslint-parser.
Replace existing katex with gatsby-remark-katex.
Disable eslint-plugin-playwright due to runtime error.

* build: replace babel/core by @babel/core

Use babel-gatsby-preset to speed up production build.

* ci: update script
* ci: set shell to bash

* test: fix tests

* ci: update os for the scan workflow
  • Loading branch information
yld-weng authored Oct 14, 2021
1 parent 363cdac commit 757bd30
Show file tree
Hide file tree
Showing 22 changed files with 6,977 additions and 13,817 deletions.
2 changes: 2 additions & 0 deletions .eslintignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
*.e2e.js
*.spec.js
13 changes: 9 additions & 4 deletions .eslintrc
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,13 @@
"es6": true,
"jest": true
},
// https://github.com/babel/babel-eslint
"parser": "babel-eslint",
"parser": "@babel/eslint-parser",
"parserOptions": {
"requireConfigFile": false,
"babelOptions": {
"presets": ["babel-preset-gatsby"]
}
},
"rules": {
// https://eslint.org/docs/2.0.0/rules/strict
"strict": 0
Expand All @@ -18,9 +23,9 @@
// https://github.com/yannickcr/eslint-plugin-react#recommended
"plugin:react/recommended",
// https://github.com/benmosher/eslint-plugin-import
"plugin:import/recommended",
"plugin:import/recommended"
// https://github.com/playwright-community/eslint-plugin-playwright
"plugin:playwright/jest-playwright"
//"plugin:playwright/jest-playwright"
],
"settings": {
"react": {
Expand Down
12 changes: 9 additions & 3 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,10 @@ on:

jobs:
CI-Build:
runs-on: ubuntu-20.04
runs-on: windows-latest
defaults:
run:
shell: bash
steps:
- name: Cancel Previous Runs
uses: styfle/cancel-workflow-action@0.9.1
Expand Down Expand Up @@ -54,7 +57,7 @@ jobs:

# Enable incremental build
- name: Incremental build
run: npm run build
run: NODE_OPTIONS=--max_old_space_size=4096 npm run build:noGA
env:
EVENT_API_KEY_1: ${{ secrets.EVENT_API_KEY_1 }}
EVENT_API_KEY_2: ${{ secrets.EVENT_API_KEY_2 }}
Expand All @@ -68,7 +71,10 @@ jobs:
run: npm run serve & npm run test:e2e

Test:
runs-on: ubuntu-20.04
runs-on: windows-latest
defaults:
run:
shell: bash
steps:
- name: Cancel Previous Runs
uses: styfle/cancel-workflow-action@0.9.1
Expand Down
5 changes: 4 additions & 1 deletion .github/workflows/deploy-qa.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,10 @@ on:

jobs:
Deploy-to-QA:
runs-on: ubuntu-20.04
runs-on: windows-latest
defaults:
run:
shell: bash
if: ${{ github.event.workflow_run.conclusion == 'success' }}

steps:
Expand Down
5 changes: 4 additions & 1 deletion .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,10 @@ on:
jobs:
deploy:
name: Deploy to GitHub Pages
runs-on: ubuntu-20.04
runs-on: windows-latest
defaults:
run:
shell: bash

steps:
- name: Cancel Previous Runs
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/scan.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ on:

jobs:
scan:
runs-on: ubuntu-20.04
runs-on: ubuntu-latest

steps:
- name: Cancel Previous Runs
Expand Down
1 change: 1 addition & 0 deletions gatsby-browser.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@

import "tailwindcss/dist/base.css";
import "gitalk/dist/gitalk.css";
import "katex/dist/katex.min.css";
import "slick-carousel/slick/slick.css";
import "slick-carousel/slick/slick-theme.css";
import "prismjs/plugins/line-numbers/prism-line-numbers.css";
Expand Down
10 changes: 8 additions & 2 deletions gatsby-config.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ module.exports = {
{
resolve: `gatsby-plugin-google-analytics`,
options: {
trackingId: "UA-165060977-1",
trackingId: process.env.QA_ENV ? "289653096" : "UA-165060977-1",
head: true,
enableWebVitalsTracking: true
}
Expand Down Expand Up @@ -81,9 +81,15 @@ module.exports = {
posts: require.resolve("./src/templates/blog/blogPostTemplate.jsx"),
docs: require.resolve("./src/templates/docs/docsTemplate.jsx")
},
remarkPlugins: [require("remark-math"), require("remark-html-katex")],
remarkPlugins: [require("remark-math")],
gatsbyRemarkPlugins: [
"gatsby-remark-code-titles",
{
resolve: `gatsby-remark-katex`,
options: {
strict: `ignore`
}
},
`gatsby-remark-embedder`,
{
resolve: `gatsby-remark-embed-video`,
Expand Down
Loading

0 comments on commit 757bd30

Please sign in to comment.