@vizabi/reader-ddfcsv 4.5.3 → 4.5.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.nyc_output/574fe7f0-58f6-4de2-9524-16e72b784218.json +1 -0
- package/.nyc_output/9aede69f-00e6-432d-bdeb-2c9f4084a6dc.json +1 -0
- package/.nyc_output/processinfo/574fe7f0-58f6-4de2-9524-16e72b784218.json +1 -0
- package/.nyc_output/processinfo/9aede69f-00e6-432d-bdeb-2c9f4084a6dc.json +1 -0
- package/.nyc_output/processinfo/index.json +1 -0
- package/LICENSE +0 -0
- package/README.md +2 -2
- package/coverage/base.css +224 -0
- package/coverage/block-navigation.js +87 -0
- package/coverage/favicon.png +0 -0
- package/coverage/index.html +161 -0
- package/coverage/prettify.css +1 -0
- package/coverage/prettify.js +2 -0
- package/coverage/sort-arrow-sprite.png +0 -0
- package/coverage/sorter.js +210 -0
- package/coverage/src/ddf-csv.ts.html +2866 -0
- package/coverage/src/ddfcsv-error.ts.html +148 -0
- package/coverage/src/ddfcsv-reader.ts.html +538 -0
- package/coverage/src/file-readers/backend-file-reader.ts.html +175 -0
- package/coverage/src/file-readers/github-path-adapter.ts.html +244 -0
- package/coverage/src/file-readers/index.html +131 -0
- package/coverage/src/index.html +176 -0
- package/coverage/src/index.ts.html +145 -0
- package/coverage/src/interfaces.ts.html +196 -0
- package/coverage/src/resource-selection-optimizer/in-clause-under-conjunction.ts.html +745 -0
- package/coverage/src/resource-selection-optimizer/index.html +131 -0
- package/coverage/src/resource-selection-optimizer/index.ts.html +118 -0
- package/coverage/src/test-cases/concepts.ts.html +166 -0
- package/coverage/src/test-cases/entities.ts.html +241 -0
- package/coverage/src/test-cases/index.html +131 -0
- package/dist/reader-ddfcsv.js +15 -1
- package/dist/reader-ddfcsv.js.map +1 -0
- package/dist/stats.html +4950 -0
- package/icon.png +0 -0
- package/lib/src/ddf-csv.d.ts +0 -0
- package/lib/src/ddf-csv.js +13 -14
- package/lib/src/ddf-csv.js.map +1 -1
- package/lib/src/ddfcsv-error.d.ts +0 -0
- package/lib/src/ddfcsv-error.js +0 -0
- package/lib/src/ddfcsv-error.js.map +0 -0
- package/lib/src/ddfcsv-reader.d.ts +0 -0
- package/lib/src/ddfcsv-reader.js +5 -5
- package/lib/src/ddfcsv-reader.js.map +1 -1
- package/lib/src/file-readers/backend-file-reader.d.ts +0 -0
- package/lib/src/file-readers/backend-file-reader.js +0 -0
- package/lib/src/file-readers/backend-file-reader.js.map +0 -0
- package/lib/src/file-readers/github-path-adapter.d.ts +0 -0
- package/lib/src/file-readers/github-path-adapter.js +0 -0
- package/lib/src/file-readers/github-path-adapter.js.map +0 -0
- package/lib/src/index.d.ts +0 -0
- package/lib/src/index.js +2 -2
- package/lib/src/index.js.map +0 -0
- package/lib/src/interfaces.d.ts +0 -0
- package/lib/src/interfaces.js +0 -0
- package/lib/src/interfaces.js.map +0 -0
- package/lib/src/resource-selection-optimizer/in-clause-under-conjunction.d.ts +0 -0
- package/lib/src/resource-selection-optimizer/in-clause-under-conjunction.js +16 -17
- package/lib/src/resource-selection-optimizer/in-clause-under-conjunction.js.map +1 -1
- package/lib/src/resource-selection-optimizer/index.d.ts +0 -0
- package/lib/src/resource-selection-optimizer/index.js +2 -2
- package/lib/src/resource-selection-optimizer/index.js.map +1 -1
- package/lib-web/src/ddf-csv.d.ts +0 -0
- package/lib-web/src/ddf-csv.js +30 -34
- package/lib-web/src/ddf-csv.js.map +1 -1
- package/lib-web/src/ddfcsv-error.d.ts +0 -0
- package/lib-web/src/ddfcsv-error.js +5 -9
- package/lib-web/src/ddfcsv-error.js.map +1 -1
- package/lib-web/src/ddfcsv-reader.d.ts +0 -0
- package/lib-web/src/ddfcsv-reader.js +16 -19
- package/lib-web/src/ddfcsv-reader.js.map +1 -1
- package/lib-web/src/file-readers/frontend-file-reader.d.ts +0 -0
- package/lib-web/src/file-readers/frontend-file-reader.js +1 -5
- package/lib-web/src/file-readers/frontend-file-reader.js.map +1 -1
- package/lib-web/src/file-readers/github-path-adapter.d.ts +0 -0
- package/lib-web/src/file-readers/github-path-adapter.js +1 -4
- package/lib-web/src/file-readers/github-path-adapter.js.map +1 -1
- package/lib-web/src/index-web.d.ts +0 -0
- package/lib-web/src/index-web.js +9 -14
- package/lib-web/src/index-web.js.map +1 -1
- package/lib-web/src/interfaces.d.ts +0 -0
- package/lib-web/src/interfaces.js +1 -2
- package/lib-web/src/interfaces.js.map +0 -0
- package/lib-web/src/resource-selection-optimizer/in-clause-under-conjunction.d.ts +0 -0
- package/lib-web/src/resource-selection-optimizer/in-clause-under-conjunction.js +12 -17
- package/lib-web/src/resource-selection-optimizer/in-clause-under-conjunction.js.map +1 -1
- package/lib-web/src/resource-selection-optimizer/index.d.ts +0 -0
- package/lib-web/src/resource-selection-optimizer/index.js +4 -7
- package/lib-web/src/resource-selection-optimizer/index.js.map +1 -1
- package/package.json +93 -129
- package/rollup.config.mjs +30 -0
- package/scripts/set-own-version.js +0 -0
- package/src/ddf-csv.ts +927 -927
- package/src/ddfcsv-error.ts +0 -0
- package/src/ddfcsv-reader.ts +151 -151
- package/src/file-readers/backend-file-reader.ts +0 -0
- package/src/file-readers/frontend-file-reader.ts +0 -0
- package/src/file-readers/github-path-adapter.ts +0 -0
- package/src/index-web.ts +0 -0
- package/src/index.ts +0 -0
- package/src/interfaces.ts +0 -0
- package/src/resource-selection-optimizer/in-clause-under-conjunction.ts +220 -220
- package/src/resource-selection-optimizer/index.ts +11 -11
- package/src/test-cases/concepts.ts +0 -0
- package/src/test-cases/entities.ts +52 -52
- package/test/assets-fixtures/world-50m.json +0 -0
- package/test/assets.spec.ts +0 -0
- package/test/common.ts +1 -1
- package/test/definition/concepts-definition.spec.ts +0 -0
- package/test/definition/datapoints-definition.spec.ts +1 -1
- package/test/definition/entities-definition.spec.ts +264 -264
- package/test/definition/schema-definition.spec.ts +0 -0
- package/test/diagnostics.spec.ts +0 -0
- package/test/features-service.spec.ts +95 -95
- package/test/high-load.spec.ts +0 -0
- package/test/main.spec.ts +0 -0
- package/test/multi-instances.spec.ts +0 -0
- package/test/result-fixtures/datapoints-assets.json +0 -0
- package/test/result-fixtures/in-clause-under-conjunction-1.json +0 -0
- package/test/result-fixtures/in-clause-under-conjunction-2.json +0 -0
- package/test/result-fixtures/multi-instances/concepts-sg.json +0 -0
- package/test/result-fixtures/multi-instances/concepts-soderstornsmodellen.json +0 -0
- package/test/result-fixtures/multi-instances/datapoints-sg.json +0 -0
- package/test/result-fixtures/multi-instances/datapoints-soderstornsmodellen.json +0 -0
- package/test/result-fixtures/multi-instances/entities-sg.json +0 -0
- package/test/result-fixtures/multi-instances/entities-soderstornsmodellen.json +0 -0
- package/test/result-fixtures/multi-instances/schema-sg.json +0 -0
- package/test/result-fixtures/multi-instances/schema-soderstornsmodellen.json +0 -0
- package/test/schema.spec.ts +0 -0
- package/test/tslint.json +0 -0
- package/tsconfig-web.json +41 -41
- package/tsconfig.json +40 -37
- package/tslint.json +0 -0
- package/.travis.yml +0 -37
- package/deploy.js +0 -87
- package/dist/reader-ddfcsv-polyfill.js +0 -2
- package/dist/reader-ddfcsv-polyfill.js.map +0 -1
- package/test/mocha.opts +0 -7
|
@@ -1,95 +1,95 @@
|
|
|
1
|
-
import * as chai from 'chai';
|
|
2
|
-
import
|
|
3
|
-
import { QueryFeature, featureDetectors } from '@vizabi/ddf-query-validator';
|
|
4
|
-
|
|
5
|
-
const expect = chai.expect;
|
|
6
|
-
const conceptsLookupStub = new Map();
|
|
7
|
-
|
|
8
|
-
conceptsLookupStub.set('country', {concept: 'country', concept_type: 'entity_set', domain: 'geo'});
|
|
9
|
-
conceptsLookupStub.set('geo', {concept: 'geo', concept_type: 'entity_domain', domain: ''});
|
|
10
|
-
|
|
11
|
-
describe('Query features', () => {
|
|
12
|
-
it('when query is appropriate then WhereClauseBasedOnConjunction and ConjunctionPartFromWhereClauseCorrespondsToJoin should be detected', done => {
|
|
13
|
-
const query = {
|
|
14
|
-
from: 'datapoints',
|
|
15
|
-
select: {
|
|
16
|
-
key: [
|
|
17
|
-
'country',
|
|
18
|
-
'time'
|
|
19
|
-
],
|
|
20
|
-
value: [
|
|
21
|
-
'income_per_person_gdppercapita_ppp_inflation_adjusted',
|
|
22
|
-
'life_expectancy_years',
|
|
23
|
-
'population_total'
|
|
24
|
-
]
|
|
25
|
-
},
|
|
26
|
-
where: {
|
|
27
|
-
$and: [
|
|
28
|
-
{
|
|
29
|
-
country: '$country'
|
|
30
|
-
}
|
|
31
|
-
]
|
|
32
|
-
},
|
|
33
|
-
join: {
|
|
34
|
-
$country: {
|
|
35
|
-
key: 'country',
|
|
36
|
-
where: {
|
|
37
|
-
country: {$in: ['afg']}
|
|
38
|
-
}
|
|
39
|
-
}
|
|
40
|
-
},
|
|
41
|
-
order_by: [
|
|
42
|
-
'time'
|
|
43
|
-
]
|
|
44
|
-
};
|
|
45
|
-
|
|
46
|
-
const relatedFeatures = compact(featureDetectors.map(detector => detector(query, conceptsLookupStub)));
|
|
47
|
-
|
|
48
|
-
expect(relatedFeatures).to.includes(QueryFeature.WhereClauseBasedOnConjunction);
|
|
49
|
-
expect(relatedFeatures).to.includes(QueryFeature.ConjunctionPartFromWhereClauseCorrespondsToJoin);
|
|
50
|
-
|
|
51
|
-
done();
|
|
52
|
-
});
|
|
53
|
-
|
|
54
|
-
it('when where section does NOT contain $and clause WhereClauseBasedOnConjunction should NOT be detected', done => {
|
|
55
|
-
const query = {
|
|
56
|
-
from: 'datapoints',
|
|
57
|
-
animatable: 'time',
|
|
58
|
-
select: {
|
|
59
|
-
key: ['geo', 'time'],
|
|
60
|
-
value: ['life_expectancy_years', 'income_per_person_gdppercapita_ppp_inflation_adjusted', 'population_total']
|
|
61
|
-
},
|
|
62
|
-
where: {
|
|
63
|
-
time: {$gt: 1800, $lt: 2016}
|
|
64
|
-
},
|
|
65
|
-
grouping: {},
|
|
66
|
-
order_by: ['time', 'geo']
|
|
67
|
-
};
|
|
68
|
-
|
|
69
|
-
const relatedFeatures = compact(featureDetectors.map(detector => detector(query, conceptsLookupStub)));
|
|
70
|
-
|
|
71
|
-
expect(relatedFeatures).to.not.includes(QueryFeature.WhereClauseBasedOnConjunction);
|
|
72
|
-
|
|
73
|
-
done();
|
|
74
|
-
});
|
|
75
|
-
|
|
76
|
-
it('when query is NOT datapoint based then WhereClauseBasedOnConjunction and ConjunctionPartFromWhereClauseCorrespondsToJoin should NOT be detected', done => {
|
|
77
|
-
const query = {
|
|
78
|
-
from: 'entities',
|
|
79
|
-
animatable: 'time',
|
|
80
|
-
select: {
|
|
81
|
-
key: ['geo'],
|
|
82
|
-
value: ['name', 'world_4region', 'latitude', 'longitude']
|
|
83
|
-
},
|
|
84
|
-
where: {'is--country': true},
|
|
85
|
-
grouping: {},
|
|
86
|
-
orderBy: null
|
|
87
|
-
};
|
|
88
|
-
|
|
89
|
-
const relatedFeatures = compact(featureDetectors.map(detector => detector(query, conceptsLookupStub)));
|
|
90
|
-
|
|
91
|
-
expect(relatedFeatures).to.not.includes(QueryFeature.WhereClauseBasedOnConjunction);
|
|
92
|
-
|
|
93
|
-
done();
|
|
94
|
-
});
|
|
95
|
-
});
|
|
1
|
+
import * as chai from 'chai';
|
|
2
|
+
import compact from 'lodash-es/compact';
|
|
3
|
+
import { QueryFeature, featureDetectors } from '@vizabi/ddf-query-validator';
|
|
4
|
+
|
|
5
|
+
const expect = chai.expect;
|
|
6
|
+
const conceptsLookupStub = new Map();
|
|
7
|
+
|
|
8
|
+
conceptsLookupStub.set('country', {concept: 'country', concept_type: 'entity_set', domain: 'geo'});
|
|
9
|
+
conceptsLookupStub.set('geo', {concept: 'geo', concept_type: 'entity_domain', domain: ''});
|
|
10
|
+
|
|
11
|
+
describe('Query features', () => {
|
|
12
|
+
it('when query is appropriate then WhereClauseBasedOnConjunction and ConjunctionPartFromWhereClauseCorrespondsToJoin should be detected', done => {
|
|
13
|
+
const query = {
|
|
14
|
+
from: 'datapoints',
|
|
15
|
+
select: {
|
|
16
|
+
key: [
|
|
17
|
+
'country',
|
|
18
|
+
'time'
|
|
19
|
+
],
|
|
20
|
+
value: [
|
|
21
|
+
'income_per_person_gdppercapita_ppp_inflation_adjusted',
|
|
22
|
+
'life_expectancy_years',
|
|
23
|
+
'population_total'
|
|
24
|
+
]
|
|
25
|
+
},
|
|
26
|
+
where: {
|
|
27
|
+
$and: [
|
|
28
|
+
{
|
|
29
|
+
country: '$country'
|
|
30
|
+
}
|
|
31
|
+
]
|
|
32
|
+
},
|
|
33
|
+
join: {
|
|
34
|
+
$country: {
|
|
35
|
+
key: 'country',
|
|
36
|
+
where: {
|
|
37
|
+
country: {$in: ['afg']}
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
},
|
|
41
|
+
order_by: [
|
|
42
|
+
'time'
|
|
43
|
+
]
|
|
44
|
+
};
|
|
45
|
+
|
|
46
|
+
const relatedFeatures = compact(featureDetectors.map(detector => detector(query, conceptsLookupStub)));
|
|
47
|
+
|
|
48
|
+
expect(relatedFeatures).to.includes(QueryFeature.WhereClauseBasedOnConjunction);
|
|
49
|
+
expect(relatedFeatures).to.includes(QueryFeature.ConjunctionPartFromWhereClauseCorrespondsToJoin);
|
|
50
|
+
|
|
51
|
+
done();
|
|
52
|
+
});
|
|
53
|
+
|
|
54
|
+
it('when where section does NOT contain $and clause WhereClauseBasedOnConjunction should NOT be detected', done => {
|
|
55
|
+
const query = {
|
|
56
|
+
from: 'datapoints',
|
|
57
|
+
animatable: 'time',
|
|
58
|
+
select: {
|
|
59
|
+
key: ['geo', 'time'],
|
|
60
|
+
value: ['life_expectancy_years', 'income_per_person_gdppercapita_ppp_inflation_adjusted', 'population_total']
|
|
61
|
+
},
|
|
62
|
+
where: {
|
|
63
|
+
time: {$gt: 1800, $lt: 2016}
|
|
64
|
+
},
|
|
65
|
+
grouping: {},
|
|
66
|
+
order_by: ['time', 'geo']
|
|
67
|
+
};
|
|
68
|
+
|
|
69
|
+
const relatedFeatures = compact(featureDetectors.map(detector => detector(query, conceptsLookupStub)));
|
|
70
|
+
|
|
71
|
+
expect(relatedFeatures).to.not.includes(QueryFeature.WhereClauseBasedOnConjunction);
|
|
72
|
+
|
|
73
|
+
done();
|
|
74
|
+
});
|
|
75
|
+
|
|
76
|
+
it('when query is NOT datapoint based then WhereClauseBasedOnConjunction and ConjunctionPartFromWhereClauseCorrespondsToJoin should NOT be detected', done => {
|
|
77
|
+
const query = {
|
|
78
|
+
from: 'entities',
|
|
79
|
+
animatable: 'time',
|
|
80
|
+
select: {
|
|
81
|
+
key: ['geo'],
|
|
82
|
+
value: ['name', 'world_4region', 'latitude', 'longitude']
|
|
83
|
+
},
|
|
84
|
+
where: {'is--country': true},
|
|
85
|
+
grouping: {},
|
|
86
|
+
orderBy: null
|
|
87
|
+
};
|
|
88
|
+
|
|
89
|
+
const relatedFeatures = compact(featureDetectors.map(detector => detector(query, conceptsLookupStub)));
|
|
90
|
+
|
|
91
|
+
expect(relatedFeatures).to.not.includes(QueryFeature.WhereClauseBasedOnConjunction);
|
|
92
|
+
|
|
93
|
+
done();
|
|
94
|
+
});
|
|
95
|
+
});
|
package/test/high-load.spec.ts
CHANGED
|
File without changes
|
package/test/main.spec.ts
CHANGED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
package/test/schema.spec.ts
CHANGED
|
File without changes
|
package/test/tslint.json
CHANGED
|
File without changes
|
package/tsconfig-web.json
CHANGED
|
@@ -1,41 +1,41 @@
|
|
|
1
|
-
{
|
|
2
|
-
"compilerOptions": {
|
|
3
|
-
"declaration": true,
|
|
4
|
-
"target": "
|
|
5
|
-
"module": "
|
|
6
|
-
"noImplicitAny": false,
|
|
7
|
-
"outDir": "./lib-web/src",
|
|
8
|
-
"preserveConstEnums": true,
|
|
9
|
-
"removeComments": true,
|
|
10
|
-
"typeRoots": ["node_modules/@types"],
|
|
11
|
-
"moduleResolution": "node",
|
|
12
|
-
"emitDecoratorMetadata": true,
|
|
13
|
-
"experimentalDecorators": true,
|
|
14
|
-
"allowSyntheticDefaultImports": true,
|
|
15
|
-
"alwaysStrict": true,
|
|
16
|
-
"sourceMap": true,
|
|
17
|
-
"noEmitHelpers": true,
|
|
18
|
-
"importHelpers": true,
|
|
19
|
-
"strictNullChecks": false,
|
|
20
|
-
"baseUrl": ".",
|
|
21
|
-
"paths": {
|
|
22
|
-
"tslib" : ["node_modules/tslib/tslib.d.ts"]
|
|
23
|
-
},
|
|
24
|
-
"lib": [
|
|
25
|
-
"es2020",
|
|
26
|
-
"dom"
|
|
27
|
-
],
|
|
28
|
-
"downlevelIteration": true
|
|
29
|
-
},
|
|
30
|
-
"include": [
|
|
31
|
-
"src/index-web.ts"
|
|
32
|
-
],
|
|
33
|
-
"exclude": [
|
|
34
|
-
"dist",
|
|
35
|
-
"lib",
|
|
36
|
-
"lib-web",
|
|
37
|
-
"node_modules",
|
|
38
|
-
"**/*.spec.ts",
|
|
39
|
-
"test/common.ts"
|
|
40
|
-
]
|
|
41
|
-
}
|
|
1
|
+
{
|
|
2
|
+
"compilerOptions": {
|
|
3
|
+
"declaration": true,
|
|
4
|
+
"target": "es2020",
|
|
5
|
+
"module": "ES2020",
|
|
6
|
+
"noImplicitAny": false,
|
|
7
|
+
"outDir": "./lib-web/src",
|
|
8
|
+
"preserveConstEnums": true,
|
|
9
|
+
"removeComments": true,
|
|
10
|
+
"typeRoots": ["node_modules/@types"],
|
|
11
|
+
"moduleResolution": "node",
|
|
12
|
+
"emitDecoratorMetadata": true,
|
|
13
|
+
"experimentalDecorators": true,
|
|
14
|
+
"allowSyntheticDefaultImports": true,
|
|
15
|
+
"alwaysStrict": true,
|
|
16
|
+
"sourceMap": true,
|
|
17
|
+
"noEmitHelpers": true,
|
|
18
|
+
"importHelpers": true,
|
|
19
|
+
"strictNullChecks": false,
|
|
20
|
+
"baseUrl": ".",
|
|
21
|
+
"paths": {
|
|
22
|
+
"tslib" : ["node_modules/tslib/tslib.d.ts"]
|
|
23
|
+
},
|
|
24
|
+
"lib": [
|
|
25
|
+
"es2020",
|
|
26
|
+
"dom"
|
|
27
|
+
],
|
|
28
|
+
"downlevelIteration": true
|
|
29
|
+
},
|
|
30
|
+
"include": [
|
|
31
|
+
"src/index-web.ts"
|
|
32
|
+
],
|
|
33
|
+
"exclude": [
|
|
34
|
+
"dist",
|
|
35
|
+
"lib",
|
|
36
|
+
"lib-web",
|
|
37
|
+
"node_modules",
|
|
38
|
+
"**/*.spec.ts",
|
|
39
|
+
"test/common.ts"
|
|
40
|
+
]
|
|
41
|
+
}
|
package/tsconfig.json
CHANGED
|
@@ -1,37 +1,40 @@
|
|
|
1
|
-
{
|
|
2
|
-
"compilerOptions": {
|
|
3
|
-
"declaration": true,
|
|
4
|
-
"target": "
|
|
5
|
-
"module": "commonjs",
|
|
6
|
-
"noImplicitAny": false,
|
|
7
|
-
"outDir": "./lib/src",
|
|
8
|
-
"preserveConstEnums": true,
|
|
9
|
-
"removeComments": true,
|
|
10
|
-
"typeRoots": ["node_modules/@types"],
|
|
11
|
-
"moduleResolution": "node",
|
|
12
|
-
"emitDecoratorMetadata": true,
|
|
13
|
-
"experimentalDecorators": true,
|
|
14
|
-
"allowSyntheticDefaultImports": true,
|
|
15
|
-
"alwaysStrict": true,
|
|
16
|
-
"sourceMap": true,
|
|
17
|
-
"noEmitHelpers": true,
|
|
18
|
-
"importHelpers": true,
|
|
19
|
-
"strictNullChecks": false,
|
|
20
|
-
"baseUrl": ".",
|
|
21
|
-
"
|
|
22
|
-
"
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
"
|
|
30
|
-
"
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
"
|
|
34
|
-
"
|
|
35
|
-
"
|
|
36
|
-
|
|
37
|
-
|
|
1
|
+
{
|
|
2
|
+
"compilerOptions": {
|
|
3
|
+
"declaration": true,
|
|
4
|
+
"target": "es2020",
|
|
5
|
+
"module": "commonjs",
|
|
6
|
+
"noImplicitAny": false,
|
|
7
|
+
"outDir": "./lib/src",
|
|
8
|
+
"preserveConstEnums": true,
|
|
9
|
+
"removeComments": true,
|
|
10
|
+
"typeRoots": ["node_modules/@types"],
|
|
11
|
+
"moduleResolution": "node",
|
|
12
|
+
"emitDecoratorMetadata": true,
|
|
13
|
+
"experimentalDecorators": true,
|
|
14
|
+
"allowSyntheticDefaultImports": true,
|
|
15
|
+
"alwaysStrict": true,
|
|
16
|
+
"sourceMap": true,
|
|
17
|
+
"noEmitHelpers": true,
|
|
18
|
+
"importHelpers": true,
|
|
19
|
+
"strictNullChecks": false,
|
|
20
|
+
"baseUrl": ".",
|
|
21
|
+
"paths": {
|
|
22
|
+
"tslib" : ["node_modules/tslib/tslib.d.ts"]
|
|
23
|
+
},
|
|
24
|
+
"lib": [
|
|
25
|
+
"es2020",
|
|
26
|
+
"dom"
|
|
27
|
+
]
|
|
28
|
+
},
|
|
29
|
+
"include": [
|
|
30
|
+
"src/index.ts"
|
|
31
|
+
],
|
|
32
|
+
"exclude": [
|
|
33
|
+
"dist",
|
|
34
|
+
"lib",
|
|
35
|
+
"lib-web",
|
|
36
|
+
"node_modules",
|
|
37
|
+
"**/*.spec.ts",
|
|
38
|
+
"test/common.ts"
|
|
39
|
+
]
|
|
40
|
+
}
|
package/tslint.json
CHANGED
|
File without changes
|
package/.travis.yml
DELETED
|
@@ -1,37 +0,0 @@
|
|
|
1
|
-
language: node_js
|
|
2
|
-
sudo: true
|
|
3
|
-
node_js:
|
|
4
|
-
- "8.11.2"
|
|
5
|
-
addons:
|
|
6
|
-
apt:
|
|
7
|
-
packages:
|
|
8
|
-
- python-pip
|
|
9
|
-
|
|
10
|
-
git:
|
|
11
|
-
submodules: false
|
|
12
|
-
|
|
13
|
-
before_install:
|
|
14
|
-
- sudo pip install s3cmd
|
|
15
|
-
- sed -i 's/git@github.com:/https:\/\/github.com\//' .gitmodules
|
|
16
|
-
- git submodule update --init --remote --recursive
|
|
17
|
-
|
|
18
|
-
script:
|
|
19
|
-
- npm run-script test-travis
|
|
20
|
-
- npm run deploy
|
|
21
|
-
|
|
22
|
-
deploy:
|
|
23
|
-
provider: npm
|
|
24
|
-
email: vyacheslav.chub@valor-software.com
|
|
25
|
-
api_key:
|
|
26
|
-
secure: $GITHUB_TOKEN
|
|
27
|
-
on:
|
|
28
|
-
branch: develop
|
|
29
|
-
node: 8.11.2
|
|
30
|
-
condition: "-e /tmp/deployment.flag"
|
|
31
|
-
|
|
32
|
-
branches:
|
|
33
|
-
only:
|
|
34
|
-
- master
|
|
35
|
-
- develop
|
|
36
|
-
- development
|
|
37
|
-
- stage
|
package/deploy.js
DELETED
|
@@ -1,87 +0,0 @@
|
|
|
1
|
-
const shell = require('shelljs');
|
|
2
|
-
const cv = require('compare-version');
|
|
3
|
-
const fs = require('fs');
|
|
4
|
-
const path = require('path');
|
|
5
|
-
const rmrf = require('rimraf');
|
|
6
|
-
|
|
7
|
-
const {
|
|
8
|
-
TRAVIS_BRANCH,
|
|
9
|
-
AWS_BUCKET,
|
|
10
|
-
AWS_ACCESS_KEY_ID,
|
|
11
|
-
AWS_SECRET_KEY,
|
|
12
|
-
AWS_SUBFOLDER
|
|
13
|
-
} = process.env;
|
|
14
|
-
|
|
15
|
-
const projectDir = process.cwd();
|
|
16
|
-
const pjson = require(path.join(projectDir, 'package.json'));
|
|
17
|
-
const oldPjson = JSON.parse(shell.exec("git show HEAD~1:package.json").stdout);
|
|
18
|
-
const lastPublishedVersion = shell.exec("npm show " + pjson.name + " version").stdout.trim();
|
|
19
|
-
const versionBump = cv(oldPjson.version, pjson.version) < 0;
|
|
20
|
-
|
|
21
|
-
const bump = () => {
|
|
22
|
-
if (TRAVIS_BRANCH !== "develop") {
|
|
23
|
-
return console.log("--- Not publishing.");
|
|
24
|
-
}
|
|
25
|
-
|
|
26
|
-
const FLAGFILE = "/tmp/deployment.flag";
|
|
27
|
-
fs.writeFileSync(FLAGFILE);
|
|
28
|
-
|
|
29
|
-
console.log("--- Latest published version: ", lastPublishedVersion);
|
|
30
|
-
console.log("--- Previous package.json version: ", oldPjson.version);
|
|
31
|
-
console.log("--- Current package.json version: ", pjson.version);
|
|
32
|
-
|
|
33
|
-
console.log("===== Bumped version:", versionBump);
|
|
34
|
-
|
|
35
|
-
if (!versionBump) {
|
|
36
|
-
console.log("--- Publishing...");
|
|
37
|
-
pjson.version = lastPublishedVersion;
|
|
38
|
-
fs.writeFileSync(path.join(projectDir, 'package.json'), JSON.stringify(pjson, null, 2));
|
|
39
|
-
shell.exec("git add package.json");
|
|
40
|
-
shell.exec("git config --global user.name travis");
|
|
41
|
-
shell.exec("git config --global user.email travis@example.com");
|
|
42
|
-
shell.exec("git commit --amend -C $(git rev-parse --verify HEAD)");
|
|
43
|
-
shell.exec("npm version --no-git-tag-version prerelease");
|
|
44
|
-
shell.exec("git status");
|
|
45
|
-
shell.exec("git add package.json");
|
|
46
|
-
shell.exec("git commit --amend -C $(git rev-parse --verify HEAD)");
|
|
47
|
-
// need rebuild after version bump so that the published vizabi is self-aware of its version
|
|
48
|
-
shell.exec("npm run build");
|
|
49
|
-
}
|
|
50
|
-
};
|
|
51
|
-
|
|
52
|
-
const upload = (path) => {
|
|
53
|
-
shell.exec(
|
|
54
|
-
`s3cmd -v --config=/tmp/.${AWS_BUCKET}-s3.s3cfg` +
|
|
55
|
-
` --acl-public` +
|
|
56
|
-
` --recursive` +
|
|
57
|
-
` --no-mime-magic` +
|
|
58
|
-
` --guess-mime-type` +
|
|
59
|
-
` sync dist/reader-ddfcsv.js "${path}"`
|
|
60
|
-
);
|
|
61
|
-
|
|
62
|
-
shell.exec(
|
|
63
|
-
`s3cmd -v --config=/tmp/.${AWS_BUCKET}-s3.s3cfg` +
|
|
64
|
-
` --acl-public` +
|
|
65
|
-
` --recursive` +
|
|
66
|
-
` --no-mime-magic` +
|
|
67
|
-
` --guess-mime-type` +
|
|
68
|
-
` sync dist/reader-ddfcsv.js.map "${path}"`
|
|
69
|
-
);
|
|
70
|
-
};
|
|
71
|
-
|
|
72
|
-
const deploy = () => {
|
|
73
|
-
shell.ShellString([
|
|
74
|
-
'[default]',
|
|
75
|
-
`access_key = ${AWS_ACCESS_KEY_ID}`,
|
|
76
|
-
`secret_key = ${AWS_SECRET_KEY}`,
|
|
77
|
-
`acl_public = True`
|
|
78
|
-
].join('\n')).to(`/tmp/.${AWS_BUCKET}-s3.s3cfg`);
|
|
79
|
-
|
|
80
|
-
upload(`s3://${AWS_BUCKET}/${AWS_SUBFOLDER}/${TRAVIS_BRANCH}/`);
|
|
81
|
-
versionBump && upload(`s3://${AWS_BUCKET}/`);
|
|
82
|
-
|
|
83
|
-
rmrf.sync('/.tmp');
|
|
84
|
-
};
|
|
85
|
-
|
|
86
|
-
deploy();
|
|
87
|
-
bump();
|