diff --git a/hooker-0.2.3.tgz b/hooker-0.2.3.tgz new file mode 100644 index 0000000..7fe3f1a Binary files /dev/null and b/hooker-0.2.3.tgz differ diff --git a/nodejs-hooker-0.2.3-Rename-grunt.js-to-Gruntfile.js.patch b/nodejs-hooker-0.2.3-Rename-grunt.js-to-Gruntfile.js.patch new file mode 100644 index 0000000..4827d9e --- /dev/null +++ b/nodejs-hooker-0.2.3-Rename-grunt.js-to-Gruntfile.js.patch @@ -0,0 +1,145 @@ +From f90375aee319deb90fed80b47435b5e617e0d67b Mon Sep 17 00:00:00 2001 +From: Jamie Nguyen +Date: Wed, 10 Jul 2013 19:45:21 +0100 +Subject: [PATCH 1/2] Rename grunt.js to Gruntfile.js + +--- + Gruntfile.js | 59 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ + grunt.js | 59 ----------------------------------------------------------- + 2 files changed, 59 insertions(+), 59 deletions(-) + create mode 100644 Gruntfile.js + delete mode 100644 grunt.js + +diff --git a/Gruntfile.js b/Gruntfile.js +new file mode 100644 +index 0000000..09bd528 +--- /dev/null ++++ b/Gruntfile.js +@@ -0,0 +1,59 @@ ++module.exports = function(grunt) { ++ ++ // Project configuration. ++ grunt.initConfig({ ++ pkg: '', ++ meta: { ++ name: 'JavaScript Hooker', ++ banner: '/*! <%= meta.name %> - v<%= pkg.version %> - <%= grunt.template.today("m/d/yyyy") %>\n' + ++ '* <%= pkg.homepage %>\n' + ++ '* Copyright (c) <%= grunt.template.today("yyyy") %> <%= pkg.author.name %>;' + ++ ' Licensed <%= _.pluck(pkg.licenses, "type").join(", ") %> */' ++ }, ++ concat: { ++ dist: { ++ src: ['', ''], ++ dest: 'dist/ba-hooker.js' ++ } ++ }, ++ min: { ++ dist: { ++ src: ['', 'dist/ba-hooker.js'], ++ dest: 'dist/ba-hooker.min.js' ++ } ++ }, ++ test: { ++ files: ['test/**/*.js'] ++ }, ++ lint: { ++ files: ['grunt.js', 'lib/**/*.js', 'test/**/*.js'] ++ }, ++ watch: { ++ files: '', ++ tasks: 'lint:files test:files' ++ }, ++ jshint: { ++ options: { ++ curly: true, ++ eqeqeq: true, ++ immed: true, ++ latedef: true, ++ newcap: true, ++ noarg: true, ++ sub: true, ++ undef: true, ++ boss: true, ++ eqnull: true ++ }, ++ globals: { ++ exports: true, ++ module: false ++ } ++ }, ++ uglify: {} ++ }); ++ ++ // Default task. ++ grunt.registerTask('default', 'lint test concat min'); ++ ++}; +diff --git a/grunt.js b/grunt.js +deleted file mode 100644 +index 09bd528..0000000 +--- a/grunt.js ++++ /dev/null +@@ -1,59 +0,0 @@ +-module.exports = function(grunt) { +- +- // Project configuration. +- grunt.initConfig({ +- pkg: '', +- meta: { +- name: 'JavaScript Hooker', +- banner: '/*! <%= meta.name %> - v<%= pkg.version %> - <%= grunt.template.today("m/d/yyyy") %>\n' + +- '* <%= pkg.homepage %>\n' + +- '* Copyright (c) <%= grunt.template.today("yyyy") %> <%= pkg.author.name %>;' + +- ' Licensed <%= _.pluck(pkg.licenses, "type").join(", ") %> */' +- }, +- concat: { +- dist: { +- src: ['', ''], +- dest: 'dist/ba-hooker.js' +- } +- }, +- min: { +- dist: { +- src: ['', 'dist/ba-hooker.js'], +- dest: 'dist/ba-hooker.min.js' +- } +- }, +- test: { +- files: ['test/**/*.js'] +- }, +- lint: { +- files: ['grunt.js', 'lib/**/*.js', 'test/**/*.js'] +- }, +- watch: { +- files: '', +- tasks: 'lint:files test:files' +- }, +- jshint: { +- options: { +- curly: true, +- eqeqeq: true, +- immed: true, +- latedef: true, +- newcap: true, +- noarg: true, +- sub: true, +- undef: true, +- boss: true, +- eqnull: true +- }, +- globals: { +- exports: true, +- module: false +- } +- }, +- uglify: {} +- }); +- +- // Default task. +- grunt.registerTask('default', 'lint test concat min'); +- +-}; +-- +1.8.3.1 + diff --git a/nodejs-hooker-0.2.3-Update-Gruntfile.js-for-use-with-grunt-0.4.0.patch b/nodejs-hooker-0.2.3-Update-Gruntfile.js-for-use-with-grunt-0.4.0.patch new file mode 100644 index 0000000..788481c --- /dev/null +++ b/nodejs-hooker-0.2.3-Update-Gruntfile.js-for-use-with-grunt-0.4.0.patch @@ -0,0 +1,99 @@ +From aa74d7f1c60705b80ab8897b408b24d55b087746 Mon Sep 17 00:00:00 2001 +From: Jamie Nguyen +Date: Wed, 10 Jul 2013 19:47:59 +0100 +Subject: [PATCH] Update Gruntfile.js for use with grunt 0.4.0 + +--- + Gruntfile.js | 38 +++++++++++++++++++++----------------- + package.json | 6 +++++- + 2 files changed, 26 insertions(+), 18 deletions(-) + +diff --git a/Gruntfile.js b/Gruntfile.js +index 09bd528..144d14e 100644 +--- a/Gruntfile.js ++++ b/Gruntfile.js +@@ -5,24 +5,23 @@ module.exports = function(grunt) { + pkg: '', + meta: { + name: 'JavaScript Hooker', +- banner: '/*! <%= meta.name %> - v<%= pkg.version %> - <%= grunt.template.today("m/d/yyyy") %>\n' + +- '* <%= pkg.homepage %>\n' + +- '* Copyright (c) <%= grunt.template.today("yyyy") %> <%= pkg.author.name %>;' + +- ' Licensed <%= _.pluck(pkg.licenses, "type").join(", ") %> */' + }, +- concat: { +- dist: { +- src: ['', ''], +- dest: 'dist/ba-hooker.js' +- } +- }, +- min: { ++ uglify: { ++ options: { ++ banner: '/*\n' + ++ ' * Javascript Hooker\n' + ++ ' * http://github.com/cowboy/javascript-hooker\n' + ++ ' * Copyright (c) 2012 "Cowboy" Ben Alman\n' + ++ ' * Licensed under the MIT license.\n' + ++ ' */\n' ++ }, + dist: { +- src: ['', 'dist/ba-hooker.js'], +- dest: 'dist/ba-hooker.min.js' ++ files: { ++ 'dist/ba-hooker.min.js': 'dist/ba-hooker.js' ++ } + } + }, +- test: { ++ nodeunit: { + files: ['test/**/*.js'] + }, + lint: { +@@ -30,7 +29,7 @@ module.exports = function(grunt) { + }, + watch: { + files: '', +- tasks: 'lint:files test:files' ++ tasks: 'lint:files nodeunit:files' + }, + jshint: { + options: { +@@ -50,10 +49,15 @@ module.exports = function(grunt) { + module: false + } + }, +- uglify: {} + }); + ++ grunt.loadNpmTasks('grunt-contrib-jshint'); ++ grunt.loadNpmTasks('grunt-contrib-nodeunit'); ++ grunt.loadNpmTasks('grunt-contrib-uglify'); ++ grunt.loadNpmTasks('grunt-contrib-watch'); ++ + // Default task. +- grunt.registerTask('default', 'lint test concat min'); ++ grunt.registerTask('default', ['lint nodeunit uglify']); ++ grunt.registerTask('test', ['lint nodeunit']); + + }; +diff --git a/package.json b/package.json +index 6dd6968..1bde458 100644 +--- a/package.json ++++ b/package.json +@@ -22,7 +22,11 @@ + ], + "dependencies": {}, + "devDependencies": { +- "grunt": "~0.2.1" ++ "grunt": "~0.2.1", ++ "grunt-contrib-jshint": "~0.6.0", ++ "grunt-contrib-nodeunit": "~0.2.0", ++ "grunt-contrib-uglify": "~0.2.2", ++ "grunt-contrib-watch": "~0.4.4" + }, + "keywords": [ + "patch", +-- +1.8.3.1 + diff --git a/nodejs-hooker-0.2.3-Updating-gruntfile-to-grunt-0.3.0-format.patch b/nodejs-hooker-0.2.3-Updating-gruntfile-to-grunt-0.3.0-format.patch new file mode 100644 index 0000000..14cf8ea --- /dev/null +++ b/nodejs-hooker-0.2.3-Updating-gruntfile-to-grunt-0.3.0-format.patch @@ -0,0 +1,121 @@ +From 96e3b30140ae2f4987af0f461acbc0a20b199f30 Mon Sep 17 00:00:00 2001 +From: Ben Alman +Date: Thu, 22 Mar 2012 21:13:32 -0400 +Subject: [PATCH] Updating gruntfile to grunt 0.3.0 format. + +--- + grunt.js | 102 +++++++++++++++++++++++++++++++++++---------------------------- + 1 file changed, 57 insertions(+), 45 deletions(-) + +diff --git a/grunt.js b/grunt.js +index c695148..09bd528 100644 +--- a/grunt.js ++++ b/grunt.js +@@ -1,47 +1,59 @@ +-/*global config:true, task:true*/ +-config.init({ +- pkg: '', +- meta: { +- name: 'JavaScript Hooker', +- banner: '/*! <%= meta.name %> - v<%= pkg.version %> - <%= template.today("m/d/yyyy") %>\n' + +- '* <%= pkg.homepage %>\n' + +- '* Copyright (c) <%= template.today("yyyy") %> <%= pkg.author.name %>;' + +- ' Licensed <%= _.pluck(pkg.licenses, "type").join(", ") %> */' +- }, +- concat: { +- 'dist/ba-hooker.js': ['', ''] +- }, +- min: { +- 'dist/ba-hooker.min.js': ['', 'dist/ba-hooker.js'] +- }, +- test: { +- files: ['test/**/*.js'] +- }, +- lint: { +- files: ['grunt.js', 'lib/**/*.js', 'test/**/*.js'] +- }, +- watch: { +- files: '', +- tasks: 'lint:files test:files' +- }, +- jshint: { +- options: { +- curly: true, +- eqeqeq: true, +- immed: true, +- latedef: true, +- newcap: true, +- noarg: true, +- sub: true, +- undef: true, +- eqnull: true ++module.exports = function(grunt) { ++ ++ // Project configuration. ++ grunt.initConfig({ ++ pkg: '', ++ meta: { ++ name: 'JavaScript Hooker', ++ banner: '/*! <%= meta.name %> - v<%= pkg.version %> - <%= grunt.template.today("m/d/yyyy") %>\n' + ++ '* <%= pkg.homepage %>\n' + ++ '* Copyright (c) <%= grunt.template.today("yyyy") %> <%= pkg.author.name %>;' + ++ ' Licensed <%= _.pluck(pkg.licenses, "type").join(", ") %> */' ++ }, ++ concat: { ++ dist: { ++ src: ['', ''], ++ dest: 'dist/ba-hooker.js' ++ } ++ }, ++ min: { ++ dist: { ++ src: ['', 'dist/ba-hooker.js'], ++ dest: 'dist/ba-hooker.min.js' ++ } ++ }, ++ test: { ++ files: ['test/**/*.js'] + }, +- globals: { +- exports: true +- } +- }, +- uglify: {} +-}); ++ lint: { ++ files: ['grunt.js', 'lib/**/*.js', 'test/**/*.js'] ++ }, ++ watch: { ++ files: '', ++ tasks: 'lint:files test:files' ++ }, ++ jshint: { ++ options: { ++ curly: true, ++ eqeqeq: true, ++ immed: true, ++ latedef: true, ++ newcap: true, ++ noarg: true, ++ sub: true, ++ undef: true, ++ boss: true, ++ eqnull: true ++ }, ++ globals: { ++ exports: true, ++ module: false ++ } ++ }, ++ uglify: {} ++ }); ++ ++ // Default task. ++ grunt.registerTask('default', 'lint test concat min'); + +-// Default task. +-task.registerTask('default', 'lint:files test:files concat min'); ++}; +-- +1.8.3.1 + diff --git a/nodejs-hooker.spec b/nodejs-hooker.spec new file mode 100644 index 0000000..c565c96 --- /dev/null +++ b/nodejs-hooker.spec @@ -0,0 +1,64 @@ +%{?nodejs_find_provides_and_requires} +%global enable_tests 0 +%global enable_grunt 0 +Name: nodejs-hooker +Version: 0.2.3 +Release: 1 +Summary: Monkey-patch (hook) functions for debugging +License: MIT +URL: https://github.com/cowboy/javascript-hooker +Source0: http://registry.npmjs.org/hooker/-/hooker-%{version}.tgz +Patch0: %{name}-0.2.3-Updating-gruntfile-to-grunt-0.3.0-format.patch +Patch1: %{name}-0.2.3-Rename-grunt.js-to-Gruntfile.js.patch +Patch2: %{name}-0.2.3-Update-Gruntfile.js-for-use-with-grunt-0.4.0.patch +BuildArch: noarch +ExclusiveArch: %{nodejs_arches} noarch +BuildRequires: nodejs-packaging uglify-js +%if 0%{?enable_tests} +BuildRequires: npm(nodeunit) +%endif +%if 0%{?enable_grunt} +BuildRequires: npm(grunt-cli) npm(grunt-contrib-nodeunit) npm(grunt-contrib-uglify) +%endif +%description +%{summary}. + +%prep +%setup -q -n package +%patch0 -p1 +%patch1 -p1 +%patch2 -p1 +%nodejs_symlink_deps --check + +%build +%if 0%{?enable_grunt} +grunt uglify +%else +head -n 8 lib/hooker.js > dist/ba-hooker.min.js.new +/usr/bin/uglifyjs dist/ba-hooker.js -m -c >> dist/ba-hooker.min.js.new +touch -r dist/ba-hooker.min.js dist/ba-hooker.min.js.new +mv dist/ba-hooker.min.js{.new,} +%endif + +%install +mkdir -p %{buildroot}%{nodejs_sitelib}/hooker +cp -pr package.json child.js dist/ lib/ parent.js \ + %{buildroot}%{nodejs_sitelib}/hooker +%nodejs_symlink_deps +%if 0%{?enable_tests} + +%check +%if 0%{?enable_grunt} +grunt nodeunit +%else +%{nodejs_sitelib}/nodeunit/bin/nodeunit test/*.js +%endif +%endif + +%files +%doc LICENSE-MIT README.md +%{nodejs_sitelib}/hooker + +%changelog +* Thu Aug 20 2020 wangxiao - 0.2.3-1 +- Package init diff --git a/nodejs-hooker.yaml b/nodejs-hooker.yaml new file mode 100644 index 0000000..d70649b --- /dev/null +++ b/nodejs-hooker.yaml @@ -0,0 +1,5 @@ +git_url: https://github.com/cowboy/javascript-hooker +version_control: github +src_repo: cowboy/javascript-hooker +tag_prefix: "^v" +seperator: "."