resuml 1.2.4 → 1.2.5

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/index.d.ts CHANGED
@@ -1,7 +1,17 @@
1
1
  #!/usr/bin/env node
2
2
  import { Command } from 'commander';
3
- import { Resume as ResumeSchema } from './api.js';
4
- export { loadResumeFiles, loadTheme, processResumeData } from './api.js';
3
+ import { R as ResumeSchema } from './loadResume-BFCirLAW.js';
4
+ export { l as loadResumeFiles, p as processResumeData } from './loadResume-BFCirLAW.js';
5
+
6
+ /**
7
+ * Load a theme module by name
8
+ * @param themeName The name of the theme to load
9
+ * @param options Optional settings (autoInstall: boolean)
10
+ * @returns The loaded theme module
11
+ */
12
+ declare function loadTheme(themeName: string, options?: {
13
+ autoInstall?: boolean;
14
+ }): Promise<any>;
5
15
 
6
16
  interface ThemeConfig {
7
17
  sections?: {
@@ -42,4 +52,4 @@ declare namespace themeRender {
42
52
 
43
53
  declare const program: Command;
44
54
 
45
- export { program, themeRender };
55
+ export { loadTheme, program, themeRender };
package/dist/index.js CHANGED
@@ -6882,9 +6882,10 @@ async function installTheme(packageName) {
6882
6882
  throw new Error(`Failed to install ${packageName}: ${error.message}`);
6883
6883
  }
6884
6884
  }
6885
- async function loadTheme(themeName) {
6885
+ async function loadTheme(themeName, options) {
6886
6886
  let jsonResumeThemeName;
6887
6887
  let nativeThemeName;
6888
+ const autoInstall = options?.autoInstall !== false;
6888
6889
  try {
6889
6890
  jsonResumeThemeName = themeName.startsWith("jsonresume-theme-") ? themeName : `jsonresume-theme-${themeName}`;
6890
6891
  try {
@@ -6894,6 +6895,12 @@ async function loadTheme(themeName) {
6894
6895
  try {
6895
6896
  return require2(nativeThemeName);
6896
6897
  } catch (_nativeError) {
6898
+ if (!autoInstall) {
6899
+ throw new Error(
6900
+ `Theme package ${jsonResumeThemeName} or ${nativeThemeName} not found in node_modules.
6901
+ Please install the theme package manually.`
6902
+ );
6903
+ }
6897
6904
  console.log(`\u{1F4E6} Theme ${jsonResumeThemeName} not found. Installing...`);
6898
6905
  try {
6899
6906
  await installTheme(jsonResumeThemeName);