Exemple #1
0
        public static string ConfigYml(this IMiruApp app, MiruSolution solution = null)
        {
            // solution = solution ?? app.Get<Solution>();
            // return solution.GetConfigYml(app.Config.Environment);

            return(string.Empty);
        }
Exemple #2
0
        public void When_solution_name_is_composed_can_extract_short_name()
        {
            var solution = new MiruSolution(A.TempPath("Projects"), "Microsoft.Dynamics");

            solution.Name.ShouldBe("Microsoft.Dynamics");
            solution.ShortName.ShouldBe("Dynamics");
        }
Exemple #3
0
        public AssetsMap(MiruSolution solution)
        {
            var mixManifestPath = solution.AppDir / "wwwroot" / "mix-manifest.json";

            var mixManifest = File.ReadAllText(mixManifestPath);

            _map = System.Text.Json.JsonSerializer.Deserialize <Dictionary <string, string> >(mixManifest);
        }
Exemple #4
0
        public static IConfigurationBuilder AddConfigYml(
            this IConfigurationBuilder builder,
            string configDir,
            string environment,
            bool optional = true,
            bool reload   = true)
        {
            var configYml = Path.Combine(configDir, MiruSolution.ConfigYml(environment));

            return(builder.AddYamlFile(configYml, optional, reload));
        }
Exemple #5
0
        public void Setup()
        {
            _solution = new MiruSolution(A.Path / "MyApp");

            _sp = new ServiceCollection()
                  .AddMiruSolution(_solution)
                  .AddTestStorage()
                  .BuildServiceProvider();

            _storage = _sp.GetRequiredService <IStorage>();
        }
Exemple #6
0
 public MiruRunner(
     IEnumerable <IMiruHost> hosts,
     ArgsConfiguration argsConfig,
     MiruSolution solution,
     IHostEnvironment hostEnvironment)
 {
     _hosts           = hosts;
     _argsConfig      = argsConfig;
     _solution        = solution;
     _hostEnvironment = hostEnvironment;
 }
Exemple #7
0
        public void Setup()
        {
            _solution = new MiruSolution(A.Path / "Musicfy");

            _sp = new ServiceCollection()
                  .AddMiruSolution(_solution)
                  .AddStorage()
                  .BuildServiceProvider();

            _ = _sp.GetService <ITestFixture>();

            _storage = _sp.GetRequiredService <IStorage>();
        }
        public void Setup()
        {
            _tempDir = A.TempPath("Miru", "SolutionFinderTest");

            Directories.DeleteIfExists(_tempDir);

            var maker = Maker.For(_tempDir, "Shoppers");

            maker.New("Shoppers");

            _solutionDir = _tempDir / "Shoppers";

            _solution = _solutionFinder.FromDir(_solutionDir).Solution;
        }
Exemple #9
0
        public static IConfigurationBuilder AddConfigYml(
            this IConfigurationBuilder builder,
            string environment,
            bool optional = true,
            bool reload   = true)
        {
            var solution = App.Solution;

            if (solution.ConfigDir.Exists() == false)
            {
                return(builder);
            }

            var configYml = Path.Combine(solution.ConfigDir, MiruSolution.ConfigYml(environment));

            return(builder.AddYamlFile(configYml, optional, reload));
        }
