From 2663893792cca199e21755ca7f0f8236ec98ad0a Mon Sep 17 00:00:00 2001 From: Christian Kaisermann Date: Thu, 5 Nov 2020 17:51:26 -0300 Subject: [PATCH] =?UTF-8?q?refactor:=20=F0=9F=92=A1=20replace=20commander?= =?UTF-8?q?=20with=20sade?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- package.json | 4 ++-- src/cli/index.ts | 6 ++++-- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/package.json b/package.json index fae8276..2e2906a 100644 --- a/package.json +++ b/package.json @@ -32,7 +32,6 @@ "lint": "eslint \"{src,test}/**/*.ts\"", "format": "prettier --loglevel silent --write \"{src,test}/**/*.ts\"", "release": " git add package.json && git commit -m \"chore(release): v$npm_package_version :tada:\"", - "pretest": "npm run build", "prebuild": "yarn clean", "postbuild": "yarn build:types", "version": "conventional-changelog -p angular -i CHANGELOG.md -s -r 1 && git add CHANGELOG.md", @@ -80,6 +79,7 @@ "@types/estree": "0.0.45", "@types/intl": "^1.2.0", "@types/jest": "^26.0.14", + "@types/sade": "^1.7.2", "babel-core": "^7.0.0-bridge.0", "babel-jest": "^26.3.0", "conventional-changelog-cli": "^2.1.0", @@ -100,11 +100,11 @@ "typescript": "^4.0.3" }, "dependencies": { - "commander": "^4.0.1", "deepmerge": "^4.2.2", "dlv": "^1.1.3", "estree-walker": "^0.9.0", "intl-messageformat": "^7.5.2", + "sade": "^1.7.4", "tiny-glob": "^0.2.6" } } diff --git a/src/cli/index.ts b/src/cli/index.ts index 5fde401..018e287 100644 --- a/src/cli/index.ts +++ b/src/cli/index.ts @@ -1,7 +1,7 @@ import fs from 'fs'; import { dirname, resolve } from 'path'; -import program from 'commander'; +import sade from 'sade'; import glob from 'tiny-glob'; import { preprocess } from 'svelte/compiler'; @@ -14,9 +14,11 @@ const fileExists = (path: string) => .then(() => true) .catch(() => false); +const program = sade('svelte-i18n'); + program .command('extract [output]') - .description('extract all message definitions from files to a json') + .describe('extract all message definitions from files to a json') .option( '-s, --shallow', 'extract to a shallow dictionary (ids with dots interpreted as strings, not paths)',