@ecmaos/kernel 0.2.3 → 0.2.5

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`
@@ -86,58 +88,74 @@ The goal is to create a kernel and supporting apps that tie together modern web
86
88
  - Some builtin commands that exist now will be moved into separate apps over time
87
89
 
88
90
  - `Devices`
91
+ - Refer to the full list of [official devices on npm](https://www.npmjs.com/org/ecmaos-devices)
92
+ - See the [./DEVICES.md](./DEVICES.md) file for a list of community devices; submit a PR to add your device!
89
93
  - Devices get loaded on boot, e.g. `/dev/bluetooth`, `/dev/random`, `/dev/battery`, etc.
90
94
  - A device can support being "run" by a user, e.g. `# /dev/battery status`
91
95
  - Devices may also be directly read/written using `fs` methods, and will behave accordingly (or have no effect if not supported)
92
96
  - An individual device module can provide multiple device drivers, e.g. `/dev/usb` provides `/dev/usb-mydevice-0001-0002`
93
97
 
98
+ - `Generators`
99
+ - Generators are used to scaffold new apps, devices, modules, etc.
100
+ - They are located in the `turbo/generators` directory of the repository
101
+ - They are used by the `turbo gen` command, e.g. `turbo gen app`, `turbo gen device`, `turbo gen module`, etc.
102
+
94
103
  - `Jaffa`
