From aeb9720f682b2aaf7a4dee444b552b93fe9ac04d Mon Sep 17 00:00:00 2001 From: Younes Barrad Date: Fri, 2 Feb 2024 00:02:42 +0100 Subject: [PATCH] feat: get props from components --- .eslintignore | 3 - .eslintrc | 4 - .vscode/settings.json | 43 + README.md | 2 - client/components/CodeContainer.vue | 18 +- client/components/CommandPalette.vue | 6 +- client/components/EmailPreview.vue | 16 +- client/components/EmptyState.vue | 8 +- client/components/SendEmail.vue | 8 +- client/components/Settings.vue | 30 +- client/components/TopNav.vue | 8 +- client/composables/shiki.ts | 3 +- client/composables/useEmail.ts | 25 +- client/composables/useTool.ts | 6 +- client/emails/code-components.vue | 1 - client/emails/github-access-token.vue | 28 +- client/emails/koala-welcome.vue | 18 +- client/emails/stripe-welcome.vue | 40 +- client/emails/twitch-reset-password.vue | 20 +- client/emails/vercel-invite-user.vue | 11 +- client/emails/yelp-recent-login.vue | 16 +- client/package.json | 3 +- client/server/api/emails.get.ts | 89 +- client/server/api/render/[file].get.ts | 3 +- client/tsconfig.json | 2 +- client/types/email.ts | 3 + client/util/copy-text-to-clipboard.ts | 3 +- eslint.config.js | 7 + package.json | 16 +- playground/app.vue | 6 +- playground/nuxt-layer/.eslintrc.cjs | 4 +- .../nuxt-layer/.playground/app.config.ts | 4 +- .../nuxt-layer/.playground/nuxt.config.ts | 2 +- playground/nuxt-layer/app.config.ts | 4 +- playground/nuxt-layer/emails/TestEmail.vue | 32 +- playground/nuxt-layer/nuxt.config.ts | 2 +- playground/nuxt.config.ts | 22 +- playground/package.json | 2 +- playground/server/api/test.get.ts | 22 +- playground/tailwind.config.js | 6 +- pnpm-lock.yaml | 1031 ++++++++++++++++- src/module.ts | 238 ++-- src/runtime/server/api/emails.get.ts | 3 +- src/runtime/server/api/render/[file].get.ts | 3 +- src/runtime/server/nitro/useCompiler.ts | 56 +- tsconfig.json | 8 +- 46 files changed, 1517 insertions(+), 368 deletions(-) delete mode 100644 .eslintignore delete mode 100644 .eslintrc create mode 100644 .vscode/settings.json create mode 100644 eslint.config.js diff --git a/.eslintignore b/.eslintignore deleted file mode 100644 index a786b23..0000000 --- a/.eslintignore +++ /dev/null @@ -1,3 +0,0 @@ -dist -node_modules -client diff --git a/.eslintrc b/.eslintrc deleted file mode 100644 index 9e17846..0000000 --- a/.eslintrc +++ /dev/null @@ -1,4 +0,0 @@ -{ - "root": true, - "extends": ["@nuxt/eslint-config"] -} diff --git a/.vscode/settings.json b/.vscode/settings.json new file mode 100644 index 0000000..eae23ff --- /dev/null +++ b/.vscode/settings.json @@ -0,0 +1,43 @@ +{ + // Enable the ESlint flat config support + "eslint.experimental.useFlatConfig": true, + + // Disable the default formatter, use eslint instead + "prettier.enable": false, + "editor.formatOnSave": false, + + // Auto fix + "editor.codeActionsOnSave": { + "source.fixAll.eslint": "explicit", + "source.organizeImports": "never" + }, + + // Silent the stylistic rules in you IDE, but still auto fix them + "eslint.rules.customizations": [ + { "rule": "style/*", "severity": "off" }, + { "rule": "format/*", "severity": "off" }, + { "rule": "*-indent", "severity": "off" }, + { "rule": "*-spacing", "severity": "off" }, + { "rule": "*-spaces", "severity": "off" }, + { "rule": "*-order", "severity": "off" }, + { "rule": "*-dangle", "severity": "off" }, + { "rule": "*-newline", "severity": "off" }, + { "rule": "*quotes", "severity": "off" }, + { "rule": "*semi", "severity": "off" } + ], + + // Enable eslint for all supported languages + "eslint.validate": [ + "javascript", + "javascriptreact", + "typescript", + "typescriptreact", + "vue", + "html", + "markdown", + "json", + "jsonc", + "yaml", + "toml" + ] +} diff --git a/README.md b/README.md index 46b9629..8ef4db4 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,5 @@ [![vue-email](https://github.com/vue-email/vue-email/blob/main/public/repo-banner.png?raw=true)](https://vuemail.net) -
[![npm version][npm-version-src]][npm-version-href] @@ -90,7 +89,6 @@ npm run release [MIT](./LICENSE) License © 2023-PRESENT [Vue Email](https://vuemail.net/) - [npm-version-src]: https://img.shields.io/npm/v/@vue-email/nuxt/latest.svg?style=flat&colorA=18181B&colorB=28CF8D [npm-version-href]: https://npmjs.com/package/@vue-email/nuxt diff --git a/client/components/CodeContainer.vue b/client/components/CodeContainer.vue index cf8145f..1eeafdb 100644 --- a/client/components/CodeContainer.vue +++ b/client/components/CodeContainer.vue @@ -59,21 +59,24 @@ const items = computed(() => { code: template.value.txt, }, ] - } else if (editorCode.value.id === 'html') { + } + else if (editorCode.value.id === 'html') { arr.push({ key: 'html', label: 'HTML', icon: 'i-ph-file-html-duotone', code: template.value.html, }) - } else if (editorCode.value.id === 'txt') { + } + else if (editorCode.value.id === 'txt') { arr.push({ key: 'txt', label: 'Plain Text', icon: 'i-ph-text-t-duotone', code: template.value.txt, }) - } else if (editorCode.value.id === 'vue') { + } + else if (editorCode.value.id === 'vue') { arr.push({ key: 'vue', label: 'Vue', @@ -89,9 +92,12 @@ const tab = ref(0)