-
-
Notifications
You must be signed in to change notification settings - Fork 58
Open
Description
$ npx @nestjs/cli@latest add nestjs-prisma --addPrismaService
✔ Package installation in progress... ☕
Starting library setup...
/home/__SNIP__/node_modules/.pnpm/@[email protected][email protected]/node_modules/@angular-devkit/schematics-cli/bin/schematics.js:397
throw new Error(`Unknown argument ${key}. Did you mean ${(0, yargs_parser_1.decamelize)(key)}?`);
^
Error: Unknown argument addPrismaService. Did you mean add-prisma-service?The below command works as expected:
$ npx @nestjs/cli@latest add nestjs-prisma --add-prisma-serviceHere's the code snippet from the line indicated above (where it throws on any capital letters):
function parseArgs(args) {
const { _, ...options } = (0, yargs_parser_1.default)(args, {
boolean: booleanArgs,
default: {
'interactive': true,
'debug': null,
'dry-run': null,
},
configuration: {
'dot-notation': false,
'boolean-negation': true,
'strip-aliased': true,
'camel-case-expansion': false,
},
});
// Camelize options as yargs will return the object in kebab-case when camel casing is disabled.
const schematicOptions = {};
const cliOptions = {};
const isCliOptions = (key) => booleanArgs.includes(key);
for (const [key, value] of Object.entries(options)) {
if (/[A-Z]/.test(key)) {
throw new Error(`Unknown argument ${key}. Did you mean ${(0, yargs_parser_1.decamelize)(key)}?`);
}
if (isCliOptions(key)) {
cliOptions[key] = value;
}
else {
schematicOptions[(0, yargs_parser_1.camelCase)(key)] = value;
}
}
return {
_: _.map((v) => v.toString()),
schematicOptions,
cliOptions,
};
}Metadata
Metadata
Assignees
Labels
No labels