Переглянути джерело

Merge pull request #372 from nyedidikeke/naming-convention-patch-1

refactor: nomenclature, typo fixes, IDE and documentation enhancement 🔨
Nariman Jelveh 1 рік тому
батько
коміт
321520741d

+ 1 - 1
.env.example

@@ -1 +1 @@
-PORT=4000
+PORT=4000

+ 17 - 1
.gitignore

@@ -1,12 +1,28 @@
+# Misc
 .DS_Store
 .DS_Store
+
+# Dependencies
 node_modules/
 node_modules/
+
 *.zip
 *.zip
 *.tgz
 *.tgz
 license.config.json
 license.config.json
 license-header.txt
 license-header.txt
+
+# Build Outputs
 dist/
 dist/
-.vscode/
+
+# VS Code IDE
+.vscode/**/*
+!.vscode/extensions.json
+!.vscode/launch.json
+!.vscode/settings.json
+!.vscode/tasks.json
+
+# Local env files
 .env
 .env
+!.env.example
+
 # this is for jetbrain IDEs
 # this is for jetbrain IDEs
 .idea/
 .idea/
 /puter
 /puter

+ 7 - 0
.vscode/settings.json

@@ -0,0 +1,7 @@
+{
+    "cSpell.words": [
+        "dnsmasq",
+        "heyputer",
+        "Puter"
+    ]
+}

+ 1 - 0
README.md

@@ -45,6 +45,7 @@ an invalid setup.
 ```bash
 ```bash
 git clone https://github.com/HeyPuter/puter
 git clone https://github.com/HeyPuter/puter
 cd puter
 cd puter
+cp .env.example .env
 npm install
 npm install
 npm start
 npm start
 ```
 ```

+ 4 - 4
doc/self-hosters/domains.md

@@ -1,4 +1,4 @@
-# Configurating Domains for Self-Hosted Puter
+# Configuring Domains for Self-Hosted Puter
 
 
 ## Local Network Configuration
 ## Local Network Configuration
 
 
@@ -51,7 +51,7 @@ Setting up a local DNS server on your network allows for flexible and scalable d
 
 
 - **Pi-hole**: Acts as both an ad-blocker and a DNS server. Ideal for easy setup and maintenance.
 - **Pi-hole**: Acts as both an ad-blocker and a DNS server. Ideal for easy setup and maintenance.
 - **BIND9**: Offers comprehensive DNS server capabilities for complex setups.
 - **BIND9**: Offers comprehensive DNS server capabilities for complex setups.
-- **Dnsmasq**: Lightweight and suitable for smaller networks or those new to running a DNS server.
+- **dnsmasq**: Lightweight and suitable for smaller networks or those new to running a DNS server.
 
 
 **contributors note:** feel free to add any software you're aware of
 **contributors note:** feel free to add any software you're aware of
 which might help with this to the list. Also, feel free to add instructions here for specific software; our goal is for Puter to be easy to setup with tools you're already familiar with.
 which might help with this to the list. Also, feel free to add instructions here for specific software; our goal is for Puter to be easy to setup with tools you're already familiar with.
@@ -60,7 +60,7 @@ which might help with this to the list. Also, feel free to add instructions here
 
 
 1. Choose and install DNS server software on a device within your network.
 1. Choose and install DNS server software on a device within your network.
 2. Configure the DNS server to resolve `puter.local` and `api.puter.local` to the IP address of your Puter hosting device.
 2. Configure the DNS server to resolve `puter.local` and `api.puter.local` to the IP address of your Puter hosting device.
-3. Update your routers DHCP settings to distribute the DNS server's IP address to all devices on the network.
+3. Update your router's DHCP settings to distribute the DNS server's IP address to all devices on the network.
 
 
 By setting up a local DNS server, you gain the most flexibility and control over your network's domain name resolution, ensuring that all devices can access Puter and its API without manual configuration.
 By setting up a local DNS server, you gain the most flexibility and control over your network's domain name resolution, ensuring that all devices can access Puter and its API without manual configuration.
 
 
@@ -68,5 +68,5 @@ By setting up a local DNS server, you gain the most flexibility and control over
 
 
 Please note the self-hosting feature is still in alpha and a public production
 Please note the self-hosting feature is still in alpha and a public production
 deployment is not recommended at this time. However, if you wish to host
 deployment is not recommended at this time. However, if you wish to host
-publically you can do so following the same steps you normally would to configure
+publicly you can do so following the same steps you normally would to configure
 a domain name and ensuring the `api` subdomain points to the server as well.
 a domain name and ensuring the `api` subdomain points to the server as well.

+ 2 - 2
packages/backend/doc/contributors/index.md

@@ -55,8 +55,8 @@ If your answer is the second, you should find a way to
 In my experience, the harder I think about the correct way to implement
 In my experience, the harder I think about the correct way to implement
 something, the bigger a mistake I'm going to make; ***unless*** a big part
 something, the bigger a mistake I'm going to make; ***unless*** a big part
 of the reason I'm thinking so hard is because I want to find a solution
 of the reason I'm thinking so hard is because I want to find a solution
