Skip to content

Commit bae9342

Browse files
authored
UI decompose (#636)
2 parents 32528b6 + f940b9b commit bae9342

File tree

288 files changed

+2050
-1374
lines changed

Some content is hidden

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

288 files changed

+2050
-1374
lines changed
Lines changed: 11 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,15 @@
1-
name: build-vue
1+
name: build-platform-ui
22
on:
33
pull_request:
44
paths:
5-
- 'packages/vue/**'
5+
- 'packages/platform-ui/**'
66
- 'packages/common/**'
77
- 'packages/db/**'
8-
- '.github/workflows/build-vue.yml'
8+
- 'packages/common-ui/**'
9+
- 'packages/courses/**'
10+
- '.github/workflows/build-platform-ui.yml'
911
jobs:
10-
build-vue-spa:
12+
build-platform-ui-spa:
1113
runs-on: ubuntu-latest
1214
steps:
1315
- name: Checkout repository
@@ -29,23 +31,12 @@ jobs:
2931
yarn --version
3032
yarn install --immutable
3133
32-
- name: Build common package
33-
working-directory: ./packages/common
34-
run: yarn build
34+
- name: Setup platform-ui environment
35+
run: printf "${{ secrets.VUE_ENV }}" > ./packages/platform-ui/.env.production
3536

36-
- name: Build db package
37-
working-directory: ./packages/db
37+
- name: Build all packages
3838
run: yarn build
3939

40-
- name: Setup Vue environment
41-
run: printf "${{ secrets.VUE_ENV }}" > ./packages/vue/.env.production
42-
43-
- name: Build Vue package
44-
working-directory: ./packages/vue
45-
run: |
46-
yarn install
47-
yarn build
48-
49-
- name: Run Vue tests
50-
working-directory: ./packages/vue
40+
- name: Run platform-ui tests
41+
working-directory: ./packages/platform-ui
5142
run: yarn test:unit

.github/workflows/courses-test.yml

Lines changed: 58 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,58 @@
1+
# .github/workflows/courses-test.yml
2+
name: Courses Package Tests
3+
4+
on:
5+
push:
6+
paths:
7+
- 'packages/courses/**'
8+
- '.github/workflows/courses-test.yml'
9+
pull_request:
10+
paths:
11+
- 'packages/courses/**'
12+
- '.github/workflows/courses-test.yml'
13+
14+
jobs:
15+
test:
16+
runs-on: ubuntu-latest
17+
steps:
18+
- name: Checkout code
19+
uses: actions/checkout@v3
20+
21+
- name: Setup Node.js
22+
uses: actions/setup-node@v3
23+
with:
24+
node-version: '18'
25+
cache: 'yarn'
26+
27+
- name: Install dependencies
28+
run: yarn install --frozen-lockfile
29+
30+
- name: Build @vue-skuilder/common
31+
run: |
32+
cd packages/common
33+
yarn build
34+
35+
- name: Build @vue-skuilder/db
36+
run: |
37+
cd packages/db
38+
yarn build
39+
40+
- name: Build @vue-skuilder/common-ui
41+
run: |
42+
cd packages/common-ui
43+
yarn build
44+
45+
- name: Build @vue-skuilder/courses
46+
run: |
47+
cd packages/courses
48+
yarn build
49+
50+
- name: Run tests for @vue-skuilder/courses
51+
run: |
52+
cd packages/courses
53+
yarn test
54+
55+
- name: Report test results
56+
if: always()
57+
run: |
58+
echo "Courses package tests completed with status: ${{ job.status }}"

.github/workflows/deploy-vue.yml renamed to .github/workflows/deploy-platform-ui.yml

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
1-
name: deploy-vue
1+
name: deploy-platform-ui
22
on:
33
workflow_dispatch:
44
inputs:
55
reason:
6-
description: 'Reason for deploying Vue app'
6+
description: 'Reason for deploying platform UI app'
77
required: true
88
default: 'Manual deployment'
99
jobs:
10-
deploy-vue:
10+
deploy-platform-ui:
1111
runs-on: ubuntu-latest
1212
steps:
1313
- name: Check out repository code
@@ -33,7 +33,7 @@ jobs:
3333
run: yarn install
3434

3535
- name: Set production environment
36-
run: printf "${{ secrets.VITE_ENV }}" > ./packages/vue/.env.production
36+
run: printf "${{ secrets.VITE_ENV }}" > ./packages/platform-ui/.env.production
3737

3838
- name: Build
3939
run: yarn build
@@ -43,7 +43,7 @@ jobs:
4343
BUILD_INFO="Build created on $(date) from commit ${{ github.sha }}\n"
4444
BUILD_INFO+="Triggered by ${{ github.actor }} via ${{ github.event_name }}\n"
4545
BUILD_INFO+="Reason: ${{ github.event.inputs.reason }}\n"
46-
echo -e "$BUILD_INFO" > ./packages/vue/dist/buildinfo.md
46+
echo -e "$BUILD_INFO" > ./packages/platform-ui/dist/buildinfo.md
4747
4848
- name: Deploy to server
4949
run: |
@@ -52,7 +52,7 @@ jobs:
5252
echo "Creating directory version $newversion..."
5353
ssh ${{ secrets.DO_USERNAME }}@eduquilt.com mkdir -p /home/skuilder/dist/vue/$newversion
5454
echo "Syncing files to server..."
55-
rsync -rl --delete ./packages/vue/dist/ ${{ secrets.DO_USERNAME }}@eduquilt.com:/home/skuilder/dist/vue/$newversion
55+
rsync -rl --delete ./packages/platform-ui/dist/ ${{ secrets.DO_USERNAME }}@eduquilt.com:/home/skuilder/dist/vue/$newversion
5656
echo "Setting symlink to new version..."
5757
ssh ${{ secrets.DO_USERNAME }}@eduquilt.com ln -sfn /home/skuilder/dist/vue/$newversion /home/skuilder/www
5858
echo "Deployment complete to version $newversion"

.gitignore

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ yarn-error.log*
3232
vue/Caddyfile
3333

3434
# Cyrpress build artifacts
35-
/packages/vue/cypress
35+
/packages/platform-ui/cypress
3636

3737
# yarn 2+ files
3838
.yarn/*

.prompt

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,13 @@ developed slowly as an occasional hobby / side project, and used 'in production'
1414

1515
Much of the legacy code was written without explicit concerns for performance, security, or scale.
1616

17+
# Current Setup:
18+
19+
- "packageManager": "yarn@4.6.0", with yarn workspaces
20+
- frontend: vue 3, vuetify 3, vite, vue router 4, pinia, pouchdb
21+
- backend: (thin) express
22+
- database: couchdb
23+
1724
# Current goals:
1825

1926
Seeking to use the project as a vehicle to develop content for commercial, production grade systems. Seeking to iterate quickly to modernize the stack and add key features.

package.json

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
{
22
"name": "vue-skuilder",
33
"scripts": {
4-
"dev": "yarn workspace @vue-skuilder/common build && yarn workspace @vue-skuilder/db build && node scripts/dev-couchdb.js start && concurrently \"yarn dev:vue\" \"yarn dev:express\"",
5-
"dev:vue": "yarn workspace @vue-skuilder/vue dev",
4+
"dev": "yarn workspace @vue-skuilder/common build && yarn workspace @vue-skuilder/db build && yarn workspace @vue-skuilder/common-ui build && yarn workspace @vue-skuilder/courses build && node scripts/dev-couchdb.js start && concurrently \"yarn dev:platform-ui\" \"yarn dev:express\"",
5+
"dev:platform-ui": "yarn workspace @vue-skuilder/platform-ui dev",
66
"dev:express": "yarn workspace @vue-skuilder/express dev",
77
"dev:couchdb": "node scripts/dev-couchdb.js start",
88
"couchdb:start": "node scripts/dev-couchdb.js start",
@@ -13,7 +13,11 @@
1313
"test:e2e": "cypress open",
1414
"test:e2e:headless": "cypress run",
1515
"ci:e2e": "yarn dev & wait-on http://localhost:5173 && cypress run; kill $(lsof -t -i:8080); yarn couchdb:stop",
16-
"build": "yarn workspace @vue-skuilder/common build && yarn workspace @vue-skuilder/db build && yarn workspace @vue-skuilder/vue build && yarn workspace @vue-skuilder/express build"
16+
"build": "yarn workspace @vue-skuilder/common build && yarn workspace @vue-skuilder/db build && yarn workspace @vue-skuilder/common-ui build && yarn workspace @vue-skuilder/courses build && yarn workspace @vue-skuilder/platform-ui build && yarn workspace @vue-skuilder/express build",
17+
"clean": "yarn clean:dist && yarn clean:node_modules",
18+
"clean:dist": "find packages -name 'dist' -type d -exec rm -rf {} +",
19+
"clean:node_modules": "find . -name 'node_modules' -type d -exec rm -rf {} +",
20+
"clean:all": "yarn clean && rm -rf .pnp.* .yarn/cache .yarn/install-state.gz"
1721
},
1822
"private": true,
1923
"workspaces": [

packages/client/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,6 @@
4343
"rollup": "^4.12.1",
4444
"ts-jest": "^29.1.2",
4545
"tslib": "^2.6.2",
46-
"typescript": "^5.4.2"
46+
"typescript": "~5.7.2"
4747
}
4848
}

packages/common-ui/package.json

Lines changed: 58 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,58 @@
1+
{
2+
"name": "@vue-skuilder/common-ui",
3+
"version": "0.1.0",
4+
"main": "./dist/common-ui.umd.js",
5+
"module": "./dist/common-ui.es.js",
6+
"types": "./dist/index.d.ts",
7+
"exports": {
8+
".": {
9+
"types": "./dist/index.d.ts",
10+
"import": "./dist/common-ui.es.js",
11+
"require": "./dist/common-ui.umd.js"
12+
},
13+
"./style": "./dist/assets/index.css",
14+
"./styles": "./dist/assets/index.css"
15+
},
16+
"files": [
17+
"dist",
18+
"src"
19+
],
20+
"scripts": {
21+
"dev": "vite build --watch",
22+
"build": "vite build && yarn build-types",
23+
"build-types": "tsc --project tsconfig.types.json",
24+
"lint": "eslint . --fix",
25+
"lint:check": "eslint .",
26+
"test:unit": "vitest run"
27+
},
28+
"dependencies": {
29+
"@highlightjs/vue-plugin": "^2.1.2",
30+
"@mdi/font": "^7.3.67",
31+
"@vue-skuilder/common": "workspace:*",
32+
"@vue-skuilder/db": "workspace:*",
33+
"highlight.js": "^11.0.1",
34+
"marked": "^15.0.6",
35+
"moment": "^2.29.4",
36+
"mousetrap": "^1.6.5",
37+
"pinia": "^2.3.0",
38+
"vue": "^3.5.13",
39+
"vuetify": "^3.7.0"
40+
},
41+
"peerDependencies": {
42+
"vue": "^3.2.0",
43+
"vuetify": "^3.0.0"
44+
},
45+
"devDependencies": {
46+
"@typescript-eslint/eslint-plugin": "^8.25.0",
47+
"@typescript-eslint/parser": "^8.25.0",
48+
"@vitejs/plugin-vue": "^5.2.1",
49+
"@vue/eslint-config-typescript": "^14.4.0",
50+
"eslint": "^9.21.0",
51+
"eslint-config-prettier": "^10.0.2",
52+
"eslint-plugin-vue": "^9.32.0",
53+
"sass": "^1.83.0",
54+
"typescript": "~5.7.2",
55+
"vite": "^6.0.9",
56+
"vitest": "^3.0.5"
57+
}
58+
}
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
export interface DayData {
2+
date: string;
3+
count: number;
4+
}
5+
6+
export interface Color {
7+
h: number;
8+
s: number;
9+
l: number;
10+
}
11+
12+
export interface ActivityRecord {
13+
timeStamp: number | string;
14+
[key: string]: any;
15+
}

0 commit comments

Comments
 (0)