forked from Azure/bicep
-
Notifications
You must be signed in to change notification settings - Fork 0
/
IServiceCollectionExtensions.cs
40 lines (36 loc) · 1.66 KB
/
IServiceCollectionExtensions.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
// Copyright (c) Microsoft Corporation.
// Licensed under the MIT License.
using System.IO.Abstractions;
using System.IO.Abstractions.TestingHelpers;
using Bicep.Core;
using Bicep.Core.Analyzers.Interfaces;
using Bicep.Core.Analyzers.Linter;
using Bicep.Core.Configuration;
using Bicep.Core.Features;
using Bicep.Core.FileSystem;
using Bicep.Core.Registry;
using Bicep.Core.Registry.Auth;
using Bicep.Core.Semantics.Namespaces;
using Bicep.Core.TypeSystem.Az;
using Bicep.Decompiler;
using Microsoft.Extensions.DependencyInjection;
namespace Bicep.Wasm;
public static class IServiceCollectionExtensions
{
public static IServiceCollection AddBicepCore(this IServiceCollection services) => services
.AddSingleton<IAzResourceTypeLoader, AzResourceTypeLoader>()
.AddSingleton<IAzResourceTypeLoaderFactory, AzResourceTypeLoaderFactory>()
.AddSingleton<INamespaceProvider, DefaultNamespaceProvider>()
.AddSingleton<IModuleDispatcher, ModuleDispatcher>()
.AddSingleton<IModuleRegistryProvider, EmptyModuleRegistryProvider>()
.AddSingleton<ITokenCredentialFactory, TokenCredentialFactory>()
.AddSingleton<IFileResolver, FileResolver>()
.AddSingleton<IFileSystem, MockFileSystem>()
.AddSingleton<IConfigurationManager, ConfigurationManager>()
.AddSingleton<IBicepAnalyzer, LinterAnalyzer>()
.AddSingleton<IFeatureProviderFactory, FeatureProviderFactory>()
.AddSingleton<ILinterRulesProvider, LinterRulesProvider>()
.AddSingleton<BicepCompiler>();
public static IServiceCollection AddBicepDecompiler(this IServiceCollection services) => services
.AddSingleton<BicepDecompiler>();
}