diff --git a/@salix/app/src/app.js b/@salix/app/src/app.js index a4cf9ee7c..6f2c434cc 100644 --- a/@salix/app/src/app.js +++ b/@salix/app/src/app.js @@ -1,3 +1,6 @@ import {bootstrap} from './bootstrap'; -import * as spliting from './spliting' +import * as spliting from './spliting'; +import * as routes from './routes'; + + bootstrap(); diff --git a/@salix/app/src/bootstrap.js b/@salix/app/src/bootstrap.js index cb1dcaf4a..0c9980703 100644 --- a/@salix/app/src/bootstrap.js +++ b/@salix/app/src/bootstrap.js @@ -13,5 +13,5 @@ export const bootstrap = () => { if (!_element) { throw new Error("element is not defined"); } - ng.bootstrap(_element, [NAME]); + ng.bootstrap(_element, [NAME]); }; \ No newline at end of file diff --git a/@salix/app/src/package.json b/@salix/app/src/package.json new file mode 100644 index 000000000..626726422 --- /dev/null +++ b/@salix/app/src/package.json @@ -0,0 +1,10 @@ +{ + "name": "@salix/core", + "version": "0.0.0", + "description": "", + "main": "index.js", + "repository": { + "type": "git", + "url": "http://git.verdnatura.es:/salix" + } +} diff --git a/@salix/app/src/routes.js b/@salix/app/src/routes.js new file mode 100644 index 000000000..444663d47 --- /dev/null +++ b/@salix/app/src/routes.js @@ -0,0 +1,24 @@ +import * as core from '@salix/core'; +import * as spliting from './spliting'; + + +core.module.config(function($stateProvider, $urlRouterProvider) { + + $urlRouterProvider.otherwise("/"); + + $stateProvider + .state('index', { + url: "/index", + component:'customer.add', + templateProvider: function(){ + console.log("hello"); + }, + resolve: { + loader: function($ocLazyLoad, $q){ + return $q((resolve) => { + spliting.crud($ocLazyLoad, resolve); + }); + } + } + }) +}); diff --git a/@salix/app/src/spliting.js b/@salix/app/src/spliting.js index a672cea56..052620631 100644 --- a/@salix/app/src/spliting.js +++ b/@salix/app/src/spliting.js @@ -1,19 +1,20 @@ -const crud = () => { +export const crud = (lazy, resolve) => { require.ensure([], () => { - require('@salix/crud') + var module = require('@salix/crud'); + resolve(lazy.load({name:'crud'})); }, "salix.crud"); }; -const compras = () => { +export const compras = () => { require.ensure([], () => { require('@salix/compras') }, "salix.compras"); }; -const ventas = () => { +export const ventas = () => { require.ensure([], () => { require('@salix/ventas') }, "salix.ventas"); }; -const pagos = () => { +export const pagos = () => { require.ensure([], () => { require('@salix/pagos') }, "salix.pagos"); diff --git a/@salix/core/src/core.js b/@salix/core/src/core.js index 511f8e75b..76e417692 100644 --- a/@salix/core/src/core.js +++ b/@salix/core/src/core.js @@ -1,7 +1,7 @@ /** * export public module */ -export {NAME} from './module'; +export * from './module'; export * from './util'; export {NAME as RESOLVEDEFAULTCOMPONENT, ResolveDefaultComponent} from './resolveDefaultComponents' export {NAME as INTERPOLATE,Interpolate} from './interpolate' diff --git a/@salix/core/src/module.js b/@salix/core/src/module.js index 43b13f444..a3391528c 100644 --- a/@salix/core/src/module.js +++ b/@salix/core/src/module.js @@ -5,3 +5,4 @@ const DEPENDENCIES = getVendorDependencies(vendors) export const NAME = getModuleName('core'); export const module = vendors.ng.module(NAME,DEPENDENCIES); + diff --git a/@salix/crud/.gitignore b/@salix/crud/.gitignore new file mode 100644 index 000000000..b512c09d4 --- /dev/null +++ b/@salix/crud/.gitignore @@ -0,0 +1 @@ +node_modules \ No newline at end of file diff --git a/@salix/crud/index.js b/@salix/crud/index.js index 9044df30e..9d8de2297 100644 --- a/@salix/crud/index.js +++ b/@salix/crud/index.js @@ -1,3 +1 @@ -import * as vendors from '@salix/vendor' -import * as core from '@salix/core' -console.log('crud'); \ No newline at end of file +export * from './src/crud'; \ No newline at end of file diff --git a/@salix/crud/package.json b/@salix/crud/package.json new file mode 100644 index 000000000..3f8fd3f3c --- /dev/null +++ b/@salix/crud/package.json @@ -0,0 +1,10 @@ +{ + "name": "@salix/crud", + "version": "0.0.0", + "description": "", + "main": "index.js", + "repository": { + "type": "git", + "url": "http://git.verdnatura.es:/salix" + } +} diff --git a/@salix/crud/src/crud.js b/@salix/crud/src/crud.js new file mode 100644 index 000000000..7d4627b16 --- /dev/null +++ b/@salix/crud/src/crud.js @@ -0,0 +1,4 @@ +export * from './module'; +export * from './customer/routes'; + +export {NAME as CUSTOMER_INDEX, COMPONENT as CUSTOMER_INDEX_COMPONENT} from './customer/index' \ No newline at end of file diff --git a/@salix/crud/src/customer/index/index.html b/@salix/crud/src/customer/index/index.html new file mode 100644 index 000000000..8470ef54c --- /dev/null +++ b/@salix/crud/src/customer/index/index.html @@ -0,0 +1 @@ +
index
\ No newline at end of file diff --git a/@salix/crud/src/customer/index/index.js b/@salix/crud/src/customer/index/index.js new file mode 100644 index 000000000..6a33f5473 --- /dev/null +++ b/@salix/crud/src/customer/index/index.js @@ -0,0 +1,16 @@ +import template from './index.html'; +import {module} from '../../module'; + +export const NAME = 'customer.add'; +export const COMPONENT = { + template: template, + controller: function() { + this.user = {name: 'world'}; + } +}; + +module.component(NAME, COMPONENT); +module.factory('hello',function(){return true}); +module.controller('pepito',function(hello){ + console.log(hello); +}); diff --git a/@salix/crud/src/customer/routes.js b/@salix/crud/src/customer/routes.js new file mode 100644 index 000000000..92032b153 --- /dev/null +++ b/@salix/crud/src/customer/routes.js @@ -0,0 +1,31 @@ +import * as core from '@salix/core'; +import * as index from './index'; + +core.module.config(function($stateProvider, $urlRouterProvider) { + + $urlRouterProvider.otherwise("/"); + + $stateProvider + .state('index', { + url: "/index", + component: index.CUSTOMER_INDEX, + resolve:{ + load:function(){ + console.log('hello'); + } + } + }) + .state('add', { + url: "/add", + template: "
add
" + }) + .state('edit', { + url: "/edit", + template: "
edit
" + }) + .state('delete', { + url: "/delete", + template: "
delete
" + }) + +}); diff --git a/@salix/crud/src/module.js b/@salix/crud/src/module.js new file mode 100644 index 000000000..39bbd2108 --- /dev/null +++ b/@salix/crud/src/module.js @@ -0,0 +1,12 @@ +import * as vendors from '@salix/vendor'; +import * as core from '@salix/core'; + +//import {getModuleName,getVendorDependencies} from './util'; + +export const NAME = 'crud'; +export const module = vendors.ng.module(NAME,[]); + + + + + diff --git a/index.html b/index.html index 48130766f..0190f001a 100644 --- a/index.html +++ b/index.html @@ -7,6 +7,11 @@
{{1+1}} +
+ index + add + edit + delete
diff --git a/npm-debug.log b/npm-debug.log deleted file mode 100644 index dc027a8b7..000000000 --- a/npm-debug.log +++ /dev/null @@ -1,26 +0,0 @@ -0 info it worked if it ends with ok -1 verbose cli [ '/usr/bin/nodejs', '/usr/bin/npm', 'run', 'dev' ] -2 info using npm@1.4.21 -3 info using node@v4.4.7 -4 verbose run-script [ 'predev', 'dev', 'postdev' ] -5 info predev salix-app@1.0.0 -6 info dev salix-app@1.0.0 -7 verbose unsafe-perm in lifecycle true -8 info salix-app@1.0.0 Failed to exec dev script -9 error salix-app@1.0.0 dev: `webpack --progress --colors --watch` -9 error Exit status 1 -10 error Failed at the salix-app@1.0.0 dev script. -10 error This is most likely a problem with the salix-app package, -10 error not with npm itself. -10 error Tell the author that this fails on your system: -10 error webpack --progress --colors --watch -10 error You can get their info via: -10 error npm owner ls salix-app -10 error There is likely additional logging output above. -11 error System Linux 4.7.0-1-amd64 -12 error command "/usr/bin/nodejs" "/usr/bin/npm" "run" "dev" -13 error cwd /home/juan/Proyectos/salix -14 error node -v v4.4.7 -15 error npm -v 1.4.21 -16 error code ELIFECYCLE -17 verbose exit [ 1, true ] diff --git a/package.json b/package.json index 083501fea..701721c00 100644 --- a/package.json +++ b/package.json @@ -9,9 +9,9 @@ "url": "http://git.verdnatura.es:/salix" }, "dependencies": { - "angular": "^1.5.8", - "angular-ui-router": "^0.3.1", - "oclazyload": "^1.0.9" + "angular": "^1.4.1", + "angular-ui-router": "^0.2.15", + "oclazyload": "^0.6.3" }, "devDependencies": { "webpack": "*",