fix dependencies and core

This commit is contained in:
Mario Romano
2016-05-21 04:25:44 +01:00
parent 5c8e37073f
commit c13d6a7fc3
70 changed files with 840 additions and 288 deletions

View File

@@ -7,8 +7,12 @@ demo/
node_modules
typings/
src/
fonts/
/ng2-alfresco-upload.ts
/ng2-alfresco-upload.d.ts
/ng2-alfresco-upload.js
/ng2-alfresco-upload.js.map
/.editorconfig
/.travis.yml
/*.js
/*.json
/*.ts
/*.js.map
/.npmignore

View File

@@ -46,36 +46,36 @@ Make sure your systemjs.config has the following configuration:
```javascript
System.config({
defaultJSExtensions: true,
map: {
'ng2-alfresco-core': 'node_modules/ng2-alfresco-core/dist',
'ng2-alfresco-upload': 'node_modules/ng2-alfresco-upload/dist',
'ng2-translate': 'node_modules/ng2-translate',
'rxjs': 'node_modules/rxjs',
'angular2' : 'node_modules/angular2',
'app': 'dist/src'
},
packages: {
'app': {
defaultExtension: 'js'
defaultJSExtensions: true,
map: {
'ng2-alfresco-core': 'node_modules/ng2-alfresco-core/dist',
'ng2-alfresco-upload': 'node_modules/ng2-alfresco-upload',
'ng2-translate': 'node_modules/ng2-translate',
'rxjs': 'node_modules/rxjs',
'angular2' : 'node_modules/angular2',
'app': 'dist/src'
},
'ng2-alfresco-core': {
defaultExtension: 'js'
},
'ng2-alfresco-upload': {
defaultExtension: 'js'
},
'ng2-translate': {
defaultExtension: 'js'
},
'rxjs': {
defaultExtension: 'js'
},
'angular2': {
defaultExtension: 'js'
packages: {
'app': {
defaultExtension: 'js'
},
'ng2-alfresco-core': {
defaultExtension: 'js'
},
'ng2-alfresco-upload': {
defaultExtension: 'js'
},
'ng2-translate': {
defaultExtension: 'js'
},
'rxjs': {
defaultExtension: 'js'
},
'angular2': {
defaultExtension: 'js'
}
}
}
});
});
```
#### Basic usage
@@ -98,7 +98,7 @@ import { Component } from 'angular2/core';
import { bootstrap } from 'angular2/platform/browser';
import { HTTP_PROVIDERS } from 'angular2/http';
import { AlfrescoSettingsService, AlfrescoTranslationService, AlfrescoTranslationLoader } from 'ng2-alfresco-core/services';
import { ALFRESCO_ULPOAD_COMPONENT, UploadService } from 'ng2-alfresco-upload/ng2-alfresco-upload';
import { ALFRESCO_ULPOAD_COMPONENTS, UploadService } from 'ng2-alfresco-upload/dist/ng2-alfresco-upload';
@Component({
@@ -157,7 +157,7 @@ import { Component } from 'angular2/core';
import { bootstrap } from 'angular2/platform/browser';
import { HTTP_PROVIDERS } from 'angular2/http';
import { AlfrescoSettingsService, AlfrescoTranslationService, AlfrescoTranslationLoader } from 'ng2-alfresco-core/services';
import { ALFRESCO_ULPOAD_COMPONENT, UploadService } from 'ng2-alfresco-upload/ng2-alfresco-upload';
import { ALFRESCO_ULPOAD_COMPONENTS, UploadService } from 'ng2-alfresco-upload/dist/ng2-alfresco-upload';
@Component({

View File

@@ -27,8 +27,8 @@
System.config({
defaultJSExtensions: true,
map: {
'ng2-alfresco-core': 'node_modules/ng2-alfresco-core/dist',
'ng2-alfresco-upload': 'node_modules/ng2-alfresco-upload/dist',
'ng2-alfresco-core': 'node_modules/ng2-alfresco-core',
'ng2-alfresco-upload': 'node_modules/ng2-alfresco-upload',
'ng2-translate': 'node_modules/ng2-translate',
'rxjs': 'node_modules/rxjs',
'angular2' : 'node_modules/angular2',
@@ -56,7 +56,7 @@
}
});
System.import('dist/src/my-app').catch(console.log.bind(console));
System.import('dist/my-app').catch(console.log.bind(console));
</script>
</head>

View File

@@ -20,8 +20,8 @@
import { Component } from 'angular2/core';
import { bootstrap } from 'angular2/platform/browser';
import { HTTP_PROVIDERS } from 'angular2/http';
import { AlfrescoSettingsService, AlfrescoTranslationService, AlfrescoTranslationLoader } from 'ng2-alfresco-core/services';
import { ALFRESCO_ULPOAD_COMPONENT, UploadService } from 'ng2-alfresco-upload/ng2-alfresco-upload';
import { AlfrescoSettingsService, AlfrescoTranslationService, AlfrescoTranslationLoader } from 'ng2-alfresco-core/dist/ng2-alfresco-core';
import { ALFRESCO_ULPOAD_COMPONENTS, UploadService } from 'ng2-alfresco-upload/dist/ng2-alfresco-upload';
@Component({
@@ -58,7 +58,7 @@ import { ALFRESCO_ULPOAD_COMPONENT, UploadService } from 'ng2-alfresco-upload/ng
DRAG HERE
</div>
</alfresco-upload-drag-area>`,
directives: [ALFRESCO_ULPOAD_COMPONENT]
directives: [ALFRESCO_ULPOAD_COMPONENTS]
})
export class MyDemoApp {
constructor(alfrescoSettingsService: AlfrescoSettingsService) {

View File

@@ -12,6 +12,7 @@
},
"exclude": [
"node_modules",
"typings"
"typings",
"dist"
]
}

View File

@@ -14,14 +14,16 @@ System.config({
format: 'register',
map: Object.keys(window.__karma__.files).filter(onlyAppFiles).reduce(createPathRecords, {})
},
'ng2-translate': {
defaultExtension: 'js',
format: 'register'
'ng2-alfresco-core/dist': {
defaultExtension: 'js'
},
'rxjs': {
defaultExtension: 'js'
}
},
map: {
'ng2-translate': '/base/node_modules/ng2-translate/bundles',
'ng2-alfresco-core': '/base/dist/node_modules/ng2-alfresco-core'
'ng2-alfresco-core/dist': '/base/node_modules/ng2-alfresco-core/dist',
'rxjs': '/base/node_modules/rxjs'
}
});
@@ -33,14 +35,13 @@ System.import('angular2/src/platform/browser/browser_adapter')
__karma__.start();
},
function(error) {
console.log(error);
__karma__.error(error.stack || error);
}
);
function createPathRecords(pathsMapping, appPath) {
// creates local module name mapping to global path with karma's fingerprint in path, e.g.:
// './vg-player/vg-player':
// '/base/dist/vg-player/vg-player.js?f4523daf879cfb7310ef6242682ccf10b2041b3e'
var moduleName = './' + resolveKeyPathForMapping('base/dist/', appPath);
moduleName = moduleName.replace(/\.js$/, '');
pathsMapping[moduleName] = appPath + '?' + window.__karma__.files[appPath];
@@ -60,7 +61,6 @@ function resolveTestFiles() {
.filter(onlySpecFiles)
.map(function(moduleName) {
// loads all spec files via their global module names (e.g.
// 'base/dist/vg-player/vg-player.spec')
return System.import(moduleName);
});
}

View File

@@ -11,13 +11,13 @@ module.exports = function (config) {
// paths loaded by Karma
{pattern: 'node_modules/angular2/bundles/angular2-polyfills.js', included: true, watched: false},
{pattern: 'node_modules/systemjs/dist/system.src.js', included: true, watched: false},
{pattern: 'node_modules/rxjs/bundles/Rx.js', included: true, watched: false},
{pattern: 'node_modules/rxjs/**/*.js', included: false, watched: false, served: true},
{pattern: 'node_modules/angular2/bundles/angular2.dev.js', included: true, served: true, watched: false},
{pattern: 'node_modules/angular2/bundles/testing.dev.js', included: true, served: true, watched: false},
{pattern: 'node_modules/angular2/bundles/http.dev.js', included: true, served: true, watched: false},
{pattern: 'node_modules/angular2/bundles/router.dev.js', included: true, watched: false},
{pattern: 'node_modules/alfresco-core-rest-api/bundle.js', included: true, watched: false},
{pattern: 'node_modules/ng2-translate/bundles/ng2-translate.js', included: true, watched: false},
{pattern: 'node_modules/ng2-alfresco-core/dist/**/*.js', included: false, served: true, watched: false},
{pattern: 'karma-test-shim.js', included: true, watched: true},
@@ -41,7 +41,7 @@ module.exports = function (config) {
// level of logging
// possible values: config.LOG_DISABLE || config.LOG_ERROR || config.LOG_WARN || config.LOG_INFO || config.LOG_DEBUG
logLevel: config.LOG_INFO,
logLevel: config.LOG_DEBUG,
colors: true,
@@ -76,6 +76,6 @@ module.exports = function (config) {
]
},
singleRun: false
singleRun: true
})
};

