├── code ├── test │ ├── Utilities.Test │ │ ├── Packaging │ │ │ ├── SampleContent.txt │ │ │ ├── MsSigned │ │ │ │ └── Templates.mstx │ │ │ ├── Unsigned │ │ │ │ └── UnsignedPackage.mstx │ │ │ └── SampleConfig.json │ │ ├── App.config │ │ └── Properties │ │ │ └── AssemblyInfo.cs │ ├── CoreTemplateStudio.Core.Test │ │ ├── Config │ │ │ ├── Error.config.no.valid.json │ │ │ ├── Partial.config.valid.json │ │ │ └── Ok.config.valid.json │ │ ├── Packaging │ │ │ ├── SampleContent.txt │ │ │ ├── MsSigned │ │ │ │ └── Templates.mstx │ │ │ └── SampleConfig.json │ │ ├── TestData │ │ │ ├── Templates │ │ │ │ └── test │ │ │ │ │ ├── PageTemplate │ │ │ │ │ └── .template.config │ │ │ │ │ │ ├── description.md │ │ │ │ │ │ ├── en-US.description.md │ │ │ │ │ │ ├── es-ES.description.md │ │ │ │ │ │ ├── en-US.template.json │ │ │ │ │ │ ├── es-ES.template.json │ │ │ │ │ │ └── template.json │ │ │ │ │ ├── ProjectTemplate │ │ │ │ │ └── .template.config │ │ │ │ │ │ ├── description.md │ │ │ │ │ │ ├── icon.png │ │ │ │ │ │ ├── Layout.json │ │ │ │ │ │ └── template.json │ │ │ │ │ ├── ServiceTemplate │ │ │ │ │ └── .template.config │ │ │ │ │ │ ├── description.md │ │ │ │ │ │ ├── en-US.description.md │ │ │ │ │ │ ├── es-ES.description.md │ │ │ │ │ │ ├── en-US.template.json │ │ │ │ │ │ ├── es-ES.template.json │ │ │ │ │ │ └── template.json │ │ │ │ │ ├── FeatureTemplate │ │ │ │ │ └── .template.config │ │ │ │ │ │ ├── en-US.description.md │ │ │ │ │ │ ├── description.md │ │ │ │ │ │ ├── es-ES.description.md │ │ │ │ │ │ ├── en-US.template.json │ │ │ │ │ │ ├── es-ES.template.json │ │ │ │ │ │ └── template.json │ │ │ │ │ ├── PageTemplate_PropertyBag │ │ │ │ │ └── .template.config │ │ │ │ │ │ ├── description.md │ │ │ │ │ │ ├── en-US.description.md │ │ │ │ │ │ ├── es-ES.description.md │ │ │ │ │ │ ├── en-US.template.json │ │ │ │ │ │ ├── es-ES.template.json │ │ │ │ │ │ └── template.json │ │ │ │ │ ├── ProjectTemplateVB │ │ │ │ │ └── .template.config │ │ │ │ │ │ ├── description.md │ │ │ │ │ │ ├── icon.png │ │ │ │ │ │ ├── Layout.json │ │ │ │ │ │ └── template.json │ │ │ │ │ ├── TestingTemplate │ │ │ │ │ └── .template.config │ │ │ │ │ │ ├── en-US.description.md │ │ │ │ │ │ ├── description.md │ │ │ │ │ │ ├── es-ES.description.md │ │ │ │ │ │ ├── en-US.template.json │ │ │ │ │ │ ├── es-ES.template.json │ │ │ │ │ │ └── template.json │ │ │ │ │ ├── _catalog │ │ │ │ │ ├── frontendframeworks │ │ │ │ │ │ ├── TestFramework.md │ │ │ │ │ │ ├── en-US.TestFramework.md │ │ │ │ │ │ └── es-ES.TestFramework.md │ │ │ │ │ ├── projectTypes │ │ │ │ │ │ ├── TestProjectType.md │ │ │ │ │ │ ├── en-US.TestProjectType.md │ │ │ │ │ │ └── es-ES.TestProjectType.md │ │ │ │ │ ├── backendframeworks │ │ │ │ │ │ ├── TestFramework.md │ │ │ │ │ │ ├── en-US.TestFramework.md │ │ │ │ │ │ └── es-ES.TestFramework.md │ │ │ │ │ ├── en-US.frontendframeworks.json │ │ │ │ │ ├── en-US.projectTypes.json │ │ │ │ │ ├── es-ES.projectTypes.json │ │ │ │ │ ├── en-US.backendframeworks.json │ │ │ │ │ ├── es-ES.frontendframeworks.json │ │ │ │ │ ├── es-ES.backendframeworks.json │ │ │ │ │ ├── frontendframeworks.json │ │ │ │ │ ├── projectTypes.json │ │ │ │ │ └── backendframeworks.json │ │ │ │ │ ├── FeatureTemplateVB │ │ │ │ │ └── .template.config │ │ │ │ │ │ ├── description.md │ │ │ │ │ │ ├── en-US.description.md │ │ │ │ │ │ ├── es-ES.description.md │ │ │ │ │ │ ├── en-US.template.json │ │ │ │ │ │ ├── es-ES.template.json │ │ │ │ │ │ └── template.json │ │ │ │ │ ├── ProjectTemplate_FrontAndBack │ │ │ │ │ └── .template.config │ │ │ │ │ │ ├── description.md │ │ │ │ │ │ ├── icon.png │ │ │ │ │ │ ├── Layout.json │ │ │ │ │ │ └── template.json │ │ │ │ │ ├── ProjectTemplate_PropertyBag │ │ │ │ │ └── .template.config │ │ │ │ │ │ ├── description.md │ │ │ │ │ │ ├── icon.png │ │ │ │ │ │ ├── Layout.json │ │ │ │ │ │ └── template.json │ │ │ │ │ ├── TestingTemplateVB │ │ │ │ │ └── .template.config │ │ │ │ │ │ ├── description.md │ │ │ │ │ │ ├── en-US.description.md │ │ │ │ │ │ ├── es-ES.description.md │ │ │ │ │ │ ├── en-US.template.json │ │ │ │ │ │ ├── es-ES.template.json │ │ │ │ │ │ └── template.json │ │ │ │ │ ├── projectNameValidation.config.json │ │ │ │ │ ├── itemNameValidation.config.json │ │ │ │ │ ├── UnspecifiedTemplate │ │ │ │ │ └── .template.config │ │ │ │ │ │ └── template.json │ │ │ │ │ ├── UnspecifiedTemplateVB │ │ │ │ │ └── .template.config │ │ │ │ │ │ └── template.json │ │ │ │ │ ├── Requirements.FeatureTemplate.r1 │ │ │ │ │ └── .template.config │ │ │ │ │ │ └── template.json │ │ │ │ │ ├── Requirements.FeatureTemplate.r2 │ │ │ │ │ └── .template.config │ │ │ │ │ │ └── template.json │ │ │ │ │ ├── Dependencies.FeatureTemplate.dp1 │ │ │ │ │ └── .template.config │ │ │ │ │ │ └── template.json │ │ │ │ │ ├── Dependencies.FeatureTemplate.dp2 │ │ │ │ │ └── .template.config │ │ │ │ │ │ └── template.json │ │ │ │ │ ├── Hidden.FeatureTemplate │ │ │ │ │ └── .template.config │ │ │ │ │ │ └── template.json │ │ │ │ │ ├── Exclusions.FeatureTemplate │ │ │ │ │ └── .template.config │ │ │ │ │ │ └── template.json │ │ │ │ │ ├── RightClick.FeatureTemplate │ │ │ │ │ └── .template.config │ │ │ │ │ │ └── template.json │ │ │ │ │ ├── Exclusions.FeatureTemplateVB │ │ │ │ │ └── .template.config │ │ │ │ │ │ └── template.json │ │ │ │ │ ├── Requirements.FeatureTemplate │ │ │ │ │ └── .template.config │ │ │ │ │ │ └── template.json │ │ │ │ │ ├── Dependencies.FeatureTemplateVB │ │ │ │ │ └── .template.config │ │ │ │ │ │ └── template.json │ │ │ │ │ ├── Requirements.FeatureTemplateVB │ │ │ │ │ └── .template.config │ │ │ │ │ │ └── template.json │ │ │ │ │ ├── TelemetryName.FeatureTemplate │ │ │ │ │ └── .template.config │ │ │ │ │ │ └── template.json │ │ │ │ │ ├── OutputToParent.FeatureTemplate │ │ │ │ │ └── .template.config │ │ │ │ │ │ └── template.json │ │ │ │ │ ├── Naming.DefaultNameTemplate │ │ │ │ │ └── .template.config │ │ │ │ │ │ └── template.json │ │ │ │ │ ├── Naming.DefaultNameTemplateVB │ │ │ │ │ └── .template.config │ │ │ │ │ │ └── template.json │ │ │ │ │ ├── CompositionTemplateVB │ │ │ │ │ └── .template.config │ │ │ │ │ │ └── template.json │ │ │ │ │ ├── ServiceTemplateVB │ │ │ │ │ └── .template.config │ │ │ │ │ │ └── template.json │ │ │ │ │ ├── CompositionTemplate │ │ │ │ │ └── .template.config │ │ │ │ │ │ └── template.json │ │ │ │ │ ├── PageTemplateVB │ │ │ │ │ └── .template.config │ │ │ │ │ │ └── template.json │ │ │ │ │ └── Dependencies.FeatureTemplate │ │ │ │ │ └── .template.config │ │ │ │ │ └── template.json │ │ │ ├── TestJson │ │ │ │ ├── TestJson.json │ │ │ │ └── TestJson_expected.json │ │ │ ├── SearchReplace │ │ │ │ ├── Source_searchreplace.cs │ │ │ │ ├── NoSource_searchreplace.cs │ │ │ │ ├── Source.cs │ │ │ │ └── Source_expected.cs │ │ │ └── Merge │ │ │ │ ├── Style.xaml │ │ │ │ ├── Style_fail.xaml │ │ │ │ ├── Style_fail_postaction.xaml │ │ │ │ ├── Style_postaction.xaml │ │ │ │ └── Style_expected.xaml │ │ ├── xunit.runner.json │ │ ├── TestFakes │ │ │ └── GenShell │ │ │ │ ├── TestGenShellCertificate.cs │ │ │ │ ├── TestGenShellVisualStudio.cs │ │ │ │ ├── TestGenShellProject.cs │ │ │ │ ├── TestGenShellSolution.cs │ │ │ │ ├── TestGenShellUI.cs │ │ │ │ └── TestGenShell.cs │ │ ├── Diagnostics │ │ │ └── TelemetryFixture.cs │ │ ├── PostActions │ │ │ └── Catalog │ │ │ │ └── FakeCreationPath.cs │ │ └── Locations │ │ │ └── UnitTestsTemplatesSource.cs │ └── CoreTemplateStudio.Cli.Test │ │ ├── templates │ │ ├── PageTemplate │ │ │ └── .template.config │ │ │ │ ├── description.md │ │ │ │ ├── en-US.description.md │ │ │ │ ├── es-ES.description.md │ │ │ │ ├── en-US.template.json │ │ │ │ ├── es-ES.template.json │ │ │ │ └── template.json │ │ ├── ProjectTemplate │ │ │ └── .template.config │ │ │ │ ├── description.md │ │ │ │ ├── icon.png │ │ │ │ ├── Layout.json │ │ │ │ └── template.json │ │ └── _catalog │ │ │ ├── frontendframeworks │ │ │ ├── TestFramework.md │ │ │ ├── en-US.TestFramework.md │ │ │ └── es-ES.TestFramework.md │ │ │ ├── projectTypes │ │ │ ├── TestProjectType.md │ │ │ ├── en-US.TestProjectType.md │ │ │ └── es-ES.TestProjectType.md │ │ │ ├── backendframeworks │ │ │ ├── TestFramework.md │ │ │ ├── en-US.TestFramework.md │ │ │ └── es-ES.TestFramework.md │ │ │ ├── en-US.frontendframeworks.json │ │ │ ├── en-US.projectTypes.json │ │ │ ├── es-ES.projectTypes.json │ │ │ ├── en-US.backendframeworks.json │ │ │ ├── es-ES.frontendframeworks.json │ │ │ ├── es-ES.backendframeworks.json │ │ │ ├── frontendframeworks.json │ │ │ ├── projectTypes.json │ │ │ └── backendframeworks.json │ │ └── xunit.runner.json ├── TestCert.pfx ├── TestKey.snk ├── tools │ ├── WtsTelemetry │ │ ├── .vscode │ │ │ ├── extensions.json │ │ │ ├── settings.json │ │ │ └── launch.json │ │ ├── Models │ │ │ ├── AppInsightConfig.cs │ │ │ ├── QueryData.cs │ │ │ ├── GithubConfig.cs │ │ │ ├── Platforms.cs │ │ │ ├── WebTSReactNativeData.cs │ │ │ ├── WinUIPlatformData.cs │ │ │ ├── WebTSFullStackWebData.cs │ │ │ ├── WebTSData.cs │ │ │ └── WinTSPlatformData.cs │ │ ├── host.json │ │ ├── local.settings.json │ │ ├── WtsTelemetry.csproj │ │ └── Services │ │ │ └── ConfigurationService.cs │ └── WtsPackagingTool │ │ ├── CommandOptions │ │ ├── CommonOptions.cs │ │ ├── RemoteSourceCommonOptions.cs │ │ └── RemoteSourceListOptions.cs │ │ ├── Environments.cs │ │ └── App.config ├── src │ └── CoreTemplateStudio │ │ ├── CoreTemplateStudio.Cli │ │ ├── appsettings.Development.json │ │ ├── Commands │ │ │ ├── Contracts │ │ │ │ ├── ICommand.cs │ │ │ │ ├── ICommandHandler`1.cs │ │ │ │ └── ICommandDispatcher.cs │ │ │ ├── GetPagesCommand.cs │ │ │ ├── GetLayoutsCommand.cs │ │ │ ├── GetFeaturesCommand.cs │ │ │ ├── GetServicesCommand.cs │ │ │ ├── GetTestingsCommand.cs │ │ │ ├── CloseCommand.cs │ │ │ ├── GetProjectTypesCommand.cs │ │ │ ├── GetFrameworksCommand.cs │ │ │ ├── GenerateCommand.cs │ │ │ ├── GetAllLicencesCommand.cs │ │ │ ├── Validators │ │ │ │ ├── GetProjectTypesValidator.cs │ │ │ │ ├── GenerateValidator.cs │ │ │ │ ├── GetFrameworksValidator.cs │ │ │ │ ├── GetAllLicencesValidator.cs │ │ │ │ ├── GetPagesValidator.cs │ │ │ │ ├── GetLayoutsValidator.cs │ │ │ │ ├── GetServicesValidator.cs │ │ │ │ ├── GetTestingsValidator.cs │ │ │ │ └── GetFeaturesValidator.cs │ │ │ └── GetTemplatesBaseCommand.cs │ │ ├── Models │ │ │ ├── GenerationResult.cs │ │ │ ├── MessageType.cs │ │ │ ├── SyncModel.cs │ │ │ └── GenerationItem.cs │ │ ├── Services │ │ │ └── Contracts │ │ │ │ ├── IOptionsService`1.cs │ │ │ │ ├── ISyncService.cs │ │ │ │ ├── IMessageService.cs │ │ │ │ └── IGenerateService.cs │ │ ├── Utilities │ │ │ └── GenShell │ │ │ │ ├── CliGenShellCertificate.cs │ │ │ │ ├── CliGenShellVisualStudio.cs │ │ │ │ ├── CliGenShellProject.cs │ │ │ │ └── CliGenShellSolution.cs │ │ └── .vscode │ │ │ ├── launch.json │ │ │ └── tasks.json │ │ ├── CoreTemplateStudio.Core │ │ ├── Gen │ │ │ ├── IWindow.cs │ │ │ ├── Shell │ │ │ │ ├── IGenShellCertificate.cs │ │ │ │ ├── IGenShell.cs │ │ │ │ ├── IGenShellUI.cs │ │ │ │ ├── IGenShellVisualStudio.cs │ │ │ │ ├── IGenShellProject.cs │ │ │ │ ├── IGenShellSolution.cs │ │ │ │ └── IGenShellTelemetry.cs │ │ │ ├── LayoutInfo.cs │ │ │ ├── UserSelectionItem.cs │ │ │ ├── CompositionInfo.cs │ │ │ ├── SupportedFramework.cs │ │ │ ├── TempGenerationResult.cs │ │ │ ├── GenToolBox.cs │ │ │ ├── ProjectConfiguration.cs │ │ │ ├── NewItemGenerationFileInfo.cs │ │ │ ├── NewItemGenerationResult.cs │ │ │ ├── GenException.cs │ │ │ ├── ProjectInfo.cs │ │ │ ├── ProjectReference.cs │ │ │ ├── IContextProvider.cs │ │ │ ├── SdkReference.cs │ │ │ ├── NugetReference.cs │ │ │ └── GenParams.cs │ │ ├── Validation │ │ │ ├── IValidator.cs │ │ │ ├── ValidationMessage.cs │ │ │ └── ValidationResult.cs │ │ ├── Templates │ │ │ ├── MetadataType.cs │ │ │ ├── TemplateOutputType.cs │ │ │ ├── TemplateLicense.cs │ │ │ ├── TemplateType.cs │ │ │ ├── MetadataLocalizedInfo.cs │ │ │ └── LayoutItem.cs │ │ ├── Composition │ │ │ ├── QueryOperator.cs │ │ │ └── InvalidCompositionQueryException.cs │ │ ├── Diagnostics │ │ │ ├── GenSourceEnum.cs │ │ │ ├── GenStatusEnum.cs │ │ │ ├── NewItemType.cs │ │ │ ├── WizardStatusEnum.cs │ │ │ ├── WizardActionEnum.cs │ │ │ ├── EditItemActionEnum.cs │ │ │ ├── ProjectMetricsEnum.cs │ │ │ ├── WizardTypeEnum.cs │ │ │ ├── HealthWriters.cs │ │ │ ├── IHealthWriter.cs │ │ │ ├── VSTelemetryInfo.cs │ │ │ ├── TelemetryMetrics.cs │ │ │ ├── ExceptionTracker.cs │ │ │ └── FormattedWriterMessages.cs │ │ ├── Casing │ │ │ └── CasingType.cs │ │ ├── Naming │ │ │ ├── Config │ │ │ │ ├── RegExConfig.cs │ │ │ │ ├── ProjectNameValidationConfig.cs │ │ │ │ └── ItemNameValidationConfig.cs │ │ │ ├── ValidationError.cs │ │ │ ├── ValidationErrorType.cs │ │ │ ├── ValidationResult.cs │ │ │ └── Validators │ │ │ │ ├── Validator.cs │ │ │ │ └── EmptyNameValidator.cs │ │ ├── Extensions │ │ │ ├── TaskExtensions.cs │ │ │ ├── VersionExtensions.cs │ │ │ ├── DictionaryExtensions.cs │ │ │ └── DateTimeExtensions.cs │ │ ├── Configuration │ │ │ └── BreakingChangeVersion.cs │ │ ├── FrameworkTypes.cs │ │ ├── Locations │ │ │ ├── ProgressEventArgs.cs │ │ │ ├── SyncStatusEventArgs.cs │ │ │ ├── SyncStatus.cs │ │ │ ├── TemplateSynchronizationException.cs │ │ │ └── TemplatesContentInfo.cs │ │ ├── PostActions │ │ │ ├── Catalog │ │ │ │ ├── Merge │ │ │ │ │ ├── MergeFailureType.cs │ │ │ │ │ ├── MergeMode.cs │ │ │ │ │ ├── MergeResult.cs │ │ │ │ │ ├── CodeStyleProviders │ │ │ │ │ │ ├── VBStyleProvider.cs │ │ │ │ │ │ └── XmlStyleProvider.cs │ │ │ │ │ └── NewItemGeneration │ │ │ │ │ │ └── MergeInfo.cs │ │ │ │ ├── SortNamespaces │ │ │ │ │ ├── UsingComparer.cs │ │ │ │ │ ├── ImportsComparer.cs │ │ │ │ │ ├── SortUsingsPostAction.cs │ │ │ │ │ └── SortImportsPostAction.cs │ │ │ │ ├── AddJsonDictionaryItem │ │ │ │ │ └── DictionaryExtensions.cs │ │ │ │ ├── AddContextItemsToSolutionAndProjectPostAction.cs │ │ │ │ ├── SetDefaultSolutionConfigurationPostAction.cs │ │ │ │ ├── ChangeSolutionConfigurationPostAction.cs │ │ │ │ └── NewItemGeneration │ │ │ │ │ └── OpenFilesPostAction.cs │ │ │ └── TemplateDefinedPostAction.cs │ │ ├── Packaging │ │ │ ├── CertInfo.cs │ │ │ ├── InvalidSignatureException.cs │ │ │ ├── SignCertNotFoundException.cs │ │ │ └── IDigitalSignatureService.cs │ │ └── Helpers │ │ │ └── FileHelper.cs │ │ └── CoreTemplateStudio.Core.sln ├── NuGet.Config ├── StyleCop.json └── WtsTelemetry.sln ├── .github └── CODEOWNERS └── docs └── PULL_REQUEST_TEMPLATE.md /code/test/Utilities.Test/Packaging/SampleContent.txt: -------------------------------------------------------------------------------- 1 | This is sample content -------------------------------------------------------------------------------- /code/test/CoreTemplateStudio.Core.Test/Config/Error.config.no.valid.json: -------------------------------------------------------------------------------- 1 | NO VALID JSON -------------------------------------------------------------------------------- /code/test/CoreTemplateStudio.Core.Test/Packaging/SampleContent.txt: -------------------------------------------------------------------------------- 1 | This is sample content -------------------------------------------------------------------------------- /code/TestCert.pfx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/CoreTemplateStudio/HEAD/code/TestCert.pfx -------------------------------------------------------------------------------- /code/TestKey.snk: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/CoreTemplateStudio/HEAD/code/TestKey.snk -------------------------------------------------------------------------------- /code/test/CoreTemplateStudio.Cli.Test/templates/PageTemplate/.template.config/description.md: -------------------------------------------------------------------------------- 1 | Generic description -------------------------------------------------------------------------------- /code/test/CoreTemplateStudio.Cli.Test/templates/PageTemplate/.template.config/en-US.description.md: -------------------------------------------------------------------------------- 1 | US description -------------------------------------------------------------------------------- /code/test/CoreTemplateStudio.Cli.Test/templates/ProjectTemplate/.template.config/description.md: -------------------------------------------------------------------------------- 1 | template description -------------------------------------------------------------------------------- /code/test/CoreTemplateStudio.Cli.Test/templates/_catalog/frontendframeworks/TestFramework.md: -------------------------------------------------------------------------------- 1 | Test Framework Base Description -------------------------------------------------------------------------------- /code/test/CoreTemplateStudio.Cli.Test/templates/_catalog/projectTypes/TestProjectType.md: -------------------------------------------------------------------------------- 1 | Test Project Type Base Description -------------------------------------------------------------------------------- /code/test/CoreTemplateStudio.Cli.Test/templates/_catalog/projectTypes/en-US.TestProjectType.md: -------------------------------------------------------------------------------- 1 | Test Project Type Description -------------------------------------------------------------------------------- /code/test/CoreTemplateStudio.Cli.Test/templates/_catalog/frontendframeworks/en-US.TestFramework.md: -------------------------------------------------------------------------------- 1 | Test Framework Description -------------------------------------------------------------------------------- /code/test/CoreTemplateStudio.Cli.Test/templates/_catalog/projectTypes/es-ES.TestProjectType.md: -------------------------------------------------------------------------------- 1 | Descripción del proyecto de prueba -------------------------------------------------------------------------------- /code/test/CoreTemplateStudio.Core.Test/Config/Partial.config.valid.json: -------------------------------------------------------------------------------- 1 | { 2 | "RemoteTelemetryKey": "partialTelemetryKey" 3 | } -------------------------------------------------------------------------------- /code/test/CoreTemplateStudio.Core.Test/TestData/Templates/test/PageTemplate/.template.config/description.md: -------------------------------------------------------------------------------- 1 | Generic description -------------------------------------------------------------------------------- /code/test/CoreTemplateStudio.Core.Test/TestData/Templates/test/PageTemplate/.template.config/en-US.description.md: -------------------------------------------------------------------------------- 1 | US description -------------------------------------------------------------------------------- /code/test/CoreTemplateStudio.Core.Test/TestData/TestJson/TestJson.json: -------------------------------------------------------------------------------- 1 | { 2 | "TestKey": { 3 | "jkl": "101112" 4 | } 5 | } -------------------------------------------------------------------------------- /code/test/CoreTemplateStudio.Cli.Test/templates/PageTemplate/.template.config/es-ES.description.md: -------------------------------------------------------------------------------- 1 | Descripción del proyecto de prueba -------------------------------------------------------------------------------- /code/test/CoreTemplateStudio.Cli.Test/templates/_catalog/backendframeworks/TestFramework.md: -------------------------------------------------------------------------------- 1 | Test Backend Framework Base Description -------------------------------------------------------------------------------- /code/test/CoreTemplateStudio.Cli.Test/templates/_catalog/backendframeworks/en-US.TestFramework.md: -------------------------------------------------------------------------------- 1 | Test Backend Framework Description -------------------------------------------------------------------------------- /code/test/CoreTemplateStudio.Cli.Test/templates/_catalog/frontendframeworks/es-ES.TestFramework.md: -------------------------------------------------------------------------------- 1 | Descripción de Framework de prueba -------------------------------------------------------------------------------- /code/test/CoreTemplateStudio.Core.Test/TestData/Templates/test/ProjectTemplate/.template.config/description.md: -------------------------------------------------------------------------------- 1 | template description -------------------------------------------------------------------------------- /code/test/CoreTemplateStudio.Core.Test/TestData/Templates/test/ServiceTemplate/.template.config/description.md: -------------------------------------------------------------------------------- 1 | Generic description -------------------------------------------------------------------------------- /code/test/CoreTemplateStudio.Core.Test/TestData/Templates/test/ServiceTemplate/.template.config/en-US.description.md: -------------------------------------------------------------------------------- 1 | US description -------------------------------------------------------------------------------- /code/test/CoreTemplateStudio.Core.Test/TestData/Templates/test/FeatureTemplate/.template.config/en-US.description.md: -------------------------------------------------------------------------------- 1 | US Feature description -------------------------------------------------------------------------------- /code/test/CoreTemplateStudio.Core.Test/TestData/Templates/test/PageTemplate_PropertyBag/.template.config/description.md: -------------------------------------------------------------------------------- 1 | Generic description -------------------------------------------------------------------------------- /code/test/CoreTemplateStudio.Core.Test/TestData/Templates/test/ProjectTemplateVB/.template.config/description.md: -------------------------------------------------------------------------------- 1 | template description 2 | -------------------------------------------------------------------------------- /code/test/CoreTemplateStudio.Core.Test/TestData/Templates/test/TestingTemplate/.template.config/en-US.description.md: -------------------------------------------------------------------------------- 1 | US Testing description -------------------------------------------------------------------------------- /code/test/CoreTemplateStudio.Core.Test/TestData/Templates/test/_catalog/frontendframeworks/TestFramework.md: -------------------------------------------------------------------------------- 1 | Test Framework Base Description -------------------------------------------------------------------------------- /code/test/CoreTemplateStudio.Core.Test/TestData/Templates/test/_catalog/projectTypes/TestProjectType.md: -------------------------------------------------------------------------------- 1 | Test Project Type Base Description -------------------------------------------------------------------------------- /code/test/CoreTemplateStudio.Core.Test/TestData/Templates/test/_catalog/projectTypes/en-US.TestProjectType.md: -------------------------------------------------------------------------------- 1 | Test Project Type Description -------------------------------------------------------------------------------- /code/test/CoreTemplateStudio.Cli.Test/templates/_catalog/backendframeworks/es-ES.TestFramework.md: -------------------------------------------------------------------------------- 1 | Descripción de Backend Framework de prueba -------------------------------------------------------------------------------- /code/test/CoreTemplateStudio.Cli.Test/xunit.runner.json: -------------------------------------------------------------------------------- 1 | { 2 | "parallelizeAssembly": false, 3 | "parallelizeTestCollections": false 4 | } -------------------------------------------------------------------------------- /code/test/CoreTemplateStudio.Core.Test/TestData/Templates/test/FeatureTemplate/.template.config/description.md: -------------------------------------------------------------------------------- 1 | Generic Feature MD description -------------------------------------------------------------------------------- /code/test/CoreTemplateStudio.Core.Test/TestData/Templates/test/FeatureTemplateVB/.template.config/description.md: -------------------------------------------------------------------------------- 1 | Generic Feature MD description -------------------------------------------------------------------------------- /code/test/CoreTemplateStudio.Core.Test/TestData/Templates/test/FeatureTemplateVB/.template.config/en-US.description.md: -------------------------------------------------------------------------------- 1 | US Feature description -------------------------------------------------------------------------------- /code/test/CoreTemplateStudio.Core.Test/TestData/Templates/test/PageTemplate_PropertyBag/.template.config/en-US.description.md: -------------------------------------------------------------------------------- 1 | US description -------------------------------------------------------------------------------- /code/test/CoreTemplateStudio.Core.Test/TestData/Templates/test/ProjectTemplate_FrontAndBack/.template.config/description.md: -------------------------------------------------------------------------------- 1 | template description -------------------------------------------------------------------------------- /code/test/CoreTemplateStudio.Core.Test/TestData/Templates/test/ProjectTemplate_PropertyBag/.template.config/description.md: -------------------------------------------------------------------------------- 1 | template description -------------------------------------------------------------------------------- /code/test/CoreTemplateStudio.Core.Test/TestData/Templates/test/TestingTemplate/.template.config/description.md: -------------------------------------------------------------------------------- 1 | Generic Feature MD description -------------------------------------------------------------------------------- /code/test/CoreTemplateStudio.Core.Test/TestData/Templates/test/TestingTemplateVB/.template.config/description.md: -------------------------------------------------------------------------------- 1 | Generic Testing MD description -------------------------------------------------------------------------------- /code/test/CoreTemplateStudio.Core.Test/TestData/Templates/test/TestingTemplateVB/.template.config/en-US.description.md: -------------------------------------------------------------------------------- 1 | US Testing description -------------------------------------------------------------------------------- /code/test/CoreTemplateStudio.Core.Test/TestData/Templates/test/_catalog/frontendframeworks/en-US.TestFramework.md: -------------------------------------------------------------------------------- 1 | Test Framework Description -------------------------------------------------------------------------------- /code/test/CoreTemplateStudio.Core.Test/TestData/Templates/test/_catalog/projectTypes/es-ES.TestProjectType.md: -------------------------------------------------------------------------------- 1 | Descripción del proyecto de prueba -------------------------------------------------------------------------------- /code/test/CoreTemplateStudio.Core.Test/xunit.runner.json: -------------------------------------------------------------------------------- 1 | { 2 | "parallelizeAssembly": false, 3 | "parallelizeTestCollections": false 4 | } -------------------------------------------------------------------------------- /code/test/CoreTemplateStudio.Core.Test/TestData/Templates/test/PageTemplate/.template.config/es-ES.description.md: -------------------------------------------------------------------------------- 1 | Descripción del proyecto de prueba -------------------------------------------------------------------------------- /code/test/CoreTemplateStudio.Core.Test/TestData/Templates/test/_catalog/backendframeworks/TestFramework.md: -------------------------------------------------------------------------------- 1 | Test Backend Framework Base Description -------------------------------------------------------------------------------- /code/test/CoreTemplateStudio.Core.Test/TestData/Templates/test/_catalog/backendframeworks/en-US.TestFramework.md: -------------------------------------------------------------------------------- 1 | Test Backend Framework Description -------------------------------------------------------------------------------- /code/test/CoreTemplateStudio.Core.Test/TestData/Templates/test/_catalog/frontendframeworks/es-ES.TestFramework.md: -------------------------------------------------------------------------------- 1 | Descripción de Framework de prueba -------------------------------------------------------------------------------- /code/test/CoreTemplateStudio.Core.Test/TestData/Templates/test/FeatureTemplate/.template.config/es-ES.description.md: -------------------------------------------------------------------------------- 1 | Descripción de la Feature de prueba -------------------------------------------------------------------------------- /code/test/CoreTemplateStudio.Core.Test/TestData/Templates/test/FeatureTemplateVB/.template.config/es-ES.description.md: -------------------------------------------------------------------------------- 1 | Descripción de la Feature de prueba -------------------------------------------------------------------------------- /code/test/CoreTemplateStudio.Core.Test/TestData/Templates/test/ServiceTemplate/.template.config/es-ES.description.md: -------------------------------------------------------------------------------- 1 | Descripción del proyecto de prueba -------------------------------------------------------------------------------- /code/test/CoreTemplateStudio.Core.Test/TestData/Templates/test/TestingTemplate/.template.config/es-ES.description.md: -------------------------------------------------------------------------------- 1 | Descripción de la Testing de prueba -------------------------------------------------------------------------------- /code/test/CoreTemplateStudio.Core.Test/TestData/Templates/test/TestingTemplateVB/.template.config/es-ES.description.md: -------------------------------------------------------------------------------- 1 | Descripción de la Testing de prueba -------------------------------------------------------------------------------- /code/test/CoreTemplateStudio.Core.Test/TestData/Templates/test/_catalog/backendframeworks/es-ES.TestFramework.md: -------------------------------------------------------------------------------- 1 | Descripción de Backend Framework de prueba -------------------------------------------------------------------------------- /code/test/CoreTemplateStudio.Core.Test/TestData/Templates/test/PageTemplate_PropertyBag/.template.config/es-ES.description.md: -------------------------------------------------------------------------------- 1 | Descripción del proyecto de prueba -------------------------------------------------------------------------------- /code/tools/WtsTelemetry/.vscode/extensions.json: -------------------------------------------------------------------------------- 1 | { 2 | "recommendations": [ 3 | "ms-azuretools.vscode-azurefunctions", 4 | "ms-dotnettools.csharp" 5 | ] 6 | } 7 | -------------------------------------------------------------------------------- /code/test/Utilities.Test/Packaging/MsSigned/Templates.mstx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/CoreTemplateStudio/HEAD/code/test/Utilities.Test/Packaging/MsSigned/Templates.mstx -------------------------------------------------------------------------------- /code/test/Utilities.Test/Packaging/Unsigned/UnsignedPackage.mstx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/CoreTemplateStudio/HEAD/code/test/Utilities.Test/Packaging/Unsigned/UnsignedPackage.mstx -------------------------------------------------------------------------------- /code/test/CoreTemplateStudio.Core.Test/TestData/TestJson/TestJson_expected.json: -------------------------------------------------------------------------------- 1 | { 2 | "TestKey": { 3 | "jkl": "101112", 4 | "abc": "123", 5 | "def": "456", 6 | "ghi": "789" 7 | } 8 | } -------------------------------------------------------------------------------- /code/test/CoreTemplateStudio.Core.Test/Packaging/MsSigned/Templates.mstx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/CoreTemplateStudio/HEAD/code/test/CoreTemplateStudio.Core.Test/Packaging/MsSigned/Templates.mstx -------------------------------------------------------------------------------- /code/test/CoreTemplateStudio.Cli.Test/templates/_catalog/en-US.frontendframeworks.json: -------------------------------------------------------------------------------- 1 | [ 2 | { 3 | "name": "TestFramework", 4 | "displayName": "Test Framework", 5 | "summary": "Test Framework Summary" 6 | } 7 | ] -------------------------------------------------------------------------------- /code/test/CoreTemplateStudio.Cli.Test/templates/_catalog/en-US.projectTypes.json: -------------------------------------------------------------------------------- 1 | [ 2 | { 3 | "name": "TestProjectType", 4 | "displayName": "Test Project Type", 5 | "summary": "Test Project Type Summary" 6 | } 7 | ] -------------------------------------------------------------------------------- /code/test/CoreTemplateStudio.Cli.Test/templates/_catalog/es-ES.projectTypes.json: -------------------------------------------------------------------------------- 1 | [ 2 | { 3 | "name": "TestProjectType", 4 | "displayName": "Proyecto de prueba", 5 | "summary": "Resumen del proyecto de prueba" 6 | } 7 | ] -------------------------------------------------------------------------------- /code/test/CoreTemplateStudio.Cli.Test/templates/ProjectTemplate/.template.config/icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/CoreTemplateStudio/HEAD/code/test/CoreTemplateStudio.Cli.Test/templates/ProjectTemplate/.template.config/icon.png -------------------------------------------------------------------------------- /code/test/CoreTemplateStudio.Cli.Test/templates/_catalog/en-US.backendframeworks.json: -------------------------------------------------------------------------------- 1 | [ 2 | { 3 | "name": "TestFramework", 4 | "displayName": "Test Backend Framework", 5 | "summary": "Test Backend Framework Summary" 6 | } 7 | ] -------------------------------------------------------------------------------- /code/test/CoreTemplateStudio.Cli.Test/templates/_catalog/es-ES.frontendframeworks.json: -------------------------------------------------------------------------------- 1 | [ 2 | { 3 | "name": "TestFramework", 4 | "displayName": "Framework de prueba", 5 | "summary": "Resumen de Framework de prueba" 6 | } 7 | ] -------------------------------------------------------------------------------- /code/test/CoreTemplateStudio.Core.Test/TestData/Templates/test/_catalog/en-US.frontendframeworks.json: -------------------------------------------------------------------------------- 1 | [ 2 | { 3 | "name": "TestFramework", 4 | "displayName": "Test Framework", 5 | "summary": "Test Framework Summary" 6 | } 7 | ] -------------------------------------------------------------------------------- /code/test/CoreTemplateStudio.Core.Test/TestData/Templates/test/_catalog/en-US.projectTypes.json: -------------------------------------------------------------------------------- 1 | [ 2 | { 3 | "name": "TestProjectType", 4 | "displayName": "Test Project Type", 5 | "summary": "Test Project Type Summary" 6 | } 7 | ] -------------------------------------------------------------------------------- /code/test/CoreTemplateStudio.Core.Test/TestData/Templates/test/_catalog/es-ES.projectTypes.json: -------------------------------------------------------------------------------- 1 | [ 2 | { 3 | "name": "TestProjectType", 4 | "displayName": "Proyecto de prueba", 5 | "summary": "Resumen del proyecto de prueba" 6 | } 7 | ] -------------------------------------------------------------------------------- /code/test/CoreTemplateStudio.Cli.Test/templates/_catalog/es-ES.backendframeworks.json: -------------------------------------------------------------------------------- 1 | [ 2 | { 3 | "name": "TestFramework", 4 | "displayName": "Backend Framework de prueba", 5 | "summary": "Resumen de Backend Framework de prueba" 6 | } 7 | ] -------------------------------------------------------------------------------- /code/test/CoreTemplateStudio.Core.Test/TestData/Templates/test/_catalog/en-US.backendframeworks.json: -------------------------------------------------------------------------------- 1 | [ 2 | { 3 | "name": "TestFramework", 4 | "displayName": "Test Backend Framework", 5 | "summary": "Test Backend Framework Summary" 6 | } 7 | ] -------------------------------------------------------------------------------- /code/test/CoreTemplateStudio.Core.Test/TestData/Templates/test/_catalog/es-ES.frontendframeworks.json: -------------------------------------------------------------------------------- 1 | [ 2 | { 3 | "name": "TestFramework", 4 | "displayName": "Framework de prueba", 5 | "summary": "Resumen de Framework de prueba" 6 | } 7 | ] -------------------------------------------------------------------------------- /code/tools/WtsTelemetry/Models/AppInsightConfig.cs: -------------------------------------------------------------------------------- 1 | namespace WtsTelemetry.Models 2 | { 3 | public class AppInsightConfig 4 | { 5 | public string AppId { get; set; } 6 | public string AppKey { get; set; } 7 | } 8 | } 9 | -------------------------------------------------------------------------------- /code/src/CoreTemplateStudio/CoreTemplateStudio.Cli/appsettings.Development.json: -------------------------------------------------------------------------------- 1 | { 2 | "Logging": { 3 | "LogLevel": { 4 | "Default": "Debug", 5 | "System": "Information", 6 | "Microsoft": "Information" 7 | } 8 | } 9 | } 10 | -------------------------------------------------------------------------------- /code/test/CoreTemplateStudio.Cli.Test/templates/PageTemplate/.template.config/en-US.template.json: -------------------------------------------------------------------------------- 1 | { 2 | "author": "Microsoft USA", 3 | "name": "PageTemplate", 4 | "description": "US English...", 5 | "identity": "Microsoft.Templates.Test.PageTemplate.CSharp" 6 | } -------------------------------------------------------------------------------- /code/test/CoreTemplateStudio.Core.Test/TestData/Templates/test/ProjectTemplate/.template.config/icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/CoreTemplateStudio/HEAD/code/test/CoreTemplateStudio.Core.Test/TestData/Templates/test/ProjectTemplate/.template.config/icon.png -------------------------------------------------------------------------------- /code/test/CoreTemplateStudio.Core.Test/TestData/Templates/test/_catalog/es-ES.backendframeworks.json: -------------------------------------------------------------------------------- 1 | [ 2 | { 3 | "name": "TestFramework", 4 | "displayName": "Backend Framework de prueba", 5 | "summary": "Resumen de Backend Framework de prueba" 6 | } 7 | ] -------------------------------------------------------------------------------- /code/test/CoreTemplateStudio.Cli.Test/templates/PageTemplate/.template.config/es-ES.template.json: -------------------------------------------------------------------------------- 1 | { 2 | "author": "Microsoft España", 3 | "name": "PageTemplate", 4 | "description": "Está en Español...", 5 | "identity": "Microsoft.Templates.Test.PageTemplate.CSharp" 6 | } -------------------------------------------------------------------------------- /code/test/CoreTemplateStudio.Core.Test/TestData/SearchReplace/Source_searchreplace.cs: -------------------------------------------------------------------------------- 1 | public sealed partial class MyPage : Page, INotifyPropertyChanged 2 | ^^^-searchabove-replacebelow-vvv 3 | public sealed partial class MyPage : Page, INotifyPropertyChanged, IPivotPage 4 | -------------------------------------------------------------------------------- /code/test/CoreTemplateStudio.Core.Test/TestData/Templates/test/ProjectTemplateVB/.template.config/icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/CoreTemplateStudio/HEAD/code/test/CoreTemplateStudio.Core.Test/TestData/Templates/test/ProjectTemplateVB/.template.config/icon.png -------------------------------------------------------------------------------- /code/test/CoreTemplateStudio.Core.Test/TestData/SearchReplace/NoSource_searchreplace.cs: -------------------------------------------------------------------------------- 1 | public sealed partial class MyPage : Page, INotifyPropertyChanged 2 | ^^^-searchabove-replacebelow-vvv 3 | public sealed partial class MyPage : Page, INotifyPropertyChanged, IPivotPage 4 | -------------------------------------------------------------------------------- /code/test/CoreTemplateStudio.Core.Test/TestData/Templates/test/projectNameValidation.config.json: -------------------------------------------------------------------------------- 1 | { 2 | "regexs" : [ 3 | { 4 | "name": "projectStartWith$", 5 | "pattern": "^[^\\$]" 6 | } 7 | ], 8 | "reservedNames" : [ 9 | ] 10 | } -------------------------------------------------------------------------------- /.github/CODEOWNERS: -------------------------------------------------------------------------------- 1 | # Code owners below will be automatically assigned as automatic PR reviewers: 2 | * @mikebattista @trevorNgo @Kai-Bailey @amrrsharaff @dandua98 @ngkelly3 @SahilTara @KirillShchetinin @mohannad-abwah @tejbirsingh @markAtMicrosoft @sibille @mvegaca @dgomezc @prupipho 3 | -------------------------------------------------------------------------------- /code/test/CoreTemplateStudio.Core.Test/TestData/Templates/test/PageTemplate/.template.config/en-US.template.json: -------------------------------------------------------------------------------- 1 | { 2 | "author": "Microsoft USA", 3 | "name": "PageTemplate", 4 | "description": "US English...", 5 | "identity": "Microsoft.Templates.Test.PageTemplate.CSharp" 6 | } -------------------------------------------------------------------------------- /code/test/CoreTemplateStudio.Core.Test/TestData/Templates/test/PageTemplate/.template.config/es-ES.template.json: -------------------------------------------------------------------------------- 1 | { 2 | "author": "Microsoft España", 3 | "name": "PageTemplate", 4 | "description": "Está en Español...", 5 | "identity": "Microsoft.Templates.Test.PageTemplate.CSharp" 6 | } -------------------------------------------------------------------------------- /code/test/CoreTemplateStudio.Core.Test/TestData/Templates/test/ProjectTemplate_FrontAndBack/.template.config/icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/CoreTemplateStudio/HEAD/code/test/CoreTemplateStudio.Core.Test/TestData/Templates/test/ProjectTemplate_FrontAndBack/.template.config/icon.png -------------------------------------------------------------------------------- /code/test/CoreTemplateStudio.Core.Test/TestData/Templates/test/ProjectTemplate_PropertyBag/.template.config/icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/CoreTemplateStudio/HEAD/code/test/CoreTemplateStudio.Core.Test/TestData/Templates/test/ProjectTemplate_PropertyBag/.template.config/icon.png -------------------------------------------------------------------------------- /code/test/CoreTemplateStudio.Core.Test/TestData/Templates/test/ServiceTemplate/.template.config/en-US.template.json: -------------------------------------------------------------------------------- 1 | { 2 | "author": "Microsoft USA", 3 | "name": "ServiceTemplate", 4 | "description": "US English...", 5 | "identity": "Microsoft.Templates.Test.ServiceTemplate.CSharp" 6 | } -------------------------------------------------------------------------------- /code/test/CoreTemplateStudio.Core.Test/Config/Ok.config.valid.json: -------------------------------------------------------------------------------- 1 | { 2 | "CdnUrl": "myCdnUrldata", 3 | "RemoteTelemetryKey": "myRemoteTelemetryKey", 4 | "LogFileFolderPath": "WindowsTemplateStudio\\Logs", 5 | "DiagnosticsTraceLevel": "Information", 6 | "DaysToKeepDiagnosticsLogs": 15 7 | } -------------------------------------------------------------------------------- /code/test/CoreTemplateStudio.Core.Test/TestData/Templates/test/FeatureTemplate/.template.config/en-US.template.json: -------------------------------------------------------------------------------- 1 | { 2 | "author": "Microsoft USA", 3 | "name": "FeatureTemplate", 4 | "description": "Feature US English...", 5 | "identity": "Microsoft.Templates.Test.FeatureTemplate.CSharp" 6 | } -------------------------------------------------------------------------------- /code/test/CoreTemplateStudio.Core.Test/TestData/Templates/test/FeatureTemplateVB/.template.config/en-US.template.json: -------------------------------------------------------------------------------- 1 | { 2 | "author": "Microsoft USA", 3 | "name": "FeatureTemplate", 4 | "description": "Feature US English...", 5 | "identity": "Microsoft.Templates.Test.FeatureTemplate.VB" 6 | } -------------------------------------------------------------------------------- /code/test/CoreTemplateStudio.Core.Test/TestData/Templates/test/ServiceTemplate/.template.config/es-ES.template.json: -------------------------------------------------------------------------------- 1 | { 2 | "author": "Microsoft España", 3 | "name": "ServiceTemplate", 4 | "description": "Está en Español...", 5 | "identity": "Microsoft.Templates.Test.ServiceTemplate.CSharp" 6 | } -------------------------------------------------------------------------------- /code/test/CoreTemplateStudio.Core.Test/TestData/Templates/test/TestingTemplate/.template.config/en-US.template.json: -------------------------------------------------------------------------------- 1 | { 2 | "author": "Microsoft USA", 3 | "name": "TestingTemplate", 4 | "description": "Testing US English...", 5 | "identity": "Microsoft.Templates.Test.TestingTemplate.CSharp" 6 | } -------------------------------------------------------------------------------- /code/test/CoreTemplateStudio.Core.Test/TestData/Templates/test/TestingTemplateVB/.template.config/en-US.template.json: -------------------------------------------------------------------------------- 1 | { 2 | "author": "Microsoft USA", 3 | "name": "TestingTemplate", 4 | "description": "Testing US English...", 5 | "identity": "Microsoft.Templates.Test.TestingTemplate.VB" 6 | } -------------------------------------------------------------------------------- /code/tools/WtsTelemetry/Models/QueryData.cs: -------------------------------------------------------------------------------- 1 | namespace WtsTelemetry.Models 2 | { 3 | public class QueryData 4 | { 5 | public string Name { get; set; } 6 | public string DisplayName { get; set; } 7 | public double Value { get; set; } 8 | } 9 | } 10 | -------------------------------------------------------------------------------- /code/tools/WtsTelemetry/host.json: -------------------------------------------------------------------------------- 1 | { 2 | "version": "2.0", 3 | "logging": { 4 | "applicationInsights": { 5 | "samplingExcludedTypes": "Request", 6 | "samplingSettings": { 7 | "isEnabled": true 8 | } 9 | } 10 | } 11 | } -------------------------------------------------------------------------------- /code/test/CoreTemplateStudio.Core.Test/TestData/Templates/test/FeatureTemplate/.template.config/es-ES.template.json: -------------------------------------------------------------------------------- 1 | { 2 | "author": "Microsoft España", 3 | "name": "FeatureTemplate", 4 | "description": "Está en Español (Feature)...", 5 | "identity": "Microsoft.Templates.Test.FeatureTemplate.CSharp" 6 | } -------------------------------------------------------------------------------- /code/test/CoreTemplateStudio.Core.Test/TestData/Templates/test/FeatureTemplateVB/.template.config/es-ES.template.json: -------------------------------------------------------------------------------- 1 | { 2 | "author": "Microsoft España", 3 | "name": "FeatureTemplate", 4 | "description": "Está en Español (Feature)...", 5 | "identity": "Microsoft.Templates.Test.FeatureTemplate.VB" 6 | } -------------------------------------------------------------------------------- /code/test/CoreTemplateStudio.Core.Test/TestData/Templates/test/TestingTemplate/.template.config/es-ES.template.json: -------------------------------------------------------------------------------- 1 | { 2 | "author": "Microsoft España", 3 | "name": "TestingTemplate", 4 | "description": "Está en Español (Testing)...", 5 | "identity": "Microsoft.Templates.Test.TestingTemplate.CSharp" 6 | } -------------------------------------------------------------------------------- /code/test/CoreTemplateStudio.Core.Test/TestData/Templates/test/TestingTemplateVB/.template.config/es-ES.template.json: -------------------------------------------------------------------------------- 1 | { 2 | "author": "Microsoft España", 3 | "name": "TestingTemplate", 4 | "description": "Está en Español (Testing)...", 5 | "identity": "Microsoft.Templates.Test.TestingTemplate.VB" 6 | } -------------------------------------------------------------------------------- /code/tools/WtsTelemetry/Models/GithubConfig.cs: -------------------------------------------------------------------------------- 1 | namespace WtsTelemetry.Models 2 | { 3 | public class GithubConfig 4 | { 5 | public string AccessToken { get; set; } 6 | public string Owner { get; set; } 7 | public string RepositoryName { get; set; } 8 | } 9 | } 10 | -------------------------------------------------------------------------------- /code/test/CoreTemplateStudio.Core.Test/TestData/Templates/test/PageTemplate_PropertyBag/.template.config/en-US.template.json: -------------------------------------------------------------------------------- 1 | { 2 | "author": "Microsoft USA", 3 | "name": "PageTemplatePropertyBag", 4 | "description": "US English...", 5 | "identity": "Microsoft.Templates.Test.PageTemplatePropertyBag.CSharp" 6 | } -------------------------------------------------------------------------------- /code/test/CoreTemplateStudio.Core.Test/TestData/SearchReplace/Source.cs: -------------------------------------------------------------------------------- 1 | namespace MyNamespace.Views 2 | { 3 | public sealed partial class MyPage : Page, INotifyPropertyChanged 4 | { 5 | public MyPage() 6 | { 7 | InitializeComponent(); 8 | } 9 | } 10 | } 11 | -------------------------------------------------------------------------------- /code/test/CoreTemplateStudio.Core.Test/TestData/Templates/test/PageTemplate_PropertyBag/.template.config/es-ES.template.json: -------------------------------------------------------------------------------- 1 | { 2 | "author": "Microsoft España", 3 | "name": "PageTemplatePropertyBag", 4 | "description": "Está en Español...", 5 | "identity": "Microsoft.Templates.Test.PageTemplatePropertyBag.CSharp" 6 | } -------------------------------------------------------------------------------- /code/tools/WtsTelemetry/.vscode/settings.json: -------------------------------------------------------------------------------- 1 | { 2 | "azureFunctions.deploySubpath": "bin/Release/netcoreapp3.1/publish", 3 | "azureFunctions.projectLanguage": "C#", 4 | "azureFunctions.projectRuntime": "~3", 5 | "debug.internalConsoleOptions": "neverOpen", 6 | "azureFunctions.preDeployTask": "publish" 7 | } -------------------------------------------------------------------------------- /code/test/CoreTemplateStudio.Core.Test/TestData/SearchReplace/Source_expected.cs: -------------------------------------------------------------------------------- 1 | namespace MyNamespace.Views 2 | { 3 | public sealed partial class MyPage : Page, INotifyPropertyChanged, IPivotPage 4 | { 5 | public MyPage() 6 | { 7 | InitializeComponent(); 8 | } 9 | } 10 | } 11 | -------------------------------------------------------------------------------- /code/tools/WtsTelemetry/.vscode/launch.json: -------------------------------------------------------------------------------- 1 | { 2 | "version": "0.2.0", 3 | "configurations": [ 4 | { 5 | "name": "Attach to .NET Functions", 6 | "type": "coreclr", 7 | "request": "attach", 8 | "processId": "${command:azureFunctions.pickProcess}" 9 | } 10 | ] 11 | } -------------------------------------------------------------------------------- /code/test/CoreTemplateStudio.Cli.Test/templates/_catalog/frontendframeworks.json: -------------------------------------------------------------------------------- 1 | [ 2 | { 3 | "name": "TestFramework", 4 | "displayName": "Test Framework Base", 5 | "summary": "Test Framework Base Summary", 6 | "author": "Microsoft", 7 | "platforms": [ "Web" ], 8 | "order": "1", 9 | "licenses": "" 10 | } 11 | ] -------------------------------------------------------------------------------- /code/test/CoreTemplateStudio.Cli.Test/templates/_catalog/projectTypes.json: -------------------------------------------------------------------------------- 1 | [ 2 | { 3 | "name": "TestProjectType", 4 | "displayName": "Test Project Type Base", 5 | "summary": "Test Project Type Base Summary", 6 | "author": "Microsoft", 7 | "platforms": [ "Web" ], 8 | "order": "1", 9 | "licenses": "" 10 | } 11 | ] -------------------------------------------------------------------------------- /code/test/CoreTemplateStudio.Core.Test/TestData/Templates/test/_catalog/frontendframeworks.json: -------------------------------------------------------------------------------- 1 | [ 2 | { 3 | "name": "TestFramework", 4 | "displayName": "Test Framework Base", 5 | "summary": "Test Framework Base Summary", 6 | "author": "Microsoft", 7 | "order": "1", 8 | "licenses": "", 9 | "platform": "test" 10 | } 11 | ] -------------------------------------------------------------------------------- /code/test/CoreTemplateStudio.Cli.Test/templates/_catalog/backendframeworks.json: -------------------------------------------------------------------------------- 1 | [ 2 | { 3 | "name": "TestFramework", 4 | "displayName": "Test Backend Framework Base", 5 | "summary": "Test Backend Framework Base Summary", 6 | "platforms": [ "test" ], 7 | "author": "Microsoft", 8 | "order": "1", 9 | "licenses": "" 10 | } 11 | ] -------------------------------------------------------------------------------- /code/test/CoreTemplateStudio.Core.Test/TestData/Templates/test/_catalog/projectTypes.json: -------------------------------------------------------------------------------- 1 | [ 2 | { 3 | "name": "TestProjectType", 4 | "displayName": "Test Project Type Base", 5 | "summary": "Test Project Type Base Summary", 6 | "author": "Microsoft", 7 | "order": "1", 8 | "licenses": "", 9 | "platform": "test" 10 | } 11 | ] -------------------------------------------------------------------------------- /code/test/CoreTemplateStudio.Core.Test/TestData/Merge/Style.xaml: -------------------------------------------------------------------------------- 1 | 4 | 5 | 28 6 | 16 7 | 8 | -------------------------------------------------------------------------------- /code/test/CoreTemplateStudio.Cli.Test/templates/ProjectTemplate/.template.config/Layout.json: -------------------------------------------------------------------------------- 1 | [ 2 | { 3 | "name": "Item1", 4 | "templateGroupIdentity": "Microsoft.UWPTemplates.Test.ProjectTemplate", 5 | "readonly": "true" 6 | }, 7 | { 8 | "name": "Item2", 9 | "templateGroupIdentity": "Microsoft.UWPTemplates.Test.PageTemplate", 10 | "readonly": "false" 11 | } 12 | ] -------------------------------------------------------------------------------- /code/test/CoreTemplateStudio.Core.Test/TestData/Templates/test/_catalog/backendframeworks.json: -------------------------------------------------------------------------------- 1 | [ 2 | { 3 | "name": "TestFramework", 4 | "displayName": "Test Backend Framework Base", 5 | "summary": "Test Backend Framework Base Summary", 6 | "platforms": [ "test" ], 7 | "author": "Microsoft", 8 | "order": "1", 9 | "licenses": "", 10 | "platform": "test" 11 | } 12 | ] -------------------------------------------------------------------------------- /code/src/CoreTemplateStudio/CoreTemplateStudio.Core/Gen/IWindow.cs: -------------------------------------------------------------------------------- 1 | // Licensed to the .NET Foundation under one or more agreements. 2 | // The .NET Foundation licenses this file to you under the MIT license. 3 | // See the LICENSE file in the project root for more information. 4 | 5 | namespace Microsoft.Templates.Core.Gen 6 | { 7 | public interface IWindow 8 | { 9 | } 10 | } 11 | -------------------------------------------------------------------------------- /code/test/CoreTemplateStudio.Core.Test/TestData/Templates/test/ProjectTemplate/.template.config/Layout.json: -------------------------------------------------------------------------------- 1 | [ 2 | { 3 | "name": "Item1", 4 | "templateGroupIdentity": "Microsoft.UWPTemplates.Test.ProjectTemplate", 5 | "readonly": "true" 6 | }, 7 | { 8 | "name": "Item2", 9 | "templateGroupIdentity": "Microsoft.UWPTemplates.Test.PageTemplate", 10 | "readonly": "false" 11 | } 12 | ] -------------------------------------------------------------------------------- /code/test/CoreTemplateStudio.Core.Test/TestData/Templates/test/ProjectTemplateVB/.template.config/Layout.json: -------------------------------------------------------------------------------- 1 | [ 2 | { 3 | "name": "Item1", 4 | "templateGroupIdentity": "Microsoft.UWPTemplates.Test.ProjectTemplate", 5 | "readonly": "true" 6 | }, 7 | { 8 | "name": "Item2", 9 | "templateGroupIdentity": "Microsoft.UWPTemplates.Test.PageTemplate", 10 | "readonly": "false" 11 | } 12 | ] 13 | -------------------------------------------------------------------------------- /code/test/CoreTemplateStudio.Core.Test/TestData/Templates/test/ProjectTemplate_PropertyBag/.template.config/Layout.json: -------------------------------------------------------------------------------- 1 | [ 2 | { 3 | "name": "Item1", 4 | "templateGroupIdentity": "Microsoft.UWPTemplates.Test.ProjectTemplate", 5 | "readonly": "true" 6 | }, 7 | { 8 | "name": "Item2", 9 | "templateGroupIdentity": "Microsoft.UWPTemplates.Test.PageTemplate", 10 | "readonly": "false" 11 | } 12 | ] -------------------------------------------------------------------------------- /code/test/CoreTemplateStudio.Core.Test/TestData/Templates/test/ProjectTemplate_FrontAndBack/.template.config/Layout.json: -------------------------------------------------------------------------------- 1 | [ 2 | { 3 | "name": "Item1", 4 | "templateGroupIdentity": "Microsoft.UWPTemplates.Test.ProjectTemplate", 5 | "readonly": "true" 6 | }, 7 | { 8 | "name": "Item2", 9 | "templateGroupIdentity": "Microsoft.UWPTemplates.Test.PageTemplate", 10 | "readonly": "false" 11 | } 12 | ] -------------------------------------------------------------------------------- /code/src/CoreTemplateStudio/CoreTemplateStudio.Cli/Commands/Contracts/ICommand.cs: -------------------------------------------------------------------------------- 1 | // Licensed to the .NET Foundation under one or more agreements. 2 | // The .NET Foundation licenses this file to you under the MIT license. 3 | // See the LICENSE file in the project root for more information. 4 | 5 | namespace Microsoft.Templates.Cli.Commands.Contracts 6 | { 7 | public interface ICommand 8 | { 9 | } 10 | } 11 | -------------------------------------------------------------------------------- /code/src/CoreTemplateStudio/CoreTemplateStudio.Core/Validation/IValidator.cs: -------------------------------------------------------------------------------- 1 | // Licensed to the .NET Foundation under one or more agreements. 2 | // The .NET Foundation licenses this file to you under the MIT license. 3 | // See the LICENSE file in the project root for more information. 4 | 5 | namespace Microsoft.Templates.Core.Validation 6 | { 7 | public interface IValidator 8 | { 9 | ValidationResult Validate(); 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /code/src/CoreTemplateStudio/CoreTemplateStudio.Core/Templates/MetadataType.cs: -------------------------------------------------------------------------------- 1 | // Licensed to the .NET Foundation under one or more agreements. 2 | // The .NET Foundation licenses this file to you under the MIT license. 3 | // See the LICENSE file in the project root for more information. 4 | 5 | namespace Microsoft.Templates.Core 6 | { 7 | public enum MetadataType 8 | { 9 | ProjectType = 0, 10 | Framework = 1, 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /code/src/CoreTemplateStudio/CoreTemplateStudio.Core/Composition/QueryOperator.cs: -------------------------------------------------------------------------------- 1 | // Licensed to the .NET Foundation under one or more agreements. 2 | // The .NET Foundation licenses this file to you under the MIT license. 3 | // See the LICENSE file in the project root for more information. 4 | 5 | namespace Microsoft.Templates.Core.Composition 6 | { 7 | public enum QueryOperator 8 | { 9 | Equals, 10 | NotEquals, 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /code/tools/WtsTelemetry/local.settings.json: -------------------------------------------------------------------------------- 1 | { 2 | "IsEncrypted": false, 3 | "Values": { 4 | "AzureWebJobsStorage": "UseDevelopmentStorage=true", 5 | "WinTS-AppId": "", 6 | "WinTS-ApiKey": "", 7 | "WebTS-AppId": "", 8 | "WebTS-ApiKey": "", 9 | "Github-AccessToken": "", 10 | "Github-RepositoryOwner": "", 11 | "WinTS-RepositoryName": "", 12 | "WebTS-RepositoryName": "", 13 | "FUNCTIONS_WORKER_RUNTIME": "dotnet" 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /docs/PULL_REQUEST_TEMPLATE.md: -------------------------------------------------------------------------------- 1 | ## PR checklist 2 | 3 | - Quick summary of changes 4 | - Which issue does this PR relate to? 5 | - Anything that requires particular review or attention? 6 | - Do all automated tests pass? 7 | - Have automated tests been added for new features? 8 | - Have you raised issues for any needed follow-on work? 9 | - Have docs been updated? 10 | - If breaking changes or different ways of doing things have been introduced, have they been communicated widely? -------------------------------------------------------------------------------- /code/src/CoreTemplateStudio/CoreTemplateStudio.Core/Diagnostics/GenSourceEnum.cs: -------------------------------------------------------------------------------- 1 | // Licensed to the .NET Foundation under one or more agreements. 2 | // The .NET Foundation licenses this file to you under the MIT license. 3 | // See the LICENSE file in the project root for more information. 4 | 5 | namespace Microsoft.Templates.Core.Diagnostics 6 | { 7 | public enum GenSourceEnum 8 | { 9 | NewProject = 0, 10 | NewItem = 1, 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /code/src/CoreTemplateStudio/CoreTemplateStudio.Core/Templates/TemplateOutputType.cs: -------------------------------------------------------------------------------- 1 | // Licensed to the .NET Foundation under one or more agreements. 2 | // The .NET Foundation licenses this file to you under the MIT license. 3 | // See the LICENSE file in the project root for more information. 4 | 5 | namespace Microsoft.Templates.Core 6 | { 7 | public enum TemplateOutputType 8 | { 9 | Project, 10 | Item, 11 | Unspecified, 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /code/test/CoreTemplateStudio.Core.Test/TestData/Templates/test/itemNameValidation.config.json: -------------------------------------------------------------------------------- 1 | { 2 | "regexs" : [ 3 | { 4 | "name": "itemEndsWithPage", 5 | "pattern": ".*(? 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | -------------------------------------------------------------------------------- /code/src/CoreTemplateStudio/CoreTemplateStudio.Cli/Commands/Contracts/ICommandHandler`1.cs: -------------------------------------------------------------------------------- 1 | // Licensed to the .NET Foundation under one or more agreements. 2 | // The .NET Foundation licenses this file to you under the MIT license. 3 | // See the LICENSE file in the project root for more information. 4 | 5 | using System.Threading.Tasks; 6 | 7 | namespace Microsoft.Templates.Cli.Commands.Contracts 8 | { 9 | public interface ICommandHandler 10 | where T : ICommand 11 | { 12 | Task ExecuteAsync(T command); 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /code/src/CoreTemplateStudio/CoreTemplateStudio.Core/Diagnostics/HealthWriters.cs: -------------------------------------------------------------------------------- 1 | // Licensed to the .NET Foundation under one or more agreements. 2 | // The .NET Foundation licenses this file to you under the MIT license. 3 | // See the LICENSE file in the project root for more information. 4 | 5 | using System.Collections.Generic; 6 | 7 | namespace Microsoft.Templates.Core.Diagnostics 8 | { 9 | internal static class HealthWriters 10 | { 11 | public static List Available { get; } = new List(); 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /code/src/CoreTemplateStudio/CoreTemplateStudio.Core/Gen/LayoutInfo.cs: -------------------------------------------------------------------------------- 1 | // Licensed to the .NET Foundation under one or more agreements. 2 | // The .NET Foundation licenses this file to you under the MIT license. 3 | // See the LICENSE file in the project root for more information. 4 | 5 | using Microsoft.TemplateEngine.Abstractions; 6 | 7 | namespace Microsoft.Templates.Core.Gen 8 | { 9 | public class LayoutInfo 10 | { 11 | public LayoutItem Layout { get; set; } 12 | 13 | public TemplateInfo Template { get; set; } 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /code/src/CoreTemplateStudio/CoreTemplateStudio.Cli/Commands/Contracts/ICommandDispatcher.cs: -------------------------------------------------------------------------------- 1 | // Licensed to the .NET Foundation under one or more agreements. 2 | // The .NET Foundation licenses this file to you under the MIT license. 3 | // See the LICENSE file in the project root for more information. 4 | 5 | using System.Threading.Tasks; 6 | 7 | namespace Microsoft.Templates.Cli.Commands.Contracts 8 | { 9 | public interface ICommandDispatcher 10 | { 11 | Task DispatchAsync(T command) 12 | where T : ICommand; 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /code/src/CoreTemplateStudio/CoreTemplateStudio.Core/Gen/UserSelectionItem.cs: -------------------------------------------------------------------------------- 1 | // Licensed to the .NET Foundation under one or more agreements. 2 | // The .NET Foundation licenses this file to you under the MIT license. 3 | // See the LICENSE file in the project root for more information. 4 | 5 | using Microsoft.TemplateEngine.Abstractions; 6 | 7 | namespace Microsoft.Templates.Core.Gen 8 | { 9 | public class UserSelectionItem 10 | { 11 | public string Name { get; set; } 12 | 13 | public string TemplateId { get; set; } 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /code/src/CoreTemplateStudio/CoreTemplateStudio.Core/Locations/ProgressEventArgs.cs: -------------------------------------------------------------------------------- 1 | // Licensed to the .NET Foundation under one or more agreements. 2 | // The .NET Foundation licenses this file to you under the MIT license. 3 | // See the LICENSE file in the project root for more information. 4 | 5 | using System; 6 | 7 | namespace Microsoft.Templates.Core.Locations 8 | { 9 | public sealed class ProgressEventArgs : EventArgs 10 | { 11 | public Version Version { get; set; } 12 | 13 | public int Progress { get; set; } 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /code/src/CoreTemplateStudio/CoreTemplateStudio.Core/PostActions/Catalog/Merge/MergeFailureType.cs: -------------------------------------------------------------------------------- 1 | // Licensed to the .NET Foundation under one or more agreements. 2 | // The .NET Foundation licenses this file to you under the MIT license. 3 | // See the LICENSE file in the project root for more information. 4 | 5 | namespace Microsoft.Templates.Core.PostActions.Catalog.Merge 6 | { 7 | public enum MergeFailureType 8 | { 9 | FileNotFound, 10 | LineNotFound, 11 | KeyAlreadyDefined, 12 | MismatchedEncoding, 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /code/test/CoreTemplateStudio.Core.Test/TestData/Templates/test/UnspecifiedTemplateVB/.template.config/template.json: -------------------------------------------------------------------------------- 1 | { 2 | "author": "Microsoft", 3 | "classifications": [ "Test" ], 4 | "name": "UnspecifiedTemplate", 5 | "groupIdentity": "Microsoft.Templates.Test.UnspecifiedTemplate", 6 | "identity": "Microsoft.Templates.Test.UnspecifiedTemplate.VisualBasic", 7 | "shortName": "unspecified-test", 8 | "tags": { 9 | "language": "VisualBasic", 10 | "wts.platform": "test" 11 | 12 | }, 13 | "sourceName": "App_Name", 14 | "preferNameDirectory": true 15 | } 16 | -------------------------------------------------------------------------------- /code/src/CoreTemplateStudio/CoreTemplateStudio.Core/PostActions/Catalog/Merge/MergeMode.cs: -------------------------------------------------------------------------------- 1 | // Licensed to the .NET Foundation under one or more agreements. 2 | // The .NET Foundation licenses this file to you under the MIT license. 3 | // See the LICENSE file in the project root for more information. 4 | 5 | namespace Microsoft.Templates.Core.PostActions.Catalog.Merge 6 | { 7 | public enum MergeMode 8 | { 9 | InsertBefore, 10 | Insert, 11 | Remove, 12 | Documentation, 13 | Context, 14 | OptionalContext, 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /code/src/CoreTemplateStudio/CoreTemplateStudio.Cli/Commands/GetProjectTypesCommand.cs: -------------------------------------------------------------------------------- 1 | // Licensed to the .NET Foundation under one or more agreements. 2 | // The .NET Foundation licenses this file to you under the MIT license. 3 | // See the LICENSE file in the project root for more information. 4 | 5 | using CommandLine; 6 | using Microsoft.Templates.Cli.Commands.Contracts; 7 | 8 | namespace Microsoft.Templates.Cli.Commands 9 | { 10 | [Verb("getprojecttypes", HelpText = "Get project types.")] 11 | public class GetProjectTypesCommand : ICommand 12 | { 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /code/src/CoreTemplateStudio/CoreTemplateStudio.Core/Validation/ValidationMessage.cs: -------------------------------------------------------------------------------- 1 | // Licensed to the .NET Foundation under one or more agreements. 2 | // The .NET Foundation licenses this file to you under the MIT license. 3 | // See the LICENSE file in the project root for more information. 4 | 5 | namespace Microsoft.Templates.Core.Validation 6 | { 7 | public class ValidationMessage 8 | { 9 | public string Message { get; set; } 10 | 11 | public string Url { get; set; } 12 | 13 | public string HyperLinkMessage { get; set; } 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /code/test/CoreTemplateStudio.Core.Test/TestData/Templates/test/Requirements.FeatureTemplate.r1/.template.config/template.json: -------------------------------------------------------------------------------- 1 | { 2 | "author": "Microsoft", 3 | "classifications": [ "Test" ], 4 | "name": "r1", 5 | "groupIdentity": "r1", 6 | "identity": "r1", 7 | "shortName": "r1", 8 | "tags": { 9 | "language": "C#", 10 | "type": "item", 11 | "wts.platform": "test", 12 | "wts.type": "feature", 13 | "wts.multipleInstance": "false", 14 | "wts.projecttype": "all", 15 | "wts.frontendframework": "all" 16 | }, 17 | "sourceName": "App_Name", 18 | "preferNameDirectory": true 19 | } -------------------------------------------------------------------------------- /code/test/CoreTemplateStudio.Core.Test/TestData/Templates/test/Requirements.FeatureTemplate.r2/.template.config/template.json: -------------------------------------------------------------------------------- 1 | { 2 | "author": "Microsoft", 3 | "classifications": [ "Test" ], 4 | "name": "r2", 5 | "groupIdentity": "r2", 6 | "identity": "r2", 7 | "shortName": "r2", 8 | "tags": { 9 | "language": "C#", 10 | "type": "item", 11 | "wts.platform": "test", 12 | "wts.type": "feature", 13 | "wts.multipleInstance": "false", 14 | "wts.projecttype": "all", 15 | "wts.frontendframework": "all" 16 | }, 17 | "sourceName": "App_Name", 18 | "preferNameDirectory": true 19 | } -------------------------------------------------------------------------------- /code/test/CoreTemplateStudio.Core.Test/TestData/Templates/test/Dependencies.FeatureTemplate.dp1/.template.config/template.json: -------------------------------------------------------------------------------- 1 | { 2 | "author": "Microsoft", 3 | "classifications": [ "Test" ], 4 | "name": "dp1", 5 | "groupIdentity": "dp1", 6 | "identity": "dp1", 7 | "shortName": "dp1", 8 | "tags": { 9 | "language": "C#", 10 | "type": "item", 11 | "wts.platform": "test", 12 | "wts.type": "feature", 13 | "wts.multipleInstance": "false", 14 | "wts.projecttype": "all", 15 | "wts.frontendframework": "all" 16 | }, 17 | "sourceName": "App_Name", 18 | "preferNameDirectory": true 19 | } -------------------------------------------------------------------------------- /code/test/CoreTemplateStudio.Core.Test/TestData/Templates/test/Dependencies.FeatureTemplate.dp2/.template.config/template.json: -------------------------------------------------------------------------------- 1 | { 2 | "author": "Microsoft", 3 | "classifications": [ "Test" ], 4 | "name": "dp2", 5 | "groupIdentity": "dp2", 6 | "identity": "dp2", 7 | "shortName": "dp2", 8 | "tags": { 9 | "language": "C#", 10 | "type": "item", 11 | "wts.platform": "test", 12 | "wts.type": "feature", 13 | "wts.multipleInstance": "false", 14 | "wts.projecttype": "all", 15 | "wts.frontendframework": "all" 16 | }, 17 | "sourceName": "App_Name", 18 | "preferNameDirectory": true 19 | } -------------------------------------------------------------------------------- /code/src/CoreTemplateStudio/CoreTemplateStudio.Cli/Services/Contracts/IOptionsService`1.cs: -------------------------------------------------------------------------------- 1 | // Licensed to the .NET Foundation under one or more agreements. 2 | // The .NET Foundation licenses this file to you under the MIT license. 3 | // See the LICENSE file in the project root for more information. 4 | 5 | using System.Threading.Tasks; 6 | using Microsoft.Templates.Cli.Commands.Contracts; 7 | 8 | namespace Microsoft.Templates.Cli.Services.Contracts 9 | { 10 | public interface IOptionsService 11 | where T : ICommand 12 | { 13 | Task ProcessAsync(T options); 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /code/test/CoreTemplateStudio.Core.Test/TestData/Templates/test/Hidden.FeatureTemplate/.template.config/template.json: -------------------------------------------------------------------------------- 1 | { 2 | "author": "Microsoft", 3 | "classifications": [ "Test" ], 4 | "name": "HiddenTemplate", 5 | "groupIdentity": "Microsoft.Templates.Test.HiddenTemplate", 6 | "identity": "Microsoft.Templates.Test.HiddenTemplate.CSharp", 7 | "shortName": "HiddenTemplate", 8 | "tags": { 9 | "language": "C#", 10 | "type": "item", 11 | "wts.platform": "test", 12 | "wts.type": "feature", 13 | "wts.isHidden": "true" 14 | }, 15 | "sourceName": "App_Name", 16 | "preferNameDirectory": true 17 | } -------------------------------------------------------------------------------- /code/src/CoreTemplateStudio/CoreTemplateStudio.Core/Gen/CompositionInfo.cs: -------------------------------------------------------------------------------- 1 | // Licensed to the .NET Foundation under one or more agreements. 2 | // The .NET Foundation licenses this file to you under the MIT license. 3 | // See the LICENSE file in the project root for more information. 4 | 5 | using Microsoft.TemplateEngine.Abstractions; 6 | using Microsoft.Templates.Core.Composition; 7 | 8 | namespace Microsoft.Templates.Core.Gen 9 | { 10 | public class CompositionInfo 11 | { 12 | public CompositionQuery Query { get; set; } 13 | 14 | public ITemplateInfo Template { get; set; } 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /code/src/CoreTemplateStudio/CoreTemplateStudio.Core/Locations/SyncStatusEventArgs.cs: -------------------------------------------------------------------------------- 1 | // Licensed to the .NET Foundation under one or more agreements. 2 | // The .NET Foundation licenses this file to you under the MIT license. 3 | // See the LICENSE file in the project root for more information. 4 | 5 | using System; 6 | 7 | namespace Microsoft.Templates.Core.Locations 8 | { 9 | public sealed class SyncStatusEventArgs : EventArgs 10 | { 11 | public SyncStatus Status { get; set; } 12 | 13 | public Version Version { get; set; } 14 | 15 | public int Progress { get; set; } 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /code/src/CoreTemplateStudio/CoreTemplateStudio.Core/Validation/ValidationResult.cs: -------------------------------------------------------------------------------- 1 | // Licensed to the .NET Foundation under one or more agreements. 2 | // The .NET Foundation licenses this file to you under the MIT license. 3 | // See the LICENSE file in the project root for more information. 4 | 5 | using System.Collections.Generic; 6 | 7 | namespace Microsoft.Templates.Core.Validation 8 | { 9 | public class ValidationResult 10 | { 11 | public bool IsValid { get; set; } = true; 12 | 13 | public List ErrorMessages { get; set; } = new List(); 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /code/test/CoreTemplateStudio.Core.Test/TestData/Templates/test/Exclusions.FeatureTemplate/.template.config/template.json: -------------------------------------------------------------------------------- 1 | { 2 | "author": "Microsoft", 3 | "classifications": [ "Test" ], 4 | "name": "ExclusionsTemplate", 5 | "groupIdentity": "Microsoft.Templates.Test.ExclusionsTemplate", 6 | "identity": "Microsoft.Templates.Test.ExclusionsTemplate.CSharp", 7 | "shortName": "ExclusionsTemplate", 8 | "tags": { 9 | "language": "C#", 10 | "type": "item", 11 | "wts.platform": "test", 12 | "wts.type": "feature", 13 | "wts.exclusions": "e1|e2" 14 | }, 15 | "sourceName": "App_Name", 16 | "preferNameDirectory": true 17 | } -------------------------------------------------------------------------------- /code/src/CoreTemplateStudio/CoreTemplateStudio.Core/Naming/ValidationResult.cs: -------------------------------------------------------------------------------- 1 | // Licensed to the .NET Foundation under one or more agreements. 2 | // The .NET Foundation licenses this file to you under the MIT license. 3 | // See the LICENSE file in the project root for more information. 4 | 5 | using System.Collections; 6 | using System.Collections.Generic; 7 | 8 | namespace Microsoft.Templates.Core.Naming 9 | { 10 | public class ValidationResult 11 | { 12 | public bool IsValid { get; set; } = true; 13 | 14 | public List Errors { get; set; } = new List(); 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /code/src/CoreTemplateStudio/CoreTemplateStudio.Core/Packaging/CertInfo.cs: -------------------------------------------------------------------------------- 1 | // Licensed to the .NET Foundation under one or more agreements. 2 | // The .NET Foundation licenses this file to you under the MIT license. 3 | // See the LICENSE file in the project root for more information. 4 | 5 | using System.Security.Cryptography.X509Certificates; 6 | 7 | namespace Microsoft.Templates.Core.Packaging 8 | { 9 | public class CertInfo 10 | { 11 | public X509Certificate2 Cert { get; set; } 12 | 13 | public string Pin { get; set; } 14 | 15 | public X509ChainStatusFlags Status { get; set; } 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /code/test/CoreTemplateStudio.Core.Test/TestData/Templates/test/RightClick.FeatureTemplate/.template.config/template.json: -------------------------------------------------------------------------------- 1 | { 2 | "author": "Microsoft", 3 | "classifications": [ "Test" ], 4 | "name": "RightClickTemplate", 5 | "groupIdentity": "Microsoft.Templates.Test.RightClickTemplate", 6 | "identity": "Microsoft.Templates.Test.RightClickTemplate.CSharp", 7 | "shortName": "RightClickTemplate", 8 | "tags": { 9 | "language": "C#", 10 | "type": "item", 11 | "wts.platform": "test", 12 | "wts.type": "feature", 13 | "wts.rightClickEnabled": "true" 14 | }, 15 | "sourceName": "App_Name", 16 | "preferNameDirectory": true 17 | } -------------------------------------------------------------------------------- /code/test/CoreTemplateStudio.Core.Test/TestData/Templates/test/Exclusions.FeatureTemplateVB/.template.config/template.json: -------------------------------------------------------------------------------- 1 | { 2 | "author": "Microsoft", 3 | "classifications": [ "Test" ], 4 | "name": "ExclusionsTemplate", 5 | "groupIdentity": "Microsoft.Templates.Test.ExclusionsTemplate", 6 | "identity": "Microsoft.Templates.Test.ExclusionsTemplate.VB", 7 | "shortName": "ExclusionsTemplate", 8 | "tags": { 9 | "language": "VisualBasic", 10 | "type": "item", 11 | "wts.platform": "test", 12 | "wts.type": "feature", 13 | "wts.exclusions": "e1|e2" 14 | }, 15 | "sourceName": "App_Name", 16 | "preferNameDirectory": true 17 | } -------------------------------------------------------------------------------- /code/src/CoreTemplateStudio/CoreTemplateStudio.Cli/Utilities/GenShell/CliGenShellCertificate.cs: -------------------------------------------------------------------------------- 1 | // Licensed to the .NET Foundation under one or more agreements. 2 | // The .NET Foundation licenses this file to you under the MIT license. 3 | // See the LICENSE file in the project root for more information. 4 | 5 | using Microsoft.Templates.Core.Gen.Shell; 6 | 7 | namespace Microsoft.Templates.Cli.Utilities.GenShell 8 | { 9 | public class CliGenShellCertificate : IGenShellCertificate 10 | { 11 | public string CreateCertificate(string publisherName) => CliCertificateService.Instance.CreateCertificate(publisherName); 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /code/test/CoreTemplateStudio.Core.Test/TestData/Templates/test/Requirements.FeatureTemplate/.template.config/template.json: -------------------------------------------------------------------------------- 1 | { 2 | "author": "Microsoft", 3 | "classifications": [ "Test" ], 4 | "name": "RequirementsTemplate", 5 | "groupIdentity": "Microsoft.Templates.Test.RequirementsTemplate", 6 | "identity": "Microsoft.Templates.Test.RequirementsTemplate.CSharp", 7 | "shortName": "RequirementsTemplate", 8 | "tags": { 9 | "language": "C#", 10 | "type": "item", 11 | "wts.platform": "test", 12 | "wts.type": "feature", 13 | "wts.requirements": "r1|r2" 14 | }, 15 | "sourceName": "App_Name", 16 | "preferNameDirectory": true 17 | } -------------------------------------------------------------------------------- /code/test/CoreTemplateStudio.Core.Test/TestFakes/GenShell/TestGenShellCertificate.cs: -------------------------------------------------------------------------------- 1 | // Licensed to the .NET Foundation under one or more agreements. 2 | // The .NET Foundation licenses this file to you under the MIT license. 3 | // See the LICENSE file in the project root for more information. 4 | 5 | using Microsoft.Templates.Core.Gen.Shell; 6 | 7 | namespace Microsoft.Templates.Core.Test.TestFakes.GenShell 8 | { 9 | public class TestGenShellCertificate : IGenShellCertificate 10 | { 11 | public string CreateCertificate(string publisherName) => TestCertificateService.Instance.CreateCertificate(publisherName); 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /code/src/CoreTemplateStudio/CoreTemplateStudio.Core/PostActions/Catalog/Merge/MergeResult.cs: -------------------------------------------------------------------------------- 1 | // Licensed to the .NET Foundation under one or more agreements. 2 | // The .NET Foundation licenses this file to you under the MIT license. 3 | // See the LICENSE file in the project root for more information. 4 | 5 | using System.Collections.Generic; 6 | 7 | namespace Microsoft.Templates.Core.PostActions.Catalog.Merge 8 | { 9 | public class MergeResult 10 | { 11 | public bool Success { get; set; } 12 | 13 | public IEnumerable Result { get; set; } 14 | 15 | public string ErrorLine { get; set; } 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /code/test/CoreTemplateStudio.Core.Test/TestData/Templates/test/Dependencies.FeatureTemplateVB/.template.config/template.json: -------------------------------------------------------------------------------- 1 | { 2 | "author": "Microsoft", 3 | "classifications": [ "Test" ], 4 | "name": "DependenciesTemplate", 5 | "groupIdentity": "Microsoft.Templates.Test.DependenciesTemplate", 6 | "identity": "Microsoft.Templates.Test.DependenciesTemplate.VB", 7 | "shortName": "DependenciesTemplate", 8 | "tags": { 9 | "language": "VisualBasic", 10 | "type": "item", 11 | "wts.platform": "test", 12 | "wts.type": "feature", 13 | "wts.dependencies": "dp1|dp2" 14 | }, 15 | "sourceName": "App_Name", 16 | "preferNameDirectory": true 17 | } -------------------------------------------------------------------------------- /code/test/CoreTemplateStudio.Core.Test/TestData/Templates/test/Requirements.FeatureTemplateVB/.template.config/template.json: -------------------------------------------------------------------------------- 1 | { 2 | "author": "Microsoft", 3 | "classifications": [ "Test" ], 4 | "name": "RequirementsTemplate", 5 | "groupIdentity": "Microsoft.Templates.Test.RequirementsTemplate", 6 | "identity": "Microsoft.Templates.Test.RequirementsTemplate.VB", 7 | "shortName": "RequirementsTemplate", 8 | "tags": { 9 | "language": "VisualBasic", 10 | "type": "item", 11 | "wts.platform": "test", 12 | "wts.type": "feature", 13 | "wts.requirements": "r1|r2" 14 | }, 15 | "sourceName": "App_Name", 16 | "preferNameDirectory": true 17 | } -------------------------------------------------------------------------------- /code/test/CoreTemplateStudio.Core.Test/TestData/Templates/test/TelemetryName.FeatureTemplate/.template.config/template.json: -------------------------------------------------------------------------------- 1 | { 2 | "author": "Microsoft", 3 | "classifications": [ "Test" ], 4 | "name": "TelemetryNameTemplate", 5 | "groupIdentity": "Microsoft.Templates.Test.TelemetryNameTemplate", 6 | "identity": "Microsoft.Templates.Test.TelemetryNameTemplate.CSharp", 7 | "shortName": "TelemetryNameTemplate", 8 | "tags": { 9 | "language": "C#", 10 | "type": "item", 11 | "wts.platform": "test", 12 | "wts.type": "feature", 13 | "wts.telemName": "TelemName" 14 | }, 15 | "sourceName": "App_Name", 16 | "preferNameDirectory": true 17 | } -------------------------------------------------------------------------------- /code/test/CoreTemplateStudio.Core.Test/TestData/Templates/test/OutputToParent.FeatureTemplate/.template.config/template.json: -------------------------------------------------------------------------------- 1 | { 2 | "author": "Microsoft", 3 | "classifications": [ "Test" ], 4 | "name": "OutputToParentTemplate", 5 | "groupIdentity": "Microsoft.Templates.Test.OutputToParentTemplate", 6 | "identity": "Microsoft.Templates.Test.OutputToParentTemplate.CSharp", 7 | "shortName": "OutputToParentTemplate", 8 | "tags": { 9 | "language": "C#", 10 | "type": "item", 11 | "wts.platform": "test", 12 | "wts.type": "feature", 13 | "wts.outputToParent": "true" 14 | }, 15 | "sourceName": "App_Name", 16 | "preferNameDirectory": true 17 | } -------------------------------------------------------------------------------- /code/test/CoreTemplateStudio.Core.Test/TestData/Templates/test/Naming.DefaultNameTemplate/.template.config/template.json: -------------------------------------------------------------------------------- 1 | { 2 | "author": "Microsoft", 3 | "classifications": [ "Test" ], 4 | "name": "LiveTile", 5 | "groupIdentity": "Microsoft.Templates.Test.Naming.DefaultName", 6 | "identity": "Microsoft.Templates.Test.Naming.DefaultName.CSharp", 7 | "shortName": "HiddenTemplate", 8 | "tags": { 9 | "language": "C#", 10 | "type": "item", 11 | "wts.platform": "test", 12 | "wts.type": "feature", 13 | "wts.multipleInstance": "false", 14 | "wts.defaultInstance": "LiveTile" 15 | }, 16 | "sourceName": "App_Name", 17 | "preferNameDirectory": true 18 | } -------------------------------------------------------------------------------- /code/src/CoreTemplateStudio/CoreTemplateStudio.Core/PostActions/Catalog/Merge/CodeStyleProviders/VBStyleProvider.cs: -------------------------------------------------------------------------------- 1 | // Licensed to the .NET Foundation under one or more agreements. 2 | // The .NET Foundation licenses this file to you under the MIT license. 3 | // See the LICENSE file in the project root for more information. 4 | 5 | using System; 6 | using System.Collections.Generic; 7 | using System.Linq; 8 | using System.Text; 9 | 10 | namespace Microsoft.Templates.Core.PostActions.Catalog.Merge.CodeStyleProviders 11 | { 12 | public class VBStyleProvider : BaseCodeStyleProvider 13 | { 14 | public override string CommentSymbol => "'"; 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /code/src/CoreTemplateStudio/CoreTemplateStudio.Cli/Services/Contracts/ISyncService.cs: -------------------------------------------------------------------------------- 1 | // Licensed to the .NET Foundation under one or more agreements. 2 | // The .NET Foundation licenses this file to you under the MIT license. 3 | // See the LICENSE file in the project root for more information. 4 | 5 | using System; 6 | using System.Threading.Tasks; 7 | using Microsoft.Templates.Cli.Models; 8 | using Microsoft.Templates.Core.Locations; 9 | 10 | namespace Microsoft.Templates.Cli.Services.Contracts 11 | { 12 | public interface ISyncService 13 | { 14 | Task ProcessAsync(string path, string fullPath, string platform, string language); 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /code/test/Utilities.Test/App.config: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | -------------------------------------------------------------------------------- /code/src/CoreTemplateStudio/CoreTemplateStudio.Core/Naming/Config/ProjectNameValidationConfig.cs: -------------------------------------------------------------------------------- 1 | // Licensed to the .NET Foundation under one or more agreements. 2 | // The .NET Foundation licenses this file to you under the MIT license. 3 | // See the LICENSE file in the project root for more information. 4 | 5 | namespace Microsoft.Templates.Core.Naming 6 | { 7 | public class ProjectNameValidationConfig 8 | { 9 | public RegExConfig[] Regexs { get; set; } 10 | 11 | public string[] ReservedNames { get; set; } 12 | 13 | public bool ValidateExistingNames { get; set; } 14 | 15 | public bool ValidateEmptyNames { get; set; } 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /code/test/CoreTemplateStudio.Core.Test/Diagnostics/TelemetryFixture.cs: -------------------------------------------------------------------------------- 1 | // Licensed to the .NET Foundation under one or more agreements. 2 | // The .NET Foundation licenses this file to you under the MIT license. 3 | // See the LICENSE file in the project root for more information. 4 | 5 | using System; 6 | 7 | using Microsoft.Templates.Core.Diagnostics; 8 | 9 | namespace Microsoft.Templates.Core.Test.Diagnostics 10 | { 11 | public sealed class TelemetryFixture 12 | { 13 | public TelemetryService Telemetry { get; } 14 | 15 | public TelemetryFixture() 16 | { 17 | Telemetry = TelemetryService.Current; 18 | } 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /code/test/CoreTemplateStudio.Core.Test/TestData/Templates/test/FeatureTemplateVB/.template.config/template.json: -------------------------------------------------------------------------------- 1 | { 2 | "author": "Microsoft", 3 | "classifications": [ "Test" ], 4 | "name": "FeatureTemplate", 5 | "description": "Generic Feature description...", 6 | "groupIdentity": "Microsoft.Templates.Test.FeatureTemplate", 7 | "identity": "Microsoft.Templates.Test.FeatureTemplate.VB", 8 | "shortName": "FeatureTemplate", 9 | "tags": { 10 | "language": "VisualBasic", 11 | "type": "item", 12 | "wts.platform": "test", 13 | "wts.type": "feature", 14 | "wts.isGroupExclusiveSelection": "true" 15 | }, 16 | "sourceName": "App_Name", 17 | "preferNameDirectory": true 18 | } -------------------------------------------------------------------------------- /code/test/CoreTemplateStudio.Core.Test/TestData/Templates/test/Naming.DefaultNameTemplateVB/.template.config/template.json: -------------------------------------------------------------------------------- 1 | { 2 | "author": "Microsoft", 3 | "classifications": [ "Test" ], 4 | "name": "LiveTile", 5 | "groupIdentity": "Microsoft.Templates.Test.Naming.DefaultName", 6 | "identity": "Microsoft.Templates.Test.Naming.DefaultName.VisualBasic", 7 | "shortName": "naming-default", 8 | "tags": { 9 | "language": "VisualBasic", 10 | "type": "item", 11 | "wts.platform": "test", 12 | "wts.type": "feature", 13 | "wts.multipleInstance": "false", 14 | "wts.defaultInstance": "LiveTile" 15 | }, 16 | "sourceName": "App_Name", 17 | "preferNameDirectory": true 18 | } -------------------------------------------------------------------------------- /code/test/CoreTemplateStudio.Core.Test/TestData/Templates/test/TestingTemplateVB/.template.config/template.json: -------------------------------------------------------------------------------- 1 | { 2 | "author": "Microsoft", 3 | "classifications": [ "Test" ], 4 | "name": "TestingTemplate", 5 | "description": "Generic Testing description...", 6 | "groupIdentity": "Microsoft.Templates.Test.TestingTemplate", 7 | "identity": "Microsoft.Templates.Test.TestingTemplate.VB", 8 | "shortName": "TestingTemplate", 9 | "tags": { 10 | "language": "VisualBasic", 11 | "type": "item", 12 | "wts.platform": "test", 13 | "wts.type": "testing", 14 | "wts.isGroupExclusiveSelection": "true" 15 | }, 16 | "sourceName": "App_Name", 17 | "preferNameDirectory": true 18 | } -------------------------------------------------------------------------------- /code/test/CoreTemplateStudio.Core.Test/PostActions/Catalog/FakeCreationPath.cs: -------------------------------------------------------------------------------- 1 | // Licensed to the .NET Foundation under one or more agreements. 2 | // The .NET Foundation licenses this file to you under the MIT license. 3 | // See the LICENSE file in the project root for more information. 4 | 5 | using System; 6 | using System.Collections.Generic; 7 | using System.Linq; 8 | using System.Text; 9 | using System.Threading.Tasks; 10 | 11 | using Microsoft.TemplateEngine.Abstractions; 12 | 13 | namespace Microsoft.Templates.Core.Test.PostActions.Catalog 14 | { 15 | internal class FakeCreationPath : ICreationPath 16 | { 17 | public string Path { get; set; } 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /code/tools/WtsPackagingTool/CommandOptions/CommonOptions.cs: -------------------------------------------------------------------------------- 1 | // Licensed to the .NET Foundation under one or more agreements. 2 | // The .NET Foundation licenses this file to you under the MIT license. 3 | // See the LICENSE file in the project root for more information. 4 | 5 | using System; 6 | using System.Collections.Generic; 7 | using System.Linq; 8 | using System.Text; 9 | using System.Threading.Tasks; 10 | using CommandLine; 11 | 12 | namespace WtsPackagingTool.CommandOptions 13 | { 14 | public class CommonOptions 15 | { 16 | [Option("verbose", HelpText = "Show verbose error info.", Default = false)] 17 | public bool Verbose { get; set; } 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /code/tools/WtsTelemetry/Models/WebTSReactNativeData.cs: -------------------------------------------------------------------------------- 1 | using WtsTelemetry.Helpers; 2 | 3 | namespace WtsTelemetry.Models 4 | { 5 | public class WebTSReactNativeData 6 | { 7 | public string ProjectTypes { get; set; } 8 | public string Pages { get; set; } 9 | public int Year { get; set; } 10 | public int Month { get; set; } 11 | 12 | public string ToMarkdown() 13 | { 14 | return new MarkdownBuilder() 15 | .AddTable("Project Types", "Framework Type", ProjectTypes) 16 | .AddTable("Pages", "Pages", Pages) 17 | .GetText(); 18 | } 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /code/src/CoreTemplateStudio/CoreTemplateStudio.Core/Locations/SyncStatus.cs: -------------------------------------------------------------------------------- 1 | // Licensed to the .NET Foundation under one or more agreements. 2 | // The .NET Foundation licenses this file to you under the MIT license. 3 | // See the LICENSE file in the project root for more information. 4 | 5 | namespace Microsoft.Templates.Core.Locations 6 | { 7 | public enum SyncStatus 8 | { 9 | None = 0, 10 | Updating = 1, 11 | Updated = 2, 12 | CheckingForUpdates = 3, 13 | NoUpdates = 4, 14 | Acquiring = 5, 15 | Preparing = 6, 16 | NewWizardVersionAvailable = 7, 17 | Ready = 8, 18 | ErrorAcquiring = 9, 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /code/test/CoreTemplateStudio.Core.Test/TestData/Templates/test/CompositionTemplateVB/.template.config/template.json: -------------------------------------------------------------------------------- 1 | { 2 | "author": "Microsoft", 3 | "classifications": [ "Test" ], 4 | "name": "CompositionTemplate", 5 | "identity": "Microsoft.Templates.Test.CompositionTemplate.VB", 6 | "shortName": "CompositionTemplate", 7 | "tags": { 8 | "language": "VisualBasic", 9 | "type": "item", 10 | "wts.platform": "test", 11 | "wts.type": "composition", 12 | "wts.version": "1.0.0", 13 | "wts.compositionFilter": "groupidentity == Microsoft.Templates.Test.PageTemplate", 14 | "wts.compositionOrder": "1" 15 | 16 | }, 17 | "sourceName": "App_Name", 18 | "preferNameDirectory": true 19 | } -------------------------------------------------------------------------------- /code/src/CoreTemplateStudio/CoreTemplateStudio.Core/PostActions/Catalog/Merge/NewItemGeneration/MergeInfo.cs: -------------------------------------------------------------------------------- 1 | // Licensed to the .NET Foundation under one or more agreements. 2 | // The .NET Foundation licenses this file to you under the MIT license. 3 | // See the LICENSE file in the project root for more information. 4 | 5 | using System; 6 | using System.Collections.Generic; 7 | using System.Linq; 8 | using System.Text; 9 | using System.Threading.Tasks; 10 | 11 | namespace Microsoft.Templates.Core.PostActions.Catalog.Merge 12 | { 13 | public class MergeInfo 14 | { 15 | public string Format { get; set; } 16 | 17 | public string PostActionCode { get; set; } 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /code/test/CoreTemplateStudio.Core.Test/TestData/Templates/test/ServiceTemplateVB/.template.config/template.json: -------------------------------------------------------------------------------- 1 | { 2 | "author": "Microsoft", 3 | "classifications": [ "Test" ], 4 | "name": "ServiceTemplate", 5 | "groupIdentity": "Microsoft.Templates.Test.ServiceTemplate", 6 | "identity": "Microsoft.Templates.Test.ServiceTemplate.VisualBasic", 7 | "shortName": "service-test", 8 | "tags": { 9 | "language": "VisualBasic", 10 | "type": "item", 11 | "wts.platform": "test", 12 | "wts.type": "service", 13 | "wts.genGroup": "1", 14 | "wts.export.baseclass": "ViewModelBase", 15 | "wts.export.setter": "Set" 16 | }, 17 | "sourceName": "App_Name", 18 | "preferNameDirectory": true 19 | } 20 | -------------------------------------------------------------------------------- /code/src/CoreTemplateStudio/CoreTemplateStudio.Cli/Commands/GetFrameworksCommand.cs: -------------------------------------------------------------------------------- 1 | // Licensed to the .NET Foundation under one or more agreements. 2 | // The .NET Foundation licenses this file to you under the MIT license. 3 | // See the LICENSE file in the project root for more information. 4 | 5 | using CommandLine; 6 | using Microsoft.Templates.Cli.Commands.Contracts; 7 | 8 | namespace Microsoft.Templates.Cli.Commands 9 | { 10 | [Verb("getframeworks", HelpText = "Get frameworks by core.")] 11 | public class GetFrameworksCommand : ICommand 12 | { 13 | [Option('p', "project-type", Required = true, HelpText = "Project type")] 14 | public string ProjectType { get; set; } 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /code/src/CoreTemplateStudio/CoreTemplateStudio.Core/Templates/MetadataLocalizedInfo.cs: -------------------------------------------------------------------------------- 1 | // Licensed to the .NET Foundation under one or more agreements. 2 | // The .NET Foundation licenses this file to you under the MIT license. 3 | // See the LICENSE file in the project root for more information. 4 | 5 | using System; 6 | using System.Collections.Generic; 7 | using System.Linq; 8 | using System.Text; 9 | using System.Threading.Tasks; 10 | 11 | namespace Microsoft.Templates.Core 12 | { 13 | public class MetadataLocalizedInfo 14 | { 15 | public string Name { get; set; } 16 | 17 | public string DisplayName { get; set; } 18 | 19 | public string Summary { get; set; } 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /code/src/CoreTemplateStudio/CoreTemplateStudio.Core/Gen/Shell/IGenShell.cs: -------------------------------------------------------------------------------- 1 | // Licensed to the .NET Foundation under one or more agreements. 2 | // The .NET Foundation licenses this file to you under the MIT license. 3 | // See the LICENSE file in the project root for more information. 4 | 5 | namespace Microsoft.Templates.Core.Gen.Shell 6 | { 7 | public interface IGenShell 8 | { 9 | IGenShellProject Project { get; } 10 | 11 | IGenShellSolution Solution { get; } 12 | 13 | IGenShellTelemetry Telemetry { get; } 14 | 15 | IGenShellUI UI { get; } 16 | 17 | IGenShellVisualStudio VisualStudio { get; } 18 | 19 | IGenShellCertificate Certificate { get; } 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /code/test/CoreTemplateStudio.Core.Test/TestData/Templates/test/CompositionTemplate/.template.config/template.json: -------------------------------------------------------------------------------- 1 | { 2 | "author": "Microsoft", 3 | "classifications": [ "Test" ], 4 | "name": "CompositionTemplate", 5 | "identity": "Microsoft.Templates.Test.CompositionTemplate.CSharp", 6 | "shortName": "CompositionTemplate", 7 | "tags": { 8 | "language": "C#", 9 | "type": "item", 10 | "wts.platform": "test", 11 | "wts.type": "composition", 12 | "wts.version": "1.0.0", 13 | "wts.compositionFilter": "groupidentity == Microsoft.Templates.Test.PageTemplate", 14 | "wts.compositionOrder": "1", 15 | "wts.export.testkey": "testValue" 16 | }, 17 | "sourceName": "App_Name", 18 | "preferNameDirectory": true 19 | } -------------------------------------------------------------------------------- /code/src/CoreTemplateStudio/CoreTemplateStudio.Core/Diagnostics/IHealthWriter.cs: -------------------------------------------------------------------------------- 1 | // Licensed to the .NET Foundation under one or more agreements. 2 | // The .NET Foundation licenses this file to you under the MIT license. 3 | // See the LICENSE file in the project root for more information. 4 | 5 | using System; 6 | using System.Diagnostics; 7 | using System.Threading.Tasks; 8 | 9 | namespace Microsoft.Templates.Core.Diagnostics 10 | { 11 | public interface IHealthWriter 12 | { 13 | Task WriteTraceAsync(TraceEventType eventType, string message, Exception ex = null); 14 | 15 | Task WriteExceptionAsync(Exception ex, string message = null); 16 | 17 | bool AllowMultipleInstances(); 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /code/src/CoreTemplateStudio/CoreTemplateStudio.Core/Diagnostics/VSTelemetryInfo.cs: -------------------------------------------------------------------------------- 1 | // Licensed to the .NET Foundation under one or more agreements. 2 | // The .NET Foundation licenses this file to you under the MIT license. 3 | // See the LICENSE file in the project root for more information. 4 | 5 | namespace Microsoft.Templates.Core.Diagnostics 6 | { 7 | public class VSTelemetryInfo 8 | { 9 | public bool OptedIn { get; set; } 10 | 11 | public string VisualStudioEdition { get; set; } 12 | 13 | public string VisualStudioExeVersion { get; set; } 14 | 15 | public string VisualStudioCulture { get; set; } 16 | 17 | public string VisualStudioManifestId { get; set; } 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /code/src/CoreTemplateStudio/CoreTemplateStudio.Cli/Services/Contracts/IMessageService.cs: -------------------------------------------------------------------------------- 1 | // Licensed to the .NET Foundation under one or more agreements. 2 | // The .NET Foundation licenses this file to you under the MIT license. 3 | // See the LICENSE file in the project root for more information. 4 | 5 | using System.Collections.Generic; 6 | using Microsoft.Templates.Cli.Models; 7 | 8 | namespace Microsoft.Templates.Cli.Services.Contracts 9 | { 10 | public interface IMessageService 11 | { 12 | void SendMessage(string message); 13 | 14 | void SendError(string error); 15 | 16 | void SendErrors(IEnumerable errors); 17 | 18 | void SendResult(MessageType type, T item); 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /code/src/CoreTemplateStudio/CoreTemplateStudio.Core/Naming/Config/ItemNameValidationConfig.cs: -------------------------------------------------------------------------------- 1 | // Licensed to the .NET Foundation under one or more agreements. 2 | // The .NET Foundation licenses this file to you under the MIT license. 3 | // See the LICENSE file in the project root for more information. 4 | 5 | namespace Microsoft.Templates.Core.Naming 6 | { 7 | public class ItemNameValidationConfig 8 | { 9 | public RegExConfig[] Regexs { get; set; } 10 | 11 | public string[] ReservedNames { get; set; } 12 | 13 | public bool ValidateDefaultNames { get; set; } 14 | 15 | public bool ValidateExistingNames { get; set; } 16 | 17 | public bool ValidateEmptyNames { get; set; } 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /code/test/CoreTemplateStudio.Core.Test/TestData/Templates/test/PageTemplateVB/.template.config/template.json: -------------------------------------------------------------------------------- 1 | { 2 | "author": "Microsoft", 3 | "classifications": [ "Test" ], 4 | "name": "PageTemplate", 5 | "groupIdentity": "Microsoft.Templates.Test.PageTemplate", 6 | "identity": "Microsoft.Templates.Test.PageTemplate.VisualBasic", 7 | "shortName": "page-test", 8 | "tags": { 9 | "language": "VisualBasic", 10 | "type": "item", 11 | "wts.platform": "test", 12 | "wts.type": "page", 13 | "wts.genGroup": "1", 14 | "wts.export.baseclass": "ViewModelBase", 15 | "wts.export.setter": "Set", 16 | "wts.casing.sourceName": "kebab|camel|pascal|snake" 17 | }, 18 | "sourceName": "App_Name", 19 | "preferNameDirectory": true 20 | } 21 | -------------------------------------------------------------------------------- /code/src/CoreTemplateStudio/CoreTemplateStudio.Core/Extensions/VersionExtensions.cs: -------------------------------------------------------------------------------- 1 | // Licensed to the .NET Foundation under one or more agreements. 2 | // The .NET Foundation licenses this file to you under the MIT license. 3 | // See the LICENSE file in the project root for more information. 4 | 5 | using System; 6 | 7 | namespace Microsoft.Templates.Core 8 | { 9 | public static class VersionExtensions 10 | { 11 | public static bool IsZero(this Version v) 12 | { 13 | return !v.IsNull() && v.Major <= 0 && v.Minor <= 0 && v.Build <= 0 && v.Revision <= 0; 14 | } 15 | 16 | public static bool IsNull(this Version v) 17 | { 18 | return v is null; 19 | } 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /code/src/CoreTemplateStudio/CoreTemplateStudio.Cli/Models/MessageType.cs: -------------------------------------------------------------------------------- 1 | // Licensed to the .NET Foundation under one or more agreements. 2 | // The .NET Foundation licenses this file to you under the MIT license. 3 | // See the LICENSE file in the project root for more information. 4 | 5 | namespace Microsoft.Templates.Cli.Models 6 | { 7 | public enum MessageType 8 | { 9 | SyncProgress, 10 | SyncResult, 11 | GetProjectTypesResult, 12 | GetFrameworksResult, 13 | GetLayoutsResult, 14 | GetPagesResult, 15 | GetFeaturesResult, 16 | GetServicesResult, 17 | GetTestingResult, 18 | GetAllLicencesResult, 19 | GenerateProgress, 20 | GenerateResult, 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /code/src/CoreTemplateStudio/CoreTemplateStudio.Core/Gen/Shell/IGenShellUI.cs: -------------------------------------------------------------------------------- 1 | // Licensed to the .NET Foundation under one or more agreements. 2 | // The .NET Foundation licenses this file to you under the MIT license. 3 | // See the LICENSE file in the project root for more information. 4 | 5 | namespace Microsoft.Templates.Core.Gen.Shell 6 | { 7 | public interface IGenShellUI 8 | { 9 | void ShowModal(IWindow shell); 10 | 11 | void CancelWizard(bool back = true); 12 | 13 | void ShowStatusBarMessage(string message); 14 | 15 | void WriteOutput(string data); 16 | 17 | void OpenProjectOverview(); 18 | 19 | void OpenItems(params string[] itemsFullPath); 20 | 21 | void ShowTaskList(); 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /code/src/CoreTemplateStudio/CoreTemplateStudio.Core/PostActions/Catalog/SortNamespaces/UsingComparer.cs: -------------------------------------------------------------------------------- 1 | // Licensed to the .NET Foundation under one or more agreements. 2 | // The .NET Foundation licenses this file to you under the MIT license. 3 | // See the LICENSE file in the project root for more information. 4 | 5 | namespace Microsoft.Templates.Core.PostActions.Catalog.SortNamespaces 6 | { 7 | public class UsingComparer : NamespaceComparer 8 | { 9 | public override string Keyword => UsingComparer.UsingKeyword; 10 | 11 | public static string UsingKeyword => @"using"; 12 | 13 | protected override string Pattern => Keyword + @"\s(?.*?);"; 14 | 15 | protected override bool StripTrailingCharacter => true; 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /code/src/CoreTemplateStudio/CoreTemplateStudio.Cli/Commands/GenerateCommand.cs: -------------------------------------------------------------------------------- 1 | // Licensed to the .NET Foundation under one or more agreements. 2 | // The .NET Foundation licenses this file to you under the MIT license. 3 | // See the LICENSE file in the project root for more information. 4 | 5 | using System.Collections.Generic; 6 | using CommandLine; 7 | using Microsoft.Templates.Cli.Commands.Contracts; 8 | 9 | namespace Microsoft.Templates.Cli.Commands 10 | { 11 | [Verb("generate", HelpText = "Generate user selection.")] 12 | public class GenerateCommand : ICommand 13 | { 14 | [Option('d', "data", Required = true, HelpText = "Generation data in json format")] 15 | public IEnumerable GenerationDataJson { get; set; } 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /code/src/CoreTemplateStudio/CoreTemplateStudio.Core/Gen/SupportedFramework.cs: -------------------------------------------------------------------------------- 1 | // Licensed to the .NET Foundation under one or more agreements. 2 | // The .NET Foundation licenses this file to you under the MIT license. 3 | // See the LICENSE file in the project root for more information. 4 | 5 | using System; 6 | using System.Collections.Generic; 7 | using System.Text; 8 | 9 | namespace Microsoft.Templates.Core.Gen 10 | { 11 | public class SupportedFramework 12 | { 13 | public string Name { get; internal set; } 14 | 15 | public FrameworkTypes Type { get; internal set; } 16 | 17 | public SupportedFramework(string name, FrameworkTypes type) 18 | { 19 | Name = name; 20 | Type = type; 21 | } 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /code/src/CoreTemplateStudio/CoreTemplateStudio.Core/PostActions/Catalog/SortNamespaces/ImportsComparer.cs: -------------------------------------------------------------------------------- 1 | // Licensed to the .NET Foundation under one or more agreements. 2 | // The .NET Foundation licenses this file to you under the MIT license. 3 | // See the LICENSE file in the project root for more information. 4 | 5 | namespace Microsoft.Templates.Core.PostActions.Catalog.SortNamespaces 6 | { 7 | public class ImportsComparer : NamespaceComparer 8 | { 9 | public override string Keyword => ImportsComparer.ImportsKeyword; 10 | 11 | public static string ImportsKeyword => @"Imports"; 12 | 13 | protected override string Pattern => Keyword + @"\s(?.*?)"; 14 | 15 | protected override bool StripTrailingCharacter => false; 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /code/test/CoreTemplateStudio.Cli.Test/templates/ProjectTemplate/.template.config/template.json: -------------------------------------------------------------------------------- 1 | { 2 | "author": "Microsoft", 3 | "classifications": [ "Test" ], 4 | "name": "ProjectTemplate", 5 | "groupIdentity": "Microsoft.Templates.Test.ProjectTemplate", 6 | "identity": "Microsoft.Templates.Test.ProjectTemplate.CSharp", 7 | "tags": { 8 | "language": "Any", 9 | "type": "project", 10 | "wts.type": "project", 11 | "wts.projecttype": "pt1|pt2|TestProjectType", 12 | "wts.frontendframework": "fx1|TestFramework", 13 | "wts.platform": "Web", 14 | "wts.version": "1.0.0", 15 | "wts.licenses": "[text1](url1)|[text2](url2)", 16 | "wts.group": "group1", 17 | "wts.defaultInstance": "DefaultName" 18 | }, 19 | "sourceName": "App_Name", 20 | "preferNameDirectory": true 21 | } -------------------------------------------------------------------------------- /code/src/CoreTemplateStudio/CoreTemplateStudio.Cli/Commands/GetAllLicencesCommand.cs: -------------------------------------------------------------------------------- 1 | // Licensed to the .NET Foundation under one or more agreements. 2 | // The .NET Foundation licenses this file to you under the MIT license. 3 | // See the LICENSE file in the project root for more information. 4 | 5 | using System.Collections.Generic; 6 | using CommandLine; 7 | using Microsoft.Templates.Cli.Commands.Contracts; 8 | 9 | namespace Microsoft.Templates.Cli.Commands 10 | { 11 | [Verb("getalllicences", HelpText = "Get all licences on user selection.")] 12 | public class GetAllLicencesCommand : ICommand 13 | { 14 | [Option('d', "data", Required = true, HelpText = "Generation data in json format")] 15 | public IEnumerable GenerationDataJson { get; set; } 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /code/src/CoreTemplateStudio/CoreTemplateStudio.Cli/Models/SyncModel.cs: -------------------------------------------------------------------------------- 1 | // Licensed to the .NET Foundation under one or more agreements. 2 | // The .NET Foundation licenses this file to you under the MIT license. 3 | // See the LICENSE file in the project root for more information. 4 | 5 | using Microsoft.Templates.Core.Naming; 6 | 7 | namespace Microsoft.Templates.Cli.Models 8 | { 9 | public class SyncModel 10 | { 11 | public bool WasUpdated { get; set; } 12 | 13 | public string TemplatesVersion { get; set; } 14 | 15 | public ProjectNameValidationConfig ProjectNameValidationConfig { get; set; } 16 | 17 | public ItemNameValidationConfig ItemNameValidationConfig { get; set; } 18 | 19 | public string[] DefaultNames { get; set; } 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /code/src/CoreTemplateStudio/CoreTemplateStudio.Core/Gen/Shell/IGenShellVisualStudio.cs: -------------------------------------------------------------------------------- 1 | // Licensed to the .NET Foundation under one or more agreements. 2 | // The .NET Foundation licenses this file to you under the MIT license. 3 | // See the LICENSE file in the project root for more information. 4 | 5 | using System.Collections.Generic; 6 | 7 | namespace Microsoft.Templates.Core.Gen.Shell 8 | { 9 | public interface IGenShellVisualStudio 10 | { 11 | string GetVsVersion(); // return "0.0.0.0"; 12 | 13 | string GetVsVersionAndInstance(); // return "0.0.0.0-i"; 14 | 15 | bool IsDebuggerEnabled(); 16 | 17 | bool IsBuildInProgress(); 18 | 19 | bool IsSdkInstalled(string version); 20 | 21 | List GetInstalledPackageIds(); 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /code/src/CoreTemplateStudio/CoreTemplateStudio.Core/Gen/Shell/IGenShellProject.cs: -------------------------------------------------------------------------------- 1 | // Licensed to the .NET Foundation under one or more agreements. 2 | // The .NET Foundation licenses this file to you under the MIT license. 3 | // See the LICENSE file in the project root for more information. 4 | 5 | using System; 6 | 7 | namespace Microsoft.Templates.Core.Gen.Shell 8 | { 9 | public interface IGenShellProject 10 | { 11 | string GetActiveProjectName(); 12 | 13 | string GetActiveProjectNamespace(); 14 | 15 | string GetActiveProjectPath(); 16 | 17 | string GetActiveProjectLanguage(); 18 | 19 | string GetActiveProjectTypeGuids(); 20 | 21 | Guid GetProjectGuidByName(string projectName); 22 | 23 | bool GetActiveProjectIsWts(); 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /code/test/CoreTemplateStudio.Cli.Test/templates/PageTemplate/.template.config/template.json: -------------------------------------------------------------------------------- 1 | { 2 | "author": "Microsoft", 3 | "classifications": [ "Test" ], 4 | "name": "PageTemplate", 5 | "description": "Generic description...", 6 | "groupIdentity": "Microsoft.Templates.Test.PageTemplate", 7 | "identity": "Microsoft.Templates.Test.PageTemplate.CSharp", 8 | "tags": { 9 | "language": "Any", 10 | "type": "item", 11 | "wts.platform": "Web", 12 | "wts.projecttype": "all", 13 | "wts.frontendframework": "fx1", 14 | "wts.backendframework": "fx3", 15 | "wts.type": "page", 16 | "wts.displayOrder": "1", 17 | "wts.genGroup": "1", 18 | "wts.export.baseclass": "ViewModelBase", 19 | "wts.export.setter": "Set" 20 | }, 21 | "sourceName": "App_Name", 22 | "preferNameDirectory": true 23 | } -------------------------------------------------------------------------------- /code/src/CoreTemplateStudio/CoreTemplateStudio.Core/Extensions/DictionaryExtensions.cs: -------------------------------------------------------------------------------- 1 | // Licensed to the .NET Foundation under one or more agreements. 2 | // The .NET Foundation licenses this file to you under the MIT license. 3 | // See the LICENSE file in the project root for more information. 4 | 5 | using System.Collections.Generic; 6 | 7 | namespace Microsoft.Templates.Core 8 | { 9 | public static class DictionaryExtensions 10 | { 11 | public static TValue SafeGet(this Dictionary dictionary, TKey key, TValue defaultResult = default(TValue)) 12 | { 13 | if (dictionary.ContainsKey(key)) 14 | { 15 | return dictionary[key]; 16 | } 17 | 18 | return defaultResult; 19 | } 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /code/src/CoreTemplateStudio/CoreTemplateStudio.Core/PostActions/Catalog/Merge/CodeStyleProviders/XmlStyleProvider.cs: -------------------------------------------------------------------------------- 1 | // Licensed to the .NET Foundation under one or more agreements. 2 | // The .NET Foundation licenses this file to you under the MIT license. 3 | // See the LICENSE file in the project root for more information. 4 | 5 | using System; 6 | using System.Collections.Generic; 7 | using System.Linq; 8 | using System.Text; 9 | 10 | namespace Microsoft.Templates.Core.PostActions.Catalog.Merge.CodeStyleProviders 11 | { 12 | public class XmlStyleProvider : BaseCodeStyleProvider 13 | { 14 | public override string CommentSymbol => ""; 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /code/src/CoreTemplateStudio/CoreTemplateStudio.Core/Templates/LayoutItem.cs: -------------------------------------------------------------------------------- 1 | // Licensed to the .NET Foundation under one or more agreements. 2 | // The .NET Foundation licenses this file to you under the MIT license. 3 | // See the LICENSE file in the project root for more information. 4 | 5 | using Newtonsoft.Json; 6 | 7 | namespace Microsoft.Templates.Core 8 | { 9 | public class LayoutItem 10 | { 11 | [JsonProperty("name")] 12 | public string Name { get; set; } 13 | 14 | [JsonProperty("templateGroupIdentity")] 15 | public string TemplateGroupIdentity { get; set; } 16 | 17 | [JsonProperty("readonly")] 18 | public bool Readonly { get; set; } 19 | 20 | [JsonProperty("projecttype")] 21 | public string ProjectType { get; set; } 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /code/src/CoreTemplateStudio/CoreTemplateStudio.Cli/Commands/Validators/GetProjectTypesValidator.cs: -------------------------------------------------------------------------------- 1 | // Licensed to the .NET Foundation under one or more agreements. 2 | // The .NET Foundation licenses this file to you under the MIT license. 3 | // See the LICENSE file in the project root for more information. 4 | 5 | using FluentValidation; 6 | using Microsoft.Templates.Cli.Resources; 7 | using Microsoft.Templates.Core.Gen; 8 | 9 | namespace Microsoft.Templates.Cli.Commands.Validators 10 | { 11 | public class GetProjectTypesValidator : AbstractValidator 12 | { 13 | public GetProjectTypesValidator() 14 | { 15 | RuleFor(x => GenContext.ToolBox) 16 | .NotEmpty() 17 | .WithMessage(StringRes.BadReqNotSynced); 18 | } 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /code/src/CoreTemplateStudio/CoreTemplateStudio.Cli/Models/GenerationItem.cs: -------------------------------------------------------------------------------- 1 | // Licensed to the .NET Foundation under one or more agreements. 2 | // The .NET Foundation licenses this file to you under the MIT license. 3 | // See the LICENSE file in the project root for more information. 4 | 5 | using System; 6 | using System.ComponentModel.DataAnnotations; 7 | using Microsoft.Templates.Core.Gen; 8 | 9 | namespace Microsoft.Templates.Cli.Models 10 | { 11 | public class GenerationItem 12 | { 13 | [Required] 14 | public string TemplateId { get; set; } 15 | 16 | [Required] 17 | public string Name { get; set; } 18 | 19 | public UserSelectionItem ToGenerationItem() => new UserSelectionItem { Name = this.Name.MakeSafeProjectName(), TemplateId = this.TemplateId }; 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /code/src/CoreTemplateStudio/CoreTemplateStudio.Cli/Services/Contracts/IGenerateService.cs: -------------------------------------------------------------------------------- 1 | // Licensed to the .NET Foundation under one or more agreements. 2 | // The .NET Foundation licenses this file to you under the MIT license. 3 | // See the LICENSE file in the project root for more information. 4 | 5 | using System; 6 | using System.Collections.Generic; 7 | using System.Threading.Tasks; 8 | using Microsoft.Templates.Cli.Models; 9 | using Microsoft.Templates.Cli.Utilities; 10 | using Microsoft.Templates.Core; 11 | 12 | namespace Microsoft.Templates.Cli.Services.Contracts 13 | { 14 | public interface IGenerateService 15 | { 16 | Task GenerateAsync(GenerationData generationData); 17 | 18 | IEnumerable GetAllLicences(GenerationData generationData); 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /code/test/CoreTemplateStudio.Core.Test/TestData/Templates/test/FeatureTemplate/.template.config/template.json: -------------------------------------------------------------------------------- 1 | { 2 | "author": "Microsoft", 3 | "classifications": [ "Test" ], 4 | "name": "FeatureTemplate", 5 | "description": "Generic Feature description...", 6 | "groupIdentity": "Microsoft.Templates.Test.FeatureTemplate", 7 | "identity": "Microsoft.Templates.Test.FeatureTemplate.CSharp", 8 | "shortName": "FeatureTemplate", 9 | "tags": { 10 | "language": "C#", 11 | "type": "item", 12 | "wts.platform": "test", 13 | "wts.projecttype": "all", 14 | "wts.frontendframework": "fx1", 15 | "wts.backendframework": "fx3", 16 | "wts.type": "feature", 17 | "wts.multipleInstance": "false", 18 | "wts.isGroupExclusiveSelection": "true" 19 | }, 20 | "sourceName": "App_Name", 21 | "preferNameDirectory": true 22 | } -------------------------------------------------------------------------------- /code/test/CoreTemplateStudio.Core.Test/TestData/Templates/test/TestingTemplate/.template.config/template.json: -------------------------------------------------------------------------------- 1 | { 2 | "author": "Microsoft", 3 | "classifications": [ "Test" ], 4 | "name": "TestingTemplate", 5 | "description": "Generic Testing description...", 6 | "groupIdentity": "Microsoft.Templates.Test.TestingTemplate", 7 | "identity": "Microsoft.Templates.Test.TestingTemplate.CSharp", 8 | "shortName": "TestingTemplate", 9 | "tags": { 10 | "language": "C#", 11 | "type": "item", 12 | "wts.platform": "test", 13 | "wts.projecttype": "all", 14 | "wts.frontendframework": "fx1", 15 | "wts.backendframework": "fx3", 16 | "wts.type": "testing", 17 | "wts.multipleInstance": "false", 18 | "wts.isGroupExclusiveSelection": "true" 19 | }, 20 | "sourceName": "App_Name", 21 | "preferNameDirectory": true 22 | } -------------------------------------------------------------------------------- /code/src/CoreTemplateStudio/CoreTemplateStudio.Core/Gen/TempGenerationResult.cs: -------------------------------------------------------------------------------- 1 | // Licensed to the .NET Foundation under one or more agreements. 2 | // The .NET Foundation licenses this file to you under the MIT license. 3 | // See the LICENSE file in the project root for more information. 4 | 5 | using System.Collections.Generic; 6 | 7 | namespace Microsoft.Templates.Core.Gen 8 | { 9 | public class TempGenerationResult 10 | { 11 | public List NewFiles { get; } = new List(); 12 | 13 | public List ModifiedFiles { get; } = new List(); 14 | 15 | public List ConflictingFiles { get; } = new List(); 16 | 17 | public List UnchangedFiles { get; } = new List(); 18 | 19 | public bool SyncGeneration { get; set; } 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /code/test/CoreTemplateStudio.Core.Test/TestData/Merge/Style_fail.xaml: -------------------------------------------------------------------------------- 1 | 4 | 5 | 28 6 | 16 7 | 15 | 16 | -------------------------------------------------------------------------------- /code/src/CoreTemplateStudio/CoreTemplateStudio.Core/Gen/Shell/IGenShellSolution.cs: -------------------------------------------------------------------------------- 1 | // Licensed to the .NET Foundation under one or more agreements. 2 | // The .NET Foundation licenses this file to you under the MIT license. 3 | // See the LICENSE file in the project root for more information. 4 | 5 | using System.Collections.Generic; 6 | 7 | namespace Microsoft.Templates.Core.Gen.Shell 8 | { 9 | public interface IGenShellSolution 10 | { 11 | void ChangeSolutionConfiguration(IEnumerable projectConfigurations); 12 | 13 | void SetDefaultSolutionConfiguration(string configurationName, string platformName, string projectName); 14 | 15 | void AddContextItemsToSolution(ProjectInfo projectInfo); 16 | 17 | void CloseSolution(); 18 | 19 | void CollapseSolutionItems(); 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /code/src/CoreTemplateStudio/CoreTemplateStudio.Core/Gen/GenToolBox.cs: -------------------------------------------------------------------------------- 1 | // Licensed to the .NET Foundation under one or more agreements. 2 | // The .NET Foundation licenses this file to you under the MIT license. 3 | // See the LICENSE file in the project root for more information. 4 | 5 | using Microsoft.Templates.Core.Gen.Shell; 6 | 7 | namespace Microsoft.Templates.Core.Gen 8 | { 9 | public class GenToolBox 10 | { 11 | public TemplatesRepository Repo { get; } 12 | 13 | public IGenShell Shell { get; } 14 | 15 | public string WizardVersion => Repo.WizardVersion; 16 | 17 | public string TemplatesVersion => Repo.TemplatesVersion; 18 | 19 | public GenToolBox(TemplatesRepository repo, IGenShell shell) 20 | { 21 | Repo = repo; 22 | Shell = shell; 23 | } 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /code/test/CoreTemplateStudio.Core.Test/TestData/Merge/Style_fail_postaction.xaml: -------------------------------------------------------------------------------- 1 | 4 | 5 | 16 6 | 14 | 5 15 | 16 | 17 | -------------------------------------------------------------------------------- /code/test/CoreTemplateStudio.Core.Test/TestData/Templates/test/Dependencies.FeatureTemplate/.template.config/template.json: -------------------------------------------------------------------------------- 1 | { 2 | "author": "Microsoft", 3 | "classifications": [ "Test" ], 4 | "name": "DependenciesTemplate", 5 | "groupIdentity": "Microsoft.Templates.Test.DependenciesTemplate", 6 | "identity": "Microsoft.Templates.Test.DependenciesTemplate.CSharp", 7 | "shortName": "DependenciesTemplate", 8 | "tags": { 9 | "language": "C#", 10 | "type": "item", 11 | "wts.platform": "test", 12 | "wts.type": "feature", 13 | "wts.dependencies": "dp1|dp2" 14 | }, 15 | "sourceName": "App_Name", 16 | "preferNameDirectory": true, 17 | "symbols": { 18 | "dp1": { 19 | "type": "parameter", 20 | "replaces": "Param_dp1" 21 | }, 22 | "dp2": { 23 | "type": "parameter", 24 | "replaces": "Param_dp2" 25 | } 26 | 27 | } 28 | } -------------------------------------------------------------------------------- /code/test/Utilities.Test/Packaging/SampleConfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "Latest": { 3 | "Name": "UWP.CS.Templates_1.2.3.4.mstx", 4 | "Date": "2018-06-11T03:38:10", 5 | "Language": "CS", 6 | "Platform": "Uwp", 7 | "WizardVersions": [ "1.2", "1.3" ], 8 | "Bytes": 5820179 9 | }, 10 | "RootUri": "https://wtsrepository.blob.core.windows.net:443/dev", 11 | "Versions": [ 12 | { 13 | "Name": "UWP.CS.Templates_1.2.3.4.mstx", 14 | "Date": "2018-06-11T03:38:10", 15 | "Language": "CS", 16 | "Platform": "Uwp", 17 | "WizardVersions": [ "1.2", "1.3" ], 18 | "Bytes": 5820179 19 | }, 20 | { 21 | "Name": "UWP.VB.Templates_1.2.3.4.mstx", 22 | "Date": "2018-06-11T03:38:10", 23 | "Language": "VB", 24 | "Platform": "Uwp", 25 | "WizardVersions": [ "1.2", "1.3" ], 26 | "Bytes": 5820179 27 | } 28 | ] 29 | } -------------------------------------------------------------------------------- /code/test/CoreTemplateStudio.Core.Test/Locations/UnitTestsTemplatesSource.cs: -------------------------------------------------------------------------------- 1 | // Licensed to the .NET Foundation under one or more agreements. 2 | // The .NET Foundation licenses this file to you under the MIT license. 3 | // See the LICENSE file in the project root for more information. 4 | 5 | using System; 6 | using System.IO; 7 | 8 | using Microsoft.Templates.Core.Locations; 9 | 10 | namespace Microsoft.Templates.Core.Test.Locations 11 | { 12 | public sealed class UnitTestsTemplatesSource : LocalTemplatesSource 13 | { 14 | public UnitTestsTemplatesSource(string installedPackagePath) 15 | : base(installedPackagePath) 16 | { 17 | } 18 | 19 | public override string Id => "UnitTest" + GetAgentName(); 20 | 21 | protected override string Origin => $@"..\..\..\TestData\{TemplatesFolderName}"; 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /code/test/CoreTemplateStudio.Core.Test/TestData/Merge/Style_postaction.xaml: -------------------------------------------------------------------------------- 1 | 4 | 5 | 16 6 | 5 7 | 8 | 16 | 17 | -------------------------------------------------------------------------------- /code/test/CoreTemplateStudio.Core.Test/TestData/Templates/test/ServiceTemplate/.template.config/template.json: -------------------------------------------------------------------------------- 1 | { 2 | "author": "Microsoft", 3 | "classifications": [ "Test" ], 4 | "name": "ServiceTemplate", 5 | "description": "Generic description...", 6 | "groupIdentity": "Microsoft.Templates.Test.ServiceTemplate", 7 | "identity": "Microsoft.Templates.Test.ServiceTemplate.CSharp", 8 | "shortName": "ServiceTemplate", 9 | "tags": { 10 | "language": "C#", 11 | "type": "item", 12 | "wts.platform": "test", 13 | "wts.projecttype": "all", 14 | "wts.frontendframework": "fx1", 15 | "wts.backendframework": "fx3", 16 | "wts.type": "service", 17 | "wts.displayOrder": "1", 18 | "wts.genGroup": "1", 19 | "wts.export.baseclass": "ViewModelBase", 20 | "wts.export.setter": "Set" 21 | }, 22 | "sourceName": "App_Name", 23 | "preferNameDirectory": true 24 | } -------------------------------------------------------------------------------- /code/src/CoreTemplateStudio/CoreTemplateStudio.Core/Gen/ProjectConfiguration.cs: -------------------------------------------------------------------------------- 1 | // Licensed to the .NET Foundation under one or more agreements. 2 | // The .NET Foundation licenses this file to you under the MIT license. 3 | // See the LICENSE file in the project root for more information. 4 | 5 | namespace Microsoft.Templates.Core.Gen 6 | { 7 | public class ProjectConfiguration 8 | { 9 | public string Project { get; set; } 10 | 11 | public bool SetDeploy { get; set; } 12 | 13 | public override bool Equals(object obj) 14 | { 15 | if (obj is ProjectConfiguration nugetReference) 16 | { 17 | return Project == nugetReference.Project; 18 | } 19 | 20 | return false; 21 | } 22 | 23 | public override int GetHashCode() => base.GetHashCode(); 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /code/src/CoreTemplateStudio/CoreTemplateStudio.Core/PostActions/Catalog/AddJsonDictionaryItem/DictionaryExtensions.cs: -------------------------------------------------------------------------------- 1 | // Licensed to the .NET Foundation under one or more agreements. 2 | // The .NET Foundation licenses this file to you under the MIT license. 3 | // See the LICENSE file in the project root for more information. 4 | 5 | using System.Collections.Generic; 6 | using System.Linq; 7 | 8 | namespace Microsoft.Templates.Core.PostActions.Catalog.AddJsonDictionaryItem 9 | { 10 | internal static class DictionaryExtensions 11 | { 12 | public static IDictionary Merge(this IDictionary dictA, IDictionary dictB) 13 | where TValue : class 14 | { 15 | return dictA.Keys.Union(dictB.Keys).ToDictionary(k => k, k => dictA.ContainsKey(k) ? dictA[k] : dictB[k]); 16 | } 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /code/test/CoreTemplateStudio.Core.Test/Packaging/SampleConfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "Latest": { 3 | "Name": "UWP.CS.Templates_1.2.3.4.mstx", 4 | "Date": "2018-06-11T03:38:10", 5 | "Language": "CS", 6 | "Platform": "Uwp", 7 | "WizardVersions": [ "1.2", "1.3" ], 8 | "Bytes": 5820179 9 | }, 10 | "RootUri": "https://wtsrepository.blob.core.windows.net:443/dev", 11 | "Versions": [ 12 | { 13 | "Name": "UWP.CS.Templates_1.2.3.4.mstx", 14 | "Date": "2018-06-11T03:38:10", 15 | "Language": "CS", 16 | "Platform": "Uwp", 17 | "WizardVersions": [ "1.2", "1.3" ], 18 | "Bytes": 5820179 19 | }, 20 | { 21 | "Name": "UWP.VB.Templates_1.2.3.4.mstx", 22 | "Date": "2018-06-11T03:38:10", 23 | "Language": "VB", 24 | "Platform": "Uwp", 25 | "WizardVersions": [ "1.2", "1.3" ], 26 | "Bytes": 5820179 27 | } 28 | ] 29 | } -------------------------------------------------------------------------------- /code/test/CoreTemplateStudio.Core.Test/TestData/Templates/test/ProjectTemplate_FrontAndBack/.template.config/template.json: -------------------------------------------------------------------------------- 1 | { 2 | "author": "Microsoft", 3 | "classifications": [ "Test" ], 4 | "name": "ProjectTemplate2", 5 | "groupIdentity": "Microsoft.Templates.Test.ProjectTemplate2", 6 | "identity": "Microsoft.Templates.Test.ProjectTemplate2.CSharp", 7 | "shortName": "ProjectTemplate2", 8 | "tags": { 9 | "language": "C#", 10 | "type": "project", 11 | "wts.type": "project", 12 | "wts.projecttype": "pt3", 13 | "wts.frontendframework": "fx3", 14 | "wts.backendframework": "fx4|TestFramework", 15 | "wts.platform": "test", 16 | "wts.version": "1.0.0", 17 | "wts.licenses": "[text1](url1)|[text2](url2)", 18 | "wts.group": "group1", 19 | "wts.defaultInstance": "DefaultName" 20 | }, 21 | "sourceName": "App_Name", 22 | "preferNameDirectory": true 23 | } -------------------------------------------------------------------------------- /code/src/CoreTemplateStudio/CoreTemplateStudio.Core/PostActions/Catalog/SortNamespaces/SortUsingsPostAction.cs: -------------------------------------------------------------------------------- 1 | // Licensed to the .NET Foundation under one or more agreements. 2 | // The .NET Foundation licenses this file to you under the MIT license. 3 | // See the LICENSE file in the project root for more information. 4 | 5 | using System.Collections.Generic; 6 | 7 | namespace Microsoft.Templates.Core.PostActions.Catalog.SortNamespaces 8 | { 9 | public class SortUsingsPostAction : SortNamespacesPostAction 10 | { 11 | public SortUsingsPostAction(List paths) 12 | : base(paths) 13 | { 14 | } 15 | 16 | public override string FilesToSearch => "*.cs"; 17 | 18 | public override bool SortMethod(List classContent) 19 | { 20 | return classContent.SortUsings(); 21 | } 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /code/src/CoreTemplateStudio/CoreTemplateStudio.Core/PostActions/Catalog/SortNamespaces/SortImportsPostAction.cs: -------------------------------------------------------------------------------- 1 | // Licensed to the .NET Foundation under one or more agreements. 2 | // The .NET Foundation licenses this file to you under the MIT license. 3 | // See the LICENSE file in the project root for more information. 4 | 5 | using System.Collections.Generic; 6 | 7 | namespace Microsoft.Templates.Core.PostActions.Catalog.SortNamespaces 8 | { 9 | public class SortImportsPostAction : SortNamespacesPostAction 10 | { 11 | public SortImportsPostAction(List paths) 12 | : base(paths) 13 | { 14 | } 15 | 16 | public override string FilesToSearch => "*.vb"; 17 | 18 | public override bool SortMethod(List classContent) 19 | { 20 | return classContent.SortImports(); 21 | } 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /code/test/CoreTemplateStudio.Core.Test/TestData/Templates/test/ProjectTemplate/.template.config/template.json: -------------------------------------------------------------------------------- 1 | { 2 | "author": "Microsoft", 3 | "classifications": [ "Test" ], 4 | "name": "ProjectTemplate", 5 | "groupIdentity": "Microsoft.Templates.Test.ProjectTemplate", 6 | "identity": "Microsoft.Templates.Test.ProjectTemplate.CSharp", 7 | "shortName": "ProjectTemplate", 8 | "tags": { 9 | "language": "C#", 10 | "type": "project", 11 | "wts.type": "project", 12 | "wts.projecttype": "pt1|pt2|TestProjectType", 13 | "wts.frontendframework": "fx1|TestFramework", 14 | "wts.platform": "test", 15 | "wts.version": "1.0.0", 16 | "wts.licenses": "[text1](url1)|[text2](url2)", 17 | "wts.group": "group1", 18 | "wts.defaultInstance": "DefaultName", 19 | "wts.requiredVersions": "sdk1|sdk2" 20 | }, 21 | "sourceName": "App_Name", 22 | "preferNameDirectory": true 23 | } -------------------------------------------------------------------------------- /code/src/CoreTemplateStudio/CoreTemplateStudio.Core/Gen/NewItemGenerationFileInfo.cs: -------------------------------------------------------------------------------- 1 | // Licensed to the .NET Foundation under one or more agreements. 2 | // The .NET Foundation licenses this file to you under the MIT license. 3 | // See the LICENSE file in the project root for more information. 4 | 5 | namespace Microsoft.Templates.Core.Gen 6 | { 7 | public class NewItemGenerationFileInfo 8 | { 9 | public string Name { get; set; } 10 | 11 | public string NewItemGenerationFilePath { get; set; } 12 | 13 | public string ProjectFilePath { get; set; } 14 | 15 | public NewItemGenerationFileInfo(string name, string newItemGenerationFilePath, string projectFilePath) 16 | { 17 | Name = name; 18 | NewItemGenerationFilePath = newItemGenerationFilePath; 19 | ProjectFilePath = projectFilePath; 20 | } 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /code/src/CoreTemplateStudio/CoreTemplateStudio.Core/PostActions/Catalog/AddContextItemsToSolutionAndProjectPostAction.cs: -------------------------------------------------------------------------------- 1 | // Licensed to the .NET Foundation under one or more agreements. 2 | // The .NET Foundation licenses this file to you under the MIT license. 3 | // See the LICENSE file in the project root for more information. 4 | 5 | using System.Diagnostics; 6 | using System.Threading.Tasks; 7 | 8 | using Microsoft.Templates.Core.Diagnostics; 9 | using Microsoft.Templates.Core.Gen; 10 | using Microsoft.Templates.Core.Resources; 11 | 12 | namespace Microsoft.Templates.Core.PostActions.Catalog 13 | { 14 | public class AddContextItemsToSolutionAndProjectPostAction : PostAction 15 | { 16 | internal override void ExecuteInternal() 17 | { 18 | GenContext.ToolBox.Shell.Solution.AddContextItemsToSolution(GenContext.Current.ProjectInfo); 19 | } 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /code/src/CoreTemplateStudio/CoreTemplateStudio.Core/Helpers/FileHelper.cs: -------------------------------------------------------------------------------- 1 | // Licensed to the .NET Foundation under one or more agreements. 2 | // The .NET Foundation licenses this file to you under the MIT license. 3 | // See the LICENSE file in the project root for more information. 4 | 5 | using System; 6 | using System.IO; 7 | 8 | namespace Microsoft.Templates.Core.Helpers 9 | { 10 | public static class FileHelper 11 | { 12 | public static string GetFileContent(string filePath) 13 | { 14 | if (!File.Exists(filePath)) 15 | { 16 | return string.Empty; 17 | } 18 | 19 | try 20 | { 21 | return File.ReadAllText(filePath); 22 | } 23 | catch (Exception) 24 | { 25 | return string.Empty; 26 | } 27 | } 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /code/test/CoreTemplateStudio.Core.Test/TestData/Templates/test/ProjectTemplateVB/.template.config/template.json: -------------------------------------------------------------------------------- 1 | { 2 | "author": "Microsoft", 3 | "classifications": [ "Test" ], 4 | "name": "ProjectTemplate", 5 | "groupIdentity": "Microsoft.Templates.Test.ProjectTemplate", 6 | "identity": "Microsoft.Templates.Test.ProjectTemplate.VisualBasic", 7 | "shortName": "project-test", 8 | "tags": { 9 | "language": "VisualBasic", 10 | "type": "project", 11 | "wts.type": "project", 12 | "wts.projecttype": "pt1|pt2|TestProjectType", 13 | "wts.frontendframework": "fx1|TestFramework", 14 | "wts.platform": "test", 15 | "wts.version": "1.0.0", 16 | "wts.licenses": "[text1](url1)|[text2](url2)", 17 | "wts.group": "group1", 18 | "wts.defaultInstance": "DefaultName", 19 | "wts.requiredVersions": "sdk1|sdk2" 20 | }, 21 | "sourceName": "App_Name", 22 | "preferNameDirectory": true 23 | } 24 | -------------------------------------------------------------------------------- /code/StyleCop.json: -------------------------------------------------------------------------------- 1 | { 2 | "$schema": "https://raw.githubusercontent.com/DotNetAnalyzers/StyleCopAnalyzers/master/StyleCop.Analyzers/StyleCop.Analyzers/Settings/stylecop.schema.json", 3 | "settings": { 4 | "documentationRules": { 5 | "companyName": ".NET Foundation", 6 | "copyrightText": "Licensed to the {companyName} under one or more agreements.\r\nThe {companyName} licenses this file to you under the MIT license.\r\nSee the LICENSE file in the project root for more information.", 7 | "xmlHeader": false, 8 | "headerDecoration": "", 9 | "fileNamingConvention": "metadata", 10 | "documentInterfaces": false, 11 | "documentExposedElements": false, 12 | "documentInternalElements": false 13 | }, 14 | "layoutRules": { 15 | "newlineAtEndOfFile": "require" 16 | }, 17 | "orderingRules": { 18 | "usingDirectivesPlacement": "outsideNamespace" 19 | } 20 | } 21 | } -------------------------------------------------------------------------------- /code/src/CoreTemplateStudio/CoreTemplateStudio.Core/PostActions/Catalog/SetDefaultSolutionConfigurationPostAction.cs: -------------------------------------------------------------------------------- 1 | // Licensed to the .NET Foundation under one or more agreements. 2 | // The .NET Foundation licenses this file to you under the MIT license. 3 | // See the LICENSE file in the project root for more information. 4 | 5 | using System.Threading.Tasks; 6 | 7 | using Microsoft.Templates.Core.Gen; 8 | 9 | namespace Microsoft.Templates.Core.PostActions.Catalog 10 | { 11 | public class SetDefaultSolutionConfigurationPostAction : PostAction 12 | { 13 | private const string Configuration = "Debug"; 14 | private const string Platform = "x86"; 15 | 16 | internal override void ExecuteInternal() 17 | { 18 | GenContext.ToolBox.Shell.Solution.SetDefaultSolutionConfiguration(Configuration, Platform, GenContext.Current.ProjectName); 19 | } 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /code/test/CoreTemplateStudio.Core.Test/TestData/Templates/test/PageTemplate/.template.config/template.json: -------------------------------------------------------------------------------- 1 | { 2 | "author": "Microsoft", 3 | "classifications": [ "Test" ], 4 | "name": "PageTemplate", 5 | "description": "Generic description...", 6 | "groupIdentity": "Microsoft.Templates.Test.PageTemplate", 7 | "identity": "Microsoft.Templates.Test.PageTemplate.CSharp", 8 | "shortName": "page-test", 9 | "tags": { 10 | "language": "C#", 11 | "type": "item", 12 | "wts.platform": "test", 13 | "wts.projecttype": "all", 14 | "wts.frontendframework": "fx1", 15 | "wts.backendframework": "fx3", 16 | "wts.type": "page", 17 | "wts.displayOrder": "1", 18 | "wts.genGroup": "1", 19 | "wts.export.baseclass": "ViewModelBase", 20 | "wts.export.setter": "Set", 21 | "wts.casing.sourceName": "kebab|camel|pascal|snake" 22 | }, 23 | "sourceName": "App_Name", 24 | "preferNameDirectory": true 25 | } -------------------------------------------------------------------------------- /code/src/CoreTemplateStudio/CoreTemplateStudio.Core/PostActions/Catalog/ChangeSolutionConfigurationPostAction.cs: -------------------------------------------------------------------------------- 1 | // Licensed to the .NET Foundation under one or more agreements. 2 | // The .NET Foundation licenses this file to you under the MIT license. 3 | // See the LICENSE file in the project root for more information. 4 | 5 | using System.Linq; 6 | using System.Threading.Tasks; 7 | 8 | using Microsoft.Templates.Core.Gen; 9 | 10 | namespace Microsoft.Templates.Core.PostActions.Catalog 11 | { 12 | public class ChangeSolutionConfigurationPostAction : PostAction 13 | { 14 | internal override void ExecuteInternal() 15 | { 16 | if (GenContext.Current.ProjectInfo.ProjectConfigurations.Any()) 17 | { 18 | GenContext.ToolBox.Shell.Solution.ChangeSolutionConfiguration(GenContext.Current.ProjectInfo.ProjectConfigurations); 19 | } 20 | } 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /code/src/CoreTemplateStudio/CoreTemplateStudio.Core/PostActions/Catalog/NewItemGeneration/OpenFilesPostAction.cs: -------------------------------------------------------------------------------- 1 | // Licensed to the .NET Foundation under one or more agreements. 2 | // The .NET Foundation licenses this file to you under the MIT license. 3 | // See the LICENSE file in the project root for more information. 4 | 5 | using System.Threading.Tasks; 6 | 7 | using Microsoft.Templates.Core.Gen; 8 | using Microsoft.Templates.Core.Resources; 9 | 10 | namespace Microsoft.Templates.Core.PostActions.Catalog 11 | { 12 | public class OpenFilesPostAction : PostAction 13 | { 14 | internal override void ExecuteInternal() 15 | { 16 | GenContext.ToolBox.Shell.UI.ShowStatusBarMessage(StringRes.StatusOpeningItems); 17 | GenContext.ToolBox.Shell.UI.OpenItems(GenContext.Current.FilesToOpen.ToArray()); 18 | GenContext.Current.FilesToOpen.Clear(); 19 | } 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /code/test/CoreTemplateStudio.Core.Test/TestData/Merge/Style_expected.xaml: -------------------------------------------------------------------------------- 1 | 4 | 5 | 28 6 | 16 7 | 5 8 | 9 | 17 | 18 | 19 | -------------------------------------------------------------------------------- /code/tools/WtsTelemetry/WtsTelemetry.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | netcoreapp3.1 4 | v3 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | PreserveNewest 15 | 16 | 17 | PreserveNewest 18 | Never 19 | 20 | 21 | -------------------------------------------------------------------------------- /code/tools/WtsTelemetry/Models/WinUIPlatformData.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Text; 4 | using WtsTelemetry.Helpers; 5 | 6 | namespace WtsTelemetry.Models 7 | { 8 | public class WinUIPlatformData: WinTSPlatformData 9 | { 10 | public string AppModels { get; set; } 11 | 12 | public override string ToMarkdown() 13 | { 14 | return new MarkdownBuilder() 15 | .AddTable("App Model", "App Model", AppModels) 16 | .AddTable("Project Type", "Project", Project) 17 | .AddTable("Framework", "Framework Type", Frameworks) 18 | .AddTable("Pages", "Pages", Pages) 19 | .AddTable("Features", "Features", Features) 20 | .AddTable("Services", "Services", Services) 21 | .AddTable("Testing", "Testing", Testing) 22 | .GetText(); 23 | } 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /code/src/CoreTemplateStudio/CoreTemplateStudio.Cli/Commands/Validators/GenerateValidator.cs: -------------------------------------------------------------------------------- 1 | // Licensed to the .NET Foundation under one or more agreements. 2 | // The .NET Foundation licenses this file to you under the MIT license. 3 | // See the LICENSE file in the project root for more information. 4 | 5 | using FluentValidation; 6 | using Microsoft.Templates.Cli.Resources; 7 | using Microsoft.Templates.Core.Gen; 8 | 9 | namespace Microsoft.Templates.Cli.Commands.Validators 10 | { 11 | public class GenerateValidator : AbstractValidator 12 | { 13 | public GenerateValidator() 14 | { 15 | RuleFor(x => GenContext.ToolBox) 16 | .NotEmpty() 17 | .WithMessage(StringRes.BadReqNotSynced); 18 | 19 | RuleFor(x => x.GenerationDataJson) 20 | .NotEmpty() 21 | .WithMessage(StringRes.BadReqInvalidGenJson); 22 | } 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /code/test/CoreTemplateStudio.Core.Test/TestData/Templates/test/PageTemplate_PropertyBag/.template.config/template.json: -------------------------------------------------------------------------------- 1 | { 2 | "author": "Microsoft", 3 | "classifications": [ "Test" ], 4 | "name": "PageTemplatePropertyBag", 5 | "description": "Generic description...", 6 | "groupIdentity": "Microsoft.Templates.Test.PageTemplatePropertyBag", 7 | "identity": "Microsoft.Templates.Test.PageTemplatePropertyBag.CSharp", 8 | "shortName": "page-test", 9 | "tags": { 10 | "language": "C#", 11 | "type": "item", 12 | "wts.platform": "test", 13 | "wts.projecttype": "all", 14 | "wts.frontendframework": "fx4", 15 | "wts.backendframework": "fx5", 16 | "wts.pb1": "value1", 17 | "wts.pb2": "all", 18 | "wts.type": "page", 19 | "wts.displayOrder": "1", 20 | "wts.genGroup": "1", 21 | "wts.export.baseclass": "ViewModelBase", 22 | "wts.export.setter": "Set", 23 | }, 24 | "sourceName": "App_Name", 25 | "preferNameDirectory": true 26 | } -------------------------------------------------------------------------------- /code/tools/WtsPackagingTool/CommandOptions/RemoteSourceCommonOptions.cs: -------------------------------------------------------------------------------- 1 | // Licensed to the .NET Foundation under one or more agreements. 2 | // The .NET Foundation licenses this file to you under the MIT license. 3 | // See the LICENSE file in the project root for more information. 4 | 5 | using System; 6 | using System.Collections.Generic; 7 | using System.Linq; 8 | using System.Text; 9 | using System.Threading.Tasks; 10 | using CommandLine; 11 | 12 | namespace WtsPackagingTool.CommandOptions 13 | { 14 | public class RemoteSourceCommonOptions : CommonOptions 15 | { 16 | [Option('a', "storage-account", HelpText = "Storage account for remote templates source operation.", Default = "wtsrepository")] 17 | public string StorageAccount { get; set; } 18 | 19 | [Option('e', "env", HelpText = "Environment. Valid values: Pro, Pre, Dev or Test", Default = EnvEnum.Dev)] 20 | public EnvEnum Env { get; set; } 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /code/test/CoreTemplateStudio.Core.Test/TestData/Templates/test/ProjectTemplate_PropertyBag/.template.config/template.json: -------------------------------------------------------------------------------- 1 | { 2 | "author": "Microsoft", 3 | "classifications": [ "Test" ], 4 | "name": "ProjectTemplatePropertyBag", 5 | "groupIdentity": "Microsoft.Templates.Test.ProjectTemplatePropertyBag", 6 | "identity": "Microsoft.Templates.Test.ProjectTemplatePropertyBag.CSharp", 7 | "shortName": "ProjectTemplate", 8 | "tags": { 9 | "language": "C#", 10 | "type": "project", 11 | "wts.type": "project", 12 | "wts.projecttype": "pt1", 13 | "wts.frontendframework": "fx4", 14 | "wts.pb1": "value1", 15 | "wts.pb2": "all", 16 | "wts.platform": "test", 17 | "wts.version": "1.0.0", 18 | "wts.licenses": "[text1](url1)|[text2](url2)", 19 | "wts.group": "group1", 20 | "wts.defaultInstance": "DefaultName", 21 | "wts.requiredVersions": "sdk1|sdk2" 22 | 23 | }, 24 | "sourceName": "App_Name", 25 | "preferNameDirectory": true 26 | } -------------------------------------------------------------------------------- /code/src/CoreTemplateStudio/CoreTemplateStudio.Cli/Commands/Validators/GetFrameworksValidator.cs: -------------------------------------------------------------------------------- 1 | // Licensed to the .NET Foundation under one or more agreements. 2 | // The .NET Foundation licenses this file to you under the MIT license. 3 | // See the LICENSE file in the project root for more information. 4 | 5 | using FluentValidation; 6 | using Microsoft.Templates.Cli.Resources; 7 | using Microsoft.Templates.Core.Gen; 8 | 9 | namespace Microsoft.Templates.Cli.Commands.Validators 10 | { 11 | public class GetFrameworksValidator : AbstractValidator 12 | { 13 | public GetFrameworksValidator() 14 | { 15 | RuleFor(x => GenContext.ToolBox) 16 | .NotEmpty() 17 | .WithMessage(StringRes.BadReqNotSynced); 18 | 19 | RuleFor(x => x.ProjectType) 20 | .NotEmpty() 21 | .WithMessage(StringRes.BadReqInvalidProjectType); 22 | } 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /code/test/Utilities.Test/Properties/AssemblyInfo.cs: -------------------------------------------------------------------------------- 1 | // Licensed to the .NET Foundation under one or more agreements. 2 | // The .NET Foundation licenses this file to you under the MIT license. 3 | // See the LICENSE file in the project root for more information. 4 | 5 | using System.Reflection; 6 | using System.Runtime.CompilerServices; 7 | using System.Runtime.InteropServices; 8 | 9 | [assembly: AssemblyTitle("Utilities.Test")] 10 | [assembly: AssemblyDescription("")] 11 | [assembly: AssemblyConfiguration("")] 12 | [assembly: AssemblyCompany("")] 13 | [assembly: AssemblyProduct("Utilities.Test")] 14 | [assembly: AssemblyCopyright("Copyright © 2019")] 15 | [assembly: AssemblyTrademark("")] 16 | [assembly: AssemblyCulture("")] 17 | 18 | [assembly: ComVisible(false)] 19 | 20 | [assembly: Guid("80d4d7e7-fa07-4a43-a5a4-f3089cd3eb81")] 21 | 22 | // [assembly: AssemblyVersion("1.0.*")] 23 | [assembly: AssemblyVersion("1.0.0.0")] 24 | [assembly: AssemblyFileVersion("0.0.0.0")] 25 | -------------------------------------------------------------------------------- /code/src/CoreTemplateStudio/CoreTemplateStudio.Cli/.vscode/launch.json: -------------------------------------------------------------------------------- 1 | { 2 | // Use IntelliSense to learn about possible attributes. 3 | // Hover to view descriptions of existing attributes. 4 | // For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387 5 | "version": "0.2.0", 6 | "configurations": [ 7 | { 8 | "name": ".NET Core Launch (console)", 9 | "type": "coreclr", 10 | "request": "launch", 11 | "preLaunchTask": "build", 12 | "program": "${workspaceFolder}/bin/Debug/netcoreapp2.2/CoreTemplateStudio.Cli.dll", 13 | "args": [], 14 | "cwd": "${workspaceFolder}", 15 | "console": "internalConsole", 16 | "stopAtEntry": false 17 | }, 18 | { 19 | "name": ".NET Core Attach", 20 | "type": "coreclr", 21 | "request": "attach", 22 | "processId": "${command:pickProcess}" 23 | } 24 | ] 25 | } -------------------------------------------------------------------------------- /code/src/CoreTemplateStudio/CoreTemplateStudio.Cli/Commands/Validators/GetAllLicencesValidator.cs: -------------------------------------------------------------------------------- 1 | // Licensed to the .NET Foundation under one or more agreements. 2 | // The .NET Foundation licenses this file to you under the MIT license. 3 | // See the LICENSE file in the project root for more information. 4 | 5 | using FluentValidation; 6 | using Microsoft.Templates.Cli.Resources; 7 | using Microsoft.Templates.Core.Gen; 8 | 9 | namespace Microsoft.Templates.Cli.Commands.Validators 10 | { 11 | public class GetAllLicencesValidator : AbstractValidator 12 | { 13 | public GetAllLicencesValidator() 14 | { 15 | RuleFor(x => GenContext.ToolBox) 16 | .NotEmpty() 17 | .WithMessage(StringRes.BadReqNotSynced); 18 | 19 | RuleFor(x => x.GenerationDataJson) 20 | .NotEmpty() 21 | .WithMessage(StringRes.BadReqInvalidGenJson); 22 | } 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /code/src/CoreTemplateStudio/CoreTemplateStudio.Cli/Commands/GetTemplatesBaseCommand.cs: -------------------------------------------------------------------------------- 1 | // Licensed to the .NET Foundation under one or more agreements. 2 | // The .NET Foundation licenses this file to you under the MIT license. 3 | // See the LICENSE file in the project root for more information. 4 | 5 | using CommandLine; 6 | using Microsoft.Templates.Cli.Commands.Contracts; 7 | 8 | namespace Microsoft.Templates.Cli.Commands 9 | { 10 | public abstract class GetTemplatesBaseCommand : ICommand 11 | { 12 | [Option('p', "project-type", Required = true, HelpText = "Project type")] 13 | public string ProjectType { get; set; } 14 | 15 | [Option('f', "frontend-framework", Required = false, HelpText = "Frontend framework")] 16 | public string FrontendFramework { get; set; } 17 | 18 | [Option('b', "backend-framework", Required = false, HelpText = "Backend framework")] 19 | public string BackendFramework { get; set; } 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /code/tools/WtsTelemetry/Models/WebTSFullStackWebData.cs: -------------------------------------------------------------------------------- 1 | using WtsTelemetry.Helpers; 2 | 3 | namespace WtsTelemetry.Models 4 | { 5 | public class WebTSFullStackWebData 6 | { 7 | public string FrontendFrameworks { get; set; } 8 | public string BackendFrameworks { get; set; } 9 | public string Pages { get; set; } 10 | public string Services { get; set; } 11 | public int Year { get; set; } 12 | public int Month { get; set; } 13 | 14 | public string ToMarkdown() 15 | { 16 | return new MarkdownBuilder() 17 | .AddTable("Frontend Frameworks", "Framework Type", FrontendFrameworks) 18 | .AddTable("Backend Frameworks", "Framework Type", BackendFrameworks) 19 | .AddTable("Pages", "Pages", Pages) 20 | .AddTable("Services", "Services", Services) 21 | .GetText(); 22 | } 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /code/src/CoreTemplateStudio/CoreTemplateStudio.Core/Gen/NewItemGenerationResult.cs: -------------------------------------------------------------------------------- 1 | // Licensed to the .NET Foundation under one or more agreements. 2 | // The .NET Foundation licenses this file to you under the MIT license. 3 | // See the LICENSE file in the project root for more information. 4 | 5 | using System.Collections.Generic; 6 | 7 | namespace Microsoft.Templates.Core.Gen 8 | { 9 | public class NewItemGenerationResult 10 | { 11 | public List NewFiles { get; } = new List(); 12 | 13 | public List ModifiedFiles { get; } = new List(); 14 | 15 | public List ConflictingFiles { get; } = new List(); 16 | 17 | public List UnchangedFiles { get; } = new List(); 18 | 19 | public bool HasChangesToApply { get; set; } 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /code/src/CoreTemplateStudio/CoreTemplateStudio.Core/Gen/GenException.cs: -------------------------------------------------------------------------------- 1 | // Licensed to the .NET Foundation under one or more agreements. 2 | // The .NET Foundation licenses this file to you under the MIT license. 3 | // See the LICENSE file in the project root for more information. 4 | 5 | using System; 6 | using System.Runtime.Serialization; 7 | 8 | using Microsoft.Templates.Core.Resources; 9 | 10 | namespace Microsoft.Templates.Core.Gen 11 | { 12 | [Serializable] 13 | public class GenException : Exception 14 | { 15 | protected GenException(SerializationInfo info, StreamingContext context) 16 | : base(info, context) 17 | { 18 | } 19 | 20 | public GenException(string message) 21 | : base(message) 22 | { 23 | } 24 | 25 | public GenException(string name, string template, string reason) 26 | : base(string.Format(StringRes.ErrorGenerating, template, name, reason)) 27 | { 28 | } 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /code/test/CoreTemplateStudio.Core.Test/TestFakes/GenShell/TestGenShellVisualStudio.cs: -------------------------------------------------------------------------------- 1 | // Licensed to the .NET Foundation under one or more agreements. 2 | // The .NET Foundation licenses this file to you under the MIT license. 3 | // See the LICENSE file in the project root for more information. 4 | 5 | using System; 6 | using System.Collections.Generic; 7 | using System.Linq; 8 | using Microsoft.Templates.Core.Gen.Shell; 9 | 10 | namespace Microsoft.Templates.Core.Test.TestFakes.GenShell 11 | { 12 | public class TestGenShellVisualStudio : IGenShellVisualStudio 13 | { 14 | public string GetVsVersion() => "0.0.0.0"; 15 | 16 | public string GetVsVersionAndInstance() => "0.0.0.0-i"; 17 | 18 | public bool IsBuildInProgress() => false; 19 | 20 | public bool IsDebuggerEnabled() => false; 21 | 22 | public bool IsSdkInstalled(string version) => false; 23 | 24 | public List GetInstalledPackageIds() => Enumerable.Empty().ToList(); 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /code/tools/WtsTelemetry/Models/WebTSData.cs: -------------------------------------------------------------------------------- 1 | using WtsTelemetry.Helpers; 2 | 3 | namespace WtsTelemetry.Models 4 | { 5 | public class WebTSData 6 | { 7 | public WebTSFullStackWebData FullStackWeb { get; set; } 8 | public WebTSReactNativeData ReactNative { get; set; } 9 | public string Platform { get; set; } 10 | public int Year { get; set; } 11 | public int Month { get; set; } 12 | 13 | public string ToMarkdown() 14 | { 15 | return new MarkdownBuilder() 16 | .AddHeader("Web Template Studio", Year, Month) 17 | .AddTable("Category", "Type", Platform) 18 | .AddSectionTitle("Project Generation by category") 19 | .AddCollapsible("Web Full Stack Generation", FullStackWeb.ToMarkdown()) 20 | .AddCollapsible("React Native Generation", ReactNative.ToMarkdown()) 21 | .GetText(); 22 | } 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /code/src/CoreTemplateStudio/CoreTemplateStudio.Cli/Utilities/GenShell/CliGenShellVisualStudio.cs: -------------------------------------------------------------------------------- 1 | // Licensed to the .NET Foundation under one or more agreements. 2 | // The .NET Foundation licenses this file to you under the MIT license. 3 | // See the LICENSE file in the project root for more information. 4 | 5 | using System; 6 | using System.Collections.Generic; 7 | using System.Linq; 8 | using Microsoft.Templates.Core.Gen.Shell; 9 | 10 | namespace Microsoft.Templates.Cli.Utilities.GenShell 11 | { 12 | public class CliGenShellVisualStudio : IGenShellVisualStudio 13 | { 14 | public string GetVsVersion() => "0.0.0.0"; 15 | 16 | public string GetVsVersionAndInstance() => "0.0.0.0-i"; 17 | 18 | public bool IsBuildInProgress() => false; 19 | 20 | public bool IsDebuggerEnabled() => false; 21 | 22 | public bool IsSdkInstalled(string version) => false; 23 | 24 | public List GetInstalledPackageIds() => Enumerable.Empty().ToList(); 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /code/tools/WtsTelemetry/Models/WinTSPlatformData.cs: -------------------------------------------------------------------------------- 1 | using WtsTelemetry.Helpers; 2 | 3 | namespace WtsTelemetry.Models 4 | { 5 | public class WinTSPlatformData 6 | { 7 | public string Project { get; set; } 8 | public string Frameworks { get; set; } 9 | public string Pages { get; set; } 10 | public string Features { get; set; } 11 | public string Services { get; set; } 12 | public string Testing { get; set; } 13 | 14 | public virtual string ToMarkdown() 15 | { 16 | return new MarkdownBuilder() 17 | .AddTable("Project Type", "Project", Project) 18 | .AddTable("Framework", "Framework Type", Frameworks) 19 | .AddTable("Pages", "Pages", Pages) 20 | .AddTable("Features", "Features", Features) 21 | .AddTable("Services", "Services", Services) 22 | .AddTable("Testing", "Testing", Testing) 23 | .GetText(); 24 | } 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /code/src/CoreTemplateStudio/CoreTemplateStudio.Core/Gen/ProjectInfo.cs: -------------------------------------------------------------------------------- 1 | // Licensed to the .NET Foundation under one or more agreements. 2 | // The .NET Foundation licenses this file to you under the MIT license. 3 | // See the LICENSE file in the project root for more information. 4 | 5 | using System; 6 | using System.Collections.Generic; 7 | 8 | namespace Microsoft.Templates.Core.Gen 9 | { 10 | public class ProjectInfo 11 | { 12 | public List Projects { get; } = new List(); 13 | 14 | public List ProjectItems { get; } = new List(); 15 | 16 | public List SdkReferences { get; } = new List(); 17 | 18 | public List NugetReferences { get; } = new List(); 19 | 20 | public List ProjectReferences { get; } = new List(); 21 | 22 | public List ProjectConfigurations { get; } = new List(); 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /code/src/CoreTemplateStudio/CoreTemplateStudio.Core/Naming/Validators/Validator.cs: -------------------------------------------------------------------------------- 1 | // Licensed to the .NET Foundation under one or more agreements. 2 | // The .NET Foundation licenses this file to you under the MIT license. 3 | // See the LICENSE file in the project root for more information. 4 | 5 | using System.Diagnostics.CodeAnalysis; 6 | 7 | namespace Microsoft.Templates.Core.Naming 8 | { 9 | public abstract class Validator 10 | { 11 | public abstract ValidationResult Validate(string suggestedName); 12 | } 13 | 14 | [SuppressMessage( 15 | "StyleCop.CSharp.MaintainabilityRules", 16 | "SA1402:File may only contain a single class", 17 | Justification = "For simplicity we're allowing generic and non-generic versions in one file.")] 18 | public abstract class Validator : Validator 19 | { 20 | public TConfig Config { get; } 21 | 22 | public Validator(TConfig config) 23 | { 24 | Config = config; 25 | } 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /code/test/CoreTemplateStudio.Core.Test/TestFakes/GenShell/TestGenShellProject.cs: -------------------------------------------------------------------------------- 1 | // Licensed to the .NET Foundation under one or more agreements. 2 | // The .NET Foundation licenses this file to you under the MIT license. 3 | // See the LICENSE file in the project root for more information. 4 | 5 | using System; 6 | using Microsoft.Templates.Core.Gen.Shell; 7 | 8 | namespace Microsoft.Templates.Core.Test.TestFakes.GenShell 9 | { 10 | public class TestGenShellProject : IGenShellProject 11 | { 12 | public bool GetActiveProjectIsWts() => true; 13 | 14 | public string GetActiveProjectLanguage() => string.Empty; 15 | 16 | public string GetActiveProjectName() => string.Empty; 17 | 18 | public string GetActiveProjectNamespace() => string.Empty; 19 | 20 | public string GetActiveProjectPath() => string.Empty; 21 | 22 | public string GetActiveProjectTypeGuids() => Guid.Empty.ToString(); 23 | 24 | public Guid GetProjectGuidByName(string projectName) => Guid.Empty; 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /code/src/CoreTemplateStudio/CoreTemplateStudio.Cli/Utilities/GenShell/CliGenShellProject.cs: -------------------------------------------------------------------------------- 1 | // Licensed to the .NET Foundation under one or more agreements. 2 | // The .NET Foundation licenses this file to you under the MIT license. 3 | // See the LICENSE file in the project root for more information. 4 | 5 | using System; 6 | using Microsoft.Templates.Core.Gen.Shell; 7 | 8 | namespace Microsoft.Templates.Cli.Utilities.GenShell 9 | { 10 | public class CliGenShellProject : IGenShellProject 11 | { 12 | public bool GetActiveProjectIsWts() => true; 13 | 14 | public string GetActiveProjectLanguage() => string.Empty; 15 | 16 | public string GetActiveProjectName() => string.Empty; 17 | 18 | public string GetActiveProjectNamespace() => string.Empty; 19 | 20 | public string GetActiveProjectPath() => string.Empty; 21 | 22 | public string GetActiveProjectTypeGuids() => Guid.Empty.ToString(); 23 | 24 | public Guid GetProjectGuidByName(string projectName) => Guid.Empty; 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /code/src/CoreTemplateStudio/CoreTemplateStudio.Core/Naming/Validators/EmptyNameValidator.cs: -------------------------------------------------------------------------------- 1 | // Licensed to the .NET Foundation under one or more agreements. 2 | // The .NET Foundation licenses this file to you under the MIT license. 3 | // See the LICENSE file in the project root for more information. 4 | 5 | namespace Microsoft.Templates.Core.Naming 6 | { 7 | public class EmptyNameValidator : Validator 8 | { 9 | public override ValidationResult Validate(string suggestedName) 10 | { 11 | var result = new ValidationResult(); 12 | 13 | if (string.IsNullOrEmpty(suggestedName)) 14 | { 15 | var error = new ValidationError() 16 | { 17 | ErrorType = ValidationErrorType.EmptyName, 18 | ValidatorName = nameof(EmptyNameValidator), 19 | }; 20 | 21 | result.IsValid = false; 22 | result.Errors.Add(error); 23 | } 24 | 25 | return result; 26 | } 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /code/src/CoreTemplateStudio/CoreTemplateStudio.Core/Packaging/InvalidSignatureException.cs: -------------------------------------------------------------------------------- 1 | // Licensed to the .NET Foundation under one or more agreements. 2 | // The .NET Foundation licenses this file to you under the MIT license. 3 | // See the LICENSE file in the project root for more information. 4 | 5 | using System; 6 | using System.Runtime.Serialization; 7 | 8 | namespace Microsoft.Templates.Core.Packaging 9 | { 10 | [Serializable] 11 | public class InvalidSignatureException : Exception 12 | { 13 | public InvalidSignatureException() 14 | { 15 | } 16 | 17 | public InvalidSignatureException(string message) 18 | : base(message) 19 | { 20 | } 21 | 22 | public InvalidSignatureException(string message, Exception innerException) 23 | : base(message, innerException) 24 | { 25 | } 26 | 27 | protected InvalidSignatureException(SerializationInfo info, StreamingContext context) 28 | : base(info, context) 29 | { 30 | } 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /code/src/CoreTemplateStudio/CoreTemplateStudio.Core/Packaging/SignCertNotFoundException.cs: -------------------------------------------------------------------------------- 1 | // Licensed to the .NET Foundation under one or more agreements. 2 | // The .NET Foundation licenses this file to you under the MIT license. 3 | // See the LICENSE file in the project root for more information. 4 | 5 | using System; 6 | using System.Runtime.Serialization; 7 | 8 | namespace Microsoft.Templates.Core.Packaging 9 | { 10 | [Serializable] 11 | public class SignCertNotFoundException : Exception 12 | { 13 | public SignCertNotFoundException() 14 | { 15 | } 16 | 17 | public SignCertNotFoundException(string message) 18 | : base(message) 19 | { 20 | } 21 | 22 | public SignCertNotFoundException(string message, Exception innerException) 23 | : base(message, innerException) 24 | { 25 | } 26 | 27 | protected SignCertNotFoundException(SerializationInfo info, StreamingContext context) 28 | : base(info, context) 29 | { 30 | } 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /code/src/CoreTemplateStudio/CoreTemplateStudio.Core/Diagnostics/TelemetryMetrics.cs: -------------------------------------------------------------------------------- 1 | // Licensed to the .NET Foundation under one or more agreements. 2 | // The .NET Foundation licenses this file to you under the MIT license. 3 | // See the LICENSE file in the project root for more information. 4 | 5 | namespace Microsoft.Templates.Core.Diagnostics 6 | { 7 | public class TelemetryMetrics 8 | { 9 | public static string PagesCount { get; private set; } = TelemetryEvents.Prefix + "PagesCount"; 10 | 11 | public static string FeaturesCount { get; private set; } = TelemetryEvents.Prefix + "FeaturesCount"; 12 | 13 | public static string ServicesCount { get; private set; } = TelemetryEvents.Prefix + "ServicesCount"; 14 | 15 | public static string TestingCount { get; private set; } = TelemetryEvents.Prefix + "TestingCount"; 16 | 17 | public static string TimeSpent { get; private set; } = TelemetryEvents.Prefix + "SecTotal"; 18 | 19 | public static string ProjectMetricsTimeSpent { get; private set; } = TelemetryEvents.Prefix + "Sec"; 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /code/src/CoreTemplateStudio/CoreTemplateStudio.Core/Gen/Shell/IGenShellTelemetry.cs: -------------------------------------------------------------------------------- 1 | // Licensed to the .NET Foundation under one or more agreements. 2 | // The .NET Foundation licenses this file to you under the MIT license. 3 | // See the LICENSE file in the project root for more information. 4 | 5 | using System.Collections.Generic; 6 | using Microsoft.Templates.Core.Diagnostics; 7 | 8 | namespace Microsoft.Templates.Core.Gen.Shell 9 | { 10 | public interface IGenShellTelemetry 11 | { 12 | VSTelemetryInfo GetVSTelemetryInfo(); 13 | 14 | void SafeTrackProjectVsTelemetry(Dictionary properties, string pages, string features, string services, string testing, Dictionary metrics, bool success = true); 15 | 16 | void SafeTrackNewItemVsTelemetry(Dictionary properties, string pages, string features, string services, string testing, Dictionary metrics, bool success = true); 17 | 18 | void SafeTrackWizardCancelledVsTelemetry(Dictionary properties, bool success = true); 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /code/src/CoreTemplateStudio/CoreTemplateStudio.Core/Locations/TemplateSynchronizationException.cs: -------------------------------------------------------------------------------- 1 | // Licensed to the .NET Foundation under one or more agreements. 2 | // The .NET Foundation licenses this file to you under the MIT license. 3 | // See the LICENSE file in the project root for more information. 4 | 5 | using System; 6 | using System.Runtime.Serialization; 7 | 8 | namespace Microsoft.Templates.Core.Locations 9 | { 10 | public class TemplateSynchronizationException : Exception 11 | { 12 | public TemplateSynchronizationException() 13 | { 14 | } 15 | 16 | public TemplateSynchronizationException(string message) 17 | : base(message) 18 | { 19 | } 20 | 21 | public TemplateSynchronizationException(string message, Exception innerException) 22 | : base(message, innerException) 23 | { 24 | } 25 | 26 | protected TemplateSynchronizationException(SerializationInfo info, StreamingContext context) 27 | : base(info, context) 28 | { 29 | } 30 | } 31 | } 32 | -------------------------------------------------------------------------------- /code/src/CoreTemplateStudio/CoreTemplateStudio.Cli/.vscode/tasks.json: -------------------------------------------------------------------------------- 1 | { 2 | "version": "2.0.0", 3 | "tasks": [ 4 | { 5 | "label": "build", 6 | "command": "dotnet", 7 | "type": "process", 8 | "args": [ 9 | "build", 10 | "${workspaceFolder}/CoreTemplateStudio.Cli.csproj" 11 | ], 12 | "problemMatcher": "$tsc" 13 | }, 14 | { 15 | "label": "publish", 16 | "command": "dotnet", 17 | "type": "process", 18 | "args": [ 19 | "publish", 20 | "${workspaceFolder}/CoreTemplateStudio.Cli.csproj" 21 | ], 22 | "problemMatcher": "$tsc" 23 | }, 24 | { 25 | "label": "watch", 26 | "command": "dotnet", 27 | "type": "process", 28 | "args": [ 29 | "watch", 30 | "run", 31 | "${workspaceFolder}/CoreTemplateStudio.Cli.csproj" 32 | ], 33 | "problemMatcher": "$tsc" 34 | } 35 | ] 36 | } -------------------------------------------------------------------------------- /code/tools/WtsPackagingTool/Environments.cs: -------------------------------------------------------------------------------- 1 | // Licensed to the .NET Foundation under one or more agreements. 2 | // The .NET Foundation licenses this file to you under the MIT license. 3 | // See the LICENSE file in the project root for more information. 4 | 5 | using System; 6 | using System.Collections.Generic; 7 | using System.Linq; 8 | using System.Text; 9 | using System.Threading.Tasks; 10 | 11 | namespace WtsPackagingTool 12 | { 13 | public enum EnvEnum 14 | { 15 | Pro, 16 | Pre, 17 | Dev, 18 | Test, 19 | Unknown, 20 | } 21 | 22 | public static class Environments 23 | { 24 | public static Dictionary CdnUrls => new Dictionary() 25 | { 26 | { EnvEnum.Test, "https://wtsrepository.blob.core.windows.net/test" }, 27 | { EnvEnum.Dev, "https://wtsrepository.blob.core.windows.net/dev" }, 28 | { EnvEnum.Pre, "https://wtsrepository.blob.core.windows.net/pre" }, 29 | { EnvEnum.Pro, "https://wts2.azureedge.net" }, 30 | }; 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /code/src/CoreTemplateStudio/CoreTemplateStudio.Core/Gen/ProjectReference.cs: -------------------------------------------------------------------------------- 1 | // Licensed to the .NET Foundation under one or more agreements. 2 | // The .NET Foundation licenses this file to you under the MIT license. 3 | // See the LICENSE file in the project root for more information. 4 | 5 | using System; 6 | using System.Collections.Generic; 7 | using System.Linq; 8 | using System.Text; 9 | using System.Threading.Tasks; 10 | 11 | namespace Microsoft.Templates.Core.Gen 12 | { 13 | public class ProjectReference 14 | { 15 | public string Project { get; set; } 16 | 17 | public string ReferencedProject { get; set; } 18 | 19 | public override bool Equals(object obj) 20 | { 21 | if (obj is ProjectReference projectReference) 22 | { 23 | return Project == projectReference.Project 24 | && ReferencedProject == projectReference.ReferencedProject; 25 | } 26 | 27 | return false; 28 | } 29 | 30 | public override int GetHashCode() => base.GetHashCode(); 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /code/src/CoreTemplateStudio/CoreTemplateStudio.Core/Gen/IContextProvider.cs: -------------------------------------------------------------------------------- 1 | // Licensed to the .NET Foundation under one or more agreements. 2 | // The .NET Foundation licenses this file to you under the MIT license. 3 | // See the LICENSE file in the project root for more information. 4 | 5 | using System.Collections.Generic; 6 | 7 | using Microsoft.Templates.Core.Diagnostics; 8 | using Microsoft.Templates.Core.PostActions.Catalog.Merge; 9 | 10 | namespace Microsoft.Templates.Core.Gen 11 | { 12 | public interface IContextProvider 13 | { 14 | string ProjectName { get; } 15 | 16 | string SafeProjectName { get; } 17 | 18 | string GenerationOutputPath { get; } 19 | 20 | string DestinationPath { get; } 21 | 22 | ProjectInfo ProjectInfo { get; } 23 | 24 | List FilesToOpen { get; } 25 | 26 | List FailedMergePostActions { get; } 27 | 28 | Dictionary> MergeFilesFromProject { get; } 29 | 30 | Dictionary ProjectMetrics { get; } 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /code/src/CoreTemplateStudio/CoreTemplateStudio.Core/Locations/TemplatesContentInfo.cs: -------------------------------------------------------------------------------- 1 | // Licensed to the .NET Foundation under one or more agreements. 2 | // The .NET Foundation licenses this file to you under the MIT license. 3 | // See the LICENSE file in the project root for more information. 4 | 5 | using System; 6 | using System.Collections.Generic; 7 | using System.IO; 8 | using System.Linq; 9 | using System.Text; 10 | using System.Text.RegularExpressions; 11 | using System.Threading.Tasks; 12 | 13 | using Microsoft.Templates.Core.Diagnostics; 14 | using Microsoft.Templates.Core.Packaging; 15 | using Microsoft.Templates.Core.Resources; 16 | 17 | using Newtonsoft.Json; 18 | 19 | namespace Microsoft.Templates.Core.Locations 20 | { 21 | public class TemplatesContentInfo 22 | { 23 | public string Path { get; set; } 24 | 25 | public DateTime Date { get; set; } 26 | 27 | public Version Version { get; set; } 28 | 29 | public string MainVersion { get => !Version.IsNull() ? $"{Version.Major.ToString()}.{Version.Minor.ToString()}" : "NoVersion"; } 30 | } 31 | } 32 | -------------------------------------------------------------------------------- /code/src/CoreTemplateStudio/CoreTemplateStudio.Core/Composition/InvalidCompositionQueryException.cs: -------------------------------------------------------------------------------- 1 | // Licensed to the .NET Foundation under one or more agreements. 2 | // The .NET Foundation licenses this file to you under the MIT license. 3 | // See the LICENSE file in the project root for more information. 4 | 5 | using System; 6 | using System.Runtime.Serialization; 7 | 8 | namespace Microsoft.Templates.Core.Composition 9 | { 10 | [Serializable] 11 | public class InvalidCompositionQueryException : Exception 12 | { 13 | public InvalidCompositionQueryException() 14 | { 15 | } 16 | 17 | public InvalidCompositionQueryException(string message) 18 | : base(message) 19 | { 20 | } 21 | 22 | public InvalidCompositionQueryException(string message, Exception innerException) 23 | : base(message, innerException) 24 | { 25 | } 26 | 27 | protected InvalidCompositionQueryException(SerializationInfo info, StreamingContext context) 28 | : base(info, context) 29 | { 30 | } 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /code/src/CoreTemplateStudio/CoreTemplateStudio.Core/PostActions/TemplateDefinedPostAction.cs: -------------------------------------------------------------------------------- 1 | // Licensed to the .NET Foundation under one or more agreements. 2 | // The .NET Foundation licenses this file to you under the MIT license. 3 | // See the LICENSE file in the project root for more information. 4 | 5 | using System; 6 | using System.Collections.Generic; 7 | 8 | using Microsoft.TemplateEngine.Abstractions; 9 | using Microsoft.Templates.Core.Diagnostics; 10 | using Microsoft.Templates.Core.Resources; 11 | 12 | namespace Microsoft.Templates.Core.PostActions 13 | { 14 | public abstract class TemplateDefinedPostAction : PostAction 15 | { 16 | public virtual Guid ActionId { get; } 17 | 18 | public IReadOnlyDictionary Args { get; private set; } 19 | 20 | public TemplateDefinedPostAction(string relatedTemplate, IPostAction templateDefinedPostAction) 21 | { 22 | RelatedTemplate = relatedTemplate; 23 | ContinueOnError = templateDefinedPostAction.ContinueOnError; 24 | Args = templateDefinedPostAction.Args; 25 | } 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /code/src/CoreTemplateStudio/CoreTemplateStudio.Core/Gen/SdkReference.cs: -------------------------------------------------------------------------------- 1 | // Licensed to the .NET Foundation under one or more agreements. 2 | // The .NET Foundation licenses this file to you under the MIT license. 3 | // See the LICENSE file in the project root for more information. 4 | 5 | using System; 6 | using System.Collections.Generic; 7 | using System.Linq; 8 | using System.Text; 9 | using System.Threading.Tasks; 10 | 11 | namespace Microsoft.Templates.Core.Gen 12 | { 13 | public class SdkReference 14 | { 15 | public string Project { get; set; } 16 | 17 | public string Name { get; set; } 18 | 19 | public string Sdk { get; set; } 20 | 21 | public override bool Equals(object obj) 22 | { 23 | if (obj is SdkReference sdkReference) 24 | { 25 | return Project == sdkReference.Project 26 | && Name == sdkReference.Name 27 | && Sdk == sdkReference.Sdk; 28 | } 29 | 30 | return false; 31 | } 32 | 33 | public override int GetHashCode() => base.GetHashCode(); 34 | } 35 | } 36 | -------------------------------------------------------------------------------- /code/src/CoreTemplateStudio/CoreTemplateStudio.Cli/Utilities/GenShell/CliGenShellSolution.cs: -------------------------------------------------------------------------------- 1 | // Licensed to the .NET Foundation under one or more agreements. 2 | // The .NET Foundation licenses this file to you under the MIT license. 3 | // See the LICENSE file in the project root for more information. 4 | 5 | using System.Collections.Generic; 6 | using Microsoft.Templates.Core.Gen; 7 | using Microsoft.Templates.Core.Gen.Shell; 8 | 9 | namespace Microsoft.Templates.Cli.Utilities.GenShell 10 | { 11 | public class CliGenShellSolution : IGenShellSolution 12 | { 13 | public void AddContextItemsToSolution(ProjectInfo projectInfo) 14 | { 15 | } 16 | 17 | public void ChangeSolutionConfiguration(IEnumerable projectConfigurations) 18 | { 19 | } 20 | 21 | public void CloseSolution() 22 | { 23 | } 24 | 25 | public void CollapseSolutionItems() 26 | { 27 | } 28 | 29 | public void SetDefaultSolutionConfiguration(string configurationName, string platformName, string projectName) 30 | { 31 | } 32 | } 33 | } 34 | -------------------------------------------------------------------------------- /code/test/CoreTemplateStudio.Core.Test/TestFakes/GenShell/TestGenShellSolution.cs: -------------------------------------------------------------------------------- 1 | // Licensed to the .NET Foundation under one or more agreements. 2 | // The .NET Foundation licenses this file to you under the MIT license. 3 | // See the LICENSE file in the project root for more information. 4 | 5 | using System.Collections.Generic; 6 | using Microsoft.Templates.Core.Gen; 7 | using Microsoft.Templates.Core.Gen.Shell; 8 | 9 | namespace Microsoft.Templates.Core.Test.TestFakes.GenShell 10 | { 11 | public class TestGenShellSolution : IGenShellSolution 12 | { 13 | public void AddContextItemsToSolution(ProjectInfo projectInfo) 14 | { 15 | } 16 | 17 | public void ChangeSolutionConfiguration(IEnumerable projectConfigurations) 18 | { 19 | } 20 | 21 | public void CloseSolution() 22 | { 23 | } 24 | 25 | public void CollapseSolutionItems() 26 | { 27 | } 28 | 29 | public void SetDefaultSolutionConfiguration(string configurationName, string platformName, string projectName) 30 | { 31 | } 32 | } 33 | } 34 | -------------------------------------------------------------------------------- /code/src/CoreTemplateStudio/CoreTemplateStudio.Core/Diagnostics/ExceptionTracker.cs: -------------------------------------------------------------------------------- 1 | // Licensed to the .NET Foundation under one or more agreements. 2 | // The .NET Foundation licenses this file to you under the MIT license. 3 | // See the LICENSE file in the project root for more information. 4 | 5 | using System; 6 | using System.Diagnostics; 7 | using System.Threading.Tasks; 8 | 9 | namespace Microsoft.Templates.Core.Diagnostics 10 | { 11 | public class ExceptionTracker 12 | { 13 | public ExceptionTracker() 14 | { 15 | } 16 | 17 | public async Task TrackAsync(Exception ex, string message = null) 18 | { 19 | try 20 | { 21 | foreach (IHealthWriter writer in HealthWriters.Available) 22 | { 23 | await writer.WriteExceptionAsync(ex, message).ConfigureAwait(false); 24 | } 25 | } 26 | catch (Exception exception) 27 | { 28 | Trace.TraceError($"Error writing exception data to listeners. Exception:\r\n{exception.ToString()}"); 29 | } 30 | } 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /code/src/CoreTemplateStudio/CoreTemplateStudio.Cli/Commands/Validators/GetPagesValidator.cs: -------------------------------------------------------------------------------- 1 | // Licensed to the .NET Foundation under one or more agreements. 2 | // The .NET Foundation licenses this file to you under the MIT license. 3 | // See the LICENSE file in the project root for more information. 4 | 5 | using FluentValidation; 6 | using Microsoft.Templates.Cli.Resources; 7 | using Microsoft.Templates.Core.Gen; 8 | 9 | namespace Microsoft.Templates.Cli.Commands.Validators 10 | { 11 | public class GetPagesValidator : AbstractValidator 12 | { 13 | public GetPagesValidator() 14 | { 15 | RuleFor(x => GenContext.ToolBox) 16 | .NotEmpty() 17 | .WithMessage(StringRes.BadReqNotSynced); 18 | 19 | RuleFor(x => x.ProjectType) 20 | .NotEmpty() 21 | .WithMessage(StringRes.BadReqInvalidProjectType); 22 | 23 | RuleFor(x => x) 24 | .Must(x => !string.IsNullOrEmpty(x.FrontendFramework) || !string.IsNullOrEmpty(x.BackendFramework)) 25 | .WithMessage(StringRes.BadReqNoBackendOrFrontend); 26 | } 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /code/src/CoreTemplateStudio/CoreTemplateStudio.Cli/Commands/Validators/GetLayoutsValidator.cs: -------------------------------------------------------------------------------- 1 | // Licensed to the .NET Foundation under one or more agreements. 2 | // The .NET Foundation licenses this file to you under the MIT license. 3 | // See the LICENSE file in the project root for more information. 4 | 5 | using FluentValidation; 6 | using Microsoft.Templates.Cli.Resources; 7 | using Microsoft.Templates.Core.Gen; 8 | 9 | namespace Microsoft.Templates.Cli.Commands.Validators 10 | { 11 | public class GetLayoutsValidator : AbstractValidator 12 | { 13 | public GetLayoutsValidator() 14 | { 15 | RuleFor(x => GenContext.ToolBox) 16 | .NotEmpty() 17 | .WithMessage(StringRes.BadReqNotSynced); 18 | 19 | RuleFor(x => x.ProjectType) 20 | .NotEmpty() 21 | .WithMessage(StringRes.BadReqInvalidProjectType); 22 | 23 | RuleFor(x => x) 24 | .Must(x => !string.IsNullOrEmpty(x.FrontendFramework) || !string.IsNullOrEmpty(x.BackendFramework)) 25 | .WithMessage(StringRes.BadReqNoBackendOrFrontend); 26 | } 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /code/src/CoreTemplateStudio/CoreTemplateStudio.Core/Gen/NugetReference.cs: -------------------------------------------------------------------------------- 1 | // Licensed to the .NET Foundation under one or more agreements. 2 | // The .NET Foundation licenses this file to you under the MIT license. 3 | // See the LICENSE file in the project root for more information. 4 | 5 | using System; 6 | using System.Collections.Generic; 7 | using System.Linq; 8 | using System.Text; 9 | using System.Threading.Tasks; 10 | 11 | namespace Microsoft.Templates.Core.Gen 12 | { 13 | public class NugetReference 14 | { 15 | public string Project { get; set; } 16 | 17 | public string PackageId { get; set; } 18 | 19 | public string Version { get; set; } 20 | 21 | public override bool Equals(object obj) 22 | { 23 | if (obj is NugetReference nugetReference) 24 | { 25 | return Project == nugetReference.Project 26 | && PackageId == nugetReference.PackageId 27 | && Version == nugetReference.Version; 28 | } 29 | 30 | return false; 31 | } 32 | 33 | public override int GetHashCode() => base.GetHashCode(); 34 | } 35 | } 36 | -------------------------------------------------------------------------------- /code/src/CoreTemplateStudio/CoreTemplateStudio.Cli/Commands/Validators/GetServicesValidator.cs: -------------------------------------------------------------------------------- 1 | // Licensed to the .NET Foundation under one or more agreements. 2 | // The .NET Foundation licenses this file to you under the MIT license. 3 | // See the LICENSE file in the project root for more information. 4 | 5 | using FluentValidation; 6 | using Microsoft.Templates.Cli.Resources; 7 | using Microsoft.Templates.Core.Gen; 8 | 9 | namespace Microsoft.Templates.Cli.Commands.Validators 10 | { 11 | public class GetServicesValidator : AbstractValidator 12 | { 13 | public GetServicesValidator() 14 | { 15 | RuleFor(x => GenContext.ToolBox) 16 | .NotEmpty() 17 | .WithMessage(StringRes.BadReqNotSynced); 18 | 19 | RuleFor(x => x.ProjectType) 20 | .NotEmpty() 21 | .WithMessage(StringRes.BadReqInvalidProjectType); 22 | 23 | RuleFor(x => x) 24 | .Must(x => !string.IsNullOrEmpty(x.FrontendFramework) || !string.IsNullOrEmpty(x.BackendFramework)) 25 | .WithMessage(StringRes.BadReqNoBackendOrFrontend); 26 | } 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /code/src/CoreTemplateStudio/CoreTemplateStudio.Cli/Commands/Validators/GetTestingsValidator.cs: -------------------------------------------------------------------------------- 1 | // Licensed to the .NET Foundation under one or more agreements. 2 | // The .NET Foundation licenses this file to you under the MIT license. 3 | // See the LICENSE file in the project root for more information. 4 | 5 | using FluentValidation; 6 | using Microsoft.Templates.Cli.Resources; 7 | using Microsoft.Templates.Core.Gen; 8 | 9 | namespace Microsoft.Templates.Cli.Commands.Validators 10 | { 11 | public class GetTestingsValidator : AbstractValidator 12 | { 13 | public GetTestingsValidator() 14 | { 15 | RuleFor(x => GenContext.ToolBox) 16 | .NotEmpty() 17 | .WithMessage(StringRes.BadReqNotSynced); 18 | 19 | RuleFor(x => x.ProjectType) 20 | .NotEmpty() 21 | .WithMessage(StringRes.BadReqInvalidProjectType); 22 | 23 | RuleFor(x => x) 24 | .Must(x => !string.IsNullOrEmpty(x.FrontendFramework) || !string.IsNullOrEmpty(x.BackendFramework)) 25 | .WithMessage(StringRes.BadReqNoBackendOrFrontend); 26 | } 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /code/src/CoreTemplateStudio/CoreTemplateStudio.Cli/Commands/Validators/GetFeaturesValidator.cs: -------------------------------------------------------------------------------- 1 | // Licensed to the .NET Foundation under one or more agreements. 2 | // The .NET Foundation licenses this file to you under the MIT license. 3 | // See the LICENSE file in the project root for more information. 4 | 5 | using FluentValidation; 6 | using Microsoft.Templates.Cli.Resources; 7 | using Microsoft.Templates.Core.Gen; 8 | 9 | namespace Microsoft.Templates.Cli.Commands.Validators 10 | { 11 | public class GetFeaturesValidator : AbstractValidator 12 | { 13 | public GetFeaturesValidator() 14 | { 15 | RuleFor(x => GenContext.ToolBox) 16 | .NotEmpty() 17 | .WithMessage(StringRes.BadReqNotSynced); 18 | 19 | RuleFor(x => x.ProjectType) 20 | .NotEmpty() 21 | .WithMessage(StringRes.BadReqInvalidProjectType); 22 | 23 | RuleFor(x => x) 24 | .Must(x => !string.IsNullOrEmpty(x.FrontendFramework) || !string.IsNullOrEmpty(x.BackendFramework)) 25 | .WithMessage(StringRes.BadReqNoBackendOrFrontend); 26 | } 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /code/src/CoreTemplateStudio/CoreTemplateStudio.Core/Gen/GenParams.cs: -------------------------------------------------------------------------------- 1 | // Licensed to the .NET Foundation under one or more agreements. 2 | // The .NET Foundation licenses this file to you under the MIT license. 3 | // See the LICENSE file in the project root for more information. 4 | 5 | using System; 6 | 7 | namespace Microsoft.Templates.Core.Gen 8 | { 9 | public class GenParams 10 | { 11 | public const string Username = "wts.userName"; 12 | public const string RootNamespace = "wts.rootNamespace"; 13 | public const string WizardVersion = "wts.wizardVersion"; 14 | public const string TemplatesVersion = "wts.templatesVersion"; 15 | public const string HomePageName = "wts.homePageName"; 16 | public const string ProjectType = "wts.generationProjectType"; 17 | public const string FrontEndFramework = "wts.generationFrontEndFramework"; 18 | public const string BackEndFramework = "wts.generationBackEndFramework"; 19 | public const string Platform = "wts.generationPlatform"; 20 | public const string GenerationPropertiesPrefix = "wts.generation"; 21 | public const string ProjectName = "wts.projectName"; 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /code/WtsTelemetry.sln: -------------------------------------------------------------------------------- 1 | 2 | Microsoft Visual Studio Solution File, Format Version 12.00 3 | # Visual Studio Version 16 4 | VisualStudioVersion = 16.0.30309.148 5 | MinimumVisualStudioVersion = 10.0.40219.1 6 | Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "WtsTelemetry", "tools\WtsTelemetry\WtsTelemetry.csproj", "{E4838E92-EE9E-4A57-BD8C-A19399B18873}" 7 | EndProject 8 | Global 9 | GlobalSection(SolutionConfigurationPlatforms) = preSolution 10 | Debug|Any CPU = Debug|Any CPU 11 | Release|Any CPU = Release|Any CPU 12 | EndGlobalSection 13 | GlobalSection(ProjectConfigurationPlatforms) = postSolution 14 | {E4838E92-EE9E-4A57-BD8C-A19399B18873}.Debug|Any CPU.ActiveCfg = Debug|Any CPU 15 | {E4838E92-EE9E-4A57-BD8C-A19399B18873}.Debug|Any CPU.Build.0 = Debug|Any CPU 16 | {E4838E92-EE9E-4A57-BD8C-A19399B18873}.Release|Any CPU.ActiveCfg = Release|Any CPU 17 | {E4838E92-EE9E-4A57-BD8C-A19399B18873}.Release|Any CPU.Build.0 = Release|Any CPU 18 | EndGlobalSection 19 | GlobalSection(SolutionProperties) = preSolution 20 | HideSolutionNode = FALSE 21 | EndGlobalSection 22 | GlobalSection(ExtensibilityGlobals) = postSolution 23 | SolutionGuid = {8FEC3A6D-144F-45F5-845D-69692A562251} 24 | EndGlobalSection 25 | EndGlobal 26 | -------------------------------------------------------------------------------- /code/src/CoreTemplateStudio/CoreTemplateStudio.Core/Packaging/IDigitalSignatureService.cs: -------------------------------------------------------------------------------- 1 | // Licensed to the .NET Foundation under one or more agreements. 2 | // The .NET Foundation licenses this file to you under the MIT license. 3 | // See the LICENSE file in the project root for more information. 4 | 5 | using System.Collections.Generic; 6 | using System.IO.Packaging; 7 | using System.Security.Cryptography.X509Certificates; 8 | 9 | namespace Microsoft.Templates.Core.Packaging 10 | { 11 | public interface IDigitalSignatureService 12 | { 13 | X509ChainStatusFlags VerifyCertificate(X509Certificate cert); 14 | 15 | bool IsSigned(Package package); 16 | 17 | IEnumerable GetX509Certificates(Package package); 18 | 19 | void SignPackage(Package package, X509Certificate cert); 20 | 21 | bool VerifySignatures(Package package); 22 | 23 | Dictionary GetPackageCertificates(Package package); 24 | 25 | // TODO WTS: This property is a temporal patch to disable verify signatures. 26 | // Required as signature can´t be verify in .net core 27 | bool CanVerifySignatures { get; } 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /code/tools/WtsTelemetry/Services/ConfigurationService.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Linq; 3 | using WtsTelemetry.Models; 4 | 5 | namespace WtsTelemetry.Services 6 | { 7 | public class ConfigurationService 8 | { 9 | private readonly string filter; 10 | 11 | public ConfigurationService(string filter) 12 | { 13 | this.filter = filter; 14 | } 15 | 16 | public AppInsightConfig GetAppInsightConfig() 17 | { 18 | return new AppInsightConfig 19 | { 20 | AppId = Environment.GetEnvironmentVariable($"{filter}-AppId"), 21 | AppKey = Environment.GetEnvironmentVariable($"{filter}-ApiKey"), 22 | }; 23 | } 24 | 25 | public GithubConfig GetGithubConfig() 26 | { 27 | return new GithubConfig 28 | { 29 | AccessToken = Environment.GetEnvironmentVariable("Github-AccessToken"), 30 | Owner = Environment.GetEnvironmentVariable("Github-RepositoryOwner"), 31 | RepositoryName = Environment.GetEnvironmentVariable($"{filter}-RepositoryName"), 32 | }; 33 | } 34 | } 35 | } 36 | -------------------------------------------------------------------------------- /code/src/CoreTemplateStudio/CoreTemplateStudio.Core/Diagnostics/FormattedWriterMessages.cs: -------------------------------------------------------------------------------- 1 | // Licensed to the .NET Foundation under one or more agreements. 2 | // The .NET Foundation licenses this file to you under the MIT license. 3 | // See the LICENSE file in the project root for more information. 4 | 5 | using System; 6 | using System.Diagnostics; 7 | 8 | using Microsoft.Templates.Core.Resources; 9 | 10 | namespace Microsoft.Templates.Core.Diagnostics 11 | { 12 | public class FormattedWriterMessages 13 | { 14 | private static string exHeader = $"===================== {StringRes.ExceptionInfoString} ====================="; 15 | 16 | public static string ExHeader 17 | { 18 | get { return exHeader; } 19 | } 20 | 21 | public const string ExFooter = "----------------------------------------------------------"; 22 | 23 | public static string LogEntryStart 24 | { 25 | get 26 | { 27 | return $"[{DateTime.Now.FormatAsFullDateTime()}]\t{Environment.UserName}\t{Process.GetCurrentProcess().Id}({System.Threading.Thread.CurrentThread.ManagedThreadId})\t"; 28 | } 29 | } 30 | } 31 | } 32 | -------------------------------------------------------------------------------- /code/test/CoreTemplateStudio.Core.Test/TestFakes/GenShell/TestGenShellUI.cs: -------------------------------------------------------------------------------- 1 | // Licensed to the .NET Foundation under one or more agreements. 2 | // The .NET Foundation licenses this file to you under the MIT license. 3 | // See the LICENSE file in the project root for more information. 4 | 5 | using Microsoft.Templates.Core.Gen; 6 | using Microsoft.Templates.Core.Gen.Shell; 7 | 8 | namespace Microsoft.Templates.Core.Test.TestFakes.GenShell 9 | { 10 | public class TestGenShellUI : IGenShellUI 11 | { 12 | public TestGenShellUI() 13 | { 14 | } 15 | 16 | public void CancelWizard(bool back = true) 17 | { 18 | } 19 | 20 | public void OpenItems(params string[] itemsFullPath) 21 | { 22 | } 23 | 24 | public void OpenProjectOverview() 25 | { 26 | } 27 | 28 | public void ShowModal(IWindow shell) 29 | { 30 | } 31 | 32 | public void ShowStatusBarMessage(string message) 33 | { 34 | } 35 | 36 | public void ShowTaskList() 37 | { 38 | } 39 | 40 | public void WriteOutput(string data) 41 | { 42 | } 43 | } 44 | } 45 | -------------------------------------------------------------------------------- /code/tools/WtsPackagingTool/App.config: -------------------------------------------------------------------------------- 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 | -------------------------------------------------------------------------------- /code/test/CoreTemplateStudio.Core.Test/TestFakes/GenShell/TestGenShell.cs: -------------------------------------------------------------------------------- 1 | // Licensed to the .NET Foundation under one or more agreements. 2 | // The .NET Foundation licenses this file to you under the MIT license. 3 | // See the LICENSE file in the project root for more information. 4 | 5 | using Microsoft.Templates.Core.Gen.Shell; 6 | 7 | namespace Microsoft.Templates.Core.Test.TestFakes.GenShell 8 | { 9 | public class TestGenShell : IGenShell 10 | { 11 | public TestGenShell() 12 | { 13 | Project = new TestGenShellProject(); 14 | Solution = new TestGenShellSolution(); 15 | Telemetry = new TestGenShellTelemetry(); 16 | UI = new TestGenShellUI(); 17 | VisualStudio = new TestGenShellVisualStudio(); 18 | Certificate = new TestGenShellCertificate(); 19 | } 20 | 21 | public IGenShellProject Project { get; } 22 | 23 | public IGenShellSolution Solution { get; } 24 | 25 | public IGenShellTelemetry Telemetry { get; } 26 | 27 | public IGenShellUI UI { get; } 28 | 29 | public IGenShellVisualStudio VisualStudio { get; } 30 | 31 | public IGenShellCertificate Certificate { get; } 32 | } 33 | } 34 | -------------------------------------------------------------------------------- /code/tools/WtsPackagingTool/CommandOptions/RemoteSourceListOptions.cs: -------------------------------------------------------------------------------- 1 | // Licensed to the .NET Foundation under one or more agreements. 2 | // The .NET Foundation licenses this file to you under the MIT license. 3 | // See the LICENSE file in the project root for more information. 4 | 5 | using System; 6 | using System.Collections.Generic; 7 | using System.Linq; 8 | using System.Text; 9 | using System.Threading.Tasks; 10 | using CommandLine; 11 | 12 | namespace WtsPackagingTool.CommandOptions 13 | { 14 | [Verb("list-versions", Hidden = false, HelpText = "List the available versions / templates packages for the specified environment.")] 15 | public class RemoteSourceListOptions : RemoteSourceCommonOptions 16 | { 17 | [Option('s', "summary", HelpText = "Shows summary info.", Default = true)] 18 | public bool Summary { get; set; } 19 | 20 | [Option('d', "detailed", HelpText = "Shows detailed versions info.", Default = false)] 21 | public bool Detailed { get; set; } 22 | 23 | [Option('b', "build", HelpText = "If specified the information will be created on-the-fly with the existing packages published in the storage.", Default = false)] 24 | public bool Build { get; set; } 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /code/src/CoreTemplateStudio/CoreTemplateStudio.Core.sln: -------------------------------------------------------------------------------- 1 | 2 | Microsoft Visual Studio Solution File, Format Version 12.00 3 | # Visual Studio 15 4 | VisualStudioVersion = 15.0.28307.271 5 | MinimumVisualStudioVersion = 10.0.40219.1 6 | Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "CoreTemplateStudio.Core", "CoreTemplateStudio.Core\CoreTemplateStudio.Core.csproj", "{97FC225C-B74A-424B-BF73-B7B0796DE526}" 7 | EndProject 8 | Global 9 | GlobalSection(SolutionConfigurationPlatforms) = preSolution 10 | Debug|Any CPU = Debug|Any CPU 11 | Release|Any CPU = Release|Any CPU 12 | EndGlobalSection 13 | GlobalSection(ProjectConfigurationPlatforms) = postSolution 14 | {97FC225C-B74A-424B-BF73-B7B0796DE526}.Debug|Any CPU.ActiveCfg = Debug|Any CPU 15 | {97FC225C-B74A-424B-BF73-B7B0796DE526}.Debug|Any CPU.Build.0 = Debug|Any CPU 16 | {97FC225C-B74A-424B-BF73-B7B0796DE526}.Release|Any CPU.ActiveCfg = Release|Any CPU 17 | {97FC225C-B74A-424B-BF73-B7B0796DE526}.Release|Any CPU.Build.0 = Release|Any CPU 18 | EndGlobalSection 19 | GlobalSection(SolutionProperties) = preSolution 20 | HideSolutionNode = FALSE 21 | EndGlobalSection 22 | GlobalSection(ExtensibilityGlobals) = postSolution 23 | SolutionGuid = {BDFE1722-F246-4A71-840F-420579B802BE} 24 | EndGlobalSection 25 | EndGlobal 26 | -------------------------------------------------------------------------------- /code/src/CoreTemplateStudio/CoreTemplateStudio.Core/Extensions/DateTimeExtensions.cs: -------------------------------------------------------------------------------- 1 | // Licensed to the .NET Foundation under one or more agreements. 2 | // The .NET Foundation licenses this file to you under the MIT license. 3 | // See the LICENSE file in the project root for more information. 4 | 5 | using System; 6 | 7 | namespace Microsoft.Templates.Core 8 | { 9 | public static class DateTimeExtensions 10 | { 11 | public static string FormatAsDateForFilePath(this DateTime date) 12 | { 13 | return date.ToString("yyyyMMdd"); 14 | } 15 | 16 | public static string FormatAsFullDateTime(this DateTime date) 17 | { 18 | return date.ToString("yyyy-MM-dd HH:mm:ss.fff"); 19 | } 20 | 21 | public static string FormatAsTime(this DateTime date) 22 | { 23 | return date.ToString("HH:mm:ss.fff"); 24 | } 25 | 26 | public static string FormatAsShortDateTime(this DateTime date) 27 | { 28 | return date.ToString("yyyyMMdd_HHmmss"); 29 | } 30 | 31 | public static string FormatAsDateHoursMinutes(this DateTime date) 32 | { 33 | return date.ToString("ddHHmmss"); 34 | } 35 | } 36 | } 37 | --------------------------------------------------------------------------------