Skip to content
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/actions/setup-fern/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ runs:
- name: Install pinned Fern
shell: bash
run: |
npm install --prefix "$RUNNER_TEMP/vapi-fern" --no-save --no-audit --no-fund fern-api@5.112.0
npm install --prefix "$RUNNER_TEMP/vapi-fern" --no-save --no-audit --no-fund fern-api@5.151.1
echo "FERN_CLI_PATH=$RUNNER_TEMP/vapi-fern/node_modules/fern-api/cli.cjs" >> "$GITHUB_ENV"
- name: Test cache safeguards
shell: bash
Expand Down
2 changes: 1 addition & 1 deletion fern/fern.config.json
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{
"organization": "vapi",
"version": "5.112.0"
"version": "5.151.1"
}
4 changes: 2 additions & 2 deletions scripts/fern/README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Fern example cache

Fern 5.112.0 repeatedly generates examples for nested API properties during
Fern 5.151.1 repeatedly generates examples for nested API properties during
validation and publication. The GPT-Live docs publish spent about 24 minutes
preparing validation and another 25 minutes building the API navigation. Its
final deployment took six seconds.
Expand Down Expand Up @@ -49,7 +49,7 @@ original Fern commands also removes this optimization.
## Local verification

```sh
npm install --prefix /tmp/vapi-fern --no-save fern-api@5.112.0
npm install --prefix /tmp/vapi-fern --no-save fern-api@5.151.1
export FERN_CLI_PATH=/tmp/vapi-fern/node_modules/fern-api/cli.cjs
node --test scripts/fern/example-cache.test.cjs
node scripts/fern/run.cjs check --local --log-level debug
Expand Down
2 changes: 1 addition & 1 deletion scripts/fern/example-cache.test.cjs
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ test('corrupt entries fall back to original generation', (t) => {
test('API and prose edits preserve the namespace while tooling changes invalidate it', (t) => {
const { directory } = fixture(t);
fs.mkdirSync(path.join(directory, 'fern/apis/api'), { recursive: true });
fs.writeFileSync(path.join(directory, 'fern/fern.config.json'), '{"version":"5.112.0"}');
fs.writeFileSync(path.join(directory, 'fern/fern.config.json'), '{"version":"5.151.1"}');
fs.writeFileSync(path.join(directory, 'fern/apis/api/openapi.json'), '{}');
const before = inputDigest(directory);
fs.writeFileSync(path.join(directory, 'fern/overview.mdx'), 'new prose');
Expand Down
8 changes: 4 additions & 4 deletions scripts/fern/run.cjs
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@ const os = require('node:os');
const { spawnSync } = require('node:child_process');
const { digest } = require('./example-cache.cjs');

const VERSION = '5.112.0';
const CLI_SHA256 = '9932a459d6e109b40a1dcf4551317e9737779c5c3750f0c78701c0c4d58d6305';
const MARKER = 'function u8d({propertySchema:e,breadcrumbs:t,context:r,propertyId:n})';
const VERSION = '5.151.1';
const CLI_SHA256 = '1259c794e499472dcd28ed3098ee5dbf6e3245bc7f0dac95faf726683fb4b379';
const MARKER = 'function gxm({propertySchema:e,breadcrumbs:t,context:r,propertyId:n})';
const MEDIA_MARKER = 'generateOrValidateExample({schema:t,example:r,generateOptionalProperties:n,exampleGenerationStrategy:i})';

function inputDigest(root) {
Expand All @@ -27,7 +27,7 @@ function main() {
if (digest(source) !== CLI_SHA256 || source.split(MARKER).length !== 2 || source.split(MEDIA_MARKER).length !== 2) throw new Error('Unexpected Fern CLI contents. Refusing to apply the cache adapter.');
const temporary = fs.mkdtempSync(path.join(os.tmpdir(), 'vapi-fern-'));
const patched = source
.replace(MARKER, 'function u8d(args){return globalThis.__vapiFernExamples(args,()=>vapiOriginalExamples(args))}function vapiOriginalExamples({propertySchema:e,breadcrumbs:t,context:r,propertyId:n})')
.replace(MARKER, 'function gxm(args){return globalThis.__vapiFernExamples(args,()=>vapiOriginalExamples(args))}function vapiOriginalExamples({propertySchema:e,breadcrumbs:t,context:r,propertyId:n})')
.replace(MEDIA_MARKER, 'generateOrValidateExample(args){return globalThis.__vapiFernExamples({context:this.context,breadcrumbs:this.breadcrumbs,mediaExampleArgs:args},()=>this.vapiOriginalMediaExample(args))}vapiOriginalMediaExample({schema:t,example:r,generateOptionalProperties:n,exampleGenerationStrategy:i})');
try {
const cli = path.join(temporary, 'fern.cjs');
Expand Down
Loading