Run this on the root of your Redwood project, like this:
npx https://gist.github.com/dac09/99cf500bbd5dc740a10c8cabf7372018
| { | |
| "name": "Cat1", | |
| "description": "A one-of-a-kind digital artwork.", | |
| "image": "https://placecats.com/millie_neo/300/200", | |
| "external_url": "https://placecats.com/millie_neo/300/200", | |
| "attributes": [ | |
| { | |
| "trait_type": "Artist", | |
| "value": "Place Cat" | |
| }, | 
| import fs from 'node:fs' | |
| import path from 'node:path' | |
| import { build as viteBuild } from 'vite' | |
| import { cjsInterop } from 'vite-plugin-cjs-interop' | |
| import { getPaths } from '@redwoodjs/project-config' | |
| export async function buildForStreamingServer({ | |
| verbose = false, | 
| // @ts-check | |
| import express from 'express' | |
| import { createServer as createViteServer } from 'vite' | |
| import { renderToPipeableStream, renderToString } from 'react-dom/server' | |
| import { PassThrough, Writable } from 'node:stream' | |
| import React from 'react' | |
| async function createServer() { | |
| const app = express() | 
| // To access your database | |
| // Append api/* to import from api and web/* to import from web | |
| import http from 'http' | |
| import { performance } from 'perf_hooks' | |
| import { db } from 'api/src/lib/db' | |
| const fs = require('fs') | |
| const path = require('path') | 
| import { QueryReference, UseBackgroundQueryResult, useBackgroundQuery, useReadQuery } from "@apollo/client" | |
| import type { DocumentNode } from "graphql" | |
| import { Suspense } from "react" | |
| import { CellErrorBoundary } from "./CellErrorBoundary.tsx" | |
| interface Cell { | |
| QUERY: DocumentNode, | |
| Success: React.FC, | |
| Loading: React.FC, | |
| Failure: React.FC, | 
Run this on the root of your Redwood project, like this:
npx https://gist.github.com/dac09/99cf500bbd5dc740a10c8cabf7372018
| const template = require('@babel/template').default | |
| module.exports = { | |
| plugins: [ | |
| [ | |
| function debugPlugin({ types }) { | |
| return { | |
| name: 'debug-plugin', | |
| visitor: { | |
| Program(p, options) { | 
| import { contacts } from './contacts' | |
| import type { StandardScenario } from './contacts.scenarios' | |
| import { setContext } from '@redwoodjs/graphql-server' | |
| const MOCKED_USER = { | |
| id: 156, | |
| name: 'Danny', | |
| } | 
| @tapehq:registry=https://npm.pkg.github.com | |
| //npm.pkg.github.com/:_authToken=PERSONAL_TOKEN_WITH_READ_PACKAGE |