@schemasentry/next 0.1.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,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 Schema Sentry
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/dist/index.cjs ADDED
@@ -0,0 +1,52 @@
1
+ "use strict";
2
+ var __defProp = Object.defineProperty;
3
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
+ var __getOwnPropNames = Object.getOwnPropertyNames;
5
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
6
+ var __export = (target, all) => {
7
+ for (var name in all)
8
+ __defProp(target, name, { get: all[name], enumerable: true });
9
+ };
10
+ var __copyProps = (to, from, except, desc) => {
11
+ if (from && typeof from === "object" || typeof from === "function") {
12
+ for (let key of __getOwnPropNames(from))
13
+ if (!__hasOwnProp.call(to, key) && key !== except)
14
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
15
+ }
16
+ return to;
17
+ };
18
+ var __reExport = (target, mod, secondTarget) => (__copyProps(target, mod, "default"), secondTarget && __copyProps(secondTarget, mod, "default"));
19
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
20
+
21
+ // src/index.tsx
22
+ var index_exports = {};
23
+ __export(index_exports, {
24
+ Schema: () => Schema
25
+ });
26
+ module.exports = __toCommonJS(index_exports);
27
+
28
+ // src/Schema.tsx
29
+ var import_core = require("@schemasentry/core");
30
+ var import_jsx_runtime = require("react/jsx-runtime");
31
+ var Schema = ({ data, id, nonce }) => {
32
+ const blocks = Array.isArray(data) ? data : [data];
33
+ const payload = blocks.length === 1 ? blocks[0] : blocks;
34
+ const json = (0, import_core.stableStringify)(payload);
35
+ return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
36
+ "script",
37
+ {
38
+ id,
39
+ nonce,
40
+ type: "application/ld+json",
41
+ dangerouslySetInnerHTML: { __html: json }
42
+ }
43
+ );
44
+ };
45
+
46
+ // src/index.tsx
47
+ __reExport(index_exports, require("@schemasentry/core"), module.exports);
48
+ // Annotate the CommonJS export names for ESM import in node:
49
+ 0 && (module.exports = {
50
+ Schema,
51
+ ...require("@schemasentry/core")
52
+ });
@@ -0,0 +1,12 @@
1
+ import * as react_jsx_runtime from 'react/jsx-runtime';
2
+ import { SchemaNode } from '@schemasentry/core';
3
+ export * from '@schemasentry/core';
4
+
5
+ type SchemaProps = {
6
+ data: SchemaNode | SchemaNode[];
7
+ id?: string;
8
+ nonce?: string;
9
+ };
10
+ declare const Schema: ({ data, id, nonce }: SchemaProps) => react_jsx_runtime.JSX.Element;
11
+
12
+ export { Schema };
@@ -0,0 +1,12 @@
1
+ import * as react_jsx_runtime from 'react/jsx-runtime';
2
+ import { SchemaNode } from '@schemasentry/core';
3
+ export * from '@schemasentry/core';
4
+
5
+ type SchemaProps = {
6
+ data: SchemaNode | SchemaNode[];
7
+ id?: string;
8
+ nonce?: string;
9
+ };
10
+ declare const Schema: ({ data, id, nonce }: SchemaProps) => react_jsx_runtime.JSX.Element;
11
+
12
+ export { Schema };
package/dist/index.js ADDED
@@ -0,0 +1,23 @@
1
+ // src/Schema.tsx
2
+ import { stableStringify } from "@schemasentry/core";
3
+ import { jsx } from "react/jsx-runtime";
4
+ var Schema = ({ data, id, nonce }) => {
5
+ const blocks = Array.isArray(data) ? data : [data];
6
+ const payload = blocks.length === 1 ? blocks[0] : blocks;
7
+ const json = stableStringify(payload);
8
+ return /* @__PURE__ */ jsx(
9
+ "script",
10
+ {
11
+ id,
12
+ nonce,
13
+ type: "application/ld+json",
14
+ dangerouslySetInnerHTML: { __html: json }
15
+ }
16
+ );
17
+ };
18
+
19
+ // src/index.tsx
20
+ export * from "@schemasentry/core";
21
+ export {
22
+ Schema
23
+ };
package/package.json ADDED
@@ -0,0 +1,57 @@
1
+ {
2
+ "name": "@schemasentry/next",
3
+ "version": "0.1.0",
4
+ "description": "Next.js App Router bindings for Schema Sentry.",
5
+ "license": "MIT",
6
+ "type": "module",
7
+ "sideEffects": false,
8
+ "main": "./dist/index.cjs",
9
+ "module": "./dist/index.js",
10
+ "types": "./dist/index.d.ts",
11
+ "exports": {
12
+ ".": {
13
+ "types": "./dist/index.d.ts",
14
+ "import": "./dist/index.js",
15
+ "require": "./dist/index.cjs"
16
+ }
17
+ },
18
+ "files": [
19
+ "dist"
20
+ ],
21
+ "repository": {
22
+ "type": "git",
23
+ "url": "https://github.com/arindamdawn/schema-sentry.git",
24
+ "directory": "packages/next"
25
+ },
26
+ "homepage": "https://github.com/arindamdawn/schema-sentry#readme",
27
+ "bugs": {
28
+ "url": "https://github.com/arindamdawn/schema-sentry/issues"
29
+ },
30
+ "keywords": [
31
+ "schema",
32
+ "json-ld",
33
+ "structured-data",
34
+ "seo",
35
+ "nextjs",
36
+ "react"
37
+ ],
38
+ "publishConfig": {
39
+ "access": "public"
40
+ },
41
+ "dependencies": {
42
+ "@schemasentry/core": "0.1.0"
43
+ },
44
+ "peerDependencies": {
45
+ "next": ">=13.4.0",
46
+ "react": ">=18.0.0"
47
+ },
48
+ "devDependencies": {
49
+ "react": "^19.1.1",
50
+ "react-dom": "^19.1.1"
51
+ },
52
+ "scripts": {
53
+ "build": "tsup src/index.tsx --format esm,cjs --dts --clean --tsconfig tsconfig.build.json",
54
+ "lint": "echo \"lint not configured\" && exit 0",
55
+ "test": "vitest run"
56
+ }
57
+ }