-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix: minor monorepo improvements (#111)
* Moved boilerplate, removed unused line in biome * Add SSR cmd to boilerplate readme * Added bin script * Cleanup biome config * update lockfile * Revert "update lockfile" This reverts commit a875ce7. * add CLI build script for renderer entrypoint * Add note about bin script issue resolution --------- Co-authored-by: Julie Muzina <[email protected]>
- Loading branch information
Showing
25 changed files
with
49 additions
and
24 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
## React Vite Boilerplate | ||
|
||
This project provides a template that can be used to quickly create a React Vite | ||
application using the standard set of shared Canonical packages. | ||
|
||
#### Running the boilerplate | ||
|
||
Run `bun run dev` to run a live development server with HMR. | ||
|
||
Run `bun run serve` to run a server-side rendered version of the app using the [React SSR](../../../packages/react/ssr) package. | ||
|
||
##### Build/Serve commands | ||
|
||
Two mechanisms for building/serving the application are supported: | ||
- CLI-based: Invoke `@canonical/react-ssr`'s `serve-express` bin script to create an express server. | ||
- Middleware-based: Call `@canonical/react-ssr`'s `serveStream()` function to create a middleware that can be used with an existing express server. | ||
|
||
In both cases, the client is built the same way (`bun run build:client`). | ||
The server is built differently depending on the approach: | ||
- CLI-based: The server's SSR renderercd module is the entry point. Built with `bun run build:server:cli`, served with `bun run serve:cli`. | ||
- Middleware-based: The server's server script is the entry point. Built with `bun run build:server:middleware`, served with `bun run serve:middleware`. | ||
|
||
The current default behavior is to use the middleware-based approach. | ||
So, `bun run build:server` and `bun run serve` will use the middleware scripts. | ||
|
||
In the future, it is intended that the CLI-based approach will be the default, | ||
and the existing `server.ts` file will be moved to the SSR package as an example. | ||
|
||
##### Bin script issues | ||
|
||
You may run into an issue where `serve-express` is not linked in `node_modules/.bin` after running `bun i`. | ||
This will result in an error when running `bun run serve:cli`. | ||
|
||
To fix this, run `bun i` again. | ||
For more information, see [this documentation](https://github.com/jmuzina/bun-repro/tree/7c9f6eefae2843bc904eabc10db973b56f5e017f/repro/bin-scripts). |
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes
File renamed without changes
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,4 @@ | ||
{ | ||
"$schema": "https://biomejs.dev/schemas/1.9.4/schema.json", | ||
"extends": ["@canonical/biome-config"], | ||
"files": { | ||
"ignore": ["src/styles/normalize.css"] | ||
} | ||
"extends": ["@canonical/biome-config"] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,4 @@ | ||
{ | ||
"$schema": "https://biomejs.dev/schemas/1.9.4/schema.json", | ||
"extends": ["@canonical/biome-config"], | ||
"files": { | ||
"ignore": ["src/styles/normalize.css"] | ||
} | ||
"extends": ["@canonical/biome-config"] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -10,6 +10,9 @@ | |
"email": "[email protected]", | ||
"name": "Canonical Webteam" | ||
}, | ||
"bin": { | ||
"serve-express": "./dist/esm/server/serve-express.js" | ||
}, | ||
"repository": { | ||
"type": "git", | ||
"url": "https://github.com/canonical/ds25" | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,4 @@ | ||
{ | ||
"$schema": "https://biomejs.dev/schemas/1.9.4/schema.json", | ||
"extends": ["@canonical/biome-config"], | ||
"files": { | ||
"ignore": ["src/styles/normalize.css"] | ||
} | ||
"extends": ["@canonical/biome-config"] | ||
} |