@esmj/size
Advanced tools
+10
-0
@@ -0,1 +1,11 @@ | ||
| ## 0.8.0 (2025-09-12) | ||
| * feat: ๐ธ add new CLI option code which replace exports ([6da8d5c](https://github.com/mjancarik/esmj-size/commit/6da8d5c)) | ||
| ### BREAKING CHANGE | ||
| * ๐งจ The export CLI option was removed. | ||
| ## <small>0.7.1 (2025-09-12)</small> | ||
@@ -2,0 +12,0 @@ |
+1
-1
| { | ||
| "name": "@esmj/size", | ||
| "version": "0.7.1", | ||
| "version": "0.8.0", | ||
| "description": "JavaScript Package Size Cost like bundlephobia or import-cost", | ||
@@ -5,0 +5,0 @@ "keywords": [ |
@@ -95,3 +95,3 @@ import { jest } from '@jest/globals'; | ||
| it('should create index file with exported statements for packages', async () => { | ||
| it('should create index file with code snippet for packages', async () => { | ||
| await module.createIndex({ | ||
@@ -101,4 +101,3 @@ TMP: 'folder', | ||
| options: { | ||
| exports: | ||
| 'export { useState } from "react", export { useEffect } from "react-dom";', | ||
| code: 'export { useState } from "react"; export { useEffect } from "react-dom";console.log(useState,useEffect);', | ||
| }, | ||
@@ -110,8 +109,7 @@ }); | ||
| ); | ||
| expect(writeFile.mock.calls[0][1]).toMatchInlineSnapshot(` | ||
| "export { useState } from "react"; | ||
| export { useEffect } from "react-dom";" | ||
| `); | ||
| expect(writeFile.mock.calls[0][1]).toMatchInlineSnapshot( | ||
| `"export { useState } from "react"; export { useEffect } from "react-dom";console.log(useState,useEffect);"`, | ||
| ); | ||
| }); | ||
| }); | ||
| }); |
@@ -11,9 +11,4 @@ import os from 'node:os'; | ||
| if (options?.exports) { | ||
| indexImports = options.exports | ||
| .split(',') | ||
| .map((statement) => statement.trim()) | ||
| .map((statement) => | ||
| statement[statement.length - 1] !== ';' ? `${statement};` : statement, | ||
| ); | ||
| if (options?.code) { | ||
| indexImports = [options.code.trim()]; | ||
| } else { | ||
@@ -20,0 +15,0 @@ indexImports = imports.map((imp) => { |
+1
-1
@@ -50,3 +50,3 @@ import path from 'node:path'; | ||
| .option('--pretty', 'log only pretty print object') | ||
| .option('--exports <string>', 'export statements') | ||
| .option('--code <string>', 'code snippet') | ||
| .option( | ||
@@ -53,0 +53,0 @@ '--bundle', |
URL strings
Supply chain riskPackage contains fragments of external URLs or IP addresses, which the package may be accessing at runtime.
Found 1 instance in 1 package
URL strings
Supply chain riskPackage contains fragments of external URLs or IP addresses, which the package may be accessing at runtime.
Found 1 instance in 1 package
40186
0.18%848
-0.82%