@vutex/vutex 0.0.14 → 0.0.16

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.
@@ -0,0 +1,93 @@
1
+ Copyright 2022 The Noto Project Authors (https://github.com/notofonts/latin-greek-cyrillic)
2
+
3
+ This Font Software is licensed under the SIL Open Font License, Version 1.1.
4
+ This license is copied below, and is also available with a FAQ at:
5
+ https://scripts.sil.org/OFL
6
+
7
+
8
+ -----------------------------------------------------------
9
+ SIL OPEN FONT LICENSE Version 1.1 - 26 February 2007
10
+ -----------------------------------------------------------
11
+
12
+ PREAMBLE
13
+ The goals of the Open Font License (OFL) are to stimulate worldwide
14
+ development of collaborative font projects, to support the font creation
15
+ efforts of academic and linguistic communities, and to provide a free and
16
+ open framework in which fonts may be shared and improved in partnership
17
+ with others.
18
+
19
+ The OFL allows the licensed fonts to be used, studied, modified and
20
+ redistributed freely as long as they are not sold by themselves. The
21
+ fonts, including any derivative works, can be bundled, embedded,
22
+ redistributed and/or sold with any software provided that any reserved
23
+ names are not used by derivative works. The fonts and derivatives,
24
+ however, cannot be released under any other type of license. The
25
+ requirement for fonts to remain under this license does not apply
26
+ to any document created using the fonts or their derivatives.
27
+
28
+ DEFINITIONS
29
+ "Font Software" refers to the set of files released by the Copyright
30
+ Holder(s) under this license and clearly marked as such. This may
31
+ include source files, build scripts and documentation.
32
+
33
+ "Reserved Font Name" refers to any names specified as such after the
34
+ copyright statement(s).
35
+
36
+ "Original Version" refers to the collection of Font Software components as
37
+ distributed by the Copyright Holder(s).
38
+
39
+ "Modified Version" refers to any derivative made by adding to, deleting,
40
+ or substituting -- in part or in whole -- any of the components of the
41
+ Original Version, by changing formats or by porting the Font Software to a
42
+ new environment.
43
+
44
+ "Author" refers to any designer, engineer, programmer, technical
45
+ writer or other person who contributed to the Font Software.
46
+
47
+ PERMISSION & CONDITIONS
48
+ Permission is hereby granted, free of charge, to any person obtaining
49
+ a copy of the Font Software, to use, study, copy, merge, embed, modify,
50
+ redistribute, and sell modified and unmodified copies of the Font
51
+ Software, subject to the following conditions:
52
+
53
+ 1) Neither the Font Software nor any of its individual components,
54
+ in Original or Modified Versions, may be sold by itself.
55
+
56
+ 2) Original or Modified Versions of the Font Software may be bundled,
57
+ redistributed and/or sold with any software, provided that each copy
58
+ contains the above copyright notice and this license. These can be
59
+ included either as stand-alone text files, human-readable headers or
60
+ in the appropriate machine-readable metadata fields within text or
61
+ binary files as long as those fields can be easily viewed by the user.
62
+
63
+ 3) No Modified Version of the Font Software may use the Reserved Font
64
+ Name(s) unless explicit written permission is granted by the corresponding
65
+ Copyright Holder. This restriction only applies to the primary font name as
66
+ presented to the users.
67
+
68
+ 4) The name(s) of the Copyright Holder(s) or the Author(s) of the Font
69
+ Software shall not be used to promote, endorse or advertise any
70
+ Modified Version, except to acknowledge the contribution(s) of the
71
+ Copyright Holder(s) and the Author(s) or with their explicit written
72
+ permission.
73
+
74
+ 5) The Font Software, modified or unmodified, in part or in whole,
75
+ must be distributed entirely under this license, and must not be
76
+ distributed under any other license. The requirement for fonts to
77
+ remain under this license does not apply to any document created
78
+ using the Font Software.
79
+
80
+ TERMINATION
81
+ This license becomes null and void if any of the above conditions are
82
+ not met.
83
+
84
+ DISCLAIMER
85
+ THE FONT SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
86
+ EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTIES OF
87
+ MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT
88
+ OF COPYRIGHT, PATENT, TRADEMARK, OR OTHER RIGHT. IN NO EVENT SHALL THE
89
+ COPYRIGHT HOLDER BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
90
+ INCLUDING ANY GENERAL, SPECIAL, INDIRECT, INCIDENTAL, OR CONSEQUENTIAL
91
+ DAMAGES, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
92
+ FROM, OUT OF THE USE OR INABILITY TO USE THE FONT SOFTWARE OR FROM
93
+ OTHER DEALINGS IN THE FONT SOFTWARE.
@@ -0,0 +1,94 @@
1
+ Copyright 2012 Google Inc. All Rights Reserved.
2
+
3
+ This Font Software is licensed under the SIL Open Font License,
4
+ Version 1.1.
5
+
6
+ This license is copied below, and is also available with a FAQ at:
7
+ http://scripts.sil.org/OFL
8
+
9
+ -----------------------------------------------------------
10
+ SIL OPEN FONT LICENSE Version 1.1 - 26 February 2007
11
+ -----------------------------------------------------------
12
+
13
+ PREAMBLE
14
+ The goals of the Open Font License (OFL) are to stimulate worldwide
15
+ development of collaborative font projects, to support the font
16
+ creation efforts of academic and linguistic communities, and to
17
+ provide a free and open framework in which fonts may be shared and
18
+ improved in partnership with others.
19
+
20
+ The OFL allows the licensed fonts to be used, studied, modified and
21
+ redistributed freely as long as they are not sold by themselves. The
22
+ fonts, including any derivative works, can be bundled, embedded,
23
+ redistributed and/or sold with any software provided that any reserved
24
+ names are not used by derivative works. The fonts and derivatives,
25
+ however, cannot be released under any other type of license. The
26
+ requirement for fonts to remain under this license does not apply to
27
+ any document created using the fonts or their derivatives.
28
+
29
+ DEFINITIONS
30
+ "Font Software" refers to the set of files released by the Copyright
31
+ Holder(s) under this license and clearly marked as such. This may
32
+ include source files, build scripts and documentation.
33
+
34
+ "Reserved Font Name" refers to any names specified as such after the
35
+ copyright statement(s).
36
+
37
+ "Original Version" refers to the collection of Font Software
38
+ components as distributed by the Copyright Holder(s).
39
+
40
+ "Modified Version" refers to any derivative made by adding to,
41
+ deleting, or substituting -- in part or in whole -- any of the
42
+ components of the Original Version, by changing formats or by porting
43
+ the Font Software to a new environment.
44
+
45
+ "Author" refers to any designer, engineer, programmer, technical
46
+ writer or other person who contributed to the Font Software.
47
+
48
+ PERMISSION & CONDITIONS
49
+ Permission is hereby granted, free of charge, to any person obtaining
50
+ a copy of the Font Software, to use, study, copy, merge, embed,
51
+ modify, redistribute, and sell modified and unmodified copies of the
52
+ Font Software, subject to the following conditions:
53
+
54
+ 1) Neither the Font Software nor any of its individual components, in
55
+ Original or Modified Versions, may be sold by itself.
56
+
57
+ 2) Original or Modified Versions of the Font Software may be bundled,
58
+ redistributed and/or sold with any software, provided that each copy
59
+ contains the above copyright notice and this license. These can be
60
+ included either as stand-alone text files, human-readable headers or
61
+ in the appropriate machine-readable metadata fields within text or
62
+ binary files as long as those fields can be easily viewed by the user.
63
+
64
+ 3) No Modified Version of the Font Software may use the Reserved Font
65
+ Name(s) unless explicit written permission is granted by the
66
+ corresponding Copyright Holder. This restriction only applies to the
67
+ primary font name as presented to the users.
68
+
69
+ 4) The name(s) of the Copyright Holder(s) or the Author(s) of the Font
70
+ Software shall not be used to promote, endorse or advertise any
71
+ Modified Version, except to acknowledge the contribution(s) of the
72
+ Copyright Holder(s) and the Author(s) or with their explicit written
73
+ permission.
74
+
75
+ 5) The Font Software, modified or unmodified, in part or in whole,
76
+ must be distributed entirely under this license, and must not be
77
+ distributed under any other license. The requirement for fonts to
78
+ remain under this license does not apply to any document created using
79
+ the Font Software.
80
+
81
+ TERMINATION
82
+ This license becomes null and void if any of the above conditions are
83
+ not met.
84
+
85
+ DISCLAIMER
86
+ THE FONT SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
87
+ EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTIES OF
88
+ MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT
89
+ OF COPYRIGHT, PATENT, TRADEMARK, OR OTHER RIGHT. IN NO EVENT SHALL THE
90
+ COPYRIGHT HOLDER BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
91
+ INCLUDING ANY GENERAL, SPECIAL, INDIRECT, INCIDENTAL, OR CONSEQUENTIAL
92
+ DAMAGES, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
93
+ FROM, OUT OF THE USE OR INABILITY TO USE THE FONT SOFTWARE OR FROM
94
+ OTHER DEALINGS IN THE FONT SOFTWARE.
@@ -0,0 +1,93 @@
1
+ Copyright 2026 The Tinos Project Authors (https://github.com/googlefonts/tinos)
2
+
3
+ This Font Software is licensed under the SIL Open Font License, Version 1.1.
4
+ This license is copied below, and is also available with a FAQ at:
5
+ https://openfontlicense.org
6
+
7
+
8
+ -----------------------------------------------------------
9
+ SIL OPEN FONT LICENSE Version 1.1 - 26 February 2007
10
+ -----------------------------------------------------------
11
+
12
+ PREAMBLE
13
+ The goals of the Open Font License (OFL) are to stimulate worldwide
14
+ development of collaborative font projects, to support the font creation
15
+ efforts of academic and linguistic communities, and to provide a free and
16
+ open framework in which fonts may be shared and improved in partnership
17
+ with others.
18
+
19
+ The OFL allows the licensed fonts to be used, studied, modified and
20
+ redistributed freely as long as they are not sold by themselves. The
21
+ fonts, including any derivative works, can be bundled, embedded,
22
+ redistributed and/or sold with any software provided that any reserved
23
+ names are not used by derivative works. The fonts and derivatives,
24
+ however, cannot be released under any other type of license. The
25
+ requirement for fonts to remain under this license does not apply
26
+ to any document created using the fonts or their derivatives.
27
+
28
+ DEFINITIONS
29
+ "Font Software" refers to the set of files released by the Copyright
30
+ Holder(s) under this license and clearly marked as such. This may
31
+ include source files, build scripts and documentation.
32
+
33
+ "Reserved Font Name" refers to any names specified as such after the
34
+ copyright statement(s).
35
+
36
+ "Original Version" refers to the collection of Font Software components as
37
+ distributed by the Copyright Holder(s).
38
+
39
+ "Modified Version" refers to any derivative made by adding to, deleting,
40
+ or substituting -- in part or in whole -- any of the components of the
41
+ Original Version, by changing formats or by porting the Font Software to a
42
+ new environment.
43
+
44
+ "Author" refers to any designer, engineer, programmer, technical
45
+ writer or other person who contributed to the Font Software.
46
+
47
+ PERMISSION & CONDITIONS
48
+ Permission is hereby granted, free of charge, to any person obtaining
49
+ a copy of the Font Software, to use, study, copy, merge, embed, modify,
50
+ redistribute, and sell modified and unmodified copies of the Font
51
+ Software, subject to the following conditions:
52
+
53
+ 1) Neither the Font Software nor any of its individual components,
54
+ in Original or Modified Versions, may be sold by itself.
55
+
56
+ 2) Original or Modified Versions of the Font Software may be bundled,
57
+ redistributed and/or sold with any software, provided that each copy
58
+ contains the above copyright notice and this license. These can be
59
+ included either as stand-alone text files, human-readable headers or
60
+ in the appropriate machine-readable metadata fields within text or
61
+ binary files as long as those fields can be easily viewed by the user.
62
+
63
+ 3) No Modified Version of the Font Software may use the Reserved Font
64
+ Name(s) unless explicit written permission is granted by the corresponding
65
+ Copyright Holder. This restriction only applies to the primary font name as
66
+ presented to the users.
67
+
68
+ 4) The name(s) of the Copyright Holder(s) or the Author(s) of the Font
69
+ Software shall not be used to promote, endorse or advertise any
70
+ Modified Version, except to acknowledge the contribution(s) of the
71
+ Copyright Holder(s) and the Author(s) or with their explicit written
72
+ permission.
73
+
74
+ 5) The Font Software, modified or unmodified, in part or in whole,
75
+ must be distributed entirely under this license, and must not be
76
+ distributed under any other license. The requirement for fonts to
77
+ remain under this license does not apply to any document created
78
+ using the Font Software.
79
+
80
+ TERMINATION
81
+ This license becomes null and void if any of the above conditions are
82
+ not met.
83
+
84
+ DISCLAIMER
85
+ THE FONT SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
86
+ EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTIES OF
87
+ MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT
88
+ OF COPYRIGHT, PATENT, TRADEMARK, OR OTHER RIGHT. IN NO EVENT SHALL THE
89
+ COPYRIGHT HOLDER BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
90
+ INCLUDING ANY GENERAL, SPECIAL, INDIRECT, INCIDENTAL, OR CONSEQUENTIAL
91
+ DAMAGES, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
92
+ FROM, OUT OF THE USE OR INABILITY TO USE THE FONT SOFTWARE OR FROM
93
+ OTHER DEALINGS IN THE FONT SOFTWARE.
@@ -3,16 +3,17 @@
3
3
  "cli.cmd.render": "Render a document to the configured output format",
