1- //*********************************************************//
2- // Copyright (c) Microsoft. All rights reserved.
3- //
4- // Apache 2.0 License
5- //
6- // You may obtain a copy of the License at
7- // http://www.apache.org/licenses/LICENSE-2.0
8- //
9- // Unless required by applicable law or agreed to in writing, software
10- // distributed under the License is distributed on an "AS IS" BASIS,
11- // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
12- // implied. See the License for the specific language governing
13- // permissions and limitations under the License.
14- //
15- //*********************************************************//
1+ //*********************************************************//
2+ // Copyright (c) Microsoft. All rights reserved.
3+ //
4+ // Apache 2.0 License
5+ //
6+ // You may obtain a copy of the License at
7+ // http://www.apache.org/licenses/LICENSE-2.0
8+ //
9+ // Unless required by applicable law or agreed to in writing, software
10+ // distributed under the License is distributed on an "AS IS" BASIS,
11+ // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
12+ // implied. See the License for the specific language governing
13+ // permissions and limitations under the License.
14+ //
15+ //*********************************************************//
16+
17+ using System ;
18+ using System . Collections . Generic ;
19+ using System . Text . RegularExpressions ;
20+ using EnvDTE ;
21+ using Microsoft . VisualStudio . TemplateWizard ;
1622
17- using System ;
18- using System . Collections . Generic ;
19- using System . Text . RegularExpressions ;
20- using EnvDTE ;
21- using Microsoft . VisualStudio . TemplateWizard ;
22-
23- namespace Microsoft . NodejsTools . ProjectWizard {
24- class NodejsPackageParametersExtension : IWizard {
25- public void RunStarted ( object automationObject , Dictionary < string , string > replacementsDictionary , WizardRunKind runKind , object [ ] customParams ) {
26- var projectName = replacementsDictionary [ "$projectname$" ] ;
27- replacementsDictionary . Add ( "$npmsafeprojectname$" , NormalizeNpmPackageName ( projectName ) ) ;
28- }
29-
30- public void ProjectFinishedGenerating ( EnvDTE . Project project ) {
31- return ;
32- }
33-
34- public void ProjectItemFinishedGenerating ( ProjectItem projectItem ) {
35- return ;
36- }
37-
38- public bool ShouldAddProjectItem ( string filePath ) {
39- return true ;
40- }
41-
42- public void BeforeOpeningFile ( ProjectItem projectItem ) {
43- return ;
44- }
45-
46- public void RunFinished ( ) {
47- return ;
23+ namespace Microsoft . NodejsTools . ProjectWizard {
24+ class NodejsPackageParametersExtension : IWizard {
25+ public void RunStarted ( object automationObject , Dictionary < string , string > replacementsDictionary , WizardRunKind runKind , object [ ] customParams ) {
26+ var projectName = replacementsDictionary [ "$projectname$" ] ;
27+ replacementsDictionary . Add ( "$npmsafeprojectname$" , NormalizeNpmPackageName ( projectName ) ) ;
28+ }
29+
30+ public void ProjectFinishedGenerating ( EnvDTE . Project project ) {
31+ return ;
32+ }
33+
34+ public void ProjectItemFinishedGenerating ( ProjectItem projectItem ) {
35+ return ;
36+ }
37+
38+ public bool ShouldAddProjectItem ( string filePath ) {
39+ return true ;
40+ }
41+
42+ public void BeforeOpeningFile ( ProjectItem projectItem ) {
43+ return ;
44+ }
45+
46+ public void RunFinished ( ) {
47+ return ;
4848 }
4949
5050 private const int NpmPackageNameMaxLength = 214 ;
@@ -64,6 +64,6 @@ private static string NormalizeNpmPackageName(string projectName) {
6464 npmProjectNameTransform = Regex . Replace ( npmProjectNameTransform , "([a-z0-9])([A-Z])" , "$1-$2" ) . ToLowerInvariant ( ) ;
6565
6666 return npmProjectNameTransform . Substring ( 0 , Math . Min ( npmProjectNameTransform . Length , NpmPackageNameMaxLength ) ) ;
67- }
68- }
69- }
67+ }
68+ }
69+ }
0 commit comments