Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Rename reload to restore #137

Merged
merged 2 commits into from
Aug 30, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -268,7 +268,7 @@ Here's an example JSON configuration file that uses Confix variables:

To manage variables in Confix, you can use the following commands:

- `confix variables reload`: This command reloads the variables for a project from the providers. Useful for updating your local environment with newly created variables.
- `confix variables restore`: This command reloads the variables for a project from the providers. Useful for updating your local environment with newly created variables.

- `confix variables set <variable> <value>`: This command sets the value for a specified variable.

Expand Down Expand Up @@ -330,7 +330,7 @@ Confix provides several commands to manage your project:

- `confix project init`: Initializes a new project
- `confix project build`: builds the final configuration files of the project
- `confix project reload`: Reloads the configuration of the component providers
- `confix project restore`: Reloads the configuration of the component providers
- `confix project validate`: Validates the configuration of the current project

Here is an example of a `.confix.project` file:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ public ProjectCommand() : base("project")
{
Description = "This command is used to manage projects.";

AddCommand(new ProjectReloadCommand());
AddCommand(new ProjectRestoreCommand());
AddCommand(new ProjectBuildCommand());
AddCommand(new ProjectInitCommand());
AddCommand(new ProjectValidateCommand());
Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
namespace Confix.Tool.Commands.Project;

public sealed class ProjectRestoreCommand : PipelineCommand<ProjectRestorePipeline>
{
public ProjectRestoreCommand() : base("restore")
{
Description = "Reloads the schema of a project";
}
}
11 changes: 0 additions & 11 deletions src/Confix.Tool/src/Confix.Library/Commands/ReloadCommand.cs

This file was deleted.

11 changes: 11 additions & 0 deletions src/Confix.Tool/src/Confix.Library/Commands/RestoreCommand.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
using Confix.Tool.Commands.Project;

namespace Confix.Tool.Commands;

public sealed class RestoreCommand : PipelineCommand<RestoreCommandPipeline>
{
/// <inheritdoc />
public RestoreCommand() : base("restore")
{
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ public SolutionCommand() : base("solution")
{
Description = "This command is used to manage solutions.";

AddCommand(new SolutionReloadCommand());
AddCommand(new SolutionRestoreCommand());
AddCommand(new SolutionBuildCommand());
AddCommand(new SolutionInitCommand());
AddCommand(new SolutionValidateCommand());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,10 @@

namespace Confix.Tool.Commands.Solution;

public sealed class SolutionReloadCommand : PipelineCommand<SolutionReloadPipeline>
public sealed class SolutionRestoreCommand : PipelineCommand<SolutionRestorePipeline>
{
/// <inheritdoc />
public SolutionReloadCommand() : base("reload")
public SolutionRestoreCommand() : base("restore")
{
Description = "Reloads the schema of all the projects in the solution";
}
Expand Down
2 changes: 1 addition & 1 deletion src/Confix.Tool/src/Confix.Library/ConfixRootCommand.cs
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ public ConfixRootCommand() : base("confix")
AddCommand(new VariableCommand());

AddCommand(new BuildCommand());
AddCommand(new ReloadCommand());
AddCommand(new RestoreCommand());
AddCommand(new ValidateCommand());

AddCommand(new FileEncryptCommand());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ public static class ProjectMiddlewareExtensions
public static CommandLineBuilder RegisterProjectMiddlewares(this CommandLineBuilder builder)
=> builder
.AddTransient(sp => new ValidationMiddleware(sp.GetRequiredService<ISchemaStore>()))
.AddTransient(sp => new ReloadProjectMiddleware(
.AddTransient(sp => new RestoreProjectMiddleware(
sp.GetRequiredService<IProjectComposer>(),
sp.GetRequiredService<ISchemaStore>()))
.AddTransient(sp =>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -65,8 +65,8 @@ private async Task<JsonSchema> GetJsonSchema(
if (!_schemaStore.TryLoad(solution, project, out var schema))
{
context.Logger.SchemaNotFoundInitiateSchemaReload(project);
var reloadProjectPipeline = new ProjectReloadPipeline();
await reloadProjectPipeline.ExecuteAsync(context);
var projectRestorePipeline = new ProjectRestorePipeline();
await projectRestorePipeline.ExecuteAsync(context);

if (!_schemaStore.TryLoad(solution, project, out schema))
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,13 @@

namespace Confix.Tool.Middlewares.Project;

public class ReloadProjectMiddleware : IMiddleware
public class RestoreProjectMiddleware : IMiddleware
{
private readonly IProjectComposer _projectComposer;

private readonly ISchemaStore _schemaStore;

public ReloadProjectMiddleware(IProjectComposer projectComposer, ISchemaStore schemaStore)
public RestoreProjectMiddleware(IProjectComposer projectComposer, ISchemaStore schemaStore)
{
_projectComposer = projectComposer;
_schemaStore = schemaStore;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

namespace Confix.Tool.Commands.Project;

public sealed class ProjectReloadPipeline : Pipeline
public sealed class ProjectRestorePipeline : Pipeline
{
/// <inheritdoc />
protected override void Configure(IPipelineDescriptor builder)
Expand All @@ -18,6 +18,6 @@ protected override void Configure(IPipelineDescriptor builder)
.Use<JsonSchemaCollectionMiddleware>()
.Use<ConfigurationAdapterMiddleware>()
.Use<BuildComponentProviderMiddleware>()
.Use<ReloadProjectMiddleware>();
.Use<RestoreProjectMiddleware>();
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

namespace Confix.Tool.Commands;

public sealed class ReloadCommandPipeline : Pipeline
public sealed class RestoreCommandPipeline : Pipeline
{
/// <inheritdoc />
protected override void Configure(IPipelineDescriptor builder)
Expand Down Expand Up @@ -37,7 +37,7 @@ private static async Task InvokeAsync(IMiddlewareContext context)
case ConfigurationScope.Project:
{
var projectDirectory = configuration.Project!.Directory!;
var pipeline = new ProjectReloadPipeline();
var pipeline = new ProjectRestorePipeline();
var projectContext = context
.WithExecutingDirectory(projectDirectory)
.WithFeatureCollection();
Expand All @@ -49,7 +49,7 @@ private static async Task InvokeAsync(IMiddlewareContext context)
case ConfigurationScope.Solution:
{
var solutionDirectory = configuration.Solution!.Directory!;
var pipeline = new SolutionReloadPipeline();
var pipeline = new SolutionRestorePipeline();
var solutionContext = context
.WithExecutingDirectory(solutionDirectory)
.WithFeatureCollection();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@

namespace Confix.Tool.Commands.Solution;

public sealed class SolutionReloadPipeline : Pipeline
public sealed class SolutionRestorePipeline : Pipeline
{
/// <inheritdoc />
protected override void Configure(IPipelineDescriptor builder)
Expand All @@ -31,7 +31,7 @@ private static async Task InvokeAsync(IMiddlewareContext context)
context.Logger.LogProjectedDetected(project);

var projectDirectory = project.Directory!;
var pipeline = new ProjectReloadPipeline();
var pipeline = new ProjectRestorePipeline();
var projectContext = context
.WithExecutingDirectory(projectDirectory)
.WithFeatureCollection();
Expand Down
Loading
Loading