Skip to content
This repository was archived by the owner on Jan 14, 2020. It is now read-only.

chore: rename bundle #17

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion bower.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "angular-nav-login",
"description": "Login components for NAV applications",
"main": "dist/bundle.js",
"main": "dist/angular-nav-login.js",
"authors": [
"Tom Vincent <[email protected]>"
],
Expand Down
113 changes: 0 additions & 113 deletions dist/bundle.js → dist/angular-nav-login.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,119 +5,6 @@

function __commonjs(fn, module) { return module = { exports: {} }, fn(module, module.exports), module.exports; }

var asyncGenerator = function () {
function AwaitValue(value) {
this.value = value;
}

function AsyncGenerator(gen) {
var front, back;

function send(key, arg) {
return new Promise(function (resolve, reject) {
var request = {
key: key,
arg: arg,
resolve: resolve,
reject: reject,
next: null
};

if (back) {
back = back.next = request;
} else {
front = back = request;
resume(key, arg);
}
});
}

function resume(key, arg) {
try {
var result = gen[key](arg);
var value = result.value;

if (value instanceof AwaitValue) {
Promise.resolve(value.value).then(function (arg) {
resume("next", arg);
}, function (arg) {
resume("throw", arg);
});
} else {
settle(result.done ? "return" : "normal", result.value);
}
} catch (err) {
settle("throw", err);
}
}

function settle(type, value) {
switch (type) {
case "return":
front.resolve({
value: value,
done: true
});
break;

case "throw":
front.reject(value);
break;

default:
front.resolve({
value: value,
done: false
});
break;
}

front = front.next;

if (front) {
resume(front.key, front.arg);
} else {
back = null;
}
}

this._invoke = send;

if (typeof gen.return !== "function") {
this.return = undefined;
}
}

if (typeof Symbol === "function" && Symbol.asyncIterator) {
AsyncGenerator.prototype[Symbol.asyncIterator] = function () {
return this;
};
}

AsyncGenerator.prototype.next = function (arg) {
return this._invoke("next", arg);
};

AsyncGenerator.prototype.throw = function (arg) {
return this._invoke("throw", arg);
};

AsyncGenerator.prototype.return = function (arg) {
return this._invoke("return", arg);
};

return {
wrap: function (fn) {
return function () {
return new AsyncGenerator(fn.apply(this, arguments));
};
},
await: function (value) {
return new AwaitValue(value);
}
};
}();

var classCallCheck = function (instance, Constructor) {
if (!(instance instanceof Constructor)) {
throw new TypeError("Cannot call a class as a function");
Expand Down
1 change: 1 addition & 0 deletions dist/angular-nav-login.min.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 0 additions & 1 deletion dist/bundle.min.js

This file was deleted.

12 changes: 8 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
{
"name": "angular-nav-login",
"description": "Login components for NAV applications",
"main": "dist/bundle.js",
"main": "dist/angular-nav-login.js",
"scripts": {
"prebuild": "rm -rf dist && mkdir dist",
"build": "rollup --config",
"postbuild": "uglifyjs dist/bundle.js --compress --mangle --output dist/bundle.min.js",
"postbuild": "uglifyjs dist/angular-nav-login.js --compress --mangle --output dist/angular-nav-login.min.js",
"test": "standard",
"prepublish-dist": "npm run build",
"publish-dist": "publish-dist --author-name 'Field Bot' --author-email '[email protected]'",
Expand Down Expand Up @@ -51,7 +52,10 @@
"env": {
"browser": true,
"jasmine": true
}
},
"ignore": [
"dist"
]
},
"config": {
"ghooks": {
Expand All @@ -60,7 +64,7 @@
}
},
"files": [
"dist/bundle.js"
"dist"
],
"repository": {
"type": "git",
Expand Down
4 changes: 3 additions & 1 deletion rollup.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,11 @@ import babel from 'rollup-plugin-babel'
import commonjs from 'rollup-plugin-commonjs'
import nodeResolve from 'rollup-plugin-node-resolve'

const pkg = require('./package.json')

export default {
entry: 'src/index.js',
dest: 'dist/bundle.js',
dest: pkg.main,
external: ['angular'],
format: 'iife',
plugins: [
Expand Down