Add dotnet new template for project scaffolding#32
Open
Kristoffer88 wants to merge 5 commits intomainfrom
Open
Add dotnet new template for project scaffolding#32Kristoffer88 wants to merge 5 commits intomainfrom
Kristoffer88 wants to merge 5 commits intomainfrom
Conversation
Adds `dotnet new xrmbedrock` template that automates project setup: - Renames project files/namespaces via sourceName - Replaces URLs, cert password, org/repo names, resource group name - Generates unique SNK strong name key (cross-platform) - Copies initial setup files, restores tools, installs npm - Creates username.txt from --username parameter
- Fix .gitignore path for username.txt (was /src/Dataverse/Tools/ should be /src/Tools/) - Replace someRandomPassword in README with <your-cert-password> to prevent cert password leaking into docs - Add --cert-password to README quick start example - Add manual replacement steps to README (ctx, demo, mgs) - Add PowerShell Core prerequisite note - Remove contradictory isRequired from publisherPrefix (has defaultValue)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Adds a
dotnet new xrmbedrocktemplate that automates most of the project setup process.What the template handles automatically
XrmBedrock→{name}in all files and filenames (sourceName)xrmbedrock→{namelower}for SNK references (nameLowergenerator)ctx_XrmBedrock→{prefix}_{name}(prefixedNamejoin generator)--dev-url,--test-url, etc.MGS/DEMOreplaced via--org-name/--repo-nameresourcegroupnamereplaced via--rg-namesomeRandomPasswordreplaced via--cert-passwordsrc/Tools/Daxif/username.txtvia--usernamegit init, copy initial files,dotnet tool restore,npm installWhat still requires manual replacement
These values are too short for safe global string replacement (the template engine's
replacesdoes literal substring matching):ctx_Config.fsxpublisher prefixctx_invoice,ctx_subscriptiondemomain.bicepsolutionIdmgsmain.bicepcompanyIdmgs_AzureStorageAccountUrlThe
--publisher-prefix,--solution-id, and--company-idparameters are collected but not auto-replaced. Users must find-and-replace these manually after project creation.Compatibility fixes
#pragma warning disable IDE0005around#if NET462inAzureService.cs— prevents build error when template engine evaluates the conditional (NET462 symbol set totrueas constant)#pragma warning disable SA1210inTestBase.cs— using order changes whenXrmBedrockis renamed to a name alphabetically beforeWireMockFiles added/changed
.template.config/template.json.template.config/dotnetcli.host.jsonSetup/postTemplateSetup.ps1src/Tools/Daxif/username.txtREADME.mdAzureService.csTestBase.csTest plan
dotnet new install .dotnet new xrmbedrock -n TestProject --publisher-prefix tst --org-name TestOrg --repo-name TestRepo --dev-url https://test.crm4.dynamics.com -o ~/repos/TestProjecttestproject.snkexists (596 bytes)src/Tools/Daxif/username.txthas correct valuetst_TestProjectfolder created under WebResourcesdotnet build --configuration Release— 0 errors, 0 warningsctx,demo,mgsin target filesdotnet new uninstall .