diff --git a/.changeset/external-targets.md b/.changeset/external-targets.md deleted file mode 100644 index 8191d57..0000000 --- a/.changeset/external-targets.md +++ /dev/null @@ -1,10 +0,0 @@ ---- -"javascript-excel": minor ---- - -`read`, `inspect` and `importDataset` now report relationships to targets outside the file (JSE-85), failing closed. Every relationship in any relationships part of the package (root, workbook, sheets, drawings, charts, external links, any other) that is not a hyperlink and that is external (`TargetMode="External"`, any letter case), whatever its kind, gives one `UNSUPPORTED_PART` warning with the new `partKind` `'externalTarget'`. Example: a linked picture, an `image` relationship of a drawing with an `http(s)`, UNC (`\\host\share\…`) or `file:` target, which Excel fetches when the file is opened (a tracking beacon; a UNC target can send the user's NTLM credentials to that host). Before, nothing reported it. Relationships already reported as another kind are reported here too: a linked OLE object gives `'oleObject'` and `'externalTarget'`, an external link `'externalLink'` and, for its path, `'externalTarget'`. Also reported, while the model still reads the target as a part name as before: -- a `TargetMode` that is neither `Internal` nor `External` (`" External"`, `"1"`, `""`, …); -- a second, namespace-prefixed or differently cased `TargetMode`; -- an internal target, or a second, prefixed or differently cased `Target` attribute, that starts with a URI scheme (after leading whitespace) or `//`, or contains a backslash. - -Hyperlinks are never reported. The warning's `part` is the first relationships part that holds one, `parts` lists every such relationships part once (bounded by `maxEntries`), and the new `relationshipTypes` field gives the first 16 distinct relationship types, excerpted. Targets are never included, resolved or fetched, and any number of such relationships is one warning. No new refusals: files that read in 2.5.0 still read, with at most this one more warning. `ExcelPartKind` gains `'externalTarget'` (a `switch` over it needs a `default` branch, as documented) and `ExcelWarning` gains the optional `relationshipTypes`. Files this library writes have none: their hyperlinks are not reported. diff --git a/apps/playground/package.json b/apps/playground/package.json index 5a0dcfe..a08944f 100644 --- a/apps/playground/package.json +++ b/apps/playground/package.json @@ -11,7 +11,7 @@ "test": "vitest run" }, "dependencies": { - "javascript-excel": "2.5.0" + "javascript-excel": "2.6.0" }, "devDependencies": { "happy-dom": "21.0.4", diff --git a/examples/node/package.json b/examples/node/package.json index a9f3fc7..0344374 100644 --- a/examples/node/package.json +++ b/examples/node/package.json @@ -8,7 +8,7 @@ "check": "tsc -p tsconfig.json" }, "dependencies": { - "javascript-excel": "2.5.0" + "javascript-excel": "2.6.0" }, "devDependencies": { "@types/node": "22.20.5", diff --git a/examples/react/package.json b/examples/react/package.json index ce73bbc..4b124f3 100644 --- a/examples/react/package.json +++ b/examples/react/package.json @@ -9,7 +9,7 @@ "check": "tsc -p tsconfig.json" }, "dependencies": { - "javascript-excel": "2.5.0", + "javascript-excel": "2.6.0", "react": "19.3.1", "react-dom": "19.3.1" }, diff --git a/examples/snippets/package.json b/examples/snippets/package.json index 5dc87d8..2ac9c39 100644 --- a/examples/snippets/package.json +++ b/examples/snippets/package.json @@ -7,7 +7,7 @@ "check": "tsc -p tsconfig.json" }, "dependencies": { - "javascript-excel": "2.5.0" + "javascript-excel": "2.6.0" }, "devDependencies": { "@types/node": "22.20.5", diff --git a/examples/vanilla/package.json b/examples/vanilla/package.json index 5e0c937..6f098f3 100644 --- a/examples/vanilla/package.json +++ b/examples/vanilla/package.json @@ -9,7 +9,7 @@ "check": "tsc -p tsconfig.json" }, "dependencies": { - "javascript-excel": "2.5.0" + "javascript-excel": "2.6.0" }, "devDependencies": { "typescript": "7.0.2", diff --git a/examples/vue/package.json b/examples/vue/package.json index 1146529..949e42a 100644 --- a/examples/vue/package.json +++ b/examples/vue/package.json @@ -9,7 +9,7 @@ "check": "tsc -p tsconfig.json" }, "dependencies": { - "javascript-excel": "2.5.0", + "javascript-excel": "2.6.0", "vue": "3.5.45" }, "devDependencies": { diff --git a/package-lock.json b/package-lock.json index effbb5d..ee5d43f 100644 --- a/package-lock.json +++ b/package-lock.json @@ -23,7 +23,7 @@ "name": "javascript-excel-playground", "version": "0.0.0", "dependencies": { - "javascript-excel": "2.5.0" + "javascript-excel": "2.6.0" }, "devDependencies": { "happy-dom": "21.0.4", @@ -35,7 +35,7 @@ "examples/node": { "name": "example-node", "dependencies": { - "javascript-excel": "2.5.0" + "javascript-excel": "2.6.0" }, "devDependencies": { "@types/node": "22.20.5", @@ -45,7 +45,7 @@ "examples/react": { "name": "example-react", "dependencies": { - "javascript-excel": "2.5.0", + "javascript-excel": "2.6.0", "react": "19.3.1", "react-dom": "19.3.1" }, @@ -59,7 +59,7 @@ "examples/snippets": { "name": "example-snippets", "dependencies": { - "javascript-excel": "2.5.0" + "javascript-excel": "2.6.0" }, "devDependencies": { "@types/node": "22.20.5", @@ -69,7 +69,7 @@ "examples/vanilla": { "name": "example-vanilla", "dependencies": { - "javascript-excel": "2.5.0" + "javascript-excel": "2.6.0" }, "devDependencies": { "typescript": "7.0.2", @@ -79,7 +79,7 @@ "examples/vue": { "name": "example-vue", "dependencies": { - "javascript-excel": "2.5.0", + "javascript-excel": "2.6.0", "vue": "3.5.45" }, "devDependencies": { @@ -3696,7 +3696,7 @@ } }, "packages/javascript-excel": { - "version": "2.5.0", + "version": "2.6.0", "license": "MIT", "devDependencies": { "@types/node": "22.20.5", diff --git a/packages/javascript-excel/CHANGELOG.md b/packages/javascript-excel/CHANGELOG.md index 349c5c6..1b45aa2 100644 --- a/packages/javascript-excel/CHANGELOG.md +++ b/packages/javascript-excel/CHANGELOG.md @@ -1,5 +1,16 @@ # javascript-excel +## 2.6.0 + +### Minor Changes + +- e6012a0: `read`, `inspect` and `importDataset` now report relationships to targets outside the file (JSE-85), failing closed. Every relationship in any relationships part of the package (root, workbook, sheets, drawings, charts, external links, any other) that is not a hyperlink and that is external (`TargetMode="External"`, any letter case), whatever its kind, gives one `UNSUPPORTED_PART` warning with the new `partKind` `'externalTarget'`. Example: a linked picture, an `image` relationship of a drawing with an `http(s)`, UNC (`\\host\share\…`) or `file:` target, which Excel fetches when the file is opened (a tracking beacon; a UNC target can send the user's NTLM credentials to that host). Before, nothing reported it. Relationships already reported as another kind are reported here too: a linked OLE object gives `'oleObject'` and `'externalTarget'`, an external link `'externalLink'` and, for its path, `'externalTarget'`. Also reported, while the model still reads the target as a part name as before: + - a `TargetMode` that is neither `Internal` nor `External` (`" External"`, `"1"`, `""`, …); + - a second, namespace-prefixed or differently cased `TargetMode`; + - an internal target, or a second, prefixed or differently cased `Target` attribute, that starts with a URI scheme (after leading whitespace) or `//`, or contains a backslash. + + Hyperlinks are never reported. The warning's `part` is the first relationships part that holds one, `parts` lists every such relationships part once (bounded by `maxEntries`), and the new `relationshipTypes` field gives the first 16 distinct relationship types, excerpted. Targets are never included, resolved or fetched, and any number of such relationships is one warning. No new refusals: files that read in 2.5.0 still read, with at most this one more warning. `ExcelPartKind` gains `'externalTarget'` (a `switch` over it needs a `default` branch, as documented) and `ExcelWarning` gains the optional `relationshipTypes`. Files this library writes have none: their hyperlinks are not reported. + ## 2.5.0 ### Minor Changes diff --git a/packages/javascript-excel/package.json b/packages/javascript-excel/package.json index 509318a..2a294ee 100644 --- a/packages/javascript-excel/package.json +++ b/packages/javascript-excel/package.json @@ -1,6 +1,6 @@ { "name": "javascript-excel", - "version": "2.5.0", + "version": "2.6.0", "private": false, "description": "Read and write .xlsx and .csv files in browsers, Web Workers and Node. 2.0 is a from-scratch rewrite in progress.", "keywords": [ diff --git a/packages/javascript-excel/src/index.ts b/packages/javascript-excel/src/index.ts index e003b9e..81ce9ef 100644 --- a/packages/javascript-excel/src/index.ts +++ b/packages/javascript-excel/src/index.ts @@ -76,4 +76,4 @@ export { decodeCell, decodeCol, decodeRange, encodeCell, encodeCol, encodeRange, export type { CellAddress, RangeAddress } from "./address"; /** Package version. Set from package.json by `npm run version-packages` (scripts/sync-version.mjs); a unit test checks it. */ -export const VERSION = "2.5.0"; +export const VERSION = "2.6.0";