@swiftuijs/twill-shell 0.3.1 → 0.4.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 +10 -5
- package/dist/cwd.js +1 -2
- package/dist/environment.js +1 -2
- package/dist/errors.js +1 -2
- package/dist/index.js +2 -3
- package/dist/values.js +1 -2
- package/package.json +5 -5
package/README.md
CHANGED
|
@@ -1,5 +1,10 @@
|
|
|
1
1
|
# <img src="https://twill.evecalm.com/logo.png" alt="Twill hummingbird" align="right" width="40" height="40" /> Twill shell
|
|
2
2
|
|
|
3
|
+
[](https://www.npmjs.com/package/@swiftuijs/twill-shell)
|
|
4
|
+
[](https://www.npmjs.com/package/@swiftuijs/twill-shell)
|
|
5
|
+
[](https://github.com/swiftuijs/twill/actions/workflows/ci.yml)
|
|
6
|
+
[](https://github.com/swiftuijs/twill/blob/main/LICENSE)
|
|
7
|
+
|
|
3
8
|
Swift-inspired subprocess tools for Twill and ordinary Node JS/TS scripts, Node-based in 0.3.0.
|
|
4
9
|
|
|
5
10
|
## Install in your project
|
|
@@ -7,10 +12,10 @@ Swift-inspired subprocess tools for Twill and ordinary Node JS/TS scripts, Node-
|
|
|
7
12
|
Use Node 24 LTS for a new setup (supported range: `^20.19.0 || >=22.12.0`). Run from the directory containing your `package.json`; for a new project, run `npm init -y` first. Install the SDK as a production dependency:
|
|
8
13
|
|
|
9
14
|
```sh
|
|
10
|
-
npm install @swiftuijs/twill-shell@0.
|
|
15
|
+
npm install @swiftuijs/twill-shell@0.4.0
|
|
11
16
|
```
|
|
12
17
|
|
|
13
|
-
With pnpm, use `pnpm add @swiftuijs/twill-shell@0.
|
|
18
|
+
With pnpm, use `pnpm add @swiftuijs/twill-shell@0.4.0`. This package supplies the process API; `@swiftuijs/twill` supplies the optional Twill source runner. A global compiler does not make this SDK available to project imports. Keep Twill packages on the same version.
|
|
14
19
|
|
|
15
20
|
## Run ordinary JavaScript
|
|
16
21
|
|
|
@@ -37,8 +42,8 @@ Run `node command.mjs`. Expected output is `Hello from a child process`. This wo
|
|
|
37
42
|
Install the compiler as well:
|
|
38
43
|
|
|
39
44
|
```sh
|
|
40
|
-
npm install --save-dev @swiftuijs/twill@0.
|
|
41
|
-
# pnpm add -D @swiftuijs/twill@0.
|
|
45
|
+
npm install --save-dev @swiftuijs/twill@0.4.0
|
|
46
|
+
# pnpm add -D @swiftuijs/twill@0.4.0
|
|
42
47
|
```
|
|
43
48
|
|
|
44
49
|
Copy the JavaScript example to `command.twill` and add `#!/usr/bin/env twill` as its first line. Use the local command:
|
|
@@ -48,7 +53,7 @@ npm exec -- twill command.twill
|
|
|
48
53
|
# pnpm exec twill command.twill
|
|
49
54
|
```
|
|
50
55
|
|
|
51
|
-
On Linux/macOS, `chmod +x command.twill` enables `npm exec --call './command.twill'` or `pnpm exec ./command.twill`. To run `./command.twill` directly, install the compiler globally with `npm install --global @swiftuijs/twill@0.
|
|
56
|
+
On Linux/macOS, `chmod +x command.twill` enables `npm exec --call './command.twill'` or `pnpm exec ./command.twill`. To run `./command.twill` directly, install the compiler globally with `npm install --global @swiftuijs/twill@0.4.0` and keep its executable directory on PATH. Windows uses the explicit CLI. Arguments after the script path pass through unchanged. Application dependencies resolve from the script's location. Use compiler and SDK 0.3.0 or newer.
|
|
52
57
|
|
|
53
58
|
For package scripts, Node type declarations, error handling and troubleshooting, follow the [complete shell scripting guide](https://twill.evecalm.com/scripting). [Getting started](https://twill.evecalm.com/getting-started) covers application modules and build integration.
|
|
54
59
|
|
package/dist/cwd.js
CHANGED
|
@@ -1,9 +1,8 @@
|
|
|
1
1
|
import { isAbsolute, win32 } from "node:path";
|
|
2
|
-
|
|
2
|
+
// src/cwd.twill
|
|
3
3
|
function cwdSnapshot(cwd, platform = process.platform, parent = process.cwd()) {
|
|
4
4
|
return cwd === void 0 ? parent : platform === "win32" ? win32.resolve(parent, cwd) : isAbsolute(cwd) ? cwd : `${parent}/${cwd}`;
|
|
5
5
|
}
|
|
6
|
-
//#endregion
|
|
7
6
|
export { cwdSnapshot };
|
|
8
7
|
|
|
9
8
|
//# sourceMappingURL=cwd.js.map
|
package/dist/environment.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { childEnvironment } from "./values.js";
|
|
2
|
-
|
|
2
|
+
// src/environment.twill
|
|
3
3
|
var windowsRequired = [
|
|
4
4
|
"HOMEDRIVE",
|
|
5
5
|
"HOMEPATH",
|
|
@@ -26,7 +26,6 @@ function environmentSnapshot(policy, platform = process.platform, parent = proce
|
|
|
26
26
|
}
|
|
27
27
|
return environment;
|
|
28
28
|
}
|
|
29
|
-
//#endregion
|
|
30
29
|
export { environmentSnapshot };
|
|
31
30
|
|
|
32
31
|
//# sourceMappingURL=environment.js.map
|
package/dist/errors.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
|
|
1
|
+
// src/errors.twill
|
|
2
2
|
var ProcessError = class extends Error {
|
|
3
3
|
processIdentifier;
|
|
4
4
|
terminationStatus;
|
|
@@ -59,7 +59,6 @@ var ProcessExitError = class extends ProcessError {
|
|
|
59
59
|
Object.assign(this, result);
|
|
60
60
|
}
|
|
61
61
|
};
|
|
62
|
-
//#endregion
|
|
63
62
|
export { OutputLimitError, ProcessAbortError, ProcessError, ProcessExitError, ProcessIOError, ProcessLaunchError, ProcessTeardownError, ProcessTimeoutError };
|
|
64
63
|
|
|
65
64
|
//# sourceMappingURL=errors.js.map
|
package/dist/index.js
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import { cwdSnapshot } from "./cwd.js";
|
|
2
|
-
import { Command, Environment, Input, Output, settings } from "./values.js";
|
|
3
2
|
import { environmentSnapshot } from "./environment.js";
|
|
3
|
+
import { Command, Environment, Input, Output, settings } from "./values.js";
|
|
4
4
|
import { OutputLimitError, ProcessAbortError, ProcessError, ProcessExitError, ProcessIOError, ProcessLaunchError, ProcessTeardownError, ProcessTimeoutError } from "./errors.js";
|
|
5
5
|
import childProcess from "node:child_process";
|
|
6
6
|
import { performance } from "node:perf_hooks";
|
|
7
7
|
import { addAbortListener } from "node:events";
|
|
8
|
-
|
|
8
|
+
// src/index.twill
|
|
9
9
|
var Capture = class {
|
|
10
10
|
reader;
|
|
11
11
|
policy;
|
|
@@ -218,7 +218,6 @@ function run(cmd, options = emptyOptions) {
|
|
|
218
218
|
});
|
|
219
219
|
}
|
|
220
220
|
var Subprocess = Object.freeze({ run });
|
|
221
|
-
//#endregion
|
|
222
221
|
export { Command, Environment, Input, Output, OutputLimitError, ProcessAbortError, ProcessError, ProcessExitError, ProcessIOError, ProcessLaunchError, ProcessTeardownError, ProcessTimeoutError, Subprocess };
|
|
223
222
|
|
|
224
223
|
//# sourceMappingURL=index.js.map
|
package/dist/values.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { isAbsolute } from "node:path";
|
|
2
2
|
import { constants } from "node:buffer";
|
|
3
|
-
|
|
3
|
+
// src/values.twill
|
|
4
4
|
var commandBrand = Symbol.for("@swiftuijs/twill-shell/command/v1");
|
|
5
5
|
var environmentBrand = Symbol.for("@swiftuijs/twill-shell/environment/v1");
|
|
6
6
|
var outputBrand = Symbol.for("@swiftuijs/twill-shell/output/v1");
|
|
@@ -170,7 +170,6 @@ function childEnvironment(policy, platform = process.platform) {
|
|
|
170
170
|
else env[key] = value;
|
|
171
171
|
return env;
|
|
172
172
|
}
|
|
173
|
-
//#endregion
|
|
174
173
|
export { Command, Environment, Input, Output, childEnvironment, settings };
|
|
175
174
|
|
|
176
175
|
//# sourceMappingURL=values.js.map
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@swiftuijs/twill-shell",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.4.0",
|
|
4
4
|
"description": "Swift-inspired subprocess toolkit for Twill and native Node scripts: explicit arguments, bounded output and owned teardown.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"license": "MIT",
|
|
@@ -37,10 +37,10 @@
|
|
|
37
37
|
"vitest": "^5.0.3",
|
|
38
38
|
"@vitest/coverage-v8": "^5.0.3",
|
|
39
39
|
"prettier": "^3.9.9",
|
|
40
|
-
"vite": "^8.3.
|
|
41
|
-
"@swiftuijs/twill-formatter": "0.
|
|
42
|
-
"@swiftuijs/twill": "0.
|
|
43
|
-
"@swiftuijs/twill-export": "0.
|
|
40
|
+
"vite": "^8.3.5",
|
|
41
|
+
"@swiftuijs/twill-formatter": "0.4.0",
|
|
42
|
+
"@swiftuijs/twill": "0.4.0",
|
|
43
|
+
"@swiftuijs/twill-export": "0.4.0"
|
|
44
44
|
},
|
|
45
45
|
"author": {
|
|
46
46
|
"name": "forth.ink",
|