diff --git a/.eslintrc.cjs b/.eslintrc.cjs index dd7bbce3d..694c95a2a 100644 --- a/.eslintrc.cjs +++ b/.eslintrc.cjs @@ -6,21 +6,21 @@ module.exports = { overrides: [ { files: ['./**/*.vue'], - extends: '@myparcel-eslint/eslint-config-prettier-typescript-vue', + extends: ['@myparcel-eslint/eslint-config-prettier-typescript-vue', '@myparcel-eslint/eslint-config-import'], rules: { '@typescript-eslint/no-misused-promises': 'off', 'vue/no-bare-strings-in-template': 'off', 'vue/no-undef-components': [ 'error', { - ignorePatterns: ['NavbarSearch'], + ignorePatterns: ['Content', 'ExternalLinkIcon', 'Layout', 'NavbarSearch', 'RouterLink', 'RouterView'], }, ], }, }, { files: ['./**/*.ts', './**/*.tsx'], - extends: '@myparcel-eslint/eslint-config-prettier-typescript', + extends: ['@myparcel-eslint/eslint-config-prettier-typescript', '@myparcel-eslint/eslint-config-import'], rules: { '@typescript-eslint/explicit-function-return-type': 'off', '@typescript-eslint/no-misused-promises': 'off', @@ -36,6 +36,7 @@ module.exports = { '@myparcel-eslint/eslint-config-node', '@myparcel-eslint/eslint-config-esnext', '@myparcel-eslint/eslint-config-prettier', + '@myparcel-eslint/eslint-config-import', ], }, { diff --git a/package.json b/package.json index e95767966..536670961 100755 --- a/package.json +++ b/package.json @@ -7,6 +7,7 @@ "bugs": { "url": "https://github.com/myparcelnl/developer/issues" }, + "type": "module", "repository": "github:myparcelnl/developer", "license": "MIT", "author": "Edie Lemoine ", @@ -16,13 +17,11 @@ "postinstall": "yarn translations:init && (is-ci || husky install)", "optimize:svg": "svgo -r --multipass --final-newline --folder src/.vuepress/public", "preview": "http-server src/.vuepress/dist -s --port 9599", - "test": "concurrently yarn:test:node yarn:test:vue yarn:test:links", - "test:dev:node": "vitest --config vitest-node.config.ts", - "test:dev:vue": "vitest --config vitest-vue.config.ts", + "test": "concurrently test:vitest:run yarn:test:links", + "test:vitest": "vitest", + "test:vitest:run": "vitest run", "test:links": "WAIT_ON_TIMEOUT=30000 start-server-and-test preview http://127.0.0.1:9599 test:links:run", "test:links:run": "hyperlink -ir --root src/.vuepress/dist http://127.0.0.1:9599", - "test:node": "vitest run --config vitest-node.config.ts", - "test:vue": "vitest run --config vitest-vue.config.ts", "translations:import": "echo 'Importing translations...' && google-docs-importer -d 1q_las2AW8vZqhyiymXnPtrCsNQsye9W0Aqi3aWymjuU -o src/.vuepress/public/translations && echo 'Done!'", "translations:init": "test -f src/.vuepress/public/translations/en.json || yarn translations:import", "watch": "nodemon --ext ts,vue,md --watch src --exec 'vuepress build src --debug'" @@ -36,60 +35,65 @@ }, "prettier": "@myparcel/prettier-config", "resolutions": { - "vite": "^2" + "vite": "^4.0.0" }, "dependencies": { "@vue/runtime-core": "^3.2.37", - "@vuepress/plugin-docsearch": "2.0.0-beta.49", - "@vuepress/plugin-google-analytics": "^2.0.0-beta.49", - "@vuepress/plugin-register-components": "2.0.0-beta.49", - "@vueuse/core": "^8.9.4", + "@vuepress/plugin-docsearch": "2.0.0-beta.67", + "@vuepress/plugin-google-analytics": "2.0.0-beta.67", + "@vuepress/plugin-register-components": "2.0.0-beta.67", + "@vueuse/core": "^10.5.0", "lodash": "^4.17.21", "lodash-es": "^4.17.21", "tailwindcss": "^3.1.6", "vue-recaptcha": "^2.0.2", - "vuepress": "2.0.0-beta.49" + "vuepress": "2.0.0-beta.67" }, "devDependencies": { "@edielemoine/google-docs-importer": "^1.0.2", "@myparcel-eslint/eslint-config-esnext": "^1.2.3", + "@myparcel-eslint/eslint-config-import": "^1.2.1", "@myparcel-eslint/eslint-config-node": "^1.2.3", "@myparcel-eslint/eslint-config-prettier": "^1.2.3", "@myparcel-eslint/eslint-config-prettier-typescript": "^1.2.4", "@myparcel-eslint/eslint-config-prettier-typescript-vue": "^1.2.6", "@myparcel/sdk": "^2.10.1", - "@tsconfig/node16": "^1.0.3", + "@tsconfig/node18": "^18.2.2", "@types/flat": "^5.0.2", "@types/lodash-es": "^4.17.6", "@types/mock-fs": "^4.13.1", - "@vitejs/plugin-vue": "^2.3.3", + "@vitejs/plugin-vue": "^4.4.0", "@vue/test-utils": "^2.0.2", "autoprefixer": "^10.4.8", - "concurrently": "^7.3.0", - "cssnano": "^5.1.12", - "dayjs": "^1.11.4", + "concurrently": "^8.2.1", + "cssnano": "^6.0.1", + "dayjs": "^2.0.0-alpha.4", "eslint": "^8.40.0", - "flat": "^5.0.2", + "flat": "^6.0.1", "gray-matter": ">= 4.0", - "happy-dom": "^6.0.4", + "happy-dom": "^12.6.0", "http-server": "^14.1.1", "husky": "^8.0.3", "hyperlink": "^5.0.4", "is-ci": "^3.0.1", - "lint-staged": "^13.1.2", + "lint-staged": "^14.0.1", "lodash-unified": "^1.0.2", "markdown-it-multimd-table": "^4.1.3", "mock-fs": "^5.1.2", "only-allow": "^1.1.1", - "plop": "^3.1.1", + "plop": "^4.0.0", + "postcss-import": "^15.1.0", "prettier": "^2.8.8", "rollup-plugin-visualizer": "^5.7.1", - "start-server-and-test": "^1.14.0", - "svgo": "^2.8.0", + "start-server-and-test": "^2.0.1", + "svgo": "^3.0.2", "ts-node": "^10.9.1", - "typescript": "^4.7.4", - "vite-svg-loader": "3.4.0", - "vitest": "^0.18.1" + "typescript": "^5.2.2", + "vite-svg-loader": "^4.0.0", + "vitest": "^0.34.6" }, - "packageManager": "yarn@3.2.2" + "packageManager": "yarn@3.2.2", + "volta": { + "node": "18.18.0" + } } diff --git a/postcss.config.js b/postcss.config.js new file mode 100644 index 000000000..0c51a6bb6 --- /dev/null +++ b/postcss.config.js @@ -0,0 +1,8 @@ +export default { + plugins: { + 'postcss-import': {}, + tailwindcss: {}, + autoprefixer: {}, + cssnano: {}, + }, +}; diff --git a/private/importTranslations.mjs b/private/importTranslations.mjs index 68d80316e..b3b40a1a1 100644 --- a/private/importTranslations.mjs +++ b/private/importTranslations.mjs @@ -1,6 +1,5 @@ import {fileURLToPath} from 'url'; -import fs from 'node:fs'; -import path from 'node:path'; +import {fs, path} from '@vuepress/utils'; // eslint-disable-next-line no-underscore-dangle const __dirname = fileURLToPath(path.dirname(import.meta.url)); diff --git a/src/.vuepress/config.ts b/src/.vuepress/config.ts index b48ffb866..fcbac78e5 100755 --- a/src/.vuepress/config.ts +++ b/src/.vuepress/config.ts @@ -1,14 +1,14 @@ -import {DIR_CONFIG, DIR_VUEPRESS} from './dirs'; import {defineUserConfig, viteBundler} from 'vuepress'; +import {path} from '@vuepress/utils'; import {docsearchPlugin} from '@vuepress/plugin-docsearch'; -import {googleTagManagerPlugin} from './plugins/gtm/node'; -import {head} from './config/head'; -import {myParcelTheme} from './theme'; -import {parseTranslationsPlugin} from './plugins/parseTranslations'; -import path from 'path'; -import {sitemapPlugin} from './plugins/sitemap'; import {slugify} from '@mdit-vue/shared'; import {viteConfig} from './viteConfig'; +import {myParcelTheme} from './theme'; +import {sitemapPlugin} from './plugins/sitemap'; +import {parseTranslationsPlugin} from './plugins/parseTranslations'; +import {googleTagManagerPlugin} from './plugins/gtm/node'; +import {DIR_CONFIG, DIR_VUEPRESS} from './dirs'; +import {head} from './config/head'; const DEV_SERVER_PORT = 8955; diff --git a/src/.vuepress/dirs.ts b/src/.vuepress/dirs.ts index c888c41bf..bf8f8413a 100644 --- a/src/.vuepress/dirs.ts +++ b/src/.vuepress/dirs.ts @@ -1,6 +1,6 @@ // noinspection UnnecessaryLocalVariableJS -import path from 'path'; +import {path} from '@vuepress/utils'; export const DIR_VUEPRESS = __dirname; diff --git a/src/.vuepress/plugins/sitemap.ts b/src/.vuepress/plugins/sitemap.ts index 1a98f4917..f39c07444 100644 --- a/src/.vuepress/plugins/sitemap.ts +++ b/src/.vuepress/plugins/sitemap.ts @@ -1,10 +1,8 @@ -import {GitPluginPageData} from '@vuepress/plugin-git'; -import {Plugin} from 'vuepress'; +import {type Plugin} from 'vuepress'; import dayjs from 'dayjs'; -import fs from 'fs'; +import {fs, logger, path} from '@vuepress/utils'; +import {type GitPluginPageData} from '@vuepress/plugin-git'; import {isOfType} from '../theme/shared/utils'; -import {logger} from '@vuepress/utils'; -import path from 'path'; interface SitemapPluginConfig { baseUrl: string; diff --git a/src/.vuepress/theme/client/clientConfig.ts b/src/.vuepress/theme/client/clientConfig.ts index 1bc92e539..13c993ef7 100644 --- a/src/.vuepress/theme/client/clientConfig.ts +++ b/src/.vuepress/theme/client/clientConfig.ts @@ -1,10 +1,17 @@ import './styles/index.scss'; -import {defineClientConfig} from '@vuepress/client'; import {h} from 'vue'; -import {setupSidebarItems} from '@mptheme/client/composables'; +import {defineClientConfig} from '@vuepress/client'; import {vTest} from '@mptheme/client/services/directives/vTest'; +import {setupSidebarItems} from '@mptheme/client/composables'; +import NotFound from './views/not-found/NotFoundPage.vue'; +import Layout from './views/layout/layout/Layout.vue'; export default defineClientConfig({ + layouts: { + Layout, + NotFound, + }, + enhance(context) { const {app, router} = context; diff --git a/src/.vuepress/theme/client/components/common/index.ts b/src/.vuepress/theme/client/components/common/index.ts new file mode 100644 index 000000000..2f132eb85 --- /dev/null +++ b/src/.vuepress/theme/client/components/common/index.ts @@ -0,0 +1,11 @@ +export {default as Icon} from './icon/Icon.vue'; + +export {default as LinkTree} from './LinkTree.vue'; + +export {default as MPButtonGroup} from './MPButtonGroup.vue'; + +export {default as MPButton} from './button/MPButton.vue'; + +export {default as ReCaptcha} from './ReCaptcha.vue'; + +export {default as ToggleChevron} from './ToggleChevron.vue'; diff --git a/src/.vuepress/theme/client/components/global/AutoLink.vue b/src/.vuepress/theme/client/components/global/AutoLink.vue index a571606d5..7dbed5d43 100644 --- a/src/.vuepress/theme/client/components/global/AutoLink.vue +++ b/src/.vuepress/theme/client/components/global/AutoLink.vue @@ -27,13 +27,14 @@ diff --git a/src/.vuepress/theme/client/components/logo/index.ts b/src/.vuepress/theme/client/components/logo/index.ts new file mode 100644 index 000000000..b15f9445f --- /dev/null +++ b/src/.vuepress/theme/client/components/logo/index.ts @@ -0,0 +1 @@ +export {default as MPLogo} from './MPLogo.vue'; diff --git a/src/.vuepress/theme/client/components/navbar-dropdown/index.ts b/src/.vuepress/theme/client/components/navbar-dropdown/index.ts new file mode 100644 index 000000000..e1367ced1 --- /dev/null +++ b/src/.vuepress/theme/client/components/navbar-dropdown/index.ts @@ -0,0 +1 @@ +export {default as NavbarDropdown} from './NavbarDropdown.vue'; diff --git a/src/.vuepress/theme/client/components/redirect-content/index.ts b/src/.vuepress/theme/client/components/redirect-content/index.ts new file mode 100644 index 000000000..fd3f04288 --- /dev/null +++ b/src/.vuepress/theme/client/components/redirect-content/index.ts @@ -0,0 +1 @@ +export {default as RedirectContent} from './RedirectContent.vue'; diff --git a/src/.vuepress/theme/client/components/sidebar-item/SidebarItem.vue b/src/.vuepress/theme/client/components/sidebar-item/SidebarItem.vue index aac92efdc..64396ba3f 100644 --- a/src/.vuepress/theme/client/components/sidebar-item/SidebarItem.vue +++ b/src/.vuepress/theme/client/components/sidebar-item/SidebarItem.vue @@ -46,14 +46,14 @@ diff --git a/src/.vuepress/theme/client/views/not-found/NotFoundPage.vue b/src/.vuepress/theme/client/views/not-found/NotFoundPage.vue new file mode 100644 index 000000000..65232fa32 --- /dev/null +++ b/src/.vuepress/theme/client/views/not-found/NotFoundPage.vue @@ -0,0 +1,35 @@ + + + diff --git a/src/.vuepress/theme/client/views/page/Page.vue b/src/.vuepress/theme/client/views/page/Page.vue index f5f71a2a3..fba2683b7 100644 --- a/src/.vuepress/theme/client/views/page/Page.vue +++ b/src/.vuepress/theme/client/views/page/Page.vue @@ -10,10 +10,6 @@ class="page pb-12 pt-4">

- -

@@ -30,15 +26,15 @@