@plurnk/plurnk-execs-common 0.1.0 → 0.2.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.
- package/README.md +6 -3
- package/dist/Common.d.ts.map +1 -1
- package/dist/Common.js +9 -0
- package/dist/Common.js.map +1 -1
- package/package.json +74 -16
package/README.md
CHANGED
|
@@ -1,15 +1,18 @@
|
|
|
1
1
|
# @plurnk/plurnk-execs-common
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
The **universal subprocess executor** for [plurnk-service](https://github.com/plurnk/plurnk-service)'s `exec` scheme: one package covering the shell + node + python floor *and* whichever host interpreters (`perl`/`ruby`/`php`/`lua`/`awk`/`bc`/…) are present. Install it once and the model gets every subprocess runtime the host can serve — `node` always, the rest detected.
|
|
4
4
|
|
|
5
|
-
A `@plurnk/plurnk-execs-*` sibling built on the [plurnk-execs](https://github.com/plurnk/plurnk-execs) framework.
|
|
5
|
+
A `@plurnk/plurnk-execs-*` sibling built on the [plurnk-execs](https://github.com/plurnk/plurnk-execs) framework. **Supersedes the former `-sh`, `-node`, `-python` packages** (folded in here).
|
|
6
6
|
|
|
7
7
|
## How it works
|
|
8
8
|
|
|
9
|
-
The manifest claims
|
|
9
|
+
The manifest claims the subprocess runtime tags. The framework's `probe()` (per-tag) lights up `node` unconditionally (the daemon *is* node) and detects the rest via a cheap `command -v`, so the consumer offers the model exactly the platform's runtimes. No per-language packages — one executor adapts to the host.
|
|
10
10
|
|
|
11
11
|
| Tag | Binary | Command via |
|
|
12
12
|
|---|---|---|
|
|
13
|
+
| `sh` 🐚 / `bash` 🐚 | sh / bash | `-c <command>` |
|
|
14
|
+
| `node` ⬢ | node | `-e <command>` (always available) |
|
|
15
|
+
| `python` / `python3` 🐍 | python3 | `-c <command>` |
|
|
13
16
|
| `perl` 🐪 / `ruby` 💎 / `lua` 🌙 | perl / ruby / lua | `-e <command>` |
|
|
14
17
|
| `php` 🐘 | php | `-r <command>` |
|
|
15
18
|
| `deno` 🦕 | deno | `eval <command>` |
|
package/dist/Common.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Common.d.ts","sourceRoot":"","sources":["../src/Common.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,kBAAkB,EAAE,MAAM,sBAAsB,CAAC;AAC1D,OAAO,KAAK,EAAE,mBAAmB,EAAE,SAAS,EAAE,MAAM,sBAAsB,CAAC;
|
|
1
|
+
{"version":3,"file":"Common.d.ts","sourceRoot":"","sources":["../src/Common.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,kBAAkB,EAAE,MAAM,sBAAsB,CAAC;AAC1D,OAAO,KAAK,EAAE,mBAAmB,EAAE,SAAS,EAAE,MAAM,sBAAsB,CAAC;AAqC3E,eAAO,MAAM,YAAY,EAAE,SAAS,MAAM,EAAwC,CAAC;AAqBnF,MAAM,CAAC,OAAO,OAAO,MAAO,SAAQ,kBAAkB;cAC/B,SAAS,CAAC,OAAO,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,GAAG,SAAS;IAU1D,KAAK,IAAI,OAAO,CAAC,mBAAmB,CAAC;CAWvD"}
|
package/dist/Common.js
CHANGED
|
@@ -1,6 +1,13 @@
|
|
|
1
1
|
import { spawnSync } from "node:child_process";
|
|
2
2
|
import { SubprocessExecutor } from "@plurnk/plurnk-execs";
|
|
3
3
|
const RECIPES = Object.freeze({
|
|
4
|
+
// Subprocess floor (folded in from the former -sh / -node / -python packages).
|
|
5
|
+
sh: { bin: "sh", arg: (c) => ["-c", c] },
|
|
6
|
+
bash: { bin: "bash", arg: (c) => ["-c", c] },
|
|
7
|
+
node: { bin: "node", arg: (c) => ["-e", c], alwaysAvailable: true },
|
|
8
|
+
python: { bin: "python3", arg: (c) => ["-c", c] },
|
|
9
|
+
python3: { bin: "python3", arg: (c) => ["-c", c] },
|
|
10
|
+
// Detected host interpreters.
|
|
4
11
|
perl: { bin: "perl", arg: (c) => ["-e", c] },
|
|
5
12
|
ruby: { bin: "ruby", arg: (c) => ["-e", c] },
|
|
6
13
|
php: { bin: "php", arg: (c) => ["-r", c] },
|
|
@@ -49,6 +56,8 @@ export default class Common extends SubprocessExecutor {
|
|
|
49
56
|
if (isDisabled(this.runtime)) {
|
|
50
57
|
return { available: false, detail: `disabled (PLURNK_EXECS_${this.runtime.toUpperCase()}=0)` };
|
|
51
58
|
}
|
|
59
|
+
if (r.alwaysAvailable)
|
|
60
|
+
return { available: true, detail: r.bin === "node" ? process.version : r.bin };
|
|
52
61
|
return onPath(r.bin)
|
|
53
62
|
? { available: true, detail: r.bin }
|
|
54
63
|
: { available: false, detail: `${r.bin} not on PATH` };
|
package/dist/Common.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Common.js","sourceRoot":"","sources":["../src/Common.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,oBAAoB,CAAC;AAC/C,OAAO,EAAE,kBAAkB,EAAE,MAAM,sBAAsB,CAAC;
|
|
1
|
+
{"version":3,"file":"Common.js","sourceRoot":"","sources":["../src/Common.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,oBAAoB,CAAC;AAC/C,OAAO,EAAE,kBAAkB,EAAE,MAAM,sBAAsB,CAAC;AAkB1D,MAAM,OAAO,GAAqC,MAAM,CAAC,MAAM,CAAC;IAC5D,+EAA+E;IAC/E,EAAE,EAAE,EAAE,GAAG,EAAE,IAAI,EAAE,GAAG,EAAE,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,IAAI,EAAE,CAAC,CAAC,EAAE;IACxC,IAAI,EAAE,EAAE,GAAG,EAAE,MAAM,EAAE,GAAG,EAAE,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,IAAI,EAAE,CAAC,CAAC,EAAE;IAC5C,IAAI,EAAE,EAAE,GAAG,EAAE,MAAM,EAAE,GAAG,EAAE,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,IAAI,E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@@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@plurnk/plurnk-execs-common",
|
|
3
|
-
"version": "0.1
|
|
4
|
-
"description": "
|
|
5
|
-
"keywords": [
|
|
3
|
+
"version": "0.2.1",
|
|
4
|
+
"description": "Universal subprocess executor for plurnk-service's exec scheme — one package exposing the shell + node + python floor plus whichever host interpreters (perl, ruby, php, lua, awk, bc, …) are present.",
|
|
5
|
+
"keywords": [
|
|
6
|
+
"plurnk",
|
|
7
|
+
"exec",
|
|
8
|
+
"runtime",
|
|
9
|
+
"executor",
|
|
10
|
+
"subprocess",
|
|
11
|
+
"repl",
|
|
12
|
+
"shell",
|
|
13
|
+
"node",
|
|
14
|
+
"python"
|
|
15
|
+
],
|
|
6
16
|
"homepage": "https://github.com/plurnk/plurnk-execs-common#readme",
|
|
7
17
|
"bugs": {
|
|
8
18
|
"url": "https://github.com/plurnk/plurnk-execs-common/issues"
|
|
@@ -23,15 +33,62 @@
|
|
|
23
33
|
"plurnk": {
|
|
24
34
|
"kind": "exec",
|
|
25
35
|
"runtimes": [
|
|
26
|
-
{
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
{
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
{
|
|
36
|
+
{
|
|
37
|
+
"name": "sh",
|
|
38
|
+
"glyph": "🐚"
|
|
39
|
+
},
|
|
40
|
+
{
|
|
41
|
+
"name": "bash",
|
|
42
|
+
"glyph": "🐚"
|
|
43
|
+
},
|
|
44
|
+
{
|
|
45
|
+
"name": "node",
|
|
46
|
+
"glyph": "⬢"
|
|
47
|
+
},
|
|
48
|
+
{
|
|
49
|
+
"name": "python",
|
|
50
|
+
"glyph": "🐍"
|
|
51
|
+
},
|
|
52
|
+
{
|
|
53
|
+
"name": "python3",
|
|
54
|
+
"glyph": "🐍"
|
|
55
|
+
},
|
|
56
|
+
{
|
|
57
|
+
"name": "perl",
|
|
58
|
+
"glyph": "🐪"
|
|
59
|
+
},
|
|
60
|
+
{
|
|
61
|
+
"name": "ruby",
|
|
62
|
+
"glyph": "💎"
|
|
63
|
+
},
|
|
64
|
+
{
|
|
65
|
+
"name": "php",
|
|
66
|
+
"glyph": "🐘"
|
|
67
|
+
},
|
|
68
|
+
{
|
|
69
|
+
"name": "lua",
|
|
70
|
+
"glyph": "🌙"
|
|
71
|
+
},
|
|
72
|
+
{
|
|
73
|
+
"name": "deno",
|
|
74
|
+
"glyph": "🦕"
|
|
75
|
+
},
|
|
76
|
+
{
|
|
77
|
+
"name": "bun",
|
|
78
|
+
"glyph": "🥟"
|
|
79
|
+
},
|
|
80
|
+
{
|
|
81
|
+
"name": "tcl",
|
|
82
|
+
"glyph": "🪶"
|
|
83
|
+
},
|
|
84
|
+
{
|
|
85
|
+
"name": "bc",
|
|
86
|
+
"glyph": "🧮"
|
|
87
|
+
},
|
|
88
|
+
{
|
|
89
|
+
"name": "awk",
|
|
90
|
+
"glyph": "🪄"
|
|
91
|
+
}
|
|
35
92
|
]
|
|
36
93
|
},
|
|
37
94
|
"exports": {
|
|
@@ -54,11 +111,12 @@
|
|
|
54
111
|
"build": "npm run build:dist",
|
|
55
112
|
"prepare": "npm run build"
|
|
56
113
|
},
|
|
57
|
-
"dependencies": {
|
|
58
|
-
"@plurnk/plurnk-execs": "0.4.1"
|
|
59
|
-
},
|
|
60
114
|
"devDependencies": {
|
|
61
115
|
"@types/node": "^25.8.0",
|
|
62
|
-
"typescript": "^6.0.3"
|
|
116
|
+
"typescript": "^6.0.3",
|
|
117
|
+
"@plurnk/plurnk-execs": "0.4.1"
|
|
118
|
+
},
|
|
119
|
+
"peerDependencies": {
|
|
120
|
+
"@plurnk/plurnk-execs": "0.4.1"
|
|
63
121
|
}
|
|
64
122
|
}
|