migrations

package
v0.11.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Feb 22, 2023 License: Apache-2.0 Imports: 21 Imported by: 0

Documentation

Overview

Package migrations implements the Mediator design pattern used to manage migrations over sveltin versions.

Index

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

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 Migration

type Migration int

Migration is the type to identidy a migration.

const (
	ProjectSettings Migration = iota
	DefaultsConfig
	WebSiteTS
	MenuTS
	SveltinDTS
	ResourceLibs
	Layout
	SvelteFiles
	PageServerTS
	SveltinioComponent
	ThemeConfig
	ThemeSveltinioComponents
	MDsveXConfig
	SvelteConfig
	DotEnv
	ViteConfig
	TSConfig
	PackageJSON
)

Migration identifiers.

type MigrationData

type MigrationData struct {
	TargetPath        string
	CliVersion        string
	ProjectCliVersion string
}

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

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).

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL