diff --git a/.npmrc b/.npmrc
index eb80caa..adaa2b5 100644
--- a/.npmrc
+++ b/.npmrc
@@ -1,2 +1,3 @@
git-checks=false
-node-linker=hoisted
\ No newline at end of file
+node-linker=hoisted
+ignore-workspace-root-check=true
\ No newline at end of file
diff --git a/package.json b/package.json
index 9ccd13c..53c2189 100644
--- a/package.json
+++ b/package.json
@@ -15,6 +15,7 @@
"build": "pnpm run packages:build && pnpm run docs:build && pnpm run site:build",
"predeploy": "rimraf dist",
"deploy": "pnpm run docs:build && pnpm run docs:stage && pnpm run site:deploy",
+ "publish": "pnpm vite-node packages/demo/scripts/deploy",
"site:start": "pnpm --filter prozilla-os-demo run start",
"site:build": "pnpm --filter prozilla-os-demo run build",
"site:preview": "pnpm --filter prozilla-os-demo run preview",
@@ -38,6 +39,9 @@
"type": "git",
"url": "git+https://github.com/Prozilla/ProzillaOS.git"
},
+ "dependencies": {
+ "pnpm": "^9.5.0"
+ },
"devDependencies": {
"@changesets/cli": "^2.27.5",
"@eslint/js": "^9.5.0",
@@ -67,5 +71,5 @@
"last 1 safari version"
]
},
- "packageManager": "pnpm@9.1.4"
+ "packageManager": "pnpm@9.5.0"
}
diff --git a/packages/docs/.vitepress/config.ts b/packages/docs/.vitepress/config.ts
index c5c518a..c5bf297 100644
--- a/packages/docs/.vitepress/config.ts
+++ b/packages/docs/.vitepress/config.ts
@@ -1,10 +1,14 @@
-import { defineConfig } from "vitepress";
+import { defineConfig, HeadConfig } from "vitepress";
+
+const TITLE = "ProzillaOS Docs";
+const DESCRIPTION = "Documentation for ProzillaOS and its packages.";
+const LOCALE = "en_US";
+const IMAGE = "https://os.prozilla.dev/assets/logo.png";
// https://vitepress.dev/reference/site-config
export default defineConfig({
- title: "ProzillaOS Docs",
-
- description: "Documentation for ProzillaOS and its packages.",
+ title: TITLE,
+ description: DESCRIPTION,
srcDir: "src",
@@ -50,8 +54,7 @@ export default defineConfig({
base: "/reference/",
items: [
{
- text: "Reference",
- collapsed: false,
+ text: "Overview",
items: [
{ text: "Configuration", link: "/configuration" },
]
@@ -64,6 +67,7 @@ export default defineConfig({
{
text: "System",
base: "/reference/classes/system/",
+ collapsed: true,
items: [
{ text: "App", link: "app" },
{ text: "AppsConfig", link: "apps-config" },
@@ -76,6 +80,14 @@ export default defineConfig({
{ text: "WindowsConfig", link: "windows-config" },
]
},
+ {
+ text: "Utils",
+ base: "/reference/classes/utils/",
+ collapsed: true,
+ items: [
+ { text: "Vector2", link: "vector2" },
+ ]
+ },
]
}
]
@@ -90,9 +102,17 @@ export default defineConfig({
editLink: {
pattern: "https://github.com/prozilla-os/ProzillaOS/edit/main/packages/docs/src/:path",
- text: "Edit this page on GitHub"
+ text: "Suggest changes to this page"
},
+ // lastUpdated: {
+ // text: "Updated at",
+ // formatOptions: {
+ // dateStyle: "short",
+ // timeStyle: "short"
+ // }
+ // },
+
socialLinks: [
{ icon: "github", link: "https://github.com/prozilla-os/ProzillaOS" },
{ icon: "discord", link: "https://discord.gg/JwbyQP4tdz" },
@@ -110,5 +130,37 @@ export default defineConfig({
message: "Built by Prozilla",
copyright: "Copyright © 2023-present Prozilla"
},
- }
+ },
+
+ transformPageData(pageData) {
+ pageData.frontmatter.head ??= [] as HeadConfig[];
+ const head = pageData.frontmatter.head as HeadConfig[];
+
+ const title = pageData.frontmatter.layout === "home"
+ ? TITLE
+ : `${pageData.title} | ${TITLE}`;
+ head.push(["meta", { name: "og:title", content: title }]);
+ head.push(["meta", { name: "twitter:title", content: title }]);
+
+ const description = pageData.frontmatter.description as string ?? DESCRIPTION;
+ head.push(["meta", { name: "og:description", content: description }]);
+ head.push(["meta", { name: "twitter:description", content: description }]);
+
+ const canonicalUrl = `https://os.prozilla.dev/docs/${pageData.relativePath}`
+ .replace(/index\.md$/, "")
+ .replace(/\.(md|html)$/, "");
+ head.push(["link", { rel: "canonical", href: canonicalUrl }]);
+ head.push(["meta", { name: "og:url", content: canonicalUrl }]);
+ head.push(["meta", { name: "twitter:url", content: canonicalUrl }]);
+
+ const locale = LOCALE;
+ head.push(["meta", { name: "og:locale", content: locale }]);
+
+ const image = pageData.frontmatter.image as string ?? IMAGE;
+ head.push(["meta", { name: "og:image", content: image }]);
+ head.push(["meta", { name: "twitter:image", content: image }]);
+
+ // Other meta data
+ head.push(["meta", { name: "og:type", content: "website" }]);
+ },
});
diff --git a/packages/docs/.vitepress/theme/style.css b/packages/docs/.vitepress/theme/style.css
index 1f5af27..b0cfaeb 100644
--- a/packages/docs/.vitepress/theme/style.css
+++ b/packages/docs/.vitepress/theme/style.css
@@ -272,6 +272,10 @@
* Custom styles
* -------------------------------------------------------------------------- */
+.custom-block {
+ border: none;
+ border-left: 5px solid;
+}
.custom-block > .custom-block-title {
display: flex;
@@ -308,3 +312,12 @@
.custom-block.warning {
--icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 512 512'%3E%3Cpath d='M256 32c14.2 0 27.3 7.5 34.5 19.8l216 368c7.3 12.4 7.3 27.7 .2 40.1S486.3 480 472 480H40c-14.3 0-27.6-7.7-34.7-20.1s-7-27.8 .2-40.1l216-368C228.7 39.5 241.8 32 256 32zm0 128c-13.3 0-24 10.7-24 24V296c0 13.3 10.7 24 24 24s24-10.7 24-24V184c0-13.3-10.7-24-24-24zm32 224a32 32 0 1 0 -64 0 32 32 0 1 0 64 0z'/%3E%3C/svg%3E")
}
+
+.VPTeamMembers.center {
+ display: flex;
+ justify-content: center;
+}
+
+.VPTeamMembers.center .container {
+ flex: 1;
+}
diff --git a/packages/docs/scripts/generateReferencePages.ts b/packages/docs/scripts/generateReferencePages.ts
new file mode 100644
index 0000000..891a00c
--- /dev/null
+++ b/packages/docs/scripts/generateReferencePages.ts
@@ -0,0 +1,98 @@
+import { ANSI } from "../../core/src/constants";
+import { name } from "../package.json";
+import { resolve } from "node:path";
+import fs from "node:fs";
+
+const OUTPUT_DIR = "cache";
+
+function getItemType(key: string, value: unknown): string | null {
+ if (/^[A-Z_]+$/.test(key))
+ return "Constant";
+
+ if (typeof value === "function") {
+ if (/^use([A-Z][a-z]*)+$/.test(key)) {
+ return "Hook";
+ } else if (/^[a-z]+([A-Z][a-z]*)+$/.test(key)) {
+ return "Function";
+ } else if (/^([A-Z][a-z]*)+$/.test(key)) {
+ return "Class";
+ }
+ }
+
+ return null;
+}
+
+function generateContent(key: string, value: unknown, type: string): string {
+ const content = [
+ "---",
+ "outline: deep",
+ "---"
+ ];
+
+ content.push(`\n# ${type}`);
+
+ return content.join("\n");
+}
+
+function generateReferencePage(key: string, value: unknown) {
+ const type = getItemType(key, value);
+ if (type == null) return;
+
+ let directory = "/";
+
+ switch (type) {
+ case "Constant":
+ directory = "/constants";
+ break;
+ case "Hook":
+ directory = "/hooks";
+ break;
+ case "Function":
+ directory = "/functions";
+ break;
+ case "Class":
+ directory = "/classes";
+ break;
+ }
+
+ try {
+ const path = resolve(__dirname, OUTPUT_DIR, directory);
+ if (!fs.existsSync(path)){
+ fs.mkdirSync(path, { recursive: true });
+ }
+
+ // fs.writeFileSync(path, generateContent(key, value, type), { flag: "w+" });
+ console.log(`- ${ANSI.fg.cyan}${path}${ANSI.reset}`);
+ } catch (error) {
+ console.log(`${ANSI.fg.red}⚠ Failed to generate page: ${key}${ANSI.reset}`);
+ }
+}
+
+async function generateReferencePages() {
+ try {
+ console.log(`Context: ${ANSI.decoration.bold}${name}${ANSI.reset}\n`);
+
+ console.log(`${ANSI.fg.yellow}Generating reference pages...${ANSI.reset}`);
+
+ const items = await import("packages/core/src/main");
+
+ for (const key in module) {
+ if (module.hasOwnProperty(key)) {
+ const item = module[key];
+ console.log(`Name: ${key}, Type: ${typeof item}, Source: ${modulePath}`);
+ }
+ }
+
+ // for (const [key, value] of Object.entries(items)) {
+ // generateReferencePage(key, value);
+ // }
+
+ console.log(`\n${ANSI.fg.green}✓ Completed generating reference pages${ANSI.reset}`);
+ } catch (error) {
+ console.error(error);
+ console.log(`${ANSI.fg.red}⚠ Reference pages generation failed${ANSI.reset}`);
+ process.exit(1);
+ }
+}
+
+generateReferencePages();
\ No newline at end of file
diff --git a/packages/docs/src/index.md b/packages/docs/src/index.md
index ab95e3f..0ec0d94 100644
--- a/packages/docs/src/index.md
+++ b/packages/docs/src/index.md
@@ -21,7 +21,7 @@ hero:
features:
- title: TypeScript
- details: ProzillaOS is powered by TypeScript's type-safety.
+ details: ProzillaOS is powered by TypeScript"s type-safety.
icon:
- title: Modular
details: ProzillaOS can be installed as separate modules with extensive customization.
@@ -33,3 +33,33 @@ features:
linkText: Learn more
---
+
+
+
+
+ Developers
+
+
+
\ No newline at end of file
diff --git a/packages/docs/src/reference/classes/system/app.md b/packages/docs/src/reference/classes/system/app.md
index 7cfdf14..413bff4 100644
--- a/packages/docs/src/reference/classes/system/app.md
+++ b/packages/docs/src/reference/classes/system/app.md
@@ -1,5 +1,6 @@
---
outline: deep
+description: "An application that can be run by ProzillaOS"
---
# Class [`App`](https://github.com/prozilla-os/ProzillaOS/blob/main/packages/core/src/features/system/configs/app.tsx)
@@ -24,9 +25,9 @@ Applications can be installed by adding them to the `apps` array in [`AppsConfig
- **windowContent** : `React.FC`
-- **windowOptions** : `object`
+- **windowOptions** : `object` (optional)
- - windowOptions.size : `Vector2`
+ - windowOptions.size : [`Vector2`](/reference/classes/utils/vector2)
## Properties
@@ -63,7 +64,7 @@ You can extend this object with any properties
#### Properties
-- windowOptions.size : `Vector2`
+- windowOptions.size : [`Vector2`](/reference/classes/utils/vector2)
### description : `string | null` {#description}
diff --git a/packages/docs/src/reference/classes/system/modals-config.md b/packages/docs/src/reference/classes/system/modals-config.md
index ff6751f..ce647bb 100644
--- a/packages/docs/src/reference/classes/system/modals-config.md
+++ b/packages/docs/src/reference/classes/system/modals-config.md
@@ -14,12 +14,12 @@ outline: deep
#### options
-- options.defaultDialogSize : `Vector2`
-- options.defaultFileSelectorSize : `Vector2`
+- options.defaultDialogSize : [`Vector2`](/reference/classes/utils/vector2)
+- options.defaultFileSelectorSize : [`Vector2`](/reference/classes/utils/vector2)
## Properties
-### defaultDialogSize : `Vector2` {#default-dialog-size}
+### defaultDialogSize : [`Vector2`](/reference/classes/utils/vector2) {#default-dialog-size}
Default size of a dialog box
@@ -29,7 +29,7 @@ Default size of a dialog box
> new Vector2(400, 200)
> ```
-### defaultFileSelectorSize : `Vector2` {#default-file-selector-size}
+### defaultFileSelectorSize : [`Vector2`](/reference/classes/utils/vector2) {#default-file-selector-size}
Default size of a file selector
diff --git a/packages/docs/src/reference/classes/system/windows-config.md b/packages/docs/src/reference/classes/system/windows-config.md
index 6ef665d..a85634b 100644
--- a/packages/docs/src/reference/classes/system/windows-config.md
+++ b/packages/docs/src/reference/classes/system/windows-config.md
@@ -16,7 +16,7 @@ outline: deep
- options.screenMargin : `number`
- options.titleSeparator : `string`
-- options.minScreenSize : `Vector2`
+- options.minScreenSize : [`Vector2`](/reference/classes/utils/vector2)
## Properties
@@ -38,7 +38,7 @@ A string that is placed between different parts of a window title
> "-"
> ```
-### minScreenSize : `Vector2` {#min-screen-size}
+### minScreenSize : [`Vector2`](/reference/classes/utils/vector2) {#min-screen-size}
If the user's screen is smaller than these values, windows will always be maximized
diff --git a/packages/docs/src/reference/classes/utils/vector2.md b/packages/docs/src/reference/classes/utils/vector2.md
new file mode 100644
index 0000000..0cfde3b
--- /dev/null
+++ b/packages/docs/src/reference/classes/utils/vector2.md
@@ -0,0 +1,83 @@
+---
+outline: deep
+---
+
+# Class [`Vector2`](https://github.com/prozilla-os/ProzillaOS/blob/main/packages/core/src/features/math/vector2.ts)
+
+## Constructor
+
+> `new Vector2(x, y)`
+
+### Parameters
+
+- **x** : `number`
+
+- **y** : `number` (optional)
+
+> [!TIP]
+> If you leave out the parameter `y`, the properties `x` and `y` will be set to the same value, e.g.:
+>
+> ```ts
+> new Vector2(10) --> new Vector2(10, 10)
+> ```
+
+## Properties
+
+### x : `number` {#x}
+
+### y : `number` {#y}
+
+### ZERO : `Vector2` {#zero}
+
+Returns a vector with each value set to zero
+
+> ```ts
+> Vector2.ZERO --> new Vector2(0, 0)
+> ```
+
+### clone : `Vector2` {#clone}
+
+Returns a clone of this vector
+
+## Methods
+
+### round () => `this` {#round}
+
+Round the values of this vector to full numbers
+
+> ```ts
+> new Vector2(3.6, 1.3) --> new Vector2(4, 1)
+> ```
+
+### getDistance (x : `number`, y : `number`) => `number` {#get-distance}
+### getDistance (vector2 : `Vector2`) => `number`
+
+Get the distance between this vector and another
+
+### add (vector2A : `Vector2`, vector2B: `Vector2`) => `Vector2` {#add}
+
+Add two vectors together
+
+### subtract (vector2A : `Vector2`, vector2B: `Vector2`) => `Vector2` {#subtract}
+
+Subtract two vectors
+
+### scale (vector2 : `Vector2`, scalar: `number`) => `Vector2` {#scale}
+
+Scale a vector
+
+### magnitude (vector2 : `Vector2`) => `number` {#magnitude}
+
+Get the magnitude of a vector
+
+### normalize (vector2 : `Vector2`) => `Vector2` {#normalize}
+
+Get the magnitude of a vector
+
+### sqrDistance (vector2A : `Vector2`, vector2B : `Vector2`) => `number` {#sqr-distance}
+
+Get the square distance of two vectors
+
+### lerp (vector2A : `Vector2`, vector2B : `Vector2`, t : `number`) => `Vector2` {#lerp}
+
+Lerp between two vectors
diff --git a/packages/docs/src/reference/configuration.md b/packages/docs/src/reference/configuration.md
index 471a621..ec2093b 100644
--- a/packages/docs/src/reference/configuration.md
+++ b/packages/docs/src/reference/configuration.md
@@ -6,9 +6,9 @@ outline: deep
To configure ProzillaOS, pass the following properties inside to the `config` prop on the `` component.
-## `` props
+## `` props {#prozillaos}
-### systemName : `string`
+### systemName : `string` {#system-name}
@@ -18,7 +18,7 @@ To configure ProzillaOS, pass the following properties inside to the `config` pr
> "ProzillaOS"
> ```
-### tagLine : `string`
+### tagLine : `string` {#tag-line}
diff --git a/packages/docs/tsconfig.json b/packages/docs/tsconfig.json
new file mode 100644
index 0000000..c2febf7
--- /dev/null
+++ b/packages/docs/tsconfig.json
@@ -0,0 +1,8 @@
+{
+ "extends": "../../tsconfig.json",
+ "compilerOptions": {
+ "baseUrl": "../..",
+ },
+ "include": ["src", ".vitepress", "scripts", "vite.config.ts"],
+ "exclude": ["node_modules"]
+}
\ No newline at end of file
diff --git a/packages/docs/typedoc.json b/packages/docs/typedoc.json
deleted file mode 100644
index 80db061..0000000
--- a/packages/docs/typedoc.json
+++ /dev/null
@@ -1,5 +0,0 @@
-{
- "entryPoints": ["../core/src/main.ts"],
- "out": "cache",
- "plugin": ["typedoc-plugin-markdown"],
-}
\ No newline at end of file
diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml
index c6fdedb..bed4cc8 100644
--- a/pnpm-lock.yaml
+++ b/pnpm-lock.yaml
@@ -7,6 +7,10 @@ settings:
importers:
.:
+ dependencies:
+ pnpm:
+ specifier: ^9.5.0
+ version: 9.5.0
devDependencies:
'@changesets/cli':
specifier: ^2.27.5
@@ -3129,6 +3133,11 @@ packages:
resolution: {integrity: sha512-HRDzbaKjC+AOWVXxAU/x54COGeIv9eb+6CkDSQoNTt4XyWoIJvuPsXizxu/Fr23EiekbtZwmh1IcIG/l/a10GQ==}
engines: {node: '>=8'}
+ pnpm@9.5.0:
+ resolution: {integrity: sha512-FAA2gwEkYY1iSiGHtQ0EKJ1aCH8ybJ7fwMzXM9dsT1LDoxPU/BSHlKKp2BVTAWAE5nQujPhQZwJopzh/wiDJAw==}
+ engines: {node: '>=18.12'}
+ hasBin: true
+
possible-typed-array-names@1.0.0:
resolution: {integrity: sha512-d7Uw+eZoloe0EHDIYoe+bQ5WXnGMOpmiZFTuMWCwpjzzkL2nTjcKiAk4hh8TjnGye2TwWOk3UXucZ+3rbmBa8Q==}
engines: {node: '>= 0.4'}
@@ -6758,6 +6767,8 @@ snapshots:
dependencies:
find-up: 4.1.0
+ pnpm@9.5.0: {}
+
possible-typed-array-names@1.0.0: {}
postcss-resolve-nested-selector@0.1.1: {}