Skip to content

Commit

Permalink
chore: added type checks in ci + updated documentation
Browse files Browse the repository at this point in the history
  • Loading branch information
Frederik Bussmann committed Feb 16, 2024
1 parent 4894e9a commit cc024b0
Show file tree
Hide file tree
Showing 7 changed files with 2,340 additions and 2,140 deletions.
3 changes: 2 additions & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,8 @@ jobs:

- run: npm install
- run: npm run dev:prepare
- run: npm run lint
- run: npm run lint:es
- run: npm run lint:types
- run: npm run test

release:
Expand Down
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
# 1.0.3
- Added type checks in ci + updated documentation

# 1.0.2
- Updated package.json

Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ text editor element:

```vue
<script setup lang="ts">
import type { BlockNode } from 'nuxt-strapi-blocks-renderer/dist/runtime/types';
import type { BlockNode } from '#strapi-blocks-renderer/types';
import type { Restaurant } from '~/types';
const route = useRoute();
Expand Down
4,428 changes: 2,309 additions & 2,119 deletions package-lock.json

Large diffs are not rendered by default.

31 changes: 16 additions & 15 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "nuxt-strapi-blocks-renderer",
"version": "1.0.2",
"version": "1.0.3",
"description": "Renderer for the strapi blocks text element.",
"license": "MIT",
"repository": {
Expand Down Expand Up @@ -28,26 +28,27 @@
"dev:custom": "nuxi dev playground/custom",
"release": "npm run lint && npm run test && npm run prepack && npm publish",
"release:ci": "npm run prepack && npm publish",
"lint": "eslint './**/*.{js,ts,vue}' --max-warnings=0",
"lint:es": "eslint './**/*.{js,ts,vue}' --max-warnings=0",
"lint:types": "tsc",
"test": "vitest run",
"test:watch": "vitest watch"
},
"dependencies": {
"@nuxt/kit": "^3.8.2",
"defu": "^6.1.3"
"@nuxt/kit": "^3.10.2",
"defu": "^6.1.4"
},
"devDependencies": {
"@types/node": "^20.10.3",
"@nuxt/devtools": "^1.0.6",
"@types/node": "^20.11.19",
"@nuxt/devtools": "^1.0.8",
"@nuxt/eslint-config": "^0.2.0",
"@nuxt/module-builder": "^0.5.4",
"@nuxt/schema": "^3.8.2",
"@nuxt/test-utils": "^3.8.1",
"@stylistic/eslint-plugin": "^1.5.1",
"eslint": "^8.55.0",
"nuxt": "^3.8.2",
"vitest": "^1.1.0",
"vue": "^3.3.13",
"vue-eslint-parser": "^9.3.2"
"@nuxt/module-builder": "^0.5.5",
"@nuxt/schema": "^3.10.2",
"@nuxt/test-utils": "^3.11.0",
"@stylistic/eslint-plugin": "^1.6.2",
"eslint": "^8.56.0",
"nuxt": "^3.10.2",
"vitest": "^1.3.0",
"vue": "^3.4.19",
"vue-eslint-parser": "^9.4.2"
}
}
4 changes: 3 additions & 1 deletion src/module.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,9 @@ export default defineNuxtModule<ModuleOptions>({
nuxt.options.alias['#strapi-blocks-renderer'] = resolve(runtimeDirectory);

const runtimeConfig: RuntimeConfig = nuxt.options.runtimeConfig;
runtimeConfig.public.strapiBlocksRenderer = defu(runtimeConfig.public.strapiBlocksRenderer, options);

runtimeConfig.public.strapiBlocksRenderer =
defu(runtimeConfig.public.strapiBlocksRenderer as ModuleOptions, options);

addImports([{
name: 'useBlocksText',
Expand Down
9 changes: 6 additions & 3 deletions src/runtime/utils/index.ts
Original file line number Diff line number Diff line change
@@ -1,12 +1,13 @@
import { resolveComponent, useRuntimeConfig, h } from '#imports';

import type { ConcreteComponent } from 'vue';
import type { ConcreteComponent, VNode } from 'vue';

import type {
BlockNode,
CodeBlockNode,
DefaultInlineNode,
HeadingBlockNode, ImageBlockNode,
HeadingBlockNode,
ImageBlockNode,
LinkInlineNode,
ListBlockNode,
ListItemInlineNode,
Expand All @@ -15,10 +16,12 @@ import type {
TextInlineNode
} from '#strapi-blocks-renderer/types';

import type { ModuleOptions } from '~/src/module';

const prefix = (): string => {
const { public: { strapiBlocksRenderer } } = useRuntimeConfig();

return strapiBlocksRenderer.blocksPrefix;
return (strapiBlocksRenderer as ModuleOptions).blocksPrefix;
};

export const textInlineNode = (node: TextInlineNode): VNode | string => {
Expand Down

0 comments on commit cc024b0

Please sign in to comment.