Code Monkey home page Code Monkey logo

coretemplatestudio's Introduction

Core Template Studio

Platforms Supported: MacOSX, Linux, Windows Project Status: Active โ€“ The project has reached a stable, usable state and is being actively developed. License: We are using the MIT License We are welcoming PRS!

Core Template Studio is a .NET Standard 2.0 project that handles all of the template synchronization and code generation (composition, generation + postaction execution) for WindowsTemplateStudio and WebTemplateStudio. The main project has two parts: a .NET Standard core and its corresponding Cli that exposes the core. There's also a tools folder containing helper tools as the WtsPackagingTool.

Build Status

Branch Build Status
dev Build Status
release Build Status

Branches

Our default branch is dev and all PR's should go to the dev branch. While there are no releases of CoreTS, we still have a release branch on CoreTS as this is where the submodules on Web Template Studio and Windows Template Studio point to. When adding new functionality or changing existing code make sure the changes are compatible with both Windows Template Studio and Web Template Studio. All changes have to be tested in both Windows Template Studio and Web Template Studio before being merged into the release branch.

Documentation

Features

  • Synchronizes Templates: The core has the ability to synchronize with templates, either in debug as a templates folder or in release as a .mstx file. It also builds and refreshes the template cache.
  • Provides information about available templates: Upon synchronization, the core will provide information on the available project type, framework, page and feature templates.
  • Generate using Templates: Using the available templates, the core does the composition, generation and postaction execution to create a C# or VB Project.
  • Telemetry: Performs the majority of telemetry for Windows Template Studio including user selections and generation time.

Limitations

  • Currently .NET Standard does not support Package verification using PackageDigitalSignatureManager. This functionality was moved to the Utilities project (.NET framework) to be consumed from Windows Template Studio. The CLI (.NET Core 3.1) does not allow to download template packages from the CDN due to this limitation. Tracking issue for adding this in once it is supported is issue #131.

Feedback, Requests and Roadmap

Please use GitHub issues for feedback, questions or comments.

If you have specific feature requests or would like to vote on what others are recommending, please go to the GitHub issues section as well. We would love to see what you are thinking.

This project is a shared project and will change based on the needs of WindowsTemplateStudio and WebTemplateStudio. You can check out WindowsTemplateStudio's roadmap for more information. We're still working on a roadmap for WebTemplateStudio.

Reporting Security Issues

Security issues and bugs should be reported privately, via email, to the Microsoft Security Response Center (MSRC) at [email protected]. You should receive a response within 24 hours. If for some reason you do not, please follow up via email to ensure we received your original message. Further information, including the MSRC PGP key, can be found in the Security TechCenter.

Contributing

Do you want to contribute? We would love to have you help out. Here are our contribution guidelines.

This project welcomes contributions and suggestions. Most contributions require you to agree to a Contributor License Agreement (CLA) declaring that you have the right to, and actually do, grant us the rights to use your contribution. For details, visit https://cla.microsoft.com.

When you submit a pull request, a CLA-bot will automatically determine whether you need to provide a CLA and decorate the PR appropriately (e.g., label, comment). Simply follow the instructions provided by the bot. You will only need to do this once across all repos using our CLA.

This project has adopted the Microsoft Open Source Code of Conduct. For more information see the Code of Conduct FAQ or contact [email protected] with any additional questions or comments.

coretemplatestudio's People

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

coretemplatestudio's Issues

Do more unit tests for Core Helpers and Extensions

Do more unit tests and improve code coverage on the following classes:

Microsoft.Templates.Core.Helpers

  • Fs
    • FindFileAtOrAbove
    • CopyRecursive
  • FileHelper
  • ProjectHelper

Microsoft.Templates.Core.Extensions:

  • DictionaryExtensions
  • IEnumerableExtensions
  • DateTimeExtension
  • PathExtensions
    • GetPathRelativeToGenerationPath
  • StringExtensions
  • TemplateTypeExtensions
    • GetNewItemType
  • VersionExtension

X-Ref: microsoft/TemplateStudio#2398

Do more unit tests for Core Postactions

Do more unit tests and improve code coverage on the following classes:

Microsoft.Templates.Core.Postactions:

  • NewItemPostactionFactory
  • NewProjectPostactionFactory

X-Ref: #2398

Core should be able to determine when to use Per-User templates or Shared templates

The core should be able to determine whether to use shared templates or per-user templates given the information passed through to the api. Currently there is a problem with the .templateengine cache messing with the switching, so this must be resolved aswell.

  • Fix .templateengine cache problem with mount points.
  • Allow contextual switching between per-user and shared templates.

Migrate Naming Folder to dotnet core

  • DefaultNamesValidator.cs
  • ExistingNamesValidator.cs
  • FileExistsValidator.cs
  • Naming.cs
  • PageSuffixValidator.cs
  • ReservedNamesValidator.cs
  • SuggestedDirectoryNameValidator.cs
  • ValidationErrorType.cs
  • ValidationResult.cs
  • Validator.cs
  • All Tests
    Above classes must be migrated before issue can be closed.

