From c59a697220dc5bfb761f0914f19ac0f43785ecc7 Mon Sep 17 00:00:00 2001 From: Vinayak Sarawagi Date: Sun, 23 Mar 2025 22:40:47 +0530 Subject: [PATCH 1/2] chore(sample-app): update @intentjs/core dependency to use workspace reference - Changed @intentjs/core dependency in sample-app's package.json to use workspace reference. - Added export for new-project command in CLI commands index.ts. --- integrations/sample-app/package.json | 2 +- packages/cli/commands/index.ts | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/integrations/sample-app/package.json b/integrations/sample-app/package.json index c278f2d..7f64155 100644 --- a/integrations/sample-app/package.json +++ b/integrations/sample-app/package.json @@ -49,7 +49,7 @@ "@aws-sdk/client-s3": "^3.689.0", "@aws-sdk/credential-providers": "^3.687.0", "@aws-sdk/s3-request-presigner": "^3.689.0", - "@intentjs/core": "*", + "@intentjs/core": "workspace:*", "bcrypt": "^5.1.1", "class-transformer": "^0.5.1", "class-validator": "^0.14.1", diff --git a/packages/cli/commands/index.ts b/packages/cli/commands/index.ts index 9c3f6d9..eb40a74 100644 --- a/packages/cli/commands/index.ts +++ b/packages/cli/commands/index.ts @@ -1,2 +1,3 @@ export * from "./start-server.js"; export * from "./build.js"; +export * from "./new-project.js"; From 9d08ffbdb627958f5aa560e58674e369d220b105 Mon Sep 17 00:00:00 2001 From: Vinayak Sarawagi Date: Tue, 25 Mar 2025 10:22:07 +0530 Subject: [PATCH 2/2] chore(cli): bump version to 0.0.19 and enhance prettier configuration handling - Updated package version to 0.0.19. - Improved prettier configuration handling by checking for the existence of the .prettierrc file before applying settings. --- packages/cli/lib/codegen/ast/inject-config.ts | 14 +++++++++----- packages/cli/package.json | 2 +- 2 files changed, 10 insertions(+), 6 deletions(-) diff --git a/packages/cli/lib/codegen/ast/inject-config.ts b/packages/cli/lib/codegen/ast/inject-config.ts index ec3ed10..b127e30 100644 --- a/packages/cli/lib/codegen/ast/inject-config.ts +++ b/packages/cli/lib/codegen/ast/inject-config.ts @@ -1,5 +1,5 @@ import { join } from "path"; -import { format, resolveConfig, resolveConfigFile } from "prettier"; +import { format, Options, resolveConfig, resolveConfigFile } from "prettier"; import { Project, SourceFile, @@ -7,6 +7,7 @@ import { ObjectLiteralExpression, Node, } from "ts-morph"; +import { pathExists } from "fs-extra/esm"; export class InjectConfig { private project: Project; @@ -146,13 +147,16 @@ export class InjectConfig { const updatedText = objects.getText().replace(/,\s*,/g, ","); objects.replaceWithText(updatedText); - const prettierConfig = await resolveConfig(this.projectRoot, { - config: join(this.projectRoot, ".prettierrc"), - }); + let prettierConfig = null; + if (await pathExists(join(this.projectRoot, ".prettierrc"))) { + prettierConfig = await resolveConfig(this.projectRoot, { + config: join(this.projectRoot, ".prettierrc"), + }); + } const formatted = await format(this.sourceFile.getFullText(), { parser: "typescript", - ...prettierConfig, + ...(prettierConfig || {}), }); this.sourceFile.replaceWithText(formatted); diff --git a/packages/cli/package.json b/packages/cli/package.json index 4e36b8b..ce8ebeb 100644 --- a/packages/cli/package.json +++ b/packages/cli/package.json @@ -1,6 +1,6 @@ { "name": "@intentjs/cli", - "version": "0.0.18", + "version": "0.0.19", "description": "Helper commands for building Intent application.", "repository": { "type": "git",