@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.
Files changed (137) hide show
  1. package/.nyc_output/574fe7f0-58f6-4de2-9524-16e72b784218.json +1 -0
  2. package/.nyc_output/9aede69f-00e6-432d-bdeb-2c9f4084a6dc.json +1 -0
  3. package/.nyc_output/processinfo/574fe7f0-58f6-4de2-9524-16e72b784218.json +1 -0
  4. package/.nyc_output/processinfo/9aede69f-00e6-432d-bdeb-2c9f4084a6dc.json +1 -0
  5. package/.nyc_output/processinfo/index.json +1 -0
  6. package/LICENSE +0 -0
  7. package/README.md +2 -2
  8. package/coverage/base.css +224 -0
  9. package/coverage/block-navigation.js +87 -0
  10. package/coverage/favicon.png +0 -0
  11. package/coverage/index.html +161 -0
  12. package/coverage/prettify.css +1 -0
  13. package/coverage/prettify.js +2 -0
  14. package/coverage/sort-arrow-sprite.png +0 -0
  15. package/coverage/sorter.js +210 -0
  16. package/coverage/src/ddf-csv.ts.html +2866 -0
  17. package/coverage/src/ddfcsv-error.ts.html +148 -0
  18. package/coverage/src/ddfcsv-reader.ts.html +538 -0
  19. package/coverage/src/file-readers/backend-file-reader.ts.html +175 -0
  20. package/coverage/src/file-readers/github-path-adapter.ts.html +244 -0
  21. package/coverage/src/file-readers/index.html +131 -0
  22. package/coverage/src/index.html +176 -0
  23. package/coverage/src/index.ts.html +145 -0
  24. package/coverage/src/interfaces.ts.html +196 -0
  25. package/coverage/src/resource-selection-optimizer/in-clause-under-conjunction.ts.html +745 -0
  26. package/coverage/src/resource-selection-optimizer/index.html +131 -0
  27. package/coverage/src/resource-selection-optimizer/index.ts.html +118 -0
  28. package/coverage/src/test-cases/concepts.ts.html +166 -0
  29. package/coverage/src/test-cases/entities.ts.html +241 -0
  30. package/coverage/src/test-cases/index.html +131 -0
  31. package/dist/reader-ddfcsv.js +15 -1
  32. package/dist/reader-ddfcsv.js.map +1 -0
  33. package/dist/stats.html +4950 -0
  34. package/icon.png +0 -0
  35. package/lib/src/ddf-csv.d.ts +0 -0
  36. package/lib/src/ddf-csv.js +13 -14
  37. package/lib/src/ddf-csv.js.map +1 -1
  38. package/lib/src/ddfcsv-error.d.ts +0 -0
  39. package/lib/src/ddfcsv-error.js +0 -0
  40. package/lib/src/ddfcsv-error.js.map +0 -0
  41. package/lib/src/ddfcsv-reader.d.ts +0 -0
  42. package/lib/src/ddfcsv-reader.js +5 -5
  43. package/lib/src/ddfcsv-reader.js.map +1 -1
  44. package/lib/src/file-readers/backend-file-reader.d.ts +0 -0
  45. package/lib/src/file-readers/backend-file-reader.js +0 -0
  46. package/lib/src/file-readers/backend-file-reader.js.map +0 -0
  47. package/lib/src/file-readers/github-path-adapter.d.ts +0 -0
  48. package/lib/src/file-readers/github-path-adapter.js +0 -0
  49. package/lib/src/file-readers/github-path-adapter.js.map +0 -0
  50. package/lib/src/index.d.ts +0 -0
  51. package/lib/src/index.js +2 -2
  52. package/lib/src/index.js.map +0 -0
  53. package/lib/src/interfaces.d.ts +0 -0
  54. package/lib/src/interfaces.js +0 -0
  55. package/lib/src/interfaces.js.map +0 -0
  56. package/lib/src/resource-selection-optimizer/in-clause-under-conjunction.d.ts +0 -0
  57. package/lib/src/resource-selection-optimizer/in-clause-under-conjunction.js +16 -17
  58. package/lib/src/resource-selection-optimizer/in-clause-under-conjunction.js.map +1 -1
  59. package/lib/src/resource-selection-optimizer/index.d.ts +0 -0
  60. package/lib/src/resource-selection-optimizer/index.js +2 -2
  61. package/lib/src/resource-selection-optimizer/index.js.map +1 -1
  62. package/lib-web/src/ddf-csv.d.ts +0 -0
  63. package/lib-web/src/ddf-csv.js +30 -34
  64. package/lib-web/src/ddf-csv.js.map +1 -1
  65. package/lib-web/src/ddfcsv-error.d.ts +0 -0
  66. package/lib-web/src/ddfcsv-error.js +5 -9
  67. package/lib-web/src/ddfcsv-error.js.map +1 -1
  68. package/lib-web/src/ddfcsv-reader.d.ts +0 -0
  69. package/lib-web/src/ddfcsv-reader.js +16 -19
  70. package/lib-web/src/ddfcsv-reader.js.map +1 -1
  71. package/lib-web/src/file-readers/frontend-file-reader.d.ts +0 -0
  72. package/lib-web/src/file-readers/frontend-file-reader.js +1 -5
  73. package/lib-web/src/file-readers/frontend-file-reader.js.map +1 -1
  74. package/lib-web/src/file-readers/github-path-adapter.d.ts +0 -0
  75. package/lib-web/src/file-readers/github-path-adapter.js +1 -4
  76. package/lib-web/src/file-readers/github-path-adapter.js.map +1 -1
  77. package/lib-web/src/index-web.d.ts +0 -0
  78. package/lib-web/src/index-web.js +9 -14
  79. package/lib-web/src/index-web.js.map +1 -1
  80. package/lib-web/src/interfaces.d.ts +0 -0
  81. package/lib-web/src/interfaces.js +1 -2
  82. package/lib-web/src/interfaces.js.map +0 -0
  83. package/lib-web/src/resource-selection-optimizer/in-clause-under-conjunction.d.ts +0 -0
  84. package/lib-web/src/resource-selection-optimizer/in-clause-under-conjunction.js +12 -17
  85. package/lib-web/src/resource-selection-optimizer/in-clause-under-conjunction.js.map +1 -1
  86. package/lib-web/src/resource-selection-optimizer/index.d.ts +0 -0
  87. package/lib-web/src/resource-selection-optimizer/index.js +4 -7
  88. package/lib-web/src/resource-selection-optimizer/index.js.map +1 -1
  89. package/package.json +93 -129
  90. package/rollup.config.mjs +30 -0
  91. package/scripts/set-own-version.js +0 -0
  92. package/src/ddf-csv.ts +927 -927
  93. package/src/ddfcsv-error.ts +0 -0
  94. package/src/ddfcsv-reader.ts +151 -151
  95. package/src/file-readers/backend-file-reader.ts +0 -0
  96. package/src/file-readers/frontend-file-reader.ts +0 -0
  97. package/src/file-readers/github-path-adapter.ts +0 -0
  98. package/src/index-web.ts +0 -0
  99. package/src/index.ts +0 -0
  100. package/src/interfaces.ts +0 -0
  101. package/src/resource-selection-optimizer/in-clause-under-conjunction.ts +220 -220
  102. package/src/resource-selection-optimizer/index.ts +11 -11
  103. package/src/test-cases/concepts.ts +0 -0
  104. package/src/test-cases/entities.ts +52 -52
  105. package/test/assets-fixtures/world-50m.json +0 -0
  106. package/test/assets.spec.ts +0 -0
  107. package/test/common.ts +1 -1
  108. package/test/definition/concepts-definition.spec.ts +0 -0
  109. package/test/definition/datapoints-definition.spec.ts +1 -1
  110. package/test/definition/entities-definition.spec.ts +264 -264
  111. package/test/definition/schema-definition.spec.ts +0 -0
  112. package/test/diagnostics.spec.ts +0 -0
  113. package/test/features-service.spec.ts +95 -95
  114. package/test/high-load.spec.ts +0 -0
  115. package/test/main.spec.ts +0 -0
  116. package/test/multi-instances.spec.ts +0 -0
  117. package/test/result-fixtures/datapoints-assets.json +0 -0
  118. package/test/result-fixtures/in-clause-under-conjunction-1.json +0 -0
  119. package/test/result-fixtures/in-clause-under-conjunction-2.json +0 -0
  120. package/test/result-fixtures/multi-instances/concepts-sg.json +0 -0
  121. package/test/result-fixtures/multi-instances/concepts-soderstornsmodellen.json +0 -0
  122. package/test/result-fixtures/multi-instances/datapoints-sg.json +0 -0
  123. package/test/result-fixtures/multi-instances/datapoints-soderstornsmodellen.json +0 -0
  124. package/test/result-fixtures/multi-instances/entities-sg.json +0 -0
  125. package/test/result-fixtures/multi-instances/entities-soderstornsmodellen.json +0 -0
  126. package/test/result-fixtures/multi-instances/schema-sg.json +0 -0
  127. package/test/result-fixtures/multi-instances/schema-soderstornsmodellen.json +0 -0
  128. package/test/schema.spec.ts +0 -0
  129. package/test/tslint.json +0 -0
  130. package/tsconfig-web.json +41 -41
  131. package/tsconfig.json +40 -37
  132. package/tslint.json +0 -0
  133. package/.travis.yml +0 -37
  134. package/deploy.js +0 -87
  135. package/dist/reader-ddfcsv-polyfill.js +0 -2
  136. package/dist/reader-ddfcsv-polyfill.js.map +0 -1
  137. package/test/mocha.opts +0 -7
@@ -1,95 +1,95 @@
1
- import * as chai from 'chai';
2
- import * as compact from 'lodash.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
- });
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
+ });
File without changes
package/test/main.spec.ts CHANGED
File without changes
File without changes
File without changes
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": "es2019",
5
- "module": "commonjs",
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": "es2017",
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
- "lib": [
22
- "es2020",
23
- "dom"
24
- ]
25
- },
26
- "include": [
27
- "src/index.ts"
28
- ],
29
- "exclude": [
30
- "dist",
31
- "lib",
32
- "lib-web",
33
- "node_modules",
34
- "**/*.spec.ts",
35
- "test/common.ts"
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();