Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

dependency updates #590

Merged
merged 6 commits into from
Jul 26, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
node-version: [20]
node-version: [20, 22]
steps:
- uses: actions/checkout@v4
with:
Expand Down
548 changes: 401 additions & 147 deletions THIRD_PARTY_LICENSES.md

Large diffs are not rendered by default.

22 changes: 16 additions & 6 deletions docs/.vscode/settings.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,17 @@
{
"cSpell.words": [
"genaiscript",
"openai"
],
"genaiscript.cli.path": "../packages/cli/built/genaiscript.cjs"
}
"cSpell.words": ["genaiscript", "openai"],
"genaiscript.cli.path": "../packages/cli/built/genaiscript.cjs",
// https://hideoo.dev/notes/starlight-paste-images-with-visual-studio-code
// Enable pasting files into a Markdown editor to create Markdown links.
"markdown.editor.filePaste.enabled": "smart",
// Copy pasted media files into a Markdown editor to the workspace.
"markdown.editor.filePaste.copyIntoWorkspace": "mediaFiles",
// Enable dropping files into a Markdown editor to create Markdown links.
"markdown.editor.drop.enabled": "smart",
// Copy dropped media files into a Markdown editor to the workspace.
"markdown.editor.drop.copyIntoWorkspace": "mediaFiles",
// Copy pasted files in documentation pages to the `src/assets/` directory.
"markdown.copyFiles.destination": {
"/src/content/docs/**/*": "/src/assets/"
}
}
8 changes: 4 additions & 4 deletions docs/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,10 @@
"genai:alt-text": "node scripts/image-alt-text.mjs"
},
"dependencies": {
"@astrojs/check": "^0.7.0",
"@astrojs/starlight": "^0.24.5",
"astro": "^4.11.5",
"typescript": "5.5.3"
"@astrojs/check": "^0.8.3",
"@astrojs/starlight": "^0.25.2",
"astro": "^4.12.2",
"typescript": "5.5.4"
},
"devDependencies": {
"zx": "^8.1.4"
Expand Down
25 changes: 25 additions & 0 deletions docs/src/components/DirectoryLinks.astro
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
---
import { getCollection } from "astro:content"
import { CardGrid, LinkCard } from "@astrojs/starlight/components"

interface Props {
directory: string
}
const { directory } = Astro.props

const pages = (
await getCollection("docs", (entry) => entry.id.startsWith(directory + "/"))
).filter(({ slug }) => slug !== directory)
---

<CardGrid
>{
pages.map(({ data, slug }) => (
<LinkCard
title={data.title}
href={"/" + slug}
description={data.description}
/>
))
}</CardGrid
>
3 changes: 2 additions & 1 deletion docs/src/content/docs/reference/cli/commands.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
---
title: Commands
description: List of all CLI commands
sidebar:
order: 100
---
Expand Down Expand Up @@ -86,7 +87,7 @@ Options:
-td, --test-delay <string> delay between tests in seconds
--no-cache disable LLM result cache
-v, --verbose verbose output
-pv, --promptfoo-version [version] promptfoo version, default is ^0.72.0
-pv, --promptfoo-version [version] promptfoo version, default is ^0.73.6

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There seems to be a typo here.

generated by pr-docs-review-commit typo

-os, --out-summary <file> append output summary in file
-h, --help display help for command
```
Expand Down
6 changes: 6 additions & 0 deletions docs/src/content/docs/reference/cli/index.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ keywords: GenAIScript CLI, Node.js automation, AI scripting, command line interf

import { Steps } from "@astrojs/starlight/components"
import { Tabs, TabItem } from "@astrojs/starlight/components"
import DirectoryLinks from '../../../../components/DirectoryLinks.astro';

The GenAIScript CLI **`genaiscript`** runs GenAIScript scripts
outside of Visual Studio and in your [automation](/genaiscript/getting-starting/automating-scripts).
Expand Down Expand Up @@ -136,3 +137,8 @@ npx genaiscript scripts model [script]

where [script] can be a script id or a file path.



## Topics

<DirectoryLinks directory="reference/cli" />

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The 'DirectoryLinks' component is used but not defined in the document.

generated by pr-docs-review-commit missing_component

8 changes: 7 additions & 1 deletion docs/src/content/docs/reference/scripts/index.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,9 @@ description: Learn how to use and customize GenAIScript templates for efficient
keywords: script templates, AI prompts, prompt expansion, OpenAI integration, template customization
---
import { FileTree } from "@astrojs/starlight/components"
import DirectoryLinks from '../../../../components/DirectoryLinks.astro';

GenAIScript are JavaScript files named as `*.genai.mjs`
GenAIScript are JavaScript files named as `*.genai.mjs`, or TypeScript files named as `*.genai.mts`,
with a prompt creation engine designed by LLM prompting.

```js title="shorten.genai.mjs"
Expand Down Expand Up @@ -48,3 +49,8 @@ $`Shorten ${file}. Limit changes to minimum.`

- `system.*.genai.mjs` are considered [system prompt templates](/genaiscript/reference/scripts/system)
and are unlisted by default.


## Topics

<DirectoryLinks directory="reference/scripts" />

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The 'DirectoryLinks' component is used but not defined in the document.

generated by pr-docs-review-commit missing_component

3 changes: 0 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,6 @@
"packages/*",
"docs",
"slides"
],
"nohoist": [
"json5"
]
},
"scripts": {
Expand Down
16 changes: 8 additions & 8 deletions packages/cli/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -28,14 +28,14 @@
"@azure/identity": "^4.4.0",
"@lvce-editor/ripgrep": "^1.2.0",
"dockerode": "^4.0.2",
"gpt-tokenizer": "^2.1.2",
"gpt-tokenizer": "^2.2.1",
"mammoth": "^1.8.0",
"mathjs": "^13.0.2",
"mathjs": "^13.0.3",
"pdfjs-dist": "4.4.168",
"promptfoo": "^0.72.0",
"promptfoo": "^0.73.6",
"tree-sitter-wasms": "^0.1.11",
"tsx": "^4.16.2",
"typescript": "5.5.3",
"typescript": "5.5.4",
"vectra": "^0.7.6",
"web-tree-sitter": "^0.22.2",
"xlsx": "https://cdn.sheetjs.com/xlsx-0.20.2/xlsx-0.20.2.tgz"
Expand All @@ -44,10 +44,10 @@
"node": ">=20.0.0"
},
"devDependencies": {
"@types/dockerode": "^3.3.30",
"@types/dockerode": "^3.3.31",
"@types/fs-extra": "^11.0.4",
"@types/memorystream": "^0.3.4",
"@types/node": "^20.14.11",
"@types/node": "^20.14.12",
"@types/papaparse": "^5.3.14",
"@types/prompts": "^2.4.9",
"@types/replace-ext": "^2.0.2",
Expand All @@ -57,13 +57,13 @@
"dotenv": "^16.4.5",
"esbuild": "^0.23.0",
"execa": "^9.3.0",
"file-type": "^19.1.1",
"file-type": "^19.3.0",
"fs-extra": "^11.2.0",
"get-stdin": "^9.0.0",
"glob": "^11.0.0",
"memorystream": "^0.3.1",
"node-sarif-builder": "^3.1.0",
"openai": "^4.52.7",
"openai": "^4.53.1",
"ora": "^8.0.1",
"pretty-bytes": "^6.1.1",
"prompts": "^2.4.2",
Expand Down
1 change: 1 addition & 0 deletions packages/cli/src/help.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ import { Command, program } from "commander"
export async function helpAll() {
console.log(`---`)
console.log(`title: Commands`)
console.log(`description: List of all CLI commands`)

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You've added a new console.log statement to print a description. This is a good addition for clarity. However, it would be better to use template literals for consistency with the rest of the code. 😊

generated by pr-review-commit missing_semi

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The string you're logging doesn't follow the same format as the other console.log statements. It might be better to follow the same format for consistency. For example: console.log(description: ${description}). πŸ‘

generated by pr-review-commit string_format

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The string "List of all CLI commands" is hard-coded. It would be better to store this in a variable or constant, especially if it's used in multiple places. This makes it easier to manage and update the text. πŸ˜ƒ

generated by pr-review-commit hard_coded_string

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The added line console.log(description: List of all CLI commands) seems to be a placeholder for a description of all CLI commands. However, it doesn't actually list the commands. You might want to replace this with a function that generates the list of commands. 😊

generated by pr-review-commit missing_functionality

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The use of console.log is generally discouraged in production code as it can lead to performance issues. Consider using a logging library that can handle log levels (like debug, info, warn, error) and output logs to a file. πŸ“

generated by pr-review-commit console_log_usage

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There is no error handling for the console.log statement. If for some reason the console is not available or an error occurs during the execution of this line, the program may crash. Consider adding error handling to ensure the program can recover gracefully from any errors. πŸ› οΈ

generated by pr-review-commit missing_error_handling

console.log(`sidebar:`)
console.log(` order: 100`)
console.log(`---\n`)
Expand Down
16 changes: 8 additions & 8 deletions packages/core/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
"@types/inflection": "^1.13.2",
"@types/ini": "^4.1.1",
"@types/mime-types": "^2.1.4",
"@types/node": "^20.14.11",
"@types/node": "^20.14.12",
"ajv": "^8.17.1",
"cross-fetch": "^4.0.0",
"csv-parse": "^5.5.6",
Expand All @@ -33,8 +33,8 @@
"fast-xml-parser": "^4.4.0",
"fetch-retry": "^6.0.0",
"fflate": "^0.8.2",
"file-type": "^19.1.1",
"gpt-tokenizer": "^2.1.2",
"file-type": "^19.3.0",
"gpt-tokenizer": "^2.2.1",
"html-escaper": "^3.0.3",
"html-to-text": "^9.0.5",
"ignore": "^5.3.1",
Expand All @@ -45,11 +45,11 @@
"magic-string": "^0.30.10",
"mammoth": "^1.8.0",
"markdown-table": "^3.0.3",
"mathjs": "^13.0.2",
"mathjs": "^13.0.3",
"mime-types": "^2.1.35",
"minimatch": "^10.0.1",
"minisearch": "^7.0.1",
"openai": "^4.52.7",
"minisearch": "^7.1.0",
"openai": "^4.53.1",
"parse-diff": "^0.11.1",
"prettier": "^3.3.3",
"pretty-bytes": "^6.1.1",
Expand All @@ -58,10 +58,10 @@
"tree-sitter-wasms": "^0.1.11",
"ts-dedent": "^2.2.0",
"tsx": "^4.16.2",
"typescript": "5.5.3",
"typescript": "5.5.4",
"vectra": "^0.7.6",
"xlsx": "https://cdn.sheetjs.com/xlsx-0.20.2/xlsx-0.20.2.tgz",
"yaml": "^2.4.5"
"yaml": "^2.5.0"
},
"scripts": {
"typecheck": "tsc -p src",
Expand Down
4 changes: 2 additions & 2 deletions packages/vscode/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -362,11 +362,11 @@
},
"devDependencies": {
"@types/vscode": "^1.90.0",
"@vscode/vsce": "^2.30.0",
"@vscode/vsce": "^2.31.1",
"assert": "^2.1.0",
"eslint": "^9.7.0",
"process": "^0.11.10",
"typescript": "5.5.3",
"typescript": "5.5.4",
"vscode-uri": "^3.0.8",
"webfont": "^11.2.26",
"websocket-polyfill": "0.0.3",
Expand Down
4 changes: 2 additions & 2 deletions slides/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,10 @@
"dev": "slidev --open"
},
"dependencies": {
"@slidev/cli": "^0.49.16",
"@slidev/cli": "^0.49.22",
"@slidev/theme-default": "latest",
"@slidev/theme-seriph": "latest",
"vue": "^3.4.31"
"vue": "^3.4.34"
},
"devDependencies": {
"zx": "^8.1.4"
Expand Down
Loading