Exemple #10
0
    public AssetsMap(MiruSolution solution)
    {
        var mixManifestPath = solution.AppDir / "wwwroot" / "mix-manifest.json";

        if (mixManifestPath.FileDoesNotExist())
        {
            throw new MixManifestNotFoundException(@$ "The file {mixManifestPath} could not be found.

It is used by Miru to reference the correct frontend assets (css, js, images, and etc).

To generate it, run the command 'miru app npm run dev'.

More details at https://mirufx.github.io/Frontend/JavascriptCssAssets.html#bundling");
        }

        var mixManifest = File.ReadAllText(mixManifestPath);

        _map = System.Text.Json.JsonSerializer.Deserialize <Dictionary <string, string> >(mixManifest);
    }
Exemple #11
0
        public void Can_create_solution_info()
        {
            var solution = new MiruSolution(A.Path("Projects", "StackOverflow"));

            solution.Name.ShouldBe("StackOverflow");
            solution.RootDir.ShouldBe(A.Path("Projects", "StackOverflow"));
            solution.SrcDir.ShouldBe(A.Path("Projects", "StackOverflow", "src"));
            solution.ConfigDir.ShouldBe(A.Path("Projects", "StackOverflow", "config"));
            solution.TestsDir.ShouldBe(A.Path("Projects", "StackOverflow", "tests"));

            solution.App.ShouldBe("StackOverflow");
            solution.AppDir.ShouldBe(A.Path("Projects", "StackOverflow", "src", "StackOverflow"));

            solution.AppTests.ShouldBe("StackOverflow.Tests");
            solution.AppTestsDir.ShouldBe(A.Path("Projects", "StackOverflow", "tests", "StackOverflow.Tests"));

            solution.AppPageTests.ShouldBe("StackOverflow.PageTests");
            solution.AppPageTestsDir.ShouldBe(A.Path("Projects", "StackOverflow", "tests", "StackOverflow.PageTests"));

            solution.DatabaseDir.ShouldBe(A.Path("Projects", "StackOverflow", "src", "StackOverflow", "Database"));
            solution.MigrationsDir.ShouldBe(A.Path("Projects", "StackOverflow", "src", "StackOverflow", "Database", "Migrations"));
            solution.FabricatorsDir.ShouldBe(A.Path("Projects", "StackOverflow", "src", "StackOverflow", "Database", "Fabricators"));
        }
Exemple #12
0
 public LiquidRenderer(MiruSolution solution)
 {
     _solution = solution;
 }
Exemple #13
0
 public MakeAppSettingsConsolable(MiruSolution solution)
 {
     _solution = solution;
 }
 public static IServiceCollection AddMiruSolution(
     this IServiceCollection services,
     MiruSolution solution)
 {
     return(services.ReplaceSingleton(solution));
 }
Exemple #15
0
 public MakeConfigConsolable(MiruSolution solution)
 {
     _solution = solution;
 }
Exemple #16
0
 public MakeEmailConsolable(MiruSolution solution)
 {
     _solution = solution;
 }
Exemple #17
0
 public MakeQueryConsolable(MiruSolution solution)
 {
     _solution = solution;
 }
Exemple #18
0
 public MakeCommandConsolable(MiruSolution solution)
 {
     _solution = solution;
 }
Exemple #19
0
 public SolutionFinderResult(MiruSolution solution = null)
 {
     Solution = solution;
 }
Exemple #20
0
        public void Get_relative_path()
        {
            var solution = new MiruSolution(A.TempPath("Miru", "ContosoUniversity"), "ContosoWeb");

            solution.Relative(m => m.SrcDir).ShouldBe("src");
        }
Exemple #21
0
        public void Get_app_name_from_root_dir()
        {
            var solution = new MiruSolution(A.TempPath("Miru", "ContosoUniversity"));

            solution.Name.ShouldBe("ContosoUniversity");
        }
Exemple #22
0
 public ConsolableHandler(MiruSolution solution)
 {
     _solution = solution;
 }
Exemple #23
0
 public ConsolableHandler(MiruSolution solution) =>
Exemple #24
0
 public MakeJobConsolable(MiruSolution solution)
 {
     _solution = solution;
 }
Exemple #25
0
 public MakeFeatureAllConsolable(MiruSolution solution)
 {
     _solution = solution;
 }
Exemple #26
0
 public TestStorage(MiruSolution solution) : base(solution)
 {
     StorageDir = solution.StorageDir / "tests";
 }
Exemple #27
0
        public void Get_app_name_from_parameter()
        {
            var solution = new MiruSolution(A.TempPath("Miru", "ContosoUniversity"), "ContosoWeb");

            solution.Name.ShouldBe("ContosoWeb");
        }
Exemple #28
0
 public StorageLinkConsolable(MiruSolution solution)
 {
     _solution = solution;
 }
Exemple #29
0
 public Storage(MiruSolution solution)
 {
     _solution = solution;
 }
Exemple #30
0
 public ThisStorage(MiruSolution solution) : base(solution)
 {
 }