Permalink
Browse files

jspm compatibility (#56)

* Import Index File

* Fix Linting

* Test Jspm, Browserify & Webpack Seperate

* remove config file

* Ignore JSPM Config

* Fix package.json

* always continue with jspm install

* newest compiled dist files
  • Loading branch information...
maennchen committed Apr 27, 2016
1 parent cfa0c70 commit 78d48d2a040857ae7af880060cea025820d7ffde
@@ -0,0 +1,7 @@
node_modules/**
bower_components/**
jspm_packages/**
coverage/**
dist/**
demo/**
config.js
@@ -1,4 +1,6 @@
/node_modules/
/bower_components/
/coverage/
*.log
*.log
/jspm_packages/
/config.js
@@ -1,3 +1,7 @@
node_modules/**
bower_components/**
jspm_packages/**
coverage/**
dist/**
demo/**
config.js

Large diffs are not rendered by default.

Oops, something went wrong.
@@ -582,21 +582,21 @@ module.exports = {
"use strict";function _interopRequireDefault(t){return t&&t.__esModule?t:{"default":t}}function HttpInterceptorConfiguration(t){t.interceptors.push(_resourceHttpInterceptor2["default"])}Object.defineProperty(exports,"__esModule",{value:!0}),exports["default"]=HttpInterceptorConfiguration;var _resourceHttpInterceptor=require("./resource-http-interceptor.factory"),_resourceHttpInterceptor2=_interopRequireDefault(_resourceHttpInterceptor);HttpInterceptorConfiguration.$inject=["$httpProvider"];
},{"./resource-http-interceptor.factory":12}],11:[function(require,module,exports){
"use strict";function _interopRequireDefault(e){return e&&e.__esModule?e:{"default":e}}Object.defineProperty(exports,"__esModule",{value:!0});var _resource=require("../resource"),_resource2=_interopRequireDefault(_resource),_configuration=require("../configuration"),_configuration2=_interopRequireDefault(_configuration),_httpInterception=require("./http-interception.config"),_httpInterception2=_interopRequireDefault(_httpInterception),MODULE_NAME="angular-hal.http-interception";angular.module(MODULE_NAME,[_resource2["default"],_configuration2["default"]]).config(_httpInterception2["default"]),exports["default"]=MODULE_NAME;
"use strict";function _interopRequireDefault(e){return e&&e.__esModule?e:{"default":e}}Object.defineProperty(exports,"__esModule",{value:!0});var _index=require("../resource/index"),_index2=_interopRequireDefault(_index),_index3=require("../configuration/index"),_index4=_interopRequireDefault(_index3),_httpInterception=require("./http-interception.config"),_httpInterception2=_interopRequireDefault(_httpInterception),MODULE_NAME="angular-hal.http-interception";angular.module(MODULE_NAME,[_index2["default"],_index4["default"]]).config(_httpInterception2["default"]),exports["default"]=MODULE_NAME;
},{"../configuration":9,"../resource":15,"./http-interception.config":10}],12:[function(require,module,exports){
},{"../configuration/index":9,"../resource/index":15,"./http-interception.config":10}],12:[function(require,module,exports){
"use strict";function ResourceHttpInterceptorFactory(e,t){function r(e){return"undefined"==typeof e.headers.Accept?e.headers.Accept=CONTENT_TYPE:e.headers.Accept=[CONTENT_TYPE,e.headers.Accept].join(", "),e}function n(t){try{if((0,_contentType.parse)(t.headers("Content-Type")).type===CONTENT_TYPE)return o(t)}catch(r){}return t.config.forceHal?o(t):"application/json"!==t.headers("Content-Type")&&null!==t.headers("Content-Type")||!e.forceJSONResource?t:o(t)}function o(e){return new t(e.data,e)}return{request:r,response:n}}Object.defineProperty(exports,"__esModule",{value:!0}),exports["default"]=ResourceHttpInterceptorFactory;var _contentType=require("content-type"),CONTENT_TYPE="application/hal+json";ResourceHttpInterceptorFactory.$inject=["$halConfiguration","Resource"];
},{"content-type":1}],13:[function(require,module,exports){
"use strict";function _interopRequireDefault(e){return e&&e.__esModule?e:{"default":e}}Object.defineProperty(exports,"__esModule",{value:!0});var _httpInterception=require("./http-interception"),_httpInterception2=_interopRequireDefault(_httpInterception),_client=require("./client"),_client2=_interopRequireDefault(_client),MODULE_NAME="angular-hal";angular.module(MODULE_NAME,[_httpInterception2["default"],_client2["default"]]),exports["default"]=MODULE_NAME;
"use strict";function _interopRequireDefault(e){return e&&e.__esModule?e:{"default":e}}Object.defineProperty(exports,"__esModule",{value:!0});var _index=require("./http-interception/index"),_index2=_interopRequireDefault(_index),_index3=require("./client/index"),_index4=_interopRequireDefault(_index3),MODULE_NAME="angular-hal";angular.module(MODULE_NAME,[_index2["default"],_index4["default"]]),exports["default"]=MODULE_NAME;
},{"./client":6,"./http-interception":11}],14:[function(require,module,exports){
},{"./client/index":6,"./http-interception/index":11}],14:[function(require,module,exports){
"use strict";function _interopRequireDefault(e){return e&&e.__esModule?e:{"default":e}}function HalResourceClientFactory(e,r,n){function t(t,u){function i(r,i,a,l,d){var o;if(r=r||"GET",i=i||n.selfLink,a=a||{},l=l||null,d=d||{},"GET"===r&&i===n.selfLink)return e.resolve(t);if(t.$hasEmbedded(i)&&Array.isArray(u[i])){o=[];for(var s=0;s<u[i].length;s++)o.push(u[i][s].$request().$request(r,"self",a,l,d));return e.all(o)}if(t.$hasEmbedded(i))return u[i].$request().$request(r,"self",a,l,d);if(t.$hasLink(i)){var f=t.$href(i,a);if(angular.extend(d,{method:r,data:l}),Array.isArray(f)){o=[];for(var c=0;c<f.length;c++)o.push(y(angular.extend({},d,{url:f[c]})));return e.all(o)}return y(angular.extend({},d,{url:t.$href(i,a)}))}return e.reject(new Error('link "'+i+'" is undefined'))}function a(e,r,n){return i("GET",e,r,void 0,n)}function l(e,r,n,t){return i("POST",e,r,n,t)}function d(e,r,n,t){return i("PUT",e,r,n,t)}function o(e,r,n,t){return i("PATCH",e,r,n,t)}function s(e,r,n){return i("DELETE",e,r,void 0,n)}function f(e,r,n,t){return t=t||{},t.headers=t.headers||{},t.headers.Link=n.map($),i("LINK",e,r,void 0,t)}function c(e,r,n,t){return t=t||{},t.headers=t.headers||{},t.headers.Link=n.map($),i("UNLINK",e,r,void 0,t)}function $(e){return e.toString()}var h=this,y=r.get("$http");!function(){(0,_extendReadOnly2["default"])(h,{$request:i,$get:a,$post:l,$put:d,$patch:o,$delete:s,$del:s,$link:f,$unlink:c})}()}return t}Object.defineProperty(exports,"__esModule",{value:!0}),exports["default"]=HalResourceClientFactory;var _extendReadOnly=require("../utility/extend-read-only"),_extendReadOnly2=_interopRequireDefault(_extendReadOnly);HalResourceClientFactory.$inject=["$q","$injector","$halConfiguration"];
},{"../utility/extend-read-only":18}],15:[function(require,module,exports){
"use strict";function _interopRequireDefault(e){return e&&e.__esModule?e:{"default":e}}Object.defineProperty(exports,"__esModule",{value:!0});var _configuration=require("../configuration"),_configuration2=_interopRequireDefault(_configuration),_resource=require("./resource.factory"),_resource2=_interopRequireDefault(_resource),_halResourceClient=require("./hal-resource-client.factory"),_halResourceClient2=_interopRequireDefault(_halResourceClient),MODULE_NAME="angular-hal.resource";angular.module(MODULE_NAME,[_configuration2["default"]]).factory("Resource",_resource2["default"]).factory("HalResourceClient",_halResourceClient2["default"]),exports["default"]=MODULE_NAME;
"use strict";function _interopRequireDefault(e){return e&&e.__esModule?e:{"default":e}}Object.defineProperty(exports,"__esModule",{value:!0});var _index=require("../configuration/index"),_index2=_interopRequireDefault(_index),_resource=require("./resource.factory"),_resource2=_interopRequireDefault(_resource),_halResourceClient=require("./hal-resource-client.factory"),_halResourceClient2=_interopRequireDefault(_halResourceClient),MODULE_NAME="angular-hal.resource";angular.module(MODULE_NAME,[_index2["default"]]).factory("Resource",_resource2["default"]).factory("HalResourceClient",_halResourceClient2["default"]),exports["default"]=MODULE_NAME;
},{"../configuration":9,"./hal-resource-client.factory":14,"./resource.factory":16}],16:[function(require,module,exports){
},{"../configuration/index":9,"./hal-resource-client.factory":14,"./resource.factory":16}],16:[function(require,module,exports){
"use strict";function _interopRequireDefault(e){return e&&e.__esModule?e:{"default":e}}function ResourceFactory(e,t){function r(n,i){function u(){for(var e in n)n.hasOwnProperty(e)&&(d(e)||(0,_defineReadOnly2["default"])(A,e,n[e]))}function o(){"object"===_typeof(n[t.linksAttribute])&&Object.keys(n[t.linksAttribute]).forEach(function(e){var r=n[t.linksAttribute][e];g[e]=(0,_normalizeLink2["default"])(i.config.url,r)})}function f(){"object"===_typeof(n[t.embeddedAttribute])&&Object.keys(n[t.embeddedAttribute]).forEach(function(e){l(e,n[t.embeddedAttribute][e])})}function a(){R=new e(A,k)}function l(e,t){return Array.isArray(t)?(k[e]=[],void t.forEach(function(t){k[e].push(new r(t,i))})):void(k[e]=new r(t,i))}function d(e){for(var r=0;r<t.ignoreAttributePrefixes.length;r++){if(e.substr(0,1)===t.ignoreAttributePrefixes[r])return!0;if(e===t.linksAttribute||e===t.embeddedAttribute)return!0}return!1}function c(e){return"undefined"!=typeof g[e]}function y(e){return"undefined"!=typeof k[e]}function s(e){return c(e)||y(e)}function b(e,r){if(!c(e))throw new Error('link "'+e+'" is undefined');var n=g[e],i=n.href;if(Array.isArray(n)){i=[];for(var u=0;u<n.length;u++){var o=n[u],f=o.href;"undefined"!=typeof o.templated&&o.templated&&(f=(0,_generateUrl2["default"])(o.href,r)),f=t.urlTransformer(f),i.push(f)}}else"undefined"!=typeof n.templated&&n.templated&&(i=(0,_generateUrl2["default"])(n.href,r)),i=t.urlTransformer(i);return i}function p(e){if(!c(e))throw new Error('link "'+e+'" is undefined');var t=g[e];return t}function _(e){for(var r=0;r<t.ignoreAttributePrefixes.length;r++){var i=t.ignoreAttributePrefixes[r]+e;return n[i]}}function m(){return i}function h(){return R}var R,A=this,g={},k={};!function(){"object"===("undefined"==typeof n?"undefined":_typeof(n))&&null!==n||(n={}),u(),f(),o(),a(),(0,_extendReadOnly2["default"])(A,{$hasLink:c,$hasEmbedded:y,$has:s,$href:b,$meta:_,$link:p,$request:h,$response:m})}()}return r}Object.defineProperty(exports,"__esModule",{value:!0});var _typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol?"symbol":typeof e};exports["default"]=ResourceFactory;var _extendReadOnly=require("../utility/extend-read-only"),_extendReadOnly2=_interopRequireDefault(_extendReadOnly),_defineReadOnly=require("../utility/define-read-only"),_defineReadOnly2=_interopRequireDefault(_defineReadOnly),_generateUrl=require("../utility/generate-url"),_generateUrl2=_interopRequireDefault(_generateUrl),_normalizeLink=require("../utility/normalize-link"),_normalizeLink2=_interopRequireDefault(_normalizeLink);ResourceFactory.$inject=["HalResourceClient","$halConfiguration"];
},{"../utility/define-read-only":17,"../utility/extend-read-only":18,"../utility/generate-url":19,"../utility/normalize-link":20}],17:[function(require,module,exports){
@@ -1,5 +1,5 @@
/* globals module: true, require: true */
/* jshint node: true */
/* eslint-env node */
'use strict';
module.exports = function(config) {
@@ -0,0 +1,38 @@
/* jshint node:true */
/* eslint-env node */
'use strict';
module.exports = function(config) {
config.set({
basePath: '.',
frameworks: ['jspm', 'jasmine'],
files: [
'node_modules/angular/angular.js',
'node_modules/angular-mocks/angular-mocks.js',
// 'test/**/*.spec.js',
],
reporters: [
'dots',
],
jspm: {
loadFiles: [
'test/**/*.spec.js',
],
serveFiles: [
'test/**/!(*.spec).js',
'src/**/*.js',
],
},
proxies: {
'/local/': 'http://localhost:8080/',
},
autoWatch: true,
browsers: ['PhantomJS']
});
};
@@ -0,0 +1,64 @@
/* jshint node: true */
/* eslint-env node */
'use strict';
module.exports = function(config) {
config.set({
basePath: '.',
frameworks: ['jasmine'],
files: [
'node_modules/angular/angular.js',
'node_modules/angular-mocks/angular-mocks.js',
'test/**/*.spec.js',
],
reporters: [
'dots',
],
preprocessors: {
'test/**/*.js': [
'webpack',
],
},
webpack: {
module: {
loaders: [
{
test: /\.js$/,
exclude: /node_modules/,
loader: 'babel',
query: {
presets: [
'es2015',
],
},
},
],
},
},
webpackMiddleware: {
noInfo: true,
},
/*browserify: {
debug: true,
transform: [
[
'babelify',
{presets: ['es2015']}
],
],
},*/
proxies: {
'/local/': 'http://localhost:8080/'
},
autoWatch: true,
browsers: ['PhantomJS']
});
};
@@ -24,30 +24,51 @@
},
"devDependencies": {
"angular-mocks": "~1",
"babel-loader": "^6.2.4",
"babel-preset-es2015": "^6.6.0",
"babelify": "^7.2.0",
"browserify": "^13.0.0",
"eslint": "^2.3.0",
"jasmine-core": "^2.4.1",
"jshint": "^2.9.1",
"jshint": "^2.9.2",
"jshint-stylish": "^2.1.0",
"jspm": "^0.16.33",
"karma": "^0.13.21",
"karma-browserify": "^5.0.3",
"karma-jasmine": "^0.3.7",
"karma-jspm": "^2.1.0",
"karma-phantomjs-launcher": "^1.0.0",
"karma-webpack": "^1.7.0",
"phantomjs-prebuilt": "^2.1.4",
"uglifyify": "^3.0.1",
"watchify": "^3.7.0"
"watchify": "^3.7.0",
"webpack": "^1.13.0"
},
"scripts": {
"build:dev": "./node_modules/.bin/browserify src/index.js -o dist/angular-hal.map.js -t [ babelify --presets [ es2015 ] ] --s angularHal -d",
"build:prod": "./node_modules/.bin/browserify src/index.js -o dist/angular-hal.min.js -t [ babelify --presets [ es2015 ] ] -t [ uglifyify --mangle --compress [ --sequences --dead_code --booleans ] ] --s angularHal",
"build:watch": "./node_modules/.bin/watchify src/index.js -o dist/angular-hal.map.js -t [ babelify --presets [ es2015 ] ] --s angularHal -d -v",
"compile": "echo Build Dev; npm run build:dev; echo Build Prod; npm run build:prod;",
"jshint": "./node_modules/.bin/jshint {src,test}",
"eslint": "./node_modules/.bin/eslint {src,test}",
"karma:single": "./node_modules/.bin/karma start karma.conf.js --single-run",
"karma:watch": "./node_modules/.bin/karma start karma.conf.js",
"test": "echo Running Karma Tests; npm run karma:single; echo Running JSHint; npm run jshint; echo Running Eslint; npm run eslint;"
"jshint": "./node_modules/.bin/jshint .",
"eslint": "./node_modules/.bin/eslint .",
"karma:browserify:single": "./node_modules/.bin/karma start karma.browserify.conf.js --single-run",
"karma:browserify:watch": "./node_modules/.bin/karma start karma.browserify.conf.js",
"karma:jspm:single": "./node_modules/.bin/jspm install -y && ./node_modules/.bin/karma start karma.jspm.conf.js --single-run",
"karma:jspm:watch": "./node_modules/.bin/jspm install -y && ./node_modules/.bin/karma start karma.jspm.conf.js",
"karma:webpack:single": "./node_modules/.bin/karma start karma.webpack.conf.js --single-run",
"karma:webpack:watch": "./node_modules/.bin/karma start karma.webpack.conf.js",
"karma:single": "npm run karma:browserify:single && npm run karma:jspm:single && npm run karma:webpack:single",
"test": "npm run karma:single && npm run jshint && npm run eslint"
},
"jspm": {
"dependencies": {
"content-type": "npm:content-type@^1.0.1",
"rfc6570": "npm:rfc6570@^0.1.8"
},
"devDependencies": {
"babel": "npm:babel-core@^5.8.24",
"babel-runtime": "npm:babel-runtime@^5.8.24",
"core-js": "npm:core-js@^1.1.4"
}
}
}
@@ -2,8 +2,8 @@
const MODULE_NAME = 'angular-hal.http-interception';
import resource from '../resource';
import configuration from '../configuration';
import resource from '../resource/index';
import configuration from '../configuration/index';
import HttpInterceptorConfiguration from './http-interception.config';
@@ -2,8 +2,8 @@
const MODULE_NAME = 'angular-hal';
import httpInterception from './http-interception';
import client from './client';
import httpInterception from './http-interception/index';
import client from './client/index';
// Combine needed Modules
angular
@@ -3,7 +3,7 @@
const MODULE_NAME = 'angular-hal.resource';
import configuration from '../configuration';
import configuration from '../configuration/index';
import ResourceFactory from './resource.factory';
import HalResourceClientFactory from './hal-resource-client.factory';
@@ -1,6 +1,6 @@
'use strict';
import angularHal from '../src';
import angularHal from '../src/index';
describe('simple', function () {
var $http
@@ -1,6 +1,6 @@
'use strict';
import angularHal from '../../src';
import angularHal from '../../src/index';
import { toObject } from '../helpers';
describe('special attribute names', function () {
@@ -1,6 +1,6 @@
'use strict';
import angularHal from '../../src';
import angularHal from '../../src/index';
import { toObject } from '../helpers';
describe('halbuilder test resources', function () {
@@ -1,6 +1,6 @@
'use strict';
import angularHal from '../../src';
import angularHal from '../../src/index';
describe('special attribute names', function () {
var $http
@@ -1,6 +1,6 @@
'use strict';
import angularHal from '../../src';
import angularHal from '../../src/index';
import { toObject } from '../helpers';
describe('simple', function () {
@@ -1,6 +1,6 @@
'use strict';
import angularHal from '../../src';
import angularHal from '../../src/index';
import { toObject } from '../helpers';
describe('simple', function () {
@@ -1,7 +1,6 @@
'use strict';
import angularHal from '../src';
import { toObject } from './helpers';
import angularHal from '../src/index';
describe('resource', function () {
beforeEach(angular.mock.module(angularHal, function($halConfigurationProvider) {

0 comments on commit 78d48d2

Please sign in to comment.