Skip to content
Merged
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
35 changes: 8 additions & 27 deletions .eslintrc.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,52 +8,33 @@
],
"overrides": [
{
"files": [
"*.ts",
"*.tsx",
"*.js",
"*.jsx"
],
"files": ["*.ts", "*.tsx", "*.js", "*.jsx"],
"rules": {
"@nrwl/nx/enforce-module-boundaries": [
"error",
{
"enforceBuildableLibDependency": true,
"allow": [],
"depConstraints": [
{
"sourceTag": "*",
"onlyDependOnLibsWithTags": [
"*"
]
}
{ "sourceTag": "*", "onlyDependOnLibsWithTags": ["*"] }
]
}
]
}
},
{
"files": [
"*.ts",
"*.tsx"
],
"extends": [
"plugin:@nrwl/nx/typescript"
],
"files": ["*.ts", "*.tsx"],
"extends": ["plugin:@nrwl/nx/typescript"],
"parserOptions": { "project": "./tsconfig.*?.json" },
"rules": {
"semi": "off",
"@typescript-eslint/semi": ["error"]
"@typescript-eslint/semi": ["error"],
"@typescript-eslint/ban-ts-comment": "off"
}
},
{
"files": [
"*.js",
"*.jsx"
],
"extends": [
"plugin:@nrwl/nx/javascript"
],
"files": ["*.js", "*.jsx"],
"extends": ["plugin:@nrwl/nx/javascript"],
"rules": {}
}
]
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/on-publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ jobs:
path: |
dist
key: dist-${{ github.run_id }}
- run: npx ng build --prod
- run: npx nx run ng2-file-upload-demo:build

# update release notes in github
update_release_draft:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/on-push-or-pull.yml
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ jobs:
with:
path: ${{ env.CACHE_DIST_PATH }}
key: dist-${{ github.run_id }}
- run: npx ng build --prod
- run: npx nx run ng2-file-upload-demo:build

