diff --git a/.gitignore b/.gitignore
index b333121..13a808f 100644
--- a/.gitignore
+++ b/.gitignore
@@ -1,4 +1,15 @@
-node_modules
-tmp
-/gulp-useref-weh/node_modules/
-/npm-debug.log
+node_modules/
+tmp/
+npm-debug.log
+run-web-ext.sh
+inspector/
+skeleton/
+make-inspector.sh
+.DS_Store
+._.DS_Store
+make-inspector-sign.sh
+inspector-tmp/
+inspector-builds/
+build-inspector-firefox.sh
+profile/
+run-inspector.sh
diff --git a/.gitmodules b/.gitmodules
deleted file mode 100644
index d1a16eb..0000000
--- a/.gitmodules
+++ /dev/null
@@ -1,3 +0,0 @@
-[submodule "gulp-chrome-manifest"]
- path = gulp-chrome-manifest
- url = https://github.com/ragingwind/gulp-chrome-manifest.git
diff --git a/README.md b/README.md
index c5361e3..f474cf2 100644
--- a/README.md
+++ b/README.md
@@ -4,14 +4,13 @@
This toolkit speeds up browser add-ons development by providing a number of facilities for WebExtensions-based (Firefox, Chrome, Opera and Edge) extensions.
-This is not a framework in the sense that the developer does not have to embrace all the provided utilities and there is not many architectural constraints to follow in order to take benefit of the tool.
+This is not a framework in the sense that the developer does not have to embrace all the provided utilities and there are not many architectural constraints to follow in order to take benefit of the tool.
The build system generates automatically a directory you can directly install into your browser, compiling
-automatically CoffeeScript, TypeScript and JSX to Javascript, Sass, Less and Stylus to CSS, optionally concatenating and minifying scripts, styles and HTML.
+automatically CoffeeScript, TypeScript and JSX to Javascript, Sass, Less and Stylus to CSS.
-**weh** also provides some libraries that goes into your addon to ease a number of common tasks like managing preferences and two-way communications between the extension background and its user interface content pages,
-providing a way for the end-user to customize any string in the add-on user interface. Developing the user interface using ReactJS is also simplified but you may choose
-not to use this library.
+**weh** also provides some libraries that go into your addon to ease a number of common tasks like managing preferences and two-way communications between the extension background and its user interface content pages,
+providing a way for the end-user to customize any string in the add-on user interface. Developing the user interface using ReactJS is also simplified but you may choose not to use this library.
In addition, an inspector application (under the form of a **weh**-based extension) is provided to monitor other **weh** extensions in real-time.
@@ -65,7 +64,7 @@ weh
```
You will notice that the last `weh` command does not return. It is in watch mode, meaning whenever you make a change into the `myextension/src`
-directory, those changes are rebuild into `myextension/build`. If you do not want this behaviour and prefer running the build command manually,
+directory, those changes are rebuild into `myextension/build`. If you do not want this behavior and prefer running the build command manually,
add `--no-watch` to the command line.
Run `weh help` to see more command line options.
@@ -82,94 +81,31 @@ Run `weh help` to see more command line options.
**weh** expects all project-specific code to be put into the `src` sub-directory:
- `src/manifest.json`: your add-on's manifest
-- `src/**/*.html`: those files are processed, so resources like js and css (and other supported languages) are learned and
-processed to the build directory.
-- `src/locales`: files are copied to `build/_locales`
-- `src/manifest.json`: file is copied to `build`
-- `src/**/_assets/`: files and directories are processed (for language compilation) and copied to the build directory
-(without the `_assets` part)
-- `etc/jsbanner.txt`: file that you can optionnally create to setup a header in the JS files.
-
-Note that a `.js` or `css` file that would be located in `src/` but not referenced from `manifest.json` nor any `.html`
-file won't be copied to the build directory. If you want this file in the build, you must put it in a `_assets`
-sub-directory of `src/`.
+- `src/**/*`: those files are processed, so resources like js and css (and other supported languages) are learned and processed to the build directory.
+- `src-modules/**/*`: files here are used to resolve dependencies
+- `locales`: files are copied to `build/_locales`
Also note that you can change the `src` directory by specifying a directory path with the `--srcdir` option.
-## defining resources
+## accessing weh services
-You don't need to do anything special to make *weh* background libraries available to your add-on. Just declare your own modules in `manifest.json`:
+Declaring `weh` from a background script: `const weh = require('weh-background');`
+From a content script: `const weh = require('weh-content');`
-```
- "background": {
- "scripts": [
- "background/main.js"
- ]
- }
-```
-
-When the add-on is built, *weh* background modules will be added automatically. If the `--prod` option is provided, *weh* and custom files
-will be concatenated and minified.
-
-Content scripts and styles included in `manifest.json`are processed the same way:
-```
- "content_scripts": [{
- "js": [ "script1.js", "script2.js" ],
- "css": [ "style1.css", "style2.css" ]
- }]
-```
-
-For content files, you must load a number of scripts and styles into your HTML files. For instance:
-```
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-```
+You can then access a number of services from the `weh` variable:
-When the extension is built, `` is first replaced by weh scripts inclusion. Then, the sections between
-`` and `` are processed to be concatenated into a single file (per section) and minified
-if you specify the `--prod` for production mode.
+- `weh.rpc`: making function calls (both ways) through various components completely transparent: between background and content, background and workers, background and native apps, background and injected-content
+- `weh.prefs`: preferences system
+- `weh.i18n`: translation system
+- `weh.ui`: content management from background utilities
## multi-language support
-*Weh* obviously supports Javascript (`.js` file extension) for scripts and Cascading Style Sheets (`.css` extension),
-but you can also use other languages:
+*Weh* obviously supports Javascript (`.js` file extension) for scripts and Cascading Style Sheets (`.css` extension), but you can also use other languages:
- scripts: *JSX* (`.jsx`), *Typescript* (`.ts`), *Coffee* (`.coffee`)
- styling: *Sass* (`.scss`), *Less* (`.less`), *Stylus* (`.styl`)
-Whether in `manifest.json`or `.html` files, just use the file as if it was Javascript or CSS:
-```
-
-
-
-
- ...
-
-
-
-
-```
-
-*Weh* will then take care of calling the appropriate processors and renaming the files inside `manifest.json` and
-`.html` files, so that the browser will be able to run this code.
-
## pre-processing files
All files with a `.ejs` are processed first by an *EJS* processor. For instance, a file named `myscript.js.ejs` will
@@ -177,7 +113,7 @@ be transformed to `myscript.js` before being processed. You can specify one or s
for the EJS resolution using the `--ejsdata` option.
The EJS pre-processing occurs in a first place, so a file named `myscript.ts.ejs` will first be EJS-processed, then
-compiled using Typescript, and will endup in the build directory as `myscript.js`.
+compiled using Typescript, and will end up in the build directory as `myscript.js`.
Any text file in the `src` directory can be processed with EJS, not only js and css-like.
@@ -188,7 +124,7 @@ Pre-processing is useful if you want to generate different builds from the same
### weh preferences
Preferences are to be formally defined in order to be used in your add-on. An example of preferences description could be:
-```
+```js
weh.prefs.declare([{
name: "myparam_string",
type: "string",
@@ -230,7 +166,7 @@ weh.prefs.declare([{
For each parameter, you must provide at least `name`, `type` and `defaultValue`. `type` must be one of `string`, `integer`, `float`, `boolean` or
`choice`. A specific preference parameter can then be accessed, as read or write, through `weh.prefs["parameter name"]`.
-You can install preferences listeners using `weh.prefs.on(whatToWatch,callback)` and uninstall listeners using `weh.prefs.off` with the same parameters. `whatToWatch` uses a dotted notation. For instance, listening to `""`, `"a"`, `"a.b"` or `"a.b.c"` will trigger the callback whenever
+You can install preferences listeners using `weh.prefs.on(whatToWatch,callback)` and un-install listeners using `weh.prefs.off` with the same parameters. `whatToWatch` uses a dotted notation. For instance, listening to `""`, `"a"`, `"a.b"` or `"a.b.c"` will trigger the callback whenever
parameter `a.b.c` is modified. Note that the preferences listeners are available from both background and local content.
You should also define a couple of human viewable strings associated to each parameter in `locales//messages.json`:
@@ -238,7 +174,7 @@ You should also define a couple of human viewable strings associated to each par
- `weh_prefs_description_` defines an optional longer description for this parameter
Example (`locales/en_US/messages.json`):
-```
+```js
"weh_prefs_label_myparam_string": {
"message": "String parameter"
},
@@ -256,154 +192,101 @@ You can define a number of constraints to your preferences. This is useful with
- object containing fields `value` (the actual preference value) and `name` (what is to be displayed to the user)
- string representing the actual preference value. The label to be displayed for this choice is searched in `locales//messages.json` as `weh_prefs_label__option_`
-Note that the preferences definition can be declared or updated at any time. This is useful if, for instance, you don't the list of choices
-in advance.
+Note that the preferences definition can be declared or updated at any time. This is useful if, for instance, you don't the list of choices in advance.
-From the content side, you should create an HTML file in your source code to represent the settings page:
-```
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-```
-
-And a settings JSX file like this:
-```
-function Prefs() {
- return (
-
-
-
-
-
-
- )
-}
-
-ReactDOM.render (
-
-
{weh._("settings")}
-
-
-
,
- document.getElementById('root')
-)
-```
-
-*weh* will automatically create a dynamic form to allow modifying settings based on the preferences definition.
+*weh* takes care of adding/removing the listener when the component is mounted/unmounted and delivering the message to the `onWehMessage` method.
-### weh user interface
+## debugging tools
-*weh* simplifies communications between background and content by handling automatically the message ports.
+The *weh* toolkit includes an extension called *weh-inspector* which allows to:
+- monitor messages between the background and UI
+- read/write addon preferences
+- read add-on storage
-Let's see an example (`src/background/main.js`):
-```
-weh.ui.update("default",{
- onMessage: function(message) {
- switch(message.type) {
- case "open-settings":
- weh.ui.close("default");
- weh.ui.open("settings");
- break;
- }
- }
-});
+The *weh-inspector* is available as a template in the *weh* toolkit. As such, you can install it with `weh init --template inspector --prjdir inspector` and then load the generated extension into the browser like any regular weh addon.
-weh.ui.update("settings",{
- type: "tab",
- contentURL: "content/settings.html",
-});
-```
+## i18n
-Here we defined 2 user interface pages. The first one has a special name `default` meaning this is the popup declared in `manifest.json`. When
-this popup sends a message with the `type` field equal to `open-settings`, a tab is opened to URL `content/settings.html`. If a tab is already
-open to this URL, it is activated instead.
+*weh* provides some utilities for dealing with locales.
-In the content popup code, when the *Setting* button/link is pressed, we just do:
-```
- weh.post({
- type: "open-settings"
- });
-```
+Instead of `browser.i18n.getMessage()`, you should use `weh._()`, with the same parameters:
+- it's shorter
+- it automatically turns character `'-'` into `'_'` in string tags while leaving a warning in the console
+- more important: it allows overwriting some or all locale strings. Whenever a call is made to `weh._()`, the library first searches for a storage-based translation for this tag. If not found, it uses the default string defined in `_locales//messages.json`. By default, *weh* provides a user interface page for the user to edit locale strings. It is up to the add-on developer to write the code to centralize the user-generated translations on a server, so that it can be shared amongst all users.
-To send asynchronous messages to the content pages, just do:
+## rpc
-```
- weh.ui.post(panelName,message)
-```
+*weh* provides an easy way to call functions across components that do not run within the same threads.
-Where `panelName` is the name of a page your previously defined with `weh.ui.update` and `message` is any JSONizable javascript object.
+All the functions return promises. If a declared function returns something other than a Promise object, *weh* takes of promisifying the returned value.
-You can also call `weh.ui.post(message)` to send the same message to all open pages.
+Functions are declared on the called side using `weh.rpc.listen()` and are called with `weh.rpc.call()`.
-When defining a content page, you can, in addition to catching messages with `onMessage`, define callbacks for page opening with `onShow` or closing
-with `onHide`.
+For instance, the background can define a function like this:
+```js
+weh.rpc.listen({
+ my_function: (a,b) => {
+ return a + b;
+ }
+})
+```
-The callback parameters are:
-- `onMessage(message,postFn,panelName)` with `message` is the object sent from the content, `postFn` a function that can be used to send back messages directly and `panelName` the name of the panel (as defined in `weh.ui.update`) that sent the message. So doing `postFn({...})` is equivalent to `weh.ui.post(panelName,{...})`.
+and a content script can call the function this way:
+```js
+weh.call("my_function",39,3)
+ .then((result)=>{
+ console.info("=",result);
+ });
+```
-From the content side, you can listen for incoming background messages with `weh.on(callback)` and `weh.off(callback)` to remove the listerner.
+`weh.rpc.listen()` can declare several functions at once, and can be called several times: only function with the same name are overwritten.
-If you go for ReactJS for building your user interface, you can defines components like this:
-```
-class MyComponent extends React.Component {
- constructor(props) {
- super(props);
- weh.react.attach(this,this.onWehMessage);
- }
- onWehMessage(message) {
- /* do something wxith the incoming message */
- }
-}
-```
+When using the `weh.ui` module to create a content, for instance creating a tab, a name is given to this content, for instance `settings`. When the background wants to call a function declared within this content, it must use the content name as the first parameter: `weh.rpc.call("settings","my_function",39,3);
-*weh* takes care of adding/removing the listener when the component is mounted/unmounted and delivering the message to the `onWehMessage` method.
+If the called function does not exists, throw an exception or return explicitly a failed promise the returned promise is rejected.
-### content weh API
+## native messaging
-The preferences and localization API are available for background and local content. Some `weh` API methods are only available from the local content:
+*weh* is also very useful when dealing with native messaging.
-- `post(message)`: post a message to the background. `message` is any JSONizable object.
-- `postLocal(message)`: emulate a message received from the background. `message` is any object.
-- `on([type,]callback)`: install a handler to receive background messages. If `type` is used, the callback will be invoked only if the received message contains a field `type` with the same value.
-- `off([type,]callback)`: uninstall the callback from a previous call to `on(...)`.
-- `copyToClipboard(data,mimeType)`: copy data to the clipboard. `mimeType` default is `plain/text`.
-- `setPageTitle(newTitle)`: update or create the `` element in the HTML `` section.
+```js
+var nativeApp = require('weh-natmsg')("com.example.myapp");
-## debugging tools
+nativeApp.call("my_function",...params)
+ .then((result)=>{
+ // do something
+ })
+ .catch((err)=>{
+ // handle error
+ })
+```
-The *weh* toolkit includes an extension called *weh-inspector* which allows to:
-- monitor messages between the background and UI
-- read/write addon preferences
-- read add-on storage
+You can catch all errors due to the native app not being installed (or at least not being callable):
+```js
+nativeApp.onAppNotFound.addListener((err)=>{
+ // for instance, open a tab to a site where to download the app
+})
+```
-As of now, this tool is only available on Chrome and Opera, as Firefox currently lacks some APIs for the tool to operate.
+You can just check whether the app is present, without triggering the `onAppNotFound()` if it is not:
+```js
+nativeApp.callCatchAppNotFound((err)=>{
+ // this is called if the app could not be launched
+},"my_function",...params);
+```
-The *weh-inspector* is available as a template in the *weh* toolkit. As such, you can install it with `weh init --template weh-inspector --prjdir weh-inspector` and then load the generated extension into the browser like any regular weh addon.
+On the native app side, assuming it is developed on node.js, you can use the exact same rpc mechanism, using `rpc.listen()` and `rpc.call()` to communicate both ways with the add-on.
-## i18n
+For now, the only implementation of such a native is available on the [`vdhcoapp` project](https://github.com/mi-g/vdhcoapp) under GPL-2.0 license. It is planned to release a version using a less restrictive license.
-*weh* provides some utilities for dealing with locales.
+## UI utilities
-Instead of `browser.i18n.getMessage()`, you should use `weh._()`, with the same parameters:
-- it's shorter
-- it automatically turns character `'-'` into `'_'` in string tags while leaving a warning in the console
-- more important: it allows overwriting some or all locale strings. Whenever a call is made to `weh._()`, the library first searches for a storage-based translation for this tag. If not found, it uses the default string defined in `_locales//messages.json`. By default, *weh* provides a user interface page for the user to edit locale strings. It is up to the add-on developer to write the code to centralize the user-generated translations on a server, so that it can be shared amongst all users.
+`weh.ui` provides the ability to open a tab or a panel, so that the created content can directly be callable from the background using `weh.rpc`.
+```js
+weh.ui.open("some_name",{
+ url: "content/content.html",
+ type: "tab"
+});
+weh.rpc.call("some_name","my_content_function",...params);
+```
diff --git a/etc/jsbanner.txt b/etc/jsbanner.txt
deleted file mode 100644
index 069314d..0000000
--- a/etc/jsbanner.txt
+++ /dev/null
@@ -1,10 +0,0 @@
-/*
- * <%= manifest.name %> <%= manifest.description && (" - "+manifest.description) || "" %>
- * @version <%= manifest.version %><% if(manifest.homepage_url) { %>
- * @link <%= manifest.homepage_url %><% }
- if(manifest.author) { %>
- * @author: <%= manifest.author %><% }
- if(manifest.license) { %>
- * @license <%= manifest.license %><% } %>
- */
-
\ No newline at end of file
diff --git a/gulp-useref-weh/index.js b/gulp-useref-weh/index.js
deleted file mode 100644
index 7d5a4d6..0000000
--- a/gulp-useref-weh/index.js
+++ /dev/null
@@ -1,153 +0,0 @@
-/*
- * gulp-useref-weh
- *
- * @summary an integration of useref into gulp, solves some gulp-useref issues
- * @author Michel Gutierrez
- * @link https://github.com/mi-g/weh
- *
- * This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/.
- */
-
-const useref = require("./useref");
-const es = require('event-stream');
-const through = require('through2');
-const minimatch = require("minimatch");
-const glob = require("glob");
-const gulp = require("gulp");
-const debug = require("gulp-debug");
-const concat = require("gulp-concat");
-const gulpif = require("gulp-if");
-const streamqueue = require('streamqueue');
-const path = require("path");
-const gutil = require('gulp-util');
-const File = gutil.File;
-
-module.exports = function () {
-
- var handlers, options;
-
- if(Array.isArray(arguments[0])) {
- handlers = arguments[0];
- options = arguments[1] || {};
- } else {
- handlers = [{src:"**/*.{js,css}"}];
- options = arguments[0] || {};
- }
-
- return through.obj(function (file, enc, callback) {
-
- var self = this;
- var output = useref(file.contents.toString(),{
- noconcat: !!options.noconcat,
- changeExt: options.changeExt
- });
- var outputHTML = output[0];
- var allAssets = output[1];
- var processCount = 1;
- var errorEmitted = false;
-
- var cwd = process.cwd();
- var baseDir = path.dirname(file.path);
- if(options.base)
- baseDir = options.base;
- process.chdir(baseDir);
- this.push(new File({
- path: file.path,
- contents: Buffer.from(outputHTML)
- }));
- process.chdir(cwd);
- var relDir = path.dirname(path.relative(baseDir,file.path));
-
- function GetAssetStreams(scripts) {
-
- var assetStreams = [];
- var fileScriptMap = {};
-
- scripts.forEach(function(script) {
- if(handlers.every(function(handler) {
- var patterns = handler.src;
- if(!Array.isArray(patterns))
- patterns = new Array(patterns);
- if(!patterns.every(function(pattern) {
- var files = glob.sync(pattern);
- if(!files.every(function(file) {
- if(minimatch(file,script,{matchBase:true})) {
- assetStreams.push(handler.stream && handler.stream(file) || gulp.src(file));
- fileScriptMap[path.resolve(file)] = script;
- return false;
- }
- return true;
- }))
- return false;
- return true;
- }))
- return false
- return true;
- }))
- console.warn("gulp-useref-weh: No handler found for",script);
- });
-
- return {
- assetStreams: assetStreams,
- fileScriptMap: fileScriptMap
- }
- }
-
- function Done() {
- if(--processCount==0)
- callback();
- }
-
- function ChangeExt(name) {
- while(options.changeExt && (path.extname(name) in options.changeExt))
- name = name.substr(0, name.lastIndexOf(".")) + options.changeExt[path.extname(name)];
- return name;
- }
-
- for(var type in allAssets) {
- for(var oName in allAssets[type])
- (function(oName) {
- var streamsObj = GetAssetStreams(allAssets[type][oName].assets);
- var streams = streamsObj.assetStreams;
- var fileScriptMap = {};
- for(var key in streamsObj.fileScriptMap)
- fileScriptMap[ChangeExt(key)] = ChangeExt(streamsObj.fileScriptMap[key]);
-
- if(options.noconcat)
- processCount+=streams.length;
- else
- processCount++;
-
- streamqueue.apply(null,[{objectMode:true}].concat(streams))
- .on("error",function(err) {
- self.emit("error",err);
- this.emit("end");
- })
- .pipe(gulpif(!options.noconcat,concat(oName)))
- .pipe(through.obj(function(file,enc,cb) {
- var scriptFile = fileScriptMap[file.path];
- var targetName = path.join(relDir,options.noconcat ? scriptFile : oName);
- if(options.map) {
- var baseName = path.basename(file.path);
- if(!options.map[baseName])
- options.map[baseName] = [];
- if(options.map[baseName].indexOf(targetName)<0)
- options.map[baseName].push(targetName);
- }
- self.push(new File({
- path: targetName,
- contents: file.contents
- }));
-
- cb();
- Done();
- }));
- })(oName);
- }
-
- Done();
- });
-
-}
diff --git a/gulp-useref-weh/package.json b/gulp-useref-weh/package.json
deleted file mode 100644
index a445bf6..0000000
--- a/gulp-useref-weh/package.json
+++ /dev/null
@@ -1,17 +0,0 @@
-{
- "name": "gulp-useref-weh",
- "version": "1.0.0",
- "description": "",
- "main": "index.js",
- "scripts": {
- "test": "echo \"Error: no test specified\" && exit 1"
- },
- "author": "",
- "license": "ISC",
- "dependencies": {
- "glob": "^7.1.1",
- "minimatch": "^3.0.3",
- "streamqueue": "^1.1.1",
- "useref": "^1.2.0"
- }
-}
diff --git a/gulp-useref-weh/useref/.editorconfig b/gulp-useref-weh/useref/.editorconfig
deleted file mode 100644
index bc9504f..0000000
--- a/gulp-useref-weh/useref/.editorconfig
+++ /dev/null
@@ -1,25 +0,0 @@
-# EditorConfig helps developers define and maintain consistent
-# coding styles between different editors and IDEs
-# editorconfig.org
-
-root = true
-
-
-[*]
-
-# Change these settings to your own preference
-indent_style = space
-indent_size = 2
-
-# We recommend you to keep these unchanged
-end_of_line = lf
-charset = utf-8
-trim_trailing_whitespace = true
-insert_final_newline = true
-
-[*.md]
-trim_trailing_whitespace = false
-
-[{package.json,*.yml}]
-indent_style = space
-indent_size = 2
diff --git a/gulp-useref-weh/useref/.eslintrc.json b/gulp-useref-weh/useref/.eslintrc.json
deleted file mode 100644
index 1383224..0000000
--- a/gulp-useref-weh/useref/.eslintrc.json
+++ /dev/null
@@ -1,180 +0,0 @@
-{
- "env": {
- "mocha": true,
- "node": true
- },
- "globals": {},
- "extends": "eslint:recommended",
- "rules": {
- "block-scoped-var": 2,
- "complexity": [
- 1,
- 5
- ],
- "consistent-return": 2,
- "curly": [
- 2,
- "all"
- ],
- "dot-notation": 2,
- "eqeqeq": 2,
- "no-caller": 2,
- "no-else-return": 2,
- "no-eq-null": 2,
- "no-extend-native": 2,
- "no-implicit-coercion": 2,
- "no-invalid-this": 2,
- "no-loop-func": 2,
- "no-multi-spaces": 2,
- "no-multi-str": 2,
- "no-new-func": 2,
- "no-new-wrappers": 2,
- "no-new": 2,
- "no-param-reassign": 1,
- "no-unused-expressions": 2,
- "no-useless-call": 2,
- "no-useless-concat": 2,
- "no-with": 2,
- "vars-on-top": 2,
- "wrap-iife": [2, "any"],
- "yoda": [
- 2,
- "never"
- ],
-
- "strict": [
- 2,
- "global"
- ],
-
- "no-shadow": 2,
- "no-use-before-define": 2,
-
- "callback-return": 2,
- "handle-callback-err": 2,
- "no-path-concat": 2,
-
- "array-bracket-spacing": [
- 1,
- "always", {
- "objectsInArrays": false
- }
- ],
- "block-spacing": 1,
- "brace-style": 1,
- "camelcase": [
- 1, {
- "properties": "never"
- }
- ],
- "comma-spacing": [
- 1, {
- "before": false,
- "after": true
- }
- ],
- "comma-style": [
- 1,
- "last"
- ],
- "computed-property-spacing": [
- 1,
- "never"
- ],
- "consistent-this": [
- 1,
- "self"
- ],
- "eol-last": 1,
- "indent": [
- 2,
- 2, {
- "SwitchCase": 1
- }
- ],
- "key-spacing": [
- 1, {
- "beforeColon": false,
- "afterColon": true
- }
- ],
- "keyword-spacing": 1,
- "linebreak-style": [
- 1,
- "unix"
- ],
- "lines-around-comment": [
- 1, {
- "allowBlockStart": true,
- "beforeBlockComment": true,
- "beforeLineComment": true
- }
- ],
- "max-depth": [
- 1,
- 4
- ],
- "max-params": [
- 1,
- 3
- ],
- "max-statements": [
- 1,
- 10
- ],
- "new-cap": 2,
- "new-parens": 2,
- "newline-after-var": [
- 1,
- "always"
- ],
- "no-array-constructor": 2,
- "no-bitwise": 1,
- "no-lonely-if": 1,
- "no-multi-spaces": 1,
- "no-multiple-empty-lines": 1,
- "no-new-object": 2,
- "no-spaced-func": 1,
- "no-trailing-spaces": 1,
- "no-unneeded-ternary": 1,
- "object-curly-spacing": [
- 1,
- "always"
- ],
- "operator-assignment": [
- 1,
- "always"
- ],
- "operator-linebreak": [
- 1,
- "after"
- ],
- "quote-props": [
- 1,
- "as-needed"
- ],
- "quotes": [
- 1,
- "single"
- ],
- "semi": [
- 2,
- "always"
- ],
- "semi-spacing": [
- 1, {
- "before": false,
- "after": true
- }
- ],
- "space-before-blocks": [
- 1,
- "always"
- ],
- "space-before-function-paren": [1, { "anonymous": "always", "named": "never" }],
- "space-in-parens": [1, "never"],
- "space-infix-ops": 1,
- "space-unary-ops": 0,
- "spaced-comment": [1, "always", { "line": { "exceptions": ["-"] } }]
- }
-}
diff --git a/gulp-useref-weh/useref/.gitattributes b/gulp-useref-weh/useref/.gitattributes
deleted file mode 100644
index dd73293..0000000
--- a/gulp-useref-weh/useref/.gitattributes
+++ /dev/null
@@ -1,5 +0,0 @@
-* text=auto
-
-# Tell git not to change these line endings
-test/testfiles/16-win-expected.html text=-crlf
-test/testfiles/16-win.html text=-crlf
diff --git a/gulp-useref-weh/useref/.gitignore b/gulp-useref-weh/useref/.gitignore
deleted file mode 100644
index 1fd04da..0000000
--- a/gulp-useref-weh/useref/.gitignore
+++ /dev/null
@@ -1,3 +0,0 @@
-node_modules
-coverage
-.nyc_output
diff --git a/gulp-useref-weh/useref/.travis.yml b/gulp-useref-weh/useref/.travis.yml
deleted file mode 100644
index 0f8a6b6..0000000
--- a/gulp-useref-weh/useref/.travis.yml
+++ /dev/null
@@ -1,18 +0,0 @@
-sudo: false
-language: node_js
-node_js:
- - '6'
- - '4'
-before_script:
- - npm install -g gulp
- - gulp lint
-after_success: npm run coveralls
-
-# whitelist
-branches:
- only:
- - master
-
-notifications:
- email:
- - kempdogg@gmail.com
diff --git a/gulp-useref-weh/useref/CONTRIBUTING.md b/gulp-useref-weh/useref/CONTRIBUTING.md
deleted file mode 100644
index 0c26321..0000000
--- a/gulp-useref-weh/useref/CONTRIBUTING.md
+++ /dev/null
@@ -1,199 +0,0 @@
-# Contributing to useref
-
-Please take a moment to review this document in order to make the contribution
-process easy and effective for everyone involved.
-
-Following these guidelines helps to communicate that you respect the time of
-the developers managing and developing this open source project. In return,
-they should reciprocate that respect in addressing your issue or assessing
-patches and features.
-
-
-## Using the issue tracker
-
-The issue tracker is the preferred channel for [bug reports](#bug-reports),
-[features requests](#feature-requests) and [submitting pull
-requests](#pull-requests), but please respect the following restrictions:
-
-* Please **do not** use the issue tracker for personal support requests (use
- [Stack Overflow](http://stackoverflow.com) or IRC).
-
-* Please **do not** derail or troll issues. Keep the discussion on topic and
- respect the opinions of others.
-
-
-## Bug reports
-
-A bug is a _demonstrable problem_ that is caused by the code in the repository.
-Good bug reports are extremely helpful - thank you!
-
-Guidelines for bug reports:
-
-1. **Use the GitHub issue search** — check if the issue has already been
- reported.
-
-2. **Check if the issue has been fixed** — try to reproduce it using the
- latest `master` or development branch in the repository.
-
-3. **Isolate the problem** — create a [reduced test
- case](https://css-tricks.com/reduced-test-cases/) and a live example.
-
-A good bug report shouldn't leave others needing to chase you up for more
-information. Please try to be as detailed as possible in your report. What is
-your environment? What steps will reproduce the issue? What browser(s) and OS
-experience the problem? What would you expect to be the outcome? All these
-details will help people to fix any potential bugs.
-
-Example:
-
-> Short and descriptive example bug report title
->
-> A summary of the issue and the browser/OS environment in which it occurs. If
-> suitable, include the steps required to reproduce the bug.
->
-> 1. This is the first step
-> 2. This is the second step
-> 3. Further steps, etc.
->
-> `` - a link to the reduced test case
->
-> Any other information you want to share that is relevant to the issue being
-> reported. This might include the lines of code that you have identified as
-> causing the bug, and potential solutions (and your opinions on their
-> merits).
-
-
-## Feature requests
-
-Feature requests are welcome. But take a moment to find out whether your idea
-fits with the scope and aims of the project. It's up to *you* to make a strong
-case to convince the project's developers of the merits of this feature. Please
-provide as much detail and context as possible.
-
-
-## Pull requests
-
-Good pull requests - patches, improvements, new features - are a fantastic
-help. They should remain focused in scope and avoid containing unrelated
-commits.
-
-**Please ask first** before embarking on any significant pull request (e.g.
-implementing features, refactoring code, porting to a different language),
-otherwise you risk spending a lot of time working on something that the
-project's developers might not want to merge into the project.
-
-Please adhere to the coding conventions used throughout a project (indentation,
-accurate comments, etc.) and any other requirements (such as test coverage).
-
-Follow this process if you'd like your work considered for inclusion in the
-project:
-
-1. [Fork](http://help.github.com/fork-a-repo/) the project, clone your fork,
- and configure the remotes:
-
- ```bash
- # Clone your fork of the repo into the current directory
- $ git clone https://github.com//useref
- # Navigate to the newly cloned directory
- $ cd useref
- # Assign the original repo to a remote called "upstream"
- $ git remote add upstream https://github.com/jonkemp/useref
- ```
-
-2. If you cloned a while ago, get the latest changes from upstream:
-
- ```bash
- $ git checkout
- $ git pull upstream
- ```
-
-3. Create a new topic branch (off the main project development branch) to
- contain your feature, change, or fix:
-
- ```bash
- $ git checkout -b
- ```
-
-4. Add relevant tests to cover the change.
-
-5. Make sure test-suite passes: `npm test`
-
-6. Commit your changes in logical chunks. Please adhere to these [git commit
- message guidelines](http://tbaggery.com/2008/04/19/a-note-about-git-commit-messages.html)
- or your code is unlikely be merged into the main project. Use Git's
- [interactive rebase](https://help.github.com/articles/interactive-rebase)
- feature to tidy up your commits before making them public.
-
-7. Locally merge (or rebase) the upstream development branch into your topic branch:
-
- ```bash
- $ git pull [--rebase] upstream
- ```
-
-8. Push your topic branch up to your fork:
-
- ```bash
- $ git push origin
- ```
-
-9. [Open a Pull Request](https://help.github.com/articles/using-pull-requests/)
- with a clear title and description.
-
-## Conventions of commit messages
-
-Addding files on repo
-
-```bash
-$ git commit -m "Add filename"
-```
-
-Updating files on repo
-
-```bash
-$ git commit -m "Update filename, filename2, filename3"
-```
-
-Removing files on repo
-
-```bash
-$ git commit -m "Remove filename"
-```
-
-Renaming files on repo
-
-```bash
-$ git commit -m "Rename filename"
-```
-
-Fixing errors and issues on repo
-
-```bash
-$ git commit -m "Fixed #issuenumber Message about this fix"
-```
-
-Adding features on repo
-
-```bash
-$ git commit -m "Add Feature: nameoffeature Message about this feature"
-```
-
-Updating features on repo
-
-```bash
-$ git commit -m "Update Feature: nameoffeature Message about this update"
-```
-
-Removing features on repo
-
-```bash
-$ git commit -m "Remove Feature: nameoffeature Message about this"
-```
-
-Ignoring Travis CI build on repo
-
-```bash
-$ git commit -m "Commit message here [ci-skip]"
-```
-
-**IMPORTANT**: By submitting a patch, you agree to allow the project owner to
-license your work under the same license as that used by the project.
diff --git a/gulp-useref-weh/useref/LICENSE b/gulp-useref-weh/useref/LICENSE
deleted file mode 100644
index e19ebc1..0000000
--- a/gulp-useref-weh/useref/LICENSE
+++ /dev/null
@@ -1,21 +0,0 @@
-The MIT License (MIT)
-
-Copyright (c) 2015 Jonathan Kemp
-
-Permission is hereby granted, free of charge, to any person obtaining a copy
-of this software and associated documentation files (the "Software"), to deal
-in the Software without restriction, including without limitation the rights
-to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
-copies of the Software, and to permit persons to whom the Software is
-furnished to do so, subject to the following conditions:
-
-The above copyright notice and this permission notice shall be included in all
-copies or substantial portions of the Software.
-
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
-LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
-OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
-SOFTWARE.
diff --git a/gulp-useref-weh/useref/README.md b/gulp-useref-weh/useref/README.md
deleted file mode 100644
index 0264fc3..0000000
--- a/gulp-useref-weh/useref/README.md
+++ /dev/null
@@ -1,200 +0,0 @@
-# useref [](https://travis-ci.org/jonkemp/useref) [](https://coveralls.io/github/jonkemp/useref?branch=master)
-
-[](https://nodei.co/npm/useref/)
-
-> Parse build blocks in HTML files to replace references
-
-Extracted from the grunt plugin [grunt-useref](https://github.com/pajtai/grunt-useref).
-
-## Installation
-
-```
-npm install useref
-```
-
-## Usage
-
-```js
-var useref = require('useref');
-var result = useref(inputHtml);
-// result = [ replacedHtml, { type: { path: { 'assets': [ replacedFiles] }}} ]
-```
-
-
-Blocks are expressed as:
-
-```html
-
-... HTML Markup, list of script / link tags.
-
-```
-
-- **type**: either `js`, `css` or `remove`
-- **alternate search path**: (optional) By default the input files are relative to the treated file. Alternate search path allows one to change that
-- **path**: the file path of the optimized file, the target output
-- **parameters**: extra parameters that should be added to the tag
-
-An example of this in completed form can be seen below:
-
-```html
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-```
-
-The module would be used with the above sample HTML as follows:
-
-```js
-var result = useref(sampleHtml);
-
-// [
-// resultHtml,
-// {
-// css: {
-// 'css/combined.css': {
-// 'assets': [ 'css/one.css', 'css/two.css' ]
-// }
-// },
-// js: {
-// 'scripts/combined.js': {
-// 'assets': [ 'scripts/one.js', 'scripts/two.js' ]
-// },
-// 'scripts/async.js': {
-// 'assets': [ 'scripts/three.js', 'scripts/four.js' ]
-// }
-// }
-// }
-// ]
-```
-
-
-The resulting HTML would be:
-
-```html
-
-
-
-
-
-
-
-
-
-```
-
-## IE Conditional Comments
-
-Internet Explorer Conditional Comments are preserved. The code below:
-
-```html
-
-
-
-```
-
-Results in:
-
-```html
-
-```
-
-### Custom blocks
-
-Sometimes you need a bit more. If you would like to do custom processing, this is possible with a custom block, as demonstrated below.
-
-```html
-
-
-
-```
-
-With
-
-```js
-var useref = require('useref');
-var result = useref(inputHtml, {
- // each property corresponds to any blocks with the same name, e.g. "build:import"
- import: function (content, target, options, alternateSearchPath) {
- // do something with `content` and return the desired HTML to replace the block content
- return content.replace('bower_components', target);
- }
-});
-```
-
-Becomes
-
-```html
-
-```
-
-The handler function gets the following arguments:
-
-- *content* (String): The content of the custom use block
-- *target* (String): The "path" value of the use block definition
-- *options* (String): The extra attributes from the use block definition, the developer can parse as JSON or do whatever they want with it
-- *alternateSearchPath* (String): The alternate search path that can be used to maintain a coherent interface with standard handlers
-
-Include a handler for each custom block type.
-
-### Symfony Twig and Laravel 5 Blade assets
-
-Works with the [symfony2 assetic](http://symfony.com/doc/current/cookbook/assetic/asset_management.html) and [laravel asset](https://laravel.com/docs/5.1/helpers#method-asset) and [elixir](https://laravel.com/docs/5.2/elixir#versioning-and-cache-busting) links in twig or blade or html or php.
-
-```html
-
-
-
-
-```
-
-### Options
-
-#### options.noconcat
-
-Type: `Boolean`
-Default: `false`
-
-Strips out build comments but leaves the rest of the block intact without replacing any tags.
-
-```html
-
-
-
-
-```
-
-Results in:
-
-```html
-
-
-```
-
-## Contributing
-
-See the [CONTRIBUTING Guidelines](https://github.com/jonkemp/useref/blob/master/CONTRIBUTING.md)
-
-## License
-
-MIT © [Jonathan Kemp](http://jonkemp.com)
diff --git a/gulp-useref-weh/useref/gulpfile.js b/gulp-useref-weh/useref/gulpfile.js
deleted file mode 100644
index 049e9bc..0000000
--- a/gulp-useref-weh/useref/gulpfile.js
+++ /dev/null
@@ -1,28 +0,0 @@
-/* eslint-disable */
-'use strict';
-
-var gulp = require('gulp'),
- mocha = require('gulp-mocha'),
- eslint = require('gulp-eslint');
-
-var paths = {
- scripts: ['./*.js', './lib/*.js', '!./gulpfile.js']
-};
-
-gulp.task('lint', function () {
- return gulp.src(paths.scripts)
- .pipe(eslint())
- .pipe(eslint.format())
- .pipe(eslint.failAfterError());
-});
-
-gulp.task('test', function () {
- return gulp.src('./test/*.js')
- .pipe(mocha({ reporter: 'spec' }));
-});
-
-gulp.task('watch', function () {
- gulp.watch(paths.scripts, ['lint', 'test']);
-});
-
-gulp.task('default', ['lint', 'test', 'watch']);
diff --git a/gulp-useref-weh/useref/index.js b/gulp-useref-weh/useref/index.js
deleted file mode 100644
index 2005589..0000000
--- a/gulp-useref-weh/useref/index.js
+++ /dev/null
@@ -1,14 +0,0 @@
-'use strict';
-
-var getBlocks = require('./lib/getBlocks'),
- transformReferences = require('./lib/transformReferences'),
- compactContent = require('./lib/compactContent');
-
-module.exports = function (content, options) {
- var blocks = getBlocks(content),
- opts = options || {},
- transformedContent = transformReferences(blocks, content, opts),
- replaced = compactContent(blocks);
-
- return [ transformedContent, replaced ];
-};
diff --git a/gulp-useref-weh/useref/lib/buildBlockManager.js b/gulp-useref-weh/useref/lib/buildBlockManager.js
deleted file mode 100644
index 08c6b17..0000000
--- a/gulp-useref-weh/useref/lib/buildBlockManager.js
+++ /dev/null
@@ -1,50 +0,0 @@
-'use strict';
-
-var resources = require('./resources'),
- sectionsJoinChar = resources.sectionsJoinChar,
- regend = resources.regend,
- sectionKey;
-
-module.exports = {
- block: false,
-
- sections: {},
-
- sectionIndex: 0,
-
- last: null,
-
- removeBlockIndex: 0,
-
- getSectionKey: function (build) {
- var key;
-
- if (build.attbs) {
- key = [ build.type, build.target, build.attbs ].join(sectionsJoinChar);
- } else if (build.target) {
- key = [ build.type, build.target ].join(sectionsJoinChar);
- } else {
- key = build.type;
- }
-
- return key;
- },
-
- setSections: function (build) {
- if (build.type === 'remove') {
- build.target = String(this.removeBlockIndex++);
- }
-
- sectionKey = this.getSectionKey(build);
-
- if (this.sections[sectionKey]) {
- sectionKey += this.sectionIndex++;
- }
-
- this.sections[sectionKey] = this.last = [];
- },
-
- endbuild: function (line) {
- return regend.test(line);
- }
-};
diff --git a/gulp-useref-weh/useref/lib/compactContent.js b/gulp-useref-weh/useref/lib/compactContent.js
deleted file mode 100644
index 9c58fc4..0000000
--- a/gulp-useref-weh/useref/lib/compactContent.js
+++ /dev/null
@@ -1,52 +0,0 @@
-'use strict';
-
-var parse = require('./parseBuildBlock'),
- resources = require('./resources'),
- sectionsJoinChar = resources.sectionsJoinChar,
- regComment = resources.regComment;
-
-function removeComments(lines) {
- return lines.join('\n').replace(regComment, '').split('\n');
-}
-
-module.exports = function (blocks) {
-
- var result = {};
-
- Object.keys(blocks).forEach(function (dest) {
- // Lines are the included scripts w/o the use blocks
- var lines = blocks[dest].slice(1, -1),
- parts = dest.split(sectionsJoinChar),
- type = parts[0],
-
- // output is the useref block file
- output = parts[1],
- build = parse(blocks[dest][0]),
- assets;
-
- // remove html comment blocks
- lines = removeComments(lines);
-
- // parse out the list of assets to handle, and update the grunt config accordingly
- assets = lines.map(function (tag) {
- // Allow white space and comment in build blocks by checking if this line has an asset or not
- // The asset is the string of the referenced source file
- return (tag.match(/(href|src)=(?:["']\W+\s*(?:\w+)\()?["']([^'"]+)['"]/) || [])[2];
- }).reduce(function (a, b) {
- return b ? a.concat(b) : a;
- }, []);
-
- result[type] = result[type] || {};
-
- result[type][output] = {
- assets: assets
- };
-
- if (build.alternateSearchPaths) {
- // Alternate search path
- result[type][output].searchPaths = build.alternateSearchPaths;
- }
- });
-
- return result;
-};
diff --git a/gulp-useref-weh/useref/lib/getBlocks.js b/gulp-useref-weh/useref/lib/getBlocks.js
deleted file mode 100644
index 46dbd87..0000000
--- a/gulp-useref-weh/useref/lib/getBlocks.js
+++ /dev/null
@@ -1,56 +0,0 @@
-'use strict';
-
-var buildBlockManager = require('./buildBlockManager'),
- parse = require('./parseBuildBlock'),
- resources = require('./resources');
-
-// Returns a hash object of all the directives for the given html. Results is
-// of the following form:
-//
-// {
-// 'css/site.css ':[
-// ' ',
-// ' ',
-// ' '
-// ],
-// 'js/head.js ': [
-// ' ',
-// ' ',
-// ' '
-// ],
-// 'js/site.js ': [
-// ' ',
-// ' ',
-// ' ',
-// ' '
-// ]
-// }
-//
-
-module.exports = function (body) {
- var lines = body.replace(/\r\n/g, '\n').split(/\n/),
- bbm = Object.create(buildBlockManager);
-
- bbm.sections = {};
-
- lines.forEach(function (l) {
- if (resources.regbuild.test(l)) {
- bbm.block = true;
-
- bbm.setSections(parse(l));
- }
-
- if (bbm.block && bbm.last) {
- bbm.last.push(l);
- }
-
- // switch back block flag when endbuild
- if (bbm.block && bbm.endbuild(l)) {
- bbm.block = false;
- }
- });
-
- // sections is an array of lines starting with the build block comment opener,
- // including all the references and including the build block comment closer.
- return bbm.sections;
-};
diff --git a/gulp-useref-weh/useref/lib/parseBuildBlock.js b/gulp-useref-weh/useref/lib/parseBuildBlock.js
deleted file mode 100644
index bbb5cef..0000000
--- a/gulp-useref-weh/useref/lib/parseBuildBlock.js
+++ /dev/null
@@ -1,14 +0,0 @@
-'use strict';
-
-var resources = require('./resources');
-
-module.exports = function (block) {
- var parts = block.match(resources.regbuild);
-
- return {
- type: parts[1],
- alternateSearchPaths: parts[2],
- target: parts[3] && parts[3].trim(),
- attbs: parts[4] && parts[4].trim()
- };
-};
diff --git a/gulp-useref-weh/useref/lib/refManager.js b/gulp-useref-weh/useref/lib/refManager.js
deleted file mode 100644
index d723ef2..0000000
--- a/gulp-useref-weh/useref/lib/refManager.js
+++ /dev/null
@@ -1,74 +0,0 @@
-'use strict';
-
-var parseBuildBlock = require('./parseBuildBlock'),
- bb = {};
-
-module.exports = {
- setBuildBlock: function (block, options) {
- var props = parseBuildBlock(block);
-
- bb.handler = options && options[props.type];
- bb.target = props.target || 'replace';
- bb.type = props.type;
- bb.attbs = props.attbs;
- bb.alternateSearchPaths = props.alternateSearchPaths;
- },
-
- transformCSSRefs: function (block, target, attbs) {
- var ref = '';
-
- // css link element regular expression
- // TODO: Determine if 'href' attribute is present.
- var regcss = /|\))/gmi;
-
- // Check to see if there are any css references at all.
- if (block.search(regcss) !== -1) {
- if (attbs) {
- ref = ' ';
- } else {
- ref = ' ';
- }
- }
-
- return ref;
- },
-
- transformJSRefs: function (block, target, attbs) {
- var ref = '';
-
- // script element regular expression
- // TODO: Detect 'src' attribute.
- var regscript = /|\))<[^<]*)*(?:<\/script>|\))/gmi;
-
- // Check to see if there are any js references at all.
- if (block.search(regscript) !== -1) {
- if (attbs) {
- ref = '';
- } else {
- ref = '';
- }
- }
-
- return ref;
- },
-
- getRef: function (block, blockContent, options) {
- var ref = '';
-
- this.setBuildBlock(block, options);
-
- if (bb.type === 'css') {
- ref = this.transformCSSRefs(blockContent, bb.target, bb.attbs);
- } else if (bb.type === 'js') {
- ref = this.transformJSRefs(blockContent, bb.target, bb.attbs);
- } else if (bb.type === 'remove') {
- ref = '';
- } else if (bb.handler) {
- ref = bb.handler(blockContent, bb.target, bb.attbs, bb.alternateSearchPaths);
- } else {
- ref = null;
- }
-
- return ref;
- }
-};
diff --git a/gulp-useref-weh/useref/lib/resources.js b/gulp-useref-weh/useref/lib/resources.js
deleted file mode 100644
index a43cb30..0000000
--- a/gulp-useref-weh/useref/lib/resources.js
+++ /dev/null
@@ -1,19 +0,0 @@
-'use strict';
-
-var exports = module.exports = {};
-
-// start build pattern:
-// $1 is the type, $2 is the alternate search path, $3 is the destination file name $4 extra attributes
-exports.regbuild = /(?:)|[^\s]+)?\s*(?:(.*))?\s*-->/;
-
-// end build pattern --
-exports.regend = /(?:/;
-
-// IE conditional comment pattern: $1 is the start tag and $2 is the end tag
-exports.regcc = /()/i;
-
-// Character used to create key for the `sections` object. This should probably be done more elegantly.
-exports.sectionsJoinChar = '\ue000';
-
-// strip all comments from HTML except for conditionals
-exports.regComment = /)(.|\n))*-->/g;
diff --git a/gulp-useref-weh/useref/lib/transformReferences.js b/gulp-useref-weh/useref/lib/transformReferences.js
deleted file mode 100644
index d8f83c3..0000000
--- a/gulp-useref-weh/useref/lib/transformReferences.js
+++ /dev/null
@@ -1,47 +0,0 @@
-'use strict';
-
-var resources = require('./resources'),
- refManager = require('./refManager');
-
-module.exports = function (blocks, content, options) {
- var replaced = content,
- refm = Object.create(refManager),
-
- // Determine the linefeed from the content
- linefeed = /\r\n/g.test(content) ? '\r\n' : '\n';
-
- // handle blocks
- Object.keys(blocks).forEach(function (key) {
- var block = blocks[key].join(linefeed),
- lines = block.split(linefeed),
- indent = (lines[0].match(/^\s*/) || [])[0],
- ccmatches = block.match(resources.regcc),
- blockContent = lines.slice(1, -1).join(linefeed),
- ref = refm.getRef(block, blockContent, options);
-
- if(options.changeExt) {
- for(var ext in options.changeExt) {
- var re = new RegExp('(<(?:script|link)\\b.*?\\b(?:src|href)\\s*=\\s*[\'"][^\'"]*?)'+ext.replace(".","\\.")
- +'([\'"])','gm');
- blockContent = blockContent.replace(re,"$1"+options.changeExt[ext]+"$2");
- }
- }
-
- if (ref !== null) {
- ref = indent + ref;
-
- // Reserve IE conditional comment if exist
- if (ccmatches) {
- ref = indent + ccmatches[1] + linefeed + ref + linefeed + indent + ccmatches[2];
- }
-
- if (options.noconcat) {
- replaced = replaced.replace(block, blockContent);
- } else {
- replaced = replaced.replace(block, ref);
- }
- }
- });
-
- return replaced;
-};
diff --git a/gulp-useref-weh/useref/package.json b/gulp-useref-weh/useref/package.json
deleted file mode 100644
index a21130f..0000000
--- a/gulp-useref-weh/useref/package.json
+++ /dev/null
@@ -1,43 +0,0 @@
-{
- "name": "useref",
- "version": "1.2.0",
- "description": "Parse build blocks in HTML files to replace references",
- "main": "index.js",
- "directories": {
- "test": "test"
- },
- "engines": {
- "node": ">=0.10.0"
- },
- "scripts": {
- "test": "mocha",
- "coverage": "nyc npm test && nyc report",
- "coveralls": "nyc npm test && nyc report --reporter=text-lcov | coveralls"
- },
- "files": [
- "index.js",
- "lib"
- ],
- "keywords": [
- "build",
- "blocks",
- "build",
- "comments",
- "replace",
- "scripts",
- "link",
- "ref"
- ],
- "author": "Jonathan Kemp (http://jonkemp.com/)",
- "license": "MIT",
- "devDependencies": {
- "chai": "^3.4.1",
- "coveralls": "^2.11.4",
- "gulp": "^3.9.0",
- "gulp-eslint": "^3.0.1",
- "gulp-mocha": "^3.0.1",
- "mocha": "*",
- "nyc": "^8.1.0"
- },
- "repository": "jonkemp/useref"
-}
diff --git a/gulp-useref-weh/useref/test/test.js b/gulp-useref-weh/useref/test/test.js
deleted file mode 100644
index 38e1e02..0000000
--- a/gulp-useref-weh/useref/test/test.js
+++ /dev/null
@@ -1,251 +0,0 @@
-/* eslint-disable */
-/* global describe, it */
-'use strict';
-var expect = require('chai').expect;
-var fs = require('fs');
-var path = require('path');
-var useRef = require('../index');
-
-function djoin(p) {
- return path.normalize(path.join(__dirname, p));
-}
-function fread(f) {
- return fs.readFileSync(f, { encoding: 'utf-8'});
-}
-
-describe('html-ref-replace', function() {
-
- it('should replace reference in css block and return replaced files', function() {
- var result = useRef(fread(djoin('testfiles/01.html')));
- expect(result[0]).to.equal(fread(djoin('testfiles/01-expected.html')));
- expect(result[1]).to.eql({ css: { '/css/combined.css': { 'assets': [ '/css/one.css', '/css/two.css' ] }}});
- });
-
- it('should replace reference in js block and return replaced files', function() {
- var result = useRef(fread(djoin('testfiles/02.html')));
- expect(result[0]).to.equal(fread(djoin('testfiles/02-expected.html')));
- expect(result[1]).to.eql({ js: { 'scripts/combined.concat.min.js': { 'assets': [ 'scripts/this.js', 'scripts/that.js' ] }}});
- });
-
- it('should not replace reference in css block with noconcat option', function() {
- var result = useRef(fread(djoin('testfiles/01.html')), { noconcat: true });
- expect(result[0]).to.equal(fread(djoin('testfiles/noconcat-css.html')));
- });
-
- it('should not replace reference in js block with noconcat option', function() {
- var result = useRef(fread(djoin('testfiles/02.html')), { noconcat: true });
- expect(result[0]).to.equal(fread(djoin('testfiles/noconcat-js.html')));
- });
-
- it('should remove `remove` block', function() {
- var result = useRef(fread(djoin('testfiles/09.html')));
- expect(result[0]).to.equal(fread(djoin('testfiles/09-expected.html')));
- expect(result[1]).to.eql({ remove: { '0': { 'assets': [ 'scripts/this.js', 'scripts/that.js' ] }}});
- });
-
- it('should remove multiple `remove` blocks', function() {
- var result = useRef(fread(djoin('testfiles/10.html')));
- expect(result[0]).to.equal(fread(djoin('testfiles/10-expected.html')));
- expect(result[1]).to.eql({ remove: { '0': { 'assets': [ 'scripts/this.js', 'scripts/that.js' ] }, '1': { 'assets': [ '/css/one.css', '/css/two.css' ] } }});
- });
-
- it('should handle comments and whitespace in blocks', function() {
- var result = useRef(fread(djoin('testfiles/03.html')));
- expect(result[0]).to.equal(fread(djoin('testfiles/03-expected.html')));
- expect(result[1]).to.eql({ js: { 'scripts/combined.concat.min.js': { 'assets': [ 'scripts/this.js', 'scripts/that.js' ] }}});
- });
-
- it('should handle comments and whitespace in blocks (without trailing space)', function() {
- var result = useRef(fread(djoin('testfiles/03b.html')));
- expect(result[0]).to.equal(fread(djoin('testfiles/03-expected.html')));
- expect(result[1]).to.eql({ js: { 'scripts/combined.concat.min.js': { 'assets': [ 'scripts/this.js', 'scripts/that.js' ] }}});
- });
-
- it('should ignore script in comments (multi line)', function() {
- var result = useRef(fread(djoin('testfiles/03c.html')));
- expect(result[0]).to.equal(fread(djoin('testfiles/03-expected.html')));
- expect(result[1]).to.eql({ js: { 'scripts/combined.concat.min.js': { 'assets': [ 'scripts/this.js' ] }}});
- });
-
- it('should ignore script in comments (single line with "
-
-
-
-
-