Skip to content

Commit

Permalink
chore: dynamic import deps
Browse files Browse the repository at this point in the history
  • Loading branch information
hi-ogawa committed Jan 18, 2025
1 parent 391b995 commit ce103cb
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 3 deletions.
3 changes: 2 additions & 1 deletion packages/gh-bin/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
5 changes: 3 additions & 2 deletions packages/gh-bin/src/cli.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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 = `\
Expand All @@ -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);
Expand Down Expand Up @@ -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({
Expand Down
8 changes: 8 additions & 0 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit ce103cb

Please sign in to comment.