Use imports with @rollup/pluginutils

This commit is contained in:
Tiger Oakes 2020-03-26 11:07:35 -07:00
parent 67748cc7cd
commit c6c733fcb5
10 changed files with 291 additions and 258 deletions

View File

@ -2,5 +2,5 @@ import * as tsTypes from "typescript";
import { IOptions } from "./ioptions";
import { IContext } from "./context";
export declare function getOptionsOverrides({ useTsconfigDeclarationDir, cacheRoot, cwd }: IOptions, preParsedTsconfig?: tsTypes.ParsedCommandLine): tsTypes.CompilerOptions;
export declare function createFilter(context: IContext, pluginOptions: IOptions, parsedConfig: tsTypes.ParsedCommandLine): any;
export declare function createFilter(context: IContext, pluginOptions: IOptions, parsedConfig: tsTypes.ParsedCommandLine): (id: unknown) => boolean;
//# sourceMappingURL=get-options-overrides.d.ts.map

View File

@ -1 +1 @@
{"version":3,"file":"get-options-overrides.d.ts","sourceRoot":"","sources":["src/get-options-overrides.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,OAAO,MAAM,YAAY,CAAC;AACtC,OAAO,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;AAGtC,OAAO,EAAE,QAAQ,EAAE,MAAM,WAAW,CAAC;AAKrC,wBAAgB,mBAAmB,CAAC,EAAE,yBAAyB,EAAE,SAAS,EAAE,GAAG,EAAE,EAAE,QAAQ,EAAE,iBAAiB,CAAC,EAAE,OAAO,CAAC,iBAAiB,GAAG,OAAO,CAAC,eAAe,CA+BnK;AAiBD,wBAAgB,YAAY,CAAC,OAAO,EAAE,QAAQ,EAAE,aAAa,EAAE,QAAQ,EAAE,YAAY,EAAE,OAAO,CAAC,iBAAiB,OAoB/G"}
{"version":3,"file":"get-options-overrides.d.ts","sourceRoot":"","sources":["src/get-options-overrides.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,OAAO,MAAM,YAAY,CAAC;AACtC,OAAO,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;AAGtC,OAAO,EAAE,QAAQ,EAAE,MAAM,WAAW,CAAC;AAErC,wBAAgB,mBAAmB,CAAC,EAAE,yBAAyB,EAAE,SAAS,EAAE,GAAG,EAAE,EAAE,QAAQ,EAAE,iBAAiB,CAAC,EAAE,OAAO,CAAC,iBAAiB,GAAG,OAAO,CAAC,eAAe,CA+BnK;AAiBD,wBAAgB,YAAY,CAAC,OAAO,EAAE,QAAQ,EAAE,aAAa,EAAE,QAAQ,EAAE,YAAY,EAAE,OAAO,CAAC,iBAAiB,4BAoB/G"}

View File

@ -12,6 +12,7 @@ var os = _interopDefault(require('os'));
var path = require('path');
var path__default = _interopDefault(path);
var resolve = require('resolve');
var pluginutils = require('@rollup/pluginutils');
var commonjsGlobal = typeof globalThis !== 'undefined' ? globalThis : typeof window !== 'undefined' ? window : typeof global !== 'undefined' ? global : typeof self !== 'undefined' ? self : {};
@ -24998,8 +24999,6 @@ function printDiagnostics(context, diagnostics, pretty) {
});
}
// tslint:disable-next-line:no-var-requires
const createRollupFilter = require("rollup-pluginutils").createFilter;
function getOptionsOverrides({ useTsconfigDeclarationDir, cacheRoot, cwd }, preParsedTsconfig) {
const overrides = {
noEmitHelpers: false,
@ -25050,7 +25049,7 @@ function createFilter(context, pluginOptions, parsedConfig) {
}
context.debug(() => `included:\n${JSON.stringify(included, undefined, 4)}`);
context.debug(() => `excluded:\n${JSON.stringify(excluded, undefined, 4)}`);
return createRollupFilter(included, excluded);
return pluginutils.createFilter(included, excluded);
}
function checkTsConfig(parsedConfig) {

File diff suppressed because one or more lines are too long

View File

@ -6,6 +6,7 @@ import util from 'util';
import os from 'os';
import path__default, { normalize as normalize$1, join, dirname, relative } from 'path';
import { sync as sync$4 } from 'resolve';
import { createFilter as createFilter$1 } from '@rollup/pluginutils';
var commonjsGlobal = typeof globalThis !== 'undefined' ? globalThis : typeof window !== 'undefined' ? window : typeof global !== 'undefined' ? global : typeof self !== 'undefined' ? self : {};
@ -24992,8 +24993,6 @@ function printDiagnostics(context, diagnostics, pretty) {
});
}
// tslint:disable-next-line:no-var-requires
const createRollupFilter = require("rollup-pluginutils").createFilter;
function getOptionsOverrides({ useTsconfigDeclarationDir, cacheRoot, cwd }, preParsedTsconfig) {
const overrides = {
noEmitHelpers: false,
@ -25044,7 +25043,7 @@ function createFilter(context, pluginOptions, parsedConfig) {
}
context.debug(() => `included:\n${JSON.stringify(included, undefined, 4)}`);
context.debug(() => `excluded:\n${JSON.stringify(excluded, undefined, 4)}`);
return createRollupFilter(included, excluded);
return createFilter$1(included, excluded);
}
function checkTsConfig(parsedConfig) {

File diff suppressed because one or more lines are too long

524
package-lock.json generated

File diff suppressed because it is too large Load Diff

View File

@ -29,10 +29,10 @@
"lint": "tslint -c ./tslint.json src/*.ts ./*.js"
},
"dependencies": {
"@rollup/pluginutils": "^3.0.8",
"find-cache-dir": "^3.2.0",
"fs-extra": "8.1.0",
"resolve": "1.15.1",
"rollup-pluginutils": "2.8.2",
"tslib": "1.10.0"
},
"peerDependencies": {

View File

@ -18,6 +18,7 @@ export default {
"util",
"assert",
"os",
"@rollup/pluginutils",
],
plugins: [

View File

@ -1,3 +1,4 @@
import { createFilter as createRollupFilter} from "@rollup/pluginutils";
import { tsModule } from "./tsproxy";
import * as tsTypes from "typescript";
import { IOptions } from "./ioptions";
@ -5,9 +6,6 @@ import * as _ from "lodash";
import { join } from "path";
import { IContext } from "./context";
// tslint:disable-next-line:no-var-requires
const createRollupFilter = require("rollup-pluginutils").createFilter;
export function getOptionsOverrides({ useTsconfigDeclarationDir, cacheRoot, cwd }: IOptions, preParsedTsconfig?: tsTypes.ParsedCommandLine): tsTypes.CompilerOptions
{
const overrides: tsTypes.CompilerOptions = {