New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

inngest-cli

Package Overview
Dependencies
Maintainers
3
Versions
122
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

inngest-cli - npm Package Compare versions

Comparing version 0.16.3 to 0.16.4-next.1

bin/.gitkeep

12

package.json
{
"name": "inngest-cli",
"version": "0.16.3",
"version": "0.16.4-next.1",
"description": "The event-driven queue for any language.",
"license": "SEE LICENSE IN LICENSE.md",
"scripts": {
"prepublishOnly": "mkdir bin && touch bin/inngest && cp ../README.md .",
"prepublishOnly": "touch bin/inngest && cp ../README.md .",
"postinstall": "node postinstall.js",

@@ -29,13 +29,15 @@ "build": "tsc"

"dependencies": {
"adm-zip": "^0.5.10",
"debug": "^4.3.4",
"node-fetch": "2.6.7",
"tar": "6.1.11",
"unzipper": "0.10.11"
"tar": "6.1.11"
},
"devDependencies": {
"@types/adm-zip": "^0.5.0",
"@types/debug": "^4.1.8",
"@types/node-fetch": "2.6.2",
"@types/request": "2.48.8",
"@types/tar": "6.1.1",
"@types/unzipper": "0.10.5",
"typescript": "4.7.4"
}
}

@@ -0,1 +1,2 @@

#!/usr/bin/env node
"use strict";

@@ -15,7 +16,9 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {

Object.defineProperty(exports, "__esModule", { value: true });
const adm_zip_1 = __importDefault(require("adm-zip"));
const debug_1 = __importDefault(require("debug"));
const node_fetch_1 = __importDefault(require("node-fetch"));
const path_1 = __importDefault(require("path"));
const tar_1 = __importDefault(require("tar"));
const unzipper_1 = __importDefault(require("unzipper"));
const url_1 = require("url");
const rootDebug = (0, debug_1.default)("inngest:cli");
const archMap = {

@@ -38,8 +41,17 @@ arm64: "arm64",

return __awaiter(this, void 0, void 0, function* () {
const version = (_a = process.env.npm_package_version) === null || _a === void 0 ? void 0 : _a.trim();
const debug = rootDebug.extend("getBinaryUrl");
const { arch, platform } = getArchPlatform();
debug({ arch, platform });
let version = (_a = process.env.npm_package_version) === null || _a === void 0 ? void 0 : _a.trim();
debug("npm_package_version:", version);
if (platform.platform === "windows") {
debug("Windows detected; pinning to v0.14.6");
console.warn("Windows detected; pinning to last known working version 0.14.6");
version = "0.14.6";
}
if (!version) {
throw new Error("Could not find package version to install binary");
}
const { arch, platform } = getArchPlatform();
const targetUrl = new url_1.URL(`https://cli.inngest.com/artifact/v${version}/inngest_${version}_${platform.platform}_${arch}${platform.extension}`);
debug("targetUrl:", targetUrl.href);
return targetUrl;

@@ -49,4 +61,11 @@ });

function getArchPlatform() {
const debug = rootDebug.extend("getArchPlatform");
const arch = archMap[process.arch];
const platform = platformMap[process.platform];
debug({
arch,
platform,
"process.arch": process.arch,
"process.platform": process.platform,
});
if (!arch) {

@@ -58,6 +77,12 @@ throw new Error(`Unsupported architecture: ${process.arch}`);

}
if (platform.platform === "windows" && arch === "amd64") {
debug("Old Windows x64 build; using 'x86_64' to access binary");
return { arch: "x86_64", platform };
}
return { arch, platform };
}
function downloadBinary(url) {
const debug = rootDebug.extend("downloadBinary");
return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () {
debug("downloading binary from:", url.href);
(0, node_fetch_1.default)(url.href, {

@@ -76,2 +101,3 @@ redirect: "follow",

function pipeBinaryToInstallLocation(res, originalUrl) {
const debug = rootDebug.extend("pipeBinaryToInstallLocation");
return new Promise((resolve, reject) => {

@@ -82,5 +108,7 @@ if (!res.body) {

const targetPath = path_1.default.resolve("./bin");
debug("targetPath:", targetPath);
const strategies = {
[KnownExtension.Tar]: () => {
var _a;
debug("unpacking using tar strategy");
const untar = tar_1.default.extract({ cwd: targetPath });

@@ -92,7 +120,11 @@ untar.on("error", reject);

[KnownExtension.Zip]: () => {
var _a;
const unzip = unzipper_1.default.Extract({ path: targetPath });
unzip.on("error", reject);
unzip.on("close", () => resolve());
(_a = res.body) === null || _a === void 0 ? void 0 : _a.pipe(unzip);
debug("unpacking using zip strategy");
res
.buffer()
.then((buffer) => {
const zip = new adm_zip_1.default(buffer);
zip.extractAllTo(targetPath, true);
resolve();
})
.catch(reject);
},

@@ -110,3 +142,5 @@ };

(() => __awaiter(void 0, void 0, void 0, function* () {
rootDebug("postinstall started");
if (process.env.SKIP_POSTINSTALL) {
rootDebug("SKIP_POSTINSTALL was defined; skipping postinstall");
process.exit(0);

@@ -118,2 +152,3 @@ }

yield pipeBinaryToInstallLocation(req, binaryUrl);
rootDebug("postinstall complete");
}

@@ -120,0 +155,0 @@ catch (err) {

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc