From c223f2f7aff687f501f5b97d610072dbc77e8404 Mon Sep 17 00:00:00 2001 From: Lightling Date: Thu, 2 May 2024 17:41:51 -0400 Subject: [PATCH] convert frontend to workspace --- .gitignore | 2 +- package-lock.json | 60 +++++++++++-------- package.json | 35 ++--------- index.html => projects/frontend/index.html | 0 projects/frontend/package.json | 36 +++++++++++ .../components/inflators/descriptionList.ts | 0 .../src}/components/inflators/details.ts | 0 .../src}/components/inflators/embed.ts | 0 .../src}/components/inflators/image.ts | 0 .../src}/components/inflators/video.ts | 0 .../components/shared/embedable-content.vue | 0 .../src}/components/shared/header-link.vue | 0 .../src}/components/shared/theme-picker.vue | 0 .../src}/components/shared/warning-prompt.vue | 0 .../frontend/src}/content-env.d.ts | 0 {src => projects/frontend/src}/main.sass | 0 {src => projects/frontend/src}/main.ts | 0 {src => projects/frontend/src}/main.vue | 0 {src => projects/frontend/src}/routes.ts | 0 .../frontend/src}/styles/embed.sass | 0 .../frontend/src}/styles/mixins.scss | 0 .../frontend/src}/styles/tag.sass | 0 .../frontend/src}/types/shared/dateRange.ts | 0 .../frontend/src}/types/shared/link.ts | 0 .../frontend/src}/utilities/dom.ts | 0 .../frontend/src}/utilities/fetch.ts | 0 .../frontend/src}/utilities/marked.ts | 0 .../frontend/src}/utilities/vuetils.ts | 0 .../src}/views/gallery/gallery-list.vue | 0 .../src}/views/gallery/gallery-tile.vue | 0 .../src}/views/gallery/gallery-utilities.ts | 0 .../src}/views/gallery/gallery-view.vue | 0 .../frontend/src}/views/gallery/gallery.d.ts | 0 .../frontend/src}/views/markdown/markdown.vue | 0 .../src}/views/project/project-list.vue | 0 .../src}/views/project/project-tile.vue | 0 .../src}/views/project/project-view.vue | 0 .../frontend/src}/views/project/project.d.ts | 0 {src => projects/frontend/src}/vite-env.d.ts | 0 projects/frontend/tsconfig.json | 31 ++++++++++ .../frontend/vite.config.ts | 2 +- tsconfig.json | 6 -- 42 files changed, 108 insertions(+), 64 deletions(-) rename index.html => projects/frontend/index.html (100%) create mode 100644 projects/frontend/package.json rename {src => projects/frontend/src}/components/inflators/descriptionList.ts (100%) rename {src => projects/frontend/src}/components/inflators/details.ts (100%) rename {src => projects/frontend/src}/components/inflators/embed.ts (100%) rename {src => projects/frontend/src}/components/inflators/image.ts (100%) rename {src => projects/frontend/src}/components/inflators/video.ts (100%) rename {src => projects/frontend/src}/components/shared/embedable-content.vue (100%) rename {src => projects/frontend/src}/components/shared/header-link.vue (100%) rename {src => projects/frontend/src}/components/shared/theme-picker.vue (100%) rename {src => projects/frontend/src}/components/shared/warning-prompt.vue (100%) rename {src => projects/frontend/src}/content-env.d.ts (100%) rename {src => projects/frontend/src}/main.sass (100%) rename {src => projects/frontend/src}/main.ts (100%) rename {src => projects/frontend/src}/main.vue (100%) rename {src => projects/frontend/src}/routes.ts (100%) rename {src => projects/frontend/src}/styles/embed.sass (100%) rename {src => projects/frontend/src}/styles/mixins.scss (100%) rename {src => projects/frontend/src}/styles/tag.sass (100%) rename {src => projects/frontend/src}/types/shared/dateRange.ts (100%) rename {src => projects/frontend/src}/types/shared/link.ts (100%) rename {src => projects/frontend/src}/utilities/dom.ts (100%) rename {src => projects/frontend/src}/utilities/fetch.ts (100%) rename {src => projects/frontend/src}/utilities/marked.ts (100%) rename {src => projects/frontend/src}/utilities/vuetils.ts (100%) rename {src => projects/frontend/src}/views/gallery/gallery-list.vue (100%) rename {src => projects/frontend/src}/views/gallery/gallery-tile.vue (100%) rename {src => projects/frontend/src}/views/gallery/gallery-utilities.ts (100%) rename {src => projects/frontend/src}/views/gallery/gallery-view.vue (100%) rename {src => projects/frontend/src}/views/gallery/gallery.d.ts (100%) rename {src => projects/frontend/src}/views/markdown/markdown.vue (100%) rename {src => projects/frontend/src}/views/project/project-list.vue (100%) rename {src => projects/frontend/src}/views/project/project-tile.vue (100%) rename {src => projects/frontend/src}/views/project/project-view.vue (100%) rename {src => projects/frontend/src}/views/project/project.d.ts (100%) rename {src => projects/frontend/src}/vite-env.d.ts (100%) create mode 100644 projects/frontend/tsconfig.json rename vite.config.ts => projects/frontend/vite.config.ts (91%) diff --git a/.gitignore b/.gitignore index 99e8630..d061917 100644 --- a/.gitignore +++ b/.gitignore @@ -12,7 +12,7 @@ dist dist-ssr *.local .vite-ssg-temp -/content +projects/frontend/content # Editor directories and files .vscode/* diff --git a/package-lock.json b/package-lock.json index 5f1cea8..3045fd0 100644 --- a/package-lock.json +++ b/package-lock.json @@ -7,31 +7,9 @@ "": { "name": "static-web-templates", "version": "0.0.0", - "devDependencies": { - "@types/dompurify": "3.0.5", - "@types/js-yaml": "4.0.9", - "@types/node": "18.16.x", - "@unhead/vue": "1.8.12", - "@vitejs/plugin-vue": "5.0.4", - "dompurify": "3.0.9", - "github-slugger": "2.0.0", - "highlight.js": "11.9.0", - "js-yaml": "4.1.0", - "marked": "12.0.1", - "marked-highlight": "2.1.1", - "normalize.css": "8.0.1", - "pinia": "2.1.7", - "pug": "3.0.2", - "rfdc": "1.3.1", - "sass": "1.71.1", - "typescript": "5.4.2", - "vite": "5.1.4", - "vite-ssg": "0.23.6", - "vue": "3.4.19", - "vue-router": "4.3.0", - "vue-tippy": "6.4.1", - "vue-tsc": "1.8.27" - } + "workspaces": [ + "projects/frontend" + ] }, "node_modules/@asamuzakjp/dom-selector": { "version": "2.0.2", @@ -2602,6 +2580,10 @@ "node": ">=0.10.0" } }, + "node_modules/static-web-templates": { + "resolved": "projects/frontend", + "link": true + }, "node_modules/string-width": { "version": "4.2.3", "resolved": "https://registry.npmjs.org/string-width/-/string-width-4.2.3.tgz", @@ -3170,6 +3152,34 @@ "funding": { "url": "https://github.com/sponsors/harlan-zw" } + }, + "projects/frontend": { + "version": "0.0.0", + "devDependencies": { + "@types/dompurify": "3.0.5", + "@types/js-yaml": "4.0.9", + "@types/node": "18.16.x", + "@unhead/vue": "1.8.12", + "@vitejs/plugin-vue": "5.0.4", + "dompurify": "3.0.9", + "github-slugger": "2.0.0", + "highlight.js": "11.9.0", + "js-yaml": "4.1.0", + "marked": "12.0.1", + "marked-highlight": "2.1.1", + "normalize.css": "8.0.1", + "pinia": "2.1.7", + "pug": "3.0.2", + "rfdc": "1.3.1", + "sass": "1.71.1", + "typescript": "5.4.2", + "vite": "5.1.4", + "vite-ssg": "0.23.6", + "vue": "3.4.19", + "vue-router": "4.3.0", + "vue-tippy": "6.4.1", + "vue-tsc": "1.8.27" + } } } } diff --git a/package.json b/package.json index bfca6f8..364373d 100644 --- a/package.json +++ b/package.json @@ -3,34 +3,7 @@ "private": true, "version": "0.0.0", "type": "module", - "scripts": { - "start": "vite", - "build": "vue-tsc && vite-ssg build", - "preview": "vite preview" - }, - "devDependencies": { - "@types/dompurify": "3.0.5", - "@types/js-yaml": "4.0.9", - "@types/node": "18.16.x", - "@unhead/vue": "1.8.12", - "@vitejs/plugin-vue": "5.0.4", - "dompurify": "3.0.9", - "github-slugger": "2.0.0", - "highlight.js": "11.9.0", - "js-yaml": "4.1.0", - "marked": "12.0.1", - "marked-highlight": "2.1.1", - "normalize.css": "8.0.1", - "pinia": "2.1.7", - "pug": "3.0.2", - "rfdc": "1.3.1", - "sass": "1.71.1", - "typescript": "5.4.2", - "vite": "5.1.4", - "vite-ssg": "0.23.6", - "vue": "3.4.19", - "vue-router": "4.3.0", - "vue-tippy": "6.4.1", - "vue-tsc": "1.8.27" - } -} + "workspaces": [ + "projects/frontend" + ] +} \ No newline at end of file diff --git a/index.html b/projects/frontend/index.html similarity index 100% rename from index.html rename to projects/frontend/index.html diff --git a/projects/frontend/package.json b/projects/frontend/package.json new file mode 100644 index 0000000..bfca6f8 --- /dev/null +++ b/projects/frontend/package.json @@ -0,0 +1,36 @@ +{ + "name": "static-web-templates", + "private": true, + "version": "0.0.0", + "type": "module", + "scripts": { + "start": "vite", + "build": "vue-tsc && vite-ssg build", + "preview": "vite preview" + }, + "devDependencies": { + "@types/dompurify": "3.0.5", + "@types/js-yaml": "4.0.9", + "@types/node": "18.16.x", + "@unhead/vue": "1.8.12", + "@vitejs/plugin-vue": "5.0.4", + "dompurify": "3.0.9", + "github-slugger": "2.0.0", + "highlight.js": "11.9.0", + "js-yaml": "4.1.0", + "marked": "12.0.1", + "marked-highlight": "2.1.1", + "normalize.css": "8.0.1", + "pinia": "2.1.7", + "pug": "3.0.2", + "rfdc": "1.3.1", + "sass": "1.71.1", + "typescript": "5.4.2", + "vite": "5.1.4", + "vite-ssg": "0.23.6", + "vue": "3.4.19", + "vue-router": "4.3.0", + "vue-tippy": "6.4.1", + "vue-tsc": "1.8.27" + } +} diff --git a/src/components/inflators/descriptionList.ts b/projects/frontend/src/components/inflators/descriptionList.ts similarity index 100% rename from src/components/inflators/descriptionList.ts rename to projects/frontend/src/components/inflators/descriptionList.ts diff --git a/src/components/inflators/details.ts b/projects/frontend/src/components/inflators/details.ts similarity index 100% rename from src/components/inflators/details.ts rename to projects/frontend/src/components/inflators/details.ts diff --git a/src/components/inflators/embed.ts b/projects/frontend/src/components/inflators/embed.ts similarity index 100% rename from src/components/inflators/embed.ts rename to projects/frontend/src/components/inflators/embed.ts diff --git a/src/components/inflators/image.ts b/projects/frontend/src/components/inflators/image.ts similarity index 100% rename from src/components/inflators/image.ts rename to projects/frontend/src/components/inflators/image.ts diff --git a/src/components/inflators/video.ts b/projects/frontend/src/components/inflators/video.ts similarity index 100% rename from src/components/inflators/video.ts rename to projects/frontend/src/components/inflators/video.ts diff --git a/src/components/shared/embedable-content.vue b/projects/frontend/src/components/shared/embedable-content.vue similarity index 100% rename from src/components/shared/embedable-content.vue rename to projects/frontend/src/components/shared/embedable-content.vue diff --git a/src/components/shared/header-link.vue b/projects/frontend/src/components/shared/header-link.vue similarity index 100% rename from src/components/shared/header-link.vue rename to projects/frontend/src/components/shared/header-link.vue diff --git a/src/components/shared/theme-picker.vue b/projects/frontend/src/components/shared/theme-picker.vue similarity index 100% rename from src/components/shared/theme-picker.vue rename to projects/frontend/src/components/shared/theme-picker.vue diff --git a/src/components/shared/warning-prompt.vue b/projects/frontend/src/components/shared/warning-prompt.vue similarity index 100% rename from src/components/shared/warning-prompt.vue rename to projects/frontend/src/components/shared/warning-prompt.vue diff --git a/src/content-env.d.ts b/projects/frontend/src/content-env.d.ts similarity index 100% rename from src/content-env.d.ts rename to projects/frontend/src/content-env.d.ts diff --git a/src/main.sass b/projects/frontend/src/main.sass similarity index 100% rename from src/main.sass rename to projects/frontend/src/main.sass diff --git a/src/main.ts b/projects/frontend/src/main.ts similarity index 100% rename from src/main.ts rename to projects/frontend/src/main.ts diff --git a/src/main.vue b/projects/frontend/src/main.vue similarity index 100% rename from src/main.vue rename to projects/frontend/src/main.vue diff --git a/src/routes.ts b/projects/frontend/src/routes.ts similarity index 100% rename from src/routes.ts rename to projects/frontend/src/routes.ts diff --git a/src/styles/embed.sass b/projects/frontend/src/styles/embed.sass similarity index 100% rename from src/styles/embed.sass rename to projects/frontend/src/styles/embed.sass diff --git a/src/styles/mixins.scss b/projects/frontend/src/styles/mixins.scss similarity index 100% rename from src/styles/mixins.scss rename to projects/frontend/src/styles/mixins.scss diff --git a/src/styles/tag.sass b/projects/frontend/src/styles/tag.sass similarity index 100% rename from src/styles/tag.sass rename to projects/frontend/src/styles/tag.sass diff --git a/src/types/shared/dateRange.ts b/projects/frontend/src/types/shared/dateRange.ts similarity index 100% rename from src/types/shared/dateRange.ts rename to projects/frontend/src/types/shared/dateRange.ts diff --git a/src/types/shared/link.ts b/projects/frontend/src/types/shared/link.ts similarity index 100% rename from src/types/shared/link.ts rename to projects/frontend/src/types/shared/link.ts diff --git a/src/utilities/dom.ts b/projects/frontend/src/utilities/dom.ts similarity index 100% rename from src/utilities/dom.ts rename to projects/frontend/src/utilities/dom.ts diff --git a/src/utilities/fetch.ts b/projects/frontend/src/utilities/fetch.ts similarity index 100% rename from src/utilities/fetch.ts rename to projects/frontend/src/utilities/fetch.ts diff --git a/src/utilities/marked.ts b/projects/frontend/src/utilities/marked.ts similarity index 100% rename from src/utilities/marked.ts rename to projects/frontend/src/utilities/marked.ts diff --git a/src/utilities/vuetils.ts b/projects/frontend/src/utilities/vuetils.ts similarity index 100% rename from src/utilities/vuetils.ts rename to projects/frontend/src/utilities/vuetils.ts diff --git a/src/views/gallery/gallery-list.vue b/projects/frontend/src/views/gallery/gallery-list.vue similarity index 100% rename from src/views/gallery/gallery-list.vue rename to projects/frontend/src/views/gallery/gallery-list.vue diff --git a/src/views/gallery/gallery-tile.vue b/projects/frontend/src/views/gallery/gallery-tile.vue similarity index 100% rename from src/views/gallery/gallery-tile.vue rename to projects/frontend/src/views/gallery/gallery-tile.vue diff --git a/src/views/gallery/gallery-utilities.ts b/projects/frontend/src/views/gallery/gallery-utilities.ts similarity index 100% rename from src/views/gallery/gallery-utilities.ts rename to projects/frontend/src/views/gallery/gallery-utilities.ts diff --git a/src/views/gallery/gallery-view.vue b/projects/frontend/src/views/gallery/gallery-view.vue similarity index 100% rename from src/views/gallery/gallery-view.vue rename to projects/frontend/src/views/gallery/gallery-view.vue diff --git a/src/views/gallery/gallery.d.ts b/projects/frontend/src/views/gallery/gallery.d.ts similarity index 100% rename from src/views/gallery/gallery.d.ts rename to projects/frontend/src/views/gallery/gallery.d.ts diff --git a/src/views/markdown/markdown.vue b/projects/frontend/src/views/markdown/markdown.vue similarity index 100% rename from src/views/markdown/markdown.vue rename to projects/frontend/src/views/markdown/markdown.vue diff --git a/src/views/project/project-list.vue b/projects/frontend/src/views/project/project-list.vue similarity index 100% rename from src/views/project/project-list.vue rename to projects/frontend/src/views/project/project-list.vue diff --git a/src/views/project/project-tile.vue b/projects/frontend/src/views/project/project-tile.vue similarity index 100% rename from src/views/project/project-tile.vue rename to projects/frontend/src/views/project/project-tile.vue diff --git a/src/views/project/project-view.vue b/projects/frontend/src/views/project/project-view.vue similarity index 100% rename from src/views/project/project-view.vue rename to projects/frontend/src/views/project/project-view.vue diff --git a/src/views/project/project.d.ts b/projects/frontend/src/views/project/project.d.ts similarity index 100% rename from src/views/project/project.d.ts rename to projects/frontend/src/views/project/project.d.ts diff --git a/src/vite-env.d.ts b/projects/frontend/src/vite-env.d.ts similarity index 100% rename from src/vite-env.d.ts rename to projects/frontend/src/vite-env.d.ts diff --git a/projects/frontend/tsconfig.json b/projects/frontend/tsconfig.json new file mode 100644 index 0000000..423c9a8 --- /dev/null +++ b/projects/frontend/tsconfig.json @@ -0,0 +1,31 @@ +{ + "compilerOptions": { + "baseUrl": "./", + "paths": { + "content/*": ["./content/*"], + "src/*": ["./src/*"] + }, + + "target": "ES2020", + "useDefineForClassFields": true, + "module": "ESNext", + "lib": ["ES2020", "DOM", "DOM.Iterable"], + "skipLibCheck": true, + + /* Bundler mode */ + "moduleResolution": "bundler", + "allowImportingTsExtensions": true, + "resolveJsonModule": true, + "isolatedModules": true, + "noEmit": true, + "jsx": "preserve", + + /* Linting */ + "strict": true, + "noUnusedLocals": false, + "noUnusedParameters": false, + "noFallthroughCasesInSwitch": true + }, + "include": ["src/**/*.ts", "src/**/*.tsx", "src/**/*.vue"], + "references": [{ "path": "../../tsconfig.node.json" }] +} diff --git a/vite.config.ts b/projects/frontend/vite.config.ts similarity index 91% rename from vite.config.ts rename to projects/frontend/vite.config.ts index 0af36f8..3971b6b 100644 --- a/vite.config.ts +++ b/projects/frontend/vite.config.ts @@ -1,6 +1,6 @@ import { defineConfig } from 'vite' import vue from '@vitejs/plugin-vue' -import path from 'path' +import * as path from 'path' // https://vitejs.dev/config/ export default defineConfig({ diff --git a/tsconfig.json b/tsconfig.json index b25c3e9..ab6a876 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -1,11 +1,5 @@ { "compilerOptions": { - "baseUrl": "./", - "paths": { - "content/*": ["./content/*"], - "src/*": ["./src/*"] - }, - "target": "ES2020", "useDefineForClassFields": true, "module": "ESNext",