4
4
  "cli.cmd.inspect": "Inspect input format and document metadata",
5
5
  "cli.cmd.package": "Manage VuTeX resource packages (fonts, templates, profiles)",
6
- "cli.cmd.package.list": "List resource packages from manifest and lockfile",
7
- "cli.cmd.package.add": "Add a resource package alias to vutex.toml",
8
- "cli.cmd.package.remove": "Remove a resource package alias from vutex.toml",
6
+ "cli.cmd.package.list": "List resource packages with their slots",
7
+ "cli.cmd.package.add": "Add a resource package to its slot in vutex.toml",
8
+ "cli.cmd.package.remove": "Remove a resource package from its slot in vutex.toml",
9
9
  "cli.cmd.package.install": "Resolve and install resource packages into the project cache",
10
10
  "cli.cmd.package.update": "Refresh the resource package lockfile",
11
11
  "cli.cmd.package.doctor": "Check manifest, lockfile, and package cache health",
12
12
  "cli.opt.output": "Output format id: svg, html, snapshot, or pdf",
13
13
  "cli.opt.profile": "Named language profile from vutex.toml",
14
14
  "cli.opt.input-format": "Override input format id",
15
+ "cli.opt.theme": "Typography theme: baseline (default) or traditional",
15
16
  "cli.opt.json": "Emit machine-readable JSON on stdout",
