docs-i18n 0.1.0 → 0.2.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.
Files changed (49) hide show
  1. package/dist/{assemble-IOHQYYHI.js → assemble-ZHDLGVTL.js} +3 -4
  2. package/dist/chunk-I74LIORX.js +11211 -0
  3. package/dist/{chunk-QSVWLTGQ.js → chunk-OSMPWXSQ.js} +1 -1
  4. package/dist/{chunk-AKLW2MUS.js → chunk-PHDMD6EM.js} +29 -7
  5. package/dist/cli.js +6 -7
  6. package/dist/{rescan-VB2PILB2.js → rescan-OJTVWDAP.js} +2 -3
  7. package/dist/server-HNVJP43X.js +2742 -0
  8. package/dist/{status-EWQEACVF.js → status-ZG7F3FRT.js} +1 -2
  9. package/dist/translate-2PCYIWIG.js +14531 -0
  10. package/package.json +3 -2
  11. package/src/admin/index.html +13 -0
  12. package/src/admin/server/index.ts +88 -0
  13. package/src/admin/server/routes/jobs.ts +113 -0
  14. package/src/admin/server/routes/models.ts +87 -0
  15. package/src/admin/server/routes/status.ts +57 -0
  16. package/src/admin/server/services/job-manager.ts +184 -0
  17. package/src/admin/server/services/status.ts +183 -0
  18. package/src/admin/ui/App.tsx +326 -0
  19. package/src/admin/ui/components/FileList.tsx +438 -0
  20. package/src/admin/ui/components/JobDialog.tsx +360 -0
  21. package/src/admin/ui/components/JobPanel.tsx +134 -0
  22. package/src/admin/ui/components/LangGrid.tsx +54 -0
  23. package/src/admin/ui/components/Preview.tsx +369 -0
  24. package/src/admin/ui/components/ProgressBar.tsx +21 -0
  25. package/src/admin/ui/lib/api.ts +154 -0
  26. package/src/admin/ui/lib/flags.ts +30 -0
  27. package/src/admin/ui/main.tsx +19 -0
  28. package/src/admin/ui/styles.css +1096 -0
  29. package/src/admin/vite.config.ts +7 -0
  30. package/dist/build-4EQEL4NI.js +0 -12
  31. package/dist/build2-3W5WMFHZ.js +0 -4901
  32. package/dist/chunk-3YNFMSJH.js +0 -30
  33. package/dist/chunk-55MBYBVK.js +0 -368
  34. package/dist/chunk-FYDB7MZX.js +0 -38944
  35. package/dist/chunk-O35QHRY6.js +0 -6
  36. package/dist/chunk-PTIH4GGE.js +0 -44
  37. package/dist/chunk-SUIDX6IZ.js +0 -122
  38. package/dist/chunk-VKKNQBDN.js +0 -6487
  39. package/dist/dist-6C32URTL.js +0 -19
  40. package/dist/dist-HOWMMQFV.js +0 -6677
  41. package/dist/false-JGP4AGWN.js +0 -7
  42. package/dist/main-QVE5TVA3.js +0 -2505
  43. package/dist/node-4GLCLDJ6.js +0 -875
  44. package/dist/node-NUDVMOF2.js +0 -129
  45. package/dist/postcss-3SK7VUC2.js +0 -5886
  46. package/dist/postcss-import-JD46KA2Z.js +0 -458
  47. package/dist/prompt-BYQIwEjg-TG7DLENB.js +0 -915
  48. package/dist/server-ER56DGPR.js +0 -548
  49. package/dist/translate-F3AQFN6X.js +0 -707
@@ -3,7 +3,7 @@ import {
3
3
  init_parser,
4
4
  normalize,
5
5
  parseMdx
6
- } from "./chunk-SUIDX6IZ.js";
6
+ } from "./chunk-I74LIORX.js";
7
7
 
8
8
  // src/core/assembler.ts
9
9
  init_normalize();
@@ -10,11 +10,6 @@ var __require = /* @__PURE__ */ ((x) => typeof require !== "undefined" ? require
10
10
  if (typeof require !== "undefined") return require.apply(this, arguments);
11
11
  throw Error('Dynamic require of "' + x + '" is not supported');
12
12
  });
13
- var __glob = (map) => (path) => {
14
- var fn = map[path];
15
- if (fn) return fn();
16
- throw new Error("Module not found in bundle: " + path);
17
- };
18
13
  var __esm = (fn, res) => function __init() {
19
14
  return fn && (res = (0, fn[__getOwnPropNames(fn)[0]])(fn = 0)), res;
20
15
  };
