@json-to-office/jto 0.33.0 → 0.33.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/dist/cli.js +20 -2
- package/dist/cli.js.map +1 -1
- package/dist/client/assets/{HomePage-jdG3Nvs3.js → HomePage-Cq6woGMG.js} +4 -4
- package/dist/client/assets/{HomePage-jdG3Nvs3.js.map → HomePage-Cq6woGMG.js.map} +1 -1
- package/dist/client/assets/{JsonEditorPage-D4_tGn_w.js → JsonEditorPage-GZV7oJD2.js} +3 -3
- package/dist/client/assets/{JsonEditorPage-D4_tGn_w.js.map → JsonEditorPage-GZV7oJD2.js.map} +1 -1
- package/dist/client/assets/{MonacoPluginProvider-CC_0EtPn.js → MonacoPluginProvider-btNzJ41o.js} +3 -3
- package/dist/client/assets/{MonacoPluginProvider-CC_0EtPn.js.map → MonacoPluginProvider-btNzJ41o.js.map} +1 -1
- package/dist/client/assets/{editor-D5kbg7B_.js → editor-Cugq4RzH.js} +2 -2
- package/dist/client/assets/{editor-D5kbg7B_.js.map → editor-Cugq4RzH.js.map} +1 -1
- package/dist/client/assets/{editor-monaco-json-Djj0D7gR.js → editor-monaco-json-rhvIaBDI.js} +2 -2
- package/dist/client/assets/{editor-monaco-json-Djj0D7gR.js.map → editor-monaco-json-rhvIaBDI.js.map} +1 -1
- package/dist/client/assets/{editor-refs-store-DicRYPUs.js → editor-refs-store-DeJZ8FB9.js} +2 -2
- package/dist/client/assets/{editor-refs-store-DicRYPUs.js.map → editor-refs-store-DeJZ8FB9.js.map} +1 -1
- package/dist/client/assets/{index-BR9EjF-e.js → index-C9uVroFQ.js} +4 -4
- package/dist/client/assets/index-C9uVroFQ.js.map +1 -0
- package/dist/client/assets/{preview-Ct4gUSjt.js → preview-B_B09gpA.js} +2 -2
- package/dist/client/assets/{preview-Ct4gUSjt.js.map → preview-B_B09gpA.js.map} +1 -1
- package/dist/client/index.html +1 -1
- package/package.json +3 -3
- package/dist/client/assets/index-BR9EjF-e.js.map +0 -1
package/dist/cli.js
CHANGED
|
@@ -2831,6 +2831,22 @@ function cleanupTypeBoxIds(schema) {
|
|
|
2831
2831
|
cleanupTypeBoxIds(schema[key]);
|
|
2832
2832
|
});
|
|
2833
2833
|
}
|
|
2834
|
+
async function ensurePluginsRegistered(format, pluginNames) {
|
|
2835
|
+
const registry = PluginRegistry3.getInstance();
|
|
2836
|
+
const satisfied = pluginNames ? pluginNames.every((name) => registry.getPlugin(name)) : registry.hasPlugins();
|
|
2837
|
+
if (satisfied) return;
|
|
2838
|
+
if (!pluginLoadInFlight) {
|
|
2839
|
+
registry.setFormat(format);
|
|
2840
|
+
pluginLoadInFlight = registry.discoverAndLoad().then(() => void 0).catch((error) => {
|
|
2841
|
+
logger.warn("On-demand plugin load for schema generation failed", {
|
|
2842
|
+
error: error?.message
|
|
2843
|
+
});
|
|
2844
|
+
}).finally(() => {
|
|
2845
|
+
pluginLoadInFlight = null;
|
|
2846
|
+
});
|
|
2847
|
+
}
|
|
2848
|
+
await pluginLoadInFlight;
|
|
2849
|
+
}
|
|
2834
2850
|
function getSelectedPlugins(pluginNames) {
|
|
2835
2851
|
const registry = PluginRegistry3.getInstance();
|
|
2836
2852
|
if (!registry.hasPlugins()) return [];
|
|
@@ -2844,6 +2860,7 @@ function getSelectedPlugins(pluginNames) {
|
|
|
2844
2860
|
});
|
|
2845
2861
|
}
|
|
2846
2862
|
async function generateDocumentSchema(format, pluginNames) {
|
|
2863
|
+
await ensurePluginsRegistered(format, pluginNames);
|
|
2847
2864
|
const selected = getSelectedPlugins(pluginNames);
|
|
2848
2865
|
if (format === "docx") {
|
|
2849
2866
|
const shared = await import("@json-to-office/shared-docx");
|
|
@@ -2913,7 +2930,7 @@ async function generateThemeSchema(format) {
|
|
|
2913
2930
|
description: `Theme definition for JSON to ${label} ${format === "docx" ? "documents" : "presentations"}`
|
|
2914
2931
|
};
|
|
2915
2932
|
}
|
|
2916
|
-
var discoveryRouter;
|
|
2933
|
+
var discoveryRouter, pluginLoadInFlight;
|
|
2917
2934
|
var init_discovery = __esm({
|
|
2918
2935
|
"src/server/routes/discovery.ts"() {
|
|
2919
2936
|
"use strict";
|
|
@@ -2921,6 +2938,7 @@ var init_discovery = __esm({
|
|
|
2921
2938
|
init_logger();
|
|
2922
2939
|
init_container();
|
|
2923
2940
|
discoveryRouter = new Hono3();
|
|
2941
|
+
pluginLoadInFlight = null;
|
|
2924
2942
|
discoveryRouter.get("/all", async (c) => {
|
|
2925
2943
|
try {
|
|
2926
2944
|
const format = Container.getAdapter().name;
|
|
@@ -4458,7 +4476,7 @@ function createDevCommand(adapter) {
|
|
|
4458
4476
|
}
|
|
4459
4477
|
|
|
4460
4478
|
// src/cli.ts
|
|
4461
|
-
var PACKAGE_VERSION = true ? "0.33.
|
|
4479
|
+
var PACKAGE_VERSION = true ? "0.33.1" : "dev-mode";
|
|
4462
4480
|
var program = new Command2();
|
|
4463
4481
|
program.name("jto").description("JSON to Office CLI - Generate .docx and .pptx from JSON").version(PACKAGE_VERSION);
|
|
4464
4482
|
registerCoreCommands(program, {
|