Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

ts-patch

Package Overview
Dependencies
Maintainers
1
Versions
46
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

ts-patch - npm Package Compare versions

Comparing version 1.2.1 to 1.2.2

bin/cli.js.map

11

bin/cli.d.ts
import minimist from 'minimist';
export declare function run(): {
declare type MenuData = Record<string, {
short?: string;
caption: string;
paramCaption?: string;
inverse?: boolean;
}>;
export declare const cliOptions: MenuData;
export declare const cliCommands: MenuData;
export declare function run(argStr?: string): {
cmd: string | undefined;

@@ -14,1 +22,2 @@ args: minimist.ParsedArgs;

} | undefined;
export {};

26

bin/cli.js

@@ -38,3 +38,3 @@ #!/usr/bin/env node

Object.defineProperty(exports, "__esModule", { value: true });
exports.run = void 0;
exports.run = exports.cliCommands = exports.cliOptions = void 0;
var minimist_1 = __importDefault(require("minimist"));

@@ -46,3 +46,3 @@ var chalk_1 = __importDefault(require("chalk"));

var __1 = require("..");
var cliOptions = {
exports.cliOptions = {
silent: { short: 's', caption: 'Run silently' },

@@ -58,3 +58,3 @@ global: { short: 'g', caption: 'Target global TypeScript installation' },

};
var cliCommands = {
exports.cliCommands = {
install: { short: 'i', caption: "Installs ts-patch" },

@@ -91,3 +91,3 @@ uninstall: { short: 'u', caption: 'Restores original typescript files' },

Object
.entries(cliCommands)
.entries(exports.cliCommands)
.map(function (_a) {

@@ -101,3 +101,3 @@ var cmd = _a[0], _b = _a[1], short = _b.short, caption = _b.caption, paramCaption = _b.paramCaption;

Object
.entries(cliOptions)
.entries(exports.cliOptions)
.map(function (_a) {

@@ -119,4 +119,4 @@ var long = _a[0], _b = _a[1], short = _b.short, inverse = _b.inverse, caption = _b.caption, paramCaption = _b.paramCaption;

run();
function run() {
var args = minimist_1.default(instanceIsCLI ? process.argv.slice(2) : arguments[0].split(' '));
function run(argStr) {
var args = minimist_1.default(instanceIsCLI ? process.argv.slice(2) : argStr.split(' '));
var cmd = args._[0] ? args._[0].toLowerCase() : void 0;

@@ -126,4 +126,4 @@ try {

if (cmd)
cmd = (Object.keys(cliCommands).includes(cmd)) ? cmd :
(Object.entries(cliCommands).find(function (_a) {
cmd = (Object.keys(exports.cliCommands).includes(cmd)) ? cmd :
(Object.entries(exports.cliCommands).find(function (_a) {
var n = _a[0], short = _a[1].short;

@@ -134,3 +134,3 @@ return n && (short == cmd);

var opts = Object
.entries(cliOptions)
.entries(exports.cliOptions)
.reduce(function (p, _a) {

@@ -165,5 +165,5 @@ var _b, _c;

case 'patch':
return actions.patch(args._.slice(1).join(' '));
return actions.patch(args._.slice(1).join(' '), { verbose: true });
case 'unpatch':
return actions.unpatch(args._.slice(1).join(' '));
return actions.unpatch(args._.slice(1).join(' '), { verbose: true });
case 'check':

@@ -191,2 +191,2 @@ return actions.check();

// endregion
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiY2xpLmpzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vLi4vc3JjL2Jpbi9jbGkudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6Ijs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7O0FBQUEsc0RBQWdDO0FBQ2hDLGdEQUEwQjtBQUMxQiwwREFBbUM7QUFDbkMsc0RBQXlDO0FBQ3pDLHdDQUEwRjtBQUMxRix3QkFBa0M7QUFVbEMsSUFBTSxVQUFVLEdBQWE7SUFDM0IsTUFBTSxFQUFFLEVBQUUsS0FBSyxFQUFFLEdBQUcsRUFBRSxPQUFPLEVBQUUsY0FBYyxFQUFFO0lBQy9DLE1BQU0sRUFBRSxFQUFFLEtBQUssRUFBRSxHQUFHLEVBQUUsT0FBTyxFQUFFLHVDQUF1QyxFQUFFO0lBQ3hFLE9BQU8sRUFBRSxFQUFFLEtBQUssRUFBRSxHQUFHLEVBQUUsT0FBTyxFQUFFLFlBQVksR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LENBQUE7U0FBRTtRQUMxRCxPQUFPLENBQUMsRUFBRSxHQUFHO0tBQ2Q7Q0FDRiJ9
//# sourceMappingURL=persist.js.map

@@ -7,2 +7,14 @@ # Changelog

## [1.2.2] (05-23-2020)
### Fixed
- Possible recursion issue with program transformer
- Older TS versions, tsc wasn't passing diagnostics array
### Added
- Added 'library' to TspExtras
### Code
- Substantial re-design of certain parts (see release commit message for more)
## [1.2.0] (05-20-2020)

@@ -53,4 +65,5 @@

[1.2.2]: https://github.com/nonara/ts-patch/compare/v1.1.0...v1.2.2
[1.2.0]: https://github.com/nonara/ts-patch/compare/v1.1.0...v1.2.0
[1.1.0]: https://github.com/nonara/ts-patch/compare/v1.0.10...v1.1.0
[1.0]: https://github.com/nonara/ts-patch/releases/tag/v1.0.0...v1.0.10

@@ -11,2 +11,2 @@ "use strict";

Object.defineProperty(exports, "setOptions", { enumerable: true, get: function () { return actions_1.setOptions; } });
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiaW5kZXguanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi9zcmMvaW5kZXgudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6Ijs7QUFBQSwrQ0FBa0Y7QUFBekUsMEdBQUEsWUFBWSxPQUFBO0FBQUUseUdBQUEsV0FBVyxPQUFBO0FBRWxDLHlDQUFxRTtBQUE1RCxrR0FBQSxPQUFPLE9BQUE7QUFBRSxvR0FBQSxTQUFTLE9BQUE7QUFBRSxnR0FBQSxLQUFLLE9BQUE7QUFBRSxxR0FBQSxVQUFVLE9BQUEifQ==
//# sourceMappingURL=index.js.map

@@ -12,4 +12,5 @@ import { TSModule } from './file-utils';

export declare function parseFiles(fileOrFilesOrGlob: string | string[], dir: string, includeSrc?: boolean): TSModule[] & {
alreadyPatched: TSModule[];
patched: TSModule[];
unPatchable: TSModule[];
canUpdateOrPatch: TSModule[];
patchable: TSModule[];

@@ -33,4 +34,5 @@ };

export declare function check(fileOrFilesOrGlob?: string | string[], opts?: Partial<TSPOptions>): TSModule[] & {
alreadyPatched: TSModule[];
patched: TSModule[];
unPatchable: TSModule[];
canUpdateOrPatch: TSModule[];
patchable: TSModule[];

@@ -37,0 +39,0 @@ };

@@ -71,5 +71,6 @@ "use strict";

return system_1.defineProperties(ret, {
alreadyPatched: { get: function () { return ret.filter(function (f) { return f.patchVersion; }); } },
patched: { get: function () { return ret.filter(function (f) { return f.patchVersion; }); } },
unPatchable: { get: function () { return ret.filter(function (f) { return !f.canPatch; }); } },
patchable: { get: function () { return ret.filter(function (f) { return f.canPatch && !f.patchVersion; }); } },
canUpdateOrPatch: { get: function () { return ret.filter(function (f) { return f.canPatch && f.outOfDate; }); } },
patchable: { get: function () { return ret.filter(function (f) { return f.canPatch; }); } },
});

@@ -83,2 +84,4 @@ }

var backupDir = path.join(tsPackage.packageDir, exports.BACKUP_DIRNAME);
if (tsModule.patchVersion)
throw new Error("Cannot backup an already patched module. You may need to reinstall typescript.");
try {

@@ -99,3 +102,6 @@ file_utils_1.mkdirIfNotExist(backupDir);

*/
function restore(currentModule, tsPackage) {
function restore(currentModule, tsPackage, noDelete) {
var copyOrMove = function (fileName, dest) {
return shell[noDelete ? 'cp' : 'mv'](fileName, dest);
};
var backupDir = path.join(tsPackage.packageDir, exports.BACKUP_DIRNAME);

@@ -107,8 +113,8 @@ var _a = file_utils_1.getTSModule(path.join(backupDir, currentModule.filename)), file = _a.file, filename = _a.filename, canPatch = _a.canPatch, patchVersion = _a.patchVersion, dir = _a.dir;

if (patchVersion)
throw new system_1.RestoreError(filename, "Backup file is not an unpatched ts module");
throw new system_1.RestoreError(filename, "Backup file is not an un-patched ts module");
/* Restore files */
if (shell.mv(file, tsPackage.libDir) && shell.error())
if (copyOrMove(file, tsPackage.libDir) && shell.error())
throw new system_1.RestoreError(filename, "Couldn't restore file - " + shell.error());
if (filename === 'typescript.js')
if (shell.mv(path.join(dir, 'typescript.d.ts'), tsPackage.libDir) && shell.error())
if (copyOrMove(path.join(dir, 'typescript.d.ts'), tsPackage.libDir) && shell.error())
throw new system_1.RestoreError(filename, "Couldn't restore file - " + shell.error());

@@ -199,2 +205,4 @@ /* Verify restored file */

var _b = _a[_i], name = _b.name, version = _b.version;
if (!pkgData.hasOwnProperty('dependencies'))
pkgData.dependencies = {};
pkgData.dependencies[name] = "^" + version;

@@ -248,5 +256,8 @@ }

for (var _i = 0, modules_1 = modules; _i < modules_1.length; _i++) {
var _b = modules_1[_i], filename = _b.filename, patchVersion = _b.patchVersion, canPatch = _b.canPatch;
var module_1 = modules_1[_i];
var filename = module_1.filename, patchVersion = module_1.patchVersion, canPatch = module_1.canPatch, outOfDate = module_1.outOfDate;
if (patchVersion)
system_1.Log(['+', chalk_1.default.blueBright(filename) + " is patched with ts-patch version " + chalk_1.default.blueBright(patchVersion) + "."]);
system_1.Log(['+', chalk_1.default.blueBright(filename) + " is patched with ts-patch version " +
(chalk_1.default[outOfDate ? 'redBright' : 'blueBright'](patchVersion) + " " + (outOfDate ? '(out of date)' : ''))
]);
else if (canPatch)

@@ -270,12 +281,19 @@ system_1.Log(['-', chalk_1.default.blueBright(filename) + " is not patched."]);

var modules = parseFiles(fileOrFilesOrGlob, tsPackage.libDir, true);
if (modules.alreadyPatched.length >= modules.length) {
system_1.Log(['!', "Files already patched. For details, run: " + chalk_1.default.bgBlackBright('ts-patch check')]);
return true;
if (!modules.canUpdateOrPatch.length) {
system_1.Log(['!', "File" + (modules.length - 1 ? 's' : '') + " already patched with the latest version. For details, run: " +
chalk_1.default.bgBlackBright('ts-patch check')
]);
return false;
}
/* Patch files */
for (var _i = 0, _a = modules.patchable; _i < _a.length; _i++) {
for (var _i = 0, _a = modules.canUpdateOrPatch; _i < _a.length; _i++) {
var m = _a[_i];
var file = m.file, filename = m.filename;
system_1.Log(['~', "Patching " + chalk_1.default.blueBright(filename) + " in " + chalk_1.default.blueBright(path.dirname(file))], system_1.Log.verbose);
backup(m, tsPackage);
// If already patched, load backup module source. Otherwise, backup un-patched
if (m.patchVersion)
m.moduleSrc =
file_utils_1.getTSModule(path.join(tsPackage.packageDir, exports.BACKUP_DIRNAME, m.filename), /* includeSrc */ true).moduleSrc;
else
backup(m, tsPackage);
patcher_1.patchTSModule(m, tsPackage);

@@ -302,4 +320,4 @@ tsPackage.config.modules[filename] = fs.statSync(file).mtimeMs;

var modules = parseFiles(fileOrFilesOrGlob, tsPackage.libDir, true);
if (modules.alreadyPatched.length < 1) {
system_1.Log(['!', "No patched files detected. For details, run: " + chalk_1.default.bgBlackBright('ts-patch check')]);
if (modules.patched.length < 1) {
system_1.Log(['!', "File" + (modules.length - 1 ? 's' : '') + " not patched. For details, run: " + chalk_1.default.bgBlackBright('ts-patch check')]);
return false;

@@ -309,3 +327,3 @@ }

var errors = {};
for (var _i = 0, _b = modules.alreadyPatched; _i < _b.length; _i++) {
for (var _i = 0, _b = modules.patched; _i < _b.length; _i++) {
var tsModule = _b[_i];

@@ -401,2 +419,2 @@ var file = tsModule.file, filename = tsModule.filename;

// endregion
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiYWN0aW9ucy5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uLy4uL3NyYy9saWIvYWN0aW9ucy50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiOzs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7QUFBQSx5Q0FBNkI7QUFDN0IscUNBQXlCO0FBQ3pCLDhDQUF3QjtBQUN4QixnREFBMEI7QUFDMUIsNkNBQWlDO0FBQ2pDLHFDQUEwQztBQUMxQywyQ0FBc0g7QUFDdEgsbUNBR2tCO0FBQ2xCLGlDQUFvQztBQUdwQzs7d0hBRXdIO0FBQ3hILGdCQUFnQjtBQUVILFFBQUEsY0FBYyxHQUFHLENBQUUsU0FBUyxDQUFFLENBQUM7QUFFNUMsS0FBSyxDQUFDLE1BQU0sQ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UcsQ0FBQyxDQUFFLENBQUMsQ0FBQztBQUN4RixDQUFDO0FBakJELGdEQWlCQztBQUVELFlBQVkifQ==
//# sourceMappingURL=actions.js.map

@@ -9,3 +9,3 @@ /**

export declare const getModuleAbsolutePath: (filename: string, libDir: string) => string;
export declare const mkdirIfNotExist: (dir: string) => false | void;
export declare const mkdirIfNotExist: (dir: string) => string | false;
export interface TSPackage {

@@ -29,2 +29,3 @@ version: string;

moduleSrc?: string;
outOfDate: boolean;
}

@@ -31,0 +32,0 @@ /**

@@ -56,2 +56,9 @@ "use strict";

exports.mkdirIfNotExist = function (dir) { return !fs_1.default.existsSync(dir) && fs_1.default.mkdirSync(dir, { recursive: true }); };
var isOutOfDate = function (version) {
var currentVer = system_1.tspPackageJSON.version.match(/(\d+)\.(\d+)\.(\d+)/);
// noinspection JSUnusedLocalSymbols
var _a = String(version).match(/(\d+)\.(\d+)\.(\d+)/) || [], f = _a[0], major = _a[1], minor = _a[2], patch = _a[3];
return (isNaN(+major) || isNaN(+minor) || isNaN(+patch)) ||
((currentVer === null || currentVer === void 0 ? void 0 : currentVer[1]) > major) || ((currentVer === null || currentVer === void 0 ? void 0 : currentVer[2]) > minor) || ((currentVer === null || currentVer === void 0 ? void 0 : currentVer[3]) > patch);
};
/**

@@ -96,3 +103,4 @@ * Get TypeScript package info - Resolve from basedir, throws if not cannot find TS package

(fileData.match(/(?<=^\s*?var\stspVersion\s?=\s?['"`])(\S+?)(?=['"`])/m) || [])[0];
return __assign({ file: file, filename: filename, canPatch: canPatch, dir: dir, patchVersion: patchVersion }, (includeSrc && canPatch && { moduleSrc: fileData }));
var outOfDate = isOutOfDate(patchVersion);
return __assign({ file: file, filename: filename, canPatch: canPatch, dir: dir, patchVersion: patchVersion, outOfDate: outOfDate }, (includeSrc && canPatch && { moduleSrc: fileData }));
}

@@ -133,2 +141,2 @@ exports.getTSModule = getTSModule;

// endregion
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjo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yxDQUFDLENBQUMsQ0FBQztLQUNoRTtJQUNELE9BQU8sQ0FBQyxFQUFFO1FBQ1IsTUFBTSxJQUFJLHVCQUFjLENBQUMsTUFBTSxDQUFDLElBQUksRUFBRSxDQUFDLENBQUMsT0FBTyxDQUFDLENBQUM7S0FDbEQ7QUFDSCxDQUFDO0FBRUQsWUFBWSJ9
//# sourceMappingURL=file-utils.js.map

@@ -30,7 +30,7 @@ "use strict";

if (tsModule) {
var file = tsModule.file, filename = tsModule.filename, dir = tsModule.dir, patchVersion = tsModule.patchVersion, canPatch = tsModule.canPatch;
var file = tsModule.file, filename = tsModule.filename, dir = tsModule.dir, patchVersion = tsModule.patchVersion, canPatch = tsModule.canPatch, outOfDate = tsModule.outOfDate;
if (!fs_1.default.existsSync(file))
throw new system_1.FileNotFound("Could not find module " + filename + " in " + (dir + path_1.default.sep));
if (patchVersion)
throw new system_1.PatchError("Module " + filename + " is already patched with ts-patch v" + patchVersion);
if (patchVersion && !outOfDate)
throw new system_1.PatchError("Module " + filename + " is already up-to-date with local version - v" + patchVersion);
if (!canPatch)

@@ -40,4 +40,3 @@ throw new system_1.PatchError("Module " + filename + " cannot be patched! No instance of TypeScript found.");

if (tsPackage) {
var version = tsPackage.version;
var _a = version.split('.'), major = _a[0], minor = _a[1];
var _a = tsPackage.version.split('.'), major = _a[0], minor = _a[1];
if (+major < 3 && +minor < 7)

@@ -48,3 +47,26 @@ throw new system_1.WrongTSVersion("ts-patch requires TypeScript v2.7 or higher.");

}
var patchModule = function (src) { return src.replace(/(function emitFilesAndReportErrors[\s\S]+?)(\s*)(var emitResult =)/, '$1\n$2ts.diagnosticMap.set(program, allDiagnostics);\n$2$3'); };
var patchModule = function (tsModule, source) {
var src = source || tsModule.moduleSrc;
var funcPos = src.search(/function emitFilesAndReportErrors\(/);
if (funcPos < 0)
throw new Error("Bad TS Code. Could not find function emitFilesAndReportErrors in " + tsModule.filename);
var startCode = src.substr(0, funcPos);
var restCode = src.substr(funcPos);
/* Modern TS */
var pos = restCode.search(/^\s*?var emitResult =/m);
if (pos >= 0) {
return startCode +
restCode.substr(0, pos) +
"\nts.diagnosticMap.set(program, allDiagnostics);\n" +
restCode.substr(pos);
}
/* TS 2.7 */
pos = restCode.search(/^\s*?var [_\w]+? = program.emit\(\)/m);
if (pos < 0)
throw new Error("Could not recognize diagnostics signature in emitFilesAndReportErrors(). Please open an issue with your TS version #.");
return startCode +
restCode.substr(0, pos) +
"\nts.diagnosticMap.set(program, diagnostics);\n" +
restCode.substr(pos);
};
/* ********************************************************************************************************************

@@ -63,3 +85,3 @@ * Patch

/* Add diagnostic modification support */
var moduleSrc = patchModule(tsModule.moduleSrc);
var moduleSrc = patchModule(tsModule);
try {

@@ -75,3 +97,3 @@ if (isTSC) {

fs_1.default.writeFileSync(file, Buffer.concat([
Buffer.from(patchModule(fs_1.default.readFileSync(tsFile, 'utf-8'))),
Buffer.from(patchModule(tsModule, fs_1.default.readFileSync(tsFile, 'utf-8'))),
Buffer.from(!file_utils_1.getTSModule(tsFile).patchVersion ? patchSrc : ''),

@@ -100,2 +122,2 @@ Buffer.from(moduleSrc.replace(/^[\s\S]+(\(function \(ts\) {\s+function countLines[\s\S]+)$/, '$1'))

exports.patchTSModule = patchTSModule;
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoicGF0Y2hlci5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uLy4uL3NyYy9saWIvcGF0Y2hlci50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiOzs7Ozs7QUFBQSwwQ0FBb0I7QUFDcEIsOENBQXdCO0FBQ3hCLG1DQUE2RztBQUM3RywyQ0FBZ0U7QUFDaEUscUNBQTJDO0FBRzNDOzt3SEFFd0g7QUFFeEg7O0dBRUc7QUFDSCxJQUFNLGFBQWEsR0FBRyxVQUFDLEtBQWM7SUFDbkMsT0FBQSxZQUFFO1NBQ0MsWUFBWSxDQUFDLGNBQUksQ0F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SUFBRyxPQUFPLENBQUMsQ0FBQyxDQUFDLEtBQUssR0FBRyxPQUFPLENBQUMsQ0FBQyxDQUFDLEVBQUUsQ0FBRSxDQUFDLFNBRXZFO1FBSGtCLGNBQVEsR0FBUixRQUFRLENBQVE7UUFFakMsS0FBSSxDQUFDLElBQUksR0FBRyxjQUFjLENBQUM7O0lBQzdCLENBQUM7SUFDSCxtQkFBQztBQUFELENBQUMsQUFMRCxDQUFrQyxLQUFLLEdBS3RDO0FBTFksb0NBQVk7QUFPekI7SUFBaUMsK0JBQUs7SUFDcEMscUJBQW1CLFFBQWdCLEVBQUUsT0FBZTtRQUFwRCxZQUNFLGtCQUFNLHNCQUFvQixRQUFRLElBQUcsT0FBTyxDQUFDLENBQUMsQ0FBQyxLQUFLLEdBQUcsT0FBTyxDQUFDLENBQUMsQ0FBQyxFQUFFLENBQUUsQ0FBQyxTQUV2RTtRQUhrQixjQUFRLEdBQVIsUUFBUSxDQUFRO1FBRWpDLEtBQUksQ0FBQyxJQUFJLEdBQUcsYUFBYSxDQUFDOztJQUM1QixDQUFDO0lBQ0gsa0JBQUM7QUFBRCxDQUFDLEFBTEQsQ0FBaUMsS0FBSyxHQUtyQztBQUxZLGtDQUFXO0FBT3hCO0lBQW9DLGtDQUFLO0lBQ3ZDLHdCQUFtQixRQUFnQixFQUFFLE9BQWU7UUFBcEQsWUFDRSxrQkFBTSxvQ0FBa0MsUUFBUSxJQUFHLE9BQU8sSUFBSSxPQUFLLE9BQVMsQ0FBRSxDQUFDLFNBQ2hGO1FBRmtCLGNBQVEsR0FBUixRQUFRLENBQVE7O0lBRW5DLENBQUM7SUFDSCxxQkFBQztBQUFELENBQUMsQUFKRCxDQUFvQyxLQUFLLEdBSXhDO0FBSlksd0NBQWMifQ==
//# sourceMappingURL=errors.js.map

@@ -66,7 +66,7 @@ "use strict";

exports.appRoot = (function () {
var moduleDir = path_1.default.join(path_1.default.dirname(module.filename), '../..');
var moduleDir = path_1.default.join(__dirname, '../..');
var chkFile = function (pkgFile) {
return (fs_1.default.existsSync(pkgFile) && (require(pkgFile).name === 'ts-patch')) ? path_1.default.dirname(pkgFile) : void 0;
};
var res = chkFile(path_1.default.join(moduleDir, 'package.json')) || chkFile(path_1.default.join(moduleDir, '..', 'package.json'));
var res = chkFile(path_1.default.join(moduleDir, 'package.json')) || chkFile(path_1.default.join(moduleDir, '../..', 'package.json'));
if (!res)

@@ -80,2 +80,2 @@ throw new Error("Error getting app root. No valid ts-patch package file found.");

exports.tspPackageJSON = require(path_1.default.resolve(exports.appRoot, 'package.json'));
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiaGVscGVycy5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uLy4uLy4uL3NyYy9saWIvc3lzdGVtL2hlbHBlcnMudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6Ijs7Ozs7Ozs7Ozs7Ozs7Ozs7QUFBQSw4Q0FBd0I7QUFDeEIsMENBQW9CO0FBR3BCOzt3SEFFd0g7QUFFeEg7O0dBRUc7QUFDVSxRQUFBLFVBQVUsR0FBRyxVQUFDLEtBQWE7SUFDdEMsT0FBQSxjQUFJLENBQUMsT0FBTyxDQUFDLEtBQUssQ0FBQyxLQUFLLGNBQUksQ0FBQyxTQUFTLENBQUMsS0FBSyxDQUFDLENBQUMsT0FBTyxDQUFDLE1BQU0sQ0FBQyxjQUFJLENBQUMsR0FBRyxHQUFHLEdBQUcsQ0FBQyxFQUFFLEVBQUUsQ0FBQztBQUFqRixDQUFpRixDQUFDO0FBRXBGOzs7Ozs7O0dBT0c7QUFDSCxTQUFnQixJQUFJLENBQXVCLEdBQU07SUFBRSxjQUFZO1NBQVosVUFBWSxFQUFaLHFCQUFZLEVBQVosSUFBWTtRQUFaLDZCQUFZOztJQUM3RCxPQUFPLGFBQ0YsSUFBSSxDQUFDLE1BQU0sQ0FBQyxVQUFDLENBQUMsRUFBRSxHQUFHOztRQUFLLE9B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EcsSUFBTSxHQUFHLEdBQUcsT0FBTyxDQUFDLGNBQUksQ0FBQyxJQUFJLENBQUMsU0FBUyxFQUFFLGNBQWMsQ0FBQyxDQUFDLElBQUksT0FBTyxDQUFDLGNBQUksQ0FBQyxJQUFJLENBQUMsU0FBUyxFQUFFLElBQUksRUFBRSxjQUFjLENBQUMsQ0FBQyxDQUFDO0lBRWpILElBQUksQ0FBQyxHQUFHO1FBQUUsTUFBTSxJQUFJLEtBQUssQ0FBQywrREFBK0QsQ0FBQyxDQUFDO0lBRTNGLE9BQU8sR0FBRyxDQUFDO0FBQ2IsQ0FBQyxDQUFDLEVBQUUsQ0FBQztBQUVMOztHQUVHO0FBQ1UsUUFBQSxjQUFjLEdBQUcsT0FBTyxDQUFDLGNBQUksQ0FBQyxPQUFPLENBQUMsZUFBTyxFQUFFLGNBQWMsQ0FBQyxDQUFDLENBQUMifQ==
//# sourceMappingURL=helpers.js.map

@@ -17,2 +17,2 @@ "use strict";

__exportStar(require("./logger"), exports);
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiaW5kZXguanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi8uLi9zcmMvbGliL3N5c3RlbS9pbmRleC50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiOzs7Ozs7Ozs7Ozs7QUFBQSwyQ0FBeUI7QUFDekIsNENBQTBCO0FBQzFCLDRDQUEwQjtBQUMxQiwyQ0FBeUIifQ==
//# sourceMappingURL=index.js.map

@@ -50,2 +50,2 @@ "use strict";

})(Log = exports.Log || (exports.Log = {}));
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoibG9nZ2VyLmpzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vLi4vLi4vc3JjL2xpYi9zeXN0ZW0vbG9nZ2VyLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiI7Ozs7OztBQU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UFLLENBQUMsR0FBRyxHQUFHLE1BQU0sQ0FBQyxDQUFDO0FBQzFDLENBQUM7QUF6QkQsa0JBeUJDO0FBRUQsa0JBQWtCO0FBQ2xCLFdBQWlCLEdBQUc7SUFDTCxVQUFNLEdBQUcsQ0FBQyxDQUFDO0lBQ1gsVUFBTSxHQUFHLENBQUMsQ0FBQztJQUNYLFdBQU8sR0FBRyxDQUFDLENBQUM7QUFDM0IsQ0FBQyxFQUpnQixHQUFHLEdBQUgsV0FBRyxLQUFILFdBQUcsUUFJbkIifQ==
//# sourceMappingURL=logger.js.map

@@ -61,2 +61,2 @@ "use strict";

exports.resetOptions = function (options) { return exports.parseOptions(__assign(__assign({}, exports.defaultOptions), options)); };
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoib3B0aW9ucy5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uLy4uLy4uL3NyYy9saWIvc3lzdGVtL29wdGlvbnMudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6Ijs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7O0FBQUEsbUNBQStCO0FBQy9CLG1DQUF3QztBQUN4QyxxQ0FBMEM7QUFDMUMsNENBQStDO0FBUWxDLFFBQUEsY0FBYyxHQUFHO0lBQzVCLFFBQVEsRUFBRSxZQUFHLENBQUMsTUFBTTtJQUNwQixLQUFLLEVBQUUsSUFBSTtJQUNYLE1BQU0sRUFBRSxLQUFLO0lBQ2IsT0FBTyxFQUFFLEtBQUs7SUFDZCxPQUFPLEVBQUUsT0FBTyxDQUFDLEdBQUcsRUFBRTtJQUN0QixhQUFhLEVBQUUsS0FBSztDQUNyQixDQUFDO0FBRUYsK0JBQStCO0FBQ3BCLFFBQUEsVUFBVSxnQkFBUSxzQkFBYyxFQUFHO0FBRzlDOzt3SEFFd0g7QUFFeEg7O0dBRUc7QUFDVSxRQUFBLFlBQVksR0FBRyxVQUFDLE9BQTZCO0lBQ3h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JBQVUsQ0FBQztBQUNwQixDQUFDLENBQUM7QUFFVyxRQUFBLFlBQVksR0FBRyxVQUFDLE9BQTZCLElBQUssT0FBQSxvQkFBWSx1QkFBTSxzQkFBYyxHQUFLLE9BQU8sRUFBRyxFQUEvQyxDQUErQyxDQUFDIn0=
//# sourceMappingURL=options.js.map
{
"name": "ts-patch",
"version": "1.2.1",
"version": "1.2.2",
"description": "Patch typescript to support custom transformers in tsconfig.json",

@@ -5,0 +5,0 @@ "main": "./index.js",

[![npm version](https://badge.fury.io/js/ts-patch.svg)](https://badge.fury.io/js/ts-patch)
[![Build Status](https://travis-ci.org/nonara/ts-patch.svg?branch=master)](https://travis-ci.org/nonara/ts-patch)
![Build Status](https://github.com/nonara/ts-patch/workflows/Build%20(CI)/badge.svg)
[![Coverage Status](https://coveralls.io/repos/github/nonara/ts-patch/badge.svg?branch=master)](https://coveralls.io/github/nonara/ts-patch?branch=master)

@@ -78,6 +78,7 @@

{
ts: typeof ts;
ts: typeof ts; // The typescript instance
addDiagnostic: (diag: Diagnostic) => number,
removeDiagnostic: (index: number) => void,
diagnostics: readonly Diagnostic[]
diagnostics: readonly Diagnostic[],
library: string // Originating library ('tsc' | typescript' | 'tsserverlibrary' | 'tsserver')
}

@@ -233,7 +234,6 @@ ```

To alter diagnostics, use the [program type signature](#program-default), and use the following from the `TspExtras` parameter
To alter diagnostics, use the [program type signature](#program-default), and use the following properties from the `TspExtras` parameter
| property | description |
| -------- |----------- |
| ts | Reference to `ts` instance
| diagnostics | Reference to `Diagnostic[]` created during `ts.emitFilesAndReportErrors()` (works with tsc also)

@@ -240,0 +240,0 @@ | addDiagnostic() | Directly add `Diagnostic` to `diagnostics` array |

@@ -47,5 +47,11 @@ declare namespace ts {

}
type ProgramTransformer = (program: Program, host?: CompilerHost, config?: PluginConfig) => Program;
type TspExtras = {
/**
* Originating TypeScript instance
*/
ts: typeof ts;
/**
* TypeScript library file event was triggered in (ie. 'tsserverlibrary' or 'typescript')
*/
library: string;
addDiagnostic: (diag: Diagnostic) => number;

@@ -55,2 +61,5 @@ removeDiagnostic: (index: number) => void;

};
type ProgramTransformer = (program: Program, host: CompilerHost | undefined, config: PluginConfig | undefined, extras: {
ts: typeof ts;
}) => Program;
type LSPattern = (ls: LanguageService, config: {}) => TransformerPlugin;

@@ -62,2 +71,3 @@ type CompilerOptionsPattern = (compilerOpts: CompilerOptions, config: {}) => TransformerPlugin;

type RawPattern = (context: TransformationContext, program: Program, config: {}) => Transformer<SourceFile>;
/**

@@ -64,0 +74,0 @@ * @example

@@ -76,10 +76,7 @@ (function () {

/*
* The logic in this file is based on TTypescript (https://github.com/cevek/ttypescript)
* Credit & thanks go to cevek (https://github.com/cevek) for the incredible work!
*/
/* ********************************************************************************************************************
* Constants
* ********************************************************************************************************************/
/* ****************************************************************************************************************** */
// region: Constants
/* ****************************************************************************************************************** */
var diagnosticMap = new WeakMap();
// endregion
/* ********************************************************************************************************************

@@ -94,2 +91,3 @@ * Helpers

}
var getCurrentLibrary = function () { return require('path').basename(__filename, require('path').extname(__filename)); };

@@ -297,3 +295,6 @@ var _rollupPluginShim1 = require('fs');

fs: true,
"fs/promises": ">= 10 && < 10.1",
"fs/promises": [
">= 10 && < 10.1",
">= 14"
],
_http_agent: ">= 0.11.1",

@@ -441,2 +442,4 @@ _http_client: ">= 0.11.1",

var realpathFS = fs.realpath && typeof fs.realpath.native === 'function' ? fs.realpath.native : fs.realpath;
var defaultIsFile = function isFile(file, cb) {

@@ -462,8 +465,12 @@ fs.stat(file, function (err, stat) {

var maybeUnwrapSymlink = function maybeUnwrapSymlink(x, opts, cb) {
var defaultRealpath = function realpath(x, cb) {
realpathFS(x, function (realpathErr, realPath) {
if (realpathErr && realpathErr.code !== 'ENOENT') cb(realpathErr);
else cb(null, realpathErr ? x : realPath);
});
};
var maybeRealpath = function maybeRealpath(realpath, x, opts, cb) {
if (opts && opts.preserveSymlinks === false) {
fs.realpath(x, function (realPathErr, realPath) {
if (realPathErr && realPathErr.code !== 'ENOENT') cb(realPathErr);
else cb(null, realPathErr ? x : realPath);
});
realpath(x, cb);
} else {

@@ -501,2 +508,3 @@ cb(null, x);

var readFile = opts.readFile || fs.readFile;
var realpath = opts.realpath || defaultRealpath;
var packageIterator = opts.packageIterator;

@@ -513,3 +521,4 @@

maybeUnwrapSymlink(
maybeRealpath(
realpath,
absoluteStart,

@@ -536,3 +545,3 @@ opts,

else if (n) {
return maybeUnwrapSymlink(n, opts, function (err, realN) {
return maybeRealpath(realpath, n, opts, function (err, realN) {
if (err) {

@@ -558,3 +567,3 @@ cb(err);

else if (d) {
maybeUnwrapSymlink(d, opts, function (err, realD) {
maybeRealpath(realpath, d, opts, function (err, realD) {
if (err) {

@@ -623,3 +632,3 @@ cb(err);

maybeUnwrapSymlink(dir, opts, function (unwrapErr, pkgdir) {
maybeRealpath(realpath, dir, opts, function (unwrapErr, pkgdir) {
if (unwrapErr) return loadpkg(path.dirname(dir), cb);

@@ -652,3 +661,3 @@ var pkgfile = path.join(pkgdir, 'package.json');

maybeUnwrapSymlink(x, opts, function (unwrapErr, pkgdir) {
maybeRealpath(realpath, x, opts, function (unwrapErr, pkgdir) {
if (unwrapErr) return cb(unwrapErr);

@@ -733,2 +742,4 @@ var pkgfile = path.join(pkgdir, 'package.json');

var realpathFS$1 = fs.realpathSync && typeof fs.realpathSync.native === 'function' ? fs.realpathSync.native : fs.realpathSync;
var defaultIsFile$1 = function isFile(file) {

@@ -754,10 +765,8 @@ try {

var maybeUnwrapSymlink$1 = function maybeUnwrapSymlink(x, opts) {
if (opts && opts.preserveSymlinks === false) {
try {
return fs.realpathSync(x);
} catch (realPathErr) {
if (realPathErr.code !== 'ENOENT') {
throw realPathErr;
}
var defaultRealpathSync = function realpathSync(x) {
try {
return realpathFS$1(x);
} catch (realpathErr) {
if (realpathErr.code !== 'ENOENT') {
throw realpathErr;
}

@@ -768,2 +777,9 @@ }

var maybeRealpathSync = function maybeRealpathSync(realpathSync, x, opts) {
if (opts && opts.preserveSymlinks === false) {
return realpathSync(x);
}
return x;
};
var getPackageCandidates$1 = function getPackageCandidates(x, start, opts) {

@@ -786,2 +802,3 @@ var dirs = nodeModulesPaths(start, opts, x);

var isDirectory = opts.isDirectory || defaultIsDir$1;
var realpathSync = opts.realpathSync || defaultRealpathSync;
var packageIterator = opts.packageIterator;

@@ -796,3 +813,3 @@

// ensure that `basedir` is an absolute path at this point, resolving against the process' current working directory
var absoluteStart = maybeUnwrapSymlink$1(path.resolve(basedir), opts);
var absoluteStart = maybeRealpathSync(realpathSync, path.resolve(basedir), opts);

@@ -803,3 +820,3 @@ if ((/^(?:\.\.?(?:\/|$)|\/|([A-Za-z]:)?[/\\])/).test(x)) {

var m = loadAsFileSync(res) || loadAsDirectorySync(res);
if (m) return maybeUnwrapSymlink$1(m, opts);
if (m) return maybeRealpathSync(realpathSync, m, opts);
} else if (isCore(x)) {

@@ -809,3 +826,3 @@ return x;

var n = loadNodeModulesSync(x, absoluteStart);
if (n) return maybeUnwrapSymlink$1(n, opts);
if (n) return maybeRealpathSync(realpathSync, n, opts);
}

@@ -847,3 +864,3 @@

var pkgfile = path.join(maybeUnwrapSymlink$1(dir, opts), 'package.json');
var pkgfile = path.join(maybeRealpathSync(realpathSync, dir, opts), 'package.json');

@@ -869,3 +886,3 @@ if (!isFile(pkgfile)) {

function loadAsDirectorySync(x) {
var pkgfile = path.join(maybeUnwrapSymlink$1(x, opts), '/package.json');
var pkgfile = path.join(maybeRealpathSync(realpathSync, x, opts), '/package.json');
if (isFile(pkgfile)) {

@@ -925,10 +942,11 @@ try {

// endregion
// endregion
/* ********************************************************************************************************************
* PluginCreator
* ********************************************************************************************************************/
// region PluginCreator
/* ****************************************************************************************************************** */
// region: Module Vars & Ambients
/* ****************************************************************************************************************** */
var tsNodeIncluded = false;
var requireStack = [];
// endregion
/* ****************************************************************************************************************** */
// region: PluginCreator
/* ****************************************************************************************************************** */
/**

@@ -1110,3 +1128,4 @@ * @example

removeDiagnostic: removeDiagnostic,
diagnostics: diagnostics
diagnostics: diagnostics,
library: getCurrentLibrary()
});

@@ -1134,7 +1153,11 @@ break;

*/
/* ********************************************************************************************************************
* Helpers
* ********************************************************************************************************************/
// region Helpers
/* ****************************************************************************************************************** */
// region: Constants & Ambients
/* ****************************************************************************************************************** */
var activeProgramTransformers = new Set();
var dirname = require('path').dirname;
// endregion
/* ****************************************************************************************************************** */
// region: Helpers
/* ****************************************************************************************************************** */
function getConfig(compilerOptions, rootFileNames, defaultDir) {

@@ -1164,4 +1187,4 @@ if (compilerOptions.configFilePath === undefined) {

if ((plugins.length === 1) && plugins[0].customTransformers) {
var _a = plugins[0].customTransformers, _b = _a.before, before_1 = _b === void 0 ? [] : _b, _c = _a.after, after_1 = _c === void 0 ? [] : _c;
return __spread(before_1.map(function (item) { return ({ transform: item }); }), after_1.map(function (item) { return ({ transform: item, after: true }); }));
var _a = plugins[0].customTransformers, _b = _a.before, before = _b === void 0 ? [] : _b, _c = _a.after, after = _c === void 0 ? [] : _c;
return __spread(before.map(function (item) { return ({ transform: item }); }), after.map(function (item) { return ({ transform: item, after: true }); }));
}

@@ -1171,7 +1194,7 @@ return plugins;

// endregion
/* ********************************************************************************************************************
* createProgram (patched method)
* ********************************************************************************************************************/
/* ****************************************************************************************************************** */
// region: createProgram - (patched method)
/* ****************************************************************************************************************** */
function createProgram(rootNamesOrOptions, options, host, oldProgram, configFileParsingDiagnostics) {
var e_1, _a;
var e_1, _a, e_2, _b;
var rootNames;

@@ -1207,7 +1230,25 @@ var projectDir = process.cwd();

var pluginCreator = new PluginCreator(plugins, projectDir);
/* Prevent recursion in Program transformers */
var programTransformers = new Map(pluginCreator.getProgramTransformers());
try {
for (var _c = __values(pluginCreator.getProgramTransformers()), _d = _c.next(); !_d.done; _d = _c.next()) {
var _e = __read(_d.value, 1), transformer = _e[0];
if (activeProgramTransformers.has(transformer))
programTransformers.delete(transformer);
else
activeProgramTransformers.add(transformer);
}
}
catch (e_1_1) { e_1 = { error: e_1_1 }; }
finally {
try {
if (_d && !_d.done && (_a = _c.return)) _a.call(_c);
}
finally { if (e_1) throw e_1.error; }
}
try {
/* Transform Program */
for (var _b = __values(pluginCreator.getProgramTransformers()), _c = _b.next(); !_c.done; _c = _b.next()) {
var _d = __read(_c.value, 2), programTransformer = _d[0], config = _d[1];
var newProgram = programTransformer(program, host, config);
for (var programTransformers_1 = __values(programTransformers), programTransformers_1_1 = programTransformers_1.next(); !programTransformers_1_1.done; programTransformers_1_1 = programTransformers_1.next()) {
var _f = __read(programTransformers_1_1.value, 2), programTransformer = _f[0], config = _f[1];
var newProgram = programTransformer(program, host, config, { ts: ts });
if (typeof (newProgram === null || newProgram === void 0 ? void 0 : newProgram['emit']) === 'function')

@@ -1217,17 +1258,21 @@ program = newProgram;

}
catch (e_1_1) { e_1 = { error: e_1_1 }; }
catch (e_2_1) { e_2 = { error: e_2_1 }; }
finally {
try {
if (_c && !_c.done && (_a = _b.return)) _a.call(_b);
if (programTransformers_1_1 && !programTransformers_1_1.done && (_b = programTransformers_1.return)) _b.call(programTransformers_1);
}
finally { if (e_1) throw e_1.error; }
finally { if (e_2) throw e_2.error; }
}
/* Hook TypeScript emit method */
var originalEmit = program.emit;
program.emit = function newEmit(targetSourceFile, writeFile, cancellationToken, emitOnlyDtsFiles, customTransformers) {
var e_2, _a;
programTransformers.forEach(function (c, transformer) { return activeProgramTransformers.delete(transformer); });
/* Hook emit method */
if (!program.originalEmit) {
program.originalEmit = program.emit;
program.emit = newEmit;
}
function newEmit(targetSourceFile, writeFile, cancellationToken, emitOnlyDtsFiles, customTransformers) {
var e_3, _a;
/* Merge in our transformers */
var transformers = pluginCreator.createTransformers({ program: program }, customTransformers);
/* Invoke TS emit */
var result = originalEmit(targetSourceFile, writeFile, cancellationToken, emitOnlyDtsFiles, transformers);
var result = program.originalEmit(targetSourceFile, writeFile, cancellationToken, emitOnlyDtsFiles, transformers);
try {

@@ -1241,3 +1286,3 @@ /* Merge in transformer diagnostics */

}
catch (e_2_1) { e_2 = { error: e_2_1 }; }
catch (e_3_1) { e_3 = { error: e_3_1 }; }
finally {

@@ -1247,8 +1292,9 @@ try {

}
finally { if (e_2) throw e_2.error; }
finally { if (e_3) throw e_3.error; }
}
return result;
};
}
return program;
}
// endregion

@@ -1255,0 +1301,0 @@ /*

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc