From 4da3272bf7893760f6710c9a1ec7de02358136e6 Mon Sep 17 00:00:00 2001 From: HampusM Date: Sat, 5 Jun 2021 19:37:52 +0200 Subject: Reorganized into a monorepo, refactored the frontend again, goodbye Parcel --- packages/client/src/App.vue | 32 ++++ packages/client/src/assets/logo.png | Bin 0 -> 6849 bytes packages/client/src/components/BaseBackButton.vue | 33 ++++ packages/client/src/components/BaseBreadcrumb.vue | 39 ++++ packages/client/src/components/CommitPatch.vue | 129 +++++++++++++ packages/client/src/components/HomeHeader.vue | 49 +++++ .../client/src/components/HomeProjectsHeader.vue | 45 +++++ .../src/components/RepositoryCloneDropdown.vue | 112 ++++++++++++ .../client/src/components/RepositoryHeader.vue | 64 +++++++ .../client/src/components/RepositoryNavbar.vue | 59 ++++++ .../client/src/components/RepositoryTreeBlob.vue | 71 ++++++++ .../client/src/components/RepositoryTreeTree.vue | 114 ++++++++++++ packages/client/src/main.js | 5 + packages/client/src/router/index.js | 46 +++++ packages/client/src/scss/_bootstrap.scss | 75 ++++++++ packages/client/src/scss/_colors.scss | 10 + packages/client/src/scss/_fonts.scss | 5 + packages/client/src/util/hljs-languages.js | 45 +++++ packages/client/src/views/Home.vue | 79 ++++++++ packages/client/src/views/Repository.vue | 27 +++ packages/client/src/views/RepositoryCommit.vue | 202 +++++++++++++++++++++ packages/client/src/views/RepositoryLog.vue | 111 +++++++++++ packages/client/src/views/RepositoryTree.vue | 106 +++++++++++ 23 files changed, 1458 insertions(+) create mode 100644 packages/client/src/App.vue create mode 100644 packages/client/src/assets/logo.png create mode 100644 packages/client/src/components/BaseBackButton.vue create mode 100644 packages/client/src/components/BaseBreadcrumb.vue create mode 100644 packages/client/src/components/CommitPatch.vue create mode 100644 packages/client/src/components/HomeHeader.vue create mode 100644 packages/client/src/components/HomeProjectsHeader.vue create mode 100644 packages/client/src/components/RepositoryCloneDropdown.vue create mode 100644 packages/client/src/components/RepositoryHeader.vue create mode 100644 packages/client/src/components/RepositoryNavbar.vue create mode 100644 packages/client/src/components/RepositoryTreeBlob.vue create mode 100644 packages/client/src/components/RepositoryTreeTree.vue create mode 100644 packages/client/src/main.js create mode 100644 packages/client/src/router/index.js create mode 100644 packages/client/src/scss/_bootstrap.scss create mode 100644 packages/client/src/scss/_colors.scss create mode 100644 packages/client/src/scss/_fonts.scss create mode 100644 packages/client/src/util/hljs-languages.js create mode 100644 packages/client/src/views/Home.vue create mode 100644 packages/client/src/views/Repository.vue create mode 100644 packages/client/src/views/RepositoryCommit.vue create mode 100644 packages/client/src/views/RepositoryLog.vue create mode 100644 packages/client/src/views/RepositoryTree.vue (limited to 'packages/client/src') diff --git a/packages/client/src/App.vue b/packages/client/src/App.vue new file mode 100644 index 0000000..f4d00ca --- /dev/null +++ b/packages/client/src/App.vue @@ -0,0 +1,32 @@ + + + diff --git a/packages/client/src/assets/logo.png b/packages/client/src/assets/logo.png new file mode 100644 index 0000000..f3d2503 Binary files /dev/null and b/packages/client/src/assets/logo.png differ diff --git a/packages/client/src/components/BaseBackButton.vue b/packages/client/src/components/BaseBackButton.vue new file mode 100644 index 0000000..e1191f9 --- /dev/null +++ b/packages/client/src/components/BaseBackButton.vue @@ -0,0 +1,33 @@ + + + + + diff --git a/packages/client/src/components/BaseBreadcrumb.vue b/packages/client/src/components/BaseBreadcrumb.vue new file mode 100644 index 0000000..91c0109 --- /dev/null +++ b/packages/client/src/components/BaseBreadcrumb.vue @@ -0,0 +1,39 @@ + + + + + diff --git a/packages/client/src/components/CommitPatch.vue b/packages/client/src/components/CommitPatch.vue new file mode 100644 index 0000000..0734b1e --- /dev/null +++ b/packages/client/src/components/CommitPatch.vue @@ -0,0 +1,129 @@ + diff --git a/packages/client/src/components/HomeHeader.vue b/packages/client/src/components/HomeHeader.vue new file mode 100644 index 0000000..24afd5b --- /dev/null +++ b/packages/client/src/components/HomeHeader.vue @@ -0,0 +1,49 @@ + + + + + diff --git a/packages/client/src/components/HomeProjectsHeader.vue b/packages/client/src/components/HomeProjectsHeader.vue new file mode 100644 index 0000000..6bc9a34 --- /dev/null +++ b/packages/client/src/components/HomeProjectsHeader.vue @@ -0,0 +1,45 @@ + + + + + diff --git a/packages/client/src/components/RepositoryCloneDropdown.vue b/packages/client/src/components/RepositoryCloneDropdown.vue new file mode 100644 index 0000000..ed565ef --- /dev/null +++ b/packages/client/src/components/RepositoryCloneDropdown.vue @@ -0,0 +1,112 @@ + + + + + diff --git a/packages/client/src/components/RepositoryHeader.vue b/packages/client/src/components/RepositoryHeader.vue new file mode 100644 index 0000000..9f37df4 --- /dev/null +++ b/packages/client/src/components/RepositoryHeader.vue @@ -0,0 +1,64 @@ + + + + + diff --git a/packages/client/src/components/RepositoryNavbar.vue b/packages/client/src/components/RepositoryNavbar.vue new file mode 100644 index 0000000..c69762f --- /dev/null +++ b/packages/client/src/components/RepositoryNavbar.vue @@ -0,0 +1,59 @@ + + + + + diff --git a/packages/client/src/components/RepositoryTreeBlob.vue b/packages/client/src/components/RepositoryTreeBlob.vue new file mode 100644 index 0000000..2da00ed --- /dev/null +++ b/packages/client/src/components/RepositoryTreeBlob.vue @@ -0,0 +1,71 @@ + + + + + diff --git a/packages/client/src/components/RepositoryTreeTree.vue b/packages/client/src/components/RepositoryTreeTree.vue new file mode 100644 index 0000000..89ffb81 --- /dev/null +++ b/packages/client/src/components/RepositoryTreeTree.vue @@ -0,0 +1,114 @@ + + + + + diff --git a/packages/client/src/main.js b/packages/client/src/main.js new file mode 100644 index 0000000..10ea69d --- /dev/null +++ b/packages/client/src/main.js @@ -0,0 +1,5 @@ +import { createApp } from "vue"; +import App from "./App.vue"; +import router from "./router"; + +createApp(App).use(router).mount("#app"); diff --git a/packages/client/src/router/index.js b/packages/client/src/router/index.js new file mode 100644 index 0000000..69cd036 --- /dev/null +++ b/packages/client/src/router/index.js @@ -0,0 +1,46 @@ +import { createRouter, createWebHashHistory } from "vue-router"; +import Home from "../views/Home"; + +const routes = [ + { + path: "/", + name: "Home", + component: Home + }, + { + path: "/:repo([a-zA-Z0-9\\.\\-_]+)", + name: "Repository", + component: () => import("../views/Repository"), + props: route => ({ repository: route.params.repo }), + children: [ + { + path: "log", + name: "Repository Log", + component: () => import("../views/RepositoryLog") + }, + { + path: "log/:commit([a-fA-F0-9]{40}$)", + name: "Commit", + component: () => import("../views/RepositoryCommit"), + props: route => ({ commit: route.params.commit }) + }, + { + path: "tree/:path*", + name: "Tree Entry", + component: () => import("../views/RepositoryTree"), + props: route => ({ pathArr: route.params.path ? route.params.path : [] }) + }, + { + path: "", + redirect: to => `/${to.params.repo}/log` + } + ] + } +]; + +const router = createRouter({ + history: createWebHashHistory(), + routes +}); + +export default router; diff --git a/packages/client/src/scss/_bootstrap.scss b/packages/client/src/scss/_bootstrap.scss new file mode 100644 index 0000000..b7cc84f --- /dev/null +++ b/packages/client/src/scss/_bootstrap.scss @@ -0,0 +1,75 @@ +@import "~bootstrap/scss/functions"; +@import "~bootstrap/scss/variables"; +@import "~bootstrap/scss/mixins"; + +$theme-colors: ( + "primary": colors.$primary, + "secondary": colors.$secondary, + "success": colors.$success, + "info": $info, + "warning": $warning, + "danger": colors.$danger, + "light": $light, + "dark": $dark +); + +$font-size-base: 0.75rem; + +$h1-font-size: $font-size-base * 2.5; +$h2-font-size: $font-size-base * 2; +$h3-font-size: $font-size-base * 1.75; +$h4-font-size: $font-size-base * 1.5; +$h5-font-size: $font-size-base * 1.125; +$h6-font-size: $font-size-base; + +$font-sizes: ( + 1: $h1-font-size, + 2: $h2-font-size, + 3: $h3-font-size, + 4: $h4-font-size, + 5: $h5-font-size, + 6: $h6-font-size +); + +$input-bg: lighten(#000000, 12%); +$input-disabled-bg: lighten(#000000, 12%); +$input-color: colors.$text; +$input-focus-color: colors.$text; +$input-focus-box-shadow: none; +$input-disabled-border-color: lighten(#000000, 50%); +$input-height-sm: auto; + +$btn-padding-y-sm: 0.15rem; +$btn-padding-x-sm: 0.4rem; + +$table-cell-padding-x: 1rem; +$table-cell-padding-y: 0.2rem; + +$table-variants: ( + "primary": shift-color($primary, $table-bg-scale), + "secondary": shift-color($secondary, $table-bg-scale), + "success": shift-color($success, $table-bg-scale), + "info": shift-color($info, $table-bg-scale), + "warning": shift-color($warning, $table-bg-scale), + "danger": shift-color($danger, $table-bg-scale), + "light": $light, + "dark": colors.$background, +); + +@media (max-width: 1200px) { + .fs-1 { + font-size: calc(1.375rem + 0.667vw) !important; + } + .fs-2 { + font-size: calc(1.325rem + 1.584vw) !important; + } + .fs-3 { + font-size: calc(1.3rem + 0.017vw) !important; + } + .fs-4 { + font-size: calc(0.82rem + 0.4vw) !important; + } + .fs-5 { + font-size: calc(0.65rem + 0.25vw) !important; + } +} \ No newline at end of file diff --git a/packages/client/src/scss/_colors.scss b/packages/client/src/scss/_colors.scss new file mode 100644 index 0000000..3c05336 --- /dev/null +++ b/packages/client/src/scss/_colors.scss @@ -0,0 +1,10 @@ +$primary: #023E8A; +$primary-light: #0077b6; +$secondary: #F48C06; +$success: #40916C; +$new: #06d6a0; +$danger: #D00000; +$text: #ffffff; +$text-gray: #6c757d; +$background: #121212; +$not-selected: #adb5bd; \ No newline at end of file diff --git a/packages/client/src/scss/_fonts.scss b/packages/client/src/scss/_fonts.scss new file mode 100644 index 0000000..cc5561a --- /dev/null +++ b/packages/client/src/scss/_fonts.scss @@ -0,0 +1,5 @@ +@import url('https://fonts.googleapis.com/css2?family=Open+Sans:wght@300;400;600;700&display=swap'); +@import url('https://fonts.googleapis.com/css2?family=Oxygen:wght@300&display=swap'); + +$font-title: 'Oxygen', sans-serif; +$font-primary: 'Open Sans', sans-serif; \ No newline at end of file diff --git a/packages/client/src/util/hljs-languages.js b/packages/client/src/util/hljs-languages.js new file mode 100644 index 0000000..2f50461 --- /dev/null +++ b/packages/client/src/util/hljs-languages.js @@ -0,0 +1,45 @@ +const languages = [ + { name: "arduino", extensions: [ ".ino" ] }, + { name: "actionscript", extensions: [ ".as" ] }, + { name: "bash", extensions: [ ".sh", ".zsh" ] }, + { name: "csharp", extensions: [ ".cs" ] }, + { name: "c", extensions: [ ".c", ".h" ] }, + { name: "cpp", extensions: [ ".cpp", ".hpp" ] }, + { name: "cmake", extensions: [ "cmake.in" ] }, + { name: "css", extensions: [ ".css" ] }, + { name: "d", extensions: [ ".d" ] }, + { name: "dos", extensions: [ ".bat", ".cmd" ] }, + { name: "dockerfile", extensions: [ "dockerfile", "Dockerfile" ] }, + { name: "go", extensions: [ ".go" ] }, + { name: "gradle", extensions: [ ".gradle" ] }, + { name: "xml", extensions: [ ".xml", ".html", ".xhtml", ".rss", ".atom", ".xjb", ".xsd", ".xsl", ".plist", ".svg" ] }, + { name: "haskell", extensions: [ ".hs" ] }, + { name: "ini", extensions: [ ".ini", ".toml" ] }, + { name: "json", extensions: [ ".json" ] }, + { name: "java", extensions: [ ".java", ".jsp" ] }, + { name: "javascript", extensions: [ ".js", ".jsx" ] }, + { name: "kotlin", extensions: [ ".kt" ] }, + { name: "lua", extensions: [ ".lua" ] }, + { name: "makefile", extensions: [ "makefile", "Makefile" ] }, + { name: "markdown", extensions: [ ".md" ] }, + { name: "objectivec", extensions: [ ".m", ".mm", ".M" ] }, + { name: "php", extensions: [ ".php" ] }, + { name: "perl", extensions: [ ".pl", ".pm" ] }, + { name: "plaintext", extensions: [ ".txt" ] }, + { name: "pgsql", extensions: [ ".pgsql" ] }, + { name: "powershell", extensions: [ ".ps", ".ps1" ] }, + { name: "python", extensions: [ ".py" ] }, + { name: "ruby", extensions: [ ".rb" ] }, + { name: "rust", extensions: [ ".rs" ] }, + { name: "scss", extensions: [ ".scss" ] }, + { name: "sql", extensions: [ ".sql" ] }, + { name: "swift", extensions: [ ".swift" ] }, + { name: "typescript", extensions: [ ".ts" ] }, + { name: "vbnet", extensions: [ ".vb" ] }, + { name: "vba", extensions: [ ".vba" ] }, + { name: "vbscript", extensions: [ ".vbs" ] }, + { name: "vim", extensions: [ ".vim" ] }, + { name: "yml", extensions: [ ".yml" ] } +]; + +export default languages; diff --git a/packages/client/src/views/Home.vue b/packages/client/src/views/Home.vue new file mode 100644 index 0000000..80f2e9a --- /dev/null +++ b/packages/client/src/views/Home.vue @@ -0,0 +1,79 @@ + + + + + diff --git a/packages/client/src/views/Repository.vue b/packages/client/src/views/Repository.vue new file mode 100644 index 0000000..93c3f82 --- /dev/null +++ b/packages/client/src/views/Repository.vue @@ -0,0 +1,27 @@ + + + + + diff --git a/packages/client/src/views/RepositoryCommit.vue b/packages/client/src/views/RepositoryCommit.vue new file mode 100644 index 0000000..6bbbcaa --- /dev/null +++ b/packages/client/src/views/RepositoryCommit.vue @@ -0,0 +1,202 @@ + + + + + diff --git a/packages/client/src/views/RepositoryLog.vue b/packages/client/src/views/RepositoryLog.vue new file mode 100644 index 0000000..542831f --- /dev/null +++ b/packages/client/src/views/RepositoryLog.vue @@ -0,0 +1,111 @@ + + + + + diff --git a/packages/client/src/views/RepositoryTree.vue b/packages/client/src/views/RepositoryTree.vue new file mode 100644 index 0000000..1b61c42 --- /dev/null +++ b/packages/client/src/views/RepositoryTree.vue @@ -0,0 +1,106 @@ + + + + + -- cgit v1.2.3-18-g5258