From afca0e8a03badde75820185dd04a03b5688e5121 Mon Sep 17 00:00:00 2001 From: Martin Guillon Date: Sat, 5 Sep 2020 21:35:06 +0200 Subject: [PATCH] fix: angular build fix --- package.json | 61 +++++++++++++++++---------------------- references.d.ts | 5 ++-- src/angular/index.ts | 2 -- src/angular/package.json | 33 ++++++++++----------- src/angular/tsconfig.json | 13 +++++++++ tsconfig.angular.json | 12 -------- tsconfig.json | 4 +-- 7 files changed, 59 insertions(+), 71 deletions(-) create mode 100644 src/angular/tsconfig.json delete mode 100644 tsconfig.angular.json diff --git a/package.json b/package.json index be19e71..ffdef8e 100644 --- a/package.json +++ b/package.json @@ -1,20 +1,9 @@ { "name": "@nativescript-community/ui-image", "version": "1.0.0", - "ngPackage": { - "dest": "tempAngular", - "lib": { - "entryFile": "src/angular/index.ts", - "umdModuleIds": { - "@nativescript/core": "ns-core", - "@nativescript/angular": "ns-angular", - "@nativescript-community/image": "ns-ui-image" - } - } - }, "scripts": { "setup": "ts-patch install", - "build.angular": "pnpm i && rimraf tempAngular && ng-packagr -p src/angular/package.json -c tsconfig.angular.json && cpy 'tempAngular/**/*' 'plugin/angular' --parents", + "build.angular": "ng-packagr -p src/angular/package.json -c src/angular/tsconfig.json", "clean": "rimraf ./plugin/**/*.d.ts ./plugin/**/*.js ./plugin/**/*.js.map plugin/node_modules plugin/package-lock.json plugin/README.md demo/node_modules demo-angular/node_modules", "tsc": "cpy '**/*.d.ts' '../plugin' --parents --cwd=src && tsc -skipLibCheck -d", "build": "cp README.md ./plugin && rm -f .tsbuildinfo && npm run tsc ", @@ -27,40 +16,42 @@ "demo.ng.android.watch": "npm run build && npm run plugin.tscwatch && cd demo-angular && tns run android --syncAllFiles", "demo.ng.reset": "cd ../demo-angular && rimraf platforms", "plugin.prepare": "npm run build && cd demo-angular && tns plugin remove nativescript-image && tns plugin add ../plugin && cd ../demo && tns plugin remove nativescript-image && tns plugin add ../plugin", - "publish": "npm run build && lerna publish", + "publish": "npm run setup && npm run build && npm run build.angular && lerna publish", "commitmsg": "commitlint -e $GIT_PARAMS" }, "devDependencies": { - "@angular/animations": "~10.0.6", - "@angular/common": "~10.0.6", - "@angular/compiler": "~10.0.6", - "@angular/compiler-cli": "~10.0.6", - "@angular/core": "~10.0.6", - "@angular/forms": "~10.0.6", - "@angular/platform-browser": "~10.0.6", - "@angular/platform-browser-dynamic": "~10.0.6", - "@angular/router": "~10.0.6", - "@commitlint/cli": "^9.1.1", - "@commitlint/config-conventional": "^9.1.1", + "@angular/animations": "~10.1.0", + "@angular/common": "~10.1.0", + "@angular/compiler": "~10.1.0", + "@angular/compiler-cli": "~10.1.0", + "@angular/core": "~10.1.0", + "@angular/forms": "~10.1.0", + "@angular/platform-browser": "~10.1.0", + "@angular/platform-browser-dynamic": "~10.1.0", + "@angular/router": "~10.1.0", + "@commitlint/cli": "^9.1.2", + "@commitlint/config-conventional": "^9.1.2", "@nativescript-community/ui-image": "file:./plugin", - "@nativescript/angular": "10.0.0", - "@nativescript/core": "rc", - "@nativescript/types": "rc", - "@nativescript/webpack": "2.0.1", - "@typescript-eslint/eslint-plugin": "3.7.1", - "@typescript-eslint/parser": "3.7.1", + "@nativescript/angular": "10.1.0", + "@nativescript/core": "7.0.0", + "@nativescript/types-android": "~7.0.2", + "@nativescript/types-ios": "~7.0.1", + "@nativescript/webpack": "3.0.1", + "@typescript-eslint/eslint-plugin": "4.0.1", + "@typescript-eslint/parser": "4.0.1", + "@types/node": "14.6.4", "cpy-cli": "^3.1.1", - "eslint": "6.8.0", + "eslint": "7.8.1", "husky": "^4.2.5", "lerna": "^3.22.1", - "ng-packagr": "~10.0.3", + "ng-packagr": "~10.1.0", "prompt": "^1.0.0", "rimraf": "^3.0.2", - "rxjs": "^6.6.0", + "rxjs": "^6.6.2", "ts-patch": "^1.3.0", - "tslib": "2.0.0", + "tslib": "2.0.1", "typescript": "3.9.7", - "zone.js": "0.10.3" + "zone.js": "0.11.1" }, "repository": { "type": "git", diff --git a/references.d.ts b/references.d.ts index 224c886..cd63d85 100644 --- a/references.d.ts +++ b/references.d.ts @@ -1,4 +1,3 @@ -/// -/// -/// +/// +/// diff --git a/src/angular/index.ts b/src/angular/index.ts index e4d4e2a..6c9360c 100644 --- a/src/angular/index.ts +++ b/src/angular/index.ts @@ -1,4 +1,2 @@ -/// -/// export * from './nativescript-image.module'; diff --git a/src/angular/package.json b/src/angular/package.json index 4e7230a..b344781 100644 --- a/src/angular/package.json +++ b/src/angular/package.json @@ -1,19 +1,18 @@ { - "$schema": "../../node_modules/ng-packagr/package.schema.json", - "name": "@nativescript-community/ui-image-angular", - "version": "1.0.0", - "ngPackage": { - "dest": "../../tempAngular", - "lib": { - "entryFile": "index.ts", - "umdModuleIds": { - "@nativescript/core": "ns-core", - "@nativescript/angular": "ns-angular", - "@nativescript-community/ui-image": "ns-ui-image" - } - }, - "whitelistedNonPeerDependencies": [ - "." - ] - } + "name": "@nativescript-community/ui-image-angular", + "main": "index.js", + "ngPackage": { + "dest": "../../plugin/angular", + "lib": { + "entryFile": "index.ts", + "umdModuleIds": { + "@nativescript/core": "ns-core", + "@nativescript/angular": "ns-angular", + "@nativescript-community/ui-image": "ns-image" + } + }, + "whitelistedNonPeerDependencies": [ + "." + ] + } } \ No newline at end of file diff --git a/src/angular/tsconfig.json b/src/angular/tsconfig.json new file mode 100644 index 0000000..49602de --- /dev/null +++ b/src/angular/tsconfig.json @@ -0,0 +1,13 @@ +{ + "extends": "../../tsconfig.json", + "compilerOptions": { + "rootDir": "./", + "baseUrl": "./", + "plugins": [], + "paths": { + "@nativescript-community/l": ["../../plugin"] + } + }, + "include": ["./**/*.ts", "../references.d.ts"], + "exclude": ["../node_modules"] +} diff --git a/tsconfig.angular.json b/tsconfig.angular.json deleted file mode 100644 index fe00e53..0000000 --- a/tsconfig.angular.json +++ /dev/null @@ -1,12 +0,0 @@ -{ - "extends": "./tsconfig.json", - "compilerOptions": { - "paths": { - } - }, - "include": ["src/angular/**/*.ts", "./references.d.ts"], - "exclude": ["node_modules", "platforms"], - "angularCompilerOptions": { - "disableTypeScriptVersionCheck": true - } -} diff --git a/tsconfig.json b/tsconfig.json index 2298a74..c283f7a 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -28,9 +28,9 @@ "@nativescript-community/ui-image/*": ["src/*"], "*": ["node_modules/*"] }, - "plugins": [{ "transform": "./node_modules/@nativescript/webpack/transformers/ns-transform-native-classes.js", "type": "raw" }] + "plugins": [{ "transform": "../../node_modules/@nativescript/webpack/transformers/ns-transform-native-classes", "type": "raw" }] }, "include": ["src/**/*", "./references.d.ts"], "exclude": ["node_modules", "platforms", "src/angular/**/*"], - "compileOnSave": false, + "compileOnSave": false }