forked from dubinc/dub
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
19 changed files
with
15,702 additions
and
11,109 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
node_modules | ||
dist | ||
.env |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,67 @@ | ||
{ | ||
"name": "dub-cli", | ||
"version": "0.0.1", | ||
"description": "A CLI for easily shortening URLs.", | ||
"publishConfig": { | ||
"access": "public" | ||
}, | ||
"type": "module", | ||
"types": "./dist/index.d.ts", | ||
"exports": "./dist/index.js", | ||
"main": "./dist/index.js", | ||
"bin": { | ||
"dub": "./dist/index.js" | ||
}, | ||
"preferGlobal": true, | ||
"author": "Steven Tey <[email protected]>", | ||
"homepage": "https://dub.co", | ||
"repository": { | ||
"type": "git", | ||
"url": "git+https://github.com/steven-tey/dub.git" | ||
}, | ||
"bugs": { | ||
"url": "https://github.com/steven-tey/dub/issues" | ||
}, | ||
"keywords": [ | ||
"dub", | ||
"dub.co", | ||
"dub cli", | ||
"cli" | ||
], | ||
"license": "MIT", | ||
"files": [ | ||
"dist" | ||
], | ||
"scripts": { | ||
"dev": "tsup --watch", | ||
"build": "tsup", | ||
"typecheck": "tsc --noEmit", | ||
"clean": "rimraf dist", | ||
"start": "node dist/index.js ", | ||
"pub:release": "pnpm build && pnpm publish --access public" | ||
}, | ||
"dependencies": { | ||
"chalk": "^5.3.0", | ||
"commander": "^11.1.0", | ||
"configstore": "^6.0.0", | ||
"fs-extra": "^11.2.0", | ||
"json-colorizer": "^2.2.2", | ||
"nanoid": "^5.0.7", | ||
"node-fetch": "^3.3.2", | ||
"ora": "^7.0.1", | ||
"package-json": "^8.1.1", | ||
"prompts": "^2.4.2", | ||
"zod": "^3.23.8" | ||
}, | ||
"devDependencies": { | ||
"@types/configstore": "^6.0.2", | ||
"@types/fs-extra": "^11.0.4", | ||
"@types/node": "18.11.9", | ||
"@types/prompts": "^2.4.9", | ||
"rimraf": "^5.0.10", | ||
"ts-node": "^10.9.2", | ||
"tsup": "^6.7.0", | ||
"type-fest": "^4.26.1", | ||
"typescript": "^5.6.2" | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
import { getConfig } from "@/utils/get-config" | ||
import { handleError } from "@/utils/handle-error" | ||
import { logger } from "@/utils/logger" | ||
import { Command } from "commander" | ||
import colorizeJson from "json-colorizer" | ||
import ora from "ora" | ||
|
||
export const config = new Command() | ||
.name("config") | ||
.description("see your configured workspace credentails") | ||
.action(async () => { | ||
const spinner = ora("Getting config file").start() | ||
|
||
try { | ||
const configInfo = await getConfig() | ||
|
||
spinner.succeed("Configuration file successfully retrieved") | ||
|
||
logger.info("") | ||
console.log( | ||
colorizeJson(JSON.stringify(configInfo, null, 2), { | ||
colors: { | ||
STRING_KEY: "white", | ||
STRING_LITERAL: "#65B741", | ||
NUMBER_LITERAL: "#7E30E1" | ||
} | ||
}) | ||
) | ||
logger.info("") | ||
} catch (error) { | ||
spinner.stop() | ||
handleError(error) | ||
} | ||
}) |
Oops, something went wrong.