Skip to content

Releases: Siemienik/XToolset

v2.4.7

20 Nov 23:43
Compare
Choose a tag to compare

v2.4.7 xlsx-renderer and xlsx-import

Thanks for each single contribution, you're fantanstic!

What's Changed

@dependabot

  • build(deps): bump minimist from 1.2.5 to 1.2.6 in /packages/xlsx-import by @dependabot in #211
  • build(deps): bump minimist from 1.2.5 to 1.2.6 in /packages/xlsx-renderer-cli by @dependabot in #213
  • build(deps): bump minimist from 1.2.5 to 1.2.6 in /packages/xlsx-renderer by @dependabot in #212
  • build(deps): bump minimist from 1.2.5 to 1.2.6 in /packages/xlsx-import-cli by @dependabot in #215
  • build(deps): bump minimatch from 3.0.4 to 3.0.8 in /packages/xlsx-import-cli by @dependabot in #218
  • build(deps): bump minimatch from 3.0.4 to 3.0.8 in /packages/xlsx-renderer-cli by @dependabot in #217
  • build(deps): bump json5 from 2.2.0 to 2.2.3 in /packages/xlsx-import by @dependabot in #222
  • build(deps): bump json5 from 2.2.0 to 2.2.3 in /packages/xlsx-renderer by @dependabot in #223
  • build(deps): bump jszip from 3.7.1 to 3.10.1 in /packages/xlsx-import by @dependabot in #225
  • build(deps): bump jszip from 3.7.1 to 3.10.1 in /packages/xlsx-import-cli by @dependabot in #228
  • build(deps): bump jszip from 3.7.1 to 3.10.1 in /packages/xlsx-renderer-cli by @dependabot in #227
  • build(deps): bump jszip from 3.7.1 to 3.10.1 in /packages/xlsx-renderer by @dependabot in #226
  • build(deps-dev): bump @babel/traverse from 7.17.0 to 7.23.4 in /packages/xlsx-renderer by @dependabot in #237
  • build(deps-dev): bump @babel/traverse from 7.17.0 to 7.23.4 in /packages/xlsx-import by @dependabot in #238

New Contributors

Thank you!

Full Changelog: v2.4.4...v2.4.7


SiemaTeam

v2.4.4

11 Nov 13:27
Compare
Choose a tag to compare

What's Changed

  • Added dateMapper with protection against invalid value passes as valid. by @Siemienik in #192
  • implement add file from buffer by @AlinaKul in #196
  • Added node 16.x, 17.x to tests suites by @Siemienik in #197
  • Issue 81: Added getFirstItem method by @maryiabydanova in #198
  • Security updates (npm audit fixes).

New Contributors

Links

Full Changelog: xlsx-renderer-v2.4.3...v2.4.4

XLSX-Renderer v2.4.0: Custom formula and template string

13 Feb 11:41
Compare
Choose a tag to compare

XLSX-Renderer

In this release, two similar proposals were done. Both use string interpolation to gain indeed result.

TemplateFormulaCell

#158 (PR #160) for the request from @jasonclake.

image

  • Starts with #=
  • This one allows you to put a template string (custom formula) into a cell as a formula. To write in a variable use ${pathToVariable}.
  • For instance: #= ${summaryFormula}(A2:A${item.__endOutput.r}) gives something like =MAX(A2:A2910)

TemplateStringCell

#152 (PR #161) for the request from @jacekkoziol.

image

  • Starts with #`
  • Template string allows us to create advanced text, such as concatenating two variables or putting them into a sentence. To write in a variable use ${pathToVariable}.
  • For instance: #Hello ${name}! How are you?</code> gives for instanceHello World! How are you?`

Kind regards,
Paweł Siemienik hi@siemienik.pl

You can catch me for a chat on Gitter.

v2.3.3 More Build-in Mappers

26 Oct 01:27
Compare
Choose a tag to compare

Mappers

Read more about mappers and how to use it.

booleanMapper

in #54 by @machadolucasvp - Thank you!

