Skip to content

Commit 3a50743

Browse files
Initial commit (#1)
Co-authored-by: ZhangQiankun <[email protected]>
1 parent 7488cc6 commit 3a50743

File tree

126 files changed

+13359
-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.

126 files changed

+13359
-1
lines changed

.eslintrc.cjs

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
/* eslint-env node */
2+
require('@rushstack/eslint-patch/modern-module-resolution')
3+
4+
module.exports = {
5+
root: true,
6+
'extends': [
7+
'plugin:vue/vue3-essential',
8+
'eslint:recommended',
9+
'@vue/eslint-config-typescript',
10+
'@vue/eslint-config-prettier/skip-formatting',
11+
'./.eslintrc-auto-import.json'
12+
],
13+
overrides: [
14+
{
15+
files: [
16+
'cypress/e2e/**/*.{cy,spec}.{js,ts,jsx,tsx}'
17+
],
18+
'extends': [
19+
'plugin:cypress/recommended'
20+
]
21+
}
22+
],
23+
parserOptions: {
24+
ecmaVersion: 'latest'
25+
}
26+
}

.github/workflows/workflow.yml

Lines changed: 68 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,68 @@
1+
# .github/workflows/auto-deploy.yml
2+
3+
name: auto deploy 🚀
4+
5+
on:
6+
# 监听push操作
7+
push:
8+
branches:
9+
- main # 这里只配置了main分支,所以只有推送main分支才会触发以下任务
10+
pull_request:
11+
12+
# 这个选项可以使你手动在 Action tab 页面触发工作流
13+
# workflow_dispatch:
14+
15+
permissions:
16+
# 允许对仓库的内容进行写操作。包括创建、修改和删除文件、目录以及提交更改等
17+
# 这里只配置了push,所以只有推送main分支才会触发以下任务
18+
contents: write
19+
# 允许管理 GitHub Pages 服务并对其进行写操作
20+
pages: write
21+
22+
23+
jobs:
24+
# 任务ID
25+
build-and-deploy:
26+
# 运行环境
27+
# runs-on: macos-latest
28+
# runs-on: windows-latest
29+
runs-on: ubuntu-latest
30+
concurrency:
31+
group: ${{ github.workflow }}-${{ github.ref }}
32+
33+
# 步骤
34+
steps:
35+
# 官方action,将代码拉取到虚拟机
36+
- name: Checkout
37+
uses: actions/checkout@v3
38+
39+
# 建一个名为setup-node的步骤(安装指定版本的Node.js)
40+
- name: setup-node
41+
# 使用setup-node@v3这个action
42+
uses: actions/setup-node@v3
43+
# 指定某个action 可能需要输入的参数
44+
with:
45+
node-version: '20'
46+
47+
# 安装 pnpm
48+
- name: Install pnpm
49+
run: npm install pnpm -g
50+
51+
# 安装依赖
52+
- name: Install dependencies
53+
run: pnpm i
54+
# 打包
55+
- name: Build application 🔧
56+
run: pnpm run build
57+
58+
# 部署 https://github.com/JamesIves/github-pages-deploy-action
59+
- name: Deploy 🚀
60+
uses: JamesIves/github-pages-deploy-action@v4
61+
if: github.ref == 'refs/heads/main'
62+
with:
63+
token: ${{ secrets.GITHUB_TOKEN }}
64+
branch: gh-pages # default: gh-pages
65+
folder: dist
66+
clean: true # Automatically remove deleted files from the deploy branch
67+
# commit-message: ${{ github.event.head_commit.message }} # default: `Deploying to gh-pages from @ 3238feb 🚀`
68+
# commit-message: "deploy: ${{ github.sha }} (${{ github.event.head_commit.message }}) 🚀 "

.gitignore

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
# Logs
2+
logs
3+
*.log
4+
npm-debug.log*
5+
yarn-debug.log*
6+
yarn-error.log*
7+
pnpm-debug.log*
8+
lerna-debug.log*
9+
10+
node_modules
11+
.DS_Store
12+
dist
13+
dist-ssr
14+
coverage
15+
*.local
16+
17+
/cypress/videos/
18+
/cypress/screenshots/
19+
20+
# Editor directories and files
21+
.vscode/*
22+
!.vscode/extensions.json
23+
!.vscode/setting.json
24+
.idea
25+
*.suo
26+
*.ntvs*
27+
*.njsproj
28+
*.sln
29+
*.sw?
30+
31+
*auto-import*
32+
src/types/auto-import.d.ts
33+
src/types/components.d.ts
34+
.eslintrc-auto-import.json

.prettierrc.json

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
{
2+
"$schema": "https://json.schemastore.org/prettierrc",
3+
"semi": false,
4+
"tabWidth": 2,
5+
"singleQuote": true,
6+
"printWidth": 100,
7+
"trailingComma": "none"
8+
}

README.md

Lines changed: 77 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,78 @@
11
# scene-editor
2-
Scene-editor is a WebGL based JS SDK, built on top of three.js. focuses on 2D and 3D graphics rendering technology and is committed to providing leading display and simulation solutions in the fields of industry, architecture, home decoration, and digital twins, driving the infinite possibilities of future visualization.
2+
3+
Developed with vue3 + antd4 + vite4 + pnpm
4+
5+
## References
6+
7+
[vue3](https://staging-cn.vuejs.org/guide/introduction.html)
8+
9+
[vite](https://cn.vitejs.dev/)
10+
11+
[pinia](https://pinia.vuejs.org/)
12+
13+
[Vue Router](https://router.vuejs.org/zh/index.html)
14+
15+
[pnpm](https://pnpm.io/zh/)
16+
17+
[qiankun](https://qiankun.umijs.org/zh/)
18+
19+
[vite-plugin-qiankun](https://github.com/tengmaoqing/vite-plugin-qiankun)
20+
21+
[VueUse](https://vueuse.org/)
22+
23+
[Unocss](https://uno.antfu.me/)
24+
25+
[ant design](https://ant.design/components/)
26+
27+
[ant design icons](https://2fd.github.io/ant-design-icons/)
28+
29+
30+
## Customize configuration
31+
32+
See [Vite Configuration Reference](https://vitejs.dev/config/).
33+
34+
## Project Setup
35+
36+
```sh
37+
pnpm install
38+
```
39+
40+
### Compile and Hot-Reload for Development
41+
42+
```sh
43+
pnpm dev
44+
```
45+
46+
### Type-Check, Compile and Minify for Production
47+
48+
```sh
49+
pnpm build
50+
```
51+
52+
### Run Unit Tests with [Vitest](https://vitest.dev/)
53+
54+
```sh
55+
pnpm test:unit
56+
```
57+
58+
### Run End-to-End Tests with [Cypress](https://www.cypress.io/)
59+
60+
```sh
61+
pnpm test:e2e:dev
62+
```
63+
64+
This runs the end-to-end tests against the Vite development server.
65+
It is much faster than the production build.
66+
67+
But it's still recommended to test the production build with `test:e2e` before deploying (e.g. in CI environments):
68+
69+
```sh
70+
pnpm build
71+
pnpm test:e2e
72+
```
73+
74+
### Lint with [ESLint](https://eslint.org/)
75+
76+
```sh
77+
pnpm lint
78+
```

cypress.config.ts

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
import { defineConfig } from 'cypress'
2+
3+
export default defineConfig({
4+
e2e: {
5+
specPattern: 'cypress/e2e/**/*.{cy,spec}.{js,jsx,ts,tsx}',
6+
baseUrl: 'http://localhost:4173'
7+
}
8+
})