View File

@@ -18,6 +18,7 @@
import { UploadDragAreaComponent } from './src/components/upload-drag-area.component';
import { FileDraggableDirective } from './src/directives/file-draggable.directive';
import { UploadButtonComponent } from './src/components/upload-button.component';
import { UploadService } from './src/services/upload.service';
/**
* ng2-alfresco-upload, provide components to upload files to alfresco repository.
@@ -41,12 +42,20 @@ export * from './src/services/upload.service';
export * from './src/directives/file-draggable.directive';
export default {
component: [UploadDragAreaComponent, UploadButtonComponent],
directives: [FileDraggableDirective]
components: [UploadDragAreaComponent, UploadButtonComponent],
providers: [FileDraggableDirective],
directives: [UploadService]
};
export const ALFRESCO_ULPOAD_COMPONENT: [any] = [
UploadDragAreaComponent,
UploadButtonComponent,
FileDraggableDirective
export const ALFRESCO_ULPOAD_COMPONENTS: [any] = [
UploadDragAreaComponent,
UploadButtonComponent
];
export const ALFRESCO_ULPOAD_DIRECTIVES: [any] = [
FileDraggableDirective
];
export const ALFRESCO_ULPOAD_SERVICES: [any] = [
UploadService
];

View File

@@ -1,7 +1,7 @@
{
"name": "ng2-alfresco-upload",
"description": "Alfresco Angular2 Upload Component",
"version": "0.1.5",
"version": "0.1.8",
"author": "Alfresco Software, Ltd.",
"scripts": {
"typings": "typings install",

View File

@@ -17,7 +17,11 @@
import { Observable } from 'rxjs/Observable';
import { EventEmitter } from 'angular2/core';
import { LangChangeEvent } from 'ng2-translate/ng2-translate';
export interface LangChangeEvent {
lang: string;
translations: any;
}
export class TranslationMock {

View File

@@ -18,7 +18,7 @@
import { Component, ElementRef, Input } from 'angular2/core';
import { FileModel } from '../models/file.model';
import { FileUploadingListComponent } from './file-uploading-list.component';
import { AlfrescoPipeTranslate } from 'ng2-alfresco-core/services';
import { AlfrescoPipeTranslate } from 'ng2-alfresco-core/dist/ng2-alfresco-core';
declare let __moduleName: string;

View File

@@ -18,7 +18,7 @@
import { Component, ElementRef, Input } from 'angular2/core';
import { FileModel } from '../models/file.model';
import { AlfrescoPipeTranslate } from 'ng2-alfresco-core/services';
import { AlfrescoPipeTranslate } from 'ng2-alfresco-core/dist/ng2-alfresco-core';
declare let __moduleName: string;

View File

@@ -20,7 +20,7 @@ import { TEST_BROWSER_PLATFORM_PROVIDERS, TEST_BROWSER_APPLICATION_PROVIDERS } f
import { it, describe, expect, injectAsync, beforeEachProviders, TestComponentBuilder, setBaseTestProviders } from 'angular2/testing';
import { provide } from 'angular2/core';
import { UploadButtonComponent } from './upload-button.component';
import { TranslateService } from 'ng2-translate/ng2-translate';
import { AlfrescoTranslationService } from 'ng2-alfresco-core/dist/ng2-alfresco-core';
import { TranslationMock } from '../assets/translation.service.mock';
describe('AlfrescoUploadButton', () => {
@@ -29,7 +29,7 @@ describe('AlfrescoUploadButton', () => {
beforeEachProviders(() => {
return [
provide(TranslateService, {useClass: TranslationMock})
provide(AlfrescoTranslationService, {useClass: TranslationMock})
];
});

View File

@@ -20,7 +20,7 @@ import { Component, ViewChild, ElementRef, Input, Output, EventEmitter } from 'a
import { UploadService } from '../services/upload.service';
import { FileModel } from '../models/file.model';
import { FileUploadingDialogComponent } from './file-uploading-dialog.component';
import { AlfrescoTranslationService, AlfrescoPipeTranslate } from 'ng2-alfresco-core/services';
import { AlfrescoTranslationService, AlfrescoPipeTranslate } from 'ng2-alfresco-core/dist/ng2-alfresco-core';
import 'rxjs/Rx';
declare let componentHandler: any;

View File

@@ -20,7 +20,7 @@ import { FileModel } from '../models/file.model';
import { EventEmitter, Injectable } from 'angular2/core';
import { Observable } from 'rxjs/Observable';
import { Response } from 'angular2/http';
import { AlfrescoSettingsService } from 'ng2-alfresco-core/services';
import { AlfrescoSettingsService } from 'ng2-alfresco-core/dist/ng2-alfresco-core';
declare let AlfrescoApi: any;

View File

@@ -21,6 +21,7 @@
"demo",
"node_modules",
"typings/main",
"typings/main.d.ts"
"typings/main.d.ts",
"dist"
]
}