unpeek 1.2.0 → 1.4.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +17 -6
- package/README.tr.md +17 -6
- package/assets/banner.svg +22 -0
- package/dist/cli/index.cjs +106 -43
- package/dist/cli/index.cjs.map +1 -1
- package/dist/cli/index.js +106 -43
- package/dist/cli/index.js.map +1 -1
- package/dist/index.cjs +106 -43
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +106 -43
- package/dist/index.js.map +1 -1
- package/package.json +2 -1
package/README.md
CHANGED
|
@@ -1,13 +1,24 @@
|
|
|
1
|
+
<p align="center">
|
|
2
|
+
<picture>
|
|
3
|
+
<source media="(prefers-color-scheme: dark)" srcset="https://raw.githubusercontent.com/Woffluon/unpeek/main/assets/banner.svg">
|
|
4
|
+
<source media="(prefers-color-scheme: light)" srcset="https://raw.githubusercontent.com/Woffluon/unpeek/main/assets/banner.svg">
|
|
5
|
+
<img src="https://raw.githubusercontent.com/Woffluon/unpeek/main/assets/banner.svg" alt="unpeek - call-graph aware client-side javascript protection" width="100%">
|
|
6
|
+
</picture>
|
|
7
|
+
</p>
|
|
8
|
+
|
|
1
9
|
# unpeek
|
|
2
10
|
|
|
3
|
-
**
|
|
11
|
+
**Nothing to peek at. Nothing to slow down.**
|
|
12
|
+
|
|
13
|
+
Zero-config, call-graph-aware client-side JavaScript protection and runtime anti-tamper toolkit with <2% CPU overhead and <15% Gzip budget.
|
|
4
14
|
|
|
5
|
-
[](LICENSE)
|
|
16
|
+
[](packages/unpeek/benchmarks/overhead.bench.ts)
|
|
17
|
+
[](packages/unpeek/benchmarks/overhead.bench.ts)
|
|
18
|
+
[](https://woffluon.github.io/unpeek)
|
|
19
|
+
[](https://woffluon.github.io/unpeek/docs)
|
|
9
20
|
|
|
10
|
-
English | [Türkçe](./README.tr.md) · [
|
|
21
|
+
English | [Türkçe](./README.tr.md) · [Interactive Showcase](https://woffluon.github.io/unpeek) · [Documentation](https://woffluon.github.io/unpeek/docs) · [Agent Architecture Guide](./AGENTS.md) · [AI Skill](./skills/unpeek/SKILL.md)
|
|
11
22
|
|
|
12
23
|
---
|
|
13
24
|
|
package/README.tr.md
CHANGED
|
@@ -1,13 +1,24 @@
|
|
|
1
|
+
<p align="center">
|
|
2
|
+
<picture>
|
|
3
|
+
<source media="(prefers-color-scheme: dark)" srcset="https://raw.githubusercontent.com/Woffluon/unpeek/main/assets/banner.svg">
|
|
4
|
+
<source media="(prefers-color-scheme: light)" srcset="https://raw.githubusercontent.com/Woffluon/unpeek/main/assets/banner.svg">
|
|
5
|
+
<img src="https://raw.githubusercontent.com/Woffluon/unpeek/main/assets/banner.svg" alt="unpeek - call-graph aware client-side javascript protection" width="100%">
|
|
6
|
+
</picture>
|
|
7
|
+
</p>
|
|
8
|
+
|
|
1
9
|
# unpeek
|
|
2
10
|
|
|
3
|
-
**
|
|
11
|
+
**Bakılacak bir şey yok. Yavaşlayacak hiçbir şey yok.**
|
|
12
|
+
|
|
13
|
+
Sıfır yapılandırma gerektiren, çağrı grafiği (call-graph) farkındalıklı, <%2 CPU ek yükü ve <%15 Gzip bütçesine sahip istemci tarafı JavaScript koruma ve çalışma zamanı (runtime) müdahale önleme aracı.
|
|
4
14
|
|
|
5
|
-
[](LICENSE)
|
|
16
|
+
[](packages/unpeek/benchmarks/overhead.bench.ts)
|
|
17
|
+
[](packages/unpeek/benchmarks/overhead.bench.ts)
|
|
18
|
+
[](https://woffluon.github.io/unpeek)
|
|
19
|
+
[](https://woffluon.github.io/unpeek/docs)
|
|
9
20
|
|
|
10
|
-
[English](./README.md) | Türkçe · [
|
|
21
|
+
[English](./README.md) | Türkçe · [İnteraktif Vitrin](https://woffluon.github.io/unpeek) · [Dokümantasyon](https://woffluon.github.io/unpeek/docs) · [Ajan Mimari Kılavuzu](./AGENTS.md) · [Yapay Zeka Becerisi (SKILL.md)](./skills/unpeek/SKILL.md)
|
|
11
22
|
|
|
12
23
|
---
|
|
13
24
|
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 960 200" width="100%" height="auto" fill="none">
|
|
2
|
+
<!-- Minimalist Carbon Canvas -->
|
|
3
|
+
<rect width="960" height="200" rx="6" fill="#111111" />
|
|
4
|
+
<rect x="0.5" y="0.5" width="959" height="199" rx="5.5" stroke="#2A2A28" />
|
|
5
|
+
|
|
6
|
+
<!-- Signal Orange Top Line -->
|
|
7
|
+
<rect x="0" y="0" width="960" height="2" fill="#FF3300" />
|
|
8
|
+
|
|
9
|
+
<!-- Iconic Brand Mark (Sealed block with open hot-path cut) -->
|
|
10
|
+
<g transform="translate(458, 30) scale(1.833)">
|
|
11
|
+
<path d="M2 2h15l5 5v15H2V2Z" fill="#EDEAE1" />
|
|
12
|
+
<rect x="0" y="10.5" width="24" height="3" fill="#FF3300" />
|
|
13
|
+
</g>
|
|
14
|
+
|
|
15
|
+
<!-- Wordmark -->
|
|
16
|
+
<text x="480" y="122" text-anchor="middle" fill="#EDEAE1" font-family="-apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif" font-size="38" font-weight="700" letter-spacing="-0.035em">unpeek</text>
|
|
17
|
+
|
|
18
|
+
<!-- Tagline -->
|
|
19
|
+
<text x="480" y="154" text-anchor="middle" fill="#8E8A7E" font-family="-apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif" font-size="14" font-weight="400" letter-spacing="-0.01em">
|
|
20
|
+
Nothing to peek at. <tspan fill="#EDEAE1">Nothing to slow down.</tspan>
|
|
21
|
+
</text>
|
|
22
|
+
</svg>
|
package/dist/cli/index.cjs
CHANGED
|
@@ -1224,7 +1224,7 @@ ${finalCode}`;
|
|
|
1224
1224
|
}
|
|
1225
1225
|
|
|
1226
1226
|
// src/cli/index.ts
|
|
1227
|
-
var VERSION = "1.
|
|
1227
|
+
var VERSION = "1.4.0";
|
|
1228
1228
|
function getPackageVersion() {
|
|
1229
1229
|
try {
|
|
1230
1230
|
const pkgUrl = new URL("../../package.json", importMetaUrl);
|
|
@@ -1236,25 +1236,52 @@ function getPackageVersion() {
|
|
|
1236
1236
|
}
|
|
1237
1237
|
}
|
|
1238
1238
|
var RUNTIME_VERSION = getPackageVersion();
|
|
1239
|
+
var MARK_TOP = " \u259B\u2580\u2580\u259C";
|
|
1240
|
+
var MARK_BOTTOM = " \u2599\u2584\u2584\u259F";
|
|
1241
|
+
var RULE = "\u2500";
|
|
1242
|
+
var LABEL_WIDTH = 19;
|
|
1243
|
+
function colorEnabled() {
|
|
1244
|
+
if (process.env.NO_COLOR) return false;
|
|
1245
|
+
if (process.env.TERM === "dumb") return false;
|
|
1246
|
+
return Boolean(process.stdout.isTTY);
|
|
1247
|
+
}
|
|
1248
|
+
function paint(code, text) {
|
|
1249
|
+
return colorEnabled() ? `\x1B[${code}m${text}\x1B[0m` : text;
|
|
1250
|
+
}
|
|
1251
|
+
function dim(text) {
|
|
1252
|
+
return paint("2", text);
|
|
1253
|
+
}
|
|
1254
|
+
function brandBlock() {
|
|
1255
|
+
return [
|
|
1256
|
+
`${MARK_TOP} ${paint("1", `unpeek ${RUNTIME_VERSION}`)}`,
|
|
1257
|
+
`${MARK_BOTTOM} ${dim("client bundle protection")}`
|
|
1258
|
+
].join("\n");
|
|
1259
|
+
}
|
|
1260
|
+
function sectionBlock(title, rows) {
|
|
1261
|
+
const fill = Math.max(2, 46 - title.length);
|
|
1262
|
+
const header = ` ${dim(title)} ${dim(RULE.repeat(fill))}`;
|
|
1263
|
+
const body = rows.map(([label, value]) => ` ${dim(label.padEnd(LABEL_WIDTH))} ${value}`);
|
|
1264
|
+
return [header, ...body].join("\n");
|
|
1265
|
+
}
|
|
1239
1266
|
function printHelp() {
|
|
1240
|
-
const helpText =
|
|
1241
|
-
|
|
1242
|
-
|
|
1243
|
-
Usage:
|
|
1244
|
-
|
|
1245
|
-
|
|
1246
|
-
|
|
1247
|
-
Options:
|
|
1248
|
-
|
|
1249
|
-
|
|
1250
|
-
|
|
1251
|
-
|
|
1252
|
-
|
|
1253
|
-
|
|
1254
|
-
|
|
1255
|
-
|
|
1256
|
-
|
|
1257
|
-
|
|
1267
|
+
const helpText = [
|
|
1268
|
+
brandBlock(),
|
|
1269
|
+
"",
|
|
1270
|
+
" Usage:",
|
|
1271
|
+
" unpeek init [--dry-run] wire postbuild and the .unpeek-maps/ vault",
|
|
1272
|
+
" unpeek protect [options] protect client bundles in place",
|
|
1273
|
+
"",
|
|
1274
|
+
" Options:",
|
|
1275
|
+
" --out-dir <dir> explicit client output directory",
|
|
1276
|
+
" --seed <number> deterministic polymorphic seed",
|
|
1277
|
+
" --passive passive deterrent mode instead of gradual",
|
|
1278
|
+
" --no-maps delete .map files instead of vaulting them",
|
|
1279
|
+
" --min-string-length <num> minimum string length for the vault (default: 4)",
|
|
1280
|
+
" --private-maps-dir <dir> vault directory (default: .unpeek-maps)",
|
|
1281
|
+
" --no-shield skip the runtime anti-tamper shield",
|
|
1282
|
+
" -h, --help show help",
|
|
1283
|
+
" -v, --version show version"
|
|
1284
|
+
].join("\n");
|
|
1258
1285
|
console.log(helpText);
|
|
1259
1286
|
}
|
|
1260
1287
|
function formatBytes(bytes) {
|
|
@@ -1263,30 +1290,66 @@ function formatBytes(bytes) {
|
|
|
1263
1290
|
}
|
|
1264
1291
|
function printSummaryTable(summary) {
|
|
1265
1292
|
const sign = summary.gzipDeltaPercent > 0 ? "+" : "";
|
|
1266
|
-
const
|
|
1267
|
-
|
|
1268
|
-
|
|
1269
|
-
|
|
1270
|
-
|
|
1271
|
-
|
|
1272
|
-
|
|
1273
|
-
|
|
1274
|
-
|
|
1275
|
-
|
|
1276
|
-
|
|
1277
|
-
|
|
1278
|
-
|
|
1279
|
-
|
|
1280
|
-
]
|
|
1281
|
-
|
|
1282
|
-
|
|
1283
|
-
|
|
1284
|
-
console.log("
|
|
1285
|
-
console.log(
|
|
1286
|
-
|
|
1287
|
-
|
|
1293
|
+
const gzip = `${formatBytes(summary.originalGzipBytes)} -> ${formatBytes(summary.protectedGzipBytes)} ${sign}${summary.gzipDeltaPercent}%`;
|
|
1294
|
+
console.log("");
|
|
1295
|
+
console.log(brandBlock());
|
|
1296
|
+
console.log("");
|
|
1297
|
+
console.log(
|
|
1298
|
+
sectionBlock("PROJECT", [
|
|
1299
|
+
["framework", summary.framework],
|
|
1300
|
+
["output", summary.outDir],
|
|
1301
|
+
["bundles", String(summary.processedFiles)]
|
|
1302
|
+
])
|
|
1303
|
+
);
|
|
1304
|
+
console.log("");
|
|
1305
|
+
console.log(
|
|
1306
|
+
sectionBlock("CALL GRAPH", [
|
|
1307
|
+
["hot path exempt", `${summary.totalHotFunctionsSkipped} ${dim("0% tax")}`],
|
|
1308
|
+
["cold path protected", String(summary.totalColdFunctionsProtected)]
|
|
1309
|
+
])
|
|
1310
|
+
);
|
|
1311
|
+
console.log("");
|
|
1312
|
+
console.log(
|
|
1313
|
+
sectionBlock("TRANSFORM", [
|
|
1314
|
+
["string vault", `${summary.totalEncryptedStrings} literals ${dim("O(1) memo")}`],
|
|
1315
|
+
["symbol mangling", `${summary.totalMangledSymbols} bindings`]
|
|
1316
|
+
])
|
|
1317
|
+
);
|
|
1318
|
+
console.log("");
|
|
1319
|
+
console.log(
|
|
1320
|
+
sectionBlock("OUTPUT", [
|
|
1321
|
+
["source maps", `${summary.movedSourceMaps} moved -> .unpeek-maps/`],
|
|
1322
|
+
["gzip", gzip],
|
|
1323
|
+
["elapsed", `${summary.elapsedMs} ms`]
|
|
1324
|
+
])
|
|
1325
|
+
);
|
|
1326
|
+
console.log("");
|
|
1327
|
+
console.log(` ${dim("done. maps are private. hot path untouched.")}`);
|
|
1328
|
+
}
|
|
1329
|
+
function printInitResult(result, dryRun) {
|
|
1330
|
+
const postbuild = result.updatedPackageJson ? dryRun ? "would be added" : "unpeek protect (added)" : "already configured";
|
|
1331
|
+
const vault = result.updatedGitignore ? dryRun ? "would be ignored" : ".unpeek-maps/ (added)" : "already ignored";
|
|
1332
|
+
console.log("");
|
|
1333
|
+
console.log(brandBlock());
|
|
1334
|
+
console.log("");
|
|
1335
|
+
console.log(
|
|
1336
|
+
sectionBlock("PROJECT", [
|
|
1337
|
+
["framework", result.framework ?? "unknown"],
|
|
1338
|
+
["postbuild", postbuild],
|
|
1339
|
+
["vault", vault]
|
|
1340
|
+
])
|
|
1341
|
+
);
|
|
1342
|
+
console.log("");
|
|
1343
|
+
if (dryRun) {
|
|
1344
|
+
console.log(` ${dim(result.message)}`);
|
|
1345
|
+
} else if (result.updatedPackageJson || result.updatedGitignore) {
|
|
1346
|
+
console.log(` ${dim("postbuild wired. maps stay private from the first build.")}`);
|
|
1347
|
+
} else {
|
|
1348
|
+
console.log(` ${dim(result.message)}`);
|
|
1349
|
+
}
|
|
1350
|
+
if (!dryRun) {
|
|
1351
|
+
console.log(` ${dim("run your build to protect the first bundle.")}`);
|
|
1288
1352
|
}
|
|
1289
|
-
console.log(divider);
|
|
1290
1353
|
}
|
|
1291
1354
|
async function runCli(args) {
|
|
1292
1355
|
if (args.length === 0 || args.includes("--help") || args.includes("-h")) {
|
|
@@ -1301,7 +1364,7 @@ async function runCli(args) {
|
|
|
1301
1364
|
if (command === "init") {
|
|
1302
1365
|
const dryRun = args.includes("--dry-run");
|
|
1303
1366
|
const res = initProject(process.cwd(), { dryRun });
|
|
1304
|
-
|
|
1367
|
+
printInitResult(res, dryRun);
|
|
1305
1368
|
return;
|
|
1306
1369
|
}
|
|
1307
1370
|
if (command === "protect" || args.length > 0 && args[0].startsWith("-")) {
|