diff --git a/.eslintignore b/.eslintignore deleted file mode 100644 index 35a85b47..00000000 --- a/.eslintignore +++ /dev/null @@ -1,7 +0,0 @@ -dist -node_modules -*.cjs -*.mjs -*.d.ts -!docs/.vitepress -docs/.vitepress/cache/deps/*.* diff --git a/.eslintrc b/.eslintrc deleted file mode 100644 index 93cb9033..00000000 --- a/.eslintrc +++ /dev/null @@ -1,18 +0,0 @@ -{ - "extends": ["@antfu"], - "overrides": [ - { - "files": [ - "**/*.md/*.*" - ], - "rules": { - "@typescript-eslint/no-this-alias": "off", - "array-bracket-spacing": "off", - "n/handle-callback-err": "off", - "no-restricted-syntax": "off", - "no-labels": "off", - "vue/block-tag-newline": "off" - } - } - ] -} diff --git a/.github/workflows/cr.yml b/.github/workflows/cr.yml index 8354dc7f..423b02d1 100644 --- a/.github/workflows/cr.yml +++ b/.github/workflows/cr.yml @@ -4,8 +4,11 @@ on: pull_request: branches: [main] types: [opened, synchronize, labeled, ready_for_review] + workflow_dispatch: -permissions: {} +permissions: + contents: read + pull-requests: write concurrency: group: ${{ github.workflow }}-${{ github.event.number }} @@ -13,7 +16,7 @@ concurrency: jobs: release: - if: ${{ !github.event.pull_request.draft && contains(github.event.pull_request.labels.*.name, 'cr-tracked') }} + if: ${{ github.event_name == 'workflow_dispatch' || (!github.event.pull_request.draft && contains(github.event.pull_request.labels.*.name, 'cr-tracked')) }} runs-on: ubuntu-latest steps: @@ -21,4 +24,6 @@ jobs: - uses: pnpm/action-setup@v4.0.0 - run: pnpm install - run: pnpm prepack - - run: pnpx pkg-pr-new publish --compact --no-template --pnpm + - run: pnpm dlx pkg-pr-new publish packages/vuetify-nuxt-module --compact --no-template --pnpm + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 6877b397..964bc631 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -7,9 +7,44 @@ on: jobs: release: - uses: sxzz/workflows/.github/workflows/release.yml@v1 - with: - publish: true permissions: - contents: write id-token: write + contents: write + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + with: + fetch-depth: 0 + + - name: Install pnpm + uses: pnpm/action-setup@v4 + + - name: Set node + uses: actions/setup-node@v4 + with: + node-version: lts/* + cache: pnpm + registry-url: 'https://registry.npmjs.org' + + - name: Install + run: pnpm install + + # Ensure npm 11.5.1 or later is installed + - name: Update NPM + run: npm install -g npm@latest + + - name: Determine NPM tag + run: | + if [[ "${{ github.ref_name }}" == *"beta"* ]] || [[ "${{ github.ref_name }}" == *"alpha"* ]]; then + echo "NPM_TAG=beta" >> $GITHUB_ENV + else + echo "NPM_TAG=latest" >> $GITHUB_ENV + fi + + - name: Publish + run: pnpm -r publish --tag ${{ env.NPM_TAG }} --access public --no-git-checks + + - name: GitHub release + run: pnpm dlx conventional-github-releaser -p vuetify + env: + CONVENTIONAL_GITHUB_RELEASER_TOKEN: ${{ secrets.GITHUB_TOKEN }} diff --git a/.nuxtrc b/.nuxtrc deleted file mode 100644 index 677ddb7f..00000000 --- a/.nuxtrc +++ /dev/null @@ -1,4 +0,0 @@ -typescript.includeWorkspace=true -typescript.tsConfig.exclude[]=../playground -typescript.tsConfig.exclude[]=../date-io-playground' - diff --git a/.stackblitz.js b/.stackblitz.js index 7a5b7e1c..8fd994d5 100644 --- a/.stackblitz.js +++ b/.stackblitz.js @@ -1,14 +1,13 @@ import { promises as fsPromises } from 'node:fs' -removeParcel('./playground/nuxt.config.ts') +removeParcel('./apps/playground/nuxt.config.ts') -async function removeParcel(filename) { +async function removeParcel (filename) { try { - const contents = await fsPromises.readFile(filename, 'utf-8') + const contents = await fsPromises.readFile(filename, 'utf8') const updatedContent = contents.replace('watcher: \'parcel\'', 'watcher: \'chokidar-granular\'') await fsPromises.writeFile(filename, updatedContent) - } - catch (err) { - console.error(err) + } catch (error) { + console.error(error) } } diff --git a/LICENSE b/LICENSE deleted file mode 100644 index 4e65aa16..00000000 --- a/LICENSE +++ /dev/null @@ -1,21 +0,0 @@ -MIT License - -Copyright (c) 2023-PRESENT Joaquín Sánchez - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -SOFTWARE. diff --git a/LICENSE b/LICENSE new file mode 120000 index 00000000..0e5020df --- /dev/null +++ b/LICENSE @@ -0,0 +1 @@ +packages/vuetify-nuxt-module/LICENSE \ No newline at end of file diff --git a/README.md b/README.md deleted file mode 100644 index 8f7c722c..00000000 --- a/README.md +++ /dev/null @@ -1,95 +0,0 @@ -
- - - vuetify-nuxt-module - Zero-config Nuxt Module for Vuetify
-
-

Zero-config Nuxt Module for Vuetify

-
- -

- -NPM version - - - NPM Downloads - - - Docs & Guides - -
- -GitHub stars - -

- -
- -## 🚀 Features - -- 📖 [**Documentation & guides**](https://nuxt.vuetifyjs.com/) -- 👌 **Zero-Config**: sensible built-in default [Vuetify](https://vuetifyjs.com/) configuration for common use cases -- 🔌 **Extensible**: expose the ability to customize the Vuetify configuration via [Nuxt Runtime Hooks](https://nuxt.com/docs/guide/going-further/hooks#usage-with-plugins) -- ⚡ **Fully Tree Shakable**: by default, only the needed Vuetify components are imported -- 🛠️ **Versatile**: custom Vuetify [directives](https://vuetifyjs.com/en/getting-started/installation/#manual-steps) and [labs components](https://vuetifyjs.com/en/labs/introduction/) registration -- ✨ **Configurable Styles**: configure your variables using [Vuetify SASS Variables](https://vuetifyjs.com/en/features/sass-variables/) -- 💥 **SSR**: automatic SSR detection and configuration including [HTTP Client hints](https://developer.mozilla.org/en-US/docs/Web/HTTP/Client_hints) -- 🔩 **Nuxt Layers and Module Hooks**: load your Vuetify configuration using [Nuxt Layers](https://nuxt.com/docs/getting-started/layers#layers) or using a custom module via `vuetify:registerModule` [Nuxt Module Hook](https://nuxt.com/docs/guide/going-further/hooks#nuxt-hooks-build-time) -- 📥 **Vuetify Configuration File**: configure your Vuetify options using a custom `vuetify.config` file, no dev server restart needed -- 🔥 **Pure CSS Icons**: no more font/js icons, use the new `unocss-mdi` icon set or build your own with UnoCSS Preset Icons -- 😃 **Icon Fonts**: configure the [icon font](https://vuetifyjs.com/en/features/icon-fonts/) you want to use, the module will automatically import it for you using CDN or local dependencies -- 🎭 **SVG Icons**: ready to use [@mdi/js](https://www.npmjs.com/package/@mdi/js) and [@fortawesome/vue-fontawesome](https://www.npmjs.com/package/@fortawesome/vue-fontawesome) SVG icons packs -- 📦 **Multiple Icon Sets**: register [multiple icon sets](https://vuetifyjs.com/en/features/icon-fonts/#multiple-icon-sets) -- 🌍 **I18n Ready**: install [@nuxtjs/i18n](https://i18n.nuxtjs.org/) Nuxt module, and you're ready to use Vuetify [internationalization](https://vuetifyjs.com/en/features/internationalization/) features -- 📆 **Date Components**: use Vuetify components [that require date functionality](https://vuetifyjs.com/en/features/dates/) installing and configuring one of the [@date-io](https://github.com/dmtrKovalenko/date-io#projects) adapters -- 💬 **Auto-Import Vuetify Locale Messages**: add [Vuetify Locale Messages](https://vuetifyjs.com/en/features/internationalization/#getting-started) adding just the locales you want to use, no more imports needed -- ⚙️ **Auto-Import Vuetify Composables**: you don't need to import Vuetify composables manually, they are automatically imported for you -- 🎨 **Vuetify Blueprints**: use [Vuetify Blueprints](https://vuetifyjs.com/en/features/blueprints/) to quickly scaffold components -- 👀 **Nuxt DevTools**: ready to inspect your Vuetify styles with the [Nuxt DevTools](https://github.com/nuxt/devtools) inspector -- 🦾 **Type Strong**: written in [TypeScript](https://www.typescriptlang.org/) - -## 📦 Install - -> Requires Vite, will not work with Webpack - -```bash -npx nuxi@latest module add vuetify-nuxt-module -``` - -[![Open in StackBlitz](https://developer.stackblitz.com/img/open_in_stackblitz.svg)](https://stackblitz.com/github/userquin/vuetify-nuxt-module) - -## 🦄 Usage - -> `vuetify-nuxt-module` is strongly opinionated and has a built-in default configuration out of the box. You can use it without any configuration, and it will work for most use cases. - -Add `vuetify-nuxt-module` module to `nuxt.config.ts` and configure it: - -```ts -// Nuxt config file -import { defineNuxtConfig } from 'nuxt/config' - -export default defineNuxtConfig({ - modules: [ - 'vuetify-nuxt-module' - ], - vuetify: { - moduleOptions: { - /* module specific options */ - }, - vuetifyOptions: { - /* vuetify options */ - } - } -}) -``` - -Read the [📖 documentation](https://nuxt.vuetifyjs.com/) for a complete guide on how to configure and use this module. - -## 👀 Full config - -Check out the [types](https://github.com/vuetifyjs/nuxt-module/blob/main/src/types.ts). - -The virtual modules can be found in [configuration.d.ts](https://github.com/vuetifyjs/nuxt-module/blob/main/configuration.d.ts) file. - -## 📄 License - -[MIT](https://github.com/vuetifyjs/nuxt-module/blob/main/LICENSE) License © 2023-PRESENT [Joaquín Sánchez](https://github.com/userquin) diff --git a/README.md b/README.md new file mode 120000 index 00000000..2a86f91d --- /dev/null +++ b/README.md @@ -0,0 +1 @@ +packages/vuetify-nuxt-module/README.md \ No newline at end of file diff --git a/apps/date-io-playground/.nuxtrc b/apps/date-io-playground/.nuxtrc new file mode 100644 index 00000000..71fb186b --- /dev/null +++ b/apps/date-io-playground/.nuxtrc @@ -0,0 +1 @@ +typescript.tsConfig.exclude[]=../../packages/vuetify-nuxt-module/src/runtime diff --git a/apps/date-io-playground/app/app.vue b/apps/date-io-playground/app/app.vue new file mode 100644 index 00000000..394a469c --- /dev/null +++ b/apps/date-io-playground/app/app.vue @@ -0,0 +1,33 @@ + + + + + diff --git a/date-io-playground/nuxt.config.ts b/apps/date-io-playground/nuxt.config.ts similarity index 93% rename from date-io-playground/nuxt.config.ts rename to apps/date-io-playground/nuxt.config.ts index 154fccc2..f4de6613 100644 --- a/date-io-playground/nuxt.config.ts +++ b/apps/date-io-playground/nuxt.config.ts @@ -41,6 +41,7 @@ export default defineNuxtConfig({ baseURL: '/', head: { meta: [ + // eslint-disable-next-line unicorn/text-encoding-identifier-case { charset: 'utf-8' }, ], }, diff --git a/apps/date-io-playground/package.json b/apps/date-io-playground/package.json new file mode 100644 index 00000000..ddd1311e --- /dev/null +++ b/apps/date-io-playground/package.json @@ -0,0 +1,41 @@ +{ + "name": "vuetify-nuxt-module-date-io-playground", + "type": "module", + "private": true, + "scripts": { + "dev:prepare": "nuxt prepare", + "dev": "nuxt dev", + "build": "nuxt build", + "generate": "nuxt generate", + "preview": "nuxt preview" + }, + "devDependencies": { + "@date-io/date-fns": "catalog:", + "@date-io/date-fns-jalali": "catalog:", + "@date-io/dayjs": "catalog:", + "@date-io/hijri": "catalog:", + "@date-io/js-joda": "catalog:", + "@date-io/luxon": "catalog:", + "@date-io/moment": "catalog:", + "@js-joda/core": "catalog:", + "@js-joda/locale_en-us": "catalog:", + "@js-joda/locale_es": "catalog:", + "@types/date-fns": "catalog:", + "@types/moment": "catalog:", + "@types/moment-hijri": "catalog:", + "@types/moment-jalaali": "catalog:", + "@unocss/nuxt": "catalog:", + "date-fns": "catalog:", + "date-fns-jalali": "catalog:", + "dayjs": "catalog:", + "luxon": "catalog:", + "moment": "catalog:", + "moment-hijri": "catalog:", + "moment-jalaali": "catalog:", + "nuxt": "catalog:", + "sass-embedded": "catalog:", + "typescript": "catalog:", + "vue-tsc": "catalog:", + "vuetify-nuxt-module": "workspace:*" + } +} diff --git a/date-io-playground/tsconfig.json b/apps/date-io-playground/tsconfig.json similarity index 100% rename from date-io-playground/tsconfig.json rename to apps/date-io-playground/tsconfig.json diff --git a/apps/playground/.nuxtrc b/apps/playground/.nuxtrc new file mode 100644 index 00000000..71fb186b --- /dev/null +++ b/apps/playground/.nuxtrc @@ -0,0 +1 @@ +typescript.tsConfig.exclude[]=../../packages/vuetify-nuxt-module/src/runtime diff --git a/apps/playground/app/app.css b/apps/playground/app/app.css new file mode 100644 index 00000000..f33d4e9b --- /dev/null +++ b/apps/playground/app/app.css @@ -0,0 +1,5 @@ +@layer custom-l { + .bg-primary { + background: red; + } +} diff --git a/modern-sass-compiler/app.vue b/apps/playground/app/app.vue similarity index 100% rename from modern-sass-compiler/app.vue rename to apps/playground/app/app.vue diff --git a/modern-sass-compiler/assets/custom-vuetify.scss b/apps/playground/app/assets/custom-vuetify.scss similarity index 100% rename from modern-sass-compiler/assets/custom-vuetify.scss rename to apps/playground/app/assets/custom-vuetify.scss diff --git a/modern-sass-compiler/assets/logo.svg b/apps/playground/app/assets/logo.svg similarity index 100% rename from modern-sass-compiler/assets/logo.svg rename to apps/playground/app/assets/logo.svg diff --git a/playground/assets/main.scss b/apps/playground/app/assets/main.scss similarity index 100% rename from playground/assets/main.scss rename to apps/playground/app/assets/main.scss diff --git a/playground/assets/settings.scss b/apps/playground/app/assets/settings.scss similarity index 100% rename from playground/assets/settings.scss rename to apps/playground/app/assets/settings.scss diff --git a/apps/playground/app/layers.css b/apps/playground/app/layers.css new file mode 100644 index 00000000..26d4ea23 --- /dev/null +++ b/apps/playground/app/layers.css @@ -0,0 +1 @@ +@layer vuetify-core, custom-l, vuetify-components, vuetify-overrides, vuetify-utilities, vuetify-final; diff --git a/apps/playground/app/layouts/default.vue b/apps/playground/app/layouts/default.vue new file mode 100644 index 00000000..2f1fa9d1 --- /dev/null +++ b/apps/playground/app/layouts/default.vue @@ -0,0 +1,14 @@ + + + diff --git a/apps/playground/app/middleware/1.vuetify.global.ts b/apps/playground/app/middleware/1.vuetify.global.ts new file mode 100644 index 00000000..4761e490 --- /dev/null +++ b/apps/playground/app/middleware/1.vuetify.global.ts @@ -0,0 +1,5 @@ +export default defineNuxtRouteMiddleware(to => { + if (import.meta.client) { + console.log('global middleware', to.path, useNuxtApp().$vuetify) + } +}) diff --git a/apps/playground/app/middleware/vuetify.ts b/apps/playground/app/middleware/vuetify.ts new file mode 100644 index 00000000..cc0984a9 --- /dev/null +++ b/apps/playground/app/middleware/vuetify.ts @@ -0,0 +1,5 @@ +export default defineNuxtRouteMiddleware(to => { + if (import.meta.client) { + console.log('middleware', to.path, useNuxtApp().$vuetify) + } +}) diff --git a/apps/playground/app/pages/index.vue b/apps/playground/app/pages/index.vue new file mode 100644 index 00000000..965b1413 --- /dev/null +++ b/apps/playground/app/pages/index.vue @@ -0,0 +1,231 @@ + + + + + diff --git a/apps/playground/app/pages/no-ssr.vue b/apps/playground/app/pages/no-ssr.vue new file mode 100644 index 00000000..7ca6a1cb --- /dev/null +++ b/apps/playground/app/pages/no-ssr.vue @@ -0,0 +1,139 @@ + + + + + diff --git a/playground/plugins/custom-unocsss-mdi.ts b/apps/playground/app/plugins/custom-unocsss-mdi.ts similarity index 96% rename from playground/plugins/custom-unocsss-mdi.ts rename to apps/playground/app/plugins/custom-unocsss-mdi.ts index e26a6977..ca80c529 100644 --- a/playground/plugins/custom-unocsss-mdi.ts +++ b/apps/playground/app/plugins/custom-unocsss-mdi.ts @@ -1,14 +1,15 @@ +import { iconsConfiguration } from 'virtual:vuetify-icons-configuration' // @unocss-include DON'T FORGET TO ADD THIS COMMENT import { mdi } from 'vuetify/iconsets/mdi' -import { iconsConfiguration } from 'virtual:vuetify-icons-configuration' -export default defineNuxtPlugin((nuxtApp) => { +export default defineNuxtPlugin(nuxtApp => { nuxtApp.hook('vuetify:configuration', ({ vuetifyOptions }) => { /* BEGIN: this block and the virtual:vuetify-icons-configuration import not required in your plugin */ const icons = iconsConfiguration() const apply = icons?.defaultSet === 'custom' - if (!apply) + if (!apply) { return + } /* END: this block and the import not required in your plugin */ vuetifyOptions.icons = { diff --git a/playground/plugins/vuetify.ts b/apps/playground/app/plugins/vuetify.ts similarity index 68% rename from playground/plugins/vuetify.ts rename to apps/playground/app/plugins/vuetify.ts index 4de0c78a..5c6bdd64 100644 --- a/playground/plugins/vuetify.ts +++ b/apps/playground/app/plugins/vuetify.ts @@ -1,16 +1,13 @@ -export default defineNuxtPlugin((nuxtApp) => { +export default defineNuxtPlugin(nuxtApp => { nuxtApp.hook('vuetify:before-create', ({ isDev, vuetifyOptions }) => { if (import.meta.client && isDev) { - // eslint-disable-next-line no-console console.log('vuetify:plugin:hook', vuetifyOptions) } }) nuxtApp.hook('vuetify:ready', () => { - // eslint-disable-next-line no-console console.log('vuetify:ready') }) nuxtApp.hook('vuetify:ssr-client-hints', ({ ssrClientHints }) => { - // eslint-disable-next-line no-console console.log('vuetify:ssr-client-hints', ssrClientHints) }) }) diff --git a/apps/playground/app/vuetify.rules.ts b/apps/playground/app/vuetify.rules.ts new file mode 100644 index 00000000..b32d0d6c --- /dev/null +++ b/apps/playground/app/vuetify.rules.ts @@ -0,0 +1,3 @@ +export default { + required: (v: any) => !!v || 'Field is required (custom)', +} diff --git a/playground/config/i18n.config.ts b/apps/playground/config/i18n.config.ts similarity index 100% rename from playground/config/i18n.config.ts rename to apps/playground/config/i18n.config.ts diff --git a/playground/config/i18n.ts b/apps/playground/config/i18n.ts similarity index 96% rename from playground/config/i18n.ts rename to apps/playground/config/i18n.ts index ba59c4d3..94f903fd 100644 --- a/playground/config/i18n.ts +++ b/apps/playground/config/i18n.ts @@ -1,6 +1,6 @@ -import process from 'node:process' import type { DateTimeFormats, NumberFormats, PluralizationRules } from '@intlify/core-base' import type { LocaleObject } from '@nuxtjs/i18n' +import process from 'node:process' const multipleJson = process.env.MULTIPLE_LANG_FILES === 'true' @@ -79,11 +79,11 @@ const locales: LocaleObject[] = [ }, ] -function buildLocales() { +function buildLocales () { const useLocales = Object.values(locales).reduce((acc, data) => { const locales = countryLocaleVariants[data.code] if (locales) { - locales.forEach((l) => { + for (const l of locales) { let entry: LocaleObject if (multipleJson) { entry = { @@ -93,8 +93,7 @@ function buildLocales() { files: [data.file as string, `${l.code}.json`], } delete entry.file - } - else { + } else { entry = { ...data, code: l.code, @@ -104,16 +103,15 @@ function buildLocales() { } acc.push(entry) - }) - } - else { + } + } else { acc.push(data) } return acc }, []) - return useLocales.sort((a, b) => a.code.localeCompare(b.code)) + return useLocales.toSorted((a, b) => a.code.localeCompare(b.code)) } export const availableLocales = buildLocales() @@ -123,8 +121,7 @@ export const datetimeFormats = Object.values(availableLocales).reduce((acc, data if (dateTimeFormats) { acc[data.code] = { ...dateTimeFormats } delete data.dateTimeFormats - } - else { + } else { acc[data.code] = { shortDate: { dateStyle: 'short', @@ -148,8 +145,7 @@ export const numberFormats = Object.values(availableLocales).reduce((acc, data) if (numberFormats) { acc[data.code] = { ...numberFormats } delete data.numberFormats - } - else { + } else { acc[data.code] = { percentage: { style: 'percent', diff --git a/playground/locales/multiple/ar-EG.json b/apps/playground/i18n/locales/multiple/ar-EG.json similarity index 100% rename from playground/locales/multiple/ar-EG.json rename to apps/playground/i18n/locales/multiple/ar-EG.json diff --git a/playground/locales/multiple/ar.json b/apps/playground/i18n/locales/multiple/ar.json similarity index 100% rename from playground/locales/multiple/ar.json rename to apps/playground/i18n/locales/multiple/ar.json diff --git a/playground/locales/multiple/en-GB.json b/apps/playground/i18n/locales/multiple/en-GB.json similarity index 100% rename from playground/locales/multiple/en-GB.json rename to apps/playground/i18n/locales/multiple/en-GB.json diff --git a/playground/locales/multiple/en-US.json b/apps/playground/i18n/locales/multiple/en-US.json similarity index 100% rename from playground/locales/multiple/en-US.json rename to apps/playground/i18n/locales/multiple/en-US.json diff --git a/apps/playground/i18n/locales/multiple/en.json b/apps/playground/i18n/locales/multiple/en.json new file mode 100644 index 00000000..a2dabce0 --- /dev/null +++ b/apps/playground/i18n/locales/multiple/en.json @@ -0,0 +1,30 @@ +{ + "xxx": "Favorite", + "$vuetify": { + "badge": "Badge", + "open": "Open", + "close": "Close", + "datePicker": { + "ariaLabel": { + "previousMonth": "Previous month", + "nextMonth": "Next month", + "selectYear": "Select year", + "previousYear": "Previous year", + "nextYear": "Next year", + "selectMonth": "Select month", + "selectDate": "{0}", + "currentDate": "Today, {0}" + }, + "title": "Select date", + "header": "Enter date", + "cancel": "Cancel", + "ok": "Ok", + "input": { + "placeholder": "Enter date" + } + }, + "input": { + "clear": "Clear" + } + } +} diff --git a/playground/locales/multiple/es-419.json b/apps/playground/i18n/locales/multiple/es-419.json similarity index 100% rename from playground/locales/multiple/es-419.json rename to apps/playground/i18n/locales/multiple/es-419.json diff --git a/playground/locales/multiple/es-ES.json b/apps/playground/i18n/locales/multiple/es-ES.json similarity index 100% rename from playground/locales/multiple/es-ES.json rename to apps/playground/i18n/locales/multiple/es-ES.json diff --git a/playground/locales/multiple/es.json b/apps/playground/i18n/locales/multiple/es.json similarity index 100% rename from playground/locales/multiple/es.json rename to apps/playground/i18n/locales/multiple/es.json diff --git a/playground/locales/single/ar-EG.json b/apps/playground/i18n/locales/single/ar-EG.json similarity index 100% rename from playground/locales/single/ar-EG.json rename to apps/playground/i18n/locales/single/ar-EG.json diff --git a/apps/playground/i18n/locales/single/en-GB.json b/apps/playground/i18n/locales/single/en-GB.json new file mode 100644 index 00000000..7b5f34da --- /dev/null +++ b/apps/playground/i18n/locales/single/en-GB.json @@ -0,0 +1,30 @@ +{ + "xxx": "Favourite", + "$vuetify": { + "badge": "Badge", + "open": "Open", + "close": "Close", + "datePicker": { + "title": "Select date", + "header": "Enter date", + "cancel": "Cancel", + "ok": "Ok", + "input": { + "placeholder": "Enter date" + }, + "ariaLabel": { + "previousMonth": "Previous month", + "nextMonth": "Next month", + "selectYear": "Select year", + "previousYear": "Previous year", + "nextYear": "Next year", + "selectMonth": "Select month", + "selectDate": "{0}", + "currentDate": "Today, {0}" + } + }, + "input": { + "clear": "Clear" + } + } +} diff --git a/apps/playground/i18n/locales/single/en-US.json b/apps/playground/i18n/locales/single/en-US.json new file mode 100644 index 00000000..13e4bc9a --- /dev/null +++ b/apps/playground/i18n/locales/single/en-US.json @@ -0,0 +1,30 @@ +{ + "xxx": "Favorite", + "$vuetify": { + "badge": "Badge", + "open": "Open", + "close": "Close", + "datePicker": { + "title": "Select date", + "header": "Enter date", + "cancel": "Cancel", + "ok": "Ok", + "input": { + "placeholder": "Enter date" + }, + "ariaLabel": { + "previousMonth": "Previous month", + "nextMonth": "Next month", + "selectYear": "Select year", + "previousYear": "Previous year", + "nextYear": "Next year", + "selectMonth": "Select month", + "selectDate": "{0}", + "currentDate": "Today, {0}" + } + }, + "input": { + "clear": "Clear" + } + } +} diff --git a/playground/locales/single/es-419.json b/apps/playground/i18n/locales/single/es-419.json similarity index 100% rename from playground/locales/single/es-419.json rename to apps/playground/i18n/locales/single/es-419.json diff --git a/playground/locales/single/es-ES.json b/apps/playground/i18n/locales/single/es-ES.json similarity index 100% rename from playground/locales/single/es-ES.json rename to apps/playground/i18n/locales/single/es-ES.json diff --git a/playground/nuxt.config.ts b/apps/playground/nuxt.config.ts similarity index 83% rename from playground/nuxt.config.ts rename to apps/playground/nuxt.config.ts index 2611fde5..a05e77af 100644 --- a/playground/nuxt.config.ts +++ b/apps/playground/nuxt.config.ts @@ -1,21 +1,18 @@ import { availableLocales, langDir } from './config/i18n' -import LayerModule from './layer-module' // import { transformAssetUrls } from "vite-plugin-vuetify"; export default defineNuxtConfig({ compatibilityDate: '2024-08-15', - extends: ['layers/vuetify-layer'], // ssr: false, sourcemap: true, imports: { autoImport: true, injectAtEnd: true, }, - modules: ['@unocss/nuxt', '@nuxtjs/i18n', LayerModule, 'vuetify-nuxt-module'], + modules: ['@unocss/nuxt', '@nuxtjs/i18n', 'vuetify-nuxt-module'], i18n: { locales: availableLocales, - lazy: true, strategy: 'no_prefix', detectBrowserLanguage: false, /* { fallbackLocale: 'en-US', @@ -27,11 +24,11 @@ export default defineNuxtConfig({ defaultLocale: 'en-US', // types: 'composition', // pages: undefined, - dynamicRouteParams: false, skipSettingLocaleOnNavigate: false, // debug: true, vueI18n: './config/i18n.config.ts', }, + css: ['~/layers.css', '~/app.css'], vuetify: { moduleOptions: { includeTransformAssetsUrls: { @@ -49,7 +46,11 @@ export default defineNuxtConfig({ }, viewportSize: true, }, - // styles: { configFile: 'assets/custom-vuetify.scss' }, + styles: { configFile: '~/assets/custom-vuetify.scss', experimental: { cache: true } }, + rulesConfiguration: { + fromLabs: true, + configFile: '~/vuetify.rules.ts', + }, }, }, vite: { @@ -81,6 +82,7 @@ export default defineNuxtConfig({ baseURL: '/', head: { meta: [ + // eslint-disable-next-line unicorn/text-encoding-identifier-case { charset: 'utf-8' }, ], }, diff --git a/apps/playground/package.json b/apps/playground/package.json new file mode 100644 index 00000000..306b022c --- /dev/null +++ b/apps/playground/package.json @@ -0,0 +1,32 @@ +{ + "name": "vuetify-nuxt-module-playground", + "type": "module", + "private": true, + "scripts": { + "dev:prepare": "nuxt prepare", + "dev": "nuxt dev", + "build": "nuxt build", + "generate": "nuxt generate", + "preview": "nuxt preview" + }, + "dependencies": { + "@date-io/luxon": "catalog:", + "@fortawesome/fontawesome-svg-core": "catalog:", + "@fortawesome/free-solid-svg-icons": "catalog:", + "@fortawesome/vue-fontawesome": "catalog:", + "@iconify-json/mdi": "catalog:", + "@mdi/js": "catalog:", + "luxon": "catalog:", + "vuetify": "catalog:" + }, + "devDependencies": { + "@nuxt/devtools": "catalog:", + "@nuxtjs/i18n": "catalog:", + "@unocss/nuxt": "catalog:", + "nuxt": "catalog:", + "sass-embedded": "catalog:", + "typescript": "catalog:", + "vue-tsc": "catalog:", + "vuetify-nuxt-module": "workspace:*" + } +} diff --git a/apps/playground/tsconfig.json b/apps/playground/tsconfig.json new file mode 100644 index 00000000..307b2134 --- /dev/null +++ b/apps/playground/tsconfig.json @@ -0,0 +1,18 @@ +{ + // https://nuxt.com/docs/guide/concepts/typescript + "files": [], + "references": [ + { + "path": "./.nuxt/tsconfig.app.json" + }, + { + "path": "./.nuxt/tsconfig.server.json" + }, + { + "path": "./.nuxt/tsconfig.shared.json" + }, + { + "path": "./.nuxt/tsconfig.node.json" + } + ] +} diff --git a/playground/unocss.config.ts b/apps/playground/uno.config.ts similarity index 100% rename from playground/unocss.config.ts rename to apps/playground/uno.config.ts diff --git a/playground/vuetify.config.ts b/apps/playground/vuetify.config.ts similarity index 100% rename from playground/vuetify.config.ts rename to apps/playground/vuetify.config.ts index 75cc461f..47998aa1 100644 --- a/playground/vuetify.config.ts +++ b/apps/playground/vuetify.config.ts @@ -1,5 +1,5 @@ -import { md3 } from 'vuetify/blueprints' import { defineVuetifyConfiguration } from 'vuetify-nuxt-module/custom-configuration' +import { md3 } from 'vuetify/blueprints' export default defineVuetifyConfiguration({ ssr: { diff --git a/apps/vuetify-locale-playground/.nuxtrc b/apps/vuetify-locale-playground/.nuxtrc new file mode 100644 index 00000000..71fb186b --- /dev/null +++ b/apps/vuetify-locale-playground/.nuxtrc @@ -0,0 +1 @@ +typescript.tsConfig.exclude[]=../../packages/vuetify-nuxt-module/src/runtime diff --git a/vuetify-locale-playground/app.vue b/apps/vuetify-locale-playground/app/app.vue similarity index 70% rename from vuetify-locale-playground/app.vue rename to apps/vuetify-locale-playground/app/app.vue index eca3bd26..2931695d 100644 --- a/vuetify-locale-playground/app.vue +++ b/apps/vuetify-locale-playground/app/app.vue @@ -1,7 +1,3 @@ - -