Skip to content

Commit

Permalink
feat: init project & ci (#11)
Browse files Browse the repository at this point in the history
1. Upgrade to Vite 4 and TypeScript 5
2. Custrom test via electron
3. API doc via typedoc
4. Trigger CI on push/pr on [main, dev]
  • Loading branch information
lslzl3000 committed Apr 20, 2023
1 parent 9816d86 commit 53fd04e
Show file tree
Hide file tree
Showing 22 changed files with 2,001 additions and 0 deletions.
62 changes: 62 additions & 0 deletions .github/ISSUE_TEMPLATE/ISSUE_TEMPLATE.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
name: Bug Report
description: File a bug report
title: "[Bug]: "
labels: ["bug", "triage"]
assignees:
- octocat
body:
- type: markdown
attributes:
value: |
Thanks for taking the time to fill out this bug report!
- type: input
id: contact
attributes:
label: Contact Details
description: How can we get in touch with you if we need more info?
placeholder: ex. email@example.com
validations:
required: false
- type: textarea
id: what-happened
attributes:
label: What happened?
description: Also tell us, what did you expect to happen?
placeholder: Tell us what you see!
value: "A bug happened!"
validations:
required: true
- type: dropdown
id: version
attributes:
label: Version
description: What version of our software are you running?
options:
- 1.0.2 (Default)
- 1.0.3 (Edge)
validations:
required: true
- type: dropdown
id: browsers
attributes:
label: What browsers are you seeing the problem on?
multiple: true
options:
- Firefox
- Chrome
- Safari
- Microsoft Edge
- type: textarea
id: logs
attributes:
label: Relevant log output
description: Please copy and paste any relevant log output. This will be automatically formatted into code, so no need for backticks.
render: shell
- type: checkboxes
id: terms
attributes:
label: Code of Conduct
description: By submitting this issue, you agree to follow our [Code of Conduct](https://example.com)
options:
- label: I agree to follow this project's Code of Conduct
required: true
38 changes: 38 additions & 0 deletions .github/ISSUE_TEMPLATE/bug---------.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
---
name: Bug 报告(中文模板)
about: 创建一个bug报告,帮助我们提升代码
title: "[BUG]"
labels: bug
assignees: ''

---

**Bug描述**
简单明晰的描述问题所在。

**Bug复现流程**
通过一下步骤产生bug:
1. 去目录/列表/文件 '...'
2. 点击 '....'
3. 向下滑动 '....'
4. 显示错误报告

**期待的结果**
简介明要的阐述你期待发生什么结果。

**报错截图**
如果可以,提供发生错误的截图。

**测试引擎版本:**
本地运行出错的Orillusion引擎版本。

**本机系统 (请填写完整):**
- OS: [e.g. win, mac, android]
- Browser [e.g. chrome]
- Version [e.g. 113]

**Codepen链接**
如果有sandbox/codepen的代码示例链接,请提供。

**其他信息**
添加关于bug的其他描述信息。
38 changes: 38 additions & 0 deletions .github/ISSUE_TEMPLATE/bug_report.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
---
name: Bug report
about: Create a report to help us improve
title: "[BUG]"
labels: bug
assignees: ''

---

**Describe the bug**
A clear and concise description of what the bug is.

**To Reproduce**
Steps to reproduce the behavior:
1. Go to '...'
2. Click on '....'
3. Scroll down to '....'
4. See error

**Expected behavior**
A clear and concise description of what you expected to happen.

**Screenshots**
If applicable, add screenshots to help explain your problem.

**Orillusion engine version:**
State the version you use for developement.

**Desktop (please complete the following information):**
- OS: [e.g. win, mac, android]
- Browser [e.g. chrome]
- Version [e.g. 113]

**Code demo link:**
If applicabla, please provide a sandbox/codepen/code snippet... to demonstrate the bug.

**Additional context**
Add any other context about the problem here.
20 changes: 20 additions & 0 deletions .github/ISSUE_TEMPLATE/feature_request.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
---
name: Feature request
about: Suggest an idea for this project
title: ''
labels: ''
assignees: ''

---

**Is your feature request related to a problem? Please describe.**
A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]

**Describe the solution you'd like**
A clear and concise description of what you want to happen.

**Describe alternatives you've considered**
A clear and concise description of any alternative solutions or features you've considered.

**Additional context**
Add any other context or screenshots about the feature request here.
34 changes: 34 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
name: CI auto test on push

on:
push:
branches: [ main, dev ]
pull_request:
branches: [ main, dev ]

jobs:
test:
runs-on: macos-latest
steps:
- uses: actions/checkout@v3

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

- name: Setup node 16
uses: actions/setup-node@v3
with:
node-version: 16
cache: pnpm

- name: Install deps
run: pnpm install

- name: Test Build
run: pnpm run build

- name: Test in Electron
run: pnpm run test:ci

23 changes: 23 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
# See https://help.github.com/articles/ignoring-files/ for more about ignoring files.

# dependencies
node_modules
npm-debug.log*
yarn-error.log
yarn.lock
package-lock.json

# production
/dist
/docs

# misc
.DS_Store

# idea
/.idea

# others
/.env
/.env.local
/js
2 changes: 2 additions & 0 deletions .npmrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
electron_mirror=https://npmmirror.com/mirrors/electron/
electron_nightlyMirror=https://npmmirror.com/mirrors/electron-nightly/
78 changes: 78 additions & 0 deletions index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,78 @@
<!DOCTYPE html>
<html lang="en">

<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Orillusion | Samples</title>
<style>
html,
body {
font-family: Avenir, Helvetica, Arial, sans-serif;
-webkit-font-smoothing: antialiased;
margin: 0;
width: 100%;
height: 100%;
background: #000;
color: #fff;
display: flex;
}

.menu {
position: fixed;
z-index: 10000;
left: 0;
top: 0;
bottom: 0;
width: 150px;
padding: 20px;
overflow: overlay;
border-right: 1px solid #fff;
background: rgba(0, 0, 0, .6);
}

.menu>p {
text-align: left;
padding: 10px 0;
margin: 0;
border-bottom: 1px solid #fff;
text-transform: capitalize;
}

.menu>a {
display: block;
text-align: left;
margin: 5px 0;
color: #00bcd4;
text-decoration: none;
cursor: pointer;
overflow: hidden;
text-overflow: ellipsis;
}

.menu>a.active {
color: #f44336;
}

.menu>a:hover {
text-decoration: underline;
}

/* width */
::-webkit-scrollbar {
width: 0;
}

iframe {
border: none;
width: 100%;
height: 100%;
}
</style>
</head>

<body>
<script type="module" src="/src/sample/index.ts"></script>
</body>

</html>
47 changes: 47 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
{
"name": "@orillusion/core",
"version": "0.5.0",
"author": "Orillusion",
"description": "Orillusion WebGPU Engine",
"main": "./dist/orillusion.umd.js",
"module": "./dist/orillusion.es.js",
"types": "./dist/src/index.d.ts",
"files": [
"dist/src",
"dist/orillusion.umd.js",
"dist/orillusion.es.js",
"tsconfig.json"
],
"license": "MIT",
"repository": {
"type": "git",
"url": "git+https://github.com/Orillusion/orillusion.git"
},
"scripts": {
"dev": "vite",
"build": "tsc --p tsconfig.build.json && vite build && npm run build:types && npm run minify:es",
"build:types": "tsc --emitDeclarationOnly -p tsconfig.build.json",
"minify:es": "uglifyjs dist/orillusion.es.js -o dist/orillusion.es.js -c -m",
"test": "electron test/ci/main.js",
"test:ci": "xvfb-maybe -- electron test/ci/main.js",
"test:install": "pnpm i electron@npm:electron-nightly@latest xvfb-maybe -O",
"docs": "npm run docs:core && npm run docs:physics && npm run docs:media",
"docs:typedoc": "npx typedoc --plugin typedoc-plugin-markdown --plugin ./script/typedoc-plugin-not-exported.js --tsconfig tsconfig.build.json --gitRevision main --hideBreadcrumbs true --allReflectionsHaveOwnDocument true --readme none --excludeInternal --excludePrivate --excludeProtected --sort source-order --out",
"docs:core": "npm run docs:typedoc docs/api src/index.ts",
"docs:physics": "npm run docs:typedoc docs/physics src/libs/physics/index.ts",
"docs:media": "npm run docs:typedoc docs/media-extention src/libs/media-extention/index.ts",
"docs:stats": "npm run docs:typedoc docs/stats src/libs/stats/index.ts"
},
"devDependencies": {
"@webgpu/types": "^0.1.30",
"typedoc": "^0.24.4",
"typedoc-plugin-markdown": "^3.15.1",
"typescript": "^5.0.4",
"vite": "^4.2.2"
},
"optionalDependencies": {
"electron": "npm:electron-nightly@latest",
"uglify-js": "^3.17.4",
"xvfb-maybe": "^0.2.1"
}
}
Loading

0 comments on commit 53fd04e

Please sign in to comment.