diff --git a/templates/Angular2Spa/template_nodemodules_placeholder.txt b/templates/Angular2Spa/template_nodemodules_placeholder.txt deleted file mode 100644 index 97e54d1..0000000 --- a/templates/Angular2Spa/template_nodemodules_placeholder.txt +++ /dev/null @@ -1,11 +0,0 @@ ------------------------------------------------------------------- -Don't delete this file. Do include it in your source control repo. ------------------------------------------------------------------- - -This file exists as a workaround for https://github.com/dotnet/cli/issues/1396 -('dotnet publish' does not publish any directories that didn't exist or were -empty before the publish script started, which means it's not enough just to -run 'npm install' during publishing: you need to ensure node_modules already -existed at least). - -Hopefully, this can be removed after the move to the new MSBuild. diff --git a/templates/AureliaSpa/template_nodemodules_placeholder.txt b/templates/AureliaSpa/template_nodemodules_placeholder.txt deleted file mode 100644 index 97e54d1..0000000 --- a/templates/AureliaSpa/template_nodemodules_placeholder.txt +++ /dev/null @@ -1,11 +0,0 @@ ------------------------------------------------------------------- -Don't delete this file. Do include it in your source control repo. ------------------------------------------------------------------- - -This file exists as a workaround for https://github.com/dotnet/cli/issues/1396 -('dotnet publish' does not publish any directories that didn't exist or were -empty before the publish script started, which means it's not enough just to -run 'npm install' during publishing: you need to ensure node_modules already -existed at least). - -Hopefully, this can be removed after the move to the new MSBuild. diff --git a/templates/KnockoutSpa/template_nodemodules_placeholder.txt b/templates/KnockoutSpa/template_nodemodules_placeholder.txt deleted file mode 100644 index 09ae8c0..0000000 --- a/templates/KnockoutSpa/template_nodemodules_placeholder.txt +++ /dev/null @@ -1,7 +0,0 @@ -This file exists as a workaround for https://github.com/dotnet/cli/issues/1396 -('dotnet publish' does not publish any directories that didn't exist or were -empty before the publish script started, which means it's not enough just to -run 'npm install' during publishing: you need to ensure node_modules already -existed at least). - -Hopefully, this can be removed after the move to the new MSBuild. diff --git a/templates/ReactReduxSpa/template_nodemodules_placeholder.txt b/templates/ReactReduxSpa/template_nodemodules_placeholder.txt deleted file mode 100644 index 09ae8c0..0000000 --- a/templates/ReactReduxSpa/template_nodemodules_placeholder.txt +++ /dev/null @@ -1,7 +0,0 @@ -This file exists as a workaround for https://github.com/dotnet/cli/issues/1396 -('dotnet publish' does not publish any directories that didn't exist or were -empty before the publish script started, which means it's not enough just to -run 'npm install' during publishing: you need to ensure node_modules already -existed at least). - -Hopefully, this can be removed after the move to the new MSBuild. diff --git a/templates/ReactSpa/template_nodemodules_placeholder.txt b/templates/ReactSpa/template_nodemodules_placeholder.txt deleted file mode 100644 index 09ae8c0..0000000 --- a/templates/ReactSpa/template_nodemodules_placeholder.txt +++ /dev/null @@ -1,7 +0,0 @@ -This file exists as a workaround for https://github.com/dotnet/cli/issues/1396 -('dotnet publish' does not publish any directories that didn't exist or were -empty before the publish script started, which means it's not enough just to -run 'npm install' during publishing: you need to ensure node_modules already -existed at least). - -Hopefully, this can be removed after the move to the new MSBuild. diff --git a/templates/WebApplicationBasic/template_nodemodules_placeholder.txt b/templates/WebApplicationBasic/template_nodemodules_placeholder.txt deleted file mode 100644 index 09ae8c0..0000000 --- a/templates/WebApplicationBasic/template_nodemodules_placeholder.txt +++ /dev/null @@ -1,7 +0,0 @@ -This file exists as a workaround for https://github.com/dotnet/cli/issues/1396 -('dotnet publish' does not publish any directories that didn't exist or were -empty before the publish script started, which means it's not enough just to -run 'npm install' during publishing: you need to ensure node_modules already -existed at least). - -Hopefully, this can be removed after the move to the new MSBuild. diff --git a/templates/package-builder/src/build/build.ts b/templates/package-builder/src/build/build.ts index 27776d8..c5d6a75 100644 --- a/templates/package-builder/src/build/build.ts +++ b/templates/package-builder/src/build/build.ts @@ -120,11 +120,7 @@ function buildDotNetNewNuGetPackage() { const projectGuid = '00000000-0000-0000-0000-000000000000'; const filenameReplacements = [ { from: /.*\.xproj$/, to: `${sourceProjectName}.xproj` }, - { from: /\btemplate_gitignore$/, to: '.gitignore' }, - - // Workaround for https://github.com/aspnet/JavaScriptServices/issues/235 - // For details, see the comment in ../yeoman/app/index.ts - { from: /\btemplate_nodemodules_placeholder.txt$/, to: 'node_modules/_placeholder.txt' } + { from: /\btemplate_gitignore$/, to: '.gitignore' } ]; const contentReplacements = [ { from: /[0-9a-f\-]{36}<\/ProjectGuid>/g, to: `${projectGuid}` }, diff --git a/templates/package-builder/src/yeoman/app/index.ts b/templates/package-builder/src/yeoman/app/index.ts index cb7bf15..30dd20b 100644 --- a/templates/package-builder/src/yeoman/app/index.ts +++ b/templates/package-builder/src/yeoman/app/index.ts @@ -104,18 +104,6 @@ class MyGenerator extends yeoman.Base { outputFn = path.join(path.dirname(fn), '.gitignore'); } - // Likewise, output template_nodemodules_placeholder.txt as node_modules/_placeholder.txt - // This is a workaround for https://github.com/aspnet/JavaScriptServices/issues/235. We need the new project - // to have a nonempty node_modules dir as far as *source control* is concerned. So, there's a gitignore - // rule that explicitly causes node_modules/_placeholder.txt to be tracked in source control. But how - // does that file get there in the first place? It's not enough for such a file to exist when the - // generator-aspnetcore-spa NPM package is published, because NPM doesn't allow any directories called - // node_modules to exist in the package. So we have a file with at a different location, and move it - // to node_modules as part of executing the template. - if (path.basename(fn) === 'template_nodemodules_placeholder.txt') { - outputFn = path.join(path.dirname(fn), 'node_modules', '_placeholder.txt'); - } - // Exclude test-specific files (unless the user has said they want tests) const isTestSpecificFile = testSpecificPaths.some(regex => regex.test(outputFn)); if (this._answers.tests || !isTestSpecificFile) {