Skip to content

Commit

Permalink
split docs/produtct dependencies (#621)
Browse files Browse the repository at this point in the history
* upgrade dependencis

* don't upgrade astro

* use installed astro

* use npx

* support for xml attribute parsing

* removing version

* updated promptfoo versions

* promptfoo as peer dependency

* removing tryimport

* removing slidev dependencies

* missing markdown-it types

* package vscode earlier
  • Loading branch information
pelikhan authored Aug 16, 2024
1 parent 257fa29 commit c9f9795
Show file tree
Hide file tree
Showing 39 changed files with 13,191 additions and 38,085 deletions.
6 changes: 4 additions & 2 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,8 @@ jobs:
run: yarn typecheck
- name: compile
run: yarn compile
- name: package vscode
run: yarn package
- name: compile system scripts
run: yarn test:system
- name: compile tests
Expand All @@ -35,5 +37,5 @@ jobs:
run: yarn test:samples
- name: docs
run: yarn build:docs
- name: package vscode
run: yarn package
- name: slides
run: yarn build:slides
33,467 changes: 3,224 additions & 30,243 deletions THIRD_PARTY_LICENSES.md

Large diffs are not rendered by default.

5 changes: 5 additions & 0 deletions docs/genaisrc/genaiscript.d.ts

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

11 changes: 6 additions & 5 deletions docs/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,11 @@
"version": "1.49.1",
"license": "MIT",
"scripts": {
"install:force": "rm yarn.lock && yarn install",
"dev": "astro dev --host",
"start": "astro dev --host",
"check": "astro check",
"build": "npx --yes astro build",
"build": "astro build",
"build:asw": "rm -Rf distasw && mkdir distasw && touch distasw/index.html && mkdir distasw/genaiscript && cp -r dist/* distasw/genaiscript",
"preview": "astro preview",
"astro": "astro",
Expand All @@ -18,12 +19,12 @@
"genai:alt-text": "node scripts/image-alt-text.mjs"
},
"dependencies": {
"@astrojs/check": "^0.9.1",
"@astrojs/starlight": "^0.25.3",
"astro": "^4.13.1",
"@astrojs/check": "^0.9.2",
"@astrojs/starlight": "^0.25.5",
"astro": "^4.14.2",
"typescript": "5.5.4"
},
"devDependencies": {
"zx": "^8.1.4"
}
}
}
10 changes: 5 additions & 5 deletions docs/src/content/docs/reference/cli/commands.md
Original file line number Diff line number Diff line change
Expand Up @@ -87,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.75.2
-pv, --promptfoo-version [version] promptfoo version, default is 0.78.0
-os, --out-summary <file> append output summary in file
-h, --help display help for command
```
Expand Down Expand Up @@ -292,10 +292,10 @@ Options:
-h, --help display help for command
Commands:
fence <language> Extracts a code fenced regions of the given type
fence <language> <file> Extracts a code fenced regions of the given type
pdf <file> Parse a PDF into text
docx <file> Parse a DOCX into texts
html-to-text [file] Parse an HTML file into text
html-to-text <file> Parse an HTML file into text
code <file> [query] Parse code using tree sitter and executes a
query
tokens [options] <files...> Count tokens in a set of files
Expand All @@ -305,7 +305,7 @@ Commands:
### `parse fence`

```
Usage: genaiscript parse fence [options] <language>
Usage: genaiscript parse fence [options] <language> <file>
Extracts a code fenced regions of the given type
Expand Down Expand Up @@ -338,7 +338,7 @@ Options:
### `parse html-to-text`

```
Usage: genaiscript parse html-to-text [options] [file]
Usage: genaiscript parse html-to-text [options] <file>
Parse an HTML file into text
Expand Down
8 changes: 8 additions & 0 deletions docs/src/content/docs/reference/scripts/files.md
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,14 @@ Reads the content of a file as JSON (using a [JSON5](https://json5.org/) parser)
const data = await workspace.readJSON("data.json")
```

### `readXML`

Reads the content of a file as XML.

```ts
const data = await workspace.readXML("data.xml")
```

### `writeText`

Writes text to a file, relative to the workspace root.
Expand Down
13 changes: 12 additions & 1 deletion docs/src/content/docs/reference/scripts/parsers.md
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,18 @@ const res = parsers.JSONL(file)
The `parsers.XML` function parses for the [XML format](https://en.wikipedia.org/wiki/XML).

```js
const res = parsers.XML("<xml></xml>")
const res = parsers.XML('<xml attr="1"><child /></xml>')
```

Attribute names are prepended with "@_".

```json
{
"xml": {
"@_attr": "1",
"child": {}
}
}
```

## front matter
Expand Down
Loading

0 comments on commit c9f9795

Please sign in to comment.