@deenruv/seo-plugin 1.0.0

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,23 @@
1
+ # License 1
2
+
3
+ The MIT License
4
+
5
+ Copyright (c) 2025-present Aexol
6
+
7
+ 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:
8
+
9
+ The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
10
+
11
+ 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.
12
+
13
+ # License 2
14
+
15
+ The MIT License
16
+
17
+ Copyright (c) 2018-2025 Michael Bromley
18
+
19
+ 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:
20
+
21
+ The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
22
+
23
+ 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.
package/README.md ADDED
@@ -0,0 +1,39 @@
1
+ # @deenruv/seo-plugin
2
+
3
+ A lightweight SEO plugin that adds custom fields for SEO metadata (title, description, social media images) to Products and Collections in your Deenruv store.
4
+
5
+ ## Installation
6
+
7
+ ```bash
8
+ pnpm add @deenruv/seo-plugin
9
+ ```
10
+
11
+ ## Configuration
12
+
13
+ ```typescript
14
+ import { SeoPlugin } from '@deenruv/seo-plugin';
15
+
16
+ // In your Deenruv server config:
17
+ plugins: [
18
+ SeoPlugin,
19
+ ]
20
+ ```
21
+
22
+ No additional configuration options are required. The plugin automatically registers custom fields on Products and Collections.
23
+
24
+ ## Features
25
+
26
+ - Locale-aware `seoTitle` custom field on Products and Collections
27
+ - Locale-aware `seoDescription` custom field on Products and Collections
28
+ - `facebookImage` asset relation for Open Graph social sharing images
29
+ - `twitterImage` asset relation for Twitter Card images
30
+ - All SEO fields grouped under an "SEO" tab in the admin UI
31
+ - All fields are publicly accessible via the Shop API
32
+
33
+ ## Admin UI
34
+
35
+ This plugin is server-only and does not add any admin UI extensions. The SEO custom fields are automatically displayed under the "SEO" tab in the Product and Collection detail pages of the standard admin UI.
36
+
37
+ ## API Extensions
38
+
39
+ This plugin does not add any custom GraphQL API extensions. The SEO fields are exposed as custom fields on the existing `Product` and `Collection` types and are accessible via the standard custom fields API.
@@ -0,0 +1,2 @@
1
+ export declare class SeoPlugin {
2
+ }
@@ -0,0 +1,60 @@
1
+ "use strict";
2
+ var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
3
+ var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
4
+ if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
5
+ else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
6
+ return c > 3 && r && Object.defineProperty(target, key, r), r;
7
+ };
8
+ Object.defineProperty(exports, "__esModule", { value: true });
9
+ exports.SeoPlugin = void 0;
10
+ const core_1 = require("@deenruv/core");
11
+ const SeoCustomFields = [
12
+ {
13
+ name: "seoTitle",
14
+ type: "localeString",
15
+ label: [{ languageCode: core_1.LanguageCode.en, value: "SEO Title" }],
16
+ ui: { tab: "SEO" },
17
+ public: true,
18
+ },
19
+ {
20
+ name: "seoDescription",
21
+ type: "localeString",
22
+ label: [{ languageCode: core_1.LanguageCode.en, value: "SEO Description" }],
23
+ ui: { tab: "SEO" },
24
+ public: true,
25
+ },
26
+ {
27
+ name: "facebookImage",
28
+ type: "relation",
29
+ graphQLType: "Asset",
30
+ entity: core_1.Asset,
31
+ label: [{ languageCode: core_1.LanguageCode.en, value: "Facebook SEO image" }],
32
+ ui: { tab: "SEO" },
33
+ eager: true,
34
+ public: true,
35
+ },
36
+ {
37
+ name: "twitterImage",
38
+ type: "relation",
39
+ graphQLType: "Asset",
40
+ entity: core_1.Asset,
41
+ label: [{ languageCode: core_1.LanguageCode.en, value: "Twitter SEO image" }],
42
+ ui: { tab: "SEO" },
43
+ eager: true,
44
+ public: true,
45
+ },
46
+ ];
47
+ let SeoPlugin = class SeoPlugin {
48
+ };
49
+ exports.SeoPlugin = SeoPlugin;
50
+ exports.SeoPlugin = SeoPlugin = __decorate([
51
+ (0, core_1.DeenruvPlugin)({
52
+ compatibility: "^0.0.20",
53
+ imports: [core_1.PluginCommonModule],
54
+ configuration: (config) => {
55
+ config.customFields.Product.push(...SeoCustomFields);
56
+ config.customFields.Collection.push(...SeoCustomFields);
57
+ return config;
58
+ },
59
+ })
60
+ ], SeoPlugin);
package/package.json ADDED
@@ -0,0 +1,33 @@
1
+ {
2
+ "name": "@deenruv/seo-plugin",
3
+ "version": "1.0.0",
4
+ "homepage": "https://deenruv.com/",
5
+ "license": "MIT",
6
+ "files": [
7
+ "dist/**/*"
8
+ ],
9
+ "main": "./dist/plugin-server/index.js",
10
+ "exports": {
11
+ ".": "./dist/plugin-server/index.js",
12
+ "./plugin-server": "./dist/plugin-server/index.js"
13
+ },
14
+ "dependencies": {
15
+ "@deenruv/common": "^1.0.0",
16
+ "@deenruv/react-ui-devkit": "^1.0.0"
17
+ },
18
+ "peerDependencies": {
19
+ "@deenruv/core": "^0.1.0"
20
+ },
21
+ "devDependencies": {
22
+ "rimraf": "^5.0.10",
23
+ "typescript": "5.3.3",
24
+ "@deenruv/core": "^1.0.0"
25
+ },
26
+ "scripts": {
27
+ "build": "rimraf dist && tsc --build",
28
+ "watch": "tsc --build --watch",
29
+ "lint": "eslint .",
30
+ "lint:fix": "eslint --fix .",
31
+ "zeus": "zeus http://localhost:3000/admin-api ./src/plugin-server && zeus http://localhost:3000/admin-api ./src/plugin-ui"
32
+ }
33
+ }