From 61b6eae3a57980ab7c8debd5f5e411d0f7b2db25 Mon Sep 17 00:00:00 2001 From: Roy Ivy III Date: Fri, 4 Nov 2022 01:14:56 -0500 Subject: [PATCH 1/3] fix(build): fix build failures with updated rollup TS plugin --- package.json | 3 ++- rollup.config.js | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/package.json b/package.json index decd0c3f..d10e8cae 100644 --- a/package.json +++ b/package.json @@ -51,6 +51,7 @@ "author": "Ben Coe ", "license": "ISC", "devDependencies": { + "@rollup/plugin-typescript": "^8.5.0", "@types/chai": "^4.2.11", "@types/mocha": "^9.0.0", "@types/node": "^16.11.4", @@ -68,11 +69,11 @@ "rimraf": "^3.0.2", "rollup": "^2.22.1", "rollup-plugin-cleanup": "^3.1.1", - "rollup-plugin-ts": "^3.0.2", "serve": "^14.0.0", "standardx": "^7.0.0", "start-server-and-test": "^1.11.2", "ts-transform-default-export": "^1.0.2", + "tslib": "^2.4.1", "typescript": "^4.0.0" }, "files": [ diff --git a/rollup.config.js b/rollup.config.js index 15fd65db..9e36123c 100644 --- a/rollup.config.js +++ b/rollup.config.js @@ -1,5 +1,5 @@ import cleanup from 'rollup-plugin-cleanup' -import ts from 'rollup-plugin-ts' +import ts from '@rollup/plugin-typescript' import transformDefaultExport from 'ts-transform-default-export' const output = { From 236f06c3fdd1644ecf6d959683892e8535158daa Mon Sep 17 00:00:00 2001 From: Roy Ivy III Date: Sun, 9 Oct 2022 14:53:44 -0500 Subject: [PATCH 2/3] fix(deno): specify deps (avoids Deno warnings) --- deno.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/deno.ts b/deno.ts index ea42bced..138350f3 100644 --- a/deno.ts +++ b/deno.ts @@ -2,7 +2,7 @@ // Main entrypoint for Deno. // // TODO: find reasonable replacement for require logic. -import * as path from 'https://deno.land/std/path/mod.ts' +import * as path from 'https://deno.land/std@0.159.0/path/mod.ts' import { camelCase, decamelize, looksLikeNumber } from './build/lib/string-utils.js' import { YargsParser } from './build/lib/yargs-parser.js' import type { Arguments, ArgsInput, Parser, Options, DetailedArguments } from './build/lib/yargs-parser-types.d.ts' From 31880da036d3765971a8599768fd6393197d9c9e Mon Sep 17 00:00:00 2001 From: Roy Ivy III Date: Tue, 22 Nov 2022 22:57:45 -0600 Subject: [PATCH 3/3] fix(build): ignore problematic uncovered lines (due to CJS vs ESM logic) --- lib/index.ts | 2 ++ 1 file changed, 2 insertions(+) diff --git a/lib/index.ts b/lib/index.ts index 3cc34257..8ca8c9de 100644 --- a/lib/index.ts +++ b/lib/index.ts @@ -39,6 +39,7 @@ const parser = new YargsParser({ resolve, // TODO: figure out a way to combine ESM and CJS coverage, such that // we can exercise all the lines below: + /* c8 ignore start */ require: (path: string) => { if (typeof require !== 'undefined') { return require(path) @@ -49,6 +50,7 @@ const parser = new YargsParser({ throw Error('only .json config files are supported in ESM') } } + /* c8 ignore stop */ }) const yargsParser: Parser = function Parser (args: ArgsInput, opts?: Partial): Arguments { const result = parser.parse(args.slice(), opts)