The engine needs to be refactored to support localization, and better practices.

  • A resource file must be used for strings.

  • ApiShell needs to be renamed to ApiGenShell

  • All instances of Wait() should be removed and replaced with async await.

  • IsValidPlatform and IsValidLanguage methods need to be moved from syncmodel to Platforms and ProgrammingLanguages.cs

  • Controllers need to have cleaner return statements

  • Remove header comments off of api after updating swagger docs.

We need to ensure the encoding is preserved by the engine.

For package.json's the utf-8 encoding with BOM will mess things up when we do yarn install. We need to make sure that we preserve non bom encodings if any exist. To do this we should check the encoding and then check if the bom exists or not, if not then we return the encoding without the BOM. If there is mismatched encoding we need to log/throw an error.

Move solutions to root level

We'll create the following solutions in the code folder (at root level) to facilitate access to the API folder:

  • Big.sln: Contains all 4 projects
  • Core.sln: Contains Core and Core.Test project

The idea is to replace the other solutions once the build is changed.

Refactor Core to return complete TemplateInfo when retrieving templates and light TemplateInfo on generation

Refactor Core to return complete TemplateInfo when retrieving templates and light TemplateInfo on generation

  • We should use a lighter TemplateInfo in UserSelection when generating. We only need the name + templateid to generate.
  • TemplateRepo should have methods that return the complete TemplateInfo + dependencies when retrieving templates.
  • To get supported projectTypes or frameworks two methods have to be called
    (e.g. GetSupportedProjecttypes from GenComposer and GetProjectTypes from Repository). This should be done in one method on the TemplateRepo, that returns MetaDataInfo for the supported projecttypes and frameworks

The engine needs to be refactored to support frontend and backend frameworks

GenComposer needs the following methods added:

  • GetAllSupportedFx
  • GetPages
  • GetFeatures
  • Deprecate GetSupportedFx

Templates Repository needs the following methods added:

  • GetFrontEndFrameworks
  • GetBackEndFrameworks
  • Deprecate GetFrameworks

ITemplatesExtensions needs the following methods added:

  • GetFrontEndFrameworkList
  • GetBackEndFrameworkList
  • Deprecate GetFrameworkList

Additionally the following needs to be done:

  • Replace frameworks.json with frontEndFramework.json and backEndFramework.json

Migrate Diagnostics Folder to dotnet core.

  • AppHealth.cs
  • EditItemActionEnum.cs
  • ExceptionTracker.cs
  • FileHealthWriter.cs
  • FormattedWriterMessages.cs
  • GenItemsTelemetryData.cs
  • GenSourceEnum.cs
  • GenStatusEnum.cs
  • HealthWriters.cs
  • IHealthWriter.cs
  • NewItemType.cs
  • ProjectMetricsEnum.cs
  • ShellHealthWriter.cs
  • TelemetryEvents.cs
  • TelemetryMetrics.cs
  • TelemetryProperties.cs
  • TelemetryService.cs
  • TelemetryTracker.cs
  • TraceHealthWriter.cs
  • TraceTracker.cs
  • VsTelemetryProperties.cs
  • WizardActionEnum.cs
  • WizardStatusEnum.cs
  • WizardTypeEnum.cs
  • All tests
    The following classes must be migrated before this issue can be closed

Need to connect engine to api for template synchronization

  • Create ApiShell and ApiDigitalSignatureService and ApiCertificate service to support RemoteTemplateSource and Local Template Source
  • Add package path to remotetemplatesource.
  • Add preprocessor directives to choose between remote and local template source for API
  • Add a templates folder in webts.
  • Change configuration to make downloaded template folder to C:/ProgramData/CoreTemplateStudio instead of WindowsTemplateStudio.
  • Fix tests to match these changes.
  • Create tests for API end point for synchronization

Migrate Gen Folder to dotnet core

  • FileRenameParameterReplacements.cs
  • GenComposer.cs
  • GenContext.cs
  • GenController.cs
  • GenException.cs
  • GenInfo.cs
  • GenParams.cs
  • GenShell.cs
  • GenToolBox.cs
  • IContextProvider.cs
  • IWindow.cs
  • NewItemGenController.cs
  • NewItemGenerationFileInfo.cs
  • NewItemGenerationResult.cs
  • NewProjectGenController.cs
  • NugetReference.cs
  • ProjectConfigInfo.cs
  • ProjectInfo.cs
  • ProjectReference.cs
  • SdkReference.cs
  • TempGenerationResult.cs
  • UserSelection.cs

The above classes must be ported to dot net core before this issue can be closed.

Migrate Extensions Folder to dotnet core

  • DateTimeExtensions.cs
  • DictionaryExtensions.cs
  • ICreationPathExtensions.cs
  • PathExtensions.cs
  • StringExtensions.cs
  • TaskExtensions.cs
  • VersionExtensions.cs
  • XElementExtensions.cs
    Above classes must be migrated before issue can be closed.

Sync changes from wints to corets

  • Added reserved names for Identity
  • Added parameter referencedProjectPath to AddProjectReferencesToContextPostaction
  • Only check encoding on mergepostactions on new project generations, not on right click

