Skip to content

Commit 2d682a4

Browse files
brandonocaseygkatsev
authored andcommitted
chore: move copy, zip, and clean tasks to npm scripts (#5544)
1 parent c1cbce3 commit 2d682a4

File tree

3 files changed

+1881
-880
lines changed

3 files changed

+1881
-880
lines changed

build/grunt.js

Lines changed: 50 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -18,42 +18,19 @@ module.exports = function(grunt) {
1818
// Project configuration.
1919
grunt.initConfig({
2020
pkg,
21-
clean: {
22-
build: ['build/temp/*', 'es5', 'test/dist'],
23-
dist: ['dist/*', 'test/dist']
24-
},
25-
dist: {},
2621
watch: {
2722
lang: {
2823
files: ['lang/**/*.json'],
2924
tasks: ['vjslanguages']
3025
}
3126
},
32-
copy: {
33-
fonts: { cwd: 'node_modules/videojs-font/fonts/', src: ['*'], dest: 'build/temp/font/', expand: true, filter: 'isFile' },
34-
lang: { cwd: 'lang/', src: ['*'], dest: 'dist/lang/', expand: true, filter: 'isFile' },
35-
dist: { cwd: 'build/temp/', src: ['**/**', '!test*'], dest: 'dist/', expand: true, filter: 'isFile' },
36-
a11y: { src: 'sandbox/descriptions.html.example', dest: 'sandbox/descriptions.test-a11y.html' }, // Can only test a file with a .html or .htm extension
37-
examples: { cwd: 'docs/examples/', src: ['**/**'], dest: 'dist/examples/', expand: true, filter: 'isFile' }
38-
},
3927
vjslanguages: {
4028
defaults: {
4129
files: {
4230
'build/temp/lang': ['lang/*.json']
4331
}
4432
}
4533
},
46-
zip: {
47-
dist: {
48-
router: function (filepath) {
49-
var path = require('path');
50-
return path.relative('dist', filepath);
51-
},
52-
// compression: 'DEFLATE',
53-
src: ['dist/**/*'],
54-
dest: 'dist/video-js-' + version.full + '.zip'
55-
}
56-
},
5734
concurrent: {
5835
options: {
5936
logConcurrentOutput: true
@@ -65,7 +42,7 @@ module.exports = function(grunt) {
6542
'shell:sass',
6643
'shell:babel',
6744
'watch:lang',
68-
'copy:dist',
45+
'shell:copy-dist',
6946
'shell:karma-server'
7047
],
7148
// Run multiple watch tasks in parallel
@@ -79,6 +56,42 @@ module.exports = function(grunt) {
7956
]
8057
},
8158
shell: {
59+
'copy-dist': {
60+
command: 'npm run copy-dist',
61+
options: {
62+
preferLocal: true
63+
}
64+
},
65+
'copy-fonts': {
66+
command: 'npm run copy-fonts',
67+
options: {
68+
preferLocal: true
69+
}
70+
},
71+
'copy-lang': {
72+
command: 'npm run copy-lang',
73+
options: {
74+
preferLocal: true
75+
}
76+
},
77+
'copy-a11y': {
78+
command: 'npm run copy-a11y',
79+
options: {
80+
preferLocal: true
81+
}
82+
},
83+
'copy-examples': {
84+
command: 'npm run copy-examples',
85+
options: {
86+
preferLocal: true
87+
}
88+
},
89+
clean: {
90+
command: 'npm run clean',
91+
options: {
92+
preferLocal: true
93+
}
94+
},
8295
'karma-server': {
8396
command: 'npm run karma-server',
8497
options: {
@@ -91,6 +104,12 @@ module.exports = function(grunt) {
91104
preferLocal: true
92105
}
93106
},
107+
'zip': {
108+
command: 'npm run zip',
109+
options: {
110+
preferLocal: true
111+
}
112+
},
94113
cssmin: {
95114
command: 'npm run cssmin',
96115
options: {
@@ -172,24 +191,23 @@ module.exports = function(grunt) {
172191

173192
grunt.registerTask('build', [
174193
'shell:lint',
175-
'clean:build',
194+
'shell:clean',
176195

177196
'shell:rollupall',
178197

179198
'shell:sass',
180199
'shell:cssmin',
181200

182-
'copy:fonts',
183-
'copy:lang',
201+
'shell:copy-fonts',
202+
'shell:copy-lang',
184203
'vjslanguages'
185204
]);
186205

187206
grunt.registerTask('dist', [
188-
'clean:dist',
189207
'build',
190-
'copy:dist',
191-
'copy:examples',
192-
'zip:dist'
208+
'shell:copy-dist',
209+
'shell:copy-examples',
210+
'shell:zip'
193211
]);
194212

195213
grunt.registerTask('skin', ['shell:sass']);
@@ -220,7 +238,7 @@ module.exports = function(grunt) {
220238
// Run while developing
221239
grunt.registerTask('dev', ['sandbox', 'concurrent:dev']);
222240
grunt.registerTask('watchAll', ['build', 'concurrent:watchAll']);
223-
grunt.registerTask('test-a11y', ['copy:a11y', 'accessibility']);
241+
grunt.registerTask('test-a11y', ['shell:copy-a11y', 'accessibility']);
224242

225243
// Pick your testing, or run both in different terminals
226244
grunt.registerTask('test-ui', ['shell:karma-server']);

0 commit comments

Comments
 (0)