Separate prototype as example
@ -1,9 +1,8 @@
|
|||||||
|
/packages/ketchup-react/
|
||||||
|
/packages/*-client/
|
||||||
|
|
||||||
node_modules/
|
node_modules/
|
||||||
dist/
|
dist/
|
||||||
|
|
||||||
/packages/ketchup-client/
|
|
||||||
/packages/ketchup-react/
|
|
||||||
/packages/space-client/
|
|
||||||
|
|
||||||
.eslintcache
|
.eslintcache
|
||||||
*.log
|
*.log
|
||||||
|
|||||||
@ -1,6 +1,7 @@
|
|||||||
version: "3.8"
|
|
||||||
services:
|
services:
|
||||||
server:
|
server:
|
||||||
build: .
|
build:
|
||||||
|
context: .
|
||||||
|
dockerfile: packages/example-server/Dockerfile
|
||||||
ports:
|
ports:
|
||||||
- "4000:80"
|
- "4000:80"
|
||||||
|
|||||||
@ -1,5 +1,5 @@
|
|||||||
{
|
{
|
||||||
"name": "space-client",
|
"name": "example-client",
|
||||||
"version": "0.1.1",
|
"version": "0.1.1",
|
||||||
"private": true,
|
"private": true,
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
@ -14,7 +14,7 @@
|
|||||||
"react": "^17.0.1",
|
"react": "^17.0.1",
|
||||||
"react-dom": "^17.0.1",
|
"react-dom": "^17.0.1",
|
||||||
"react-scripts": "^4.0.3",
|
"react-scripts": "^4.0.3",
|
||||||
"space-common": "^0.1.1",
|
"example-common": "^0.1.1",
|
||||||
"typescript": "^4.0.3",
|
"typescript": "^4.0.3",
|
||||||
"web-vitals": "^1.1.2"
|
"web-vitals": "^1.1.2"
|
||||||
},
|
},
|
||||||
|
Before Width: | Height: | Size: 3.8 KiB After Width: | Height: | Size: 3.8 KiB |
|
Before Width: | Height: | Size: 5.2 KiB After Width: | Height: | Size: 5.2 KiB |
|
Before Width: | Height: | Size: 9.4 KiB After Width: | Height: | Size: 9.4 KiB |
@ -1,7 +1,7 @@
|
|||||||
import React, { useState } from 'react';
|
import React, { useState } from 'react';
|
||||||
import './App.css';
|
import './App.css';
|
||||||
import useKetchup from 'ketchup-react'
|
import useKetchup from 'ketchup-react'
|
||||||
import { reducer } from 'space-common'
|
import { reducer } from 'example-common'
|
||||||
|
|
||||||
export default function App() {
|
export default function App() {
|
||||||
const [proj, dispatch] = useKetchup('ws://localhost:4000', reducer)
|
const [proj, dispatch] = useKetchup('ws://localhost:4000', reducer)
|
||||||
|
Before Width: | Height: | Size: 2.6 KiB After Width: | Height: | Size: 2.6 KiB |
@ -1,5 +1,5 @@
|
|||||||
{
|
{
|
||||||
"name": "space-common",
|
"name": "example-common",
|
||||||
"version": "0.1.3",
|
"version": "0.1.3",
|
||||||
"description": "WebSocket-based rollback state synchronization server.",
|
"description": "WebSocket-based rollback state synchronization server.",
|
||||||
"main": "dist/index.js",
|
"main": "dist/index.js",
|
||||||
@ -4,11 +4,11 @@ RUN apk add --no-cache tini
|
|||||||
|
|
||||||
RUN yarn global add lerna
|
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-common/package.json packages/ketchup-common/
|
||||||
COPY packages/ketchup-server/package.json packages/ketchup-server/
|
COPY packages/ketchup-server/package.json packages/ketchup-server/
|
||||||
COPY packages/space-common/package.json packages/space-common/
|
COPY packages/example-common/package.json packages/example-common/
|
||||||
COPY packages/space-server/package.json packages/space-server/
|
COPY packages/example-server/package.json packages/example-server/
|
||||||
COPY package.json yarn.lock lerna.json ./
|
COPY package.json yarn.lock lerna.json ./
|
||||||
RUN lerna bootstrap
|
RUN lerna bootstrap
|
||||||
|
|
||||||
@ -16,5 +16,5 @@ COPY . ./
|
|||||||
RUN lerna run build
|
RUN lerna run build
|
||||||
|
|
||||||
ENTRYPOINT ["tini", "--"]
|
ENTRYPOINT ["tini", "--"]
|
||||||
CMD ["node", "packages/space-server"]
|
CMD ["node", "packages/example-server"]
|
||||||
EXPOSE 80
|
EXPOSE 80
|
||||||
@ -1,6 +1,6 @@
|
|||||||
import WebSocket from 'ws'
|
import WebSocket from 'ws'
|
||||||
import KetchupServer from 'ketchup-server'
|
import KetchupServer from 'ketchup-server'
|
||||||
import { initial, reducer } from 'space-common'
|
import { initial, reducer } from 'example-common'
|
||||||
|
|
||||||
const port = parseInt(process.env.PORT ?? '80')
|
const port = parseInt(process.env.PORT ?? '80')
|
||||||
|
|
||||||
@ -1,5 +1,5 @@
|
|||||||
{
|
{
|
||||||
"name": "space-server",
|
"name": "example-server",
|
||||||
"version": "0.1.3",
|
"version": "0.1.3",
|
||||||
"description": "WebSocket-based rollback state synchronization server.",
|
"description": "WebSocket-based rollback state synchronization server.",
|
||||||
"main": "dist/index.js",
|
"main": "dist/index.js",
|
||||||
@ -8,7 +8,7 @@
|
|||||||
"dependencies": {
|
"dependencies": {
|
||||||
"ketchup-server": "^0.1.1",
|
"ketchup-server": "^0.1.1",
|
||||||
"lodash": "^4.17.20",
|
"lodash": "^4.17.20",
|
||||||
"space-common": "^0.1.1",
|
"example-common": "^0.1.1",
|
||||||
"ts-node": "^9.1.1",
|
"ts-node": "^9.1.1",
|
||||||
"ws": "^7.4.2"
|
"ws": "^7.4.2"
|
||||||
},
|
},
|
||||||