Documentation ¶
Overview ¶
Package migrations implements the Mediator design pattern used to manage migrations over sveltin versions.
Index ¶
- type AddAliasToViteConfig
- type AddPrerenderTrailingToLayoutTS
- type AddSveltinPathToTSConfig
- type AddUpdateProjectSettings
- type CleanDotEnv
- type IMigration
- type IMigrationFactory
- type IMigrationMediator
- type Migration
- type MigrationData
- type MigrationManager
- type MigrationServices
- type OverwriteSveltinDTS
- type RefactorDefaultsTSTypes
- type RefactorMenuTSTypes
- type RefactorPageServerTSTypes
- type RefactorResourcesLibsTypes
- type RefactorSvelteFilesTypes
- type RefactorThemeConfig
- type RefactorWebSiteTSTypes
- type RemoveTrailingFromSvelteConfig
- type UnhandledMigration
- type UpdateMDsveXPlugins
- type UpdatePackageJson
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AddAliasToViteConfig ¶
type AddAliasToViteConfig struct { Mediator IMigrationMediator Services *MigrationServices Data *MigrationData }
AddAliasToViteConfig is the struct representing the migration update the defaults.js.ts file.
func (*AddAliasToViteConfig) MakeMigration ¶
func (m *AddAliasToViteConfig) MakeMigration(migrationManager *MigrationManager, services *MigrationServices, data *MigrationData) IMigration
MakeMigration implements IMigrationFactory interface.
func (AddAliasToViteConfig) Migrate ¶
func (m AddAliasToViteConfig) Migrate() error
Migrate return error if migration execution over up and down methods fails (IMigration interface).
type AddPrerenderTrailingToLayoutTS ¶
type AddPrerenderTrailingToLayoutTS struct { Mediator IMigrationMediator Services *MigrationServices Data *MigrationData }
AddPrerenderTrailingToLayoutTS is the struct representing the migration update the defaults.js.ts file.
func (*AddPrerenderTrailingToLayoutTS) MakeMigration ¶
func (m *AddPrerenderTrailingToLayoutTS) MakeMigration(migrationManager *MigrationManager, services *MigrationServices, data *MigrationData) IMigration
MakeMigration implements IMigrationFactory interface,
func (AddPrerenderTrailingToLayoutTS) Migrate ¶
func (m AddPrerenderTrailingToLayoutTS) Migrate() error
Migrate return error if migration execution over up and down methods fails (IMigration interface).
type AddSveltinPathToTSConfig ¶
type AddSveltinPathToTSConfig struct { Mediator IMigrationMediator Services *MigrationServices Data *MigrationData }
AddSveltinPathToTSConfig is the struct representing the migration update the defaults.js.ts file.
func (*AddSveltinPathToTSConfig) MakeMigration ¶
func (m *AddSveltinPathToTSConfig) MakeMigration(migrationManager *MigrationManager, services *MigrationServices, data *MigrationData) IMigration
MakeMigration implements IMigrationFactory interface.
func (AddSveltinPathToTSConfig) Migrate ¶
func (m AddSveltinPathToTSConfig) Migrate() error
Migrate return error if migration execution over up and down methods fails (IMigration interface).
type AddUpdateProjectSettings ¶
type AddUpdateProjectSettings struct { Mediator IMigrationMediator Services *MigrationServices Data *MigrationData }
AddUpdateProjectSettings is the struct representing the migration add the sveltin.json file.
func (*AddUpdateProjectSettings) MakeMigration ¶
func (m *AddUpdateProjectSettings) MakeMigration(migrationManager *MigrationManager, services *MigrationServices, data *MigrationData) IMigration
MakeMigration implements IMigrationFactory interface.
func (AddUpdateProjectSettings) Migrate ¶
func (m AddUpdateProjectSettings) Migrate() error
Migrate return error if migration execution over up and down methods fails.
type CleanDotEnv ¶
type CleanDotEnv struct { Mediator IMigrationMediator Services *MigrationServices Data *MigrationData }
CleanDotEnv is the struct representing the migration update the defaults.js.ts file.
func (*CleanDotEnv) MakeMigration ¶
func (m *CleanDotEnv) MakeMigration(migrationManager *MigrationManager, services *MigrationServices, data *MigrationData) IMigration
MakeMigration implements IMigrationFactory interface.
func (CleanDotEnv) Migrate ¶
func (m CleanDotEnv) Migrate() error
Migrate return error if migration execution over up and down methods fails (IMigration interface).
type IMigration ¶
type IMigration interface { Migrate() error // contains filtered or unexported methods }
IMigration is the interface defining the methods to be implemented by single migration.
type IMigrationFactory ¶
type IMigrationFactory interface {
MakeMigration(*MigrationManager, *MigrationServices, *MigrationData) IMigration
}
IMigrationFactory declares a set of methods for creating each of the abstract migrations.
func GetMigrationFactory ¶
func GetMigrationFactory(id Migration) (IMigrationFactory, error)
GetMigrationFactory picks the migration factory depending on the migration id.
type IMigrationMediator ¶
type IMigrationMediator interface {
// contains filtered or unexported methods
}
IMigrationMediator interface declares methods of communication with components.
type MigrationData ¶
MigrationData is the struct with data used by migrations.
type MigrationManager ¶
type MigrationManager struct {
// contains filtered or unexported fields
}
MigrationManager is the struct for the concrete mediator.
func NewMigrationManager ¶
func NewMigrationManager() *MigrationManager
NewMigrationManager is the concrete Mediator.
type MigrationServices ¶
type MigrationServices struct {
// contains filtered or unexported fields
}
MigrationServices contains references to services used by the migrations.
func NewMigrationServices ¶
func NewMigrationServices(fs afero.Fs, fsm *fsm.SveltinFSManager, pathmaker *pathmaker.SveltinPathMaker, logger *yinlog.Logger) *MigrationServices
NewMigrationServices creates an instance of MigrationService struct.
type OverwriteSveltinDTS ¶
type OverwriteSveltinDTS struct { Mediator IMigrationMediator Services *MigrationServices Data *MigrationData }
OverwriteSveltinDTS is the struct representing the migration add the sveltin.json file.
func (*OverwriteSveltinDTS) MakeMigration ¶
func (m *OverwriteSveltinDTS) MakeMigration(migrationManager *MigrationManager, services *MigrationServices, data *MigrationData) IMigration
MakeMigration implements IMigrationFactory interface.
func (OverwriteSveltinDTS) Migrate ¶
func (m OverwriteSveltinDTS) Migrate() error
Migrate return error if migration execution over up and down methods fails.
type RefactorDefaultsTSTypes ¶
type RefactorDefaultsTSTypes struct { Mediator IMigrationMediator Services *MigrationServices Data *MigrationData }
RefactorDefaultsTSTypes is the struct representing the migration update the defaults.js.ts file.
func (*RefactorDefaultsTSTypes) MakeMigration ¶
func (m *RefactorDefaultsTSTypes) MakeMigration(migrationManager *MigrationManager, services *MigrationServices, data *MigrationData) IMigration
MakeMigration implements IMigrationFactory interface,
func (RefactorDefaultsTSTypes) Migrate ¶
func (m RefactorDefaultsTSTypes) Migrate() error
Migrate return error if migration execution over up and down methods fails (IMigration interface).
type RefactorMenuTSTypes ¶
type RefactorMenuTSTypes struct { Mediator IMigrationMediator Services *MigrationServices Data *MigrationData }
RefactorMenuTSTypes is the struct representing the migration update the defaults.js.ts file.
func (*RefactorMenuTSTypes) MakeMigration ¶
func (m *RefactorMenuTSTypes) MakeMigration(migrationManager *MigrationManager, services *MigrationServices, data *MigrationData) IMigration
MakeMigration implements IMigrationFactory interface,
func (RefactorMenuTSTypes) Migrate ¶
func (m RefactorMenuTSTypes) Migrate() error
Migrate return error if migration execution over up and down methods fails (IMigration interface).
type RefactorPageServerTSTypes ¶
type RefactorPageServerTSTypes struct { Mediator IMigrationMediator Services *MigrationServices Data *MigrationData }
RefactorPageServerTSTypes is the struct representing the migration update the defaults.js.ts file.
func (*RefactorPageServerTSTypes) MakeMigration ¶
func (m *RefactorPageServerTSTypes) MakeMigration(migrationManager *MigrationManager, services *MigrationServices, data *MigrationData) IMigration
MakeMigration implements IMigrationFactory interface,
func (RefactorPageServerTSTypes) Migrate ¶
func (m RefactorPageServerTSTypes) Migrate() error
Migrate return error if migration execution over up and down methods fails (IMigration interface).
type RefactorResourcesLibsTypes ¶
type RefactorResourcesLibsTypes struct { Mediator IMigrationMediator Services *MigrationServices Data *MigrationData }
RefactorResourcesLibsTypes is the struct representing the migration update the defaults.js.ts file.
func (*RefactorResourcesLibsTypes) MakeMigration ¶
func (m *RefactorResourcesLibsTypes) MakeMigration(migrationManager *MigrationManager, services *MigrationServices, data *MigrationData) IMigration
MakeMigration implements IMigrationFactory interface,
func (RefactorResourcesLibsTypes) Migrate ¶
func (m RefactorResourcesLibsTypes) Migrate() error
Migrate return error if migration execution over up and down methods fails (IMigration interface).
type RefactorSvelteFilesTypes ¶
type RefactorSvelteFilesTypes struct { Mediator IMigrationMediator Services *MigrationServices Data *MigrationData }
RefactorSvelteFilesTypes is the struct representing the migration update the defaults.js.ts file.
func (*RefactorSvelteFilesTypes) MakeMigration ¶
func (m *RefactorSvelteFilesTypes) MakeMigration(migrationManager *MigrationManager, services *MigrationServices, data *MigrationData) IMigration
MakeMigration implements IMigrationFactory interface,
func (RefactorSvelteFilesTypes) Migrate ¶
func (m RefactorSvelteFilesTypes) Migrate() error
Migrate return error if migration execution over up and down methods fails (IMigration interface).
type RefactorThemeConfig ¶
type RefactorThemeConfig struct { Mediator IMigrationMediator Services *MigrationServices Data *MigrationData }
RefactorThemeConfig is the struct representing the migration update the defaults.js.ts file.
func (*RefactorThemeConfig) MakeMigration ¶
func (m *RefactorThemeConfig) MakeMigration(migrationManager *MigrationManager, services *MigrationServices, data *MigrationData) IMigration
MakeMigration implements IMigrationFactory interface.
func (RefactorThemeConfig) Migrate ¶
func (m RefactorThemeConfig) Migrate() error
Migrate return error if migration execution over up and down methods fails.
type RefactorWebSiteTSTypes ¶
type RefactorWebSiteTSTypes struct { Mediator IMigrationMediator Services *MigrationServices Data *MigrationData }
RefactorWebSiteTSTypes is the struct representing the migration update the defaults.js.ts file.
func (*RefactorWebSiteTSTypes) MakeMigration ¶
func (m *RefactorWebSiteTSTypes) MakeMigration(migrationManager *MigrationManager, services *MigrationServices, data *MigrationData) IMigration
MakeMigration implements IMigrationFactory interface,
func (RefactorWebSiteTSTypes) Migrate ¶
func (m RefactorWebSiteTSTypes) Migrate() error
Migrate return error if migration execution over up and down methods fails (IMigration interface).
type RemoveTrailingFromSvelteConfig ¶
type RemoveTrailingFromSvelteConfig struct { Mediator IMigrationMediator Services *MigrationServices Data *MigrationData }
RemoveTrailingFromSvelteConfig is the struct representing the migration update the defaults.js.ts file.
func (*RemoveTrailingFromSvelteConfig) MakeMigration ¶
func (m *RemoveTrailingFromSvelteConfig) MakeMigration(migrationManager *MigrationManager, services *MigrationServices, data *MigrationData) IMigration
MakeMigration implements IMigrationFactory interface,
func (RemoveTrailingFromSvelteConfig) Migrate ¶
func (m RemoveTrailingFromSvelteConfig) Migrate() error
Migrate return error if migration execution over up and down methods fails (IMigration interface).
type UnhandledMigration ¶
type UnhandledMigration struct { Mediator IMigrationMediator Services *MigrationServices Data *MigrationData }
UnhandledMigration is the struct representing the migration update the defaults.js.ts file.
func (*UnhandledMigration) MakeMigration ¶
func (m *UnhandledMigration) MakeMigration(migrationManager *MigrationManager, services *MigrationServices, data *MigrationData) IMigration
MakeMigration implements IMigrationFactory interface,
func (UnhandledMigration) Migrate ¶
func (m UnhandledMigration) Migrate() error
Migrate return error if migration execution over up and down methods fails (IMigration interface).
type UpdateMDsveXPlugins ¶
type UpdateMDsveXPlugins struct { Mediator IMigrationMediator Services *MigrationServices Data *MigrationData }
UpdateMDsveXPlugins is the struct representing the migration update the defaults.js.ts file.
func (*UpdateMDsveXPlugins) MakeMigration ¶
func (m *UpdateMDsveXPlugins) MakeMigration(migrationManager *MigrationManager, services *MigrationServices, data *MigrationData) IMigration
MakeMigration implements IMigrationFactory interface.
func (UpdateMDsveXPlugins) Migrate ¶
func (m UpdateMDsveXPlugins) Migrate() error
Migrate return error if migration execution over up and down methods fails (IMigration interface).
type UpdatePackageJson ¶
type UpdatePackageJson struct { Mediator IMigrationMediator Services *MigrationServices Data *MigrationData }
UpdatePackageJson is the struct representing the migration update the defaults.js.ts file.
func (*UpdatePackageJson) MakeMigration ¶
func (m *UpdatePackageJson) MakeMigration(migrationManager *MigrationManager, services *MigrationServices, data *MigrationData) IMigration
MakeMigration implements IMigrationFactory interface.
func (UpdatePackageJson) Migrate ¶
func (m UpdatePackageJson) Migrate() error
Migrate return error if migration execution over up and down methods fails (IMigration interface).
Source Files ¶
- 01_add-update-project-settings.go
- 02_refactor-defaults-ts-types.go
- 03_refactor-website-ts-types.go
- 04_refactor-menu-ts-types.go
- 05_overwrite-sveltin-d-ts.go
- 06_refactor-resource-libs-types.go
- 07_add-prerender-trailing-layout-ts.go
- 08_refactor-svelte-files-types.go
- 09_refactor-page-server-ts-types.go
- 10_refactor-theme-config.go
- 11_mdsvex-plugins.go
- 12_remove-trailing-svelte-config.go
- 13_clean-dotenv.go
- 14_add-alias-vite-config.go
- 15_add-path-ts-config.go
- 16_update-package-json.go
- XX_unhandled_migrations.go
- factory.go
- manager.go
- mediator.go
- migration.go
- patterns.go
- utils.go