Skip to content

Commit d6254ed

Browse files
feat(api): switch to new typescript design
1 parent 43bca87 commit d6254ed

File tree

149 files changed

+23371
-1
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

149 files changed

+23371
-1
lines changed

.devcontainer/Dockerfile

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
# syntax=docker/dockerfile:1
2+
FROM debian:bookworm-slim AS stainless
3+
4+
RUN apt-get update && apt-get install -y \
5+
nodejs \
6+
npm \
7+
yarnpkg \
8+
&& apt-get clean autoclean
9+
10+
# Ensure UTF-8 encoding
11+
ENV LANG=C.UTF-8
12+
ENV LC_ALL=C.UTF-8
13+
14+
# Yarn
15+
RUN ln -sf /usr/bin/yarnpkg /usr/bin/yarn
16+
17+
WORKDIR /workspace
18+
19+
COPY package.json yarn.lock /workspace/
20+
21+
RUN yarn install
22+
23+
COPY . /workspace

.devcontainer/devcontainer.json

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
// For format details, see https://aka.ms/devcontainer.json. For config options, see the
2+
// README at: https://github.com/devcontainers/templates/tree/main/src/debian
3+
{
4+
"name": "Debian",
5+
"build": {
6+
"dockerfile": "Dockerfile"
7+
}
8+
9+
// Features to add to the dev container. More info: https://containers.dev/features.
10+
// "features": {},
11+
12+
// Use 'forwardPorts' to make a list of ports inside the container available locally.
13+
// "forwardPorts": [],
14+
15+
// Configure tool-specific properties.
16+
// "customizations": {},
17+
18+
// Uncomment to connect as root instead. More info: https://aka.ms/dev-containers-non-root.
19+
// "remoteUser": "root"
20+
}

.eslintrc.js

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
module.exports = {
2+
parser: '@typescript-eslint/parser',
3+
plugins: ['@typescript-eslint', 'unused-imports', 'prettier'],
4+
rules: {
5+
'no-unused-vars': 'off',
6+
'prettier/prettier': 'error',
7+
'unused-imports/no-unused-imports': 'error',
8+
'no-restricted-imports': [
9+
'error',
10+
{
11+
patterns: [
12+
{
13+
group: ['@gitpod/sdk', '@gitpod/sdk/*'],
14+
message: 'Use a relative import, not a package import.',
15+
},
16+
],
17+
},
18+
],
19+
},
20+
overrides: [
21+
{
22+
files: ['tests/**', 'examples/**'],
23+
rules: {
24+
'no-restricted-imports': 'off',
25+
},
26+
},
27+
],
28+
root: true,
29+
};

.github/workflows/ci.yml

Lines changed: 66 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,66 @@
1+
name: CI
2+
on:
3+
push:
4+
branches:
5+
- main
6+
pull_request:
7+
branches:
8+
- main
9+
- next
10+
11+
jobs:
12+
lint:
13+
name: lint
14+
runs-on: ubuntu-latest
15+
16+
17+
steps:
18+
- uses: actions/checkout@v4
19+
20+
- name: Set up Node
21+
uses: actions/setup-node@v4
22+
with:
23+
node-version: '18'
24+
25+
- name: Bootstrap
26+
run: ./scripts/bootstrap
27+
28+
- name: Check types
29+
run: ./scripts/lint
30+
31+
build:
32+
name: build
33+
runs-on: ubuntu-latest
34+
35+
36+
steps:
37+
- uses: actions/checkout@v4
38+
39+
- name: Set up Node
40+
uses: actions/setup-node@v4
41+
with:
42+
node-version: '18'
43+
44+
- name: Bootstrap
45+
run: ./scripts/bootstrap
46+
47+
- name: Check build
48+
run: ./scripts/build
49+
test:
50+
name: test
51+
runs-on: ubuntu-latest
52+
53+
steps:
54+
- uses: actions/checkout@v4
55+
56+
- name: Set up Node
57+
uses: actions/setup-node@v4
58+
with:
59+
node-version: '18'
60+
61+
- name: Bootstrap
62+
run: ./scripts/bootstrap
63+
64+
- name: Run tests
65+
run: ./scripts/test
66+

