0
Fork 0
mirror of https://github.com/TryGhost/Ghost.git synced 2025-01-20 22:42:53 -05:00

Added support for yarn dev --signup

no issue

Added support for `--signup` to `yarn dev`. This will make sure that the signup form preview server is served (with rebuilding) and can be used in admin (instead of using the published version). This is also automatically started when using `yarn dev --all`, but with a twist:

If you only run `yarn dev --all`, it will only build and watch the production build of the signup form. If you use `yarn dev --signup` or `yarn dev --all --signup` it will also serve the demo app on `http://localhost:6173`.
This commit is contained in:
Simon Backx 2023-06-01 10:20:37 +02:00
parent 7e27d3f3e8
commit a2a79cec0e
3 changed files with 20 additions and 3 deletions

11
.github/dev.js vendored
View file

@ -82,6 +82,17 @@ if (DASH_DASH_ARGS.includes('portal') || DASH_DASH_ARGS.includes('all')) {
COMMAND_GHOST.env['portal__url'] = 'http://localhost:5368/umd/portal.min.js';
}
if (DASH_DASH_ARGS.includes('signup') || DASH_DASH_ARGS.includes('all')) {
commands.push({
name: 'signup-form',
command: DASH_DASH_ARGS.includes('signup') ? 'yarn dev' : 'yarn preview',
cwd: path.resolve(__dirname, '../ghost/signup-form'),
prefixColor: 'magenta',
env: {}
});
COMMAND_GHOST.env['signupForm__url'] = 'http://localhost:6174/signup-form.min.js';
}
if (DASH_DASH_ARGS.includes('announcement-bar') || DASH_DASH_ARGS.includes('announcementBar') || DASH_DASH_ARGS.includes('announcementbar') || DASH_DASH_ARGS.includes('all')) {
commands.push({
name: 'announcement-bar',

View file

@ -9,9 +9,15 @@ Embed a Ghost signup form on any site.
- Run `yarn` in Ghost monorepo root
- Run `yarn` in this directory
### Running the development version
### Running via Ghost `yarn dev` in root folder
Run `yarn dev` to start the development server to test/develop the form standalone.
You can automatically start the signup-form dev server when developing Ghost by running Ghost (in root folder) via `yarn dev --all`. This will only build the production build, without the demo site.
Running via `yarn dev --all --signup` or `yarn dev --signup` will also serve the demo site on `http://localhost:6173`.
### Running the development version only
Run `yarn dev` (in package folder) to start the development server to test/develop the form standalone.
- This will generate a demo site on http://localhost:6173
- This will build and watch the production build and host it on http://localhost:6174/signup-form.min.js (different port!)

View file

@ -18,6 +18,7 @@
},
"scripts": {
"dev": "concurrently \"vite --port 6173\" \"vite preview -l silent\" \"vite build --watch\"",
"preview": "concurrently \"vite preview -l silent\" \"vite build --watch\"",
"dev:test": "vite build && vite preview --port 6175",
"build": "tsc && vite build",
"lint": "yarn run lint:js",
@ -26,7 +27,6 @@
"test:e2e": "NODE_OPTIONS='--experimental-specifier-resolution=node --no-warnings' VITE_TEST=true playwright test",
"test:slowmo": "TIMEOUT=100000 PLAYWRIGHT_SLOWMO=100 yarn test:e2e --headed",
"test:e2e:full": "ALL_BROWSERS=1 yarn test:e2e",
"preview": "vite preview",
"storybook": "storybook dev -p 6006",
"build-storybook": "storybook build",
"preship": "yarn lint",