Skip to content

Commit 1f96fa2

Browse files
author
m.r
committed
fix: check range of record
1 parent d12658a commit 1f96fa2

20 files changed

+555
-511
lines changed

.github/workflows/manually-release-publish.yml

+40-14
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,23 @@
11
name: Manually Release & Publish Package
22
on:
3-
workflow_dispatch
3+
workflow_dispatch:
4+
inputs:
5+
skip-release:
6+
description: 'Skip Release Job'
7+
required: true
8+
default: 'false'
9+
type: choice
10+
options:
11+
- 'false'
12+
- 'true'
13+
skip-publish-gpr:
14+
description: 'Skip publish Github Job'
15+
required: true
16+
default: 'false'
17+
type: choice
18+
options:
19+
- 'false'
20+
- 'true'
421
# push:
522
# branches:
623
# - main
@@ -13,6 +30,7 @@ on:
1330
# - CHANGELOG.md
1431
jobs:
1532
release:
33+
if: ${{ github.event.inputs.skip-release == 'false' }}
1634
name: Create release package
1735
runs-on: ubuntu-latest
1836
steps:
@@ -41,25 +59,33 @@ jobs:
4159
tag_name: ${{env.PV}}
4260
release_name: Release v${{env.PV}}
4361
body: ${{env.PB}}
44-
publish-gpr:
45-
needs: build
62+
publish-gpr:
63+
needs: release
64+
if: ${{always() && (needs.release.result == 'success' || needs.release.result == 'skipped') && github.event.inputs.skip-publish-gpr == 'false'}}
4665
runs-on: ubuntu-latest
4766
permissions:
4867
contents: read
4968
packages: write
5069
steps:
51-
- uses: actions/checkout@v4
52-
- uses: actions/setup-node@v4
53-
with:
54-
node-version: 20
55-
registry-url: https://npm.pkg.github.com/
56-
- run: npm ci
57-
- run: npm publish
58-
env:
59-
NODE_AUTH_TOKEN: ${{secrets.GITHUB_TOKEN}}
60-
publish:
70+
- uses: actions/checkout@v4
71+
# Setup .npmrc file to publish to GitHub Packages
72+
- uses: actions/setup-node@v4
73+
with:
74+
node-version: '20.x'
75+
registry-url: 'https://npm.pkg.github.com'
76+
# Defaults to the user or organization that owns the workflow file
77+
scope: '@mohammadrezaeicode'
78+
- run: npm set @mohammadrezaeicode:registry=https://npm.pkg.github.com/
79+
- run: npm login --scope=@mohammadrezaeicode --registry=https://npm.pkg.github.com
80+
- run: npm adduser
81+
- run: npm ci
82+
- run: npm publish
83+
env:
84+
NODE_AUTH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
85+
publish:
6186
name: Publish to NPM
62-
needs: release
87+
needs: publish-gpr
88+
if: ${{always() && (needs.publish-gpr.result == 'success' || needs.publish-gpr.result == 'skipped') }}
6389
runs-on: ubuntu-latest
6490
steps:
6591
- name: Checkout to code

.npmrc

+3-1
Original file line numberDiff line numberDiff line change
@@ -1 +1,3 @@
1-
@mohammadrezaeicode:registry=https://npm.pkg.github.com
1+
//@npm.pkg.github.com/:_authToken=${NODE_AUTH_TOKEN}
2+
mohammadrezaeicode:registry=https://npm.pkg.github.com
3+
always-auth=true

README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# MR Excel
22