cypress/e2e/example.cy.ts

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
// https://on.cypress.io/api
2+
3+
describe('My First Test', () => {
4+
it('visits the app root url', () => {
5+
cy.visit('/')
6+
cy.contains('h1', 'You did it!')
7+
})
8+
})

cypress/e2e/tsconfig.json

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
{
2+
"extends": "@vue/tsconfig/tsconfig.dom.json",
3+
"include": ["./**/*", "../support/**/*"],
4+
"compilerOptions": {
5+
"isolatedModules": false,
6+
"target": "es5",
7+
"lib": ["es5", "dom"],
8+
"types": ["cypress"]
9+
}
10+
}

cypress/fixtures/example.json

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
{
2+
"name": "Using fixtures to represent data",
3+
"email": "[email protected]",
4+
"body": "Fixtures are a great way to mock data for responses to routes"
5+
}

cypress/support/commands.ts

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
/// <reference types="cypress" />
2+
// ***********************************************
3+
// This example commands.ts shows you how to
4+
// create various custom commands and overwrite
5+
// existing commands.
6+
//
7+
// For more comprehensive examples of custom
8+
// commands please read more here:
9+
// https://on.cypress.io/custom-commands
10+
// ***********************************************
11+
//
12+
//
13+
// -- This is a parent command --
14+
// Cypress.Commands.add('login', (email, password) => { ... })
15+
//
16+
//
17+
// -- This is a child command --
18+
// Cypress.Commands.add('drag', { prevSubject: 'element'}, (subject, options) => { ... })
19+
//
20+
//
21+
// -- This is a dual command --
22+
// Cypress.Commands.add('dismiss', { prevSubject: 'optional'}, (subject, options) => { ... })
23+
//
24+
//
25+
// -- This will overwrite an existing command --
26+
// Cypress.Commands.overwrite('visit', (originalFn, url, options) => { ... })
27+
//
28+
// declare global {
29+
// namespace Cypress {
30+
// interface Chainable {
31+
// login(email: string, password: string): Chainable<void>
32+
// drag(subject: string, options?: Partial<TypeOptions>): Chainable<Element>
33+
// dismiss(subject: string, options?: Partial<TypeOptions>): Chainable<Element>
34+
// visit(originalFn: CommandOriginalFn, url: string, options: Partial<VisitOptions>): Chainable<Element>
35+
// }
36+
// }
37+
// }
38+
39+
export {}

0 commit comments

Comments
 (0)