Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bump node.js version and switch from camel-case to change-case #1077

Merged
merged 2 commits into from
Aug 9, 2024
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
8 changes: 4 additions & 4 deletions src/nerdbank-gitversioning.npm/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,20 +24,20 @@
"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"
"change-case": "5.4.4"
},
"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 @@ -47,8 +46,9 @@ export async function getVersion(projectDirectory?: string, dotnetCommand?: stri

var directResult = JSON.parse(versionText.stdout);
var result = {};
const { camelCase } = await import('change-case');
for (var field in directResult) {
result[camelCase.camelCase(field)] = directResult[field];
result[camelCase(field)] = 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
Loading