yamlresume 0.15.3 → 0.16.0

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,39 @@
1
+ import {Command,InvalidArgumentError}from'commander';import {joinNonEmptyString,YAMLResumeError,getErrorMessage,LOCALE_LANGUAGE_OPTIONS,getLocaleLanguageDetail,LATEX_TEMPLATE_OPTIONS,getLatexTemplateDetail,HTML_TEMPLATE_OPTIONS,getHtmlTemplateDetail,DOCX_TEMPLATE_OPTIONS,getDocxTemplateDetail}from'@yamlresume/core';import {LATEX_COMPILE_TIMEOUT,watchResumeFile,readResumeFile,buildResumeFile,newResumeFile,generateResumeFile,translateResumeFile}from'@yamlresume/node';import A,{consola}from'consola';import W from'ora';import P from'fs';import s from'chalk';import Ce from'envinfo';import {execa}from'execa';import {getFonts}from'font-list';import {markdownTable}from'markdown-table';import {listSampleResumes}from'@yamlresume/samples';import {box}from'consola/utils';var M={version:"0.16.0"};var u=`
2
+ Environment variables:
3
+
4
+ Required (one API key for the selected cloud provider):
5
+ DEEPSEEK_API_KEY DeepSeek API key
6
+ OPENAI_API_KEY OpenAI API key
7
+ MOONSHOT_API_KEY Kimi (Moonshot AI) API key
8
+
9
+ Optional:
10
+ OLLAMA_HOST Ollama host for local models
11
+ YAMLRESUME_AI_MODEL model override (overridden by --model)
12
+ YAMLRESUME_AI_BASE_URL API base URL override (overridden by --base-url)
13
+ `;async function Z(e,o){let t,r="",i={start:n=>{t=W(n).start();},success:n=>{t?.succeed(n),consola.success(`Generated ${e} successfully.`);},debug:consola.debug,info:consola.info,log:consola.log,warn:consola.warn,error:()=>{}};try{await generateResumeFile(e,o.position,o.language,{model:o.model,baseURL:o.baseUrl,maxRetries:o.retry,onChunk:n=>{r+=n,t&&(t.text=`Generating resume...
14
+ ${r.slice(-200)}`);},logger:i});}catch(n){t?.fail("Failed to generate resume");let a=getErrorMessage(n);consola.error(a),consola.level>=4&&n instanceof Error&&n.stack&&consola.error(n.stack),this.error(a,{exitCode:n instanceof YAMLResumeError?n.errno:1});}}function k(){return new Command().name("generate").description("generate a new resume with AI").requiredOption("-p, --position <position>","target position or job title").requiredOption("-l, --language <language>","target locale language").option("-m, --model <model>","AI provider model to use").option("-b, --base-url <url>","AI provider base URL").option("-r, --retry <count>","maximum retries when validation fails (default: 2)",e=>{let o=Number.parseInt(e,10);if(Number.isNaN(o)||o<0)throw new InvalidArgumentError("Retry count must be a non-negative integer.");return o}).argument("<filename>","output filename").addHelpText("after",u).action(Z)}async function ie(e,o,t){let r,i="",n={start:a=>{r=W(a).start();},success:a=>{r?.succeed(a),consola.success(`Translated ${o} successfully.`);},debug:consola.debug,info:consola.info,log:consola.log,warn:consola.warn,error:()=>{}};try{await translateResumeFile(e,o,t.to,{model:t.model,baseURL:t.baseUrl,maxRetries:t.retry,onChunk:a=>{i+=a,r&&(r.text=`Translating resume...
15
+ ${i.slice(-200)}`);},logger:n});}catch(a){r?.fail("Failed to translate resume");let c=getErrorMessage(a);consola.error(c),consola.level>=4&&a instanceof Error&&a.stack&&consola.error(a.stack),this.error(c,{exitCode:a instanceof YAMLResumeError?a.errno:1});}}function $(){return new Command().name("translate").description("translate a resume from one locale language to another with AI").requiredOption("-t, --to <language>","target locale language").option("-m, --model <model>","AI provider model to use").option("-b, --base-url <url>","AI provider base URL").option("-r, --retry <count>","maximum retries when validation fails (default: 2)",e=>{let o=Number.parseInt(e,10);if(Number.isNaN(o)||o<0)throw new InvalidArgumentError("Retry count must be a non-negative integer.");return o}).argument("<input>","source resume filename").argument("<output>","output resume filename").addHelpText("after",u).action(ie)}function b(){return new Command().name("ai").description("AI-powered resume commands").addCommand(k()).addCommand($())}function f(e,o,t){let i=t.replace(/\r\n/g,`
16
+ `).split(`
17
+ `)[e.line-1]||"",n=`${" ".repeat(e.column-1)}^`,a=s.white.bold(`${o}:${e.line}:${e.column}`),c=s.red.bold("warning"),y=s.white(e.message),C=s.white(i),h=s.green.bold(n);return [`${a}: ${c}: ${y}`,`${C}`,`${h}`].join(`
18
+ `)}function g(e,o,t){let r=e.match(/at line (\d+), column (\d+)/);if(!r)return [s.white.bold(o),s.red.bold("error"),`${s.white(e)}.`].join(": ");let i=Number.parseInt(r[1],10),n=Number.parseInt(r[2],10),c=t.replace(/\r\n/g,`
19
+ `).split(`
20
+ `)[i-1]||"",y=`${" ".repeat(n-1)}^`,C=s.white.bold(`${o}:${i}:${n}`),h=s.red.bold("error"),B=s.white(e.split(`
21
+ `)[0].replace(/ at line \d+, column \d+:?/,".").trim()),j=s.white(c),H=s.green.bold(y);return [`${C}: ${h}: ${B}`,`${j}`,`${H}`].join(`
22
+ `)}function pe(e){let o=Number(e);return Number.isNaN(o)||o<0?(consola.warn(joinNonEmptyString([`Invalid timeout value: "${e}".`,`Using default timeout: ${LATEX_COMPILE_TIMEOUT}s.`,"Timeout must be a non-negative number in seconds (0 to disable)."]," ")),LATEX_COMPILE_TIMEOUT):o}async function ue(e,o){try{let{validated:t,errors:r}=readResumeFile(e,{validate:o.validate});if(t==="failed"&&r){let i=P.readFileSync(e,"utf8");for(let n of r)consola.log(f(n,e,i));}await buildResumeFile(e,{...o,validate:!1,logger:consola});}catch(t){if(t instanceof YAMLResumeError){if(t.code==="INVALID_YAML"){let r=P.readFileSync(e,"utf8");consola.log(g(t.message,e,r));}consola.error(getErrorMessage(t)),process.exit(t.errno);return}consola.error(getErrorMessage(t)),process.exit(1);return}}function L(){return new Command().name("build").description("build a resume to Docx, HTML, Markdown or LaTeX/PDF").argument("<resume-path>","the resume file path").option("--no-pdf","only generate TeX file without PDF (for LaTeX layouts)").option("--no-validate","skip resume schema validation").option("-o, --output <dir>","output directory for generated files").option("-t, --timeout <seconds>",joinNonEmptyString(["timeout for LaTeX compilation in seconds",`(default: ${LATEX_COMPILE_TIMEOUT}, 0 to disable)`]," "),e=>pe(e)).action(ue)}function x(){return new Command().name("dev").description("build a resume on file changes (watch mode)").argument("<resume-path>","the resume file path").option("--no-pdf","only generate TeX file without PDF").option("--no-validate","skip resume schema validation").option("-o, --output <dir>","output directory for generated files").action((e,o)=>{watchResumeFile(e,{...o,logger:consola});})}async function be(){let e=await Ce.run({System:["OS","CPU"],Binaries:["Node","Yarn","npm","pnpm","Bun"]},{json:false,showNotFound:true});console.log(e);}async function we(){A.info("Checking XeTeX...");try{let{stdout:e}=await execa("xelatex",["--version"]);console.log(` XeTeX: ${e.split(`
23
+ `)[0]}
24
+ `);}catch{console.log(` XeTeX: Not Found
25
+ `);}}async function Le(){A.info("Checking Tectonic...");try{let{stdout:e}=await execa("tectonic",["--version"]);console.log(` Tectonic: ${e.split(`
26
+ `)[0]}
27
+ `);}catch{console.log(` Tectonic: Not Found
28
+ `);}}async function xe(){A.info("Checking Fonts...");let e=await getFonts({disableQuoting:true}),o=["Linux Libertine O","Linux Libertine","Noto Serif CJK SC","Noto Sans CJK SC"];for(let t of o){let i=e.some(n=>n.toLowerCase().includes(t.toLowerCase()))?"Installed":"Not Installed";console.log(` ${t}: ${i}`);}}function E(){return new Command().name("doctor").description("check environment for YAMLResume dependencies").action(async()=>{await be(),await we(),await Le(),await xe();})}function Ne(){return markdownTable([["locale.language","Language Name"],...LOCALE_LANGUAGE_OPTIONS.map(e=>[e,getLocaleLanguageDetail(e).name])])}function T(){let e=new Command().name("languages").description("i18n and l10n support");return e.command("list").description("list all supported languages").action(()=>{A.log(Ne());}),e}var ke="software-engineer";function $e(e,o){try{newResumeFile(e,o.sample??ke,o.language,{showSampleSource:!!o.sample,logger:consola});}catch(t){if(t instanceof YAMLResumeError){consola.error(getErrorMessage(t)),process.exit(t.errno);return}consola.error(getErrorMessage(t)),consola.info(`Available samples:
29
+ ${listSampleResumes().map(r=>` - ${r.id}: ${r.title}`).join(`
30
+ `)}`),process.exit(1);}}function v(){return new Command().name("new").description("create a new resume").argument("[filename]","output filename","resume.yml").option("--sample <id>","create from a curated sample resume").option("--language <language>","locale language for the sample","en").action($e)}function Ve(){let e=listSampleResumes();return markdownTable([["ID","Position","Title","Category"],...e.map(o=>[o.id,o.position,o.title,o.category])])}function I(){let e=new Command().name("samples").description("manage sample resumes");return e.command("list").description("list all sample resumes").action(()=>{A.log(Ve());}),e}function Qe(){let e=[...LATEX_TEMPLATE_OPTIONS.map(o=>{let t=getLatexTemplateDetail(o);return [o,t.engine,t.name,t.description]}),...HTML_TEMPLATE_OPTIONS.map(o=>{let t=getHtmlTemplateDetail(o);return [o,t.engine,t.name,t.description]}),...DOCX_TEMPLATE_OPTIONS.map(o=>{let t=getDocxTemplateDetail(o);return [o,t.engine,t.name,t.description]})];return markdownTable([["layouts.[].template","Engine","Template Name","Description"],...e])}function N(){let e=new Command().name("templates").description("manage resume templates");return e.command("list").description("list all supported templates").action(()=>{A.log(Qe());}),e}async function eo(e){try{let{validated:o,errors:t}=readResumeFile(e,{validate:!0});if(o==="success"){consola.success("Resume validation passed.");return}if(o==="failed"&&t){let r=P.readFileSync(e,"utf8");for(let i of t)consola.log(f(i,e,r));consola.fail("Resume validation failed.");}}catch(o){if(o instanceof YAMLResumeError){if(o.code==="INVALID_YAML"){let t=P.readFileSync(e,"utf8");consola.log(g(o.message,e,t));}consola.error(getErrorMessage(o)),process.exit(o.errno);return}consola.error(getErrorMessage(o)),process.exit(1);return}}function O(){return new Command().name("validate").description("validate a resume against the YAMLResume schema").argument("<resume-path>","the resume file path").action(eo)}var to=["New from v0.16: translate resume with AI.","Example: yamlresume ai translate --to <language> <input> <output>","Learn more: yamlresume ai translate --help"].join(`
31
+ `);function R(){return box(to)}function S(e){A.level=e?4:3;}function Vt(){let e=new Command;return e.name("yamlresume").description(["YAMLResume \u2014 Resume as Code in YAML",`
32
+ __ __ _ __ __ _ ____
33
+ \\ \\ / // \\ | \\/ | | | _ \\ ___ ___ _ _ ___ ___ ___
34
+ \\ V // _ \\ | |\\/| | | | |_) / _ \\/ __| | | / _ \\/ _ \\ / _ \\
35
+ | |/ ___ \\| | | | |___| _ < __/\\__ \\ |_| | | | | | | __/
36
+ |_/_/ \\_\\_| |_|_____|_| \\_\\___||___/\\____|_| |_| |_|\\___|
37
+ `].join(`
38
+ `)).version(M.version).option("-v, --verbose","verbose output").addHelpText("before",R()).hook("preAction",t=>{S(t.opts().verbose);}),e.addCommand(b()),e.addCommand(L()),e.addCommand(x()),e.addCommand(E()),e.addCommand(T()),e.addCommand(v()),e.addCommand(I()),e.addCommand(N()),e.addCommand(O()),e}export{b as a,L as b,x as c,E as d,T as e,v as f,I as g,N as h,O as i,Vt as j};//# sourceMappingURL=chunk-FZHGWOCD.js.map
39
+ //# sourceMappingURL=chunk-FZHGWOCD.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../package.json","../src/commands/ai/const.ts","../src/commands/ai/generate.ts","../src/commands/ai/translate.ts","../src/commands/ai/index.ts","../src/utils/format.ts","../src/commands/build.ts","../src/commands/dev.ts","../src/commands/doctor.ts","../src/commands/languages.ts","../src/commands/new.ts","../src/commands/samples.ts","../src/commands/templates.ts","../src/commands/validate.ts","../src/utils/banner.ts","../src/utils/consola.ts","../src/program.ts"],"names":["package_default","AI_ENVIRONMENT_VARIABLES_HELP_TEXT","handleGenerateCommand","filename","options","spinner","streamedText","logger","message","ora","consola","generateResumeFile","chunk","error","getErrorMessage","YAMLResumeError","createAIGenerateCommand","Command","value","parsed","InvalidArgumentError","handleTranslateCommand","input","output","translateResumeFile","createAITranslateCommand","createAICommand","prettifySchemaValidationError","resumePath","resumeStr","lineContent","pointer","filePath","chalk","errorType","codeLine","pointerLine","prettifyYamlParseError","errorMessage","lineMatch","line","column","parseTimeout","num","joinNonEmptyString","LATEX_COMPILE_TIMEOUT","handleBuildCommand","validated","errors","readResumeFile","fs","buildResumeFile","createBuildCommand","createDevCommand","watchResumeFile","checkSystem","info","envinfo","checkXeTeX","stdout","execa","checkTectonic","checkFonts","installedFonts","getFonts","fonts","font","status","f","createDoctorCommand","listLanguages","markdownTable","LOCALE_LANGUAGE_OPTIONS","getLocaleLanguageDetail","createLanguagesCommand","cmd","DEFAULT_SAMPLE_ID","handleNewCommand","newResumeFile","listSampleResumes","sample","createNewCommand","listSamples","samples","createSamplesCommand","listTemplates","templates","LATEX_TEMPLATE_OPTIONS","details","getLatexTemplateDetail","HTML_TEMPLATE_OPTIONS","getHtmlTemplateDetail","DOCX_TEMPLATE_OPTIONS","getDocxTemplateDetail","createTemplatesCommand","handleValidateCommand","createValidateCommand","ANNOUNCEMENT","showBanner","box","setVerboseLog","verbose","createProgram","program","thisCommand"],"mappings":"kwBAAA,IAAAA,CAAAA,CAAA,CAEE,OAAA,CAAW,QAuFb,CAAA,CC9DO,IAAMC,CAAAA,CAAqC;AAAA;;AAAA;AAAA;AAAA;AAAA;;AAAA;AAAA;AAAA;AAAA;ACwBlD,CAAA,CAAA,eAAsBC,EAEpBC,CAAAA,CACAC,CAAAA,CACe,CACf,IAAIC,EACAC,CAAAA,CAAe,EAAA,CAEbC,CAAAA,CAAiB,CACrB,MAAQC,CAAAA,EAAY,CAClBH,CAAAA,CAAUI,CAAAA,CAAID,CAAO,CAAA,CAAE,KAAA,GACzB,CAAA,CACA,QAAUA,CAAAA,EAAY,CACpBH,CAAAA,EAAS,OAAA,CAAQG,CAAO,CAAA,CACxBE,OAAAA,CAAQ,OAAA,CAAQ,CAAA,UAAA,EAAaP,CAAQ,CAAA,cAAA,CAAgB,EACvD,CAAA,CACA,KAAA,CAAOO,QAAQ,KAAA,CACf,IAAA,CAAMA,OAAAA,CAAQ,IAAA,CACd,IAAKA,OAAAA,CAAQ,GAAA,CACb,IAAA,CAAMA,OAAAA,CAAQ,KACd,KAAA,CAAO,IAAM,CAAC,CAChB,EAEA,GAAI,CACF,MAAMC,kBAAAA,CAAmBR,EAAUC,CAAAA,CAAQ,QAAA,CAAUA,CAAAA,CAAQ,QAAA,CAAU,CACrE,KAAA,CAAOA,CAAAA,CAAQ,KAAA,CACf,OAAA,CAASA,EAAQ,OAAA,CACjB,UAAA,CAAYA,CAAAA,CAAQ,KAAA,CACpB,QAAUQ,CAAAA,EAAU,CAClBN,GAAgB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Q,UAAA,CAAWlC,CAAAA,EAAqB,CAAA,CACxCkC,EAAQ,UAAA,CAAW7B,CAAAA,EAAwB,CAAA,CAC3C6B,EAAQ,UAAA,CAAWtB,CAAAA,EAAkB,CAAA,CACrCsB,CAAAA,CAAQ,UAAA,CAAWnB,CAAAA,EAAsB,EACzCmB,CAAAA,CAAQ,UAAA,CAAWT,CAAAA,EAAwB,EAC3CS,CAAAA,CAAQ,UAAA,CAAWP,CAAAA,EAAuB,EAEnCO,CACT","file":"chunk-FZHGWOCD.js","sourcesContent":["{\n \"name\": \"yamlresume\",\n \"version\": \"0.16.0\",\n \"description\": \"The CLI interface for YAMLResume's engine\",\n \"license\": \"MIT\",\n \"author\": {\n \"name\": \"YAMLResume\",\n \"email\": \"support@yamlresume.com\",\n \"url\": \"https://yamlresume.dev\"\n },\n \"keywords\": [\n \"YAMLResume\",\n \"CV\",\n \"Resume\",\n \"LaTeX\",\n \"Typesetting\",\n \"PDF\",\n \"YAML\",\n \"JSON\"\n ],\n \"type\": \"module\",\n \"main\": \"./dist/index.js\",\n \"types\": \"./dist/index.d.ts\",\n \"exports\": {\n \".\": {\n \"types\": \"./dist/index.d.ts\",\n \"default\": \"./dist/index.js\"\n }\n },\n \"bin\": {\n \"yamlresume\": \"./dist/cli.js\"\n },\n \"files\": [\n \"dist\",\n \"README.md\",\n \"LICENSE\"\n ],\n \"scripts\": {\n \"build\": \"tsup\",\n \"build:watch\": \"tsup --watch\",\n \"build:clean\": \"rm -rf dist\",\n \"build:prod\": \"tsup --dts --minify --sourcemap\",\n \"prepublishOnly\": \"pnpm test\",\n \"dev\": \"tsx src/cli.ts\",\n \"test\": \"vitest --run\",\n \"test:cov\": \"vitest --coverage --run\",\n \"test:watch\": \"vitest\",\n \"typedoc\": \"typedoc\"\n },\n \"dependencies\": {\n \"@yamlresume/ai\": \"workspace:*\",\n \"@yamlresume/core\": \"workspace:*\",\n \"@yamlresume/node\": \"workspace:*\",\n \"@yamlresume/samples\": \"workspace:*\",\n \"chalk\": \"^5.6.2\",\n \"commander\": \"^15.0.0\",\n \"consola\": \"^3.4.2\",\n \"envinfo\": \"^7.21.0\",\n \"execa\": \"^10.0.0\",\n \"extensionless\": \"^2.0.6\",\n \"font-list\": \"^2.1.0\",\n \"lodash-es\": \"^4.18.1\",\n \"markdown-table\": \"^3.0.4\",\n \"ora\": \"^8.0.0\",\n \"tslib\": \"^2.8.1\",\n \"which\": \"^7.0.0\",\n \"yaml\": \"^2.9.0\"\n },\n \"devDependencies\": {\n \"@types/envinfo\": \"^7.8.4\",\n \"@types/node\": \"^26.1.1\",\n \"@types/which\": \"^3.0.4\",\n \"@yamlresume/testing\": \"workspace:*\"\n },\n \"publishConfig\": {\n \"access\": \"public\"\n },\n \"repository\": {\n \"type\": \"git\",\n \"url\": \"https://github.com/yamlresume/yamlresume.git\",\n \"directory\": \"packages/cli\"\n },\n \"bugs\": {\n \"url\": \"https://github.com/yamlresume/yamlresume/issues\"\n },\n \"homepage\": \"https://yamlresume.dev/docs/cli\",\n \"engines\": {\n \"node\": \">=20.0.0\"\n }\n}\n","/**\n * MIT License\n *\n * Copyright (c) 2023–Present PPResume (https://ppresume.com)\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to\n * deal in the Software without restriction, including without limitation the\n * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or\n * sell copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS\n * IN THE SOFTWARE.\n */\n\n/**\n * Help text describing AI-related environment variables for CLI commands.\n */\nexport const AI_ENVIRONMENT_VARIABLES_HELP_TEXT = `\nEnvironment variables:\n\n Required (one API key for the selected cloud provider):\n DEEPSEEK_API_KEY DeepSeek API key\n OPENAI_API_KEY OpenAI API key\n MOONSHOT_API_KEY Kimi (Moonshot AI) API key\n\n Optional:\n OLLAMA_HOST Ollama host for local models\n YAMLRESUME_AI_MODEL model override (overridden by --model)\n YAMLRESUME_AI_BASE_URL API base URL override (overridden by --base-url)\n`\n","/**\n * MIT License\n *\n * Copyright (c) 2023–Present PPResume (https://ppresume.com)\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to\n * deal in the Software without restriction, including without limitation the\n * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or\n * sell copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS\n * IN THE SOFTWARE.\n */\n\nimport { getErrorMessage, type Logger, YAMLResumeError } from '@yamlresume/core'\nimport { generateResumeFile } from '@yamlresume/node'\nimport { Command, InvalidArgumentError } from 'commander'\nimport { consola } from 'consola'\nimport type { Ora } from 'ora'\nimport ora from 'ora'\n\nimport { AI_ENVIRONMENT_VARIABLES_HELP_TEXT } from './const'\n\n/**\n * Options passed to the generate command action.\n */\nexport interface GenerateCommandOptions {\n position: string\n language: string\n model?: string\n baseUrl?: string\n retry?: number\n}\n\n/**\n * Handle the `ai generate` command.\n *\n * @param this - The Commander command instance.\n * @param filename - The output resume filename.\n * @param options - The command options.\n */\nexport async function handleGenerateCommand(\n this: Command,\n filename: string,\n options: GenerateCommandOptions\n): Promise<void> {\n let spinner: Ora | undefined\n let streamedText = ''\n\n const logger: Logger = {\n start: (message) => {\n spinner = ora(message).start()\n },\n success: (message) => {\n spinner?.succeed(message)\n consola.success(`Generated ${filename} successfully.`)\n },\n debug: consola.debug,\n info: consola.info,\n log: consola.log,\n warn: consola.warn,\n error: () => {},\n }\n\n try {\n await generateResumeFile(filename, options.position, options.language, {\n model: options.model,\n baseURL: options.baseUrl,\n maxRetries: options.retry,\n onChunk: (chunk) => {\n streamedText += chunk\n if (spinner) {\n spinner.text = `Generating resume...\\n${streamedText.slice(-200)}`\n }\n },\n logger,\n })\n } catch (error) {\n spinner?.fail('Failed to generate resume')\n\n const message = getErrorMessage(error)\n consola.error(message)\n\n if (consola.level >= 4 && error instanceof Error && error.stack) {\n consola.error(error.stack)\n }\n\n this.error(message, {\n exitCode: error instanceof YAMLResumeError ? error.errno : 1,\n })\n }\n}\n\n/**\n * Create a command instance to generate a resume with AI.\n */\nexport function createAIGenerateCommand() {\n return new Command()\n .name('generate')\n .description('generate a new resume with AI')\n .requiredOption('-p, --position <position>', 'target position or job title')\n .requiredOption('-l, --language <language>', 'target locale language')\n .option('-m, --model <model>', 'AI provider model to use')\n .option('-b, --base-url <url>', 'AI provider base URL')\n .option(\n '-r, --retry <count>',\n 'maximum retries when validation fails (default: 2)',\n (value) => {\n const parsed = Number.parseInt(value, 10)\n if (Number.isNaN(parsed) || parsed < 0) {\n throw new InvalidArgumentError(\n 'Retry count must be a non-negative integer.'\n )\n }\n return parsed\n }\n )\n .argument('<filename>', 'output filename')\n .addHelpText('after', AI_ENVIRONMENT_VARIABLES_HELP_TEXT)\n .action(handleGenerateCommand)\n}\n","/**\n * MIT License\n *\n * Copyright (c) 2023–Present PPResume (https://ppresume.com)\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to\n * deal in the Software without restriction, including without limitation the\n * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or\n * sell copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS\n * IN THE SOFTWARE.\n */\n\nimport { getErrorMessage, type Logger, YAMLResumeError } from '@yamlresume/core'\nimport { translateResumeFile } from '@yamlresume/node'\nimport { Command, InvalidArgumentError } from 'commander'\nimport { consola } from 'consola'\nimport type { Ora } from 'ora'\nimport ora from 'ora'\n\nimport { AI_ENVIRONMENT_VARIABLES_HELP_TEXT } from './const'\n\n/**\n * Options passed to the translate command action.\n */\nexport interface TranslateCommandOptions {\n to: string\n model?: string\n baseUrl?: string\n retry?: number\n}\n\n/**\n * Handle the `ai translate` command.\n *\n * @param this - The Commander command instance.\n * @param input - The source resume filename.\n * @param output - The output resume filename.\n * @param options - The command options.\n */\nexport async function handleTranslateCommand(\n this: Command,\n input: string,\n output: string,\n options: TranslateCommandOptions\n): Promise<void> {\n let spinner: Ora | undefined\n let streamedText = ''\n\n const logger: Logger = {\n start: (message) => {\n spinner = ora(message).start()\n },\n success: (message) => {\n spinner?.succeed(message)\n consola.success(`Translated ${output} successfully.`)\n },\n debug: consola.debug,\n info: consola.info,\n log: consola.log,\n warn: consola.warn,\n error: () => {},\n }\n\n try {\n await translateResumeFile(input, output, options.to, {\n model: options.model,\n baseURL: options.baseUrl,\n maxRetries: options.retry,\n onChunk: (chunk) => {\n streamedText += chunk\n if (spinner) {\n spinner.text = `Translating resume...\\n${streamedText.slice(-200)}`\n }\n },\n logger,\n })\n } catch (error) {\n spinner?.fail('Failed to translate resume')\n\n const message = getErrorMessage(error)\n consola.error(message)\n\n if (consola.level >= 4 && error instanceof Error && error.stack) {\n consola.error(error.stack)\n }\n\n this.error(message, {\n exitCode: error instanceof YAMLResumeError ? error.errno : 1,\n })\n }\n}\n\n/**\n * Create a command instance to translate a resume with AI.\n */\nexport function createAITranslateCommand() {\n return new Command()\n .name('translate')\n .description(\n 'translate a resume from one locale language to another with AI'\n )\n .requiredOption('-t, --to <language>', 'target locale language')\n .option('-m, --model <model>', 'AI provider model to use')\n .option('-b, --base-url <url>', 'AI provider base URL')\n .option(\n '-r, --retry <count>',\n 'maximum retries when validation fails (default: 2)',\n (value) => {\n const parsed = Number.parseInt(value, 10)\n if (Number.isNaN(parsed) || parsed < 0) {\n throw new InvalidArgumentError(\n 'Retry count must be a non-negative integer.'\n )\n }\n return parsed\n }\n )\n .argument('<input>', 'source resume filename')\n .argument('<output>', 'output resume filename')\n .addHelpText('after', AI_ENVIRONMENT_VARIABLES_HELP_TEXT)\n .action(handleTranslateCommand)\n}\n","/**\n * MIT License\n *\n * Copyright (c) 2023–Present PPResume (https://ppresume.com)\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to\n * deal in the Software without restriction, including without limitation the\n * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or\n * sell copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS\n * IN THE SOFTWARE.\n */\n\nimport { Command } from 'commander'\n\nimport { createAIGenerateCommand } from './generate'\nimport { createAITranslateCommand } from './translate'\n\n/**\n * Create the AI parent command.\n *\n * Exposes `ai generate` and `ai translate` subcommands.\n */\nexport function createAICommand() {\n return new Command()\n .name('ai')\n .description('AI-powered resume commands')\n .addCommand(createAIGenerateCommand())\n .addCommand(createAITranslateCommand())\n}\n","/**\n * MIT License\n *\n * Copyright (c) 2023–Present PPResume (https://ppresume.com)\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to\n * deal in the Software without restriction, including without limitation the\n * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or\n * sell copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS\n * IN THE SOFTWARE.\n */\n\nimport type { PositionalError } from '@yamlresume/node'\nimport chalk from 'chalk'\n\n/**\n * Formats a schema validation error in clang-style with line number, column\n * pointer, and message.\n *\n * @param error - The positional error to format.\n * @param resumePath - The source file path.\n * @param resumeStr - The content of the source file for line display.\n * @returns Formatted error string in clang style.\n */\nexport function prettifySchemaValidationError(\n error: PositionalError,\n resumePath: string,\n resumeStr: string\n): string {\n // Normalize CRLF to LF for cross-platform consistency\n const lines = resumeStr.replace(/\\r\\n/g, '\\n').split('\\n')\n const lineContent = lines[error.line - 1] || ''\n\n // Create the pointer line with spaces and caret\n const pointer = `${' '.repeat(error.column - 1)}^`\n\n // Color scheme similar to clang with enhanced visibility\n const filePath = chalk.white.bold(\n `${resumePath}:${error.line}:${error.column}`\n )\n const errorType = chalk.red.bold('warning')\n const message = chalk.white(error.message)\n const codeLine = chalk.white(lineContent)\n const pointerLine = chalk.green.bold(pointer)\n\n return [\n `${filePath}: ${errorType}: ${message}`,\n `${codeLine}`,\n `${pointerLine}`,\n ].join('\\n')\n}\n\n/**\n * Parses YAML parsing error messages and extracts line/column information.\n *\n * @param errorMessage - The error message from `yaml.parse`.\n * @param resumePath - The source file path.\n * @param resumeStr - The content of the source file for line display.\n * @returns Formatted error string in clang style.\n */\nexport function prettifyYamlParseError(\n errorMessage: string,\n resumePath: string,\n resumeStr: string\n): string {\n // parse the error message to extract line and column\n // example:\n // \"Nested mappings are not allowed in compact mappings at line 6, column 10\"\n const lineMatch = errorMessage.match(/at line (\\d+), column (\\d+)/)\n\n if (!lineMatch) {\n // if we can't parse the error, return a simple formatted message\n return [\n chalk.white.bold(resumePath),\n chalk.red.bold('error'),\n `${chalk.white(errorMessage)}.`,\n ].join(': ')\n }\n\n const line = Number.parseInt(lineMatch[1], 10)\n const column = Number.parseInt(lineMatch[2], 10)\n // Normalize CRLF to LF for cross-platform consistency\n const lines = resumeStr.replace(/\\r\\n/g, '\\n').split('\\n')\n const lineContent = lines[line - 1] || ''\n\n // create the pointer line with spaces and caret\n const pointer = `${' '.repeat(column - 1)}^`\n\n // color scheme similar to clang with enhanced visibility\n const filePath = chalk.white.bold(`${resumePath}:${line}:${column}`)\n const errorType = chalk.red.bold('error')\n const message = chalk.white(\n errorMessage\n .split('\\n')[0]\n .replace(/ at line \\d+, column \\d+:?/, '.')\n .trim()\n )\n const codeLine = chalk.white(lineContent)\n const pointerLine = chalk.green.bold(pointer)\n\n return [\n `${filePath}: ${errorType}: ${message}`,\n `${codeLine}`,\n `${pointerLine}`,\n ].join('\\n')\n}\n","/**\n * MIT License\n *\n * Copyright (c) 2023–Present PPResume (https://ppresume.com)\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to\n * deal in the Software without restriction, including without limitation the\n * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or\n * sell copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS\n * IN THE SOFTWARE.\n */\n\nimport fs from 'node:fs'\nimport {\n getErrorMessage,\n joinNonEmptyString,\n YAMLResumeError,\n} from '@yamlresume/core'\nimport {\n buildResumeFile,\n LATEX_COMPILE_TIMEOUT,\n readResumeFile,\n} from '@yamlresume/node'\nimport { Command } from 'commander'\nimport { consola } from 'consola'\n\nimport {\n prettifySchemaValidationError,\n prettifyYamlParseError,\n} from '../utils/format'\n\n/**\n * Parse and validate the timeout option.\n *\n * If the value is invalid, logs a warning and returns the default timeout.\n *\n * @param value - The timeout value in seconds as a string.\n * @returns The parsed timeout in seconds.\n */\nexport function parseTimeout(value: string): number {\n const num = Number(value)\n\n if (Number.isNaN(num) || num < 0) {\n consola.warn(\n joinNonEmptyString(\n [\n `Invalid timeout value: \"${value}\".`,\n `Using default timeout: ${LATEX_COMPILE_TIMEOUT}s.`,\n 'Timeout must be a non-negative number in seconds (0 to disable).',\n ],\n ' '\n )\n )\n return LATEX_COMPILE_TIMEOUT\n }\n\n return num\n}\n\n/**\n * Options passed to the build command action.\n */\nexport interface BuildCommandOptions {\n pdf: boolean\n validate: boolean\n output?: string\n timeout: number\n}\n\n/**\n * Handle the `build` command.\n *\n * @param resumePath - The resume file path.\n * @param options - The command options.\n */\nexport async function handleBuildCommand(\n resumePath: string,\n options: BuildCommandOptions\n): Promise<void> {\n try {\n const { validated, errors } = readResumeFile(resumePath, {\n validate: options.validate,\n })\n\n if (validated === 'failed' && errors) {\n const resumeStr = fs.readFileSync(resumePath, 'utf8')\n for (const error of errors) {\n consola.log(prettifySchemaValidationError(error, resumePath, resumeStr))\n }\n }\n\n await buildResumeFile(resumePath, {\n ...options,\n validate: false,\n logger: consola,\n })\n } catch (error) {\n if (error instanceof YAMLResumeError) {\n if (error.code === 'INVALID_YAML') {\n const resumeStr = fs.readFileSync(resumePath, 'utf8')\n consola.log(\n prettifyYamlParseError(error.message, resumePath, resumeStr)\n )\n }\n consola.error(getErrorMessage(error))\n process.exit(error.errno)\n return\n }\n\n consola.error(getErrorMessage(error))\n process.exit(1)\n return\n }\n}\n\n/**\n * Create a command instance to build a YAML resume to LaTeX and PDF\n */\nexport function createBuildCommand() {\n return new Command()\n .name('build')\n .description('build a resume to Docx, HTML, Markdown or LaTeX/PDF')\n .argument('<resume-path>', 'the resume file path')\n .option(\n '--no-pdf',\n 'only generate TeX file without PDF (for LaTeX layouts)'\n )\n .option('--no-validate', 'skip resume schema validation')\n .option('-o, --output <dir>', 'output directory for generated files')\n .option(\n '-t, --timeout <seconds>',\n joinNonEmptyString(\n [\n 'timeout for LaTeX compilation in seconds',\n `(default: ${LATEX_COMPILE_TIMEOUT}, 0 to disable)`,\n ],\n ' '\n ),\n (value) => parseTimeout(value)\n )\n .action(handleBuildCommand)\n}\n","/**\n * MIT License\n *\n * Copyright (c) 2023–Present PPResume (https://ppresume.com)\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to\n * deal in the Software without restriction, including without limitation the\n * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or\n * sell copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS\n * IN THE SOFTWARE.\n */\n\nimport { watchResumeFile } from '@yamlresume/node'\nimport { Command } from 'commander'\nimport { consola } from 'consola'\n\n/**\n * Create a command instance to run in watch mode\n */\nexport function createDevCommand() {\n return new Command()\n .name('dev')\n .description('build a resume on file changes (watch mode)')\n .argument('<resume-path>', 'the resume file path')\n .option('--no-pdf', 'only generate TeX file without PDF')\n .option('--no-validate', 'skip resume schema validation')\n .option('-o, --output <dir>', 'output directory for generated files')\n .action(\n (\n resumePath: string,\n options: { pdf: boolean; validate: boolean; output?: string }\n ) => {\n watchResumeFile(resumePath, { ...options, logger: consola })\n }\n )\n}\n","/**\n * MIT License\n *\n * Copyright (c) 2023–Present PPResume (https://ppresume.com)\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to\n * deal in the Software without restriction, including without limitation the\n * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or\n * sell copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS\n * IN THE SOFTWARE.\n */\n\nimport { Command } from 'commander'\nimport consola from 'consola'\nimport envinfo from 'envinfo'\nimport { execa } from 'execa'\nimport { getFonts } from 'font-list'\n\n/**\n * Check system information\n */\nexport async function checkSystem() {\n const info = await envinfo.run(\n {\n System: ['OS', 'CPU'],\n Binaries: ['Node', 'Yarn', 'npm', 'pnpm', 'Bun'],\n },\n { json: false, showNotFound: true }\n )\n console.log(info)\n}\n\n/**\n * Check if XeTeX is installed\n */\nexport async function checkXeTeX() {\n consola.info('Checking XeTeX...')\n try {\n const { stdout } = await execa('xelatex', ['--version'])\n console.log(` XeTeX: ${stdout.split('\\n')[0]}\\n`)\n } catch {\n console.log(' XeTeX: Not Found\\n')\n }\n}\n\n/**\n * Check if Tectonic is installed\n */\nexport async function checkTectonic() {\n consola.info('Checking Tectonic...')\n try {\n const { stdout } = await execa('tectonic', ['--version'])\n console.log(` Tectonic: ${stdout.split('\\n')[0]}\\n`)\n } catch {\n console.log(' Tectonic: Not Found\\n')\n }\n}\n\n/**\n * Check if required fonts are installed\n */\nexport async function checkFonts() {\n consola.info('Checking Fonts...')\n const installedFonts = await getFonts({ disableQuoting: true })\n const fonts = [\n 'Linux Libertine O',\n 'Linux Libertine',\n 'Noto Serif CJK SC',\n 'Noto Sans CJK SC',\n ]\n\n for (const font of fonts) {\n // font-list returns fonts like \"Arial\" or \"Times New Roman\" in an array\n // We check if the required font is included in the list\n // The checking is case-insensitive\n const isInstalled = installedFonts.some((f) =>\n f.toLowerCase().includes(font.toLowerCase())\n )\n const status = isInstalled ? 'Installed' : 'Not Installed'\n console.log(` ${font}: ${status}`)\n }\n}\n\n/**\n * Create a command instance to check the environment\n */\nexport function createDoctorCommand() {\n return new Command()\n .name('doctor')\n .description('check environment for YAMLResume dependencies')\n .action(async () => {\n await checkSystem()\n await checkXeTeX()\n await checkTectonic()\n await checkFonts()\n })\n}\n","/**\n * MIT License\n *\n * Copyright (c) 2023–Present PPResume (https://ppresume.com)\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to\n * deal in the Software without restriction, including without limitation the\n * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or\n * sell copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS\n * IN THE SOFTWARE.\n */\n\nimport {\n getLocaleLanguageDetail,\n LOCALE_LANGUAGE_OPTIONS,\n} from '@yamlresume/core'\nimport { Command } from 'commander'\nimport consola from 'consola'\nimport { markdownTable } from 'markdown-table'\n\n/**\n * Generates a markdown table listing all supported locale languages.\n *\n * The table includes columns for the language code and the language name.\n *\n * @returns A string containing the formatted markdown table.\n */\nexport function listLanguages() {\n return markdownTable([\n ['locale.language', 'Language Name'],\n ...LOCALE_LANGUAGE_OPTIONS.map((value) => [\n value,\n getLocaleLanguageDetail(value).name,\n ]),\n ])\n}\n\n/**\n * Create a command instance to list supported languages\n */\n\nexport function createLanguagesCommand() {\n const cmd = new Command()\n .name('languages')\n .description('i18n and l10n support')\n\n cmd\n .command('list')\n .description('list all supported languages')\n .action(() => {\n consola.log(listLanguages())\n })\n\n return cmd\n}\n","/**\n * MIT License\n *\n * Copyright (c) 2023–Present PPResume (https://ppresume.com)\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to\n * deal in the Software without restriction, including without limitation the\n * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or\n * sell copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS\n * IN THE SOFTWARE.\n */\n\nimport {\n getErrorMessage,\n type LocaleLanguage,\n YAMLResumeError,\n} from '@yamlresume/core'\nimport { newResumeFile } from '@yamlresume/node'\nimport { listSampleResumes } from '@yamlresume/samples'\nimport { Command } from 'commander'\nimport { consola } from 'consola'\n\nconst DEFAULT_SAMPLE_ID = 'software-engineer'\n\n/**\n * Options passed to the new command action.\n */\nexport interface NewCommandOptions {\n sample?: string\n language: string\n}\n\n/**\n * Handle the `new` command.\n *\n * @param filename - The output filename.\n * @param options - The command options.\n */\nexport function handleNewCommand(\n filename: string,\n options: NewCommandOptions\n): void {\n try {\n newResumeFile(\n filename,\n options.sample ?? DEFAULT_SAMPLE_ID,\n options.language as LocaleLanguage,\n { showSampleSource: Boolean(options.sample), logger: consola }\n )\n } catch (error) {\n if (error instanceof YAMLResumeError) {\n consola.error(getErrorMessage(error))\n process.exit(error.errno)\n return\n }\n\n consola.error(getErrorMessage(error))\n consola.info(\n `Available samples:\\n${listSampleResumes()\n .map((sample) => ` - ${sample.id}: ${sample.title}`)\n .join('\\n')}`\n )\n process.exit(1)\n }\n}\n\n/**\n * Create a command instance to create a new YAML resume\n */\nexport function createNewCommand() {\n return new Command()\n .name('new')\n .description('create a new resume')\n .argument('[filename]', 'output filename', 'resume.yml')\n .option('--sample <id>', 'create from a curated sample resume')\n .option('--language <language>', 'locale language for the sample', 'en')\n .action(handleNewCommand)\n}\n","/**\n * MIT License\n *\n * Copyright (c) 2023–Present PPResume (https://ppresume.com)\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to\n * deal in the Software without restriction, including without limitation the\n * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or\n * sell copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS\n * IN THE SOFTWARE.\n */\n\nimport { listSampleResumes } from '@yamlresume/samples'\nimport { Command } from 'commander'\nimport consola from 'consola'\nimport { markdownTable } from 'markdown-table'\n\n/**\n * Generates a markdown table listing all available sample resumes.\n *\n * The table includes columns for the sample id, position, title, and category.\n *\n * @returns A string containing the formatted markdown table.\n */\nexport function listSamples() {\n const samples = listSampleResumes()\n\n return markdownTable([\n ['ID', 'Position', 'Title', 'Category'],\n ...samples.map((sample) => [\n sample.id,\n sample.position,\n sample.title,\n sample.category,\n ]),\n ])\n}\n\n/**\n * Create a command instance to manage sample resumes.\n */\nexport function createSamplesCommand() {\n const cmd = new Command().name('samples').description('manage sample resumes')\n\n cmd\n .command('list')\n .description('list all sample resumes')\n .action(() => {\n consola.log(listSamples())\n })\n\n return cmd\n}\n","/**\n * MIT License\n *\n * Copyright (c) 2023–Present PPResume (https://ppresume.com)\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to\n * deal in the Software without restriction, including without limitation the\n * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or\n * sell copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS\n * IN THE SOFTWARE.\n */\n\nimport {\n DOCX_TEMPLATE_OPTIONS,\n getDocxTemplateDetail,\n getHtmlTemplateDetail,\n getLatexTemplateDetail,\n HTML_TEMPLATE_OPTIONS,\n LATEX_TEMPLATE_OPTIONS,\n} from '@yamlresume/core'\nimport { Command } from 'commander'\nimport consola from 'consola'\nimport { markdownTable } from 'markdown-table'\n\n/**\n * Generates a markdown table listing all supported templates.\n *\n * The table includes columns for the template id, name and description.\n *\n * @returns A string containing the formatted markdown table.\n */\nexport function listTemplates() {\n const templates = [\n ...LATEX_TEMPLATE_OPTIONS.map((value) => {\n const details = getLatexTemplateDetail(value)\n return [value, details.engine, details.name, details.description]\n }),\n ...HTML_TEMPLATE_OPTIONS.map((value) => {\n const details = getHtmlTemplateDetail(value)\n return [value, details.engine, details.name, details.description]\n }),\n ...DOCX_TEMPLATE_OPTIONS.map((value) => {\n const details = getDocxTemplateDetail(value)\n return [value, details.engine, details.name, details.description]\n }),\n ]\n\n return markdownTable([\n ['layouts.[].template', 'Engine', 'Template Name', 'Description'],\n ...templates,\n ])\n}\n\n/**\n * Create a command instance to list supported templates\n */\nexport function createTemplatesCommand() {\n const cmd = new Command()\n .name('templates')\n .description('manage resume templates')\n\n cmd\n .command('list')\n .description('list all supported templates')\n .action(() => {\n consola.log(listTemplates())\n })\n\n return cmd\n}\n","/**\n * MIT License\n *\n * Copyright (c) 2023–Present PPResume (https://ppresume.com)\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to\n * deal in the Software without restriction, including without limitation the\n * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or\n * sell copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS\n * IN THE SOFTWARE.\n */\n\nimport fs from 'node:fs'\nimport { getErrorMessage, YAMLResumeError } from '@yamlresume/core'\nimport { readResumeFile } from '@yamlresume/node'\nimport { Command } from 'commander'\nimport { consola } from 'consola'\n\nimport {\n prettifySchemaValidationError,\n prettifyYamlParseError,\n} from '../utils/format'\n\n/**\n * Handle the `validate` command.\n *\n * @param resumePath - The resume file path.\n */\nexport async function handleValidateCommand(resumePath: string): Promise<void> {\n try {\n const { validated, errors } = readResumeFile(resumePath, {\n validate: true,\n })\n\n if (validated === 'success') {\n consola.success('Resume validation passed.')\n return\n }\n\n if (validated === 'failed' && errors) {\n const resumeStr = fs.readFileSync(resumePath, 'utf8')\n for (const error of errors) {\n consola.log(prettifySchemaValidationError(error, resumePath, resumeStr))\n }\n consola.fail('Resume validation failed.')\n }\n } catch (error) {\n if (error instanceof YAMLResumeError) {\n if (error.code === 'INVALID_YAML') {\n const resumeStr = fs.readFileSync(resumePath, 'utf8')\n consola.log(\n prettifyYamlParseError(error.message, resumePath, resumeStr)\n )\n }\n consola.error(getErrorMessage(error))\n process.exit(error.errno)\n return\n }\n\n consola.error(getErrorMessage(error))\n process.exit(1)\n return\n }\n}\n\n/**\n * Create a command instance to validate a YAML resume\n */\nexport function createValidateCommand() {\n return new Command()\n .name('validate')\n .description('validate a resume against the YAMLResume schema')\n .argument('<resume-path>', 'the resume file path')\n .action(handleValidateCommand)\n}\n","/**\n * MIT License\n *\n * Copyright (c) 2023–Present PPResume (https://ppresume.com)\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to\n * deal in the Software without restriction, including without limitation the\n * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or\n * sell copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS\n * IN THE SOFTWARE.\n */\n\nimport { box } from 'consola/utils'\n\n/**\n * Announcement shown in the root help output.\n *\n * Update this constant when there is something new to announce and clear it\n * when the announcement becomes stale.\n */\nconst ANNOUNCEMENT = [\n 'New from v0.16: translate resume with AI.',\n 'Example: yamlresume ai translate --to <language> <input> <output>',\n 'Learn more: yamlresume ai translate --help',\n].join('\\n')\n\n/**\n * Get the announcement banner for the current release.\n *\n * @returns The boxed announcement banner.\n */\nexport function showBanner(): string {\n return box(ANNOUNCEMENT)\n}\n","/**\n * MIT License\n *\n * Copyright (c) 2023–Present PPResume (https://ppresume.com)\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to\n * deal in the Software without restriction, including without limitation the\n * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or\n * sell copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS\n * IN THE SOFTWARE.\n */\n\nimport consola from 'consola'\n\n/**\n * Set the verbose mode for consola\n *\n * @param verbose - Whether to enable verbose mode\n * @see https://github.com/unjs/consola?tab=readme-ov-file#log-level\n */\nexport function setVerboseLog(verbose: boolean) {\n consola.level = verbose ? 4 : 3\n}\n","/**\n * MIT License\n *\n * Copyright (c) 2023–Present PPResume (https://ppresume.com)\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to\n * deal in the Software without restriction, including without limitation the\n * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or\n * sell copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS\n * IN THE SOFTWARE.\n */\n\nimport { Command } from 'commander'\n\nimport packageJson from '../package.json' with { type: 'json' }\nimport {\n createAICommand,\n createBuildCommand,\n createDevCommand,\n createDoctorCommand,\n createLanguagesCommand,\n createNewCommand,\n createSamplesCommand,\n createTemplatesCommand,\n createValidateCommand,\n} from './commands'\nimport { setVerboseLog, showBanner } from './utils'\n\n/**\n * Create the CLI program.\n *\n * @returns The CLI program.\n */\nexport function createProgram(): Command {\n const program = new Command()\n\n const banner = `\n __ __ _ __ __ _ ____\n \\\\ \\\\ / // \\\\ | \\\\/ | | | _ \\\\ ___ ___ _ _ ___ ___ ___\n \\\\ V // _ \\\\ | |\\\\/| | | | |_) / _ \\\\/ __| | | / _ \\\\/ _ \\\\ / _ \\\\\n | |/ ___ \\\\| | | | |___| _ < __/\\\\__ \\\\ |_| | | | | | | __/\n |_/_/ \\\\_\\\\_| |_|_____|_| \\\\_\\\\___||___/\\\\____|_| |_| |_|\\\\___|\n`\n\n program\n .name('yamlresume')\n .description(['YAMLResume — Resume as Code in YAML', banner].join('\\n'))\n .version(packageJson.version)\n .option('-v, --verbose', 'verbose output')\n .addHelpText('before', showBanner())\n .hook('preAction', (thisCommand) => {\n setVerboseLog(thisCommand.opts().verbose)\n })\n\n program.addCommand(createAICommand())\n program.addCommand(createBuildCommand())\n program.addCommand(createDevCommand())\n program.addCommand(createDoctorCommand())\n program.addCommand(createLanguagesCommand())\n program.addCommand(createNewCommand())\n program.addCommand(createSamplesCommand())\n program.addCommand(createTemplatesCommand())\n program.addCommand(createValidateCommand())\n\n return program\n}\n"]}
package/dist/cli.js CHANGED
@@ -1,3 +1,3 @@
1
1
  #!/usr/bin/env node
