diff --git a/packages/gh-bin/package.json b/packages/gh-bin/package.json index b41d0d28..2585bf8c 100644 --- a/packages/gh-bin/package.json +++ b/packages/gh-bin/package.json @@ -21,7 +21,8 @@ }, "dependencies": { "@clack/prompts": "^0.9.1", - "adm-zip": "^0.5.16" + "adm-zip": "^0.5.16", + "nanotar": "^0.1.1" }, "devDependencies": { "@types/adm-zip": "^0.5.7" diff --git a/packages/gh-bin/src/cli.ts b/packages/gh-bin/src/cli.ts index 4722249c..73942a10 100644 --- a/packages/gh-bin/src/cli.ts +++ b/packages/gh-bin/src/cli.ts @@ -3,8 +3,6 @@ import os from "node:os"; import path from "node:path"; import process from "node:process"; import { Readable } from "node:stream"; -import * as prompts from "@clack/prompts"; -import AdmZip from "adm-zip"; import { name, version } from "../package.json"; const HELP = `\ @@ -27,6 +25,8 @@ async function main() { return; } + const prompts = await import("@clack/prompts"); + // parse github url const input = args[0]; const match = input.replace(/\/+$/, "").match(GITHUB_RELEASE_RE); @@ -93,6 +93,7 @@ async function main() { // if .zip or .tar.gz, unpack and prompt again which file to use if (selectedAsset.endsWith(".zip")) { + const { default: AdmZip } = await import("adm-zip"); var zip = new AdmZip(tmpAssetPath); var zipEntries = zip.getEntries(); const selectedEntry = await prompts.select({ diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 6039d2f3..84dc0f37 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -79,6 +79,9 @@ importers: adm-zip: specifier: ^0.5.16 version: 0.5.16 + nanotar: + specifier: ^0.1.1 + version: 0.1.1 devDependencies: '@types/adm-zip': specifier: ^0.5.7 @@ -2845,6 +2848,9 @@ packages: engines: {node: ^10 || ^12 || ^13.7 || ^14 || >=15.0.1} hasBin: true + nanotar@0.1.1: + resolution: {integrity: sha512-AiJsGsSF3O0havL1BydvI4+wR76sKT+okKRwWIaK96cZUnXqH0uNBOsHlbwZq3+m2BR1VKqHDVudl3gO4mYjpQ==} + napi-build-utils@1.0.2: resolution: {integrity: sha512-ONmRUqK7zj7DWX0D9ADe03wbwOBZxNAfF20PlGfCWQcD3+/MakShIHrMqx9YwPTfxDdF1zLeL+RGZiR9kGMLdg==} @@ -6027,6 +6033,8 @@ snapshots: nanoid@3.3.7: {} + nanotar@0.1.1: {} + napi-build-utils@1.0.2: {} negotiator@0.6.3: {}