@hmpact/core 0.0.1-beta.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (54) hide show
  1. package/build-info.json +8 -0
  2. package/dist/config.d.ts +3 -0
  3. package/dist/config.d.ts.map +1 -0
  4. package/dist/features/init.d.ts +5 -0
  5. package/dist/features/init.d.ts.map +1 -0
  6. package/dist/features/registry.d.ts +7 -0
  7. package/dist/features/registry.d.ts.map +1 -0
  8. package/dist/index.d.ts +2 -0
  9. package/dist/index.d.ts.map +1 -0
  10. package/dist/index.mjs +18 -0
  11. package/dist/index.mjs.map +7 -0
  12. package/dist/parse.d.ts +1 -0
  13. package/dist/parse.d.ts.map +1 -0
  14. package/dist/runner.d.ts +2 -0
  15. package/dist/runner.d.ts.map +1 -0
  16. package/dist/schema/lang.d.ts +25 -0
  17. package/dist/schema/lang.d.ts.map +1 -0
  18. package/dist/schema/manifest.d.ts +61 -0
  19. package/dist/schema/manifest.d.ts.map +1 -0
  20. package/dist/schema/regs.d.ts +54 -0
  21. package/dist/schema/regs.d.ts.map +1 -0
  22. package/dist/schema/user-config.d.ts +35 -0
  23. package/dist/schema/user-config.d.ts.map +1 -0
  24. package/dist/types/build-info.d.ts +9 -0
  25. package/dist/types/build-info.d.ts.map +1 -0
  26. package/dist/types/self.d.ts +8 -0
  27. package/dist/types/self.d.ts.map +1 -0
  28. package/dist/utils/format.d.ts +16 -0
  29. package/dist/utils/format.d.ts.map +1 -0
  30. package/dist/utils/helper.d.ts +73 -0
  31. package/dist/utils/helper.d.ts.map +1 -0
  32. package/dist/utils/helpers/build-info.d.ts +6 -0
  33. package/dist/utils/helpers/build-info.d.ts.map +1 -0
  34. package/dist/utils/helpers/cache.d.ts +23 -0
  35. package/dist/utils/helpers/cache.d.ts.map +1 -0
  36. package/dist/utils/helpers/dir.d.ts +11 -0
  37. package/dist/utils/helpers/dir.d.ts.map +1 -0
  38. package/dist/utils/helpers/fetcher.d.ts +3 -0
  39. package/dist/utils/helpers/fetcher.d.ts.map +1 -0
  40. package/dist/utils/helpers/jsonc.d.ts +17 -0
  41. package/dist/utils/helpers/jsonc.d.ts.map +1 -0
  42. package/dist/utils/helpers/lang.d.ts +7 -0
  43. package/dist/utils/helpers/lang.d.ts.map +1 -0
  44. package/dist/utils/helpers/manifest.d.ts +32 -0
  45. package/dist/utils/helpers/manifest.d.ts.map +1 -0
  46. package/dist/utils/helpers/registry.d.ts +7 -0
  47. package/dist/utils/helpers/registry.d.ts.map +1 -0
  48. package/dist/utils/helpers/schema.d.ts +6 -0
  49. package/dist/utils/helpers/schema.d.ts.map +1 -0
  50. package/dist/utils/helpers/self.d.ts +7 -0
  51. package/dist/utils/helpers/self.d.ts.map +1 -0
  52. package/dist/utils/helpers/user-config.d.ts +10 -0
  53. package/dist/utils/helpers/user-config.d.ts.map +1 -0
  54. package/package.json +67 -0
