Skip to content

Commit

Permalink
upgrade serve and customize serve command (#2805)
Browse files Browse the repository at this point in the history
  • Loading branch information
Burnett2k authored Feb 15, 2024
1 parent 6e34169 commit a6ee1dd
Show file tree
Hide file tree
Showing 3 changed files with 325 additions and 28 deletions.
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

0 comments on commit a6ee1dd

Please sign in to comment.