From fa6e82ea75f6f16dea40c02fa877b9ec27b4b8e7 Mon Sep 17 00:00:00 2001 From: Volodymyr Zotov Date: Mon, 4 Aug 2025 15:30:01 -0500 Subject: [PATCH 1/9] Use op-cli-installer package --- dist/index.js | 608 ++++++++++++++++++++++++++++++++++------------ package-lock.json | 11 + package.json | 1 + src/index.ts | 9 +- 4 files changed, 467 insertions(+), 162 deletions(-) diff --git a/dist/index.js b/dist/index.js index c923e85..36b04c2 100644 --- a/dist/index.js +++ b/dist/index.js @@ -32584,230 +32584,397 @@ function parseParams (str) { module.exports = parseParams -/***/ }) - -/******/ }); -/************************************************************************/ -/******/ // The module cache -/******/ var __webpack_module_cache__ = {}; -/******/ -/******/ // The require function -/******/ function __nccwpck_require__(moduleId) { -/******/ // Check if module is in cache -/******/ var cachedModule = __webpack_module_cache__[moduleId]; -/******/ if (cachedModule !== undefined) { -/******/ return cachedModule.exports; -/******/ } -/******/ // Create a new module (and put it into the cache) -/******/ var module = __webpack_module_cache__[moduleId] = { -/******/ // no module.id needed -/******/ // no module.loaded needed -/******/ exports: {} -/******/ }; -/******/ -/******/ // Execute the module function -/******/ var threw = true; -/******/ try { -/******/ __webpack_modules__[moduleId].call(module.exports, module, module.exports, __nccwpck_require__); -/******/ threw = false; -/******/ } finally { -/******/ if(threw) delete __webpack_module_cache__[moduleId]; -/******/ } -/******/ -/******/ // Return the exports of the module -/******/ return module.exports; -/******/ } -/******/ -/************************************************************************/ -/******/ /* webpack/runtime/compat get default export */ -/******/ (() => { -/******/ // getDefaultExport function for compatibility with non-harmony modules -/******/ __nccwpck_require__.n = (module) => { -/******/ var getter = module && module.__esModule ? -/******/ () => (module['default']) : -/******/ () => (module); -/******/ __nccwpck_require__.d(getter, { a: getter }); -/******/ return getter; -/******/ }; -/******/ })(); -/******/ -/******/ /* webpack/runtime/define property getters */ -/******/ (() => { -/******/ // define getter functions for harmony exports -/******/ __nccwpck_require__.d = (exports, definition) => { -/******/ for(var key in definition) { -/******/ if(__nccwpck_require__.o(definition, key) && !__nccwpck_require__.o(exports, key)) { -/******/ Object.defineProperty(exports, key, { enumerable: true, get: definition[key] }); -/******/ } -/******/ } -/******/ }; -/******/ })(); -/******/ -/******/ /* webpack/runtime/hasOwnProperty shorthand */ -/******/ (() => { -/******/ __nccwpck_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop)) -/******/ })(); -/******/ -/******/ /* webpack/runtime/compat */ -/******/ -/******/ if (typeof __nccwpck_require__ !== 'undefined') __nccwpck_require__.ab = new URL('.', import.meta.url).pathname.slice(import.meta.url.match(/^file:\/\/\/\w:/) ? 1 : 0, -1) + "/"; -/******/ -/************************************************************************/ -var __webpack_exports__ = {}; - -// EXTERNAL MODULE: ./node_modules/@actions/core/lib/core.js -var core = __nccwpck_require__(7484); -// EXTERNAL MODULE: external "os" -var external_os_ = __nccwpck_require__(857); -var external_os_default = /*#__PURE__*/__nccwpck_require__.n(external_os_); -// EXTERNAL MODULE: ./node_modules/@actions/tool-cache/lib/tool-cache.js -var tool_cache = __nccwpck_require__(3472); -;// CONCATENATED MODULE: ./src/cli-installer/cli-installer.ts +/***/ }), +/***/ 8733: +/***/ (function(__unused_webpack_module, exports, __nccwpck_require__) { +var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + var desc = Object.getOwnPropertyDescriptor(m, k); + if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { + desc = { enumerable: true, get: function() { return m[k]; } }; + } + Object.defineProperty(o, k2, desc); +}) : (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + o[k2] = m[k]; +})); +var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) { + Object.defineProperty(o, "default", { enumerable: true, value: v }); +}) : function(o, v) { + o["default"] = v; +}); +var __importStar = (this && this.__importStar) || (function () { + var ownKeys = function(o) { + ownKeys = Object.getOwnPropertyNames || function (o) { + var ar = []; + for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k; + return ar; + }; + return ownKeys(o); + }; + return function (mod) { + if (mod && mod.__esModule) return mod; + var result = {}; + if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]); + __setModuleDefault(result, mod); + return result; + }; +})(); +var __importDefault = (this && this.__importDefault) || function (mod) { + return (mod && mod.__esModule) ? mod : { "default": mod }; +}; +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.CliInstaller = exports.cliUrlBuilder = exports.archMap = void 0; +const os_1 = __importDefault(__nccwpck_require__(857)); +const core = __importStar(__nccwpck_require__(7484)); +const tc = __importStar(__nccwpck_require__(3472)); // maps OS architecture names to 1Password CLI installer architecture names -const archMap = { +exports.archMap = { ia32: "386", x64: "amd64", arm: "arm", arm64: "arm64", }; // Builds the download URL for the 1Password CLI based on the platform and version. -const cliUrlBuilder = { +exports.cliUrlBuilder = { linux: (version, arch) => `https://cache.agilebits.com/dist/1P/op2/pkg/${version}/op_linux_${arch}_${version}.zip`, darwin: (version) => `https://cache.agilebits.com/dist/1P/op2/pkg/${version}/op_apple_universal_${version}.pkg`, win32: (version, arch) => `https://cache.agilebits.com/dist/1P/op2/pkg/${version}/op_windows_${arch}_${version}.zip`, }; class CliInstaller { - version; - arch; constructor(version) { this.version = version; this.arch = this.getArch(); } async install(url) { console.info(`Downloading 1Password CLI from: ${url}`); - const downloadPath = await tool_cache.downloadTool(url); + const downloadPath = await tc.downloadTool(url); console.info("Installing 1Password CLI"); - const extractedPath = await tool_cache.extractZip(downloadPath); + const extractedPath = await tc.extractZip(downloadPath); core.addPath(extractedPath); core.info("1Password CLI installed"); } getArch() { - const arch = archMap[external_os_default().arch()]; + const arch = exports.archMap[os_1.default.arch()]; if (!arch) { throw new Error("Unsupported architecture"); } return arch; } } +exports.CliInstaller = CliInstaller; + + +/***/ }), + +/***/ 2846: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + + +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.newCliInstaller = void 0; +var installer_1 = __nccwpck_require__(3074); +Object.defineProperty(exports, "newCliInstaller", ({ enumerable: true, get: function () { return installer_1.newCliInstaller; } })); + + +/***/ }), + +/***/ 3074: +/***/ (function(__unused_webpack_module, exports, __nccwpck_require__) { + + +var __importDefault = (this && this.__importDefault) || function (mod) { + return (mod && mod.__esModule) ? mod : { "default": mod }; +}; +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.newCliInstaller = void 0; +const os_1 = __importDefault(__nccwpck_require__(857)); +const linux_1 = __nccwpck_require__(2500); +const macos_1 = __nccwpck_require__(5315); +const windows_1 = __nccwpck_require__(2403); +const newCliInstaller = (version) => { + const platform = os_1.default.platform(); + switch (platform) { + case "linux": + return new linux_1.LinuxInstaller(version); + case "darwin": + return new macos_1.MacOsInstaller(version); + case "win32": + return new windows_1.WindowsInstaller(version); + default: + throw new Error(`Unsupported platform: ${platform}`); + } +}; +exports.newCliInstaller = newCliInstaller; + + +/***/ }), + +/***/ 2500: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { -;// CONCATENATED MODULE: ./src/cli-installer/linux.ts -class LinuxInstaller extends CliInstaller { - platform = "linux"; // Node.js platform identifier for Linux +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.LinuxInstaller = void 0; +const cli_installer_1 = __nccwpck_require__(8733); +class LinuxInstaller extends cli_installer_1.CliInstaller { constructor(version) { super(version); + this.platform = "linux"; // Node.js platform identifier for Linux } async installCli() { - const urlBuilder = cliUrlBuilder[this.platform]; + const urlBuilder = cli_installer_1.cliUrlBuilder[this.platform]; await super.install(urlBuilder(this.version, this.arch)); } } - -// EXTERNAL MODULE: external "child_process" -var external_child_process_ = __nccwpck_require__(5317); -// EXTERNAL MODULE: external "fs" -var external_fs_ = __nccwpck_require__(9896); -// EXTERNAL MODULE: external "path" -var external_path_ = __nccwpck_require__(6928); -// EXTERNAL MODULE: external "util" -var external_util_ = __nccwpck_require__(9023); -;// CONCATENATED MODULE: ./src/cli-installer/macos.ts - - - +exports.LinuxInstaller = LinuxInstaller; +/***/ }), +/***/ 5315: +/***/ (function(__unused_webpack_module, exports, __nccwpck_require__) { -const execAsync = (0,external_util_.promisify)(external_child_process_.exec); -class MacOsInstaller extends CliInstaller { - platform = "darwin"; // Node.js platform identifier for macOS +var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + var desc = Object.getOwnPropertyDescriptor(m, k); + if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { + desc = { enumerable: true, get: function() { return m[k]; } }; + } + Object.defineProperty(o, k2, desc); +}) : (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + o[k2] = m[k]; +})); +var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) { + Object.defineProperty(o, "default", { enumerable: true, value: v }); +}) : function(o, v) { + o["default"] = v; +}); +var __importStar = (this && this.__importStar) || (function () { + var ownKeys = function(o) { + ownKeys = Object.getOwnPropertyNames || function (o) { + var ar = []; + for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k; + return ar; + }; + return ownKeys(o); + }; + return function (mod) { + if (mod && mod.__esModule) return mod; + var result = {}; + if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]); + __setModuleDefault(result, mod); + return result; + }; +})(); +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.MacOsInstaller = void 0; +const child_process_1 = __nccwpck_require__(5317); +const fs = __importStar(__nccwpck_require__(9896)); +const path = __importStar(__nccwpck_require__(6928)); +const util_1 = __nccwpck_require__(9023); +const core = __importStar(__nccwpck_require__(7484)); +const tc = __importStar(__nccwpck_require__(3472)); +const cli_installer_1 = __nccwpck_require__(8733); +const execAsync = (0, util_1.promisify)(child_process_1.exec); +class MacOsInstaller extends cli_installer_1.CliInstaller { constructor(version) { super(version); + this.platform = "darwin"; // Node.js platform identifier for macOS } async installCli() { - const urlBuilder = cliUrlBuilder[this.platform]; + const urlBuilder = cli_installer_1.cliUrlBuilder[this.platform]; await this.install(urlBuilder(this.version)); } // @actions/tool-cache package does not support .pkg files, so we need to handle the installation manually async install(downloadUrl) { console.info(`Downloading 1Password CLI from: ${downloadUrl}`); - const pkgPath = await tool_cache.downloadTool(downloadUrl); + const pkgPath = await tc.downloadTool(downloadUrl); const pkgWithExtension = `${pkgPath}.pkg`; - external_fs_.renameSync(pkgPath, pkgWithExtension); + fs.renameSync(pkgPath, pkgWithExtension); const expandDir = "temp-pkg"; await execAsync(`pkgutil --expand "${pkgWithExtension}" "${expandDir}"`); - const payloadPath = external_path_.join(expandDir, "op.pkg", "Payload"); + const payloadPath = path.join(expandDir, "op.pkg", "Payload"); console.info("Installing 1Password CLI"); - const cliPath = await tool_cache.extractTar(payloadPath); + const cliPath = await tc.extractTar(payloadPath); core.addPath(cliPath); - external_fs_.rmSync(expandDir, { recursive: true, force: true }); - external_fs_.rmSync(pkgPath, { force: true }); + fs.rmSync(expandDir, { recursive: true, force: true }); + fs.rmSync(pkgPath, { force: true }); core.info("1Password CLI installed"); } } +exports.MacOsInstaller = MacOsInstaller; -;// CONCATENATED MODULE: ./src/cli-installer/windows.ts -class WindowsInstaller extends CliInstaller { - platform = "win32"; // Node.js platform identifier for Windows +/***/ }), + +/***/ 2403: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + + +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.WindowsInstaller = void 0; +const cli_installer_1 = __nccwpck_require__(8733); +class WindowsInstaller extends cli_installer_1.CliInstaller { constructor(version) { super(version); + this.platform = "win32"; // Node.js platform identifier for Windows } async installCli() { - const urlBuilder = cliUrlBuilder[this.platform]; + const urlBuilder = cli_installer_1.cliUrlBuilder[this.platform]; await super.install(urlBuilder(this.version, this.arch)); } } +exports.WindowsInstaller = WindowsInstaller; -;// CONCATENATED MODULE: ./src/cli-installer/installer.ts +/***/ }), +/***/ 9046: +/***/ (function(__unused_webpack_module, exports, __nccwpck_require__) { -const newCliInstaller = (version) => { - const platform = external_os_default().platform(); - switch (platform) { - case "linux": - return new LinuxInstaller(version); - case "darwin": - return new MacOsInstaller(version); - case "win32": - return new WindowsInstaller(version); - default: - throw new Error(`Unsupported platform: ${platform}`); +var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + var desc = Object.getOwnPropertyDescriptor(m, k); + if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { + desc = { enumerable: true, get: function() { return m[k]; } }; + } + Object.defineProperty(o, k2, desc); +}) : (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + o[k2] = m[k]; +})); +var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) { + Object.defineProperty(o, "default", { enumerable: true, value: v }); +}) : function(o, v) { + o["default"] = v; +}); +var __importStar = (this && this.__importStar) || (function () { + var ownKeys = function(o) { + ownKeys = Object.getOwnPropertyNames || function (o) { + var ar = []; + for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k; + return ar; + }; + return ownKeys(o); + }; + return function (mod) { + if (mod && mod.__esModule) return mod; + var result = {}; + if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]); + __setModuleDefault(result, mod); + return result; + }; +})(); +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.installCliOnGithubActionRunner = void 0; +const core = __importStar(__nccwpck_require__(7484)); +const version_1 = __nccwpck_require__(8950); +const cli_installer_1 = __nccwpck_require__(2846); +// Installs the 1Password CLI on a GitHub Action runner. +const installCliOnGithubActionRunner = async (version) => { + try { + const versionResolver = new version_1.VersionResolver(version ?? core.getInput("version")); + await versionResolver.resolve(); + const installer = (0, cli_installer_1.newCliInstaller)(versionResolver.get()); + await installer.installCli(); + } + catch (error) { + if (error instanceof Error) { + console.error("error:", error); + core.setFailed(error.message); + } + else { + console.error("Unknown error:", error); + core.setFailed("Unknown error occurred"); + } } }; +exports.installCliOnGithubActionRunner = installCliOnGithubActionRunner; + -;// CONCATENATED MODULE: ./src/cli-installer/index.ts +/***/ }), + +/***/ 1621: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { +var __webpack_unused_export__; -;// CONCATENATED MODULE: ./src/version/constants.ts +__webpack_unused_export__ = ({ value: true }); +__webpack_unused_export__ = __webpack_unused_export__ = exports.Cq = void 0; +var github_action_1 = __nccwpck_require__(9046); +Object.defineProperty(exports, "Cq", ({ enumerable: true, get: function () { return github_action_1.installCliOnGithubActionRunner; } })); +var version_1 = __nccwpck_require__(8950); +__webpack_unused_export__ = ({ enumerable: true, get: function () { return version_1.ReleaseChannel; } }); +__webpack_unused_export__ = ({ enumerable: true, get: function () { return version_1.VersionResolver; } }); + + +/***/ }), + +/***/ 4823: +/***/ ((__unused_webpack_module, exports) => { + + +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.ReleaseChannel = void 0; /* eslint-disable @typescript-eslint/naming-convention */ var ReleaseChannel; (function (ReleaseChannel) { ReleaseChannel["Stable"] = "latest"; ReleaseChannel["Beta"] = "latest-beta"; -})(ReleaseChannel || (ReleaseChannel = {})); +})(ReleaseChannel || (exports.ReleaseChannel = ReleaseChannel = {})); /* eslint-enable @typescript-eslint/naming-convention */ -;// CONCATENATED MODULE: ./src/version/helper.ts + +/***/ }), + +/***/ 1592: +/***/ (function(__unused_webpack_module, exports, __nccwpck_require__) { +var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + var desc = Object.getOwnPropertyDescriptor(m, k); + if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { + desc = { enumerable: true, get: function() { return m[k]; } }; + } + Object.defineProperty(o, k2, desc); +}) : (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + o[k2] = m[k]; +})); +var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) { + Object.defineProperty(o, "default", { enumerable: true, value: v }); +}) : function(o, v) { + o["default"] = v; +}); +var __importStar = (this && this.__importStar) || (function () { + var ownKeys = function(o) { + ownKeys = Object.getOwnPropertyNames || function (o) { + var ar = []; + for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k; + return ar; + }; + return ownKeys(o); + }; + return function (mod) { + if (mod && mod.__esModule) return mod; + var result = {}; + if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]); + __setModuleDefault(result, mod); + return result; + }; +})(); +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.getLatestVersion = void 0; +const core = __importStar(__nccwpck_require__(7484)); +const constants_1 = __nccwpck_require__(4823); // Returns the latest version of the 1Password CLI based on the specified channel. const getLatestVersion = async (channel) => { core.info(`Getting ${channel} version number`); @@ -32815,23 +32982,46 @@ const getLatestVersion = async (channel) => { const json = (await res.json()); const latestStable = json?.CLI2?.release?.version; const latestBeta = json?.CLI2?.beta?.version; - const version = channel === ReleaseChannel.Beta ? latestBeta : latestStable; + const version = channel === constants_1.ReleaseChannel.Beta ? latestBeta : latestStable; if (!version) { core.error(`No ${channel} versions found`); throw new Error(`No ${channel} versions found`); } return version; }; +exports.getLatestVersion = getLatestVersion; -// EXTERNAL MODULE: ./node_modules/semver/index.js -var semver = __nccwpck_require__(2088); -var semver_default = /*#__PURE__*/__nccwpck_require__.n(semver); -;// CONCATENATED MODULE: ./src/version/validate.ts + +/***/ }), + +/***/ 8950: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + + +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.ReleaseChannel = exports.VersionResolver = void 0; +var version_resolver_1 = __nccwpck_require__(609); +Object.defineProperty(exports, "VersionResolver", ({ enumerable: true, get: function () { return version_resolver_1.VersionResolver; } })); +var constants_1 = __nccwpck_require__(4823); +Object.defineProperty(exports, "ReleaseChannel", ({ enumerable: true, get: function () { return constants_1.ReleaseChannel; } })); + + +/***/ }), + +/***/ 2946: +/***/ (function(__unused_webpack_module, exports, __nccwpck_require__) { +var __importDefault = (this && this.__importDefault) || function (mod) { + return (mod && mod.__esModule) ? mod : { "default": mod }; +}; +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.validateVersion = void 0; +const semver_1 = __importDefault(__nccwpck_require__(2088)); +const constants_1 = __nccwpck_require__(4823); // Validates if the provided version type is a valid enum value or a valid semver version. const validateVersion = (input) => { - if (Object.values(ReleaseChannel).includes(input)) { + if (Object.values(constants_1.ReleaseChannel).includes(input)) { return; } // 1Password beta releases (aka 2.19.0-beta.01) are not semver compliant. @@ -32840,20 +33030,61 @@ const validateVersion = (input) => { // Accepts valid semver versions like "2.18.0" or beta-releases like "2.19.0-beta.01" // or versions with 'v' prefix like "v2.19.0" const normalized = input.replace(/-beta\.0*(\d+)/, "-beta.$1"); - const normInput = new (semver_default()).SemVer(normalized); - if (semver_default().valid(normInput)) { + const normInput = new semver_1.default.SemVer(normalized); + if (semver_1.default.valid(normInput)) { return; } throw new Error(`Invalid version input: ${input}`); }; +exports.validateVersion = validateVersion; -;// CONCATENATED MODULE: ./src/version/version-resolver.ts +/***/ }), +/***/ 609: +/***/ (function(__unused_webpack_module, exports, __nccwpck_require__) { +var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + var desc = Object.getOwnPropertyDescriptor(m, k); + if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { + desc = { enumerable: true, get: function() { return m[k]; } }; + } + Object.defineProperty(o, k2, desc); +}) : (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + o[k2] = m[k]; +})); +var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) { + Object.defineProperty(o, "default", { enumerable: true, value: v }); +}) : function(o, v) { + o["default"] = v; +}); +var __importStar = (this && this.__importStar) || (function () { + var ownKeys = function(o) { + ownKeys = Object.getOwnPropertyNames || function (o) { + var ar = []; + for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k; + return ar; + }; + return ownKeys(o); + }; + return function (mod) { + if (mod && mod.__esModule) return mod; + var result = {}; + if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]); + __setModuleDefault(result, mod); + return result; + }; +})(); +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.VersionResolver = void 0; +const core = __importStar(__nccwpck_require__(7484)); +const constants_1 = __nccwpck_require__(4823); +const helper_1 = __nccwpck_require__(1592); +const validate_1 = __nccwpck_require__(2946); class VersionResolver { - version; constructor(version) { this.validate(version); this.version = version; @@ -32868,7 +33099,7 @@ class VersionResolver { throw new Error("Version is not provided"); } if (this.isReleaseChannel(this.version)) { - this.version = await getLatestVersion(this.version); + this.version = await (0, helper_1.getLatestVersion)(this.version); } // add `v` prefix if not already present this.version = this.version.startsWith("v") @@ -32877,19 +33108,89 @@ class VersionResolver { } validate(version) { core.info(`Validating version number: '${version}'`); - validateVersion(version); + (0, validate_1.validateVersion)(version); core.info(`Version number '${version}' is valid`); } isReleaseChannel(value) { - return Object.values(ReleaseChannel).includes(value); + return Object.values(constants_1.ReleaseChannel).includes(value); } } - -;// CONCATENATED MODULE: ./src/version/index.ts +exports.VersionResolver = VersionResolver; -;// CONCATENATED MODULE: ./src/index.ts +/***/ }) +/******/ }); +/************************************************************************/ +/******/ // The module cache +/******/ var __webpack_module_cache__ = {}; +/******/ +/******/ // The require function +/******/ function __nccwpck_require__(moduleId) { +/******/ // Check if module is in cache +/******/ var cachedModule = __webpack_module_cache__[moduleId]; +/******/ if (cachedModule !== undefined) { +/******/ return cachedModule.exports; +/******/ } +/******/ // Create a new module (and put it into the cache) +/******/ var module = __webpack_module_cache__[moduleId] = { +/******/ // no module.id needed +/******/ // no module.loaded needed +/******/ exports: {} +/******/ }; +/******/ +/******/ // Execute the module function +/******/ var threw = true; +/******/ try { +/******/ __webpack_modules__[moduleId].call(module.exports, module, module.exports, __nccwpck_require__); +/******/ threw = false; +/******/ } finally { +/******/ if(threw) delete __webpack_module_cache__[moduleId]; +/******/ } +/******/ +/******/ // Return the exports of the module +/******/ return module.exports; +/******/ } +/******/ +/************************************************************************/ +/******/ /* webpack/runtime/compat get default export */ +/******/ (() => { +/******/ // getDefaultExport function for compatibility with non-harmony modules +/******/ __nccwpck_require__.n = (module) => { +/******/ var getter = module && module.__esModule ? +/******/ () => (module['default']) : +/******/ () => (module); +/******/ __nccwpck_require__.d(getter, { a: getter }); +/******/ return getter; +/******/ }; +/******/ })(); +/******/ +/******/ /* webpack/runtime/define property getters */ +/******/ (() => { +/******/ // define getter functions for harmony exports +/******/ __nccwpck_require__.d = (exports, definition) => { +/******/ for(var key in definition) { +/******/ if(__nccwpck_require__.o(definition, key) && !__nccwpck_require__.o(exports, key)) { +/******/ Object.defineProperty(exports, key, { enumerable: true, get: definition[key] }); +/******/ } +/******/ } +/******/ }; +/******/ })(); +/******/ +/******/ /* webpack/runtime/hasOwnProperty shorthand */ +/******/ (() => { +/******/ __nccwpck_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop)) +/******/ })(); +/******/ +/******/ /* webpack/runtime/compat */ +/******/ +/******/ if (typeof __nccwpck_require__ !== 'undefined') __nccwpck_require__.ab = new URL('.', import.meta.url).pathname.slice(import.meta.url.match(/^file:\/\/\/\w:/) ? 1 : 0, -1) + "/"; +/******/ +/************************************************************************/ +var __webpack_exports__ = {}; +/* harmony import */ var _actions_core__WEBPACK_IMPORTED_MODULE_0__ = __nccwpck_require__(7484); +/* harmony import */ var _actions_core__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__nccwpck_require__.n(_actions_core__WEBPACK_IMPORTED_MODULE_0__); +/* harmony import */ var op_cli_installer__WEBPACK_IMPORTED_MODULE_1__ = __nccwpck_require__(1621); /** @@ -32897,19 +33198,16 @@ class VersionResolver { */ const run = async () => { try { - const versionResolver = new VersionResolver(core.getInput("version")); - await versionResolver.resolve(); - const installer = newCliInstaller(versionResolver.get()); - await installer.installCli(); + await (0,op_cli_installer__WEBPACK_IMPORTED_MODULE_1__/* .installCliOnGithubActionRunner */ .Cq)(); } catch (error) { if (error instanceof Error) { console.error("error:", error); - core.setFailed(error.message); + _actions_core__WEBPACK_IMPORTED_MODULE_0__.setFailed(error.message); } else { console.error("Unknown error:", error); - core.setFailed("Unknown error occurred"); + _actions_core__WEBPACK_IMPORTED_MODULE_0__.setFailed("Unknown error occurred"); } } }; diff --git a/package-lock.json b/package-lock.json index 02ba6aa..2fabb28 100644 --- a/package-lock.json +++ b/package-lock.json @@ -12,6 +12,7 @@ "@actions/core": "^1.11.1", "@actions/tool-cache": "^2.0.2", "eslint": "^9.31.0", + "op-cli-installer": "github:1Password/op-cli-installer#vzt/v1", "semver": "^7.7.2" }, "devDependencies": { @@ -6349,6 +6350,16 @@ "url": "https://github.com/sponsors/sindresorhus" } }, + "node_modules/op-cli-installer": { + "version": "1.0.0", + "resolved": "git+ssh://git@github.com/1Password/op-cli-installer.git#8e592dfdcb62344b3c369d33c318ead400929e7c", + "license": "MIT", + "dependencies": { + "@actions/core": "^1.11.1", + "@actions/tool-cache": "^2.0.2", + "semver": "^7.7.2" + } + }, "node_modules/optionator": { "version": "0.9.4", "resolved": "https://registry.npmjs.org/optionator/-/optionator-0.9.4.tgz", diff --git a/package.json b/package.json index 5840015..8da9de8 100644 --- a/package.json +++ b/package.json @@ -39,6 +39,7 @@ "@actions/core": "^1.11.1", "@actions/tool-cache": "^2.0.2", "eslint": "^9.31.0", + "op-cli-installer": "github:1Password/op-cli-installer#vzt/v1", "semver": "^7.7.2" }, "devDependencies": { diff --git a/src/index.ts b/src/index.ts index ef3ec1b..ce0beb0 100644 --- a/src/index.ts +++ b/src/index.ts @@ -1,17 +1,12 @@ import * as core from "@actions/core"; - -import { newCliInstaller } from "./cli-installer"; -import { VersionResolver } from "./version"; +import { installCliOnGithubActionRunner } from "op-cli-installer"; /** * Entry point for the GitHub Action. */ const run = async (): Promise => { try { - const versionResolver = new VersionResolver(core.getInput("version")); - await versionResolver.resolve(); - const installer = newCliInstaller(versionResolver.get()); - await installer.installCli(); + await installCliOnGithubActionRunner(); } catch (error: unknown) { if (error instanceof Error) { console.error("error:", error); From ae341c92c6e177f2c23438bd51c248960f533a8a Mon Sep 17 00:00:00 2001 From: Volodymyr Zotov Date: Mon, 4 Aug 2025 15:41:55 -0500 Subject: [PATCH 2/9] Use latest op-cli-installer --- package-lock.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package-lock.json b/package-lock.json index 2fabb28..e191170 100644 --- a/package-lock.json +++ b/package-lock.json @@ -6352,7 +6352,7 @@ }, "node_modules/op-cli-installer": { "version": "1.0.0", - "resolved": "git+ssh://git@github.com/1Password/op-cli-installer.git#8e592dfdcb62344b3c369d33c318ead400929e7c", + "resolved": "git+ssh://git@github.com/1Password/op-cli-installer.git#8ea4bf402c6385a90f6d2d98efe31ac845633412", "license": "MIT", "dependencies": { "@actions/core": "^1.11.1", From 3a9ae1e1539b6f3d56f945a4326e12e4601b3f70 Mon Sep 17 00:00:00 2001 From: Volodymyr Zotov Date: Mon, 4 Aug 2025 22:34:48 -0500 Subject: [PATCH 3/9] Use op-cli-installer version from the specific commit --- dist/index.js | 20 ++++---------------- package-lock.json | 3 ++- package.json | 2 +- 3 files changed, 7 insertions(+), 18 deletions(-) diff --git a/dist/index.js b/dist/index.js index 36b04c2..549a400 100644 --- a/dist/index.js +++ b/dist/index.js @@ -32879,22 +32879,10 @@ const version_1 = __nccwpck_require__(8950); const cli_installer_1 = __nccwpck_require__(2846); // Installs the 1Password CLI on a GitHub Action runner. const installCliOnGithubActionRunner = async (version) => { - try { - const versionResolver = new version_1.VersionResolver(version ?? core.getInput("version")); - await versionResolver.resolve(); - const installer = (0, cli_installer_1.newCliInstaller)(versionResolver.get()); - await installer.installCli(); - } - catch (error) { - if (error instanceof Error) { - console.error("error:", error); - core.setFailed(error.message); - } - else { - console.error("Unknown error:", error); - core.setFailed("Unknown error occurred"); - } - } + const versionResolver = new version_1.VersionResolver(version ?? core.getInput("version")); + await versionResolver.resolve(); + const installer = (0, cli_installer_1.newCliInstaller)(versionResolver.get()); + await installer.installCli(); }; exports.installCliOnGithubActionRunner = installCliOnGithubActionRunner; diff --git a/package-lock.json b/package-lock.json index e191170..29139fc 100644 --- a/package-lock.json +++ b/package-lock.json @@ -12,7 +12,7 @@ "@actions/core": "^1.11.1", "@actions/tool-cache": "^2.0.2", "eslint": "^9.31.0", - "op-cli-installer": "github:1Password/op-cli-installer#vzt/v1", + "op-cli-installer": "github:1Password/op-cli-installer#8ea4bf402c6385a90f6d2d98efe31ac845633412", "semver": "^7.7.2" }, "devDependencies": { @@ -6353,6 +6353,7 @@ "node_modules/op-cli-installer": { "version": "1.0.0", "resolved": "git+ssh://git@github.com/1Password/op-cli-installer.git#8ea4bf402c6385a90f6d2d98efe31ac845633412", + "integrity": "sha512-HBk4wp0rOwiz4xkLTxkcYGkTZuOE+ScgIh2aSaUI35Xd692V8QbPRt2L75ZB2XzfHs2eW6j/80qDJhT9A5J92w==", "license": "MIT", "dependencies": { "@actions/core": "^1.11.1", diff --git a/package.json b/package.json index 8da9de8..172c409 100644 --- a/package.json +++ b/package.json @@ -39,7 +39,7 @@ "@actions/core": "^1.11.1", "@actions/tool-cache": "^2.0.2", "eslint": "^9.31.0", - "op-cli-installer": "github:1Password/op-cli-installer#vzt/v1", + "op-cli-installer": "github:1Password/op-cli-installer#8ea4bf402c6385a90f6d2d98efe31ac845633412", "semver": "^7.7.2" }, "devDependencies": { From 9a943f7f930037c387a5d5ef0ea06f2821263c32 Mon Sep 17 00:00:00 2001 From: Volodymyr Zotov Date: Mon, 4 Aug 2025 22:37:13 -0500 Subject: [PATCH 4/9] Remove `cli-installer` and `version` modules from src as use it from `op-cli-installer` now --- package-lock.json | 129 ++++++++++++++++++++++----- package.json | 6 +- src/cli-installer/cli-installer.ts | 58 ------------ src/cli-installer/index.ts | 1 - src/cli-installer/installer.test.ts | 43 --------- src/cli-installer/installer.ts | 23 ----- src/cli-installer/linux.test.ts | 38 -------- src/cli-installer/linux.ts | 19 ---- src/cli-installer/macos.test.ts | 35 -------- src/cli-installer/macos.ts | 49 ---------- src/cli-installer/windows.test.ts | 38 -------- src/cli-installer/windows.ts | 19 ---- src/version/constants.ts | 13 --- src/version/helper.test.ts | 91 ------------------- src/version/helper.ts | 22 ----- src/version/index.ts | 1 - src/version/validate.test.ts | 45 ---------- src/version/validate.ts | 23 ----- src/version/version-resolver.test.ts | 58 ------------ src/version/version-resolver.ts | 45 ---------- 20 files changed, 109 insertions(+), 647 deletions(-) delete mode 100644 src/cli-installer/cli-installer.ts delete mode 100644 src/cli-installer/index.ts delete mode 100644 src/cli-installer/installer.test.ts delete mode 100644 src/cli-installer/installer.ts delete mode 100644 src/cli-installer/linux.test.ts delete mode 100644 src/cli-installer/linux.ts delete mode 100644 src/cli-installer/macos.test.ts delete mode 100644 src/cli-installer/macos.ts delete mode 100644 src/cli-installer/windows.test.ts delete mode 100644 src/cli-installer/windows.ts delete mode 100644 src/version/constants.ts delete mode 100644 src/version/helper.test.ts delete mode 100644 src/version/helper.ts delete mode 100644 src/version/index.ts delete mode 100644 src/version/validate.test.ts delete mode 100644 src/version/validate.ts delete mode 100644 src/version/version-resolver.test.ts delete mode 100644 src/version/version-resolver.ts diff --git a/package-lock.json b/package-lock.json index 29139fc..6ae6952 100644 --- a/package-lock.json +++ b/package-lock.json @@ -10,10 +10,7 @@ "license": "MIT", "dependencies": { "@actions/core": "^1.11.1", - "@actions/tool-cache": "^2.0.2", - "eslint": "^9.31.0", - "op-cli-installer": "github:1Password/op-cli-installer#8ea4bf402c6385a90f6d2d98efe31ac845633412", - "semver": "^7.7.2" + "op-cli-installer": "github:1Password/op-cli-installer#8ea4bf402c6385a90f6d2d98efe31ac845633412" }, "devDependencies": { "@1password/eslint-config": "^8.1.0", @@ -22,6 +19,7 @@ "@types/node": "^24.0.14", "@types/semver": "^7.7.0", "@vercel/ncc": "^0.38.3", + "eslint": "^9.31.0", "husky": "^9.1.7", "jest": "^30.0.4", "lint-staged": "^16.1.2", @@ -652,6 +650,7 @@ "version": "4.7.0", "resolved": "https://registry.npmjs.org/@eslint-community/eslint-utils/-/eslint-utils-4.7.0.tgz", "integrity": "sha512-dyybb3AcajC7uha6CvhdVRJqaKyn7w2YKqKyAN37NKYgZT36w+iRb0Dymmc5qEJ549c/S31cMMSFd75bteCpCw==", + "dev": true, "dependencies": { "eslint-visitor-keys": "^3.4.3" }, @@ -669,6 +668,7 @@ "version": "4.12.1", "resolved": "https://registry.npmjs.org/@eslint-community/regexpp/-/regexpp-4.12.1.tgz", "integrity": "sha512-CCZCDJuduB9OUkFkY2IgppNZMi2lBQgD2qzwXkEia16cge2pijY/aXi96CJMquDMn3nJdlPV1A5KrJEXwfLNzQ==", + "dev": true, "engines": { "node": "^12.0.0 || ^14.0.0 || >=16.0.0" } @@ -677,6 +677,7 @@ "version": "0.21.0", "resolved": "https://registry.npmjs.org/@eslint/config-array/-/config-array-0.21.0.tgz", "integrity": "sha512-ENIdc4iLu0d93HeYirvKmrzshzofPw6VkZRKQGe9Nv46ZnWUzcF1xV01dcvEg/1wXUR61OmmlSfyeyO7EvjLxQ==", + "dev": true, "dependencies": { "@eslint/object-schema": "^2.1.6", "debug": "^4.3.1", @@ -690,6 +691,7 @@ "version": "0.3.0", "resolved": "https://registry.npmjs.org/@eslint/config-helpers/-/config-helpers-0.3.0.tgz", "integrity": "sha512-ViuymvFmcJi04qdZeDc2whTHryouGcDlaxPqarTD0ZE10ISpxGUVZGZDx4w01upyIynL3iu6IXH2bS1NhclQMw==", + "dev": true, "engines": { "node": "^18.18.0 || ^20.9.0 || >=21.1.0" } @@ -698,6 +700,7 @@ "version": "0.15.1", "resolved": "https://registry.npmjs.org/@eslint/core/-/core-0.15.1.tgz", "integrity": "sha512-bkOp+iumZCCbt1K1CmWf0R9pM5yKpDv+ZXtvSyQpudrI9kuFLp+bM2WOPXImuD/ceQuaa8f5pj93Y7zyECIGNA==", + "dev": true, "dependencies": { "@types/json-schema": "^7.0.15" }, @@ -709,6 +712,7 @@ "version": "3.3.1", "resolved": "https://registry.npmjs.org/@eslint/eslintrc/-/eslintrc-3.3.1.tgz", "integrity": "sha512-gtF186CXhIl1p4pJNGZw8Yc6RlshoePRvE0X91oPGb3vZ8pM3qOS9W9NGPat9LziaBV7XrJWGylNQXkGcnM3IQ==", + "dev": true, "dependencies": { "ajv": "^6.12.4", "debug": "^4.3.2", @@ -731,6 +735,7 @@ "version": "9.31.0", "resolved": "https://registry.npmjs.org/@eslint/js/-/js-9.31.0.tgz", "integrity": "sha512-LOm5OVt7D4qiKCqoiPbA7LWmI+tbw1VbTUowBcUMgQSuM6poJufkFkYDcQpo5KfgD39TnNySV26QjOh7VFpSyw==", + "dev": true, "engines": { "node": "^18.18.0 || ^20.9.0 || >=21.1.0" }, @@ -742,6 +747,7 @@ "version": "2.1.6", "resolved": "https://registry.npmjs.org/@eslint/object-schema/-/object-schema-2.1.6.tgz", "integrity": "sha512-RBMg5FRL0I0gs51M/guSAj5/e14VQ4tpZnQNWwuDT66P14I43ItmPfIZRhO9fUVIPOAQXU47atlywZ/czoqFPA==", + "dev": true, "engines": { "node": "^18.18.0 || ^20.9.0 || >=21.1.0" } @@ -750,6 +756,7 @@ "version": "0.3.4", "resolved": "https://registry.npmjs.org/@eslint/plugin-kit/-/plugin-kit-0.3.4.tgz", "integrity": "sha512-Ul5l+lHEcw3L5+k8POx6r74mxEYKG5kOb6Xpy2gCRW6zweT6TEhAf8vhxGgjhqrd/VO/Dirhsb+1hNpD1ue9hw==", + "dev": true, "dependencies": { "@eslint/core": "^0.15.1", "levn": "^0.4.1" @@ -770,6 +777,7 @@ "version": "0.19.1", "resolved": "https://registry.npmjs.org/@humanfs/core/-/core-0.19.1.tgz", "integrity": "sha512-5DyQ4+1JEUzejeK1JGICcideyfUbGixgS9jNgex5nqkW+cY7WZhxBigmieN5Qnw9ZosSNVC9KQKyb+GUaGyKUA==", + "dev": true, "engines": { "node": ">=18.18.0" } @@ -778,6 +786,7 @@ "version": "0.16.6", "resolved": "https://registry.npmjs.org/@humanfs/node/-/node-0.16.6.tgz", "integrity": "sha512-YuI2ZHQL78Q5HbhDiBA1X4LmYdXCKCMQIfw0pw7piHJwyREFebJUvrQN4cMssyES6x+vfUbx1CIpaQUKYdQZOw==", + "dev": true, "dependencies": { "@humanfs/core": "^0.19.1", "@humanwhocodes/retry": "^0.3.0" @@ -790,6 +799,7 @@ "version": "0.3.1", "resolved": "https://registry.npmjs.org/@humanwhocodes/retry/-/retry-0.3.1.tgz", "integrity": "sha512-JBxkERygn7Bv/GbN5Rv8Ul6LVknS+5Bp6RgDC/O8gEBU/yeH5Ui5C/OlWrTb6qct7LjjfT6Re2NxB0ln0yYybA==", + "dev": true, "engines": { "node": ">=18.18" }, @@ -802,6 +812,7 @@ "version": "1.0.1", "resolved": "https://registry.npmjs.org/@humanwhocodes/module-importer/-/module-importer-1.0.1.tgz", "integrity": "sha512-bxveV4V8v5Yb4ncFTT3rPSgZBOpCkjfK0y4oVVVJwIuDVBRMDXrPyXRL988i5ap9m9bnyEEjWfm5WkBmtffLfA==", + "dev": true, "engines": { "node": ">=12.22" }, @@ -814,6 +825,7 @@ "version": "0.4.3", "resolved": "https://registry.npmjs.org/@humanwhocodes/retry/-/retry-0.4.3.tgz", "integrity": "sha512-bV0Tgo9K4hfPCek+aMAn81RppFKv2ySDQeMoSZuvTASywNTnVJCArCZE2FWqpvIatKu7VMRLWlR1EazvVhDyhQ==", + "dev": true, "engines": { "node": ">=18.18" }, @@ -1459,7 +1471,8 @@ "node_modules/@types/estree": { "version": "1.0.8", "resolved": "https://registry.npmjs.org/@types/estree/-/estree-1.0.8.tgz", - "integrity": "sha512-dWHzHa2WqEXI/O1E9OjrocMTKJl2mSrEolh1Iomrv6U+JuNwaHXsXx9bLu5gG7BUWFIN0skIQJQ/L1rIex4X6w==" + "integrity": "sha512-dWHzHa2WqEXI/O1E9OjrocMTKJl2mSrEolh1Iomrv6U+JuNwaHXsXx9bLu5gG7BUWFIN0skIQJQ/L1rIex4X6w==", + "dev": true }, "node_modules/@types/istanbul-lib-coverage": { "version": "2.0.6", @@ -1498,7 +1511,8 @@ "node_modules/@types/json-schema": { "version": "7.0.15", "resolved": "https://registry.npmjs.org/@types/json-schema/-/json-schema-7.0.15.tgz", - "integrity": "sha512-5+fP8P8MFNC+AyZCDxrB2pkZFPGzqQWUzpSeuuVLvm8VMcorNYavBqoFcxK8bQz4Qsbn4oUEEem4wDLfcysGHA==" + "integrity": "sha512-5+fP8P8MFNC+AyZCDxrB2pkZFPGzqQWUzpSeuuVLvm8VMcorNYavBqoFcxK8bQz4Qsbn4oUEEem4wDLfcysGHA==", + "dev": true }, "node_modules/@types/json5": { "version": "0.0.29", @@ -2068,6 +2082,7 @@ "version": "8.15.0", "resolved": "https://registry.npmjs.org/acorn/-/acorn-8.15.0.tgz", "integrity": "sha512-NZyJarBfL7nWwIq+FDL6Zp/yHEhePMNnnJ0y3qfieCrmNvYct8uvtiV41UvlSe6apAfk0fY1FbWx+NwfmpvtTg==", + "dev": true, "bin": { "acorn": "bin/acorn" }, @@ -2079,6 +2094,7 @@ "version": "5.3.2", "resolved": "https://registry.npmjs.org/acorn-jsx/-/acorn-jsx-5.3.2.tgz", "integrity": "sha512-rq9s+JNhf0IChjtDXxllJ7g41oZk5SlXtp0LHwyA5cejwn7vKmKp4pPri6YEePv2PU65sAsegbXtIinmDFDXgQ==", + "dev": true, "peerDependencies": { "acorn": "^6.0.0 || ^7.0.0 || ^8.0.0" } @@ -2087,6 +2103,7 @@ "version": "6.12.6", "resolved": "https://registry.npmjs.org/ajv/-/ajv-6.12.6.tgz", "integrity": "sha512-j3fVLgvTo527anyYyJOGTYJbG+vnnQYvE0m5mmkc1TK+nxAppkCLMIL0aZ4dblVCNoGShhm+kzE4ZUykBoMg4g==", + "dev": true, "dependencies": { "fast-deep-equal": "^3.1.1", "fast-json-stable-stringify": "^2.0.0", @@ -2129,6 +2146,7 @@ "version": "4.3.0", "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", + "dev": true, "dependencies": { "color-convert": "^2.0.1" }, @@ -2164,7 +2182,8 @@ "node_modules/argparse": { "version": "2.0.1", "resolved": "https://registry.npmjs.org/argparse/-/argparse-2.0.1.tgz", - "integrity": "sha512-8+9WqebbFzpX9OR+Wa6O29asIogeRMzcGtAINdpMHHyAg10f05aSFVBbcEqGf/PXw1EjAZ+q2/bEBg3DvurK3Q==" + "integrity": "sha512-8+9WqebbFzpX9OR+Wa6O29asIogeRMzcGtAINdpMHHyAg10f05aSFVBbcEqGf/PXw1EjAZ+q2/bEBg3DvurK3Q==", + "dev": true }, "node_modules/aria-query": { "version": "5.3.2", @@ -2477,12 +2496,14 @@ "node_modules/balanced-match": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-1.0.2.tgz", - "integrity": "sha512-3oSeUO0TMV67hN1AmbXsK4yaqU7tjiHlbxRDZOpH0KW9+CeX4bRAaX0Anxt0tx2MrpRpWwQaPwIlISEJhYU5Pw==" + "integrity": "sha512-3oSeUO0TMV67hN1AmbXsK4yaqU7tjiHlbxRDZOpH0KW9+CeX4bRAaX0Anxt0tx2MrpRpWwQaPwIlISEJhYU5Pw==", + "dev": true }, "node_modules/brace-expansion": { "version": "1.1.12", "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.12.tgz", "integrity": "sha512-9T9UjW3r0UW5c1Q7GTwllptXwhvYmEzFhzMfZ9H7FQWt+uZePjZPjBP/W1ZEyZ1twGWom5/56TF4lPcqjnDHcg==", + "dev": true, "dependencies": { "balanced-match": "^1.0.0", "concat-map": "0.0.1" @@ -2631,6 +2652,7 @@ "version": "3.1.0", "resolved": "https://registry.npmjs.org/callsites/-/callsites-3.1.0.tgz", "integrity": "sha512-P8BjAsXvZS+VIDUI11hHCQEv74YT67YUi5JJFNWIqL235sBmjX4+qx9Muvls5ivyNENctx46xQLQ3aTuE7ssaQ==", + "dev": true, "engines": { "node": ">=6" } @@ -2668,6 +2690,7 @@ "version": "4.1.2", "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.2.tgz", "integrity": "sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==", + "dev": true, "dependencies": { "ansi-styles": "^4.1.0", "supports-color": "^7.1.0" @@ -2864,6 +2887,7 @@ "version": "2.0.1", "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", + "dev": true, "dependencies": { "color-name": "~1.1.4" }, @@ -2874,7 +2898,8 @@ "node_modules/color-name": { "version": "1.1.4", "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", - "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==" + "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==", + "dev": true }, "node_modules/colorette": { "version": "2.0.20", @@ -2903,7 +2928,8 @@ "node_modules/concat-map": { "version": "0.0.1", "resolved": "https://registry.npmjs.org/concat-map/-/concat-map-0.0.1.tgz", - "integrity": "sha512-/Srv4dswyQNBfohGpz9o6Yb3Gz3SrUDqBH5rTuhGR7ahtlbYKnVxw2bCFMRljaA7EXHaXZ8wsHdodFvbkhKmqg==" + "integrity": "sha512-/Srv4dswyQNBfohGpz9o6Yb3Gz3SrUDqBH5rTuhGR7ahtlbYKnVxw2bCFMRljaA7EXHaXZ8wsHdodFvbkhKmqg==", + "dev": true }, "node_modules/convert-source-map": { "version": "2.0.0", @@ -2915,6 +2941,7 @@ "version": "7.0.6", "resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-7.0.6.tgz", "integrity": "sha512-uV2QOWP2nWzsy2aMp8aRibhi9dlzF5Hgh5SHaB9OiTGEyDTiJJyx0uy51QXdyWbtAHNua4XJzUKca3OzKUd3vA==", + "dev": true, "dependencies": { "path-key": "^3.1.0", "shebang-command": "^2.0.0", @@ -2985,6 +3012,7 @@ "version": "4.4.1", "resolved": "https://registry.npmjs.org/debug/-/debug-4.4.1.tgz", "integrity": "sha512-KcKCqiftBJcZr++7ykoDIEwSa3XWowTfNPo92BYxjXiyYEVrUQh2aLyhxBCwww+heortUFxEJYcRzosstTEBYQ==", + "dev": true, "dependencies": { "ms": "^2.1.3" }, @@ -3014,7 +3042,8 @@ "node_modules/deep-is": { "version": "0.1.4", "resolved": "https://registry.npmjs.org/deep-is/-/deep-is-0.1.4.tgz", - "integrity": "sha512-oIPzksmTg4/MriiaYGO+okXDT7ztn/w3Eptv/+gSIdMdKsJo0u4CfYNFJPy+4SKMuCqGw2wxnA+URMg3t8a/bQ==" + "integrity": "sha512-oIPzksmTg4/MriiaYGO+okXDT7ztn/w3Eptv/+gSIdMdKsJo0u4CfYNFJPy+4SKMuCqGw2wxnA+URMg3t8a/bQ==", + "dev": true }, "node_modules/deepmerge": { "version": "4.3.1", @@ -3342,6 +3371,7 @@ "version": "4.0.0", "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-4.0.0.tgz", "integrity": "sha512-TtpcNJ3XAzx3Gq8sWRzJaVajRs0uVxA2YAkdb1jm2YkPz4G6egUFAyA3n5vtEIZefPk5Wa4UXbKuS5fKkJWdgA==", + "dev": true, "engines": { "node": ">=10" }, @@ -3353,6 +3383,7 @@ "version": "9.31.0", "resolved": "https://registry.npmjs.org/eslint/-/eslint-9.31.0.tgz", "integrity": "sha512-QldCVh/ztyKJJZLr4jXNUByx3gR+TDYZCRXEktiZoUR3PGy4qCmSbkxcIle8GEwGpb5JBZazlaJ/CxLidXdEbQ==", + "dev": true, "dependencies": { "@eslint-community/eslint-utils": "^4.2.0", "@eslint-community/regexpp": "^4.12.1", @@ -3686,6 +3717,7 @@ "version": "8.4.0", "resolved": "https://registry.npmjs.org/eslint-scope/-/eslint-scope-8.4.0.tgz", "integrity": "sha512-sNXOfKCn74rt8RICKMvJS7XKV/Xk9kA7DyJr8mJik3S7Cwgy3qlkkmyS2uQB3jiJg6VNdZd/pDBJu0nvG2NlTg==", + "dev": true, "dependencies": { "esrecurse": "^4.3.0", "estraverse": "^5.2.0" @@ -3701,6 +3733,7 @@ "version": "3.4.3", "resolved": "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-3.4.3.tgz", "integrity": "sha512-wpc+LXeiyiisxPlEkUzU6svyS1frIO3Mgxj1fdy7Pm8Ygzguax2N3Fa/D/ag1WqbOprdI+uY6wMUl8/a2G+iag==", + "dev": true, "engines": { "node": "^12.22.0 || ^14.17.0 || >=16.0.0" }, @@ -3712,6 +3745,7 @@ "version": "4.2.1", "resolved": "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-4.2.1.tgz", "integrity": "sha512-Uhdk5sfqcee/9H/rCOJikYz67o0a2Tw2hGRPOG2Y1R2dg7brRe1uG0yaNQDHu+TO/uQPF/5eCapvYSmHUjt7JQ==", + "dev": true, "engines": { "node": "^18.18.0 || ^20.9.0 || >=21.1.0" }, @@ -3723,6 +3757,7 @@ "version": "10.4.0", "resolved": "https://registry.npmjs.org/espree/-/espree-10.4.0.tgz", "integrity": "sha512-j6PAQ2uUr79PZhBjP5C5fhl8e39FmRnOjsD5lGnWrFU8i2G776tBK7+nP8KuQUTTyAZUwfQqXAgrVH5MbH9CYQ==", + "dev": true, "dependencies": { "acorn": "^8.15.0", "acorn-jsx": "^5.3.2", @@ -3739,6 +3774,7 @@ "version": "4.2.1", "resolved": "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-4.2.1.tgz", "integrity": "sha512-Uhdk5sfqcee/9H/rCOJikYz67o0a2Tw2hGRPOG2Y1R2dg7brRe1uG0yaNQDHu+TO/uQPF/5eCapvYSmHUjt7JQ==", + "dev": true, "engines": { "node": "^18.18.0 || ^20.9.0 || >=21.1.0" }, @@ -3763,6 +3799,7 @@ "version": "1.6.0", "resolved": "https://registry.npmjs.org/esquery/-/esquery-1.6.0.tgz", "integrity": "sha512-ca9pw9fomFcKPvFLXhBKUK90ZvGibiGOvRJNbjljY7s7uq/5YO4BOzcYtJqExdx99rF6aAcnRxHmcUHcz6sQsg==", + "dev": true, "dependencies": { "estraverse": "^5.1.0" }, @@ -3774,6 +3811,7 @@ "version": "4.3.0", "resolved": "https://registry.npmjs.org/esrecurse/-/esrecurse-4.3.0.tgz", "integrity": "sha512-KmfKL3b6G+RXvP8N1vr3Tq1kL/oCFgn2NYXEtqP8/L3pKapUA4G8cFVaoF3SU323CD4XypR/ffioHmkti6/Tag==", + "dev": true, "dependencies": { "estraverse": "^5.2.0" }, @@ -3785,6 +3823,7 @@ "version": "5.3.0", "resolved": "https://registry.npmjs.org/estraverse/-/estraverse-5.3.0.tgz", "integrity": "sha512-MMdARuVEQziNTeJD8DgMqmhwR11BRQ/cBP+pLtYdSTnf3MIO8fFeiINEbX36ZdNlfU/7A9f3gUw49B3oQsvwBA==", + "dev": true, "engines": { "node": ">=4.0" } @@ -3793,6 +3832,7 @@ "version": "2.0.3", "resolved": "https://registry.npmjs.org/esutils/-/esutils-2.0.3.tgz", "integrity": "sha512-kVscqXk4OCp68SZ0dkgEKVi6/8ij300KBWTJq32P/dYeWTSwK41WyTxalN1eRmA5Z9UU/LX9D7FWSmV9SAYx6g==", + "dev": true, "engines": { "node": ">=0.10.0" } @@ -3861,7 +3901,8 @@ "node_modules/fast-deep-equal": { "version": "3.1.3", "resolved": "https://registry.npmjs.org/fast-deep-equal/-/fast-deep-equal-3.1.3.tgz", - "integrity": "sha512-f3qQ9oQy9j2AhBe/H9VC91wLmKBCCU/gDOnKNAYG5hswO7BLKj09Hc5HYNz9cGI++xlpDCIgDaitVs03ATR84Q==" + "integrity": "sha512-f3qQ9oQy9j2AhBe/H9VC91wLmKBCCU/gDOnKNAYG5hswO7BLKj09Hc5HYNz9cGI++xlpDCIgDaitVs03ATR84Q==", + "dev": true }, "node_modules/fast-glob": { "version": "3.3.3", @@ -3894,12 +3935,14 @@ "node_modules/fast-json-stable-stringify": { "version": "2.1.0", "resolved": "https://registry.npmjs.org/fast-json-stable-stringify/-/fast-json-stable-stringify-2.1.0.tgz", - "integrity": "sha512-lhd/wF+Lk98HZoTCtlVraHtfh5XYijIjalXck7saUtuanSDyLMxnHhSXEDJqHxD7msR8D0uCmqlkwjCV8xvwHw==" + "integrity": "sha512-lhd/wF+Lk98HZoTCtlVraHtfh5XYijIjalXck7saUtuanSDyLMxnHhSXEDJqHxD7msR8D0uCmqlkwjCV8xvwHw==", + "dev": true }, "node_modules/fast-levenshtein": { "version": "2.0.6", "resolved": "https://registry.npmjs.org/fast-levenshtein/-/fast-levenshtein-2.0.6.tgz", - "integrity": "sha512-DCXu6Ifhqcks7TZKY3Hxp3y6qphY5SJZmrWMDrKcERSOXWQdMhU9Ig/PYrzyw/ul9jOIyh0N4M0tbC5hodg8dw==" + "integrity": "sha512-DCXu6Ifhqcks7TZKY3Hxp3y6qphY5SJZmrWMDrKcERSOXWQdMhU9Ig/PYrzyw/ul9jOIyh0N4M0tbC5hodg8dw==", + "dev": true }, "node_modules/fastq": { "version": "1.19.1", @@ -3923,6 +3966,7 @@ "version": "8.0.0", "resolved": "https://registry.npmjs.org/file-entry-cache/-/file-entry-cache-8.0.0.tgz", "integrity": "sha512-XXTUwCvisa5oacNGRP9SfNtYBNAMi+RPwBFmblZEF7N7swHYQS6/Zfk7SRwx4D5j3CH211YNRco1DEMNVfZCnQ==", + "dev": true, "dependencies": { "flat-cache": "^4.0.0" }, @@ -3976,6 +4020,7 @@ "version": "5.0.0", "resolved": "https://registry.npmjs.org/find-up/-/find-up-5.0.0.tgz", "integrity": "sha512-78/PXT1wlLLDgTzDs7sjq9hzz0vXD+zn+7wypEe4fXQxCmdmqfGsEPQxmiCSQI3ajFV91bVSsvNtrJRiW6nGng==", + "dev": true, "dependencies": { "locate-path": "^6.0.0", "path-exists": "^4.0.0" @@ -3991,6 +4036,7 @@ "version": "4.0.1", "resolved": "https://registry.npmjs.org/flat-cache/-/flat-cache-4.0.1.tgz", "integrity": "sha512-f7ccFPK3SXFHpx15UIGyRJ/FJQctuKZ0zVuN3frBo4HnK3cay9VEW0R6yPYFHC0AgqhukPzKjq22t5DmAyqGyw==", + "dev": true, "dependencies": { "flatted": "^3.2.9", "keyv": "^4.5.4" @@ -4002,7 +4048,8 @@ "node_modules/flatted": { "version": "3.3.3", "resolved": "https://registry.npmjs.org/flatted/-/flatted-3.3.3.tgz", - "integrity": "sha512-GX+ysw4PBCz0PzosHDepZGANEuFCMLrnRTiEy9McGjmkCQYwRq4A/X786G/fjM/+OjsWSU1ZrY5qyARZmO/uwg==" + "integrity": "sha512-GX+ysw4PBCz0PzosHDepZGANEuFCMLrnRTiEy9McGjmkCQYwRq4A/X786G/fjM/+OjsWSU1ZrY5qyARZmO/uwg==", + "dev": true }, "node_modules/for-each": { "version": "0.3.5", @@ -4228,6 +4275,7 @@ "version": "6.0.2", "resolved": "https://registry.npmjs.org/glob-parent/-/glob-parent-6.0.2.tgz", "integrity": "sha512-XxwI8EOhVQgWp6iDL+3b0r86f4d6AX6zSU55HfB4ydCEuXLXc5FcYeOu+nnGftS4TEju/11rt4KJPTMgbfmv4A==", + "dev": true, "dependencies": { "is-glob": "^4.0.3" }, @@ -4263,6 +4311,7 @@ "version": "14.0.0", "resolved": "https://registry.npmjs.org/globals/-/globals-14.0.0.tgz", "integrity": "sha512-oahGvuMGQlPw/ivIYBjVSrWAfWLBeku5tpPE2fOPLi+WHffIWbuh2tCjhyQhTBPMf5E9jDEH4FOmTYgYwbKwtQ==", + "dev": true, "engines": { "node": ">=18" }, @@ -4326,6 +4375,7 @@ "version": "4.0.0", "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz", "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==", + "dev": true, "engines": { "node": ">=8" } @@ -4430,6 +4480,7 @@ "version": "5.3.2", "resolved": "https://registry.npmjs.org/ignore/-/ignore-5.3.2.tgz", "integrity": "sha512-hsBTNUqQTDwkWtcdYI2i06Y/nUBEsNEDJKjWdigLvegy8kDuJAS8uRlpkkcQpyEXL0Z/pjDy5HBmMjRCJ2gq+g==", + "dev": true, "engines": { "node": ">= 4" } @@ -4438,6 +4489,7 @@ "version": "3.3.1", "resolved": "https://registry.npmjs.org/import-fresh/-/import-fresh-3.3.1.tgz", "integrity": "sha512-TR3KfrTZTYLPB6jUjfx6MF9WcWrHL9su5TObK4ZkYgBdWKPOFoSoQIdEuTuR82pmtxH2spWG9h6etwfr1pLBqQ==", + "dev": true, "dependencies": { "parent-module": "^1.0.0", "resolve-from": "^4.0.0" @@ -4472,6 +4524,7 @@ "version": "0.1.4", "resolved": "https://registry.npmjs.org/imurmurhash/-/imurmurhash-0.1.4.tgz", "integrity": "sha512-JmXMZ6wuvDmLiHEml9ykzqO6lwFbof0GG4IkcGaENdCRDDmMVnny7s5HsIgHCbaq0w2MyPhDqkhTUgS2LU2PHA==", + "dev": true, "engines": { "node": ">=0.8.19" } @@ -4644,6 +4697,7 @@ "version": "2.1.1", "resolved": "https://registry.npmjs.org/is-extglob/-/is-extglob-2.1.1.tgz", "integrity": "sha512-SbKbANkN603Vi4jEZv49LeVJMn4yGwsbzZworEoyEiutsN3nJYdbO36zfhGJ6QEDpOZIFkDtnq5JRxmvl3jsoQ==", + "dev": true, "engines": { "node": ">=0.10.0" } @@ -4706,6 +4760,7 @@ "version": "4.0.3", "resolved": "https://registry.npmjs.org/is-glob/-/is-glob-4.0.3.tgz", "integrity": "sha512-xelSayHH36ZgE7ZWhli7pW34hNbNl8Ojv5KVmkJD4hBdD3th8Tfk9vYasLM+mXWOZhFkgZfxhLSnrwRr4elSSg==", + "dev": true, "dependencies": { "is-extglob": "^2.1.1" }, @@ -4919,7 +4974,8 @@ "node_modules/isexe": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/isexe/-/isexe-2.0.0.tgz", - "integrity": "sha512-RHxMLp9lnKHGHRng9QFhRCMbYAcVpn69smSGcq3f36xjgVVWThj4qqLbTLlq7Ssj8B+fIQ1EuCEGI2lKsyQeIw==" + "integrity": "sha512-RHxMLp9lnKHGHRng9QFhRCMbYAcVpn69smSGcq3f36xjgVVWThj4qqLbTLlq7Ssj8B+fIQ1EuCEGI2lKsyQeIw==", + "dev": true }, "node_modules/istanbul-lib-coverage": { "version": "3.2.2", @@ -5612,6 +5668,7 @@ "version": "4.1.0", "resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-4.1.0.tgz", "integrity": "sha512-wpxZs9NoxZaJESJGIZTyDEaYpl0FKSA+FB9aJiyemKhMwkxQg63h4T1KJgUGHpTqPDNRcmmYLugrRjJlBtWvRA==", + "dev": true, "dependencies": { "argparse": "^2.0.1" }, @@ -5643,7 +5700,8 @@ "node_modules/json-buffer": { "version": "3.0.1", "resolved": "https://registry.npmjs.org/json-buffer/-/json-buffer-3.0.1.tgz", - "integrity": "sha512-4bV5BfR2mqfQTJm+V5tPPdf+ZpuhiIvTuAB5g8kcrXOZpTT/QwwVRWBywX1ozr6lEuPdbHxwaJlm9G6mI2sfSQ==" + "integrity": "sha512-4bV5BfR2mqfQTJm+V5tPPdf+ZpuhiIvTuAB5g8kcrXOZpTT/QwwVRWBywX1ozr6lEuPdbHxwaJlm9G6mI2sfSQ==", + "dev": true }, "node_modules/json-parse-even-better-errors": { "version": "2.3.1", @@ -5654,12 +5712,14 @@ "node_modules/json-schema-traverse": { "version": "0.4.1", "resolved": "https://registry.npmjs.org/json-schema-traverse/-/json-schema-traverse-0.4.1.tgz", - "integrity": "sha512-xbbCH5dCYU5T8LcEhhuh7HJ88HXuW3qsI3Y0zOZFKfZEHcpWiHU/Jxzk629Brsab/mMiHQti9wMP+845RPe3Vg==" + "integrity": "sha512-xbbCH5dCYU5T8LcEhhuh7HJ88HXuW3qsI3Y0zOZFKfZEHcpWiHU/Jxzk629Brsab/mMiHQti9wMP+845RPe3Vg==", + "dev": true }, "node_modules/json-stable-stringify-without-jsonify": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/json-stable-stringify-without-jsonify/-/json-stable-stringify-without-jsonify-1.0.1.tgz", - "integrity": "sha512-Bdboy+l7tA3OGW6FjyFHWkP5LuByj1Tk33Ljyq0axyzdk9//JSi2u3fP1QSmd1KNwq6VOKYGlAu87CisVir6Pw==" + "integrity": "sha512-Bdboy+l7tA3OGW6FjyFHWkP5LuByj1Tk33Ljyq0axyzdk9//JSi2u3fP1QSmd1KNwq6VOKYGlAu87CisVir6Pw==", + "dev": true }, "node_modules/json5": { "version": "2.2.3", @@ -5692,6 +5752,7 @@ "version": "4.5.4", "resolved": "https://registry.npmjs.org/keyv/-/keyv-4.5.4.tgz", "integrity": "sha512-oxVHkHR/EJf2CNXnWxRLW6mg7JyCCUcG0DtEGmL2ctUo1PNTin1PUil+r/+4r5MpVgC/fn1kjsx7mjSujKqIpw==", + "dev": true, "dependencies": { "json-buffer": "3.0.1" } @@ -5727,6 +5788,7 @@ "version": "0.4.1", "resolved": "https://registry.npmjs.org/levn/-/levn-0.4.1.tgz", "integrity": "sha512-+bT2uH4E5LGE7h/n3evcS/sQlJXCpIp6ym8OWJ5eV6+67Dsql/LaaT7qJBAt2rzfoa/5QBGBhxDix1dMt2kQKQ==", + "dev": true, "dependencies": { "prelude-ls": "^1.2.1", "type-check": "~0.4.0" @@ -5865,6 +5927,7 @@ "version": "6.0.0", "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-6.0.0.tgz", "integrity": "sha512-iPZK6eYjbxRu3uB4/WZ3EsEIMJFMqAoopl3R+zuq0UjcAm/MO6KCweDgPfP3elTztoKP3KtnVHxTn2NHBSDVUw==", + "dev": true, "dependencies": { "p-locate": "^5.0.0" }, @@ -5884,7 +5947,8 @@ "node_modules/lodash.merge": { "version": "4.6.2", "resolved": "https://registry.npmjs.org/lodash.merge/-/lodash.merge-4.6.2.tgz", - "integrity": "sha512-0KpjqXRVvrYyCsX1swR/XTK0va6VQkQM6MNo7PqW77ByjAhoARA8EfrP1N4+KlKj8YS0ZUCtRT/YUuhyYDujIQ==" + "integrity": "sha512-0KpjqXRVvrYyCsX1swR/XTK0va6VQkQM6MNo7PqW77ByjAhoARA8EfrP1N4+KlKj8YS0ZUCtRT/YUuhyYDujIQ==", + "dev": true }, "node_modules/log-update": { "version": "6.1.0", @@ -6116,6 +6180,7 @@ "version": "3.1.2", "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.1.2.tgz", "integrity": "sha512-J7p63hRiAjw1NDEww1W7i37+ByIrOWO5XQQAzZ3VOcL0PNybwpfmV/N05zFAzwQ9USyEcX6t3UO+K5aqBQOIHw==", + "dev": true, "dependencies": { "brace-expansion": "^1.1.7" }, @@ -6144,7 +6209,8 @@ "node_modules/ms": { "version": "2.1.3", "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.3.tgz", - "integrity": "sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA==" + "integrity": "sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA==", + "dev": true }, "node_modules/nano-spawn": { "version": "1.0.2", @@ -6176,7 +6242,8 @@ "node_modules/natural-compare": { "version": "1.4.0", "resolved": "https://registry.npmjs.org/natural-compare/-/natural-compare-1.4.0.tgz", - "integrity": "sha512-OWND8ei3VtNC9h7V60qff3SVobHr996CTwgxubgyQYEpg290h9J0buyECNNJexkFm5sOajh5G116RYA1c8ZMSw==" + "integrity": "sha512-OWND8ei3VtNC9h7V60qff3SVobHr996CTwgxubgyQYEpg290h9J0buyECNNJexkFm5sOajh5G116RYA1c8ZMSw==", + "dev": true }, "node_modules/node-int64": { "version": "0.4.0", @@ -6365,6 +6432,7 @@ "version": "0.9.4", "resolved": "https://registry.npmjs.org/optionator/-/optionator-0.9.4.tgz", "integrity": "sha512-6IpQ7mKUxRcZNLIObR0hz7lxsapSSIYNZJwXPGeF0mTVqGKFIXj1DQcMoT22S3ROcLyY/rz0PWaWZ9ayWmad9g==", + "dev": true, "dependencies": { "deep-is": "^0.1.3", "fast-levenshtein": "^2.0.6", @@ -6398,6 +6466,7 @@ "version": "3.1.0", "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-3.1.0.tgz", "integrity": "sha512-TYOanM3wGwNGsZN2cVTYPArw454xnXj5qmWF1bEoAc4+cU/ol7GVh7odevjp1FNHduHc3KZMcFduxU5Xc6uJRQ==", + "dev": true, "dependencies": { "yocto-queue": "^0.1.0" }, @@ -6412,6 +6481,7 @@ "version": "5.0.0", "resolved": "https://registry.npmjs.org/p-locate/-/p-locate-5.0.0.tgz", "integrity": "sha512-LaNjtRWUBY++zB5nE/NwcaoMylSPk+S+ZHNB1TzdbMJMny6dynpAGt7X/tl/QYq3TIeE6nxHppbo2LGymrG5Pw==", + "dev": true, "dependencies": { "p-limit": "^3.0.2" }, @@ -6441,6 +6511,7 @@ "version": "1.0.1", "resolved": "https://registry.npmjs.org/parent-module/-/parent-module-1.0.1.tgz", "integrity": "sha512-GQ2EWRpQV8/o+Aw8YqtfZZPfNRWZYkbidE9k5rpl/hC3vtHHBfGm2Ifi6qWV+coDGkrUKZAxE3Lot5kcsRlh+g==", + "dev": true, "dependencies": { "callsites": "^3.0.0" }, @@ -6485,6 +6556,7 @@ "version": "4.0.0", "resolved": "https://registry.npmjs.org/path-exists/-/path-exists-4.0.0.tgz", "integrity": "sha512-ak9Qy5Q7jYb2Wwcey5Fpvg2KoAc/ZIhLSLOSBmRmygPsGwkVVt0fZa0qrtMz+m6tJTAHfZQ8FnmB4MG4LWy7/w==", + "dev": true, "engines": { "node": ">=8" } @@ -6502,6 +6574,7 @@ "version": "3.1.1", "resolved": "https://registry.npmjs.org/path-key/-/path-key-3.1.1.tgz", "integrity": "sha512-ojmeN0qd+y0jszEtoY48r0Peq5dwMEkIlCOu6Q5f41lfkswXuKtYrhgoTpLnyIcHm24Uhqx+5Tqm2InSwLhE6Q==", + "dev": true, "engines": { "node": ">=8" } @@ -6650,6 +6723,7 @@ "version": "1.2.1", "resolved": "https://registry.npmjs.org/prelude-ls/-/prelude-ls-1.2.1.tgz", "integrity": "sha512-vkcDPrRZo1QZLbn5RLGPpg/WmIQ65qoWWhcGKf/b5eplkkarX0m9z8ppCat4mlOqUsWpyNuYgO3VRyrYHSzX5g==", + "dev": true, "engines": { "node": ">= 0.8.0" } @@ -6717,6 +6791,7 @@ "version": "2.3.1", "resolved": "https://registry.npmjs.org/punycode/-/punycode-2.3.1.tgz", "integrity": "sha512-vYt7UD1U9Wg6138shLtLOvdAu+8DsC/ilFtEVHcH+wydcSpNE20AfSOduf6MkRFahL5FY7X1oU7nKVZFtfq8Fg==", + "dev": true, "engines": { "node": ">=6" } @@ -6884,6 +6959,7 @@ "version": "4.0.0", "resolved": "https://registry.npmjs.org/resolve-from/-/resolve-from-4.0.0.tgz", "integrity": "sha512-pb/MYmXstAkysRFx8piNI1tGFNQIFA3vkE3Gq4EuA1dF6gHp/+vgZqsCGJapvy8N3Q+4o7FwvquPJcnZ7RYy4g==", + "dev": true, "engines": { "node": ">=4" } @@ -7085,6 +7161,7 @@ "version": "2.0.0", "resolved": "https://registry.npmjs.org/shebang-command/-/shebang-command-2.0.0.tgz", "integrity": "sha512-kHxr2zZpYtdmrN1qDjrrX/Z1rR1kG8Dx+gkpK1G4eXmvXswmcE1hTWBWYUzlraYw1/yZp6YuDY77YtvbN0dmDA==", + "dev": true, "dependencies": { "shebang-regex": "^3.0.0" }, @@ -7096,6 +7173,7 @@ "version": "3.0.0", "resolved": "https://registry.npmjs.org/shebang-regex/-/shebang-regex-3.0.0.tgz", "integrity": "sha512-7++dFhtcx3353uBaq8DDR4NuxBetBzC7ZQOhmTQInHEd6bSrXdiEyzCvG07Z44UYdLShWUyXt5M/yhz8ekcb1A==", + "dev": true, "engines": { "node": ">=8" } @@ -7579,6 +7657,7 @@ "version": "3.1.1", "resolved": "https://registry.npmjs.org/strip-json-comments/-/strip-json-comments-3.1.1.tgz", "integrity": "sha512-6fPc+R4ihwqP6N/aIv2f1gMH8lOVtWQHoqC4yK6oSDVVocumAsfCqjkXnqiYMhmMwS/mEHLp7Vehlt3ql6lEig==", + "dev": true, "engines": { "node": ">=8" }, @@ -7590,6 +7669,7 @@ "version": "7.2.0", "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz", "integrity": "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==", + "dev": true, "dependencies": { "has-flag": "^4.0.0" }, @@ -7805,6 +7885,7 @@ "version": "0.4.0", "resolved": "https://registry.npmjs.org/type-check/-/type-check-0.4.0.tgz", "integrity": "sha512-XleUoc9uwGXqjWwXaUTZAmzMcFZ5858QA2vvx1Ur5xIcixXIP+8LnFDgRplU30us6teqdlskFfu+ae4K79Ooew==", + "dev": true, "dependencies": { "prelude-ls": "^1.2.1" }, @@ -8046,6 +8127,7 @@ "version": "4.4.1", "resolved": "https://registry.npmjs.org/uri-js/-/uri-js-4.4.1.tgz", "integrity": "sha512-7rKUyy33Q1yc98pQ1DAmLtwX109F7TIfWlW1Ydo8Wl1ii1SeHieeh0HHfPeL2fMXK6z0s8ecKs9frCuLJvndBg==", + "dev": true, "dependencies": { "punycode": "^2.1.0" } @@ -8077,6 +8159,7 @@ "version": "2.0.2", "resolved": "https://registry.npmjs.org/which/-/which-2.0.2.tgz", "integrity": "sha512-BLI3Tl1TW3Pvl70l3yq3Y64i+awpwXqsGBYWkkqMtnbXgrMD+yj7rhW0kuEDxzJaYXGjEW5ogapKNMEKNMjibA==", + "dev": true, "dependencies": { "isexe": "^2.0.0" }, @@ -8176,6 +8259,7 @@ "version": "1.2.5", "resolved": "https://registry.npmjs.org/word-wrap/-/word-wrap-1.2.5.tgz", "integrity": "sha512-BN22B5eaMMI9UMtjrGd5g5eCYPpCPDUy0FJXbYsaT5zYxjFOckS53SQDE3pWkVoWpHXVb3BrYcEN4Twa55B5cA==", + "dev": true, "engines": { "node": ">=0.10.0" } @@ -8404,6 +8488,7 @@ "version": "0.1.0", "resolved": "https://registry.npmjs.org/yocto-queue/-/yocto-queue-0.1.0.tgz", "integrity": "sha512-rVksvsnNCdJ/ohGc6xgPwyN8eheCxsiLM8mxuE/t/mOVqJewPuO1miLpTHQiRgTKCLexL4MeAFVagts7HmNZ2Q==", + "dev": true, "engines": { "node": ">=10" }, diff --git a/package.json b/package.json index 172c409..94de103 100644 --- a/package.json +++ b/package.json @@ -37,10 +37,7 @@ "homepage": "https://github.com/1Password/install-cli-action#readme", "dependencies": { "@actions/core": "^1.11.1", - "@actions/tool-cache": "^2.0.2", - "eslint": "^9.31.0", - "op-cli-installer": "github:1Password/op-cli-installer#8ea4bf402c6385a90f6d2d98efe31ac845633412", - "semver": "^7.7.2" + "op-cli-installer": "github:1Password/op-cli-installer#8ea4bf402c6385a90f6d2d98efe31ac845633412" }, "devDependencies": { "@1password/eslint-config": "^8.1.0", @@ -49,6 +46,7 @@ "@types/node": "^24.0.14", "@types/semver": "^7.7.0", "@vercel/ncc": "^0.38.3", + "eslint": "^9.31.0", "husky": "^9.1.7", "jest": "^30.0.4", "lint-staged": "^16.1.2", diff --git a/src/cli-installer/cli-installer.ts b/src/cli-installer/cli-installer.ts deleted file mode 100644 index 820e179..0000000 --- a/src/cli-installer/cli-installer.ts +++ /dev/null @@ -1,58 +0,0 @@ -import os from "os"; - -import * as core from "@actions/core"; -import * as tc from "@actions/tool-cache"; - -export type SupportedPlatform = Extract< - NodeJS.Platform, - "linux" | "darwin" | "win32" ->; - -// maps OS architecture names to 1Password CLI installer architecture names -export const archMap: Record = { - ia32: "386", - x64: "amd64", - arm: "arm", - arm64: "arm64", -}; - -// Builds the download URL for the 1Password CLI based on the platform and version. -export const cliUrlBuilder: Record< - SupportedPlatform, - (version: string, arch?: string) => string -> = { - linux: (version, arch) => - `https://cache.agilebits.com/dist/1P/op2/pkg/${version}/op_linux_${arch}_${version}.zip`, - darwin: (version) => - `https://cache.agilebits.com/dist/1P/op2/pkg/${version}/op_apple_universal_${version}.pkg`, - win32: (version, arch) => - `https://cache.agilebits.com/dist/1P/op2/pkg/${version}/op_windows_${arch}_${version}.zip`, -}; - -export class CliInstaller { - public readonly version: string; - public readonly arch: string; - - public constructor(version: string) { - this.version = version; - this.arch = this.getArch(); - } - - public async install(url: string): Promise { - console.info(`Downloading 1Password CLI from: ${url}`); - const downloadPath = await tc.downloadTool(url); - console.info("Installing 1Password CLI"); - const extractedPath = await tc.extractZip(downloadPath); - core.addPath(extractedPath); - core.info("1Password CLI installed"); - } - - private getArch(): string { - const arch = archMap[os.arch()]; - if (!arch) { - throw new Error("Unsupported architecture"); - } - - return arch; - } -} diff --git a/src/cli-installer/index.ts b/src/cli-installer/index.ts deleted file mode 100644 index 4b071e6..0000000 --- a/src/cli-installer/index.ts +++ /dev/null @@ -1 +0,0 @@ -export { type Installer, newCliInstaller } from "./installer"; diff --git a/src/cli-installer/installer.test.ts b/src/cli-installer/installer.test.ts deleted file mode 100644 index f94b8f2..0000000 --- a/src/cli-installer/installer.test.ts +++ /dev/null @@ -1,43 +0,0 @@ -import os from "os"; - -import { newCliInstaller } from "./installer"; -import { LinuxInstaller } from "./linux"; -import { MacOsInstaller } from "./macos"; -import { WindowsInstaller } from "./windows"; - -afterEach(() => { - jest.restoreAllMocks(); -}); - -describe("newCliInstaller", () => { - const version = "1.0.0"; - - afterEach(() => { - jest.resetAllMocks(); - }); - - it("should return LinuxInstaller for linux platform", () => { - jest.spyOn(os, "platform").mockReturnValue("linux"); - const installer = newCliInstaller(version); - expect(installer).toBeInstanceOf(LinuxInstaller); - }); - - it("should return MacOsInstaller for darwin platform", () => { - jest.spyOn(os, "platform").mockReturnValue("darwin"); - const installer = newCliInstaller(version); - expect(installer).toBeInstanceOf(MacOsInstaller); - }); - - it("should return WindowsInstaller for win32 platform", () => { - jest.spyOn(os, "platform").mockReturnValue("win32"); - const installer = newCliInstaller(version); - expect(installer).toBeInstanceOf(WindowsInstaller); - }); - - it("should throw error for unsupported platform", () => { - jest.spyOn(os, "platform").mockReturnValue("sunos"); - expect(() => newCliInstaller(version)).toThrow( - "Unsupported platform: sunos", - ); - }); -}); diff --git a/src/cli-installer/installer.ts b/src/cli-installer/installer.ts deleted file mode 100644 index 1e8f649..0000000 --- a/src/cli-installer/installer.ts +++ /dev/null @@ -1,23 +0,0 @@ -import os from "os"; - -import { LinuxInstaller } from "./linux"; -import { MacOsInstaller } from "./macos"; -import { WindowsInstaller } from "./windows"; - -export interface Installer { - installCli(): Promise; -} - -export const newCliInstaller = (version: string): Installer => { - const platform = os.platform(); - switch (platform) { - case "linux": - return new LinuxInstaller(version); - case "darwin": - return new MacOsInstaller(version); - case "win32": - return new WindowsInstaller(version); - default: - throw new Error(`Unsupported platform: ${platform}`); - } -}; diff --git a/src/cli-installer/linux.test.ts b/src/cli-installer/linux.test.ts deleted file mode 100644 index db8cd7a..0000000 --- a/src/cli-installer/linux.test.ts +++ /dev/null @@ -1,38 +0,0 @@ -import os from "os"; - -import { - archMap, - CliInstaller, - cliUrlBuilder, - type SupportedPlatform, -} from "./cli-installer"; -import { LinuxInstaller } from "./linux"; - -afterEach(() => { - jest.restoreAllMocks(); -}); - -describe("LinuxInstaller", () => { - const version = "1.2.3"; - const arch: NodeJS.Architecture = "arm64"; - - it("should construct with given version and architecture", () => { - jest.spyOn(os, "arch").mockReturnValue(arch); - const installer = new LinuxInstaller(version); - expect(installer.version).toEqual(version); - expect(installer.arch).toEqual(archMap[arch]); - }); - - it("should call install with correct URL", async () => { - const installer = new LinuxInstaller(version); - const installMock = jest - .spyOn(CliInstaller.prototype, "install") - .mockResolvedValue(); - - await installer.installCli(); - - const builder = cliUrlBuilder["linux" as SupportedPlatform]; - const url = builder(version, installer.arch); - expect(installMock).toHaveBeenCalledWith(url); - }); -}); diff --git a/src/cli-installer/linux.ts b/src/cli-installer/linux.ts deleted file mode 100644 index 8d7c8ed..0000000 --- a/src/cli-installer/linux.ts +++ /dev/null @@ -1,19 +0,0 @@ -import { - CliInstaller, - cliUrlBuilder, - type SupportedPlatform, -} from "./cli-installer"; -import type { Installer } from "./installer"; - -export class LinuxInstaller extends CliInstaller implements Installer { - private readonly platform: SupportedPlatform = "linux"; // Node.js platform identifier for Linux - - public constructor(version: string) { - super(version); - } - - public async installCli(): Promise { - const urlBuilder = cliUrlBuilder[this.platform]; - await super.install(urlBuilder(this.version, this.arch)); - } -} diff --git a/src/cli-installer/macos.test.ts b/src/cli-installer/macos.test.ts deleted file mode 100644 index ebbc64f..0000000 --- a/src/cli-installer/macos.test.ts +++ /dev/null @@ -1,35 +0,0 @@ -import os from "os"; - -import { - archMap, - cliUrlBuilder, - type SupportedPlatform, -} from "./cli-installer"; -import { MacOsInstaller } from "./macos"; - -afterEach(() => { - jest.restoreAllMocks(); -}); - -describe("MacOsInstaller", () => { - const version = "1.2.3"; - const arch: NodeJS.Architecture = "x64"; - - it("should construct with given version and architecture", () => { - jest.spyOn(os, "arch").mockReturnValue(arch); - const installer = new MacOsInstaller(version); - expect(installer.version).toEqual(version); - expect(installer.arch).toEqual(archMap[arch]); - }); - - it("should call install with correct URL", async () => { - const installer = new MacOsInstaller(version); - const installMock = jest.spyOn(installer, "install").mockResolvedValue(); - - await installer.installCli(); - - const builder = cliUrlBuilder["darwin" as SupportedPlatform]; - const url = builder(version, installer.arch); - expect(installMock).toHaveBeenCalledWith(url); - }); -}); diff --git a/src/cli-installer/macos.ts b/src/cli-installer/macos.ts deleted file mode 100644 index f73224e..0000000 --- a/src/cli-installer/macos.ts +++ /dev/null @@ -1,49 +0,0 @@ -import { exec } from "child_process"; -import * as fs from "fs"; -import * as path from "path"; -import { promisify } from "util"; - -import * as core from "@actions/core"; -import * as tc from "@actions/tool-cache"; - -import { - CliInstaller, - cliUrlBuilder, - type SupportedPlatform, -} from "./cli-installer"; -import { type Installer } from "./installer"; - -const execAsync = promisify(exec); - -export class MacOsInstaller extends CliInstaller implements Installer { - private readonly platform: SupportedPlatform = "darwin"; // Node.js platform identifier for macOS - - public constructor(version: string) { - super(version); - } - - public async installCli(): Promise { - const urlBuilder = cliUrlBuilder[this.platform]; - await this.install(urlBuilder(this.version)); - } - - // @actions/tool-cache package does not support .pkg files, so we need to handle the installation manually - public override async install(downloadUrl: string): Promise { - console.info(`Downloading 1Password CLI from: ${downloadUrl}`); - const pkgPath = await tc.downloadTool(downloadUrl); - const pkgWithExtension = `${pkgPath}.pkg`; - fs.renameSync(pkgPath, pkgWithExtension); - - const expandDir = "temp-pkg"; - await execAsync(`pkgutil --expand "${pkgWithExtension}" "${expandDir}"`); - const payloadPath = path.join(expandDir, "op.pkg", "Payload"); - console.info("Installing 1Password CLI"); - const cliPath = await tc.extractTar(payloadPath); - core.addPath(cliPath); - - fs.rmSync(expandDir, { recursive: true, force: true }); - fs.rmSync(pkgPath, { force: true }); - - core.info("1Password CLI installed"); - } -} diff --git a/src/cli-installer/windows.test.ts b/src/cli-installer/windows.test.ts deleted file mode 100644 index 7b91d3d..0000000 --- a/src/cli-installer/windows.test.ts +++ /dev/null @@ -1,38 +0,0 @@ -import os from "os"; - -import { - archMap, - CliInstaller, - cliUrlBuilder, - type SupportedPlatform, -} from "./cli-installer"; -import { WindowsInstaller } from "./windows"; - -afterEach(() => { - jest.restoreAllMocks(); -}); - -describe("WindowsInstaller", () => { - const version = "1.2.3"; - const arch: NodeJS.Architecture = "x64"; - - it("should construct with given version and architecture", () => { - jest.spyOn(os, "arch").mockReturnValue(arch); - const installer = new WindowsInstaller(version); - expect(installer.version).toEqual(version); - expect(installer.arch).toEqual(archMap[arch]); - }); - - it("should call install with correct URL", async () => { - const installer = new WindowsInstaller(version); - const installMock = jest - .spyOn(CliInstaller.prototype, "install") - .mockResolvedValue(); - - await installer.installCli(); - - const builder = cliUrlBuilder["win32" as SupportedPlatform]; - const url = builder(version, installer.arch); - expect(installMock).toHaveBeenCalledWith(url); - }); -}); diff --git a/src/cli-installer/windows.ts b/src/cli-installer/windows.ts deleted file mode 100644 index b1d37cb..0000000 --- a/src/cli-installer/windows.ts +++ /dev/null @@ -1,19 +0,0 @@ -import { - CliInstaller, - cliUrlBuilder, - type SupportedPlatform, -} from "./cli-installer"; -import type { Installer } from "./installer"; - -export class WindowsInstaller extends CliInstaller implements Installer { - private readonly platform: SupportedPlatform = "win32"; // Node.js platform identifier for Windows - - public constructor(version: string) { - super(version); - } - - public async installCli(): Promise { - const urlBuilder = cliUrlBuilder[this.platform]; - await super.install(urlBuilder(this.version, this.arch)); - } -} diff --git a/src/version/constants.ts b/src/version/constants.ts deleted file mode 100644 index 2bc0295..0000000 --- a/src/version/constants.ts +++ /dev/null @@ -1,13 +0,0 @@ -/* eslint-disable @typescript-eslint/naming-convention */ -export enum ReleaseChannel { - Stable = "latest", - Beta = "latest-beta", -} - -export interface VersionResponse { - CLI2: { - release: { version: string }; - beta: { version: string }; - }; -} -/* eslint-enable @typescript-eslint/naming-convention */ diff --git a/src/version/helper.test.ts b/src/version/helper.test.ts deleted file mode 100644 index 62fd3a3..0000000 --- a/src/version/helper.test.ts +++ /dev/null @@ -1,91 +0,0 @@ -import { ReleaseChannel } from "./constants"; -import { getLatestVersion } from "./helper"; - -describe("getLatestVersion", () => { - beforeEach(() => { - jest.restoreAllMocks(); - }); - - it("should return latest stable version", async () => { - const mockResponse = { - // eslint-disable-next-line @typescript-eslint/naming-convention - CLI2: { - release: { version: "2.31.0" }, - beta: { version: "2.32.0-beta.01" }, - }, - }; - - jest.spyOn(global, "fetch").mockResolvedValueOnce({ - // eslint-disable-next-line @typescript-eslint/require-await - json: async () => mockResponse, - } as Response); - - const version = await getLatestVersion(ReleaseChannel.Stable); - expect(version).toBe("2.31.0"); - }); - - it("should return latest beta version", async () => { - const mockResponse = { - // eslint-disable-next-line @typescript-eslint/naming-convention - CLI2: { - release: { version: "2.31.0" }, - beta: { version: "2.32.0-beta.01" }, - }, - }; - - jest.spyOn(global, "fetch").mockResolvedValueOnce({ - // eslint-disable-next-line @typescript-eslint/require-await - json: async () => mockResponse, - } as Response); - - const version = await getLatestVersion(ReleaseChannel.Beta); - expect(version).toBe("2.32.0-beta.01"); - }); - - it("should throw if no CLI2 field", async () => { - jest.spyOn(global, "fetch").mockResolvedValueOnce({ - // eslint-disable-next-line @typescript-eslint/require-await - json: async () => ({}), - } as Response); - - await expect(getLatestVersion(ReleaseChannel.Stable)).rejects.toThrow( - `No ${ReleaseChannel.Stable} versions found`, - ); - }); - - it("should throw if no stable version found", async () => { - const mockResponse = { - // eslint-disable-next-line @typescript-eslint/naming-convention - CLI2: { - beta: { version: "2.32.0-beta.01" }, - }, - }; - - jest.spyOn(global, "fetch").mockResolvedValueOnce({ - // eslint-disable-next-line @typescript-eslint/require-await - json: async () => mockResponse, - } as Response); - - await expect(getLatestVersion(ReleaseChannel.Stable)).rejects.toThrow( - `No ${ReleaseChannel.Stable} versions found`, - ); - }); - - it("should throw if no beta version found", async () => { - const mockResponse = { - // eslint-disable-next-line @typescript-eslint/naming-convention - CLI2: { - release: { version: "2.32.0" }, - }, - }; - - jest.spyOn(global, "fetch").mockResolvedValueOnce({ - // eslint-disable-next-line @typescript-eslint/require-await - json: async () => mockResponse, - } as Response); - - await expect(getLatestVersion(ReleaseChannel.Beta)).rejects.toThrow( - `No ${ReleaseChannel.Beta} versions found`, - ); - }); -}); diff --git a/src/version/helper.ts b/src/version/helper.ts deleted file mode 100644 index d7419b6..0000000 --- a/src/version/helper.ts +++ /dev/null @@ -1,22 +0,0 @@ -import * as core from "@actions/core"; - -import { ReleaseChannel, type VersionResponse } from "./constants"; - -// Returns the latest version of the 1Password CLI based on the specified channel. -export const getLatestVersion = async ( - channel: ReleaseChannel, -): Promise => { - core.info(`Getting ${channel} version number`); - const res = await fetch("https://app-updates.agilebits.com/latest"); - const json = (await res.json()) as VersionResponse; - const latestStable = json?.CLI2?.release?.version; - const latestBeta = json?.CLI2?.beta?.version; - const version = channel === ReleaseChannel.Beta ? latestBeta : latestStable; - - if (!version) { - core.error(`No ${channel} versions found`); - throw new Error(`No ${channel} versions found`); - } - - return version; -}; diff --git a/src/version/index.ts b/src/version/index.ts deleted file mode 100644 index 39915a5..0000000 --- a/src/version/index.ts +++ /dev/null @@ -1 +0,0 @@ -export { VersionResolver } from "./version-resolver"; diff --git a/src/version/validate.test.ts b/src/version/validate.test.ts deleted file mode 100644 index ff4a201..0000000 --- a/src/version/validate.test.ts +++ /dev/null @@ -1,45 +0,0 @@ -import { describe, expect, it } from "@jest/globals"; - -import { validateVersion } from "./validate"; - -describe("validateVersion", () => { - it('should not throw for "latest"', () => { - expect(() => validateVersion("latest")).not.toThrow(); - }); - - it('should not throw for "latest-beta"', () => { - expect(() => validateVersion("latest-beta")).not.toThrow(); - }); - - it('should not throw for valid semver version "2.18.0"', () => { - expect(() => validateVersion("2.18.0")).not.toThrow(); - }); - - it('should throw for partial version "2"', () => { - expect(() => validateVersion("2")).toThrow(); - }); - - it('should throw for partial version "2.1"', () => { - expect(() => validateVersion("2.1")).toThrow(); - }); - - it('should not throw for valid beta "2.19.0-beta.01"', () => { - expect(() => validateVersion("2.19.0-beta.01")).not.toThrow(); - }); - - it('should not throw for valid beta "2.19.3-beta.12"', () => { - expect(() => validateVersion("2.19.3-beta.12")).not.toThrow(); - }); - - it('should not throw for coerced version "v2.19.0"', () => { - expect(() => validateVersion("v2.19.0")).not.toThrow(); - }); - - it('should throw for invalid version "latest-abc"', () => { - expect(() => validateVersion("latest-abc")).toThrow(); - }); - - it("should throw for empty string", () => { - expect(() => validateVersion("")).toThrow(); - }); -}); diff --git a/src/version/validate.ts b/src/version/validate.ts deleted file mode 100644 index 39967dd..0000000 --- a/src/version/validate.ts +++ /dev/null @@ -1,23 +0,0 @@ -import semver from "semver"; - -import { ReleaseChannel } from "./constants"; - -// Validates if the provided version type is a valid enum value or a valid semver version. -export const validateVersion = (input: string): void => { - if (Object.values(ReleaseChannel).includes(input as ReleaseChannel)) { - return; - } - - // 1Password beta releases (aka 2.19.0-beta.01) are not semver compliant. - // According to semver, it should be "2.19.0-beta.1". - // That's why we need to normalize them before validating. - // Accepts valid semver versions like "2.18.0" or beta-releases like "2.19.0-beta.01" - // or versions with 'v' prefix like "v2.19.0" - const normalized = input.replace(/-beta\.0*(\d+)/, "-beta.$1"); - const normInput = new semver.SemVer(normalized); - if (semver.valid(normInput)) { - return; - } - - throw new Error(`Invalid version input: ${input}`); -}; diff --git a/src/version/version-resolver.test.ts b/src/version/version-resolver.test.ts deleted file mode 100644 index 0c49b3c..0000000 --- a/src/version/version-resolver.test.ts +++ /dev/null @@ -1,58 +0,0 @@ -import { expect } from "@jest/globals"; - -import { ReleaseChannel } from "./constants"; -import { VersionResolver } from "./version-resolver"; - -describe("VersionResolver", () => { - test("should throw error when invalid version provided", () => { - expect(() => new VersionResolver("vv")).toThrow(); - }); - - test("should throw error when version is empty", () => { - expect(() => new VersionResolver("")).toThrow(); - }); - - test("should throw error for major version only", () => { - expect(() => new VersionResolver("1")).toThrow(); - }); - - test("should throw error for major and minor version only", () => { - expect(() => new VersionResolver("1.0")).toThrow(); - }); - - test("should resolve latest stable version", async () => { - const versionResolver = new VersionResolver(ReleaseChannel.Stable); - await versionResolver.resolve(); - expect(versionResolver.get()).toBeDefined(); - }); - - test("should resolve latest beta version", async () => { - const versionResolver = new VersionResolver(ReleaseChannel.Beta); - await versionResolver.resolve(); - expect(versionResolver.get()).toBeDefined(); - }); - - test("should resolve version without 'v' prefix", async () => { - const versionResolver = new VersionResolver("1.0.0"); - await versionResolver.resolve(); - expect(versionResolver.get()).toBe("v1.0.0"); - }); - - test("should resolve version with 'v' prefix", async () => { - const versionResolver = new VersionResolver("v1.0.0"); - await versionResolver.resolve(); - expect(versionResolver.get()).toBe("v1.0.0"); - }); - - test("should resolve beta version without 'v' prefix", async () => { - const versionResolver = new VersionResolver("2.19.0-beta.01"); - await versionResolver.resolve(); - expect(versionResolver.get()).toBe("v2.19.0-beta.01"); - }); - - test("should resolve beta version with 'v' prefix", async () => { - const versionResolver = new VersionResolver("v2.19.0-beta.01"); - await versionResolver.resolve(); - expect(versionResolver.get()).toBe("v2.19.0-beta.01"); - }); -}); diff --git a/src/version/version-resolver.ts b/src/version/version-resolver.ts deleted file mode 100644 index d74ba4f..0000000 --- a/src/version/version-resolver.ts +++ /dev/null @@ -1,45 +0,0 @@ -import * as core from "@actions/core"; - -import { ReleaseChannel } from "./constants"; -import { getLatestVersion } from "./helper"; -import { validateVersion } from "./validate"; - -export class VersionResolver { - private version: string; - - public constructor(version: string) { - this.validate(version); - this.version = version; - } - - public get(): string { - return this.version; - } - - public async resolve(): Promise { - core.info(`Resolving version: ${this.version}`); - if (!this.version) { - core.error("Version is not provided"); - throw new Error("Version is not provided"); - } - - if (this.isReleaseChannel(this.version)) { - this.version = await getLatestVersion(this.version); - } - - // add `v` prefix if not already present - this.version = this.version.startsWith("v") - ? this.version - : `v${this.version}`; - } - - private validate(version: string) { - core.info(`Validating version number: '${version}'`); - validateVersion(version); - core.info(`Version number '${version}' is valid`); - } - - private isReleaseChannel(value: string): value is ReleaseChannel { - return Object.values(ReleaseChannel).includes(value as ReleaseChannel); - } -} From d3a32216c1eeedf9c9ee245db8642bbba7686e3a Mon Sep 17 00:00:00 2001 From: Volodymyr Zotov Date: Mon, 4 Aug 2025 22:40:37 -0500 Subject: [PATCH 5/9] Remove jest tests job as there are no unit tests anymore --- .github/workflows/test.yml | 9 --------- 1 file changed, 9 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index ec04e04..a5ab4a1 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -2,15 +2,6 @@ on: push name: Test installation jobs: - jest-tests: - name: "Run Jest tests" - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v4 - - name: Install dependencies - run: npm install - - name: Run Jest tests - run: npm test use-latest-version: name: "Test getting latest CLI stable version" strategy: From a2e7e68543ccccae154e5c4b222440cfc2d592d7 Mon Sep 17 00:00:00 2001 From: Volodymyr Zotov Date: Mon, 4 Aug 2025 22:41:46 -0500 Subject: [PATCH 6/9] Do not run tests on pre-commit/pre-push as this should be a part of ci/cd job --- lint-staged.config.js | 2 -- 1 file changed, 2 deletions(-) diff --git a/lint-staged.config.js b/lint-staged.config.js index 997fab4..24545d4 100644 --- a/lint-staged.config.js +++ b/lint-staged.config.js @@ -2,8 +2,6 @@ const lintStagedConfig = { // run formatting and linting on all supported file types "*.{js,json,md,ts,yaml,yml}": "npm run format:write", "*.{js,ts}": ["npm run lint:fix"], - // run testing on all supported file types within the src/ directory - "src/**/*.{js,ts}": ["npm run test -- --findRelatedTests"], }; export default lintStagedConfig; From f8fe031a62ea02abd840441cc41381683810c98c Mon Sep 17 00:00:00 2001 From: Volodymyr Zotov Date: Mon, 4 Aug 2025 22:43:16 -0500 Subject: [PATCH 7/9] Check formatting and lint on pre-commit/pre-push steps If failed, it should not push had users have to fix formatting and eslint errors by himself and re-try to commit/push --- lint-staged.config.js | 4 ++-- package.json | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/lint-staged.config.js b/lint-staged.config.js index 24545d4..0d3f9ea 100644 --- a/lint-staged.config.js +++ b/lint-staged.config.js @@ -1,7 +1,7 @@ const lintStagedConfig = { // run formatting and linting on all supported file types - "*.{js,json,md,ts,yaml,yml}": "npm run format:write", - "*.{js,ts}": ["npm run lint:fix"], + "*.{js,json,md,ts,yaml,yml}": "npm run format:check", + "*.{js,ts}": ["npm run lint"], }; export default lintStagedConfig; diff --git a/package.json b/package.json index 94de103..5574fcb 100644 --- a/package.json +++ b/package.json @@ -9,12 +9,12 @@ "format": "prettier", "format:check": "npm run format -- --check ./", "format:write": "npm run format -- --write ./", - "lint": "eslint ./", + "lint": "eslint src/**/*.ts", "lint:fix": "npm run lint -- --fix", "prepare": "husky install", "test": "jest", "test:clearcache": "jest --clearCache", - "test:coverage": "npm run test -- --coverage", + "test:coverage": "npm run test -- --coverage --passWithNoTests", "test:watch": "npm run test -- --watch", "typecheck": "tsc", "validate": "npm run format:check && npm run lint && npm run test:coverage && npm run typecheck && npm run build" From 3200fdaa723776a8d5c2e78cba40156e88f98a5c Mon Sep 17 00:00:00 2001 From: Volodymyr Zotov Date: Fri, 8 Aug 2025 19:05:25 -0500 Subject: [PATCH 8/9] Use latest commit has for op-cli-installer dependency --- dist/index.js | 17 +++++++++-------- package-lock.json | 6 +++--- package.json | 2 +- tsconfig.json | 2 -- 4 files changed, 13 insertions(+), 14 deletions(-) diff --git a/dist/index.js b/dist/index.js index 549a400..b373fd4 100644 --- a/dist/index.js +++ b/dist/index.js @@ -32645,6 +32645,8 @@ exports.cliUrlBuilder = { win32: (version, arch) => `https://cache.agilebits.com/dist/1P/op2/pkg/${version}/op_windows_${arch}_${version}.zip`, }; class CliInstaller { + version; + arch; constructor(version) { this.version = version; this.arch = this.getArch(); @@ -32721,9 +32723,9 @@ Object.defineProperty(exports, "__esModule", ({ value: true })); exports.LinuxInstaller = void 0; const cli_installer_1 = __nccwpck_require__(8733); class LinuxInstaller extends cli_installer_1.CliInstaller { + platform = "linux"; // Node.js platform identifier for Linux constructor(version) { super(version); - this.platform = "linux"; // Node.js platform identifier for Linux } async installCli() { const urlBuilder = cli_installer_1.cliUrlBuilder[this.platform]; @@ -32783,9 +32785,9 @@ const tc = __importStar(__nccwpck_require__(3472)); const cli_installer_1 = __nccwpck_require__(8733); const execAsync = (0, util_1.promisify)(child_process_1.exec); class MacOsInstaller extends cli_installer_1.CliInstaller { + platform = "darwin"; // Node.js platform identifier for macOS constructor(version) { super(version); - this.platform = "darwin"; // Node.js platform identifier for macOS } async installCli() { const urlBuilder = cli_installer_1.cliUrlBuilder[this.platform]; @@ -32821,9 +32823,9 @@ Object.defineProperty(exports, "__esModule", ({ value: true })); exports.WindowsInstaller = void 0; const cli_installer_1 = __nccwpck_require__(8733); class WindowsInstaller extends cli_installer_1.CliInstaller { + platform = "win32"; // Node.js platform identifier for Windows constructor(version) { super(version); - this.platform = "win32"; // Node.js platform identifier for Windows } async installCli() { const urlBuilder = cli_installer_1.cliUrlBuilder[this.platform]; @@ -32911,13 +32913,11 @@ __webpack_unused_export__ = ({ enumerable: true, get: function () { return versi Object.defineProperty(exports, "__esModule", ({ value: true })); exports.ReleaseChannel = void 0; -/* eslint-disable @typescript-eslint/naming-convention */ var ReleaseChannel; (function (ReleaseChannel) { - ReleaseChannel["Stable"] = "latest"; - ReleaseChannel["Beta"] = "latest-beta"; + ReleaseChannel["latest"] = "latest"; + ReleaseChannel["latestBeta"] = "latest-beta"; })(ReleaseChannel || (exports.ReleaseChannel = ReleaseChannel = {})); -/* eslint-enable @typescript-eslint/naming-convention */ /***/ }), @@ -32970,7 +32970,7 @@ const getLatestVersion = async (channel) => { const json = (await res.json()); const latestStable = json?.CLI2?.release?.version; const latestBeta = json?.CLI2?.beta?.version; - const version = channel === constants_1.ReleaseChannel.Beta ? latestBeta : latestStable; + const version = channel === constants_1.ReleaseChannel.latestBeta ? latestBeta : latestStable; if (!version) { core.error(`No ${channel} versions found`); throw new Error(`No ${channel} versions found`); @@ -33073,6 +33073,7 @@ const constants_1 = __nccwpck_require__(4823); const helper_1 = __nccwpck_require__(1592); const validate_1 = __nccwpck_require__(2946); class VersionResolver { + version; constructor(version) { this.validate(version); this.version = version; diff --git a/package-lock.json b/package-lock.json index 6ae6952..869e836 100644 --- a/package-lock.json +++ b/package-lock.json @@ -10,7 +10,7 @@ "license": "MIT", "dependencies": { "@actions/core": "^1.11.1", - "op-cli-installer": "github:1Password/op-cli-installer#8ea4bf402c6385a90f6d2d98efe31ac845633412" + "op-cli-installer": "github:1Password/op-cli-installer#f3ef8d8e0651def3e5fe6234043f09b3298d2148" }, "devDependencies": { "@1password/eslint-config": "^8.1.0", @@ -6419,8 +6419,8 @@ }, "node_modules/op-cli-installer": { "version": "1.0.0", - "resolved": "git+ssh://git@github.com/1Password/op-cli-installer.git#8ea4bf402c6385a90f6d2d98efe31ac845633412", - "integrity": "sha512-HBk4wp0rOwiz4xkLTxkcYGkTZuOE+ScgIh2aSaUI35Xd692V8QbPRt2L75ZB2XzfHs2eW6j/80qDJhT9A5J92w==", + "resolved": "git+ssh://git@github.com/1Password/op-cli-installer.git#f3ef8d8e0651def3e5fe6234043f09b3298d2148", + "integrity": "sha512-k8mp0gMwYuz8uDdpUw2vQPdcRuQBUiWAAK8pJ2q90uekdYcSABVaKP6qQwrtxDcN+J1tjH32+l6+a5kX8eM/rw==", "license": "MIT", "dependencies": { "@actions/core": "^1.11.1", diff --git a/package.json b/package.json index 5574fcb..b141f0a 100644 --- a/package.json +++ b/package.json @@ -37,7 +37,7 @@ "homepage": "https://github.com/1Password/install-cli-action#readme", "dependencies": { "@actions/core": "^1.11.1", - "op-cli-installer": "github:1Password/op-cli-installer#8ea4bf402c6385a90f6d2d98efe31ac845633412" + "op-cli-installer": "github:1Password/op-cli-installer#f3ef8d8e0651def3e5fe6234043f09b3298d2148" }, "devDependencies": { "@1password/eslint-config": "^8.1.0", diff --git a/tsconfig.json b/tsconfig.json index da44961..797343c 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -1,8 +1,6 @@ { "compilerOptions": { "allowJs": false, - "allowUnreachableCode": false, - "allowUnusedLabels": false, "esModuleInterop": true, "exactOptionalPropertyTypes": true, "forceConsistentCasingInFileNames": true, From 4d5b3fc465994505e460c65af1ee5d6b253de21a Mon Sep 17 00:00:00 2001 From: Volodymyr Zotov Date: Fri, 8 Aug 2025 19:11:16 -0500 Subject: [PATCH 9/9] Fix eslint error and formatting when running pre-commit hook --- lint-staged.config.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lint-staged.config.js b/lint-staged.config.js index 0d3f9ea..24545d4 100644 --- a/lint-staged.config.js +++ b/lint-staged.config.js @@ -1,7 +1,7 @@ const lintStagedConfig = { // run formatting and linting on all supported file types - "*.{js,json,md,ts,yaml,yml}": "npm run format:check", - "*.{js,ts}": ["npm run lint"], + "*.{js,json,md,ts,yaml,yml}": "npm run format:write", + "*.{js,ts}": ["npm run lint:fix"], }; export default lintStagedConfig;