Skip to content

Commit 84e007d

Browse files
committed
chore: update deps
1 parent c46019a commit 84e007d

9 files changed

Lines changed: 822 additions & 554 deletions

File tree

Lines changed: 355 additions & 355 deletions
Large diffs are not rendered by default.

.yarnrc.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,4 +8,4 @@ plugins:
88
- path: .yarn/plugins/@yarnpkg/plugin-postinstall-dev.cjs
99
spec: "https://raw.githubusercontent.com/sachinraja/yarn-plugin-postinstall-dev/main/bundles/%40yarnpkg/plugin-postinstall-dev.js"
1010

11-
yarnPath: .yarn/releases/yarn-4.9.2.cjs
11+
yarnPath: .yarn/releases/yarn-4.10.3.cjs

AGENTS.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
- This repository uses **Yarn 4 (Berry)** in classic `node_modules` mode (Plug'n'Play is disabled). Install dependencies with `yarn install --immutable`.
55
- A `postinstallDev` script runs [Beemo](https://beemo.dev/) with the `@niieani/scaffold` configuration to materialize local config files after install. If you ever need to regenerate those scaffolds manually, run `yarn postinstallDev`.
66
- The primary verification flow matches the CI workflow in `.github/workflows/ci-cd.yml`: run `yarn build` followed by `yarn test` when practical. The `yarn test` command runs formatting, type-checking, linting, and unit tests.
7-
- Use the existing formatting and linting tools instead of manual formatting. Prettier and ESLint configurations are already provided.
7+
- Use the existing formatting and linting tools instead of manual formatting. Prettier and ESLint configurations are already provided. Make sure to run `yarn format` before committing changes.
88

99
## Code generation boundaries
1010
- The following outputs are generated by scripts and must not be edited manually:

package.json

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -119,19 +119,19 @@
119119
},
120120
"devDependencies": {
121121
"@edge-runtime/vm": "^5.0.0",
122-
"@niieani/scaffold": "^1.7.49",
123-
"@swc/cli": "^0.7.7",
124-
"@swc/core": "^1.11.31",
125-
"devalue": "^5.1.1",
122+
"@niieani/scaffold": "^1.7.54",
123+
"@swc/cli": "^0.7.8",
124+
"@swc/core": "1.13.5",
125+
"devalue": "^5.3.2",
126126
"node-resolve-ts": "^1.0.2",
127-
"typescript": "^5.8.3",
128-
"vitest": "^3.2.2"
127+
"typescript": "^5.9.3",
128+
"vitest": "^3.2.4"
129129
},
130130
"resolutions": {
131131
"typescript": "5.8.3",
132132
"prettier": "^3"
133133
},
134-
"packageManager": "yarn@4.9.2",
134+
"packageManager": "yarn@4.10.3",
135135
"publishConfig": {
136136
"access": "public"
137137
}

src/bpeRanks/o200k_base.js

Lines changed: 11 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/codegen/generateByModel.ts

Lines changed: 23 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -14,17 +14,26 @@ import * as models from '../models.js'
1414
// eslint-disable-next-line no-underscore-dangle
1515
const __dirname = path.dirname(fileURLToPath(import.meta.url))
1616

17-
const directivePrefixes = ['/* eslint-disable', '// eslint-disable', '// @ts-nocheck', '// prettier-ignore'] as const
17+
const directivePrefixes = [
18+
'/* eslint-disable',
19+
'// eslint-disable',
20+
'// @ts-nocheck',
21+
'// prettier-ignore',
22+
] as const
1823

19-
const insertHeaderAfterDirectives = (content: string, headerLines: string[]): string => {
24+
const insertHeaderAfterDirectives = (
25+
content: string,
26+
headerLines: string[],
27+
): string => {
2028
const lines = content.split('\n')
2129
let insertIndex = 0
2230

2331
while (insertIndex < lines.length) {
24-
const line = lines[insertIndex]
32+
const line = lines[insertIndex]!
2533

2634
if (directivePrefixes.some((prefix) => line.startsWith(prefix))) {
2735
insertIndex += 1
36+
// eslint-disable-next-line no-continue
2837
continue
2938
}
3039

@@ -51,25 +60,25 @@ await Promise.all(
5160

5261
const headerLines = [
5362
'// This file was generated by src/codegen/generateByModel.ts.',
54-
"// To regenerate, run: yarn codegen:models.",
63+
'// To regenerate, run: yarn codegen:models.',
5564
`// Source template: src/encoding/${encoding}.ts.`,
5665
'',
5766
]
5867

59-
const baseContent = (isChatModel
68+
const baseContent = isChatModel
6069
? template
61-
.replace(
62-
`getEncodingApi('cl100k_base', () => bpeRanks)`,
63-
`getEncodingApiForModel('${modelName}', () => bpeRanks, ${devalue.uneval(
64-
modelData,
65-
)})`,
66-
)
67-
.replace('\nconst api =', '// prettier-ignore\nconst api =')
68-
.replaceAll(`cl100k_base.js`, `${encoding}.js`)
70+
.replace(
71+
`getEncodingApi('cl100k_base', () => bpeRanks)`,
72+
`getEncodingApiForModel('${modelName}', () => bpeRanks, ${devalue.uneval(
73+
modelData,
74+
)})`,
75+
)
76+
.replace('\nconst api =', '// prettier-ignore\nconst api =')
77+
.replaceAll(`cl100k_base.js`, `${encoding}.js`)
6978
: /* ts */ `// eslint-disable-next-line no-restricted-exports, import/no-default-export
7079
export { default } from '../encoding/${encoding}.js'
7180
export * from '../encoding/${encoding}.js'
72-
`)
81+
`
7382

7483
const content = insertHeaderAfterDirectives(baseContent, headerLines)
7584
await fs.writeFile(

src/codegen/generateChatEnabled.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ const chatEnabledModels = Object.entries<ModelSpec>(models)
1818

1919
const header = [
2020
'// This file was generated by src/codegen/generateChatEnabled.ts.',
21-
"// To regenerate, run: yarn codegen:chat-enabled.",
21+
'// To regenerate, run: yarn codegen:chat-enabled.',
2222
'// Source data: src/models.ts.',
2323
'',
2424
].join('\n')

src/codegen/generateJsBpe.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -129,7 +129,7 @@ await processFilesInDirectory(
129129

130130
const headerLines = [
131131
'// This file was generated by src/codegen/generateJsBpe.ts.',
132-
"// To regenerate, run: yarn codegen:bpe.",
132+
'// To regenerate, run: yarn codegen:bpe.',
133133
`// Source data: data/${modelName}.tiktoken.`,
134134
'',
135135
]

0 commit comments

Comments
 (0)