From 55976b2dbee846df318ebddcec06eedb500a9f49 Mon Sep 17 00:00:00 2001 From: Bastian Gebhardt Date: Sun, 28 Nov 2021 23:26:59 +0100 Subject: [PATCH] WIP --- commons/constants.ts | 2 +- examples/example-download-single.ts | 5 +++-- package.json | 1 + test.utils.ts | 21 --------------------- 4 files changed, 5 insertions(+), 24 deletions(-) diff --git a/commons/constants.ts b/commons/constants.ts index 12f9871..df3322c 100644 --- a/commons/constants.ts +++ b/commons/constants.ts @@ -71,6 +71,6 @@ export const DEFAULT_SINGLE_CONFIG: IChromeSingleConfig = { store: true, download: true, downloadFolder: null, - single: '10.0.0.0', + single: new ComparableVersion(10, 0, 0, 0), quiet: false, } diff --git a/examples/example-download-single.ts b/examples/example-download-single.ts index 6f770ab..b10bbcd 100644 --- a/examples/example-download-single.ts +++ b/examples/example-download-single.ts @@ -1,7 +1,8 @@ -import { downloadChromium } from 'rusted-chromium'; +import { downloadChromium } from 'rusted-chromium' +import { ComparableVersion } from '../commons/ComparableVersion' downloadChromium({ - single: '98.0.4707.2', + single: new ComparableVersion(98, 0, 4707, 2), os: 'linux', arch: 'x64', }) diff --git a/package.json b/package.json index 3f37f06..0d8bccf 100644 --- a/package.json +++ b/package.json @@ -16,6 +16,7 @@ "prebuild": "npm run clean", "build": "tsc -p tsconfig.json", "build:silent": "npm run build -- --noEmit", + "build:examples": "cd examples/ && npm run build", "release": "npm run build && npm publish", "release-github": "npm run build && npm publish --registry=https://npm.pkg.github.com/" }, diff --git a/test.utils.ts b/test.utils.ts index 8cee604..a14aed5 100644 --- a/test.utils.ts +++ b/test.utils.ts @@ -1,7 +1,6 @@ import { NoParamCallback, PathLike, Stats } from 'fs' import { HTMLElement as NodeParserHTMLElement, Node as NodeParserNode } from 'node-html-parser' -import { ComparableVersion } from './commons/ComparableVersion' import { DEFAULT_FULL_CONFIG, DEFAULT_SINGLE_CONFIG, DEFAULT_CONFIG_OPTIONS } from './commons/constants' import { MappedVersion } from './commons/MappedVersion' import type { IConfigOptions } from './interfaces/config.interfaces' @@ -14,26 +13,6 @@ export const createChromeFullConfig = (config?: Partial): ICh ...config, }) -export const createChromeConfig = (config?: Partial): IChromeConfig => ({ - arch: 'x64', - autoUnzip: false, - download: true, - downloadFolder: null, - hideNegativeHits: false, - interactive: true, - max: new ComparableVersion(10000, 0, 0, 0), - min: new ComparableVersion(0, 0, 0, 0), - onFail: 'nothing', - onlyNewestMajor: false, - os: 'linux', - results: 10, - store: true, - single: null, - inverse: false, - quiet: false, - ...config, -}) - export const createChromeSingleConfig = (config?: Partial): IChromeSingleConfig => ({ ...DEFAULT_SINGLE_CONFIG, ...config,