Skip to content

Commit d3fd8ea

Browse files
committed
docs: Added self-hosting guide
1 parent 424e97d commit d3fd8ea

File tree

8 files changed

+3260
-70
lines changed

8 files changed

+3260
-70
lines changed

README.md

Lines changed: 16 additions & 46 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,8 @@
1111
</p>
1212
</div>
1313

14+
<!-- #region about -->
15+
1416
## About
1517

1618
This repository contains the source code of [os.prozilla.dev][demo] as well as multiple packages. You can find the main package at [`prozilla-os`][prozilla-os].
@@ -23,6 +25,10 @@ ProzillaOS is a web-based operating system inspired by Ubuntu Linux and Windows.
2325
<br />
2426
</div>
2527

28+
<!-- #endregion about -->
29+
30+
<!-- #region getting-started -->
31+
2632
## Getting started
2733

2834
Make sure you have [NodeJS](https://nodejs.org/en) (version v18.12 or higher) installed on your device.
@@ -37,8 +43,8 @@ Make sure you have [NodeJS](https://nodejs.org/en) (version v18.12 or higher) in
3743
2. Install package manager and dependencies
3844

3945
```
40-
npm i pnpm -g
41-
pnpm i
46+
npm install pnpm -g
47+
pnpm install
4248
```
4349

4450
3. Run project
@@ -49,8 +55,12 @@ Make sure you have [NodeJS](https://nodejs.org/en) (version v18.12 or higher) in
4955

5056
4. Test local dev server by visiting [localhost:3000](http://localhost:3000/)
5157

52-
> [!TIP]
53-
> If you encounter an error saying `module not found`, that probably means you haven't built the packages yet. In most cases, you can fix this by typing `pnpm run packages:build`.
58+
> [!WARNING]
59+
> In a local environment, ProzillaOS packages will try to import uncompiled versions of other ProzillaOS packages from their respective `src` directory. If this does not happen correctly and a package tries to import a compiled version of another package from its respective `dist` directory, you might run into an error message saying `module not found`. Executing the command `pnpm run packages:build` will compile each package into their `dist` directories and resolve this error.
60+
61+
<!-- #endregion getting-started -->
62+
63+
<!-- #region packages -->
5464

5565
## Packages
5666

@@ -84,48 +94,7 @@ These packages contains the source code of parts of the ProzillaOS website. They
8494
- [`@prozilla-os/demo`](./packages/demo/): Demo site
8595
- [`@prozilla-os/docs`](./packages/docs/): Documentation site
8696

87-
## Scripts
88-
89-
ProzillaOS uses the package manager [pnpm](https://pnpm.io/) to run scripts.
90-
91-
### Global
92-
93-
| Script | Description |
94-
| --- | --- |
95-
| <pre>pnpm&nbsp;run&nbsp;start</pre> | Run [`pnpm run demo:start`](#package-prozilla-os-demo). VSCode is configured to run this script whenever the project is opened.
96-
| <pre>pnpm&nbsp;run&nbsp;build</pre> | Build every package in sequential order.
97-
| <pre>pnpm&nbsp;run&nbsp;stage</pre> | Copy and combine the build of each package that comprises the website in the `dist` directory at the root.
98-
| <pre>pnpm&nbsp;run&nbsp;deploy</pre> | Clear the `dist` directory, stage each package that comprises the website, then deploy to GitHub pages. This should trigger a GitHub Action that deploys the build to production.
99-
100-
### Public packages
101-
102-
| Script | Description |
103-
| --- | --- |
104-
| <pre>pnpm&nbsp;run&nbsp;packages:build</pre> | Build all dependencies of the `prozilla-os` package in sequential order and output to respective `dist` directories.
105-
| <pre>pnpm&nbsp;run&nbsp;packages:update</pre> | Create a new changeset for packages and update their version accordingly.
106-
| <pre>pnpm&nbsp;run&nbsp;packages:release</pre> | Publish the latest versions of each package to the npm registry.
107-
108-
> [!TIP]
109-
> Use `pnpm --filter <package_selector> build` to build a sepecific subset of packages or a single package and output to respective `dist` directory/directories. For more information about selecting/filtering specific packages, read [pnpm's documentation on filtering](https://pnpm.io/filtering).
110-
111-
### Internal package: `@prozilla-os/demo`
112-
113-
| Script | Description |
114-
| --- | --- |
115-
| <pre>pnpm&nbsp;run&nbsp;demo:start</pre> | See [`pnpm run start`](./packages/demo/README.md#scripts)
116-
| <pre>pnpm&nbsp;run&nbsp;demo:build</pre> | See [`pnpm run build`](./packages/demo/README.md#scripts)
117-
| <pre>pnpm&nbsp;run&nbsp;demo:preview</pre> | See [`pnpm run preview`](./packages/demo/README.md#scripts)
118-
| <pre>pnpm&nbsp;run&nbsp;demo:stage</pre> | See [`pnpm run stage`](./packages/demo/README.md#scripts)
119-
| <pre>pnpm&nbsp;run&nbsp;demo:fetch</pre> | See [`pnpm run fetch`](./packages/demo/README.md#scripts)
120-
121-
### Internal package: `@prozilla-os/docs`
122-
123-
| Script | Description |
124-
| --- | --- |
125-
| <pre>pnpm&nbsp;run&nbsp;docs:start</pre> | See [`pnpm run start`](./packages/docs/README.md#scripts)
126-
| <pre>pnpm&nbsp;run&nbsp;docs:build</pre> | See [`pnpm run build`](./packages/docs/README.md#scripts)
127-
| <pre>pnpm&nbsp;run&nbsp;docs:preview</pre> | See [`pnpm run preview`](./packages/docs/README.md#scripts)
128-
| <pre>pnpm&nbsp;run&nbsp;docs:generate</pre> | See [`pnpm run generate`](./packages/docs/README.md#scripts)
97+
<!-- #endregion packages -->
12998

13099
## Links
131100

@@ -141,6 +110,7 @@ ProzillaOS uses the package manager [pnpm](https://pnpm.io/) to run scripts.
141110
These resources can help you get started with ProzillaOS.
142111

143112
- [Getting started guide](https://os.prozilla.dev/docs/guides/getting-started)
113+
- [Self-hosting guide](https://os.prozilla.dev/docs/guides/self-hosting)
144114
- [prozilla-os/ProzillaOS-boilerplate][boilerplate]: Boilerplate code for a React Vite app implementing ProzillaOS
145115

146116

packages/demo/README.md

Lines changed: 1 addition & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -15,17 +15,7 @@
1515

1616
**🔗 [os.prozilla.dev](https://os.prozilla.dev/)**
1717

18-
`@prozilla-os/demo` is a React Vite website that demonstrates the features of ProzillaOS.
19-
20-
## Scripts
21-
22-
| Script | Description |
23-
| --- | --- |
24-
| <pre>pnpm&nbsp;run&nbsp;start</pre> | Start Vite dev server at [localhost:3000](http://localhost:3000/). Changes to module will dynamically be hot-reloaded, so normally there is no need for hard-refreshes. VSCode is configured to run this script whenever the project is opened.
25-
| <pre>pnpm&nbsp;run&nbsp;build</pre> | Compile project using TypeScript and bundle all files into the `dist` directory, or the directory specified in config file. This directory can be uploaded to a web server.
26-
| <pre>pnpm&nbsp;run&nbsp;preview</pre> | Start web server with preview of build at [localhost:8080](http://localhost:8080/). Can be useful for validating build before deploying.
27-
| <pre>pnpm&nbsp;run&nbsp;stage</pre> | Execute [stage.ts](./scripts/stage.ts), which stages the build and prepares it for deployment. Script will generate a sitemap, robots.txt and all other necessary files.
28-
| <pre>pnpm&nbsp;run&nbsp;fetch</pre> | Fetch the repository tree using GitHub's API and store it as a JSON file that will be used to populate the virtual drive. More information can be found on the [virtual drive](./features/virtual-drive/README.md) page.
18+
`@prozilla-os/demo` is a React Vite website that demonstrates the features of ProzillaOS. For more information about this package, visit the [self-hosting guide](https://os.prozilla.dev/docs/guides/self-hosting).
2919

3020
## Links
3121

packages/demo/scripts/_utils/print.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { ANSI } from "@prozilla-os/core";
1+
import { ANSI } from "@prozilla-os/shared";
22

33
export type status = "error" | "info" | "file" | "success" | "start";
44

packages/docs/.vitepress/config.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,7 @@ export default defineConfig({
5454
items: [
5555
{ text: "Getting started", link: "/getting-started" },
5656
// { text: "Custom app", link: "/custom-app" },
57+
{ text: "Self-hosting", link: "/self-hosting" },
5758
]
5859
}]
5960
},

packages/docs/README.md

Lines changed: 1 addition & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -15,16 +15,7 @@
1515

1616
**🔗 [os.prozilla.dev/docs](https://os.prozilla.dev/docs)**
1717

18-
`@prozilla-os/docs` is a VitePress website that contains the documentation for ProzillaOS.
19-
20-
## Scripts
21-
22-
| Script | Description |
23-
| --- | --- |
24-
| <pre>pnpm&nbsp;run&nbsp;start</pre> | Start VitePress dev server at [localhost:3000](http://localhost:3000/). Changes to module will dynamically be hot-reloaded, so normally there is no need for hard-refreshes.
25-
| <pre>pnpm&nbsp;run&nbsp;build</pre> | Compile project using VitePress and output to the `dist` directory.
26-
| <pre>pnpm&nbsp;run&nbsp;preview</pre> | Start web server with preview of build at [localhost:8080](http://localhost:8080/). Can be useful for validating build before deploying.
27-
| <pre>pnpm&nbsp;run&nbsp;generate</pre> | Generate basic information files in JSON format to use as a base for writing the documentation and output to the `data` directory.
18+
`@prozilla-os/docs` is a VitePress website that contains the documentation for ProzillaOS. For more information about this package, visit the [self-hosting guide](https://os.prozilla.dev/docs/guides/self-hosting).
2819

2920
## Links
3021

0 commit comments

Comments
 (0)