Skip to content

Commit

Permalink
Merge edad9b9 into 5dd193e
Browse files Browse the repository at this point in the history
  • Loading branch information
teobler committed Dec 13, 2021
2 parents 5dd193e + edad9b9 commit 00d9709
Show file tree
Hide file tree
Showing 11 changed files with 41,240 additions and 24,285 deletions.
38 changes: 38 additions & 0 deletions .github/workflows/web.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
name: web

on: [ push, pull_request ]

jobs:
main:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2

- name: go to web app folder
shell: bash
run: cd quake_webapp

- name: Cache pnpm modules
uses: actions/cache@v2
with:
path: ~/.pnpm-store
key: ${{ runner.os }}-${{ hashFiles('**/pnpm-lock.yaml') }}
restore-keys: |
${{ runner.os }}-
- name: setup pnpm and install all dependencies
uses: pnpm/action-setup@v2.0.1
with:
version: 6.0.2
run_install: |
- recursive: true
- name: Derive appropriate SHAs for base and head for `nx affected` commands
uses: nrwl/nx-set-shas@v2

- uses: actions/setup-node@v1
with:
node-version: '16'

- run: yarn run nx affected -- --target=build --base=origin/master --parallel --max-parallel=3
# - run: yarn run nx affected -- --target=test --base=origin/master --parallel --max-parallel=2
6 changes: 6 additions & 0 deletions DEVELOPMENT.md
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,12 @@ Tech stacks:

# Quake Web 开发指南

## build

前端项目基于 `pnpm` 来管理并减少依赖体积,使用 [nx](https://nx.dev/#getting-started) 来管理整个项目,nx cloud可以有效减少每一次构建/测试的时长。

## 开发

Quake 的组件都由 Web Component 构成,通过 Web Component Router 将它们组合在一起,即 [app.js](quake_webapp/app.js)。 如下一个简单的 Web Component 创建过程,基于纯原生的 JavaScript:

```javascript
Expand Down
4,692 changes: 2,808 additions & 1,884 deletions quake_webapp/dashboard/pnpm-lock.yaml

Large diffs are not rendered by default.

42 changes: 42 additions & 0 deletions quake_webapp/nx.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
{
"extends": "@nrwl/workspace/presets/npm.json",
"npmScope": "quake_webapp",
"tasksRunnerOptions": {
"default": {
"runner": "@nrwl/nx-cloud",
"options": {
"cacheableOperations": [
"build",
"test",
"lint",
"package",
"prepare"
],
"accessToken": "NWZhOTRlMDItNDgyNy00ZjMyLTk0ZWQtODJjMWZmZmQxMTNifHJlYWQtd3JpdGU="
}
}
},
"targetDependencies": {
"build": [
{
"target": "build",
"projects": "dependencies"
}
],
"prepare": [
{
"target": "prepare",
"projects": "dependencies"
}
],
"package": [
{
"target": "package",
"projects": "dependencies"
}
]
},
"affected": {
"defaultBase": "master"
}
}
12 changes: 10 additions & 2 deletions quake_webapp/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
"scripts": {
"rinstall": "pnpm recursive install",
"rstart": "pnpm recursive run start",
"dist": "pnpm recursive run build && node build.js",
"dist": "nx run-many --target=build --all && node build.js",
"test": "echo \"Error: no test specified\" && exit 1"
},
"author": "",
Expand All @@ -16,6 +16,14 @@
"fs-extra": "^10.0.0"
},
"devDependencies": {
"uglifyjs-webpack-plugin": "^2.2.0"
"uglifyjs-webpack-plugin": "^2.2.0",
"@nrwl/workspace": "latest",
"@nrwl/cli": "latest",
"@nrwl/tao": "latest",
"typescript": "4.2.4",
"@nrwl/nx-cloud": "latest"
},
"resolutions": {
"eslint": "^7.11.0"
}
}
Loading

0 comments on commit 00d9709

Please sign in to comment.