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

tsc-esm-fix

Package Overview
Dependencies
Maintainers
1
Versions
77
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

tsc-esm-fix - npm Package Compare versions

Comparing version 2.12.4 to 2.13.0

4

buildstamp.json
{
"git": {
"commitId": "9f6743a349a00f9096c0a5ed2b4c7a167f6b1c5d",
"commitId": "aa649c3f0a34a39bf87982ef8d3772a9d7999608",
"repoUrl": "https://github.com/antongolub/tsc-esm-fix",
"repoName": "antongolub/tsc-esm-fix"
},
"date": "2022-04-08T07:54:19.437Z"
"date": "2022-04-22T12:15:45.188Z"
}

@@ -0,1 +1,8 @@

# [2.13.0](https://github.com/antongolub/tsc-esm-fix/compare/v2.12.4...v2.13.0) (2022-04-22)
### Features
* add nodejs v18 support ([baafd95](https://github.com/antongolub/tsc-esm-fix/commit/baafd9522b26052a58f3b56770efc05c50477dbc))
## [2.12.4](https://github.com/antongolub/tsc-esm-fix/compare/v2.12.3...v2.12.4) (2022-04-08)

@@ -2,0 +9,0 @@

{
"name": "tsc-esm-fix",
"version": "2.12.4",
"version": "2.13.0",
"private": false,

@@ -31,3 +31,3 @@ "publishConfig": {

"test:unit": "NODE_OPTIONS=--experimental-vm-modules jest --config=jest.config.json --runInBand",
"test:it": "cross-env NODE_OPTIONS=\"--experimental-vm-modules --experimental-modules\" npx glob-runner src/test/**/*.it.js",
"test:it": "npx cross-env NODE_OPTIONS=\"--experimental-vm-modules --experimental-modules\" npx glob-runner src/test/**/*.it.js",
"test:deps": "npm-run-all -p -l test:depcheck test:depauditfix",

@@ -58,7 +58,7 @@ "test:depcheck": "npm_config_yes=true npx -p depcheck -p @babel/parser@7.16.4 depcheck --ignore-patterns fixtures --ignores glob-runner,tslib,@types/jest,@types/node,eslint-config-*,typedoc",

"@types/fs-extra": "^9.0.13",
"fs-extra": "^10.0.1",
"fs-extra": "^10.1.0",
"globby": "^13.1.1",
"json5": "^2.2.1",
"meow": "^10.1.2",
"tslib": "^2.3.1"
"tslib": "^2.4.0"
},

@@ -68,6 +68,7 @@ "devDependencies": {

"@types/jest": "^27.4.1",
"@types/node": "^17.0.23",
"@types/node": "^17.0.25",
"@types/semver": "^7.3.9",
"cpy-cli": "^4.1.0",
"cross-env": "^7.0.3",
"eslint": "^8.12.0",
"eslint": "^8.13.0",
"eslint-config-prettier": "^8.5.0",

@@ -82,6 +83,7 @@ "eslint-config-qiwi": "^1.16.1",

"rimraf": "^3.0.2",
"tempy": "^2.0.0",
"semver": "^7.3.7",
"tempy": "^3.0.0",
"terser": "^5.12.1",
"ts-jest": "^27.1.4",
"typedoc": "^0.22.14",
"typedoc": "^0.22.15",
"typescript": "4.6"

@@ -88,0 +90,0 @@ },

@@ -43,3 +43,3 @@ # tsc-esm-fix

This lib covers 1 and 2 options.
This lib covers options 1 and 2.

@@ -46,0 +46,0 @@ ### Features

@@ -1,2 +0,2 @@

!function(e,n){"object"==typeof exports&&"undefined"!=typeof module?n(exports,require("path"),require("fs"),require("fs-extra"),require("globby"),require("json5")):"function"==typeof define&&define.amd?define(["exports","path","fs","fs-extra","globby","json5"],n):n((e||self).tscEsmFix={},e.path,e.fs,e.fsExtra,e.globby,e.json5)}(this,function(e,n,r,t,o,u){function i(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var c=/*#__PURE__*/i(t),l=/*#__PURE__*/i(u);function s(){return s=Object.assign||function(e){for(var n=1;n<arguments.length;n++){var r=arguments[n];for(var t in r)Object.prototype.hasOwnProperty.call(r,t)&&(e[t]=r[t])}return e},s.apply(this,arguments)}var a=function(e){return r.readFileSync(e,{encoding:"utf8"})},f=function(e){return l.default.parse(a(e))},d=function(e){return e?Array.isArray(e)?e:[e]:[]},m=r.unlinkSync,p=function(e){return e.replace(/\\/g,"/")},g=function e(r){var t=f(r);if(t.extends){var o=e(n.resolve(n.dirname(r),t.extends));return s({},o,t,{compilerOptions:s({},o.compilerOptions,t.compilerOptions)})}return t},b={cwd:process.cwd(),tsconfig:"./tsconfig.json",filenameVar:!0,dirnameVar:!0,ext:!0,unlink:!0,debug:function(){}},v=function(e,r){return d(e).reduce(function(e,t){var o,u,i=g(n.resolve(r,t)),c=null==i||null==(o=i.compilerOptions)?void 0:o.outDir,l=null==i||null==(u=i.compilerOptions)||null==u.module.toLowerCase?void 0:u.module.toLowerCase();return c&&l.startsWith("es")?e.push(c):console.warn("tsconfig should declare `outDir` and `module` type es6 or above"),e},[])},x=function(e,n){return e.map(function(e){return e.replace(/\.[^./\\]+$/,n)})},y=function(e,r,t,o){return e.replace(/(\sfrom\s|[\s(](?:import|require)[ (])(["'])([^"']+\/[^"']+)(["'])/g,function(e,u,i,c,l){return""+u+i+function(e,r,t,o){var u=n.dirname(e),i=n.resolve(o,"node_modules"),c=/^\..+\.[^./\\]+$/.test(r)?[r,r.replace(/\.[^./\\]+$/,"")]:[r],l=[".js",".cjs",".mjs"].reduce(function(e,n){return c.forEach(function(r){return e.push(""+r+n,r+"/index"+n)}),e},[]);return l.find(function(e){return t.includes(p(n.resolve(u,e)))})||l.find(function(e){return t.includes(p(n.resolve(i,e)))})||r}(r,c,t,o)+l})},h=function(e){return e.replace(/__dirname/g,"/file:\\/\\/(.+)\\/[^/]/.exec(import.meta.url)[1]")},j=function(e){return e.replace(/__filename/g,"/file:\\/\\/(.+)/.exec(import.meta.url)[1]")},_=function(e){return 0===e.trim().length?"\nexport {}\nexport default undefined\n":e},w=function(e,n,r,t){var o=t.dirnameVar,u=t.filenameVar,i=t.fillBlank,c=e;return t.ext&&(c=y(c,n,r,t.cwd)),o&&(c=h(c)),u&&(c=j(c)),i&&(c=_(c)),c};e.DEFAULT_FIX_OPTIONS=b,e.fix=function(e){try{var r=function(e){return s({},b,e,{debug:"function"==typeof(null==e?void 0:e.debug)?e.debug:!0===(null==e?void 0:e.debug)?console.log:b.debug})}(e),t=r.cwd,u=r.target,i=r.src,l=r.tsconfig,g=r.out,y=r.ext,h=r.debug,j=r.unlink,_=n.resolve(t,void 0===g?t:g),F=d(i),O=[].concat(d(u),v(l,t));h("debug:cwd",t),h("debug:outdir",_),h("debug:sources",F),h("debug:targets",O);var P=F.length>0?F.map(function(e){return e+"/**/*.ts"}):O.map(function(e){return e+"/**/*.js"});return Promise.resolve(o.globby(P,{cwd:t,onlyFiles:!0,absolute:!0})).then(function(e){return Promise.resolve(function(e){try{return Promise.resolve(function(e){return o.globby(["node_modules/*/package.json"],{cwd:e,onlyFiles:!0,absolute:!0}).then(function(e){return e.filter(function(e){return f(e).exports}).map(function(e){return n.basename(n.dirname(e))})})}(e)).then(function(n){return o.globby(["node_modules/**/*.(m|c)?js","!node_modules/.cache","!node_modules/.bin","!node_modules/**/node_modules"].concat(n.map(function(e){return"!node_modules/"+e})),{cwd:e,onlyFiles:!0,absolute:!0})})}catch(e){return Promise.reject(e)}}(t)).then(function(n){h("debug:external-names",n);var o="string"==typeof y?x(e,y):e;h("debug:local-names",o);var u=[].concat(n,o);o.forEach(function(n,o){var l=(i?e[o]:n).replace(p(t),p(_)),s=a(e[o]);!function(e,n){c.default.outputFileSync(e,n,{encoding:"utf8"})}(l,w(s,n,u,r)),!i&&j&&t===_&&l!==e[o]&&m(e[o])})})})}catch(e){return Promise.reject(e)}},e.fixBlankFiles=_,e.fixContents=w,e.fixDirnameVar=h,e.fixFilenameExtensions=x,e.fixFilenameVar=j,e.fixModuleReferences=y});
!function(e,n){"object"==typeof exports&&"undefined"!=typeof module?n(exports,require("node:path"),require("fs"),require("fs-extra"),require("globby"),require("json5")):"function"==typeof define&&define.amd?define(["exports","node:path","fs","fs-extra","globby","json5"],n):n((e||self).tscEsmFix={},e.node_path,e.fs,e.fsExtra,e.globby,e.json5)}(this,function(e,n,r,t,o,u){function i(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var c=/*#__PURE__*/i(t),l=/*#__PURE__*/i(u);function s(){return s=Object.assign||function(e){for(var n=1;n<arguments.length;n++){var r=arguments[n];for(var t in r)Object.prototype.hasOwnProperty.call(r,t)&&(e[t]=r[t])}return e},s.apply(this,arguments)}var a=function(e){return r.readFileSync(e,{encoding:"utf8"})},f=function(e){return l.default.parse(a(e))},d=function(e){return e?Array.isArray(e)?e:[e]:[]},m=r.unlinkSync,p=function(e){return e.replace(/\\/g,"/")},g=function e(r){var t=f(r);if(t.extends){var o=e(n.resolve(n.dirname(r),t.extends));return s({},o,t,{compilerOptions:s({},o.compilerOptions,t.compilerOptions)})}return t},b={cwd:process.cwd(),tsconfig:"./tsconfig.json",filenameVar:!0,dirnameVar:!0,ext:!0,unlink:!0,debug:function(){}},v=function(e,r){return d(e).reduce(function(e,t){var o,u,i=g(n.resolve(r,t)),c=null==i||null==(o=i.compilerOptions)?void 0:o.outDir,l=null==i||null==(u=i.compilerOptions)||null==u.module.toLowerCase?void 0:u.module.toLowerCase();return c&&l.startsWith("es")?e.push(c):console.warn("tsconfig should declare `outDir` and `module` type es6 or above"),e},[])},x=function(e,n){return e.map(function(e){return e.replace(/\.[^./\\]+$/,n)})},y=function(e,r,t,o){return e.replace(/(\sfrom\s|[\s(](?:import|require)[ (])(["'])([^"']+\/[^"']+)(["'])/g,function(e,u,i,c,l){return""+u+i+function(e,r,t,o){var u=n.dirname(e),i=n.resolve(o,"node_modules"),c=/^\..+\.[^./\\]+$/.test(r)?[r,r.replace(/\.[^./\\]+$/,"")]:[r],l=[".js",".cjs",".mjs"].reduce(function(e,n){return c.forEach(function(r){return e.push(""+r+n,r+"/index"+n)}),e},[]);return l.find(function(e){return t.includes(p(n.resolve(u,e)))})||l.find(function(e){return t.includes(p(n.resolve(i,e)))})||r}(r,c,t,o)+l})},h=function(e){return e.replace(/__dirname/g,"/file:\\/\\/(.+)\\/[^/]/.exec(import.meta.url)[1]")},j=function(e){return e.replace(/__filename/g,"/file:\\/\\/(.+)/.exec(import.meta.url)[1]")},_=function(e){return 0===e.trim().length?"\nexport {}\nexport default undefined\n":e},w=function(e,n,r,t){var o=t.dirnameVar,u=t.filenameVar,i=t.fillBlank,c=e;return t.ext&&(c=y(c,n,r,t.cwd)),o&&(c=h(c)),u&&(c=j(c)),i&&(c=_(c)),c};e.DEFAULT_FIX_OPTIONS=b,e.fix=function(e){try{var r=function(e){return s({},b,e,{debug:"function"==typeof(null==e?void 0:e.debug)?e.debug:!0===(null==e?void 0:e.debug)?console.log:b.debug})}(e),t=r.cwd,u=r.target,i=r.src,l=r.tsconfig,g=r.out,y=r.ext,h=r.debug,j=r.unlink,_=n.resolve(t,void 0===g?t:g),F=d(i),O=[].concat(d(u),v(l,t));h("debug:cwd",t),h("debug:outdir",_),h("debug:sources",F),h("debug:targets",O);var P=F.length>0?F.map(function(e){return e+"/**/*.ts"}):O.map(function(e){return e+"/**/*.js"});return Promise.resolve(o.globby(P,{cwd:t,onlyFiles:!0,absolute:!0})).then(function(e){return Promise.resolve(function(e){try{return Promise.resolve(function(e){return o.globby(["node_modules/*/package.json"],{cwd:e,onlyFiles:!0,absolute:!0}).then(function(e){return e.filter(function(e){return f(e).exports}).map(function(e){return n.basename(n.dirname(e))})})}(e)).then(function(n){return o.globby(["node_modules/**/*.(m|c)?js","!node_modules/.cache","!node_modules/.bin","!node_modules/**/node_modules"].concat(n.map(function(e){return"!node_modules/"+e})),{cwd:e,onlyFiles:!0,absolute:!0})})}catch(e){return Promise.reject(e)}}(t)).then(function(n){h("debug:external-names",n);var o="string"==typeof y?x(e,y):e;h("debug:local-names",o);var u=[].concat(n,o);o.forEach(function(n,o){var l=(i?e[o]:n).replace(p(t),p(_)),s=a(e[o]);!function(e,n){c.default.outputFileSync(e,n,{encoding:"utf8"})}(l,w(s,n,u,r)),!i&&j&&t===_&&l!==e[o]&&m(e[o])})})})}catch(e){return Promise.reject(e)}},e.fixBlankFiles=_,e.fixContents=w,e.fixDirnameVar=h,e.fixFilenameExtensions=x,e.fixFilenameVar=j,e.fixModuleReferences=y});
//# sourceMappingURL=tsc-esm-fix.umd.js.map
import { Options as GlobbyOptions } from 'globby'
import { basename, dirname, resolve } from 'path'
import { basename, dirname, resolve } from 'node:path'

@@ -4,0 +4,0 @@ import { IFixOptions, IFixOptionsNormalized } from './interface'

@@ -5,3 +5,3 @@ import { readFileSync, unlinkSync } from 'fs'

import json5 from 'json5'
import { dirname, resolve } from 'path'
import { dirname, resolve } from 'node:path'

@@ -8,0 +8,0 @@ import { TSConfig } from './interface'

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

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