2
- import'@yamlresume/core/suppress-warnings';var{createProgram:r}=await import('./program-G4CL3FZC.js');r().parse();//# sourceMappingURL=cli.js.map
2
+ import'@yamlresume/core/suppress-warnings';var{createProgram:r}=await import('./program-NQKF2FPN.js');r().parse();//# sourceMappingURL=cli.js.map
3
3
  //# sourceMappingURL=cli.js.map
package/dist/index.d.ts CHANGED
@@ -25,9 +25,11 @@ import { Command } from 'commander';
25
25
  */
26
26
 
27
27
  /**
28
- * Create a command instance to build a YAML resume to LaTeX and PDF
28
+ * Create the AI parent command.
29
+ *
30
+ * Exposes `ai generate` and `ai translate` subcommands.
29
31
  */
30
- declare function createBuildCommand(): Command;
32
+ declare function createAICommand(): Command;
31
33
 
32
34
  /**
33
35
  * MIT License
@@ -54,9 +56,9 @@ declare function createBuildCommand(): Command;
54
56
  */
55
57
 
56
58
  /**
57
- * Create a command instance to run in watch mode
59
+ * Create a command instance to build a YAML resume to LaTeX and PDF
58
60
  */
59
- declare function createDevCommand(): Command;
61
+ declare function createBuildCommand(): Command;
60
62
 
