inngest-cli 1.9.1 → 1.9.2-beta.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 CHANGED
@@ -19,7 +19,7 @@ Inngest Functions enable developers to run reliable background logic, from backg
19
19
 
20
20
  - [**Triggers**](https://www.inngest.com/docs/features/events-triggers?ref=github-inngest-readme) - Events, Cron schedules or webhook events that trigger the function.
21
21
  - [**Flow Control**](https://www.inngest.com/docs/guides/flow-control?ref=github-inngest-readme) - Configure how the function runs are enqueued and executed including concurrency, throttling, debouncing, rate limiting, and prioritization.
22
- - [**Steps**](/docs/features/inngest-functions/steps-workflows?ref=github-inngest-readme) - Steps are fundamental building blocks of Inngest, turning your Inngest Functions into reliable workflows that can runs for months and recover from failures.
22
+ - [**Steps**](/docs/features/inngest-functions/steps-workflows?ref=github-inngest-readme) - Steps are fundamental building blocks of Inngest, turning your Inngest Functions into reliable workflows that can run for months and recover from failures.
23
23
 
24
24
  Here is an example function that limits concurrency for each unique user id and performs two steps that will be retried on error:
25
25
 
package/bin/inngest CHANGED
@@ -0,0 +1,34 @@
1
+ #!/usr/bin/env node
2
+
3
+ const { existsSync } = require('fs');
4
+ const { join } = require('path');
5
+ const { execFileSync } = require('child_process');
6
+
7
+ // On Windows, the downloaded release does not overwrite this file
8
+ // so check if inngest.exe exists and run it
9
+ if (process.platform === 'win32') {
10
+ const exePath = join(__dirname, 'inngest.exe');
11
+ if (existsSync(exePath)) {
12
+ try {
13
+ execFileSync(exePath, process.argv.slice(2), { stdio: 'inherit' });
14
+ process.exit(0);
15
+ } catch (err) {
16
+ process.exit(err.status || 1);
17
+ }
18
+ }
19
+ }
20
+
21
+ console.error('Error: Inngest CLI binary not found.');
22
+ console.error('');
23
+ console.error('This happened because install scripts were skipped.');
24
+ console.error('To fix this, use the method most appropriate for your setup');
25
+ console.error('');
26
+ console.error('one-off npx run:');
27
+ console.error(' NPM_CONFIG_CACHE=$(mktemp -d) npx --ignore-scripts=false inngest-cli@latest');
28
+ console.error('');
29
+ console.error('or delete your npx cache at ~/.npm/_npx and run:');
30
+ console.error(' npx --ignore-scripts=false inngest-cli@latest');
31
+ console.error('');
32
+ console.error('if you are using npm install:');
33
+ console.error(' npm rebuild --ignore-scripts=false inngest-cli');
34
+ process.exit(1);
package/package.json CHANGED
@@ -1,10 +1,10 @@
1
1
  {
2
2
  "name": "inngest-cli",
3
- "version": "1.9.1",
3
+ "version": "1.9.2-beta.1",
4
4
  "description": "The leading workflow orchestration platform. Run stateful step functions and AI workflows on serverless, servers, or the edge.",
5
5
  "license": "SEE LICENSE IN LICENSE.md",
6
6
  "scripts": {
7
- "prepublishOnly": "touch bin/inngest && cp ../README.md .",
7
+ "prepublishOnly": "cp ../README.md .",
8
8
  "postinstall": "node postinstall.js",
9
9
  "build": "tsc"
10
10
  },
@@ -23,20 +23,22 @@
23
23
  "postinstall.js"
24
24
  ],
25
25
  "volta": {
26
- "node": "^20.1.0"
26
+ "node": "24.13.0"
27
27
  },
28
28
  "dependencies": {
29
29
  "adm-zip": "^0.5.10",
30
30
  "debug": "^4.3.4",
31
31
  "node-fetch": "^2.6.7",
32
- "tar": "^6.2.1"
32
+ "tar": "^7.5.3"
33
33
  },
34
34
  "devDependencies": {
35
35
  "@types/adm-zip": "^0.5.0",
36
36
  "@types/debug": "^4.1.8",
37
37
  "@types/node-fetch": "^2.6.2",
38
38
  "@types/request": "^2.48.8",
39
- "@types/tar": "^6.1.1",
40
39
  "typescript": "^4.7.4"
40
+ },
41
+ "prettier": {
42
+ "singleQuote": false
41
43
  }
42
44
  }
package/postinstall.js CHANGED
@@ -1,5 +1,28 @@
1
1
  #!/usr/bin/env node
2
2
  "use strict";
3
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
4
+ if (k2 === undefined) k2 = k;
5
+ var desc = Object.getOwnPropertyDescriptor(m, k);
6
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
7
+ desc = { enumerable: true, get: function() { return m[k]; } };
8
+ }
9
+ Object.defineProperty(o, k2, desc);
10
+ }) : (function(o, m, k, k2) {
11
+ if (k2 === undefined) k2 = k;
12
+ o[k2] = m[k];
13
+ }));
14
+ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
15
+ Object.defineProperty(o, "default", { enumerable: true, value: v });
16
+ }) : function(o, v) {
17
+ o["default"] = v;
18
+ });
19
+ var __importStar = (this && this.__importStar) || function (mod) {
20
+ if (mod && mod.__esModule) return mod;
21
+ var result = {};
22
+ if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
23
+ __setModuleDefault(result, mod);
24
+ return result;
25
+ };
3
26
  var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
