Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: e2b-dev/E2B
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: @e2b/[email protected]
Choose a base ref
...
head repository: e2b-dev/E2B
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: main
Choose a head ref
Loading
Showing 998 changed files with 101,187 additions and 70,704 deletions.
8 changes: 7 additions & 1 deletion .changeset/config.json
Original file line number Diff line number Diff line change
@@ -3,9 +3,15 @@
"changelog": "@changesets/cli/changelog",
"commit": false,
"fixed": [],
"ignore": [
"e2b-docs"
],
"linked": [],
"access": "public",
"baseBranch": "main",
"updateInternalDependencies": "patch",
"privatePackages": { "version": true, "tag": true }
"privatePackages": {
"version": true,
"tag": true
}
}
30 changes: 0 additions & 30 deletions .devcontainer/devcontainer.json

This file was deleted.

26 changes: 26 additions & 0 deletions .eslintrc.cjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
module.exports = {
env: {
node: true,
browser: true,
es6: true,
},
extends: ['eslint:recommended', 'plugin:@typescript-eslint/recommended'],
parser: '@typescript-eslint/parser',
parserOptions: {
ecmaVersion: 'latest',
sourceType: 'module',
},
ignorePatterns: ['dist/', 'node_modules/', '*.gen.ts'],
plugins: ['@typescript-eslint', 'unused-imports', '@stylistic/ts'],
rules: {
'@typescript-eslint/member-ordering': 'error',
'@typescript-eslint/ban-ts-comment': 'off', // "move fast" mode
'@typescript-eslint/no-explicit-any': 'off', // "move fast" mode
'linebreak-style': ['error', 'unix'],
'unused-imports/no-unused-imports': 'error',
// No double quotes
quotes: ['error', 'single', { avoidEscape: true }],
// No extra semicolon
'@stylistic/ts/semi': ['error', 'never'],
},
}
2 changes: 2 additions & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
packages/python-sdk/e2b/api/client/** linguist-generated=true
**/*.gen.ts linguist-generated=true
2 changes: 1 addition & 1 deletion .github/ISSUE_TEMPLATE/bug_report.md
Original file line number Diff line number Diff line change
@@ -2,7 +2,7 @@
name: Bug report
about: Create a report to help us improve
title: ''
labels: ''
labels: 'bug'
assignees: ''
---

2 changes: 1 addition & 1 deletion .github/ISSUE_TEMPLATE/feature_request.md
Original file line number Diff line number Diff line change
@@ -2,7 +2,7 @@
name: Feature request
about: Suggest an idea for this project
title: ''
labels: ''
labels: 'feature'
assignees: ''
---

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
9 changes: 9 additions & 0 deletions .github/scripts/is_release.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
#!/bin/sh

# This script checks if the current commit contains changesets.

set -eu

CHANGES=$(node -e "require('@changesets/read').default(process.cwd()).then(result => console.log(!!result.length))")

echo "${CHANGES}"
43 changes: 43 additions & 0 deletions .github/workflows/cli_tests.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
name: Test CLI

on:
workflow_call:

permissions:
contents: read

jobs:
test:
defaults:
run:
working-directory: ./packages/cli
name: Build CLI
runs-on: ubuntu-20.04
steps:
- name: Checkout repository
uses: actions/checkout@v3

- name: Install pnpm
uses: pnpm/action-setup@v3
id: pnpm-install
with:
version: 9.5

- name: Setup Node
uses: actions/setup-node@v3
with:
node-version: '18.x'
registry-url: 'https://registry.npmjs.org'
cache: pnpm
cache-dependency-path: pnpm-lock.yaml

- name: Configure pnpm
run: |
pnpm config set auto-install-peers true
pnpm config set exclude-links-from-lockfile true
- name: Install dependencies
run: pnpm install --frozen-lockfile

- name: Test build
run: pnpm build
71 changes: 71 additions & 0 deletions .github/workflows/js_sdk_tests.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,71 @@
name: Test JS SDK

on:
workflow_call:
secrets:
E2B_API_KEY:
required: true

permissions:
contents: read

jobs:
test:
defaults:
run:
working-directory: ./packages/js-sdk
name: Build and test SDK
runs-on: ubuntu-20.04
steps:
- name: Checkout repository
uses: actions/checkout@v3

- name: Install pnpm
uses: pnpm/action-setup@v3
id: pnpm-install
with:
version: 9.5

- name: Setup Node
uses: actions/setup-node@v3
with:
node-version: '18.x'
registry-url: 'https://registry.npmjs.org'
cache: pnpm
cache-dependency-path: pnpm-lock.yaml

- name: Configure pnpm
run: |
pnpm config set auto-install-peers true
pnpm config set exclude-links-from-lockfile true
- name: Install dependencies
run: |
pnpm install --frozen-lockfile
npx playwright install --with-deps
- name: Test build
run: pnpm build

- name: Run Node tests
run: pnpm test
env:
E2B_API_KEY: ${{ secrets.E2B_API_KEY }}

- name: Install Bun
uses: oven-sh/setup-bun@v2

- name: Run Bun tests
run: pnpm test:bun
env:
E2B_API_KEY: ${{ secrets.E2B_API_KEY }}

- name: Install Deno
uses: denoland/setup-deno@v1
with:
deno-version: v1.x

- name: Run Deno tests
run: pnpm test:deno
env:
E2B_API_KEY: ${{ secrets.E2B_API_KEY }}
96 changes: 96 additions & 0 deletions .github/workflows/publish_packages.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,96 @@
name: Publish Packages

on:
workflow_call:
secrets:
E2B_API_KEY:
required: true
NPM_TOKEN:
required: true
PYPI_TOKEN:
required: true

permissions:
contents: write

jobs:
test:
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
with:
python-version: "3.9"

- name: Install and configure Poetry
uses: snok/install-poetry@v1
with:
version: 1.5.1
virtualenvs-create: true
virtualenvs-in-project: true
installer-parallel: true

- uses: pnpm/action-setup@v3
with:
version: 9.5

- name: Setup Node.js 18
uses: actions/setup-node@v3
with:
node-version: '18.x'
cache: pnpm

- name: Configure pnpm
run: |
pnpm config set auto-install-peers true
pnpm config set exclude-links-from-lockfile true
- name: Install dependencies
run: pnpm install --frozen-lockfile

- name: Create new versions
run: pnpm run version
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

- name: Release new versions
uses: changesets/action@v1
with:
publish: pnpm run publish
createGithubReleases: true
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
PYPI_TOKEN: ${{ secrets.PYPI_TOKEN }}

- 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/sdk-reference
git commit -am "[skip ci] Release new versions" || exit 0
git push
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
45 changes: 45 additions & 0 deletions .github/workflows/python_sdk_tests.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
name: Test Python SDK

on:
workflow_call:
secrets:
E2B_API_KEY:
required: true

permissions:
contents: read

jobs:
test:
defaults:
run:
working-directory: ./packages/python-sdk
name: Build and test SDK
runs-on: ubuntu-20.04
steps:
- name: Checkout repository
uses: actions/checkout@v3

- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: '3.9'

- name: Install and configure Poetry
uses: snok/install-poetry@v1
with:
version: 1.5.1
virtualenvs-create: true
virtualenvs-in-project: true
installer-parallel: true

- name: Install dependencies
run: poetry install

- name: Test build
run: poetry build

- name: Run tests
run: poetry run pytest --verbose -x
env:
E2B_API_KEY: ${{ secrets.E2B_API_KEY }}
Loading