@nuxt-ignis/content 0.0.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2023-2025 Alois Sečkár
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md ADDED
@@ -0,0 +1,24 @@
1
+ # @nuxt-ignis/content
2
+
3
+ [![npm version][npm-version-src]][npm-version-href]
4
+ [![npm downloads][npm-downloads-src]][npm-downloads-href]
5
+ [![License][license-src]][license-href]
6
+ [![Nuxt][nuxt-src]][nuxt-href]
7
+
8
+ Service module providing Content features for Nuxt Ignis
9
+
10
+ See https://nuxt-ignis.com/
11
+
12
+
13
+ <!-- Badges -->
14
+ [npm-version-src]: https://img.shields.io/npm/v/@nuxt-ignis/content/latest.svg?style=flat&colorA=020420&colorB=00DC82
15
+ [npm-version-href]: https://npmjs.com/package/@nuxt-ignis/content
16
+
17
+ [npm-downloads-src]: https://img.shields.io/npm/dm/@nuxt-ignis/content.svg?style=flat&colorA=020420&colorB=00DC82
18
+ [npm-downloads-href]: https://npm.chart.dev/@nuxt-ignis/content
19
+
20
+ [license-src]: https://img.shields.io/npm/l/@nuxt-ignis/content.svg?style=flat&colorA=020420&colorB=00DC82
21
+ [license-href]: https://npmjs.com/package/@nuxt-ignis/content
22
+
23
+ [nuxt-src]: https://img.shields.io/badge/Nuxt-020420?logo=nuxt
24
+ [nuxt-href]: https://nuxt.com
@@ -0,0 +1,20 @@
1
+ import * as _nuxt_schema from '@nuxt/schema';
2
+
3
+ interface ModuleOptions {
4
+ content?: {
5
+ enabled: boolean;
6
+ };
7
+ i18n?: {
8
+ enabled: boolean;
9
+ default?: string;
10
+ config?: string;
11
+ };
12
+ pslo?: {
13
+ enabled: boolean;
14
+ content?: boolean;
15
+ };
16
+ }
17
+ declare const _default: _nuxt_schema.NuxtModule<ModuleOptions, ModuleOptions, false>;
18
+
19
+ export { _default as default };
20
+ export type { ModuleOptions };
@@ -0,0 +1,9 @@
1
+ {
2
+ "name": "@nuxt-ignis/content",
3
+ "configKey": "ignisContent",
4
+ "version": "0.0.1",
5
+ "builder": {
6
+ "@nuxt/module-builder": "1.0.2",
7
+ "unbuild": "3.6.1"
8
+ }
9
+ }
@@ -0,0 +1,57 @@
1
+ import { defineNuxtModule, createResolver, installModule, addPlugin } from '@nuxt/kit';
2
+ import { createConsola } from 'consola';
3
+
4
+ const log = createConsola({ defaults: { tag: "nuxt-ignis" } });
5
+ const module$1 = defineNuxtModule({
6
+ meta: {
7
+ name: "@nuxt-ignis/content",
8
+ configKey: "ignisContent"
9
+ },
10
+ setup(options, nuxt) {
11
+ const resolver = createResolver(import.meta.url);
12
+ nuxt.options.runtimeConfig.public.ignis ||= {
13
+ content: { enabled: false },
14
+ i18n: { enabled: false, default: "en", config: "./i18n.config.ts" },
15
+ pslo: { enabled: false, content: false }
16
+ };
17
+ nuxt.options.runtimeConfig.public.ignis.content = options.content?.enabled || false;
18
+ nuxt.options.runtimeConfig.public.ignis.i18n = {
19
+ enabled: options.i18n?.enabled || false,
20
+ default: options.i18n?.default || "en",
21
+ config: options.i18n?.config || "./i18n.config.ts"
22
+ };
23
+ nuxt.options.runtimeConfig.public.ignis.pslo = {
24
+ enabled: options.pslo?.enabled || false,
25
+ content: options.pslo?.content || false
26
+ };
27
+ if (options.i18n?.enabled === true) {
28
+ installModule("@nuxtjs/i18n", {
29
+ vueI18n: options.i18n?.config || "./i18n.config.ts",
30
+ locales: [options.i18n?.default || "en"],
31
+ strategy: "no_prefix",
32
+ bundle: {
33
+ optimizeTranslationDirective: false
34
+ }
35
+ });
36
+ console.debug("@nuxtjs/i18n module installed");
37
+ }
38
+ if (options.content?.enabled === true) {
39
+ installModule("@nuxt/content");
40
+ console.debug("@nuxt/content module installed");
41
+ }
42
+ if (options.pslo?.enabled === true) {
43
+ console.debug("elrh-pslo enabled");
44
+ if (options.content?.enabled === true && options.pslo?.content === true) {
45
+ nuxt.hook("content:file:beforeParse", async (ctx) => {
46
+ const { preventSingleLetterOrphans } = await import('elrh-pslo');
47
+ const { file } = ctx;
48
+ file.body = preventSingleLetterOrphans(file.body);
49
+ log.debug(`Nuxt Content file ${file.id} processed with elrh-pslo`);
50
+ });
51
+ }
52
+ }
53
+ addPlugin(resolver.resolve("./runtime/plugin"));
54
+ }
55
+ });
56
+
57
+ export { module$1 as default };
@@ -0,0 +1,2 @@
1
+ declare const _default: import("#app").Plugin<Record<string, unknown>> & import("#app").ObjectPlugin<Record<string, unknown>>;
2
+ export default _default;
@@ -0,0 +1,4 @@
1
+ import { defineNuxtPlugin } from "#app";
2
+ export default defineNuxtPlugin((_nuxtApp) => {
3
+ console.log("@nuxt-ignis/content ran and executed this plugin!");
4
+ });
@@ -0,0 +1,3 @@
1
+ {
2
+ "extends": "../../../.nuxt/tsconfig.server.json",
3
+ }
@@ -0,0 +1,3 @@
1
+ export { default } from './module.mjs'
2
+
3
+ export { type ModuleOptions } from './module.mjs'
package/package.json ADDED
@@ -0,0 +1,66 @@
1
+ {
2
+ "name": "@nuxt-ignis/content",
3
+ "version": "0.0.1",
4
+ "description": "Nuxt Ignis module - Content features",
5
+ "publishConfig": {
6
+ "access": "public"
7
+ },
8
+ "repository": {
9
+ "type": "git",
10
+ "url": "git+https://github.com/AloisSeckar/nuxt-ignis.git"
11
+ },
12
+ "license": "MIT",
13
+ "type": "module",
14
+ "exports": {
15
+ ".": {
16
+ "types": "./dist/types.d.mts",
17
+ "import": "./dist/module.mjs"
18
+ }
19
+ },
20
+ "main": "./dist/module.mjs",
21
+ "typesVersions": {
22
+ "*": {
23
+ ".": [
24
+ "./dist/types.d.mts"
25
+ ]
26
+ }
27
+ },
28
+ "files": [
29
+ "dist"
30
+ ],
31
+ "workspaces": [
32
+ "playground"
33
+ ],
34
+ "dependencies": {
35
+ "@nuxt/kit": "4.3.1",
36
+ "@nuxt/content": "3.11.2",
37
+ "@nuxtjs/i18n": "10.2.3",
38
+ "better-sqlite3": "12.2.0",
39
+ "consola": "3.4.2",
40
+ "elrh-pslo": "1.1.6"
41
+ },
42
+ "devDependencies": {
43
+ "@nuxt/devtools": "^3.1.1",
44
+ "@nuxt/eslint-config": "^1.14.0",
45
+ "@nuxt/module-builder": "^1.0.2",
46
+ "@nuxt/schema": "4.3.1",
47
+ "@nuxt/test-utils": "^4.0.0",
48
+ "@types/node": "^25.2.2",
49
+ "changelogen": "^0.6.2",
50
+ "eslint": "^9.39.2",
51
+ "nuxt": "4.3.1",
52
+ "typescript": "^5.9.3",
53
+ "vitest": "^4.0.18",
54
+ "vue-tsc": "^3.2.4"
55
+ },
56
+ "scripts": {
57
+ "dev": "npm run dev:prepare && nuxt dev playground",
58
+ "dev:build": "nuxt build playground",
59
+ "dev:prepare": "nuxt-module-build build --stub && nuxt-module-build prepare && nuxt prepare playground",
60
+ "release": "npm run lint && npm run test && npm run prepack && changelogen --release && npm publish && git push --follow-tags",
61
+ "lint": "eslint .",
62
+ "test": "vitest run",
63
+ "test:watch": "vitest watch",
64
+ "test:types": "vue-tsc --noEmit && cd playground && vue-tsc --noEmit"
65
+ }
66
+ }