@@ -43,12 +38,39 @@ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__ge
43
38
  ));
44
39
  var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
45
40
 
41
+ // src/config.ts
42
+ async function loadConfig(path) {
43
+ const configPath = path ?? "docs-i18n.config.ts";
44
+ try {
45
+ const mod = await import(
46
+ /* @vite-ignore */
47
+ `${process.cwd()}/${configPath}`
48
+ );
49
+ return mod.default ?? mod;
50
+ } catch {
51
+ throw new Error(`Cannot load config from ${configPath}. Create a docs-i18n.config.ts file.`);
52
+ }
53
+ }
54
+ function flattenSources(config) {
55
+ const projects = Object.entries(config.projects);
56
+ const singleProject = projects.length === 1;
57
+ return projects.flatMap(
58
+ ([projectId, project]) => Object.entries(project.sources).map(([version, sourcePath]) => ({
59
+ project: projectId,
60
+ version,
61
+ sourcePath,
62
+ versionKey: singleProject ? version : `${projectId}/${version}`
63
+ }))
64
+ );
65
+ }
66
+
46
67
  export {
47
68
  __require,
48
- __glob,
49
69
  __esm,
50
70
  __commonJS,
51
71
  __export,
52
72
  __toESM,
53
- __toCommonJS
73
+ __toCommonJS,
74
+ loadConfig,
75
+ flattenSources
54
76
  };
package/dist/cli.js CHANGED
@@ -1,8 +1,7 @@
1
1
  #!/usr/bin/env node
2
2
  import {
3
3
  loadConfig
4
- } from "./chunk-3YNFMSJH.js";
5
- import "./chunk-AKLW2MUS.js";
4
+ } from "./chunk-PHDMD6EM.js";
6
5
 
7
6
  // src/cli.ts
8
7
  var args = process.argv.slice(2);
@@ -50,7 +49,7 @@ Options:
50
49
  console.error("Error: --lang is required");
51
50
  process.exit(1);
52
51
  }
53
- const { translate } = await import("./translate-F3AQFN6X.js");
52
+ const { translate } = await import("./translate-2PCYIWIG.js");
54
53
  await translate(config, {
55
54
  lang,
56
55
  project: getOpt("project") || void 0,
@@ -66,7 +65,7 @@ Options:
66
65
  break;
67
66
  }
68
67
  case "assemble": {
69
- const { assembleAll } = await import("./assemble-IOHQYYHI.js");
68
+ const { assembleAll } = await import("./assemble-ZHDLGVTL.js");
70
69
  await assembleAll(config, {
71
70
  project: getOpt("project") || void 0,
72
71
  version: getOpt("version") || void 0,
@@ -75,7 +74,7 @@ Options:
75
74
  break;
76
75
  }
77
76
  case "rescan": {
78
- const { rescan } = await import("./rescan-VB2PILB2.js");
77
+ const { rescan } = await import("./rescan-OJTVWDAP.js");
79
78
  await rescan(config, {
80
79
  project: getOpt("project") || void 0,
81
80
  version: getOpt("version") || void 0
@@ -83,13 +82,13 @@ Options:
83
82
  break;
84
83
  }
85
84
  case "status": {
86
- const { status } = await import("./status-EWQEACVF.js");
85
+ const { status } = await import("./status-ZG7F3FRT.js");
87
86
  await status(config, { lang: getOpt("lang") || void 0 });
88
87
  break;
89
88
  }
90
89
  case "admin": {
91
90
  const port = Number(getOpt("port", "3456"));
92
- const { startAdmin } = await import("./server-ER56DGPR.js");
91
+ const { startAdmin } = await import("./server-HNVJP43X.js");
93
92
  await startAdmin(config, port);
94
93
  break;
95
94
  }
@@ -1,14 +1,13 @@
1
1
  import {
2
2
  init_parser,
3
3
  parseMdx
4
- } from "./chunk-SUIDX6IZ.js";
4
+ } from "./chunk-I74LIORX.js";
5
5
  import {
6
6
  TranslationCache
7
7
  } from "./chunk-XEOYZUHS.js";
8
8
  import {
9
9
  flattenSources
10
- } from "./chunk-3YNFMSJH.js";
11
- import "./chunk-AKLW2MUS.js";
10
+ } from "./chunk-PHDMD6EM.js";
12
11
 
13
12
  // src/commands/rescan.ts
14
13
  import { existsSync, readdirSync, readFileSync } from "fs";