diff --git a/README.md b/README.md index 23a0fad..6e5ac37 100644 --- a/README.md +++ b/README.md @@ -2,44 +2,50 @@ Get your module up and running quickly. Find and replace all on all files (CMD+SHIFT+F): -- Name: My Module -- Package name: my-module -- Description: My new Nuxt module +- Name: CmsKatze +- Package name: cms-katze +- Description: An easy to setup in APP CMS --> -# My Module +# CmsKatze [![npm version][npm-version-src]][npm-version-href] [![npm downloads][npm-downloads-src]][npm-downloads-href] [![License][license-src]][license-href] [![Nuxt][nuxt-src]][nuxt-href] -My new Nuxt module for doing amazing things. +An easy to setup in APP CMS - [✨  Release Notes](/CHANGELOG.md) - + ## Features - -- ⛰  Foo -- 🚠  Bar -- 🌲  Baz +- 📝  In app CMS editor for easy content management +- 🎨  Customizable content blocks +- 📦  Easy to setup and use ## Quick Setup -Install the module to your Nuxt application with one command: +1. Add `cms-katze` dependency to your project +2. Add `cms-katze` to the `modules` section of `nuxt.config.js` +3. Use the CMS editor in your app and implement the content blocks ```bash -npx nuxi module add my-module +npx nuxi module add cms-katze ``` -That's it! You can now use My Module in your Nuxt app ✨ +That's it! You can now use CmsKatze in your Nuxt app ✨ ## Contribution +1. Clone this repository +2. Install dependencies using `pnpm install` +3. Generate type stubs using `pnpm dev:prepare` +4. Develop with the playground using `pnpm dev` +
Local development @@ -59,10 +65,6 @@ That's it! You can now use My Module in your Nuxt app ✨ # Run ESLint npm run lint - # Run Vitest - npm run test - npm run test:watch - # Release new version npm run release ``` @@ -71,14 +73,14 @@ That's it! You can now use My Module in your Nuxt app ✨ -[npm-version-src]: https://img.shields.io/npm/v/my-module/latest.svg?style=flat&colorA=020420&colorB=00DC82 -[npm-version-href]: https://npmjs.com/package/my-module +[npm-version-src]: https://img.shields.io/npm/v/cms-katze/latest.svg?style=flat&colorA=020420&colorB=00DC82 +[npm-version-href]: https://npmjs.com/package/cms-katze -[npm-downloads-src]: https://img.shields.io/npm/dm/my-module.svg?style=flat&colorA=020420&colorB=00DC82 -[npm-downloads-href]: https://npmjs.com/package/my-module +[npm-downloads-src]: https://img.shields.io/npm/dm/cms-katze.svg?style=flat&colorA=020420&colorB=00DC82 +[npm-downloads-href]: https://npmjs.com/package/cms-katze -[license-src]: https://img.shields.io/npm/l/my-module.svg?style=flat&colorA=020420&colorB=00DC82 -[license-href]: https://npmjs.com/package/my-module +[license-src]: https://img.shields.io/npm/l/cms-katze.svg?style=flat&colorA=020420&colorB=00DC82 +[license-href]: https://npmjs.com/package/cms-katze [nuxt-src]: https://img.shields.io/badge/Nuxt-020420?logo=nuxt.js [nuxt-href]: https://nuxt.com diff --git a/playground/package.json b/playground/package.json index 289c8a7..c98e570 100644 --- a/playground/package.json +++ b/playground/package.json @@ -1,6 +1,6 @@ { "private": true, - "name": "my-module-playground", + "name": "cms-katze-playground", "type": "module", "scripts": { "dev": "nuxi dev", diff --git a/src/module.ts b/src/module.ts index 7c794b9..c7480c6 100644 --- a/src/module.ts +++ b/src/module.ts @@ -1,4 +1,3 @@ -import fs from 'node:fs' import { addComponentsDir, addImportsDir, @@ -10,8 +9,8 @@ import { extendPages, installModule, } from '@nuxt/kit' -import {createStorage} from 'unstorage'; -import fsDriver from 'unstorage/drivers/fs'; +import { createStorage } from 'unstorage' +import fsDriver from 'unstorage/drivers/fs' /* THIS MODULE IS THE CORE OF THE KATZENFRAMEWORK diff --git a/src/runtime/components/views/EditView.vue b/src/runtime/components/views/EditView.vue index ff8a37c..42f8e2e 100644 --- a/src/runtime/components/views/EditView.vue +++ b/src/runtime/components/views/EditView.vue @@ -290,6 +290,8 @@ const fillEmptySpace = computed(() => { if (mod > 0) { return Array.from({ length: 3 - mod }).fill('') } + + return [] }) watch(selectedImage, () => { diff --git a/src/runtime/middleware/authentication.ts b/src/runtime/middleware/authentication.ts index 7fb8902..97bf0ca 100644 --- a/src/runtime/middleware/authentication.ts +++ b/src/runtime/middleware/authentication.ts @@ -1,4 +1,4 @@ -import {defineNuxtRouteMiddleware, useCookie, useNuxtApp, useRuntimeConfig} from '#imports' +import { defineNuxtRouteMiddleware, useCookie, useNuxtApp, useRuntimeConfig } from '#imports' export default defineNuxtRouteMiddleware(async (to) => { const checkAuth = import.meta.client ? clientSideAuthentication : serverSideAuthentication @@ -25,8 +25,8 @@ const serverSideAuthentication = async () => { const token = useCookie('token') if (!token.value) return false const runtimeConfig = useRuntimeConfig() - const {$verifyJwtToken} = useNuxtApp() - return $verifyJwtToken(token.value, runtimeConfig.secret||'') + const { $verifyJwtToken } = useNuxtApp() + return $verifyJwtToken(token.value, runtimeConfig.secret || '') } const clientSideAuthentication = async () => {