コード例 #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);
        }
コード例 #2
0
ファイル: MiruSolutionTest.cs プロジェクト: michelanjos/Miru
        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");
        }
コード例 #3
0
ファイル: AssetsMap.cs プロジェクト: michelanjos/Miru
        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);
        }
コード例 #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));
        }
コード例 #5
0
ファイル: TestStorageTest.cs プロジェクト: MiruFx/Miru
        public void Setup()
        {
            _solution = new MiruSolution(A.Path / "MyApp");

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

            _storage = _sp.GetRequiredService <IStorage>();
        }
コード例 #6
0
 public MiruRunner(
     IEnumerable <IMiruHost> hosts,
     ArgsConfiguration argsConfig,
     MiruSolution solution,
     IHostEnvironment hostEnvironment)
 {
     _hosts           = hosts;
     _argsConfig      = argsConfig;
     _solution        = solution;
     _hostEnvironment = hostEnvironment;
 }
コード例 #7
0
ファイル: StorageTest.cs プロジェクト: MiruFx/Miru
        public void Setup()
        {
            _solution = new MiruSolution(A.Path / "Musicfy");

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

            _ = _sp.GetService <ITestFixture>();

            _storage = _sp.GetRequiredService <IStorage>();
        }
コード例 #8
0
        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;
        }
コード例 #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));
        }
コード例 #10
0
ファイル: AssetsMap.cs プロジェクト: MiruFx/Miru
    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);
    }
コード例 #11
0
ファイル: MiruSolutionTest.cs プロジェクト: joaofx/Miru
        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"));
        }
コード例 #12
0
 public LiquidRenderer(MiruSolution solution)
 {
     _solution = solution;
 }
コード例 #13
0
 public MakeAppSettingsConsolable(MiruSolution solution)
 {
     _solution = solution;
 }
コード例 #14
0
 public static IServiceCollection AddMiruSolution(
     this IServiceCollection services,
     MiruSolution solution)
 {
     return(services.ReplaceSingleton(solution));
 }
コード例 #15
0
 public MakeConfigConsolable(MiruSolution solution)
 {
     _solution = solution;
 }
コード例 #16
0
ファイル: MakeEmailConsolable.cs プロジェクト: joaofx/Miru
 public MakeEmailConsolable(MiruSolution solution)
 {
     _solution = solution;
 }
コード例 #17
0
 public MakeQueryConsolable(MiruSolution solution)
 {
     _solution = solution;
 }
コード例 #18
0
 public MakeCommandConsolable(MiruSolution solution)
 {
     _solution = solution;
 }
コード例 #19
0
 public SolutionFinderResult(MiruSolution solution = null)
 {
     Solution = solution;
 }
コード例 #20
0
ファイル: MiruSolutionTest.cs プロジェクト: michelanjos/Miru
        public void Get_relative_path()
        {
            var solution = new MiruSolution(A.TempPath("Miru", "ContosoUniversity"), "ContosoWeb");

            solution.Relative(m => m.SrcDir).ShouldBe("src");
        }
コード例 #21
0
ファイル: MiruSolutionTest.cs プロジェクト: michelanjos/Miru
        public void Get_app_name_from_root_dir()
        {
            var solution = new MiruSolution(A.TempPath("Miru", "ContosoUniversity"));

            solution.Name.ShouldBe("ContosoUniversity");
        }
コード例 #22
0
 public ConsolableHandler(MiruSolution solution)
 {
     _solution = solution;
 }
コード例 #23
0
ファイル: StorageLinkConsolable.cs プロジェクト: MiruFx/Miru
 public ConsolableHandler(MiruSolution solution) =>
コード例 #24
0
ファイル: MakeJobConsolable.cs プロジェクト: michelanjos/Miru
 public MakeJobConsolable(MiruSolution solution)
 {
     _solution = solution;
 }
コード例 #25
0
 public MakeFeatureAllConsolable(MiruSolution solution)
 {
     _solution = solution;
 }
コード例 #26
0
ファイル: TestStorage.cs プロジェクト: MiruFx/Miru
 public TestStorage(MiruSolution solution) : base(solution)
 {
     StorageDir = solution.StorageDir / "tests";
 }
コード例 #27
0
ファイル: MiruSolutionTest.cs プロジェクト: michelanjos/Miru
        public void Get_app_name_from_parameter()
        {
            var solution = new MiruSolution(A.TempPath("Miru", "ContosoUniversity"), "ContosoWeb");

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