Skip to content

Commit

Permalink
feat: init Device API & WebGL implementations
Browse files Browse the repository at this point in the history
  • Loading branch information
xiaoiver committed Sep 14, 2023
0 parents commit 1bf27b1
Show file tree
Hide file tree
Showing 75 changed files with 16,462 additions and 0 deletions.
8 changes: 8 additions & 0 deletions .changeset/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
# Changesets

Hello and welcome! This folder has been automatically generated by `@changesets/cli`, a build tool that works
with multi-package repos, or single-package repos to help you version and publish your code. You can
find the full documentation for it [in our repository](https://github.com/changesets/changesets)

We have a quick list of common questions to get you started engaging with this project in
[our documentation](https://github.com/changesets/changesets/blob/main/docs/common-questions.md)
11 changes: 11 additions & 0 deletions .changeset/config.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
{
"$schema": "https://unpkg.com/@changesets/[email protected]/schema.json",
"changelog": "@changesets/cli/changelog",
"commit": false,
"fixed": [],
"linked": [],
"access": "restricted",
"baseBranch": "master",
"updateInternalDependencies": "patch",
"ignore": []
}
21 changes: 21 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
# EditorConfig is awesome: http://EditorConfig.org

# top-most EditorConfig file
root = true

# Unix-style newlines with a newline ending every file
[*]
end_of_line = lf
charset = utf-8
insert_final_newline = true
trim_trailing_whitespace = true
indent_style = space
indent_size = 2

[Makefile]
indent_style = tab
indent_size = 1

[*.md]
trim_trailing_whitespace = false
indent_size = 4
8 changes: 8 additions & 0 deletions .eslintignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
coverage
es
lib
dist
node_modules
test
rust
__tests__
38 changes: 38 additions & 0 deletions .eslintrc.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
module.exports = {
extends: ['eslint:recommended', 'plugin:@typescript-eslint/recommended'],

globals: {
window: true,
document: true,
module: true,
},

rules: {
'no-fallthrough': 0,
'no-empty': 0,
'no-param-reassign': 0,
'no-redeclare': 'off',
'no-useless-escape': 'off',
'no-case-declarations': 'off',
'no-constant-condition': 'off',
'@typescript-eslint/no-duplicate-enum-values': 'off',
'@typescript-eslint/no-empty-interface': 'off',
'@typescript-eslint/no-shadow': 0,
'@typescript-eslint/no-parameter-properties': 0,
'@typescript-eslint/ban-ts-comment': 0,
'@typescript-eslint/no-empty-function': 0,
'@typescript-eslint/no-invalid-this': 0,
'@typescript-eslint/no-use-before-define': [
'error',
{ functions: false, classes: false },
],
'@typescript-eslint/no-redeclare': ['error'],
'@typescript-eslint/no-unused-vars': [
'error',
{
args: 'none',
ignoreRestSiblings: true,
},
],
},
};
11 changes: 11 additions & 0 deletions .github/----please-use-antv-issue-helper---.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
---
name: '⚠️ Please use https://antv-issue-helper.surge.sh ⚠️'
about: The issue which is not created via https://antv-issue-helper.surge.sh will be closed immediately.
labels:
---

The issue which is not created via <https://antv-issue-helper.surge.sh> will be closed immediately.

---

注意:不是用 <https://antv-issue-helper.surge.sh> 创建的 issue 会被立即关闭。
11 changes: 11 additions & 0 deletions .github/ISSUE_TEMPLATE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
<!--
⚠️ ⚠️ ⚠️ IMPORTANT: Please use the following link to create a new issue: ⚠️ ⚠️ ⚠️
https://antv-issue-helper.surge.sh
If your issue was not created using the app above, it will be closed immediately.
-->

<!--
⚠️ ⚠️ ⚠️ 注意:请使用下面的链接来新建 issue: ⚠️ ⚠️ ⚠️
https://antv-issue-helper.surge.sh
不是用上面的链接创建的 issue 会被立即关闭。
-->
53 changes: 53 additions & 0 deletions .github/PULL_REQUEST_TEMPLATE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
<!--
Thank you for your pull request. Please review below requirements.
Bug fixes and new features should include tests and possibly benchmarks.
Contributors guide: https://github.com/antvis/g2/blob/master/CONTRIBUTING.md
感谢您贡献代码。请确认下列 checklist 的完成情况。
Bug 修复和新功能必须包含测试,必要时请附上性能测试。
Contributors guide: https://github.com/antvis/g2/blob/master/CONTRIBUTING.md
-->

### 🤔 This is a

- [ ] New feature
- [ ] Bug fix
- [ ] Site / Document optimization
- [ ] TypeScript definition update
- [ ] Refactoring
- [ ] Performance improvement
- [ ] Code style optimization
- [ ] Test Case
- [ ] Branch merge
- [ ] Other (about what?)

### 🔗 Related issue link

<!--
1. Describe the source of requirement, like related issue link.
-->

### 💡 Background and solution

<!--
1. Describe the problem and the scenario.
2. GIF or snapshot should be provided if includes UI/interactive modification.
3. How to fix the problem, and list final API implementation and usage sample if that is an new feature.
-->

### 📝 Changelog

<!--
Describe changes from userside, and list all potential break changes or other risks.
--->

| Language | Changelog |
| ---------- | --------- |
| 🇺🇸 English | |
| 🇨🇳 Chinese | |

### ☑️ Self Check before Merge

- [ ] Doc is updated/provided or not needed
- [ ] Demo is updated/provided or not needed
- [ ] TypeScript definition is updated/provided or not needed
- [ ] Changelog is provided or not needed
41 changes: 41 additions & 0 deletions .github/workflows/codeql.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
name: 'CodeQL'

on:
push:
branches: ['master']
pull_request:
branches: ['master']
schedule:
- cron: '35 10 * * 0'

jobs:
analyze:
name: Analyze
runs-on: ubuntu-latest
permissions:
actions: read
contents: read
security-events: write

strategy:
fail-fast: false
matrix:
language: [javascript]

steps:
- name: Checkout
uses: actions/checkout@v3

- name: Initialize CodeQL
uses: github/codeql-action/init@v2
with:
languages: ${{ matrix.language }}
queries: +security-and-quality

- name: Autobuild
uses: github/codeql-action/autobuild@v2

- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@v2
with:
category: '/language:${{ matrix.language }}'
32 changes: 32 additions & 0 deletions .github/workflows/lint.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
name: 🚀 Lint

on: ['pull_request']

jobs:
lint:
name: Lint
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3

# Python 3.11 和 node-gyp 有兼容问题, 导致无法安装依赖
# https://github.com/slint-ui/slint/commit/a9c48e33502fdebc36c5aa2f4f516c2218424679#diff-944291df2c9c06359d37cc8833d182d705c9e8c3108e7cfe132d61a06e9133dd
- uses: actions/setup-python@v4
with:
python-version: '3.10'

- uses: pnpm/action-setup@v2
with:
version: 7

- name: Use Node.js 16
uses: actions/setup-node@v3
with:
node-version: 16 # semantic-release 需要 >= 16 的 Node.js 环境
cache: 'pnpm'

- name: Install dependencies
run: pnpm install

- name: Lint
run: pnpm lint
21 changes: 21 additions & 0 deletions .github/workflows/pr-translation.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
name: PR Translation
on:
pull_request:
types: [opened]
issue_comment:
types: [created]
pull_request_review_comment:
types: [created]
pull_request_review:
types: [submitted, dismissed]
jobs:
translate:
runs-on: ubuntu-latest
steps:
- name: Translate
uses: yhosun/[email protected]
with:
language-1: 'en'
repo-token: ${{ secrets.GITHUB_TOKEN }}
google-project-id: 'ecstatic-branch-398907'
google-credentials: ${{ secrets.GOOGLE_TRANSLATION_API }}
35 changes: 35 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
name: 🚀 Auto Release
on:
push:
branches:
- master

jobs:
release:
runs-on: ubuntu-latest
if: "!contains(github.event.head_commit.message, '[skip ci]')"

steps:
- uses: actions/checkout@v3

# Python 3.11 和 node-gyp 有兼容问题, 导致无法安装依赖
# https://github.com/slint-ui/slint/commit/a9c48e33502fdebc36c5aa2f4f516c2218424679#diff-944291df2c9c06359d37cc8833d182d705c9e8c3108e7cfe132d61a06e9133dd
- uses: actions/setup-python@v4
with:
python-version: '3.10'

- uses: pnpm/action-setup@v2
with:
version: 7

- name: Use Node.js 16
uses: actions/setup-node@v3
with:
node-version: 16
cache: 'pnpm'

- name: Install dependencies
run: pnpm install

- name: Build
run: pnpm build
45 changes: 45 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
name: 🚀 Test

on: [pull_request]

jobs:
test:
name: Test
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3

# Python 3.11 和 node-gyp 有兼容问题, 导致无法安装依赖
# https://github.com/slint-ui/slint/commit/a9c48e33502fdebc36c5aa2f4f516c2218424679#diff-944291df2c9c06359d37cc8833d182d705c9e8c3108e7cfe132d61a06e9133dd
- uses: actions/setup-python@v4
with:
python-version: '3.10'

- uses: pnpm/action-setup@v2
with:
version: 7

- name: Use Node.js 16
uses: actions/setup-node@v3
with:
node-version: 16
cache: 'pnpm'

- name: Install dependencies
run: pnpm install

- name: Build
run: pnpm build

- name: Test
run: pnpm test

- name: Cov
run: |
pnpm cov
env:
CI: true
- name: Coveralls
uses: coverallsapp/github-action@master
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
38 changes: 38 additions & 0 deletions .github/workflows/version.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
name: 🚀 Version
on:
push:
branches:
- release

jobs:
version:
name: Update Package Version
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3

# Python 3.11 和 node-gyp 有兼容问题, 导致无法安装依赖
# https://github.com/slint-ui/slint/commit/a9c48e33502fdebc36c5aa2f4f516c2218424679#diff-944291df2c9c06359d37cc8833d182d705c9e8c3108e7cfe132d61a06e9133dd
- uses: actions/setup-python@v4
with:
python-version: '3.10'

- uses: pnpm/action-setup@v2
with:
version: 7

- name: Use Node.js 16
uses: actions/setup-node@v3
with:
node-version: 16
cache: 'pnpm'

- name: Install dependencies
run: pnpm install

- name: Create Release Pull Request
uses: changesets/action@v1
with:
commit: 'chore(release): bump version'
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
5 changes: 5 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
.DS_Store
node_modules
es
lib
rust/target
4 changes: 4 additions & 0 deletions .husky/commit-msg
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
#!/bin/sh
. "$(dirname "$0")/_/husky.sh"

npx --no-install commitlint --edit "$1"
Loading

0 comments on commit 1bf27b1

Please sign in to comment.