afterpack 0.0.9 → 0.0.10
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/cli.js +29 -71
- package/dist/cli.js.map +1 -1
- package/package.json +2 -1
package/dist/cli.js
CHANGED
|
@@ -1,88 +1,46 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
import {
|
|
3
|
-
import { basename, extname, relative, resolve } from "node:path";
|
|
4
|
-
import { processFile, version } from "@afterpack/core";
|
|
2
|
+
import { version } from "@afterpack/core";
|
|
5
3
|
|
|
6
4
|
//#region src/cli.ts
|
|
7
5
|
const args = process.argv.slice(2);
|
|
8
|
-
|
|
6
|
+
if (args.includes("--version") || args.includes("-v")) {
|
|
7
|
+
console.log(`AfterPack v${version()}`);
|
|
8
|
+
process.exit(0);
|
|
9
|
+
}
|
|
10
|
+
if (args[0] === "audit") {
|
|
9
11
|
console.log(`
|
|
10
12
|
╔═══════════════════════════════════════════════════════╗
|
|
11
13
|
║ AfterPack v${version().padEnd(42)}║
|
|
12
|
-
║ High-performance JavaScript obfuscator ║
|
|
13
14
|
╚═══════════════════════════════════════════════════════╝
|
|
14
|
-
`);
|
|
15
|
-
}
|
|
16
|
-
function showHelp() {
|
|
17
|
-
showBanner();
|
|
18
|
-
console.log(`
|
|
19
|
-
Usage:
|
|
20
|
-
npx afterpack <file.js> Process a JavaScript file
|
|
21
|
-
npx afterpack --version Show version
|
|
22
|
-
npx afterpack --help Show this help
|
|
23
15
|
|
|
24
|
-
|
|
25
|
-
-h, --help Show this help message
|
|
26
|
-
-v, --version Show version number
|
|
16
|
+
Audit command coming soon!
|
|
27
17
|
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
npx afterpack build/index.mjs
|
|
18
|
+
This will analyze your site and reveal what AI can
|
|
19
|
+
extract from your client-side JavaScript.
|
|
31
20
|
|
|
32
|
-
|
|
21
|
+
┌─────────────────────────────────────────────────────┐
|
|
22
|
+
│ Join the waitlist to get notified: │
|
|
23
|
+
│ https://www.afterpack.dev │
|
|
24
|
+
└─────────────────────────────────────────────────────┘
|
|
33
25
|
`);
|
|
34
|
-
}
|
|
35
|
-
if (args.includes("--version") || args.includes("-v")) {
|
|
36
|
-
console.log(`AfterPack v${version()}`);
|
|
37
26
|
process.exit(0);
|
|
38
27
|
}
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
console.error(`Error: File not found: ${relativePath}`);
|
|
56
|
-
hasErrors = true;
|
|
57
|
-
continue;
|
|
58
|
-
}
|
|
59
|
-
if (statSync(filePath).isDirectory()) {
|
|
60
|
-
console.error(`Error: Expected a file, got directory: ${relativePath}`);
|
|
61
|
-
console.error(" Hint: Directory processing coming soon!");
|
|
62
|
-
hasErrors = true;
|
|
63
|
-
continue;
|
|
64
|
-
}
|
|
65
|
-
const ext = extname(filePath).toLowerCase();
|
|
66
|
-
if (ext !== ".js" && ext !== ".mjs" && ext !== ".cjs") {
|
|
67
|
-
console.error(`Error: Expected JavaScript file (.js, .mjs, .cjs), got: ${basename(filePath)}`);
|
|
68
|
-
hasErrors = true;
|
|
69
|
-
continue;
|
|
70
|
-
}
|
|
71
|
-
try {
|
|
72
|
-
console.log(`Processing: ${relativePath}`);
|
|
73
|
-
processFile(filePath);
|
|
74
|
-
console.log(` Done!`);
|
|
75
|
-
} catch (err) {
|
|
76
|
-
const message = err instanceof Error ? err.message : String(err);
|
|
77
|
-
console.error(`Error processing ${relativePath}: ${message}`);
|
|
78
|
-
hasErrors = true;
|
|
79
|
-
}
|
|
80
|
-
}
|
|
81
|
-
console.log("");
|
|
82
|
-
if (hasErrors) {
|
|
83
|
-
console.log("Completed with errors.");
|
|
84
|
-
process.exit(1);
|
|
85
|
-
} else console.log("All files processed successfully.");
|
|
28
|
+
console.log(`
|
|
29
|
+
╔═══════════════════════════════════════════════════════╗
|
|
30
|
+
║ AfterPack v${version().padEnd(42)}║
|
|
31
|
+
╚═══════════════════════════════════════════════════════╝
|
|
32
|
+
|
|
33
|
+
Coming soon: High-performance JavaScript protection.
|
|
34
|
+
|
|
35
|
+
Secure your client-side logic from AI extraction,
|
|
36
|
+
reverse engineering, vulnerability scanning, and
|
|
37
|
+
automated scraping.
|
|
38
|
+
|
|
39
|
+
┌─────────────────────────────────────────────────────┐
|
|
40
|
+
│ Join the waitlist for early access: │
|
|
41
|
+
│ https://www.afterpack.dev │
|
|
42
|
+
└─────────────────────────────────────────────────────┘
|
|
43
|
+
`);
|
|
86
44
|
|
|
87
45
|
//#endregion
|
|
88
46
|
//# sourceMappingURL=cli.js.map
|
package/dist/cli.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"cli.js","names":[],"sources":["../src/cli.ts"],"sourcesContent":["#!/usr/bin/env node\n\nimport {
|
|
1
|
+
{"version":3,"file":"cli.js","names":[],"sources":["../src/cli.ts"],"sourcesContent":["#!/usr/bin/env node\n\nimport { version } from \"@afterpack/core\";\n\nconst args = process.argv.slice(2);\n\n// Version flag\nif (args.includes(\"--version\") || args.includes(\"-v\")) {\n console.log(`AfterPack v${version()}`);\n process.exit(0);\n}\n\n// Audit command\nif (args[0] === \"audit\") {\n console.log(`\n ╔═══════════════════════════════════════════════════════╗\n ║ AfterPack v${version().padEnd(42)}║\n ╚═══════════════════════════════════════════════════════╝\n\n Audit command coming soon!\n\n This will analyze your site and reveal what AI can\n extract from your client-side JavaScript.\n\n ┌─────────────────────────────────────────────────────┐\n │ Join the waitlist to get notified: │\n │ https://www.afterpack.dev │\n └─────────────────────────────────────────────────────┘\n`);\n process.exit(0);\n}\n\n// Default: show main waitlist message\nconsole.log(`\n ╔═══════════════════════════════════════════════════════╗\n ║ AfterPack v${version().padEnd(42)}║\n ╚═══════════════════════════════════════════════════════╝\n\n Coming soon: High-performance JavaScript protection.\n\n Secure your client-side logic from AI extraction,\n reverse engineering, vulnerability scanning, and\n automated scraping.\n\n ┌─────────────────────────────────────────────────────┐\n │ Join the waitlist for early access: │\n │ https://www.afterpack.dev │\n └─────────────────────────────────────────────────────┘\n`);\n"],"mappings":";;;;AAIA,MAAM,OAAO,QAAQ,KAAK,MAAM,EAAE;AAGlC,IAAI,KAAK,SAAS,YAAY,IAAI,KAAK,SAAS,KAAK,EAAE;AACrD,SAAQ,KAAK,aAAa,SAAS,CAAC,EAAE;AACtC,SAAQ,KAAK,EAAE;AAChB;AAGD,IAAI,KAAK,OAAO,SAAS;AACvB,SAAQ,KAAK;;kBAEG,SAAS,CAAC,OAAO,GAAG,CAAC;;;;;;;;;;;;EAYrC;AACA,SAAQ,KAAK,EAAE;AAChB;AAGD,QAAQ,KAAK;;kBAEK,SAAS,CAAC,OAAO,GAAG,CAAC;;;;;;;;;;;;;EAarC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "afterpack",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.10",
|
|
4
4
|
"description": "A high-performance post-build JavaScript obfuscator and minifier",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./dist/cli.js",
|
|
@@ -42,6 +42,7 @@
|
|
|
42
42
|
"@afterpack/core": "^0.0.9"
|
|
43
43
|
},
|
|
44
44
|
"devDependencies": {
|
|
45
|
+
"@types/node": "^25.0.9",
|
|
45
46
|
"tsdown": "^0.11.0",
|
|
46
47
|
"typescript": "^5.0.0",
|
|
47
48
|
"vitest": "^2.0.0"
|