Use Angular CLI instead of ngm for building
Some commands: npm run build - to build the library. Output is in dist/ng2-file-upload/. npm run test - to run tests. Coverage report is in coverage/ as before. npm run demo.serve - to build demo application and serve it through browsersync npm run start - to run demo application using `ng serve`. Requires the library to be built and linked first.
This commit is contained in:
committed by
Evgeny Arshinov
parent
6cb3f87e57
commit
7a342268bb
48
angular.json
48
angular.json
@@ -4,6 +4,20 @@
|
|||||||
"newProjectRoot": "projects",
|
"newProjectRoot": "projects",
|
||||||
"projects": {
|
"projects": {
|
||||||
"ng2-file-upload": {
|
"ng2-file-upload": {
|
||||||
|
"root": ".",
|
||||||
|
"sourceRoot": "src",
|
||||||
|
"projectType": "library",
|
||||||
|
"architect": {
|
||||||
|
"build": {
|
||||||
|
"builder": "@angular-devkit/build-ng-packagr:build",
|
||||||
|
"options": {
|
||||||
|
"tsConfig": "src/tsconfig.json",
|
||||||
|
"project": "src/ng-package.json"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"ng2-file-upload-demo": {
|
||||||
"root": "demo",
|
"root": "demo",
|
||||||
"sourceRoot": "demo/src",
|
"sourceRoot": "demo/src",
|
||||||
"projectType": "application",
|
"projectType": "application",
|
||||||
@@ -44,38 +58,48 @@
|
|||||||
"serve": {
|
"serve": {
|
||||||
"builder": "@angular-devkit/build-angular:dev-server",
|
"builder": "@angular-devkit/build-angular:dev-server",
|
||||||
"options": {
|
"options": {
|
||||||
"browserTarget": "ng2-file-upload:build"
|
"browserTarget": "ng2-file-upload-demo:build"
|
||||||
},
|
},
|
||||||
"configurations": {
|
"configurations": {
|
||||||
"production": {
|
"production": {
|
||||||
"browserTarget": "ng2-file-upload:build:production"
|
"browserTarget": "ng2-file-upload-demo:build:production"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"ng2-file-upload-test": {
|
||||||
|
"root": ".",
|
||||||
|
"sourceRoot": "test",
|
||||||
|
"projectType": "library",
|
||||||
|
"architect": {
|
||||||
"test": {
|
"test": {
|
||||||
"builder": "@angular-devkit/build-angular:karma",
|
"builder": "@angular-devkit/build-angular:karma",
|
||||||
"options": {
|
"options": {
|
||||||
"main": "demo/src/../../scripts/test.ts",
|
"main": "test/test.ts",
|
||||||
"karmaConfig": "karma.conf.js",
|
"karmaConfig": "test/karma.conf.js",
|
||||||
"scripts": [],
|
"scripts": [],
|
||||||
"styles": [],
|
"styles": [],
|
||||||
"tsConfig": "demo/src/tsconfig.json",
|
"tsConfig": "test/tsconfig.json"
|
||||||
"assets": [
|
|
||||||
"demo/src/assets"
|
|
||||||
]
|
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"lint": {
|
"lint": {
|
||||||
"builder": "@angular-devkit/build-angular:tslint",
|
"builder": "@angular-devkit/build-angular:tslint",
|
||||||
"options": {
|
"options": {
|
||||||
"tsConfig": [],
|
"tsConfig": [
|
||||||
"exclude": []
|
"src/tsconfig.json",
|
||||||
|
"demo/src/tsconfig.json",
|
||||||
|
"test/tsconfig.json"
|
||||||
|
],
|
||||||
|
"exclude": [
|
||||||
|
"**/node_modules/**"
|
||||||
|
]
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"defaultProject": "ng2-file-upload",
|
"defaultProject": "ng2-file-upload-demo",
|
||||||
"schematics": {
|
"schematics": {
|
||||||
"@schematics/angular:component": {
|
"@schematics/angular:component": {
|
||||||
"prefix": "",
|
"prefix": "",
|
||||||
|
|||||||
@@ -5,9 +5,9 @@ let doc = require('html-loader!markdown-loader!../../doc.md');
|
|||||||
let tabDesc:Array<any> = [
|
let tabDesc:Array<any> = [
|
||||||
{
|
{
|
||||||
heading: 'Simple',
|
heading: 'Simple',
|
||||||
ts: require('!!raw-loader?lang=typescript!./file-upload/simple-demo.ts'),
|
ts: require('!!raw-loader!./file-upload/simple-demo.ts').default,
|
||||||
html: require('!!raw-loader?lang=markup!./file-upload/simple-demo.html'),
|
html: require('!!raw-loader!./file-upload/simple-demo.html').default,
|
||||||
js: require('!!raw-loader?lang=javascript!./file-upload/file-catcher.js')
|
js: require('!!raw-loader!./file-upload/file-catcher.js').default
|
||||||
}
|
}
|
||||||
];
|
];
|
||||||
|
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
import './polyfills.ts';
|
import '../../scripts/polyfills.ts';
|
||||||
|
|
||||||
import { platformBrowserDynamic } from '@angular/platform-browser-dynamic';
|
import { platformBrowserDynamic } from '@angular/platform-browser-dynamic';
|
||||||
import { enableProdMode } from '@angular/core';
|
import { enableProdMode } from '@angular/core';
|
||||||
|
|||||||
@@ -1,32 +1,25 @@
|
|||||||
{
|
{
|
||||||
"compilerOptions": {
|
"compilerOptions": {
|
||||||
|
"baseUrl": ".",
|
||||||
"declaration": false,
|
"declaration": false,
|
||||||
"downlevelIteration": true,
|
"downlevelIteration": true,
|
||||||
"emitDecoratorMetadata": true,
|
"emitDecoratorMetadata": true,
|
||||||
"experimentalDecorators": true,
|
"experimentalDecorators": true,
|
||||||
"noEmitHelpers": false,
|
"noEmitHelpers": false,
|
||||||
"lib": ["es6", "dom"],
|
"lib": ["es6", "dom"],
|
||||||
"types": [
|
|
||||||
"jasmine",
|
|
||||||
"webpack"
|
|
||||||
],
|
|
||||||
"mapRoot": "./",
|
"mapRoot": "./",
|
||||||
"module": "esnext",
|
"module": "esnext",
|
||||||
"moduleResolution": "node",
|
"moduleResolution": "node",
|
||||||
"outDir": "../temp/out-tsc",
|
"outDir": "../temp/out-tsc",
|
||||||
"sourceMap": true,
|
"sourceMap": true,
|
||||||
"target": "es2015",
|
"target": "es2015"
|
||||||
"typeRoots": [
|
|
||||||
"../node_modules/@types"
|
|
||||||
]
|
|
||||||
},
|
},
|
||||||
"files": [
|
"files": [
|
||||||
|
"../../scripts/typings.d.ts",
|
||||||
"main.ts",
|
"main.ts",
|
||||||
"polyfills.ts"
|
"../../scripts/polyfills.ts"
|
||||||
],
|
],
|
||||||
"include": [
|
"exclude": [
|
||||||
"*.d.ts",
|
"**/*.spec.ts"
|
||||||
"../../src/spec/*.spec.ts",
|
|
||||||
"../../scripts/test.ts"
|
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
|
|||||||
16
demo/src/typings.d.ts
vendored
16
demo/src/typings.d.ts
vendored
@@ -1,16 +0,0 @@
|
|||||||
// Typings reference file, you can add your own global typings here
|
|
||||||
// https://www.typescriptlang.org/docs/handbook/writing-declaration-files.html
|
|
||||||
// tslint:disable
|
|
||||||
declare const System: any;
|
|
||||||
declare const ENV:string;
|
|
||||||
// google code-prettify
|
|
||||||
declare const PR:any;
|
|
||||||
|
|
||||||
// declare const require:any;
|
|
||||||
// declare const global:any;
|
|
||||||
|
|
||||||
declare module jasmine {
|
|
||||||
interface Matchers {
|
|
||||||
toHaveCssClass(expected: any): boolean;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
2785
package-lock.json
generated
2785
package-lock.json
generated
File diff suppressed because it is too large
Load Diff
26
package.json
26
package.json
@@ -7,24 +7,21 @@
|
|||||||
"lite-server": "lite-server -c demo/bs-config.json",
|
"lite-server": "lite-server -c demo/bs-config.json",
|
||||||
"demo.serve": "run-s build link demo.build lite-server",
|
"demo.serve": "run-s build link demo.build lite-server",
|
||||||
"demo.gh-pages": "run-s build demo.build demo.deploy",
|
"demo.gh-pages": "run-s build demo.build demo.deploy",
|
||||||
"demo.build": "ng build -prod --aot",
|
"demo.build": "ng build ng2-file-upload-demo --prod",
|
||||||
"demo.deploy": "gh-pages -d demo/dist",
|
"demo.deploy": "gh-pages -d demo/dist",
|
||||||
"link": "ngm link -p src --here",
|
"link": "cd dist/ng2-file-upload/ && npm link && cd ../../ && npm link ng2-file-upload",
|
||||||
"lint": "exit 0",
|
"lint": "exit 0",
|
||||||
"disable-lint": "tslint \"**/*.ts\" -c tslint.json --fix --type-check -t prose -e \"node_modules/**\" -e \"dist/**\" -e \"temp/**\" -e \"scripts/docs/**\"",
|
"disable-lint": "tslint \"**/*.ts\" -c tslint.json --fix --type-check -t prose -e \"node_modules/**\" -e \"dist/**\" -e \"temp/**\" -e \"scripts/docs/**\"",
|
||||||
"flow.changelog": "conventional-changelog -i CHANGELOG.md -s -p angular",
|
"flow.changelog": "conventional-changelog -i CHANGELOG.md -s -p angular",
|
||||||
"flow.github-release": "conventional-github-releaser -p angular",
|
"flow.github-release": "conventional-github-releaser -p angular",
|
||||||
"build": "ngm build -p src --clean",
|
"build": "ng build ng2-file-upload",
|
||||||
"build.watch": "ngm build -p src --watch --skip-bundles",
|
"build.watch": "ng build ng2-file-upload --watch",
|
||||||
"start": "ng serve --aot",
|
"start": "ng serve ng2-file-upload-demo --aot",
|
||||||
"pretest": "run-s lint build link",
|
"pretest": "run-s lint build link",
|
||||||
"test": "ng test",
|
"test": "ng test ng2-file-upload-test",
|
||||||
"test-coverage": "ng test --code-coverage",
|
"test-coverage": "ng test ng2-file-upload-test --code-coverage",
|
||||||
"version": "npm run flow.changelog && git add -A"
|
"version": "npm run flow.changelog && git add -A"
|
||||||
},
|
},
|
||||||
"main": "bundles/ng2-file-upload.umd.js",
|
|
||||||
"module": "index.js",
|
|
||||||
"typings": "index.d.ts",
|
|
||||||
"keywords": [
|
"keywords": [
|
||||||
"angular2",
|
"angular2",
|
||||||
"bootstrap",
|
"bootstrap",
|
||||||
@@ -46,6 +43,7 @@
|
|||||||
"peerDependencies": {},
|
"peerDependencies": {},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@angular-devkit/build-angular": "~0.803.0",
|
"@angular-devkit/build-angular": "~0.803.0",
|
||||||
|
"@angular-devkit/build-ng-packagr": "^0.803.0",
|
||||||
"@angular/cli": "^8.3.0",
|
"@angular/cli": "^8.3.0",
|
||||||
"@angular/common": "^8.2.3",
|
"@angular/common": "^8.2.3",
|
||||||
"@angular/compiler": "^8.2.3",
|
"@angular/compiler": "^8.2.3",
|
||||||
@@ -74,7 +72,7 @@
|
|||||||
"gh-pages": "0.12.0",
|
"gh-pages": "0.12.0",
|
||||||
"gitignore-to-glob": "0.3.0",
|
"gitignore-to-glob": "0.3.0",
|
||||||
"google-code-prettify": "1.0.5",
|
"google-code-prettify": "1.0.5",
|
||||||
"html-loader": "0.4.4",
|
"html-loader": "^0.5.5",
|
||||||
"jasmine": "2.5.3",
|
"jasmine": "2.5.3",
|
||||||
"jasmine-core": "2.5.2",
|
"jasmine-core": "2.5.2",
|
||||||
"jasmine-data-provider": "2.2.0",
|
"jasmine-data-provider": "2.2.0",
|
||||||
@@ -88,19 +86,21 @@
|
|||||||
"karma-sauce-launcher": "1.1.0",
|
"karma-sauce-launcher": "1.1.0",
|
||||||
"lite-server": "2.2.2",
|
"lite-server": "2.2.2",
|
||||||
"lodash": "4.17.4",
|
"lodash": "4.17.4",
|
||||||
"markdown-loader": "^0.1.7",
|
"markdown-loader": "^5.1.0",
|
||||||
"marked": "0.3.6",
|
"marked": "0.3.6",
|
||||||
"ngm-cli": "0.4.0",
|
"ng-packagr": "^5.5.0",
|
||||||
"ngx-bootstrap": "1.6.6",
|
"ngx-bootstrap": "1.6.6",
|
||||||
"npm-run-all": "^4.0.1",
|
"npm-run-all": "^4.0.1",
|
||||||
"pre-commit": "1.2.2",
|
"pre-commit": "1.2.2",
|
||||||
"protractor": "5.0.0",
|
"protractor": "5.0.0",
|
||||||
|
"raw-loader": "^3.1.0",
|
||||||
"reflect-metadata": "0.1.9",
|
"reflect-metadata": "0.1.9",
|
||||||
"require-dir": "0.3.1",
|
"require-dir": "0.3.1",
|
||||||
"rxjs": "^6.5.2",
|
"rxjs": "^6.5.2",
|
||||||
"systemjs-builder": "0.15.34",
|
"systemjs-builder": "0.15.34",
|
||||||
"ts-helpers": "^1.1.1",
|
"ts-helpers": "^1.1.1",
|
||||||
"ts-node": "2.0.0",
|
"ts-node": "2.0.0",
|
||||||
|
"tsickle": "^0.37.0",
|
||||||
"tslint": "^5.19.0",
|
"tslint": "^5.19.0",
|
||||||
"tslint-config-valorsoft": "^2.2.1",
|
"tslint-config-valorsoft": "^2.2.1",
|
||||||
"typedoc": "0.5.5",
|
"typedoc": "0.5.5",
|
||||||
|
|||||||
1
scripts/.gitignore
vendored
1
scripts/.gitignore
vendored
@@ -1 +0,0 @@
|
|||||||
!**/*.js
|
|
||||||
@@ -1,4 +1,4 @@
|
|||||||
import { FileLikeObject } from "../ng2-file-upload";
|
import { FileLikeObject } from "../index";
|
||||||
|
|
||||||
export class FileType {
|
export class FileType {
|
||||||
/* MS office */
|
/* MS office */
|
||||||
|
|||||||
7
src/ng-package.json
Normal file
7
src/ng-package.json
Normal file
@@ -0,0 +1,7 @@
|
|||||||
|
{
|
||||||
|
"$schema": "../node_modules/ng-packagr/ng-package.schema.json",
|
||||||
|
"dest": "../dist/ng2-file-upload",
|
||||||
|
"lib": {
|
||||||
|
"entryFile": "index.ts"
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -1 +0,0 @@
|
|||||||
export * from './index';
|
|
||||||
@@ -1,8 +1,9 @@
|
|||||||
{
|
{
|
||||||
"compilerOptions": {
|
"compilerOptions": {
|
||||||
|
"baseUrl": ".",
|
||||||
"outDir": "../dist",
|
"outDir": "../dist",
|
||||||
"target": "es5",
|
"target": "es5",
|
||||||
"module": "commonjs",
|
"module": "esnext",
|
||||||
"moduleResolution": "node",
|
"moduleResolution": "node",
|
||||||
"emitDecoratorMetadata": true,
|
"emitDecoratorMetadata": true,
|
||||||
"experimentalDecorators": true,
|
"experimentalDecorators": true,
|
||||||
@@ -14,24 +15,12 @@
|
|||||||
"stripInternal": true,
|
"stripInternal": true,
|
||||||
"noUnusedLocals": false,
|
"noUnusedLocals": false,
|
||||||
"noUnusedParameters": false,
|
"noUnusedParameters": false,
|
||||||
"lib": ["dom", "es6"],
|
"lib": ["dom", "es6"]
|
||||||
"types": [
|
|
||||||
"jasmine",
|
|
||||||
"webpack"
|
|
||||||
],
|
|
||||||
"typeRoots": [
|
|
||||||
"../node_modules/@types"
|
|
||||||
]
|
|
||||||
},
|
},
|
||||||
|
"include": [
|
||||||
|
"../scripts/typings.d.ts"
|
||||||
|
],
|
||||||
"exclude": [
|
"exclude": [
|
||||||
"node_modules"
|
"**/*.spec.ts"
|
||||||
],
|
]
|
||||||
"files": [
|
|
||||||
"../scripts/typings.d.ts",
|
|
||||||
"./ng2-file-upload.ts",
|
|
||||||
"./index.ts"
|
|
||||||
],
|
|
||||||
"angularCompilerOptions": {
|
|
||||||
"genDir": "../temp/factories"
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
// Karma configuration file, see link for more information
|
// Karma configuration file, see link for more information
|
||||||
// https://karma-runner.github.io/0.13/config/configuration-file.html
|
// https://karma-runner.github.io/0.13/config/configuration-file.html
|
||||||
|
|
||||||
const customLaunchers = require('./scripts/sauce-browsers').customLaunchers;
|
const customLaunchers = require('./sauce-browsers').customLaunchers;
|
||||||
|
|
||||||
module.exports = function (config) {
|
module.exports = function (config) {
|
||||||
const configuration = {
|
const configuration = {
|
||||||
@@ -14,7 +14,7 @@ module.exports = function (config) {
|
|||||||
require('@angular-devkit/build-angular/plugins/karma')
|
require('@angular-devkit/build-angular/plugins/karma')
|
||||||
],
|
],
|
||||||
coverageIstanbulReporter: {
|
coverageIstanbulReporter: {
|
||||||
dir: require('path').join(__dirname, 'coverage'), reports: [ 'html', 'lcovonly' ],
|
dir: require('path').join(__dirname, '../coverage'), reports: [ 'html', 'lcovonly' ],
|
||||||
fixWebpackSourcePaths: false
|
fixWebpackSourcePaths: false
|
||||||
},
|
},
|
||||||
|
|
||||||
@@ -1,4 +1,4 @@
|
|||||||
import '../demo/src/polyfills.ts';
|
import '../scripts/polyfills.ts';
|
||||||
|
|
||||||
import 'zone.js/dist/long-stack-trace-zone';
|
import 'zone.js/dist/long-stack-trace-zone';
|
||||||
import 'zone.js/dist/proxy.js';
|
import 'zone.js/dist/proxy.js';
|
||||||
22
test/tsconfig.json
Normal file
22
test/tsconfig.json
Normal file
@@ -0,0 +1,22 @@
|
|||||||
|
{
|
||||||
|
"compilerOptions": {
|
||||||
|
"experimentalDecorators": true,
|
||||||
|
"module": "esnext",
|
||||||
|
"moduleResolution": "node",
|
||||||
|
"target": "es2015",
|
||||||
|
"outDir": "./out-tsc/spec",
|
||||||
|
"types": [
|
||||||
|
"jasmine",
|
||||||
|
"node"
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"files": [
|
||||||
|
"../scripts/typings.d.ts",
|
||||||
|
"test.ts",
|
||||||
|
"../scripts/polyfills.ts",
|
||||||
|
],
|
||||||
|
"include": [
|
||||||
|
"../src/**/*.spec.ts",
|
||||||
|
"../demo/src/**/*.spec.ts"
|
||||||
|
]
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user