@restatedev/restate 0.5.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/lib/index.js ADDED
@@ -0,0 +1,25 @@
1
+ #!/usr/bin/env node
2
+ "use strict";
3
+ var __importDefault = (this && this.__importDefault) || function (mod) {
4
+ return (mod && mod.__esModule) ? mod : { "default": mod };
5
+ };
6
+ Object.defineProperty(exports, "__esModule", { value: true });
7
+ const child_process_1 = require("child_process");
8
+ const node_os_1 = __importDefault(require("node:os"));
9
+ function getExePath() {
10
+ const arch = node_os_1.default.arch();
11
+ const op = node_os_1.default.platform();
12
+ try {
13
+ return require.resolve(`@restatedev/restate-${op}-${arch}/bin/restate`);
14
+ }
15
+ catch (e) {
16
+ throw new Error(`Couldn't find application binary inside node_modules for ${op}-${arch}`);
17
+ }
18
+ }
19
+ function run() {
20
+ var _a;
21
+ const args = process.argv.slice(2);
22
+ const processResult = (0, child_process_1.spawnSync)(getExePath(), args, { stdio: "inherit" });
23
+ process.exit((_a = processResult.status) !== null && _a !== void 0 ? _a : 0);
24
+ }
25
+ run();
package/package.json ADDED
@@ -0,0 +1,37 @@
1
+ {
2
+ "name": "@restatedev/restate",
3
+ "description": "The Restate CLI",
4
+ "version": "0.5.1",
5
+ "bin": "lib/index.js",
6
+ "repository": {
7
+ "type": "git",
8
+ "url": "git+https://github.com/restate/restate.git"
9
+ },
10
+ "publishConfig": {
11
+ "@restatedev:registry": "https://registry.npmjs.org"
12
+ },
13
+ "author": "Restate Developers",
14
+ "license": "BSL",
15
+ "email": "code@restate.dev",
16
+ "homepage": "https://github.com/restatedev/restate#readme",
17
+ "scripts": {
18
+ "typecheck": "tsc --noEmit",
19
+ "lint": "eslint .",
20
+ "lint:fix": "eslint . --fix",
21
+ "build": "tsc",
22
+ "dev": "npm run build && node lib/index.js"
23
+ },
24
+ "devDependencies": {
25
+ "@types/node": "^18.11.18",
26
+ "@typescript-eslint/eslint-plugin": "^5.48.0",
27
+ "@typescript-eslint/parser": "^5.48.0",
28
+ "eslint": "^8.31.0",
29
+ "typescript": "^4.9.4"
30
+ },
31
+ "optionalDependencies": {
32
+ "@restatedev/restate-linux-x86_64": "0.5.1",
33
+ "@restatedev/restate-linux-arm64": "0.5.1",
34
+ "@restatedev/restate-darwin-x86_64": "0.5.1",
35
+ "@restatedev/restate-darwin-arm64": "0.5.1"
36
+ }
37
+ }
package/src/index.ts ADDED
@@ -0,0 +1,25 @@
1
+ #!/usr/bin/env node
2
+
3
+ import { spawnSync } from "child_process";
4
+ import os from 'node:os';
5
+
6
+ function getExePath() {
7
+ const arch = os.arch();
8
+ const op = os.platform();
9
+
10
+ try {
11
+ return require.resolve(`@restatedev/restate-${op}-${arch}/bin/restate`);
12
+ } catch (e) {
13
+ throw new Error(
14
+ `Couldn't find application binary inside node_modules for ${op}-${arch}`
15
+ );
16
+ }
17
+ }
18
+
19
+ function run() {
20
+ const args = process.argv.slice(2);
21
+ const processResult = spawnSync(getExePath(), args, { stdio: "inherit" });
22
+ process.exit(processResult.status ?? 0);
23
+ }
24
+
25
+ run();
package/tsconfig.json ADDED
@@ -0,0 +1,12 @@
1
+ {
2
+ "compilerOptions": {
3
+ "target": "es2016",
4
+ "module": "commonjs",
5
+ "esModuleInterop": true,
6
+ "baseUrl": "./",
7
+ "outDir": "lib",
8
+ "forceConsistentCasingInFileNames": true,
9
+ "strict": true,
10
+ "skipLibCheck": true
11
+ }
12
+ }