@fig/complete-commander
Advanced tools
Comparing version 2.0.1 to 3.0.0
@@ -5,3 +5,3 @@ import { Command } from "commander"; | ||
} | ||
export declare function generateCompletionSpec(command: Command, options?: Options): string | undefined; | ||
export declare function generateCompletionSpec(command: Command, options?: Options): Promise<string | undefined>; | ||
export declare function addCompletionSpecCommand(command: Command): void; |
"use strict"; | ||
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) { | ||
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); } | ||
return new (P || (P = Promise))(function (resolve, reject) { | ||
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } } | ||
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } } | ||
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); } | ||
step((generator = generator.apply(thisArg, _arguments || [])).next()); | ||
}); | ||
}; | ||
var __importDefault = (this && this.__importDefault) || function (mod) { | ||
@@ -17,3 +26,4 @@ return (mod && mod.__esModule) ? mod : { "default": mod }; | ||
function getTemplate(spec) { | ||
return prettier_1.default.format(` | ||
return __awaiter(this, void 0, void 0, function* () { | ||
return prettier_1.default.format(` | ||
// Autogenerated by @fig/complete-commander | ||
@@ -25,2 +35,3 @@ | ||
`, { parser: "typescript" }); | ||
}); | ||
} | ||
@@ -128,7 +139,9 @@ function generateArg(_arg) { | ||
function generateCompletionSpec(command, options) { | ||
const figSpecCommandName = (options === null || options === void 0 ? void 0 : options.figSpecCommandName) || DEFAULT_FIG_SUBCOMMAND_NAME; | ||
// The first subcommand will never have the name of the `figSpecCommandName` | ||
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion | ||
const spec = getTemplate(generateCommand(command, figSpecCommandName)); | ||
return spec; | ||
return __awaiter(this, void 0, void 0, function* () { | ||
const figSpecCommandName = (options === null || options === void 0 ? void 0 : options.figSpecCommandName) || DEFAULT_FIG_SUBCOMMAND_NAME; | ||
// The first subcommand will never have the name of the `figSpecCommandName` | ||
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion | ||
const spec = getTemplate(generateCommand(command, figSpecCommandName)); | ||
return spec; | ||
}); | ||
} | ||
@@ -140,7 +153,7 @@ exports.generateCompletionSpec = generateCompletionSpec; | ||
.description("Print the Fig completion spec") | ||
.action(() => { | ||
const spec = generateCompletionSpec(command); | ||
.action(() => __awaiter(this, void 0, void 0, function* () { | ||
const spec = yield generateCompletionSpec(command); | ||
console.log(spec); | ||
}); | ||
})); | ||
} | ||
exports.addCompletionSpecCommand = addCompletionSpecCommand; |
{ | ||
"name": "@fig/complete-commander", | ||
"version": "2.0.1", | ||
"version": "3.0.0", | ||
"description": "Export commander command as a Fig spec", | ||
"main": "lib/index.js", | ||
"scripts": { | ||
"build": "tsc", | ||
"test": "ts-node test/index.ts", | ||
"test:overwrite": "OVERWRITE=true yarn test", | ||
"clean:test": "git clean -Xf test", | ||
"prepack": "yarn build" | ||
}, | ||
"repository": { | ||
@@ -35,19 +28,24 @@ "type": "git", | ||
"peerDependencies": { | ||
"commander": "^8.0.0" | ||
"commander": "^11.1.0" | ||
}, | ||
"dependencies": { | ||
"prettier": "^2.3.2" | ||
"prettier": "^3.1.0" | ||
}, | ||
"devDependencies": { | ||
"@types/node": "^16.7.2", | ||
"@types/prettier": "^2.3.2", | ||
"@withfig/autocomplete-types": "^1.10.0", | ||
"chalk": "^4.1.2", | ||
"commander": "^8.1.0", | ||
"ts-node": "^10.2.1", | ||
"typescript": "^4.4.2" | ||
"@types/node": "^20.9.2", | ||
"chalk": "^5.3.0", | ||
"commander": "^11.1.0", | ||
"tsx": "^4.1.4", | ||
"typescript": "~5.2.0", | ||
"@withfig/autocomplete-types": "^1.29.0" | ||
}, | ||
"publishConfig": { | ||
"access": "public" | ||
}, | ||
"scripts": { | ||
"build": "tsc", | ||
"test": "tsx test/index.ts", | ||
"test:overwrite": "OVERWRITE=true yarn test", | ||
"clean:test": "git clean -Xf test" | ||
} | ||
} |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
New author
Supply chain riskA new npm collaborator published a version of the package for the first time. New collaborators are usually benign additions to a project, but do indicate a change to the security surface area of a package.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
11812
6
159
1
+ Addedcommander@11.1.0(transitive)
+ Addedprettier@3.4.2(transitive)
- Removedcommander@8.3.0(transitive)
- Removedprettier@2.8.8(transitive)
Updatedprettier@^3.1.0