exupery-core-bin 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.
@@ -0,0 +1,6 @@
1
+ import * as g_pi from "./bin_glossary";
2
+ export declare namespace DEP {
3
+ }
4
+ export declare namespace API {
5
+ type main = ($: null, $d: null, $se: null) => g_pi.A.Main;
6
+ }
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -0,0 +1,31 @@
1
+ import * as pt from 'exupery-core-types';
2
+ export declare namespace G { }
3
+ export declare namespace N { }
4
+ export declare namespace D {
5
+ namespace Command__Line__Arguments {
6
+ namespace _larguments {
7
+ type A = string;
8
+ }
9
+ type _larguments = pt.Array<string>;
10
+ }
11
+ type Command__Line__Arguments = {
12
+ readonly 'arguments': pt.Array<string>;
13
+ };
14
+ type Exit__code = number;
15
+ type Message = string;
16
+ }
17
+ export declare namespace I {
18
+ type Exit = ($: D.Exit__code) => void;
19
+ type Main = ($: D.Command__Line__Arguments) => void;
20
+ type Message__Stream = {
21
+ 'data': ($: D.Message) => void;
22
+ 'end': () => void;
23
+ };
24
+ }
25
+ export declare namespace A {
26
+ type Main = ($is: {
27
+ readonly 'exit': I.Exit;
28
+ readonly 'stderr': I.Message__Stream;
29
+ readonly 'stdout': I.Message__Stream;
30
+ }) => I.Main;
31
+ }
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -0,0 +1,3 @@
1
+ export * from "./run_program";
2
+ export * from "./bin_api";
3
+ export * from "./bin_glossary";
package/dist/index.js ADDED
@@ -0,0 +1,19 @@
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
+ for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
+ };
16
+ Object.defineProperty(exports, "__esModule", { value: true });
17
+ __exportStar(require("./run_program"), exports);
18
+ __exportStar(require("./bin_api"), exports);
19
+ __exportStar(require("./bin_glossary"), exports);
@@ -0,0 +1,2 @@
1
+ import * as api from "./bin_api";
2
+ export declare function run_program(main_creator: api.API.main): void;
@@ -0,0 +1,51 @@
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
14
+ Object.defineProperty(o, "default", { enumerable: true, value: v });
15
+ }) : function(o, v) {
16
+ o["default"] = v;
17
+ });
18
+ var __importStar = (this && this.__importStar) || function (mod) {
19
+ if (mod && mod.__esModule) return mod;
20
+ var result = {};
21
+ if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
22
+ __setModuleDefault(result, mod);
23
+ return result;
24
+ };
25
+ Object.defineProperty(exports, "__esModule", { value: true });
26
+ exports.run_program = run_program;
27
+ const pi = __importStar(require("exupery-core-internals"));
28
+ const process = __importStar(require("process"));
29
+ function run_program(main_creator) {
30
+ main_creator(null, null, null)({
31
+ 'exit': ($) => {
32
+ process.exit($);
33
+ },
34
+ 'stderr': {
35
+ 'data': ($) => {
36
+ process.stderr.write($);
37
+ },
38
+ 'end': () => {
39
+ }
40
+ },
41
+ 'stdout': {
42
+ 'data': ($) => {
43
+ process.stdout.write($);
44
+ },
45
+ 'end': () => {
46
+ }
47
+ }
48
+ })({
49
+ 'arguments': pi.array_literal(process.argv.slice(2)) //strip 'node' and the script name
50
+ });
51
+ }
package/package.json ADDED
@@ -0,0 +1,32 @@
1
+ {
2
+ "name": "exupery-core-bin",
3
+ "version": "0.1.0",
4
+ "license": "ISC",
5
+ "description": "this is one of the core packages for Exupery. it provides functionality to create executables",
6
+ "author": "Corno",
7
+ "keywords": [
8
+ "exupery",
9
+ "exe",
10
+ "executable",
11
+ "bin"
12
+ ],
13
+ "homepage": "https://github.com/corno/exupery-core#readme",
14
+ "bugs": {
15
+ "url": "https://github.com/corno/exupery-core/issues"
16
+ },
17
+ "main": "./dist/index.js",
18
+ "types": "dist/index.d.ts",
19
+ "files": [
20
+ "dist"
21
+ ],
22
+ "devDependencies": {
23
+ "@types/node": "^18.11.9"
24
+ },
25
+ "repository": {
26
+ "type": "git",
27
+ "url": "git+https://github.com/corno/exupery-core.git"
28
+ },
29
+ "dependencies": {
30
+ "exupery-core-internals": "^0.1.2"
31
+ }
32
+ }