Skip to content

Commit

Permalink
Merge branch 'main' into marcus/fix-broken-serde-schema-generation
Browse files Browse the repository at this point in the history
  • Loading branch information
mstade authored Dec 11, 2024
2 parents 9f7fac4 + 7687e8b commit d5a4382
Show file tree
Hide file tree
Showing 5,008 changed files with 1,484,989 additions and 1,114,187 deletions.
The diff you're trying to view is too large. We only load the first 3000 changed files.
31 changes: 25 additions & 6 deletions .github/workflows/preview-docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,9 @@ on:
pull_request_target:
branches:
- main
paths:
- 'fern/**'
- 'packages/cli/docs-**'
workflow_dispatch:
inputs:
prNumber:
Expand Down Expand Up @@ -38,10 +41,26 @@ jobs:
echo "$OUTPUT"
URL=$(echo "$OUTPUT" | grep -oP 'Published docs to \K.*(?= \()')
echo "Preview URL: $URL"
echo "🌿 Preview your docs: $URL" > preview_url.txt
echo "$URL" > preview_url.txt
- name: Comment URL in PR
uses: thollander/actions-comment-pull-request@v2.4.3
with:
filePath: preview_url.txt
comment_tag: docs-preview-link
- name: Comment or Update URL in PR
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
COMMENT_TAG="<!-- docs-preview-link -->"
PREVIEW_URL=$(cat preview_url.txt)
# Get existing comments
EXISTING_COMMENT=$(gh api repos/${{ github.repository }}/issues/${{ github.event.pull_request.number }}/comments \
--jq ".[] | select(.body | contains(\"${COMMENT_TAG}\")) | .id")
if [ -z "$EXISTING_COMMENT" ]; then
# No existing comment, create one
gh api repos/${{ github.repository }}/issues/${{ github.event.pull_request.number }}/comments \
-f body="${COMMENT_TAG}🌿 Preview your docs: $PREVIEW_URL"
else
# Update existing comment
gh api repos/${{ github.repository }}/issues/comments/$EXISTING_COMMENT \
-X PATCH \
-f body="${COMMENT_TAG}🌿 Preview your docs: $PREVIEW_URL"
fi
52 changes: 52 additions & 0 deletions .github/workflows/publish-snippets-core.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
name: Publish @fern-api/snippets-core

on:
workflow_dispatch:
inputs:
version:
description: "The version of the library to publish."
required: true
type: string

env:
PACKAGE_NAME: "@fern-api/snippets-core"
GITHUB_TOKEN: ${{ secrets.FERN_GITHUB_TOKEN }}
NPM_TOKEN: ${{ secrets.FERN_NPM_TOKEN }}

jobs:
publish:
runs-on: ubuntu-latest
if: ${{ inputs.version != null }}
steps:
- name: Checkout repo
uses: actions/checkout@v4
with:
fetch-tags: true

- name: 📥 Install
uses: ./.github/actions/install

- uses: bufbuild/buf-setup-action@v1.34.0
with:
github_token: ${{ github.token }}

- uses: actions/setup-go@v5
with:
go-version: "stable"

- name: Install protoc-gen-openapi
run: go install github.com/google/gnostic/cmd/protoc-gen-openapi@v0.7.0

- name: 🧪 Build
run: pnpm --filter=${{ env.PACKAGE_NAME }} compile

- name: 🧪 Test
run: pnpm --filter=${{ env.PACKAGE_NAME }} test

- name: Publish @fern-api/snippets-core
run: |
cd packages/snippets/core
pnpm --filter=${{ env.PACKAGE_NAME }} dist ${{ inputs.version }}
cd dist
echo "//registry.npmjs.org/:_authToken=${{ env.NPM_TOKEN }}" > ~/.npmrc
npm publish --access public
8 changes: 6 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,14 +1,18 @@
<br/>
<div align="center">
<a href="https://www.buildwithfern.com/?utm_source=github&utm_medium=readme&utm_campaign=fern&utm_content=logo">
<img src="/fern/images/logo-primary.svg" height="80" align="center" alt="header" />
<picture>
<source media="(prefers-color-scheme: dark)" srcset="/fern/images/logo-white.svg">
<source media="(prefers-color-scheme: light)" srcset="/fern/images/logo-primary.svg">
<img alt="logo" src="/fern/images/logo-primary.svg" height="80" align="center">
</picture>
</a>
<br/>

<br/>

[![2023 Y Combinator Startup](https://img.shields.io/badge/Y%20Combinator-2023-orange)](https://www.ycombinator.com/companies/fern)
![License](https://img.shields.io/badge/License-MIT-blue)
![License](https://img.shields.io/badge/license-Apache%202.0-blue)

[![Slack](https://img.shields.io/badge/slack-pink.svg)](https://join.slack.com/t/fern-community/shared_invite/zt-2dpftfmif-MuAegl8AfP_PK8s2tx350Q)
[![Documentation](https://img.shields.io/badge/Read%20our%20Documentation-black?logo=book)](https://buildwithfern.com/learn/home?utm_source=fern-api/fern/readme-read-our-documentation)
Expand Down
50 changes: 50 additions & 0 deletions fern.schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -497,6 +497,16 @@
}
]
},
"inline": {
"oneOf": [
{
"type": "boolean"
},
{
"type": "null"
}
]
},
"docs": {
"oneOf": [
{
Expand Down Expand Up @@ -700,6 +710,16 @@
}
]
},
"inline": {
"oneOf": [
{
"type": "boolean"
},
{
"type": "null"
}
]
},
"docs": {
"oneOf": [
{
Expand Down Expand Up @@ -1033,6 +1053,16 @@
}
]
},
"inline": {
"oneOf": [
{
"type": "boolean"
},
{
"type": "null"
}
]
},
"docs": {
"oneOf": [
{
Expand Down Expand Up @@ -1189,6 +1219,16 @@
}
]
},
"inline": {
"oneOf": [
{
"type": "boolean"
},
{
"type": "null"
}
]
},
"docs": {
"oneOf": [
{
Expand Down Expand Up @@ -1274,6 +1314,16 @@
}
]
},
"inline": {
"oneOf": [
{
"type": "boolean"
},
{
"type": "null"
}
]
},
"docs": {
"oneOf": [
{
Expand Down
52 changes: 26 additions & 26 deletions fern/apis/fern-definition/definition/commons.yml
Original file line number Diff line number Diff line change
@@ -1,39 +1,39 @@
imports:
imports:
availability: availability.yml

types:
WithDocsSchema:
properties:
types:
WithDocsSchema:
properties:
docs: optional<string>
WithName:
properties:

WithName:
properties:
name: optional<string>
WithAvailability:
properties:

WithAvailability:
properties:
availability: optional<availability.AvailabilityUnionSchema>
WithDisplayName:
properties:

WithDisplayName:
properties:
display-name: optional<string>
WithAudiences:
properties:

WithAudiences:
properties:
audiences: optional<list<string>>
DeclarationSchema:
extends:

DeclarationSchema:
extends:
- WithDocsSchema
- WithAvailability
- WithAudiences
DeclarationWithoutDocsSchema:
extends:

DeclarationWithoutDocsSchema:
extends:
- WithAvailability
- WithAudiences
DeclarationWithNameSchema:
extends:

DeclarationWithNameSchema:
extends:
- DeclarationSchema
- WithName
- WithName
Loading

0 comments on commit d5a4382

Please sign in to comment.