@json-to-office/json-to-docx 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,18 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 Wiseair srl
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy of this software and
6
+ associated documentation files (the "Software"), to deal in the Software without restriction, including
7
+ without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
8
+ copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the
9
+ following conditions:
10
+
11
+ The above copyright notice and this permission notice shall be included in all copies or substantial
12
+ portions of the Software.
13
+
14
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT
15
+ LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO
16
+ EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
17
+ IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
18
+ USE OR OTHER DEALINGS IN THE SOFTWARE.
package/README.md ADDED
@@ -0,0 +1,27 @@
1
+ # @json-to-office/json-to-docx
2
+
3
+ Generate professional .docx documents from JSON definitions.
4
+
5
+ ## Install
6
+
7
+ ```bash
8
+ npm install @json-to-office/json-to-docx docx
9
+ ```
10
+
11
+ ## Usage
12
+
13
+ ```ts
14
+ import { generateDocx } from '@json-to-office/json-to-docx';
15
+
16
+ const buffer = await generateDocx({
17
+ sections: [
18
+ {
19
+ children: [{ type: 'paragraph', text: 'Hello!' }],
20
+ },
21
+ ],
22
+ });
23
+ ```
24
+
25
+ ## License
26
+
27
+ [MIT](../../LICENSE)
package/dist/index.cjs ADDED
@@ -0,0 +1,43 @@
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.ts
22
+ var index_exports = {};
23
+ __export(index_exports, {
24
+ compareSemver: () => import_shared.compareSemver,
25
+ generateDocument: () => import_core_docx.generateDocument,
26
+ isValidSemver: () => import_shared.isValidSemver,
27
+ latestVersion: () => import_shared.latestVersion,
28
+ parseSemver: () => import_shared.parseSemver
29
+ });
30
+ module.exports = __toCommonJS(index_exports);
31
+ var import_core_docx = require("@json-to-office/core-docx");
32
+ __reExport(index_exports, require("@json-to-office/shared-docx"), module.exports);
33
+ var import_shared = require("@json-to-office/shared");
34
+ // Annotate the CommonJS export names for ESM import in node:
35
+ 0 && (module.exports = {
36
+ compareSemver,
37
+ generateDocument,
38
+ isValidSemver,
39
+ latestVersion,
40
+ parseSemver,
41
+ ...require("@json-to-office/shared-docx")
42
+ });
43
+ //# sourceMappingURL=index.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/index.ts"],"sourcesContent":["/**\n * @json-to-office/json-to-docx\n *\n * Public API package for DOCX document generation.\n * Re-exports from core-docx and shared-docx.\n */\n\n// Core generation API\nexport { generateDocument } from '@json-to-office/core-docx';\n\n// Re-export shared-docx schemas and types\nexport * from '@json-to-office/shared-docx';\n\n// Re-export shared utilities\nexport {\n type ComponentDefinition,\n type GenerationWarning,\n type AddWarningFunction,\n type ValidationError,\n type ParsedSemver,\n isValidSemver,\n parseSemver,\n compareSemver,\n latestVersion,\n} from '@json-to-office/shared';\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAQA,uBAAiC;AAGjC,0BAAc,wCAXd;AAcA,oBAUO;","names":[]}
@@ -0,0 +1,3 @@
1
+ export { generateDocument } from '@json-to-office/core-docx';
2
+ export * from '@json-to-office/shared-docx';
3
+ export { AddWarningFunction, ComponentDefinition, GenerationWarning, ParsedSemver, ValidationError, compareSemver, isValidSemver, latestVersion, parseSemver } from '@json-to-office/shared';
@@ -0,0 +1,3 @@
1
+ export { generateDocument } from '@json-to-office/core-docx';
2
+ export * from '@json-to-office/shared-docx';
3
+ export { AddWarningFunction, ComponentDefinition, GenerationWarning, ParsedSemver, ValidationError, compareSemver, isValidSemver, latestVersion, parseSemver } from '@json-to-office/shared';
package/dist/index.js ADDED
@@ -0,0 +1,17 @@
1
+ // src/index.ts
2
+ import { generateDocument } from "@json-to-office/core-docx";
3
+ export * from "@json-to-office/shared-docx";
4
+ import {
5
+ isValidSemver,
6
+ parseSemver,
7
+ compareSemver,
8
+ latestVersion
9
+ } from "@json-to-office/shared";
10
+ export {
11
+ compareSemver,
12
+ generateDocument,
13
+ isValidSemver,
14
+ latestVersion,
15
+ parseSemver
16
+ };
17
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/index.ts"],"sourcesContent":["/**\n * @json-to-office/json-to-docx\n *\n * Public API package for DOCX document generation.\n * Re-exports from core-docx and shared-docx.\n */\n\n// Core generation API\nexport { generateDocument } from '@json-to-office/core-docx';\n\n// Re-export shared-docx schemas and types\nexport * from '@json-to-office/shared-docx';\n\n// Re-export shared utilities\nexport {\n type ComponentDefinition,\n type GenerationWarning,\n type AddWarningFunction,\n type ValidationError,\n type ParsedSemver,\n isValidSemver,\n parseSemver,\n compareSemver,\n latestVersion,\n} from '@json-to-office/shared';\n"],"mappings":";AAQA,SAAS,wBAAwB;AAGjC,cAAc;AAGd;AAAA,EAME;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OACK;","names":[]}
package/package.json ADDED
@@ -0,0 +1,82 @@
1
+ {
2
+ "name": "@json-to-office/json-to-docx",
3
+ "version": "0.1.0",
4
+ "description": "Professional .docx document generation from JSON - Public API package",
5
+ "type": "module",
6
+ "main": "dist/index.cjs",
7
+ "module": "dist/index.js",
8
+ "types": "dist/index.d.ts",
9
+ "exports": {
10
+ ".": {
11
+ "import": {
12
+ "types": "./dist/index.d.ts",
13
+ "default": "./dist/index.js"
14
+ },
15
+ "require": {
16
+ "types": "./dist/index.d.cts",
17
+ "default": "./dist/index.cjs"
18
+ }
19
+ },
20
+ "./package.json": "./package.json"
21
+ },
22
+ "files": [
23
+ "dist",
24
+ "LICENSE"
25
+ ],
26
+ "dependencies": {
27
+ "@json-to-office/core-docx": "^0.1.0",
28
+ "@json-to-office/shared": "^0.1.0",
29
+ "@json-to-office/shared-docx": "^0.1.0"
30
+ },
31
+ "peerDependencies": {
32
+ "docx": "9.5.1",
33
+ "highcharts-export-server": "5.0.0"
34
+ },
35
+ "peerDependenciesMeta": {
36
+ "highcharts-export-server": {
37
+ "optional": true
38
+ }
39
+ },
40
+ "devDependencies": {
41
+ "@types/node": "20.11.0",
42
+ "tsup": "8.5.0",
43
+ "typescript": "5.3.3"
44
+ },
45
+ "keywords": [
46
+ "docx",
47
+ "document",
48
+ "generator",
49
+ "typescript",
50
+ "json",
51
+ "word"
52
+ ],
53
+ "author": "Paolo Barbato",
54
+ "license": "MIT",
55
+ "engines": {
56
+ "node": ">=20.0.0"
57
+ },
58
+ "repository": {
59
+ "type": "git",
60
+ "url": "https://github.com/Wiseair-srl/json-to-office.git",
61
+ "directory": "packages/json-to-docx"
62
+ },
63
+ "homepage": "https://github.com/Wiseair-srl/json-to-office/tree/main/packages/json-to-docx",
64
+ "bugs": {
65
+ "url": "https://github.com/Wiseair-srl/json-to-office/issues"
66
+ },
67
+ "publishConfig": {
68
+ "access": "public"
69
+ },
70
+ "scripts": {
71
+ "build": "tsup",
72
+ "dev": "tsup --watch",
73
+ "clean": "rm -rf dist",
74
+ "lint": "eslint src/**/*.ts",
75
+ "lint:fix": "eslint src/**/*.ts --fix",
76
+ "format": "prettier --write \"src/**/*.ts\"",
77
+ "typecheck": "tsc --noEmit",
78
+ "test": "vitest run --passWithNoTests",
79
+ "test:watch": "vitest",
80
+ "test:coverage": "vitest run --coverage --passWithNoTests"
81
+ }
82
+ }