Skip to content

Commit

Permalink
Merge the snapshots-docs branch
Browse files Browse the repository at this point in the history
  • Loading branch information
mlejva committed Dec 10, 2024
2 parents 76eb025 + 1c7052c commit 1e2b6ea
Show file tree
Hide file tree
Showing 190 changed files with 21,528 additions and 4,730 deletions.
1 change: 0 additions & 1 deletion .gitattributes
Original file line number Diff line number Diff line change
@@ -1,3 +1,2 @@
packages/python-sdk/e2b/api/client/** linguist-generated=true
**/*.gen.ts linguist-generated=true
apps/web/src/app/(docs)/docs/api-reference/** linguist-generated=true
11 changes: 11 additions & 0 deletions .github/scripts/is_new_sdk_ref.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
#!/usr/bin/env bash

set -euo pipefail

# This script checks for diffs in the packages directory.
# If there are diffs, it means we need to generate new SDK references.
if git diff --name-only HEAD^ | grep -q '^packages/'; then
echo "true"
else
echo "false"
fi
22 changes: 17 additions & 5 deletions .github/workflows/publish_packages.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Test JS SDK
name: Publish Packages

on:
workflow_call:
Expand All @@ -18,8 +18,16 @@ jobs:
name: Build and test SDK
runs-on: ubuntu-20.04
steps:
- uses: actions/create-github-app-token@v1
id: app-token
with:
app-id: ${{ vars.VERSION_BUMPER_APPID }}
private-key: ${{ secrets.VERSION_BUMPER_SECRET }}

- name: Checkout Repo
uses: actions/checkout@v3
with:
token: ${{ steps.app-token.outputs.token }}

- name: Set up Python
uses: actions/setup-python@v4
Expand Down Expand Up @@ -67,17 +75,21 @@ jobs:
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
PYPI_TOKEN: ${{ secrets.PYPI_TOKEN }}

- name: Generate API Ref
run: pnpm run generate-api-reference

- name: Generate SDK reference
id: sdk-ref
run: pnpm run --recursive generate-ref

- name: Show docs file structure
run: tree ./sdk-reference

- name: Update lock file
run: pnpm i --no-link --no-frozen-lockfile

- name: Commit new versions
run: |
git config user.name "github-actions[bot]"
git config user.email "github-actions[bot]@users.noreply.github.com"
git add apps/web/src/app/\(docs\)/docs/api-reference
git add apps/web/src/app/\(docs\)/docs/sdk-reference
git commit -am "[skip ci] Release new versions" || exit 0
git push
env:
Expand Down
6 changes: 3 additions & 3 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -289,6 +289,6 @@ cython_debug/
# option (not recommended) you can uncomment the following to ignore the entire idea folder.
.idea/

# API reference artifacts
api_ref/
apiRefRoutes.json
# SDK reference artifacts
sdk_ref/
sdkRefRoutes.json
12 changes: 12 additions & 0 deletions CODEOWNERS
Validating CODEOWNERS rules …
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
# These owners will be the default owners for everything in
# the repo. Unless a later match takes precedence.
* @jakubno @ValentaTomas

# Web
apps/web @jakubno @mishushakov
apps/web/src/app/(docs)/docs @mlejva
apps/web/src/app/(docs)/docs/sdk-reference @0div

# SDKs
packages @jakubno @ValentaTomas
packages/connect-python @ValentaTomas
3 changes: 2 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,11 @@ generate-js:
cd spec/envd && buf generate --template buf-js.gen.yaml

generate-python:
$(MAKE) -C packages/connect-python build
cd packages/python-sdk && make generate-api
cd spec/envd && buf generate --template buf-python.gen.yaml
cd packages/python-sdk && ./scripts/fix-python-pb.sh && black .

.PHONY: init-styles
init-styles:
vale sync
vale sync
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
<img width="100%" src="/readme-assets/preview.png" alt="Cover image">
--->
## What is E2B?
[E2B](https://www.e2b.dev/) is an open-source infrastructure that allows you run to AI-generated code in secure isolated sandboxes in the cloud. To start and control sandboxes, use our [JavaScript SDK](https://www.npmjs.com/package/@e2b/code-interpreter) or [Python SDK](https://pypi.org/project/e2b_code_interpreter).
[E2B](https://www.e2b.dev/) is an open-source infrastructure that allows you to run AI-generated code in secure isolated sandboxes in the cloud. To start and control sandboxes, use our [JavaScript SDK](https://www.npmjs.com/package/@e2b/code-interpreter) or [Python SDK](https://pypi.org/project/e2b_code_interpreter).

> [!NOTE]
> This repository contains the core E2B SDK that's used in our main [E2B Code Interpreter SDK](https://github.com/e2b-dev/code-interpreter).
Expand Down
Empty file added api_ref/sandbox_sync.mdx
Empty file.
4 changes: 2 additions & 2 deletions apps/web/.gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,6 @@ vale-styles
# Sentry Auth Token
.sentryclirc

# Add the generated route file for API reference docs to gitignore so we don't commit it.
# Add the generated route file for SDK reference docs to gitignore so we don't commit it.
# The idea is that we want to generate this file only from the automated GitHub actions.
apiRefRoutes.json
sdkRefRoutes.json
14 changes: 8 additions & 6 deletions apps/web/README.md
Original file line number Diff line number Diff line change
@@ -1,12 +1,14 @@
# E2B Web App

This repository contains E2D Dashboard, documentation, and API reference.
This repository contains E2D Dashboard, documentation, and SDK references.

## SDK API References
## SDK References

The SDK API references are generated from the source code in the [packages](../../packages) folder.
Each package has its own API reference generator found in `{package-dir}/scripts/generate_api_ref.sh`, it generates markdown files with the following schema: `./src/app/(docs)/docs/api-reference/{package-name}/{version}/{module-name}/page.mdx`.
The SDK references are generated from the source code in the [packages](../../packages) folder.
Each package has its own SDK reference generator found in `{package-dir}/scripts/generate_sdk_ref.sh`, it generates markdown files with the following schema: `./src/app/(docs)/docs/sdk-reference/{package-name}/{version}/{module-name}/page.mdx`.

When pushed to `main`, a [github workflow](../../.github/workflows/generate_api_ref.yml) checks for diffs in the [packages](../../packages) folder, and if any are found, the API reference generator is run and the result is auto-commited the incoming branch.
When pushed to `main`, a [github workflow](../../.github/workflows/generate_sdk_ref.yml) checks for diffs in the [packages](../../packages) folder, and if any are found, the SDK reference generator is run and the result is auto-commited the incoming branch.

Finally, when building or running the dev server, a [prebuild](./prebuild.js) step is run beforehand to generate the API reference TOCs and routes in the [api-reference](./src/app/(docs)/docs/api-reference) directory. This can also be run manually using `npm run prebuild`.
Finally, when building or running the dev server, a [prebuild](./prebuild.js) step is run beforehand to generate the SDK reference TOCs and routes in the [sdk-reference](./src/app/(docs)/docs/sdk-reference) directory. This can also be run manually using `npm run prebuild`.

note: sometimes you may see uncommited changes or untracked files in the [sdk-reference](./src/app/(docs)/docs/sdk-reference) directory, this is fine and the files can be ignored.
1 change: 0 additions & 1 deletion apps/web/next.config.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,6 @@ const nextConfig = {
destination: 'https://app.posthog.com/:path*',
// BEWARE: setting basePath will break the analytics proxy
},
{ source: '/:path*', destination: '/_404/:path*' },
]
}
}
Expand Down
10 changes: 6 additions & 4 deletions apps/web/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,8 @@
"@headlessui/tailwindcss": "^0.2.0",
"@mdx-js/loader": "^2.1.5",
"@mdx-js/react": "^2.1.5",
"@mux/mux-node": "^9.0.1",
"@mux/mux-player-react": "^3.1.0",
"@next/mdx": "^14.2.5",
"@nivo/line": "^0.87.0",
"@radix-ui/react-alert-dialog": "^1.0.5",
Expand All @@ -34,15 +36,13 @@
"@supabase/supabase-js": "^2.36.0",
"@tailwindcss/typography": "0.5.9",
"@types/node": "20.6.3",
"@types/react": "18.2.48",
"@types/react-dom": "18.2.7",
"@types/react-highlight-words": "^0.16.4",
"@vercel/analytics": "^1.0.2",
"acorn": "^8.8.1",
"autoprefixer": "^10.4.7",
"class-variance-authority": "^0.7.0",
"clsx": "^1.2.1",
"e2b": "^0.16.2",
"e2b": "^1.0.5",
"fast-glob": "^3.3.0",
"fast-xml-parser": "^4.3.3",
"flexsearch": "^0.7.31",
Expand Down Expand Up @@ -79,9 +79,11 @@
"@nodelib/fs.walk": "^2.0.0",
"@stylistic/eslint-plugin-ts": "^1.6.2",
"@types/mdx": "^2.0.8",
"@types/react": "^18.3.11",
"@types/react-dom": "^18.3.1",
"eslint-config-next": "14.2.5",
"knip": "^2.25.2",
"sharp": "^0.32.0",
"tailwind-scrollbar": "^3.0.5"
}
}
}
Loading

0 comments on commit 1e2b6ea

Please sign in to comment.