From 4c77e544781137755a4ea768db75a7fc3f4036c3 Mon Sep 17 00:00:00 2001 From: Rob Wormald Date: Thu, 26 May 2016 18:18:11 -0700 Subject: [PATCH 1/3] fix(types): use default syntax for typedef this will enable projects consuming symbol-observable from TS (eg, RxJS) to use ```typescript import $$observable from 'symbol-observable' ``` rather than ```typescript import * as $$observable from 'symbol-observable' ``` This might? require downstream changes on RxJS but its more correct methinks. --- index.d.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/index.d.ts b/index.d.ts index e5dd040..6816a1d 100644 --- a/index.d.ts +++ b/index.d.ts @@ -1,2 +1,2 @@ declare const observableSymbol: symbol; -export = observableSymbol; \ No newline at end of file +export default observableSymbol; From 4046dade0dc6117c5cffff55e453dd264aa1645f Mon Sep 17 00:00:00 2001 From: Ben Lesh Date: Sat, 28 May 2016 13:08:51 -0700 Subject: [PATCH 2/3] test(typescript): add TypeScript test to ensure it imports and compiles okay --- .gitignore | 1 + package.json | 4 +++- ts-test/test.ts | 9 +++++++++ 3 files changed, 13 insertions(+), 1 deletion(-) create mode 100644 ts-test/test.ts diff --git a/.gitignore b/.gitignore index 491fc35..92b258f 100644 --- a/.gitignore +++ b/.gitignore @@ -1,2 +1,3 @@ node_modules lib +ts-test/test.js diff --git a/package.json b/package.json index fd6ff64..8f09986 100644 --- a/package.json +++ b/package.json @@ -12,6 +12,7 @@ "node": ">=0.10.0" }, "scripts": { + "test": "mocha && tsc ./ts-test/test.ts && node ./ts-test/test.js" "build": "babel es --out-dir lib", "test": "npm run build && mocha", "prepublish": "npm test" @@ -38,6 +39,7 @@ "babel-plugin-add-module-exports": "^0.2.1", "babel-preset-es2015": "^6.9.0", "chai": "^3.5.0", - "mocha": "^2.4.5" + "mocha": "^2.4.5", + "typescript": "^1.8.10" } } diff --git a/ts-test/test.ts b/ts-test/test.ts new file mode 100644 index 0000000..69e8c4b --- /dev/null +++ b/ts-test/test.ts @@ -0,0 +1,9 @@ +import $$symbolObservable from '../'; + +console.log('***********************'); +console.log('RUNNING TYPESCRIPT TEST'); +console.log('***********************'); + +if (typeof $$symbolObservable !== 'symbol' && $$symbolObservable !== '@@observable') { + throw new Error('Sorry, $symbolObservable is ' + JSON.stringify($$symbolObservable)); +} From 03f1d1fe002423acebf32379efb66d75f16ed64d Mon Sep 17 00:00:00 2001 From: Ben Lesh Date: Sat, 28 May 2016 13:50:38 -0700 Subject: [PATCH 3/3] refactor(conflicts): resolving merge issues --- es/index.js | 7 +++++-- package.json | 3 +-- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/es/index.js b/es/index.js index dacce17..548ba11 100644 --- a/es/index.js +++ b/es/index.js @@ -1,11 +1,14 @@ /* global window */ import ponyfill from './ponyfill'; -let root = this; +var root = this; if (typeof global !== 'undefined') { root = global; } else if (typeof window !== 'undefined') { root = window; } -export default ponyfill(root); +var result = ponyfill(root); +// being explicit +result['default'] = result; +export default result; diff --git a/package.json b/package.json index 8f09986..dbf9350 100644 --- a/package.json +++ b/package.json @@ -12,9 +12,8 @@ "node": ">=0.10.0" }, "scripts": { - "test": "mocha && tsc ./ts-test/test.ts && node ./ts-test/test.js" + "test": "npm run build && mocha && tsc ./ts-test/test.ts && node ./ts-test/test.js", "build": "babel es --out-dir lib", - "test": "npm run build && mocha", "prepublish": "npm test" }, "files": [