@latticexyz/abi-ts 2.0.12 → 2.0.13-account-kit-817df9903
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/abi-ts.js +1 -1
- package/dist/chunk-EKGXNXNJ.js +3 -0
- package/dist/chunk-EKGXNXNJ.js.map +1 -0
- package/dist/index.js +1 -1
- package/package.json +2 -3
- package/dist/chunk-6Q43RSOM.js +0 -3
- package/dist/chunk-6Q43RSOM.js.map +0 -1
package/dist/abi-ts.js
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
import{a as r}from"./chunk-
|
|
2
|
+
import{a as r}from"./chunk-EKGXNXNJ.js";import e from"yargs";import{hideBin as i}from"yargs/helpers";import o from"chalk";r.command="$0";e(i(process.argv)).scriptName("abi-ts").command(r).strict().fail(a=>{console.error(o.red(a)),a.includes("Missing required argument")&&console.log(o.yellow(`Run 'pnpm abi-ts ${process.argv[2]} --help' for a list of available and required arguments.`)),process.exit(1)}).alias({h:"help"}).argv;
|
|
3
3
|
//# sourceMappingURL=abi-ts.js.map
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import{readFileSync as d,writeFileSync as f}from"fs";import{globSync as p}from"glob";import s from"debug";var e=s("abi-ts"),c=s("abi-ts");e.log=console.debug.bind(console);c.log=console.error.bind(console);var a={command:"abi-ts",describe:"Convert a directory of JSON ABI files to a directory of TS files with `as const`",builder(o){return o.options({input:{type:"string",desc:"Input glob of ABI JSON files",default:"**/*.abi.json"}})},handler({input:o}){let n=p(o).sort();n.length||(console.error(`No files found for glob: ${o}`),process.exit(1));for(let t of n){let r=d(t,"utf8").trim();if(r==="[]"){e("Skipping empty ABI file",t);continue}let l=`declare const abi: ${r}; export default abi;
|
|
2
|
+
`,i=`${t}.d.ts`;e("Writing",i),f(i,l)}process.exit(0)}},S=a;export{S as a};
|
|
3
|
+
//# sourceMappingURL=chunk-EKGXNXNJ.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/index.ts","../src/debug.ts"],"sourcesContent":["import type { CommandModule } from \"yargs\";\nimport { readFileSync, writeFileSync } from \"fs\";\nimport { globSync } from \"glob\";\nimport { debug } from \"./debug\";\n\ntype Options = {\n input: string;\n output: string;\n};\n\nconst commandModule: CommandModule<Options, Options> = {\n command: \"abi-ts\",\n\n describe: \"Convert a directory of JSON ABI files to a directory of TS files with `as const`\",\n\n builder(yargs) {\n return yargs.options({\n input: {\n type: \"string\",\n desc: \"Input glob of ABI JSON files\",\n default: \"**/*.abi.json\",\n },\n });\n },\n\n handler({ input }) {\n const files = globSync(input).sort();\n\n if (!files.length) {\n console.error(`No files found for glob: ${input}`);\n process.exit(1);\n }\n\n for (const jsonFilename of files) {\n const json = readFileSync(jsonFilename, \"utf8\").trim();\n if (json === \"[]\") {\n debug(\"Skipping empty ABI file\", jsonFilename);\n continue;\n }\n\n const ts = `declare const abi: ${json}; export default abi;\\n`;\n const tsFilename = `${jsonFilename}.d.ts`;\n\n debug(\"Writing\", tsFilename);\n writeFileSync(tsFilename, ts);\n }\n\n process.exit(0);\n },\n};\n\nexport default commandModule;\n","import createDebug from \"debug\";\n\nexport const debug = createDebug(\"abi-ts\");\nexport const error = createDebug(\"abi-ts\");\n\n// Pipe debug output to stdout instead of stderr\ndebug.log = console.debug.bind(console);\n\n// Pipe error output to stderr\nerror.log = console.error.bind(console);\n"],"mappings":"AACA,OAAS,gBAAAA,EAAc,iBAAAC,MAAqB,KAC5C,OAAS,YAAAC,MAAgB,OCFzB,OAAOC,MAAiB,QAEjB,IAAMC,EAAQD,EAAY,QAAQ,EAC5BE,EAAQF,EAAY,QAAQ,EAGzCC,EAAM,IAAM,QAAQ,MAAM,KAAK,OAAO,EAGtCC,EAAM,IAAM,QAAQ,MAAM,KAAK,OAAO,EDCtC,IAAMC,EAAiD,CACrD,QAAS,SAET,SAAU,mFAEV,QAAQC,EAAO,CACb,OAAOA,EAAM,QAAQ,CACnB,MAAO,CACL,KAAM,SACN,KAAM,+BACN,QAAS,eACX,CACF,CAAC,CACH,EAEA,QAAQ,CAAE,MAAAC,CAAM,EAAG,CACjB,IAAMC,EAAQC,EAASF,CAAK,EAAE,KAAK,EAE9BC,EAAM,SACT,QAAQ,MAAM,4BAA4BD,GAAO,EACjD,QAAQ,KAAK,CAAC,GAGhB,QAAWG,KAAgBF,EAAO,CAChC,IAAMG,EAAOC,EAAaF,EAAc,MAAM,EAAE,KAAK,EACrD,GAAIC,IAAS,KAAM,CACjBE,EAAM,0BAA2BH,CAAY,EAC7C,SAGF,IAAMI,EAAK,sBAAsBH;AAAA,EAC3BI,EAAa,GAAGL,SAEtBG,EAAM,UAAWE,CAAU,EAC3BC,EAAcD,EAAYD,CAAE,EAG9B,QAAQ,KAAK,CAAC,CAChB,CACF,EAEOG,EAAQZ","names":["readFileSync","writeFileSync","globSync","createDebug","debug","error","commandModule","yargs","input","files","globSync","jsonFilename","json","readFileSync","debug","ts","tsFilename","writeFileSync","src_default"]}
|
package/dist/index.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{a}from"./chunk-
|
|
1
|
+
import{a}from"./chunk-EKGXNXNJ.js";export{a as default};
|
|
2
2
|
//# sourceMappingURL=index.js.map
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@latticexyz/abi-ts",
|
|
3
|
-
"version": "2.0.
|
|
3
|
+
"version": "2.0.13-account-kit-817df9903",
|
|
4
4
|
"description": "Create TypeScript type declaration files (`.d.ts`) for your ABI JSON files.",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -29,12 +29,11 @@
|
|
|
29
29
|
"chalk": "^5.3.0",
|
|
30
30
|
"debug": "^4.3.4",
|
|
31
31
|
"execa": "^7.0.0",
|
|
32
|
-
"glob": "^
|
|
32
|
+
"glob": "^10.4.2",
|
|
33
33
|
"yargs": "^17.7.1"
|
|
34
34
|
},
|
|
35
35
|
"devDependencies": {
|
|
36
36
|
"@types/debug": "^4.1.7",
|
|
37
|
-
"@types/glob": "^7.2.0",
|
|
38
37
|
"@types/node": "^18.15.11",
|
|
39
38
|
"@types/yargs": "^17.0.10",
|
|
40
39
|
"tsup": "^6.7.0",
|
package/dist/chunk-6Q43RSOM.js
DELETED
|
@@ -1,3 +0,0 @@
|
|
|
1
|
-
import{readFileSync as d,writeFileSync as f}from"fs";import p from"glob";import s from"debug";var e=s("abi-ts"),c=s("abi-ts");e.log=console.debug.bind(console);c.log=console.error.bind(console);var a={command:"abi-ts",describe:"Convert a directory of JSON ABI files to a directory of TS files with `as const`",builder(o){return o.options({input:{type:"string",desc:"Input glob of ABI JSON files",default:"**/*.abi.json"}})},handler({input:o}){let n=p.sync(o);n.length||(console.error(`No files found for glob: ${o}`),process.exit(1));for(let t of n){let i=d(t,"utf8").trim();if(i==="[]"){e("Skipping empty ABI file",t);continue}let l=`declare const abi: ${i}; export default abi;
|
|
2
|
-
`,r=`${t}.d.ts`;e("Writing",r),f(r,l)}process.exit(0)}},x=a;export{x as a};
|
|
3
|
-
//# sourceMappingURL=chunk-6Q43RSOM.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/index.ts","../src/debug.ts"],"sourcesContent":["import type { CommandModule } from \"yargs\";\nimport { readFileSync, writeFileSync } from \"fs\";\nimport glob from \"glob\";\nimport { debug } from \"./debug\";\n\ntype Options = {\n input: string;\n output: string;\n};\n\nconst commandModule: CommandModule<Options, Options> = {\n command: \"abi-ts\",\n\n describe: \"Convert a directory of JSON ABI files to a directory of TS files with `as const`\",\n\n builder(yargs) {\n return yargs.options({\n input: {\n type: \"string\",\n desc: \"Input glob of ABI JSON files\",\n default: \"**/*.abi.json\",\n },\n });\n },\n\n handler({ input }) {\n const files = glob.sync(input);\n\n if (!files.length) {\n console.error(`No files found for glob: ${input}`);\n process.exit(1);\n }\n\n for (const jsonFilename of files) {\n const json = readFileSync(jsonFilename, \"utf8\").trim();\n if (json === \"[]\") {\n debug(\"Skipping empty ABI file\", jsonFilename);\n continue;\n }\n\n const ts = `declare const abi: ${json}; export default abi;\\n`;\n const tsFilename = `${jsonFilename}.d.ts`;\n\n debug(\"Writing\", tsFilename);\n writeFileSync(tsFilename, ts);\n }\n\n process.exit(0);\n },\n};\n\nexport default commandModule;\n","import createDebug from \"debug\";\n\nexport const debug = createDebug(\"abi-ts\");\nexport const error = createDebug(\"abi-ts\");\n\n// Pipe debug output to stdout instead of stderr\ndebug.log = console.debug.bind(console);\n\n// Pipe error output to stderr\nerror.log = console.error.bind(console);\n"],"mappings":"AACA,OAAS,gBAAAA,EAAc,iBAAAC,MAAqB,KAC5C,OAAOC,MAAU,OCFjB,OAAOC,MAAiB,QAEjB,IAAMC,EAAQD,EAAY,QAAQ,EAC5BE,EAAQF,EAAY,QAAQ,EAGzCC,EAAM,IAAM,QAAQ,MAAM,KAAK,OAAO,EAGtCC,EAAM,IAAM,QAAQ,MAAM,KAAK,OAAO,EDCtC,IAAMC,EAAiD,CACrD,QAAS,SAET,SAAU,mFAEV,QAAQC,EAAO,CACb,OAAOA,EAAM,QAAQ,CACnB,MAAO,CACL,KAAM,SACN,KAAM,+BACN,QAAS,eACX,CACF,CAAC,CACH,EAEA,QAAQ,CAAE,MAAAC,CAAM,EAAG,CACjB,IAAMC,EAAQC,EAAK,KAAKF,CAAK,EAExBC,EAAM,SACT,QAAQ,MAAM,4BAA4BD,GAAO,EACjD,QAAQ,KAAK,CAAC,GAGhB,QAAWG,KAAgBF,EAAO,CAChC,IAAMG,EAAOC,EAAaF,EAAc,MAAM,EAAE,KAAK,EACrD,GAAIC,IAAS,KAAM,CACjBE,EAAM,0BAA2BH,CAAY,EAC7C,SAGF,IAAMI,EAAK,sBAAsBH;AAAA,EAC3BI,EAAa,GAAGL,SAEtBG,EAAM,UAAWE,CAAU,EAC3BC,EAAcD,EAAYD,CAAE,EAG9B,QAAQ,KAAK,CAAC,CAChB,CACF,EAEOG,EAAQZ","names":["readFileSync","writeFileSync","glob","createDebug","debug","error","commandModule","yargs","input","files","glob","jsonFilename","json","readFileSync","debug","ts","tsFilename","writeFileSync","src_default"]}
|