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.20.12 to 2.20.13

4

buildstamp.json
{
"git": {
"commitId": "dd72a3acea9fce608ab1eff4bc79e232b7456554",
"commitId": "96906a97e76a8298e257de53ea572975e76d081e",
"repoUrl": "https://github.com/antongolub/tsc-esm-fix.git",
"repoName": "antongolub/tsc-esm-fix"
},
"date": "2023-01-19T10:35:26.384Z"
"date": "2023-05-02T17:53:45.976Z"
}

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

## [2.20.13](https://github.com/antongolub/tsc-esm-fix/compare/v2.20.12...v2.20.13) (2023-05-02)
### Bug Fixes
* **deps:** update dependency meow to v12 ([96906a9](https://github.com/antongolub/tsc-esm-fix/commit/96906a97e76a8298e257de53ea572975e76d081e))
## [2.20.5](https://github.com/antongolub/tsc-esm-fix/compare/v2.20.4...v2.20.5) (2022-10-11)

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

{
"name": "tsc-esm-fix",
"version": "2.20.12",
"version": "2.20.13",
"private": false,

@@ -20,3 +20,2 @@ "publishConfig": {

},
"source": "src/main/ts/index.ts",
"main": "target/bundle/tsc-esm-fix.js",

@@ -34,3 +33,3 @@ "module": "target/bundle/tsc-esm-fix.mjs",

"test:deps": "npm-run-all -p -l test:depcheck test:depauditfix",
"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",
"test:depcheck": "npm_config_yes=true npx depcheck --ignore-patterns fixtures --ignores glob-runner,tslib,@types/jest,@types/node,eslint-config-*,typedoc,mkdirp,rimraf",
"test:depaudit": "yarn audit --groups=dependencies --level=moderate; [[ $? -ge 4 ]] && exit 1 || exit 0",

@@ -60,30 +59,30 @@ "test:depauditfix": "npm_config_yes=true npx yarn-audit-fix --audit-level=moderate",

"globby": "^13.1.3",
"json5": "^2.2.1",
"meow": "^11.0.0",
"tslib": "^2.4.1"
"json5": "^2.2.3",
"meow": "^12.0.0",
"tslib": "^2.5.0"
},
"devDependencies": {
"@types/fs-extra": "^11.0.0",
"@types/fs-extra": "^11.0.1",
"@qiwi/npm-run-all": "^4.1.7",
"@types/jest": "^29.2.4",
"@types/node": "^18.11.15",
"@types/jest": "^29.5.0",
"@types/node": "^18.15.3",
"@types/semver": "^7.3.13",
"cpy-cli": "^4.2.0",
"cross-env": "^7.0.3",
"eslint": "^8.29.0",
"eslint-config-prettier": "^8.5.0",
"eslint-config-qiwi": "^1.17.8",
"eslint": "^8.36.0",
"eslint-config-prettier": "^8.7.0",
"eslint-config-qiwi": "^2.1.1",
"glob-runner": "^1.0.6",
"jest": "^29.3.1",
"jest": "^29.5.0",
"microbundle": "^0.15.1",
"mkdirp": "^1.0.4",
"prettier": "^2.8.1",
"prettier-config-qiwi": "^2.0.1",
"rimraf": "^3.0.2",
"mkdirp": "^3.0.0",
"prettier": "^2.8.5",
"prettier-config-qiwi": "^2.1.0",
"rimraf": "^5.0.0",
"semver": "^7.3.8",
"tempy": "^3.0.0",
"terser": "^5.16.1",
"ts-jest": "^29.0.3",
"typedoc": "^0.23.22",
"typescript": "4.9"
"terser": "^5.16.6",
"ts-jest": "^29.0.5",
"typedoc": "^0.24.0",
"typescript": "^5.0.2"
},

@@ -90,0 +89,0 @@ "repository": {

#!/usr/bin/env node
export {};

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

export { fix, fixBlankFiles, fixContents, fixFilenameVar, fixDirnameVar, fixModuleReferences, fixFilenameExtensions, fixDefaultExport, fixSourceMapRef, DEFAULT_FIX_OPTIONS, } from './fix';
export * from './interface';

@@ -0,0 +0,0 @@ type IFunction<A extends any[] = any[], R = any> = (...args: A) => R;

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

!function(e,n){"object"==typeof exports&&"undefined"!=typeof module?n(exports,require("node:path"),require("fs-extra"),require("globby"),require("json5"),require("node:fs")):"function"==typeof define&&define.amd?define(["exports","node:path","fs-extra","globby","json5","node:fs"],n):n((e||self).tscEsmFix={},e.node_path,e.fsExtra,e.globby,e.json5,e.node_fs)}(this,function(e,n,r,t,o,u){function i(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var s=/*#__PURE__*/i(r),c=/*#__PURE__*/i(o);function l(){return l=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},l.apply(this,arguments)}var a=function(e){return s.default.readFileSync(e,{encoding:"utf8"})},f=function(e,n){return s.default.outputFileSync(e,n,{encoding:"utf8"})},d=function(e){return c.default.parse(a(e))},m=function(e){return e?Array.isArray(e)?e:[e]:[]},p=s.default.unlinkSync,g=function(e){return e.replace(/\\/g,"/")},v=function e(r){var t=d(r);if(t.extends){var o=e(n.resolve(n.dirname(r),t.extends));return l({},o,t,{compilerOptions:l({},o.compilerOptions,t.compilerOptions)})}return t},b={cwd:process.cwd(),tsconfig:"./tsconfig.json",filenameVar:!0,dirnameVar:!0,ext:!0,unlink:!0,debug:function(){}},h=function(e,r){return m(e).reduce(function(e,t){var o,u,i=v(n.resolve(r,t)),s=null==i||null==(o=i.compilerOptions)?void 0:o.outDir,c=null==i||null==(u=i.compilerOptions)||null==u.module.toLowerCase?void 0:u.module.toLowerCase();return s&&c.startsWith("es")?e.push(s):console.warn("tsconfig should declare `outDir` and `module` type es6 or above"),e},[])},x=function(e,n){return e.map(function(e){return e.endsWith(".d.ts")?e:e.replace(/\.[^./\\]+$/,n)})},y=function(e,r,t,o,u){return e.replace(/(\sfrom\s|[\s(:[](?:import|require)[ (])(["'])([^"']+\/[^"']+|\.{1,2})\/?(["'])/g,function(e,i,s,c,l){return""+i+s+(u.includes(c)?c:function(e,r,t,o){var u=n.dirname(e),i=n.resolve(o,"node_modules"),s=/^\..+\.[^./\\]+$/.test(r)?[r,r.replace(/\.[^./\\]+$/,"")]:[r],c=[".js",".cjs",".mjs"].reduce(function(e,n){return s.forEach(function(r){return e.push(""+r+n,r+"/index"+n)}),e},[]);return c.find(function(e){return t.includes(g(n.resolve(u,e)))})||c.find(function(e){return t.includes(g(n.resolve(i,e)))})||r}(r,c,t,o))+l})},j=function(e,n){return e.replace(/__dirname/g,"`${process.platform === 'win32' ? '' : '/'}${/file:\\/{2,3}(.+)\\/[^/]/.exec(import.meta.url)"+(n?"!":"")+"[1]}`")},P=function(e,n){return e.replace(/__filename/g,"`${process.platform === 'win32' ? '' : '/'}${/file:\\/{2,3}(.+)/.exec(import.meta.url)"+(n?"!":"")+"[1]}`")},_=function(e){return e.includes("export default")?e:e+"\nexport default undefined\n"},O=function(e){return 0===e.trim().length?"\nexport {}\nexport default undefined\n":e},w=function(e,r,t){return r===t?e:e.replace("//# sourceMappingURL="+n.basename(r)+".map","//# sourceMappingURL="+n.basename(t)+".map")},F=function(e,n,r,t,o,u,i){var s=t.dirnameVar,c=t.filenameVar,l=t.fillBlank,a=t.forceDefaultExport,f=t.sourceMap;void 0===o&&(o=n),void 0===u&&(u=!1),void 0===i&&(i=[]);var d=e;return t.ext&&(d=y(d,n,r,t.cwd,i)),s&&(d=j(d,u)),c&&(d=P(d,u)),l&&(d=O(d)),a&&(d=_(d)),f&&(d=w(d,o,n)),d},M=function(e,r){if(!r)return e;var t=r;return t.includes("*")&&(t=t.slice(0,t.indexOf("*"))).includes("/")&&(t=t.slice(0,t.lastIndexOf("/"))),n.join(e,t)};e.DEFAULT_FIX_OPTIONS=b,e.fix=function(e){try{var r=function(e){return l({},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),o=r.cwd,i=r.target,s=r.src,c=r.tsconfig,v=r.out,y=r.ext,j=r.debug,P=r.unlink,_=r.sourceMap,O=n.resolve(o,void 0===v?o:v),w=m(s),k=[].concat(m(i),h(c,o));j("debug:cwd",o),j("debug:outdir",O),j("debug:sources",w),j("debug:targets",k);var E=w.length>0,S=function(e,n){return e.length>0?e.map(function(e){return e.includes("*")?e:e+"/**/*.{ts,tsx}"}):n.map(function(e){return e.includes("*")?e:e+"/**/*.{js,d.ts}"})}(w,k);return Promise.resolve(t.globby(S,{cwd:o,onlyFiles:!0,absolute:!0})).then(function(e){return Promise.resolve(function(e){try{return Promise.resolve(function(e){return t.globby(["node_modules/*/package.json","node_modules/@*/*/package.json"],{cwd:e,onlyFiles:!0,absolute:!0}).then(function(e){try{return Promise.resolve(Promise.all(e.map(function(e){try{return Promise.resolve(d(e)).then(function(r){var o=r.name,u=r.exports;if(!u)return{};var i=n.dirname(e),s=function(e){var n=Object.entries(e),r=function e(n){return"string"==typeof n?[n]:Object.values(n).map(e).flat(2)};return"string"!=typeof e&&Object.keys(e).some(function(e){return e.startsWith(".")})?n.map(function(e){return[e[0],r(e[1])]}):[[".",r(e)]]}(u);return Promise.resolve(Promise.all(s.map(function(e){var r=e[0];return Promise.all(e[1].map(function(e){try{return Promise.resolve(t.globby(e,{cwd:i,onlyFiles:!0,absolute:!1})).then(function(t){return t.map(function(t){return n.join(t).replace(M(".",e),M(o,r))})})}catch(e){return Promise.reject(e)}}))}))).then(function(e){return{name:o,files:e.flat(2)}})})}catch(e){return Promise.reject(e)}}))).then(function(e){return e.reduce(function(e,n){var r,t=n.name,o=n.files;return t&&e.names.push(t),o&&(r=e.files).push.apply(r,o),e},{names:[],files:[]})})}catch(e){return Promise.reject(e)}})}(e)).then(function(n){var r=n.files;return Promise.resolve(t.globby(["node_modules/**/*.(m|c)?js","!node_modules/.cache","!node_modules/.bin","!node_modules/**/node_modules"].concat(n.names.map(function(e){return"!node_modules/"+e})),{cwd:e,onlyFiles:!0,absolute:!0})).then(function(e){return{cjsModules:e,esmModules:r}})})}catch(e){return Promise.reject(e)}}(o)).then(function(t){var i=t.cjsModules,s=t.esmModules;j("debug:external-cjs-modules",i),j("debug:external-esm-modules",s);var c="string"==typeof y?x(e,y):e,l=[].concat(i,c),m=[].concat(i,x(e,".js"));j("debug:local-modules",c),c.forEach(function(t,i){var c=t.endsWith(".d.ts")?m:l,v=e[i],b=(0===w.length?t:v).replace(g(o),g(O)),h=a(v),x=F(h,t,c,r,v,E,s);f(b,x),0===w.length&&P&&o===O&&b!==v&&p(v),_&&function(e,r,t){if(void 0===t&&(t=!1),e!==r){var o=e+".map";if(u.existsSync(o)){var i=r+".map",s=d(o);s.file=n.basename(r),f(i,JSON.stringify(s)),t&&p(o)}}}(v,b,P&&o===O)})})})}catch(e){return Promise.reject(e)}},e.fixBlankFiles=O,e.fixContents=F,e.fixDefaultExport=_,e.fixDirnameVar=j,e.fixFilenameExtensions=x,e.fixFilenameVar=P,e.fixModuleReferences=y,e.fixSourceMapRef=w});
!function(e,n){"object"==typeof exports&&"undefined"!=typeof module?n(exports,require("node:path"),require("fs-extra"),require("json5"),require("globby"),require("node:fs")):"function"==typeof define&&define.amd?define(["exports","node:path","fs-extra","json5","globby","node:fs"],n):n((e||self).tscEsmFix={},e.node_path,e.fsExtra,e.json5,e.globby,e.node_fs)}(this,function(e,n,r,t,o,u){function i(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var s=/*#__PURE__*/i(r),c=/*#__PURE__*/i(t);function l(){return l=Object.assign?Object.assign.bind():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},l.apply(this,arguments)}var a=function(e){return s.default.readFileSync(e,{encoding:"utf8"})},f=function(e,n){return s.default.outputFileSync(e,n,{encoding:"utf8"})},d=function(e){return c.default.parse(a(e))},m=function(e){return e?Array.isArray(e)?e:[e]:[]},p=s.default.unlinkSync,g=function(e){return e.replace(/\\/g,"/")},v=function e(r){var t=d(r);if(t.extends){var o=e(n.resolve(n.dirname(r),t.extends));return l({},o,t,{compilerOptions:l({},o.compilerOptions,t.compilerOptions)})}return t},b={cwd:process.cwd(),tsconfig:"./tsconfig.json",filenameVar:!0,dirnameVar:!0,ext:!0,unlink:!0,debug:function(){}},h=function(e,r){return m(e).reduce(function(e,t){var o,u,i=v(n.resolve(r,t)),s=null==i||null==(o=i.compilerOptions)?void 0:o.outDir,c=null==i||null==(u=i.compilerOptions)||null==u.module.toLowerCase?void 0:u.module.toLowerCase();return s&&c.startsWith("es")?e.push(s):console.warn("tsconfig should declare `outDir` and `module` type es6 or above"),e},[])},x=function(e,n){return e.map(function(e){return e.endsWith(".d.ts")?e:e.replace(/\.[^./\\]+$/,n)})},y=function(e,r,t,o,u){return e.replace(/(\sfrom\s|[\s(:[](?:import|require)[ (])(["'])([^"']+\/[^"']+|\.{1,2})\/?(["'])/g,function(e,i,s,c,l){return""+i+s+(u.includes(c)?c:function(e,r,t,o){var u=n.dirname(e),i=n.resolve(o,"node_modules"),s=/^\..+\.[^./\\]+$/.test(r)?[r,r.replace(/\.[^./\\]+$/,"")]:[r],c=[".js",".cjs",".mjs"].reduce(function(e,n){return s.forEach(function(r){return e.push(""+r+n,r+"/index"+n)}),e},[]);return c.find(function(e){return t.includes(g(n.resolve(u,e)))})||c.find(function(e){return t.includes(g(n.resolve(i,e)))})||r}(r,c,t,o))+l})},j=function(e,n){return e.replace(/__dirname/g,"`${process.platform === 'win32' ? '' : '/'}${/file:\\/{2,3}(.+)\\/[^/]/.exec(import.meta.url)"+(n?"!":"")+"[1]}`")},P=function(e,n){return e.replace(/__filename/g,"`${process.platform === 'win32' ? '' : '/'}${/file:\\/{2,3}(.+)/.exec(import.meta.url)"+(n?"!":"")+"[1]}`")},O=function(e){return e.includes("export default")?e:e+"\nexport default undefined\n"},_=function(e){return 0===e.trim().length?"\nexport {}\nexport default undefined\n":e},w=function(e,r,t){return r===t?e:e.replace("//# sourceMappingURL="+n.basename(r)+".map","//# sourceMappingURL="+n.basename(t)+".map")},F=function(e,n,r,t,o,u,i){var s=t.dirnameVar,c=t.filenameVar,l=t.fillBlank,a=t.forceDefaultExport,f=t.sourceMap;void 0===o&&(o=n),void 0===u&&(u=!1),void 0===i&&(i=[]);var d=e;return t.ext&&(d=y(d,n,r,t.cwd,i)),s&&(d=j(d,u)),c&&(d=P(d,u)),l&&(d=_(d)),a&&(d=O(d)),f&&(d=w(d,o,n)),d},M=function(e,r){if(!r)return e;var t=r;return t.includes("*")&&(t=t.slice(0,t.indexOf("*"))).includes("/")&&(t=t.slice(0,t.lastIndexOf("/"))),n.join(e,t)};e.DEFAULT_FIX_OPTIONS=b,e.fix=function(e){try{var r=function(e){return l({},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,i=r.target,s=r.src,c=r.tsconfig,v=r.out,y=r.ext,j=r.debug,P=r.unlink,O=r.sourceMap,_=n.resolve(t,void 0===v?t:v),w=m(s),k=[].concat(m(i),h(c,t));j("debug:cwd",t),j("debug:outdir",_),j("debug:sources",w),j("debug:targets",k);var E=w.length>0,S=function(e,n){return e.length>0?e.map(function(e){return e.includes("*")?e:e+"/**/*.{ts,tsx}"}):n.map(function(e){return e.includes("*")?e:e+"/**/*.{js,d.ts}"})}(w,k);return Promise.resolve(o.globby(S,{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","node_modules/@*/*/package.json"],{cwd:e,onlyFiles:!0,absolute:!0}).then(function(e){try{return Promise.resolve(Promise.all(e.map(function(e){try{return Promise.resolve(d(e)).then(function(r){var t=r.name,u=r.exports;if(!u)return{};var i=n.dirname(e),s=function(e){var n=Object.entries(e),r=function e(n){return"string"==typeof n?[n]:Object.values(n).map(e).flat(2)};return"string"!=typeof e&&Object.keys(e).some(function(e){return e.startsWith(".")})?n.map(function(e){return[e[0],r(e[1])]}):[[".",r(e)]]}(u);return Promise.resolve(Promise.all(s.map(function(e){var r=e[0];return Promise.all(e[1].map(function(e){try{return Promise.resolve(o.globby(e,{cwd:i,onlyFiles:!0,absolute:!1})).then(function(o){return o.map(function(o){return n.join(o).replace(M(".",e),M(t,r))})})}catch(e){return Promise.reject(e)}}))}))).then(function(e){return{name:t,files:e.flat(2)}})})}catch(e){return Promise.reject(e)}}))).then(function(e){return e.reduce(function(e,n){var r,t=n.name,o=n.files;return t&&e.names.push(t),o&&(r=e.files).push.apply(r,o),e},{names:[],files:[]})})}catch(e){return Promise.reject(e)}})}(e)).then(function(n){var r=n.files;return Promise.resolve(o.globby(["node_modules/**/*.(m|c)?js","!node_modules/.cache","!node_modules/.bin","!node_modules/**/node_modules"].concat(n.names.map(function(e){return"!node_modules/"+e})),{cwd:e,onlyFiles:!0,absolute:!0})).then(function(e){return{cjsModules:e,esmModules:r}})})}catch(e){return Promise.reject(e)}}(t)).then(function(o){var i=o.cjsModules,s=o.esmModules;j("debug:external-cjs-modules",i),j("debug:external-esm-modules",s);var c="string"==typeof y?x(e,y):e,l=[].concat(i,c),m=[].concat(i,x(e,".js"));j("debug:local-modules",c),c.forEach(function(o,i){var c=o.endsWith(".d.ts")?m:l,v=e[i],b=(0===w.length?o:v).replace(g(t),g(_)),h=a(v),x=F(h,o,c,r,v,E,s);f(b,x),0===w.length&&P&&t===_&&b!==v&&p(v),O&&function(e,r,t){if(void 0===t&&(t=!1),e!==r){var o=e+".map";if(u.existsSync(o)){var i=r+".map",s=d(o);s.file=n.basename(r),f(i,JSON.stringify(s)),t&&p(o)}}}(v,b,P&&t===_)})})})}catch(e){return Promise.reject(e)}},e.fixBlankFiles=_,e.fixContents=F,e.fixDefaultExport=O,e.fixDirnameVar=j,e.fixFilenameExtensions=x,e.fixFilenameVar=P,e.fixModuleReferences=y,e.fixSourceMapRef=w});
//# sourceMappingURL=tsc-esm-fix.umd.js.map
/// <reference types="node" />
import fse from 'fs-extra';
import { globby } from 'globby';
import { TSConfig } from './interface';
export { globby };
export { globby } from 'globby';
export { existsSync } from 'node:fs';

@@ -7,0 +6,0 @@ export declare const read: (file: string) => string;

/// <reference types="node" />
import fse from 'fs-extra';
import { globby } from 'globby';
import { TSConfig } from './interface.js';
export { globby };
export { globby } from 'globby';
export { existsSync } from 'node:fs';

@@ -7,0 +6,0 @@ export declare const read: (file: string) => string;

import { dirname, resolve } from 'node:path'
import fse from 'fs-extra'
import { globby } from 'globby'
import json5 from 'json5'

@@ -9,3 +8,3 @@

export { globby }
export { globby } from 'globby'

@@ -12,0 +11,0 @@ export { existsSync } from 'node:fs'

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