Skip to content

Commit 34d1b77

Browse files
authored
chore: optimize setup function names (#1364)
1 parent c66a230 commit 34d1b77

File tree

22 files changed

+55
-55
lines changed

22 files changed

+55
-55
lines changed

auth/setup/setup.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ func main() {
2121

2222
setup.Install(
2323
// Add the auth service provider to the providers array in bootstrap/providers.go
24-
modify.AddProviderApply(modulePath, authServiceProvider),
24+
modify.RegisterProvider(modulePath, authServiceProvider),
2525

2626
// Create config/auth.go
2727
modify.File(authConfigPath).Overwrite(stubs.Config(setup.Paths().Config().Package(), setup.Paths().Facades().Import(), facadesPackage)),
@@ -35,7 +35,7 @@ func main() {
3535
modify.File(authConfigPath).Remove(),
3636

3737
// Remove the auth service provider from the providers array in bootstrap/providers.go
38-
modify.RemoveProviderApply(modulePath, authServiceProvider),
38+
modify.UnregisterProvider(modulePath, authServiceProvider),
3939
),
4040

4141
// Remove the Auth and Gate facades

cache/setup/setup.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ func main() {
1919

2020
setup.Install(
2121
// Add the cache service provider to the providers array in bootstrap/providers.go
22-
modify.AddProviderApply(moduleImport, cacheServiceProvider),
22+
modify.RegisterProvider(moduleImport, cacheServiceProvider),
2323

2424
// Create config/cache.go
2525
modify.File(cacheConfigPath).Overwrite(stubs.Config(setup.Paths().Config().Package(), setup.Paths().Facades().Import(), facadesPackage)),
@@ -31,7 +31,7 @@ func main() {
3131
modify.File(cacheConfigPath).Remove(),
3232

3333
// Remove the cache service provider from the providers array in bootstrap/providers.go
34-
modify.RemoveProviderApply(moduleImport, cacheServiceProvider),
34+
modify.UnregisterProvider(moduleImport, cacheServiceProvider),
3535

3636
// Remove the Cache facade
3737
modify.File(cacheFacadePath).Remove(),

crypt/setup/setup.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,13 +17,13 @@ func main() {
1717

1818
setup.Install(
1919
// Add the crypt service provider to the providers array in bootstrap/providers.go
20-
modify.AddProviderApply(moduleImport, cryptServiceProvider),
20+
modify.RegisterProvider(moduleImport, cryptServiceProvider),
2121

2222
// Add the Crypt facade
2323
modify.File(cryptFacadePath).Overwrite(stubs.CryptFacade(setup.Paths().Facades().Package())),
2424
).Uninstall(
2525
// Remove the crypt service provider from the providers array in bootstrap/providers.go
26-
modify.RemoveProviderApply(moduleImport, cryptServiceProvider),
26+
modify.UnregisterProvider(moduleImport, cryptServiceProvider),
2727

2828
// Remove the Crypt facade
2929
modify.File(cryptFacadePath).Remove(),

database/setup/setup.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ DB_PASSWORD=
7878
modify.GoFile(databaseConfigPath).Find(match.Config("database")).Modify(installConfigActionsFunc()...),
7979

8080
// Add the database service provider to the providers array in bootstrap/providers.go
81-
modify.AddProviderApply(moduleImport, databaseServiceProvider),
81+
modify.RegisterProvider(moduleImport, databaseServiceProvider),
8282

8383
// Register the DB, Orm, Schema and Seeder facades
8484
modify.WhenFacade(facades.DB, modify.File(dbFacadePath).Overwrite(stubs.DBFacade(facadesPackage))),
@@ -92,7 +92,7 @@ DB_PASSWORD=
9292
).Uninstall(
9393
modify.WhenNoFacades([]string{facades.DB, facades.Orm, facades.Schema, facades.Seeder},
9494
// Remove the database service provider from the providers array in bootstrap/providers.go
95-
modify.RemoveProviderApply(moduleImport, databaseServiceProvider),
95+
modify.UnregisterProvider(moduleImport, databaseServiceProvider),
9696

9797
// Remove database configuration from config/database.go
9898
modify.GoFile(databaseConfigPath).Find(match.Config("database")).Modify(uninstallConfigActionsFunc()...).Format(),

event/setup/setup.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ func main() {
1717

1818
setup.Install(
1919
// Add the event service provider to the providers array in bootstrap/providers.go
20-
modify.AddProviderApply(moduleImport, eventServiceProvider),
20+
modify.RegisterProvider(moduleImport, eventServiceProvider),
2121

2222
// Add the Event facade.
2323
modify.File(eventFacadePath).Overwrite(stubs.EventFacade(setup.Paths().Facades().Package())),
@@ -26,6 +26,6 @@ func main() {
2626
modify.File(eventFacadePath).Remove(),
2727

2828
// Remove the event service provider from the providers array in bootstrap/providers.go
29-
modify.RemoveProviderApply(moduleImport, eventServiceProvider),
29+
modify.UnregisterProvider(moduleImport, eventServiceProvider),
3030
).Execute()
3131
}

filesystem/setup/setup.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ func main() {
1919

2020
setup.Install(
2121
// Add the filesystem service provider to the providers array in bootstrap/providers.go
22-
modify.AddProviderApply(moduleImport, filesystemServiceProvider),
22+
modify.RegisterProvider(moduleImport, filesystemServiceProvider),
2323

2424
// Create config/filesystems.go
2525
modify.File(storageConfigPath).Overwrite(stubs.Config(setup.Paths().Config().Package(), setup.Paths().Facades().Import(), facadesPackage)),
@@ -31,7 +31,7 @@ func main() {
3131
modify.File(storageConfigPath).Remove(),
3232

3333
// Remove the filesystem service provider from the providers array in bootstrap/providers.go
34-
modify.RemoveProviderApply(moduleImport, filesystemServiceProvider),
34+
modify.UnregisterProvider(moduleImport, filesystemServiceProvider),
3535

3636
// Remove the Storage facade
3737
modify.File(storageFacadePath).Remove(),

grpc/setup/setup.go

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -27,14 +27,14 @@ GRPC_PORT=
2727

2828
setup.Install(
2929
// Add the grpc service provider to the providers array in bootstrap/providers.go
30-
modify.AddProviderApply(moduleImport, grpcServiceProvider),
30+
modify.RegisterProvider(moduleImport, grpcServiceProvider),
3131

3232
// Create config/grpc.go, routes/grpc.go
3333
modify.File(configPath).Overwrite(stubs.Config(setup.Paths().Config().Package(), setup.Paths().Facades().Import(), facadesPackage)),
3434
modify.File(grpcRoutePath).Overwrite(stubs.Routes(setup.Paths().Routes().Package())),
3535

3636
// Add the Grpc function to WithRouting
37-
modify.AddRouteApply(routesImport, grpcFunc),
37+
modify.RegisterRoute(routesImport, grpcFunc),
3838

3939
// Register the Grpc facade
4040
modify.File(facadePath).Overwrite(stubs.GrpcFacade(facadesPackage)),
@@ -47,13 +47,13 @@ GRPC_PORT=
4747
modify.File(facadePath).Remove(),
4848

4949
// Remove the Grpc function from WithRouting
50-
modify.RemoveRouteApply(routesImport, grpcFunc),
50+
modify.UnregisterRoute(routesImport, grpcFunc),
5151

5252
// Remove config/grpc.go, routes/grpc.go
5353
modify.File(configPath).Remove(),
5454
modify.File(grpcRoutePath).Remove(),
5555

5656
// Remove the gRPC service provider from the providers array in bootstrap/providers.go
57-
modify.RemoveProviderApply(moduleImport, grpcServiceProvider),
57+
modify.UnregisterProvider(moduleImport, grpcServiceProvider),
5858
).Execute()
5959
}

hash/setup/setup.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ func main() {
1919

2020
setup.Install(
2121
// Add the hash service provider to the providers array in bootstrap/providers.go
22-
modify.AddProviderApply(moduleImport, hashServiceProvider),
22+
modify.RegisterProvider(moduleImport, hashServiceProvider),
2323

2424
// Create config/hashing.go
2525
modify.File(configPath).Overwrite(stubs.Config(setup.Paths().Config().Package(), setup.Paths().Facades().Import(), facadesPackage)),
@@ -31,7 +31,7 @@ func main() {
3131
modify.File(configPath).Remove(),
3232

3333
// Remove the hash service provider from the providers array in bootstrap/providers.go
34-
modify.RemoveProviderApply(moduleImport, hashServiceProvider),
34+
modify.UnregisterProvider(moduleImport, hashServiceProvider),
3535

3636
// Remove the Hash facade
3737
modify.File(hashFacadePath).Remove(),

http/setup/setup.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ func main() {
2626

2727
setup.Install(
2828
// Add the http service provider to the providers array in bootstrap/providers.go
29-
modify.AddProviderApply(moduleImport, httpServiceProvider),
29+
modify.RegisterProvider(moduleImport, httpServiceProvider),
3030

3131
// Register the Http, RateLimiter, View facades
3232
modify.WhenFacade(httpFacade,
@@ -41,7 +41,7 @@ func main() {
4141
).Uninstall(
4242
modify.WhenNoFacades([]string{httpFacade, rateLimiterFacade, viewFacade},
4343
// Remove the http service provider from the providers array in bootstrap/providers.go
44-
modify.RemoveProviderApply(moduleImport, httpServiceProvider),
44+
modify.UnregisterProvider(moduleImport, httpServiceProvider),
4545
),
4646

4747
// Remove the Http, RateLimiter, View facades

log/setup/setup.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ LOG_LEVEL=debug
2525

2626
setup.Install(
2727
// Add the log service provider to the providers array in bootstrap/providers.go
28-
modify.AddProviderApply(moduleImport, logServiceProvider),
28+
modify.RegisterProvider(moduleImport, logServiceProvider),
2929

3030
// Create config/logging.go
3131
modify.File(loggingConfigPath).Overwrite(stubs.Config(setup.Paths().Config().Package(), setup.Paths().Facades().Import(), facadesPackage)),
@@ -41,7 +41,7 @@ LOG_LEVEL=debug
4141
modify.File(loggingConfigPath).Remove(),
4242

4343
// Remove the log service provider from the providers array in bootstrap/providers.go
44-
modify.RemoveProviderApply(moduleImport, logServiceProvider),
44+
modify.UnregisterProvider(moduleImport, logServiceProvider),
4545

4646
// Remove the Log facade
4747
modify.File(logFacadePath).Remove(),

0 commit comments

Comments
 (0)