# run unit tests
unit_tests_with_coverage:
Expand Down
42 changes: 22 additions & 20 deletions angular.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
"$schema": "./node_modules/@angular/cli/lib/config/schema.json",
"version": 1,
"newProjectRoot": "projects",
"defaultProject": "ng2-file-upload-demo",
"projects": {
"ng2-file-upload": {
"root": "libs/ng2-file-upload",
Expand Down Expand Up @@ -30,22 +29,24 @@
"lintFilePatterns": [
"libs/ng2-file-upload/**/*.ts"
]
}
},
"outputs": [
"{options.outputFile}"
]
},
"test": {
"builder": "@nrwl/jest:jest",
"outputs": [
"coverage/libs/ng2-file-upload"
],
"options": {
"jestConfig": "libs/ng2-file-upload/jest.config.js",
"jestConfig": "libs/ng2-file-upload/jest.config.ts",
"passWithNoTests": true
}
},
"version": {
"builder": "@nrwl/workspace:run-commands",
"outputs": [
],
"outputs": [],
"options": {
"commands": [
"ts-node ./scripts/set-version.ts",
Expand All @@ -59,7 +60,10 @@
"production": {}
}
}
}
},
"tags": [
"lib"
]
},
"ng2-file-upload-demo": {
"root": "apps/demo",
Expand Down Expand Up @@ -110,16 +114,16 @@
]
}
},
"defaultConfiguration": ""
"defaultConfiguration": "production"
},
"serve": {
"builder": "@angular-devkit/build-angular:dev-server",
"options": {
"browserTarget": "ng2-file-upload-demo:build"
"browserTarget": "ng2-file-upload-demo:build:production"
},
"configurations": {
"production": {
"browserTarget": "ng2-file-upload-demo:build:production"
"browserTarget": "ng2-file-upload-demo:build"
}
}
},
Expand All @@ -129,18 +133,16 @@
"lintFilePatterns": [
"apps/demo/**/*.ts"
]
}
},
"outputs": [
"{options.outputFile}"
]
}
}
}
},
"schematics": {
"@schematics/angular:component": {
"prefix": "",
"styleext": "css"
},
"@schematics/angular:directive": {
"prefix": ""
},
"tags": [],
"implicitDependencies": [
"ng2-file-upload"
]
}
}
}
24 changes: 16 additions & 8 deletions apps/demo/.eslintrc.json
Original file line number Diff line number Diff line change
@@ -1,20 +1,28 @@
{
"extends": ["../../.eslintrc.json"],
"ignorePatterns": ["!**/*"],
"extends": [
"../../.eslintrc.json"
],
"ignorePatterns": [
"!**/*"
],
"overrides": [
{
"files": ["*.ts"],
"files": [
"*.ts"
],
"extends": [
"plugin:@nrwl/nx/angular",
"plugin:@angular-eslint/template/process-inline-templates"
],
"parserOptions": { "project": ["src/accordion/tsconfig.*?.json"] },
"rules": {
}
"rules": {}
},
{
"files": ["*.html"],
"extends": ["plugin:@nrwl/nx/angular-template"],
"files": [
"*.html"
],
"extends": [
"plugin:@nrwl/nx/angular-template"
],
"rules": {}
}
]
Expand Down
2 changes: 0 additions & 2 deletions apps/demo/src/app/components/file-upload-section.html
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,7 @@
<tabset>
<tab *ngFor="let desc of tabs" heading="{{desc.heading}}" (select)="select($event)">
<div class="card card-block p-3 border-top-0">

<simple-demo></simple-demo>

<br>
<div class="container p-0">
<div class="row" style="margin: 0px;">
Expand Down
15 changes: 11 additions & 4 deletions apps/demo/tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,10 +1,12 @@
{
"extends": "../../tsconfig.base.json",
"files": [
"./src/main.ts",
"../../scripts/polyfills.ts"
"./src/main.ts",
"../../scripts/polyfills.ts"
],
"include": [
"./src/typings.d.ts"
],
"include": ["./src/typings.d.ts"],
"references": [
{
"path": "./tsconfig.app.json"
Expand All @@ -16,5 +18,10 @@
"path": "./tsconfig.editor.json"
}
],
"exclude": ["**/*.spec.ts"]
"exclude": [
"**/*.spec.ts"
],
"compilerOptions": {
"target": "es2020"
}
}
5 changes: 0 additions & 5 deletions jest.config.js

This file was deleted.

3 changes: 3 additions & 0 deletions jest.config.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
const { getJestProjects } = require('@nrwl/jest');

export default {"projects": getJestProjects()};
2 changes: 1 addition & 1 deletion jest.preset.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
const nxPreset = require('@nrwl/jest/preset');
const nxPreset = require('@nrwl/jest/preset').default;
module.exports = {
...nxPreset,
...{
Expand Down
24 changes: 16 additions & 8 deletions libs/ng2-file-upload/.eslintrc.json
Original file line number Diff line number Diff line change
@@ -1,20 +1,28 @@
{
"extends": ["../../.eslintrc.json"],
"ignorePatterns": ["!**/*"],
"extends": [
"../../.eslintrc.json"
],
"ignorePatterns": [
"!**/*"
],
"overrides": [
{
"files": ["*.ts"],
"files": [
"*.ts"
],
"extends": [
"plugin:@nrwl/nx/angular",
"plugin:@angular-eslint/template/process-inline-templates"
],
"parserOptions": { "project": ["src/accordion/tsconfig.*?.json"] },
"rules": {
}
"rules": {}
},
{
"files": ["*.html"],
"extends": ["plugin:@nrwl/nx/angular-template"],
"files": [
"*.html"
],
"extends": [
"plugin:@nrwl/nx/angular-template"
],
"rules": {}
}
]
Expand Down
2 changes: 2 additions & 0 deletions libs/ng2-file-upload/file-upload/file-upload.module.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@ import { NgModule } from '@angular/core';

import { FileDropDirective } from './file-drop.directive';
import { FileSelectDirective } from './file-select.directive';
export { FileDropDirective } from './file-drop.directive';
export { FileSelectDirective } from './file-select.directive';

@NgModule({
imports: [ CommonModule ],
Expand Down
26 changes: 0 additions & 26 deletions libs/ng2-file-upload/jest.config.js

This file was deleted.

21 changes: 21 additions & 0 deletions libs/ng2-file-upload/jest.config.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
/* eslint-disable */
export default {
displayName: 'ng2-file-upload',
preset: '../../jest.preset.js',
setupFilesAfterEnv: ['<rootDir>/testing/test-setup.ts'],
globals: {
'ts-jest': {
tsconfig: '<rootDir>/tsconfig.spec.json',

}
},
coverageDirectory: '../../coverage/libs/ng2-file-upload',
snapshotSerializers: [
'jest-preset-angular/build/serializers/no-ng-attributes',
'jest-preset-angular/build/serializers/ng-snapshot',
'jest-preset-angular/build/serializers/html-comment'
],
transform: { '^.+.(ts|mjs|js|html)$': 'jest-preset-angular' },
transformIgnorePatterns: ['node_modules/(?!.*.mjs$)'],
moduleFileExtensions: ['mjs', 'ts', 'js', 'html']
};
4 changes: 2 additions & 2 deletions libs/ng2-file-upload/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@
"author": "Dmitriy Shekhovtsov <valorkin@gmail.com>",
"license": "MIT",
"peerDependencies": {
"@angular/core": "^13.0.0",
"@angular/common": "^13.0.0"
"@angular/core": "^14.0.0",
"@angular/common": "^14.0.0"
},
"sideEffects": false,
"publishConfig": {
Expand Down
Loading