Skip to content

Commit

Permalink
Merge pull request #27 from Ironclad/github-actions
Browse files Browse the repository at this point in the history
initial github actions
  • Loading branch information
abrenneke authored Jul 27, 2023
2 parents f8aa138 + 195df20 commit abab5b8
Show file tree
Hide file tree
Showing 115 changed files with 2,658 additions and 1,821 deletions.
23 changes: 23 additions & 0 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
name: Build

on:
push:
branches:
- main
pull_request:

jobs:
build:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
node-version: 20
- name: Install dependencies
run: yarn --immutable
- name: Build
run: yarn build
- name: Test
run: yarn test
2,116 changes: 1,179 additions & 937 deletions .pnp.cjs

Large diffs are not rendered by default.

Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
21 changes: 11 additions & 10 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,21 +12,22 @@
"release-node": "node --loader ts-node/esm --loader ./.pnp.loader.mjs release-node.mts",
"publish-docs": "node --loader ts-node/esm --loader ./.pnp.loader.mjs publish-docs.mts",
"build": "yarn workspace @ironclad/rivet-core run build && yarn workspace @ironclad/rivet-node run build && yarn workspace @ironclad/rivet-app-executor run build && yarn workspace @ironclad/trivet run build && yarn workspace @ironclad/rivet-app run build",
"publish": "yarn workspace @ironclad/rivet-core run publish && yarn workspace @ironclad/rivet-node run publish"
"publish": "yarn workspace @ironclad/rivet-core run publish && yarn workspace @ironclad/rivet-node run publish",
"test": "yarn workspace @ironclad/rivet-core run test"
},
"devDependencies": {
"@swc/core": "^1.3.68",
"@types/eslint": "^8.40.2",
"@types/node": "^20.3.1",
"@swc/core": "^1.3.71",
"@types/eslint": "^8.44.1",
"@types/node": "^20.4.5",
"@types/yargs": "^17.0.24",
"chalk": "^5.2.0",
"esbuild": "^0.18.2",
"eslint": "^8.42.0",
"rollup": "^3.25.1",
"chalk": "^5.3.0",
"esbuild": "^0.18.17",
"eslint": "^8.45.0",
"rollup": "^3.26.3",
"ts-node": "^10.9.1",
"typescript": "^5.1.3",
"typescript": "^5.1.6",
"yargs": "^17.7.2",
"zx": "^7.2.2"
"zx": "^7.2.3"
},
"resolutions": {
"jest-mock": "^28.1.0"
Expand Down
15 changes: 13 additions & 2 deletions packages/app-executor/bin/executor.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,18 @@
import { startDebuggerServer, currentDebuggerState, createProcessor } from '@ironclad/rivet-node';
import yargs from 'yargs';
import { hideBin } from 'yargs/helpers';

const { port } = yargs(hideBin(process.argv))
.option('port', {
alias: 'p',
type: 'number',
description: 'Port to run the executor on.',
default: 21889,
})
.parseSync();

const rivetDebugger = startDebuggerServer({
port: 21889,
port,
allowGraphUpload: true,
dynamicGraphRun: async ({ graphId, inputs }) => {
if (currentDebuggerState.uploadedProject === undefined) {
Expand All @@ -22,4 +33,4 @@ const rivetDebugger = startDebuggerServer({
},
});

console.log('Node.js executor started on port 21889.');
console.log(`Node.js executor started on port ${port}.`);
10 changes: 6 additions & 4 deletions packages/app-executor/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,15 +12,17 @@
},
"devDependencies": {
"@ironclad/rivet-node": "workspace:^",
"@swc/core": "^1.3.68",
"esbuild": "^0.18.2",
"@swc/core": "^1.3.71",
"@types/yargs": "^17.0.24",
"esbuild": "^0.18.17",
"esbuild-plugin-copy": "^2.1.1",
"pkg": "^5.8.1",
"tsx": "^3.12.7",
"typescript": "^5.1.3"
"typescript": "^5.1.6"
},
"dependencies": {
"@dqbd/tiktoken": "^1.0.7"
"@dqbd/tiktoken": "^1.0.7",
"yargs": "^17.7.2"
},
"pkg": {
"assets": [
Expand Down
76 changes: 38 additions & 38 deletions packages/app/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -29,58 +29,58 @@
]
},
"dependencies": {
"@atlaskit/button": "^16.7.6",
"@atlaskit/checkbox": "^12.6.3",
"@atlaskit/css-reset": "^6.5.2",
"@atlaskit/dropdown-menu": "^11.9.4",
"@atlaskit/form": "^8.11.7",
"@atlaskit/inline-edit": "^12.3.3",
"@atlaskit/modal-dialog": "^12.6.1",
"@atlaskit/popup": "^1.6.4",
"@atlaskit/button": "^16.8.2",
"@atlaskit/checkbox": "^12.6.7",
"@atlaskit/css-reset": "^6.5.3",
"@atlaskit/dropdown-menu": "^11.11.0",
"@atlaskit/form": "^8.11.8",
"@atlaskit/inline-edit": "^12.3.5",
"@atlaskit/modal-dialog": "^12.6.4",
"@atlaskit/popup": "^1.9.0",
"@atlaskit/portal": "^4.3.4",
"@atlaskit/select": "^16.5.3",
"@atlaskit/tabs": "^13.4.2",
"@atlaskit/textarea": "^4.7.1",
"@atlaskit/textfield": "^5.5.1",
"@atlaskit/theme": "^12.5.4",
"@atlaskit/toggle": "^12.6.5",
"@atlaskit/tokens": "^1.5.2",
"@atlaskit/select": "^16.5.7",
"@atlaskit/tabs": "^13.4.3",
"@atlaskit/textarea": "^4.7.4",
"@atlaskit/textfield": "^5.6.3",
"@atlaskit/theme": "^12.5.5",
"@atlaskit/toggle": "^12.6.9",
"@atlaskit/tokens": "^1.13.1",
"@dnd-kit/core": "^6.0.8",
"@dqbd/tiktoken": "^1.0.7",
"@emotion/react": "^11.11.1",
"@emotion/styled": "^11.11.0",
"@floating-ui/react": "^0.24.5",
"@floating-ui/react": "^0.24.8",
"@ironclad/rivet-core": "workspace:^",
"@ironclad/trivet": "workspace:^",
"@swc/core": "^1.3.68",
"@tauri-apps/api": "^1.3.0",
"@tauri-apps/cli": "^1.3.1",
"@swc/core": "^1.3.71",
"@tauri-apps/api": "^1.4.0",
"@tauri-apps/cli": "^1.4.0",
"@types/fuse": "^2.6.0",
"@types/jsonpath-plus": "^5.0.2",
"@types/lodash-es": "^4.17.7",
"@types/node": "^20.3.1",
"@types/react": "^18.2.12",
"@types/react-dom": "^18.2.5",
"@types/lodash-es": "^4.17.8",
"@types/node": "^20.4.5",
"@types/react": "^18.2.17",
"@types/react-dom": "^18.2.7",
"@types/react-transition-group": "^4.4.6",
"@types/retry": "^0.12.2",
"@types/ws": "^8.5.5",
"@types/yargs": "^17.0.24",
"@vitejs/plugin-react": "^4.0.0",
"@zilliz/milvus2-sdk-node": "^2.2.16",
"ahooks": "^3.7.7",
"@vitejs/plugin-react": "^4.0.3",
"@zilliz/milvus2-sdk-node": "^2.2.21",
"ahooks": "^3.7.8",
"clsx": "^1.2.1",
"core-js": "^3.31.0",
"core-js": "^3.31.1",
"emittery": "^1.0.1",
"esbuild": "^0.18.2",
"eslint": "^8.42.0",
"esbuild": "^0.18.17",
"eslint": "^8.45.0",
"eslint-config-react-app": "^7.0.1",
"fuse.js": "^6.6.2",
"immer": "^10.0.2",
"jsonpath-plus": "^7.2.0",
"lodash-es": "^4.17.21",
"majesticons": "^2.1.2",
"marked": "^5.1.0",
"minimatch": "^9.0.1",
"marked": "^5.1.2",
"minimatch": "^9.0.3",
"monaco-editor": "^0.39.0",
"nanoid": "^3.3.6",
"openai": "^3.3.0",
Expand All @@ -100,14 +100,14 @@
"recoil": "^0.7.7",
"recoil-persist": "^4.2.0",
"retry": "^0.13.1",
"rollup": "^3.25.1",
"rollup": "^3.26.3",
"safe-stable-stringify": "^2.4.3",
"ts-dedent": "^2.2.0",
"ts-node": "^10.9.1",
"ts-pattern": "^5.0.1",
"type-fest": "^3.11.1",
"typescript": "^5.1.3",
"vite": "^4.3.9",
"ts-pattern": "^5.0.4",
"type-fest": "^3.13.1",
"typescript": "^5.1.6",
"vite": "^4.4.7",
"vite-plugin-monaco-editor": "^1.1.0",
"vite-plugin-svgr": "^3.2.0",
"vite-plugin-top-level-await": "^1.3.1",
Expand All @@ -127,8 +127,8 @@
},
"devDependencies": {
"@types/filesystem": "^0.0.32",
"@types/marked": "^5",
"@types/react-color": "^2",
"@types/marked": "^5.0.1",
"@types/react-color": "^2.17.6",
"@types/wicg-file-system-access": "^2020.9.6"
}
}
8 changes: 6 additions & 2 deletions packages/app/src/components/CodeEditor.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { useLatest } from 'ahooks';
import { FC, useEffect, useRef } from 'react';
import { FC, MutableRefObject, useEffect, useRef } from 'react';
import { monaco } from '../utils/monaco.js';

export const CodeEditor: FC<{
Expand All @@ -10,7 +10,8 @@ export const CodeEditor: FC<{
theme?: string;
autoFocus?: boolean;
onKeyDown?: (e: monaco.IKeyboardEvent) => void;
}> = ({ text, isReadonly, onChange, language, theme, autoFocus, onKeyDown }) => {
editorRef?: MutableRefObject<monaco.editor.IStandaloneCodeEditor | undefined>;
}> = ({ text, isReadonly, onChange, language, theme, autoFocus, onKeyDown, editorRef }) => {
const editorContainer = useRef<HTMLDivElement>(null);
const editorInstance = useRef<monaco.editor.IStandaloneCodeEditor>();

Expand Down Expand Up @@ -42,6 +43,9 @@ export const CodeEditor: FC<{
});

editorInstance.current = editor;
if (editorRef) {
editorRef.current = editor;
}

return () => {
editor.dispose();
Expand Down
9 changes: 6 additions & 3 deletions packages/app/src/components/UserInputModal.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { FC, useEffect, useMemo, useState } from 'react';
import { FC, useEffect, useMemo, useRef, useState } from 'react';
import { useRecoilState } from 'recoil';
import { ArrayDataValue, StringDataValue } from '@ironclad/rivet-core';
import { lastAnswersState } from '../state/userInput.js';
Expand Down Expand Up @@ -45,8 +45,7 @@ export const UserInputModal: FC<UserInputModalProps> = ({ open, questions, onSub

useEffect(() => {
setAnswers(questions.map((question) => lastAnswers[question] ?? ''));
// eslint-disable-next-line react-hooks/exhaustive-deps
}, [open]);
}, [open, lastAnswers, questions]);

const handleChange = (index: number, value: string) => {
const newAnswers = [...answers];
Expand Down Expand Up @@ -102,6 +101,8 @@ const UserInputModalQuestion: FC<{
onChange?: (index: number, newText: string) => void;
onSubmit?: () => void;
}> = ({ question, answer, index, onChange, onSubmit }) => {
const editorRef = useRef<monaco.editor.IStandaloneCodeEditor>();

const handleTextAreaKeyDown = (e: monaco.IKeyboardEvent) => {
if (e.keyCode === monaco.KeyCode.Enter && (e.metaKey || e.ctrlKey)) {
e.preventDefault();
Expand All @@ -118,10 +119,12 @@ const UserInputModalQuestion: FC<{
<div className="question" dangerouslySetInnerHTML={questionHtml} />
<div className="editor">
<CodeEditor
key={question}
text={answer ?? ''}
onChange={(e) => onChange?.(index, e)}
autoFocus
onKeyDown={handleTextAreaKeyDown}
editorRef={editorRef}
/>
</div>
</div>
Expand Down
Loading

0 comments on commit abab5b8

Please sign in to comment.