Skip to content

Commit d8534f4

Browse files
committed
Updated gulpfile jobs
1 parent f02b125 commit d8534f4

File tree

1 file changed

+22
-43
lines changed

1 file changed

+22
-43
lines changed

gulpfile.js

Lines changed: 22 additions & 43 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ const log = require('fancy-log');
1010

1111
//TODO: Add job to git clone and build the component packages to retrieve build artifacts.
1212

13-
// Copy the inst directories for each of the component packages.
13+
// Update the inst directories for each of the component packages.
1414
function copyCoreInstDirectory() {
1515
if (
1616
fs.existsSync(
@@ -53,7 +53,7 @@ function copyTableInstDirectory() {
5353
}
5454
}
5555

56-
// Copy the man directories for each of the component packages.
56+
// Update the man directories for each of the component packages.
5757
function copyCoreManDirectory() {
5858
if (
5959
fs.existsSync(
@@ -90,7 +90,7 @@ function copyTableManDirectory() {
9090
}
9191
}
9292

93-
// Copy the R directories for each of the component packages.
93+
// Update the R directories for each of the component packages.
9494
function copyCoreRDirectory() {
9595
if (fs.existsSync(
9696
path.relative(__dirname, 'gulp-assets/dash-core-components/R')
@@ -143,16 +143,14 @@ function appendCoreNamespace() {
143143
.toString()
144144
.split('\n');
145145
namespace.shift();
146+
namespace.unshift('# dashCoreComponents exports appended by `npm unify` command: do not edit by hand\n')
146147
namespace = namespace.join('\n');
147-
return src('./NAMESPACE')
148+
return src('gulp-assets/NAMESPACE.template')
148149
.pipe(print())
149150
.pipe(
150-
footer(
151-
'# dashCoreComponents exports appended by `npm unify` command: do not edit by hand\n'
152-
)
151+
replace("{dcc_exports}", namespace)
153152
)
154-
.pipe(footer(namespace))
155-
.pipe(dest('.', {overwrite: true}));
153+
.pipe(dest('./NAMESPACE', {overwrite: true}));
156154
}
157155

158156
function appendHtmlNamespace() {
@@ -161,16 +159,14 @@ function appendHtmlNamespace() {
161159
.toString()
162160
.split('\n');
163161
namespace.shift();
162+
namespace.unshift('# dashHtmlComponents exports appended by `npm unify` command: do not edit by hand\n')
164163
namespace = namespace.join('\n');
165164
return src('./NAMESPACE')
166165
.pipe(print())
167166
.pipe(
168-
footer(
169-
'# dashHtmlComponents exports appended by `npm unify` command: do not edit by hand\n'
170-
)
167+
replace("{html_exports}", namespace)
171168
)
172-
.pipe(footer(namespace))
173-
.pipe(dest('.', {overwrite: true}));
169+
.pipe(dest('./NAMESPACE', {overwrite: true}));
174170
}
175171

176172
function appendTableNamespace() {
@@ -179,57 +175,42 @@ function appendTableNamespace() {
179175
.toString()
180176
.split('\n');
181177
namespace.shift();
178+
namespace.unshift('# dashTable exports appended by `npm unify` command: do not edit by hand\n')
182179
namespace = namespace.join('\n');
183180
return src('./NAMESPACE')
184181
.pipe(print())
185182
.pipe(
186-
footer(
187-
'# dashTable exports appended by `npm unify` command: do not edit by hand\n'
188-
)
183+
replace("{table_exports}", namespace)
189184
)
190-
.pipe(footer(namespace))
191-
.pipe(dest('.', {overwrite: true}));
185+
.pipe(dest('./NAMESPACE', {overwrite: true}));
192186
}
193187

194188
// Append the internal.R for each of the component packages to the DashR internal.R.
195189
function appendCoreInternal() {
196-
return src('R/internal.R')
190+
return src('gulp-assets/internal.template')
197191
.pipe(print())
198192
.pipe(
199-
footer(
200-
'# dashCoreComponents metadata appended by `npm unify` command\n'
201-
)
193+
replace("{dcc_deps}", fs.readFileSync('gulp-assets/dash-core-components/R/internal.R'))
202194
)
203-
.pipe(
204-
footer(
205-
fs.readFileSync('gulp-assets/dash-core-components/R/internal.R')
206-
)
207-
)
208-
.pipe(dest('R/', {overwrite: true}));
195+
.pipe(dest('R/internal.R', {overwrite: true}));
209196
}
210197

211198
function appendHtmlInternal() {
212199
return src('R/internal.R')
213200
.pipe(print())
214201
.pipe(
215-
footer(
216-
'# dashHtmlComponents metadata appended by `npm unify` command\n'
217-
)
202+
replace("{html_deps}", fs.readFileSync('gulp-assets/dash-html-components/R/internal.R'))
218203
)
219-
.pipe(
220-
footer(
221-
fs.readFileSync('gulp-assets/dash-html-components/R/internal.R')
222-
)
223-
)
224-
.pipe(dest('R/', {overwrite: true}));
204+
.pipe(dest('R/internal.R', {overwrite: true}));
225205
}
226206

227207
function appendTableInternal() {
228208
return src('R/internal.R')
229209
.pipe(print())
230-
.pipe(footer('# dashTable metadata appended by `npm unify` command\n'))
231-
.pipe(footer(fs.readFileSync('gulp-assets/dash-table/R/internal.R')))
232-
.pipe(dest('R/', {overwrite: true}));
210+
.pipe(
211+
replace("{table_deps}", fs.readFileSync('gulp-assets/dash-table/R/internal.R'))
212+
)
213+
.pipe(dest('R/internal.R', {overwrite: true}));
233214
}
234215

235216

@@ -251,5 +232,3 @@ exports.updateNamespace = series(
251232
appendHtmlInternal,
252233
appendTableInternal
253234
);
254-
255-
exports.test = series(copyCoreInstDirectory);

0 commit comments

Comments
 (0)