Skip to content
This repository has been archived by the owner on Apr 8, 2020. It is now read-only.

Commit

Permalink
Remove template_nodemodules_placeholder.txt files - they are redundan…
Browse files Browse the repository at this point in the history
…t now that we no longer need to publish node_modules to production
  • Loading branch information
SteveSandersonMS committed Dec 15, 2016
1 parent 495c95d commit 6c16ba3
Show file tree
Hide file tree
Showing 8 changed files with 1 addition and 67 deletions.
11 changes: 0 additions & 11 deletions templates/Angular2Spa/template_nodemodules_placeholder.txt

This file was deleted.

11 changes: 0 additions & 11 deletions templates/AureliaSpa/template_nodemodules_placeholder.txt

This file was deleted.

7 changes: 0 additions & 7 deletions templates/KnockoutSpa/template_nodemodules_placeholder.txt

This file was deleted.

7 changes: 0 additions & 7 deletions templates/ReactReduxSpa/template_nodemodules_placeholder.txt

This file was deleted.

7 changes: 0 additions & 7 deletions templates/ReactSpa/template_nodemodules_placeholder.txt

This file was deleted.

This file was deleted.

6 changes: 1 addition & 5 deletions templates/package-builder/src/build/build.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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: /<ProjectGuid>[0-9a-f\-]{36}<\/ProjectGuid>/g, to: `<ProjectGuid>${projectGuid}</ProjectGuid>` },
Expand Down
12 changes: 0 additions & 12 deletions templates/package-builder/src/yeoman/app/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down

0 comments on commit 6c16ba3

Please sign in to comment.