Skip to content

Commit e934ca0

Browse files
committed
Concatenating component function files
1 parent 3aa7abd commit e934ca0

File tree

3 files changed

+8
-125
lines changed

3 files changed

+8
-125
lines changed

gulp-assets/NAMESPACE.template

Lines changed: 0 additions & 68 deletions
This file was deleted.

gulpfile.js

Lines changed: 7 additions & 57 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,11 @@
11
const {dest, parallel, series, src} = require('gulp');
22
const print = require('gulp-print').default;
3-
const fs = require('fs-extra');
43
const replace = require('gulp-replace');
4+
const rename = require('gulp-rename');
5+
const concat = require("gulp-concat")
6+
const fs = require('fs-extra');
57
const path = require('path');
68
const log = require('fancy-log');
7-
const rename = require('gulp-rename');
89
const shell = require('shelljs');
910

1011
// Task to git clone and build the component packages to retrieve build artifacts.
@@ -127,6 +128,7 @@ function copyCoreRDirectory() {
127128
'!gulp-assets/dash-core-components/R/internal.R',
128129
])
129130
.pipe(print())
131+
.pipe(concat('dashCoreComponents.R'))
130132
.pipe(dest('R/', {overwrite: true}));
131133
}
132134
return log('Unable to find dash-core-components `R` directory.');
@@ -143,6 +145,7 @@ function copyHtmlRDirectory() {
143145
'!gulp-assets/dash-html-components/R/internal.R',
144146
])
145147
.pipe(print())
148+
.pipe(concat('dashHtmlComponents.R'))
146149
.pipe(dest('R/', {overwrite: true}));
147150
}
148151
return log('Unable to find dash-html-components `R` directory.');
@@ -155,60 +158,10 @@ function copyTableRDirectory() {
155158
'!gulp-assets/dash-table/R/internal.R',
156159
])
157160
.pipe(print())
161+
.pipe(concat('dashTable.R'))
158162
.pipe(dest('R/', {overwrite: true}));
159163
}
160-
return log('Unable to find dash-core-components `R` directory.');
161-
}
162-
163-
// Append the NAMESPACE for each of the component packages to the DashR NAMESPACE.
164-
function appendCoreNamespace() {
165-
var namespace = fs
166-
.readFileSync('gulp-assets/dash-core-components/NAMESPACE')
167-
.toString()
168-
.split('\n');
169-
namespace.shift();
170-
namespace.unshift(
171-
'# dashCoreComponents exports appended by `npm unify` command: do not edit by hand'
172-
);
173-
namespace = namespace.join('\n');
174-
return src('gulp-assets/NAMESPACE.template')
175-
.pipe(print())
176-
.pipe(replace('{dcc_exports}', namespace))
177-
.pipe(rename('NAMESPACE'))
178-
.pipe(dest('./', {overwrite: true}));
179-
}
180-
181-
function appendHtmlNamespace() {
182-
var namespace = fs
183-
.readFileSync('gulp-assets/dash-html-components/NAMESPACE')
184-
.toString()
185-
.split('\n');
186-
namespace.shift();
187-
namespace.unshift(
188-
'# dashHtmlComponents exports appended by `npm unify` command: do not edit by hand'
189-
);
190-
namespace = namespace.join('\n');
191-
return src('./NAMESPACE')
192-
.pipe(print())
193-
.pipe(replace('{html_exports}', namespace))
194-
.pipe(dest('./', {overwrite: true}));
195-
}
196-
197-
function appendTableNamespace() {
198-
var namespace = fs
199-
.readFileSync('gulp-assets/dash-table/NAMESPACE')
200-
.toString()
201-
.split('\n');
202-
namespace.shift();
203-
namespace.push('export(df_to_list)');
204-
namespace.unshift(
205-
'# dashTable exports appended by `npm unify` command: do not edit by hand'
206-
);
207-
namespace = namespace.join('\n');
208-
return src('./NAMESPACE')
209-
.pipe(print())
210-
.pipe(replace('{table_exports}', namespace))
211-
.pipe(dest('./', {overwrite: true}));
164+
return log('Unable to find dash-table `R` directory.');
212165
}
213166

214167
// Append the internal.R for each of the component packages to the DashR internal.R.
@@ -284,9 +237,6 @@ exports.unify = series(
284237
);
285238

286239
exports.update = series(
287-
appendCoreNamespace,
288-
appendHtmlNamespace,
289-
appendTableNamespace,
290240
appendCoreInternal,
291241
appendHtmlInternal,
292242
appendTableInternal,

package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@
3030
"fs-extra": "^9.0.1",
3131
"gulp": "^4.0.2",
3232
"gulp-footer": "^2.0.2",
33+
"gulp-concat":"2.6.1",
3334
"gulp-print": "^5.0.2",
3435
"gulp-replace": "^1.0.0",
3536
"gulp-rename": "^2.0.0",

0 commit comments

Comments
 (0)