resuml 1.2.2 → 1.2.3
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/README.md +24 -0
- package/dist/api.js +6829 -0
- package/dist/api.js.map +1 -0
- package/dist/index.js +119 -103
- package/dist/index.js.map +1 -1
- package/package.json +9 -2
- package/src/types/theme.d.ts +0 -15
package/dist/index.js
CHANGED
|
@@ -258,13 +258,17 @@ var require_brace_expansion = __commonJS({
|
|
|
258
258
|
// src/index.ts
|
|
259
259
|
var index_exports = {};
|
|
260
260
|
__export(index_exports, {
|
|
261
|
-
|
|
261
|
+
loadResumeFiles: () => loadResumeFiles,
|
|
262
|
+
loadTheme: () => loadTheme,
|
|
263
|
+
processResumeData: () => processResumeData,
|
|
264
|
+
program: () => program,
|
|
265
|
+
themeRender: () => themeRender_exports
|
|
262
266
|
});
|
|
263
267
|
module.exports = __toCommonJS(index_exports);
|
|
264
268
|
init_cjs_shims();
|
|
265
269
|
var import_commander = require("commander");
|
|
266
|
-
var
|
|
267
|
-
var
|
|
270
|
+
var import_path2 = __toESM(require("path"));
|
|
271
|
+
var import_fs5 = __toESM(require("fs"));
|
|
268
272
|
var import_url = require("url");
|
|
269
273
|
|
|
270
274
|
// src/commands/validate.ts
|
|
@@ -4187,12 +4191,12 @@ var PathBase = class {
|
|
|
4187
4191
|
/**
|
|
4188
4192
|
* Get the Path object referenced by the string path, resolved from this Path
|
|
4189
4193
|
*/
|
|
4190
|
-
resolve(
|
|
4191
|
-
if (!
|
|
4194
|
+
resolve(path6) {
|
|
4195
|
+
if (!path6) {
|
|
4192
4196
|
return this;
|
|
4193
4197
|
}
|
|
4194
|
-
const rootPath = this.getRootString(
|
|
4195
|
-
const dir =
|
|
4198
|
+
const rootPath = this.getRootString(path6);
|
|
4199
|
+
const dir = path6.substring(rootPath.length);
|
|
4196
4200
|
const dirParts = dir.split(this.splitSep);
|
|
4197
4201
|
const result = rootPath ? this.getRoot(rootPath).#resolveParts(dirParts) : this.#resolveParts(dirParts);
|
|
4198
4202
|
return result;
|
|
@@ -4944,8 +4948,8 @@ var PathWin32 = class _PathWin32 extends PathBase {
|
|
|
4944
4948
|
/**
|
|
4945
4949
|
* @internal
|
|
4946
4950
|
*/
|
|
4947
|
-
getRootString(
|
|
4948
|
-
return import_node_path.win32.parse(
|
|
4951
|
+
getRootString(path6) {
|
|
4952
|
+
return import_node_path.win32.parse(path6).root;
|
|
4949
4953
|
}
|
|
4950
4954
|
/**
|
|
4951
4955
|
* @internal
|
|
@@ -4991,8 +4995,8 @@ var PathPosix = class _PathPosix extends PathBase {
|
|
|
4991
4995
|
/**
|
|
4992
4996
|
* @internal
|
|
4993
4997
|
*/
|
|
4994
|
-
getRootString(
|
|
4995
|
-
return
|
|
4998
|
+
getRootString(path6) {
|
|
4999
|
+
return path6.startsWith("/") ? "/" : "";
|
|
4996
5000
|
}
|
|
4997
5001
|
/**
|
|
4998
5002
|
* @internal
|
|
@@ -5041,8 +5045,8 @@ var PathScurryBase = class {
|
|
|
5041
5045
|
*
|
|
5042
5046
|
* @internal
|
|
5043
5047
|
*/
|
|
5044
|
-
constructor(cwd = process.cwd(), pathImpl, sep2, { nocase, childrenCacheSize = 16 * 1024, fs:
|
|
5045
|
-
this.#fs = fsFromOption(
|
|
5048
|
+
constructor(cwd = process.cwd(), pathImpl, sep2, { nocase, childrenCacheSize = 16 * 1024, fs: fs7 = defaultFS } = {}) {
|
|
5049
|
+
this.#fs = fsFromOption(fs7);
|
|
5046
5050
|
if (cwd instanceof URL || cwd.startsWith("file://")) {
|
|
5047
5051
|
cwd = (0, import_node_url.fileURLToPath)(cwd);
|
|
5048
5052
|
}
|
|
@@ -5081,11 +5085,11 @@ var PathScurryBase = class {
|
|
|
5081
5085
|
/**
|
|
5082
5086
|
* Get the depth of a provided path, string, or the cwd
|
|
5083
5087
|
*/
|
|
5084
|
-
depth(
|
|
5085
|
-
if (typeof
|
|
5086
|
-
|
|
5088
|
+
depth(path6 = this.cwd) {
|
|
5089
|
+
if (typeof path6 === "string") {
|
|
5090
|
+
path6 = this.cwd.resolve(path6);
|
|
5087
5091
|
}
|
|
5088
|
-
return
|
|
5092
|
+
return path6.depth();
|
|
5089
5093
|
}
|
|
5090
5094
|
/**
|
|
5091
5095
|
* Return the cache of child entries. Exposed so subclasses can create
|
|
@@ -5572,9 +5576,9 @@ var PathScurryBase = class {
|
|
|
5572
5576
|
process2();
|
|
5573
5577
|
return results;
|
|
5574
5578
|
}
|
|
5575
|
-
chdir(
|
|
5579
|
+
chdir(path6 = this.cwd) {
|
|
5576
5580
|
const oldCwd = this.cwd;
|
|
5577
|
-
this.cwd = typeof
|
|
5581
|
+
this.cwd = typeof path6 === "string" ? this.cwd.resolve(path6) : path6;
|
|
5578
5582
|
this.cwd[setAsCwd](oldCwd);
|
|
5579
5583
|
}
|
|
5580
5584
|
};
|
|
@@ -5600,8 +5604,8 @@ var PathScurryWin32 = class extends PathScurryBase {
|
|
|
5600
5604
|
/**
|
|
5601
5605
|
* @internal
|
|
5602
5606
|
*/
|
|
5603
|
-
newRoot(
|
|
5604
|
-
return new PathWin32(this.rootPath, IFDIR, void 0, this.roots, this.nocase, this.childrenCache(), { fs:
|
|
5607
|
+
newRoot(fs7) {
|
|
5608
|
+
return new PathWin32(this.rootPath, IFDIR, void 0, this.roots, this.nocase, this.childrenCache(), { fs: fs7 });
|
|
5605
5609
|
}
|
|
5606
5610
|
/**
|
|
5607
5611
|
* Return true if the provided path string is an absolute path
|
|
@@ -5629,8 +5633,8 @@ var PathScurryPosix = class extends PathScurryBase {
|
|
|
5629
5633
|
/**
|
|
5630
5634
|
* @internal
|
|
5631
5635
|
*/
|
|
5632
|
-
newRoot(
|
|
5633
|
-
return new PathPosix(this.rootPath, IFDIR, void 0, this.roots, this.nocase, this.childrenCache(), { fs:
|
|
5636
|
+
newRoot(fs7) {
|
|
5637
|
+
return new PathPosix(this.rootPath, IFDIR, void 0, this.roots, this.nocase, this.childrenCache(), { fs: fs7 });
|
|
5634
5638
|
}
|
|
5635
5639
|
/**
|
|
5636
5640
|
* Return true if the provided path string is an absolute path
|
|
@@ -5936,8 +5940,8 @@ var MatchRecord = class {
|
|
|
5936
5940
|
}
|
|
5937
5941
|
// match, absolute, ifdir
|
|
5938
5942
|
entries() {
|
|
5939
|
-
return [...this.store.entries()].map(([
|
|
5940
|
-
|
|
5943
|
+
return [...this.store.entries()].map(([path6, n]) => [
|
|
5944
|
+
path6,
|
|
5941
5945
|
!!(n & 2),
|
|
5942
5946
|
!!(n & 1)
|
|
5943
5947
|
]);
|
|
@@ -6142,9 +6146,9 @@ var GlobUtil = class {
|
|
|
6142
6146
|
signal;
|
|
6143
6147
|
maxDepth;
|
|
6144
6148
|
includeChildMatches;
|
|
6145
|
-
constructor(patterns,
|
|
6149
|
+
constructor(patterns, path6, opts) {
|
|
6146
6150
|
this.patterns = patterns;
|
|
6147
|
-
this.path =
|
|
6151
|
+
this.path = path6;
|
|
6148
6152
|
this.opts = opts;
|
|
6149
6153
|
this.#sep = !opts.posix && opts.platform === "win32" ? "\\" : "/";
|
|
6150
6154
|
this.includeChildMatches = opts.includeChildMatches !== false;
|
|
@@ -6163,11 +6167,11 @@ var GlobUtil = class {
|
|
|
6163
6167
|
});
|
|
6164
6168
|
}
|
|
6165
6169
|
}
|
|
6166
|
-
#ignored(
|
|
6167
|
-
return this.seen.has(
|
|
6170
|
+
#ignored(path6) {
|
|
6171
|
+
return this.seen.has(path6) || !!this.#ignore?.ignored?.(path6);
|
|
6168
6172
|
}
|
|
6169
|
-
#childrenIgnored(
|
|
6170
|
-
return !!this.#ignore?.childrenIgnored?.(
|
|
6173
|
+
#childrenIgnored(path6) {
|
|
6174
|
+
return !!this.#ignore?.childrenIgnored?.(path6);
|
|
6171
6175
|
}
|
|
6172
6176
|
// backpressure mechanism
|
|
6173
6177
|
pause() {
|
|
@@ -6382,8 +6386,8 @@ var GlobUtil = class {
|
|
|
6382
6386
|
};
|
|
6383
6387
|
var GlobWalker = class extends GlobUtil {
|
|
6384
6388
|
matches = /* @__PURE__ */ new Set();
|
|
6385
|
-
constructor(patterns,
|
|
6386
|
-
super(patterns,
|
|
6389
|
+
constructor(patterns, path6, opts) {
|
|
6390
|
+
super(patterns, path6, opts);
|
|
6387
6391
|
}
|
|
6388
6392
|
matchEmit(e) {
|
|
6389
6393
|
this.matches.add(e);
|
|
@@ -6420,8 +6424,8 @@ var GlobWalker = class extends GlobUtil {
|
|
|
6420
6424
|
};
|
|
6421
6425
|
var GlobStream = class extends GlobUtil {
|
|
6422
6426
|
results;
|
|
6423
|
-
constructor(patterns,
|
|
6424
|
-
super(patterns,
|
|
6427
|
+
constructor(patterns, path6, opts) {
|
|
6428
|
+
super(patterns, path6, opts);
|
|
6425
6429
|
this.results = new Minipass({
|
|
6426
6430
|
signal: this.signal,
|
|
6427
6431
|
objectMode: true
|
|
@@ -6791,8 +6795,8 @@ function handleCommandError(error, command, debug = false) {
|
|
|
6791
6795
|
if (debug) {
|
|
6792
6796
|
console.error("\nValidation failed with the following errors:");
|
|
6793
6797
|
errors.forEach((err, index) => {
|
|
6794
|
-
const
|
|
6795
|
-
console.error(`${index + 1}. Path: ${
|
|
6798
|
+
const path6 = err.instancePath || "root";
|
|
6799
|
+
console.error(`${index + 1}. Path: ${path6}`);
|
|
6796
6800
|
console.error(` Error: ${err.message || "Unknown validation error"}`);
|
|
6797
6801
|
if (err.params) {
|
|
6798
6802
|
console.error(` Params: ${JSON.stringify(err.params)}`);
|
|
@@ -6802,8 +6806,8 @@ function handleCommandError(error, command, debug = false) {
|
|
|
6802
6806
|
console.error("\nSome validation errors were found:");
|
|
6803
6807
|
const maxErrors = 5;
|
|
6804
6808
|
errors.slice(0, maxErrors).forEach((err, index) => {
|
|
6805
|
-
const
|
|
6806
|
-
console.error(`${index + 1}. Field: ${
|
|
6809
|
+
const path6 = err.instancePath || "root";
|
|
6810
|
+
console.error(`${index + 1}. Field: ${path6}`);
|
|
6807
6811
|
console.error(` Error: ${err.message || "Unknown validation error"}`);
|
|
6808
6812
|
});
|
|
6809
6813
|
if (errors.length > maxErrors) {
|
|
@@ -6860,49 +6864,8 @@ async function toJsonAction(options) {
|
|
|
6860
6864
|
|
|
6861
6865
|
// src/commands/render.ts
|
|
6862
6866
|
init_cjs_shims();
|
|
6863
|
-
var import_fs4 = __toESM(require("fs"));
|
|
6864
|
-
var import_node_path2 = __toESM(require("path"));
|
|
6865
|
-
|
|
6866
|
-
// src/utils/loadThemeConfig.ts
|
|
6867
|
-
init_cjs_shims();
|
|
6868
6867
|
var import_fs3 = __toESM(require("fs"));
|
|
6869
|
-
var
|
|
6870
|
-
var import_yaml3 = __toESM(require("yaml"));
|
|
6871
|
-
function loadThemeConfig(configPath) {
|
|
6872
|
-
if (!configPath) {
|
|
6873
|
-
return {};
|
|
6874
|
-
}
|
|
6875
|
-
try {
|
|
6876
|
-
const extension = import_path2.default.extname(configPath).toLowerCase();
|
|
6877
|
-
const content = import_fs3.default.readFileSync(configPath, "utf8");
|
|
6878
|
-
let config;
|
|
6879
|
-
if (extension === ".json") {
|
|
6880
|
-
config = JSON.parse(content);
|
|
6881
|
-
} else if (extension === ".yaml" || extension === ".yml") {
|
|
6882
|
-
config = import_yaml3.default.parse(content) || {};
|
|
6883
|
-
} else {
|
|
6884
|
-
throw new Error(`Unsupported config file extension: ${extension}`);
|
|
6885
|
-
}
|
|
6886
|
-
if (config.sections && typeof config.sections !== "object") {
|
|
6887
|
-
throw new Error("Invalid sections configuration");
|
|
6888
|
-
}
|
|
6889
|
-
if (config.layout && typeof config.layout !== "object") {
|
|
6890
|
-
throw new Error("Invalid layout configuration");
|
|
6891
|
-
}
|
|
6892
|
-
if (config.styling && typeof config.styling !== "object") {
|
|
6893
|
-
throw new Error("Invalid styling configuration");
|
|
6894
|
-
}
|
|
6895
|
-
if (config.labels && typeof config.labels !== "object") {
|
|
6896
|
-
throw new Error("Invalid labels configuration");
|
|
6897
|
-
}
|
|
6898
|
-
return config;
|
|
6899
|
-
} catch (error) {
|
|
6900
|
-
if (error instanceof Error) {
|
|
6901
|
-
throw new Error(`Error loading theme config: ${error.message}`);
|
|
6902
|
-
}
|
|
6903
|
-
throw new Error("Unknown error loading theme config");
|
|
6904
|
-
}
|
|
6905
|
-
}
|
|
6868
|
+
var import_node_path2 = __toESM(require("path"));
|
|
6906
6869
|
|
|
6907
6870
|
// src/utils/themeLoader.ts
|
|
6908
6871
|
init_cjs_shims();
|
|
@@ -6966,16 +6929,14 @@ async function renderAction(options) {
|
|
|
6966
6929
|
console.log(import_chalk.default.blue("Processing and validating resume data..."));
|
|
6967
6930
|
const resumeData = await processResumeData(yamlContents);
|
|
6968
6931
|
console.log(import_chalk.default.green("Resume data processing and validation successful!"));
|
|
6969
|
-
const userThemeConfig = loadThemeConfig(options.themeConfig);
|
|
6970
6932
|
const theme = await loadTheme(options.theme);
|
|
6971
6933
|
const htmlOutput = await theme.render(resumeData, {
|
|
6972
|
-
...userThemeConfig,
|
|
6973
6934
|
locale: options.language
|
|
6974
6935
|
});
|
|
6975
6936
|
const outputHtmlPath = options.output || "resume.html";
|
|
6976
6937
|
console.log(import_chalk.default.blue(`Writing HTML output to ${outputHtmlPath}...`));
|
|
6977
|
-
|
|
6978
|
-
|
|
6938
|
+
import_fs3.default.mkdirSync(import_node_path2.default.dirname(outputHtmlPath), { recursive: true });
|
|
6939
|
+
import_fs3.default.writeFileSync(outputHtmlPath, htmlOutput, "utf8");
|
|
6979
6940
|
console.log(import_chalk.default.green(`Successfully wrote HTML output to ${outputHtmlPath}`));
|
|
6980
6941
|
} catch (error) {
|
|
6981
6942
|
handleCommandError(error, "render", options.debug);
|
|
@@ -6984,7 +6945,7 @@ async function renderAction(options) {
|
|
|
6984
6945
|
|
|
6985
6946
|
// src/commands/dev.ts
|
|
6986
6947
|
init_cjs_shims();
|
|
6987
|
-
var
|
|
6948
|
+
var import_fs4 = __toESM(require("fs"));
|
|
6988
6949
|
var import_node_path3 = __toESM(require("path"));
|
|
6989
6950
|
var import_chalk2 = __toESM(require("chalk"));
|
|
6990
6951
|
async function devAction(options) {
|
|
@@ -7003,9 +6964,9 @@ async function devAction(options) {
|
|
|
7003
6964
|
await renderResume(options);
|
|
7004
6965
|
console.log(import_chalk2.default.green(`\u{1F680} Development server running at http://localhost:${port}`));
|
|
7005
6966
|
console.log(import_chalk2.default.blue("Watching for file changes..."));
|
|
7006
|
-
if (
|
|
6967
|
+
if (import_fs4.default.existsSync(inputPath) && import_fs4.default.statSync(inputPath).isDirectory()) {
|
|
7007
6968
|
watchDirectory(inputPath, () => renderResume(options));
|
|
7008
|
-
} else if (
|
|
6969
|
+
} else if (import_fs4.default.existsSync(inputPath)) {
|
|
7009
6970
|
watchFile(inputPath, () => renderResume(options));
|
|
7010
6971
|
}
|
|
7011
6972
|
await startDevServer(port);
|
|
@@ -7022,22 +6983,20 @@ async function renderResume(options) {
|
|
|
7022
6983
|
const { yamlContents } = await loadResumeFiles(inputPath);
|
|
7023
6984
|
console.log(import_chalk2.default.blue("\u{1F504} Processing resume data..."));
|
|
7024
6985
|
const resumeData = await processResumeData(yamlContents);
|
|
7025
|
-
const userThemeConfig = loadThemeConfig(options.themeConfig);
|
|
7026
6986
|
const theme = await loadTheme(options.theme);
|
|
7027
6987
|
const htmlOutput = await theme.render(resumeData, {
|
|
7028
|
-
...userThemeConfig,
|
|
7029
6988
|
locale: options.language
|
|
7030
6989
|
});
|
|
7031
6990
|
const outputPath = import_node_path3.default.join(process.cwd(), ".resuml-dev", "index.html");
|
|
7032
|
-
|
|
7033
|
-
|
|
6991
|
+
import_fs4.default.mkdirSync(import_node_path3.default.dirname(outputPath), { recursive: true });
|
|
6992
|
+
import_fs4.default.writeFileSync(outputPath, htmlOutput, "utf8");
|
|
7034
6993
|
console.log(import_chalk2.default.green("\u2705 Resume updated!"));
|
|
7035
6994
|
} catch (error) {
|
|
7036
6995
|
console.error(import_chalk2.default.red("\u274C Error rendering resume:"), error.message);
|
|
7037
6996
|
}
|
|
7038
6997
|
}
|
|
7039
6998
|
function watchDirectory(dirPath, callback) {
|
|
7040
|
-
|
|
6999
|
+
import_fs4.default.watch(dirPath, { recursive: true }, (eventType, filename) => {
|
|
7041
7000
|
if (filename && (filename.endsWith(".yaml") || filename.endsWith(".yml"))) {
|
|
7042
7001
|
console.log(import_chalk2.default.blue(`\u{1F4C1} File changed: ${filename}`));
|
|
7043
7002
|
callback();
|
|
@@ -7045,7 +7004,7 @@ function watchDirectory(dirPath, callback) {
|
|
|
7045
7004
|
});
|
|
7046
7005
|
}
|
|
7047
7006
|
function watchFile(filePath, callback) {
|
|
7048
|
-
|
|
7007
|
+
import_fs4.default.watch(filePath, (eventType) => {
|
|
7049
7008
|
if (eventType === "change") {
|
|
7050
7009
|
console.log(import_chalk2.default.blue(`\u{1F4C4} File changed: ${import_node_path3.default.basename(filePath)}`));
|
|
7051
7010
|
callback();
|
|
@@ -7060,8 +7019,8 @@ async function startDevServer(port) {
|
|
|
7060
7019
|
const pathname = parsedUrl.pathname || "/";
|
|
7061
7020
|
if (pathname === "/" || pathname === "/index.html") {
|
|
7062
7021
|
const htmlPath = import_node_path3.default.join(process.cwd(), ".resuml-dev", "index.html");
|
|
7063
|
-
if (
|
|
7064
|
-
const html =
|
|
7022
|
+
if (import_fs4.default.existsSync(htmlPath)) {
|
|
7023
|
+
const html = import_fs4.default.readFileSync(htmlPath, "utf8");
|
|
7065
7024
|
const liveReloadScript = `
|
|
7066
7025
|
<script>
|
|
7067
7026
|
setInterval(() => {
|
|
@@ -7093,13 +7052,66 @@ async function startDevServer(port) {
|
|
|
7093
7052
|
});
|
|
7094
7053
|
}
|
|
7095
7054
|
|
|
7055
|
+
// src/utils/themeRender.ts
|
|
7056
|
+
var themeRender_exports = {};
|
|
7057
|
+
__export(themeRender_exports, {
|
|
7058
|
+
injectCss: () => injectCss,
|
|
7059
|
+
renderTheme: () => renderTheme
|
|
7060
|
+
});
|
|
7061
|
+
init_cjs_shims();
|
|
7062
|
+
async function renderTheme(themeName, resumeData, themeConfig = {}, inlineCss, language = "en") {
|
|
7063
|
+
try {
|
|
7064
|
+
if (themeName.startsWith("jsonresume-")) {
|
|
7065
|
+
return await renderJsonResumeTheme(themeName, resumeData, inlineCss);
|
|
7066
|
+
} else {
|
|
7067
|
+
return await renderRyamlTheme(themeName, resumeData, themeConfig, inlineCss, language);
|
|
7068
|
+
}
|
|
7069
|
+
} catch (error) {
|
|
7070
|
+
if (error instanceof Error) {
|
|
7071
|
+
throw new Error(`Error rendering theme: ${error.message}`);
|
|
7072
|
+
}
|
|
7073
|
+
throw new Error("Unknown error rendering theme");
|
|
7074
|
+
}
|
|
7075
|
+
}
|
|
7076
|
+
async function renderJsonResumeTheme(themeName, resumeData, inlineCss) {
|
|
7077
|
+
let themePackageName;
|
|
7078
|
+
if (themeName.startsWith("jsonresume-theme-")) {
|
|
7079
|
+
themePackageName = themeName;
|
|
7080
|
+
} else if (themeName.startsWith("jsonresume-")) {
|
|
7081
|
+
themePackageName = `jsonresume-theme-${themeName.replace("jsonresume-", "")}`;
|
|
7082
|
+
} else {
|
|
7083
|
+
themePackageName = `jsonresume-theme-${themeName}`;
|
|
7084
|
+
}
|
|
7085
|
+
const jsonResumeData = resumeData;
|
|
7086
|
+
const themePackage = await import(themePackageName);
|
|
7087
|
+
const renderedHTML = themePackage.default.render(jsonResumeData);
|
|
7088
|
+
return {
|
|
7089
|
+
htmlOutput: injectCss(renderedHTML, inlineCss)
|
|
7090
|
+
};
|
|
7091
|
+
}
|
|
7092
|
+
async function renderRyamlTheme(themeName, resumeData, themeConfig, inlineCss, language = "en") {
|
|
7093
|
+
if (themeName === "default") {
|
|
7094
|
+
throw new Error("No default theme available. Please specify a specific theme name.");
|
|
7095
|
+
}
|
|
7096
|
+
const themePackageName = `@resuml/theme-${themeName}`;
|
|
7097
|
+
const themePackage = await import(themePackageName);
|
|
7098
|
+
const renderedHTML = themePackage.default.render(resumeData, themeConfig, language);
|
|
7099
|
+
return {
|
|
7100
|
+
htmlOutput: injectCss(renderedHTML, inlineCss)
|
|
7101
|
+
};
|
|
7102
|
+
}
|
|
7103
|
+
function injectCss(html, css) {
|
|
7104
|
+
if (!css) return html;
|
|
7105
|
+
return html.replace("</head>", `<style>${css}</style></head>`);
|
|
7106
|
+
}
|
|
7107
|
+
|
|
7096
7108
|
// src/index.ts
|
|
7097
|
-
var currentDir =
|
|
7109
|
+
var currentDir = import_path2.default.dirname((0, import_url.fileURLToPath)(importMetaUrl));
|
|
7098
7110
|
function getCliVersion() {
|
|
7099
|
-
const packageJsonPath =
|
|
7100
|
-
if (
|
|
7111
|
+
const packageJsonPath = import_path2.default.resolve(currentDir, "../package.json");
|
|
7112
|
+
if (import_fs5.default.existsSync(packageJsonPath)) {
|
|
7101
7113
|
try {
|
|
7102
|
-
const packageJson = JSON.parse(
|
|
7114
|
+
const packageJson = JSON.parse(import_fs5.default.readFileSync(packageJsonPath, "utf8"));
|
|
7103
7115
|
return packageJson.version || "0.0.0";
|
|
7104
7116
|
} catch {
|
|
7105
7117
|
return "0.0.0";
|
|
@@ -7111,8 +7123,8 @@ var program = new import_commander.Command();
|
|
|
7111
7123
|
program.name("resuml").description("CLI tool for managing resuml resume files.").version(getCliVersion());
|
|
7112
7124
|
program.command("validate").description("Validates resume data against the schema.").option("-r, --resume <path>", "Input YAML file, directory, or glob pattern.").option("--debug", "Show detailed validation errors.").action(validateAction);
|
|
7113
7125
|
program.command("tojson").description("Converts YAML resume data to JSON format.").option("-r, --resume <path>", "Input YAML file, directory, or glob pattern.").option("-o, --output <file>", "Output JSON file path.", "resume.json").option("--debug", "Show detailed validation and processing information.").action(toJsonAction);
|
|
7114
|
-
program.command("render").description("Renders the resume data using a specified theme.").option("-r, --resume <path>", "Input YAML file, directory, or glob pattern.").option("-t, --theme <name>", "Theme name (e.g., stackoverflow, react).").option("
|
|
7115
|
-
program.command("dev").description("Start development server with hot-reload.").option("-r, --resume <path>", "Input YAML file, directory, or glob pattern.").option("-t, --theme <name>", "Theme name (e.g., stackoverflow, react).").option("--
|
|
7126
|
+
program.command("render").description("Renders the resume data using a specified theme.").option("-r, --resume <path>", "Input YAML file, directory, or glob pattern.").option("-t, --theme <name>", "Theme name (e.g., stackoverflow, react).").option("-o, --output <file>", "Output HTML file path (defaults to resume.html).").option("--language <code>", "Language code for localization.", "en").option("--debug", "Show detailed validation and processing information.").action(renderAction);
|
|
7127
|
+
program.command("dev").description("Start development server with hot-reload.").option("-r, --resume <path>", "Input YAML file, directory, or glob pattern.").option("-t, --theme <name>", "Theme name (e.g., stackoverflow, react).").option("--port <number>", "Port for development server.", "3000").option("--language <code>", "Language code for localization.", "en").option("--debug", "Show detailed validation and processing information.").action(devAction);
|
|
7116
7128
|
if (process.env.NODE_ENV !== "test") {
|
|
7117
7129
|
(async () => {
|
|
7118
7130
|
try {
|
|
@@ -7125,6 +7137,10 @@ if (process.env.NODE_ENV !== "test") {
|
|
|
7125
7137
|
}
|
|
7126
7138
|
// Annotate the CommonJS export names for ESM import in node:
|
|
7127
7139
|
0 && (module.exports = {
|
|
7128
|
-
|
|
7140
|
+
loadResumeFiles,
|
|
7141
|
+
loadTheme,
|
|
7142
|
+
processResumeData,
|
|
7143
|
+
program,
|
|
7144
|
+
themeRender
|
|
7129
7145
|
});
|
|
7130
7146
|
//# sourceMappingURL=index.js.map
|