0
Fork 0
mirror of https://github.com/verdaccio/verdaccio.git synced 2024-12-16 21:56:25 -05:00

deps: update typescript 4 (#2000)

This commit is contained in:
Juan Picado 2020-11-14 16:52:37 +01:00
parent b3e8438f64
commit 1153a8d92f
17 changed files with 1138 additions and 740 deletions

View file

@ -14,50 +14,50 @@
"url": "https://opencollective.com/verdaccio"
},
"devDependencies": {
"@babel/cli": "7.11.6",
"@babel/core": "7.11.6",
"@babel/node": "7.10.5",
"@babel/plugin-proposal-class-properties": "7.10.4",
"@babel/plugin-proposal-decorators": "7.10.5",
"@babel/plugin-proposal-export-namespace-from": "7.10.4",
"@babel/plugin-proposal-function-sent": "7.10.4",
"@babel/plugin-proposal-json-strings": "7.10.4",
"@babel/plugin-proposal-nullish-coalescing-operator": "7.10.4",
"@babel/plugin-proposal-numeric-separator": "7.10.4",
"@babel/plugin-proposal-object-rest-spread": "7.11.0",
"@babel/plugin-proposal-optional-chaining": "7.11.0",
"@babel/plugin-proposal-throw-expressions": "7.10.4",
"@babel/cli": "7.12.1",
"@babel/core": "7.12.3",
"@babel/node": "7.12.6",
"@babel/plugin-proposal-class-properties": "7.12.1",
"@babel/plugin-proposal-decorators": "7.12.1",
"@babel/plugin-proposal-export-namespace-from": "7.12.1",
"@babel/plugin-proposal-function-sent": "7.12.1",
"@babel/plugin-proposal-json-strings": "7.12.1",
"@babel/plugin-proposal-nullish-coalescing-operator": "7.12.1",
"@babel/plugin-proposal-numeric-separator": "7.12.5",
"@babel/plugin-proposal-object-rest-spread": "7.12.1",
"@babel/plugin-proposal-optional-chaining": "7.12.1",
"@babel/plugin-proposal-throw-expressions": "7.12.1",
"@babel/plugin-syntax-dynamic-import": "7.8.3",
"@babel/plugin-syntax-import-meta": "7.10.4",
"@babel/plugin-transform-async-to-generator": "7.10.4",
"@babel/plugin-transform-classes": "7.10.4",
"@babel/plugin-transform-runtime": "7.11.5",
"@babel/polyfill": "7.11.5",
"@babel/preset-env": "7.11.5",
"@babel/preset-react": "7.10.4",
"@babel/preset-typescript": "7.10.4",
"@babel/register": "7.11.5",
"@babel/runtime": "7.11.2",
"@changesets/changelog-github": "0.1.1",
"@changesets/cli": "2.10.1",
"@babel/plugin-transform-async-to-generator": "7.12.1",
"@babel/plugin-transform-classes": "7.12.1",
"@babel/plugin-transform-runtime": "7.12.1",
"@babel/polyfill": "7.12.1",
"@babel/preset-env": "7.12.1",
"@babel/preset-react": "7.12.5",
"@babel/preset-typescript": "7.12.1",
"@babel/register": "7.12.1",
"@babel/runtime": "7.12.5",
"@changesets/changelog-github": "0.2.7",
"@changesets/cli": "2.11.2",
"@commitlint/cli": "8.3.5",
"@commitlint/config-conventional": "8.2.0",
"@octokit/rest": "17.0.0",
"@types/async": "3.2.3",
"@types/express": "4.17.6",
"@types/http-errors": "1.6.3",
"@types/jest": "26.0.1",
"@types/lodash": "4.14.156",
"@types/jest": "^26.0.15",
"@types/lodash": "4.14.165",
"@types/mime": "2.0.2",
"@types/minimatch": "3.0.3",
"@types/node": "14.0.14",
"@types/node": "^14.14.7",
"@types/request": "2.48.3",
"@types/semver": "7.2.0",
"@types/supertest": "2.0.9",
"@typescript-eslint/eslint-plugin": "3.10.1",
"@typescript-eslint/parser": "3.10.1",
"@typescript-eslint/eslint-plugin": "4.7.0",
"@typescript-eslint/parser": "4.7.0",
"@verdaccio/types": "workspace:*",
"@verdaccio/ui-theme": "latest",
"@verdaccio/ui-theme": "^1.14.0",
"babel-core": "7.0.0-bridge.0",
"babel-eslint": "10.1.0",
"babel-jest": "26.1.0",
@ -95,7 +95,7 @@
"standard-version": "8.0.0",
"supertest": "4.0.2",
"ts-node": "^9.0.0",
"typescript": "^3.9.7",
"typescript": "^4.0.5",
"verdaccio": "workspace:*",
"verdaccio-audit": "workspace:*",
"verdaccio-auth-memory": "workspace:*",

View file

@ -1,3 +1,4 @@
/* eslint-disable no-undef */
import fs from 'fs';
import { Callback } from '@verdaccio/types';

View file

@ -1,3 +1,5 @@
/* eslint-disable no-undef */
import fs from 'fs';
import path from 'path';
import buildDebug from 'debug';

View file

@ -9,7 +9,6 @@ declare module '@verdaccio/types' {
type Callback = Function;
// FIXME: err should be something flexible enough for any implementation
type CallbackAction = (err: any | null) => void;
type CallbackError = (err: NodeJS.ErrnoException) => void;
interface Author {
name: string;
email?: string;

View file

@ -1,3 +1,5 @@
/* eslint-disable no-undef */
import Handlebars from 'handlebars';
import buildDebug from 'debug';

View file

@ -238,7 +238,7 @@ export function final(
// and should just close socket
if (err.message.match(/set headers after they are sent/)) {
if (_.isNil(res.socket) === false) {
res.socket.destroy();
res.socket?.destroy();
}
return;
}

View file

@ -8,3 +8,4 @@ export * from './server';
export * from './config';
export * from './mock';
export * from './mock-api';
export * from './types';

View file

@ -5,8 +5,7 @@ import * as fsExtra from 'fs-extra';
import { DOMAIN_SERVERS } from './constants';
import VerdaccioProcess from './server_process';
import { VerdaccioConfig } from './verdaccio-server';
import Server from './server';
import { IServerBridge } from './types';
import Server, { IServerBridge } from './server';
/**
* Fork a Verdaccio process with a custom configuration.

View file

@ -2,8 +2,7 @@ import assert from 'assert';
import _ from 'lodash';
import request from 'request';
import buildDebug from 'debug';
import { IRequestPromise } from './types';
import { IRequestPromise } from './server';
const requestData = Symbol('smart_request_data');

View file

@ -4,9 +4,8 @@ import buildDebug from 'debug';
import { API_MESSAGE, HEADERS, HTTP_STATUS, TOKEN_BASIC } from '@verdaccio/dev-commons';
import { buildToken } from '@verdaccio/utils';
import smartRequest from './request';
import smartRequest, { PromiseAssert } from './request';
import { IServerBridge } from './types';
import { CREDENTIALS } from './constants';
import getPackage from './fixtures/package';
@ -16,6 +15,44 @@ const buildAuthHeader = (user, pass): string => {
const debug = buildDebug('verdaccio:mock:server');
export interface IRequestPromise {
status(reason: any): any;
body_ok(reason: any): any;
body_error(reason: any): any;
request(reason: any): any;
response(reason: any): any;
send(reason: any): any;
}
export interface IServerBridge {
url: string;
userAgent: string;
authstr: string;
request(options: any): typeof PromiseAssert;
auth(name: string, password: string): IRequestPromise;
auth(name: string, password: string): IRequestPromise;
logout(token: string): Promise<any>;
getPackage(name: string): Promise<any>;
putPackage(name: string, data: any): Promise<any>;
putVersion(name: string, version: string, data: any): Promise<any>;
getTarball(name: string, filename: string): Promise<any>;
putTarball(name: string, filename: string, data: any): Promise<any>;
removeTarball(name: string): Promise<any>;
removeSingleTarball(name: string, filename: string): Promise<any>;
addTag(name: string, tag: string, version: string): Promise<any>;
putTarballIncomplete(
name: string,
filename: string,
data: any,
size: number,
cb: Function
): Promise<any>;
addPackage(name: string): Promise<any>;
whoami(): Promise<any>;
ping(): Promise<any>;
debug(): IRequestPromise;
}
export default class Server implements IServerBridge {
public url: string;
public userAgent: string;

View file

@ -4,7 +4,8 @@ import { fork } from 'child_process';
import { HTTP_STATUS } from '@verdaccio/dev-commons';
import { CREDENTIALS } from './constants';
import { IVerdaccioConfig, IServerBridge, IServerProcess } from './types';
import { IVerdaccioConfig, IServerProcess } from './types';
import { IServerBridge } from './server';
const defaultBinPath = require.resolve('verdaccio/bin/verdaccio');
export default class VerdaccioProcess implements IServerProcess {

View file

@ -5,15 +5,6 @@ export interface IVerdaccioConfig {
port: number | string;
}
export interface IRequestPromise {
status(reason: any): any;
body_ok(reason: any): any;
body_error(reason: any): any;
request(reason: any): any;
response(reason: any): any;
send(reason: any): any;
}
export interface IServerProcess {
init(binPath: string): Promise<any>;
stop(): void;
@ -23,32 +14,3 @@ export interface IServerProcess {
declare class PromiseAssert<IRequestPromise> extends Promise<any> {
public constructor(options: any);
}
export interface IServerBridge {
url: string;
userAgent: string;
authstr: string;
request(options: any): typeof PromiseAssert;
auth(name: string, password: string): IRequestPromise;
auth(name: string, password: string): IRequestPromise;
logout(token: string): Promise<any>;
getPackage(name: string): Promise<any>;
putPackage(name: string, data: any): Promise<any>;
putVersion(name: string, version: string, data: any): Promise<any>;
getTarball(name: string, filename: string): Promise<any>;
putTarball(name: string, filename: string, data: any): Promise<any>;
removeTarball(name: string): Promise<any>;
removeSingleTarball(name: string, filename: string): Promise<any>;
addTag(name: string, tag: string, version: string): Promise<any>;
putTarballIncomplete(
name: string,
filename: string,
data: any,
size: number,
cb: Function
): Promise<any>;
addPackage(name: string): Promise<any>;
whoami(): Promise<any>;
ping(): Promise<any>;
debug(): IRequestPromise;
}

View file

@ -36,20 +36,20 @@
},
"homepage": "https://verdaccio.org",
"dependencies": {
"@verdaccio/cli": "workspace:5.0.0-alpha.0",
"@verdaccio/hooks": "workspace:5.0.0-alpha.0",
"@verdaccio/utils": "workspace:5.0.0-alpha.0",
"@verdaccio/logger": "workspace:5.0.0-alpha.0",
"@verdaccio/mock": "workspace:5.0.0-alpha.0",
"@verdaccio/node-api": "workspace:5.0.0-alpha.0",
"@verdaccio/cli": "workspace:5.0.0-alpha.0",
"verdaccio-htpasswd": "9.7.2",
"@verdaccio/ui-theme": "^1.12.1"
"@verdaccio/ui-theme": "^1.14.0",
"@verdaccio/utils": "workspace:5.0.0-alpha.0",
"verdaccio-htpasswd": "9.7.2"
},
"devDependencies": {
"@verdaccio/config": "workspace:5.0.0-alpha.0",
"@verdaccio/auth": "workspace:5.0.0-alpha.0",
"@verdaccio/store": "workspace:5.0.0-alpha.0",
"@verdaccio/dev-commons": "workspace:*"
"@verdaccio/config": "workspace:5.0.0-alpha.0",
"@verdaccio/dev-commons": "workspace:*",
"@verdaccio/store": "workspace:5.0.0-alpha.0"
},
"keywords": [
"private",

View file

@ -25,6 +25,7 @@ import pluginsAuth from './plugins/auth';
import middleware from './plugins/middleware';
import upLinkCache from './uplinks/cache';
import uplinkTimeout from './uplinks/timeout';
import { IServerBridge } from '@verdaccio/mock';
describe('functional test verdaccio', function () {
jest.setTimeout(20000);

File diff suppressed because it is too large Load diff

View file

@ -7,6 +7,7 @@
"strict": true,
"declaration": true,
"strictNullChecks": true,
"types": ["node", "jest", "express"],
"resolveJsonModule": true,
"allowSyntheticDefaultImports": true,
"esModuleInterop": true

View file

@ -4,7 +4,7 @@
},
"settings": {
"react": {
"version": "detect"
"version": "16"
}
},
"rules": {