@tryghost/signup-form 0.3.31 → 0.3.33
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 +6 -5
- package/package.json +4 -4
- package/umd/signup-form.min.js +11 -12
- package/umd/signup-form.min.js.map +0 -1
package/README.md
CHANGED
|
@@ -18,17 +18,18 @@ pnpm dev
|
|
|
18
18
|
|
|
19
19
|
This starts all frontend apps (including Signup Form.)
|
|
20
20
|
|
|
21
|
-
### Running the
|
|
21
|
+
### Running the standalone demo page
|
|
22
22
|
|
|
23
|
-
Run `pnpm dev` (in package folder) to start the development server
|
|
24
|
-
- This
|
|
25
|
-
|
|
23
|
+
Run `pnpm dev:standalone` (in this package folder) to start the standalone development server with HMR for testing/developing the form in isolation.
|
|
24
|
+
- This serves the demo page at http://localhost:6173
|
|
25
|
+
|
|
26
|
+
`pnpm dev` on its own (in this package folder) only builds `umd/signup-form.min.js` and watches for changes — it does not bind a port. The UMD is served by Caddy at http://localhost:2368/ghost/assets/signup-form/signup-form.min.js when you run `pnpm dev` from the monorepo root.
|
|
26
27
|
|
|
27
28
|
### Using the UMD build during development
|
|
28
29
|
|
|
29
30
|
Vite by default only supports HRM with an ESM output. But when loading a script on a site as a ESM module (`<script type="module" src="...">`), you don't have access to `document.currentScript` inside the script, which is required to determine the location to inject the iframe. In development mode we use a workaround for this to make the ESM HMR work. But this workaround is not suitable for production.
|
|
30
31
|
|
|
31
|
-
To test the real production behaviour without this hack, you can use http://localhost:6173/preview.html.
|
|
32
|
+
To test the real production behaviour without this hack, you can use http://localhost:6173/preview.html (served by `pnpm dev:standalone`). The page loads the production UMD via `<script src="http://localhost:2368/ghost/assets/signup-form/signup-form.min.js">`, which is served by Caddy when `pnpm dev` is also running from the monorepo root. Both processes need to be up at the same time.
|
|
32
33
|
|
|
33
34
|
## Develop
|
|
34
35
|
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@tryghost/signup-form",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "0.3.
|
|
4
|
+
"version": "0.3.33",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"repository": {
|
|
7
7
|
"type": "git",
|
|
@@ -47,7 +47,7 @@
|
|
|
47
47
|
"tailwindcss": "3.4.19",
|
|
48
48
|
"vite": "7.3.2",
|
|
49
49
|
"vite-plugin-svgr": "4.5.0",
|
|
50
|
-
"vitest": "4.1.
|
|
50
|
+
"vitest": "4.1.9",
|
|
51
51
|
"@tryghost/i18n": "0.0.0"
|
|
52
52
|
},
|
|
53
53
|
"nx": {
|
|
@@ -57,8 +57,8 @@
|
|
|
57
57
|
]
|
|
58
58
|
},
|
|
59
59
|
"scripts": {
|
|
60
|
-
"dev": "
|
|
61
|
-
"
|
|
60
|
+
"dev": "vite build --watch --mode development",
|
|
61
|
+
"dev:standalone": "vite --port 6173",
|
|
62
62
|
"dev:test": "vite build && vite preview --port 6175",
|
|
63
63
|
"build": "tsc && vite build",
|
|
64
64
|
"lint": "pnpm run lint:js",
|