@tryghost/signup-form 0.3.277 → 0.3.279
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 +11 -20
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -6,46 +6,37 @@ Embed a Ghost signup form on any site.
|
|
|
6
6
|
|
|
7
7
|
### Pre-requisites
|
|
8
8
|
|
|
9
|
-
- Run `pnpm` in Ghost monorepo root
|
|
10
|
-
- Run `pnpm` in this directory
|
|
9
|
+
- Run `pnpm setup` in the Ghost monorepo root
|
|
11
10
|
|
|
12
|
-
### Running via Ghost
|
|
11
|
+
### Running via Ghost from the monorepo root
|
|
12
|
+
|
|
13
|
+
Start Ghost with the public-app watchers enabled:
|
|
13
14
|
|
|
14
|
-
Signup Form runs automatically when using Ghost's development command from the monorepo root:
|
|
15
15
|
```bash
|
|
16
|
-
pnpm dev
|
|
16
|
+
pnpm dev:public
|
|
17
17
|
```
|
|
18
18
|
|
|
19
|
-
This starts
|
|
19
|
+
This starts the standard development environment and the Signup Form watcher.
|
|
20
20
|
|
|
21
21
|
### Running the standalone demo page
|
|
22
22
|
|
|
23
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
24
|
- This serves the demo page at http://localhost:6173
|
|
25
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
|
+
`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:public` from the monorepo root.
|
|
27
27
|
|
|
28
28
|
### Using the UMD build during development
|
|
29
29
|
|
|
30
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.
|
|
31
31
|
|
|
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.
|
|
33
|
-
|
|
34
|
-
## Develop
|
|
35
|
-
|
|
36
|
-
This is a monorepo package.
|
|
37
|
-
|
|
38
|
-
Follow the instructions for the top-level repo.
|
|
39
|
-
1. `git clone` this repo & `cd` into it as usual
|
|
40
|
-
2. Run `pnpm` to install top-level dependencies.
|
|
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:public` is also running from the monorepo root. Both processes need to be up at the same time.
|
|
41
33
|
|
|
42
34
|
## Test
|
|
43
35
|
|
|
44
36
|
- `pnpm lint` run just eslint
|
|
45
|
-
- `pnpm test` run
|
|
46
|
-
- `pnpm test:
|
|
47
|
-
- `pnpm test:
|
|
48
|
-
- `pnpm test:e2e:full` run e2e tests on all browsers
|
|
37
|
+
- `pnpm test:acceptance` run acceptance tests on Chromium
|
|
38
|
+
- `pnpm test:acceptance:slowmo` run acceptance tests visually (headed) and slower on Chromium
|
|
39
|
+
- `pnpm test:acceptance:full` run acceptance tests on all configured browsers
|
|
49
40
|
|
|
50
41
|
## Release
|
|
51
42
|
|