.github/workflows/create-releases.yml

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
name: Create releases
2+
on:
3+
schedule:
4+
- cron: '0 5 * * *' # every day at 5am UTC
5+
push:
6+
branches:
7+
- main
8+
9+
jobs:
10+
release:
11+
name: release
12+
if: github.ref == 'refs/heads/main' && github.repository == 'gitpod-io/gitpod-sdk-typescript'
13+
runs-on: ubuntu-latest
14+
15+
steps:
16+
- uses: actions/checkout@v4
17+
18+
- uses: stainless-api/trigger-release-please@v1
19+
id: release
20+
with:
21+
repo: ${{ github.event.repository.full_name }}
22+
stainless-api-key: ${{ secrets.STAINLESS_API_KEY }}
23+
24+
- name: Set up Node
25+
if: ${{ steps.release.outputs.releases_created }}
26+
uses: actions/setup-node@v3
27+
with:
28+
node-version: '18'
29+
30+
- name: Install dependencies
31+
if: ${{ steps.release.outputs.releases_created }}
32+
run: |
33+
yarn install
34+
35+
- name: Publish to NPM
36+
if: ${{ steps.release.outputs.releases_created }}
37+
run: |
38+
bash ./bin/publish-npm
39+
env:
40+
NPM_TOKEN: ${{ secrets.GITPOD_NPM_TOKEN || secrets.NPM_TOKEN }}
41+

.github/workflows/publish-npm.yml

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
# workflow for re-running publishing to NPM in case it fails for some reason
2+
# you can run this workflow by navigating to https://www.github.com/gitpod-io/gitpod-sdk-typescript/actions/workflows/publish-npm.yml
3+
name: Publish NPM
4+
on:
5+
workflow_dispatch:
6+
7+
jobs:
8+
publish:
9+
name: publish
10+
runs-on: ubuntu-latest
11+
12+
steps:
13+
- uses: actions/checkout@v4
14+
15+
- name: Set up Node
16+
uses: actions/setup-node@v3
17+
with:
18+
node-version: '18'
19+
20+
- name: Install dependencies
21+
run: |
22+
yarn install
23+
24+
- name: Publish to NPM
25+
run: |
26+
bash ./bin/publish-npm
27+
env:
28+
NPM_TOKEN: ${{ secrets.GITPOD_NPM_TOKEN || secrets.NPM_TOKEN }}

.github/workflows/release-doctor.yml

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
name: Release Doctor
2+
on:
3+
pull_request:
4+
branches:
5+
- main
6+
workflow_dispatch:
7+
8+
jobs:
9+
release_doctor:
10+
name: release doctor
11+
runs-on: ubuntu-latest
12+
if: github.repository == 'gitpod-io/gitpod-sdk-typescript' && (github.event_name == 'push' || github.event_name == 'workflow_dispatch' || startsWith(github.head_ref, 'release-please') || github.head_ref == 'next')
13+
14+
steps:
15+
- uses: actions/checkout@v4
16+
17+
- name: Check release environment
18+
run: |
19+
bash ./bin/check-release-environment
20+
env:
21+
STAINLESS_API_KEY: ${{ secrets.STAINLESS_API_KEY }}
22+
NPM_TOKEN: ${{ secrets.GITPOD_NPM_TOKEN || secrets.NPM_TOKEN }}
23+

.gitignore

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
.prism.log
2+
node_modules
3+
yarn-error.log
4+
codegen.log
5+
Brewfile.lock.json
6+
dist
7+
dist-deno
8+
/*.tgz
9+
.idea/
10+

.prettierignore

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
CHANGELOG.md
2+
/ecosystem-tests/*/**
3+
/node_modules
4+
/deno
5+
6+
# don't format tsc output, will break source maps
7+
/dist

.prettierrc.json

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
{
2+
"arrowParens": "always",
3+
"experimentalTernaries": true,
4+
"printWidth": 110,
5+
"singleQuote": true,
6+
"trailingComma": "all"
7+
}

0 commit comments

Comments
 (0)