@afterpack/esbuild 0.1.0 → 0.2.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 CHANGED
@@ -28,8 +28,9 @@ Both `outdir` and `outfile` work. Builds with `write: false`, and builds that al
28
28
  skipped. If obfuscation fails, the build fails.
29
29
 
30
30
  esbuild has no hook to change output before it is written, so the plugin obfuscates the files right
31
- after esbuild writes them. For a few milliseconds the readable files are on disk, and a failed run
32
- leaves them there. If that matters to you, use a bundler with an in-memory plugin, such as
31
+ after esbuild writes them. Until the pass finishes (about a quarter of a second for 185 KB at the
32
+ default preset, longer at higher presets) the readable files are on disk, and a failed run leaves
33
+ them there. If that matters to you, use a bundler with an in-memory plugin, such as
33
34
  [`@afterpack/vite`](https://www.npmjs.com/package/@afterpack/vite) or
34
35
  [`@afterpack/rollup`](https://www.npmjs.com/package/@afterpack/rollup).
35
36
 
@@ -64,12 +65,14 @@ other option is in the [configuration reference](https://www.afterpack.dev/docs/
64
65
  [protectionMap.enabled]: https://www.afterpack.dev/docs/config#protectionMap-enabled
65
66
  [build.autorun]: https://www.afterpack.dev/docs/config#build-autorun
66
67
 
67
- `/* @afterpack */` directives need esbuild's `sourcemap: true`, since they are read back from the
68
- source map. Without it, the plugin skips them and tells you.
68
+ `/* @afterpack */` [directives](https://www.afterpack.dev/docs/directives) that raise protection for
69
+ a region are a [Pro](https://www.afterpack.dev/docs/pro) feature. They need esbuild's
70
+ `sourcemap: true`, since they are read back from the source map. Without it, the plugin skips them
71
+ and tells you.
69
72
 
70
73
  The [Protection Map](https://www.afterpack.dev/docs/protection-map) is written to `.afterpack/`,
71
- and the plugin adds its local artifacts to your `.gitignore`. The Protection Map and any backups
72
- contain your original source, so never deploy or commit them.
74
+ which carries its own `.gitignore` and self-ignores. The Protection Map and any backups contain
75
+ your original source, so never deploy or commit them.
73
76
 
74
77
  Options can also live in `afterpack.json` or in `AFTERPACK_*` environment variables. The options
75
78
  object wins over the environment, which wins over the file. An unknown or misspelled key fails the
@@ -77,11 +80,12 @@ build and names the right spelling.
77
80
 
78
81
  ## Pro
79
82
 
80
- Without a key, AfterPack runs on your machine and applies basic protection. Set
83
+ Without a key, AfterPack runs on your machine with the full pipeline at any preset. Set
81
84
  [`AFTERPACK_KEY`](https://www.afterpack.dev/docs/config#key) in your environment and the same plugin
82
- sends the build to AfterPack's cloud, which applies much stronger protection. Keep the key out of
83
- your build script: the plugin rejects it there. See [AfterPack
84
- Pro](https://www.afterpack.dev/docs/pro).
85
+ builds in AfterPack's cloud instead, which adds per-region
86
+ [directives](https://www.afterpack.dev/docs/directives) and two hardening transforms you can turn
87
+ on: self-integrity (anti-tamper) and comparison hardening. Keep the key out of your build script:
88
+ the plugin rejects it there. See [AfterPack Pro](https://www.afterpack.dev/docs/pro).
85
89
 
86
90
  ## Links
87
91
 
package/dist/index.cjs CHANGED
@@ -77,7 +77,7 @@ function afterpackEsbuild(options = {}) {
77
77
  client: (0, __afterpack_integration_utils.resolveClientIdentity)(require("url").pathToFileURL(__filename).href),
78
78
  telemetry: (0, __afterpack_integration_utils.createTelemetryReporter)(),
79
79
  label: "afterpack-esbuild",
80
- gitignoreDir: cwd,
80
+ cwd,
81
81
  startedAt: startedBeforeOutputWalk,
82
82
  combinedProtectionMap: {
83
83
  buildDir,
package/dist/index.js CHANGED
@@ -54,7 +54,7 @@ function afterpackEsbuild(options = {}) {
54
54
  client: resolveClientIdentity(import.meta.url),
55
55
  telemetry: createTelemetryReporter(),
56
56
  label: "afterpack-esbuild",
57
- gitignoreDir: cwd,
57
+ cwd,
58
58
  startedAt: startedBeforeOutputWalk,
59
59
  combinedProtectionMap: {
60
60
  buildDir,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@afterpack/esbuild",
3
- "version": "0.1.0",
3
+ "version": "0.2.0",
4
4
  "description": "esbuild plugin for AfterPack: obfuscate your JavaScript output when the esbuild build finishes",
5
5
  "type": "module",
6
6
  "main": "./dist/index.cjs",
@@ -28,8 +28,8 @@
28
28
  "esbuild": ">=0.17.0"
29
29
  },
30
30
  "dependencies": {
31
- "@afterpack/core": "~0.1.0",
32
- "@afterpack/integration-utils": "0.1.0"
31
+ "@afterpack/core": "~0.2.0",
32
+ "@afterpack/integration-utils": "0.2.0"
33
33
  },
34
34
  "devDependencies": {
35
35
  "@biomejs/biome": "2.4.4",