@@ -0,0 +1,8 @@
1
+ {
2
+ "name": "@hmpact/core",
3
+ "version": "0.0.1-beta.1",
4
+ "buildId": "MK7XMVVI",
5
+ "commit": "",
6
+ "branch": "",
7
+ "timestamp": "2026-01-10T06:36:55.134Z"
8
+ }
@@ -0,0 +1,3 @@
1
+ import type { hmpactrcType } from "@/types/self";
2
+ export declare const hmpactrc: hmpactrcType;
3
+ //# sourceMappingURL=config.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"config.d.ts","sourceRoot":"","sources":["../src/config.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,cAAc,CAAC;AAMjD,eAAO,MAAM,QAAQ,EAAE,YAMtB,CAAC"}
@@ -0,0 +1,5 @@
1
+ /**
2
+ * summary: プロジェクトの初期化を行う
3
+ * description: このモジュールは、新しいプロジェクトの初期化を担当します。ユーザーに対してプロジェクト名やテンプレートの選択を促し、必要なファイルとディレクトリを作成します。
4
+ */
5
+ //# sourceMappingURL=init.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"init.d.ts","sourceRoot":"","sources":["../../src/features/init.ts"],"names":[],"mappings":"AACA;;;GAGG"}
@@ -0,0 +1,7 @@
1
+ import { Command } from "commander";
2
+ /**
3
+ * summary: パッケージレジストリの管理コマンドを提供する
4
+ * description: このモジュールは、パッケージレジストリの追加、削除、インポートを行うためのCLIコマンドを定義します。ユーザーはドメイン、ID、URLフォーマットルール、HTTPヘッダーを指定してレジストリを管理できます。
5
+ */
6
+ export declare function createRegistryCommand(): Command;
7
+ //# sourceMappingURL=registry.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"registry.d.ts","sourceRoot":"","sources":["../../src/features/registry.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAIpC;;;GAGG;AAGH,wBAAgB,qBAAqB,IAAI,OAAO,CAkD/C"}
@@ -0,0 +1,2 @@
1
+ export * from "./runner";
2
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AACA,cAAc,UAAU,CAAC"}
package/dist/index.mjs ADDED
@@ -0,0 +1,18 @@
1
+ import $r from"chalk";import{program as w}from"commander";import vr from"figlet";import xr from"gradient-string";import{existsSync as $e}from"fs";import{readFile as ve}from"fs/promises";import{join as xe}from"path";import ye from"fs";import{homedir as B}from"os";import z from"path";import{fileURLToPath as _e}from"url";var H=_e(import.meta.url),G=z.dirname(H),we=()=>{try{return process.cwd()}catch{throw new Error("Error getting current working directory.")}},Fe=async()=>{try{let e=z.resolve(G),r=10;for(;r-- >0;){if(ye.existsSync(z.join(e,"package.json")))return e;let t=z.dirname(e);if(t===e)return;e=t}}catch{throw new Error("Error getting self root directory.")}},Se=B()+"/.hmpact",Ee={filename:H,dirname:G,cwd:we,selfroot:Fe,userRoot:B,userhmpactRoot:Se},p=Ee;var Ce=async()=>{try{let e=await p.selfroot();if(!e)throw new Error("candidate not found");let r=xe(e,"build-info.json");if($e(r)){let t=await ve(r,"utf8");return JSON.parse(t)}else throw new Error(`build-info.json not found at ${r}`)}catch(e){throw e instanceof Error?e:new Error(String(e))}},Re={load:Ce},U=Re;import _ from"@hmpact/logger";import P from"cacache";var b="/tmp/.cache/hmpact",Te=async()=>{try{return await P.ls(b)}catch(e){_.error("Error listing cache:",e)}},ke=async()=>{try{await P.rm.all(b)}catch(e){_.error("Error clearing cache:",e)}},A=async(e,r)=>{try{await P.put(b,e,r)}catch(t){throw _.error("Error writing cache:",t),t}},ze=async(e,r)=>{try{let t=JSON.stringify(r);return await A(e,t),{success:!0}}catch(t){return _.error("Error writing JSON to cache:",t),{success:!1,error:t}}},Z=async e=>{try{return(await P.get(b,e)).data}catch{return}},Pe=async(e,r)=>{let t=await Z(e);if(t)try{let o=JSON.parse(t.toString("utf8"));if(r?.schema){let n=r.schema;if(typeof n=="function"){if(!n(o)){_.error(`Validation failed for cache key: ${e}. Data does not match expected type.`);return}}else if("parse"in n&&typeof n.parse=="function")try{return n.parse(o)}catch(a){_.error(`Validation failed for cache key: ${e}. Error:`,a);return}}return o}catch(o){_.error("Error parsing cached JSON:",o);return}},be={ls:Te,clear:ke,put:A,putJson:ze,get:Z,getJson:Pe},R=be;import Je from"isomorphic-unfetch";var De=e=>Je(e,{headers:{}}).then(r=>r.json()),je=De,q=je;import Me from"@hmpact/logger";import{readFile as Le}from"fs/promises";import{parse as Ne,printParseErrorCode as Ie}from"jsonc-parser";var Oe=async(e,r)=>{try{let t=await Le(e,"utf-8"),o=[],n=Ne(t,o);if(o.length>0)return o.forEach(a=>{Me.error(`\u30A8\u30E9\u30FC: ${Ie(a.error)} at ${a.offset}`)}),{status:"error",message:`Failed to parse JSONC file at ${e}.`};if(r?.schema){let a=r.schema;if(typeof a=="function"){if(!a(n))return{status:"validation_failed",message:`Validation failed for ${e}. Data does not match expected type.`}}else if("parse"in a&&typeof a.parse=="function")try{return{status:"success",data:a.parse(n)}}catch(m){return{status:"validation_failed",message:`Validation failed for ${e}. Error.`,error:m}}}return{status:"success",data:n}}catch(t){return{status:"not_found",error:t}}},Ve={getJsoncByPath:Oe},F=Ve;import rr from"@hmpact/logger";import tr from"isomorphic-unfetch";import or from"ora";import S from"zod";var Y=S.record(S.string(),S.string()),Be=S.object({version:S.string(),lang:S.string(),mapping:Y}),L={zod:Be,includes:{__schemaLangMapping:Y}};import qe from"deepmerge";import{existsSync as Ye}from"fs";import{writeFile as ee}from"fs/promises";import{extname as X}from"path";import{z as s}from"zod";var He=s.record(s.string(),s.url()),Ge=s.object({packs:He.optional()}),K=s.object({format:s.string(),header:s.record(s.string(),s.string()).optional()}),W=s.record(s.string(),s.object({rule:K})),Q=s.record(s.string(),s.record(s.string(),s.string())),Ue=s.object({lang:Ge.optional(),registries:W.optional(),dependencies:Q.optional()}),T={zod:Ue,includes:{__schemaRegistriesSchema:W,__schemaDependenciesSchema:Q,__schemaRegistryRule:K}};var Ae=async(e,r)=>{try{return r.safeParse(e)}catch(t){throw new Error(`Error loading JSONC file: ${t}`)}},Ze={safeCheck:Ae},E=Ze;import{applyEdits as re,modify as te}from"jsonc-parser";var Ke=async()=>{try{let e=p.cwd();for(let r=0;r<d.manifestFile.name.length;r++){let t=d.manifestFile.name[r],o=`${e}/${t}`;if(Ye(o))return{has:!0,file:{path:o,fullname:t,name:t.replace(X(t),""),ext:X(o).toLowerCase()}}}return{has:!1}}catch{throw new Error("Error checking for config file.")}},N=async e=>{let r=e;if(!r){let o=await oe.hasFile();o.has&&o.file&&(r=o.file)}let t;if(r)try{let{path:o,ext:n,name:a}=r;if(a==="hmpact.json")throw new Error("hmpact.json format not supported yet.");n===".jsonc"&&(t=(await F.getJsoncByPath(o,{schema:T.zod})).data)}catch(o){throw new Error(`Error loading config file: ${o}`)}try{let o=qe({},t||{}),n=await E.safeCheck(o,T.zod);if(!n.success)throw new Error(`Config file validation error: ${n.error.message}`);return{has:!0,file:r,content:n.data}}catch(o){throw new Error(`Error processing config file: ${o}`)}},We=async(e,r)=>{let t=await N();if(!t.has)throw new Error("No manifest file to edit.");try{let o=JSON.stringify(t.content,null,2),n=te(o,e,r,{formattingOptions:{tabSize:2,insertSpaces:!0}}),a=re(o,n);if(!t.file)throw new Error("No manifest file information available.");await ee(t.file.path,a)}catch(o){throw new Error(`Error modifying manifest content: ${o}`)}},Qe=async()=>{let e=await N();if(!e.has)throw new Error("No manifest file to edit.");return e},Xe=async(e,r,t)=>{try{let o=JSON.stringify(e),n=te(o,r,t,{formattingOptions:{tabSize:2,insertSpaces:!0}});return re(o,n)}catch(o){throw new Error(`Error modifying manifest content: ${o}`)}},er=async(e,r)=>{try{if(!e)throw new Error("No manifest file information available.");await ee(e.path,JSON.stringify(r,null,2))}catch(t){throw new Error(`Error saving manifest content: ${t}`)}},oe={hasFile:Ke,loadFile:N,edit:We,draftCreate:Qe,draftEdit:Xe,draftSave:er},J=oe;var nr=async()=>{let e=await J.loadFile();if(!e.has)throw rr.error("No manifest file found."),new Error;await ne(e.content)},ne=async e=>{let r=or("Downloading language packs...").start();try{let t=[];r.text="Starting downloads...",await Promise.allSettled(Object.entries(e.lang?.packs||{}).map(async([n,a])=>{try{let m=await R.getJson(`${d.version}-pack-${n}`,{schema:L.zod});if(m){t.push({lang:n,version:m.version});return}}catch{}r.text=`Downloading language pack: ${n} from ${a}`;try{let y=await(await tr(a)).json(),l={version:y.version,lang:y.lang};if(!l.version||!l.lang){r.fail(`Invalid language pack format from: ${a}`);return}d.version!==l.version&&r.warn(`You are running hmpact v${d.version}, but you have specified a language pack for v${l.version}.`);let h=await E.safeCheck(y,L.zod);if(!h.success)throw r.fail(`Language pack validation error from: ${a}
2
+ ${h.error.message}`),new Error;if(!h.data)throw r.fail(`Failed to download language pack from: ${a}`),new Error;let $=await R.putJson(`${h.data.version}-pack-${h.data.lang}`,h.data);if(!$.success)throw r.fail(`Failed to cache language pack from: ${a}
3
+ ${$.error?.message}`),new Error;t.push({lang:l.lang,version:l.version})}catch{throw r.fail(`Failed to download language pack from: ${a}`),new Error}}));let o=t.map(n=>`${n.lang} (v${n.version})`).join(", ");r.succeed(`Downloaded language packs: ${t.length>0?o:"None"}
4
+ `);return}catch{throw new Error}},ar={init:nr,downloads:ne},ae=ar;import c from"@hmpact/logger";import g from"zod";var ie=g.object({format:g.string(),header:g.record(g.string(),g.string()).optional()}),se=g.object({id:g.string(),rule:ie}),ir=g.object({registries:g.array(se)}),ce={zod:ir,includes:{__schemaRegsRegistry:se,__schemaRegsRegistryRule:ie}};var sr=async(e,r,t)=>{let o=t||`//${e}/@{org}/{pkg}/-/{pkg}-{ver}.tgz`;await i.manifest.edit(["registries",r||e,"rule","format"],o||"").catch(n=>{throw new Error(`Failed to add registry: ${n instanceof Error?n.message:String(n)}`)})},cr=async e=>{await i.manifest.edit(["registries",e]).catch(r=>{throw new Error(`Failed to remove registry: ${r instanceof Error?r.message:String(r)}`)})},fr=async e=>{try{c.info(`Fetching registries from: ${e}`);let r=await i.fetcher(e),t=ce.zod.safeParse(r);if(!t.success)throw new Error(`Config file validation error: ${t.error.message}`);let o=t.data.registries,n=o.length;if(n===0){c.info("No registries found to import.");return}c.info(`Found ${n} registries to import.`);let a=o.map(f=>f.id),m=a.filter((f,v)=>a.indexOf(f)!==v);if(m.length>0)throw new Error(`Duplicate registry IDs found in import data: ${[...new Set(m)].join(", ")}`);let y=await i.manifest.draftCreate(),l=y.content,h=l.registries||{},$=a.filter(f=>f in h);$.length>0&&c.warn(`Warning: The following registries will be overwritten: ${$.join(", ")}`);let D=0,j=0,V=[];for(let f=0;f<n;f++){let v=o[f],{id:x,rule:ue}=v;try{c.info(`[${f+1}/${n}] Importing registry: ${x}...`);let C=await i.manifest.draftEdit(l,["registries",x],{rule:ue}),k=JSON.parse(C),M=T.zod.safeParse(k);if(!M.success)throw new Error(`Draft validation failed: ${M.error.message}`);l=M.data,D++,c.info(`[${f+1}/${n}] \u2713 ${x} imported successfully`)}catch(C){j++;let k=C instanceof Error?C.message:String(C);V.push({id:x,error:k}),c.error(`[${f+1}/${n}] \u2717 Failed to import ${x}: ${k}`)}}if(c.info(`
5
+ === Import Summary ===`),c.info(`Total: ${n}`),c.info(`Success: ${D}`),c.info(`Failed: ${j}`),j>0)if(c.info(`
6
+ Failed registries:`),V.forEach(({id:f,error:v})=>{c.info(` - ${f}: ${v}`)}),D>0)c.info(`
7
+ Saving successfully imported registries...`),await i.manifest.draftSave(y.file,l),c.info("Partial import completed.");else throw new Error("All registry imports failed.");else await i.manifest.draftSave(y.file,l),c.info(`
8
+ \u2713 All registries imported successfully!`)}catch(r){throw new Error(`Failed to import registries: ${r instanceof Error?r.message:String(r)}`)}},lr={add:sr,remove:cr,import:fr},fe=lr;import{existsSync as mr}from"fs";import{readFile as pr}from"fs/promises";import{join as dr}from"path";var gr=async()=>{let e=await p.selfroot();if(!e)throw new Error("package.json not found: candidate directory not found");let r=dr(e,"package.json");if(!mr(r))throw new Error(`package.json not found at ${r}`);let t=await pr(r,"utf8");return JSON.parse(t)},hr={pkg:{load:gr}},le=hr;import I from"@hmpact/logger";import u from"zod";var ur=u.record(u.string(),u.string()),me=u.object({default:u.string(),packs:u.record(u.string(),ur)}),yr=u.object({lang:me}),pe={zod:yr,includes:{__schemaLanguage:me}};var _r=p.userhmpactRoot+"/config.jsonc",wr=async()=>{let e=await F.getJsoncByPath(_r,{schema:pe.zod}).then(r=>(I.debug("User config loaded:",r),r));return e.status!=="success"?(e.status==="not_found"?I.warn("User config file not found. Using default configuration."):e.status==="validation_failed"&&I.error("User config validation failed:",e.message),null):e},Fr={get:wr},de=Fr;var Sr={schema:E,jsonc:F,fetcher:q,dir:p,lang:ae,userConfig:de,cache:R,self:le,buildInfo:U,manifest:J,registry:fe},i=Sr;var ge=await i.self.pkg.load(),d={name:ge.name,version:ge.version||"0.0.0",manifestFile:{name:["hmpact.jsonc"]}};import O from"@hmpact/logger";import{Command as Er}from"commander";function he(){let e=new Er("registry").alias("reg").description("Generate package registry URL based on predefined rules");return e.command("add").requiredOption("--domain <domain>","Domain of the registry").option("--id <id>","ID of the registry").option("--format <format>","URL format rule (use {pkg}, {ver}, {:env.KEY})").option("--header <header>","HTTP header for the registry request (use key:value format)").description("Add a new registry entry").action(async r=>{let{domain:t,id:o,format:n}=r;await i.registry.add(t,o,n).catch(a=>{O.error(`Error adding registry: ${a instanceof Error?a.message:String(a)}`)})}),e.command("remove <id>").description("Remove a registry entry").action(async r=>{await i.registry.remove(r).catch(t=>{O.error(`Error removing registry: ${t instanceof Error?t.message:String(t)}`)})}),e.command("import <url>").description("Import registry entries from a remote JSONC file").action(async r=>{await i.registry.import(r).catch(t=>{O.error(`Error importing registries: ${t instanceof Error?t.message:String(t)}`)})}),e}console.log(`
9
+ `+xr(["#26b02b","#53ed59"]).multiline(vr.textSync("> hmpact",{font:"ANSI Shadow",horizontalLayout:"default",verticalLayout:"default"})));console.log($r.gray(`v${d.version}
10
+ `));await i.lang.init();await i.userConfig.get();w.name("hmpact").description("").version(d.version);w.configureHelp({showGlobalOptions:!0}).option("-d, --debug","enable debug mode").option("--lang <language>","select language pack");w.command("build-info").description("Display build information").action(async()=>{let e=await i.buildInfo.load();if(!e){console.log("No build info available.");return}console.log(`> Build info data
11
+ Name: ${e.name}
12
+ Version: ${e.version}
13
+ Build ID: ${e.buildId}
14
+ Commit: ${e.commit}
15
+ Branch: ${e.branch}
16
+ Timestamp: ${e.timestamp}
17
+ `)});w.command("test").description("Display the resolved configuration data").action(async()=>{let e=await i.manifest.loadFile();console.log("Config file data:",e)});w.addCommand(he());process.argv.slice(2).length||(w.outputHelp(),process.exit(0));await w.parseAsync(process.argv);
18
+ //# sourceMappingURL=index.mjs.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../src/runner.ts", "../src/utils/helpers/build-info.ts", "../src/utils/helpers/dir.ts", "../src/utils/helpers/cache.ts", "../src/utils/helpers/fetcher.ts", "../src/utils/helpers/jsonc.ts", "../src/utils/helpers/lang.ts", "../src/schema/lang.ts", "../src/utils/helpers/manifest.ts", "../src/schema/manifest.ts", "../src/utils/helpers/schema.ts", "../src/utils/helpers/registry.ts", "../src/schema/regs.ts", "../src/utils/helpers/self.ts", "../src/utils/helpers/user-config.ts", "../src/schema/user-config.ts", "../src/utils/helper.ts", "../src/config.ts", "../src/features/registry.ts"],
4
+ "sourcesContent": ["import chalk from \"chalk\";\nimport { program } from \"commander\";\nimport figlet from \"figlet\";\nimport gradient from \"gradient-string\";\n\nimport { hmpactrc } from \"~/src/config\";\nimport { createRegistryCommand } from \"@/features/registry\";\nimport helper from \"@/utils/helper\";\n\n// \u30D0\u30CA\u30FC\u8868\u793A\nconsole.log(\n \"\\n\" +\n gradient([\"#26b02b\", \"#53ed59\"]).multiline(\n figlet.textSync(\"> hmpact\", {\n font: \"ANSI Shadow\",\n horizontalLayout: \"default\",\n verticalLayout: \"default\",\n }),\n ),\n);\nconsole.log(chalk.gray(`v${hmpactrc.version}\\n`));\n\n// \u8A00\u8A9E\u30D1\u30C3\u30AF\u306E\u521D\u671F\u5316\nawait helper.lang.init();\nawait helper.userConfig.get();\n\n// \u30B3\u30DE\u30F3\u30C9\u30E9\u30A4\u30F3\u30A4\u30F3\u30BF\u30FC\u30D5\u30A7\u30FC\u30B9\u306E\u8A2D\u5B9A\nprogram.name(\"hmpact\").description(\"\").version(hmpactrc.version);\n\n// \u30B0\u30ED\u30FC\u30D0\u30EB\u30AA\u30D7\u30B7\u30E7\u30F3\u306E\u8A2D\u5B9A\nprogram\n .configureHelp({ showGlobalOptions: true })\n .option(\"-d, --debug\", \"enable debug mode\")\n .option(\"--lang <language>\", \"select language pack\");\n\n// build-info \u30B3\u30DE\u30F3\u30C9\u306E\u5B9A\u7FA9\nprogram\n .command(\"build-info\")\n .description(\"Display build information\")\n .action(async () => {\n const data = await helper.buildInfo.load();\n if (!data) {\n console.log(\"No build info available.\");\n return;\n }\n console.log(`> Build info data\nName: ${data.name}\nVersion: ${data.version}\nBuild ID: ${data.buildId}\nCommit: ${data.commit}\nBranch: ${data.branch}\nTimestamp: ${data.timestamp}\\n`);\n });\n\n// test \u30B3\u30DE\u30F3\u30C9\u306E\u5B9A\u7FA9\nprogram\n .command(\"test\")\n .description(\"Display the resolved configuration data\")\n .action(async () => {\n const configData = await helper.manifest.loadFile();\n console.log(\"Config file data:\", configData);\n });\n\nprogram.addCommand(createRegistryCommand());\n\n// \u5F15\u6570\u304C\u306A\u3044\u5834\u5408\u306F\u30D8\u30EB\u30D7\u3092\u8868\u793A\nif (!process.argv.slice(2).length) {\n program.outputHelp();\n process.exit(0);\n}\n\nawait program.parseAsync(process.argv);\n", "import { existsSync } from \"fs\";\nimport { readFile } from \"fs/promises\";\nimport { join } from \"path\";\n\nimport { BuildInfo } from \"@/types/build-info\";\nimport _helperDirFunction from \"@/utils/helpers/dir\";\n\nconst __helperBuildInfoFuncLoad = async (): Promise<BuildInfo> => {\n try {\n // `package.json`\u304C\u5B58\u5728\u3059\u308B\u30C7\u30A3\u30EC\u30AF\u30C8\u30EA\u3092\u53D6\u5F97\n const candidate = await _helperDirFunction.selfroot();\n if (!candidate) {\n // \u898B\u3064\u304B\u3089\u306A\u304B\u3063\u305F\u5834\u5408\u306F\u30A8\u30E9\u30FC\u3092\u30B9\u30ED\u30FC\n throw new Error(\"candidate not found\");\n }\n // `package.json`\u306E\u5B58\u5728\u3092\u78BA\u8A8D\u3057\u3066\u8AAD\u307F\u8FBC\u3080\n const buildInfoPath = join(candidate, \"build-info.json\");\n if (existsSync(buildInfoPath)) {\n // \u30D5\u30A1\u30A4\u30EB\u3092\u8AAD\u307F\u8FBC\u3093\u3067JSON\u3092\u8FD4\u3059\n const raw = await readFile(buildInfoPath, \"utf8\");\n return JSON.parse(raw);\n } else {\n throw new Error(`build-info.json not found at ${buildInfoPath}`);\n }\n } catch (e) {\n // \u65E2\u5B58\u306E\u30A8\u30E9\u30FC\u30E1\u30C3\u30BB\u30FC\u30B8\u3092\u4FDD\u6301\u3057\u3066\u518D\u30B9\u30ED\u30FC\n throw e instanceof Error ? e : new Error(String(e));\n }\n};\n\nconst _helperBuildInfoFunction = {\n load: __helperBuildInfoFuncLoad,\n};\nexport default _helperBuildInfoFunction;\n", "import fs from \"fs\";\nimport { homedir } from \"os\";\nimport path from \"path\";\nimport { fileURLToPath } from \"url\";\n\n// \u30B9\u30AF\u30EA\u30D7\u30C8\u306E\u30C7\u30A3\u30EC\u30AF\u30C8\u30EA\u3092\u53D6\u5F97\nconst __filename = fileURLToPath(import.meta.url);\n// \u30B9\u30AF\u30EA\u30D7\u30C8\u306E\u30C7\u30A3\u30EC\u30AF\u30C8\u30EA\u540D\u3092\u53D6\u5F97\nconst __dirname = path.dirname(__filename);\n\n/**\n * \u30AB\u30EC\u30F3\u30C8\u30C7\u30A3\u30EC\u30AF\u30C8\u30EA\u3092\u53D6\u5F97\u3059\u308B\n */\nconst __helperDirFuncCwd = (): string => {\n try {\n // \u5B9F\u884C\u3055\u308C\u305F\u30D1\u30B9\u3092\u53D6\u5F97\n const cwd = process.cwd();\n return cwd;\n } catch {\n // \u30A8\u30E9\u30FC\u6642\u306F\u4F8B\u5916\u3092\u30B9\u30ED\u30FC\n throw new Error(\"Error getting current working directory.\");\n }\n};\n\n/**\n * \u3053\u306E\u30B9\u30AF\u30EA\u30D7\u30C8\u306E\u30C7\u30A3\u30EC\u30AF\u30C8\u30EA\u3092\u8D77\u70B9\u306B\u4E0A\u4F4D\u30C7\u30A3\u30EC\u30AF\u30C8\u30EA\u3092\u8FBF\u308A\u3001`package.json`\u304C\u5B58\u5728\u3059\u308B\u30C7\u30A3\u30EC\u30AF\u30C8\u30EA\u3092\u63A2\u3059\n */\nconst __helperDirFuncSelfroot = async () => {\n try {\n // \u4E0A\u4F4D\u30C7\u30A3\u30EC\u30AF\u30C8\u30EA\u3092\u8FBF\u308A\u306A\u304C\u3089`package.json`\u3092\u63A2\u3059\n let dir = path.resolve(__dirname);\n // \u7121\u9650\u30EB\u30FC\u30D7\u9632\u6B62\u306E\u305F\u3081\u306E\u6700\u5927\u6DF1\u5EA6\n let maxDepth = 10;\n while (maxDepth-- > 0) {\n // `package.json`\u304C\u5B58\u5728\u3059\u308B\u304B\u78BA\u8A8D\n if (fs.existsSync(path.join(dir, \"package.json\"))) {\n return dir;\n }\n // \u30EB\u30FC\u30C8\u306B\u5230\u9054\u3057\u305F\u3089\u7D42\u4E86\n const parent = path.dirname(dir);\n if (parent === dir) {\n // \u30EB\u30FC\u30C8\u306B\u5230\u9054\u3057\u3066\u898B\u3064\u304B\u3089\u306A\u304B\u3063\u305F\n return undefined;\n }\n // \u4E0A\u4F4D\u30C7\u30A3\u30EC\u30AF\u30C8\u30EA\u3078\u79FB\u52D5\n dir = parent;\n }\n } catch {\n // \u30A8\u30E9\u30FC\u6642\u306F\u4F8B\u5916\u3092\u30B9\u30ED\u30FC\n throw new Error(\"Error getting self root directory.\");\n }\n};\n\nconst __helperDirFuncUserhmpactRoot = homedir() + \"/.hmpact\";\n\nconst _helperDirFunction = {\n filename: __filename,\n dirname: __dirname,\n cwd: __helperDirFuncCwd,\n selfroot: __helperDirFuncSelfroot,\n userRoot: homedir,\n userhmpactRoot: __helperDirFuncUserhmpactRoot,\n};\n\nexport default _helperDirFunction;\n", "import logger from \"@hmpact/logger\";\nimport cacache from \"cacache\";\nimport { type ZodSchema } from \"zod\";\n\nconst cachePath = `/tmp/.cache/hmpact`;\n\ntype ValidatorFunction<T> = (data: unknown) => data is T;\n\ntype ValidationSchema<T> = ZodSchema<T> | ValidatorFunction<T>;\n\nexport interface CacheGetJsonOptions<T> {\n schema?: ValidationSchema<T>;\n}\n\nconst __helperCacheLsFunc = async () => {\n try {\n const result = await cacache.ls(cachePath);\n return result;\n } catch (error) {\n logger.error(\"Error listing cache:\", error);\n }\n};\n\nconst __helperCacheClearFunc = async () => {\n try {\n await cacache.rm.all(cachePath);\n } catch (error) {\n logger.error(\"Error clearing cache:\", error);\n }\n};\n\nconst __helperCachePutFunc = async (key: string, data: string | Buffer) => {\n try {\n await cacache.put(cachePath, key, data);\n } catch (error) {\n logger.error(\"Error writing cache:\", error);\n throw error;\n }\n};\n\nconst __helperCachePutJsonFunc = async (key: string, value: unknown) => {\n try {\n const payload = JSON.stringify(value);\n await __helperCachePutFunc(key, payload);\n return {\n success: true,\n };\n } catch (error) {\n logger.error(\"Error writing JSON to cache:\", error);\n return {\n success: false,\n error: error as Error,\n };\n }\n};\n\nconst __helperCacheGetFunc = async (key: string) => {\n try {\n const entry = await cacache.get(cachePath, key);\n return entry.data; // Buffer\n } catch (error) {\n // \u30AD\u30E3\u30C3\u30B7\u30E5\u304C\u5B58\u5728\u3057\u306A\u3044\u5834\u5408\u306Fundefined\u3092\u8FD4\u3059\n return undefined;\n }\n};\n\nconst __helperCacheGetJsonFunc = async <T = unknown>(\n key: string,\n options?: CacheGetJsonOptions<T>,\n): Promise<T | undefined> => {\n const buf = await __helperCacheGetFunc(key);\n if (!buf) {\n return undefined;\n }\n try {\n const parsed = JSON.parse(buf.toString(\"utf8\"));\n\n // \u30B9\u30AD\u30FC\u30DE\u304C\u6307\u5B9A\u3055\u308C\u3066\u3044\u308B\u5834\u5408\u306F\u691C\u8A3C\u3092\u5B9F\u884C\n if (options?.schema) {\n const schema = options.schema;\n\n // Zod \u30B9\u30AD\u30FC\u30DE\uFF08parse\u30E1\u30BD\u30C3\u30C9\u3092\u6301\u3064\uFF09\u304B\u30AB\u30B9\u30BF\u30E0\u691C\u8A3C\u95A2\u6570\u304B\u3092\u5224\u5B9A\n if (typeof schema === \"function\") {\n // \u30AB\u30B9\u30BF\u30E0\u578B\u30AC\u30FC\u30C9\u95A2\u6570\n if (!schema(parsed)) {\n logger.error(\n `Validation failed for cache key: ${key}. Data does not match expected type.`,\n );\n return undefined;\n }\n } else if (\"parse\" in schema && typeof schema.parse === \"function\") {\n // Zod \u30B9\u30AD\u30FC\u30DE\n try {\n return schema.parse(parsed) as T;\n } catch (validationError) {\n logger.error(\n `Validation failed for cache key: ${key}. Error:`,\n validationError,\n );\n return undefined;\n }\n }\n }\n\n return parsed as T;\n } catch (error) {\n logger.error(\"Error parsing cached JSON:\", error);\n return undefined;\n }\n};\n\nconst _helperCacheFunction = {\n ls: __helperCacheLsFunc,\n clear: __helperCacheClearFunc,\n put: __helperCachePutFunc,\n putJson: __helperCachePutJsonFunc,\n get: __helperCacheGetFunc,\n getJson: __helperCacheGetJsonFunc,\n};\n\nexport default _helperCacheFunction;\n", "import fetch from \"isomorphic-unfetch\";\n\nconst __helperFetcherFunc = (url: string) =>\n fetch(url, {\n headers: {},\n }).then((r) => r.json());\n\nconst _helperFetcherFunction = __helperFetcherFunc;\n\nexport default _helperFetcherFunction;\n", "import logger from \"@hmpact/logger\";\nimport { readFile } from \"fs/promises\";\nimport { parse, ParseError, printParseErrorCode } from \"jsonc-parser\";\nimport { ZodSchema } from \"zod\";\n\ntype ValidatorFunction<T> = (data: unknown) => data is T;\n\ntype ValidationSchema<T> = ZodSchema<T> | ValidatorFunction<T>;\n\nexport interface GetJsoncOptions<T> {\n schema?: ValidationSchema<T>;\n}\n\nexport interface __helperGetJsoncByPathFuncResponse<T = unknown> {\n status: \"success\" | \"not_found\" | \"error\" | \"validation_failed\";\n message?: string;\n data?: T;\n error?: unknown;\n}\n\nconst __helperGetJsoncByPathFunc = async <T = unknown>(\n path: string,\n options?: GetJsoncOptions<T>,\n): Promise<__helperGetJsoncByPathFuncResponse<T>> => {\n try {\n // \u30D5\u30A1\u30A4\u30EB\u3092\u8AAD\u307F\u8FBC\u307F\u3001JSON\u3068\u3057\u3066\u30D1\u30FC\u30B9\u3057\u3066\u8FD4\u3059\n const row = await readFile(path, \"utf-8\");\n const errors: ParseError[] = [];\n const parsed = parse(row, errors);\n\n if (errors.length > 0) {\n errors.forEach((error) => {\n logger.error(\n `\u30A8\u30E9\u30FC: ${printParseErrorCode(error.error)} at ${error.offset}`,\n );\n });\n return {\n status: \"error\",\n message: `Failed to parse JSONC file at ${path}.`,\n };\n }\n\n // \u30B9\u30AD\u30FC\u30DE\u304C\u6307\u5B9A\u3055\u308C\u3066\u3044\u308B\u5834\u5408\u306F\u691C\u8A3C\u3092\u5B9F\u884C\n if (options?.schema) {\n const schema = options.schema;\n\n // Zod \u30B9\u30AD\u30FC\u30DE\uFF08parse\u30E1\u30BD\u30C3\u30C9\u3092\u6301\u3064\uFF09\u304B\u30AB\u30B9\u30BF\u30E0\u691C\u8A3C\u95A2\u6570\u304B\u3092\u5224\u5B9A\n if (typeof schema === \"function\") {\n // \u30AB\u30B9\u30BF\u30E0\u578B\u30AC\u30FC\u30C9\u95A2\u6570\n if (!schema(parsed)) {\n return {\n status: \"validation_failed\",\n message: `Validation failed for ${path}. Data does not match expected type.`,\n };\n }\n } else if (\"parse\" in schema && typeof schema.parse === \"function\") {\n // Zod \u30B9\u30AD\u30FC\u30DE\n try {\n return {\n status: \"success\",\n data: schema.parse(parsed) as T,\n };\n } catch (validationError) {\n return {\n status: \"validation_failed\",\n message: `Validation failed for ${path}. Error.`,\n error: validationError,\n };\n }\n }\n }\n\n return {\n status: \"success\",\n data: parsed as T,\n };\n } catch (e) {\n return {\n status: \"not_found\",\n error: e,\n };\n }\n};\n\nconst _helperJsoncFunction = {\n getJsoncByPath: __helperGetJsoncByPathFunc,\n};\n\nexport default _helperJsoncFunction;\n", "import logger from \"@hmpact/logger\";\nimport fetch from \"isomorphic-unfetch\";\nimport ora from \"ora\";\n\nimport { hmpactrc } from \"~/src/config\";\nimport { langSchema } from \"@/schema/lang\";\nimport { type ManifestSchemaType } from \"@/schema/manifest\";\nimport _helperCacheFunction from \"@/utils/helpers/cache\";\nimport _helperManifestFunction from \"@/utils/helpers/manifest\";\nimport _helperSchemaFunction from \"@/utils/helpers/schema\";\n\nconst __helperLangFuncInit = async () => {\n // \u30DE\u30CB\u30D5\u30A7\u30B9\u30C8\u306E\u8AAD\u307F\u8FBC\u307F\n const manifest = await _helperManifestFunction.loadFile();\n if (!manifest.has) {\n logger.error(\"No manifest file found.\");\n throw new Error();\n }\n\n // \u8A00\u8A9E\u30D1\u30C3\u30AF\u306E\u30C0\u30A6\u30F3\u30ED\u30FC\u30C9\u51E6\u7406\u3092\u5B9F\u884C\n await __helperLangFuncDownloads(manifest.content);\n};\n\nconst __helperLangFuncDownloads = async (content: ManifestSchemaType.zod) => {\n // \u8A00\u8A9E\u30D1\u30C3\u30AF\u306E\u30C0\u30A6\u30F3\u30ED\u30FC\u30C9\n const packPromises = ora(\"Downloading language packs...\").start();\n\n // \u30C0\u30A6\u30F3\u30ED\u30FC\u30C9\u958B\u59CB\n try {\n const downloadedPacks: { lang: string; version: string }[] = [];\n packPromises.text = \"Starting downloads...\";\n\n await Promise.allSettled(\n Object.entries(content.lang?.packs || {}).map(async ([key, packUrl]) => {\n // \u5B9F\u884C\u30D0\u30FC\u30B8\u30E7\u30F3\u306B\u5BFE\u5FDC\u3057\u305F\u30D1\u30C3\u30AF\u306E\u30AD\u30E3\u30C3\u30B7\u30E5\u304C\u5B58\u5728\u3059\u308B\u5834\u5408\u306F\u305D\u308C\u3092\u4F7F\u7528\n try {\n const cachedData = await _helperCacheFunction.getJson(\n `${hmpactrc.version}-pack-${key}`,\n { schema: langSchema.zod },\n );\n if (cachedData) {\n downloadedPacks.push({\n lang: key,\n version: cachedData.version,\n });\n return;\n }\n } catch (e) {\n // \u30AD\u30E3\u30C3\u30B7\u30E5\u53D6\u5F97\u5931\u6557\u6642\u306F\u7121\u8996\u3057\u3066\u7D9A\u884C\n }\n packPromises.text = `Downloading language pack: ${key} from ${packUrl}`;\n\n try {\n const result = await fetch(packUrl);\n const data = (await result.json()) as any;\n const _packInfo = {\n version: data.version,\n lang: data.lang,\n };\n\n // \u8B58\u5225\u3067\u304D\u306A\u3044\u5834\u5408\u306F\u30A8\u30E9\u30FC\n if (!_packInfo.version || !_packInfo.lang) {\n packPromises.fail(`Invalid language pack format from: ${packUrl}`);\n return;\n }\n\n // \u30C0\u30A6\u30F3\u30ED\u30FC\u30C9\u6210\u529F\n if (hmpactrc.version !== _packInfo.version) {\n packPromises.warn(\n `You are running hmpact v${hmpactrc.version}, but you have specified a language pack for v${_packInfo.version}.`,\n );\n }\n\n // \u30B9\u30AD\u30FC\u30DE\u3067\u691C\u8A3C\n const parsedValue = await _helperSchemaFunction.safeCheck(\n data,\n langSchema.zod,\n );\n if (!parsedValue.success) {\n packPromises.fail(\n `Language pack validation error from: ${packUrl}\\n${parsedValue.error.message}`,\n );\n throw new Error();\n }\n\n // \u30AD\u30E3\u30C3\u30B7\u30E5\u306B\u4FDD\u5B58\n if (!parsedValue.data) {\n packPromises.fail(\n `Failed to download language pack from: ${packUrl}`,\n );\n throw new Error();\n }\n const save_result = await _helperCacheFunction.putJson(\n `${parsedValue.data.version}-pack-${parsedValue.data.lang}`,\n parsedValue.data,\n );\n if (!save_result.success) {\n packPromises.fail(\n `Failed to cache language pack from: ${packUrl}\\n${save_result.error?.message}`,\n );\n throw new Error();\n }\n\n downloadedPacks.push({\n lang: _packInfo.lang,\n version: _packInfo.version,\n });\n } catch (e) {\n // \u30C0\u30A6\u30F3\u30ED\u30FC\u30C9\u5931\u6557\n packPromises.fail(\n `Failed to download language pack from: ${packUrl}`,\n );\n throw new Error();\n }\n }),\n );\n\n const packs = downloadedPacks\n .map((p) => `${p.lang} (v${p.version})`)\n .join(\", \");\n\n packPromises.succeed(\n `Downloaded language packs: ${downloadedPacks.length > 0 ? packs : \"None\"}\\n`,\n );\n return;\n } catch (e) {\n throw new Error();\n }\n};\n\nconst _helperLangFunction = {\n init: __helperLangFuncInit,\n downloads: __helperLangFuncDownloads,\n};\n\nexport default _helperLangFunction;\n", "import z from \"zod\";\n\nconst __schemaLangMapping = z.record(z.string(), z.string());\n\nconst __schemaLang = z.object({\n version: z.string(),\n lang: z.string(),\n mapping: __schemaLangMapping,\n});\n\nexport const langSchema = {\n zod: __schemaLang,\n includes: {\n __schemaLangMapping,\n },\n};\n\nexport namespace LangSchemaType {\n export type zod = z.infer<typeof __schemaLang>;\n export namespace includes {\n export type __schemaLangMapping = z.infer<typeof __schemaLangMapping>;\n }\n}\n", "import deepmerge from \"deepmerge\";\nimport { existsSync } from \"fs\";\nimport { readFile, writeFile } from \"fs/promises\";\nimport { extname } from \"path\";\n\nimport { hmpactrc } from \"~/src/config\";\nimport { type ManifestSchemaType, manifestSchema } from \"@/schema/manifest\";\nimport _helperDirFunction from \"@/utils/helpers/dir\";\nimport _helperJsoncFunction from \"@/utils/helpers/jsonc\";\nimport _helperSchemaFunction from \"@/utils/helpers/schema\";\n\nimport {\n applyEdits,\n modify,\n parse,\n ParseError,\n printParseErrorCode,\n} from \"jsonc-parser\";\n\nexport interface ManifestHelperFunction_hasFileFile {\n path: string;\n fullname: string;\n name: string;\n ext: string;\n}\n\nexport interface ManifestHelperFunction_hasFileResult {\n has: boolean;\n file?: ManifestHelperFunction_hasFileFile;\n}\n\n/**\n * \u30DE\u30CB\u30D5\u30A7\u30B9\u30C8\u30D5\u30A1\u30A4\u30EB\u304C\u5B58\u5728\u3059\u308B\u304B\u78BA\u8A8D\u3059\u308B\n */\nconst __helperManifestFuncHasFile =\n async (): Promise<ManifestHelperFunction_hasFileResult> => {\n try {\n // \u30AB\u30EC\u30F3\u30C8\u30C7\u30A3\u30EC\u30AF\u30C8\u30EA\u3092\u57FA\u6E96\u306B\u78BA\u8A8D\n const cwd = _helperDirFunction.cwd();\n // \u30DE\u30CB\u30D5\u30A7\u30B9\u30C8\u30D5\u30A1\u30A4\u30EB\u540D\u306E\u30EA\u30B9\u30C8\u3092\u30EB\u30FC\u30D7\u3057\u3066\u5B58\u5728\u78BA\u8A8D\n for (let i = 0; i < hmpactrc.manifestFile.name.length; i++) {\n const fileName = hmpactrc.manifestFile.name[i];\n // \u30D5\u30EB\u30D1\u30B9\u3092\u751F\u6210\n const fullPath = `${cwd}/${fileName}`;\n // \u5B58\u5728\u3059\u308C\u3070\u30D1\u30B9\u3092\u8FD4\u3059\n if (existsSync(fullPath))\n return {\n has: true,\n file: {\n // \u30D5\u30EB\u30D1\u30B9\u3092\u8FD4\u3059\n path: fullPath,\n // \u30D5\u30EB\u30CD\u30FC\u30E0\u3092\u8FD4\u3059\n fullname: fileName,\n // \u62E1\u5F35\u5B50\u306A\u3057\u306E\u30D5\u30A1\u30A4\u30EB\u540D\u3092\u8FD4\u3059\n name: fileName.replace(extname(fileName), \"\"),\n // \u62E1\u5F35\u5B50\u306F\u5C0F\u6587\u5B57\u3067\u7D71\u4E00\n ext: extname(fullPath).toLowerCase(),\n },\n };\n }\n // \u898B\u3064\u304B\u3089\u306A\u304B\u3063\u305F\u5834\u5408\n return { has: false };\n } catch {\n // \u30A8\u30E9\u30FC\u6642\u306F\u4F8B\u5916\u3092\u30B9\u30ED\u30FC\n throw new Error(\"Error checking for config file.\");\n }\n };\n\nexport type ManifestHelperFunction_loadFileResult =\n | {\n has: true;\n file?: ManifestHelperFunction_hasFileFile;\n content: ManifestSchemaType.zod;\n }\n | {\n has: false;\n };\n\n/**\n * \u30DE\u30CB\u30D5\u30A7\u30B9\u30C8\u30D5\u30A1\u30A4\u30EB\u3092\u8AAD\u307F\u8FBC\u307F\u3001\u5185\u5BB9\u3092\u8FD4\u3059\n * @param file - \u8AAD\u307F\u8FBC\u3080\u30D5\u30A1\u30A4\u30EB\u60C5\u5831\uFF08\u7701\u7565\u6642\u306F\u81EA\u52D5\u691C\u51FA\uFF09\n * @returns \u30DE\u30CB\u30D5\u30A7\u30B9\u30C8\u30D5\u30A1\u30A4\u30EB\u306E\u5185\u5BB9\n */\nconst __helperManifestFuncLoadFile = async (\n file?: ManifestHelperFunction_hasFileFile,\n): Promise<ManifestHelperFunction_loadFileResult> => {\n let _file = file;\n // \u30D5\u30A1\u30A4\u30EB\u304C\u6307\u5B9A\u3055\u308C\u3066\u3044\u306A\u3044\u5834\u5408\u306F\u5B58\u5728\u78BA\u8A8D\u3092\u884C\u3046\n if (!_file) {\n // \u30DE\u30CB\u30D5\u30A7\u30B9\u30C8\u30D5\u30A1\u30A4\u30EB\u306E\u5B58\u5728\u3092\u78BA\u8A8D\n const result = await _helperManifestFunction.hasFile();\n // \u5B58\u5728\u3057\u306A\u3051\u308C\u3070\u4F8B\u5916\u3092\u30B9\u30ED\u30FC\n if (result.has && result.file) {\n // \u30D5\u30A1\u30A4\u30EB\u60C5\u5831\u3092\u4E0A\u66F8\u304D\n _file = result.file;\n }\n }\n\n // \u62E1\u5F35\u5B50\u306B\u5FDC\u3058\u3066\u30D1\u30FC\u30B9\u65B9\u6CD5\u3092\u5909\u66F4\n let configData: Record<string, any> | undefined = undefined;\n if (_file) {\n try {\n const { path, ext, name } = _file;\n if (name === \"hmpact.json\") {\n throw new Error(\"hmpact.json format not supported yet.\");\n }\n // JSON\u30D5\u30A1\u30A4\u30EB\u306E\u5834\u5408\n if (ext === \".jsonc\") {\n const result = await _helperJsoncFunction.getJsoncByPath(path, {\n schema: manifestSchema.zod,\n });\n configData = result.data;\n }\n } catch (e) {\n throw new Error(`Error loading config file: ${e}`);\n }\n }\n\n try {\n // \u30C7\u30D5\u30A9\u30EB\u30C8\u8A2D\u5B9A\u3068\u30DE\u30FC\u30B8\n const mergedConfig = deepmerge({}, configData || {});\n\n // \u30B9\u30AD\u30FC\u30DE\u3067\u691C\u8A3C\n const parsedValue = await _helperSchemaFunction.safeCheck(\n mergedConfig,\n manifestSchema.zod,\n );\n\n // \u691C\u8A3C\u30A8\u30E9\u30FC\u6642\u306F\u4F8B\u5916\u3092\u30B9\u30ED\u30FC\n if (!parsedValue.success) {\n throw new Error(\n `Config file validation error: ${parsedValue.error.message}`,\n );\n }\n // \u691C\u8A3C\u6E08\u307F\u306E\u30C7\u30FC\u30BF\u3092\u8FD4\u3059\n return { has: true, file: _file, content: parsedValue.data };\n } catch (e) {\n throw new Error(`Error processing config file: ${e}`);\n }\n};\n\nconst __helperManifestFuncEdit = async (key: string[], value?: any) => {\n const getContent = await __helperManifestFuncLoadFile();\n if (!getContent.has) {\n throw new Error(\"No manifest file to edit.\");\n }\n try {\n const content = JSON.stringify(getContent.content, null, 2);\n const edits = modify(content, key, value, {\n formattingOptions: { tabSize: 2, insertSpaces: true },\n });\n const newContent = applyEdits(content, edits);\n if (!getContent.file) {\n throw new Error(\"No manifest file information available.\");\n }\n await writeFile(getContent.file.path, newContent);\n } catch (e) {\n throw new Error(`Error modifying manifest content: ${e}`);\n }\n};\n\nconst __helperManifestFuncDraftCreate = async () => {\n const getContent = await __helperManifestFuncLoadFile();\n if (!getContent.has) {\n throw new Error(\"No manifest file to edit.\");\n }\n return getContent;\n};\n\nconst __helperManifestFuncDraftEdit = async (\n draft: ManifestSchemaType.zod,\n key: string[],\n value?: any,\n) => {\n try {\n const content = JSON.stringify(draft);\n const edits = modify(content, key, value, {\n formattingOptions: { tabSize: 2, insertSpaces: true },\n });\n const newContent = applyEdits(content, edits);\n return newContent;\n } catch (e) {\n throw new Error(`Error modifying manifest content: ${e}`);\n }\n};\n\nconst __helperManifestFuncDraftSave = async (\n file: ManifestHelperFunction_hasFileFile,\n draft: ManifestSchemaType.zod,\n) => {\n try {\n if (!file) {\n throw new Error(\"No manifest file information available.\");\n }\n await writeFile(file.path, JSON.stringify(draft, null, 2));\n } catch (e) {\n throw new Error(`Error saving manifest content: ${e}`);\n }\n};\n\nconst _helperManifestFunction = {\n hasFile: __helperManifestFuncHasFile,\n loadFile: __helperManifestFuncLoadFile,\n edit: __helperManifestFuncEdit,\n draftCreate: __helperManifestFuncDraftCreate,\n draftEdit: __helperManifestFuncDraftEdit,\n draftSave: __helperManifestFuncDraftSave,\n};\n\nexport default _helperManifestFunction;\n", "import { z } from \"zod\";\n\nconst __schemaLangPack = z.record(z.string(), z.url());\n\nconst __schemaLang = z.object({\n packs: __schemaLangPack.optional(),\n});\n\nconst __schemaRegistryRule = z.object({\n format: z.string(),\n header: z.record(z.string(), z.string()).optional(),\n});\n\nconst __schemaRegistriesSchema = z.record(\n z.string(),\n z.object({\n rule: __schemaRegistryRule,\n }),\n);\n\nconst __schemaDependenciesSchema = z.record(\n z.string(),\n z.record(z.string(), z.string()),\n);\n\nconst __schemaManifest = z.object({\n lang: __schemaLang.optional(),\n registries: __schemaRegistriesSchema.optional(),\n dependencies: __schemaDependenciesSchema.optional(),\n});\n\nexport const manifestSchema = {\n zod: __schemaManifest,\n includes: {\n __schemaRegistriesSchema,\n __schemaDependenciesSchema,\n __schemaRegistryRule,\n },\n};\n\nexport namespace ManifestSchemaType {\n export type zod = z.infer<typeof __schemaManifest>;\n export namespace includes {\n export type __schemaRegistriesSchema = z.infer<\n typeof __schemaRegistriesSchema\n >;\n export type __schemaDependenciesSchema = z.infer<\n typeof __schemaDependenciesSchema\n >;\n export type __schemaRegistryRule = z.infer<typeof __schemaRegistryRule>;\n }\n}\n", "import z from \"zod\";\n\nconst __helperSchemaSafeCheckFunc = async <T>(\n data: any,\n schema: z.ZodType<T>,\n): Promise<z.ZodSafeParseResult<T>> => {\n try {\n // \u30B9\u30AD\u30FC\u30DE\u3067\u691C\u8A3C\n const parsedValue = schema.safeParse(data);\n return parsedValue;\n } catch (e) {\n throw new Error(`Error loading JSONC file: ${e}`);\n }\n};\n\nconst _helperSchemaFunction = {\n safeCheck: __helperSchemaSafeCheckFunc,\n};\n\nexport default _helperSchemaFunction;\n", "import logger from \"@hmpact/logger\";\n\nimport { manifestSchema } from \"@/schema/manifest\";\nimport { regsSchema } from \"@/schema/regs\";\nimport helper from \"@/utils/helper\";\n\nconst __helperRegistryFuncAdd = async (\n domain: string,\n id: string,\n _format?: string,\n) => {\n const format = _format || `//${domain}/@{org}/{pkg}/-/{pkg}-{ver}.tgz`;\n\n await helper.manifest\n .edit([\"registries\", id || domain, \"rule\", \"format\"], format || \"\")\n .catch((e) => {\n throw new Error(\n `Failed to add registry: ${e instanceof Error ? e.message : String(e)}`,\n );\n });\n};\n\nconst __helperRegistryFuncRemove = async (id: string) => {\n await helper.manifest.edit([\"registries\", id]).catch((e) => {\n throw new Error(\n `Failed to remove registry: ${e instanceof Error ? e.message : String(e)}`,\n );\n });\n};\n\nconst __helperRegistryFuncImport = async (url: string) => {\n try {\n logger.info(`Fetching registries from: ${url}`);\n const result = await helper.fetcher(url);\n\n // \u30B9\u30AD\u30FC\u30DE\u3067\u691C\u8A3C\n const parsedValue = regsSchema.zod.safeParse(result);\n\n // \u691C\u8A3C\u30A8\u30E9\u30FC\u6642\u306F\u4F8B\u5916\u3092\u30B9\u30ED\u30FC\n if (!parsedValue.success) {\n throw new Error(\n `Config file validation error: ${parsedValue.error.message}`,\n );\n }\n\n const registries = parsedValue.data.registries;\n const totalCount = registries.length;\n\n if (totalCount === 0) {\n logger.info(\"No registries found to import.\");\n return;\n }\n\n logger.info(`Found ${totalCount} registries to import.`);\n\n // \u91CD\u8907ID\u306E\u691C\u8A3C\n const registryIds = registries.map((r) => r.id);\n const duplicateIds = registryIds.filter(\n (id, index) => registryIds.indexOf(id) !== index,\n );\n\n if (duplicateIds.length > 0) {\n throw new Error(\n `Duplicate registry IDs found in import data: ${[...new Set(duplicateIds)].join(\", \")}`,\n );\n }\n\n // \u65E2\u5B58\u306E\u30DE\u30CB\u30D5\u30A7\u30B9\u30C8\u3092\u53D6\u5F97\n const draft = await helper.manifest.draftCreate();\n let draftContent = draft.content;\n\n // \u65E2\u5B58\u306E\u30EC\u30B8\u30B9\u30C8\u30EAID\u3068\u7AF6\u5408\u30C1\u30A7\u30C3\u30AF\n const existingRegistries = draftContent.registries || {};\n const conflictingIds = registryIds.filter((id) => id in existingRegistries);\n\n if (conflictingIds.length > 0) {\n logger.warn(\n `Warning: The following registries will be overwritten: ${conflictingIds.join(\", \")}`,\n );\n }\n\n // \u5404\u30EC\u30B8\u30B9\u30C8\u30EA\u3092\u30C9\u30E9\u30D5\u30C8\u306B\u8FFD\u52A0\uFF08\u30D0\u30C3\u30C1\u51E6\u7406\uFF09\n let successCount = 0;\n let failedCount = 0;\n const failedRegistries: { id: string; error: string }[] = [];\n\n for (let i = 0; i < totalCount; i++) {\n const registry = registries[i];\n const { id, rule } = registry;\n\n try {\n logger.info(`[${i + 1}/${totalCount}] Importing registry: ${id}...`);\n\n const editedJson = await helper.manifest.draftEdit(\n draftContent,\n [\"registries\", id],\n { rule },\n );\n\n // \u578B\u5B89\u5168\u6027\u306E\u5411\u4E0A: JSON.parse \u306E\u7D50\u679C\u3092\u691C\u8A3C\n const parsedDraft = JSON.parse(editedJson);\n const validatedDraft = manifestSchema.zod.safeParse(parsedDraft);\n\n if (!validatedDraft.success) {\n throw new Error(\n `Draft validation failed: ${validatedDraft.error.message}`,\n );\n }\n\n draftContent = validatedDraft.data;\n successCount++;\n logger.info(`[${i + 1}/${totalCount}] \u2713 ${id} imported successfully`);\n } catch (e) {\n failedCount++;\n const errorMessage = e instanceof Error ? e.message : String(e);\n failedRegistries.push({ id, error: errorMessage });\n logger.error(\n `[${i + 1}/${totalCount}] \u2717 Failed to import ${id}: ${errorMessage}`,\n );\n }\n }\n\n // \u7D50\u679C\u306E\u30B5\u30DE\u30EA\u30FC\u8868\u793A\n logger.info(\"\\n=== Import Summary ===\");\n logger.info(`Total: ${totalCount}`);\n logger.info(`Success: ${successCount}`);\n logger.info(`Failed: ${failedCount}`);\n\n if (failedCount > 0) {\n logger.info(\"\\nFailed registries:\");\n failedRegistries.forEach(({ id, error }) => {\n logger.info(` - ${id}: ${error}`);\n });\n\n // \u4E00\u90E8\u5931\u6557\u3057\u305F\u5834\u5408\u3067\u3082\u6210\u529F\u3057\u305F\u3082\u306E\u306F\u4FDD\u5B58\n if (successCount > 0) {\n logger.info(\"\\nSaving successfully imported registries...\");\n await helper.manifest.draftSave(draft.file!, draftContent);\n logger.info(\"Partial import completed.\");\n } else {\n throw new Error(\"All registry imports failed.\");\n }\n } else {\n // \u3059\u3079\u3066\u6210\u529F\u3057\u305F\u5834\u5408\n await helper.manifest.draftSave(draft.file!, draftContent);\n logger.info(\"\\n\u2713 All registries imported successfully!\");\n }\n } catch (e) {\n throw new Error(\n `Failed to import registries: ${e instanceof Error ? e.message : String(e)}`,\n );\n }\n};\n\nconst _helperRegistryFunction = {\n add: __helperRegistryFuncAdd,\n remove: __helperRegistryFuncRemove,\n import: __helperRegistryFuncImport,\n};\n\nexport default _helperRegistryFunction;\n", "import z from \"zod\";\n\nconst __schemaRegsRegistryRule = z.object({\n format: z.string(),\n header: z.record(z.string(), z.string()).optional(),\n});\n\nconst __schemaRegsRegistry = z.object({\n id: z.string(),\n rule: __schemaRegsRegistryRule,\n});\n\nconst __schemaRegs = z.object({\n registries: z.array(__schemaRegsRegistry),\n});\n\nexport const regsSchema = {\n zod: __schemaRegs,\n includes: {\n __schemaRegsRegistry,\n __schemaRegsRegistryRule,\n },\n};\nexport namespace RegsSchemaType {\n export type zod = z.infer<typeof __schemaRegs>;\n export namespace includes {\n export type __schemaRegsRegistry = z.infer<typeof __schemaRegsRegistry>;\n export type __schemaRegsRegistryRule = z.infer<\n typeof __schemaRegsRegistryRule\n >;\n }\n}\n", "import { existsSync } from \"fs\";\nimport { readFile } from \"fs/promises\";\nimport { join } from \"path\";\n\nimport _helperDirFunction from \"@/utils/helpers/dir\";\n\nconst __helperSelfPkgJsonLoad = async () => {\n // `package.json`\u304C\u5B58\u5728\u3059\u308B\u30C7\u30A3\u30EC\u30AF\u30C8\u30EA\u3092\u53D6\u5F97\n const candidate = await _helperDirFunction.selfroot();\n if (!candidate) {\n // \u898B\u3064\u304B\u3089\u306A\u304B\u3063\u305F\u5834\u5408\u306F\u30A8\u30E9\u30FC\u3092\u30B9\u30ED\u30FC\n throw new Error(\"package.json not found: candidate directory not found\");\n }\n const pkgPath = join(candidate, \"package.json\");\n if (!existsSync(pkgPath)) {\n throw new Error(`package.json not found at ${pkgPath}`);\n }\n const raw = await readFile(pkgPath, \"utf8\");\n return JSON.parse(raw);\n};\n\nconst _helperSelfFunction = {\n pkg: {\n load: __helperSelfPkgJsonLoad,\n },\n};\n\nexport default _helperSelfFunction;\n", "import logger from \"@hmpact/logger\";\r\n\r\nimport { userConfigSchema } from \"@/schema/user-config\";\r\nimport _helperDirFunction from \"@/utils/helpers/dir\";\r\nimport _helperJsoncFunction from \"@/utils/helpers/jsonc\";\r\n\r\nconst __userConfigPath = _helperDirFunction.userhmpactRoot + \"/config.jsonc\";\r\n\r\nconst __helperUserConfigFuncGet = async () => {\r\n const result = await _helperJsoncFunction\r\n .getJsoncByPath(__userConfigPath, { schema: userConfigSchema.zod })\r\n .then((data) => {\r\n logger.debug(\"User config loaded:\", data);\r\n return data;\r\n });\r\n\r\n if (result.status !== \"success\") {\r\n if (result.status === \"not_found\") {\r\n logger.warn(\"User config file not found. Using default configuration.\");\r\n } else if (result.status === \"validation_failed\") {\r\n logger.error(\"User config validation failed:\", result.message);\r\n }\r\n return null;\r\n }\r\n return result;\r\n};\r\n\r\nconst _helperUserConfigFunction = {\r\n get: __helperUserConfigFuncGet,\r\n};\r\n\r\nexport default _helperUserConfigFunction;\r\n", "import z from \"zod\";\n\nconst __schemaLanguagePack = z.record(z.string(), z.string());\n\nconst __schemaLanguage = z.object({\n default: z.string(),\n packs: z.record(z.string(), __schemaLanguagePack),\n});\n\nconst __schemaUserConfig = z.object({\n lang: __schemaLanguage,\n});\n\nexport const userConfigSchema = {\n zod: __schemaUserConfig,\n includes: {\n __schemaLanguage,\n },\n};\n\nexport namespace UserConfigSchemaType {\n export type zod = z.infer<typeof __schemaUserConfig>;\n export namespace includes {\n export type __schemaLanguage = z.infer<typeof __schemaLanguage>;\n export type __schemaLanguagePack = z.infer<typeof __schemaLanguagePack>;\n }\n}\n", "import _helperBuildInfoFunction from \"@/utils/helpers/build-info\";\nimport _helperCacheFunction from \"@/utils/helpers/cache\";\nimport _helperDirFunction from \"@/utils/helpers/dir\";\nimport _helperFetcherFunction from \"@/utils/helpers/fetcher\";\nimport _helperJsoncFunction from \"@/utils/helpers/jsonc\";\nimport _helperLangFunction from \"@/utils/helpers/lang\";\nimport _helperManifestFunction from \"@/utils/helpers/manifest\";\nimport _helperRegistryFunction from \"@/utils/helpers/registry\";\nimport _helperSchemaFunction from \"@/utils/helpers/schema\";\nimport _helperSelfFunction from \"@/utils/helpers/self\";\nimport _helperUserConfigFunction from \"@/utils/helpers/user-config\";\n\n/**\n * \u30D8\u30EB\u30D1\u30FC\u95A2\u6570\u7FA4\n */\nconst helper = {\n schema: _helperSchemaFunction,\n jsonc: _helperJsoncFunction,\n fetcher: _helperFetcherFunction,\n dir: _helperDirFunction,\n lang: _helperLangFunction,\n userConfig: _helperUserConfigFunction,\n cache: _helperCacheFunction,\n self: _helperSelfFunction,\n buildInfo: _helperBuildInfoFunction,\n manifest: _helperManifestFunction,\n registry: _helperRegistryFunction,\n};\n\nexport default helper;\n", "import type { hmpactrcType } from \"@/types/self\";\nimport helper from \"@/utils/helper\";\n\n// `package.json`\u3092\u8AAD\u307F\u8FBC\u3080\nconst pkgJson = await helper.self.pkg.load();\n\nexport const hmpactrc: hmpactrcType = {\n name: pkgJson.name,\n version: pkgJson.version || \"0.0.0\",\n manifestFile: {\n name: [\"hmpact.jsonc\"],\n },\n};\n", "import logger from \"@hmpact/logger\";\nimport { Command } from \"commander\";\n\nimport helper from \"@/utils/helper\";\n\n/**\n * summary: \u30D1\u30C3\u30B1\u30FC\u30B8\u30EC\u30B8\u30B9\u30C8\u30EA\u306E\u7BA1\u7406\u30B3\u30DE\u30F3\u30C9\u3092\u63D0\u4F9B\u3059\u308B\n * description: \u3053\u306E\u30E2\u30B8\u30E5\u30FC\u30EB\u306F\u3001\u30D1\u30C3\u30B1\u30FC\u30B8\u30EC\u30B8\u30B9\u30C8\u30EA\u306E\u8FFD\u52A0\u3001\u524A\u9664\u3001\u30A4\u30F3\u30DD\u30FC\u30C8\u3092\u884C\u3046\u305F\u3081\u306ECLI\u30B3\u30DE\u30F3\u30C9\u3092\u5B9A\u7FA9\u3057\u307E\u3059\u3002\u30E6\u30FC\u30B6\u30FC\u306F\u30C9\u30E1\u30A4\u30F3\u3001ID\u3001URL\u30D5\u30A9\u30FC\u30DE\u30C3\u30C8\u30EB\u30FC\u30EB\u3001HTTP\u30D8\u30C3\u30C0\u30FC\u3092\u6307\u5B9A\u3057\u3066\u30EC\u30B8\u30B9\u30C8\u30EA\u3092\u7BA1\u7406\u3067\u304D\u307E\u3059\u3002\n */\n\n\nexport function createRegistryCommand(): Command {\n const registryCmd = new Command(\"registry\")\n .alias(\"reg\")\n .description(\"Generate package registry URL based on predefined rules\");\n\n registryCmd\n .command(\"add\")\n .requiredOption(\"--domain <domain>\", \"Domain of the registry\")\n .option(\"--id <id>\", \"ID of the registry\")\n .option(\n \"--format <format>\",\n \"URL format rule (use {pkg}, {ver}, {:env.KEY})\",\n )\n .option(\n \"--header <header>\",\n \"HTTP header for the registry request (use key:value format)\",\n )\n .description(\"Add a new registry entry\")\n .action(async (opts) => {\n const { domain, id, format } = opts;\n await helper.registry.add(domain, id, format).catch((e) => {\n logger.error(\n `Error adding registry: ${e instanceof Error ? e.message : String(e)}`,\n );\n });\n });\n\n registryCmd\n .command(\"remove <id>\")\n .description(\"Remove a registry entry\")\n .action(async (id: string) => {\n await helper.registry.remove(id).catch((e) => {\n logger.error(\n `Error removing registry: ${e instanceof Error ? e.message : String(e)}`,\n );\n });\n });\n\n registryCmd\n .command(\"import <url>\")\n .description(\"Import registry entries from a remote JSONC file\")\n .action(async (url: string) => {\n await helper.registry.import(url).catch((e) => {\n logger.error(\n `Error importing registries: ${e instanceof Error ? e.message : String(e)}`,\n );\n });\n });\n\n return registryCmd;\n}\n"],
5
+ "mappings": "AAAA,OAAOA,OAAW,QAClB,OAAS,WAAAC,MAAe,YACxB,OAAOC,OAAY,SACnB,OAAOC,OAAc,kBCHrB,OAAS,cAAAC,OAAkB,KAC3B,OAAS,YAAAC,OAAgB,cACzB,OAAS,QAAAC,OAAY,OCFrB,OAAOC,OAAQ,KACf,OAAS,WAAAC,MAAe,KACxB,OAAOC,MAAU,OACjB,OAAS,iBAAAC,OAAqB,MAG9B,IAAMC,EAAaD,GAAc,YAAY,GAAG,EAE1CE,EAAYH,EAAK,QAAQE,CAAU,EAKnCE,GAAqB,IAAc,CACvC,GAAI,CAGF,OADY,QAAQ,IAAI,CAE1B,MAAQ,CAEN,MAAM,IAAI,MAAM,0CAA0C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AG/DE,EACG,cAAc,CAAE,kBAAmB,EAAK,CAAC,EACzC,OAAO,cAAe,mBAAmB,EACzC,OAAO,oBAAqB,sBAAsB,EAGrDA,EACG,QAAQ,YAAY,EACpB,YAAY,2BAA2B,EACvC,OAAO,SAAY,CAClB,IAAMC,EAAO,MAAMF,EAAO,UAAU,KAAK,EACzC,GAAI,CAACE,EAAM,CACT,QAAQ,IAAI,0BAA0B,EACtC,MACF,CACA,QAAQ,IAAI;AAAA,QACRA,EAAK,IAAI;AAAA,WACNA,EAAK,OAAO;AAAA,YACXA,EAAK,OAAO;AAAA,UACdA,EAAK,MAAM;AAAA,UACXA,EAAK,MAAM;AAAA,aACRA,EAAK,SAAS;AAAA,CAAI,CAC7B,CAAC,EAGHD,EACG,QAAQ,MAAM,EACd,YAAY,yCAAyC,EACrD,OAAO,SAAY,CAClB,IAAME,EAAa,MAAMH,EAAO,SAAS,SAAS,EAClD,QAAQ,IAAI,oBAAqBG,CAAU,CAC7C,CAAC,EAEHF,EAAQ,WAAWG,GAAsB,CAAC,EAGrC,QAAQ,KAAK,MAAM,CAAC,EAAE,SACzBH,EAAQ,WAAW,EACnB,QAAQ,KAAK,CAAC,GAGhB,MAAMA,EAAQ,WAAW,QAAQ,IAAI",
6
+ "names": ["chalk", "program", "figlet", "gradient", "existsSync", "readFile", "join", "fs", "homedir", "path", "fileURLToPath", "__filename", "__dirname", "__helperDirFuncCwd", "__helperDirFuncSelfroot", "dir", "maxDepth", "parent", "__helperDirFuncUserhmpactRoot", "_helperDirFunction", "dir_default", "__helperBuildInfoFuncLoad", "candidate", "dir_default", "buildInfoPath", "join", "existsSync", "raw", "readFile", "_helperBuildInfoFunction", "build_info_default", "logger", "cacache", "cachePath", "__helperCacheLsFunc", "error", "__helperCacheClearFunc", "__helperCachePutFunc", "key", "data", "__helperCachePutJsonFunc", "value", "payload", "__helperCacheGetFunc", "__helperCacheGetJsonFunc", "options", "buf", "parsed", "schema", "validationError", "_helperCacheFunction", "cache_default", "fetch", "__helperFetcherFunc", "url", "_helperFetcherFunction", "fetcher_default", "logger", "readFile", "parse", "printParseErrorCode", "__helperGetJsoncByPathFunc", "path", "options", "row", "errors", "parsed", "error", "schema", "validationError", "e", "_helperJsoncFunction", "jsonc_default", "logger", "fetch", "ora", "z", "__schemaLangMapping", "__schemaLang", "langSchema", "deepmerge", "existsSync", "writeFile", "extname", "z", "__schemaLangPack", "__schemaLang", "__schemaRegistryRule", "__schemaRegistriesSchema", "__schemaDependenciesSchema", "__schemaManifest", "manifestSchema", "__helperSchemaSafeCheckFunc", "data", "schema", "e", "_helperSchemaFunction", "schema_default", "applyEdits", "modify", "__helperManifestFuncHasFile", "cwd", "dir_default", "i", "hmpactrc", "fileName", "fullPath", "existsSync", "extname", "__helperManifestFuncLoadFile", "file", "_file", "result", "_helperManifestFunction", "configData", "path", "ext", "name", "jsonc_default", "manifestSchema", "e", "mergedConfig", "deepmerge", "parsedValue", "schema_default", "__helperManifestFuncEdit", "key", "value", "getContent", "content", "edits", "newContent", "writeFile", "__helperManifestFuncDraftCreate", "__helperManifestFuncDraftEdit", "draft", "__helperManifestFuncDraftSave", "manifest_default", "__helperLangFuncInit", "manifest", "manifest_default", "logger", "__helperLangFuncDownloads", "content", "packPromises", "ora", "downloadedPacks", "key", "packUrl", "cachedData", "cache_default", "hmpactrc", "langSchema", "data", "fetch", "_packInfo", "parsedValue", "schema_default", "save_result", "packs", "p", "_helperLangFunction", "lang_default", "logger", "z", "__schemaRegsRegistryRule", "__schemaRegsRegistry", "__schemaRegs", "regsSchema", "__helperRegistryFuncAdd", "domain", "id", "_format", "format", "helper_default", "e", "__helperRegistryFuncRemove", "__helperRegistryFuncImport", "url", "logger", "result", "parsedValue", "regsSchema", "registries", "totalCount", "registryIds", "r", "duplicateIds", "index", "draft", "draftContent", "existingRegistries", "conflictingIds", "successCount", "failedCount", "failedRegistries", "i", "registry", "rule", "editedJson", "parsedDraft", "validatedDraft", "manifestSchema", "errorMessage", "error", "_helperRegistryFunction", "registry_default", "existsSync", "readFile", "join", "__helperSelfPkgJsonLoad", "candidate", "dir_default", "pkgPath", "join", "existsSync", "raw", "readFile", "_helperSelfFunction", "self_default", "logger", "z", "__schemaLanguagePack", "__schemaLanguage", "__schemaUserConfig", "userConfigSchema", "__userConfigPath", "dir_default", "__helperUserConfigFuncGet", "result", "jsonc_default", "userConfigSchema", "data", "logger", "_helperUserConfigFunction", "user_config_default", "helper", "schema_default", "jsonc_default", "fetcher_default", "dir_default", "lang_default", "user_config_default", "cache_default", "self_default", "build_info_default", "manifest_default", "registry_default", "helper_default", "pkgJson", "helper_default", "hmpactrc", "logger", "Command", "createRegistryCommand", "registryCmd", "Command", "opts", "domain", "id", "format", "helper_default", "e", "logger", "url", "gradient", "figlet", "chalk", "hmpactrc", "helper_default", "program", "data", "configData", "createRegistryCommand"]
7
+ }
@@ -0,0 +1 @@
1
+ //# sourceMappingURL=parse.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"parse.d.ts","sourceRoot":"","sources":["../src/parse.ts"],"names":[],"mappings":""}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=runner.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"runner.d.ts","sourceRoot":"","sources":["../src/runner.ts"],"names":[],"mappings":""}
@@ -0,0 +1,25 @@
1
+ import z from "zod";
2
+ declare const __schemaLangMapping: z.ZodRecord<z.ZodString, z.ZodString>;
3
+ declare const __schemaLang: z.ZodObject<{
4
+ version: z.ZodString;
5
+ lang: z.ZodString;
6
+ mapping: z.ZodRecord<z.ZodString, z.ZodString>;
7
+ }, z.core.$strip>;
8
+ export declare const langSchema: {
9
+ zod: z.ZodObject<{
10
+ version: z.ZodString;
11
+ lang: z.ZodString;
12
+ mapping: z.ZodRecord<z.ZodString, z.ZodString>;
13
+ }, z.core.$strip>;
14
+ includes: {
15
+ __schemaLangMapping: z.ZodRecord<z.ZodString, z.ZodString>;
16
+ };
17
+ };
18
+ export declare namespace LangSchemaType {
19
+ type zod = z.infer<typeof __schemaLang>;
20
+ namespace includes {
21
+ type __schemaLangMapping = z.infer<typeof __schemaLangMapping>;
22
+ }
23
+ }
24
+ export {};
25
+ //# sourceMappingURL=lang.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"lang.d.ts","sourceRoot":"","sources":["../../src/schema/lang.ts"],"names":[],"mappings":"AAAA,OAAO,CAAC,MAAM,KAAK,CAAC;AAEpB,QAAA,MAAM,mBAAmB,uCAAmC,CAAC;AAE7D,QAAA,MAAM,YAAY;;;;iBAIhB,CAAC;AAEH,eAAO,MAAM,UAAU;;;;;;;;;CAKtB,CAAC;AAEF,yBAAiB,cAAc,CAAC;IAC9B,KAAY,GAAG,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,YAAY,CAAC,CAAC;IAC/C,UAAiB,QAAQ,CAAC;QACxB,KAAY,mBAAmB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,mBAAmB,CAAC,CAAC;KACvE;CACF"}
@@ -0,0 +1,61 @@
1
+ import { z } from "zod";
2
+ declare const __schemaRegistryRule: z.ZodObject<{
3
+ format: z.ZodString;
4
+ header: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
5
+ }, z.core.$strip>;
6
+ declare const __schemaRegistriesSchema: z.ZodRecord<z.ZodString, z.ZodObject<{
7
+ rule: z.ZodObject<{
8
+ format: z.ZodString;
9
+ header: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
10
+ }, z.core.$strip>;
11
+ }, z.core.$strip>>;
12
+ declare const __schemaDependenciesSchema: z.ZodRecord<z.ZodString, z.ZodRecord<z.ZodString, z.ZodString>>;
13
+ declare const __schemaManifest: z.ZodObject<{
14
+ lang: z.ZodOptional<z.ZodObject<{
15
+ packs: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodURL>>;
16
+ }, z.core.$strip>>;
17
+ registries: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodObject<{
18
+ rule: z.ZodObject<{
19
+ format: z.ZodString;
20
+ header: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
21
+ }, z.core.$strip>;
22
+ }, z.core.$strip>>>;
23
+ dependencies: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodRecord<z.ZodString, z.ZodString>>>;
24
+ }, z.core.$strip>;
25
+ export declare const manifestSchema: {
26
+ zod: z.ZodObject<{
27
+ lang: z.ZodOptional<z.ZodObject<{
28
+ packs: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodURL>>;
29
+ }, z.core.$strip>>;
30
+ registries: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodObject<{
31
+ rule: z.ZodObject<{
32
+ format: z.ZodString;
33
+ header: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
34
+ }, z.core.$strip>;
35
+ }, z.core.$strip>>>;
36
+ dependencies: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodRecord<z.ZodString, z.ZodString>>>;
37
+ }, z.core.$strip>;
38
+ includes: {
39
+ __schemaRegistriesSchema: z.ZodRecord<z.ZodString, z.ZodObject<{
40
+ rule: z.ZodObject<{
41
+ format: z.ZodString;
42
+ header: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
43
+ }, z.core.$strip>;
44
+ }, z.core.$strip>>;
45
+ __schemaDependenciesSchema: z.ZodRecord<z.ZodString, z.ZodRecord<z.ZodString, z.ZodString>>;
46
+ __schemaRegistryRule: z.ZodObject<{
47
+ format: z.ZodString;
48
+ header: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
49
+ }, z.core.$strip>;
50
+ };
51
+ };
52
+ export declare namespace ManifestSchemaType {
53
+ type zod = z.infer<typeof __schemaManifest>;
54
+ namespace includes {
55
+ type __schemaRegistriesSchema = z.infer<typeof __schemaRegistriesSchema>;
56
+ type __schemaDependenciesSchema = z.infer<typeof __schemaDependenciesSchema>;
57
+ type __schemaRegistryRule = z.infer<typeof __schemaRegistryRule>;
58
+ }
59
+ }
60
+ export {};
61
+ //# sourceMappingURL=manifest.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"manifest.d.ts","sourceRoot":"","sources":["../../src/schema/manifest.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAQxB,QAAA,MAAM,oBAAoB;;;iBAGxB,CAAC;AAEH,QAAA,MAAM,wBAAwB;;;;;kBAK7B,CAAC;AAEF,QAAA,MAAM,0BAA0B,iEAG/B,CAAC;AAEF,QAAA,MAAM,gBAAgB;;;;;;;;;;;iBAIpB,CAAC;AAEH,eAAO,MAAM,cAAc;;;;;;;;;;;;;;;;;;;;;;;;;;CAO1B,CAAC;AAEF,yBAAiB,kBAAkB,CAAC;IAClC,KAAY,GAAG,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,gBAAgB,CAAC,CAAC;IACnD,UAAiB,QAAQ,CAAC;QACxB,KAAY,wBAAwB,GAAG,CAAC,CAAC,KAAK,CAC5C,OAAO,wBAAwB,CAChC,CAAC;QACF,KAAY,0BAA0B,GAAG,CAAC,CAAC,KAAK,CAC9C,OAAO,0BAA0B,CAClC,CAAC;QACF,KAAY,oBAAoB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,oBAAoB,CAAC,CAAC;KACzE;CACF"}
@@ -0,0 +1,54 @@
1
+ import z from "zod";
2
+ declare const __schemaRegsRegistryRule: z.ZodObject<{
3
+ format: z.ZodString;
4
+ header: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
5
+ }, z.core.$strip>;
6
+ declare const __schemaRegsRegistry: z.ZodObject<{
7
+ id: z.ZodString;
8
+ rule: z.ZodObject<{
9
+ format: z.ZodString;
10
+ header: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
11
+ }, z.core.$strip>;
12
+ }, z.core.$strip>;
13
+ declare const __schemaRegs: z.ZodObject<{
14
+ registries: z.ZodArray<z.ZodObject<{
15
+ id: z.ZodString;
16
+ rule: z.ZodObject<{
17
+ format: z.ZodString;
18
+ header: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
19
+ }, z.core.$strip>;
20
+ }, z.core.$strip>>;
21
+ }, z.core.$strip>;
22
+ export declare const regsSchema: {
23
+ zod: z.ZodObject<{
24
+ registries: z.ZodArray<z.ZodObject<{
25
+ id: z.ZodString;
26
+ rule: z.ZodObject<{
27
+ format: z.ZodString;
28
+ header: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
29
+ }, z.core.$strip>;
30
+ }, z.core.$strip>>;
31
+ }, z.core.$strip>;
32
+ includes: {
33
+ __schemaRegsRegistry: z.ZodObject<{
34
+ id: z.ZodString;
35
+ rule: z.ZodObject<{
36
+ format: z.ZodString;
37
+ header: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
38
+ }, z.core.$strip>;
39
+ }, z.core.$strip>;
40
+ __schemaRegsRegistryRule: z.ZodObject<{
41
+ format: z.ZodString;
42
+ header: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
43
+ }, z.core.$strip>;
44
+ };
45
+ };
46
+ export declare namespace RegsSchemaType {
47
+ type zod = z.infer<typeof __schemaRegs>;
48
+ namespace includes {
49
+ type __schemaRegsRegistry = z.infer<typeof __schemaRegsRegistry>;
50
+ type __schemaRegsRegistryRule = z.infer<typeof __schemaRegsRegistryRule>;
51
+ }
52
+ }
53
+ export {};
54
+ //# sourceMappingURL=regs.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"regs.d.ts","sourceRoot":"","sources":["../../src/schema/regs.ts"],"names":[],"mappings":"AAAA,OAAO,CAAC,MAAM,KAAK,CAAC;AAEpB,QAAA,MAAM,wBAAwB;;;iBAG5B,CAAC;AAEH,QAAA,MAAM,oBAAoB;;;;;;iBAGxB,CAAC;AAEH,QAAA,MAAM,YAAY;;;;;;;;iBAEhB,CAAC;AAEH,eAAO,MAAM,UAAU;;;;;;;;;;;;;;;;;;;;;;;CAMtB,CAAC;AACF,yBAAiB,cAAc,CAAC;IAC9B,KAAY,GAAG,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,YAAY,CAAC,CAAC;IAC/C,UAAiB,QAAQ,CAAC;QACxB,KAAY,oBAAoB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,oBAAoB,CAAC,CAAC;QACxE,KAAY,wBAAwB,GAAG,CAAC,CAAC,KAAK,CAC5C,OAAO,wBAAwB,CAChC,CAAC;KACH;CACF"}
@@ -0,0 +1,35 @@
1
+ import z from "zod";
2
+ declare const __schemaLanguagePack: z.ZodRecord<z.ZodString, z.ZodString>;
3
+ declare const __schemaLanguage: z.ZodObject<{
4
+ default: z.ZodString;
5
+ packs: z.ZodRecord<z.ZodString, z.ZodRecord<z.ZodString, z.ZodString>>;
6
+ }, z.core.$strip>;
7
+ declare const __schemaUserConfig: z.ZodObject<{
8
+ lang: z.ZodObject<{
9
+ default: z.ZodString;
10
+ packs: z.ZodRecord<z.ZodString, z.ZodRecord<z.ZodString, z.ZodString>>;
11
+ }, z.core.$strip>;
12
+ }, z.core.$strip>;
13
+ export declare const userConfigSchema: {
14
+ zod: z.ZodObject<{
15
+ lang: z.ZodObject<{
16
+ default: z.ZodString;
17
+ packs: z.ZodRecord<z.ZodString, z.ZodRecord<z.ZodString, z.ZodString>>;
18
+ }, z.core.$strip>;
19
+ }, z.core.$strip>;
20
+ includes: {
21
+ __schemaLanguage: z.ZodObject<{
22
+ default: z.ZodString;
23
+ packs: z.ZodRecord<z.ZodString, z.ZodRecord<z.ZodString, z.ZodString>>;
24
+ }, z.core.$strip>;
25
+ };
26
+ };
27
+ export declare namespace UserConfigSchemaType {
28
+ type zod = z.infer<typeof __schemaUserConfig>;
29
+ namespace includes {
30
+ type __schemaLanguage = z.infer<typeof __schemaLanguage>;
31
+ type __schemaLanguagePack = z.infer<typeof __schemaLanguagePack>;
32
+ }
33
+ }
34
+ export {};
35
+ //# sourceMappingURL=user-config.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"user-config.d.ts","sourceRoot":"","sources":["../../src/schema/user-config.ts"],"names":[],"mappings":"AAAA,OAAO,CAAC,MAAM,KAAK,CAAC;AAEpB,QAAA,MAAM,oBAAoB,uCAAmC,CAAC;AAE9D,QAAA,MAAM,gBAAgB;;;iBAGpB,CAAC;AAEH,QAAA,MAAM,kBAAkB;;;;;iBAEtB,CAAC;AAEH,eAAO,MAAM,gBAAgB;;;;;;;;;;;;;CAK5B,CAAC;AAEF,yBAAiB,oBAAoB,CAAC;IACpC,KAAY,GAAG,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,kBAAkB,CAAC,CAAC;IACrD,UAAiB,QAAQ,CAAC;QACxB,KAAY,gBAAgB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,gBAAgB,CAAC,CAAC;QAChE,KAAY,oBAAoB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,oBAAoB,CAAC,CAAC;KACzE;CACF"}
@@ -0,0 +1,9 @@
1
+ export interface BuildInfo {
2
+ name: string;
3
+ version: string;
4
+ buildId: string;
5
+ commit: string;
6
+ branch: string;
7
+ timestamp: string;
8
+ }
9
+ //# sourceMappingURL=build-info.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"build-info.d.ts","sourceRoot":"","sources":["../../src/types/build-info.ts"],"names":[],"mappings":"AACA,MAAM,WAAW,SAAS;IACxB,IAAI,EAAE,MAAM,CAAC;IACb,OAAO,EAAE,MAAM,CAAC;IAChB,OAAO,EAAE,MAAM,CAAC;IAChB,MAAM,EAAE,MAAM,CAAC;IACf,MAAM,EAAE,MAAM,CAAC;IACf,SAAS,EAAE,MAAM,CAAC;CACnB"}
@@ -0,0 +1,8 @@
1
+ export interface hmpactrcType {
2
+ name: string;
3
+ version: string;
4
+ manifestFile: {
5
+ name: string | string[];
6
+ };
7
+ }
8
+ //# sourceMappingURL=self.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"self.d.ts","sourceRoot":"","sources":["../../src/types/self.ts"],"names":[],"mappings":"AACA,MAAM,WAAW,YAAY;IAE3B,IAAI,EAAE,MAAM,CAAC;IAEb,OAAO,EAAE,MAAM,CAAC;IAChB,YAAY,EAAE;QACZ,IAAI,EAAE,MAAM,GAAG,MAAM,EAAE,CAAC;KACzB,CAAC;CACH"}
@@ -0,0 +1,16 @@
1
+ /**
2
+ * フォーマット文字列内の $` を `&` に変換
3
+ * @param format フォーマット文字列 (例: "//api.motion.dev/registry?package={pkg}$version={ver}")
4
+ * @returns 変換されたフォーマット文字列
5
+ */
6
+ export declare function convertFormatToUrl(format: string): string;
7
+ /**
8
+ * フォーマット文字列内のプレースホルダーを置換
9
+ * @param format フォーマット文字列
10
+ * @param pkg パッケージ名
11
+ * @param ver バージョン
12
+ * @param envVars 環境変数オブジェクト
13
+ * @returns 置換されたURL
14
+ */
15
+ export declare function interpolateFormat(format: string, pkg: string, ver: string, envVars?: Record<string, string>): string;
16
+ //# sourceMappingURL=format.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"format.d.ts","sourceRoot":"","sources":["../../src/utils/format.ts"],"names":[],"mappings":"AACA;;;;GAIG;AACH,wBAAgB,kBAAkB,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,CAEzD;AAED;;;;;;;GAOG;AACH,wBAAgB,iBAAiB,CAC/B,MAAM,EAAE,MAAM,EACd,GAAG,EAAE,MAAM,EACX,GAAG,EAAE,MAAM,EACX,OAAO,GAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAM,GACnC,MAAM,CAUR"}
@@ -0,0 +1,73 @@
1
+ /**
2
+ * ヘルパー関数群
3
+ */
4
+ declare const helper: {
5
+ schema: {
6
+ safeCheck: <T>(data: any, schema: import("zod").ZodType<T>) => Promise<import("zod").ZodSafeParseResult<T>>;
7
+ };
8
+ jsonc: {
9
+ getJsoncByPath: <T = unknown>(path: string, options?: import("@/utils/helpers/jsonc").GetJsoncOptions<T>) => Promise<import("@/utils/helpers/jsonc").__helperGetJsoncByPathFuncResponse<T>>;
10
+ };
11
+ fetcher: (url: string) => Promise<unknown>;
12
+ dir: {
13
+ filename: string;
14
+ dirname: string;
15
+ cwd: () => string;
16
+ selfroot: () => Promise<string | undefined>;
17
+ userRoot: typeof import("os").homedir;
18
+ userhmpactRoot: string;
19
+ };
20
+ lang: {
21
+ init: () => Promise<void>;
22
+ downloads: (content: import("../schema/manifest").ManifestSchemaType.zod) => Promise<void>;
23
+ };
24
+ userConfig: {
25
+ get: () => Promise<import("@/utils/helpers/jsonc").__helperGetJsoncByPathFuncResponse<{
26
+ lang: {
27
+ default: string;
28
+ packs: Record<string, Record<string, string>>;
29
+ };
30
+ }> | null>;
31
+ };
32
+ cache: {
33
+ ls: () => Promise<import("cacache").ls.Cache | undefined>;
34
+ clear: () => Promise<void>;
35
+ put: (key: string, data: string | Buffer) => Promise<void>;
36
+ putJson: (key: string, value: unknown) => Promise<{
37
+ success: boolean;
38
+ error?: undefined;
39
+ } | {
40
+ success: boolean;
41
+ error: Error;
42
+ }>;
43
+ get: (key: string) => Promise<Buffer<ArrayBufferLike> | undefined>;
44
+ getJson: <T = unknown>(key: string, options?: import("@/utils/helpers/cache").CacheGetJsonOptions<T>) => Promise<T | undefined>;
45
+ };
46
+ self: {
47
+ pkg: {
48
+ load: () => Promise<any>;
49
+ };
50
+ };
51
+ buildInfo: {
52
+ load: () => Promise<import("../types/build-info").BuildInfo>;
53
+ };
54
+ manifest: {
55
+ hasFile: () => Promise<import("@/utils/helpers/manifest").ManifestHelperFunction_hasFileResult>;
56
+ loadFile: (file?: import("@/utils/helpers/manifest").ManifestHelperFunction_hasFileFile) => Promise<import("@/utils/helpers/manifest").ManifestHelperFunction_loadFileResult>;
57
+ edit: (key: string[], value?: any) => Promise<void>;
58
+ draftCreate: () => Promise<{
59
+ has: true;
60
+ file?: import("@/utils/helpers/manifest").ManifestHelperFunction_hasFileFile;
61
+ content: import("../schema/manifest").ManifestSchemaType.zod;
62
+ }>;
63
+ draftEdit: (draft: import("../schema/manifest").ManifestSchemaType.zod, key: string[], value?: any) => Promise<string>;
64
+ draftSave: (file: import("@/utils/helpers/manifest").ManifestHelperFunction_hasFileFile, draft: import("../schema/manifest").ManifestSchemaType.zod) => Promise<void>;
65
+ };
66
+ registry: {
67
+ add: (domain: string, id: string, _format?: string) => Promise<void>;
68
+ remove: (id: string) => Promise<void>;
69
+ import: (url: string) => Promise<void>;
70
+ };
71
+ };
72
+ export default helper;
73
+ //# sourceMappingURL=helper.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"helper.d.ts","sourceRoot":"","sources":["../../src/utils/helper.ts"],"names":[],"mappings":"AAYA;;GAEG;AACH,QAAA,MAAM,MAAM;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAYX,CAAC;AAEF,eAAe,MAAM,CAAC"}
@@ -0,0 +1,6 @@
1
+ import { BuildInfo } from "@/types/build-info";
2
+ declare const _helperBuildInfoFunction: {
3
+ load: () => Promise<BuildInfo>;
4
+ };
5
+ export default _helperBuildInfoFunction;
6
+ //# sourceMappingURL=build-info.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"build-info.d.ts","sourceRoot":"","sources":["../../../src/utils/helpers/build-info.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,SAAS,EAAE,MAAM,oBAAoB,CAAC;AA0B/C,QAAA,MAAM,wBAAwB;gBAvBc,OAAO,CAAC,SAAS,CAAC;CAyB7D,CAAC;AACF,eAAe,wBAAwB,CAAC"}
@@ -0,0 +1,23 @@
1
+ import cacache from "cacache";
2
+ import { type ZodSchema } from "zod";
3
+ type ValidatorFunction<T> = (data: unknown) => data is T;
4
+ type ValidationSchema<T> = ZodSchema<T> | ValidatorFunction<T>;
5
+ export interface CacheGetJsonOptions<T> {
6
+ schema?: ValidationSchema<T>;
7
+ }
8
+ declare const _helperCacheFunction: {
9
+ ls: () => Promise<cacache.ls.Cache | undefined>;
10
+ clear: () => Promise<void>;
11
+ put: (key: string, data: string | Buffer) => Promise<void>;
12
+ putJson: (key: string, value: unknown) => Promise<{
13
+ success: boolean;
14
+ error?: undefined;
15
+ } | {
16
+ success: boolean;
17
+ error: Error;
18
+ }>;
19
+ get: (key: string) => Promise<Buffer<ArrayBufferLike> | undefined>;
20
+ getJson: <T = unknown>(key: string, options?: CacheGetJsonOptions<T>) => Promise<T | undefined>;
21
+ };
22
+ export default _helperCacheFunction;
23
+ //# sourceMappingURL=cache.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"cache.d.ts","sourceRoot":"","sources":["../../../src/utils/helpers/cache.ts"],"names":[],"mappings":"AACA,OAAO,OAAO,MAAM,SAAS,CAAC;AAC9B,OAAO,EAAE,KAAK,SAAS,EAAE,MAAM,KAAK,CAAC;AAIrC,KAAK,iBAAiB,CAAC,CAAC,IAAI,CAAC,IAAI,EAAE,OAAO,KAAK,IAAI,IAAI,CAAC,CAAC;AAEzD,KAAK,gBAAgB,CAAC,CAAC,IAAI,SAAS,CAAC,CAAC,CAAC,GAAG,iBAAiB,CAAC,CAAC,CAAC,CAAC;AAE/D,MAAM,WAAW,mBAAmB,CAAC,CAAC;IACpC,MAAM,CAAC,EAAE,gBAAgB,CAAC,CAAC,CAAC,CAAC;CAC9B;AAmGD,QAAA,MAAM,oBAAoB;;;eAhFe,MAAM,QAAQ,MAAM,GAAG,MAAM;mBASzB,MAAM,SAAS,OAAO;;;;;eAW7C,KAAK;;eAKc,MAAM;cAUP,CAAC,iBAClC,MAAM,YACD,mBAAmB,CAAC,CAAC,CAAC,KAC/B,OAAO,CAAC,CAAC,GAAG,SAAS,CAAC;CAiDxB,CAAC;AAEF,eAAe,oBAAoB,CAAC"}
@@ -0,0 +1,11 @@
1
+ import { homedir } from "os";
2
+ declare const _helperDirFunction: {
3
+ filename: string;
4
+ dirname: string;
5
+ cwd: () => string;
6
+ selfroot: () => Promise<string | undefined>;
7
+ userRoot: typeof homedir;
8
+ userhmpactRoot: string;
9
+ };
10
+ export default _helperDirFunction;
11
+ //# sourceMappingURL=dir.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"dir.d.ts","sourceRoot":"","sources":["../../../src/utils/helpers/dir.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,OAAO,EAAE,MAAM,IAAI,CAAC;AAsD7B,QAAA,MAAM,kBAAkB;;;eA1CO,MAAM;;;;CAiDpC,CAAC;AAEF,eAAe,kBAAkB,CAAC"}
@@ -0,0 +1,3 @@
1
+ declare const _helperFetcherFunction: (url: string) => Promise<unknown>;
2
+ export default _helperFetcherFunction;
3
+ //# sourceMappingURL=fetcher.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"fetcher.d.ts","sourceRoot":"","sources":["../../../src/utils/helpers/fetcher.ts"],"names":[],"mappings":"AAOA,QAAA,MAAM,sBAAsB,QALM,MAAM,qBAKU,CAAC;AAEnD,eAAe,sBAAsB,CAAC"}
@@ -0,0 +1,17 @@
1
+ import { ZodSchema } from "zod";
2
+ type ValidatorFunction<T> = (data: unknown) => data is T;
3
+ type ValidationSchema<T> = ZodSchema<T> | ValidatorFunction<T>;
4
+ export interface GetJsoncOptions<T> {
5
+ schema?: ValidationSchema<T>;
6
+ }
7
+ export interface __helperGetJsoncByPathFuncResponse<T = unknown> {
8
+ status: "success" | "not_found" | "error" | "validation_failed";
9
+ message?: string;
10
+ data?: T;
11
+ error?: unknown;
12
+ }
13
+ declare const _helperJsoncFunction: {
14
+ getJsoncByPath: <T = unknown>(path: string, options?: GetJsoncOptions<T>) => Promise<__helperGetJsoncByPathFuncResponse<T>>;
15
+ };
16
+ export default _helperJsoncFunction;
17
+ //# sourceMappingURL=jsonc.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"jsonc.d.ts","sourceRoot":"","sources":["../../../src/utils/helpers/jsonc.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,SAAS,EAAE,MAAM,KAAK,CAAC;AAEhC,KAAK,iBAAiB,CAAC,CAAC,IAAI,CAAC,IAAI,EAAE,OAAO,KAAK,IAAI,IAAI,CAAC,CAAC;AAEzD,KAAK,gBAAgB,CAAC,CAAC,IAAI,SAAS,CAAC,CAAC,CAAC,GAAG,iBAAiB,CAAC,CAAC,CAAC,CAAC;AAE/D,MAAM,WAAW,eAAe,CAAC,CAAC;IAChC,MAAM,CAAC,EAAE,gBAAgB,CAAC,CAAC,CAAC,CAAC;CAC9B;AAED,MAAM,WAAW,kCAAkC,CAAC,CAAC,GAAG,OAAO;IAC7D,MAAM,EAAE,SAAS,GAAG,WAAW,GAAG,OAAO,GAAG,mBAAmB,CAAC;IAChE,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,IAAI,CAAC,EAAE,CAAC,CAAC;IACT,KAAK,CAAC,EAAE,OAAO,CAAC;CACjB;AAkED,QAAA,MAAM,oBAAoB;qBAhEgB,CAAC,kBACnC,MAAM,YACF,eAAe,CAAC,CAAC,CAAC,KAC3B,OAAO,CAAC,kCAAkC,CAAC,CAAC,CAAC,CAAC;CA+DhD,CAAC;AAEF,eAAe,oBAAoB,CAAC"}
@@ -0,0 +1,7 @@
1
+ import { type ManifestSchemaType } from "@/schema/manifest";
2
+ declare const _helperLangFunction: {
3
+ init: () => Promise<void>;
4
+ downloads: (content: ManifestSchemaType.zod) => Promise<void>;
5
+ };
6
+ export default _helperLangFunction;
7
+ //# sourceMappingURL=lang.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"lang.d.ts","sourceRoot":"","sources":["../../../src/utils/helpers/lang.ts"],"names":[],"mappings":"AAMA,OAAO,EAAE,KAAK,kBAAkB,EAAE,MAAM,mBAAmB,CAAC;AA4H5D,QAAA,MAAM,mBAAmB;;yBA3GyB,kBAAkB,CAAC,GAAG;CA8GvE,CAAC;AAEF,eAAe,mBAAmB,CAAC"}
@@ -0,0 +1,32 @@
1
+ import { type ManifestSchemaType } from "@/schema/manifest";
2
+ export interface ManifestHelperFunction_hasFileFile {
3
+ path: string;
4
+ fullname: string;
5
+ name: string;
6
+ ext: string;
7
+ }
8
+ export interface ManifestHelperFunction_hasFileResult {
9
+ has: boolean;
10
+ file?: ManifestHelperFunction_hasFileFile;
11
+ }
12
+ export type ManifestHelperFunction_loadFileResult = {
13
+ has: true;
14
+ file?: ManifestHelperFunction_hasFileFile;
15
+ content: ManifestSchemaType.zod;
16
+ } | {
17
+ has: false;
18
+ };
19
+ declare const _helperManifestFunction: {
20
+ hasFile: () => Promise<ManifestHelperFunction_hasFileResult>;
21
+ loadFile: (file?: ManifestHelperFunction_hasFileFile) => Promise<ManifestHelperFunction_loadFileResult>;
22
+ edit: (key: string[], value?: any) => Promise<void>;
23
+ draftCreate: () => Promise<{
24
+ has: true;
25
+ file?: ManifestHelperFunction_hasFileFile;
26
+ content: ManifestSchemaType.zod;
27
+ }>;
28
+ draftEdit: (draft: ManifestSchemaType.zod, key: string[], value?: any) => Promise<string>;
29
+ draftSave: (file: ManifestHelperFunction_hasFileFile, draft: ManifestSchemaType.zod) => Promise<void>;
30
+ };
31
+ export default _helperManifestFunction;
32
+ //# sourceMappingURL=manifest.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"manifest.d.ts","sourceRoot":"","sources":["../../../src/utils/helpers/manifest.ts"],"names":[],"mappings":"AAMA,OAAO,EAAE,KAAK,kBAAkB,EAAkB,MAAM,mBAAmB,CAAC;AAa5E,MAAM,WAAW,kCAAkC;IACjD,IAAI,EAAE,MAAM,CAAC;IACb,QAAQ,EAAE,MAAM,CAAC;IACjB,IAAI,EAAE,MAAM,CAAC;IACb,GAAG,EAAE,MAAM,CAAC;CACb;AAED,MAAM,WAAW,oCAAoC;IACnD,GAAG,EAAE,OAAO,CAAC;IACb,IAAI,CAAC,EAAE,kCAAkC,CAAC;CAC3C;AAuCD,MAAM,MAAM,qCAAqC,GAC7C;IACE,GAAG,EAAE,IAAI,CAAC;IACV,IAAI,CAAC,EAAE,kCAAkC,CAAC;IAC1C,OAAO,EAAE,kBAAkB,CAAC,GAAG,CAAC;CACjC,GACD;IACE,GAAG,EAAE,KAAK,CAAC;CACZ,CAAC;AA4HN,QAAA,MAAM,uBAAuB;mBArKjB,OAAO,CAAC,oCAAoC,CAAC;sBAiDhD,kCAAkC,KACxC,OAAO,CAAC,qCAAqC,CAAC;gBAwDJ,MAAM,EAAE,UAAU,GAAG;;aAvEvD,IAAI;eACF,kCAAkC;iBAChC,kBAAkB,CAAC,GAAG;;uBAkG5B,kBAAkB,CAAC,GAAG,OACxB,MAAM,EAAE,UACL,GAAG;sBAeL,kCAAkC,SACjC,kBAAkB,CAAC,GAAG;CAmB9B,CAAC;AAEF,eAAe,uBAAuB,CAAC"}
@@ -0,0 +1,7 @@
1
+ declare const _helperRegistryFunction: {
2
+ add: (domain: string, id: string, _format?: string) => Promise<void>;
3
+ remove: (id: string) => Promise<void>;
4
+ import: (url: string) => Promise<void>;
5
+ };
6
+ export default _helperRegistryFunction;
7
+ //# sourceMappingURL=registry.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"registry.d.ts","sourceRoot":"","sources":["../../../src/utils/helpers/registry.ts"],"names":[],"mappings":"AA0JA,QAAA,MAAM,uBAAuB;kBAnJnB,MAAM,MACV,MAAM,YACA,MAAM;iBAa4B,MAAM;kBAQL,MAAM;CAgIpD,CAAC;AAEF,eAAe,uBAAuB,CAAC"}
@@ -0,0 +1,6 @@
1
+ import z from "zod";
2
+ declare const _helperSchemaFunction: {
3
+ safeCheck: <T>(data: any, schema: z.ZodType<T>) => Promise<z.ZodSafeParseResult<T>>;
4
+ };
5
+ export default _helperSchemaFunction;
6
+ //# sourceMappingURL=schema.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"schema.d.ts","sourceRoot":"","sources":["../../../src/utils/helpers/schema.ts"],"names":[],"mappings":"AAAA,OAAO,CAAC,MAAM,KAAK,CAAC;AAepB,QAAA,MAAM,qBAAqB;gBAbgB,CAAC,QACpC,GAAG,UACD,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,KACnB,OAAO,CAAC,CAAC,CAAC,kBAAkB,CAAC,CAAC,CAAC,CAAC;CAYlC,CAAC;AAEF,eAAe,qBAAqB,CAAC"}
@@ -0,0 +1,7 @@
1
+ declare const _helperSelfFunction: {
2
+ pkg: {
3
+ load: () => Promise<any>;
4
+ };
5
+ };
6
+ export default _helperSelfFunction;
7
+ //# sourceMappingURL=self.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"self.d.ts","sourceRoot":"","sources":["../../../src/utils/helpers/self.ts"],"names":[],"mappings":"AAqBA,QAAA,MAAM,mBAAmB;;;;CAIxB,CAAC;AAEF,eAAe,mBAAmB,CAAC"}
@@ -0,0 +1,10 @@
1
+ declare const _helperUserConfigFunction: {
2
+ get: () => Promise<import("@/utils/helpers/jsonc").__helperGetJsoncByPathFuncResponse<{
3
+ lang: {
4
+ default: string;
5
+ packs: Record<string, Record<string, string>>;
6
+ };
7
+ }> | null>;
8
+ };
9
+ export default _helperUserConfigFunction;
10
+ //# sourceMappingURL=user-config.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"user-config.d.ts","sourceRoot":"","sources":["../../../src/utils/helpers/user-config.ts"],"names":[],"mappings":"AA2BA,QAAA,MAAM,yBAAyB;;;;;;;CAE9B,CAAC;AAEF,eAAe,yBAAyB,CAAC"}
package/package.json ADDED
@@ -0,0 +1,67 @@
1
+ {
2
+ "name": "@hmpact/core",
3
+ "type": "module",
4
+ "version": "0.0.1-beta.1",
5
+ "description": "",
6
+ "author": "toakiryu <toakiryu@gmail.com>",
7
+ "license": "MIT",
8
+ "keywords": [
9
+ "cli",
10
+ "tool"
11
+ ],
12
+ "repository": {
13
+ "type": "git",
14
+ "url": "git+https://github.com/toakiryu/hmpact.git",
15
+ "directory": "packages/core"
16
+ },
17
+ "bugs": {
18
+ "url": "https://github.com/toakiryu/hmpact/issues"
19
+ },
20
+ "files": [
21
+ "dist",
22
+ "build-info.json"
23
+ ],
24
+ "main": "./dist/index.mjs",
25
+ "types": "./dist/index.d.ts",
26
+ "exports": {
27
+ ".": {
28
+ "types": "./dist/index.d.ts",
29
+ "import": "./dist/index.mjs"
30
+ }
31
+ },
32
+ "dependencies": {
33
+ "cacache": "^20.0.3",
34
+ "chalk": "^5.6.2",
35
+ "commander": "^14.0.2",
36
+ "deepmerge": "^4.3.1",
37
+ "figlet": "^1.9.4",
38
+ "gradient-string": "^3.0.0",
39
+ "isomorphic-unfetch": "^4.0.2",
40
+ "jsonc-parser": "^3.3.1",
41
+ "ora": "^9.0.0",
42
+ "zod": "^4.1.13",
43
+ "@hmpact/logger": "^0.0.1-beta.1"
44
+ },
45
+ "devDependencies": {
46
+ "@types/cacache": "^20.0.0",
47
+ "@types/figlet": "^1.7.0",
48
+ "@types/node": "^24.10.1",
49
+ "@typescript-eslint/parser": "^8.52.0",
50
+ "esbuild": "^0.27.1",
51
+ "eslint": "^9.39.1",
52
+ "glob": "^11.0.0",
53
+ "prettier": "^3.7.4",
54
+ "tsc-alias": "^1.8.16",
55
+ "tsx": "^4.21.0",
56
+ "typescript": "^5.9.3"
57
+ },
58
+ "scripts": {
59
+ "test": "echo \"Error: no test specified\" && exit 1",
60
+ "build": "pnpm build:info && node ../../.scripts/build-esbuild.js",
61
+ "build:info": "node ../../.scripts/build-info.js",
62
+ "typecheck": "tsc --noEmit",
63
+ "t:pack": "pnpm pack",
64
+ "lint": "eslint",
65
+ "format": "prettier --write ."
66
+ }
67
+ }