Map string into boolean

import {booleanMapper} from 'xlsx-import/lib/mappers';

booleanMapper('1'); // returns true
booleanMapper('0'); // returns false

numberMapper

in #55 by @machadolucasvp - Thank you!

Map string into float number

import {numberMapper} from 'xlsx-import/lib/mappers';

numberMapper('1.5'); // returns 1.5
numberMapper('0.05'); // returns 0.05

integerMapper

in #56 by @machadolucasvp - Thank you!

Map string into integer

import {integerMapper} from 'xlsx-import/lib/mappers';

integerMapper('1.5'); // returns 1
integerMapper('0.05'); // returns 0

integerMapper #56 @machadolucasvp

Documentation & contributing improvements

The pull requests #66 and #67 introduced markdown linter and GH workflow to automatically performing lint fixing.

v2.3.2 Build-in Mappers & Samples

18 Oct 00:44
Compare
Choose a tag to compare

Build-in mappers:

The v2.3.2 introduce many ready to use value mappers and additional samples.

🚀 All contributors many thanks (@Gontrum, @Metastasis, @Siemienik) 🎉 You've done a lot greatness job 🥇

isEmpty

in #41 by @Gontrum - Thank you!

Examine if input is empty

import {isEmpty} from 'xlsx-import/lib/mappers';

isEmpty('asd'); // returns false
isEmpty(''); // returns true

isFilled

in #42 by @Gontrum - Thank you!

Examine if input is not empty

import {isFilled} from 'xlsx-import/lib/mappers';

isFilled('asd'); // returns true
isFilled(''); // returns false

jsonMapper

in #43 by @Gontrum - Thank you!

Try to parse json string into js object, if failed return null

import {jsonMapper} from 'xlsx-import/lib/mappers';

jsonMapper(''); // returns null because invalid input
jsonMapper('asd'); // returns null because invalid input
jsonMapper('"asd"'); // returns "asd"
jsonMapper('false'); // returns false,
jsonMapper('123'); // returns 123,
jsonMapper('false'); // returns false,
jsonMapper( '{"a":[1]}'); // returns  { a: [ 1 ] },

lowerCaseMapper

in #44 by @Metastasis - Thank you!

Changes string into lower case.

import {lowerCaseMapper} from 'xlsx-import/lib/mappers';

lowerCaseMapper('ASD'); // returns 'asd'

upperCaseMapper

in #36 by @Metastasis - Thank you!

Changes string into UPPER CASE.

import {upperCaseMapper} from 'xlsx-import/lib/mappers';

upperCaseMapper('asd'); // returns 'ASD'

splitMapper

in #50 by @Siemienik

Split string into array of items. May be customised by setting separator and item mapper:
(Doing customisation do not change original mapper but create new one.)

import {splitMapper} from 'xlsx-import/lib/mappers';

splitMapper('asd,jkl'); // returns ['asd', 'jkl']
splitMapper.separator(' || ')('string,1 || string,2'); // returns ['string,1', 'string,2']
splitMapper.itemMapper(upperCaseMapper)('lower1,lover2'); // returns ['LOWER1', 'LOVER2']

Samples:

This version introduce two additional samples:
All off these mappers are well tested, for lots examples how it works please study unit tests

nodejs + typescript

in #45 by @Metastasis - Thank you!

Show how to use xlsx-import in an application built on Nodejs with Typescript. For more details follow this link.

ExpressJS microservice

in #47 by @Metastasis - Thank you!

Microservice written in ExpressJS . For more details follow this link.

Other changes:

  • Fixed typos in readme and code: Thanks for @Metastasis for contribution #35
  • Enable CI for PR: #38

v2.3.1 Api & Documentation Improvements

09 Oct 01:15
Compare
Choose a tag to compare

This was really existing time that get results in many PR merged 🚀

Important Note:

Some functions and default exports was refactored, it means that the previous version is deprecated now. It still works same way like previous, however it will be removed on January 2021. Please follow by deprecated notes or use Migration Guide

Change List

