From 2734aa3da01cf5872176b1c6f1bfdc9815cdf500 Mon Sep 17 00:00:00 2001 From: Hakim El Hattab Date: Mon, 1 Apr 2019 13:46:08 +0200 Subject: fix grunt ci error --- Gruntfile.ts | 188 ---------------------------------------------------- gruntfile.js | 192 ++++++++++++++++++++++++++++++++++++++++++++++++++++++ package-lock.json | 6 -- package.json | 7 +- 4 files changed, 195 insertions(+), 198 deletions(-) delete mode 100644 Gruntfile.ts create mode 100644 gruntfile.js diff --git a/Gruntfile.ts b/Gruntfile.ts deleted file mode 100644 index 597ede1..0000000 --- a/Gruntfile.ts +++ /dev/null @@ -1,188 +0,0 @@ -/* global module:false */ -module.exports = function(grunt) { - const sass = require('node-sass'); - - require('load-grunt-tasks')(grunt); - - let port = grunt.option('port') || 8000; - let root = grunt.option('root') || '.'; - - if (!Array.isArray(root)) root = [root]; - - // Project configuration - grunt.initConfig({ - pkg: grunt.file.readJSON('package.json'), - meta: { - banner: - '/*!\n' + - ' * reveal.js <%= pkg.version %> (<%= grunt.template.today("yyyy-mm-dd, HH:MM") %>)\n' + - ' * http://revealjs.com\n' + - ' * MIT licensed\n' + - ' *\n' + - ' * Copyright (C) 2019 Hakim El Hattab, http://hakim.se\n' + - ' */' - }, - - qunit: { - files: [ 'test/*.html' ] - }, - - uglify: { - options: { - banner: '<%= meta.banner %>\n', - ie8: true - }, - build: { - src: 'js/reveal.js', - dest: 'js/reveal.min.js' - } - }, - - sass: { - options: { - implementation: sass, - sourceMap: false - }, - core: { - src: 'css/reveal.scss', - dest: 'css/reveal.css' - }, - themes: { - expand: true, - cwd: 'css/theme/source', - src: ['*.sass', '*.scss'], - dest: 'css/theme', - ext: '.css' - } - }, - - autoprefixer: { - core: { - src: 'css/reveal.css' - } - }, - - cssmin: { - options: { - compatibility: 'ie9' - }, - compress: { - src: 'css/reveal.css', - dest: 'css/reveal.min.css' - } - }, - - jshint: { - options: { - curly: false, - eqeqeq: true, - immed: true, - esnext: true, - latedef: 'nofunc', - newcap: true, - noarg: true, - sub: true, - undef: true, - eqnull: true, - browser: true, - expr: true, - loopfunc: true, - globals: { - head: false, - module: false, - console: false, - unescape: false, - define: false, - exports: false - } - }, - files: [ 'Gruntfile.js', 'js/reveal.js' ] - }, - - connect: { - server: { - options: { - port: port, - base: root, - livereload: true, - open: true, - useAvailablePort: true - } - } - }, - - zip: { - bundle: { - src: [ - 'index.html', - 'css/**', - 'js/**', - 'lib/**', - 'images/**', - 'plugin/**', - '**.md' - ], - dest: 'reveal-js-presentation.zip' - } - }, - - watch: { - js: { - files: [ 'Gruntfile.js', 'js/reveal.js' ], - tasks: 'js' - }, - theme: { - files: [ - 'css/theme/source/*.sass', - 'css/theme/source/*.scss', - 'css/theme/template/*.sass', - 'css/theme/template/*.scss' - ], - tasks: 'css-themes' - }, - css: { - files: [ 'css/reveal.scss' ], - tasks: 'css-core' - }, - test: { - files: [ 'test/*.html' ], - tasks: 'test' - }, - html: { - files: root.map(path => path + '/*.html') - }, - markdown: { - files: root.map(path => path + '/*.md') - }, - options: { - livereload: true - } - } - - }); - - // Default task - grunt.registerTask( 'default', [ 'css', 'js' ] ); - - // JS task - grunt.registerTask( 'js', [ 'jshint', 'uglify', 'qunit' ] ); - - // Theme CSS - grunt.registerTask( 'css-themes', [ 'sass:themes' ] ); - - // Core framework CSS - grunt.registerTask( 'css-core', [ 'sass:core', 'autoprefixer', 'cssmin' ] ); - - // All CSS - grunt.registerTask( 'css', [ 'sass', 'autoprefixer', 'cssmin' ] ); - - // Package presentation to archive - grunt.registerTask( 'package', [ 'default', 'zip' ] ); - - // Serve presentation locally - grunt.registerTask( 'serve', [ 'connect', 'watch' ] ); - - // Run tests - grunt.registerTask( 'test', [ 'jshint', 'qunit' ] ); - -}; diff --git a/gruntfile.js b/gruntfile.js new file mode 100644 index 0000000..edebddd --- /dev/null +++ b/gruntfile.js @@ -0,0 +1,192 @@ +const sass = require('node-sass'); + +module.exports = grunt => { + + require('load-grunt-tasks')(grunt); + + let port = grunt.option('port') || 8000; + let root = grunt.option('root') || '.'; + + if (!Array.isArray(root)) root = [root]; + + // Project configuration + grunt.initConfig({ + pkg: grunt.file.readJSON('package.json'), + meta: { + banner: + '/*!\n' + + ' * reveal.js <%= pkg.version %> (<%= grunt.template.today("yyyy-mm-dd, HH:MM") %>)\n' + + ' * http://revealjs.com\n' + + ' * MIT licensed\n' + + ' *\n' + + ' * Copyright (C) 2019 Hakim El Hattab, http://hakim.se\n' + + ' */' + }, + + qunit: { + files: [ 'test/*.html' ] + }, + + uglify: { + options: { + banner: '<%= meta.banner %>\n', + ie8: true + }, + build: { + src: 'js/reveal.js', + dest: 'js/reveal.min.js' + } + }, + + sass: { + options: { + implementation: sass, + sourceMap: false + }, + core: { + src: 'css/reveal.scss', + dest: 'css/reveal.css' + }, + themes: { + expand: true, + cwd: 'css/theme/source', + src: ['*.sass', '*.scss'], + dest: 'css/theme', + ext: '.css' + } + }, + + autoprefixer: { + core: { + src: 'css/reveal.css' + } + }, + + cssmin: { + options: { + compatibility: 'ie9' + }, + compress: { + src: 'css/reveal.css', + dest: 'css/reveal.min.css' + } + }, + + jshint: { + options: { + curly: false, + eqeqeq: true, + immed: true, + esnext: true, + latedef: 'nofunc', + newcap: true, + noarg: true, + sub: true, + undef: true, + eqnull: true, + browser: true, + expr: true, + loopfunc: true, + globals: { + head: false, + module: false, + console: false, + unescape: false, + define: false, + exports: false, + require: false + } + }, + files: [ 'gruntfile.js', 'js/reveal.js' ] + }, + + connect: { + server: { + options: { + port: port, + base: root, + livereload: true, + open: true, + useAvailablePort: true + } + } + }, + + zip: { + bundle: { + src: [ + 'index.html', + 'css/**', + 'js/**', + 'lib/**', + 'images/**', + 'plugin/**', + '**.md' + ], + dest: 'reveal-js-presentation.zip' + } + }, + + watch: { + js: { + files: [ 'gruntfile.js', 'js/reveal.js' ], + tasks: 'js' + }, + theme: { + files: [ + 'css/theme/source/*.sass', + 'css/theme/source/*.scss', + 'css/theme/template/*.sass', + 'css/theme/template/*.scss' + ], + tasks: 'css-themes' + }, + css: { + files: [ 'css/reveal.scss' ], + tasks: 'css-core' + }, + test: { + files: [ 'test/*.html' ], + tasks: 'test' + }, + html: { + files: root.map(path => path + '/*.html') + }, + markdown: { + files: root.map(path => path + '/*.md') + }, + options: { + livereload: true + } + } + + }); + + grunt.loadNpmTasks('grunt-contrib-clean'); + grunt.loadNpmTasks('grunt-contrib-nodeunit'); + + // Default task + grunt.registerTask( 'default', [ 'css', 'js' ] ); + + // JS task + grunt.registerTask( 'js', [ 'jshint', 'uglify', 'qunit' ] ); + + // Theme CSS + grunt.registerTask( 'css-themes', [ 'sass:themes' ] ); + + // Core framework CSS + grunt.registerTask( 'css-core', [ 'sass:core', 'autoprefixer', 'cssmin' ] ); + + // All CSS + grunt.registerTask( 'css', [ 'sass', 'autoprefixer', 'cssmin' ] ); + + // Package presentation to archive + grunt.registerTask( 'package', [ 'default', 'zip' ] ); + + // Serve presentation locally + grunt.registerTask( 'serve', [ 'connect', 'watch' ] ); + + // Run tests + grunt.registerTask( 'test', [ 'jshint', 'qunit' ] ); + +}; diff --git a/package-lock.json b/package-lock.json index ba506a7..9d36c31 100644 --- a/package-lock.json +++ b/package-lock.json @@ -5441,12 +5441,6 @@ "integrity": "sha1-hnrHTjhkGHsdPUfZlqeOxciDB3c=", "dev": true }, - "typescript": { - "version": "3.3.3333", - "resolved": "https://registry.npmjs.org/typescript/-/typescript-3.3.3333.tgz", - "integrity": "sha512-JjSKsAfuHBE/fB2oZ8NxtRTk5iGcg6hkYXMnZ3Wc+b2RSqejEqTaem11mHASMnFilHrax3sLK0GDzcJrekZYLw==", - "dev": true - }, "uglify-js": { "version": "3.3.8", "resolved": "https://registry.npmjs.org/uglify-js/-/uglify-js-3.3.8.tgz", diff --git a/package.json b/package.json index cd6ccbe..877f2e4 100644 --- a/package.json +++ b/package.json @@ -24,7 +24,7 @@ }, "devDependencies": { "express": "^4.16.2", - "grunt": "^1.0.3", + "grunt": "^1.0.4", "grunt-cli": "^1.3.2", "grunt-autoprefixer": "^3.0.4", "grunt-contrib-connect": "^2.0.0", @@ -36,10 +36,9 @@ "grunt-sass": "^3.0.2", "grunt-zip": "~0.17.1", "load-grunt-tasks": "^4.0.0", - "node-sass": "4.11.0", + "node-sass": "^4.11.0", "mustache": "^2.3.0", - "socket.io": "^2.2.0", - "typescript": "^3.3.3333" + "socket.io": "^2.2.0" }, "license": "MIT" } -- cgit v1.2.3