61
63
  /**
62
64
  * MIT License
@@ -83,9 +85,9 @@ declare function createDevCommand(): Command;
83
85
  */
84
86
 
85
87
  /**
86
- * Create a command instance to check the environment
88
+ * Create a command instance to run in watch mode
87
89
  */
88
- declare function createDoctorCommand(): Command;
90
+ declare function createDevCommand(): Command;
89
91
 
90
92
  /**
91
93
  * MIT License
@@ -112,9 +114,9 @@ declare function createDoctorCommand(): Command;
112
114
  */
113
115
 
114
116
  /**
115
- * Create a command instance to generate a resume with AI.
117
+ * Create a command instance to check the environment
116
118
  */
117
- declare function createGenerateCommand(): Command;
119
+ declare function createDoctorCommand(): Command;
118
120
 
119
121
  /**
120
122
  * MIT License
@@ -198,6 +200,9 @@ declare function createNewCommand(): Command;
198
200
  * IN THE SOFTWARE.
199
201
  */
200
202
 
203
+ /**
204
+ * Create a command instance to manage sample resumes.
205
+ */
201
206
  declare function createSamplesCommand(): Command;
202
207
 
203
208
  /**
@@ -289,4 +294,4 @@ declare function createValidateCommand(): Command;
289
294
  */
