Separate prototype as example

This commit is contained in:
Kenneth Allen 2021-05-15 16:18:13 +10:00
parent cc3115bfcc
commit 3e692c0996
31 changed files with 18 additions and 18 deletions

View File

@ -1,9 +1,8 @@
/packages/ketchup-react/
/packages/*-client/
node_modules/
dist/
/packages/ketchup-client/
/packages/ketchup-react/
/packages/space-client/
.eslintcache
*.log

View File

@ -1,6 +1,7 @@
version: "3.8"
services:
server:
build: .
build:
context: .
dockerfile: packages/example-server/Dockerfile
ports:
- "4000:80"

View File

@ -1,5 +1,5 @@
{
"name": "space-client",
"name": "example-client",
"version": "0.1.1",
"private": true,
"dependencies": {
@ -14,7 +14,7 @@
"react": "^17.0.1",
"react-dom": "^17.0.1",
"react-scripts": "^4.0.3",
"space-common": "^0.1.1",
"example-common": "^0.1.1",
"typescript": "^4.0.3",
"web-vitals": "^1.1.2"
},

View File

Before

Width:  |  Height:  |  Size: 3.8 KiB

After

Width:  |  Height:  |  Size: 3.8 KiB

View File

Before

Width:  |  Height:  |  Size: 5.2 KiB

After

Width:  |  Height:  |  Size: 5.2 KiB

View File

Before

Width:  |  Height:  |  Size: 9.4 KiB

After

Width:  |  Height:  |  Size: 9.4 KiB

View File

@ -1,7 +1,7 @@
import React, { useState } from 'react';
import './App.css';
import useKetchup from 'ketchup-react'
import { reducer } from 'space-common'
import { reducer } from 'example-common'
export default function App() {
const [proj, dispatch] = useKetchup('ws://localhost:4000', reducer)

View File

Before

Width:  |  Height:  |  Size: 2.6 KiB

After

Width:  |  Height:  |  Size: 2.6 KiB

View File

@ -1,5 +1,5 @@
{
"name": "space-common",
"name": "example-common",
"version": "0.1.3",
"description": "WebSocket-based rollback state synchronization server.",
"main": "dist/index.js",

View File

@ -4,11 +4,11 @@ RUN apk add --no-cache tini
RUN yarn global add lerna
WORKDIR /opt/space-server
WORKDIR /opt/example-server
COPY packages/ketchup-common/package.json packages/ketchup-common/
COPY packages/ketchup-server/package.json packages/ketchup-server/
COPY packages/space-common/package.json packages/space-common/
COPY packages/space-server/package.json packages/space-server/
COPY packages/example-common/package.json packages/example-common/
COPY packages/example-server/package.json packages/example-server/
COPY package.json yarn.lock lerna.json ./
RUN lerna bootstrap
@ -16,5 +16,5 @@ COPY . ./
RUN lerna run build
ENTRYPOINT ["tini", "--"]
CMD ["node", "packages/space-server"]
CMD ["node", "packages/example-server"]
EXPOSE 80

View File

@ -1,6 +1,6 @@
import WebSocket from 'ws'
import KetchupServer from 'ketchup-server'
import { initial, reducer } from 'space-common'
import { initial, reducer } from 'example-common'
const port = parseInt(process.env.PORT ?? '80')

View File

@ -1,5 +1,5 @@
{
"name": "space-server",
"name": "example-server",
"version": "0.1.3",
"description": "WebSocket-based rollback state synchronization server.",
"main": "dist/index.js",
@ -8,7 +8,7 @@
"dependencies": {
"ketchup-server": "^0.1.1",
"lodash": "^4.17.20",
"space-common": "^0.1.1",
"example-common": "^0.1.1",
"ts-node": "^9.1.1",
"ws": "^7.4.2"
},