afterpack 1.0.3 → 1.1.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/CHANGELOG.md +22 -0
- package/README.md +13 -3
- package/SKILL.md +6 -3
- package/dist/cli.js +105 -20
- package/package.json +3 -3
package/CHANGELOG.md
CHANGED
|
@@ -2,6 +2,28 @@
|
|
|
2
2
|
|
|
3
3
|
The full changelog, including cloud and dashboard changes, is at https://www.afterpack.dev/changelog.
|
|
4
4
|
|
|
5
|
+
## 1.1.0 - 2026-11-28
|
|
6
|
+
|
|
7
|
+
Cloud builds of any size, all-caps variables and empty values that reset
|
|
8
|
+
|
|
9
|
+
### Added
|
|
10
|
+
|
|
11
|
+
- **Cloud:** A Pro cloud build of any size runs as one build. The server splits a large build into parts, and you get one entry in the builds list, one usage charge and one Protection Map that merges every part. The 200-file limit on a cloud build is gone with the 1.1.0 CLI and plugins; older versions keep sending each build as one request, within that limit. A build that is cancelled or drops gives back what it reserved for files it did not deliver.
|
|
12
|
+
- **Dashboard:** A cloud build in progress shows as building, with the bytes it has reserved. Once it finishes, its page shows what was billed and what went back.
|
|
13
|
+
- **Plugins:** An empty value resets `key`, `seed` or a list option to its default and overrides `afterpack.json`: `AFTERPACK_KEY=` builds locally on Free, and `AFTERPACK_SEED=` draws a fresh seed. Before, an empty seed pinned one fixed seed, in the plugins and in `@afterpack/core` and `@afterpack/wasm` alike. An empty value for any other option, such as `AFTERPACK_PRESET=`, now fails the build with an error naming the option, and so do `complexity=` and `inflation.max=` in a directive. ([Empty values](https://www.afterpack.dev/docs/config#empty-values))
|
|
14
|
+
- **Engine:** In `@afterpack/core`, `key: null` builds locally on Free without reading `AFTERPACK_KEY` or `afterpack.json`.
|
|
15
|
+
- **CLI:** `afterpack network keygen` prints a key pair for network protection, which arrives in a later release.
|
|
16
|
+
|
|
17
|
+
### Changed
|
|
18
|
+
|
|
19
|
+
- **Plugins:** Every option's environment variable is spelled in capitals: `strings.minLength` is `AFTERPACK_STRINGS_MIN_LENGTH`. The spelling that keeps the option's case, `AFTERPACK_strings_minLength`, still works. Setting both spellings of one option to different values fails the build. An all-caps variable that looks like an option but matches none, such as `AFTERPACK_SOURCEMAP_ENABLED`, fails with the right spelling. ([Configuration](https://www.afterpack.dev/docs/config))
|
|
20
|
+
- **Plugins:** The CLI and plugins read `key` only from `--key=`, `AFTERPACK_KEY` and the `afterpack.json` they read the rest of the configuration from. A key in another `afterpack.json`, such as one at a monorepo root above the project's own, no longer applies. If your key lives only in a monorepo-root `afterpack.json`, move it to `AFTERPACK_KEY` or the project's own `afterpack.json`. With an engine older than 1.1.0, a build that would pick up such a key fails and names the update to install. ([Key lookup](https://www.afterpack.dev/docs/config#key-lookup))
|
|
21
|
+
|
|
22
|
+
### Fixed
|
|
23
|
+
|
|
24
|
+
- **Plugins:** `seed: "git"` with no commit to read falls back to the seed in `AFTERPACK_SEED`, then the one in `afterpack.json`.
|
|
25
|
+
- **Plugins:** Astro's server build adds its entries to `strings.preserveLiterals` instead of replacing the list from `afterpack.json` or the environment.
|
|
26
|
+
|
|
5
27
|
## 1.0.3 - 2026-11-13
|
|
6
28
|
|
|
7
29
|
A smaller WebAssembly engine and a `super` fix
|
package/README.md
CHANGED
|
@@ -116,12 +116,18 @@ link to the full report. It sends only the URL and writes nothing. A finished sc
|
|
|
116
116
|
much it found. It is the [free website security scanner](https://www.afterpack.dev/security-scanner)
|
|
117
117
|
in your terminal; see [auditing a live site](https://www.afterpack.dev/docs/audit).
|
|
118
118
|
|
|
119
|
+
## `afterpack network keygen`
|
|
120
|
+
|
|
121
|
+
Prints a new X25519 key pair in base64url for network protection, which arrives in a later
|
|
122
|
+
release: a Pro build will seal the app's own API and socket traffic to your server's public key.
|
|
123
|
+
It writes nothing. The private key belongs only in your server's secret store.
|
|
124
|
+
|
|
119
125
|
## Options
|
|
120
126
|
|
|
121
127
|
Every option has one name, written the same way everywhere:
|
|
122
128
|
|
|
123
129
|
- `--preset=hard` on the command line
|
|
124
|
-
- `
|
|
130
|
+
- `AFTERPACK_PRESET=hard` in the environment (`strings.minLength` is `AFTERPACK_STRINGS_MIN_LENGTH`)
|
|
125
131
|
- `"preset": "hard"` in `afterpack.json`, the nearest one at or above the working directory
|
|
126
132
|
|
|
127
133
|
A flag wins over the environment, which wins over the file. A boolean flag on its own means `true`.
|
|
@@ -137,7 +143,10 @@ An unknown or misspelled option fails the run and names the right spelling.
|
|
|
137
143
|
| [`--build.backup`][build.backup] | back up originals to `.afterpack/backups/` | `true` |
|
|
138
144
|
| [`--protectionMap.enabled`][protectionMap.enabled] | write the Protection Map | on when an input map exists, outside CI |
|
|
139
145
|
|
|
140
|
-
Each flag is also a key in `afterpack.json` and an `AFTERPACK_*` variable.
|
|
146
|
+
Each flag is also a key in `afterpack.json` and an `AFTERPACK_*` variable. A flag outranks the
|
|
147
|
+
environment, which outranks `afterpack.json`. An empty value (`--seed=`, `AFTERPACK_KEY=`) resets
|
|
148
|
+
`key`, `seed` or a list to its default over the lower layers, and is an error for any other
|
|
149
|
+
option. Every other option is in
|
|
141
150
|
the [configuration reference](https://www.afterpack.dev/docs/config). The
|
|
142
151
|
[CLI reference](https://www.afterpack.dev/docs/cli) covers the commands.
|
|
143
152
|
|
|
@@ -172,7 +181,8 @@ support it too. Every document, failures included, starts with `"schemaVersion":
|
|
|
172
181
|
|
|
173
182
|
Without a key, AfterPack runs on your machine with the full pipeline at any preset. Set
|
|
174
183
|
[`AFTERPACK_KEY`][key] in your environment (or [`key`][key] in `afterpack.json`) and the same
|
|
175
|
-
command builds in AfterPack's cloud instead
|
|
184
|
+
command builds in AfterPack's cloud instead (`AFTERPACK_KEY=`, empty, overrides a key in
|
|
185
|
+
`afterpack.json` and builds locally), which adds two hardening transforms you can turn on:
|
|
176
186
|
self-integrity, which detects edits to its own check table only, not edits
|
|
177
187
|
elsewhere in your code, and comparison hardening. If the cloud cannot be reached, the run
|
|
178
188
|
fails; it never falls back to a local build. Never commit the key. See [AfterPack
|
package/SKILL.md
CHANGED
|
@@ -103,8 +103,8 @@ The backup and the Protection Map contain the original source. `.afterpack/` car
|
|
|
103
103
|
Every option has one dot-delimited camelCase name, used the same way in every place:
|
|
104
104
|
|
|
105
105
|
1. `--key=value` on the command line
|
|
106
|
-
2. `AFTERPACK_<
|
|
107
|
-
`
|
|
106
|
+
2. `AFTERPACK_<KEY>` in the environment, the key in SCREAMING_SNAKE_CASE, for example
|
|
107
|
+
`AFTERPACK_DIAGNOSTICS_FORMAT=json` for `diagnostics.format`
|
|
108
108
|
3. `afterpack.json`, the nearest one at or above the working directory
|
|
109
109
|
|
|
110
110
|
Higher in the list wins. A boolean flag on its own means `true`; `=false` turns it off. There is
|
|
@@ -213,7 +213,10 @@ self-integrity, which detects edits to its own check table only, not edits
|
|
|
213
213
|
elsewhere in your code, and comparison hardening.
|
|
214
214
|
|
|
215
215
|
- Set it as `AFTERPACK_KEY` in the environment (a CI secret), or [`key`][key] in an uncommitted
|
|
216
|
-
`afterpack.json`.
|
|
216
|
+
`afterpack.json`. The environment outranks the file; an empty or whitespace-only `AFTERPACK_KEY=`
|
|
217
|
+
means no key and builds locally even when `afterpack.json` holds one.
|
|
218
|
+
- An empty value resets `key`, `seed` or a list to its default over every lower layer. For any
|
|
219
|
+
other option (`AFTERPACK_PRESET=`, `--complexity=`) it is an error, never a silent default.
|
|
217
220
|
- Never put it in a plugin's options object. Plugins reject it there, because a bundler config is
|
|
218
221
|
committed source.
|
|
219
222
|
- Never commit it.
|
package/dist/cli.js
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
import { closeSync, existsSync, mkdirSync, openSync, readFileSync, readdirSync, realpathSync, renameSync, rmSync, rmdirSync, statSync, writeFileSync, writeSync } from "node:fs";
|
|
3
3
|
import { processBatch, version } from "@afterpack/core";
|
|
4
|
-
import { AFTERPACK_DIR, AfterpackFilesError, AlreadyObfuscatedError, CLOUD_REFUSAL_SUMMARY, CONFIG_KEYS, CORE_FLOOR_SUMMARY, CloudApiError, CoreVersionError, DIAG_ALREADY_OBFUSCATED, NEXT_CHUNKS_PREFIX, PROTECTION_RECEIPTS_DIR, UnreadableReceiptError, afterpackHome, angularHashToken, angularServerManifestRefusal, buildDirKey, collectJsFiles, createTelemetryReporter, detectNextBundler, ensureAfterpackGitignore, findHashTokenReference, getPath, installedRequiredLine, isWithinDir, loadConfigFile, locateProtectionReceipt,
|
|
4
|
+
import { AFTERPACK_DIR, AfterpackFilesError, AlreadyObfuscatedError, CLOUD_REFUSAL_SUMMARY, CONFIG_KEYS, CORE_FLOOR_SUMMARY, CloudApiError, CoreVersionError, DIAG_ALREADY_OBFUSCATED, NEXT_CHUNKS_PREFIX, PROTECTION_RECEIPTS_DIR, UnreadableReceiptError, afterpackHome, angularHashToken, angularServerManifestRefusal, buildDirKey, collectJsFiles, createTelemetryReporter, detectNextBundler, ensureAfterpackGitignore, findHashTokenReference, getPath, installedRequiredLine, isWithinDir, loadConfigFile, locateProtectionReceipt, mergeLayers, nextChunkToken, npxAlternative, parseCliOptions, parseEnvOptions, planAngularIntegrity, protectionReceiptPath, resolveClientIdentity, resolvePluginConfig, runObfuscationPass, serverAddsInfo, sha256Hex, skipNextInternals, stagedPath, unreferencedHashedFiles, verifyProtectionReceipt, writeFileAtomic } from "@afterpack/integration-utils";
|
|
5
5
|
import { basename, dirname, isAbsolute, join, posix, relative, resolve, sep } from "node:path";
|
|
6
|
-
import { createHash, randomUUID } from "node:crypto";
|
|
6
|
+
import { createHash, generateKeyPairSync, randomUUID } from "node:crypto";
|
|
7
7
|
import { hostname } from "node:os";
|
|
8
8
|
|
|
9
9
|
//#region src/detect.ts
|
|
@@ -250,12 +250,12 @@ function stripAnsi(text) {
|
|
|
250
250
|
|
|
251
251
|
//#endregion
|
|
252
252
|
//#region src/args.ts
|
|
253
|
-
function toRunOptions(
|
|
254
|
-
const view =
|
|
253
|
+
function toRunOptions(resolved) {
|
|
254
|
+
const view = resolved.options;
|
|
255
255
|
return {
|
|
256
256
|
...view,
|
|
257
257
|
pathsInclude: view.paths?.include ?? [],
|
|
258
|
-
engineConfig:
|
|
258
|
+
engineConfig: resolved.engineConfig
|
|
259
259
|
};
|
|
260
260
|
}
|
|
261
261
|
function expandShortFlags(argv) {
|
|
@@ -301,7 +301,7 @@ function renderFlag(key) {
|
|
|
301
301
|
return `--${key.path}=<${key.shape === "scalar" ? item : `${item}[,...]`}>`;
|
|
302
302
|
}
|
|
303
303
|
const CONTACT_FOOTER = "contact https://www.afterpack.dev/contact";
|
|
304
|
-
const USAGE = "usage: afterpack [path] [--key=value ...] [--help] [--version]\n afterpack verify [dir]\n afterpack restore [dir]\n afterpack audit <url
|
|
304
|
+
const USAGE = "usage: afterpack [path] [--key=value ...] [--help] [--version]\n afterpack verify [dir]\n afterpack restore [dir]\n afterpack audit <url>\n afterpack network keygen";
|
|
305
305
|
const OUTPUT_DIR_LIST = OUTPUT_DIRS.map((dir) => `${dir}/`).join(", ");
|
|
306
306
|
const KEY_BY_PATH = new Map(CONFIG_KEYS.map((k) => [k.path, k]));
|
|
307
307
|
const COMMON_OPTION_PATHS = [
|
|
@@ -384,13 +384,14 @@ it processes every emitted file in place. On a Next.js, Angular, Vite or
|
|
|
384
384
|
webpack build it also renames each content-hashed file to match its
|
|
385
385
|
obfuscated bytes, and rewrites every reference to it.
|
|
386
386
|
|
|
387
|
-
Every option below
|
|
388
|
-
|
|
389
|
-
|
|
390
|
-
|
|
391
|
-
|
|
392
|
-
|
|
393
|
-
|
|
387
|
+
Every option below has one name in all four places: \`--key=value\` here,
|
|
388
|
+
AFTERPACK_<KEY> in the environment with the key in SCREAMING_SNAKE_CASE
|
|
389
|
+
(strings.minLength is AFTERPACK_STRINGS_MIN_LENGTH), nested in afterpack.json
|
|
390
|
+
(the nearest one at or above the working directory). A boolean key written
|
|
391
|
+
alone means true; \`=false\` switches it off. Most specific wins: a flag, then
|
|
392
|
+
the environment, then afterpack.json. An empty value resets \`key\`, \`seed\` or
|
|
393
|
+
a list to its default over every lower layer (AFTERPACK_KEY= builds locally
|
|
394
|
+
on Free); an empty value for any other key is an error.
|
|
394
395
|
|
|
395
396
|
Arguments:
|
|
396
397
|
[path] directory of emitted JS to obfuscate, or a single
|
|
@@ -419,6 +420,9 @@ Commands:
|
|
|
419
420
|
audit <url> scan a DEPLOYED site for leaked secrets, exposed
|
|
420
421
|
source and unprotected JavaScript, streaming the
|
|
421
422
|
findings as they land. \`afterpack audit --help\`.
|
|
423
|
+
network keygen print a key pair for network protection, which
|
|
424
|
+
arrives in a later release.
|
|
425
|
+
\`afterpack network --help\`.
|
|
422
426
|
|
|
423
427
|
Options:
|
|
424
428
|
${optionLines()}
|
|
@@ -468,7 +472,11 @@ function resolveOutputMode(input) {
|
|
|
468
472
|
}
|
|
469
473
|
const env = parseEnvOptions(input.env);
|
|
470
474
|
const cli = parseCliOptions([...input.argv]);
|
|
471
|
-
const config =
|
|
475
|
+
const config = mergeLayers([
|
|
476
|
+
file.config,
|
|
477
|
+
env.config,
|
|
478
|
+
cli.config
|
|
479
|
+
]);
|
|
472
480
|
return {
|
|
473
481
|
mode: outputModeOf(config),
|
|
474
482
|
issues: [
|
|
@@ -1837,26 +1845,93 @@ function acquireLock(path, notice) {
|
|
|
1837
1845
|
} };
|
|
1838
1846
|
}
|
|
1839
1847
|
|
|
1848
|
+
//#endregion
|
|
1849
|
+
//#region src/network.ts
|
|
1850
|
+
const NETWORK_USAGE = "usage: afterpack network keygen [--diagnostics.format=text|json]";
|
|
1851
|
+
const NETWORK_HELP = `${NETWORK_USAGE}
|
|
1852
|
+
|
|
1853
|
+
Prepares network protection, which arrives in a later release: a Pro build will
|
|
1854
|
+
seal the app's own API and socket traffic to your server's public key.
|
|
1855
|
+
|
|
1856
|
+
Commands:
|
|
1857
|
+
keygen print a new key pair (X25519, base64url, 32 bytes
|
|
1858
|
+
each) from the OS random source. Writes nothing.
|
|
1859
|
+
|
|
1860
|
+
The private key belongs only in your server's secret store, never in git.
|
|
1861
|
+
|
|
1862
|
+
Options:
|
|
1863
|
+
--diagnostics.format=<text|json> json prints ONE document on stdout
|
|
1864
|
+
--help, -h this help
|
|
1865
|
+
|
|
1866
|
+
Exit codes: 0 on success, 64 on a usage error.
|
|
1867
|
+
|
|
1868
|
+
${dim(CONTACT_FOOTER)}`;
|
|
1869
|
+
function generateNetworkKeyPair() {
|
|
1870
|
+
const { publicKey, privateKey } = generateKeyPairSync("x25519");
|
|
1871
|
+
const publicJwk = publicKey.export({ format: "jwk" });
|
|
1872
|
+
const privateJwk = privateKey.export({ format: "jwk" });
|
|
1873
|
+
if (typeof publicJwk.x !== "string" || typeof privateJwk.d !== "string") throw new Error("the X25519 key pair did not export");
|
|
1874
|
+
return {
|
|
1875
|
+
publicKey: publicJwk.x,
|
|
1876
|
+
privateKey: privateJwk.d
|
|
1877
|
+
};
|
|
1878
|
+
}
|
|
1879
|
+
function keygen(deps) {
|
|
1880
|
+
const pair = generateNetworkKeyPair();
|
|
1881
|
+
if (deps.mode.format === "json") {
|
|
1882
|
+
emitJson(deps.logger, {
|
|
1883
|
+
schemaVersion: JSON_SCHEMA_VERSION,
|
|
1884
|
+
afterpack: deps.version,
|
|
1885
|
+
command: "network",
|
|
1886
|
+
exitCode: EXIT.ok,
|
|
1887
|
+
ok: true,
|
|
1888
|
+
files: [],
|
|
1889
|
+
diagnostics: [],
|
|
1890
|
+
summary: {
|
|
1891
|
+
publicKey: pair.publicKey,
|
|
1892
|
+
privateKey: pair.privateKey
|
|
1893
|
+
},
|
|
1894
|
+
artifacts: {}
|
|
1895
|
+
});
|
|
1896
|
+
return EXIT.ok;
|
|
1897
|
+
}
|
|
1898
|
+
deps.logger.log(`publicKey ${pair.publicKey}`);
|
|
1899
|
+
deps.logger.log(`privateKey ${pair.privateKey}`);
|
|
1900
|
+
deps.logger.log("");
|
|
1901
|
+
deps.logger.log(dim("the private key goes ONLY in your server's secret store, never in git"));
|
|
1902
|
+
return EXIT.ok;
|
|
1903
|
+
}
|
|
1904
|
+
function network(deps) {
|
|
1905
|
+
const [command, ...rest] = deps.positionals;
|
|
1906
|
+
if (command !== "keygen") return commandFailure(deps, "network", EXIT.usage, "UNKNOWN_COMMAND", command === void 0 ? "`afterpack network` takes a command" : `\`${command}\` is not an \`afterpack network\` command`, NETWORK_USAGE);
|
|
1907
|
+
if (rest.length > 0) return commandFailure(deps, "network", EXIT.usage, "TOO_MANY_ARGUMENTS", `\`afterpack network ${command}\` takes no arguments, got ${rest.join(" ")}`, NETWORK_USAGE);
|
|
1908
|
+
return keygen(deps);
|
|
1909
|
+
}
|
|
1910
|
+
|
|
1840
1911
|
//#endregion
|
|
1841
1912
|
//#region src/package-manager.ts
|
|
1842
1913
|
const NPM = {
|
|
1843
1914
|
name: "npm",
|
|
1844
1915
|
install: (pkg) => `npm install -D ${pkg}`,
|
|
1916
|
+
add: (pkg) => `npm install ${pkg}`,
|
|
1845
1917
|
run: (script) => `npm run ${script}`
|
|
1846
1918
|
};
|
|
1847
1919
|
const PNPM = {
|
|
1848
1920
|
name: "pnpm",
|
|
1849
1921
|
install: (pkg) => `pnpm add -D ${pkg}`,
|
|
1922
|
+
add: (pkg) => `pnpm add ${pkg}`,
|
|
1850
1923
|
run: (script) => `pnpm ${script}`
|
|
1851
1924
|
};
|
|
1852
1925
|
const YARN = {
|
|
1853
1926
|
name: "yarn",
|
|
1854
1927
|
install: (pkg) => `yarn add -D ${pkg}`,
|
|
1928
|
+
add: (pkg) => `yarn add ${pkg}`,
|
|
1855
1929
|
run: (script) => `yarn ${script}`
|
|
1856
1930
|
};
|
|
1857
1931
|
const BUN = {
|
|
1858
1932
|
name: "bun",
|
|
1859
1933
|
install: (pkg) => `bun add -d ${pkg}`,
|
|
1934
|
+
add: (pkg) => `bun add ${pkg}`,
|
|
1860
1935
|
run: (script) => `bun run ${script}`
|
|
1861
1936
|
};
|
|
1862
1937
|
function lockfileAt(dir) {
|
|
@@ -2395,7 +2470,7 @@ function verify(deps) {
|
|
|
2395
2470
|
//#region src/run.ts
|
|
2396
2471
|
const DIRECTIVES_UNSUPPORTED = "the CLI obfuscates already-built output, where the `/* @afterpack */` comments are gone and no source map places them. Use a bundler plugin, which captures them before minification.";
|
|
2397
2472
|
const NOT_A_COMMAND = { obfuscate: "obfuscation IS the bare command — write `afterpack <path>`, or `afterpack` with no path to obfuscate the build output it detects" };
|
|
2398
|
-
const COMMAND_HINT = "the commands are `verify`, `restore` and `
|
|
2473
|
+
const COMMAND_HINT = "the commands are `verify`, `restore`, `audit` and `network`; obfuscation is `afterpack <path>`, with no subcommand";
|
|
2399
2474
|
function unknownCommand(argv, cwd) {
|
|
2400
2475
|
const positionals = argv.filter((token) => !token.startsWith("-"));
|
|
2401
2476
|
const first = positionals[0];
|
|
@@ -2686,6 +2761,8 @@ async function runObfuscationAndBackup(input) {
|
|
|
2686
2761
|
clientVersion: input.version,
|
|
2687
2762
|
client: input.client,
|
|
2688
2763
|
seed: input.parsed.seed,
|
|
2764
|
+
seedFallback: input.parsed.seedFallback,
|
|
2765
|
+
key: input.parsed.key,
|
|
2689
2766
|
preset: input.parsed.preset,
|
|
2690
2767
|
complexity: input.parsed.complexity,
|
|
2691
2768
|
diagnostics: input.parsed.diagnostics?.level,
|
|
@@ -2869,7 +2946,7 @@ async function runHolding(deps, locks) {
|
|
|
2869
2946
|
return EXIT.ok;
|
|
2870
2947
|
}
|
|
2871
2948
|
const command = argv[0];
|
|
2872
|
-
if (command === "verify" || command === "audit" || command === "restore") return runSubcommand(command, argv.slice(1), {
|
|
2949
|
+
if (command === "verify" || command === "audit" || command === "restore" || command === "network") return runSubcommand(command, argv.slice(1), {
|
|
2873
2950
|
...deps,
|
|
2874
2951
|
cwd,
|
|
2875
2952
|
env,
|
|
@@ -2955,10 +3032,9 @@ async function runHolding(deps, locks) {
|
|
|
2955
3032
|
detail
|
|
2956
3033
|
});
|
|
2957
3034
|
if (resolved.positionals.length > 1) return refuseHere(EXIT.usage, "TOO_MANY_PATHS", `expected a single [path], got ${resolved.positionals.length}`, "Name one directory or one .js file; run it again for the second target.");
|
|
2958
|
-
const parsed = toRunOptions(resolved
|
|
3035
|
+
const parsed = toRunOptions(resolved);
|
|
2959
3036
|
const backupEnabled = parsed.artifactOptions.build?.backup ?? true;
|
|
2960
|
-
const
|
|
2961
|
-
const hasConfiguredKey = typeof configuredKey === "string" && configuredKey !== "" || typeof env.AFTERPACK_KEY === "string" && env.AFTERPACK_KEY !== "";
|
|
3037
|
+
const hasConfiguredKey = parsed.key !== null;
|
|
2962
3038
|
if (resolved.configFile) report.log(`afterpack: using ${documentPath(cwd, resolved.configFile)}`);
|
|
2963
3039
|
if (parsed.build?.autorun === false) {
|
|
2964
3040
|
if (mode.format === "json") {
|
|
@@ -3144,7 +3220,8 @@ async function runHolding(deps, locks) {
|
|
|
3144
3220
|
const SUBCOMMAND_HELP = {
|
|
3145
3221
|
verify: VERIFY_HELP,
|
|
3146
3222
|
restore: RESTORE_HELP,
|
|
3147
|
-
audit: AUDIT_HELP
|
|
3223
|
+
audit: AUDIT_HELP,
|
|
3224
|
+
network: NETWORK_HELP
|
|
3148
3225
|
};
|
|
3149
3226
|
async function runSubcommand(command, rest, deps) {
|
|
3150
3227
|
const { cwd, logger, version: version$1, env, stdout } = deps;
|
|
@@ -3186,6 +3263,14 @@ async function runSubcommand(command, rest, deps) {
|
|
|
3186
3263
|
mode,
|
|
3187
3264
|
version: version$1
|
|
3188
3265
|
});
|
|
3266
|
+
if (command === "network") return network({
|
|
3267
|
+
cwd,
|
|
3268
|
+
logger,
|
|
3269
|
+
report,
|
|
3270
|
+
positionals: args.positionals,
|
|
3271
|
+
mode,
|
|
3272
|
+
version: version$1
|
|
3273
|
+
});
|
|
3189
3274
|
return audit({
|
|
3190
3275
|
cwd,
|
|
3191
3276
|
positionals: args.positionals,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "afterpack",
|
|
3
|
-
"version": "1.0
|
|
3
|
+
"version": "1.1.0",
|
|
4
4
|
"description": "AfterPack CLI: obfuscate the JavaScript in any build output, verify a build before deploy, and scan a live site",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"bin": {
|
|
@@ -15,8 +15,8 @@
|
|
|
15
15
|
"dist"
|
|
16
16
|
],
|
|
17
17
|
"dependencies": {
|
|
18
|
-
"@afterpack/core": "~1.0
|
|
19
|
-
"@afterpack/integration-utils": "1.0
|
|
18
|
+
"@afterpack/core": "~1.1.0",
|
|
19
|
+
"@afterpack/integration-utils": "1.1.0"
|
|
20
20
|
},
|
|
21
21
|
"devDependencies": {
|
|
22
22
|
"@biomejs/biome": "2.4.4",
|