Unverified Commit 95ea8526 authored by NGPixel's avatar NGPixel

ci: fix missing node_modules in build tarball

parent d1bf125f
...@@ -77,9 +77,9 @@ jobs: ...@@ -77,9 +77,9 @@ jobs:
cp -R server _dist/server cp -R server _dist/server
cp LICENSE _dist/LICENSE cp LICENSE _dist/LICENSE
cp config.sample.yml _dist/config.sample.yml cp config.sample.yml _dist/config.sample.yml
cd server cd _dist/server
npm ci --omit=dev --audit=false --fund=false npm ci --omit=dev --audit=false --fund=false
cd .. cd -
find ./_dist/ -printf "%P\n" | tar -czf wiki-js.tar.gz --no-recursion -C ./_dist/ -T - find ./_dist/ -printf "%P\n" | tar -czf wiki-js.tar.gz --no-recursion -C ./_dist/ -T -
- name: Upload Build Artifact - name: Upload Build Artifact
......
import fs from 'node:fs/promises' import fs from 'node:fs/promises'
import http from 'node:http' import http from 'node:http'
import https from 'node:https' import https from 'node:https'
import { ApolloServer } from 'apollo-server-express' import { ApolloServer } from '@apollo/server'
import { expressMiddleware } from '@apollo/server/express4'
import { isEmpty } from 'lodash-es' import { isEmpty } from 'lodash-es'
import { Server as IoServer } from 'socket.io' import { Server as IoServer } from 'socket.io'
import { ApolloServerPluginLandingPageGraphQLPlayground, ApolloServerPluginLandingPageProductionDefault } from 'apollo-server-core' import { ApolloServerPluginLandingPageLocalDefault, ApolloServerPluginLandingPageProductionDefault } from '@apollo/server/plugin/landingPage/default'
import graphqlUploadExpress from 'graphql-upload/graphqlUploadExpress.mjs' import graphqlUploadExpress from 'graphql-upload/graphqlUploadExpress.mjs'
import { initSchema } from '../graph/index.mjs' import { initSchema } from '../graph/index.mjs'
...@@ -134,10 +135,13 @@ export default { ...@@ -134,10 +135,13 @@ export default {
schema: graphqlSchema, schema: graphqlSchema,
csrfPrevention: true, csrfPrevention: true,
cache: 'bounded', cache: 'bounded',
context: ({ req, res }) => ({ req, res }),
plugins: [ plugins: [
process.env.NODE_ENV === 'development' ? ApolloServerPluginLandingPageGraphQLPlayground({ process.env.NODE_ENV === 'development' ? ApolloServerPluginLandingPageLocalDefault({
footer: false footer: false,
embed: {
endpointIsEditable: false,
runTelemetry: false
}
}) : ApolloServerPluginLandingPageProductionDefault({ }) : ApolloServerPluginLandingPageProductionDefault({
footer: false footer: false
}) })
...@@ -150,7 +154,9 @@ export default { ...@@ -150,7 +154,9 @@ export default {
maxFileSize: WIKI.config.security.uploadMaxFileSize, maxFileSize: WIKI.config.security.uploadMaxFileSize,
maxFiles: WIKI.config.security.uploadMaxFiles maxFiles: WIKI.config.security.uploadMaxFiles
})) }))
this.graph.applyMiddleware({ app: WIKI.app, cors: false, path: '/_graphql' }) WIKI.app.use('/_graphql', expressMiddleware(this.graph, {
context: ({ req, res }) => ({ req, res })
}))
}, },
/** /**
* Start Socket.io WebSocket Server * Start Socket.io WebSocket Server
......
...@@ -34,6 +34,7 @@ ...@@ -34,6 +34,7 @@
"node": ">=18.0" "node": ">=18.0"
}, },
"dependencies": { "dependencies": {
"@apollo/server": "4.7.1",
"@azure/storage-blob": "12.14.0", "@azure/storage-blob": "12.14.0",
"@exlinc/keycloak-passport": "1.0.2", "@exlinc/keycloak-passport": "1.0.2",
"@graphql-tools/schema": "10.0.0", "@graphql-tools/schema": "10.0.0",
...@@ -44,10 +45,6 @@ ...@@ -44,10 +45,6 @@
"@root/pem": "1.0.4", "@root/pem": "1.0.4",
"acme": "3.0.3", "acme": "3.0.3",
"akismet-api": "6.0.0", "akismet-api": "6.0.0",
"apollo-fetch": "0.7.0",
"apollo-server": "3.6.7",
"apollo-server-express": "3.6.7",
"auto-load": "3.0.4",
"aws-sdk": "2.1386.0", "aws-sdk": "2.1386.0",
"bcryptjs": "2.4.3", "bcryptjs": "2.4.3",
"body-parser": "1.20.2", "body-parser": "1.20.2",
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment