@ecmaos/jaffa 0.1.1

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.
@@ -0,0 +1,3 @@
1
+ {
2
+ "recommendations": ["tauri-apps.tauri-vscode", "rust-lang.rust-analyzer"]
3
+ }
package/CHANGELOG.md ADDED
@@ -0,0 +1,8 @@
1
+ # @ecmaos/jaffa
2
+
3
+ ## 0.1.1
4
+
5
+ ### Patch Changes
6
+
7
+ - Updated dependencies [ac98305]
8
+ - @ecmaos/kernel@0.2.1
package/LICENSE ADDED
@@ -0,0 +1,7 @@
1
+ # Dual MIT/Apache-2.0 License
2
+
3
+ Copyright (c) 2024-2025 Jay Mathis <code@mathis.network>
4
+
5
+ Except as otherwise noted in individual files, this software is licensed under the MIT license (<http://opensource.org/licenses/MIT>), or the Apache License, Version 2.0 (<http://www.apache.org/licenses/LICENSE-2.0>).
6
+
7
+ Downstream projects and end users may choose either license individually, or both together, at their discretion. The motivation for this dual-licensing is the additional software patent assurance provided by Apache 2.0.
package/README.md ADDED
@@ -0,0 +1,21 @@
1
+ # ecmaOS Jaffa
2
+
3
+ Jaffa is a [Tauri](https://tauri.app) application that can run ecmaOS on any device.
4
+
5
+ ## Getting Started
6
+
7
+ ```bash
8
+ pnpm install
9
+ ```
10
+
11
+ ## Running
12
+
13
+ ```bash
14
+ pnpm dev:tauri
15
+ ```
16
+
17
+ ## Building
18
+
19
+ ```bash
20
+ pnpm bundle
21
+ ```
package/index.html ADDED
@@ -0,0 +1,14 @@
1
+ <!doctype html>
2
+ <html lang="en">
3
+ <head>
4
+ <meta charset="UTF-8" />
5
+ <meta name="viewport" content="width=device-width, initial-scale=1.0" />
6
+ <link rel="icon" type="image/png" href="/favicon.ico" />
7
+ <link rel="stylesheet" href="src/styles.css" />
8
+ <title>ecmaos#</title>
9
+ </head>
10
+ <body>
11
+ <div id="terminal"></div>
12
+ <script type="module" src="src/main.ts"></script>
13
+ </body>
14
+ </html>
package/package.json ADDED
@@ -0,0 +1,32 @@
1
+ {
2
+ "name": "@ecmaos/jaffa",
3
+ "version": "0.1.1",
4
+ "type": "module",
5
+ "publishConfig": {
6
+ "access": "public"
7
+ },
8
+ "dependencies": {
9
+ "@tauri-apps/api": "^2",
10
+ "@tauri-apps/plugin-shell": "^2",
11
+ "@ecmaos/kernel": "^0.2.1",
12
+ "@ecmaos/types": "^0.2.0"
13
+ },
14
+ "devDependencies": {
15
+ "@tauri-apps/cli": "^2",
16
+ "sass-embedded": "^1.79.4",
17
+ "typescript": "^5.6.3",
18
+ "user-agent-data-types": "^0.4.2",
19
+ "vite": "^6.0.1",
20
+ "vite-plugin-i18next-loader": "^2.0.13",
21
+ "vite-plugin-node-polyfills": "^0.22.0"
22
+ },
23
+ "scripts": {
24
+ "build": "tsc && vite build",
25
+ "build:tauri": "tauri build",
26
+ "bundle": "pnpm build:tauri && pnpm bundle",
27
+ "dev": "vite",
28
+ "dev:tauri": "tauri dev",
29
+ "preview": "vite preview",
30
+ "tauri": "tauri"
31
+ }
32
+ }
package/src/main.ts ADDED
@@ -0,0 +1,45 @@
1
+ /// <reference types="vite/client" />
2
+ /// <reference types="user-agent-data-types" />
3
+ /// <reference types="@ecmaos/kernel" />
4
+
5
+ declare type Timer = ReturnType<typeof setInterval>
6
+
7
+ declare global {
8
+ // eslint-disable-next-line no-var
9
+ var kernel: Kernel | undefined
10
+
11
+ interface Navigator {
12
+ userAgentData: NavigatorUAData | null
13
+ }
14
+ }
15
+
16
+ import { Kernel } from '@ecmaos/kernel'
17
+ import '@ecmaos/kernel/ui.css'
18
+
19
+ const username = import.meta.env.VITE_AUTOLOGIN_USERNAME
20
+ const password = import.meta.env.VITE_AUTOLOGIN_PASSWORD
21
+ const socket = import.meta.env.VITE_METAL_SOCKET
22
+
23
+ const kernel = new Kernel({
24
+ credentials: (username && password) ? { username, password } : undefined,
25
+ dom: { topbar: import.meta.env.NODE_ENV !== 'test' },
26
+ log: { name: `ecmaos:${import.meta.env.NODE_ENV || 'kernel'}` },
27
+ socket: socket ? new WebSocket(socket) : undefined
28
+ })
29
+
30
+ globalThis.kernels = globalThis.kernels || new Map()
31
+ globalThis.kernels.set(kernel.id, kernel)
32
+
33
+ globalThis.shells = globalThis.shells || new Map()
34
+ globalThis.shells.set(kernel.shell.id, kernel.shell)
35
+
36
+ globalThis.terminals = globalThis.terminals || new Map()
37
+ globalThis.terminals.set(kernel.terminal.id, kernel.terminal)
38
+
39
+ const primaryKernel = globalThis.kernels.values().next().value
40
+ globalThis.kernel = primaryKernel
41
+
42
+ kernel.terminal.mount(document.getElementById('terminal') as HTMLElement)
43
+ kernel.boot({ silent: import.meta.env.NODE_ENV === 'test', figletFontRandom: false })
44
+
45
+
package/src/styles.css ADDED
@@ -0,0 +1,12 @@
1
+ html, body {
2
+ margin: 0;
3
+ padding: 0;
4
+ height: 100vh;
5
+ width: 100vw;
6
+ background-color: #000;
7
+ }
8
+
9
+ #terminal {
10
+ height: 100%;
11
+ width: 100%;
12
+ }