Refactoring:

  • IMPORTANT: Obsolete default exports (#27)
  • IMPORTANT: Rename class members to cameCase (#28) - and obsolete older in PascalCase
  • Add default mapper to Importer (#19) - Many thanks for @lowkeypriority
  • Refactoring and clean up performed (#20)
    • Introduce strategies
    • Introduce enum ImportType
  • Introduce type ValueMapper, (#29)

Security:

  • Handling incorrect type param value more explicitly. (#20)

Documentation:

  • Describe configuration options (#20)
  • Added supported node versions: 7fd63b4
  • Some minor changes

Migration Guide:

  1. First rename all GetAllItems to getAllItems. Run test to prove that it doesn't fail your up.
  2. Rename all From to from, run test again.
  3. Change default imports to specific:

from: const ImporterFactory = require('xlsx-import/lib/ImporterFactory').default;
to: const {ImporterFactory} = require('xlsx-import/lib/ImporterFactory');

from: import ImporterFactory from 'xlsx-import/lib/ImporterFactory';
to: import {ImporterFactory} from 'xlsx-import/lib/ImporterFactory';

  1. run test

Migration is required to proceed before January 2021, when deprecated items will be removed.

Upgrade version and resolving deprecations was done also in our sample, this PR #33 might be helpful for you.


Do you want to support my work? ❤️ Sponsor me
Your issue is stuck? I can make it done, contact me for further info :)

Upgrade dependency & readme

01 Oct 13:24
Compare
Choose a tag to compare

ExcelJS introduce version 4 more than half year ago, so it is great time to upgrade xlsx-import.
Lib may stop working with node version < 10 . If problem occurs please create an issue it will be fixed soon.
Also some improvements in Readme was done.

npm notice 📦  xlsx-import@2.3.0
npm notice === Tarball Contents === 
npm notice 1.1kB LICENSE                              
npm notice 118B  lib/config/IColumnConfig.js          
npm notice 117B  lib/config/IFieldConfig.js           
npm notice 114B  lib/IImporter.js                     
npm notice 122B  lib/config/IListSourceConfig.js      
npm notice 1.5kB lib/Importer.js                      
npm notice 3.6kB lib/ImporterFactory.js               
npm notice 124B  lib/config/IObjectSourceConfig.js    
npm notice 118B  lib/config/ISourceConfig.js          
npm notice 1.6kB package.json                         
npm notice 128B  lib/config/IColumnConfig.js.map      
npm notice 126B  lib/config/IFieldConfig.js.map       
npm notice 110B  lib/IImporter.js.map                 
npm notice 136B  lib/config/IListSourceConfig.js.map  
npm notice 1.4kB lib/Importer.js.map                  
npm notice 441B  lib/ImporterFactory.js.map           
npm notice 140B  lib/config/IObjectSourceConfig.js.map
npm notice 128B  lib/config/ISourceConfig.js.map      
npm notice 2.6kB README.md                            
npm notice 113B  lib/config/IColumnConfig.d.ts        
npm notice 136B  lib/config/IFieldConfig.d.ts         
npm notice 139B  lib/IImporter.d.ts                   
npm notice 212B  lib/config/IListSourceConfig.d.ts    
npm notice 272B  lib/Importer.d.ts                    
npm notice 122B  lib/ImporterFactory.d.ts             
npm notice 187B  lib/config/IObjectSourceConfig.d.ts  
npm notice 85B   lib/config/ISourceConfig.d.ts        
npm notice === Tarball Details === 
npm notice name:          xlsx-import                             
npm notice version:       2.3.0                                   
npm notice package size:  5.7 kB                                  
npm notice unpacked size: 14.9 kB                                 
npm notice shasum:        6f0a5de39bc72d6a1b588992bda7ff758ff2b536
npm notice integrity:     sha512-LpkE2gCkfKM7R[...]wUpIaLD404qpQ==
npm notice total files:   27                                      
npm notice 
+ xlsx-import@2.3.0
➜  xlsx-import git:(master)