-that reduces complexity and has the right maintanence trade-off.
+that reduces complexity and has the right maintenance trade-off.
 There's no easy solution for this so just keep it in mind; there are some
 There's no easy solution for this so just keep it in mind; there are some
 things we might write 2 times, 3 times, even more times over before we
 things we might write 2 times, 3 times, even more times over before we
 really get it right and *that's okay*; sometimes part of doing useful work is
 really get it right and *that's okay*; sometimes part of doing useful work is
-doing the useless work that reveals what the useful work is.
+doing the useless work that reveals what the useful work is.

+ 2 - 2
packages/backend/exports.js

@@ -20,7 +20,7 @@ const CoreModule = require("./src/CoreModule.js");
 const { Kernel } = require("./src/Kernel.js");
 const { Kernel } = require("./src/Kernel.js");
 const DatabaseModule = require("./src/DatabaseModule.js");
 const DatabaseModule = require("./src/DatabaseModule.js");
 const LocalDiskStorageModule = require("./src/LocalDiskStorageModule.js");
 const LocalDiskStorageModule = require("./src/LocalDiskStorageModule.js");
-const SelfhostedModule = require("./src/SelfhostedModule.js");
+const SelfHostedModule = require("./src/SelfHostedModule.js");
 const PuterDriversModule = require("./src/PuterDriversModule.js");
 const PuterDriversModule = require("./src/PuterDriversModule.js");
 const { testlaunch } = require("./src/index.js");
 const { testlaunch } = require("./src/index.js");
 const BaseService = require("./src/services/BaseService.js");
 const BaseService = require("./src/services/BaseService.js");
@@ -45,5 +45,5 @@ module.exports = {
     DatabaseModule,
     DatabaseModule,
     PuterDriversModule,
     PuterDriversModule,
     LocalDiskStorageModule,
     LocalDiskStorageModule,
-    SelfhostedModule,
+    SelfHostedModule,
 };
 };

+ 2 - 2
packages/backend/packages/puter-js-common/README.md

@@ -1,7 +1,7 @@
 # Puter - Common Javascript Module
 # Puter - Common Javascript Module
 
 
 This is a small module for javascript which you might call a
 This is a small module for javascript which you might call a
-"langauge tool"; it adds some behavior to make javascript classes
+"language tool"; it adds some behavior to make javascript classes
 more flexible, with an aim to avoid any significant complexity.
 more flexible, with an aim to avoid any significant complexity.
 
 
 Each class in this module is best described as an _idea_:
 Each class in this module is best described as an _idea_:
@@ -9,7 +9,7 @@ Each class in this module is best described as an _idea_:
 ### BasicBase
 ### BasicBase
 
 
 **BasicBase** is the idea that there should be a common way to
 **BasicBase** is the idea that there should be a common way to
-see the inheretence chain of the current instance, and obtain
+see the inheritance chain of the current instance, and obtain
 merged objects and arrays from static members of these classes.
 merged objects and arrays from static members of these classes.
 
 
 ### TraitBase
 ### TraitBase

+ 2 - 2
packages/backend/src/SelfhostedModule.js

@@ -1,7 +1,7 @@
 const { AdvancedBase } = require("@heyputer/puter-js-common");
 const { AdvancedBase } = require("@heyputer/puter-js-common");
 const config = require("./config");
 const config = require("./config");
 
 
-class SelfhostedModule extends AdvancedBase {
+class SelfHostedModule extends AdvancedBase {
     async install (context) {
     async install (context) {
         const services = context.get('services');
         const services = context.get('services');
 
 
@@ -63,4 +63,4 @@ class SelfhostedModule extends AdvancedBase {
     }
     }
 }
 }
 
 
-module.exports = SelfhostedModule;
+module.exports = SelfHostedModule;

+ 3 - 3
run-selfhosted.js

@@ -29,7 +29,7 @@ const surrounding_box = (col, lines) => {
     // Keeping track of WHY certain versions don't work
     // Keeping track of WHY certain versions don't work
     const ver_info = [
     const ver_info = [
         { under: 14, reasons: ['optional chaining is not available'] },
         { under: 14, reasons: ['optional chaining is not available'] },
-        { under: 16, reasons: ['diskusage package ABI mismatch'] },
+        { under: 16, reasons: ['disk usage package ABI mismatch'] },
     ];
     ];
 
 
     const lowest_allowed = Math.max(...ver_info.map(r => r.under));
     const lowest_allowed = Math.max(...ver_info.map(r => r.under));
@@ -59,7 +59,7 @@ const main = async () => {
         DatabaseModule,
         DatabaseModule,
         PuterDriversModule,
         PuterDriversModule,
         LocalDiskStorageModule,
         LocalDiskStorageModule,
-        SelfhostedModule
+        SelfHostedModule
     } = (await import('@heyputer/backend')).default;
     } = (await import('@heyputer/backend')).default;
 
 
     console.log('kerne', Kernel);
     console.log('kerne', Kernel);
@@ -68,7 +68,7 @@ const main = async () => {
     k.add_module(new DatabaseModule());
     k.add_module(new DatabaseModule());
     k.add_module(new PuterDriversModule());
     k.add_module(new PuterDriversModule());
     k.add_module(new LocalDiskStorageModule());
     k.add_module(new LocalDiskStorageModule());
-    k.add_module(new SelfhostedModule());
+    k.add_module(new SelfHostedModule());
     k.boot();
     k.boot();
 };
 };