diff --git a/CHANGELOG.md b/CHANGELOG.md index 8d88569d..86470bb6 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -47,6 +47,7 @@ In previous releases, the name "Hypermode" was used for all three._ - Add `.gitignore` files to default templates [#486](https://github.com/hypermodeinc/modus/pull/486) - Fix CLI warnings about Go/TinyGo installation [#487](https://github.com/hypermodeinc/modus/pull/487) - Remove deprecated model fields [#488](https://github.com/hypermodeinc/modus/pull/488) +- Improve dev first use log messages [#489](https://github.com/hypermodeinc/modus/pull/489) ## 2024-10-02 - Version 0.12.7 diff --git a/cli/src/commands/dev/index.ts b/cli/src/commands/dev/index.ts index deb1e14e..884f7c5b 100644 --- a/cli/src/commands/dev/index.ts +++ b/cli/src/commands/dev/index.ts @@ -178,7 +178,6 @@ export default class DevCommand extends Command { // NOTE: The built-in fs.watch or fsPromises.watch is insufficient for our needs. // Instead, we use chokidar for consistent behavior in cross-platform file watching. const ignoredPaths = [path.join(appPath, "build") + path.sep, path.join(appPath, "node_modules") + path.sep]; - this.log(chalk.dim("Ignoring paths:"), ignoredPaths); chokidar .watch(appPath, { ignored: (filePath, stats) => (stats?.isFile() || true) && ignoredPaths.some((p) => path.normalize(filePath).startsWith(p)), diff --git a/runtime/db/db.go b/runtime/db/db.go index 4f0c64ff..49414b16 100644 --- a/runtime/db/db.go +++ b/runtime/db/db.go @@ -17,6 +17,7 @@ import ( "time" "github.com/hypermodeinc/modus/lib/manifest" + "github.com/hypermodeinc/modus/runtime/config" "github.com/hypermodeinc/modus/runtime/logger" "github.com/hypermodeinc/modus/runtime/metrics" "github.com/hypermodeinc/modus/runtime/plugins" @@ -243,7 +244,9 @@ func logDbWarningOrError(ctx context.Context, err error, msg string) { if _, ok := err.(*pgconn.ConnectError); ok { logger.Warn(ctx).Err(err).Msgf("Database connection error. %s", msg) } else if errors.Is(err, errDbNotConfigured) { - logger.Warn(ctx).Msgf("Database has not been configured. %s", msg) + if !config.IsDevEnvironment() { + logger.Warn(ctx).Msgf("Database has not been configured. %s", msg) + } } else { logger.Err(ctx, err).Msg(msg) } @@ -663,7 +666,7 @@ VALUES ($1, $2, $3, $4, $5, $6, $7, $8) func Initialize(ctx context.Context) { // this will initialize the pool and start the worker _, err := globalRuntimePostgresWriter.GetPool(ctx) - if err != nil { + if err != nil && !config.IsDevEnvironment() { logger.Warn(ctx).Err(err).Msg("Metadata database is not available.") } go globalRuntimePostgresWriter.worker(ctx) diff --git a/runtime/manifestdata/manifestdata.go b/runtime/manifestdata/manifestdata.go index a3dd9e6e..0a513ef8 100644 --- a/runtime/manifestdata/manifestdata.go +++ b/runtime/manifestdata/manifestdata.go @@ -38,21 +38,16 @@ func SetManifest(m *manifest.Manifest) { func MonitorManifestFile(ctx context.Context) { loadFile := func(file storage.FileInfo) error { + logger.Info(ctx).Str("filename", file.Name).Msg("Loading manifest file.") if file.Name != manifestFileName { return nil } - err := loadManifest(ctx) - if err == nil { - logger.Info(ctx). - Str("filename", file.Name). - Msg("Loaded manifest file.") - } else { - logger.Err(ctx, err). - Str("filename", file.Name). - Msg("Failed to load manifest file.") + + if err := loadManifest(ctx); err != nil { + logger.Err(ctx, err).Str("filename", file.Name).Msg("Failed to load manifest file.") } - return err + return nil } // NOTE: Removing the manifest file entirely is not currently supported.