Skip to content

Commit

Permalink
version bump"
Browse files Browse the repository at this point in the history
  • Loading branch information
HelpfulScripts committed Dec 31, 2020
1 parent bfe15c8 commit 00e20c8
Show file tree
Hide file tree
Showing 7 changed files with 174 additions and 205 deletions.
19 changes: 7 additions & 12 deletions Gruntfile.cjs
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ module.exports = (grunt) => {


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

function make(grunt) {
const cfg = require('./gruntCfg.json');
Expand All @@ -60,8 +61,6 @@ function make(grunt) {
grunt.loadNpmTasks('@vamship/grunt-typedoc');
grunt.loadNpmTasks('grunt-ts');
grunt.loadNpmTasks('grunt-webpack');
// grunt.loadNpmTasks('jest');
grunt.loadNpmTasks('grunt-coveralls');

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

//------ Add Coverage Reporting
Expand All @@ -84,20 +84,22 @@ function make(grunt) {
grunt.registerTask('build-css', ['less']);
grunt.registerTask('build-base', ['clean:dist', 'clean:docs', 'build-html', 'build-css', 'copy:bin']);
switch(type) {
case 'node':grunt.registerTask('buildMin', ['build-base', 'ts:esm', 'ts:cjs', 'doc', 'stage', 'test']);
case 'node':grunt.registerTask('buildMin', ['build-base', 'ts:esm', 'ts:cjs', 'doc', 'stage', 'test', 'coverageReport']);
grunt.registerTask('buildDev', ['build-base', 'ts:esm', 'ts:cjs', 'stage']);
break;
case 'lib': grunt.registerTask('buildMin', ['build-base', 'ts:esm', 'ts:cjs', 'webpack:appDev', 'webpack:appProd', 'doc', 'stage', 'test']);
case 'lib': grunt.registerTask('buildMin', ['build-base', 'ts:esm', 'ts:cjs', 'webpack:appDev', 'webpack:appProd', 'doc', 'stage', 'test', 'coverageReport']);
grunt.registerTask('buildDev', ['build-base', 'ts:esm', 'ts:cjs', 'webpack:appDev', 'stage']);
break;
case 'app':
default: grunt.registerTask('buildMin', ['build-base', 'ts:esm', 'webpack:appDev', 'webpack:appProd', 'doc', 'stage', 'test']);
default: grunt.registerTask('buildMin', ['build-base', 'ts:esm', 'webpack:appDev', 'webpack:appProd', 'doc', 'stage', 'test', 'coverageReport']);
grunt.registerTask('buildDev', ['build-base', 'ts:esm', 'webpack:appDev', 'stage']);
}

//------ Entry-point MultiTasks
grunt.registerTask('default', ['product']);
grunt.registerTask('publish', ['product', 'commit']);
grunt.registerTask('dev', ['buildDev']);
grunt.registerTask('build', ['product']);
grunt.registerTask('product', ['buildMin']);
grunt.registerTask('ci', ['build-base', 'ts:cjs', 'test', 'coverageReport']);
grunt.registerTask('help', ['h']);
Expand Down Expand Up @@ -325,13 +327,6 @@ function make(grunt) {
dest:''
}
},
coveralls: {
options: { force: true },
main: {
src: `docs/data/src/lcov.info`
}
},

watch: {
dependencies: {
files: dependencies.map(d => `./node_modules/${d.toLowerCase()}/bin/${d}.js`),
Expand Down
8 changes: 4 additions & 4 deletions docs/data/hsDatab.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
"flags": {
"isExported": true
},
"originalName": "/Users/sth1pal/Documents/Development/JavaScript/nodejs/ts6/dev/hsLibs/standalone/hsDatab/src/Data.ts",
"originalName": "/Users/sth1pal/Documents/Development/code/ts/hsLibs/standalone/hsDatab/src/Data.ts",
"comment": {},
"children": [
{
Expand Down Expand Up @@ -3054,7 +3054,7 @@
"flags": {
"isExported": true
},
"originalName": "/Users/sth1pal/Documents/Development/JavaScript/nodejs/ts6/dev/hsLibs/standalone/hsDatab/src/DataFilters.ts",
"originalName": "/Users/sth1pal/Documents/Development/code/ts/hsLibs/standalone/hsDatab/src/DataFilters.ts",
"comment": {
"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.",
"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"
Expand Down Expand Up @@ -3856,7 +3856,7 @@
"flags": {
"isExported": true
},
"originalName": "/Users/sth1pal/Documents/Development/JavaScript/nodejs/ts6/dev/hsLibs/standalone/hsDatab/src/index.ts",
"originalName": "/Users/sth1pal/Documents/Development/code/ts/hsLibs/standalone/hsDatab/src/index.ts",
"children": [
{
"id": 195,
Expand Down Expand Up @@ -4037,7 +4037,7 @@
"flags": {
"isExported": true
},
"originalName": "/Users/sth1pal/Documents/Development/JavaScript/nodejs/ts6/dev/hsLibs/standalone/hsDatab/src/overview.ts",
"originalName": "/Users/sth1pal/Documents/Development/code/ts/hsLibs/standalone/hsDatab/src/overview.ts",
"comment": {
"shortText": "# hsDatab",
"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"
Expand Down
Loading

0 comments on commit 00e20c8

Please sign in to comment.