Docs: Switch to SWC

PR-URL: https://github.com/hasura/graphql-engine-mono/pull/7304
GitOrigin-RevId: c413cc5145b54ef89b16aef792332a85b681b3d7
This commit is contained in:
Sean Park-Ross 2022-12-16 17:52:42 +02:00 committed by hasura-bot
parent 32b56723a9
commit 47eeace9a6
3 changed files with 153 additions and 1 deletions

View File

@ -18,7 +18,23 @@ const config = {
organizationName: 'hasura',
projectName: 'graphql-engine',
staticDirectories: ['static', 'public'],
webpack: {
jsLoader: (isServer) => ({
loader: require.resolve('swc-loader'),
options: {
jsc: {
parser: {
syntax: 'typescript',
tsx: true,
},
target: 'es2017',
},
module: {
type: isServer ? 'commonjs' : 'es6',
},
},
}),
},
presets: [
[
'classic',

View File

@ -30,6 +30,7 @@
"docusaurus-plugin-sass": "^0.2.2",
"graphiql": "^1.5.1",
"graphql": "^15.7.2",
"graphql-ws": "^5.11.2",
"prism-react-renderer": "^1.3.5",
"react": "^17.0.2",
"react-dom": "^17.0.2",
@ -38,8 +39,10 @@
},
"devDependencies": {
"@docusaurus/module-type-aliases": "^2.1.0",
"@swc/core": "^1.3.23",
"@tsconfig/docusaurus": "^1.0.6",
"prettier": "^2.7.1",
"swc-loader": "^0.2.3",
"typescript": "^4.8.4"
},
"browserslist": {

View File

@ -2616,6 +2616,117 @@ __metadata:
languageName: node
linkType: hard
"@swc/core-darwin-arm64@npm:1.3.23":
version: 1.3.23
resolution: "@swc/core-darwin-arm64@npm:1.3.23"
conditions: os=darwin & cpu=arm64
languageName: node
linkType: hard
"@swc/core-darwin-x64@npm:1.3.23":
version: 1.3.23
resolution: "@swc/core-darwin-x64@npm:1.3.23"
conditions: os=darwin & cpu=x64
languageName: node
linkType: hard
"@swc/core-linux-arm-gnueabihf@npm:1.3.23":
version: 1.3.23
resolution: "@swc/core-linux-arm-gnueabihf@npm:1.3.23"
conditions: os=linux & cpu=arm
languageName: node
linkType: hard
"@swc/core-linux-arm64-gnu@npm:1.3.23":
version: 1.3.23
resolution: "@swc/core-linux-arm64-gnu@npm:1.3.23"
conditions: os=linux & cpu=arm64 & libc=glibc
languageName: node
linkType: hard
"@swc/core-linux-arm64-musl@npm:1.3.23":
version: 1.3.23
resolution: "@swc/core-linux-arm64-musl@npm:1.3.23"
conditions: os=linux & cpu=arm64 & libc=musl
languageName: node
linkType: hard
"@swc/core-linux-x64-gnu@npm:1.3.23":
version: 1.3.23
resolution: "@swc/core-linux-x64-gnu@npm:1.3.23"
conditions: os=linux & cpu=x64 & libc=glibc
languageName: node
linkType: hard
"@swc/core-linux-x64-musl@npm:1.3.23":
version: 1.3.23
resolution: "@swc/core-linux-x64-musl@npm:1.3.23"
conditions: os=linux & cpu=x64 & libc=musl
languageName: node
linkType: hard
"@swc/core-win32-arm64-msvc@npm:1.3.23":
version: 1.3.23
resolution: "@swc/core-win32-arm64-msvc@npm:1.3.23"
conditions: os=win32 & cpu=arm64
languageName: node
linkType: hard
"@swc/core-win32-ia32-msvc@npm:1.3.23":
version: 1.3.23
resolution: "@swc/core-win32-ia32-msvc@npm:1.3.23"
conditions: os=win32 & cpu=ia32
languageName: node
linkType: hard
"@swc/core-win32-x64-msvc@npm:1.3.23":
version: 1.3.23
resolution: "@swc/core-win32-x64-msvc@npm:1.3.23"
conditions: os=win32 & cpu=x64
languageName: node
linkType: hard
"@swc/core@npm:^1.3.23":
version: 1.3.23
resolution: "@swc/core@npm:1.3.23"
dependencies:
"@swc/core-darwin-arm64": 1.3.23
"@swc/core-darwin-x64": 1.3.23
"@swc/core-linux-arm-gnueabihf": 1.3.23
"@swc/core-linux-arm64-gnu": 1.3.23
"@swc/core-linux-arm64-musl": 1.3.23
"@swc/core-linux-x64-gnu": 1.3.23
"@swc/core-linux-x64-musl": 1.3.23
"@swc/core-win32-arm64-msvc": 1.3.23
"@swc/core-win32-ia32-msvc": 1.3.23
"@swc/core-win32-x64-msvc": 1.3.23
dependenciesMeta:
"@swc/core-darwin-arm64":
optional: true
"@swc/core-darwin-x64":
optional: true
"@swc/core-linux-arm-gnueabihf":
optional: true
"@swc/core-linux-arm64-gnu":
optional: true
"@swc/core-linux-arm64-musl":
optional: true
"@swc/core-linux-x64-gnu":
optional: true
"@swc/core-linux-x64-musl":
optional: true
"@swc/core-win32-arm64-msvc":
optional: true
"@swc/core-win32-ia32-msvc":
optional: true
"@swc/core-win32-x64-msvc":
optional: true
bin:
swcx: run_swcx.js
checksum: 2a92949c33f292a369f4a750a8a9759f88f6f399bc0beef54768fce3d1af5cf0c33a4c8f3c2478020ae95e99d99b7c17f301b79163cdbcdf533b91675f1d2e8d
languageName: node
linkType: hard
"@szmarczak/http-timer@npm:^1.1.2":
version: 1.1.2
resolution: "@szmarczak/http-timer@npm:1.1.2"
@ -4824,6 +4935,7 @@ __metadata:
"@docusaurus/module-type-aliases": ^2.1.0
"@docusaurus/preset-classic": ^2.2.0
"@mdx-js/react": ^1.6.22
"@swc/core": ^1.3.23
"@tsconfig/docusaurus": ^1.0.6
algoliasearch: ^4.14.2
algoliasearch-helper: ^3.7.4
@ -4831,12 +4943,14 @@ __metadata:
docusaurus-plugin-sass: ^0.2.2
graphiql: ^1.5.1
graphql: ^15.7.2
graphql-ws: ^5.11.2
prettier: ^2.7.1
prism-react-renderer: ^1.3.5
react: ^17.0.2
react-dom: ^17.0.2
react-transition-group: ^4.4.2
sass: ^1.49.8
swc-loader: ^0.2.3
typescript: ^4.8.4
languageName: unknown
linkType: soft
@ -5872,6 +5986,15 @@ __metadata:
languageName: node
linkType: hard
"graphql-ws@npm:^5.11.2":
version: 5.11.2
resolution: "graphql-ws@npm:5.11.2"
peerDependencies:
graphql: ">=0.11 <=16"
checksum: 2c94b06c1919217dc15a0556474673de7aabcc7179a2982a87ded51856c105e4f4ee6d54a6c135a0a7f55d85a5997a6a15cff514959258885814adec6a61ff00
languageName: node
linkType: hard
"graphql@npm:^15.7.2":
version: 15.8.0
resolution: "graphql@npm:15.8.0"
@ -10089,6 +10212,16 @@ __metadata:
languageName: node
linkType: hard
"swc-loader@npm:^0.2.3":
version: 0.2.3
resolution: "swc-loader@npm:0.2.3"
peerDependencies:
"@swc/core": ^1.2.147
webpack: ">=2"
checksum: 010d84d399525c0185d36d62c86c55ae017e7a90046bc8a39be4b7e07526924037868049f6037bc966da98151cb2600934b96a66279b742d3c413a718b427251
languageName: node
linkType: hard
"tapable@npm:^1.0.0":
version: 1.1.3
resolution: "tapable@npm:1.1.3"