Skip to content

Commit

Permalink
Merge pull request #1077 from dotnet/bumpNodeJs
Browse files Browse the repository at this point in the history
Bump node.js version and switch from camel-case to change-case
  • Loading branch information
AArnott authored Aug 9, 2024
2 parents e7c9520 + a594d7d commit 81162b8
Show file tree
Hide file tree
Showing 7 changed files with 720 additions and 1,657 deletions.
2 changes: 1 addition & 1 deletion azure-pipelines/install-dependencies.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ steps:

- task: NodeTool@0
inputs:
versionSpec: 16.x
versionSpec: 20.x
displayName: ⚙️ Install Node.js

- task: NuGetAuthenticate@1
Expand Down
19 changes: 7 additions & 12 deletions src/nerdbank-gitversioning.npm/gulpfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ var ts = require('gulp-typescript');
var sourcemaps = require('gulp-sourcemaps');
var merge = require('merge2');
// var tslint = require('gulp-tslint');
var del = import('del');
var path = require('path');

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

return merge([
tsResult.dts.pipe(gulp.dest(outDir)),
tsResult.js
.pipe(sourcemaps.write('.'))
.pipe(gulp.dest(outDir))
]);
return merge(
tsResult.js.pipe(sourcemaps.write('.')).pipe(gulp.dest(outDir)),
tsResult.dts.pipe(gulp.dest(outDir)));
});

gulp.task('copyPackageContents', gulp.series('tsc', function () {
Expand Down Expand Up @@ -53,18 +49,17 @@ gulp.task('package', gulp.series('setPackageVersion', function () {
});
}));

gulp.task('clean', function () {
return del([
outDir
])
gulp.task('clean', async function () {
const del = await import('del');
await del.deleteAsync([outDir]);
});

gulp.task('default', gulp.series('package', function (done) {
done();
}));

gulp.task('watch', gulp.series('tsc', function () {
return gulp.watch('**/*.ts', ['tsc']);
return gulp.watch('**/*.ts', gulp.series('tsc'));
}));

gulp.task('test', gulp.series('tsc', async function () {
Expand Down
4 changes: 2 additions & 2 deletions src/nerdbank-gitversioning.npm/jsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@
// See https://go.microsoft.com/fwlink/?LinkId=759670
// for the documentation about the jsconfig.json format
"compilerOptions": {
"target": "es6",
"module": "commonjs",
"target": "ES2022",
"module": "ES2022",
"allowSyntheticDefaultImports": true
},
"exclude": [
Expand Down
10 changes: 4 additions & 6 deletions src/nerdbank-gitversioning.npm/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,21 +24,19 @@
"versioning"
],
"devDependencies": {
"@types/camel-case": "^1.2.1",
"@types/node": "^18.7.14",
"del": "^7.0.0",
"gulp": "^4.0.2",
"del": "^7.1.0",
"gulp": "^5.0.0",
"gulp-cli": "^3.0.0",
"gulp-sourcemaps": "3.0.0",
"gulp-typescript": "^5.0.1",
"gulp-util": "^3.0.8",
"merge2": "^1.4.1",
"path": "^0.12.7",
"source-map": "^0.7.4",
"typescript": "^5.0.4"
},
"dependencies": {
"camel-case": "^4.1.2"
},
"dependencies": {},
"scripts": {
"build": "gulp"
}
Expand Down
4 changes: 2 additions & 2 deletions src/nerdbank-gitversioning.npm/ts/index.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
'use strict';

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

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

return <IGitVersion>result;
Expand Down
6 changes: 3 additions & 3 deletions src/nerdbank-gitversioning.npm/tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
{
"compilerOptions": {
"target": "es6",
"target": "ES2022",
"declaration": true,
"module": "commonjs",
"moduleResolution": "node",
"module": "Node16",
"moduleResolution": "Node16",
"sourceMap": true,
"noImplicitAny": false,
"outDir": "js"
Expand Down
Loading

0 comments on commit 81162b8

Please sign in to comment.