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

Update dependencies and fix Yarn 2 enable bug #140

Merged
merged 3 commits into from
Apr 10, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
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
3 changes: 3 additions & 0 deletions .github/workflows/package.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,9 @@ jobs:
steps:
- uses: actions/checkout@v3

- name: Enable Corepack
run: corepack enable

- name: Enable Yarn 2
run: yarn set version stable

Expand Down
3 changes: 3 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,9 @@ jobs:
steps:
- uses: actions/checkout@v3

- name: Enable Corepack
run: corepack enable

- name: Enable Yarn 2
run: yarn set version stable

Expand Down
37 changes: 19 additions & 18 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -340,26 +340,27 @@
"test": "yarn run pretest && node ./out/test/runTest.js"
},
"devDependencies": {
"@types/glob": "^7.1.3",
"@types/mocha": "^8.0.4",
"@types/node": "^12.11.7",
"@types/shell-quote": "^1.7.1",
"@types/glob": "^8.1.0",
"@types/mocha": "^10.0.6",
"@types/node": "^16.11.7",
"@types/shell-quote": "^1.7.5",
"@types/vscode": "1.53.0",
"@typescript-eslint/eslint-plugin": "^5.55.0",
"@typescript-eslint/parser": "^5.55.0",
"@vscode/test-electron": "^1.5.0",
"@vscode/vsce": "^2.18.0",
"eslint": "^7.19.0",
"glob": "^7.1.6",
"mocha": "^8.2.1",
"sinon": "^13.0.1",
"ts-loader": "^8.0.14",
"typescript": "^4.1.3",
"webpack": "^5.19.0",
"webpack-cli": "^4.4.0"
"@typescript-eslint/eslint-plugin": "^7.1.0",
"@typescript-eslint/parser": "^7.1.0",
"@vscode/test-electron": "^2.3.9",
"@vscode/vsce": "^2.24.0",
"eslint": "^8.57.0",
"glob": "^8.1.0",
"mocha": "^10.3.0",
"sinon": "^17.0.1",
"ts-loader": "^9.5.1",
"typescript": "^5.3.3",
"webpack": "^5.90.3",
"webpack-cli": "^5.1.4"
},
"dependencies": {
"shell-quote": "^1.7.3"
"shell-quote": "^1.8.1",
"tslib": "^2.6.2"
},
"packageManager": "yarn@3.4.1"
"packageManager": "[email protected].0"
}
6 changes: 3 additions & 3 deletions src/backend/executor/process.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import * as child_process from 'child_process';
import * as childProcess from 'child_process';
import * as os from 'os';
import { quote } from 'shell-quote';
import { Disposable, Event, EventEmitter, ExtensionContext, workspace } from 'vscode';
Expand Down Expand Up @@ -56,7 +56,7 @@ export class ScheduledProcess implements Disposable {
public readonly executable: string;
public readonly commandArgs: string[];

private activeProcess?: child_process.ChildProcess;
private activeProcess?: childProcess.ChildProcess;

/** Contains parameters for the executor. All members are defined. */
public readonly processParameters: ProcessParameters;
Expand Down Expand Up @@ -135,7 +135,7 @@ export class ScheduledProcess implements Disposable {

this._processStderr.fire(`>>> Starting process '${commonName}'\n`);
this._processStderr.fire(`> ${this.commandLine}\n`);
this.activeProcess = child_process.spawn(
this.activeProcess = childProcess.spawn(
this.executable,
this.commandArgs,
{ cwd: workspace.workspaceFolders[0].uri.fsPath }
Expand Down
6 changes: 3 additions & 3 deletions src/test/parser/metadata.unit.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import * as fs from 'fs';
import * as path from 'path';
import { promisify } from 'util';

import { parseMetadata } from '../../backend/parser';
import { MetadataParseError, parseMetadata } from '../../backend/parser';
import { STATIC_FILE_PATH } from '../utils/constants';

suite('Unit Test: Metadata Parser', () => {
Expand Down Expand Up @@ -42,7 +42,7 @@ suite('Unit Test: Metadata Parser', () => {
const testAndExpectCode = async (filename: string, code: string) => {
await assert.rejects(
() => parseMetadata(path.join(staticPath, filename)),
(err) => {
(err: MetadataParseError) => {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Shouldn't you use the MetadataParseError in the next test case too?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This change was just to silence a TS type-error because it couldn't deduce the error type of parseMetadata.
Might as well use the type on the next case as well, fixed.

assert.strictEqual(err.code, code, 'wrong error code');
return true;
},
Expand All @@ -52,7 +52,7 @@ suite('Unit Test: Metadata Parser', () => {
const testAndExpectSyntaxError = async (filename: string) => {
await assert.rejects(
() => parseMetadata(path.join(staticPath, filename)),
(err) => {
(err: MetadataParseError) => {
assert.ok(err instanceof SyntaxError, 'wrong error type');
return true;
},
Expand Down
2 changes: 1 addition & 1 deletion src/test/suite/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ export function run(): Promise<void> {
const testsRoot = path.resolve(__dirname, '..');

return new Promise((c, e) => {
glob('**/**.test.js', { cwd: testsRoot }, (err, files) => {
glob.glob('**/**.test.js', { cwd: testsRoot }, (err: any, files: string[]) => {
if (err) {
return e(err);
}
Expand Down
Loading
Loading