Skip to content

Commit 81162b8

Browse files
authored
Merge pull request #1077 from dotnet/bumpNodeJs
Bump node.js version and switch from camel-case to change-case
2 parents e7c9520 + a594d7d commit 81162b8

File tree

7 files changed

+720
-1657
lines changed

7 files changed

+720
-1657
lines changed

azure-pipelines/install-dependencies.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ steps:
55

66
- task: NodeTool@0
77
inputs:
8-
versionSpec: 16.x
8+
versionSpec: 20.x
99
displayName: ⚙️ Install Node.js
1010

1111
- task: NuGetAuthenticate@1

src/nerdbank-gitversioning.npm/gulpfile.js

+7-12
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@ var ts = require('gulp-typescript');
55
var sourcemaps = require('gulp-sourcemaps');
66
var merge = require('merge2');
77
// var tslint = require('gulp-tslint');
8-
var del = import('del');
98
var path = require('path');
109

1110
const outDir = 'out';
@@ -20,12 +19,9 @@ gulp.task('tsc', function () {
2019
.pipe(sourcemaps.init())
2120
.pipe(tsProject());
2221

23-
return merge([
24-
tsResult.dts.pipe(gulp.dest(outDir)),
25-
tsResult.js
26-
.pipe(sourcemaps.write('.'))
27-
.pipe(gulp.dest(outDir))
28-
]);
22+
return merge(
23+
tsResult.js.pipe(sourcemaps.write('.')).pipe(gulp.dest(outDir)),
24+
tsResult.dts.pipe(gulp.dest(outDir)));
2925
});
3026

3127
gulp.task('copyPackageContents', gulp.series('tsc', function () {
@@ -53,18 +49,17 @@ gulp.task('package', gulp.series('setPackageVersion', function () {
5349
});
5450
}));
5551

56-
gulp.task('clean', function () {
57-
return del([
58-
outDir
59-
])
52+
gulp.task('clean', async function () {
53+
const del = await import('del');
54+
await del.deleteAsync([outDir]);
6055
});
6156

6257
gulp.task('default', gulp.series('package', function (done) {
6358
done();
6459
}));
6560

6661
gulp.task('watch', gulp.series('tsc', function () {
67-
return gulp.watch('**/*.ts', ['tsc']);
62+
return gulp.watch('**/*.ts', gulp.series('tsc'));
6863
}));
6964

7065
gulp.task('test', gulp.series('tsc', async function () {

src/nerdbank-gitversioning.npm/jsconfig.json

+2-2
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@
22
// See https://go.microsoft.com/fwlink/?LinkId=759670
33
// for the documentation about the jsconfig.json format
44
"compilerOptions": {
5-
"target": "es6",
6-
"module": "commonjs",
5+
"target": "ES2022",
6+
"module": "ES2022",
77
"allowSyntheticDefaultImports": true
88
},
99
"exclude": [

src/nerdbank-gitversioning.npm/package.json

+4-6
Original file line numberDiff line numberDiff line change
@@ -24,21 +24,19 @@
2424
"versioning"
2525
],
2626
"devDependencies": {
27-
"@types/camel-case": "^1.2.1",
2827
"@types/node": "^18.7.14",
29-
"del": "^7.0.0",
30-
"gulp": "^4.0.2",
28+
"del": "^7.1.0",
29+
"gulp": "^5.0.0",
3130
"gulp-cli": "^3.0.0",
3231
"gulp-sourcemaps": "3.0.0",
3332
"gulp-typescript": "^5.0.1",
3433
"gulp-util": "^3.0.8",
3534
"merge2": "^1.4.1",
3635
"path": "^0.12.7",
36+
"source-map": "^0.7.4",
3737
"typescript": "^5.0.4"
3838
},
39-
"dependencies": {
40-
"camel-case": "^4.1.2"
41-
},
39+
"dependencies": {},
4240
"scripts": {
4341
"build": "gulp"
4442
}

src/nerdbank-gitversioning.npm/ts/index.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
'use strict';
22

3-
import * as camelCase from 'camel-case';
43
import { execAsync } from './asyncprocess';
54
import { getNbgvCommand } from './core';
65

@@ -48,7 +47,8 @@ export async function getVersion(projectDirectory?: string, dotnetCommand?: stri
4847
var directResult = JSON.parse(versionText.stdout);
4948
var result = {};
5049
for (var field in directResult) {
51-
result[camelCase.camelCase(field)] = directResult[field];
50+
const camelCaseFieldName = field.charAt(0).toLowerCase() + field.slice(1);
51+
result[camelCaseFieldName] = directResult[field];
5252
}
5353

5454
return <IGitVersion>result;

src/nerdbank-gitversioning.npm/tsconfig.json

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
{
22
"compilerOptions": {
3-
"target": "es6",
3+
"target": "ES2022",
44
"declaration": true,
5-
"module": "commonjs",
6-
"moduleResolution": "node",
5+
"module": "Node16",
6+
"moduleResolution": "Node16",
77
"sourceMap": true,
88
"noImplicitAny": false,
99
"outDir": "js"

0 commit comments

Comments
 (0)