From 5abf3ce4c6ef6600ac08cd404e9be09cf98ef5df Mon Sep 17 00:00:00 2001 From: Floris Bernard Date: Fri, 22 Feb 2019 12:01:09 +0100 Subject: [PATCH] Fix build errors Output declarations to a temporary directory, because TS will add the declaration directory to excludes. Make a field public because the declarations build doesn't allow for private fields in some places. --- .gitignore | 1 + .npmignore | 1 + package.json | 4 ++-- src/lib/IsomorphicBaseEvent.ts | 2 +- tsconfig.build.json | 2 +- tsconfig.json | 4 ++-- 6 files changed, 8 insertions(+), 6 deletions(-) diff --git a/.gitignore b/.gitignore index fabec19..d9a5442 100644 --- a/.gitignore +++ b/.gitignore @@ -10,6 +10,7 @@ node_modules/ /coverage/ /.nyc_output/ /tmp/ +/decl/ ## only ignore in git /lib diff --git a/.npmignore b/.npmignore index 98d0a4f..749c5fe 100644 --- a/.npmignore +++ b/.npmignore @@ -10,6 +10,7 @@ node_modules/ /coverage/ /.nyc_output/ /tmp/ +/decl/ # .npmignore .babelrc diff --git a/package.json b/package.json index 8e32f25..2c4f3e5 100755 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "seng-event", - "version": "2.0.0-alpha.4", + "version": "2.0.0-alpha.5", "description": "Provides Classes and utilities for dispatching and listening to events.", "main": "./index.js", "types": "./index.d.ts", @@ -12,7 +12,7 @@ "dev:ts": "tsc --noEmit --allowJs --watch", "build": "npm-run-all -s clean build:*", "build:babel": "babel ./src -x \".ts\" -x \".js\" --out-dir ./", - "build:ts": "tsc -p ./tsconfig.build.json", + "build:ts": "tsc -p ./tsconfig.build.json && shx cp -Rf decl/* .", "test": "jest", "test:types": "typings-checker --allow-expect-error --project tsconfig.json test/types/tests.ts", "test:dev": "jest --watch", diff --git a/src/lib/IsomorphicBaseEvent.ts b/src/lib/IsomorphicBaseEvent.ts index 0a5ff70..10c5a37 100644 --- a/src/lib/IsomorphicBaseEvent.ts +++ b/src/lib/IsomorphicBaseEvent.ts @@ -17,7 +17,7 @@ class IsomorphicBaseEvent< public type: TType; public data: DataForIsomorphicEvent; - private typeOptions: EventOptionsMap; + public typeOptions: EventOptionsMap; constructor( type: TType, diff --git a/tsconfig.build.json b/tsconfig.build.json index 7ed50d9..a927159 100755 --- a/tsconfig.build.json +++ b/tsconfig.build.json @@ -4,7 +4,7 @@ "allowJs": false, "outDir": "tmp", "declaration": true, - "declarationDir": "./", + "declarationDir": "./decl", "emitDeclarationOnly": true } } diff --git a/tsconfig.json b/tsconfig.json index 915040f..7785c9d 100755 --- a/tsconfig.json +++ b/tsconfig.json @@ -24,7 +24,7 @@ ] }, "include": [ - "src/**/*", - "types/**/*.d.ts" + "./src/**/*", + "./types/**/*.d.ts" ] }