From 0020bfe4a12b111b8cf5d7ba625c52e55a48443a Mon Sep 17 00:00:00 2001 From: Debucquoy Date: Sat, 10 Feb 2024 19:44:52 +0100 Subject: [PATCH 1/4] frontend base --- frontend/.gitignore | 27 ++++++ frontend/README.md | 33 +++++++ frontend/index.html | 13 +++ frontend/jsconfig.json | 8 ++ frontend/package.json | 25 +++++ frontend/public/favicon.ico | Bin 0 -> 4286 bytes frontend/src/App.vue | 47 ++++++++++ frontend/src/assets/base.css | 86 +++++++++++++++++ frontend/src/assets/logo.svg | 1 + frontend/src/assets/main.css | 35 +++++++ frontend/src/components/HelloWorld.vue | 44 +++++++++ frontend/src/components/TheWelcome.vue | 88 ++++++++++++++++++ frontend/src/components/WelcomeItem.vue | 87 +++++++++++++++++ .../components/__tests__/HelloWorld.spec.js | 11 +++ .../src/components/icons/IconCommunity.vue | 7 ++ .../components/icons/IconDocumentation.vue | 7 ++ .../src/components/icons/IconEcosystem.vue | 7 ++ frontend/src/components/icons/IconSupport.vue | 7 ++ frontend/src/components/icons/IconTooling.vue | 19 ++++ frontend/src/main.js | 6 ++ frontend/vite.config.js | 16 ++++ frontend/vitest.config.js | 14 +++ 22 files changed, 588 insertions(+) create mode 100644 frontend/.gitignore create mode 100644 frontend/README.md create mode 100644 frontend/index.html create mode 100644 frontend/jsconfig.json create mode 100644 frontend/package.json create mode 100644 frontend/public/favicon.ico create mode 100644 frontend/src/App.vue create mode 100644 frontend/src/assets/base.css create mode 100644 frontend/src/assets/logo.svg create mode 100644 frontend/src/assets/main.css create mode 100644 frontend/src/components/HelloWorld.vue create mode 100644 frontend/src/components/TheWelcome.vue create mode 100644 frontend/src/components/WelcomeItem.vue create mode 100644 frontend/src/components/__tests__/HelloWorld.spec.js create mode 100644 frontend/src/components/icons/IconCommunity.vue create mode 100644 frontend/src/components/icons/IconDocumentation.vue create mode 100644 frontend/src/components/icons/IconEcosystem.vue create mode 100644 frontend/src/components/icons/IconSupport.vue create mode 100644 frontend/src/components/icons/IconTooling.vue create mode 100644 frontend/src/main.js create mode 100644 frontend/vite.config.js create mode 100644 frontend/vitest.config.js diff --git a/frontend/.gitignore b/frontend/.gitignore new file mode 100644 index 0000000..39c5c92 --- /dev/null +++ b/frontend/.gitignore @@ -0,0 +1,27 @@ +# Logs +logs +*.log +npm-debug.log* +yarn-debug.log* +yarn-error.log* +pnpm-debug.log* +lerna-debug.log* + +node_modules +.DS_Store +dist +dist-ssr +coverage +*.local + +# Editor directories and files +.vscode/* +!.vscode/extensions.json +.idea +*.suo +*.ntvs* +*.njsproj +*.sln +*.sw? + +*.tsbuildinfo diff --git a/frontend/README.md b/frontend/README.md new file mode 100644 index 0000000..1183763 --- /dev/null +++ b/frontend/README.md @@ -0,0 +1,33 @@ +# Clyde + +This is the frontend part of the Clyde application + +## Project Setup + +```sh +npm install +``` + +### Compile and Hot-Reload for Development + +```sh +npm run dev +``` + +### Compile and Minify for Production + +```sh +npm run build +``` + +### Run Unit Tests with [Vitest](https://vitest.dev/) + +```sh +npm run test:unit +``` + +### Lint with [ESLint](https://eslint.org/) + +```sh +npm run lint +``` diff --git a/frontend/index.html b/frontend/index.html new file mode 100644 index 0000000..99f583a --- /dev/null +++ b/frontend/index.html @@ -0,0 +1,13 @@ + + + + + + + Vite App + + +
+ + + diff --git a/frontend/jsconfig.json b/frontend/jsconfig.json new file mode 100644 index 0000000..5a1f2d2 --- /dev/null +++ b/frontend/jsconfig.json @@ -0,0 +1,8 @@ +{ + "compilerOptions": { + "paths": { + "@/*": ["./src/*"] + } + }, + "exclude": ["node_modules", "dist"] +} diff --git a/frontend/package.json b/frontend/package.json new file mode 100644 index 0000000..627ffa2 --- /dev/null +++ b/frontend/package.json @@ -0,0 +1,25 @@ +{ + "name": "clyde", + "version": "0.0.0", + "private": true, + "type": "module", + "scripts": { + "dev": "vite", + "build": "vite build", + "preview": "vite preview", + "test:unit": "vitest", + "lint": "eslint . --ext .vue,.js,.jsx,.cjs,.mjs --fix --ignore-path .gitignore" + }, + "dependencies": { + "vue": "^3.4.15" + }, + "devDependencies": { + "@vitejs/plugin-vue": "^5.0.3", + "@vue/test-utils": "^2.4.4", + "eslint": "^8.49.0", + "eslint-plugin-vue": "^9.17.0", + "jsdom": "^24.0.0", + "vite": "^5.0.11", + "vitest": "^1.2.2" + } +} diff --git a/frontend/public/favicon.ico b/frontend/public/favicon.ico new file mode 100644 index 0000000000000000000000000000000000000000..df36fcfb72584e00488330b560ebcf34a41c64c2 GIT binary patch literal 4286 zcmds*O-Phc6o&64GDVCEQHxsW(p4>LW*W<827=Unuo8sGpRux(DN@jWP-e29Wl%wj zY84_aq9}^Am9-cWTD5GGEo#+5Fi2wX_P*bo+xO!)p*7B;iKlbFd(U~_d(U?#hLj56 zPhFkj-|A6~Qk#@g^#D^U0XT1cu=c-vu1+SElX9NR;kzAUV(q0|dl0|%h|dI$%VICy zJnu2^L*Te9JrJMGh%-P79CL0}dq92RGU6gI{v2~|)p}sG5x0U*z<8U;Ij*hB9z?ei z@g6Xq-pDoPl=MANPiR7%172VA%r)kevtV-_5H*QJKFmd;8yA$98zCxBZYXTNZ#QFk2(TX0;Y2dt&WitL#$96|gJY=3xX zpCoi|YNzgO3R`f@IiEeSmKrPSf#h#Qd<$%Ej^RIeeYfsxhPMOG`S`Pz8q``=511zm zAm)MX5AV^5xIWPyEu7u>qYs?pn$I4nL9J!=K=SGlKLXpE<5x+2cDTXq?brj?n6sp= zphe9;_JHf40^9~}9i08r{XM$7HB!`{Ys~TK0kx<}ZQng`UPvH*11|q7&l9?@FQz;8 zx!=3<4seY*%=OlbCbcae?5^V_}*K>Uo6ZWV8mTyE^B=DKy7-sdLYkR5Z?paTgK-zyIkKjIcpyO z{+uIt&YSa_$QnN_@t~L014dyK(fOOo+W*MIxbA6Ndgr=Y!f#Tokqv}n<7-9qfHkc3 z=>a|HWqcX8fzQCT=dqVbogRq!-S>H%yA{1w#2Pn;=e>JiEj7Hl;zdt-2f+j2%DeVD zsW0Ab)ZK@0cIW%W7z}H{&~yGhn~D;aiP4=;m-HCo`BEI+Kd6 z={Xwx{TKxD#iCLfl2vQGDitKtN>z|-AdCN|$jTFDg0m3O`WLD4_s#$S literal 0 HcmV?d00001 diff --git a/frontend/src/App.vue b/frontend/src/App.vue new file mode 100644 index 0000000..633a5df --- /dev/null +++ b/frontend/src/App.vue @@ -0,0 +1,47 @@ + + + + + diff --git a/frontend/src/assets/base.css b/frontend/src/assets/base.css new file mode 100644 index 0000000..8816868 --- /dev/null +++ b/frontend/src/assets/base.css @@ -0,0 +1,86 @@ +/* color palette from */ +:root { + --vt-c-white: #ffffff; + --vt-c-white-soft: #f8f8f8; + --vt-c-white-mute: #f2f2f2; + + --vt-c-black: #181818; + --vt-c-black-soft: #222222; + --vt-c-black-mute: #282828; + + --vt-c-indigo: #2c3e50; + + --vt-c-divider-light-1: rgba(60, 60, 60, 0.29); + --vt-c-divider-light-2: rgba(60, 60, 60, 0.12); + --vt-c-divider-dark-1: rgba(84, 84, 84, 0.65); + --vt-c-divider-dark-2: rgba(84, 84, 84, 0.48); + + --vt-c-text-light-1: var(--vt-c-indigo); + --vt-c-text-light-2: rgba(60, 60, 60, 0.66); + --vt-c-text-dark-1: var(--vt-c-white); + --vt-c-text-dark-2: rgba(235, 235, 235, 0.64); +} + +/* semantic color variables for this project */ +:root { + --color-background: var(--vt-c-white); + --color-background-soft: var(--vt-c-white-soft); + --color-background-mute: var(--vt-c-white-mute); + + --color-border: var(--vt-c-divider-light-2); + --color-border-hover: var(--vt-c-divider-light-1); + + --color-heading: var(--vt-c-text-light-1); + --color-text: var(--vt-c-text-light-1); + + --section-gap: 160px; +} + +@media (prefers-color-scheme: dark) { + :root { + --color-background: var(--vt-c-black); + --color-background-soft: var(--vt-c-black-soft); + --color-background-mute: var(--vt-c-black-mute); + + --color-border: var(--vt-c-divider-dark-2); + --color-border-hover: var(--vt-c-divider-dark-1); + + --color-heading: var(--vt-c-text-dark-1); + --color-text: var(--vt-c-text-dark-2); + } +} + +*, +*::before, +*::after { + box-sizing: border-box; + margin: 0; + font-weight: normal; +} + +body { + min-height: 100vh; + color: var(--color-text); + background: var(--color-background); + transition: + color 0.5s, + background-color 0.5s; + line-height: 1.6; + font-family: + Inter, + -apple-system, + BlinkMacSystemFont, + 'Segoe UI', + Roboto, + Oxygen, + Ubuntu, + Cantarell, + 'Fira Sans', + 'Droid Sans', + 'Helvetica Neue', + sans-serif; + font-size: 15px; + text-rendering: optimizeLegibility; + -webkit-font-smoothing: antialiased; + -moz-osx-font-smoothing: grayscale; +} diff --git a/frontend/src/assets/logo.svg b/frontend/src/assets/logo.svg new file mode 100644 index 0000000..7565660 --- /dev/null +++ b/frontend/src/assets/logo.svg @@ -0,0 +1 @@ + diff --git a/frontend/src/assets/main.css b/frontend/src/assets/main.css new file mode 100644 index 0000000..36fb845 --- /dev/null +++ b/frontend/src/assets/main.css @@ -0,0 +1,35 @@ +@import './base.css'; + +#app { + max-width: 1280px; + margin: 0 auto; + padding: 2rem; + font-weight: normal; +} + +a, +.green { + text-decoration: none; + color: hsla(160, 100%, 37%, 1); + transition: 0.4s; + padding: 3px; +} + +@media (hover: hover) { + a:hover { + background-color: hsla(160, 100%, 37%, 0.2); + } +} + +@media (min-width: 1024px) { + body { + display: flex; + place-items: center; + } + + #app { + display: grid; + grid-template-columns: 1fr 1fr; + padding: 0 2rem; + } +} diff --git a/frontend/src/components/HelloWorld.vue b/frontend/src/components/HelloWorld.vue new file mode 100644 index 0000000..5fb372c --- /dev/null +++ b/frontend/src/components/HelloWorld.vue @@ -0,0 +1,44 @@ + + + + + diff --git a/frontend/src/components/TheWelcome.vue b/frontend/src/components/TheWelcome.vue new file mode 100644 index 0000000..dab9536 --- /dev/null +++ b/frontend/src/components/TheWelcome.vue @@ -0,0 +1,88 @@ + + + diff --git a/frontend/src/components/WelcomeItem.vue b/frontend/src/components/WelcomeItem.vue new file mode 100644 index 0000000..6d7086a --- /dev/null +++ b/frontend/src/components/WelcomeItem.vue @@ -0,0 +1,87 @@ + + + diff --git a/frontend/src/components/__tests__/HelloWorld.spec.js b/frontend/src/components/__tests__/HelloWorld.spec.js new file mode 100644 index 0000000..2533202 --- /dev/null +++ b/frontend/src/components/__tests__/HelloWorld.spec.js @@ -0,0 +1,11 @@ +import { describe, it, expect } from 'vitest' + +import { mount } from '@vue/test-utils' +import HelloWorld from '../HelloWorld.vue' + +describe('HelloWorld', () => { + it('renders properly', () => { + const wrapper = mount(HelloWorld, { props: { msg: 'Hello Vitest' } }) + expect(wrapper.text()).toContain('Hello Vitest') + }) +}) diff --git a/frontend/src/components/icons/IconCommunity.vue b/frontend/src/components/icons/IconCommunity.vue new file mode 100644 index 0000000..2dc8b05 --- /dev/null +++ b/frontend/src/components/icons/IconCommunity.vue @@ -0,0 +1,7 @@ + diff --git a/frontend/src/components/icons/IconDocumentation.vue b/frontend/src/components/icons/IconDocumentation.vue new file mode 100644 index 0000000..6d4791c --- /dev/null +++ b/frontend/src/components/icons/IconDocumentation.vue @@ -0,0 +1,7 @@ + diff --git a/frontend/src/components/icons/IconEcosystem.vue b/frontend/src/components/icons/IconEcosystem.vue new file mode 100644 index 0000000..c3a4f07 --- /dev/null +++ b/frontend/src/components/icons/IconEcosystem.vue @@ -0,0 +1,7 @@ + diff --git a/frontend/src/components/icons/IconSupport.vue b/frontend/src/components/icons/IconSupport.vue new file mode 100644 index 0000000..7452834 --- /dev/null +++ b/frontend/src/components/icons/IconSupport.vue @@ -0,0 +1,7 @@ + diff --git a/frontend/src/components/icons/IconTooling.vue b/frontend/src/components/icons/IconTooling.vue new file mode 100644 index 0000000..660598d --- /dev/null +++ b/frontend/src/components/icons/IconTooling.vue @@ -0,0 +1,19 @@ + + diff --git a/frontend/src/main.js b/frontend/src/main.js new file mode 100644 index 0000000..0ac3a5f --- /dev/null +++ b/frontend/src/main.js @@ -0,0 +1,6 @@ +import './assets/main.css' + +import { createApp } from 'vue' +import App from './App.vue' + +createApp(App).mount('#app') diff --git a/frontend/vite.config.js b/frontend/vite.config.js new file mode 100644 index 0000000..5c45e1d --- /dev/null +++ b/frontend/vite.config.js @@ -0,0 +1,16 @@ +import { fileURLToPath, URL } from 'node:url' + +import { defineConfig } from 'vite' +import vue from '@vitejs/plugin-vue' + +// https://vitejs.dev/config/ +export default defineConfig({ + plugins: [ + vue(), + ], + resolve: { + alias: { + '@': fileURLToPath(new URL('./src', import.meta.url)) + } + } +}) diff --git a/frontend/vitest.config.js b/frontend/vitest.config.js new file mode 100644 index 0000000..10067d5 --- /dev/null +++ b/frontend/vitest.config.js @@ -0,0 +1,14 @@ +import { fileURLToPath } from 'node:url' +import { mergeConfig, defineConfig, configDefaults } from 'vitest/config' +import viteConfig from './vite.config' + +export default mergeConfig( + viteConfig, + defineConfig({ + test: { + environment: 'jsdom', + exclude: [...configDefaults.exclude, 'e2e/*'], + root: fileURLToPath(new URL('./', import.meta.url)) + } + }) +) -- 2.46.0 From 35bbb45ff23d5481103918b3b910c7d77591f4a2 Mon Sep 17 00:00:00 2001 From: Debucquoy Date: Wed, 14 Feb 2024 08:55:44 +0100 Subject: [PATCH 2/4] avoid storing lock --- frontend/.gitignore | 3 +++ 1 file changed, 3 insertions(+) diff --git a/frontend/.gitignore b/frontend/.gitignore index 39c5c92..3230044 100644 --- a/frontend/.gitignore +++ b/frontend/.gitignore @@ -25,3 +25,6 @@ coverage *.sw? *.tsbuildinfo + +# Personal but I don't like to store the lock +package-lock.json -- 2.46.0 From 613ad99264ca6aa7adeb1c7dc79c06bb7a125d84 Mon Sep 17 00:00:00 2001 From: Debucquoy Date: Wed, 14 Feb 2024 11:06:26 +0100 Subject: [PATCH 3/4] ci(app): Drone Deployment --- .drone.yml | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/.drone.yml b/.drone.yml index 45ad986..146771f 100644 --- a/.drone.yml +++ b/.drone.yml @@ -37,6 +37,14 @@ kind: pipeline type: exec name: deploy +server: + host: + from_secret: host + user: + from_secret: user + ssh_key: + from_secret: ssh_key + plateform: os: linux arch: amd64 @@ -47,13 +55,12 @@ trigger: event: - push -clone: - disabled: true - steps: - name: deploy frontend commands: - - echo "deploying frontend TODO" + - cd frontend + - npm run build + - install -d "dist/" "$HOME/dist" - name: deploy backend commands: - echo "deploying backend TODO" -- 2.46.0 From 1f342468c5ab74045ea86f6829e5e0ba2a633699 Mon Sep 17 00:00:00 2001 From: Debucquoy Date: Fri, 16 Feb 2024 08:07:46 +0100 Subject: [PATCH 4/4] droned --- .drone.yml | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/.drone.yml b/.drone.yml index 146771f..0f031a1 100644 --- a/.drone.yml +++ b/.drone.yml @@ -20,6 +20,9 @@ kind: pipeline type: docker name: build +depends_on: + - test + steps: - name: Backend-build image: eclipse-temurin:21 @@ -37,6 +40,9 @@ kind: pipeline type: exec name: deploy +depends_on: + - build + server: host: from_secret: host @@ -66,6 +72,6 @@ steps: - echo "deploying backend TODO" --- kind: signature -hmac: b83fd07f6cc04de673e561857d82e3cc36c4f98f311f78808fc927839d5d3cf2 +hmac: 3c5387c57626f0946636d82b97fad0daaf09dbb5f02f201791363ff33cc0bb82 ... -- 2.46.0