@enhance-eng/sandbox 0.3.10 → 0.3.17-dev.test789

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 ADDED
@@ -0,0 +1,44 @@
1
+ # @enhance-eng/sandbox
2
+
3
+ Enhance sandbox library for adding preview functionality to your application.
4
+
5
+ **Supported frameworks:** React SPAs and statically generated sites. SSR is not supported.
6
+
7
+ ## Installation
8
+
9
+ ```bash
10
+ npm install @enhance-eng/sandbox
11
+ ```
12
+
13
+ ## Vite
14
+
15
+ Add the plugin to your Vite config:
16
+
17
+ ```typescript
18
+ // vite.config.ts
19
+ import { enhance } from "@enhance-eng/sandbox/vite";
20
+
21
+ export default defineConfig({
22
+ plugins: [enhance()],
23
+ });
24
+ ```
25
+
26
+ That's it. The plugin handles everything automatically.
27
+
28
+ ## Other Build Tools
29
+
30
+ For non-Vite setups, use the CLI to copy the required assets to your public directory:
31
+
32
+ ```bash
33
+ npx enhance-sandbox prepare-sw --public-dir ./public
34
+ ```
35
+
36
+ Then initialize Enhance in your application entry point:
37
+
38
+ ```typescript
39
+ import { Enhance } from "@enhance-eng/sandbox";
40
+
41
+ Enhance.init();
42
+ ```
43
+
44
+ Run the CLI as part of your build process to keep assets up to date.