kordex 0.1.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.
Files changed (3) hide show
  1. package/README.md +63 -0
  2. package/bin/kordex.js +37 -0
  3. package/package.json +16 -0
package/README.md ADDED
@@ -0,0 +1,63 @@
1
+ # Kordex
2
+
3
+ Kordex is a JavaScript and TypeScript runtime for reliable local-first applications.
4
+
5
+ It is built on top of Vix.cpp and Softadastra, with a focus on local execution, explicit permissions, native modules, and offline-ready application foundations.
6
+
7
+ ## Install
8
+
9
+ ```bash
10
+ npm install -g kordex
11
+ ```
12
+
13
+ ## Run
14
+
15
+ ```bash
16
+ kordex run main.js
17
+ ```
18
+
19
+ ## Example
20
+
21
+ Create `main.js`:
22
+
23
+ ```js
24
+ console.log("Hello from Kordex");
25
+ ```
26
+
27
+ Run:
28
+
29
+ ```bash
30
+ kordex run main.js
31
+ ```
32
+
33
+ Output:
34
+
35
+ ```txt
36
+ Hello from Kordex
37
+ ```
38
+
39
+ ## Status
40
+
41
+ Kordex is early-stage.
42
+
43
+ Current foundations include:
44
+
45
+ * JavaScript execution
46
+ * TypeScript MVP loading
47
+ * local imports
48
+ * JSON imports
49
+ * native `kordex:` modules
50
+ * explicit runtime permissions
51
+ * project entry resolution
52
+ * build and bundle workflow
53
+
54
+ ## Links
55
+
56
+ * Repository: https://github.com/softadastra/kordex
57
+ * Releases: https://github.com/softadastra/kordex/releases
58
+ * Vix.cpp: https://github.com/vixcpp/vix
59
+ * Softadastra: https://softadastra.com
60
+
61
+ ## License
62
+
63
+ MIT
package/bin/kordex.js ADDED
@@ -0,0 +1,37 @@
1
+ #!/usr/bin/env node
2
+
3
+ const { spawnSync } = require("child_process");
4
+
5
+ const platform = process.platform;
6
+ const arch = process.arch;
7
+
8
+ let packageName;
9
+
10
+ if (platform === "linux" && arch === "x64") {
11
+ packageName = "@softadastra/kordex-linux-x64";
12
+ } else {
13
+ console.error(`Kordex does not support ${platform}-${arch} yet.`);
14
+ process.exit(1);
15
+ }
16
+
17
+ let binary;
18
+
19
+ try {
20
+ const nativePackage = require(packageName);
21
+ binary = nativePackage.binary;
22
+ } catch (error) {
23
+ console.error(`Failed to load ${packageName}.`);
24
+ console.error("Try reinstalling Kordex.");
25
+ process.exit(1);
26
+ }
27
+
28
+ const result = spawnSync(binary, process.argv.slice(2), {
29
+ stdio: "inherit",
30
+ });
31
+
32
+ if (result.error) {
33
+ console.error(result.error.message);
34
+ process.exit(1);
35
+ }
36
+
37
+ process.exit(result.status ?? 1);
package/package.json ADDED
@@ -0,0 +1,16 @@
1
+ {
2
+ "name": "kordex",
3
+ "version": "0.1.0",
4
+ "description": "A JavaScript and TypeScript runtime for reliable local-first applications",
5
+ "bin": {
6
+ "kordex": "bin/kordex.js"
7
+ },
8
+ "optionalDependencies": {
9
+ "@softadastra/kordex-linux-x64": "0.1.0"
10
+ },
11
+ "files": [
12
+ "bin",
13
+ "README.md"
14
+ ],
15
+ "license": "MIT"
16
+ }