Skip to content

Commit d30c79e

Browse files
authored
Use modern Node built-ins and npm packages (#811)
1 parent 690c77c commit d30c79e

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

43 files changed

+3010
-6006
lines changed

.github/workflows/main.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ jobs:
1212
fetch-depth: 0
1313
- uses: actions/setup-node@v4
1414
with:
15-
node-version: "20.x"
15+
node-version: "22.x"
1616
- uses: actions/setup-java@v4
1717
with:
1818
java-version: 21

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ This repository contains the WPILib VS Code extension.
66

77
## Build Dependencies
88

9-
- Node JS - Tested with Node 20.
9+
- Node JS - Tested with Node 22.
1010
- Java - Tested with Java 21
1111
- VS Code - For development/debugging.
1212
- TS Lint Extension

vscode-wpilib/.eslintrc.js

Lines changed: 0 additions & 12 deletions
This file was deleted.

vscode-wpilib/.gitignore

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,5 @@ resources/cpp
77
resources/java
88
resources/dist
99
resources/vendordeps
10-
1110
// These files will be generated from the i18n folder
1211
*nls.*.json

vscode-wpilib/eslint.config.js

Lines changed: 0 additions & 12 deletions
This file was deleted.

vscode-wpilib/eslint.config.mjs

Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
1+
import tseslint from 'typescript-eslint';
2+
import js from '@eslint/js';
3+
4+
import { defineConfig, globalIgnores } from 'eslint/config';
5+
export default defineConfig([
6+
globalIgnores([
7+
'media/',
8+
'out/',
9+
'resources/',
10+
'.eslintrc.js',
11+
'webpack.config.js',
12+
'gulpfile.js',
13+
'dist',
14+
]),
15+
{
16+
files: ['**/*.ts'],
17+
},
18+
{
19+
plugins: {
20+
'@typescript-eslint': tseslint.plugin,
21+
js,
22+
},
23+
24+
languageOptions: {
25+
parser: tseslint.parser,
26+
ecmaVersion: 2022,
27+
sourceType: 'module',
28+
},
29+
30+
rules: {
31+
'@typescript-eslint/naming-convention': [
32+
'warn',
33+
{
34+
selector: 'import',
35+
format: ['camelCase', 'PascalCase'],
36+
},
37+
],
38+
39+
'@typescript-eslint/no-explicit-any': 'off',
40+
'@typescript-eslint/no-namespace': 'off',
41+
'@typescript-eslint/no-require-imports': 'off',
42+
'@typescript-eslint/no-unused-vars': 'off',
43+
curly: 'warn',
44+
eqeqeq: 'warn',
45+
'no-throw-literal': 'warn',
46+
'no-case-declarations': 'off',
47+
'no-control-regex': 'off',
48+
'no-undef': 'off', // Enforced by tsc instead
49+
'no-unused-vars': 'off',
50+
semi: 'warn',
51+
},
52+
extends: [tseslint.configs.recommended, 'js/recommended'],
53+
},
54+
]);

vscode-wpilib/gulpfile.js

Lines changed: 0 additions & 70 deletions
This file was deleted.

vscode-wpilib/gulpfile.mjs

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
/*---------------------------------------------------------------------------------------------
2+
* Copyright (c) Microsoft Corporation. All rights reserved.
3+
* Licensed under the MIT License. See License.txt in the project root for license information.
4+
*--------------------------------------------------------------------------------------------*/
5+
6+
import { globSync } from 'fs';
7+
import { rm } from 'fs/promises';
8+
import gulp from 'gulp';
9+
import yaml from 'gulp-yaml';
10+
import nls from 'vscode-nls-dev';
11+
12+
// If all VS Code languages are supported you can use nls.coreLanguages
13+
const languages = [
14+
{
15+
id: 'zh-CN',
16+
},
17+
];
18+
19+
gulp.task('i18n-compile', async () =>
20+
gulp.src('./locale/**/*.yaml').pipe(yaml()).pipe(gulp.dest('./i18n/'))
21+
);
22+
23+
gulp.task('i18n-additional', async () =>
24+
gulp
25+
.src(['package.nls.json'])
26+
.pipe(nls.createAdditionalLanguageFiles(languages, 'i18n'))
27+
.pipe(gulp.dest('.'))
28+
);
29+
30+
gulp.task('clean', async () => {
31+
await rm('out/', { force: true, recursive: true });
32+
globSync(['package.nls.*.json', '*.vsix']).map(async (file) => await rm(file));
33+
});
34+
35+
gulp.task('build', gulp.series('clean', 'i18n-compile', 'i18n-additional'));
36+
37+
gulp.task('default', gulp.series('build'));

0 commit comments

Comments
 (0)