Skip to content
This repository was archived by the owner on Apr 13, 2025. It is now read-only.

Commit 7ef4628

Browse files
authored
Update dependencies (#16)
* Update dependencies * Remove node 15 and add node 16 from ci
1 parent b11aa82 commit 7ef4628

File tree

10 files changed

+4351
-8073
lines changed

10 files changed

+4351
-8073
lines changed

.devcontainer/Dockerfile

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,6 @@
11
# See here for image contents: https://github.com/microsoft/vscode-dev-containers/tree/v0.162.0/containers/typescript-node/.devcontainer/base.Dockerfile
22

3-
FROM mcr.microsoft.com/vscode/devcontainers/typescript-node:0-14
3+
FROM mcr.microsoft.com/vscode/devcontainers/typescript-node:0-16
44

55
# Get dependencies that are used by nodecg-io if you do a development build
66
RUN apt update && apt install libusb-1.0-0-dev libasound2-dev libudev-dev -y
7-
8-
# Update npm to version 7
9-
RUN npm i -g npm@7

.github/workflows/ci.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ jobs:
66
strategy:
77
matrix:
88
os: [ubuntu-latest, windows-latest]
9-
node: [12, 15]
9+
node: [12, 14, 16]
1010

1111
runs-on: ${{ matrix.os }}
1212
steps:

.github/workflows/lint.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ jobs:
99

1010
- uses: actions/setup-node@v2
1111
with:
12-
node-version: 15
12+
node-version: 16
1313

1414
- name: Install dependencies
1515
run: npm i

.github/workflows/release.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ jobs:
1515
- name: Setup Node.js
1616
uses: actions/setup-node@v1
1717
with:
18-
node-version: 14
18+
node-version: 16
1919

2020
- name: Install dependencies
2121
run: npm ci

package-lock.json

Lines changed: 4303 additions & 8027 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 28 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -37,40 +37,40 @@
3737
],
3838
"homepage": "https://github.com/codeoverflow-org/nodecg-io-cli#readme",
3939
"devDependencies": {
40-
"@semantic-release/git": "^9.0.0",
41-
"@types/glob": "^7.1.3",
40+
"@semantic-release/git": "^10.0.0",
41+
"@types/glob": "^7.1.4",
4242
"@types/gunzip-maybe": "^1.4.0",
43-
"@types/inquirer": "^7.3.1",
44-
"@types/jest": "^26.0.22",
45-
"@types/node": "^14.14.31",
46-
"@types/semver": "^7.3.4",
47-
"@types/tar-fs": "^2.0.0",
48-
"@types/temp": "^0.9.0",
49-
"@types/yargs": "^16.0.0",
50-
"@typescript-eslint/eslint-plugin": "^4.17.0",
51-
"@typescript-eslint/parser": "^4.17.0",
52-
"eslint": "^7.21.0",
53-
"husky": "^5.1.3",
54-
"jest": "^26.6.3",
55-
"memfs": "^3.2.2",
56-
"prettier": "^2.2.1",
57-
"pretty-quick": "^3.1.0",
58-
"semantic-release": "^17.4.2",
43+
"@types/inquirer": "^8.1.3",
44+
"@types/jest": "^27.0.2",
45+
"@types/node": "^16.10.3",
46+
"@types/semver": "^7.3.8",
47+
"@types/tar-fs": "^2.0.1",
48+
"@types/temp": "^0.9.1",
49+
"@types/yargs": "^17.0.3",
50+
"@typescript-eslint/eslint-plugin": "^4.33.0",
51+
"@typescript-eslint/parser": "^4.33.0",
52+
"eslint": "^7.32.0",
53+
"husky": "^7.0.2",
54+
"jest": "^27.2.5",
55+
"memfs": "^3.3.0",
56+
"prettier": "^2.4.1",
57+
"pretty-quick": "^3.1.1",
58+
"semantic-release": "^18.0.0",
5959
"temp": "^0.9.4",
60-
"ts-jest": "^26.5.4",
61-
"typescript": "^4.2.2"
60+
"ts-jest": "^27.0.5",
61+
"typescript": "^4.4.3"
6262
},
6363
"dependencies": {
64-
"axios": "^0.21.1",
65-
"chalk": "^4.1.0",
64+
"axios": "^0.22.0",
65+
"chalk": "^4.1.2",
6666
"code-block-writer": "^10.1.1",
6767
"find-up": "^5.0.0",
68-
"glob": "^7.1.6",
68+
"glob": "^7.2.0",
6969
"gunzip-maybe": "^1.4.2",
70-
"inquirer": "^8.0.0",
71-
"isomorphic-git": "^1.8.1",
72-
"semver": "^5.3.0",
73-
"tar-fs": "^1.16.3",
74-
"yargs": "^16.2.0"
70+
"inquirer": "^8.2.0",
71+
"isomorphic-git": "^1.10.1",
72+
"semver": "^7.3.5",
73+
"tar-fs": "^2.1.1",
74+
"yargs": "^17.2.1"
7575
}
7676
}

