Skip to content

Commit

Permalink
docs: ✏️ update contributing guide with build/debug info
Browse files Browse the repository at this point in the history
  • Loading branch information
pelikhan committed Nov 20, 2024
1 parent d631679 commit 0c21ae8
Show file tree
Hide file tree
Showing 2 changed files with 49 additions and 1 deletion.
48 changes: 47 additions & 1 deletion CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,11 +31,57 @@ You can open this repo in GitHub CodeSpace/Docker to get the build environment n
yarn install --frozen-lockfile --prefer-offline
```

## Build

You can do a full compile using esbuild.

```sh
yarn compile
```

or a typecheck using `tsc`.

```sh
yarn typecheck
```

or start a debug session in VSCode.

- Start the **Run - sample** Debugger to launch the sample project in debugging mode

## Running local scripts

To run a script using the locally built cli,

```sh
yarn genai <scriptid> ...
```

To run a sample script under the `packages/sample` folder:

```sh
yarn run:script <scriptid> ...
```

In this case, it will use the `packages/sample/.env` file for the environment variables and workspace will be rooted at `packages/sample`.

## Debugging local scripts

Open a `JavaScript Debug Terminal` and launch the script using

```sh
yarn genai:debug <scriptid> ...
```

or for samples

```sh
yarn run:script:debug <scriptid> ...
```

## Dependencies

- run `yarn install` to refresh the lock file
- run `yarn install:force` to refresh the lock file
- run `yarn gen:licenses` to refresh the 3rd party licenses

## Docs
Expand Down
2 changes: 2 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@
"test:infomodel": "node packages/cli/built/genaiscript.cjs scripts model",
"test:phi3": "node packages/cli/built/genaiscript.cjs run summarize-ollama-phi3 packages/sample/src/rag/markdown.md",
"run:script": "cd packages/sample/ && yarn run:script",
"run:script:debug": "yarn compile-debug && cd packages/sample/ && yarn run:script",
"cache:clear": "cd packages/sample/ && yarn cache:clear",
"test:scripts": "cd packages/sample/ && yarn test:scripts",
"test:scripts:view": "cd packages/sample/ && yarn test:scripts:view",
Expand All @@ -70,6 +71,7 @@
"gcm": "node packages/cli/built/genaiscript.cjs run gcm --model github:gpt-4o",
"prd": "node packages/cli/built/genaiscript.cjs run prd -prd --model github:gpt-4o",
"genai": "node packages/cli/built/genaiscript.cjs run",
"genai:debug": "yarn compile-debug && node packages/cli/built/genaiscript.cjs run",
"upgrade:deps": "zx scripts/upgrade-deps.mjs",
"cli": "node packages/cli/built/genaiscript.cjs",
"ollama": "yarn ollama:stop && yarn ollama:start",
Expand Down

0 comments on commit 0c21ae8

Please sign in to comment.