Skip to content

Commit e214115

Browse files
author
Lauren McCarthy
committed
removing grunt-open issue #3296
1 parent a96c6c6 commit e214115

File tree

3 files changed

+56
-28
lines changed

3 files changed

+56
-28
lines changed

Gruntfile.js

+56-12
Original file line numberDiff line numberDiff line change
@@ -340,14 +340,60 @@ module.exports = function(grunt) {
340340
return middlewares;
341341
}
342342
}
343-
}
344-
},
345-
open: {
343+
},
346344
yui: {
347-
path: 'http://127.0.0.1:9001/docs/reference/'
345+
options: {
346+
directory: {
347+
path: './',
348+
options: {
349+
icons: true
350+
}
351+
},
352+
port: 9001,
353+
open: 'http://127.0.0.1:9001/docs/reference/',
354+
keepalive: keepalive,
355+
middleware: function(connect, options, middlewares) {
356+
middlewares.unshift(
357+
require('connect-modrewrite')([
358+
'^/assets/js/p5(\\.min)?\\.js(.*) /lib/p5$1.js$2 [L]',
359+
'^/assets/js/p5\\.(dom|sound)(\\.min)?\\.js(.*) /lib/addons/p5.$1$2.js$3 [L]'
360+
]),
361+
function(req, res, next) {
362+
res.setHeader('Access-Control-Allow-Origin', '*');
363+
res.setHeader('Access-Control-Allow-Methods', '*');
364+
return next();
365+
}
366+
);
367+
return middlewares;
368+
}
369+
}
348370
},
349-
dev: {
350-
path: 'http://127.0.0.1:9001/test/'
371+
test: {
372+
options: {
373+
directory: {
374+
path: './',
375+
options: {
376+
icons: true
377+
}
378+
},
379+
port: 9001,
380+
open: 'http://127.0.0.1:9001/test/',
381+
keepalive: keepalive,
382+
middleware: function(connect, options, middlewares) {
383+
middlewares.unshift(
384+
require('connect-modrewrite')([
385+
'^/assets/js/p5(\\.min)?\\.js(.*) /lib/p5$1.js$2 [L]',
386+
'^/assets/js/p5\\.(dom|sound)(\\.min)?\\.js(.*) /lib/addons/p5.$1$2.js$3 [L]'
387+
]),
388+
function(req, res, next) {
389+
res.setHeader('Access-Control-Allow-Origin', '*');
390+
res.setHeader('Access-Control-Allow-Methods', '*');
391+
return next();
392+
}
393+
);
394+
return middlewares;
395+
}
396+
}
351397
}
352398
},
353399
'saucelabs-mocha': {
@@ -411,7 +457,6 @@ module.exports = function(grunt) {
411457
// Load the external libraries used.
412458
grunt.loadNpmTasks('grunt-contrib-compress');
413459
grunt.loadNpmTasks('grunt-contrib-connect');
414-
grunt.loadNpmTasks('grunt-open');
415460
grunt.loadNpmTasks('grunt-contrib-copy');
416461
grunt.loadNpmTasks('grunt-eslint');
417462
grunt.loadNpmTasks('grunt-contrib-watch');
@@ -440,7 +485,7 @@ module.exports = function(grunt) {
440485
'lint-no-fix',
441486
//'yuidoc:prod', // already done by lint-no-fix
442487
'build',
443-
'connect',
488+
'connect:server',
444489
'mochaChrome',
445490
'mochaTest'
446491
]);
@@ -449,18 +494,17 @@ module.exports = function(grunt) {
449494
grunt.registerTask('yui:test', [
450495
'yuidoc:prod',
451496
'clean:reference',
452-
'connect',
497+
'connect:yui',
453498
'mochaChrome:yui'
454499
]);
455500
grunt.registerTask('yui:dev', [
456501
'yui:prod',
457502
'clean:reference',
458503
'build',
459-
'connect',
460-
'open:yui',
504+
'connect:yui',
461505
'watch:yui'
462506
]);
463507
grunt.registerTask('yui:build', ['yui']);
464508
grunt.registerTask('default', ['test']);
465-
grunt.registerTask('saucetest', ['connect', 'saucelabs-mocha']);
509+
grunt.registerTask('saucetest', ['connect:server', 'saucelabs-mocha']);
466510
};

package-lock.json

-15
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

-1
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,6 @@
6666
"grunt-minjson": "^0.4.0",
6767
"grunt-mocha-test": "^0.13.3",
6868
"grunt-newer": "^1.1.0",
69-
"grunt-open": "^0.2.3",
7069
"grunt-release-it": "^1.0.1",
7170
"grunt-saucelabs": "^9.0.0",
7271
"html2plaintext": "^1.1.1",

0 commit comments

Comments
 (0)