diff --git a/templates/Microsoft.AspNetCore.SpaTemplates/Content/aurelia/.template.config/template.json b/templates/Microsoft.AspNetCore.SpaTemplates/Content/aurelia/.template.config/template.json index 5c2277b..3b176af 100644 --- a/templates/Microsoft.AspNetCore.SpaTemplates/Content/aurelia/.template.config/template.json +++ b/templates/Microsoft.AspNetCore.SpaTemplates/Content/aurelia/.template.config/template.json @@ -11,11 +11,11 @@ "preferNameDirectory": true, "primaryOutputs": [ { - "path": "WebApplicationBasic.csproj" + "path": "AureliaSpa.csproj" } ], "shortName": "aurelia", - "sourceName": "WebApplicationBasic", + "sourceName": "AureliaSpa", "sources": [ { "source": "./", diff --git a/templates/Microsoft.AspNetCore.SpaTemplates/Content/aurelia/ClientApp/app/components/navmenu/navmenu.html b/templates/Microsoft.AspNetCore.SpaTemplates/Content/aurelia/ClientApp/app/components/navmenu/navmenu.html index a604b7e..1661aa6 100644 --- a/templates/Microsoft.AspNetCore.SpaTemplates/Content/aurelia/ClientApp/app/components/navmenu/navmenu.html +++ b/templates/Microsoft.AspNetCore.SpaTemplates/Content/aurelia/ClientApp/app/components/navmenu/navmenu.html @@ -9,7 +9,7 @@ - WebApplicationBasic + AureliaSpa
diff --git a/templates/Microsoft.DotNet.Web.Spa.ProjectTemplates/Content/react/Controllers/HomeController.cs b/templates/Microsoft.DotNet.Web.Spa.ProjectTemplates/Content/react/Controllers/HomeController.cs index 2889abd..32f2cee 100644 --- a/templates/Microsoft.DotNet.Web.Spa.ProjectTemplates/Content/react/Controllers/HomeController.cs +++ b/templates/Microsoft.DotNet.Web.Spa.ProjectTemplates/Content/react/Controllers/HomeController.cs @@ -5,7 +5,7 @@ using System.Linq; using System.Threading.Tasks; using Microsoft.AspNetCore.Mvc; -namespace WebApplicationBasic.Controllers +namespace ReactSpa.Controllers { public class HomeController : Controller { diff --git a/templates/Microsoft.DotNet.Web.Spa.ProjectTemplates/Content/react/Controllers/SampleDataController.cs b/templates/Microsoft.DotNet.Web.Spa.ProjectTemplates/Content/react/Controllers/SampleDataController.cs index 0f1aa37..c0c9e37 100644 --- a/templates/Microsoft.DotNet.Web.Spa.ProjectTemplates/Content/react/Controllers/SampleDataController.cs +++ b/templates/Microsoft.DotNet.Web.Spa.ProjectTemplates/Content/react/Controllers/SampleDataController.cs @@ -4,7 +4,7 @@ using System.Linq; using System.Threading.Tasks; using Microsoft.AspNetCore.Mvc; -namespace WebApplicationBasic.Controllers +namespace ReactSpa.Controllers { [Route("api/[controller]")] public class SampleDataController : Controller diff --git a/templates/Microsoft.DotNet.Web.Spa.ProjectTemplates/Content/react/Program.cs b/templates/Microsoft.DotNet.Web.Spa.ProjectTemplates/Content/react/Program.cs index e1e634e..719033c 100644 --- a/templates/Microsoft.DotNet.Web.Spa.ProjectTemplates/Content/react/Program.cs +++ b/templates/Microsoft.DotNet.Web.Spa.ProjectTemplates/Content/react/Program.cs @@ -8,7 +8,7 @@ using Microsoft.AspNetCore.Hosting; using Microsoft.Extensions.Configuration; using Microsoft.Extensions.Logging; -namespace WebApplicationBasic +namespace ReactSpa { public class Program { diff --git a/templates/Microsoft.DotNet.Web.Spa.ProjectTemplates/Content/react/Startup.cs b/templates/Microsoft.DotNet.Web.Spa.ProjectTemplates/Content/react/Startup.cs index 740f113..5920452 100644 --- a/templates/Microsoft.DotNet.Web.Spa.ProjectTemplates/Content/react/Startup.cs +++ b/templates/Microsoft.DotNet.Web.Spa.ProjectTemplates/Content/react/Startup.cs @@ -8,7 +8,7 @@ using Microsoft.AspNetCore.SpaServices.Webpack; using Microsoft.Extensions.Configuration; using Microsoft.Extensions.DependencyInjection; -namespace WebApplicationBasic +namespace ReactSpa { public class Startup { diff --git a/templates/Microsoft.DotNet.Web.Spa.ProjectTemplates/Content/react/Views/Shared/_Layout.cshtml b/templates/Microsoft.DotNet.Web.Spa.ProjectTemplates/Content/react/Views/Shared/_Layout.cshtml index 2860f31..74472d3 100644 --- a/templates/Microsoft.DotNet.Web.Spa.ProjectTemplates/Content/react/Views/Shared/_Layout.cshtml +++ b/templates/Microsoft.DotNet.Web.Spa.ProjectTemplates/Content/react/Views/Shared/_Layout.cshtml @@ -3,7 +3,7 @@ - @ViewData["Title"] - WebApplicationBasic + @ViewData["Title"] - ReactSpa diff --git a/templates/Microsoft.DotNet.Web.Spa.ProjectTemplates/Content/react/Views/_ViewImports.cshtml b/templates/Microsoft.DotNet.Web.Spa.ProjectTemplates/Content/react/Views/_ViewImports.cshtml index 8edbc68..d097fcb 100644 --- a/templates/Microsoft.DotNet.Web.Spa.ProjectTemplates/Content/react/Views/_ViewImports.cshtml +++ b/templates/Microsoft.DotNet.Web.Spa.ProjectTemplates/Content/react/Views/_ViewImports.cshtml @@ -1,3 +1,3 @@ -@using WebApplicationBasic +@using ReactSpa @addTagHelper *, Microsoft.AspNetCore.Mvc.TagHelpers @addTagHelper *, Microsoft.AspNetCore.SpaServices diff --git a/templates/Microsoft.DotNet.Web.Spa.ProjectTemplates/Content/react/npm-shrinkwrap.json b/templates/Microsoft.DotNet.Web.Spa.ProjectTemplates/Content/react/npm-shrinkwrap.json index 3df0b40..cc53139 100644 --- a/templates/Microsoft.DotNet.Web.Spa.ProjectTemplates/Content/react/npm-shrinkwrap.json +++ b/templates/Microsoft.DotNet.Web.Spa.ProjectTemplates/Content/react/npm-shrinkwrap.json @@ -1,5 +1,5 @@ { - "name": "WebApplicationBasic", + "name": "ReactSpa", "version": "0.0.0", "dependencies": { "@types/history": { diff --git a/templates/Microsoft.DotNet.Web.Spa.ProjectTemplates/Content/react/package.json b/templates/Microsoft.DotNet.Web.Spa.ProjectTemplates/Content/react/package.json index 5431d17..29cf148 100644 --- a/templates/Microsoft.DotNet.Web.Spa.ProjectTemplates/Content/react/package.json +++ b/templates/Microsoft.DotNet.Web.Spa.ProjectTemplates/Content/react/package.json @@ -1,5 +1,5 @@ { - "name": "WebApplicationBasic", + "name": "ReactSpa", "private": true, "version": "0.0.0", "devDependencies": { diff --git a/templates/Microsoft.DotNet.Web.Spa.ProjectTemplates/Content/redux/.template.config/template.json b/templates/Microsoft.DotNet.Web.Spa.ProjectTemplates/Content/redux/.template.config/template.json index 0dc06ba..38418e8 100644 --- a/templates/Microsoft.DotNet.Web.Spa.ProjectTemplates/Content/redux/.template.config/template.json +++ b/templates/Microsoft.DotNet.Web.Spa.ProjectTemplates/Content/redux/.template.config/template.json @@ -11,11 +11,11 @@ "preferNameDirectory": true, "primaryOutputs": [ { - "path": "WebApplicationBasic.csproj" + "path": "ReactReduxSpa.csproj" } ], "shortName": "reactredux", - "sourceName": "WebApplicationBasic", + "sourceName": "ReactReduxSpa", "sources": [ { "source": "./", diff --git a/templates/Microsoft.DotNet.Web.Spa.ProjectTemplates/Content/redux/ClientApp/components/NavMenu.tsx b/templates/Microsoft.DotNet.Web.Spa.ProjectTemplates/Content/redux/ClientApp/components/NavMenu.tsx index 1747148..3f60015 100644 --- a/templates/Microsoft.DotNet.Web.Spa.ProjectTemplates/Content/redux/ClientApp/components/NavMenu.tsx +++ b/templates/Microsoft.DotNet.Web.Spa.ProjectTemplates/Content/redux/ClientApp/components/NavMenu.tsx @@ -12,7 +12,7 @@ export class NavMenu extends React.Component<{}, {}> { - WebApplicationBasic + ReactReduxSpa
diff --git a/templates/Microsoft.DotNet.Web.Spa.ProjectTemplates/Content/redux/Controllers/HomeController.cs b/templates/Microsoft.DotNet.Web.Spa.ProjectTemplates/Content/redux/Controllers/HomeController.cs index 2889abd..6931d53 100644 --- a/templates/Microsoft.DotNet.Web.Spa.ProjectTemplates/Content/redux/Controllers/HomeController.cs +++ b/templates/Microsoft.DotNet.Web.Spa.ProjectTemplates/Content/redux/Controllers/HomeController.cs @@ -5,7 +5,7 @@ using System.Linq; using System.Threading.Tasks; using Microsoft.AspNetCore.Mvc; -namespace WebApplicationBasic.Controllers +namespace ReactReduxSpa.Controllers { public class HomeController : Controller { diff --git a/templates/Microsoft.DotNet.Web.Spa.ProjectTemplates/Content/redux/Controllers/SampleDataController.cs b/templates/Microsoft.DotNet.Web.Spa.ProjectTemplates/Content/redux/Controllers/SampleDataController.cs index 6972475..8286824 100644 --- a/templates/Microsoft.DotNet.Web.Spa.ProjectTemplates/Content/redux/Controllers/SampleDataController.cs +++ b/templates/Microsoft.DotNet.Web.Spa.ProjectTemplates/Content/redux/Controllers/SampleDataController.cs @@ -4,7 +4,7 @@ using System.Linq; using System.Threading.Tasks; using Microsoft.AspNetCore.Mvc; -namespace WebApplicationBasic.Controllers +namespace ReactReduxSpa.Controllers { [Route("api/[controller]")] public class SampleDataController : Controller diff --git a/templates/Microsoft.DotNet.Web.Spa.ProjectTemplates/Content/redux/Program.cs b/templates/Microsoft.DotNet.Web.Spa.ProjectTemplates/Content/redux/Program.cs index e1e634e..708408c 100644 --- a/templates/Microsoft.DotNet.Web.Spa.ProjectTemplates/Content/redux/Program.cs +++ b/templates/Microsoft.DotNet.Web.Spa.ProjectTemplates/Content/redux/Program.cs @@ -8,7 +8,7 @@ using Microsoft.AspNetCore.Hosting; using Microsoft.Extensions.Configuration; using Microsoft.Extensions.Logging; -namespace WebApplicationBasic +namespace ReactReduxSpa { public class Program { diff --git a/templates/Microsoft.DotNet.Web.Spa.ProjectTemplates/Content/redux/Startup.cs b/templates/Microsoft.DotNet.Web.Spa.ProjectTemplates/Content/redux/Startup.cs index 740f113..7da1e59 100644 --- a/templates/Microsoft.DotNet.Web.Spa.ProjectTemplates/Content/redux/Startup.cs +++ b/templates/Microsoft.DotNet.Web.Spa.ProjectTemplates/Content/redux/Startup.cs @@ -8,7 +8,7 @@ using Microsoft.AspNetCore.SpaServices.Webpack; using Microsoft.Extensions.Configuration; using Microsoft.Extensions.DependencyInjection; -namespace WebApplicationBasic +namespace ReactReduxSpa { public class Startup { diff --git a/templates/Microsoft.DotNet.Web.Spa.ProjectTemplates/Content/redux/Views/Shared/_Layout.cshtml b/templates/Microsoft.DotNet.Web.Spa.ProjectTemplates/Content/redux/Views/Shared/_Layout.cshtml index 388f8f9..7c3e0f8 100644 --- a/templates/Microsoft.DotNet.Web.Spa.ProjectTemplates/Content/redux/Views/Shared/_Layout.cshtml +++ b/templates/Microsoft.DotNet.Web.Spa.ProjectTemplates/Content/redux/Views/Shared/_Layout.cshtml @@ -3,7 +3,7 @@ - @ViewData["Title"] - WebApplicationBasic + @ViewData["Title"] - ReactReduxSpa diff --git a/templates/Microsoft.DotNet.Web.Spa.ProjectTemplates/Content/redux/Views/_ViewImports.cshtml b/templates/Microsoft.DotNet.Web.Spa.ProjectTemplates/Content/redux/Views/_ViewImports.cshtml index 8edbc68..cda1928 100644 --- a/templates/Microsoft.DotNet.Web.Spa.ProjectTemplates/Content/redux/Views/_ViewImports.cshtml +++ b/templates/Microsoft.DotNet.Web.Spa.ProjectTemplates/Content/redux/Views/_ViewImports.cshtml @@ -1,3 +1,3 @@ -@using WebApplicationBasic +@using ReactReduxSpa @addTagHelper *, Microsoft.AspNetCore.Mvc.TagHelpers @addTagHelper *, Microsoft.AspNetCore.SpaServices diff --git a/templates/Microsoft.DotNet.Web.Spa.ProjectTemplates/Content/redux/npm-shrinkwrap.json b/templates/Microsoft.DotNet.Web.Spa.ProjectTemplates/Content/redux/npm-shrinkwrap.json index 4da356c..13165b4 100644 --- a/templates/Microsoft.DotNet.Web.Spa.ProjectTemplates/Content/redux/npm-shrinkwrap.json +++ b/templates/Microsoft.DotNet.Web.Spa.ProjectTemplates/Content/redux/npm-shrinkwrap.json @@ -1,5 +1,5 @@ { - "name": "WebApplicationBasic", + "name": "ReactReduxSpa", "version": "0.0.0", "dependencies": { "@types/history": { diff --git a/templates/Microsoft.DotNet.Web.Spa.ProjectTemplates/Content/redux/package.json b/templates/Microsoft.DotNet.Web.Spa.ProjectTemplates/Content/redux/package.json index c7c8288..3991fb1 100644 --- a/templates/Microsoft.DotNet.Web.Spa.ProjectTemplates/Content/redux/package.json +++ b/templates/Microsoft.DotNet.Web.Spa.ProjectTemplates/Content/redux/package.json @@ -1,5 +1,5 @@ { - "name": "WebApplicationBasic", + "name": "ReactReduxSpa", "private": true, "version": "0.0.0", "dependencies": { diff --git a/templates/package-builder/src/build/build.ts b/templates/package-builder/src/build/build.ts index ee57fc1..05611e0 100644 --- a/templates/package-builder/src/build/build.ts +++ b/templates/package-builder/src/build/build.ts @@ -9,18 +9,12 @@ import * as childProcess from 'child_process'; import * as targz from 'tar.gz'; const isWindows = /^win/.test(process.platform); -const textFileExtensions = ['.gitignore', '.config', '.cs', '.cshtml', '.csproj', '.html', '.js', '.json', '.jsx', '.md', '.nuspec', '.ts', '.tsx']; const dotNetPackages = [ 'Microsoft.DotNet.Web.Spa.ProjectTemplates', 'Microsoft.AspNetCore.SpaTemplates' ]; -function isTextFile(filename: string): boolean { - return textFileExtensions.indexOf(path.extname(filename).toLowerCase()) >= 0 - || textFileExtensions.indexOf(path.basename(filename)) >= 0; -} - function writeFileEnsuringDirExists(root: string, filename: string, contents: string | Buffer) { let fullPath = path.join(root, filename); mkdirp.sync(path.dirname(fullPath)); @@ -45,18 +39,9 @@ function applyContentReplacements(sourceContent: Buffer, contentReplacements: { return new Buffer(sourceText, 'utf8'); } -function writeTemplate(sourceRoot: string, destRoot: string, contentReplacements: { from: RegExp, to: string }[], filenameReplacements: { from: RegExp, to: string }[]) { +function writeTemplate(sourceRoot: string, destRoot: string) { listFilesExcludingGitignored(sourceRoot).forEach(fn => { let sourceContent = fs.readFileSync(path.join(sourceRoot, fn)); - if (isTextFile(fn)) { - sourceContent = applyContentReplacements(sourceContent, contentReplacements); - } - - // Also apply replacements in filenames - filenameReplacements.forEach(replacement => { - fn = fn.replace(replacement.from, replacement.to); - }); - writeFileEnsuringDirExists(destRoot, fn, sourceContent); }); } @@ -93,20 +78,13 @@ function buildDotNetNewNuGetPackage(packageId: string) { rimraf.sync(outputRoot); // Copy template files - const sourceProjectName = 'WebApplicationBasic'; - const projectGuid = '00000000-0000-0000-0000-000000000000'; - const filenameReplacements = [ - { from: /.*\.csproj$/, to: `${sourceProjectName}.csproj` } - ]; - const contentReplacements = []; - const packageSourceRootDir = path.join('../', packageId); const templatesInPackage = fs.readdirSync(path.join(packageSourceRootDir, 'Content')); _.forEach(templatesInPackage, templateName => { const templateSourceDir = path.join(packageSourceRootDir, 'Content', templateName); const templateOutputDir = path.join(outputRoot, 'Content', templateName); - writeTemplate(templateSourceDir, templateOutputDir, contentReplacements, filenameReplacements); + writeTemplate(templateSourceDir, templateOutputDir); }); // Create the .nuspec file