Skip to content

Commit

Permalink
fix(cli): fix require error issue related to update-notifier import
Browse files Browse the repository at this point in the history
Closes: #392
  • Loading branch information
Romakita committed Jul 24, 2024
1 parent 4678936 commit 870b5e6
Show file tree
Hide file tree
Showing 5 changed files with 11 additions and 6 deletions.
1 change: 1 addition & 0 deletions lerna.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
{
"npmClient": "yarn",
"useWorkspaces": true,
"packages": [
"packages/*"
],
Expand Down
5 changes: 3 additions & 2 deletions packages/cli/src/commands/add/AddCmd.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,8 @@ import {
createSubTasks,
PackageManagersModule,
ProjectPackageJson,
QuestionOptions
QuestionOptions,
Task
} from "@tsed/cli-core";

export interface AddCmdOptions extends CliDefaultOptions {
Expand Down Expand Up @@ -49,7 +50,7 @@ export class AddCmd implements CommandProvider {
];
}

$exec(ctx: AddCmdOptions) {
$exec(ctx: AddCmdOptions): Task[] {
this.packageJson.addDevDependency(ctx.name, "latest");

return [
Expand Down
5 changes: 3 additions & 2 deletions packages/cli/src/commands/init/InitCmd.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,8 @@ import {
PackageManagersModule,
ProjectPackageJson,
QuestionOptions,
RootRendererService
RootRendererService,
Task
} from "@tsed/cli-core";
import {paramCase, pascalCase} from "change-case";
import {basename, join} from "path";
Expand Down Expand Up @@ -289,7 +290,7 @@ export class InitCmd implements CommandProvider {
);
}

async $exec(ctx: InitCmdContext) {
async $exec(ctx: InitCmdContext): Promise<Task[]> {
this.checkPrecondition(ctx);

const subTasks = [
Expand Down
5 changes: 3 additions & 2 deletions packages/cli/src/commands/update/UpdateCmd.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,8 @@ import {
NpmRegistryClient,
PackageManagersModule,
ProjectPackageJson,
QuestionOptions
QuestionOptions,
Task
} from "@tsed/cli-core";
import {getValue} from "@tsed/core";
import semver from "semver";
Expand Down Expand Up @@ -70,7 +71,7 @@ export class UpdateCmd implements CommandProvider {
];
}

async $exec(ctx: UpdateCmdContext) {
async $exec(ctx: UpdateCmdContext): Promise<Task[]> {
Object.keys(this.projectPackage.dependencies).forEach((pkg: string) => {
if (shouldUpdate(pkg)) {
this.projectPackage.addDependency(pkg, ctx.version);
Expand Down
1 change: 1 addition & 0 deletions packages/cli/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
"compilerOptions": {
"baseUrl": ".",
"module": "commonjs",
"moduleResolution": "Node16",
"rootDir": "src",
"outDir": "./lib/cjs",
"declaration": true,
Expand Down

0 comments on commit 870b5e6

Please sign in to comment.