@clerc/core
Advanced tools
Comparing version 0.11.1 to 0.12.0
@@ -317,2 +317,11 @@ import * as _clerc_utils from '@clerc/utils'; | ||
} | ||
declare class NameNotSetError extends Error { | ||
constructor(); | ||
} | ||
declare class DescriptionNotSetError extends Error { | ||
constructor(); | ||
} | ||
declare class VersionNotSetError extends Error { | ||
constructor(); | ||
} | ||
@@ -335,2 +344,2 @@ declare function resolveFlattenCommands(commands: CommandRecord): Map<string[], CommandAlias<string, CommandOptions<string[], _clerc_utils.MaybeArray<string>, _clerc_utils.Dict<FlagOptions>>>>; | ||
export { Clerc, Command, CommandAlias, CommandCustomProperties, CommandExistsError, CommandNameConflictError, CommandOptions, CommandRecord, CommandWithHandler, CommonCommandExistsError, FallbackType, Flag, FlagOptions, Handler, HandlerContext, HandlerInCommand, Inspector, InspectorContext, InspectorFn, InspectorObject, MakeEventMap, MultipleCommandsMatchedError, NoSuchCommandError, ParentCommandExistsError, Plugin, PossibleInputKind, SingleCommand, SingleCommandAliasError, SingleCommandError, SingleCommandType, SubcommandExistsError, compose, defineCommand, defineHandler, defineInspector, definePlugin, mapParametersToArguments, parseParameters, resolveArgv, resolveCommand, resolveFlattenCommands, resolveParametersBeforeFlag, resolveRootCommands, resolveSubcommandsByParent }; | ||
export { Clerc, Command, CommandAlias, CommandCustomProperties, CommandExistsError, CommandNameConflictError, CommandOptions, CommandRecord, CommandWithHandler, CommonCommandExistsError, DescriptionNotSetError, FallbackType, Flag, FlagOptions, Handler, HandlerContext, HandlerInCommand, Inspector, InspectorContext, InspectorFn, InspectorObject, MakeEventMap, MultipleCommandsMatchedError, NameNotSetError, NoSuchCommandError, ParentCommandExistsError, Plugin, PossibleInputKind, SingleCommand, SingleCommandAliasError, SingleCommandError, SingleCommandType, SubcommandExistsError, VersionNotSetError, compose, defineCommand, defineHandler, defineInspector, definePlugin, mapParametersToArguments, parseParameters, resolveArgv, resolveCommand, resolveFlattenCommands, resolveParametersBeforeFlag, resolveRootCommands, resolveSubcommandsByParent }; |
@@ -51,2 +51,17 @@ import { LiteEmit } from 'lite-emit'; | ||
} | ||
class NameNotSetError extends Error { | ||
constructor() { | ||
super("Name not set."); | ||
} | ||
} | ||
class DescriptionNotSetError extends Error { | ||
constructor() { | ||
super("Description not set."); | ||
} | ||
} | ||
class VersionNotSetError extends Error { | ||
constructor() { | ||
super("Version not set."); | ||
} | ||
} | ||
@@ -299,2 +314,11 @@ function resolveFlattenCommands(commands) { | ||
parse(argv = resolveArgv()) { | ||
if (!__privateGet(this, _name)) { | ||
throw new NameNotSetError(); | ||
} | ||
if (!__privateGet(this, _description)) { | ||
throw new DescriptionNotSetError(); | ||
} | ||
if (!__privateGet(this, _version)) { | ||
throw new VersionNotSetError(); | ||
} | ||
const name = resolveParametersBeforeFlag(argv, __privateGet(this, _isSingleCommand, isSingleCommand_get)); | ||
@@ -385,2 +409,2 @@ const stringName = name.join(" "); | ||
export { Clerc, CommandExistsError, CommandNameConflictError, CommonCommandExistsError, MultipleCommandsMatchedError, NoSuchCommandError, ParentCommandExistsError, SingleCommand, SingleCommandAliasError, SingleCommandError, SubcommandExistsError, compose, defineCommand, defineHandler, defineInspector, definePlugin, mapParametersToArguments, parseParameters, resolveArgv, resolveCommand, resolveFlattenCommands, resolveParametersBeforeFlag, resolveRootCommands, resolveSubcommandsByParent }; | ||
export { Clerc, CommandExistsError, CommandNameConflictError, CommonCommandExistsError, DescriptionNotSetError, MultipleCommandsMatchedError, NameNotSetError, NoSuchCommandError, ParentCommandExistsError, SingleCommand, SingleCommandAliasError, SingleCommandError, SubcommandExistsError, VersionNotSetError, compose, defineCommand, defineHandler, defineInspector, definePlugin, mapParametersToArguments, parseParameters, resolveArgv, resolveCommand, resolveFlattenCommands, resolveParametersBeforeFlag, resolveRootCommands, resolveSubcommandsByParent }; |
{ | ||
"name": "@clerc/core", | ||
"version": "0.11.1", | ||
"version": "0.12.0", | ||
"author": "Ray <nn_201312@163.com> (https://github.com/so1ve)", | ||
@@ -50,6 +50,6 @@ "description": "Clerc core", | ||
"dependencies": { | ||
"@clerc/utils": "0.12.0", | ||
"is-platform": "^0.2.0", | ||
"lite-emit": "^1.4.0", | ||
"type-flag": "^3.0.0", | ||
"@clerc/utils": "0.11.1" | ||
"type-flag": "^3.0.0" | ||
}, | ||
@@ -56,0 +56,0 @@ "scripts": { |
Sorry, the diff of this file is not supported yet
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
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
44777
1142
+ Added@clerc/utils@0.12.0(transitive)
- Removed@clerc/utils@0.11.1(transitive)
Updated@clerc/utils@0.12.0