afterpack 0.2.6 → 1.0.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.
Files changed (3) hide show
  1. package/README.md +8 -8
  2. package/SKILL.md +5 -4
  3. package/package.json +4 -4
package/README.md CHANGED
@@ -46,7 +46,7 @@ Each run writes:
46
46
  `.afterpack/backup/` and don't read the new location; this version still restores the old one.
47
47
  Turn it off with [`--build.backup`][build.backup]`=false`.
48
48
  - `.afterpack/protectionMap.html`, the [Protection Map](https://www.afterpack.dev/docs/protection-map),
49
- when your build has source maps.
49
+ when your build has source maps (outside CI, unless `protectionMap.enabled` is `true`).
50
50
  - `.map` files next to the output, only when you ask for them with
51
51
  [`--sourceMap.enabled`][sourceMap.enabled] or run with `--build.mode=development` (or
52
52
  `NODE_ENV=development`) on a build that has source maps.
@@ -55,12 +55,12 @@ Every other run is a production run: it deletes your build's own source maps, hi
55
55
  and the `sourceMappingURL` comments that name them, so no original source ships beside the output.
56
56
 
57
57
  `.afterpack/` sits next to your project's lockfile, `afterpack.json` or `.git` (failing those, its
58
- `package.json`), otherwise beside the build directory, never inside it: `cd public && npx afterpack
59
- .` keeps it beside `public/`, and a `package.json` your build emits, such as Nitro's
60
- `.output/server/package.json`, never moves it. A single file in a project root that holds a
61
- lockfile, `afterpack.json` or `.git` keeps it in that root. The same place holds every run's files
62
- whatever directory you run from, so a second run over the same output, or over the same file, is
63
- refused from anywhere. A run fails if it finds a `.afterpack/` inside the output, and removes a
58
+ `package.json`), otherwise beside the build directory, never inside it:
59
+ `cd public && npx afterpack@latest .` keeps it beside `public/`, and a `package.json` your build
60
+ emits, such as Nitro's `.output/server/package.json`, never moves it. A single file in a project
61
+ root that holds a lockfile, `afterpack.json` or `.git` keeps it in that root. The same place holds
62
+ every run's files whatever directory you run from, so a second run over the same output, or over
63
+ the same file, is refused from anywhere. A run fails if it finds a `.afterpack/` inside the output, and removes a
64
64
  `.afterpack-protection.json` an older version left there.
65
65
 
66
66
  The backup and the Protection Map contain your original source. `.afterpack/` carries its own
@@ -128,7 +128,7 @@ An unknown or misspelled option fails the run and names the right spelling.
128
128
  | [`--paths.include`][paths.include] | globs to add back to the walk | none |
129
129
  | [`--identifiers.reserved`][identifiers.reserved] | names never to rename | none |
130
130
  | [`--build.backup`][build.backup] | back up originals to `.afterpack/backups/` | `true` |
131
- | [`--protectionMap.enabled`][protectionMap.enabled] | write the Protection Map | on when an input map exists |
131
+ | [`--protectionMap.enabled`][protectionMap.enabled] | write the Protection Map | on when an input map exists, outside CI |
132
132
 
133
133
  Each flag is also a key in `afterpack.json` and an `AFTERPACK_*` variable. Every other option is in
134
134
  the [configuration reference](https://www.afterpack.dev/docs/config). The
package/SKILL.md CHANGED
@@ -76,7 +76,8 @@ Rules:
76
76
  - `.afterpack/backups/<output dir>/`: the original files, on by default for the CLI, so
77
77
  `afterpack restore` can undo the run. `--build.backup=false` turns it off. Each output directory
78
78
  has its own backup and lock, so parallel builds of different apps don't collide.
79
- - `.afterpack/protectionMap.html`: the Protection Map report, when the build has source maps.
79
+ - `.afterpack/protectionMap.html`: the Protection Map report, when the build has source maps
80
+ (outside CI, unless `protectionMap.enabled` is `true`).
80
81
  - `.map` files beside the output, only with `--sourceMap.enabled` or on a development run
81
82
  (`--build.mode=development` or `NODE_ENV=development`) when an input map exists.
82
83
 
@@ -85,10 +86,10 @@ own source maps, hidden ones included, and the `sourceMappingURL` comments that
85
86
 
86
87
  Every front door puts `.afterpack/` next to the nearest lockfile, `afterpack.json` or `.git` above
87
88
  the build directory, failing those the nearest `package.json`, otherwise beside the build
88
- directory, never inside it (`cd public && npx afterpack .` keeps it beside `public/`). A
89
+ directory, never inside it (`cd public && npx afterpack@latest .` keeps it beside `public/`). A
89
90
  `package.json` the build emits, such as Nitro's `.output/server/package.json` or a dual package's
90
91
  `dist/cjs/package.json`, never moves it. For a single file, the file's own directory counts when it
91
- holds a lockfile, `afterpack.json` or `.git`, so `npx afterpack app.js` in such a root keeps
92
+ holds a lockfile, `afterpack.json` or `.git`, so `npx afterpack@latest app.js` in such a root keeps
92
93
  `.afterpack/` there. The place does not depend on the working directory, so a re-run over the same
93
94
  output or the same file is refused from anywhere. A run fails if it finds a `.afterpack/` inside
94
95
  the output, and removes a `.afterpack-protection.json` an older version left there.
@@ -124,7 +125,7 @@ minification.
124
125
  | [`identifiers.reserved`][identifiers.reserved] | names never to rename | `[]` |
125
126
  | [`build.backup`][build.backup] | keep originals in `.afterpack/backups/` | `true` for the CLI, `false` in plugins |
126
127
  | [`sourceMap.enabled`][sourceMap.enabled] | write `.map` files | off; on in development mode when an input map exists |
127
- | [`protectionMap.enabled`][protectionMap.enabled] | write the Protection Map | on when an input map exists |
128
+ | [`protectionMap.enabled`][protectionMap.enabled] | write the Protection Map | on when an input map exists, outside CI |
128
129
  | [`diagnostics.format`][diagnostics.format] | `text` or `json` | `text` |
129
130
  | [`diagnostics.level`][diagnostics.level] | `summary`, `all` or `none` (errors still print) | `summary` |
130
131
  | [`build.autorun`][build.autorun] | `false` turns AfterPack off for the project, CLI and plugins alike | `true` |
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "afterpack",
3
- "version": "0.2.6",
3
+ "version": "1.0.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": {
@@ -14,15 +14,15 @@
14
14
  "dist"
15
15
  ],
16
16
  "dependencies": {
17
- "@afterpack/core": "~0.2.7",
18
- "@afterpack/integration-utils": "0.2.6"
17
+ "@afterpack/core": "~1.0.0",
18
+ "@afterpack/integration-utils": "1.0.0"
19
19
  },
20
20
  "devDependencies": {
21
21
  "@biomejs/biome": "2.4.4",
22
22
  "@types/node": "^22.0.0",
23
23
  "tsdown": "^0.11.0",
24
24
  "typescript": "^5.0.0",
25
- "vitest": "^2.0.0"
25
+ "vitest": "^4.1.12"
26
26
  },
27
27
  "engines": {
28
28
  "node": ">=18"