Skip to content

Commit 00e20c8

Browse files
version bump"
1 parent bfe15c8 commit 00e20c8

File tree

7 files changed

+174
-205
lines changed

7 files changed

+174
-205
lines changed

Gruntfile.cjs

Lines changed: 7 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,7 @@ module.exports = (grunt) => {
3939

4040

4141
const launchJest = () => require('child_process').spawnSync('./node_modules/.bin/jest', ['-c=jest.config.json', '-i'], {stdio: 'inherit'});
42+
const commit = () => require('child_process').spawnSync('git', ['commit', '-m version bump"', '-a'], {stdio: 'inherit'});
4243

4344
function make(grunt) {
4445
const cfg = require('./gruntCfg.json');
@@ -60,8 +61,6 @@ function make(grunt) {
6061
grunt.loadNpmTasks('@vamship/grunt-typedoc');
6162
grunt.loadNpmTasks('grunt-ts');
6263
grunt.loadNpmTasks('grunt-webpack');
63-
// grunt.loadNpmTasks('jest');
64-
grunt.loadNpmTasks('grunt-coveralls');
6564

6665
//------ Add Doc Tasks
6766
grunt.registerTask('noTask', []);
@@ -73,6 +72,7 @@ function make(grunt) {
7372
//------ Add Test Tasks
7473
grunt.registerTask('ospec', () => { require('child_process').spawnSync('./node_modules/.bin/ospec', {stdio: 'inherit'}); });
7574
grunt.registerTask('jest', () => launchJest().status===0)
75+
grunt.registerTask('commit', () => commit().status===0)
7676
grunt.registerTask('test', ['clean:cov', 'jest', 'copy:coverage', 'cleanupCoverage']);
7777

7878
//------ Add Coverage Reporting
@@ -84,20 +84,22 @@ function make(grunt) {
8484
grunt.registerTask('build-css', ['less']);
8585
grunt.registerTask('build-base', ['clean:dist', 'clean:docs', 'build-html', 'build-css', 'copy:bin']);
8686
switch(type) {
87-
case 'node':grunt.registerTask('buildMin', ['build-base', 'ts:esm', 'ts:cjs', 'doc', 'stage', 'test']);
87+
case 'node':grunt.registerTask('buildMin', ['build-base', 'ts:esm', 'ts:cjs', 'doc', 'stage', 'test', 'coverageReport']);
8888
grunt.registerTask('buildDev', ['build-base', 'ts:esm', 'ts:cjs', 'stage']);
8989
break;
90-
case 'lib': grunt.registerTask('buildMin', ['build-base', 'ts:esm', 'ts:cjs', 'webpack:appDev', 'webpack:appProd', 'doc', 'stage', 'test']);
90+
case 'lib': grunt.registerTask('buildMin', ['build-base', 'ts:esm', 'ts:cjs', 'webpack:appDev', 'webpack:appProd', 'doc', 'stage', 'test', 'coverageReport']);
9191
grunt.registerTask('buildDev', ['build-base', 'ts:esm', 'ts:cjs', 'webpack:appDev', 'stage']);
9292
break;
9393
case 'app':
94-
default: grunt.registerTask('buildMin', ['build-base', 'ts:esm', 'webpack:appDev', 'webpack:appProd', 'doc', 'stage', 'test']);
94+
default: grunt.registerTask('buildMin', ['build-base', 'ts:esm', 'webpack:appDev', 'webpack:appProd', 'doc', 'stage', 'test', 'coverageReport']);
9595
grunt.registerTask('buildDev', ['build-base', 'ts:esm', 'webpack:appDev', 'stage']);
9696
}
9797

9898
//------ Entry-point MultiTasks
9999
grunt.registerTask('default', ['product']);
100+
grunt.registerTask('publish', ['product', 'commit']);
100101
grunt.registerTask('dev', ['buildDev']);
102+
grunt.registerTask('build', ['product']);
101103
grunt.registerTask('product', ['buildMin']);
102104
grunt.registerTask('ci', ['build-base', 'ts:cjs', 'test', 'coverageReport']);
103105
grunt.registerTask('help', ['h']);
@@ -325,13 +327,6 @@ function make(grunt) {
325327
dest:''
326328
}
327329
},
328-
coveralls: {
329-
options: { force: true },
330-
main: {
331-
src: `docs/data/src/lcov.info`
332-
}
333-
},
334-
335330
watch: {
336331
dependencies: {
337332
files: dependencies.map(d => `./node_modules/${d.toLowerCase()}/bin/${d}.js`),

docs/data/hsDatab.json

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
"flags": {
1313
"isExported": true
1414
},
15-
"originalName": "/Users/sth1pal/Documents/Development/JavaScript/nodejs/ts6/dev/hsLibs/standalone/hsDatab/src/Data.ts",
15+
"originalName": "/Users/sth1pal/Documents/Development/code/ts/hsLibs/standalone/hsDatab/src/Data.ts",
1616
"comment": {},
1717
"children": [
1818
{
@@ -3054,7 +3054,7 @@
30543054
"flags": {
30553055
"isExported": true
30563056
},
3057-
"originalName": "/Users/sth1pal/Documents/Development/JavaScript/nodejs/ts6/dev/hsLibs/standalone/hsDatab/src/DataFilters.ts",
3057+
"originalName": "/Users/sth1pal/Documents/Development/code/ts/hsLibs/standalone/hsDatab/src/DataFilters.ts",
30583058
"comment": {
30593059
"shortText": "Use the {@link filter `filter`} function to executes a queries on a {@link Data `Data`} object.\nEach row in the data is checked and those for which `conditions` holds true are returned as a new `Data` object.",
30603060
"text": "# Condition construction\n\n### General Condition\n```\nCondition =\n IndexCondition -> conditions on the row index\n|| RecursiveCondition -> (set of) conditions on column values\n```\n\n### IndexCondition\n```\nIndexCondition =\n rowIndex:number -> true if row index matches\n```\n\n### RecursiveCondition\n```\nRecursiveCondition =\n OrCondition -> OR: true if any compound condition is true\n|| AndCondition -> AND: true if all compound conditions are true\n\nOrCondition = -> OR: true if\n AndCondition[] -> any of the AndConditions are true\n|| IndexCondition[] -> any of thr IndexConditions are true\n\nAndCondition = -> AND: true if\n SetAndCondition -> all SetAndConditions are true\n|| TermAndCondition -> or if all TermAndConditions are true\n\nSetAndCondition = { -> AND: true if all sub-conditions are true\n 'or': RecursiveCondition -> true if any RecursiveCondition is true\n|| 'and': RecursiveCondition -> true if all RecursiveCondition are true\n|| 'not': RecursiveCondition -> true if the condition is false\n\nTermAndCondition = { -> Terminal AND: true if all terminal sub-conditions are true\n colDesc:colValue -> true if colValue matches\n|| colDesc:[colValue, ...] -> true if any of the colValues match\n|| colDesc:function(value,row) -> true if function returns true\n}\n\ncolDesc = either column name or index\n```\n\n### Practical Tips\n```\n {'or': [recurCond, ...]} -> OR, same as [recurCond, ...]\n|| {'or': {SetCond, ...}} -> OR, same as [SetCond, ...]\n|| {'and': [recurCond, ...]} -> AND, true if all recurCond are true\n|| {'and': {SetCond, ...}} -> AND, same as {SetCond, ...}\n|| {'not': {SetCond, ...}} -> NAND: true if the SetCond are true\n|| {'not': [recurCond, ...]} -> NOR: true if any of the recurCond are true\n```\n\n# Example\n<example height=1000px libs={hsDatab:hsDatab}>\n<file name=\"script.js\">\nconst colNames = ['Name', 'Value', 'Start', 'End'];\nconst rows = [\n ['Harry', '100', '3/1/14', '11/20/14'],\n ['Mary', '1500', '7/1/14', '9/30/14'],\n ['Peter', '400', '5/20/14', '4/30/15'],\n ['Jane', '700', '11/13/14', '8/15/15']\n]\nconst data = new hsDatab.Data({colNames:colNames, rows:rows});\n\nqueries = [\n ['0', undefined, 'undefined query => pass all'],\n ['1', [], 'empty OR: [] => fail all'],\n ['2', {}, 'empty AND: {} => pass all'],\n ['3', 1, '2nd row: pass row 1'],\n ['4', [1,3], '2nd+4th: pass rows: 1 and 3'],\n ['5', {Name:\"Jane\"}, 'Name is Jane'],\n ['6', {1:1500}, 'Column 2 is 1500'],\n ['7', {Name:[\"Peter\", \"Jane\"]}, 'Name is Peter or Jane'],\n ['8', [{Name:\"Peter\"}, {Value:1500}], 'Name is Peter or Value is 1500'],\n ['9', {or:{Name:\"Peter\", Value:1500}}, 'OR: same as 8:'],\n ['A', {or:[{Name:\"Peter\"}, {Value:1500}]}, 'OR: [{Name is Peter}, {Value is 1500}]'],\n ['B', {Name:\"Peter\", Value:400}, 'Name is Peter and Value is 400'],\n ['C', {and:{Name:\"Peter\", Value:400}}, 'AND: {Name is Peter, Value is 400}'],\n ['D', {and:{Name:\"Peter\", Value:1500}}, 'AND: {Name is Peter, Value is 1500}'],\n ['E', {and:[{Name:\"Peter\"}, {Value:400}]}, 'AND:[{Name is Peter}, {Value is 400}]'],\n ['F', {and:[{Name:\"Peter\"}, {Value:1500}]},'AND:[{Name is Peter}, {Value is 1500}]'],\n ['G', {not:{Name:\"Peter\", Value:400}}, 'NAND: not {Name is Peter and Value is 400}'],\n ['H', {not:{Name:\"Peter\", Value:1500}}, 'NAND: not {Name is Peter and Value is 1500}'],\n ['I', {not:[{Name:\"Peter\"}, {Value:1500}]},'NOR: not [{Name is Peter} or {Value is 1500}]'],\n ['J', {Name:(v) => v.length===4}, 'Name has 4 letters']\n];\n\nm.mount(root, {\n view:() => m('', [\n m('h3', 'Given the data set:'),\n m('table#data', [\n m('tr', colNames.map(n => m('th', n))),\n ...rows.map(row => m('tr', [m('td', row[0]),m('td', row[1]),m('td', row[2].toDateString()),m('td', row[3].toDateString())]))\n ]),\n m('h3', 'The following queries yield:'),\n m('table', [\n m('tr', [m('th','#'), m('th','Query'), m('th',\"Live Result, by 'Name' field\")]),\n ...queries.map(q => {\n const result = data.filter(q[1]).getColumn('Name').join(', ');\n return m('tr', [m('td',`${q[0]}:`), m('td',`${q[2]}`), m('td',`[ ${result} ]`)]);\n })\n ])\n ])\n});\n</file>\n<file name='style.css'>\n $exampleID { height: 600px; }\n #data th { width:15%; }\n table {\n font-size: 10pt;\n margin-left: 10px;\n }\n</file>\n</example>\n"
@@ -3856,7 +3856,7 @@
38563856
"flags": {
38573857
"isExported": true
38583858
},
3859-
"originalName": "/Users/sth1pal/Documents/Development/JavaScript/nodejs/ts6/dev/hsLibs/standalone/hsDatab/src/index.ts",
3859+
"originalName": "/Users/sth1pal/Documents/Development/code/ts/hsLibs/standalone/hsDatab/src/index.ts",
38603860
"children": [
38613861
{
38623862
"id": 195,
@@ -4037,7 +4037,7 @@
40374037
"flags": {
40384038
"isExported": true
40394039
},
4040-
"originalName": "/Users/sth1pal/Documents/Development/JavaScript/nodejs/ts6/dev/hsLibs/standalone/hsDatab/src/overview.ts",
4040+
"originalName": "/Users/sth1pal/Documents/Development/code/ts/hsLibs/standalone/hsDatab/src/overview.ts",
40414041
"comment": {
40424042
"shortText": "# hsDatab",
40434043
"text": "Helpful Scripts framework-independent data management functions.\n<a href=\"./data/src/hsDatab/coverage/\" target=\"_blank\">[Coverage Info]</a>\n\n[![NPM License](https://img.shields.io/badge/license-MIT-brightgreen.svg)](https://www.npmjs.com/package/hsdatab)\n[![npm version](https://badge.fury.io/js/hsdatab.svg)](https://badge.fury.io/js/hsdatab)\n[![docs](https://img.shields.io/badge/hsDocs-hsDatab-blue.svg)](https://helpfulscripts.github.io/hsExcel/#!/api/hsDatab/0)\n[![Build Status](https://github.com/HelpfulScripts/hsDatab/workflows/CI/badge.svg)](https://github.com/HelpfulScripts/hsDatab/)\n[![codecov](https://codecov.io/gh/HelpfulScripts/hsDatab/branch/master/graph/badge.svg)](https://codecov.io/gh/HelpfulScripts/hsDatab)\n[![Known Vulnerabilities](https://snyk.io/test/github/HelpfulScripts/hsDatab/badge.svg?targetFile=package.json)](https://snyk.io/test/github/HelpfulScripts/hsDatab?targetFile=package.json)\n[![Dependencies Status](https://david-dm.org/helpfulscripts/hdatab.svg)](https://david-dm.org/helpfulscripts/hdatab)\n\n___\n\n**hsDatab** provides a JavaScript-based data management and query mechanism.\nData is managed in a simple in-memory database that holds data in rows of columns.\nIt autodetermines the types of data held in each column, along with the\ndomain range for each column of data.\nComplex filters can be applied by defining {@link DataFilters `Condition`}s using a simple query object structure.\n\n## Data Types\nsupported {@link Data.Data.type data types} include\n- **number**: numeric values\n- **name**: nominal values, represented by arbitrary words\n- **date**: date values\n- **currency**: Currently supported: '$dd[,ddd]'\n- **percent**: 'd%'\n\n## Data Class\nThe fundamental object in this library is {@link Data.Data `Data`},\na simple row-column based database object,\nfeaturing named columns, sorting, mapping and filtering functions.\n\n## Example\n<example height=500 libs={hsDatab:hsDatab}>\n<file name=\"script.js\">\nconst colNames = ['Name', 'Value', 'Start', 'End'];\nconst rows = [\n ['Harry', '100', '3/1/14', '11/20/14'],\n ['Mary', '1500', '7/1/14', '9/30/14'],\n ['Peter', '400', '5/20/14', '4/30/15'],\n ['Jane', '700', '11/13/14', '8/15/15']\n]\nconst data = new hsDatab.Data({colNames:colNames, rows:rows});\n\nquery = {Name:[\"Peter\", \"Jane\"]};\n\nconst dateConvert = d => new Date(d).toDateString();\n\nm.mount(root, {\n view:() => m('', [\n m('h3', 'Given the data set:'),\n m('pre',\n m('table#data', [\n m('tr', colNames.map(n => m('th', n))),\n ...rows.map(row => m('tr', [\n m('td', row[0]),\n m('td', row[1]),\n m('td', `${row[2].getMonth()+1}/${row[2].getDate()}/${row[2].getFullYear()}`),\n m('td', `${row[3].getMonth()+1}/${row[3].getDate()}/${row[3].getFullYear()}`)\n ]))\n ])),\n m('h3', 'The column types and domains are'),\n m('pre', m('table',\n m('tr', m('th', 'Column'), m('th', 'Type'), m('th', 'Domain')),\n m('tr', m('td', '\"Name\":'), m('td', data.colType(\"Name\")), m('td', data.findDomain(\"Name\").join(', '))),\n m('tr', m('td', '\"Value\":'), m('td', data.colType(\"Value\")), m('td', data.findDomain(\"Value\").join(' - '))),\n m('tr', m('td', '\"Start\":'), m('td', data.colType(\"Start\")), m('td', data.findDomain(\"Start\").map(dateConvert).join(' - '))),\n m('tr', m('td', '\"Stop\":'), m('td', data.colType(\"End\")), m('td', data.findDomain(\"End\").map(dateConvert).join(' - ')))\n )),\n m('h3', 'The query:'),\n m('code', JSON.stringify(query)),\n m('h3', 'yields results with \"Name\"'),\n m('code', data.filter(query).getColumn('Name').join(', '))\n ])\n});\n</file>\n<file name='style.css'>\n $exampleID { height: 600px; }\n #data th { width:15%; }\n #data { font-size: 11pt; }\n</file>\n</example>\n"

0 commit comments

Comments
 (0)