Skip to content

Commit

Permalink
add save option
Browse files Browse the repository at this point in the history
  • Loading branch information
LCluber committed May 10, 2022
1 parent c5a1cf3 commit ef2b6f1
Show file tree
Hide file tree
Showing 21 changed files with 2,212 additions and 9,452 deletions.
40 changes: 0 additions & 40 deletions .size-snapshot.json

This file was deleted.

4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
Version 0.3.0 (May 10th 2022)
-----------------------------
- Added "save" option to get prompted on file save instead of a direct download

Version 0.2.5 (March 03rd 2021)
-----------------------------
- improved typings for table conversion method
Expand Down
4 changes: 0 additions & 4 deletions Gruntfile.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,5 @@
module.exports = function(grunt){
const path = require('path');
const sass = require('node-sass');

require('time-grunt')(grunt);


const projectName = 'CSVx';
Expand Down Expand Up @@ -120,7 +117,6 @@ module.exports = function(grunt){
});

grunt.loadNpmTasks( 'grunt-contrib-clean' );
grunt.loadNpmTasks( 'grunt-contrib-copy' );
grunt.loadNpmTasks( 'grunt-contrib-uglify' );
grunt.loadNpmTasks( 'grunt-contrib-concat' );
grunt.loadNpmTasks( 'grunt-strip-code' );
Expand Down
4 changes: 4 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -207,6 +207,7 @@ interface Options {
separator?: string; // default : ','
CRLF?: string; // default : '\r\n'
customLabels: { [key: string]: string }; // default : {}
save: boolean; //**
}

interface CSS {
Expand All @@ -216,6 +217,9 @@ interface CSS {

```

** With the "save" option to true the user will be prompted to select where to save the file.
Please note this option will only work on a https website or on Chrome browser.

## Contributors

CSVx.js is still in early development and I would be glad to get all the help you can provide for this project.
Expand Down
2 changes: 2 additions & 0 deletions babel.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,8 @@ module.exports = api => {
[
"@babel/env",
{
useBuiltIns: "usage", // alternative mode: "entry"
corejs: 3, // default would be 2
debug: true,
targets: {
ie: 11,
Expand Down
68 changes: 46 additions & 22 deletions contributor.md
Original file line number Diff line number Diff line change
@@ -1,33 +1,57 @@
## CSVx.js project installation guide
# Installation guide

You just cloned CSVx.js : git clone https://github.com/LCluber/CSVx.js.git
## Clone the project :

### Install nodejs :
- Windows and OSX : **https://nodejs.org/en/**
- Linux : run
- **curl -sL https://deb.nodesource.com/setup_8.x | sudo -E bash -**
- **sudo apt-get install -y nodejs**
```bash
$ git clone https://github.com/DWTechs/CSVx.js.git
```

## Launch with docker

### build image :
```bash
$ cd CSVx.js/
$ docker-compose up -d
```

### build lib :
```bash
$ cd CSVx.js/
$ docker-compose run csvx
```

OR

### Install grunt :
- Run **npm update -g npm** to update npm
- Run **npm install -g grunt-cli**
## Install project dependencies :

```bash
$ cd CSVx.js/
$ npm i
```

### Install typescript :
- Run **npm install -g typescript**
# Workflow

- create a branch following [these instructions](https://lcluber.github.io/LeadDevToolkit/docs/git/branch.html)

### Install project dependencies
- Run **npm install** in your project directory
- build the library :

```bash
$ npm run build
```

### Workflow
- Run **grunt** to serve the website and start develop. (http://localhost:3000/)
- Run **grunt build** to build the library in development mode and serve the website.
- Run **grunt build** to build the library in production mode and serve the website.
- Use **grunt --help** to see the list of tasks.
- test the library :

```bash
$ npm run test
```

- commit your work following [conventional commits rules](https://lcluber.github.io/LeadDevToolkit/docs/git/commit.html) :


## Folders

- scripts/
- dist/
- src/
- tests/

- Set node environment if needed :
- Run **export NODE_ENV=development**
- Or **export NODE_ENV=production**
4 changes: 3 additions & 1 deletion dist/csvx.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -41,9 +41,10 @@ export declare class Export {
static options: Options;
static data(filename: string, data: {
[key: string]: number | string;
}[], options?: Partial<Options>): boolean;
}[], options?: Partial<Options>): Promise<boolean>;
static setOptions(options: Partial<Options>): void;
private static download;
private static save;
private static createTable;
private static createLabels;
private static createCustomLabels;
Expand All @@ -61,6 +62,7 @@ export interface Options {
customLabels: {
[key: string]: string;
} | null;
save: boolean;
[key: string]: string[] | String | boolean | {
[key: string]: string;
} | null;
Expand Down
Loading

0 comments on commit ef2b6f1

Please sign in to comment.