From 3893bfb9742340ba58e8240eafa4a66fc317092b Mon Sep 17 00:00:00 2001 From: Sean Ryan Date: Mon, 25 Nov 2024 21:28:31 +0100 Subject: [PATCH 1/4] Up examples --- README.md | 2 +- example/library-usage-via-JavaScript/index.js | 2 +- example/library-usage-via-TypeScript/src/app.ts | 8 ++++---- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/README.md b/README.md index d814d84..c47c5d5 100644 --- a/README.md +++ b/README.md @@ -88,7 +88,7 @@ For an example see `./example/library-usage-via-TypeScript/`. From JavaScript - depending on your environment, you may need to navigate to reach the analyzeTsConfig() function. ```js -import analyzeTsConfig from "ts-unused-exports"; +import { analyzeTsConfig } from "ts-unused-exports"; const result = analyzeTsConfig.default('path/to/tsconfig.json'); ``` diff --git a/example/library-usage-via-JavaScript/index.js b/example/library-usage-via-JavaScript/index.js index 2fcdd11..161db21 100644 --- a/example/library-usage-via-JavaScript/index.js +++ b/example/library-usage-via-JavaScript/index.js @@ -1,4 +1,4 @@ -import analyzeTsConfig from "ts-unused-exports"; +import { analyzeTsConfig } from "ts-unused-exports"; try { // need to navigate to reach the function: diff --git a/example/library-usage-via-TypeScript/src/app.ts b/example/library-usage-via-TypeScript/src/app.ts index 8b6d485..047dba3 100644 --- a/example/library-usage-via-TypeScript/src/app.ts +++ b/example/library-usage-via-TypeScript/src/app.ts @@ -1,11 +1,11 @@ -import analyzeTsConfig from "ts-unused-exports"; +import { analyzeTsConfig } from 'ts-unused-exports'; import { inc } from './math'; console.log('two', inc(1)); try { - const result = analyzeTsConfig("../simple/tsconfig.json"); - console.log(result) + const result = analyzeTsConfig('../simple/tsconfig.json'); + console.log(result); } catch (e) { console.error(e); -} \ No newline at end of file +} From 3b779c11f027d2d974435ef9bfaa93fd83423721 Mon Sep 17 00:00:00 2001 From: Sean Ryan Date: Mon, 25 Nov 2024 21:28:52 +0100 Subject: [PATCH 2/4] Up example package files --- .../package-lock.json | 118 +++++++++++++----- .../library-usage-via-TypeScript/package.json | 2 +- 2 files changed, 90 insertions(+), 30 deletions(-) diff --git a/example/library-usage-via-TypeScript/package-lock.json b/example/library-usage-via-TypeScript/package-lock.json index 4a0d7a9..ad39678 100644 --- a/example/library-usage-via-TypeScript/package-lock.json +++ b/example/library-usage-via-TypeScript/package-lock.json @@ -1,97 +1,157 @@ { + "name": "library-usage-via-TypeScript", + "lockfileVersion": 3, "requires": true, - "lockfileVersion": 1, - "dependencies": { - "@types/json5": { + "packages": { + "": { + "license": "MIT", + "dependencies": { + "ts-unused-exports": "^11.0.0", + "typescript": "^4.9.4" + } + }, + "node_modules/@types/json5": { "version": "0.0.29", "resolved": "https://registry.npmjs.org/@types/json5/-/json5-0.0.29.tgz", "integrity": "sha512-dRLjCWHYg4oaA77cxO64oO+7JwCwnIzkZPdrrC71jQmQtlhM556pwKo5bUzqvZndkVbeFLIIi+9TC40JNF5hNQ==" }, - "ansi-styles": { + "node_modules/ansi-styles": { "version": "4.3.0", "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", - "requires": { + "dependencies": { "color-convert": "^2.0.1" + }, + "engines": { + "node": ">=8" + }, + "funding": { + "url": "https://github.com/chalk/ansi-styles?sponsor=1" } }, - "chalk": { + "node_modules/chalk": { "version": "4.1.2", "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.2.tgz", "integrity": "sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==", - "requires": { + "dependencies": { "ansi-styles": "^4.1.0", "supports-color": "^7.1.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/chalk/chalk?sponsor=1" } }, - "color-convert": { + "node_modules/color-convert": { "version": "2.0.1", "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", - "requires": { + "dependencies": { "color-name": "~1.1.4" + }, + "engines": { + "node": ">=7.0.0" } }, - "color-name": { + "node_modules/color-name": { "version": "1.1.4", "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==" }, - "has-flag": { + "node_modules/has-flag": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz", - "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==" + "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==", + "engines": { + "node": ">=8" + } }, - "json5": { + "node_modules/json5": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/json5/-/json5-1.0.2.tgz", "integrity": "sha512-g1MWMLBiz8FKi1e4w0UyVL3w+iJceWAFBAaBnnGKOpNa5f8TLktkbre1+s6oICydWAm+HRUGTmI+//xv2hvXYA==", - "requires": { + "dependencies": { "minimist": "^1.2.0" + }, + "bin": { + "json5": "lib/cli.js" } }, - "minimist": { + "node_modules/minimist": { "version": "1.2.7", "resolved": "https://registry.npmjs.org/minimist/-/minimist-1.2.7.tgz", - "integrity": "sha512-bzfL1YUZsP41gmu/qjrEk0Q6i2ix/cVeAhbCbqH9u3zYutS1cLg00qhrD0M2MVdCcx4Sc0UpP2eBWo9rotpq6g==" + "integrity": "sha512-bzfL1YUZsP41gmu/qjrEk0Q6i2ix/cVeAhbCbqH9u3zYutS1cLg00qhrD0M2MVdCcx4Sc0UpP2eBWo9rotpq6g==", + "funding": { + "url": "https://github.com/sponsors/ljharb" + } }, - "strip-bom": { + "node_modules/strip-bom": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/strip-bom/-/strip-bom-3.0.0.tgz", - "integrity": "sha512-vavAMRXOgBVNF6nyEEmL3DBK19iRpDcoIwW+swQ+CbGiu7lju6t+JklA1MHweoWtadgt4ISVUsXLyDq34ddcwA==" + "integrity": "sha512-vavAMRXOgBVNF6nyEEmL3DBK19iRpDcoIwW+swQ+CbGiu7lju6t+JklA1MHweoWtadgt4ISVUsXLyDq34ddcwA==", + "engines": { + "node": ">=4" + } }, - "supports-color": { + "node_modules/supports-color": { "version": "7.2.0", "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz", "integrity": "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==", - "requires": { + "dependencies": { "has-flag": "^4.0.0" + }, + "engines": { + "node": ">=8" } }, - "ts-unused-exports": { - "version": "9.0.1", - "resolved": "https://registry.npmjs.org/ts-unused-exports/-/ts-unused-exports-9.0.1.tgz", - "integrity": "sha512-nlP+g0guz1AGO8bV2wbRkbfYG8q+kIt6KiMCz2dRAMwfuX77sukuKN4hG1Bx9ilBeM+CNA4NskE5sdHejlVeug==", - "requires": { + "node_modules/ts-unused-exports": { + "version": "11.0.0", + "resolved": "https://registry.npmjs.org/ts-unused-exports/-/ts-unused-exports-11.0.0.tgz", + "integrity": "sha512-i5u/JOTrAAJjo2IOf/2WYrlgWdkTTPUxcU4otarUX839r9kA4nWwTfkROLxHH+rJRBQsUixLpOi3CCJcuXYfEA==", + "license": "MIT", + "dependencies": { "chalk": "^4.0.0", "tsconfig-paths": "^3.9.0" + }, + "bin": { + "ts-unused-exports": "bin/ts-unused-exports" + }, + "funding": { + "url": "https://github.com/pzavolinsky/ts-unused-exports?sponsor=1" + }, + "peerDependencies": { + "typescript": ">=3.8.3" + }, + "peerDependenciesMeta": { + "typescript": { + "optional": false + } } }, - "tsconfig-paths": { + "node_modules/tsconfig-paths": { "version": "3.14.1", "resolved": "https://registry.npmjs.org/tsconfig-paths/-/tsconfig-paths-3.14.1.tgz", "integrity": "sha512-fxDhWnFSLt3VuTwtvJt5fpwxBHg5AdKWMsgcPOOIilyjymcYVZoCQF8fvFRezCNfblEXmi+PcM1eYHeOAgXCOQ==", - "requires": { + "dependencies": { "@types/json5": "^0.0.29", "json5": "^1.0.1", "minimist": "^1.2.6", "strip-bom": "^3.0.0" } }, - "typescript": { + "node_modules/typescript": { "version": "4.9.4", "resolved": "https://registry.npmjs.org/typescript/-/typescript-4.9.4.tgz", - "integrity": "sha512-Uz+dTXYzxXXbsFpM86Wh3dKCxrQqUcVMxwU54orwlJjOpO3ao8L7j5lH+dWfTwgCwIuM9GQ2kvVotzYJMXTBZg==" + "integrity": "sha512-Uz+dTXYzxXXbsFpM86Wh3dKCxrQqUcVMxwU54orwlJjOpO3ao8L7j5lH+dWfTwgCwIuM9GQ2kvVotzYJMXTBZg==", + "bin": { + "tsc": "bin/tsc", + "tsserver": "bin/tsserver" + }, + "engines": { + "node": ">=4.2.0" + } } } } diff --git a/example/library-usage-via-TypeScript/package.json b/example/library-usage-via-TypeScript/package.json index 946641c..4ddeb89 100644 --- a/example/library-usage-via-TypeScript/package.json +++ b/example/library-usage-via-TypeScript/package.json @@ -7,7 +7,7 @@ "test": "npm ci && ./node_modules/ts-unused-exports/bin/ts-unused-exports ../simple/tsconfig.json" }, "dependencies": { - "ts-unused-exports": "^9.0.1", + "ts-unused-exports": "^11.0.0", "typescript": "^4.9.4" } } From a8f715aff01ad76627953f4d3b9da153db14fe24 Mon Sep 17 00:00:00 2001 From: Sean Ryan Date: Mon, 25 Nov 2024 21:30:28 +0100 Subject: [PATCH 3/4] up README --- CHANGELOG.md | 6 ++++++ README.md | 2 +- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 3c02ed3..6a8194c 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,9 @@ +## [11.0.1] - 25 Nov 2024 + +### Changed + +- updated examples and README to match the changes in version 11.0.0 + ## [11.0.0] - 25 Nov 2024 ### Changed diff --git a/README.md b/README.md index c47c5d5..1a12c65 100644 --- a/README.md +++ b/README.md @@ -68,7 +68,7 @@ As of version 7.0.0 the TypeScript compiler is a _peer dependency_ of `ts-unused #### Usage as a library - From TypeScript (was built with ES5 + commonjs) ```ts -import analyzeTsConfig from 'ts-unused-exports'; +import { analyzeTsConfig } from 'ts-unused-exports'; const result = analyzeTsConfig('path/to/tsconfig.json'); // or const result = analyzeTsConfig('path/to/tsconfig.json', ['file1.ts']); // or const result = analyzeTsConfig('path/to/tsconfig.json', ['file1.ts', '--excludePathsFromReport=math']); From 106454b732e4e96a83fdaee9b433c98b2549fcec Mon Sep 17 00:00:00 2001 From: Sean Ryan Date: Mon, 25 Nov 2024 21:32:31 +0100 Subject: [PATCH 4/4] 11.0.1 --- package-lock.json | 2 +- package.json | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/package-lock.json b/package-lock.json index e8491d8..58d2ae7 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,6 +1,6 @@ { "name": "ts-unused-exports", - "version": "11.0.0", + "version": "11.0.1", "lockfileVersion": 1, "requires": true, "dependencies": { diff --git a/package.json b/package.json index 852940c..5c21fdb 100755 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "ts-unused-exports", - "version": "11.0.0", + "version": "11.0.1", "description": "ts-unused-exports finds unused exported symbols in your Typescript project", "main": "lib/app.js", "repository": {