@ecmaos/kernel 0.2.4 → 0.2.6

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -63,10 +63,12 @@ The goal is to create a kernel and supporting apps that tie together modern web
63
63
 
64
64
  - `Apps`
65
65
  - These are full applications that are developed specifically to work with ecmaOS
66
+ - Refer to the full list of [official published apps on npm](https://www.npmjs.com/org/ecmaos-apps)
67
+ - See the [./APPS.md](./APPS.md) file for a list of community apps; submit a PR to add your app!
66
68
  - An app is an npm package, in which the bin file has a shebang line of `#!ecmaos:bin:app:myappname`
67
69
  - Its default export (or exported `main` function) will be called with the `ProcessEntryParams` object
68
- - They can be installed from the terminal using the `install` command, e.g. `# install @ecmaos-apps/boilerplate`
69
- - Run the installed app: `# /usr/bin/boilerplate arg1 arg2` *(absolute path not required)*
70
+ - They can be installed from the terminal using the `install` command, e.g. `# install @ecmaos-apps/code`
71
+ - Run the installed app (bins are linked to `/usr/bin`): `# code /root/hello.js`
70
72
  - During development, it can be useful to run a [Verdaccio](https://github.com/verdaccio/verdaccio) server to test local packages
71
73
  - To publish to Verdaccio, run `# npm publish --registry http://localhost:4873` in your app's development environment
72
74
  - Then to install from your local registry, run `# install @myscope/mypackage --registry http://localhost:4873`
@@ -77,15 +79,13 @@ The goal is to create a kernel and supporting apps that tie together modern web
77
79
  - The main idea is that data and custom code can be loaded into it from the OS for WASM-native performance, as well as providing various utilities
78
80
  - Confusingly, the Kernel loads the BIOS — not the other way around
79
81
 
80
- - `Core`
81
- - Core modules provide the system's essential functionality; this includes the kernel itself
82
- - Other core modules include BIOS, Jaffa, Metal, SWAPI, as well as the main `@ecmaos/types` package
83
-
84
82
  - `Commands`
85
83
  - Commands are small utilities that aren't quite full Apps, provided by the shell
86
84
  - Some builtin commands that exist now will be moved into separate apps over time
87
85
 
88
86
  - `Devices`
87
+ - Refer to the full list of [official devices on npm](https://www.npmjs.com/org/ecmaos-devices)
88
+ - See the [./DEVICES.md](./DEVICES.md) file for a list of community devices; submit a PR to add your device!
89
89
  - Devices get loaded on boot, e.g. `/dev/bluetooth`, `/dev/random`, `/dev/battery`, etc.
90
90
  - A device can support being "run" by a user, e.g. `# /dev/battery status`
91
91
  - Devices may also be directly read/written using `fs` methods, and will behave accordingly (or have no effect if not supported)
@@ -128,10 +128,12 @@ The goal is to create a kernel and supporting apps that tie together modern web
128
128
  - Authenticated and encrypted connections with JWK/JWE/JOSE
129
129
 
130
130
  - `Modules`
131
+ - Refer to the full list of [official modules on npm](https://www.npmjs.com/org/ecmaos-modules)
132
+ - See the [./MODULES.md](./MODULES.md) file for a list of community modules; submit a PR to add your module!
131
133
  - Modules are dynamically loaded into the kernel at boot and can be enabled or disabled
132
134
  - They are specified during build via the `VITE_KERNEL_MODULES` environment variable
133
- - e.g. `VITE_KERNEL_MODULES=@ecmaos-modules/sample@0.1.2,@your/package@1.2.3`
134
- - Versions must be exact and are mandatory - you cannot use NPM version specifiers
135
+ - e.g. `VITE_KERNEL_MODULES=@ecmaos-modules/boilerplate@0.1.0,@your/package@1.2.3`
136
+ - Versions must be pinned and are mandatory - you cannot use NPM version specifiers
135
137
  - They can provide additional functionality, devices, commands, etc.
136
138
  - They offer a [common interface](./core/types/modules.ts) for interacting with the kernel
137
139
  - Generally they should be written in [AssemblyScript](https://www.assemblyscript.org), but this isn't required
@@ -155,6 +157,20 @@ The goal is to create a kernel and supporting apps that tie together modern web
155
157
  - `Utils`
156
158
  - Utilities and configuration used during development
157
159
 
160
+ ## Important Files and Directories
161
+
162
+ - `/bin/`: Built-in commands
163
+ - `/bios/`: The BIOS filesystem
164
+ - `/boot/init`: A script that runs on boot
165
+ - `/dev/`: All devices are here
166
+ - `/etc/packages`: A list of installed packages to load on boot
167
+ - `/home/`: Contains user home directories
168
+ - `/proc/`: A directory containing various dynamic system information
169
+ - `/root/`: The home directory for the root user
170
+ - `/usr/bin/`: Executable packages get linked here
171
+ - `/usr/lib/`: All installed packages are here
172
+ - `/var/log/kernel.log`: The kernel log
173
+
158
174
  ## Command Examples
159
175
 
160
176
  ```sh
@@ -221,6 +237,22 @@ cat /dev/zero --bytes 10 > /dev/null
221
237
 
222
238
  Note: many device implementations are incomplete, but provide a solid starting point
223
239
 
240
+ ## Code Execution Example
241
+
242
+ ```sh
243
+ echo "window.alert('Hello, world!')" > /root/hello.js
244
+ load /root/hello.js
245
+ ```
246
+
247
+ ## App Development
248
+
249
+ The `apps` directory in the repository contains a number of examples of how to develop apps, but there are many approaches you could take.
250
+
251
+ - `@ecmaos-apps/boilerplate`: A minimal boilerplate app for developing new apps
252
+ - `@ecmaos-apps/code`: A simple code editor app using [Monaco](https://microsoft.github.io/monaco-editor/); serves as a good reference for more complex apps
253
+
254
+ Basically, your app's [bin](https://docs.npmjs.com/cli/v10/configuring-npm/package-json#bin) file has a `main` (or default) function export that is passed the kernel reference and can use it to interact with the system as needed. A shebang line of `#!ecmaos:bin:app:myappname` is required at the top of the bin file to identify it as an app.
255
+
224
256
  ## Early Days
225
257
 
226
258
  The kernel is currently in active development. It is not considered stable and the structure and API are very likely to change in unexpected and possibly unannounced ways until version 1.0.0. Use cautiously and at your own risk.
@@ -230,8 +262,9 @@ Things to keep in mind:
230
262
  - Things have changed a lot since the tests were written, so they need to be updated and fixed
231
263
  - The kernel is designed to be run in an environment with a DOM (i.e. a browser)
232
264
  - Many features are only available on Chromium-based browsers, and many more behind feature flags
265
+ - There will be a lot of technical challenges to overcome, and many things will first be implemented in a non-optimal way
233
266
  - Command interfaces won't match what you might be used to from a traditional Linux environment; not all commands and options are supported. Over time, Linuxish commands will be fleshed out and made to behave in a more familiar way.
234
- - Globbing doesn't work in the terminal yet
267
+ - Globbing doesn't work in the terminal yet, [but is supported at the filesystem level](https://zenfs.dev/core/functions/fs.promises.glob.html)
235
268
 
236
269
  ## Development
237
270
 
@@ -247,9 +280,9 @@ git clone https://github.com/ecmaos/ecmaos.git
247
280
  cd ecmaos && pnpm install
248
281
 
249
282
  # Run the dev server
250
- pnpm run dev
283
+ pnpm run dev:kernel
251
284
 
252
- # Run the docs server
285
+ # Run the docs server (optional)
253
286
  pnpm run dev:docs
254
287
 
255
288
  # Build
@@ -263,7 +296,9 @@ pnpm run test:bench
263
296
  pnpm run test:ui
264
297
 
265
298
  # Generate modules
299
+ turbo gen app # generate a new app template
266
300
  turbo gen device # generate a new device template
301
+ turbo gen module # generate a new module template
267
302
  ```
268
303
 
269
304
  Also see [turbo.json](./turbo.json) and [CONTRIBUTING.md](./CONTRIBUTING.md) for more information.
@@ -1,18 +1,18 @@
1
1
  {
2
- "_browser-CoSyrw7Q.js": {
3
- "file": "browser-CoSyrw7Q.js",
2
+ "_browser-C0q0NWWv.js": {
3
+ "file": "browser-C0q0NWWv.js",
4
4
  "name": "browser",
5
5
  "isDynamicEntry": true,
6
6
  "imports": [
7
- "_empty-DAF3BgdH.js"
7
+ "_empty-BMkCc_7L.js"
8
8
  ]
9
9
  },
10
- "_empty-DAF3BgdH.js": {
11
- "file": "empty-DAF3BgdH.js",
10
+ "_empty-BMkCc_7L.js": {
11
+ "file": "empty-BMkCc_7L.js",
12
12
  "name": "empty",
13
13
  "dynamicImports": [
14
- "_topbar.min-CYYqkupv.js",
15
- "_browser-CoSyrw7Q.js",
14
+ "_topbar.min-xBbuiIjv.js",
15
+ "_browser-C0q0NWWv.js",
16
16
  "src/tree/lib/commands/install.ts",
17
17
  "node_modules/.pnpm/figlet@1.8.0/node_modules/figlet/importable-fonts/Poison.js"
18
18
  ]
@@ -21,12 +21,12 @@
21
21
  "file": "kernel.css",
22
22
  "src": "_kernel.css"
23
23
  },
24
- "_topbar.min-CYYqkupv.js": {
25
- "file": "topbar.min-CYYqkupv.js",
24
+ "_topbar.min-xBbuiIjv.js": {
25
+ "file": "topbar.min-xBbuiIjv.js",
26
26
  "name": "topbar.min",
27
27
  "isDynamicEntry": true,
28
28
  "imports": [
29
- "_empty-DAF3BgdH.js"
29
+ "_empty-BMkCc_7L.js"
30
30
  ]
31
31
  },
32
32
  "node_modules/.pnpm/figlet@1.8.0/node_modules/figlet/importable-fonts/Poison.js": {
@@ -41,16 +41,16 @@
41
41
  "src": "src/tree/kernel.ts",
42
42
  "isEntry": true,
43
43
  "imports": [
44
- "_empty-DAF3BgdH.js"
44
+ "_empty-BMkCc_7L.js"
45
45
  ]
46
46
  },
47
47
  "src/tree/lib/commands/install.ts": {
48
- "file": "install--B0gJ8Dk.js",
48
+ "file": "install-C64fBUI2.js",
49
49
  "name": "install",
50
50
  "src": "src/tree/lib/commands/install.ts",
51
51
  "isDynamicEntry": true,
52
52
  "imports": [
53
- "_empty-DAF3BgdH.js"
53
+ "_empty-BMkCc_7L.js"
54
54
  ]
55
55
  },
56
56
  "src/ui.ts": {
@@ -59,7 +59,7 @@
59
59
  "src": "src/ui.ts",
60
60
  "isEntry": true,
61
61
  "imports": [
62
- "_empty-DAF3BgdH.js"
62
+ "_empty-BMkCc_7L.js"
63
63
  ]
64
64
  }
65
65
  }
@@ -1,4 +1,4 @@
1
- import { g as getDefaultExportFromCjs } from "./empty-DAF3BgdH.js";
1
+ import { g as getDefaultExportFromCjs } from "./empty-BMkCc_7L.js";
2
2
  var browser$2;
3
3
  var hasRequiredBrowser;
4
4
  function requireBrowser() {
@@ -20,4 +20,4 @@ const browser$1 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.definePro
20
20
  export {
21
21
  browser$1 as b
22
22
  };
23
- //# sourceMappingURL=browser-CoSyrw7Q.js.map
23
+ //# sourceMappingURL=browser-C0q0NWWv.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"browser-CoSyrw7Q.js","sources":["../node_modules/.pnpm/ws@8.18.0/node_modules/ws/browser.js"],"sourcesContent":["'use strict';\n\nmodule.exports = function () {\n throw new Error(\n 'ws does not work in the browser. Browser clients must use the native ' +\n 'WebSocket object'\n );\n};\n"],"names":["browser"],"mappings":";;;;;;AAEAA,cAAiB,WAAY;AAC3B,UAAM,IAAI;AAAA,MACR;AAAA,IAED;AAAA,EACF;;;;;;;;;","x_google_ignoreList":[0]}
1
+ {"version":3,"file":"browser-C0q0NWWv.js","sources":["../node_modules/.pnpm/ws@8.18.0/node_modules/ws/browser.js"],"sourcesContent":["'use strict';\n\nmodule.exports = function () {\n throw new Error(\n 'ws does not work in the browser. Browser clients must use the native ' +\n 'WebSocket object'\n );\n};\n"],"names":["browser"],"mappings":";;;;;;AAEAA,cAAiB,WAAY;AAC3B,UAAM,IAAI;AAAA,MACR;AAAA,IAED;AAAA,EACF;;;;;;;;;","x_google_ignoreList":[0]}