@enhance-eng/sandbox 0.1.0 → 0.3.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 +14 -3
- package/dist/assets/overlay.js +47 -0
- package/dist/cli.js +1 -1
- package/dist/index.cjs +1 -1
- package/dist/index.d.cts +3 -5
- package/dist/index.d.ts +3 -5
- package/dist/index.js +1 -1
- package/dist/manifest.json +5 -5
- package/dist/postinstall.js +1 -0
- package/dist/sw-enhance.js +1 -0
- package/enhance.config.sample.json +4 -0
- package/package.json +6 -2
- package/dist/assets/overlay-bootstrap.b4f6bc7e22bc.js +0 -1
- package/dist/assets/overlay.816d478d8101.js +0 -47
- package/dist/assets/sw-enhance.13e926e196ee.js +0 -1
package/README.md
CHANGED
|
@@ -9,13 +9,24 @@ npm install @enhance-eng/sandbox
|
|
|
9
9
|
# or pnpm add @enhance-eng/sandbox
|
|
10
10
|
```
|
|
11
11
|
|
|
12
|
-
|
|
12
|
+
To keep the bundled assets current automatically, add an `enhance.config.json` at your project root and reinstall:
|
|
13
|
+
|
|
14
|
+
```json
|
|
15
|
+
{
|
|
16
|
+
"publicDir": "./public",
|
|
17
|
+
"swFilename": "sw-enhance.js"
|
|
18
|
+
}
|
|
19
|
+
```
|
|
20
|
+
|
|
21
|
+
The postinstall hook reads this file and copies the service worker (`sw-enhance.js`) plus overlay bundle (`assets/overlay.js`) into the configured directory. Rerunning `npm install` or bumping `@enhance-eng/sandbox` keeps both files up to date without any extra steps.
|
|
22
|
+
|
|
23
|
+
Prefer to run the sync manually? You can still call the CLI directly:
|
|
13
24
|
|
|
14
25
|
```bash
|
|
15
26
|
npx enhance-sandbox prepare-sw --public-dir ./public --filename sw-enhance.js
|
|
16
27
|
```
|
|
17
28
|
|
|
18
|
-
|
|
29
|
+
Both paths write the service worker and overlay bundle into your public directory.
|
|
19
30
|
|
|
20
31
|
## Initialise
|
|
21
32
|
|
|
@@ -39,7 +50,7 @@ When the page loads with `?enhance=1`, the runtime registers the service worker,
|
|
|
39
50
|
The package exposes an `enhance-sandbox` binary:
|
|
40
51
|
|
|
41
52
|
- `prepare-sw` – copy bundled assets into a public directory.
|
|
42
|
-
- `
|
|
53
|
+
- `manifest` – print the packaged asset metadata for templating or deploy verification.
|
|
43
54
|
|
|
44
55
|
Run `npx enhance-sandbox --help` to view all commands and options.
|
|
45
56
|
|