16
17
  "cli.opt.package-name": "Resource package name to install",
17
- "cli.opt.package-version": "Requested package version range"
18
+ "cli.opt.package-slot": "Resource slot: font, math-font, template, theme, profile, macros, resources, fixture"
18
19
  }
package/package.json CHANGED
@@ -23,6 +23,7 @@
23
23
  },
24
24
  "files": [
25
25
  "bin",
26
+ "licenses",
26
27
  "locales",
27
28
  "readme.md",
28
29
  "src"
@@ -30,11 +31,11 @@
30
31
  "license": "MPL-2.0",
31
32
  "name": "@vutex/vutex",
32
33
  "optionalDependencies": {
33
- "@vutex/vutex-darwin-arm64": "0.0.14",
34
- "@vutex/vutex-darwin-x64": "0.0.14",
35
- "@vutex/vutex-linux-arm64": "0.0.14",
36
- "@vutex/vutex-linux-x64": "0.0.14",
37
- "@vutex/vutex-win32-x64": "0.0.14"
34
+ "@vutex/vutex-darwin-arm64": "0.0.16",
35
+ "@vutex/vutex-darwin-x64": "0.0.16",
36
+ "@vutex/vutex-linux-arm64": "0.0.16",
37
+ "@vutex/vutex-linux-x64": "0.0.16",
38
+ "@vutex/vutex-win32-x64": "0.0.16"
38
39
  },
39
40
  "publishConfig": {
40
41
  "access": "public"
@@ -45,9 +46,9 @@
45
46
  "url": "git+https://github.com/notedge/VuTeX.git"
46
47
  },
47
48
  "scripts": {
48
- "test": "tsx --test tests/cli.test.ts tests/manifest-lockfile.test.ts tests/node-load.test.ts tests/package-manager.test.ts tests/render-runtime.test.ts tests/runtime.test.ts",
49
+ "test": "tsx --test tests/cli.test.ts tests/manifest-lockfile.test.ts tests/node-load.test.ts tests/package-manager.test.ts tests/registry.test.ts tests/render-runtime.test.ts tests/runtime.test.ts",
49
50
  "typecheck": "tsc --noEmit"
50
51
  },
51
52
  "type": "module",
52
- "version": "0.0.14"
53
+ "version": "0.0.16"
53
54
  }
