Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 1 addition & 3 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,6 @@ jobs:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
node: [20]

steps:
- name: Retrieve current Date Time in EST
Expand All @@ -38,7 +36,7 @@ jobs:
- name: Set NodeJS
uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node }}
node-version: 24

- name: Install pnpm
uses: pnpm/action-setup@v3
Expand Down
8 changes: 4 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -55,10 +55,10 @@
},
"packageManager": "pnpm@10.10.0",
"devDependencies": {
"@biomejs/biome": "^2.2.3",
"@lerna-lite/cli": "^4.7.3",
"@lerna-lite/publish": "^4.7.3",
"@types/node": "^24.3.1",
"@biomejs/biome": "^2.2.4",
"@lerna-lite/cli": "^4.9.0",
"@lerna-lite/publish": "^4.9.0",
"@types/node": "^24.5.2",
"@vitest/coverage-v8": "^3.2.4",
"conventional-changelog-conventionalcommits": "^9.1.0",
"happy-dom": "^18.0.1",
Expand Down
14 changes: 7 additions & 7 deletions packages/excel-builder-vanilla-types/dist/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1035,15 +1035,15 @@ export type InferOutputByType<T extends "Blob" | "Uint8Array"> = T extends "Blob
*/
export declare function createWorkbook(): Workbook;
/**
* Turns a workbook into a downloadable file, you can between a 'Blob' or 'Uint8Array',
* and if nothing is provided then 'Blob' will be the default
* Turns a Workbook into a downloadable file, you can switch output type a `Blob` or `Uint8Array`,
* and if nothing is provided then `Blob` is the default output type.
* @param {Excel/Workbook} workbook - The workbook that is being converted
* @param {'Uint8Array' | 'Blob'} [outputType='Blob'] - defaults to 'Blob'
* @param {Object} [options]
* - `fileFormat` defaults to "xlsx"
* - `mimeType`: a mime type can be provided by the user or auto-detect the mime when undefined (by file extension .xls/.xlsx)
* - `mimeType`: a mime type can be provided by the user or auto-detect the mime when undefined (by file extension `.xls`/`.xlsx`)
* (user can pass an empty string to completely cancel the mime type altogether)
* - `zipOptions` to specify any `fflate` options to modify how the zip is created.
* - `zipOptions` to specify any `fflate` options to modify how the zip will be created.
* @returns {Promise}
*/
export declare function createExcelFile<T extends "Blob" | "Uint8Array" = "Blob">(workbook: Workbook, outputType?: T, options?: {
Expand All @@ -1053,11 +1053,11 @@ export declare function createExcelFile<T extends "Blob" | "Uint8Array" = "Blob"
}): Promise<InferOutputByType<T>>;
/**
* Download Excel file, currently only supports a "browser" as `downloadType`
* but it could be expended in the future to also other type of platform like NodeJS for example.
* but it could be expended in the future to also support other type of platforms like NodeJS for example.
* @param {Workbook} workbook
* @param {String} filename - filename (must also include file extension, xls/xlsx)
* @param {String} filename - filename (must also include file extension: `.xls` or `.xlsx`)
* @param {Object} [options]
* - `downloadType`: download type (browser/node), currently only a "browser" download as a Blob
* - `downloadType`: download type ('browser' / 'node'), currently only supports "browser" download as a Blob
* - `mimeType`: a mime type can be provided by the user or auto-detect the mime when undefined (by file extension .xls/.xlsx)
* (user can pass an empty string to completely cancel the mime type altogether)
* - `zipOptions` to specify any `fflate` options to modify how the zip is created.
Expand Down
4 changes: 2 additions & 2 deletions packages/excel-builder-vanilla/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -59,9 +59,9 @@
},
"devDependencies": {
"dts-bundle-generator": "^9.5.1",
"native-copyfiles": "^1.3.5",
"native-copyfiles": "^1.3.6",
"remove-glob": "catalog:",
"typescript": "catalog:",
"vite": "catalog:"
}
}
}
10 changes: 4 additions & 6 deletions packages/excel-builder-vanilla/src/streaming.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,13 +16,11 @@ export interface ExcelFileStreamOptions {
* Yields zipped chunks for browser (ReadableStream) or NodeJS (async generator).
*/
export function createExcelFileStream(workbook: Workbook, options?: ExcelFileStreamOptions) {
const isBrowser = typeof window !== 'undefined' && typeof window.ReadableStream !== 'undefined';
const isNode = typeof process !== 'undefined' && process.versions?.node;
if (isBrowser) {
return browserExcelStream(workbook, options);
if (typeof window !== 'undefined' && typeof window.ReadableStream !== 'undefined') {
return browserExcelStream(workbook, options); // Browser environment
}
if (isNode) {
return nodeExcelStream(workbook, options);
if (typeof process !== 'undefined' && process.versions?.node) {
return nodeExcelStream(workbook, options); // NodeJS environment
}
throw new Error('Streaming is only supported in browser or NodeJS environments.');
}
Expand Down
Loading