290
295
  declare function createProgram(): Command;
291
296
 
292
- export { createBuildCommand, createDevCommand, createDoctorCommand, createGenerateCommand, createLanguagesCommand, createNewCommand, createProgram, createSamplesCommand, createTemplatesCommand, createValidateCommand };
297
+ export { createAICommand, createBuildCommand, createDevCommand, createDoctorCommand, createLanguagesCommand, createNewCommand, createProgram, createSamplesCommand, createTemplatesCommand, createValidateCommand };
package/dist/index.js CHANGED
@@ -1,2 +1,2 @@
1
- export{a as createBuildCommand,b as createDevCommand,c as createDoctorCommand,d as createGenerateCommand,e as createLanguagesCommand,f as createNewCommand,j as createProgram,g as createSamplesCommand,h as createTemplatesCommand,i as createValidateCommand}from'./chunk-HWR7YN6O.js';//# sourceMappingURL=index.js.map
1
+ export{a as createAICommand,b as createBuildCommand,c as createDevCommand,d as createDoctorCommand,e as createLanguagesCommand,f as createNewCommand,j as createProgram,g as createSamplesCommand,h as createTemplatesCommand,i as createValidateCommand}from'./chunk-FZHGWOCD.js';//# sourceMappingURL=index.js.map
2
2
  //# sourceMappingURL=index.js.map
