Skip to content

Commit

Permalink
feat(katzencore): Changed README, fixed ESLint issues
Browse files Browse the repository at this point in the history
  • Loading branch information
maxlkatze committed Jul 19, 2024
1 parent a89a76f commit 191d655
Show file tree
Hide file tree
Showing 5 changed files with 33 additions and 30 deletions.
48 changes: 25 additions & 23 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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)
<!-- - [🏀 Online playground](https://stackblitz.com/github/your-org/my-module?file=playground%2Fapp.vue) -->
<!-- - [🏀 Online playground](https://stackblitz.com/github/your-org/cms-katze?file=playground%2Fapp.vue) -->
<!-- - [📖 &nbsp;Documentation](https://example.com) -->

## Features

<!-- Highlight some of the features your module provide here -->
-&nbsp;Foo
- 🚠 &nbsp;Bar
- 🌲 &nbsp;Baz
- 📝 &nbsp;In app CMS editor for easy content management
- 🎨 &nbsp;Customizable content blocks
- 📦 &nbsp;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`

<details>
<summary>Local development</summary>

Expand All @@ -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
```
Expand All @@ -71,14 +73,14 @@ That's it! You can now use My Module in your Nuxt app ✨


<!-- Badges -->
[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
2 changes: 1 addition & 1 deletion playground/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"private": true,
"name": "my-module-playground",
"name": "cms-katze-playground",
"type": "module",
"scripts": {
"dev": "nuxi dev",
Expand Down
5 changes: 2 additions & 3 deletions src/module.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import fs from 'node:fs'
import {
addComponentsDir,
addImportsDir,
Expand All @@ -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
Expand Down
2 changes: 2 additions & 0 deletions src/runtime/components/views/EditView.vue
Original file line number Diff line number Diff line change
Expand Up @@ -290,6 +290,8 @@ const fillEmptySpace = computed(() => {
if (mod > 0) {
return Array.from({ length: 3 - mod }).fill('')
}
return []
})
watch(selectedImage, () => {
Expand Down
6 changes: 3 additions & 3 deletions src/runtime/middleware/authentication.ts
Original file line number Diff line number Diff line change
@@ -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
Expand All @@ -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 () => {
Expand Down

0 comments on commit 191d655

Please sign in to comment.