just-binary 2.9.8 → 2.9.9
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/bin/chunks/base64-XCZKQZ7Z.js +2 -0
- package/dist/bin/chunks/chunk-RUESYAVK.js +2 -0
- package/dist/bin/chunks/chunk-S23TISYL.js +6 -0
- package/dist/bin/{shell/chunks/chunk-CRHN4WNQ.js → chunks/chunk-ZD5OTNAU.js} +17 -17
- package/dist/bin/{shell/chunks/flag-coverage-DBKGNLJO.js → chunks/flag-coverage-RODPAQVH.js} +1 -1
- package/dist/bin/chunks/tar-IQNZQP7E.js +2 -0
- package/dist/bin/just-bash.js +97 -97
- package/dist/bin/shell/chunks/base64-XCZKQZ7Z.js +2 -0
- package/dist/bin/shell/chunks/chunk-RUESYAVK.js +2 -0
- package/dist/bin/shell/chunks/chunk-S23TISYL.js +6 -0
- package/dist/bin/{chunks/chunk-CRHN4WNQ.js → shell/chunks/chunk-ZD5OTNAU.js} +17 -17
- package/dist/bin/{chunks/flag-coverage-DBKGNLJO.js → shell/chunks/flag-coverage-RODPAQVH.js} +1 -1
- package/dist/bin/shell/chunks/tar-IQNZQP7E.js +2 -0
- package/dist/bin/shell/shell.js +97 -97
- package/dist/bundle/browser.js +426 -426
- package/dist/bundle/chunks/base64-5E5MPPWD.js +1 -0
- package/dist/bundle/chunks/chunk-DQTFPKDH.js +5 -0
- package/dist/bundle/chunks/chunk-MIFIRXNI.js +1 -0
- package/dist/bundle/chunks/{chunk-3OY3UJDR.js → chunk-ZCZOV2DS.js} +17 -17
- package/dist/bundle/chunks/{flag-coverage-FMTW4YWD.js → flag-coverage-LGRO7HFL.js} +1 -1
- package/dist/bundle/chunks/tar-K64VDNWF.js +1 -0
- package/dist/bundle/index.js +96 -96
- package/dist/utils/binary-string.d.ts +1 -0
- package/package.json +31 -29
- package/dist/bin/chunks/base64-DNX4WCIO.js +0 -2
- package/dist/bin/chunks/chunk-6CZOPIZD.js +0 -6
- package/dist/bin/chunks/tar-2UVSVD3P.js +0 -2
- package/dist/bin/shell/chunks/base64-DNX4WCIO.js +0 -2
- package/dist/bin/shell/chunks/chunk-6CZOPIZD.js +0 -6
- package/dist/bin/shell/chunks/tar-2UVSVD3P.js +0 -2
- package/dist/bundle/chunks/base64-RY5JPAQL.js +0 -1
- package/dist/bundle/chunks/chunk-N4GRDEVJ.js +0 -5
- package/dist/bundle/chunks/tar-7KN7KZ6S.js +0 -1
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function uint8ToBinaryString(bytes: Uint8Array): string;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "just-binary",
|
|
3
|
-
"version": "2.9.
|
|
3
|
+
"version": "2.9.9",
|
|
4
4
|
"description": "A simulated bash environment with virtual filesystem",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -46,6 +46,34 @@
|
|
|
46
46
|
"publishConfig": {
|
|
47
47
|
"access": "public"
|
|
48
48
|
},
|
|
49
|
+
"scripts": {
|
|
50
|
+
"prepack": "pnpm build",
|
|
51
|
+
"build": "rm -rf dist && tsc && pnpm build:lib && pnpm build:browser && pnpm build:cli && pnpm build:shell && pnpm build:worker && pnpm build:clean && sed '1,/^-->/d' AGENTS.npm.md > dist/AGENTS.md",
|
|
52
|
+
"build:clean": "find dist -name '*.test.js' -delete && find dist -name '*.test.d.ts' -delete",
|
|
53
|
+
"build:worker": "esbuild src/commands/python3/worker.ts --bundle --platform=node --format=esm --outfile=src/commands/python3/worker.js --external:pyodide && cp src/commands/python3/worker.js dist/commands/python3/worker.js && mkdir -p dist/bin/chunks && cp src/commands/python3/worker.js dist/bin/chunks/worker.js && mkdir -p dist/bundle/chunks && cp src/commands/python3/worker.js dist/bundle/chunks/worker.js",
|
|
54
|
+
"build:lib": "esbuild dist/index.js --bundle --splitting --platform=node --format=esm --minify --outdir=dist/bundle --chunk-names=chunks/[name]-[hash] --external:diff --external:minimatch --external:sprintf-js --external:turndown --external:sql.js --external:pyodide --external:@mongodb-js/zstd --external:node-liblzma --external:compressjs",
|
|
55
|
+
"build:browser": "esbuild dist/browser.js --bundle --platform=browser --format=esm --minify --outfile=dist/bundle/browser.js --external:diff --external:minimatch --external:sprintf-js --external:turndown --external:node:* --external:@mongodb-js/zstd --external:node-liblzma --external:compressjs --define:__BROWSER__=true",
|
|
56
|
+
"build:cli": "esbuild dist/cli/just-bash.js --bundle --splitting --platform=node --format=esm --minify --outdir=dist/bin --entry-names=[name] --chunk-names=chunks/[name]-[hash] --banner:js='#!/usr/bin/env node' --external:sql.js --external:pyodide --external:@mongodb-js/zstd --external:node-liblzma --external:compressjs",
|
|
57
|
+
"build:shell": "esbuild dist/cli/shell.js --bundle --splitting --platform=node --format=esm --minify --outdir=dist/bin/shell --entry-names=[name] --chunk-names=chunks/[name]-[hash] --banner:js='#!/usr/bin/env node' --external:sql.js --external:pyodide --external:@mongodb-js/zstd --external:node-liblzma --external:compressjs",
|
|
58
|
+
"prepublishOnly": "pnpm validate",
|
|
59
|
+
"validate": "pnpm lint && pnpm knip && pnpm typecheck && pnpm build && pnpm test:run && pnpm test:dist",
|
|
60
|
+
"typecheck": "tsc --noEmit",
|
|
61
|
+
"lint": "biome check .",
|
|
62
|
+
"lint:fix": "biome check --write .",
|
|
63
|
+
"knip": "knip",
|
|
64
|
+
"test": "vitest",
|
|
65
|
+
"test:run": "vitest run --exclude src/security/fuzzing/",
|
|
66
|
+
"test:dist": "vitest run src/cli/just-bash.bundle.test.ts",
|
|
67
|
+
"test:unit": "vitest run --config vitest.unit.config.ts",
|
|
68
|
+
"test:comparison": "vitest run --config vitest.comparison.config.ts",
|
|
69
|
+
"test:comparison:record": "RECORD_FIXTURES=1 vitest run --config vitest.comparison.config.ts",
|
|
70
|
+
"test:coverage": "vitest run --coverage",
|
|
71
|
+
"test:coverage:unit": "vitest run --config vitest.unit.config.ts --coverage",
|
|
72
|
+
"test:fuzz": "vitest run src/security/fuzzing/",
|
|
73
|
+
"test:fuzz:long": "FUZZ_RUNS=10000 vitest run src/security/fuzzing/",
|
|
74
|
+
"shell": "npx tsx src/cli/shell.ts",
|
|
75
|
+
"dev:exec": "npx tsx src/cli/exec.ts"
|
|
76
|
+
},
|
|
49
77
|
"keywords": [],
|
|
50
78
|
"author": "hinkik",
|
|
51
79
|
"license": "Apache-2.0",
|
|
@@ -85,31 +113,5 @@
|
|
|
85
113
|
"@mongodb-js/zstd": "^7.0.0",
|
|
86
114
|
"node-liblzma": "^2.0.3"
|
|
87
115
|
},
|
|
88
|
-
"packageManager": "pnpm@8.15.9+sha512.499434c9d8fdd1a2794ebf4552b3b25c0a633abcee5bb15e7b5de90f32f47b513aca98cd5cfd001c31f0db454bc3804edccd578501e4ca293a6816166bbd9f81"
|
|
89
|
-
|
|
90
|
-
"build": "rm -rf dist && tsc && pnpm build:lib && pnpm build:browser && pnpm build:cli && pnpm build:shell && pnpm build:worker && pnpm build:clean && sed '1,/^-->/d' AGENTS.npm.md > dist/AGENTS.md",
|
|
91
|
-
"build:clean": "find dist -name '*.test.js' -delete && find dist -name '*.test.d.ts' -delete",
|
|
92
|
-
"build:worker": "esbuild src/commands/python3/worker.ts --bundle --platform=node --format=esm --outfile=src/commands/python3/worker.js --external:pyodide && cp src/commands/python3/worker.js dist/commands/python3/worker.js && mkdir -p dist/bin/chunks && cp src/commands/python3/worker.js dist/bin/chunks/worker.js && mkdir -p dist/bundle/chunks && cp src/commands/python3/worker.js dist/bundle/chunks/worker.js",
|
|
93
|
-
"build:lib": "esbuild dist/index.js --bundle --splitting --platform=node --format=esm --minify --outdir=dist/bundle --chunk-names=chunks/[name]-[hash] --external:diff --external:minimatch --external:sprintf-js --external:turndown --external:sql.js --external:pyodide --external:@mongodb-js/zstd --external:node-liblzma --external:compressjs",
|
|
94
|
-
"build:browser": "esbuild dist/browser.js --bundle --platform=browser --format=esm --minify --outfile=dist/bundle/browser.js --external:diff --external:minimatch --external:sprintf-js --external:turndown --external:node:* --external:@mongodb-js/zstd --external:node-liblzma --external:compressjs --define:__BROWSER__=true",
|
|
95
|
-
"build:cli": "esbuild dist/cli/just-bash.js --bundle --splitting --platform=node --format=esm --minify --outdir=dist/bin --entry-names=[name] --chunk-names=chunks/[name]-[hash] --banner:js='#!/usr/bin/env node' --external:sql.js --external:pyodide --external:@mongodb-js/zstd --external:node-liblzma --external:compressjs",
|
|
96
|
-
"build:shell": "esbuild dist/cli/shell.js --bundle --splitting --platform=node --format=esm --minify --outdir=dist/bin/shell --entry-names=[name] --chunk-names=chunks/[name]-[hash] --banner:js='#!/usr/bin/env node' --external:sql.js --external:pyodide --external:@mongodb-js/zstd --external:node-liblzma --external:compressjs",
|
|
97
|
-
"validate": "pnpm lint && pnpm knip && pnpm typecheck && pnpm build && pnpm test:run && pnpm test:dist",
|
|
98
|
-
"typecheck": "tsc --noEmit",
|
|
99
|
-
"lint": "biome check .",
|
|
100
|
-
"lint:fix": "biome check --write .",
|
|
101
|
-
"knip": "knip",
|
|
102
|
-
"test": "vitest",
|
|
103
|
-
"test:run": "vitest run --exclude src/security/fuzzing/",
|
|
104
|
-
"test:dist": "vitest run src/cli/just-bash.bundle.test.ts",
|
|
105
|
-
"test:unit": "vitest run --config vitest.unit.config.ts",
|
|
106
|
-
"test:comparison": "vitest run --config vitest.comparison.config.ts",
|
|
107
|
-
"test:comparison:record": "RECORD_FIXTURES=1 vitest run --config vitest.comparison.config.ts",
|
|
108
|
-
"test:coverage": "vitest run --coverage",
|
|
109
|
-
"test:coverage:unit": "vitest run --config vitest.unit.config.ts --coverage",
|
|
110
|
-
"test:fuzz": "vitest run src/security/fuzzing/",
|
|
111
|
-
"test:fuzz:long": "FUZZ_RUNS=10000 vitest run src/security/fuzzing/",
|
|
112
|
-
"shell": "npx tsx src/cli/shell.ts",
|
|
113
|
-
"dev:exec": "npx tsx src/cli/exec.ts"
|
|
114
|
-
}
|
|
115
|
-
}
|
|
116
|
+
"packageManager": "pnpm@8.15.9+sha512.499434c9d8fdd1a2794ebf4552b3b25c0a633abcee5bb15e7b5de90f32f47b513aca98cd5cfd001c31f0db454bc3804edccd578501e4ca293a6816166bbd9f81"
|
|
117
|
+
}
|
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env node
|
|
2
|
-
import{a as m}from"./chunk-KFLJ4EMB.js";import{a as h,b}from"./chunk-227L3ACM.js";import{g as d,h as i,l as g}from"./chunk-RQSPCXDR.js";var B={name:"base64",summary:"base64 encode/decode data and print to standard output",usage:"base64 [OPTION]... [FILE]",options:["-d, --decode decode data","-w, --wrap=COLS wrap encoded lines after COLS character (default 76, 0 to disable)"," --help display this help and exit"]},F={decode:{short:"d",long:"decode",type:"boolean"},wrap:{short:"w",long:"wrap",type:"number",default:76}};async function y(n,a,c){if(a.length===0||a.length===1&&a[0]==="-")return{ok:!0,data:n.stdin};let r=[];for(let e of a){if(e==="-"){r.push(n.stdin);continue}try{let t=n.fs.resolvePath(n.cwd,e),o=await n.fs.readFileBuffer(t);r.push(o)}catch{return{ok:!1,error:{stdout:d,stderr:i(`${c}: ${e}: No such file or directory
|
|
3
|
-
`),exitCode:1}}}}let l=r.reduce((e,t)=>e+t.length,0),s=new Uint8Array(l),f=0;for(let e of r)s.set(e,f),f+=e.length;return{ok:!0,data:s}}var v={name:"base64",async execute(n,a){let c=g(n);if(b(c))return h(B);let r=m("base64",c,F);if(!r.ok)return r.error;let l=r.result.flags.decode,s=r.result.flags.wrap,f=r.result.positional;try{if(l){let o=await y(a,f,"base64");if(!o.ok)return o.error;if(typeof Buffer<"u"){let k=Buffer.from(o.data).toString("utf8").replace(/\s/g,""),p=Buffer.from(k,"base64");return{stdout:new Uint8Array(p.buffer,p.byteOffset,p.byteLength),stderr:d,exitCode:0}}let w=String.fromCharCode(...o.data).replace(/\s/g,""),C=atob(w);return{stdout:i(C),stderr:d,exitCode:0}}let e=await y(a,f,"base64");if(!e.ok)return e.error;let t;if(typeof Buffer<"u"?t=Buffer.from(e.data).toString("base64"):t=btoa(String.fromCharCode(...e.data)),s>0){let o=[];for(let u=0;u<t.length;u+=s)o.push(t.slice(u,u+s));t=o.join(`
|
|
4
|
-
`)+(t.length>0?`
|
|
5
|
-
`:"")}return{stdout:i(t),stderr:d,exitCode:0}}catch{return{stdout:d,stderr:i(`base64: invalid input
|
|
6
|
-
`),exitCode:1}}}},A={name:"base64",flags:[{flag:"-d",type:"boolean"},{flag:"-w",type:"value",valueHint:"number"}],stdinType:"text",needsFiles:!0};export{v as a,A as b};
|
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env node
|
|
2
|
-
import{a as m}from"./chunk-KFLJ4EMB.js";import{a as h,b}from"./chunk-227L3ACM.js";import{g as d,h as i,l as g}from"./chunk-RQSPCXDR.js";var B={name:"base64",summary:"base64 encode/decode data and print to standard output",usage:"base64 [OPTION]... [FILE]",options:["-d, --decode decode data","-w, --wrap=COLS wrap encoded lines after COLS character (default 76, 0 to disable)"," --help display this help and exit"]},F={decode:{short:"d",long:"decode",type:"boolean"},wrap:{short:"w",long:"wrap",type:"number",default:76}};async function y(n,a,c){if(a.length===0||a.length===1&&a[0]==="-")return{ok:!0,data:n.stdin};let r=[];for(let e of a){if(e==="-"){r.push(n.stdin);continue}try{let t=n.fs.resolvePath(n.cwd,e),o=await n.fs.readFileBuffer(t);r.push(o)}catch{return{ok:!1,error:{stdout:d,stderr:i(`${c}: ${e}: No such file or directory
|
|
3
|
-
`),exitCode:1}}}}let l=r.reduce((e,t)=>e+t.length,0),s=new Uint8Array(l),f=0;for(let e of r)s.set(e,f),f+=e.length;return{ok:!0,data:s}}var v={name:"base64",async execute(n,a){let c=g(n);if(b(c))return h(B);let r=m("base64",c,F);if(!r.ok)return r.error;let l=r.result.flags.decode,s=r.result.flags.wrap,f=r.result.positional;try{if(l){let o=await y(a,f,"base64");if(!o.ok)return o.error;if(typeof Buffer<"u"){let k=Buffer.from(o.data).toString("utf8").replace(/\s/g,""),p=Buffer.from(k,"base64");return{stdout:new Uint8Array(p.buffer,p.byteOffset,p.byteLength),stderr:d,exitCode:0}}let w=String.fromCharCode(...o.data).replace(/\s/g,""),C=atob(w);return{stdout:i(C),stderr:d,exitCode:0}}let e=await y(a,f,"base64");if(!e.ok)return e.error;let t;if(typeof Buffer<"u"?t=Buffer.from(e.data).toString("base64"):t=btoa(String.fromCharCode(...e.data)),s>0){let o=[];for(let u=0;u<t.length;u+=s)o.push(t.slice(u,u+s));t=o.join(`
|
|
4
|
-
`)+(t.length>0?`
|
|
5
|
-
`:"")}return{stdout:i(t),stderr:d,exitCode:0}}catch{return{stdout:d,stderr:i(`base64: invalid input
|
|
6
|
-
`),exitCode:1}}}},A={name:"base64",flags:[{flag:"-d",type:"boolean"},{flag:"-w",type:"value",valueHint:"number"}],stdinType:"text",needsFiles:!0};export{v as a,A as b};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{a,b}from"./chunk-N4GRDEVJ.js";import"./chunk-OXRHP7HO.js";import"./chunk-KZ3P3SVS.js";import"./chunk-O7N2RCS7.js";export{a as base64Command,b as flagsForFuzzing};
|
|
@@ -1,5 +0,0 @@
|
|
|
1
|
-
import{a as m}from"./chunk-OXRHP7HO.js";import{a as h,b}from"./chunk-KZ3P3SVS.js";import{g as d,h as i,l as g}from"./chunk-O7N2RCS7.js";var B={name:"base64",summary:"base64 encode/decode data and print to standard output",usage:"base64 [OPTION]... [FILE]",options:["-d, --decode decode data","-w, --wrap=COLS wrap encoded lines after COLS character (default 76, 0 to disable)"," --help display this help and exit"]},F={decode:{short:"d",long:"decode",type:"boolean"},wrap:{short:"w",long:"wrap",type:"number",default:76}};async function y(n,a,c){if(a.length===0||a.length===1&&a[0]==="-")return{ok:!0,data:n.stdin};let r=[];for(let e of a){if(e==="-"){r.push(n.stdin);continue}try{let t=n.fs.resolvePath(n.cwd,e),o=await n.fs.readFileBuffer(t);r.push(o)}catch{return{ok:!1,error:{stdout:d,stderr:i(`${c}: ${e}: No such file or directory
|
|
2
|
-
`),exitCode:1}}}}let l=r.reduce((e,t)=>e+t.length,0),s=new Uint8Array(l),f=0;for(let e of r)s.set(e,f),f+=e.length;return{ok:!0,data:s}}var v={name:"base64",async execute(n,a){let c=g(n);if(b(c))return h(B);let r=m("base64",c,F);if(!r.ok)return r.error;let l=r.result.flags.decode,s=r.result.flags.wrap,f=r.result.positional;try{if(l){let o=await y(a,f,"base64");if(!o.ok)return o.error;if(typeof Buffer<"u"){let k=Buffer.from(o.data).toString("utf8").replace(/\s/g,""),p=Buffer.from(k,"base64");return{stdout:new Uint8Array(p.buffer,p.byteOffset,p.byteLength),stderr:d,exitCode:0}}let w=String.fromCharCode(...o.data).replace(/\s/g,""),C=atob(w);return{stdout:i(C),stderr:d,exitCode:0}}let e=await y(a,f,"base64");if(!e.ok)return e.error;let t;if(typeof Buffer<"u"?t=Buffer.from(e.data).toString("base64"):t=btoa(String.fromCharCode(...e.data)),s>0){let o=[];for(let u=0;u<t.length;u+=s)o.push(t.slice(u,u+s));t=o.join(`
|
|
3
|
-
`)+(t.length>0?`
|
|
4
|
-
`:"")}return{stdout:i(t),stderr:d,exitCode:0}}catch{return{stdout:d,stderr:i(`base64: invalid input
|
|
5
|
-
`),exitCode:1}}}},A={name:"base64",flags:[{flag:"-d",type:"boolean"},{flag:"-w",type:"value",valueHint:"number"}],stdinType:"text",needsFiles:!0};export{v as a,A as b};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{a,b}from"./chunk-3OY3UJDR.js";import"./chunk-YNYSPYQ5.js";import"./chunk-KZ3P3SVS.js";import"./chunk-O7N2RCS7.js";export{b as flagsForFuzzing,a as tarCommand};
|