src/index.ts

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import * as yargs from "yargs";
1+
import yargs from "yargs";
22
import { installModule } from "./install";
33
import { uninstallModule } from "./uninstall";
44
import { version } from "../package.json";
@@ -7,7 +7,7 @@ import { generateModule } from "./generate";
77

88
// This file gets imported by the index.js file of the repository root.
99

10-
const argv = yargs(process.argv.slice(2))
10+
const args = yargs(process.argv.slice(2))
1111
.scriptName("nodecg-io")
1212
.usage("$0 <cmd> [args]")
1313
.version(version)
@@ -16,9 +16,12 @@ const argv = yargs(process.argv.slice(2))
1616
.command(generateModule)
1717
.option("disable-updates", { type: "boolean", description: "Disables check for nodecg-io-cli updates" })
1818
.strict()
19-
.demandCommand().argv;
19+
.demandCommand();
2020

2121
ensureNode12();
22-
if (!argv["disable-updates"]) {
23-
checkForCliUpdate();
24-
}
22+
(async () => {
23+
const opts = await args.argv;
24+
if (!opts["disable-updates"]) {
25+
checkForCliUpdate();
26+
}
27+
})();

src/install/development.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import chalk = require("chalk");
1+
import * as chalk from "chalk";
22
import * as git from "isomorphic-git";
33
import * as fs from "fs";
44
import * as http from "isomorphic-git/http/node";

src/utils/npm.ts

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
1-
import axios, { AxiosRequestConfig } from "axios";
1+
import axios, { AxiosRequestConfig, AxiosResponse } from "axios";
22
import * as fs from "fs";
33
import * as path from "path";
44
import { executeCommand, removeDirectory } from "./fs";
55
import { exec } from "child_process";
66
import { maxSatisfying, satisfies, SemVer } from "semver";
77
import gunzip = require("gunzip-maybe");
8-
import tar = require("tar-fs");
8+
import * as tar from "tar-fs";
99

1010
const npmRegistryEndpoint = "https://registry.npmjs.org/";
1111
const nodeModulesDir = "node_modules";
@@ -50,7 +50,9 @@ export function isPackageEquals(a: NpmPackage, b: NpmPackage): boolean {
5050
* @returns the versions of the package
5151
*/
5252
export async function getPackageVersions(packageName: string): Promise<SemVer[]> {
53-
const response = await axios(npmRegistryEndpoint + packageName, axiosNpmMetadataConfig);
53+
const response = (await axios(npmRegistryEndpoint + packageName, axiosNpmMetadataConfig)) as AxiosResponse<{
54+
versions?: Record<string, never>;
55+
}>;
5456
if (response.data.versions) {
5557
return Object.keys(response.data.versions).map((versionString) => new SemVer(versionString));
5658
} else {

test/utils/npm/registryVersions.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ const fakeCoreNpmResponse: AxiosResponse<typeof fakeCoreNpmResponseData> = {
2929
status: 200,
3030
statusText: "OK",
3131
data: fakeCoreNpmResponseData,
32-
headers: undefined,
32+
headers: {},
3333
config: {},
3434
};
3535

0 commit comments

Comments
 (0)