diff --git a/.gitignore b/.gitignore index 06cc11a..6df4b42 100644 --- a/.gitignore +++ b/.gitignore @@ -34,6 +34,13 @@ npm-debug.log # files with that name (https://github.com/npm/npm/issues/1862). So, each template instead has a template_gitignore # file which gets renamed after the files are copied. And so any files that need to be excluded in the source # repo have to be excluded here. -/templates/*/node_modules/ + +# Note that we need to exclude node_modules/** (i.e., subdirs, not the whole of node_modules) because we do need to +# include the _placeholder.txt files, and can't do that using gitignore exclusion because developers aren't promoted to +# commit files included that way. This is all a workaround for Workaround for https://github.com/aspnet/JavaScriptServices/issues/235 +/templates/*/node_modules/** /templates/*/wwwroot/dist/ .vscode/ + +# Workaround for https://github.com/aspnet/JavaScriptServices/issues/235 +!/templates/*/node_modules/_placeholder.txt diff --git a/templates/Angular2Spa/node_modules/_placeholder.txt b/templates/Angular2Spa/node_modules/_placeholder.txt new file mode 100644 index 0000000..09ae8c0 --- /dev/null +++ b/templates/Angular2Spa/node_modules/_placeholder.txt @@ -0,0 +1,7 @@ +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/Angular2Spa/template_gitignore b/templates/Angular2Spa/template_gitignore index d410b8b..2ee8e59 100644 --- a/templates/Angular2Spa/template_gitignore +++ b/templates/Angular2Spa/template_gitignore @@ -184,9 +184,12 @@ ClientBin/ *.dbproj.schemaview *.pfx *.publishsettings -node_modules/ orleans.codegen.cs +# Workaround for https://github.com/aspnet/JavaScriptServices/issues/235 +/node_modules/** +!/node_modules/_placeholder.txt + # RIA/Silverlight projects Generated_Code/ diff --git a/templates/KnockoutSpa/node_modules/_placeholder.txt b/templates/KnockoutSpa/node_modules/_placeholder.txt new file mode 100644 index 0000000..09ae8c0 --- /dev/null +++ b/templates/KnockoutSpa/node_modules/_placeholder.txt @@ -0,0 +1,7 @@ +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_gitignore b/templates/KnockoutSpa/template_gitignore index d410b8b..2ee8e59 100644 --- a/templates/KnockoutSpa/template_gitignore +++ b/templates/KnockoutSpa/template_gitignore @@ -184,9 +184,12 @@ ClientBin/ *.dbproj.schemaview *.pfx *.publishsettings -node_modules/ orleans.codegen.cs +# Workaround for https://github.com/aspnet/JavaScriptServices/issues/235 +/node_modules/** +!/node_modules/_placeholder.txt + # RIA/Silverlight projects Generated_Code/ diff --git a/templates/ReactReduxSpa/node_modules/_placeholder.txt b/templates/ReactReduxSpa/node_modules/_placeholder.txt new file mode 100644 index 0000000..09ae8c0 --- /dev/null +++ b/templates/ReactReduxSpa/node_modules/_placeholder.txt @@ -0,0 +1,7 @@ +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_gitignore b/templates/ReactReduxSpa/template_gitignore index d410b8b..2ee8e59 100644 --- a/templates/ReactReduxSpa/template_gitignore +++ b/templates/ReactReduxSpa/template_gitignore @@ -184,9 +184,12 @@ ClientBin/ *.dbproj.schemaview *.pfx *.publishsettings -node_modules/ orleans.codegen.cs +# Workaround for https://github.com/aspnet/JavaScriptServices/issues/235 +/node_modules/** +!/node_modules/_placeholder.txt + # RIA/Silverlight projects Generated_Code/ diff --git a/templates/ReactSpa/node_modules/_placeholder.txt b/templates/ReactSpa/node_modules/_placeholder.txt new file mode 100644 index 0000000..09ae8c0 --- /dev/null +++ b/templates/ReactSpa/node_modules/_placeholder.txt @@ -0,0 +1,7 @@ +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_gitignore b/templates/ReactSpa/template_gitignore index d410b8b..2ee8e59 100644 --- a/templates/ReactSpa/template_gitignore +++ b/templates/ReactSpa/template_gitignore @@ -184,9 +184,12 @@ ClientBin/ *.dbproj.schemaview *.pfx *.publishsettings -node_modules/ orleans.codegen.cs +# Workaround for https://github.com/aspnet/JavaScriptServices/issues/235 +/node_modules/** +!/node_modules/_placeholder.txt + # RIA/Silverlight projects Generated_Code/ diff --git a/templates/WebApplicationBasic/node_modules/_placeholder.txt b/templates/WebApplicationBasic/node_modules/_placeholder.txt new file mode 100644 index 0000000..09ae8c0 --- /dev/null +++ b/templates/WebApplicationBasic/node_modules/_placeholder.txt @@ -0,0 +1,7 @@ +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_gitignore b/templates/WebApplicationBasic/template_gitignore index d410b8b..2ee8e59 100644 --- a/templates/WebApplicationBasic/template_gitignore +++ b/templates/WebApplicationBasic/template_gitignore @@ -184,9 +184,12 @@ ClientBin/ *.dbproj.schemaview *.pfx *.publishsettings -node_modules/ orleans.codegen.cs +# Workaround for https://github.com/aspnet/JavaScriptServices/issues/235 +/node_modules/** +!/node_modules/_placeholder.txt + # RIA/Silverlight projects Generated_Code/