Skip to content

Commit 3dde8db

Browse files
chore: init typescript sdk
0 parents  commit 3dde8db

Some content is hidden

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

79 files changed

+15836
-0
lines changed

.github/CODEOWNERS

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
* @EiffelFly @xiaofei-du

.github/CODE_OF_CONDUCT.md

Lines changed: 133 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,133 @@
1+
# Contributor Covenant Code of Conduct
2+
3+
## Our Pledge
4+
5+
We as members, contributors, and leaders pledge to make participation in our
6+
community a harassment-free experience for everyone, regardless of age, body
7+
size, visible or invisible disability, ethnicity, sex characteristics, gender
8+
identity and expression, level of experience, education, socio-economic status,
9+
nationality, personal appearance, race, caste, color, religion, or sexual
10+
identity and orientation.
11+
12+
We pledge to act and interact in ways that contribute to an open, welcoming,
13+
diverse, inclusive, and healthy community.
14+
15+
## Our Standards
16+
17+
Examples of behavior that contributes to a positive environment for our
18+
community include:
19+
20+
* Demonstrating empathy and kindness toward other people
21+
* Being respectful of differing opinions, viewpoints, and experiences
22+
* Giving and gracefully accepting constructive feedback
23+
* Accepting responsibility and apologizing to those affected by our mistakes,
24+
and learning from the experience
25+
* Focusing on what is best not just for us as individuals, but for the overall
26+
community
27+
28+
Examples of unacceptable behavior include:
29+
30+
* The use of sexualized language or imagery, and sexual attention or advances of
31+
any kind
32+
* Trolling, insulting or derogatory comments, and personal or political attacks
33+
* Public or private harassment
34+
* Publishing others' private information, such as a physical or email address,
35+
without their explicit permission
36+
* Other conduct which could reasonably be considered inappropriate in a
37+
professional setting
38+
39+
## Enforcement Responsibilities
40+
41+
Community leaders are responsible for clarifying and enforcing our standards of
42+
acceptable behavior and will take appropriate and fair corrective action in
43+
response to any behavior that they deem inappropriate, threatening, offensive,
44+
or harmful.
45+
46+
Community leaders have the right and responsibility to remove, edit, or reject
47+
comments, commits, code, wiki edits, issues, and other contributions that are
48+
not aligned to this Code of Conduct, and will communicate reasons for moderation
49+
decisions when appropriate.
50+
51+
## Scope
52+
53+
This Code of Conduct applies within all community spaces, and also applies when
54+
an individual is officially representing the community in public spaces.
55+
Examples of representing our community include using an official e-mail address,
56+
posting via an official social media account, or acting as an appointed
57+
representative at an online or offline event.
58+
59+
## Enforcement
60+
61+
Instances of abusive, harassing, or otherwise unacceptable behavior may be
62+
reported to the community leaders responsible for enforcement at
63+
64+
65+
All complaints will be reviewed and investigated promptly and fairly.
66+
67+
All community leaders are obligated to respect the privacy and security of the
68+
reporter of any incident.
69+
70+
## Enforcement Guidelines
71+
72+
Community leaders will follow these Community Impact Guidelines in determining
73+
the consequences for any action they deem in violation of this Code of Conduct:
74+
75+
### 1. Correction
76+
77+
**Community Impact**: Use of inappropriate language or other behavior deemed
78+
unprofessional or unwelcome in the community.
79+
80+
**Consequence**: A private, written warning from community leaders, providing
81+
clarity around the nature of the violation and an explanation of why the
82+
behavior was inappropriate. A public apology may be requested.
83+
84+
### 2. Warning
85+
86+
**Community Impact**: A violation through a single incident or series of
87+
actions.
88+
89+
**Consequence**: A warning with consequences for continued behavior. No
90+
interaction with the people involved, including unsolicited interaction with
91+
those enforcing the Code of Conduct, for a specified period of time. This
92+
includes avoiding interactions in community spaces as well as external channels
93+
like social media. Violating these terms may lead to a temporary or permanent
94+
ban.
95+
96+
### 3. Temporary Ban
97+
98+
**Community Impact**: A serious violation of community standards, including
99+
sustained inappropriate behavior.
100+
101+
**Consequence**: A temporary ban from any sort of interaction or public
102+
communication with the community for a specified period of time. No public or
103+
private interaction with the people involved, including unsolicited interaction
104+
with those enforcing the Code of Conduct, is allowed during this period.
105+
Violating these terms may lead to a permanent ban.
106+
107+
### 4. Permanent Ban
108+
109+
**Community Impact**: Demonstrating a pattern of violation of community
110+
standards, including sustained inappropriate behavior, harassment of an
111+
individual, or aggression toward or disparagement of classes of individuals.
112+
113+
**Consequence**: A permanent ban from any sort of public interaction within the
114+
community.
115+
116+
## Attribution
117+
118+
This Code of Conduct is adapted from the [Contributor Covenant][homepage],
119+
version 2.1, available at
120+
[https://www.contributor-covenant.org/version/2/1/code_of_conduct.html][v2.1].
121+
122+
Community Impact Guidelines were inspired by
123+
[Mozilla's code of conduct enforcement ladder][Mozilla CoC].
124+
125+
For answers to common questions about this code of conduct, see the FAQ at
126+
[https://www.contributor-covenant.org/faq][FAQ]. Translations are available at
127+
[https://www.contributor-covenant.org/translations][translations].
128+
129+
[homepage]: https://www.contributor-covenant.org
130+
[v2.1]: https://www.contributor-covenant.org/version/2/1/code_of_conduct.html
131+
[Mozilla CoC]: https://github.com/mozilla/diversity
132+
[FAQ]: https://www.contributor-covenant.org/faq
133+
[translations]: https://www.contributor-covenant.org/translations

.github/CONTRIBUTING.md

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
# Contributing Guidelines
2+
3+
Hello! Thanks for your interest in contributing to the codebase.
4+
5+
## How to contribute
6+
7+
TBD
8+
9+
10+
## Submitting a pull request
11+
12+
To make an efficient review process, we very much appreciate if the PR commits
13+
14+
- follow the [conventional commits guidelines](https://www.conventionalcommits.org/),
15+
- follow the [7 rules of commit messages](https://chris.beams.io/posts/git-commit/), and
16+
- are rearranged to squash trivial commits together (use [git rebase](http://gitready.com/advanced/2009/03/20/reorder-commits-with-rebase.html)).

.github/PULL_REQUEST_TEMPLATE.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
Because
2+
3+
- (write the reason why we need to consider this PR in a list)
4+
5+
This commit
6+
7+
- (write the summary of all commits in this PR in a list)

.github/SECURITY.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
If you discover a security issue in this repository, please contact us through [email protected].
2+
3+
Thanks for helping make the codebase safe for everyone.

.github/semantic.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
# Always validate the PR title AND all the commits
2+
titleAndCommits: true
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
name: Add Issue to Frontend Project
2+
3+
on:
4+
issues:
5+
types:
6+
- opened
7+
8+
jobs:
9+
track_issue:
10+
uses: instill-ai/meta/.github/workflows/add-issue-to-prj.yml@main
11+
with:
12+
project_number: 1 # Frontend Project
13+
secrets:
14+
botGitHubToken: ${{ secrets.botGitHubToken }}
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
name: Add PR to Frontend Project
2+
3+
on:
4+
pull_request:
5+
types:
6+
- opened
7+
- ready_for_review
8+
9+
jobs:
10+
track_pr:
11+
uses: instill-ai/meta/.github/workflows/add-pr-to-prj.yml@main
12+
with:
13+
project_number: 1 # Frontend Project
14+
secrets:
15+
botGitHubToken: ${{ secrets.botGitHubToken }}

.github/workflows/lint.yml

Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
name: Lint
2+
3+
on:
4+
push:
5+
branches:
6+
- "*"
7+
- "!main"
8+
9+
jobs:
10+
unit-test:
11+
# skip the test of release bot opened PR to main
12+
if: ${{ !contains(github.ref, 'release') }}
13+
14+
runs-on: ubuntu-latest
15+
16+
steps:
17+
- name: Checkout
18+
uses: actions/checkout@v3
19+
20+
- name: Setup node
21+
uses: actions/setup-node@v3
22+
with:
23+
node-version: 16
24+
25+
- uses: pnpm/[email protected]
26+
name: Install pnpm
27+
id: pnpm-install
28+
with:
29+
version: 8
30+
run_install: false
31+
32+
- name: Get pnpm store directory
33+
id: pnpm-cache
34+
run: |
35+
echo "::set-output name=pnpm_cache_dir::$(pnpm store path)"
36+
- uses: actions/cache@v3
37+
name: Setup pnpm cache
38+
with:
39+
path: ${{ steps.pnpm-cache.outputs.pnpm_cache_dir }}
40+
key: ${{ runner.os }}-pnpm-store-${{ hashFiles('**/pnpm-lock.yaml') }}
41+
restore-keys: |
42+
${{ runner.os }}-pnpm-store-
43+
44+
- name: Install dependencies
45+
run: rm -rf node_modules && pnpm i --frozen-lockfile
46+
47+
- name: build packages
48+
run: pnpm build
49+
50+
- name: Run linter
51+
run: pnpm lint

.github/workflows/release.yml

Lines changed: 71 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,71 @@
1+
name: Release
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
8+
concurrency: ${{ github.workflow }}-${{ github.ref }}
9+
10+
jobs:
11+
release:
12+
name: Release
13+
runs-on: ubuntu-latest
14+
steps:
15+
- uses: google-github-actions/release-please-action@v3
16+
id: release
17+
with:
18+
token: ${{ secrets.botGitHubToken }}
19+
release-type: node
20+
command: manifest
21+
config-file: release-please/config.json
22+
manifest-file: release-please/manifest.json
23+
24+
- name: Checkout
25+
if: ${{ steps.release.outputs.releases_created }}
26+
uses: actions/checkout@v3
27+
28+
- name: Setup Node.js 16.x
29+
if: ${{ steps.release.outputs.releases_created }}
30+
uses: actions/setup-node@v3
31+
with:
32+
node-version: 16.x
33+
34+
- uses: pnpm/[email protected]
35+
if: ${{ steps.release.outputs.releases_created }}
36+
name: Install pnpm
37+
id: pnpm-install
38+
with:
39+
version: 8
40+
run_install: false
41+
42+
- name: Get pnpm store directory
43+
if: ${{ steps.release.outputs.releases_created }}
44+
id: pnpm-cache
45+
run: |
46+
echo "::set-output name=pnpm_cache_dir::$(pnpm store path)"
47+
48+
- uses: actions/cache@v3
49+
if: ${{ steps.release.outputs.releases_created }}
50+
name: Setup pnpm cache
51+
with:
52+
path: ${{ steps.pnpm-cache.outputs.pnpm_cache_dir }}
53+
key: ${{ runner.os }}-pnpm-store-${{ hashFiles('**/pnpm-lock.yaml') }}
54+
restore-keys: |
55+
${{ runner.os }}-pnpm-store-
56+
57+
- name: Setup npmrc
58+
if: ${{ steps.release.outputs.releases_created }}
59+
run: echo "//registry.npmjs.org/:_authToken=${{ secrets.NPMTOKEN }}" > .npmrc
60+
61+
- name: Install dependencies
62+
if: ${{ steps.release.outputs.releases_created }}
63+
run: rm -rf node_modules && pnpm i --frozen-lockfile
64+
65+
- name: Build packages
66+
if: ${{ steps.release.outputs.releases_created }}
67+
run: pnpm build
68+
69+
- name: Publish packages
70+
if: ${{ steps.release.outputs.releases_created }}
71+
run: pnpm -r publish --no-git-checks

.github/workflows/semantic.yml

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
name: Lint PR
2+
3+
on:
4+
pull_request_target:
5+
types:
6+
- opened
7+
- edited
8+
- synchronize
9+
10+
jobs:
11+
main:
12+
name: Validate PR title
13+
runs-on: ubuntu-latest
14+
steps:
15+
- uses: amannn/action-semantic-pull-request@v4
16+
env:
17+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

.github/workflows/test.yml

Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
name: Test
2+
3+
on:
4+
push:
5+
branches:
6+
- "*"
7+
- "!main"
8+
9+
jobs:
10+
unit-test:
11+
# skip the test of release bot opened PR to main
12+
if: ${{ !contains(github.ref, 'release') }}
13+
14+
runs-on: ubuntu-latest
15+
16+
steps:
17+
- name: Checkout
18+
uses: actions/checkout@v3
19+
20+
- name: Setup node
21+
uses: actions/setup-node@v3
22+
with:
23+
node-version: 16
24+
25+
- uses: pnpm/[email protected]
26+
name: Install pnpm
27+
id: pnpm-install
28+
with:
29+
version: 8
30+
run_install: false
31+
32+
- name: Get pnpm store directory
33+
id: pnpm-cache
34+
run: |
35+
echo "::set-output name=pnpm_cache_dir::$(pnpm store path)"
36+
37+
- uses: actions/cache@v3
38+
name: Setup pnpm cache
39+
with:
40+
path: ${{ steps.pnpm-cache.outputs.pnpm_cache_dir }}
41+
key: ${{ runner.os }}-pnpm-store-${{ hashFiles('**/pnpm-lock.yaml') }}
42+
restore-keys: |
43+
${{ runner.os }}-pnpm-store-
44+
45+
- name: Install dependencies
46+
run: rm -rf node_modules && pnpm i --frozen-lockfile
47+
48+
- name: build packages
49+
run: pnpm build
50+
51+
- name: Run test
52+
run: pnpm test

0 commit comments

Comments
 (0)