@plurnk/plurnk-execs-common 2.0.2 → 3.0.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/dist/Common.d.ts +1 -0
- package/dist/Common.d.ts.map +1 -1
- package/dist/Common.js +9 -4
- package/dist/Common.js.map +1 -1
- package/dist/runtimes.d.ts +3 -0
- package/dist/runtimes.d.ts.map +1 -0
- package/dist/runtimes.js +215 -0
- package/dist/runtimes.js.map +1 -0
- package/docs/sh.md +6 -4
- package/package.json +9 -215
package/dist/Common.d.ts
CHANGED
|
@@ -2,6 +2,7 @@ import { SubprocessExecutor } from "@plurnk/plurnk-execs";
|
|
|
2
2
|
import type { RuntimeAvailability, SpawnArgs } from "@plurnk/plurnk-execs";
|
|
3
3
|
export declare const RUNTIME_TAGS: readonly string[];
|
|
4
4
|
export default class Common extends SubprocessExecutor {
|
|
5
|
+
#private;
|
|
5
6
|
protected spawnArgs(runtime: string, command: string, target?: string | null): SpawnArgs;
|
|
6
7
|
probe(): Promise<RuntimeAvailability>;
|
|
7
8
|
}
|
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,
|
|
1
|
+
{"version":3,"file":"Common.d.ts","sourceRoot":"","sources":["../src/Common.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,kBAAkB,EAAwB,MAAM,sBAAsB,CAAC;AAChF,OAAO,KAAK,EAAE,mBAAmB,EAAE,SAAS,EAAE,MAAM,sBAAsB,CAAC;AAmC3E,eAAO,MAAM,YAAY,EAAE,SAAS,MAAM,EAAwC,CAAC;AAenF,MAAM,CAAC,OAAO,OAAO,MAAO,SAAQ,kBAAkB;;IAClD,UAAmB,SAAS,CAAC,OAAO,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,EAAE,MAAM,GAAE,MAAM,GAAG,IAAW,GAAG,SAAS,CActG;IAQc,KAAK,IAAI,OAAO,CAAC,mBAAmB,CAAC,CAOnD;CACJ"}
|
package/dist/Common.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { spawnSync } from "node:child_process";
|
|
2
|
-
import { SubprocessExecutor, SpawnAccounts } from "@plurnk/plurnk-execs";
|
|
2
|
+
import { SubprocessExecutor, SpawnAccounts, Shell } from "@plurnk/plurnk-execs";
|
|
3
3
|
const RECIPES = Object.freeze({
|
|
4
|
-
// Subprocess floor.
|
|
4
|
+
// Subprocess floor. `sh`'s bin is the shell the environment names ({§executor-shell}), resolved at use.
|
|
5
5
|
sh: { bin: "sh", arg: (c) => ["-c", c] },
|
|
6
6
|
node: { bin: "node", arg: (c) => ["-e", c], alwaysAvailable: true },
|
|
7
7
|
python3: { bin: "python3", arg: (c) => ["-c", c] },
|
|
@@ -30,7 +30,7 @@ const onPath = (bin) => spawnSync("sh", ["-c", `command -v "$1"`, "sh", bin], {
|
|
|
30
30
|
// SubprocessExecutor's run() (streaming + process-group abort) via spawnArgs().
|
|
31
31
|
export default class Common extends SubprocessExecutor {
|
|
32
32
|
spawnArgs(runtime, command, target = null) {
|
|
33
|
-
const r =
|
|
33
|
+
const r = Common.#recipe(runtime);
|
|
34
34
|
if (r === undefined)
|
|
35
35
|
throw new Error(`plurnk-execs-common received unclaimed runtime tag '${runtime}'`);
|
|
36
36
|
// With a target the program IS the target and the body is its stdin
|
|
@@ -47,8 +47,13 @@ export default class Common extends SubprocessExecutor {
|
|
|
47
47
|
return { cmd: r.bin, args: [command], useShell: false, stdin: "" };
|
|
48
48
|
return { cmd: r.bin, args: r.arg(command), useShell: false };
|
|
49
49
|
}
|
|
50
|
+
// {§executor-shell} `sh` runs the environment's shell; every other recipe is fixed.
|
|
51
|
+
static #recipe(runtime) {
|
|
52
|
+
const r = RECIPES[runtime];
|
|
53
|
+
return runtime === "sh" && r !== undefined ? { ...r, bin: Shell.current().path } : r;
|
|
54
|
+
}
|
|
50
55
|
async probe() {
|
|
51
|
-
const r =
|
|
56
|
+
const r = Common.#recipe(this.runtime);
|
|
52
57
|
if (r === undefined)
|
|
53
58
|
return { available: false, detail: `unknown runtime '${this.runtime}'` };
|
|
54
59
|
if (r.alwaysAvailable)
|
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,aAAa,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,aAAa,EAAE,KAAK,EAAE,MAAM,sBAAsB,CAAC;AAmBhF,MAAM,OAAO,GAAqC,MAAM,CAAC,MAAM,CAAC;IAC5D,wGAAwG;IACxG,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,eAAe,EAAE,IAAI,EAAE;IACnE,OAAO,EAAE,EAAE,GAAG,EAAE,SAAS,EAAE,GAAG,EAAE,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,IAAI,EAAE,CAAC,CAAC,EAAE;IAClD,8BAA8B;IAC9B,IAAI,EAAE,EAAE,GAAG,EAAE,MAAM,EAAE,GAAG,EAAE,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,IAAI,EAAE,CAAC,CAAC,EAAE;IAC5C,IAAI,EAAE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} The common package's declarations. `sh` names the shell it runs
|
|
2
|
+
// ({§executor-shell}), resolved on this host; every other declaration is fixed.
|
|
3
|
+
import { Shell } from "@plurnk/plurnk-execs";
|
|
4
|
+
const SH = {
|
|
5
|
+
name: "sh",
|
|
6
|
+
glyph: "🐚",
|
|
7
|
+
invocation: {
|
|
8
|
+
body: {
|
|
9
|
+
role: "the shell program; stdin when the target is a script",
|
|
10
|
+
required: false,
|
|
11
|
+
},
|
|
12
|
+
target: {
|
|
13
|
+
role: "script; never a command or a directory",
|
|
14
|
+
required: false,
|
|
15
|
+
kind: "script",
|
|
16
|
+
},
|
|
17
|
+
example: {
|
|
18
|
+
body: "git status --short",
|
|
19
|
+
},
|
|
20
|
+
},
|
|
21
|
+
};
|
|
22
|
+
const FIXED = [
|
|
23
|
+
{
|
|
24
|
+
name: "node",
|
|
25
|
+
glyph: "⬢",
|
|
26
|
+
summary: "Run JavaScript code or scripts with Node.js.",
|
|
27
|
+
invocation: {
|
|
28
|
+
body: {
|
|
29
|
+
role: "JavaScript program; stdin when the target is a script",
|
|
30
|
+
required: false,
|
|
31
|
+
},
|
|
32
|
+
target: {
|
|
33
|
+
role: "script; never a command or a directory",
|
|
34
|
+
required: false,
|
|
35
|
+
kind: "script",
|
|
36
|
+
},
|
|
37
|
+
example: {
|
|
38
|
+
body: "console.log(42)",
|
|
39
|
+
},
|
|
40
|
+
},
|
|
41
|
+
},
|
|
42
|
+
{
|
|
43
|
+
name: "python3",
|
|
44
|
+
glyph: "🐍",
|
|
45
|
+
summary: "Run Python 3 code or scripts.",
|
|
46
|
+
invocation: {
|
|
47
|
+
body: {
|
|
48
|
+
role: "Python program; stdin when the target is a script",
|
|
49
|
+
required: false,
|
|
50
|
+
},
|
|
51
|
+
target: {
|
|
52
|
+
role: "script; never a command or a directory",
|
|
53
|
+
required: false,
|
|
54
|
+
kind: "script",
|
|
55
|
+
},
|
|
56
|
+
example: {
|
|
57
|
+
body: "print(42)",
|
|
58
|
+
},
|
|
59
|
+
},
|
|
60
|
+
},
|
|
61
|
+
{
|
|
62
|
+
name: "perl",
|
|
63
|
+
glyph: "🐪",
|
|
64
|
+
summary: "Run Perl code or scripts.",
|
|
65
|
+
invocation: {
|
|
66
|
+
body: {
|
|
67
|
+
role: "Perl program; stdin when the target is a script",
|
|
68
|
+
required: false,
|
|
69
|
+
},
|
|
70
|
+
target: {
|
|
71
|
+
role: "script; never a command or a directory",
|
|
72
|
+
required: false,
|
|
73
|
+
kind: "script",
|
|
74
|
+
},
|
|
75
|
+
example: {
|
|
76
|
+
body: "print 42;",
|
|
77
|
+
},
|
|
78
|
+
},
|
|
79
|
+
},
|
|
80
|
+
{
|
|
81
|
+
name: "ruby",
|
|
82
|
+
glyph: "💎",
|
|
83
|
+
summary: "Run Ruby code or scripts.",
|
|
84
|
+
invocation: {
|
|
85
|
+
body: {
|
|
86
|
+
role: "Ruby program; stdin when the target is a script",
|
|
87
|
+
required: false,
|
|
88
|
+
},
|
|
89
|
+
target: {
|
|
90
|
+
role: "script; never a command or a directory",
|
|
91
|
+
required: false,
|
|
92
|
+
kind: "script",
|
|
93
|
+
},
|
|
94
|
+
example: {
|
|
95
|
+
body: "puts 42",
|
|
96
|
+
},
|
|
97
|
+
},
|
|
98
|
+
},
|
|
99
|
+
{
|
|
100
|
+
name: "lua",
|
|
101
|
+
glyph: "🌙",
|
|
102
|
+
summary: "Run Lua code or scripts.",
|
|
103
|
+
invocation: {
|
|
104
|
+
body: {
|
|
105
|
+
role: "Lua program; stdin when the target is a script",
|
|
106
|
+
required: false,
|
|
107
|
+
},
|
|
108
|
+
target: {
|
|
109
|
+
role: "script; never a command or a directory",
|
|
110
|
+
required: false,
|
|
111
|
+
kind: "script",
|
|
112
|
+
},
|
|
113
|
+
example: {
|
|
114
|
+
body: "print(42)",
|
|
115
|
+
},
|
|
116
|
+
},
|
|
117
|
+
},
|
|
118
|
+
{
|
|
119
|
+
name: "deno",
|
|
120
|
+
glyph: "🦕",
|
|
121
|
+
summary: "Run TypeScript or JavaScript code or scripts with Deno.",
|
|
122
|
+
invocation: {
|
|
123
|
+
body: {
|
|
124
|
+
role: "Deno program; stdin when the target is a script",
|
|
125
|
+
required: false,
|
|
126
|
+
},
|
|
127
|
+
target: {
|
|
128
|
+
role: "script; never a command or a directory",
|
|
129
|
+
required: false,
|
|
130
|
+
kind: "script",
|
|
131
|
+
},
|
|
132
|
+
example: {
|
|
133
|
+
body: "console.log(42)",
|
|
134
|
+
},
|
|
135
|
+
},
|
|
136
|
+
},
|
|
137
|
+
{
|
|
138
|
+
name: "bun",
|
|
139
|
+
glyph: "🥟",
|
|
140
|
+
summary: "Run TypeScript or JavaScript code or scripts with Bun.",
|
|
141
|
+
invocation: {
|
|
142
|
+
body: {
|
|
143
|
+
role: "Bun program; stdin when the target is a script",
|
|
144
|
+
required: false,
|
|
145
|
+
},
|
|
146
|
+
target: {
|
|
147
|
+
role: "script; never a command or a directory",
|
|
148
|
+
required: false,
|
|
149
|
+
kind: "script",
|
|
150
|
+
},
|
|
151
|
+
example: {
|
|
152
|
+
body: "console.log(42)",
|
|
153
|
+
},
|
|
154
|
+
},
|
|
155
|
+
},
|
|
156
|
+
{
|
|
157
|
+
name: "tcl",
|
|
158
|
+
glyph: "🪶",
|
|
159
|
+
summary: "Run Tcl code or scripts.",
|
|
160
|
+
invocation: {
|
|
161
|
+
body: {
|
|
162
|
+
role: "Tcl program; stdin when the target is a script",
|
|
163
|
+
required: false,
|
|
164
|
+
},
|
|
165
|
+
target: {
|
|
166
|
+
role: "script; never a command or a directory",
|
|
167
|
+
required: false,
|
|
168
|
+
kind: "script",
|
|
169
|
+
},
|
|
170
|
+
example: {
|
|
171
|
+
body: "puts 42",
|
|
172
|
+
},
|
|
173
|
+
},
|
|
174
|
+
},
|
|
175
|
+
{
|
|
176
|
+
name: "bc",
|
|
177
|
+
glyph: "🧮",
|
|
178
|
+
summary: "Evaluate calculations with bc.",
|
|
179
|
+
invocation: {
|
|
180
|
+
body: {
|
|
181
|
+
role: "bc program; stdin when the target is a script",
|
|
182
|
+
required: false,
|
|
183
|
+
},
|
|
184
|
+
target: {
|
|
185
|
+
role: "script; never a command or a directory",
|
|
186
|
+
required: false,
|
|
187
|
+
kind: "script",
|
|
188
|
+
},
|
|
189
|
+
example: {
|
|
190
|
+
body: "6 * 7",
|
|
191
|
+
},
|
|
192
|
+
},
|
|
193
|
+
},
|
|
194
|
+
{
|
|
195
|
+
name: "awk",
|
|
196
|
+
glyph: "🪄",
|
|
197
|
+
summary: "Run AWK code or scripts.",
|
|
198
|
+
invocation: {
|
|
199
|
+
body: {
|
|
200
|
+
role: "AWK program; stdin when the target is a script",
|
|
201
|
+
required: false,
|
|
202
|
+
},
|
|
203
|
+
target: {
|
|
204
|
+
role: "script; never a command or a directory",
|
|
205
|
+
required: false,
|
|
206
|
+
kind: "script",
|
|
207
|
+
},
|
|
208
|
+
example: {
|
|
209
|
+
body: "BEGIN { print 42 }",
|
|
210
|
+
},
|
|
211
|
+
},
|
|
212
|
+
},
|
|
213
|
+
];
|
|
214
|
+
export const runtimes = () => [{ ...SH, summary: Shell.summary(Shell.current()) }, ...FIXED];
|
|
215
|
+
//# sourceMappingURL=runtimes.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"runtimes.js","sourceRoot":"","sources":["../src/runtimes.ts"],"names":[],"mappings":"AAAA,+FAA+F;AAC/F,gFAAgF;AAChF,OAAO,EAAE,KAAK,EAAoB,MAAM,sBAAsB,CAAC;AAE/D,MAAM,EAAE,GAAiC;IACrC,IAAI,EAAE,IAAI;IACV,KAAK,EAAE,IAAI;IACX,UAAU,EAAE;QACR,IAAI,EAAE;YACF,IAAI,EAAE,sDAAsD;YAC5D,QAAQ,EAAE,KAAK;SAClB;QACD,MAAM,EAAE;YACJ,IAAI,EAAE,wCAAwC;YAC9C,QAAQ,EAAE,KAAK;YACf,IAAI,EAAE,QAAQ;SACjB;QACD,OAAO,EAAE;YACL,IAAI,EAAE,oBAAoB;SAC7B;KACJ;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The `sh` fence runs the body with `-c` in the shell its summary names: the
|
|
4
|
+
environment's `$SHELL`, or `/bin/sh` when that names no executable file. The body
|
|
5
|
+
reaches it character-perfect, whitespace included; write for that shell.
|
|
4
6
|
|
|
5
7
|
```sh <!-- the body is the script itself -->
|
|
6
8
|
printf 'hello\n' > hello.txt
|
|
@@ -30,15 +32,15 @@ are refused by name.
|
|
|
30
32
|
|
|
31
33
|
The working directory is the workspace project root, or in a workspace without
|
|
32
34
|
one the directory the shell would run in anyway. `[{"cwd": "<directory>"}]` on
|
|
33
|
-
the fence line overrides it for its body;
|
|
34
|
-
|
|
35
|
+
the fence line overrides it for its body; a receipt names the directory,
|
|
36
|
+
relative to the project root, only when the command ran elsewhere.
|
|
35
37
|
|
|
36
38
|
## Channels
|
|
37
39
|
|
|
38
40
|
An execution is a host effect, subject to approval. Output streams
|
|
39
41
|
under the receipt's `stream` address, such as `sh:///ab3d5678`: `#stdout` is
|
|
40
42
|
the default channel and `#stderr` the second; both are `text/stream`. While it
|
|
41
|
-
runs, the packet's `##
|
|
43
|
+
runs, the packet's `## Open Work` streams list reports each channel's size and
|
|
42
44
|
growth, and READ can inspect any range. On completion, the harness adds one
|
|
43
45
|
`_plurnk` READ per channel: the whole output when it fits the context budget,
|
|
44
46
|
otherwise a bodiless receipt naming its size, with the `range` extent and the
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@plurnk/plurnk-execs-common",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "3.0.1",
|
|
4
4
|
"description": "Universal subprocess executor for plurnk-service's exec scheme — one package exposing the shell, Node.js, Python 3, and supported host interpreters.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"plurnk",
|
|
@@ -33,223 +33,17 @@
|
|
|
33
33
|
},
|
|
34
34
|
"plurnk": {
|
|
35
35
|
"kind": "exec",
|
|
36
|
-
"
|
|
37
|
-
{
|
|
38
|
-
"name": "sh",
|
|
39
|
-
"glyph": "🐚",
|
|
40
|
-
"summary": "Run POSIX shell commands and scripts.",
|
|
41
|
-
"invocation": {
|
|
42
|
-
"body": {
|
|
43
|
-
"role": "the shell program; stdin when the target is a script",
|
|
44
|
-
"required": false
|
|
45
|
-
},
|
|
46
|
-
"target": {
|
|
47
|
-
"role": "script; never a command or a directory",
|
|
48
|
-
"required": false,
|
|
49
|
-
"kind": "script"
|
|
50
|
-
},
|
|
51
|
-
"example": {
|
|
52
|
-
"body": "git status --short"
|
|
53
|
-
}
|
|
54
|
-
}
|
|
55
|
-
},
|
|
56
|
-
{
|
|
57
|
-
"name": "node",
|
|
58
|
-
"glyph": "⬢",
|
|
59
|
-
"summary": "Run JavaScript code or scripts with Node.js.",
|
|
60
|
-
"invocation": {
|
|
61
|
-
"body": {
|
|
62
|
-
"role": "JavaScript program; stdin when the target is a script",
|
|
63
|
-
"required": false
|
|
64
|
-
},
|
|
65
|
-
"target": {
|
|
66
|
-
"role": "script; never a command or a directory",
|
|
67
|
-
"required": false,
|
|
68
|
-
"kind": "script"
|
|
69
|
-
},
|
|
70
|
-
"example": {
|
|
71
|
-
"body": "console.log(42)"
|
|
72
|
-
}
|
|
73
|
-
}
|
|
74
|
-
},
|
|
75
|
-
{
|
|
76
|
-
"name": "python3",
|
|
77
|
-
"glyph": "🐍",
|
|
78
|
-
"summary": "Run Python 3 code or scripts.",
|
|
79
|
-
"invocation": {
|
|
80
|
-
"body": {
|
|
81
|
-
"role": "Python program; stdin when the target is a script",
|
|
82
|
-
"required": false
|
|
83
|
-
},
|
|
84
|
-
"target": {
|
|
85
|
-
"role": "script; never a command or a directory",
|
|
86
|
-
"required": false,
|
|
87
|
-
"kind": "script"
|
|
88
|
-
},
|
|
89
|
-
"example": {
|
|
90
|
-
"body": "print(42)"
|
|
91
|
-
}
|
|
92
|
-
}
|
|
93
|
-
},
|
|
94
|
-
{
|
|
95
|
-
"name": "perl",
|
|
96
|
-
"glyph": "🐪",
|
|
97
|
-
"summary": "Run Perl code or scripts.",
|
|
98
|
-
"invocation": {
|
|
99
|
-
"body": {
|
|
100
|
-
"role": "Perl program; stdin when the target is a script",
|
|
101
|
-
"required": false
|
|
102
|
-
},
|
|
103
|
-
"target": {
|
|
104
|
-
"role": "script; never a command or a directory",
|
|
105
|
-
"required": false,
|
|
106
|
-
"kind": "script"
|
|
107
|
-
},
|
|
108
|
-
"example": {
|
|
109
|
-
"body": "print 42;"
|
|
110
|
-
}
|
|
111
|
-
}
|
|
112
|
-
},
|
|
113
|
-
{
|
|
114
|
-
"name": "ruby",
|
|
115
|
-
"glyph": "💎",
|
|
116
|
-
"summary": "Run Ruby code or scripts.",
|
|
117
|
-
"invocation": {
|
|
118
|
-
"body": {
|
|
119
|
-
"role": "Ruby program; stdin when the target is a script",
|
|
120
|
-
"required": false
|
|
121
|
-
},
|
|
122
|
-
"target": {
|
|
123
|
-
"role": "script; never a command or a directory",
|
|
124
|
-
"required": false,
|
|
125
|
-
"kind": "script"
|
|
126
|
-
},
|
|
127
|
-
"example": {
|
|
128
|
-
"body": "puts 42"
|
|
129
|
-
}
|
|
130
|
-
}
|
|
131
|
-
},
|
|
132
|
-
{
|
|
133
|
-
"name": "lua",
|
|
134
|
-
"glyph": "🌙",
|
|
135
|
-
"summary": "Run Lua code or scripts.",
|
|
136
|
-
"invocation": {
|
|
137
|
-
"body": {
|
|
138
|
-
"role": "Lua program; stdin when the target is a script",
|
|
139
|
-
"required": false
|
|
140
|
-
},
|
|
141
|
-
"target": {
|
|
142
|
-
"role": "script; never a command or a directory",
|
|
143
|
-
"required": false,
|
|
144
|
-
"kind": "script"
|
|
145
|
-
},
|
|
146
|
-
"example": {
|
|
147
|
-
"body": "print(42)"
|
|
148
|
-
}
|
|
149
|
-
}
|
|
150
|
-
},
|
|
151
|
-
{
|
|
152
|
-
"name": "deno",
|
|
153
|
-
"glyph": "🦕",
|
|
154
|
-
"summary": "Run TypeScript or JavaScript code or scripts with Deno.",
|
|
155
|
-
"invocation": {
|
|
156
|
-
"body": {
|
|
157
|
-
"role": "Deno program; stdin when the target is a script",
|
|
158
|
-
"required": false
|
|
159
|
-
},
|
|
160
|
-
"target": {
|
|
161
|
-
"role": "script; never a command or a directory",
|
|
162
|
-
"required": false,
|
|
163
|
-
"kind": "script"
|
|
164
|
-
},
|
|
165
|
-
"example": {
|
|
166
|
-
"body": "console.log(42)"
|
|
167
|
-
}
|
|
168
|
-
}
|
|
169
|
-
},
|
|
170
|
-
{
|
|
171
|
-
"name": "bun",
|
|
172
|
-
"glyph": "🥟",
|
|
173
|
-
"summary": "Run TypeScript or JavaScript code or scripts with Bun.",
|
|
174
|
-
"invocation": {
|
|
175
|
-
"body": {
|
|
176
|
-
"role": "Bun program; stdin when the target is a script",
|
|
177
|
-
"required": false
|
|
178
|
-
},
|
|
179
|
-
"target": {
|
|
180
|
-
"role": "script; never a command or a directory",
|
|
181
|
-
"required": false,
|
|
182
|
-
"kind": "script"
|
|
183
|
-
},
|
|
184
|
-
"example": {
|
|
185
|
-
"body": "console.log(42)"
|
|
186
|
-
}
|
|
187
|
-
}
|
|
188
|
-
},
|
|
189
|
-
{
|
|
190
|
-
"name": "tcl",
|
|
191
|
-
"glyph": "🪶",
|
|
192
|
-
"summary": "Run Tcl code or scripts.",
|
|
193
|
-
"invocation": {
|
|
194
|
-
"body": {
|
|
195
|
-
"role": "Tcl program; stdin when the target is a script",
|
|
196
|
-
"required": false
|
|
197
|
-
},
|
|
198
|
-
"target": {
|
|
199
|
-
"role": "script; never a command or a directory",
|
|
200
|
-
"required": false,
|
|
201
|
-
"kind": "script"
|
|
202
|
-
},
|
|
203
|
-
"example": {
|
|
204
|
-
"body": "puts 42"
|
|
205
|
-
}
|
|
206
|
-
}
|
|
207
|
-
},
|
|
208
|
-
{
|
|
209
|
-
"name": "bc",
|
|
210
|
-
"glyph": "🧮",
|
|
211
|
-
"summary": "Evaluate calculations with bc.",
|
|
212
|
-
"invocation": {
|
|
213
|
-
"body": {
|
|
214
|
-
"role": "bc program; stdin when the target is a script",
|
|
215
|
-
"required": false
|
|
216
|
-
},
|
|
217
|
-
"target": {
|
|
218
|
-
"role": "script; never a command or a directory",
|
|
219
|
-
"required": false,
|
|
220
|
-
"kind": "script"
|
|
221
|
-
},
|
|
222
|
-
"example": {
|
|
223
|
-
"body": "6 * 7"
|
|
224
|
-
}
|
|
225
|
-
}
|
|
226
|
-
},
|
|
227
|
-
{
|
|
228
|
-
"name": "awk",
|
|
229
|
-
"glyph": "🪄",
|
|
230
|
-
"summary": "Run AWK code or scripts.",
|
|
231
|
-
"invocation": {
|
|
232
|
-
"body": {
|
|
233
|
-
"role": "AWK program; stdin when the target is a script",
|
|
234
|
-
"required": false
|
|
235
|
-
},
|
|
236
|
-
"target": {
|
|
237
|
-
"role": "script; never a command or a directory",
|
|
238
|
-
"required": false,
|
|
239
|
-
"kind": "script"
|
|
240
|
-
},
|
|
241
|
-
"example": {
|
|
242
|
-
"body": "BEGIN { print 42 }"
|
|
243
|
-
}
|
|
244
|
-
}
|
|
245
|
-
}
|
|
246
|
-
]
|
|
36
|
+
"runtimesModule": "./runtimes"
|
|
247
37
|
},
|
|
248
38
|
"exports": {
|
|
249
39
|
".": {
|
|
250
40
|
"types": "./dist/index.d.ts",
|
|
251
41
|
"default": "./dist/index.js"
|
|
252
42
|
},
|
|
43
|
+
"./runtimes": {
|
|
44
|
+
"types": "./dist/runtimes.d.ts",
|
|
45
|
+
"default": "./dist/runtimes.js"
|
|
46
|
+
},
|
|
253
47
|
"./package.json": "./package.json"
|
|
254
48
|
},
|
|
255
49
|
"files": [
|
|
@@ -261,7 +55,7 @@
|
|
|
261
55
|
],
|
|
262
56
|
"scripts": {
|
|
263
57
|
"test:lint": "tsc --noEmit",
|
|
264
|
-
"test:unit": "node --conditions=plurnk-dev --env-file-if-exists=.env.defaults --env-file-if-exists=../plurnk-execs/.env.defaults --test \"src/**/*.test.ts\"",
|
|
58
|
+
"test:unit": "node --conditions=plurnk-dev --env-file-if-exists=.env.defaults --env-file-if-exists=../plurnk-execs/.env.defaults --test ${PLURNK_TEST_CONCURRENCY:+--test-concurrency=$PLURNK_TEST_CONCURRENCY} \"src/**/*.test.ts\"",
|
|
265
59
|
"test": "npm run test:lint && npm run test:unit",
|
|
266
60
|
"build:clean": "rm -rf dist",
|
|
267
61
|
"build:dist": "tsc -p tsconfig.build.json",
|
|
@@ -270,7 +64,7 @@
|
|
|
270
64
|
"prepublishOnly": "npm audit --audit-level=moderate && npm test"
|
|
271
65
|
},
|
|
272
66
|
"peerDependencies": {
|
|
273
|
-
"@plurnk/plurnk-execs": "^
|
|
67
|
+
"@plurnk/plurnk-execs": "^4.0.0"
|
|
274
68
|
},
|
|
275
|
-
"gitHead": "
|
|
69
|
+
"gitHead": "d2647f7ec0d352b276714f22a93267aac04634b3"
|
|
276
70
|
}
|