From b22173681cbe7f10123aaa2559e58adea6856e8e Mon Sep 17 00:00:00 2001 From: Corentin Thomasset Date: Sat, 26 Oct 2024 10:54:32 +0200 Subject: [PATCH] feat(app): tools management base --- packages/app/assets/css/tailwind.css | 10 +- packages/app/i18n.config.ts | 9 +- packages/app/nuxt.config.ts | 17 +- packages/app/package.json | 6 +- packages/app/public/humans.txt | 4 + packages/app/public/robots.txt | 1 - packages/app/src/locales/en.yaml | 31 + packages/app/src/locales/fr.yaml | 29 + .../src/modules/app/components/app-footer.vue | 29 +- .../src/modules/app/components/app-header.vue | 2 +- .../app/src/modules/app/pages/[...404].vue | 2 +- packages/app/src/modules/app/pages/index.vue | 45 +- .../composables/useRefreshableState.test.ts | 21 + .../shared/composables/useRefreshableState.ts | 12 + .../token-generator/token-generator.models.ts | 28 + .../token-generator/token-generator.tool.ts | 9 + .../token-generator/token-generator.vue | 36 + .../modules/tools/modules/tools.modules.ts | 21 + .../app/src/modules/tools/tools.models.ts | 18 + .../app/src/modules/tools/tools.registry.ts | 5 + packages/app/src/modules/tools/tools.store.ts | 36 + .../src/modules/ui/components/card/Card.vue | 21 + .../ui/components/card/CardContent.vue | 14 + .../ui/components/card/CardDescription.vue | 14 + .../modules/ui/components/card/CardFooter.vue | 14 + .../modules/ui/components/card/CardHeader.vue | 14 + .../modules/ui/components/card/CardTitle.vue | 18 + .../src/modules/ui/components/card/index.ts | 6 + pnpm-lock.yaml | 985 +++++++++++++++++- 29 files changed, 1392 insertions(+), 65 deletions(-) create mode 100644 packages/app/public/humans.txt delete mode 100644 packages/app/public/robots.txt create mode 100644 packages/app/src/locales/en.yaml create mode 100644 packages/app/src/locales/fr.yaml create mode 100644 packages/app/src/modules/shared/composables/useRefreshableState.test.ts create mode 100644 packages/app/src/modules/shared/composables/useRefreshableState.ts create mode 100644 packages/app/src/modules/tools/definitions/token-generator/token-generator.models.ts create mode 100644 packages/app/src/modules/tools/definitions/token-generator/token-generator.tool.ts create mode 100644 packages/app/src/modules/tools/definitions/token-generator/token-generator.vue create mode 100644 packages/app/src/modules/tools/modules/tools.modules.ts create mode 100644 packages/app/src/modules/tools/tools.models.ts create mode 100644 packages/app/src/modules/tools/tools.registry.ts create mode 100644 packages/app/src/modules/tools/tools.store.ts create mode 100644 packages/app/src/modules/ui/components/card/Card.vue create mode 100644 packages/app/src/modules/ui/components/card/CardContent.vue create mode 100644 packages/app/src/modules/ui/components/card/CardDescription.vue create mode 100644 packages/app/src/modules/ui/components/card/CardFooter.vue create mode 100644 packages/app/src/modules/ui/components/card/CardHeader.vue create mode 100644 packages/app/src/modules/ui/components/card/CardTitle.vue create mode 100644 packages/app/src/modules/ui/components/card/index.ts diff --git a/packages/app/assets/css/tailwind.css b/packages/app/assets/css/tailwind.css index 4d1d3860d..c4793ac9c 100644 --- a/packages/app/assets/css/tailwind.css +++ b/packages/app/assets/css/tailwind.css @@ -5,7 +5,7 @@ @layer base { :root { - --background: 0 0% 100%; + --background: 0 0% 98%; --foreground: 240 10% 3.9%; --card: 0 0% 100%; @@ -14,7 +14,7 @@ --popover: 0 0% 100%; --popover-foreground: 240 10% 3.9%; - --primary: 240 5.9% 10%; + --primary: 150 76% 38%; --primary-foreground: 0 0% 98%; --secondary: 240 4.8% 95.9%; @@ -36,10 +36,10 @@ } .dark { - --background:0 0% 9%; + --background:240 5% 6%; --foreground:0 0% 98%; - --card: 0 0% 7%; + --card: 240 5% 8%; --card-foreground:0 0% 98%; --popover:240 10% 3.9%; @@ -74,4 +74,4 @@ body { @apply bg-background text-foreground; } -} \ No newline at end of file +} \ No newline at end of file diff --git a/packages/app/i18n.config.ts b/packages/app/i18n.config.ts index bf4d6bd2a..635d3f5de 100644 --- a/packages/app/i18n.config.ts +++ b/packages/app/i18n.config.ts @@ -1,12 +1,5 @@ export default defineI18nConfig(() => ({ legacy: false, locale: 'en', - messages: { - en: { - welcome: 'Welcome', - }, - fr: { - welcome: 'Bienvenue', - }, - }, + fallbackLocale: 'en', })); diff --git a/packages/app/nuxt.config.ts b/packages/app/nuxt.config.ts index f6dbef93f..66df0547e 100644 --- a/packages/app/nuxt.config.ts +++ b/packages/app/nuxt.config.ts @@ -1,3 +1,5 @@ +import toolsModule from './src/modules/tools/modules/tools.modules'; + // https://nuxt.com/docs/api/configuration/nuxt-config export default defineNuxtConfig({ compatibilityDate: '2024-04-03', @@ -14,9 +16,18 @@ export default defineNuxtConfig({ '@nuxt/icon', '@vueuse/nuxt', '@nuxtjs/color-mode', + toolsModule, // Must be imported before i18n '@nuxtjs/i18n', + '@nuxtjs/seo', + '@pinia/nuxt', ], + site: { + url: 'https://it-tools.tech', + name: 'IT Tools', + description: 'The open-source collection of handy online tools to help developers in their daily life.', + }, + fonts: { provider: 'bunny', defaults: { @@ -35,7 +46,11 @@ export default defineNuxtConfig({ i18n: { strategy: 'prefix', vueI18n: './i18n.config.ts', - locales: ['en', 'fr'], defaultLocale: 'en', + langDir: './src/locales', + locales: [ + { code: 'en', file: 'en.yaml', name: 'English' }, + { code: 'fr', file: 'fr.yaml', name: 'Français' }, + ], }, }); diff --git a/packages/app/package.json b/packages/app/package.json index a8a437906..771e04c66 100644 --- a/packages/app/package.json +++ b/packages/app/package.json @@ -3,7 +3,6 @@ "type": "module", "private": true, "packageManager": "pnpm@9.12.2", - "scripts": { "dev": "nuxt dev", "build": "nuxt build", @@ -19,12 +18,16 @@ "typecheck": "tsc --noEmit" }, "dependencies": { + "@corentinth/chisels": "^1.1.0", "@nuxt/fonts": "^0.10.2", "@nuxt/icon": "^1.5.6", "@nuxtjs/color-mode": "^3.5.2", "@nuxtjs/i18n": "^8.5.5", + "@nuxtjs/seo": "2.0.0-rc.23", + "@pinia/nuxt": "^0.5.5", "class-variance-authority": "^0.7.0", "clsx": "^2.1.1", + "lodash-es": "^4.17.21", "lucide-vue-next": "^0.453.0", "nuxt": "^3.13.2", "radix-vue": "^1.9.7", @@ -37,6 +40,7 @@ "devDependencies": { "@antfu/eslint-config": "^3.8.0", "@nuxtjs/tailwindcss": "^6.12.2", + "@types/lodash-es": "^4.17.12", "@vueuse/core": "^11.1.0", "@vueuse/nuxt": "^11.1.0", "eslint": "^9.13.0", diff --git a/packages/app/public/humans.txt b/packages/app/public/humans.txt new file mode 100644 index 000000000..e2d90924a --- /dev/null +++ b/packages/app/public/humans.txt @@ -0,0 +1,4 @@ +/* TEAM */ +Developer: Corentin Thomasset +Site: https://corentin.tech +Twitter: @cthmsst \ No newline at end of file diff --git a/packages/app/public/robots.txt b/packages/app/public/robots.txt deleted file mode 100644 index 8b1378917..000000000 --- a/packages/app/public/robots.txt +++ /dev/null @@ -1 +0,0 @@ - diff --git a/packages/app/src/locales/en.yaml b/packages/app/src/locales/en.yaml new file mode 100644 index 000000000..13f29436c --- /dev/null +++ b/packages/app/src/locales/en.yaml @@ -0,0 +1,31 @@ +app: + title: IT-Tools + description: The open-source collection of handy online tools to help developers in their daily life. +home: + all-the-tools: All the tools + search-tools: Search for a tool + open-source: Open Source + free: Free + self-hostable: Self-hostable + open-tool: Open tool +footer: + resources: + title: Resources + all-tools: All the tools + github: GitHub repository + support: Support IT-Tools + license: License + support: + title: Support + report-bug: Report a bug + request-feature: Request a feature + contribute: Contribute to the project + contact: Contact me + friends: + title: Friends +tools: + token-generator: + title: Token Generator + description: >- + Generate random string with the characters you want, uppercase, lowercase + letters, numbers and/or symbols. diff --git a/packages/app/src/locales/fr.yaml b/packages/app/src/locales/fr.yaml new file mode 100644 index 000000000..eb884e262 --- /dev/null +++ b/packages/app/src/locales/fr.yaml @@ -0,0 +1,29 @@ +app: + title: IT-Tools + description: La collection open-source d'outils en ligne pour aider les devs dans leur vie quotidienne. +home: + all-the-tools: Tous les outils + search-tools: Rechercher un outil + open-source: Open Source + free: Gratuit + self-hostable: Self-hostable + open-tool: Ouvrir l'outil +footer: + resources: + title: Ressources + all-tools: Tous les outils + github: Dépôt GitHub + support: Soutenir IT-Tools + license: Licence + support: + title: Support + report-bug: Signaler un bug + request-feature: Demander une fonctionnalité + contribute: Contribuer au projet + contact: Me contacter + friends: + title: Ami·e·s +tools: + token-generator: + title: Générateur de token + description: Générer des chaines de caractères aléatoires, contrôlez les caractères que vous voulez, lettres majuscules, minuscules, chiffres et/ou symboles. diff --git a/packages/app/src/modules/app/components/app-footer.vue b/packages/app/src/modules/app/components/app-footer.vue index 09a81d955..3a41a3ed8 100644 --- a/packages/app/src/modules/app/components/app-footer.vue +++ b/packages/app/src/modules/app/components/app-footer.vue @@ -1,29 +1,32 @@