@@ -0,0 +1,2 @@
1
+ export{j as createProgram}from'./chunk-FZHGWOCD.js';//# sourceMappingURL=program-NQKF2FPN.js.map
2
+ //# sourceMappingURL=program-NQKF2FPN.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":[],"names":[],"mappings":"","file":"program-G4CL3FZC.js"}
1
+ {"version":3,"sources":[],"names":[],"mappings":"","file":"program-NQKF2FPN.js"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "yamlresume",
3
- "version": "0.15.3",
3
+ "version": "0.16.0",
4
4
  "description": "The CLI interface for YAMLResume's engine",
5
5
  "license": "MIT",
6
6
  "author": {
@@ -49,16 +49,16 @@
49
49
  "tslib": "^2.8.1",
50
50
  "which": "^7.0.0",
51
51
  "yaml": "^2.9.0",
52
- "@yamlresume/ai": "0.15.3",
53
- "@yamlresume/core": "0.15.3",
54
- "@yamlresume/node": "0.15.3",
55
- "@yamlresume/samples": "0.15.3"
52
+ "@yamlresume/core": "0.16.0",
53
+ "@yamlresume/samples": "0.16.0",
54
+ "@yamlresume/node": "0.16.0",
55
+ "@yamlresume/ai": "0.16.0"
56
56
  },
57
57
  "devDependencies": {
58
58
  "@types/envinfo": "^7.8.4",
59
59
  "@types/node": "^26.1.1",
60
60
  "@types/which": "^3.0.4",
61
- "@yamlresume/testing": "0.15.3"
61
+ "@yamlresume/testing": "0.16.0"
62
62
  },
63
63
  "publishConfig": {
64
64
  "access": "public"
@@ -1,38 +0,0 @@
1
- import {Command,InvalidArgumentError}from'commander';import k from'fs';import {joinNonEmptyString,YAMLResumeError,getErrorMessage,LOCALE_LANGUAGE_OPTIONS,getLocaleLanguageDetail,LATEX_TEMPLATE_OPTIONS,getLatexTemplateDetail,HTML_TEMPLATE_OPTIONS,getHtmlTemplateDetail,DOCX_TEMPLATE_OPTIONS,getDocxTemplateDetail}from'@yamlresume/core';import {LATEX_COMPILE_TIMEOUT,readResumeFile,buildResumeFile,watchResumeFile,generateResumeFile,newResumeFile}from'@yamlresume/node';import C,{consola}from'consola';import a from'chalk';import Z from'envinfo';import {execa}from'execa';import {getFonts}from'font-list';import ce from'ora';import {markdownTable}from'markdown-table';import {listSampleResumes}from'@yamlresume/samples';import {box}from'consola/utils';var M={version:"0.15.3"};function d(e,o,t){let i=t.replace(/\r\n/g,`
2
- `).split(`
3
- `)[e.line-1]||"",r=`${" ".repeat(e.column-1)}^`,c=a.white.bold(`${o}:${e.line}:${e.column}`),f=a.red.bold("warning"),g=a.white(e.message),_=a.white(i),y=a.green.bold(r);return [`${c}: ${f}: ${g}`,`${_}`,`${y}`].join(`
4
- `)}function p(e,o,t){let n=e.match(/at line (\d+), column (\d+)/);if(!n)return [a.white.bold(o),a.red.bold("error"),`${a.white(e)}.`].join(": ");let i=Number.parseInt(n[1],10),r=Number.parseInt(n[2],10),f=t.replace(/\r\n/g,`
5
- `).split(`
6
- `)[i-1]||"",g=`${" ".repeat(r-1)}^`,_=a.white.bold(`${o}:${i}:${r}`),y=a.red.bold("error"),X=a.white(e.split(`
7
- `)[0].replace(/ at line \d+, column \d+:?/,".").trim()),U=a.white(f),j=a.green.bold(g);return [`${_}: ${y}: ${X}`,`${U}`,`${j}`].join(`
8
- `)}function J(e){let o=Number(e);return Number.isNaN(o)||o<0?(consola.warn(joinNonEmptyString([`Invalid timeout value: "${e}".`,`Using default timeout: ${LATEX_COMPILE_TIMEOUT}s.`,"Timeout must be a non-negative number in seconds (0 to disable)."]," ")),LATEX_COMPILE_TIMEOUT):o}function b(){return new Command().name("build").description("build a resume to Docx, HTML, Markdown or LaTeX/PDF").argument("<resume-path>","the resume file path").option("--no-pdf","only generate TeX file without PDF (for LaTeX layouts)").option("--no-validate","skip resume schema validation").option("-o, --output <dir>","output directory for generated files").option("-t, --timeout <seconds>",joinNonEmptyString(["timeout for LaTeX compilation in seconds",`(default: ${LATEX_COMPILE_TIMEOUT}, 0 to disable)`]," "),e=>J(e)).action(async(e,o)=>{try{let{validated:t,errors:n}=readResumeFile(e,{validate:o.validate});if(t==="failed"&&n){let i=k.readFileSync(e,"utf8");for(let r of n)consola.log(d(r,e,i));}await buildResumeFile(e,{...o,validate:!1,logger:consola});}catch(t){if(t instanceof YAMLResumeError){if(t.code==="INVALID_YAML"){let n=k.readFileSync(e,"utf8");consola.log(p(t.message,e,n));}consola.error(getErrorMessage(t)),process.exit(t.errno);return}consola.error(getErrorMessage(t)),process.exit(1);return}})}function h(){return new Command().name("dev").description("build a resume on file changes (watch mode)").argument("<resume-path>","the resume file path").option("--no-pdf","only generate TeX file without PDF").option("--no-validate","skip resume schema validation").option("-o, --output <dir>","output directory for generated files").action((e,o)=>{watchResumeFile(e,{...o,logger:consola});})}async function oe(){let e=await Z.run({System:["OS","CPU"],Binaries:["Node","Yarn","npm","pnpm","Bun"]},{json:false,showNotFound:true});console.log(e);}async function te(){C.info("Checking XeTeX...");try{let{stdout:e}=await execa("xelatex",["--version"]);console.log(` XeTeX: ${e.split(`
9
- `)[0]}
10
- `);}catch{console.log(` XeTeX: Not Found
11
- `);}}async function re(){C.info("Checking Tectonic...");try{let{stdout:e}=await execa("tectonic",["--version"]);console.log(` Tectonic: ${e.split(`
12
- `)[0]}
13
- `);}catch{console.log(` Tectonic: Not Found
14
- `);}}async function ne(){C.info("Checking Fonts...");let e=await getFonts({disableQuoting:true}),o=["Linux Libertine O","Linux Libertine","Noto Serif CJK SC","Noto Sans CJK SC"];for(let t of o){let i=e.some(r=>r.toLowerCase().includes(t.toLowerCase()))?"Installed":"Not Installed";console.log(` ${t}: ${i}`);}}function L(){return new Command().name("doctor").description("check environment for YAMLResume dependencies").action(async()=>{await oe(),await te(),await re(),await ne();})}function x(){return new Command().name("generate").description("generate a new resume with AI").requiredOption("-p, --position <position>","target position or job title").requiredOption("-l, --language <language>","target locale language").option("-m, --model <model>","AI provider model to use").option("-b, --base-url <url>","AI provider base URL").option("-r, --retry <count>","maximum retries when validation fails (default: 2)",e=>{let o=Number.parseInt(e,10);if(Number.isNaN(o)||o<0)throw new InvalidArgumentError("Retry count must be a non-negative integer.");return o}).argument("<filename>","output filename").addHelpText("after",`
15
- Environment variables:
16
-
17
- Required (one API key for the selected cloud provider):
18
- DEEPSEEK_API_KEY DeepSeek API key
19
- OPENAI_API_KEY OpenAI API key
20
- MOONSHOT_API_KEY Kimi (Moonshot AI) API key
21
-
22
- Optional:
23
- OLLAMA_HOST Ollama host for local models
24
- YAMLRESUME_AI_MODEL model override (overridden by --model)
25
- YAMLRESUME_AI_BASE_URL API base URL override (overridden by --base-url)
26
- `).action(async function(e,o){let t,n="",i={start:r=>{t=ce(r).start();},success:r=>{t?.succeed(r),consola.success(`Generated ${e} successfully.`);},debug:consola.debug,info:consola.info,log:consola.log,warn:consola.warn,error:()=>{}};try{await generateResumeFile(e,o.position,o.language,{model:o.model,baseURL:o.baseUrl,maxRetries:o.retry,onChunk:r=>{n+=r,t&&(t.text=`Generating resume...
27
- ${n.slice(-200)}`);},logger:i});}catch(r){t?.fail("Failed to generate resume");let c=getErrorMessage(r);consola.error(c),consola.level>=4&&r instanceof Error&&r.stack&&consola.error(r.stack),this.error(c,{exitCode:r instanceof YAMLResumeError?r.errno:1});}})}function _e(){return markdownTable([["locale.language","Language Name"],...LOCALE_LANGUAGE_OPTIONS.map(e=>[e,getLocaleLanguageDetail(e).name])])}function v(){let e=new Command().name("languages").description("i18n and l10n support");return e.command("list").description("list all supported languages").action(()=>{C.log(_e());}),e}var Ce="software-engineer";function T(){return new Command().name("new").description("create a new resume").argument("[filename]","output filename","resume.yml").option("--sample <id>","create from a curated sample resume").option("--language <language>","locale language for the sample","en").action((e,o)=>{try{newResumeFile(e,o.sample??Ce,o.language,{showSampleSource:!!o.sample,logger:consola});}catch(t){if(t instanceof YAMLResumeError){consola.error(getErrorMessage(t)),process.exit(t.errno);return}consola.error(getErrorMessage(t)),consola.info(`Available samples:
28
- ${listSampleResumes().map(n=>` - ${n.id}: ${n.title}`).join(`
29
- `)}`),process.exit(1);}})}function Te(){let e=listSampleResumes();return markdownTable([["ID","Position","Title","Category"],...e.map(o=>[o.id,o.position,o.title,o.category])])}function Ee(){return new Command().name("list").description("list all sample resumes").action(()=>{C.log(Te());})}function E(){return new Command().name("samples").description("manage sample resumes").addCommand(Ee())}function De(){let e=[...LATEX_TEMPLATE_OPTIONS.map(o=>{let t=getLatexTemplateDetail(o);return [o,t.engine,t.name,t.description]}),...HTML_TEMPLATE_OPTIONS.map(o=>{let t=getHtmlTemplateDetail(o);return [o,t.engine,t.name,t.description]}),...DOCX_TEMPLATE_OPTIONS.map(o=>{let t=getDocxTemplateDetail(o);return [o,t.engine,t.name,t.description]})];return markdownTable([["layouts.[].template","Engine","Template Name","Description"],...e])}function A(){let e=new Command().name("templates").description("manage resume templates");return e.command("list").description("list all supported templates").action(()=>{C.log(De());}),e}function S(){return new Command().name("validate").description("validate a resume against the YAMLResume schema").argument("<resume-path>","the resume file path").action(async e=>{try{let{validated:o,errors:t}=readResumeFile(e,{validate:!0});if(o==="success"){consola.success("Resume validation passed.");return}if(o==="failed"&&t){let n=k.readFileSync(e,"utf8");for(let i of t)consola.log(d(i,e,n));consola.fail("Resume validation failed.");}}catch(o){if(o instanceof YAMLResumeError){if(o.code==="INVALID_YAML"){let t=k.readFileSync(e,"utf8");consola.log(p(o.message,e,t));}consola.error(getErrorMessage(o)),process.exit(o.errno);return}consola.error(getErrorMessage(o)),process.exit(1);return}})}var Ue=["New from v0.15: sample resumes!","Create one: yamlresume new --sample <sample-id>","Browse all: yamlresume samples list"].join(`
30
- `);function I(){return box(Ue)}function N(e){C.level=e?4:3;}function pt(){let e=new Command;return e.name("yamlresume").description(["YAMLResume \u2014 Resume as Code in YAML",`
31
- __ __ _ __ __ _ ____
32
- \\ \\ / // \\ | \\/ | | | _ \\ ___ ___ _ _ ___ ___ ___
33
- \\ V // _ \\ | |\\/| | | | |_) / _ \\/ __| | | / _ \\/ _ \\ / _ \\
34
- | |/ ___ \\| | | | |___| _ < __/\\__ \\ |_| | | | | | | __/
35
- |_/_/ \\_\\_| |_|_____|_| \\_\\___||___/\\____|_| |_| |_|\\___|
36
- `].join(`
37
- `)).version(M.version).option("-v, --verbose","verbose output").addHelpText("before",I()).hook("preAction",t=>{N(t.opts().verbose);}),e.addCommand(b()),e.addCommand(x()),e.addCommand(h()),e.addCommand(L()),e.addCommand(v()),e.addCommand(T()),e.addCommand(E()),e.addCommand(A()),e.addCommand(S()),e}export{b as a,h as b,L as c,x as d,v as e,T as f,E as g,A as h,S as i,pt as j};//# sourceMappingURL=chunk-HWR7YN6O.js.map
38
- //# sourceMappingURL=chunk-HWR7YN6O.js.map
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../package.json","../src/utils/format.ts","../src/commands/build.ts","../src/commands/dev.ts","../src/commands/doctor.ts","../src/commands/generate.ts","../src/commands/languages.ts","../src/commands/new.ts","../src/commands/samples.ts","../src/commands/templates.ts","../src/commands/validate.ts","../src/utils/banner.ts","../src/utils/consola.ts","../src/program.ts"],"names":["package_default","prettifySchemaValidationError","error","resumePath","resumeStr","lineContent","pointer","filePath","chalk","errorType","message","codeLine","pointerLine","prettifyYamlParseError","errorMessage","lineMatch","line","column","parseTimeout","value","num","consola","joinNonEmptyString","LATEX_COMPILE_TIMEOUT","createBuildCommand","Command","options","validated","errors","readResumeFile","fs","buildResumeFile","YAMLResumeError","getErrorMessage","createDevCommand","watchResumeFile","checkSystem","info","envinfo","checkXeTeX","stdout","execa","checkTectonic","checkFonts","installedFonts","getFonts","fonts","font","status","f","createDoctorCommand","createGenerateCommand","parsed","InvalidArgumentError","filename","spinner","streamedText","logger","ora","generateResumeFile","chunk","listLanguages","markdownTable","LOCALE_LANGUAGE_OPTIONS","getLocaleLanguageDetail","createLanguagesCommand","cmd","DEFAULT_SAMPLE_ID","createNewCommand","newResumeFile","listSampleResumes","sample","listSamples","samples","createSamplesListCommand","createSamplesCommand","listTemplates","templates","LATEX_TEMPLATE_OPTIONS","details","getLatexTemplateDetail","HTML_TEMPLATE_OPTIONS","getHtmlTemplateDetail","DOCX_TEMPLATE_OPTIONS","getDocxTemplateDetail","createTemplatesCommand","createValidateCommand","ANNOUNCEMENT","showBanner","box","setVerboseLog","verbose","createProgram","program","thisCommand"],"mappings":"8uBAAA,IAAAA,EAAA,CAEE,OAAA,CAAW,QAuFb,CAAA,CCrDO,SAASC,CAAAA,CACdC,EACAC,CAAAA,CACAC,CAAAA,CACQ,CAGR,IAAMC,CAAAA,CADQD,CAAAA,CAAU,OAAA,CAAQ,OAAA,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CAAAA,CAAU,CAAA,CAAI,EAChC,CCWO,SAASC,EAAAA,EAAyB,CACvC,IAAMC,CAAAA,CAAU,IAAIpE,OAAAA,CAUpB,OAAAoE,EACG,IAAA,CAAK,YAAY,CAAA,CACjB,WAAA,CAAY,CAAC,0CAAA,CAVD;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,CAU8C,EAAE,IAAA,CAAK;AAAA,CAAI,CAAC,CAAA,CACtE,OAAA,CAAQ7F,CAAAA,CAAY,OAAO,CAAA,CAC3B,MAAA,CAAO,eAAA,CAAiB,gBAAgB,EACxC,WAAA,CAAY,QAAA,CAAUwF,CAAAA,EAAY,EAClC,IAAA,CAAK,WAAA,CAAcM,CAAAA,EAAgB,CAClCJ,CAAAA,CAAcI,CAAAA,CAAY,IAAA,EAAK,CAAE,OAAO,EAC1C,CAAC,CAAA,CAEHD,CAAAA,CAAQ,WAAWrE,CAAAA,EAAoB,CAAA,CACvCqE,CAAAA,CAAQ,WAAW1C,CAAAA,EAAuB,CAAA,CAC1C0C,CAAAA,CAAQ,UAAA,CAAW3D,CAAAA,EAAkB,CAAA,CACrC2D,EAAQ,UAAA,CAAW3C,CAAAA,EAAqB,CAAA,CACxC2C,EAAQ,UAAA,CAAW5B,CAAAA,EAAwB,CAAA,CAC3C4B,EAAQ,UAAA,CAAWzB,CAAAA,EAAkB,CAAA,CACrCyB,CAAAA,CAAQ,UAAA,CAAWlB,CAAAA,EAAsB,EACzCkB,CAAAA,CAAQ,UAAA,CAAWR,CAAAA,EAAwB,EAC3CQ,CAAAA,CAAQ,UAAA,CAAWP,CAAAA,EAAuB,EAEnCO,CACT","file":"chunk-HWR7YN6O.js","sourcesContent":["{\n \"name\": \"yamlresume\",\n \"version\": \"0.15.3\",\n \"description\": \"The CLI interface for YAMLResume's engine\",\n \"license\": \"MIT\",\n \"author\": {\n \"name\": \"YAMLResume\",\n \"email\": \"support@yamlresume.com\",\n \"url\": \"https://yamlresume.dev\"\n },\n \"keywords\": [\n \"YAMLResume\",\n \"CV\",\n \"Resume\",\n \"LaTeX\",\n \"Typesetting\",\n \"PDF\",\n \"YAML\",\n \"JSON\"\n ],\n \"type\": \"module\",\n \"main\": \"./dist/index.js\",\n \"types\": \"./dist/index.d.ts\",\n \"exports\": {\n \".\": {\n \"types\": \"./dist/index.d.ts\",\n \"default\": \"./dist/index.js\"\n }\n },\n \"bin\": {\n \"yamlresume\": \"./dist/cli.js\"\n },\n \"files\": [\n \"dist\",\n \"README.md\",\n \"LICENSE\"\n ],\n \"scripts\": {\n \"build\": \"tsup\",\n \"build:watch\": \"tsup --watch\",\n \"build:clean\": \"rm -rf dist\",\n \"build:prod\": \"tsup --dts --minify --sourcemap\",\n \"prepublishOnly\": \"pnpm test\",\n \"dev\": \"tsx src/cli.ts\",\n \"test\": \"vitest --run\",\n \"test:cov\": \"vitest --coverage --run\",\n \"test:watch\": \"vitest\",\n \"typedoc\": \"typedoc\"\n },\n \"dependencies\": {\n \"@yamlresume/ai\": \"workspace:*\",\n \"@yamlresume/core\": \"workspace:*\",\n \"@yamlresume/node\": \"workspace:*\",\n \"@yamlresume/samples\": \"workspace:*\",\n \"chalk\": \"^5.6.2\",\n \"commander\": \"^15.0.0\",\n \"consola\": \"^3.4.2\",\n \"envinfo\": \"^7.21.0\",\n \"execa\": \"^10.0.0\",\n \"extensionless\": \"^2.0.6\",\n \"font-list\": \"^2.1.0\",\n \"lodash-es\": \"^4.18.1\",\n \"markdown-table\": \"^3.0.4\",\n \"ora\": \"^8.0.0\",\n \"tslib\": \"^2.8.1\",\n \"which\": \"^7.0.0\",\n \"yaml\": \"^2.9.0\"\n },\n \"devDependencies\": {\n \"@types/envinfo\": \"^7.8.4\",\n \"@types/node\": \"^26.1.1\",\n \"@types/which\": \"^3.0.4\",\n \"@yamlresume/testing\": \"workspace:*\"\n },\n \"publishConfig\": {\n \"access\": \"public\"\n },\n \"repository\": {\n \"type\": \"git\",\n \"url\": \"https://github.com/yamlresume/yamlresume.git\",\n \"directory\": \"packages/cli\"\n },\n \"bugs\": {\n \"url\": \"https://github.com/yamlresume/yamlresume/issues\"\n },\n \"homepage\": \"https://yamlresume.dev/docs/cli\",\n \"engines\": {\n \"node\": \">=20.0.0\"\n }\n}\n","/**\n * MIT License\n *\n * Copyright (c) 2023–Present PPResume (https://ppresume.com)\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to\n * deal in the Software without restriction, including without limitation the\n * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or\n * sell copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS\n * IN THE SOFTWARE.\n */\n\nimport type { PositionalError } from '@yamlresume/node'\nimport chalk from 'chalk'\n\n/**\n * Formats a schema validation error in clang-style with line number, column\n * pointer, and message.\n *\n * @param error - The positional error to format.\n * @param resumePath - The source file path.\n * @param resumeStr - The content of the source file for line display.\n * @returns Formatted error string in clang style.\n */\nexport function prettifySchemaValidationError(\n error: PositionalError,\n resumePath: string,\n resumeStr: string\n): string {\n // Normalize CRLF to LF for cross-platform consistency\n const lines = resumeStr.replace(/\\r\\n/g, '\\n').split('\\n')\n const lineContent = lines[error.line - 1] || ''\n\n // Create the pointer line with spaces and caret\n const pointer = `${' '.repeat(error.column - 1)}^`\n\n // Color scheme similar to clang with enhanced visibility\n const filePath = chalk.white.bold(\n `${resumePath}:${error.line}:${error.column}`\n )\n const errorType = chalk.red.bold('warning')\n const message = chalk.white(error.message)\n const codeLine = chalk.white(lineContent)\n const pointerLine = chalk.green.bold(pointer)\n\n return [\n `${filePath}: ${errorType}: ${message}`,\n `${codeLine}`,\n `${pointerLine}`,\n ].join('\\n')\n}\n\n/**\n * Parses YAML parsing error messages and extracts line/column information.\n *\n * @param errorMessage - The error message from `yaml.parse`.\n * @param resumePath - The source file path.\n * @param resumeStr - The content of the source file for line display.\n * @returns Formatted error string in clang style.\n */\nexport function prettifyYamlParseError(\n errorMessage: string,\n resumePath: string,\n resumeStr: string\n): string {\n // parse the error message to extract line and column\n // example:\n // \"Nested mappings are not allowed in compact mappings at line 6, column 10\"\n const lineMatch = errorMessage.match(/at line (\\d+), column (\\d+)/)\n\n if (!lineMatch) {\n // if we can't parse the error, return a simple formatted message\n return [\n chalk.white.bold(resumePath),\n chalk.red.bold('error'),\n `${chalk.white(errorMessage)}.`,\n ].join(': ')\n }\n\n const line = Number.parseInt(lineMatch[1], 10)\n const column = Number.parseInt(lineMatch[2], 10)\n // Normalize CRLF to LF for cross-platform consistency\n const lines = resumeStr.replace(/\\r\\n/g, '\\n').split('\\n')\n const lineContent = lines[line - 1] || ''\n\n // create the pointer line with spaces and caret\n const pointer = `${' '.repeat(column - 1)}^`\n\n // color scheme similar to clang with enhanced visibility\n const filePath = chalk.white.bold(`${resumePath}:${line}:${column}`)\n const errorType = chalk.red.bold('error')\n const message = chalk.white(\n errorMessage\n .split('\\n')[0]\n .replace(/ at line \\d+, column \\d+:?/, '.')\n .trim()\n )\n const codeLine = chalk.white(lineContent)\n const pointerLine = chalk.green.bold(pointer)\n\n return [\n `${filePath}: ${errorType}: ${message}`,\n `${codeLine}`,\n `${pointerLine}`,\n ].join('\\n')\n}\n","/**\n * MIT License\n *\n * Copyright (c) 2023–Present PPResume (https://ppresume.com)\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to\n * deal in the Software without restriction, including without limitation the\n * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or\n * sell copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS\n * IN THE SOFTWARE.\n */\n\nimport fs from 'node:fs'\nimport {\n getErrorMessage,\n joinNonEmptyString,\n YAMLResumeError,\n} from '@yamlresume/core'\nimport {\n buildResumeFile,\n LATEX_COMPILE_TIMEOUT,\n readResumeFile,\n} from '@yamlresume/node'\nimport { Command } from 'commander'\nimport { consola } from 'consola'\n\nimport {\n prettifySchemaValidationError,\n prettifyYamlParseError,\n} from '../utils/format'\n\n/**\n * Parse and validate the timeout option.\n *\n * If the value is invalid, logs a warning and returns the default timeout.\n *\n * @param value - The timeout value in seconds as a string.\n * @returns The parsed timeout in seconds.\n */\nexport function parseTimeout(value: string): number {\n const num = Number(value)\n\n if (Number.isNaN(num) || num < 0) {\n consola.warn(\n joinNonEmptyString(\n [\n `Invalid timeout value: \"${value}\".`,\n `Using default timeout: ${LATEX_COMPILE_TIMEOUT}s.`,\n 'Timeout must be a non-negative number in seconds (0 to disable).',\n ],\n ' '\n )\n )\n return LATEX_COMPILE_TIMEOUT\n }\n\n return num\n}\n\n/**\n * Create a command instance to build a YAML resume to LaTeX and PDF\n */\nexport function createBuildCommand() {\n return new Command()\n .name('build')\n .description('build a resume to Docx, HTML, Markdown or LaTeX/PDF')\n .argument('<resume-path>', 'the resume file path')\n .option(\n '--no-pdf',\n 'only generate TeX file without PDF (for LaTeX layouts)'\n )\n .option('--no-validate', 'skip resume schema validation')\n .option('-o, --output <dir>', 'output directory for generated files')\n .option(\n '-t, --timeout <seconds>',\n joinNonEmptyString(\n [\n 'timeout for LaTeX compilation in seconds',\n `(default: ${LATEX_COMPILE_TIMEOUT}, 0 to disable)`,\n ],\n ' '\n ),\n (value) => parseTimeout(value)\n )\n .action(\n async (\n resumePath: string,\n options: {\n pdf: boolean\n validate: boolean\n output?: string\n timeout: number\n }\n ) => {\n try {\n const { validated, errors } = readResumeFile(resumePath, {\n validate: options.validate,\n })\n\n if (validated === 'failed' && errors) {\n const resumeStr = fs.readFileSync(resumePath, 'utf8')\n for (const error of errors) {\n consola.log(\n prettifySchemaValidationError(error, resumePath, resumeStr)\n )\n }\n }\n\n await buildResumeFile(resumePath, {\n ...options,\n validate: false,\n logger: consola,\n })\n } catch (error) {\n if (error instanceof YAMLResumeError) {\n if (error.code === 'INVALID_YAML') {\n const resumeStr = fs.readFileSync(resumePath, 'utf8')\n consola.log(\n prettifyYamlParseError(error.message, resumePath, resumeStr)\n )\n }\n consola.error(getErrorMessage(error))\n process.exit(error.errno)\n return\n }\n\n consola.error(getErrorMessage(error))\n process.exit(1)\n return\n }\n }\n )\n}\n","/**\n * MIT License\n *\n * Copyright (c) 2023–Present PPResume (https://ppresume.com)\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to\n * deal in the Software without restriction, including without limitation the\n * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or\n * sell copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS\n * IN THE SOFTWARE.\n */\n\nimport { watchResumeFile } from '@yamlresume/node'\nimport { Command } from 'commander'\nimport { consola } from 'consola'\n\n/**\n * Create a command instance to run in watch mode\n */\nexport function createDevCommand() {\n return new Command()\n .name('dev')\n .description('build a resume on file changes (watch mode)')\n .argument('<resume-path>', 'the resume file path')\n .option('--no-pdf', 'only generate TeX file without PDF')\n .option('--no-validate', 'skip resume schema validation')\n .option('-o, --output <dir>', 'output directory for generated files')\n .action(\n (\n resumePath: string,\n options: { pdf: boolean; validate: boolean; output?: string }\n ) => {\n watchResumeFile(resumePath, { ...options, logger: consola })\n }\n )\n}\n","/**\n * MIT License\n *\n * Copyright (c) 2023–Present PPResume (https://ppresume.com)\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to\n * deal in the Software without restriction, including without limitation the\n * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or\n * sell copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS\n * IN THE SOFTWARE.\n */\n\nimport { Command } from 'commander'\nimport consola from 'consola'\nimport envinfo from 'envinfo'\nimport { execa } from 'execa'\nimport { getFonts } from 'font-list'\n\n/**\n * Check system information\n */\nexport async function checkSystem() {\n const info = await envinfo.run(\n {\n System: ['OS', 'CPU'],\n Binaries: ['Node', 'Yarn', 'npm', 'pnpm', 'Bun'],\n },\n { json: false, showNotFound: true }\n )\n console.log(info)\n}\n\n/**\n * Check if XeTeX is installed\n */\nexport async function checkXeTeX() {\n consola.info('Checking XeTeX...')\n try {\n const { stdout } = await execa('xelatex', ['--version'])\n console.log(` XeTeX: ${stdout.split('\\n')[0]}\\n`)\n } catch {\n console.log(' XeTeX: Not Found\\n')\n }\n}\n\n/**\n * Check if Tectonic is installed\n */\nexport async function checkTectonic() {\n consola.info('Checking Tectonic...')\n try {\n const { stdout } = await execa('tectonic', ['--version'])\n console.log(` Tectonic: ${stdout.split('\\n')[0]}\\n`)\n } catch {\n console.log(' Tectonic: Not Found\\n')\n }\n}\n\n/**\n * Check if required fonts are installed\n */\nexport async function checkFonts() {\n consola.info('Checking Fonts...')\n const installedFonts = await getFonts({ disableQuoting: true })\n const fonts = [\n 'Linux Libertine O',\n 'Linux Libertine',\n 'Noto Serif CJK SC',\n 'Noto Sans CJK SC',\n ]\n\n for (const font of fonts) {\n // font-list returns fonts like \"Arial\" or \"Times New Roman\" in an array\n // We check if the required font is included in the list\n // The checking is case-insensitive\n const isInstalled = installedFonts.some((f) =>\n f.toLowerCase().includes(font.toLowerCase())\n )\n const status = isInstalled ? 'Installed' : 'Not Installed'\n console.log(` ${font}: ${status}`)\n }\n}\n\n/**\n * Create a command instance to check the environment\n */\nexport function createDoctorCommand() {\n return new Command()\n .name('doctor')\n .description('check environment for YAMLResume dependencies')\n .action(async () => {\n await checkSystem()\n await checkXeTeX()\n await checkTectonic()\n await checkFonts()\n })\n}\n","/**\n * MIT License\n *\n * Copyright (c) 2023–Present PPResume (https://ppresume.com)\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to\n * deal in the Software without restriction, including without limitation the\n * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or\n * sell copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS\n * IN THE SOFTWARE.\n */\n\nimport { getErrorMessage, type Logger, YAMLResumeError } from '@yamlresume/core'\nimport { generateResumeFile } from '@yamlresume/node'\nimport { Command, InvalidArgumentError } from 'commander'\nimport { consola } from 'consola'\nimport type { Ora } from 'ora'\nimport ora from 'ora'\n\n/**\n * Create a command instance to generate a resume with AI.\n */\nexport function createGenerateCommand() {\n return new Command()\n .name('generate')\n .description('generate a new resume with AI')\n .requiredOption('-p, --position <position>', 'target position or job title')\n .requiredOption('-l, --language <language>', 'target locale language')\n .option('-m, --model <model>', 'AI provider model to use')\n .option('-b, --base-url <url>', 'AI provider base URL')\n .option(\n '-r, --retry <count>',\n 'maximum retries when validation fails (default: 2)',\n (value) => {\n const parsed = Number.parseInt(value, 10)\n if (Number.isNaN(parsed) || parsed < 0) {\n throw new InvalidArgumentError(\n 'Retry count must be a non-negative integer.'\n )\n }\n return parsed\n }\n )\n .argument('<filename>', 'output filename')\n .addHelpText(\n 'after',\n `\nEnvironment variables:\n\n Required (one API key for the selected cloud provider):\n DEEPSEEK_API_KEY DeepSeek API key\n OPENAI_API_KEY OpenAI API key\n MOONSHOT_API_KEY Kimi (Moonshot AI) API key\n\n Optional:\n OLLAMA_HOST Ollama host for local models\n YAMLRESUME_AI_MODEL model override (overridden by --model)\n YAMLRESUME_AI_BASE_URL API base URL override (overridden by --base-url)\n`\n )\n .action(async function (\n this: Command,\n filename: string,\n options: {\n position: string\n language: string\n model?: string\n baseUrl?: string\n retry?: number\n }\n ) {\n let spinner: Ora | undefined\n let streamedText = ''\n\n const logger: Logger = {\n start: (message) => {\n spinner = ora(message).start()\n },\n success: (message) => {\n spinner?.succeed(message)\n consola.success(`Generated ${filename} successfully.`)\n },\n debug: consola.debug,\n info: consola.info,\n log: consola.log,\n warn: consola.warn,\n error: () => {},\n }\n\n try {\n await generateResumeFile(filename, options.position, options.language, {\n model: options.model,\n baseURL: options.baseUrl,\n maxRetries: options.retry,\n onChunk: (chunk) => {\n streamedText += chunk\n if (spinner) {\n spinner.text = `Generating resume...\\n${streamedText.slice(-200)}`\n }\n },\n logger,\n })\n } catch (error) {\n spinner?.fail('Failed to generate resume')\n\n const message = getErrorMessage(error)\n consola.error(message)\n\n if (consola.level >= 4 && error instanceof Error && error.stack) {\n consola.error(error.stack)\n }\n\n this.error(message, {\n exitCode: error instanceof YAMLResumeError ? error.errno : 1,\n })\n }\n })\n}\n","/**\n * MIT License\n *\n * Copyright (c) 2023–Present PPResume (https://ppresume.com)\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to\n * deal in the Software without restriction, including without limitation the\n * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or\n * sell copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS\n * IN THE SOFTWARE.\n */\n\nimport {\n getLocaleLanguageDetail,\n LOCALE_LANGUAGE_OPTIONS,\n} from '@yamlresume/core'\nimport { Command } from 'commander'\nimport consola from 'consola'\nimport { markdownTable } from 'markdown-table'\n\n/**\n * Generates a markdown table listing all supported locale languages.\n *\n * The table includes columns for the language code and the language name.\n *\n * @returns A string containing the formatted markdown table.\n */\nexport function listLanguages() {\n return markdownTable([\n ['locale.language', 'Language Name'],\n ...LOCALE_LANGUAGE_OPTIONS.map((value) => [\n value,\n getLocaleLanguageDetail(value).name,\n ]),\n ])\n}\n\n/**\n * Create a command instance to list supported languages\n */\n\nexport function createLanguagesCommand() {\n const cmd = new Command()\n .name('languages')\n .description('i18n and l10n support')\n\n cmd\n .command('list')\n .description('list all supported languages')\n .action(() => {\n consola.log(listLanguages())\n })\n\n return cmd\n}\n","/**\n * MIT License\n *\n * Copyright (c) 2023–Present PPResume (https://ppresume.com)\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to\n * deal in the Software without restriction, including without limitation the\n * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or\n * sell copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS\n * IN THE SOFTWARE.\n */\n\nimport { getErrorMessage, YAMLResumeError } from '@yamlresume/core'\nimport { newResumeFile } from '@yamlresume/node'\nimport { listSampleResumes } from '@yamlresume/samples'\nimport { Command } from 'commander'\nimport { consola } from 'consola'\n\nconst DEFAULT_SAMPLE_ID = 'software-engineer'\n\n/**\n * Create a command instance to create a new YAML resume\n */\nexport function createNewCommand() {\n return new Command()\n .name('new')\n .description('create a new resume')\n .argument('[filename]', 'output filename', 'resume.yml')\n .option('--sample <id>', 'create from a curated sample resume')\n .option('--language <language>', 'locale language for the sample', 'en')\n .action((filename, options) => {\n try {\n newResumeFile(\n filename,\n options.sample ?? DEFAULT_SAMPLE_ID,\n options.language,\n { showSampleSource: Boolean(options.sample), logger: consola }\n )\n } catch (error) {\n if (error instanceof YAMLResumeError) {\n consola.error(getErrorMessage(error))\n process.exit(error.errno)\n return\n }\n\n consola.error(getErrorMessage(error))\n consola.info(\n `Available samples:\\n${listSampleResumes()\n .map((sample) => ` - ${sample.id}: ${sample.title}`)\n .join('\\n')}`\n )\n process.exit(1)\n }\n })\n}\n","/**\n * MIT License\n *\n * Copyright (c) 2023–Present PPResume (https://ppresume.com)\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to\n * deal in the Software without restriction, including without limitation the\n * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or\n * sell copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS\n * IN THE SOFTWARE.\n */\n\nimport { listSampleResumes } from '@yamlresume/samples'\nimport { Command } from 'commander'\nimport consola from 'consola'\nimport { markdownTable } from 'markdown-table'\n\n/**\n * Generates a markdown table listing all available sample resumes.\n *\n * The table includes columns for the sample id, position, title, and category.\n *\n * @returns A string containing the formatted markdown table.\n */\nexport function listSamples() {\n const samples = listSampleResumes()\n\n return markdownTable([\n ['ID', 'Position', 'Title', 'Category'],\n ...samples.map((sample) => [\n sample.id,\n sample.position,\n sample.title,\n sample.category,\n ]),\n ])\n}\n\n/**\n * Create a command instance to list sample resumes.\n */\nexport function createSamplesListCommand() {\n return new Command()\n .name('list')\n .description('list all sample resumes')\n .action(() => {\n consola.log(listSamples())\n })\n}\n\nexport function createSamplesCommand() {\n return new Command()\n .name('samples')\n .description('manage sample resumes')\n .addCommand(createSamplesListCommand())\n}\n","/**\n * MIT License\n *\n * Copyright (c) 2023–Present PPResume (https://ppresume.com)\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to\n * deal in the Software without restriction, including without limitation the\n * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or\n * sell copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS\n * IN THE SOFTWARE.\n */\n\nimport {\n DOCX_TEMPLATE_OPTIONS,\n getDocxTemplateDetail,\n getHtmlTemplateDetail,\n getLatexTemplateDetail,\n HTML_TEMPLATE_OPTIONS,\n LATEX_TEMPLATE_OPTIONS,\n} from '@yamlresume/core'\nimport { Command } from 'commander'\nimport consola from 'consola'\nimport { markdownTable } from 'markdown-table'\n\n/**\n * Generates a markdown table listing all supported templates.\n *\n * The table includes columns for the template id, name and description.\n *\n * @returns A string containing the formatted markdown table.\n */\nexport function listTemplates() {\n const templates = [\n ...LATEX_TEMPLATE_OPTIONS.map((value) => {\n const details = getLatexTemplateDetail(value)\n return [value, details.engine, details.name, details.description]\n }),\n ...HTML_TEMPLATE_OPTIONS.map((value) => {\n const details = getHtmlTemplateDetail(value)\n return [value, details.engine, details.name, details.description]\n }),\n ...DOCX_TEMPLATE_OPTIONS.map((value) => {\n const details = getDocxTemplateDetail(value)\n return [value, details.engine, details.name, details.description]\n }),\n ]\n\n return markdownTable([\n ['layouts.[].template', 'Engine', 'Template Name', 'Description'],\n ...templates,\n ])\n}\n\n/**\n * Create a command instance to list supported templates\n */\nexport function createTemplatesCommand() {\n const cmd = new Command()\n .name('templates')\n .description('manage resume templates')\n\n cmd\n .command('list')\n .description('list all supported templates')\n .action(() => {\n consola.log(listTemplates())\n })\n\n return cmd\n}\n","/**\n * MIT License\n *\n * Copyright (c) 2023–Present PPResume (https://ppresume.com)\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to\n * deal in the Software without restriction, including without limitation the\n * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or\n * sell copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS\n * IN THE SOFTWARE.\n */\n\nimport fs from 'node:fs'\nimport { getErrorMessage, YAMLResumeError } from '@yamlresume/core'\nimport { readResumeFile } from '@yamlresume/node'\nimport { Command } from 'commander'\nimport { consola } from 'consola'\n\nimport {\n prettifySchemaValidationError,\n prettifyYamlParseError,\n} from '../utils/format'\n\n/**\n * Create a command instance to validate a YAML resume\n */\nexport function createValidateCommand() {\n return new Command()\n .name('validate')\n .description('validate a resume against the YAMLResume schema')\n .argument('<resume-path>', 'the resume file path')\n .action(async (resumePath: string) => {\n try {\n const { validated, errors } = readResumeFile(resumePath, {\n validate: true,\n })\n\n if (validated === 'success') {\n consola.success('Resume validation passed.')\n return\n }\n\n if (validated === 'failed' && errors) {\n const resumeStr = fs.readFileSync(resumePath, 'utf8')\n for (const error of errors) {\n consola.log(\n prettifySchemaValidationError(error, resumePath, resumeStr)\n )\n }\n consola.fail('Resume validation failed.')\n }\n } catch (error) {\n if (error instanceof YAMLResumeError) {\n if (error.code === 'INVALID_YAML') {\n const resumeStr = fs.readFileSync(resumePath, 'utf8')\n consola.log(\n prettifyYamlParseError(error.message, resumePath, resumeStr)\n )\n }\n consola.error(getErrorMessage(error))\n process.exit(error.errno)\n return\n }\n\n consola.error(getErrorMessage(error))\n process.exit(1)\n return\n }\n })\n}\n","/**\n * MIT License\n *\n * Copyright (c) 2023–Present PPResume (https://ppresume.com)\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to\n * deal in the Software without restriction, including without limitation the\n * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or\n * sell copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS\n * IN THE SOFTWARE.\n */\n\nimport { box } from 'consola/utils'\n\n/**\n * Announcement shown in the root help output.\n *\n * Update this constant when there is something new to announce and clear it\n * when the announcement becomes stale.\n */\nconst ANNOUNCEMENT = [\n 'New from v0.15: sample resumes!',\n 'Create one: yamlresume new --sample <sample-id>',\n 'Browse all: yamlresume samples list',\n].join('\\n')\n\n/**\n * Get the announcement banner for the current release.\n *\n * @returns The boxed announcement banner.\n */\nexport function showBanner(): string {\n return box(ANNOUNCEMENT)\n}\n","/**\n * MIT License\n *\n * Copyright (c) 2023–Present PPResume (https://ppresume.com)\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to\n * deal in the Software without restriction, including without limitation the\n * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or\n * sell copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS\n * IN THE SOFTWARE.\n */\n\nimport consola from 'consola'\n\n/**\n * Set the verbose mode for consola\n *\n * @param verbose - Whether to enable verbose mode\n * @see https://github.com/unjs/consola?tab=readme-ov-file#log-level\n */\nexport function setVerboseLog(verbose: boolean) {\n consola.level = verbose ? 4 : 3\n}\n","/**\n * MIT License\n *\n * Copyright (c) 2023–Present PPResume (https://ppresume.com)\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to\n * deal in the Software without restriction, including without limitation the\n * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or\n * sell copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS\n * IN THE SOFTWARE.\n */\n\nimport { Command } from 'commander'\n\nimport packageJson from '../package.json' with { type: 'json' }\nimport {\n createBuildCommand,\n createDevCommand,\n createDoctorCommand,\n createGenerateCommand,\n createLanguagesCommand,\n createNewCommand,\n createSamplesCommand,\n createTemplatesCommand,\n createValidateCommand,\n} from './commands'\nimport { setVerboseLog, showBanner } from './utils'\n\n/**\n * Create the CLI program.\n *\n * @returns The CLI program.\n */\nexport function createProgram(): Command {\n const program = new Command()\n\n const banner = `\n __ __ _ __ __ _ ____\n \\\\ \\\\ / // \\\\ | \\\\/ | | | _ \\\\ ___ ___ _ _ ___ ___ ___\n \\\\ V // _ \\\\ | |\\\\/| | | | |_) / _ \\\\/ __| | | / _ \\\\/ _ \\\\ / _ \\\\\n | |/ ___ \\\\| | | | |___| _ < __/\\\\__ \\\\ |_| | | | | | | __/\n |_/_/ \\\\_\\\\_| |_|_____|_| \\\\_\\\\___||___/\\\\____|_| |_| |_|\\\\___|\n`\n\n program\n .name('yamlresume')\n .description(['YAMLResume — Resume as Code in YAML', banner].join('\\n'))\n .version(packageJson.version)\n .option('-v, --verbose', 'verbose output')\n .addHelpText('before', showBanner())\n .hook('preAction', (thisCommand) => {\n setVerboseLog(thisCommand.opts().verbose)\n })\n\n program.addCommand(createBuildCommand())\n program.addCommand(createGenerateCommand())\n program.addCommand(createDevCommand())\n program.addCommand(createDoctorCommand())\n program.addCommand(createLanguagesCommand())\n program.addCommand(createNewCommand())\n program.addCommand(createSamplesCommand())\n program.addCommand(createTemplatesCommand())\n program.addCommand(createValidateCommand())\n\n return program\n}\n"]}
@@ -1,2 +0,0 @@
1
- export{j as createProgram}from'./chunk-HWR7YN6O.js';//# sourceMappingURL=program-G4CL3FZC.js.map
2
- //# sourceMappingURL=program-G4CL3FZC.js.map