4
27
  function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
5
28
  return new (P || (P = Promise))(function (resolve, reject) {
@@ -17,7 +40,7 @@ const adm_zip_1 = __importDefault(require("adm-zip"));
17
40
  const debug_1 = __importDefault(require("debug"));
18
41
  const node_fetch_1 = __importDefault(require("node-fetch"));
19
42
  const path_1 = __importDefault(require("path"));
20
- const tar_1 = __importDefault(require("tar"));
43
+ const tar = __importStar(require("tar"));
21
44
  const url_1 = require("url");
22
45
  const package_json_1 = __importDefault(require("./package.json"));
23
46
  const rootDebug = (0, debug_1.default)("inngest:cli");
@@ -35,16 +58,23 @@ const platformMap = {
35
58
  darwin: { platform: "darwin", extension: KnownExtension.Tar },
36
59
  win32: { platform: "windows", extension: KnownExtension.Zip },
37
60
  };
38
- function getBinaryUrl() {
61
+ function getBinaryUrl(source) {
39
62
  return __awaiter(this, void 0, void 0, function* () {
40
63
  const debug = rootDebug.extend("getBinaryUrl");
41
64
  const { arch, platform } = getArchPlatform();
42
- debug({ arch, platform });
65
+ debug({ arch, platform, source });
43
66
  let version = package_json_1.default.version.trim();
44
67
  debug("package.json version:", version);
45
- const targetUrl = new url_1.URL(`https://cli.inngest.com/artifact/v${version}/inngest_${version}_${platform.platform}_${arch}${platform.extension}`);
46
- debug("targetUrl:", targetUrl.href);
47
- return targetUrl;
68
+ if (source === "cdn") {
69
+ const url = new url_1.URL(`https://cli.inngest.com/artifact/v${version}/inngest_${version}_${platform.platform}_${arch}${platform.extension}`);
70
+ debug("targetUrl:", url.href);
71
+ return url;
72
+ }
73
+ else {
74
+ const url = new url_1.URL(`https://github.com/inngest/inngest/releases/download/v${version}/inngest_${version}_${platform.platform}_${arch}${platform.extension}`);
75
+ debug("targetUrl:", url.href);
76
+ return url;
77
+ }
48
78
  });
49
79
  }
50
80
  function getArchPlatform() {
@@ -93,7 +123,7 @@ function pipeBinaryToInstallLocation(res, originalUrl) {
93
123
  [KnownExtension.Tar]: () => {
94
124
  var _a;
95
125
  debug("unpacking using tar strategy");
96
- const untar = tar_1.default.extract({ cwd: targetPath });
126
+ const untar = tar.extract({ cwd: targetPath });
97
127
  untar.on("error", reject);
98
128
  untar.on("end", () => resolve());
99
129
  (_a = res.body) === null || _a === void 0 ? void 0 : _a.pipe(untar);
@@ -126,10 +156,19 @@ function pipeBinaryToInstallLocation(res, originalUrl) {
126
156
  process.exit(0);
127
157
  }
128
158
  try {
129
- const binaryUrl = yield getBinaryUrl();
130
- const req = yield downloadBinary(binaryUrl);
131
- yield pipeBinaryToInstallLocation(req, binaryUrl);
132
- rootDebug("postinstall complete");
159
+ try {
160
+ const binaryUrl = yield getBinaryUrl("cdn");
161
+ const req = yield downloadBinary(binaryUrl);
162
+ yield pipeBinaryToInstallLocation(req, binaryUrl);
163
+ rootDebug("postinstall complete (via cdn)");
164
+ }
165
+ catch (err) {
166
+ rootDebug("failed to download from cdn; falling back to github");
167
+ const binaryUrl = yield getBinaryUrl("github");
168
+ const req = yield downloadBinary(binaryUrl);
169
+ yield pipeBinaryToInstallLocation(req, binaryUrl);
170
+ rootDebug("postinstall complete (via github)");
171
+ }
133
172
  }
134
173
  catch (err) {
135
174
  console.error(err);