From b980d30c0f1b329def483f18823c1e913e383824 Mon Sep 17 00:00:00 2001 From: Jake Howard Date: Wed, 19 Aug 2015 19:15:14 +0100 Subject: [PATCH] Move from bash to npm --- README.md | 11 ++++++++++ firefox/README.md | 2 -- firefox/index.js | 10 +-------- firefox/package.json | 10 ++++----- firefox/test/test-index.js | 19 ----------------- package.json | 43 ++++++++++++++++++++++++++++++++++++++ run.sh | 20 ------------------ 7 files changed, 60 insertions(+), 55 deletions(-) delete mode 100644 firefox/README.md delete mode 100644 firefox/test/test-index.js create mode 100644 package.json delete mode 100644 run.sh diff --git a/README.md b/README.md index 4093c6d..e6833b0 100644 --- a/README.md +++ b/README.md @@ -1,9 +1,20 @@ # Hipchat Emoticons for all! # +## Building for yourself ## +Whilst I recommend that you use the plugins that are on the add-on stores of the respective browsers, building the apps yourself is perfectly possible. I build the apps on ubuntu, so have made sure that the build scripts work for me, use on other platforms may vary. +### Commands: ### + npm clean + npm install + npm run build + npm run build-extensions + + + ### To-Do ### * Create chrome version * Create script to copy files from common to platform directories * Add other sites support (currently facebook messages popup only) + ##### Disclaimer: ##### As you can tell, the quality of the code isnt perfect, or to a particular standard. Once the plugin works properly to a basic level, I will install some linting software to make the code look nicer, and possibly run smoother too. \ No newline at end of file diff --git a/firefox/README.md b/firefox/README.md deleted file mode 100644 index 276365d..0000000 --- a/firefox/README.md +++ /dev/null @@ -1,2 +0,0 @@ -#injection testing -A basic add-on \ No newline at end of file diff --git a/firefox/index.js b/firefox/index.js index 9fc3799..7a6e921 100644 --- a/firefox/index.js +++ b/firefox/index.js @@ -1,15 +1,7 @@ var self = require('sdk/self'); var pageMod = require("sdk/page-mod"); -// a dummy function, to show how tests work. -// to see how to test this function, look at test/test-index.js -function dummy(text, callback) { - callback(text); -} - pageMod.PageMod({ include: "*.facebook.com", contentScriptFile: ["./jquery.js", "./script.js"] -}); -exports.dummy = dummy; - +}); \ No newline at end of file diff --git a/firefox/package.json b/firefox/package.json index 4156438..c07f791 100644 --- a/firefox/package.json +++ b/firefox/package.json @@ -1,10 +1,10 @@ { - "title": "injection testing", - "name": "injectiontesting", - "version": "0.0.1", - "description": "A basic add-on", + "title": "Hipchat Emoticons for all", + "name": "Hipchat emoticons for all", + "version": "ALPHA", + "description": "Use Hipchat emoticons on other sites", "main": "index.js", - "author": "Jake Howard", + "author": "TheOrangeOne", "engines": { "firefox": ">=38.0a1", "fennec": ">=38.0a1" diff --git a/firefox/test/test-index.js b/firefox/test/test-index.js deleted file mode 100644 index b3ad6e8..0000000 --- a/firefox/test/test-index.js +++ /dev/null @@ -1,19 +0,0 @@ -var main = require("../"); - -exports["test main"] = function(assert) { - assert.pass("Unit test running!"); -}; - -exports["test main async"] = function(assert, done) { - assert.pass("async Unit test running!"); - done(); -}; - -exports["test dummy"] = function(assert, done) { - main.dummy("foo", function(text) { - assert.ok((text === "foo"), "Is the text actually 'foo'"); - done(); - }); -}; - -require("sdk/test").run(exports); diff --git a/package.json b/package.json new file mode 100644 index 0000000..726053a --- /dev/null +++ b/package.json @@ -0,0 +1,43 @@ +{ + "name": "Hipchat Emoticons for all", + "version": "ALPHA", + "description": "Use hipchat emoticons on other sites", + "main": "src/index.js", + "scripts": { + "create-dirs": "mkdir -p build/assets build/lib", + "build-extensions": "", + "build-firefox": "", + "build-chrome": "", + "build-js": "browserify -t reactify src/index.js -o build/index.js", + "copy-firefox": "", + "copy-chrome": "", + "build": "ulimit -n 512 && npm run create-dirs && npm install && npm run build-js && npm run copy-firefox && npm run copy-chrome", + "clean": "rm -rf build/ && rm -rf firefox/data", + }, + "repository": { + "type": "git", + "url": "https://bitbucket.org/theorangeone/hipchat-emoticons-for-all" + }, + "keywords": [ + "hipchat", + "emoticons" + ], + "author": "TheOrangeOne", + "license": "MIT", + "bugs": { + "url": "https://bitbucket.org/theorangeone/hipchat-emoticons-for-all/issues" + }, + "homepage": "https://bitbucket.org/theorangeone/hipchat-emoticons-for-all", + "dependencies": { + "browserify": "=9.0.3", + "ionic-sdk": "=1.0.0", + "less": "=2.4.0", + "react": "=0.13.2", + "react-tools": "=0.13.2", + "reactify": "=1.1.1" + }, + "devDependencies": { + "jquery": "=2.1.4", + "jpm":"=1.0.1" + } +} diff --git a/run.sh b/run.sh deleted file mode 100644 index 3585754..0000000 --- a/run.sh +++ /dev/null @@ -1,20 +0,0 @@ -#!/bin/bash -# Build script for firefox and chrome plugins - - -function build_firefox { - echo "Building Firefox extension..." -} - -function build_chrome { - echo "Building Chrome extension..." -} - -if [ "$1" == "firefox" ]; then - build_firefox -elif [ "$1" == "chrome" ]; then - build_chrome -else - build_firefox - build_chrome -fi