95
104
  - Jaffa is a [Tauri](https://tauri.app) wrapper for the ecmaOS kernel
96
105
  - It's used to tie the kernel into a desktop or mobile environment, allowing for native functionality
97
106
 
98
107
  - `Kernel`
99
- - Authentication (WebAuthn)
100
- - Components (Web Components/Custom Elements)
101
- - Devices
102
- - DOM
103
- - Events (CustomEvents)
104
- - Filesystem (ZenFS)
105
- - Internationalization (i18next)
106
- - Interval Manager (setInterval)
107
- - Log Manager (tslog)
108
- - Memory Manager (Abstractions)
109
- - Process Manager
110
- - Protocol Handlers (web+ecmaos://...)
111
- - Service Worker Manager
112
- - Shell
113
- - Storage (IndexedDB, localStorage, sessionStorage, etc.)
114
- - Terminal (xterm.js)
115
- - User Manager
116
- - WASM Loader
117
- - Window Manager (WinBox)
118
- - Workers (Web Workers)
108
+ - The kernel ties together the various components of the system into a cohesive whole
109
+ - Authentication (WebAuthn)
110
+ - Components (Web Components/Custom Elements)
111
+ - Devices
112
+ - DOM
113
+ - Events (CustomEvents)
114
+ - Filesystem (ZenFS)
115
+ - Internationalization (i18next)
116
+ - Interval Manager (setInterval)
117
+ - Log Manager (tslog)
118
+ - Memory Manager (Abstractions)
119
+ - Process Manager
120
+ - Protocol Handlers (web+ecmaos://...)
121
+ - Service Worker Manager
122
+ - Shell
123
+ - Storage (IndexedDB, localStorage, sessionStorage, etc.)
124
+ - Terminal (xterm.js)
125
+ - User Manager
126
+ - WASM Loader
127
+ - Window Manager (WinBox)
128
+ - Workers (Web Workers)
119
129
 
120
130
  - `Metal`
121
131
  - Metal is an API server for allowing connections to physical systems from ecmaOS using [Hono](https://hono.dev)
122
132
  - Authenticated and encrypted connections with JWK/JWE/JOSE
123
133
 
124
134
  - `Modules`
135
+ - Refer to the full list of [official modules on npm](https://www.npmjs.com/org/ecmaos-modules)
136
+ - See the [./MODULES.md](./MODULES.md) file for a list of community modules; submit a PR to add your module!
125
137
  - Modules are dynamically loaded into the kernel at boot and can be enabled or disabled
138
+ - They are specified during build via the `VITE_KERNEL_MODULES` environment variable
139
+ - e.g. `VITE_KERNEL_MODULES=@ecmaos-modules/boilerplate@0.1.2,@your/package@1.2.3`
140
+ - Versions must be exact and are mandatory - you cannot use NPM version specifiers
126
141
  - They can provide additional functionality, devices, commands, etc.
127
142
  - They offer a [common interface](./core/types/modules.ts) for interacting with the kernel
128
143
  - Generally they should be written in [AssemblyScript](https://www.assemblyscript.org), but this isn't required
129
144
 
130
145
  - `Packages`
131
- - Packages are [npm packages](https://www.npmjs.com) that are installed into the ecmaOS environment
146
+ - Packages are [NPM packages](https://www.npmjs.com) that are installed into the ecmaOS environment
132
147
  - They can be installed from the terminal using the `install` command, e.g. `# install jquery`
133
148
  - NPM version specifiers are supported, e.g.:
134
149
  - `# install jquery@3.7.1`
135
150
  - `# install jquery@^3.7.1`
136
151
  - `# install jquery@latest`
137
- - [JSR](https://jsr.io) support is coming soon
152
+ - [JSR](https://jsr.io) may be used with the [NPM compatibility layer](https://jsr.io/docs/npm-compatibility):
153
+ - `# install @jsr/defaude__hello-jsr --registry https://npm.jsr.io`
138
154
 
139
155
  - `SWAPI`
140
156
  - The SWAPI is an API server running completely inside a service worker using [Hono](https://hono.dev)
157
+ - It allows for various operations including the `fs` route to fetch files via URL
158
+ - e.g., `# fetch /swapi/fs/home/user/hello.txt`
141
159
  - e.g., `# fetch /swapi/fake/person/fullName`
142
160
 
143
161
  - `Utils`
@@ -159,8 +177,10 @@ edit hello.txt
159
177
  env hello --set world ; env
160
178
  fetch https://ipecho.net/plain > /tmp/myip.txt
161
179
  fetch /xkcd-os.sixel # xterm.js includes sixel support
180
+ fetch /swapi/fs/home/user/hello.txt # fetch a file from the filesystem
162
181
  fetch /swapi/fake/person/fullName # fetch a random person from the SWAPI
163
182
  install jquery
183
+ install @ecmaos-apps/boilerplate
164
184
  ls /dev
165
185
  mkdir /tmp/zip ; cd /tmp/zip
166
186
  upload
@@ -207,6 +227,22 @@ cat /dev/zero --bytes 10 > /dev/null
207
227
 
208
228
  Note: many device implementations are incomplete, but provide a solid starting point
209
229
 
230
+ ## Code Execution Example
231
+
232
+ ```sh
233
+ echo "window.alert('Hello, world!')" > /root/hello.js
234
+ load /root/hello.js
235
+ ```
236
+
237
+ ## App Development
238
+
239
+ The `apps` directory in the repository contains a number of examples of how to develop apps, but there are many approaches you could take.
240
+
241
+ - `@ecmaos-apps/boilerplate`: A minimal boilerplate app for developing new apps
242
+ - `@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
243
+
244
+ 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.
245
+
210
246
  ## Early Days
211
247
 
212
248
  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.
@@ -1,18 +1,18 @@
1
1
  {
2
- "_browser-jvtvvRnm.js": {
3
- "file": "browser-jvtvvRnm.js",
2
+ "_browser-C0q0NWWv.js": {
3
+ "file": "browser-C0q0NWWv.js",
4
4
  "name": "browser",
5
5
  "isDynamicEntry": true,
6
6
  "imports": [
7
- "_empty-D1k8eaRb.js"
7
+ "_empty-BMkCc_7L.js"
8
8
  ]
9
9
  },
10
- "_empty-D1k8eaRb.js": {
11
- "file": "empty-D1k8eaRb.js",
10
+ "_empty-BMkCc_7L.js": {
11
+ "file": "empty-BMkCc_7L.js",
12
12
  "name": "empty",
13
13
  "dynamicImports": [
14
- "_topbar.min-qHiqBD75.js",
15
- "_browser-jvtvvRnm.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-qHiqBD75.js": {
25
- "file": "topbar.min-qHiqBD75.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-D1k8eaRb.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-D1k8eaRb.js"
44
+ "_empty-BMkCc_7L.js"
45
45
  ]
46
46
  },
47
47
  "src/tree/lib/commands/install.ts": {
48
- "file": "install-DvXm00-p.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-D1k8eaRb.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-D1k8eaRb.js"
62
+ "_empty-BMkCc_7L.js"
63
63
  ]
64
64
  }
65
65
  }
@@ -1,4 +1,4 @@
1
- import { g as getDefaultExportFromCjs } from "./empty-D1k8eaRb.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-jvtvvRnm.js.map
23
+ //# sourceMappingURL=browser-C0q0NWWv.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"browser-jvtvvRnm.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]}