From f4daf69074d085779dcedb42532ce8d6cdddb3db Mon Sep 17 00:00:00 2001 From: Matt Toohey Date: Wed, 2 Oct 2024 14:24:12 +1000 Subject: [PATCH] rename modulewatch as just watch --- internal/buildengine/engine.go | 16 ++++++++-------- internal/buildengine/plugin.go | 16 ++++++++-------- internal/buildengine/plugin_go.go | 8 ++++---- internal/buildengine/plugin_java.go | 4 ++-- internal/buildengine/plugin_rust.go | 4 ++-- internal/{modulewatch => watch}/discover.go | 2 +- internal/{modulewatch => watch}/discover_test.go | 2 +- internal/{modulewatch => watch}/filehash.go | 2 +- internal/{modulewatch => watch}/filehash_test.go | 2 +- .../testdata/alpha/alpha.go | 0 .../testdata/alpha/ftl.toml | 0 .../{modulewatch => watch}/testdata/alpha/go.mod | 0 .../{modulewatch => watch}/testdata/alpha/go.sum | 0 .../testdata/alpha/pkg/pkg.go | 0 .../testdata/alpha/types.ftl.go | 0 .../src/main/kotlin/ftl/alpha/Alpha.kt | 0 .../testdata/another/another.go | 0 .../testdata/another/ftl.toml | 0 .../testdata/another/go.mod | 0 .../testdata/another/go.sum | 0 .../testdata/another/types.ftl.go | 0 .../testdata/depcycle1/depcycle1.go | 0 .../testdata/depcycle1/ftl.toml | 0 .../testdata/depcycle1/go.mod | 0 .../testdata/depcycle2/depcycle2.go | 0 .../testdata/depcycle2/ftl.toml | 0 .../testdata/depcycle2/go.mod | 0 .../testdata/echokotlin/ftl.toml | 0 .../testdata/echokotlin/pom.xml | 0 .../echokotlin/src/main/kotlin/ftl/echo/Echo.kt | 0 .../testdata/external/external.go | 0 .../testdata/external/ftl.toml | 0 .../testdata/external/go.mod | 0 .../testdata/external/go.sum | 0 .../testdata/externalkotlin/ftl.toml | 0 .../testdata/externalkotlin/pom.xml | 0 .../kotlin/ftl/externalkotlin/ExternalKotlin.kt | 0 .../testdata/integer/ftl.toml | 0 .../testdata/integer/go.mod | 0 .../testdata/integer/go.sum | 0 .../testdata/integer/integer.go | 0 .../testdata/other/ftl.toml | 0 .../{modulewatch => watch}/testdata/other/go.mod | 0 .../{modulewatch => watch}/testdata/other/go.sum | 0 .../testdata/other/other.go | 0 .../testdata/other/types.ftl.go | 0 .../testdata/type_registry_main.go | 0 internal/{modulewatch => watch}/walk.go | 2 +- internal/{modulewatch => watch}/watch.go | 2 +- .../watch_integration_test.go | 2 +- 50 files changed, 31 insertions(+), 31 deletions(-) rename internal/{modulewatch => watch}/discover.go (98%) rename internal/{modulewatch => watch}/discover_test.go (99%) rename internal/{modulewatch => watch}/filehash.go (99%) rename internal/{modulewatch => watch}/filehash_test.go (98%) rename internal/{modulewatch => watch}/testdata/alpha/alpha.go (100%) rename internal/{modulewatch => watch}/testdata/alpha/ftl.toml (100%) rename internal/{modulewatch => watch}/testdata/alpha/go.mod (100%) rename internal/{modulewatch => watch}/testdata/alpha/go.sum (100%) rename internal/{modulewatch => watch}/testdata/alpha/pkg/pkg.go (100%) rename internal/{modulewatch => watch}/testdata/alpha/types.ftl.go (100%) rename internal/{modulewatch => watch}/testdata/alphakotlin/src/main/kotlin/ftl/alpha/Alpha.kt (100%) rename internal/{modulewatch => watch}/testdata/another/another.go (100%) rename internal/{modulewatch => watch}/testdata/another/ftl.toml (100%) rename internal/{modulewatch => watch}/testdata/another/go.mod (100%) rename internal/{modulewatch => watch}/testdata/another/go.sum (100%) rename internal/{modulewatch => watch}/testdata/another/types.ftl.go (100%) rename internal/{modulewatch => watch}/testdata/depcycle1/depcycle1.go (100%) rename internal/{modulewatch => watch}/testdata/depcycle1/ftl.toml (100%) rename internal/{modulewatch => watch}/testdata/depcycle1/go.mod (100%) rename internal/{modulewatch => watch}/testdata/depcycle2/depcycle2.go (100%) rename internal/{modulewatch => watch}/testdata/depcycle2/ftl.toml (100%) rename internal/{modulewatch => watch}/testdata/depcycle2/go.mod (100%) rename internal/{modulewatch => watch}/testdata/echokotlin/ftl.toml (100%) rename internal/{modulewatch => watch}/testdata/echokotlin/pom.xml (100%) rename internal/{modulewatch => watch}/testdata/echokotlin/src/main/kotlin/ftl/echo/Echo.kt (100%) rename internal/{modulewatch => watch}/testdata/external/external.go (100%) rename internal/{modulewatch => watch}/testdata/external/ftl.toml (100%) rename internal/{modulewatch => watch}/testdata/external/go.mod (100%) rename internal/{modulewatch => watch}/testdata/external/go.sum (100%) rename internal/{modulewatch => watch}/testdata/externalkotlin/ftl.toml (100%) rename internal/{modulewatch => watch}/testdata/externalkotlin/pom.xml (100%) rename internal/{modulewatch => watch}/testdata/externalkotlin/src/main/kotlin/ftl/externalkotlin/ExternalKotlin.kt (100%) rename internal/{modulewatch => watch}/testdata/integer/ftl.toml (100%) rename internal/{modulewatch => watch}/testdata/integer/go.mod (100%) rename internal/{modulewatch => watch}/testdata/integer/go.sum (100%) rename internal/{modulewatch => watch}/testdata/integer/integer.go (100%) rename internal/{modulewatch => watch}/testdata/other/ftl.toml (100%) rename internal/{modulewatch => watch}/testdata/other/go.mod (100%) rename internal/{modulewatch => watch}/testdata/other/go.sum (100%) rename internal/{modulewatch => watch}/testdata/other/other.go (100%) rename internal/{modulewatch => watch}/testdata/other/types.ftl.go (100%) rename internal/{modulewatch => watch}/testdata/type_registry_main.go (100%) rename internal/{modulewatch => watch}/walk.go (99%) rename internal/{modulewatch => watch}/watch.go (99%) rename internal/{modulewatch => watch}/watch_integration_test.go (99%) diff --git a/internal/buildengine/engine.go b/internal/buildengine/engine.go index 31fba40013..9461ae8892 100644 --- a/internal/buildengine/engine.go +++ b/internal/buildengine/engine.go @@ -21,11 +21,11 @@ import ( ftlv1 "github.com/TBD54566975/ftl/backend/protos/xyz/block/ftl/v1" "github.com/TBD54566975/ftl/internal/log" "github.com/TBD54566975/ftl/internal/moduleconfig" - "github.com/TBD54566975/ftl/internal/modulewatch" "github.com/TBD54566975/ftl/internal/rpc" "github.com/TBD54566975/ftl/internal/schema" "github.com/TBD54566975/ftl/internal/slices" "github.com/TBD54566975/ftl/internal/terminal" + "github.com/TBD54566975/ftl/internal/watch" ) type CompilerBuildError struct { @@ -95,7 +95,7 @@ type Engine struct { moduleMetas *xsync.MapOf[string, moduleMeta] projectRoot string moduleDirs []string - watcher *modulewatch.Watcher // only watches for module toml changes + watcher *watch.Watcher // only watches for module toml changes controllerSchema *xsync.MapOf[string, *schema.Module] schemaChanges *pubsub.Topic[schemaChange] pluginEvents chan PluginEvent @@ -157,7 +157,7 @@ func New(ctx context.Context, client DeployClient, projectRoot string, moduleDir projectRoot: projectRoot, moduleDirs: moduleDirs, moduleMetas: xsync.NewMapOf[string, moduleMeta](), - watcher: modulewatch.NewWatcher("ftl.toml"), + watcher: watch.NewWatcher("ftl.toml"), controllerSchema: xsync.NewMapOf[string, *schema.Module](), schemaChanges: pubsub.New[schemaChange](), pluginEvents: make(chan PluginEvent, 128), @@ -178,7 +178,7 @@ func New(ctx context.Context, client DeployClient, projectRoot string, moduleDir go e.listenForBuildUpdates(ctx) - configs, err := modulewatch.DiscoverModules(ctx, moduleDirs) + configs, err := watch.DiscoverModules(ctx, moduleDirs) if err != nil { return nil, fmt.Errorf("could not find modules: %w", err) } @@ -399,7 +399,7 @@ func (e *Engine) watchForModuleChanges(ctx context.Context, period time.Duration e.schemaChanges.Unsubscribe(schemaChanges) }() - watchEvents := make(chan modulewatch.WatchEvent, 128) + watchEvents := make(chan watch.WatchEvent, 128) ctx, cancel := context.WithCancel(ctx) topic, err := e.watcher.Watch(ctx, period, e.moduleDirs) if err != nil { @@ -460,7 +460,7 @@ func (e *Engine) watchForModuleChanges(ctx context.Context, period time.Duration didUpdateDeployments = false case event := <-watchEvents: switch event := event.(type) { - case modulewatch.WatchEventModuleAdded: + case watch.WatchEventModuleAdded: config := event.Config if _, exists := e.moduleMetas.Load(config.Module); !exists { meta, err := e.newModuleMeta(ctx, config, e.projectRoot) @@ -479,7 +479,7 @@ func (e *Engine) watchForModuleChanges(ctx context.Context, period time.Duration didUpdateDeployments = true } } - case modulewatch.WatchEventModuleRemoved: + case watch.WatchEventModuleRemoved: err := terminateModuleDeployment(ctx, e.client, event.Config.Module) terminal.UpdateModuleState(ctx, event.Config.Module, terminal.BuildStateTerminated) @@ -500,7 +500,7 @@ func (e *Engine) watchForModuleChanges(ctx context.Context, period time.Duration } } e.moduleMetas.Delete(event.Config.Module) - case modulewatch.WatchEventModuleChanged: + case watch.WatchEventModuleChanged: // ftl.toml file has changed meta, ok := e.moduleMetas.Load(event.Config.Module) if !ok { diff --git a/internal/buildengine/plugin.go b/internal/buildengine/plugin.go index ad3eb1bf40..725f79c339 100644 --- a/internal/buildengine/plugin.go +++ b/internal/buildengine/plugin.go @@ -17,9 +17,9 @@ import ( "github.com/TBD54566975/ftl/internal/errors" "github.com/TBD54566975/ftl/internal/flock" "github.com/TBD54566975/ftl/internal/moduleconfig" - "github.com/TBD54566975/ftl/internal/modulewatch" "github.com/TBD54566975/ftl/internal/projectconfig" "github.com/TBD54566975/ftl/internal/schema" + "github.com/TBD54566975/ftl/internal/watch" ) const BuildLockTimeout = time.Minute @@ -120,7 +120,7 @@ type getDependenciesCommand struct { func (getDependenciesCommand) pluginCmd() {} -type buildFunc = func(ctx context.Context, projectRoot string, config moduleconfig.AbsModuleConfig, sch *schema.Schema, buildEnv []string, devMode bool, transaction modulewatch.ModifyFilesTransaction) error +type buildFunc = func(ctx context.Context, projectRoot string, config moduleconfig.AbsModuleConfig, sch *schema.Schema, buildEnv []string, devMode bool, transaction watch.ModifyFilesTransaction) error // internalPlugin is used by languages that have not been split off into their own external plugins yet. // It has standard behaviours around building and watching files. @@ -206,8 +206,8 @@ func (p *internalPlugin) getDependencies(ctx context.Context, d dependenciesFunc } func (p *internalPlugin) run(ctx context.Context) { - watcher := modulewatch.NewWatcher(p.config.Watch...) - watchChan := make(chan modulewatch.WatchEvent, 128) + watcher := watch.NewWatcher(p.config.Watch...) + watchChan := make(chan watch.WatchEvent, 128) // State // This is updated when given explicit build commands and used for automatic rebuilds @@ -257,7 +257,7 @@ func (p *internalPlugin) run(ctx context.Context) { } case event := <-watchChan: switch event.(type) { - case modulewatch.WatchEventModuleChanged: + case watch.WatchEventModuleChanged: // automatic rebuild p.updates.Publish(AutoRebuildStartedEvent{Module: p.config.Module}) @@ -273,10 +273,10 @@ func (p *internalPlugin) run(ctx context.Context) { Module: p.config.Module, Result: either.LeftOf[error](result), }) - case modulewatch.WatchEventModuleAdded: + case watch.WatchEventModuleAdded: // ignore - case modulewatch.WatchEventModuleRemoved: + case watch.WatchEventModuleRemoved: // ignore } @@ -286,7 +286,7 @@ func (p *internalPlugin) run(ctx context.Context) { } } -func buildAndLoadResult(ctx context.Context, projectRoot string, c moduleconfig.ModuleConfig, sch *schema.Schema, buildEnv []string, devMode bool, watcher *modulewatch.Watcher, build buildFunc) (BuildResult, error) { +func buildAndLoadResult(ctx context.Context, projectRoot string, c moduleconfig.ModuleConfig, sch *schema.Schema, buildEnv []string, devMode bool, watcher *watch.Watcher, build buildFunc) (BuildResult, error) { config := c.Abs() release, err := flock.Acquire(ctx, filepath.Join(config.Dir, ".ftl.lock"), BuildLockTimeout) if err != nil { diff --git a/internal/buildengine/plugin_go.go b/internal/buildengine/plugin_go.go index 93ef2b4066..1383a7b177 100644 --- a/internal/buildengine/plugin_go.go +++ b/internal/buildengine/plugin_go.go @@ -22,9 +22,9 @@ import ( "github.com/TBD54566975/ftl/internal/exec" "github.com/TBD54566975/ftl/internal/log" "github.com/TBD54566975/ftl/internal/moduleconfig" - "github.com/TBD54566975/ftl/internal/modulewatch" "github.com/TBD54566975/ftl/internal/projectconfig" "github.com/TBD54566975/ftl/internal/schema" + "github.com/TBD54566975/ftl/internal/watch" ) type goPlugin struct { @@ -105,12 +105,12 @@ func (p *goPlugin) GetDependencies(ctx context.Context) ([]string, error) { return p.internalPlugin.getDependencies(ctx, func() ([]string, error) { dependencies := map[string]bool{} fset := token.NewFileSet() - err := modulewatch.WalkDir(p.config.Abs().Dir, func(path string, d fs.DirEntry) error { + err := watch.WalkDir(p.config.Abs().Dir, func(path string, d fs.DirEntry) error { if !d.IsDir() { return nil } if strings.HasPrefix(d.Name(), "_") || d.Name() == "testdata" { - return modulewatch.ErrSkip + return watch.ErrSkip } pkgs, err := parser.ParseDir(fset, path, nil, parser.ImportsOnly) if pkgs == nil { @@ -145,7 +145,7 @@ func (p *goPlugin) GetDependencies(ctx context.Context) ([]string, error) { }) } -func buildGo(ctx context.Context, projectRoot string, config moduleconfig.AbsModuleConfig, sch *schema.Schema, buildEnv []string, devMode bool, transaction modulewatch.ModifyFilesTransaction) error { +func buildGo(ctx context.Context, projectRoot string, config moduleconfig.AbsModuleConfig, sch *schema.Schema, buildEnv []string, devMode bool, transaction watch.ModifyFilesTransaction) error { if err := compile.Build(ctx, projectRoot, config.Dir, sch, transaction, buildEnv, devMode); err != nil { return CompilerBuildError{err: fmt.Errorf("failed to build module %q: %w", config.Module, err)} } diff --git a/internal/buildengine/plugin_java.go b/internal/buildengine/plugin_java.go index aabeba5b10..d035526d50 100644 --- a/internal/buildengine/plugin_java.go +++ b/internal/buildengine/plugin_java.go @@ -22,9 +22,9 @@ import ( "github.com/TBD54566975/ftl/internal/exec" "github.com/TBD54566975/ftl/internal/log" "github.com/TBD54566975/ftl/internal/moduleconfig" - "github.com/TBD54566975/ftl/internal/modulewatch" "github.com/TBD54566975/ftl/internal/projectconfig" "github.com/TBD54566975/ftl/internal/schema" + "github.com/TBD54566975/ftl/internal/watch" "github.com/TBD54566975/ftl/jvm-runtime/java" "github.com/TBD54566975/ftl/jvm-runtime/kotlin" ) @@ -191,7 +191,7 @@ func extractKotlinFTLImports(self, dir string) ([]string, error) { return modules, nil } -func buildJava(ctx context.Context, projectRoot string, config moduleconfig.AbsModuleConfig, sch *schema.Schema, buildEnv []string, devMode bool, transaction modulewatch.ModifyFilesTransaction) error { +func buildJava(ctx context.Context, projectRoot string, config moduleconfig.AbsModuleConfig, sch *schema.Schema, buildEnv []string, devMode bool, transaction watch.ModifyFilesTransaction) error { logger := log.FromContext(ctx) if config.Java.BuildTool == moduleconfig.JavaBuildToolMaven { if err := setPOMProperties(ctx, config.Dir); err != nil { diff --git a/internal/buildengine/plugin_rust.go b/internal/buildengine/plugin_rust.go index d7f04d0d78..d295705afd 100644 --- a/internal/buildengine/plugin_rust.go +++ b/internal/buildengine/plugin_rust.go @@ -9,9 +9,9 @@ import ( "github.com/TBD54566975/ftl/internal/exec" "github.com/TBD54566975/ftl/internal/log" "github.com/TBD54566975/ftl/internal/moduleconfig" - "github.com/TBD54566975/ftl/internal/modulewatch" "github.com/TBD54566975/ftl/internal/projectconfig" "github.com/TBD54566975/ftl/internal/schema" + "github.com/TBD54566975/ftl/internal/watch" ) type rustPlugin struct { @@ -39,7 +39,7 @@ func (p *rustPlugin) GetDependencies(ctx context.Context) ([]string, error) { return nil, fmt.Errorf("not implemented") } -func buildRust(ctx context.Context, projectRoot string, config moduleconfig.AbsModuleConfig, sch *schema.Schema, buildEnv []string, devMode bool, transaction modulewatch.ModifyFilesTransaction) error { +func buildRust(ctx context.Context, projectRoot string, config moduleconfig.AbsModuleConfig, sch *schema.Schema, buildEnv []string, devMode bool, transaction watch.ModifyFilesTransaction) error { logger := log.FromContext(ctx) logger.Debugf("Using build command '%s'", config.Build) err := exec.Command(ctx, log.Debug, config.Dir+"/_ftl", "bash", "-c", config.Build).RunBuffered(ctx) diff --git a/internal/modulewatch/discover.go b/internal/watch/discover.go similarity index 98% rename from internal/modulewatch/discover.go rename to internal/watch/discover.go index bfe6ea270e..edcdfd76bd 100644 --- a/internal/modulewatch/discover.go +++ b/internal/watch/discover.go @@ -1,4 +1,4 @@ -package modulewatch +package watch import ( "context" diff --git a/internal/modulewatch/discover_test.go b/internal/watch/discover_test.go similarity index 99% rename from internal/modulewatch/discover_test.go rename to internal/watch/discover_test.go index eb7ffdc1ee..74798acbe2 100644 --- a/internal/modulewatch/discover_test.go +++ b/internal/watch/discover_test.go @@ -1,4 +1,4 @@ -package modulewatch +package watch import ( "context" diff --git a/internal/modulewatch/filehash.go b/internal/watch/filehash.go similarity index 99% rename from internal/modulewatch/filehash.go rename to internal/watch/filehash.go index c4621f97fa..b61cb57692 100644 --- a/internal/modulewatch/filehash.go +++ b/internal/watch/filehash.go @@ -1,4 +1,4 @@ -package modulewatch +package watch import ( "bytes" diff --git a/internal/modulewatch/filehash_test.go b/internal/watch/filehash_test.go similarity index 98% rename from internal/modulewatch/filehash_test.go rename to internal/watch/filehash_test.go index a37fe8800d..1e6a3e75b4 100644 --- a/internal/modulewatch/filehash_test.go +++ b/internal/watch/filehash_test.go @@ -1,4 +1,4 @@ -package modulewatch +package watch import ( "os" diff --git a/internal/modulewatch/testdata/alpha/alpha.go b/internal/watch/testdata/alpha/alpha.go similarity index 100% rename from internal/modulewatch/testdata/alpha/alpha.go rename to internal/watch/testdata/alpha/alpha.go diff --git a/internal/modulewatch/testdata/alpha/ftl.toml b/internal/watch/testdata/alpha/ftl.toml similarity index 100% rename from internal/modulewatch/testdata/alpha/ftl.toml rename to internal/watch/testdata/alpha/ftl.toml diff --git a/internal/modulewatch/testdata/alpha/go.mod b/internal/watch/testdata/alpha/go.mod similarity index 100% rename from internal/modulewatch/testdata/alpha/go.mod rename to internal/watch/testdata/alpha/go.mod diff --git a/internal/modulewatch/testdata/alpha/go.sum b/internal/watch/testdata/alpha/go.sum similarity index 100% rename from internal/modulewatch/testdata/alpha/go.sum rename to internal/watch/testdata/alpha/go.sum diff --git a/internal/modulewatch/testdata/alpha/pkg/pkg.go b/internal/watch/testdata/alpha/pkg/pkg.go similarity index 100% rename from internal/modulewatch/testdata/alpha/pkg/pkg.go rename to internal/watch/testdata/alpha/pkg/pkg.go diff --git a/internal/modulewatch/testdata/alpha/types.ftl.go b/internal/watch/testdata/alpha/types.ftl.go similarity index 100% rename from internal/modulewatch/testdata/alpha/types.ftl.go rename to internal/watch/testdata/alpha/types.ftl.go diff --git a/internal/modulewatch/testdata/alphakotlin/src/main/kotlin/ftl/alpha/Alpha.kt b/internal/watch/testdata/alphakotlin/src/main/kotlin/ftl/alpha/Alpha.kt similarity index 100% rename from internal/modulewatch/testdata/alphakotlin/src/main/kotlin/ftl/alpha/Alpha.kt rename to internal/watch/testdata/alphakotlin/src/main/kotlin/ftl/alpha/Alpha.kt diff --git a/internal/modulewatch/testdata/another/another.go b/internal/watch/testdata/another/another.go similarity index 100% rename from internal/modulewatch/testdata/another/another.go rename to internal/watch/testdata/another/another.go diff --git a/internal/modulewatch/testdata/another/ftl.toml b/internal/watch/testdata/another/ftl.toml similarity index 100% rename from internal/modulewatch/testdata/another/ftl.toml rename to internal/watch/testdata/another/ftl.toml diff --git a/internal/modulewatch/testdata/another/go.mod b/internal/watch/testdata/another/go.mod similarity index 100% rename from internal/modulewatch/testdata/another/go.mod rename to internal/watch/testdata/another/go.mod diff --git a/internal/modulewatch/testdata/another/go.sum b/internal/watch/testdata/another/go.sum similarity index 100% rename from internal/modulewatch/testdata/another/go.sum rename to internal/watch/testdata/another/go.sum diff --git a/internal/modulewatch/testdata/another/types.ftl.go b/internal/watch/testdata/another/types.ftl.go similarity index 100% rename from internal/modulewatch/testdata/another/types.ftl.go rename to internal/watch/testdata/another/types.ftl.go diff --git a/internal/modulewatch/testdata/depcycle1/depcycle1.go b/internal/watch/testdata/depcycle1/depcycle1.go similarity index 100% rename from internal/modulewatch/testdata/depcycle1/depcycle1.go rename to internal/watch/testdata/depcycle1/depcycle1.go diff --git a/internal/modulewatch/testdata/depcycle1/ftl.toml b/internal/watch/testdata/depcycle1/ftl.toml similarity index 100% rename from internal/modulewatch/testdata/depcycle1/ftl.toml rename to internal/watch/testdata/depcycle1/ftl.toml diff --git a/internal/modulewatch/testdata/depcycle1/go.mod b/internal/watch/testdata/depcycle1/go.mod similarity index 100% rename from internal/modulewatch/testdata/depcycle1/go.mod rename to internal/watch/testdata/depcycle1/go.mod diff --git a/internal/modulewatch/testdata/depcycle2/depcycle2.go b/internal/watch/testdata/depcycle2/depcycle2.go similarity index 100% rename from internal/modulewatch/testdata/depcycle2/depcycle2.go rename to internal/watch/testdata/depcycle2/depcycle2.go diff --git a/internal/modulewatch/testdata/depcycle2/ftl.toml b/internal/watch/testdata/depcycle2/ftl.toml similarity index 100% rename from internal/modulewatch/testdata/depcycle2/ftl.toml rename to internal/watch/testdata/depcycle2/ftl.toml diff --git a/internal/modulewatch/testdata/depcycle2/go.mod b/internal/watch/testdata/depcycle2/go.mod similarity index 100% rename from internal/modulewatch/testdata/depcycle2/go.mod rename to internal/watch/testdata/depcycle2/go.mod diff --git a/internal/modulewatch/testdata/echokotlin/ftl.toml b/internal/watch/testdata/echokotlin/ftl.toml similarity index 100% rename from internal/modulewatch/testdata/echokotlin/ftl.toml rename to internal/watch/testdata/echokotlin/ftl.toml diff --git a/internal/modulewatch/testdata/echokotlin/pom.xml b/internal/watch/testdata/echokotlin/pom.xml similarity index 100% rename from internal/modulewatch/testdata/echokotlin/pom.xml rename to internal/watch/testdata/echokotlin/pom.xml diff --git a/internal/modulewatch/testdata/echokotlin/src/main/kotlin/ftl/echo/Echo.kt b/internal/watch/testdata/echokotlin/src/main/kotlin/ftl/echo/Echo.kt similarity index 100% rename from internal/modulewatch/testdata/echokotlin/src/main/kotlin/ftl/echo/Echo.kt rename to internal/watch/testdata/echokotlin/src/main/kotlin/ftl/echo/Echo.kt diff --git a/internal/modulewatch/testdata/external/external.go b/internal/watch/testdata/external/external.go similarity index 100% rename from internal/modulewatch/testdata/external/external.go rename to internal/watch/testdata/external/external.go diff --git a/internal/modulewatch/testdata/external/ftl.toml b/internal/watch/testdata/external/ftl.toml similarity index 100% rename from internal/modulewatch/testdata/external/ftl.toml rename to internal/watch/testdata/external/ftl.toml diff --git a/internal/modulewatch/testdata/external/go.mod b/internal/watch/testdata/external/go.mod similarity index 100% rename from internal/modulewatch/testdata/external/go.mod rename to internal/watch/testdata/external/go.mod diff --git a/internal/modulewatch/testdata/external/go.sum b/internal/watch/testdata/external/go.sum similarity index 100% rename from internal/modulewatch/testdata/external/go.sum rename to internal/watch/testdata/external/go.sum diff --git a/internal/modulewatch/testdata/externalkotlin/ftl.toml b/internal/watch/testdata/externalkotlin/ftl.toml similarity index 100% rename from internal/modulewatch/testdata/externalkotlin/ftl.toml rename to internal/watch/testdata/externalkotlin/ftl.toml diff --git a/internal/modulewatch/testdata/externalkotlin/pom.xml b/internal/watch/testdata/externalkotlin/pom.xml similarity index 100% rename from internal/modulewatch/testdata/externalkotlin/pom.xml rename to internal/watch/testdata/externalkotlin/pom.xml diff --git a/internal/modulewatch/testdata/externalkotlin/src/main/kotlin/ftl/externalkotlin/ExternalKotlin.kt b/internal/watch/testdata/externalkotlin/src/main/kotlin/ftl/externalkotlin/ExternalKotlin.kt similarity index 100% rename from internal/modulewatch/testdata/externalkotlin/src/main/kotlin/ftl/externalkotlin/ExternalKotlin.kt rename to internal/watch/testdata/externalkotlin/src/main/kotlin/ftl/externalkotlin/ExternalKotlin.kt diff --git a/internal/modulewatch/testdata/integer/ftl.toml b/internal/watch/testdata/integer/ftl.toml similarity index 100% rename from internal/modulewatch/testdata/integer/ftl.toml rename to internal/watch/testdata/integer/ftl.toml diff --git a/internal/modulewatch/testdata/integer/go.mod b/internal/watch/testdata/integer/go.mod similarity index 100% rename from internal/modulewatch/testdata/integer/go.mod rename to internal/watch/testdata/integer/go.mod diff --git a/internal/modulewatch/testdata/integer/go.sum b/internal/watch/testdata/integer/go.sum similarity index 100% rename from internal/modulewatch/testdata/integer/go.sum rename to internal/watch/testdata/integer/go.sum diff --git a/internal/modulewatch/testdata/integer/integer.go b/internal/watch/testdata/integer/integer.go similarity index 100% rename from internal/modulewatch/testdata/integer/integer.go rename to internal/watch/testdata/integer/integer.go diff --git a/internal/modulewatch/testdata/other/ftl.toml b/internal/watch/testdata/other/ftl.toml similarity index 100% rename from internal/modulewatch/testdata/other/ftl.toml rename to internal/watch/testdata/other/ftl.toml diff --git a/internal/modulewatch/testdata/other/go.mod b/internal/watch/testdata/other/go.mod similarity index 100% rename from internal/modulewatch/testdata/other/go.mod rename to internal/watch/testdata/other/go.mod diff --git a/internal/modulewatch/testdata/other/go.sum b/internal/watch/testdata/other/go.sum similarity index 100% rename from internal/modulewatch/testdata/other/go.sum rename to internal/watch/testdata/other/go.sum diff --git a/internal/modulewatch/testdata/other/other.go b/internal/watch/testdata/other/other.go similarity index 100% rename from internal/modulewatch/testdata/other/other.go rename to internal/watch/testdata/other/other.go diff --git a/internal/modulewatch/testdata/other/types.ftl.go b/internal/watch/testdata/other/types.ftl.go similarity index 100% rename from internal/modulewatch/testdata/other/types.ftl.go rename to internal/watch/testdata/other/types.ftl.go diff --git a/internal/modulewatch/testdata/type_registry_main.go b/internal/watch/testdata/type_registry_main.go similarity index 100% rename from internal/modulewatch/testdata/type_registry_main.go rename to internal/watch/testdata/type_registry_main.go diff --git a/internal/modulewatch/walk.go b/internal/watch/walk.go similarity index 99% rename from internal/modulewatch/walk.go rename to internal/watch/walk.go index 6218b2b029..d9973a7e1d 100644 --- a/internal/modulewatch/walk.go +++ b/internal/watch/walk.go @@ -1,4 +1,4 @@ -package modulewatch +package watch import ( "bufio" diff --git a/internal/modulewatch/watch.go b/internal/watch/watch.go similarity index 99% rename from internal/modulewatch/watch.go rename to internal/watch/watch.go index a96745ca3e..50238a39fb 100644 --- a/internal/modulewatch/watch.go +++ b/internal/watch/watch.go @@ -1,4 +1,4 @@ -package modulewatch +package watch import ( "context" diff --git a/internal/modulewatch/watch_integration_test.go b/internal/watch/watch_integration_test.go similarity index 99% rename from internal/modulewatch/watch_integration_test.go rename to internal/watch/watch_integration_test.go index 2d71043c11..80e908b21c 100644 --- a/internal/modulewatch/watch_integration_test.go +++ b/internal/watch/watch_integration_test.go @@ -1,6 +1,6 @@ //go:build integration -package modulewatch +package watch import ( "context" //nolint:depguard