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

Update dependencies #16

Merged
merged 2 commits into from
Oct 10, 2021
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
5 changes: 1 addition & 4 deletions .devcontainer/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,9 +1,6 @@
# See here for image contents: https://github.com/microsoft/vscode-dev-containers/tree/v0.162.0/containers/typescript-node/.devcontainer/base.Dockerfile

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

# Get dependencies that are used by nodecg-io if you do a development build
RUN apt update && apt install libusb-1.0-0-dev libasound2-dev libudev-dev -y

# Update npm to version 7
RUN npm i -g npm@7
2 changes: 1 addition & 1 deletion .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ jobs:
strategy:
matrix:
os: [ubuntu-latest, windows-latest]
node: [12, 15]
node: [12, 14, 16]

runs-on: ${{ matrix.os }}
steps:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/lint.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ jobs:

- uses: actions/setup-node@v2
with:
node-version: 15
node-version: 16

- name: Install dependencies
run: npm i
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ jobs:
- name: Setup Node.js
uses: actions/setup-node@v1
with:
node-version: 14
node-version: 16

- name: Install dependencies
run: npm ci
Expand Down
12,330 changes: 4,303 additions & 8,027 deletions package-lock.json

Large diffs are not rendered by default.

56 changes: 28 additions & 28 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -37,40 +37,40 @@
],
"homepage": "https://github.com/codeoverflow-org/nodecg-io-cli#readme",
"devDependencies": {
"@semantic-release/git": "^9.0.0",
"@types/glob": "^7.1.3",
"@semantic-release/git": "^10.0.0",
"@types/glob": "^7.1.4",
"@types/gunzip-maybe": "^1.4.0",
"@types/inquirer": "^7.3.1",
"@types/jest": "^26.0.22",
"@types/node": "^14.14.31",
"@types/semver": "^7.3.4",
"@types/tar-fs": "^2.0.0",
"@types/temp": "^0.9.0",
"@types/yargs": "^16.0.0",
"@typescript-eslint/eslint-plugin": "^4.17.0",
"@typescript-eslint/parser": "^4.17.0",
"eslint": "^7.21.0",
"husky": "^5.1.3",
"jest": "^26.6.3",
"memfs": "^3.2.2",
"prettier": "^2.2.1",
"pretty-quick": "^3.1.0",
"semantic-release": "^17.4.2",
"@types/inquirer": "^8.1.3",
"@types/jest": "^27.0.2",
"@types/node": "^16.10.3",
"@types/semver": "^7.3.8",
"@types/tar-fs": "^2.0.1",
"@types/temp": "^0.9.1",
"@types/yargs": "^17.0.3",
"@typescript-eslint/eslint-plugin": "^4.33.0",
"@typescript-eslint/parser": "^4.33.0",
"eslint": "^7.32.0",
"husky": "^7.0.2",
"jest": "^27.2.5",
"memfs": "^3.3.0",
"prettier": "^2.4.1",
"pretty-quick": "^3.1.1",
"semantic-release": "^18.0.0",
"temp": "^0.9.4",
"ts-jest": "^26.5.4",
"typescript": "^4.2.2"
"ts-jest": "^27.0.5",
"typescript": "^4.4.3"
},
"dependencies": {
"axios": "^0.21.1",
"chalk": "^4.1.0",
"axios": "^0.22.0",
"chalk": "^4.1.2",
"code-block-writer": "^10.1.1",
"find-up": "^5.0.0",
"glob": "^7.1.6",
"glob": "^7.2.0",
"gunzip-maybe": "^1.4.2",
"inquirer": "^8.0.0",
"isomorphic-git": "^1.8.1",
"semver": "^5.3.0",
"tar-fs": "^1.16.3",
"yargs": "^16.2.0"
"inquirer": "^8.2.0",
"isomorphic-git": "^1.10.1",
"semver": "^7.3.5",
"tar-fs": "^2.1.1",
"yargs": "^17.2.1"
}
}
15 changes: 9 additions & 6 deletions src/index.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import * as yargs from "yargs";
import yargs from "yargs";
import { installModule } from "./install";
import { uninstallModule } from "./uninstall";
import { version } from "../package.json";
Expand All @@ -7,7 +7,7 @@ import { generateModule } from "./generate";

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

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

ensureNode12();
if (!argv["disable-updates"]) {
checkForCliUpdate();
}
(async () => {
const opts = await args.argv;
if (!opts["disable-updates"]) {
checkForCliUpdate();
}
})();
2 changes: 1 addition & 1 deletion src/install/development.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import chalk = require("chalk");
import * as chalk from "chalk";
import * as git from "isomorphic-git";
import * as fs from "fs";
import * as http from "isomorphic-git/http/node";
Expand Down
8 changes: 5 additions & 3 deletions src/utils/npm.ts
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
import axios, { AxiosRequestConfig } from "axios";
import axios, { AxiosRequestConfig, AxiosResponse } from "axios";
import * as fs from "fs";
import * as path from "path";
import { executeCommand, removeDirectory } from "./fs";
import { exec } from "child_process";
import { maxSatisfying, satisfies, SemVer } from "semver";
import gunzip = require("gunzip-maybe");
import tar = require("tar-fs");
import * as tar from "tar-fs";

const npmRegistryEndpoint = "https://registry.npmjs.org/";
const nodeModulesDir = "node_modules";
Expand Down Expand Up @@ -50,7 +50,9 @@ export function isPackageEquals(a: NpmPackage, b: NpmPackage): boolean {
* @returns the versions of the package
*/
export async function getPackageVersions(packageName: string): Promise<SemVer[]> {
const response = await axios(npmRegistryEndpoint + packageName, axiosNpmMetadataConfig);
const response = (await axios(npmRegistryEndpoint + packageName, axiosNpmMetadataConfig)) as AxiosResponse<{
versions?: Record<string, never>;
}>;
if (response.data.versions) {
return Object.keys(response.data.versions).map((versionString) => new SemVer(versionString));
} else {
Expand Down
2 changes: 1 addition & 1 deletion test/utils/npm/registryVersions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ const fakeCoreNpmResponse: AxiosResponse<typeof fakeCoreNpmResponseData> = {
status: 200,
statusText: "OK",
data: fakeCoreNpmResponseData,
headers: undefined,
headers: {},
config: {},
};

Expand Down