Migrate Post Actions Folder to dotnet core

  • NewItemPostActionFactory.cs
  • NewProjectPostActionFactory.cs
  • PostAction.cs
  • PostActionFactory.cs
  • TemplateDefinedPostAction.cs
  • \Catalog\AddContextItemsToSolutionAndProjectPostAction.cs
  • \Catalog\AddItemToContextPostAction.cs
  • \Catalog\AddNugetReferenceToContextPostaction.cs
  • \Catalog\AddProjectReferencesToContextPostAction.cs
  • \Catalog\AddProjectToContextPostAction.cs
  • \Catalog\AddSdkReferencesToContextPostAction.cs
  • \Catalog\GenerateTestCertificatePostAction.cs
  • \Catalog\SetDefaultSolutionConfigurationPostAction.cs
  • \Catalog\Merge\FailedMergePostActionInfo.cs
  • \Catalog\Merge\GenerateMergeInfoPostAction.cs
  • \Catalog\Merge\GetMergeFilesFromProjectPostAction.cs
  • \Catalog\Merge\IEnumerableExtensions.cs
  • \Catalog\Merge\MergeConfiguration.cs
  • \Catalog\Merge\MergeFailureType.cs
  • \Catalog\Merge\MergeInfo.cs
  • \Catalog\Merge\MergeMode.cs
  • \Catalog\Merge\MergePostAction.cs
  • \Catalog\Merge\MergeResourceDictionaryPostAction.cs
  • \Catalog\Merge\PostactionFormatter.cs
  • \Catalog\Merge\ResourceDictionaryWriter.cs
  • \Catalog\Merge\SearchAndReplacePostAction.cs
  • \Catalog\Merge\StringExtensions.cs
  • \Catalog\NewItemGeneration\CopyFilesToProjectPostAction.cs
  • \Catalog\NewItemGeneration\CreateSummaryPostAction.cs
  • \Catalog\NewItemGeneration\OpenFilesPostAction.cs
  • \Catalog\SortNamespaces\ImportsComparer.cs
  • \Catalog\SortNamespaces\ListStringExtensions.cs
  • \Catalog\SortNamespaces\NamespaceComparer.cs
  • \Catalog\SortNamespaces\SortImportsPostAction.cs
  • \Catalog\SortNamespaces\SortNamespacesPostAction.cs
  • \Catalog\SortNamespaces\SortUsingsPostAction.cs
  • \Catalog\SortNamespaces\UsingComparer.cs
  • All Tests
    The following classes must be migrated before this issue can be closed

Api Infrastructure improvements

We should improve the api infrastructure with the following changes:

  • Change the controller methods to use the improvements introduce in .net core 2.1, especially the use of the ActionResult<T> and ApiController attribute.
  • Refactor controllers to move GenContext validation code if (GenContext.ToolBox == null) to action filter.
  • Create an action filter to validate model state. This will allow us to validate models using Data Annotation. In a future we should use fluent validation to validate models.
  • Create middleware to handle errors and exceptions globally.

Migrate Locations Folder to dotnet core

  • JunctionNativeMethods.cs
  • LocalTemplatesSource.cs
  • ProgressEventArgs.cs
  • RemoteTemplatesSource.cs
  • SyncStatus.cs
  • SyncStatusEventArgs.cs
  • TemplatesContent.cs
  • TemplatesContentInfo.cs
  • TemplatesPackageInfo.cs
  • TemplatesSource.cs
  • TemplatesSourceConfig.cs
  • TemplatesSynchronization.cs
  • All Tests
    Above classes must be migrated before issue can be closed.

Migrate Packaging Folder to dotnet core

  • IDigitalSignatureService.cs
  • InvalidSignatureException.cs
  • SignCertNotFoundException.cs
  • TemplatePackage.cs
  • All Tests
    The above must be migrated before this issue can be closed.

Need to connect GetProjectTypes, GetFrameworks and GetPages

  • Modify FrameworkController to connect to engine
  • Add ability to filter frameworks by type (Frontend and backend)
  • Modify ProjectTypeController to connect to engine
  • Modify PagesController to connect to engine
  • Create tests for ProjectTypes endpoint
  • Create tests for framework endpoint
  • Create tests for pages end point

Migrate Templates Folder to dotnet core

  • ITemplateInfoExtensions.cs
  • LayoutItem.cs
  • MetadataInfo.cs
  • MetadataLocalizedInfo.cs
  • MetadataType.cs
  • TemplateLicense.cs
  • TemplateLicenseEqualityComparer.cs
  • TemplateOutputType.cs
  • TemplatesRepository.cs
  • TemplateType.cs
  • All Tests
    Above classes must be migrated before issue can be closed.

Sync changes from WinTS for Testing features

Sync changes from WinTS for testing features:

  • GenComposer:
    • Add userName to GenParams
    • Add QueryableProperties for pages and features
  • AddProjectReferencesToContext Postaction: Add specifiedPathIsTarget property
  • GenerateTestCertificatePostAction: Correct filePath of certificate

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.