Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

upgrade serve and customize serve command #2805

Merged
merged 1 commit into from
Feb 15, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 11 additions & 3 deletions docs/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,19 +16,27 @@ Note that paths in local development are based on a root of "/" but be careful w

## Want to see if you're ready to :shipit:?

First build the static site.
First, build the static site (within /docs folder):

```bash
yarn build
```
Once it builds successfully, serve it:
Once the build succeeds, serve it:

```bash
yarn serve
```
The staging and production sites are served from a nested path, e.g. `https://commerce.nearform.com/open-source/victory`. This step is important for validating that both the `basePath` used by the static HTML output and the `basename` used by the client-side router are working as expected.

This will render the docs site at `http://localhost:3000/open-source/victory/`. If you go to root (i.e. `http://localhost:3000/`), you will need to click through the browser's file explorer to `open-source/victory` to get to the site.

Note the staging and production sites are served from a nested path, e.g. `https://commerce.nearform.com/open-source/victory`. This step is important for validating that both the `basePath` used by the static HTML output and the `basename` used by the client-side router are working as expected.

## Deployment

### Preview Environments

Upon creating a Pull Request, a Vercel preview deployment is created and posted as a comment on the pull request to allow for testing changes.

### Production

This site is deployed with Vercel infrastructure and is automated with a repository trigger in the Formidable Labs Vercel account.
Expand Down
3 changes: 2 additions & 1 deletion docs/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@
"remark-frontmatter": "^1.3.0",
"remark-slug": "^5.1.1",
"rimraf": "^3.0.2",
"serve": "^10.0.0",
"serve": "^14.2.1",
"unist-util-select": "^1.5.0"
},
"resolutions": {
Expand All @@ -80,6 +80,7 @@
"license": "MIT",
"scripts": {
"start": "node --max-old-space-size=2048 node_modules/react-static/bin/react-static start",
"serve": "serve dist/",
"build": "node ./scripts/build.js",
"clean": "rimraf dist"
}
Expand Down
Loading
Loading