3-
![Test](https://github.com/mohammadrezaeicode/github-action/actions/workflows/test.yml/badge.svg) [![Release & Publish](https://github.com/mohammadrezaeicode/mr-excel-repo/actions/workflows/release.yml/badge.svg)](https://github.com/mohammadrezaeicode/mr-excel-repo/actions/workflows/release.yml)
3+
![Test](https://github.com/mohammadrezaeicode/github-action/actions/workflows/test.yml/badge.svg) [![Release & Publish](https://github.com/mohammadrezaeicode/mr-excel-repo/actions/workflows/release.yml/badge.svg)](https://github.com/mohammadrezaeicode/mr-excel-repo/actions/workflows/manually-release-publish.yml)
44

55
`MR-Excel` is a powerful JavaScript library designed for reading and writing Excel files. It enables users to extract data seamlessly from Excel documents while providing an array of advanced writing features. These include commenting, styling, applying formulas, merging cells, inserting images into cells, adding background images, grouping rows, and implementing conditional formatting. Additionally, the library supports multi-style values and offers functions for cell merging and styling, as well as commenting features.
66

dist/excel-table.amd.js

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/excel-table.cjs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./index-CzrjgJVS.cjs");exports.Validator=e.validateExcelTable;exports.addGlobalOptionFromExcelTable=e.addGlobalOptionFromExcelTable;exports.addGlobalOptions=e.addGlobalOptions;exports.convertTableToExcel=e.convertTableToExcel;exports.excelToJson=e.excelToJson;exports.excelToNode=e.excelToNode;exports.extractExcelData=e.extractExcelData;exports.generateCSV=e.generateCSV;exports.generateExcel=e.generateExcel;exports.generateText=e.generateText;exports.replaceInExcel=e.replaceInExcel;exports.sideBySideLineByLine=e.sideBySideLineByLine;exports.themeBaseGenerate=e.themeBaseGenerate;
1+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./index-DkpykvyS.cjs");exports.Validator=e.validateExcelTable;exports.addGlobalOptionFromExcelTable=e.addGlobalOptionFromExcelTable;exports.addGlobalOptions=e.addGlobalOptions;exports.convertTableToExcel=e.convertTableToExcel;exports.excelToJson=e.excelToJson;exports.excelToNode=e.excelToNode;exports.extractExcelData=e.extractExcelData;exports.generateCSV=e.generateCSV;exports.generateExcel=e.generateExcel;exports.generateText=e.generateText;exports.replaceInExcel=e.replaceInExcel;exports.sideBySideLineByLine=e.sideBySideLineByLine;exports.themeBaseGenerate=e.themeBaseGenerate;

dist/excel-table.d.ts

+10-10
Original file line numberDiff line numberDiff line change
@@ -215,7 +215,7 @@ declare type ConditionalFormattingTopOperation = "belowAverage" | "aboveAverage"
215215
* @param {boolean} [config.keepStyle] - Whether to keep the style.
216216
* @param {RowHeightScaleFunction} [config.rowHeightScaleFunction] - The function to scale row height.
217217
* @param {ColWidthScaleFunction} [config.colWidthScaleFunction] - The function to scale column width.
218-
* @returns {Promise<ExcelTable>} The generated Excel table.
218+
* @returns {Promise<string | number[] | Blob | DataModel.Buffer | undefined>} The generated Excel table.
219219
*/
220220
export declare function convertTableToExcel(queryForTable?: string, table?: HTMLTableElement, config?: {
221221
keepStyle?: boolean;
@@ -396,8 +396,8 @@ export declare function excelToJson(uri: string, fetchFunc?: Function, withHeade
396396
* @param {string} uri - The URI of the Excel file.
397397
* @param {string | null} [queryForTable] - The query selector for the table.
398398
* @param {HTMLDivElement | null} [containerElement] - The container element.
399-
* @param {ExcelToNodeConfig} [config={}] - The configuration options.
400-
* @returns {Promise<void>} The result of the conversion.
399+
* @param {ExcelToNodeConfig} [config=defaultConfig] - The configuration options.
400+
* @returns {Promise<HTMLTableElement[] | "Done">} The result of the conversion.
401401
*/
402402
export declare function excelToNode(uri: string, queryForTable?: string | null, containerElement?: HTMLDivElement | null, config?: ExcelToNodeConfig): Promise<HTMLTableElement[] | "Done">;
403403

@@ -436,7 +436,7 @@ declare type ExtractedData = (string | null | undefined)[][];
436436
* @param {string} uri - The URI of the Excel file.
437437
* @param {boolean} [isBackend=false] - Whether the extraction is done on the backend.
438438
* @param {Function} [fetchFunc] - The function to fetch data.
439-
* @returns {Promise<ExtractResult>} The extracted data.
439+
* @returns {Promise<DataModel.ReadResult>} The extracted data.
440440
*/
441441
export declare function extractExcelData(uri: string, isBackend?: boolean, fetchFunc?: Function): Promise<DataModel.ReadResult>;
442442

@@ -487,20 +487,20 @@ declare type FormulaType = "AVERAGE" | "SUM" | "COUNT" | "MAX" | "MIN";
487487
declare function generalValidationCheck(value: never, validateProperty: ValidationObject, property: string, strict: boolean, warn: boolean): boolean;
488488

489489
/**
490-
* Generates a CSV file from an Excel table.
490+
* Generates a CSV file from an Excel table Object.
491491
* @param {ExcelTable} excelTable - The Excel table.
492492
* @param {boolean} [asZip=false] - Whether to generate the CSV as a ZIP file.
493-
* @returns {Promise<Blob>} The generated CSV file.
493+
* @returns {Promise<string[] | "done" | undefined>} The generated CSV file.
494494
*/
495495
export declare function generateCSV(excelTable: ExcelTable, asZip?: boolean): Promise<string[] | "done" | undefined>;
496496

497497
export declare function generateExcel(data: ExcelTable, styleKey?: string): Promise<string | number[] | Blob | Buffer_2 | undefined>;
498498

499499
/**
500-
* Generates a text file from an Excel table.
500+
* Generates a text file from an Excel table Object.
501501
* @param {ExcelTable} excelTable - The Excel table.
502502
* @param {boolean} [asZip=false] - Whether to generate the text file as a ZIP file.
503-
* @returns {Promise<Blob>} The generated text file.
503+
* @returns {Promise<string[] | "done" | undefined>} The generated text file.
504504
*/
505505
export declare function generateText(excelTable: ExcelTable, asZip?: boolean): Promise<string[] | "done" | undefined>;
506506

@@ -891,7 +891,7 @@ declare interface SideBySide {
891891
/**
892892
* Generates an Excel file with side-by-side data.
893893
* @param {SideBySide[][]} data - The side-by-side data.
894-
* @returns {Promise<ExcelTable>} The generated Excel table.
894+
* @returns {Promise<string | number[] | Blob | DataModel.Buffer | undefined>} The generated Excel table.
895895
*/
896896
export declare function sideBySideLineByLine(data: SideBySide[][]): Promise<string | number[] | DataModel.Buffer | Blob | undefined>;
897897

@@ -1021,7 +1021,7 @@ declare type StyleType = "conditionalFormatting" | "CF" | "headerFooter" | "HF";
10211021
* Generates an Excel file with a theme.
10221022
* @param {ExcelTable | Data[] | Data[][]} data - The data for the Excel file.
10231023
* @param {ThemeOption} [option] - The theme options.
1024-
* @returns {Promise<ExcelTable>} The generated Excel table.
1024+
* @returns {Promise<string | number[] | Blob | DataModel.Buffer | undefined>} The generated Excel table.
10251025
*/
10261026
export declare function themeBaseGenerate(data: ExcelTable | Data[] | Data[][], option?: ThemeOption): Promise<string | number[] | DataModel.Buffer | Blob | undefined>;
10271027

0 commit comments

Comments
 (0)