upgrade deps

This commit is contained in:
keyan 2022-11-06 11:28:58 -06:00
parent a1690ed511
commit 525cab2573
12 changed files with 3009 additions and 3355 deletions

View File

@ -1,6 +1,6 @@
import { ApolloClient, InMemoryCache } from '@apollo/client' import { ApolloClient, InMemoryCache } from '@apollo/client'
import { SchemaLink } from '@apollo/client/link/schema' import { SchemaLink } from '@apollo/client/link/schema'
import { mergeSchemas } from 'graphql-tools' import { makeExecutableSchema } from 'graphql-tools'
import { getSession } from 'next-auth/client' import { getSession } from 'next-auth/client'
import resolvers from './resolvers' import resolvers from './resolvers'
import typeDefs from './typeDefs' import typeDefs from './typeDefs'
@ -16,9 +16,9 @@ export default async function getSSRApolloClient (req, me = null) {
return new ApolloClient({ return new ApolloClient({
ssrMode: true, ssrMode: true,
link: new SchemaLink({ link: new SchemaLink({
schema: mergeSchemas({ schema: makeExecutableSchema({
schemas: typeDefs, typeDefs,
resolvers: resolvers resolvers
}), }),
context: { context: {
models, models,

View File

@ -38,7 +38,9 @@ export function LightningAuth ({ callbackUrl }) {
} }
}`) }`)
useEffect(createAuth, []) useEffect(() => {
createAuth()
}, [])
if (error) return <div>error</div> if (error) return <div>error</div>

View File

@ -7,7 +7,8 @@ import { useEffect } from 'react'
export default function LnQR ({ value, webLn, statusVariant, status }) { export default function LnQR ({ value, webLn, statusVariant, status }) {
const qrValue = 'lightning:' + value.toUpperCase() const qrValue = 'lightning:' + value.toUpperCase()
useEffect(async () => { useEffect(() => {
async function effect () {
if (webLn) { if (webLn) {
try { try {
const provider = await requestProvider() const provider = await requestProvider()
@ -16,6 +17,8 @@ export default function LnQR ({ value, webLn, statusVariant, status }) {
console.log(e.message) console.log(e.message)
} }
} }
}
effect()
}, []) }, [])
return ( return (

View File

@ -26,7 +26,7 @@ module.exports = withPlausibleProxy()({
return Object.keys(RuntimeSources['stacker.news'])[0] return Object.keys(RuntimeSources['stacker.news'])[0]
}, },
// Use the CDN in production and localhost for development. // Use the CDN in production and localhost for development.
assetPrefix: isProd ? 'https://a.stacker.news' : '', assetPrefix: isProd ? 'https://a.stacker.news' : undefined,
async headers () { async headers () {
return [ return [
{ {

6156
package-lock.json generated

File diff suppressed because it is too large Load Diff

View File

@ -3,74 +3,79 @@
"version": "0.1.0", "version": "0.1.0",
"private": true, "private": true,
"scripts": { "scripts": {
"dev": "NODE_OPTIONS='--trace-warnings --inspect' next dev", "dev": "NODE_OPTIONS='--trace-warnings' next dev",
"build": "next build", "build": "next build",
"migrate": "prisma migrate deploy", "migrate": "prisma migrate deploy",
"start": "NODE_OPTIONS='--trace-warnings' next start -p $PORT" "start": "NODE_OPTIONS='--trace-warnings' next start -p $PORT"
}, },
"dependencies": { "dependencies": {
"@apollo/client": "^3.4.15", "@apollo/client": "^3.7.1",
"@opensearch-project/opensearch": "^1.0.2", "@opensearch-project/opensearch": "^1.1.0",
"@prisma/client": "^2.25.0", "@prisma/client": "^2.30.3",
"apollo-server-micro": "^2.21.2", "apollo-server-micro": "^3.11.1",
"async-retry": "^1.3.1", "async-retry": "^1.3.1",
"aws-sdk": "^2.1056.0", "aws-sdk": "^2.1248.0",
"babel-plugin-inline-react-svg": "^2.0.1", "babel-plugin-inline-react-svg": "^2.0.1",
"bech32": "^2.0.0", "bech32": "^2.0.0",
"bolt11": "^1.3.4", "bolt11": "^1.4.0",
"bootstrap": "^4.6.0", "bootstrap": "^4.6.2",
"browserslist": "^4.21.4",
"clipboard-copy": "^4.0.1", "clipboard-copy": "^4.0.1",
"cross-fetch": "^3.1.5", "cross-fetch": "^3.1.5",
"domino": "^2.1.6", "domino": "^2.1.6",
"formik": "^2.2.6", "formik": "^2.2.6",
"github-slugger": "^1.4.0", "github-slugger": "^1.5.0",
"graphql": "^15.5.0", "graphql": "^15.8.0",
"graphql-tools": "^8.3.10",
"graphql-type-json": "^0.3.2", "graphql-type-json": "^0.3.2",
"ln-service": "^54.2.1", "jquery": "^3.6.1",
"ln-service": "^54.2.6",
"mdast-util-find-and-replace": "^1.1.1", "mdast-util-find-and-replace": "^1.1.1",
"mdast-util-from-markdown": "^1.2.0", "mdast-util-from-markdown": "^1.2.0",
"mdast-util-to-string": "^3.1.0", "mdast-util-to-string": "^3.1.0",
"next": "^11.1.2", "micro": "^9.4.1",
"next-auth": "^3.29.3", "next": "^12.3.2",
"next-plausible": "^2.1.3", "next-auth": "^3.29.10",
"next-seo": "^4.24.0", "next-plausible": "^3.6.4",
"nextjs-progressbar": "^0.0.13", "next-seo": "^4.29.0",
"nextjs-progressbar": "0.0.16",
"node-s3-url-encode": "^0.0.4", "node-s3-url-encode": "^0.0.4",
"page-metadata-parser": "^1.1.4", "page-metadata-parser": "^1.1.4",
"pageres": "^6.3.0", "pageres": "^7.1.0",
"pg-boss": "^7.0.2", "pg-boss": "^7.4.0",
"prisma": "^2.25.0", "popper.js": "^1.16.1",
"qrcode.react": "^1.0.1", "prisma": "^2.30.3",
"react": "^17.0.1", "qrcode.react": "^3.1.0",
"react": "^17.0.2",
"react-avatar-editor": "^13.0.0", "react-avatar-editor": "^13.0.0",
"react-bootstrap": "^1.5.2", "react-bootstrap": "^1.6.6",
"react-countdown": "^2.3.2", "react-countdown": "^2.3.3",
"react-dom": "^17.0.2", "react-dom": "^17.0.2",
"react-longpressable": "^1.1.1", "react-longpressable": "^1.1.1",
"react-markdown": "^8.0.0", "react-markdown": "^8.0.3",
"react-string-replace": "^0.4.4", "react-string-replace": "^0.4.4",
"react-syntax-highlighter": "^15.4.3", "react-syntax-highlighter": "^15.5.0",
"react-textarea-autosize": "^8.3.3", "react-textarea-autosize": "^8.3.4",
"react-twitter-embed": "^4.0.4", "react-twitter-embed": "^4.0.4",
"react-youtube": "^7.14.0", "react-youtube": "^7.14.0",
"recharts": "^2.1.10", "recharts": "^2.1.16",
"remark-directive": "^2.0.1", "remark-directive": "^2.0.1",
"remark-gfm": "^3.0.1", "remark-gfm": "^3.0.1",
"remove-markdown": "^0.3.0", "remove-markdown": "^0.3.0",
"sass": "^1.32.8", "sass": "^1.56.0",
"secp256k1": "^4.0.2", "secp256k1": "^4.0.3",
"swr": "^0.5.4", "swr": "^1.3.0",
"unist-util-visit": "^4.1.0", "unist-util-visit": "^4.1.1",
"use-dark-mode": "^2.3.1", "use-dark-mode": "^2.3.1",
"uuid": "^8.3.2", "uuid": "^8.3.2",
"webln": "^0.2.2", "webln": "^0.2.2",
"yup": "^0.32.9" "yup": "^0.32.11"
}, },
"engines": { "engines": {
"node": "14.17.0" "node": "14.17.0"
}, },
"standard": { "standard": {
"parser": "babel-eslint", "parser": "@babel/eslint-parser",
"plugins": [ "plugins": [
"eslint-plugin-compat" "eslint-plugin-compat"
], ],
@ -82,9 +87,10 @@
} }
}, },
"devDependencies": { "devDependencies": {
"babel-eslint": "^10.1.0", "@babel/core": "^7.20.2",
"eslint": "^7.29.0", "@babel/eslint-parser": "^7.19.1",
"eslint-plugin-compat": "^3.9.0", "eslint": "^7.32.0",
"standard": "^16.0.3" "eslint-plugin-compat": "^4.0.2",
"standard": "^16.0.4"
} }
} }

View File

@ -42,7 +42,7 @@ function MyApp ({ Component, pageProps: { session, ...props } }) {
const client = getApolloClient() const client = getApolloClient()
const router = useRouter() const router = useRouter()
useEffect(async () => { useEffect(() => {
// HACK: 'cause there's no way to tell Next to skip SSR // HACK: 'cause there's no way to tell Next to skip SSR
// So every page load, we modify the route in browser history // So every page load, we modify the route in browser history
// to point to the same page but without SSR, ie ?nodata=true // to point to the same page but without SSR, ie ?nodata=true

View File

@ -9,7 +9,7 @@ const bucketRegion = 'us-east-1'
const contentType = 'image/png' const contentType = 'image/png'
const bucketUrl = 'https://sn-capture.s3.amazonaws.com/' const bucketUrl = 'https://sn-capture.s3.amazonaws.com/'
const s3PathPrefix = process.env.NODE_ENV === 'development' ? 'dev/' : '' const s3PathPrefix = process.env.NODE_ENV === 'development' ? 'dev/' : ''
var capturing = false let capturing = false
AWS.config.update({ AWS.config.update({
region: bucketRegion region: bucketRegion

View File

@ -51,4 +51,11 @@ export const config = {
} }
} }
export default apolloServer.createHandler({ path: '/api/graphql' }) const startServer = apolloServer.start()
export default async function handler (req, res) {
await startServer
await apolloServer.createHandler({
path: '/api/graphql'
})(req, res)
}

View File

@ -149,7 +149,8 @@ export function WithdrawlForm () {
const [createWithdrawl, { called, error }] = useMutation(CREATE_WITHDRAWL) const [createWithdrawl, { called, error }] = useMutation(CREATE_WITHDRAWL)
useEffect(async () => { useEffect(() => {
async function effect () {
try { try {
const provider = await requestProvider() const provider = await requestProvider()
const { paymentRequest: invoice } = await provider.makeInvoice({ const { paymentRequest: invoice } = await provider.makeInvoice({
@ -161,6 +162,8 @@ export function WithdrawlForm () {
} catch (e) { } catch (e) {
console.log(e.message) console.log(e.message)
} }
}
effect()
}, []) }, [])
if (called && !error) { if (called && !error) {
@ -228,15 +231,17 @@ function LnQRWith ({ k1, encodedUrl }) {
export function LnWithdrawal () { export function LnWithdrawal () {
// query for challenge // query for challenge
const [createAuth, { data, error }] = useMutation(gql` const [createWith, { data, error }] = useMutation(gql`
mutation createAuth { mutation createWith {
createWith { createWith {
k1 k1
encodedUrl encodedUrl
} }
}`) }`)
useEffect(createAuth, []) useEffect(() => {
createWith()
}, [])
if (error) return <div>error</div> if (error) return <div>error</div>

View File

@ -1,11 +1,11 @@
#!/usr/bin/node #!/usr/bin/node
const Pageres = require('pageres') import Pageres from 'pageres'
async function captureUrl () { async function captureUrl () {
try { try {
const streams = await new Pageres({ crop: true, delay: 1, scale: 2, timeout: 10, launchOptions: { args: ['--single-process'] } }) const streams = await new Pageres({ crop: true, scale: 2, timeout: 10, launchOptions: { args: ['--single-process'] } })
.src(process.argv[2], ['600x315']) .source(process.argv[2], ['600x315'])
.run() .run()
process.stdout.write(streams[0], () => process.exit(0)) process.stdout.write(streams[0], () => process.exit(0))
} catch (e) { } catch (e) {

3
spawn/package.json Normal file
View File

@ -0,0 +1,3 @@
{
"type": "module"
}