package/readme.md CHANGED
@@ -2,9 +2,22 @@
2
2
 
3
3
  VuTeX TypeScript runtime facade and official CLI.
4
4
 
5
+ ## Install
6
+
5
7
  ```bash
6
- vutex render sample.nd --output out.svg
7
- vutex inspect sample.nd
8
+ npm install -g @vutex/vutex
9
+ ```
10
+
11
+ `@vutex/vutex` installs the matching `@vutex/vutex-<platform>` native package
12
+ as an optional dependency. The CLI requires that native package; browsers and
13
+ JavaScript-only hosts use `@vutex/watex` instead.
14
+
15
+ ## Usage
16
+
17
+ ```bash
18
+ vutex render sample.md --output svg > out.svg
19
+ vutex render sample.md --output pdf # writes sample.pdf next to the input
20
+ vutex inspect sample.md
8
21
  vutex package doctor
9
22
  ```
10
23
 
@@ -12,7 +25,20 @@ vutex package doctor
12
25
  import { createVuTeX } from "@vutex/vutex";
13
26
 
14
27
  const vutex = await createVuTeX({ projectRoot: process.cwd() });
15
- const result = await vutex.render("sample.nd", { output: "svg" });
28
+ const result = await vutex.render("sample.md", { output: "svg" });
16
29
  ```
17
30
 
31
+ `--output` takes a format id (`svg`, `html`, `snapshot`, `pdf`), not a path.
32
+ Markdown input (`$…$` inline, `$$…$$` display) is laid out as real math. The
33
+ native `.nd` Notedown format has no math syntax and keeps `$…$` as text.
34
+
18
35
  Resource packages (fonts, templates, profiles) are managed by the VuTeX package manager via `vutex.toml`, not npm.
36
+
37
+ ## Scope
38
+
39
+ VuTeX is a document typesetting runtime, not a TeX engine. Formula geometry is
40
+ checked against Tectonic `0.17.0` with `default_bundle_v33.tar` and amsmath
41
+ 2021/10/15 v2.17l, with 5% width, 10% height and 15% depth tolerances. Input
42
+ outside the gated corpus must surface a structured diagnostic. The raster
43
+ backend is a stub; use SVG, HTML or PDF. Fonts, licenses and known limitations
44
+ are listed in the repository `Readme.md`.
@@ -1,14 +1,19 @@
1
1
  import type { Cli, ParsedOptions } from "@vmz/commander";
2
2
 
3
3
  import { createVuTeXRuntime } from "../context.js";
4
- import { emitHuman, emitJson } from "../diagnostics.js";
4
+ import { emitHuman, emitJson, presentDiagnostics } from "../diagnostics.js";
5
5
  import { ExitCode } from "../exit-codes.js";
6
+ import { PackageResolveError } from "../../packages/manager.js";
6
7
 
7
8
  function readName(options: ParsedOptions): string | undefined {
8
9
  const value = options._[0] ?? options.name;
9
10
  return typeof value === "string" ? value : undefined;
10
11
  }
11
12
 
13
+ function readSlot(options: ParsedOptions): string | undefined {
14
+ return typeof options.slot === "string" ? options.slot : undefined;
15
+ }
16
+
12
17
  export function registerPackageCommands(cli: Cli): void {
13
18
  const group = cli.command("package", "cli.cmd.package");
14
19
 
@@ -22,7 +27,7 @@ export function registerPackageCommands(cli: Cli): void {
22
27
  emitJson({ packages: items });
23
28
  } else {
24
29
  for (const item of items) {
25
- emitHuman(`${item.name}\t${item.version}\t${item.source}`);
30
+ emitHuman(`${item.slot}\t${item.name}\t${item.version}\t${item.source}`);
26
31
  }
27
32
  }
28
33
  return ExitCode.Ok;
@@ -30,15 +35,22 @@ export function registerPackageCommands(cli: Cli): void {
30
35
 
31
36
  group
32
37
  .command("add", "cli.cmd.package.add")
38
+ .option("--slot <slot>", "cli.opt.package-slot")
33
39
  .action(async (options: ParsedOptions) => {
34
40
  const name = readName(options);
35
41
  if (!name) {
36
42
  return ExitCode.InvalidArgs;
37
43
  }
38
44
  const runtime = await createVuTeXRuntime();
39
- await runtime.packages.add(name, {
40
- version: typeof options.version === "string" ? options.version : undefined,
41
- });
45
+ try {
46
+ await runtime.packages.add(name, { slot: readSlot(options) });
47
+ } catch (error) {
48
+ if (error instanceof PackageResolveError) {
49
+ presentDiagnostics(error.diagnostics, false);
50
+ return ExitCode.ActionFailed;
51
+ }
52
+ throw error;
53
+ }
42
54
  return ExitCode.Ok;
43
55
  });
44
56
 
@@ -57,13 +69,21 @@ export function registerPackageCommands(cli: Cli): void {
57
69
  group
58
70
  .command("install", "cli.cmd.package.install")
59
71
  .option("--name <name>", "cli.opt.package-name")
60
- .option("--version <version>", "cli.opt.package-version")
72
+ .option("--slot <slot>", "cli.opt.package-slot")
61
73
  .action(async (options: ParsedOptions) => {
62
74
  const runtime = await createVuTeXRuntime();
63
- await runtime.packages.install({
64
- name: typeof options.name === "string" ? options.name : undefined,
65
- version: typeof options.version === "string" ? options.version : undefined,
66
- });
75
+ try {
76
+ await runtime.packages.install({
77
+ name: typeof options.name === "string" ? options.name : undefined,
78
+ slot: readSlot(options),
79
+ });
80
+ } catch (error) {
81
+ if (error instanceof PackageResolveError) {
82
+ presentDiagnostics(error.diagnostics, false);
83
+ return ExitCode.ActionFailed;
84
+ }
85
+ throw error;
86
+ }
67
87
  return ExitCode.Ok;
68
88
  });
69
89
 
@@ -71,7 +91,15 @@ export function registerPackageCommands(cli: Cli): void {
71
91
  .command("update", "cli.cmd.package.update")
72
92
  .action(async () => {
73
93
  const runtime = await createVuTeXRuntime();
74
- await runtime.packages.update();
94
+ try {
95
+ await runtime.packages.update();
96
+ } catch (error) {
97
+ if (error instanceof PackageResolveError) {
98
+ presentDiagnostics(error.diagnostics, false);
99
+ return ExitCode.ActionFailed;
100
+ }
101
+ throw error;
102
+ }
75
103
  return ExitCode.Ok;
76
104
  });
77
105
 
@@ -91,7 +119,8 @@ export function registerPackageCommands(cli: Cli): void {
91
119
  } else {
92
120
  emitHuman("VuTeX resource packages have issues");
93
121
  for (const check of report.checks) {
94
- emitHuman(` ${check.ok ? "ok" : "fail"} ${check.id}: ${check.message}`);
122
+ const code = check.code ? ` ${check.code}` : "";
123
+ emitHuman(` ${check.ok ? "ok" : "fail"} ${check.id}${code}: ${check.message}`);
95
124
  }
96
125
  }
97
126
  return report.ok ? ExitCode.Ok : ExitCode.ActionFailed;
@@ -31,6 +31,7 @@ export function registerRenderCommand(cli: Cli): void {
31
31
  .option("-o, --output <format>", "cli.opt.output")
32
32
  .option("--profile <name>", "cli.opt.profile")
33
33
  .option("--input <format>", "cli.opt.input-format")
34
+ .option("--theme <name>", "cli.opt.theme")
34
35
  .option("--json", "cli.opt.json")
35
36
  .action(async (options: ParsedOptions) => {
36
37
  const inputPath = options._[0];
@@ -43,6 +44,7 @@ export function registerRenderCommand(cli: Cli): void {
43
44
  output: typeof options.output === "string" ? options.output : undefined,
44
45
  profile: typeof options.profile === "string" ? options.profile : undefined,
45
46
  input: typeof options.input === "string" ? options.input : undefined,
47
+ theme: typeof options.theme === "string" ? options.theme : undefined,
46
48
  });
47
49
 
48
50
  const pdf = result.outputFormat === "pdf" ? result.pdf : undefined;
@@ -63,6 +65,8 @@ export function registerRenderCommand(cli: Cli): void {
63
65
  presentDiagnostics(result.diagnostics, options.json === true);
64
66
  }
65
67
 
66
- return result.exitCode === 0 ? ExitCode.Ok : ExitCode.ActionFailed;
68
+ return result.diagnostics.some((item) => item.severity === "error")
69
+ ? ExitCode.ActionFailed
70
+ : ExitCode.Ok;
67
71
  });
68
72
  }
package/src/index.ts CHANGED
@@ -9,8 +9,11 @@ export type {
9
9
  FormulaMetrics,
10
10
  FormulaRender,
11
11
  FormulaRenderOptions,
12
+ ActivatedPackage,
12
13
  InspectDocumentResult,
14
+ PackageCheck,
13
15
  PackageDoctorReport,
16
+ PackageSlot,
14
17
  PackageInstallOptions,
15
18
  PackageRecord,
16
19
  RenderDocumentOptions,
package/src/node/load.ts CHANGED
@@ -1,26 +1,11 @@
1
1
  import { createRequire } from "node:module";
2
2
 
3
- import type { VuTeXBindings } from "../types.js";
3
+ import type { LoweredDocumentHandle, DisplaySceneHandle, FlowSceneHandle, TemplateGeometry, VuTeXBindings } from "../types.js";
4
4
 
5
- type NativeBinding = {
6
- vutexVersion: () => string;
7
- measureFormula: (source: string, optionsJson?: string) => string;
8
- renderFormulaSvg: (source: string, optionsJson?: string) => string;
9
- renderFormulaMathml: (source: string, optionsJson?: string) => string;
10
- renderFormula: (source: string, optionsJson?: string) => string;
11
- inspectDocument: (inputPath: string) => {
12
- inputFormat: string;
13
- path: string;
14
- reportJson: string;
15
- };
16
- renderDocument: (inputPath: string, optionsJson?: string) => {
17
- exitCode: number;
18
- outputFormat: string;
19
- svg?: string;
20
- html?: string;
21
- pdf?: Uint8Array;
22
- reportJson: string;
23
- };
5
+ type NativeBinding = VuTeXBindings & {
6
+ lowerDocument: (graphJson: string, label: string) => LoweredDocumentHandle;
7
+ buildDisplay: (lowered: LoweredDocumentHandle, theme?: string, mathFont?: string, template?: TemplateGeometry) => DisplaySceneHandle;
8
+ buildFlow: (graphJson: string, theme?: string) => FlowSceneHandle;
24
9
  };
25
10
 
26
11
  const PLATFORM_PACKAGES: Record<string, string> = {
@@ -46,7 +31,18 @@ export function loadVuTeXNode(): VuTeXBindings {
46
31
  renderFormulaSvg: (source, optionsJson) => binding.renderFormulaSvg(source, optionsJson),
47
32
  renderFormulaMathml: (source, optionsJson) => binding.renderFormulaMathml(source, optionsJson),
48
33
  renderFormula: (source, optionsJson) => binding.renderFormula(source, optionsJson),
49
- inspectDocument: (inputPath) => binding.inspectDocument(inputPath),
50
- renderDocument: (inputPath, optionsJson) => binding.renderDocument(inputPath, optionsJson),
34
+ parseDocument: (label, format, bytes) => binding.parseDocument(label, format, bytes),
35
+ lowerDocument: (graphJson, label) => binding.lowerDocument(graphJson, label),
36
+ buildDisplay: (lowered, theme, mathFont, template) => binding.buildDisplay(lowered, theme, mathFont, template),
37
+ buildFlow: (graphJson, theme) => binding.buildFlow(graphJson, theme),
38
+ installMathFontFace: (name, artifactHash, bytes, texParameters) =>
39
+ binding.installMathFontFace(name, artifactHash, bytes, texParameters),
40
+ mathFontTexParameterFamilies: () => binding.mathFontTexParameterFamilies(),
41
+ embedSvgFonts: (svg, theme) => binding.embedSvgFonts(svg, theme),
42
+ subsetFace: (family, script, style, chars) => binding.subsetFace(family, script, style, chars),
43
+ summarizeDocument: (graphJson) => binding.summarizeDocument(graphJson),
44
+ assembleReport: (operation, inputsJson, diagnosticsJson, outputJson, extraJson) =>
45
+ binding.assembleReport(operation, inputsJson, diagnosticsJson, outputJson, extraJson),
46
+ themeFacts: (theme) => binding.themeFacts(theme),
51
47
  };
52
48
  }