@ecmaos/kernel 0.2.7 → 0.3.0
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 +48 -8
- package/dist/.vite/manifest.json +20 -20
- package/dist/{empty--zdtkf0T.js → __vite-browser-external-ZgWJ_FY-.js} +50819 -55143
- package/dist/__vite-browser-external-ZgWJ_FY-.js.map +1 -0
- package/dist/{browser-D_CtuxSB.js → browser-Bnkgx7wL.js} +7 -4
- package/dist/{browser-D_CtuxSB.js.map → browser-Bnkgx7wL.js.map} +1 -1
- package/dist/favicon.ico +0 -0
- package/dist/icon.jpg +0 -0
- package/dist/icon.png +0 -0
- package/dist/initfs/usr/share/licenses/zenfs/COPYRIGHT.txt +3 -0
- package/dist/initfs/usr/share/licenses/zenfs/LICENSE.md +157 -0
- package/dist/initfs.tar.gz +0 -0
- package/dist/{install-Ds1oWgTf.js → install-BWxc1crE.js} +9 -7
- package/dist/install-BWxc1crE.js.map +1 -0
- package/dist/kernel.d.ts +4 -2
- package/dist/kernel.js +1 -1
- package/dist/{topbar.min-CDkSVOxV.js → topbar.min-DHDDU9sh.js} +15 -11
- package/dist/{topbar.min-CDkSVOxV.js.map → topbar.min-DHDDU9sh.js.map} +1 -1
- package/dist/ui.js +1 -1
- package/package.json +11 -9
- package/LICENSE +0 -7
- package/dist/empty--zdtkf0T.js.map +0 -1
- package/dist/install-Ds1oWgTf.js.map +0 -1
package/README.md
CHANGED
|
@@ -141,6 +141,7 @@ The goal is to create a kernel and supporting apps that tie together modern web
|
|
|
141
141
|
- Terminal (xterm.js)
|
|
142
142
|
- User Manager
|
|
143
143
|
- WASM Loader
|
|
144
|
+
- [WebContainer](https://github.com/stackblitz/webcontainer-core) for running Node.js apps
|
|
144
145
|
- Window Manager (WinBox)
|
|
145
146
|
- Workers (Web Workers)
|
|
146
147
|
|
|
@@ -169,6 +170,8 @@ The goal is to create a kernel and supporting apps that tie together modern web
|
|
|
169
170
|
|
|
170
171
|
- Packages are [NPM packages](https://www.npmjs.com) that are installed into the ecmaOS environment
|
|
171
172
|
- They can be installed from the terminal using the `install` command, e.g. `# install jquery`
|
|
173
|
+
- Client-side packages should work well
|
|
174
|
+
- Some basic Node emulation is in place, but don't expect anything to work at this point
|
|
172
175
|
- NPM version specifiers are supported, e.g.:
|
|
173
176
|
- `# install jquery@3.7.1`
|
|
174
177
|
- `# install jquery@^3.7.1`
|
|
@@ -199,7 +202,7 @@ The goal is to create a kernel and supporting apps that tie together modern web
|
|
|
199
202
|
- `/dev/`: All devices are here
|
|
200
203
|
- `/etc/packages`: A list of installed packages to load on boot
|
|
201
204
|
- `/home/`: Contains user home directories
|
|
202
|
-
- `/proc/`:
|
|
205
|
+
- `/proc/`: Contains various dynamic system information
|
|
203
206
|
- `/root/`: The home directory for the root user
|
|
204
207
|
- `/usr/bin/`: Executable packages get linked here
|
|
205
208
|
- `/usr/lib/`: All installed packages are here
|
|
@@ -278,30 +281,57 @@ echo "window.alert('Hello, world!')" > /root/hello.js
|
|
|
278
281
|
load /root/hello.js
|
|
279
282
|
```
|
|
280
283
|
|
|
284
|
+
## Scripting
|
|
285
|
+
|
|
286
|
+
```txt
|
|
287
|
+
#!ecmaos:bin:script
|
|
288
|
+
echo "Hello, world!"
|
|
289
|
+
install jquery
|
|
290
|
+
```
|
|
291
|
+
|
|
292
|
+
## Startup
|
|
293
|
+
|
|
294
|
+
- `/boot/init` is a script that runs on boot inside the init process (PID 0)
|
|
295
|
+
- `/etc/packages` is a list of already installed packages to load on boot; one per line
|
|
296
|
+
- The env var `VITE_KERNEL_MODULES` is a list of modules to load on boot; CSV with pinned versions
|
|
297
|
+
- The env var `VITE_RECOMMENDED_APPS` is a list of apps to suggest to new users
|
|
298
|
+
|
|
281
299
|
## App Development
|
|
282
300
|
|
|
283
|
-
The
|
|
301
|
+
The [apps](/apps) directory in the repository contains some examples of how to develop apps, but there are many approaches you could take.
|
|
284
302
|
|
|
285
|
-
- `@ecmaos-apps/boilerplate`: A minimal boilerplate app for
|
|
303
|
+
- `@ecmaos-apps/boilerplate`: A minimal boilerplate app for reference
|
|
286
304
|
- `@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
|
|
287
305
|
|
|
288
306
|
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.
|
|
289
307
|
|
|
290
|
-
## Kernel Interface Example
|
|
308
|
+
## App/Kernel Interface Example
|
|
309
|
+
|
|
310
|
+
> See the [docs](https://docs.ecmaos.sh) for more information
|
|
291
311
|
|
|
292
312
|
```ts
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
313
|
+
#!ecmaos:bin:app:example
|
|
314
|
+
// shebang format: ecmaos:exectype:execnamespace:execname
|
|
315
|
+
export default async function main(params: ProcessEntryParams) {
|
|
316
|
+
const { args, kernel, terminal } = params
|
|
317
|
+
kernel.log.info('Hello, world!')
|
|
318
|
+
kernel.log.debug(args)
|
|
319
|
+
terminal.writeln('Hello, world!')
|
|
320
|
+
await kernel.filesystem.fs.writeFile('/tmp/hello.txt', 'Hello, world!')
|
|
321
|
+
const win = kernel.windows.create({ title: 'Example', width: 800, height: 600 })
|
|
322
|
+
const container = document.createElement('div')
|
|
323
|
+
container.innerHTML = '<h1>Hello, world!</h1>'
|
|
324
|
+
win.mount(container)
|
|
296
325
|
}
|
|
297
326
|
```
|
|
298
327
|
|
|
299
328
|
## Early Days
|
|
300
329
|
|
|
301
|
-
|
|
330
|
+
ecmaOS 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.
|
|
302
331
|
|
|
303
332
|
Things to keep in mind:
|
|
304
333
|
|
|
334
|
+
- If things go wrong or break, clear your browser cache and site data for ecmaOS
|
|
305
335
|
- Things have changed a lot since the tests were written, so they need to be updated and fixed
|
|
306
336
|
- The kernel is designed to be run in an environment with a DOM (i.e. a browser)
|
|
307
337
|
- Many features are only available on Chromium-based browsers, and many more behind feature flags
|
|
@@ -313,6 +343,14 @@ Things to keep in mind:
|
|
|
313
343
|
|
|
314
344
|
[Turborepo](https://turbo.build/repo) is used to manage the monorepo, and [pnpm](https://pnpm.io) is used for package management.
|
|
315
345
|
|
|
346
|
+
PNPM Workspaces:
|
|
347
|
+
|
|
348
|
+
- [apps](/apps)
|
|
349
|
+
- [core](/core)
|
|
350
|
+
- [devices](/devices)
|
|
351
|
+
- [modules](/modules)
|
|
352
|
+
- [utils](/utils)
|
|
353
|
+
|
|
316
354
|
A good place to start is viewing the `scripts` property of [package.json](./package.json) in the root of the repository.
|
|
317
355
|
|
|
318
356
|
```bash
|
|
@@ -348,4 +386,6 @@ Also see [turbo.json](./turbo.json) and [CONTRIBUTING.md](/CONTRIBUTING.md) for
|
|
|
348
386
|
|
|
349
387
|
## Security Vulnerabilities
|
|
350
388
|
|
|
389
|
+
See [SECURITY.md](/SECURITY.md) for more information.
|
|
390
|
+
|
|
351
391
|
If you find a serious security vulnerability, please submit a new [Draft Security Advisory](https://github.com/ecmaos/ecmaos/security) or contact the project maintainer directly at [code@mathis.network](mailto:code@mathis.network).
|
package/dist/.vite/manifest.json
CHANGED
|
@@ -1,32 +1,32 @@
|
|
|
1
1
|
{
|
|
2
|
-
"
|
|
3
|
-
"file": "browser-
|
|
4
|
-
"name": "browser",
|
|
5
|
-
"isDynamicEntry": true,
|
|
6
|
-
"imports": [
|
|
7
|
-
"_empty--zdtkf0T.js"
|
|
8
|
-
]
|
|
9
|
-
},
|
|
10
|
-
"_empty--zdtkf0T.js": {
|
|
11
|
-
"file": "empty--zdtkf0T.js",
|
|
12
|
-
"name": "empty",
|
|
2
|
+
"___vite-browser-external-ZgWJ_FY-.js": {
|
|
3
|
+
"file": "__vite-browser-external-ZgWJ_FY-.js",
|
|
4
|
+
"name": "__vite-browser-external",
|
|
13
5
|
"dynamicImports": [
|
|
14
|
-
"_topbar.min-
|
|
15
|
-
"_browser-
|
|
6
|
+
"_topbar.min-DHDDU9sh.js",
|
|
7
|
+
"_browser-Bnkgx7wL.js",
|
|
16
8
|
"src/tree/lib/commands/install.ts",
|
|
17
9
|
"node_modules/.pnpm/figlet@1.8.0/node_modules/figlet/importable-fonts/Poison.js"
|
|
18
10
|
]
|
|
19
11
|
},
|
|
12
|
+
"_browser-Bnkgx7wL.js": {
|
|
13
|
+
"file": "browser-Bnkgx7wL.js",
|
|
14
|
+
"name": "browser",
|
|
15
|
+
"isDynamicEntry": true,
|
|
16
|
+
"imports": [
|
|
17
|
+
"___vite-browser-external-ZgWJ_FY-.js"
|
|
18
|
+
]
|
|
19
|
+
},
|
|
20
20
|
"_kernel.css": {
|
|
21
21
|
"file": "kernel.css",
|
|
22
22
|
"src": "_kernel.css"
|
|
23
23
|
},
|
|
24
|
-
"_topbar.min-
|
|
25
|
-
"file": "topbar.min-
|
|
24
|
+
"_topbar.min-DHDDU9sh.js": {
|
|
25
|
+
"file": "topbar.min-DHDDU9sh.js",
|
|
26
26
|
"name": "topbar.min",
|
|
27
27
|
"isDynamicEntry": true,
|
|
28
28
|
"imports": [
|
|
29
|
-
"
|
|
29
|
+
"___vite-browser-external-ZgWJ_FY-.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
|
-
"
|
|
44
|
+
"___vite-browser-external-ZgWJ_FY-.js"
|
|
45
45
|
]
|
|
46
46
|
},
|
|
47
47
|
"src/tree/lib/commands/install.ts": {
|
|
48
|
-
"file": "install-
|
|
48
|
+
"file": "install-BWxc1crE.js",
|
|
49
49
|
"name": "install",
|
|
50
50
|
"src": "src/tree/lib/commands/install.ts",
|
|
51
51
|
"isDynamicEntry": true,
|
|
52
52
|
"imports": [
|
|
53
|
-
"
|
|
53
|
+
"___vite-browser-external-ZgWJ_FY-.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
|
-
"
|
|
62
|
+
"___vite-browser-external-ZgWJ_FY-.js"
|
|
63
63
|
]
|
|
64
64
|
}
|
|
65
65
|
}
|