From 6b21d12b23805e789fbfc619f37e045e06cd5940 Mon Sep 17 00:00:00 2001 From: EisenbergEffect Date: Sat, 3 Mar 2018 15:41:16 -0800 Subject: [PATCH] chore(all): prepare release 1.0.0-beta.3.1.0 --- dist/global.d.ts | 1 + dist/index.js | 1 + dist/index.js.map | 2 +- dist/nodejs-dom.d.ts | 1 + dist/nodejs-dom.js | 1 + dist/nodejs-dom.js.map | 2 +- dist/nodejs-global.d.ts | 1 + doc/CHANGELOG.md | 16 +++++++++++++--- package.json | 2 +- 9 files changed, 21 insertions(+), 6 deletions(-) diff --git a/dist/global.d.ts b/dist/global.d.ts index e3b71c5..739781d 100644 --- a/dist/global.d.ts +++ b/dist/global.d.ts @@ -2,6 +2,7 @@ import { DOMWindow, JSDOM } from 'jsdom'; export interface IGlobal extends DOMWindow { MutationObserver: typeof MutationObserver; Element: typeof Element; + NodeList: typeof NodeList; jsdom: typeof JSDOM; SVGElement: typeof SVGElement; XMLHttpRequest: typeof XMLHttpRequest; diff --git a/dist/index.js b/dist/index.js index 72e6b5e..b718104 100644 --- a/dist/index.js +++ b/dist/index.js @@ -74,6 +74,7 @@ function globalize() { global.window = global.self = aurelia_pal_1.PLATFORM.global; global.document = aurelia_pal_1.PLATFORM.global.document; global.Element = aurelia_pal_1.DOM.Element; + global.NodeList = aurelia_pal_1.PLATFORM.global.NodeList; global.SVGElement = aurelia_pal_1.DOM.SVGElement; global.HTMLElement = aurelia_pal_1.PLATFORM.global.HTMLElement; global.requestAnimationFrame = aurelia_pal_1.PLATFORM.global.requestAnimationFrame; diff --git a/dist/index.js.map b/dist/index.js.map index 93285f7..3a52f88 100644 --- a/dist/index.js.map +++ b/dist/index.js.map @@ -1 +1 @@ -{"version":3,"sources":["index.ts"],"names":[],"mappings":";AAAA,2CAA2C;;AAE3C,6CAAmF;AACnF,6DAAgD;AAChD,qEAAiE;AAEjE;;EAEE;AACF;IACE,EAAE,CAAC,CAAC,2BAAa,CAAC,CAAC,CAAC;QAClB,MAAM,CA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EAAR,sBAAQ,EAAE,OAAO,EAAP,qBAAO;KACvB,CAAC;IACF,MAAM,CAAC,MAAM,CAAC;AAChB,CAAC;AAvBD,8BAuBC;AAED,eAAsB,MAAe;IACnC,EAAE,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC;QACX,MAAM,CAAC,KAAK,EAAE,CAAC;IACjB,CAAC;IAED,oCAAgB,CAAC,WAAW,EAAE,CAAC,QAAQ,EAAE,CAAC;AAC5C,CAAC;AAND,sBAMC","file":"index.js","sourcesContent":["/// \n\nimport { initializePAL, DOM, PLATFORM, FEATURE, isInitialized } from 'aurelia-pal';\nimport { buildPal } from './nodejs-pal-builder';\nimport { MutationNotifier } from './polyfills/mutation-observer';\n\n/**\n* Initializes the PAL with the NodeJS-targeted implementation.\n*/\nexport function initialize(): void {\n if (isInitialized) {\n return;\n }\n\n let pal = buildPal();\n\n initializePAL((platform, feature, dom) => {\n Object.assign(platform, pal.platform);\n Object.setPrototypeOf(platform, pal.platform.constructor.prototype);\n\n Object.assign(dom, pal.dom);\n Object.setPrototypeOf(dom, pal.dom.constructor.prototype);\n\n Object.assign(feature, pal.feature);\n Object.setPrototypeOf(feature, pal.feature.constructor.prototype);\n\n (function (global) {\n global.console = global.console || {};\n let con = global.console;\n let prop;\n let method;\n let empty = {};\n let dummy = function () { };\n let properties = 'memory'.split(',');\n let methods = ('assert,clear,count,debug,dir,dirxml,error,exception,group,' +\n 'groupCollapsed,groupEnd,info,log,markTimeline,profile,profiles,profileEnd,' +\n 'show,table,time,timeEnd,timeline,timelineEnd,timeStamp,trace,warn').split(',');\n while (prop = properties.pop()) if (!con[prop]) con[prop] = empty;\n while (method = methods.pop()) if (!con[method]) con[method] = dummy;\n })(platform.global);\n\n if (platform.global.console && typeof console.log === 'object') {\n if (typeof console['debug'] === 'undefined') {\n console['debug'] = this.bind(console['log'], console);\n }\n ['log', 'info', 'warn', 'error', 'assert', 'dir', 'clear', 'profile', 'profileEnd'].forEach(function (method) {\n console[method] = this.bind(console[method], console);\n }, Function.prototype.call);\n }\n\n Object.defineProperty(dom, 'title', {\n get: function () {\n return pal.global.document.title;\n },\n set: function (value) {\n pal.global.document.title = value;\n }\n });\n\n Object.defineProperty(dom, 'activeElement', {\n get: function () {\n return pal.global.document.activeElement;\n }\n });\n\n Object.defineProperty(platform, 'XMLHttpRequest', {\n get: function () {\n return pal.global.XMLHttpRequest;\n }\n });\n });\n}\n\n/**\n * @description initializes and makes variables like 'window' into NodeJS globals\n */\nexport function globalize() {\n initialize();\n global.window = global.self = PLATFORM.global;\n global.document = PLATFORM.global.document;\n global.Element = DOM.Element;\n global.SVGElement = DOM.SVGElement;\n global.HTMLElement = PLATFORM.global.HTMLElement;\n global.requestAnimationFrame = PLATFORM.global.requestAnimationFrame;\n global.location = PLATFORM.location;\n global.history = PLATFORM.history;\n global.System = {\n import(moduleId: string) {\n try {\n return Promise.resolve(require(moduleId));\n } catch (e) {\n return Promise.reject(e);\n }\n }\n };\n global.PAL = {\n DOM, PLATFORM, FEATURE\n };\n return global;\n}\n\nexport function reset(window?: Window) {\n if (window) {\n window.close();\n }\n\n MutationNotifier.getInstance().destruct();\n}"],"sourceRoot":"../src/"} \ No newline at end of file +{"version":3,"sources":["index.ts"],"names":[],"mappings":";AAAA,2CAA2C;;AAE3C,6CAAmF;AACnF,6DAAgD;AAChD,qEAAiE;AAEjE;;EAEE;AACF;IACE,EAAE,CAAC,CAAC,2BAAa,CAAC,CAAC,CAAC;QAClB,MAAM,CAAC;IACT,CAAC;IAED,IAAI,GAAG,GAAG,6BAAQ,EAAE,CAAC;IAErB,2BAAa,CAAC,CAAC,QAAQ,EAAE,OAAO,EAAE,GAAG;QACnC,MAAM,CAAC,MAAM,CAAC,QAAQ,EAAE,GAAG,CAAC,QAAQ,CAAC,CAAC;QACtC,MAAM,CAAC,cAAc,CAAC,QAAQ,EAAE,GAAG,CAAC,QAAQ,CAAC,WAAW,CAAC,SAAS,CAAC,CAAC;QAEpE,MAAM,CAAC,MAAM,CAAC,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EAAE,CAAC,QAAQ,EAAE,CAAC;AAC5C,CAAC;AAND,sBAMC","file":"index.js","sourcesContent":["/// \n\nimport { initializePAL, DOM, PLATFORM, FEATURE, isInitialized } from 'aurelia-pal';\nimport { buildPal } from './nodejs-pal-builder';\nimport { MutationNotifier } from './polyfills/mutation-observer';\n\n/**\n* Initializes the PAL with the NodeJS-targeted implementation.\n*/\nexport function initialize(): void {\n if (isInitialized) {\n return;\n }\n\n let pal = buildPal();\n\n initializePAL((platform, feature, dom) => {\n Object.assign(platform, pal.platform);\n Object.setPrototypeOf(platform, pal.platform.constructor.prototype);\n\n Object.assign(dom, pal.dom);\n Object.setPrototypeOf(dom, pal.dom.constructor.prototype);\n\n Object.assign(feature, pal.feature);\n Object.setPrototypeOf(feature, pal.feature.constructor.prototype);\n\n (function (global) {\n global.console = global.console || {};\n let con = global.console;\n let prop;\n let method;\n let empty = {};\n let dummy = function () { };\n let properties = 'memory'.split(',');\n let methods = ('assert,clear,count,debug,dir,dirxml,error,exception,group,' +\n 'groupCollapsed,groupEnd,info,log,markTimeline,profile,profiles,profileEnd,' +\n 'show,table,time,timeEnd,timeline,timelineEnd,timeStamp,trace,warn').split(',');\n while (prop = properties.pop()) if (!con[prop]) con[prop] = empty;\n while (method = methods.pop()) if (!con[method]) con[method] = dummy;\n })(platform.global);\n\n if (platform.global.console && typeof console.log === 'object') {\n if (typeof console['debug'] === 'undefined') {\n console['debug'] = this.bind(console['log'], console);\n }\n ['log', 'info', 'warn', 'error', 'assert', 'dir', 'clear', 'profile', 'profileEnd'].forEach(function (method) {\n console[method] = this.bind(console[method], console);\n }, Function.prototype.call);\n }\n\n Object.defineProperty(dom, 'title', {\n get: function () {\n return pal.global.document.title;\n },\n set: function (value) {\n pal.global.document.title = value;\n }\n });\n\n Object.defineProperty(dom, 'activeElement', {\n get: function () {\n return pal.global.document.activeElement;\n }\n });\n\n Object.defineProperty(platform, 'XMLHttpRequest', {\n get: function () {\n return pal.global.XMLHttpRequest;\n }\n });\n });\n}\n\n/**\n * @description initializes and makes variables like 'window' into NodeJS globals\n */\nexport function globalize() {\n initialize();\n global.window = global.self = PLATFORM.global;\n global.document = PLATFORM.global.document;\n global.Element = DOM.Element;\n global.NodeList = PLATFORM.global.NodeList;\n global.SVGElement = DOM.SVGElement;\n global.HTMLElement = PLATFORM.global.HTMLElement;\n global.requestAnimationFrame = PLATFORM.global.requestAnimationFrame;\n global.location = PLATFORM.location;\n global.history = PLATFORM.history;\n global.System = {\n import(moduleId: string) {\n try {\n return Promise.resolve(require(moduleId));\n } catch (e) {\n return Promise.reject(e);\n }\n }\n };\n global.PAL = {\n DOM, PLATFORM, FEATURE\n };\n return global;\n}\n\nexport function reset(window?: Window) {\n if (window) {\n window.close();\n }\n\n MutationNotifier.getInstance().destruct();\n}"],"sourceRoot":"../src/"} \ No newline at end of file diff --git a/dist/nodejs-dom.d.ts b/dist/nodejs-dom.d.ts index b5f9abe..6a9fa11 100644 --- a/dist/nodejs-dom.d.ts +++ b/dist/nodejs-dom.d.ts @@ -7,6 +7,7 @@ export declare class NodeJsDom implements IDom { global: IGlobal; constructor(global: IGlobal); Element: typeof Element; + NodeList: typeof NodeList; SVGElement: typeof SVGElement | any; boundary: string; title: string; diff --git a/dist/nodejs-dom.js b/dist/nodejs-dom.js index b8ab914..b7a6fa2 100644 --- a/dist/nodejs-dom.js +++ b/dist/nodejs-dom.js @@ -10,6 +10,7 @@ class NodeJsDom { this.title = ""; this.activeElement = null; this.Element = global.Element; + this.NodeList = global.NodeList; this.SVGElement = global.SVGElement || class SVGElement extends global.Element { }; } diff --git a/dist/nodejs-dom.js.map b/dist/nodejs-dom.js.map index 7df2a7e..2370f77 100644 --- a/dist/nodejs-dom.js.map +++ b/dist/nodejs-dom.js.map @@ -1 +1 @@ -{"version":3,"sources":["nodejs-dom.ts"],"names":[],"mappings":";;AAGA;;EAEE;AACF;IAEE,YAAmB,MAAe;QAAf,WAAM,GAAN,MAAM,CAAS;QAOlC,aAAQ,GAAW,sBAA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YAAY,CAAC,OAAO,EAAE,IAAI,CAAC,CAAC;QACzC,CAAC;IACH,CAAC;IAED,UAAU,CAAC,IAAU,EAAE,UAAiB;QACtC,EAAE,CAAC,CAAC,IAAI,CAAC,UAAU,CAAC,CAAC,CAAC;YACpB,IAAI,CAAC,UAAU,CAAC,WAAW,CAAC,IAAI,CAAC,CAAC;QACpC,CAAC;QACD,IAAI,CAAC,CAAC;YACJ,UAAU,CAAC,WAAW,CAAC,IAAI,CAAC,CAAC;QAC/B,CAAC;IACH,CAAC;CACF;AA5GD,8BA4GC","file":"nodejs-dom.js","sourcesContent":["import { IDom } from './dom';\nimport { IGlobal } from './global';\n\n/**\n* Represents the core APIs of the DOM.\n*/\nexport class NodeJsDom implements IDom {\n\n constructor(public global: IGlobal) {\n this.Element = global.Element;\n this.SVGElement = global.SVGElement || class SVGElement extends global.Element { };\n }\n\n Element: typeof Element;\n SVGElement: typeof SVGElement /* until a proper implementation is ready: */ | any;\n boundary: string = 'aurelia-dom-boundary';\n title: string = \"\";\n activeElement: Element = null;\n\n addEventListener(eventName: string, callback: EventListener, capture: boolean): void {\n return this.global.document.addEventListener(eventName, callback, capture);\n }\n removeEventListener(eventName: string, callback: EventListener, capture: boolean): void {\n return this.global.document.removeEventListener(eventName, callback, capture);\n }\n createElement(tagName: string): Element {\n return this.global.document.createElement(tagName);\n }\n createAttribute(name: string): Attr {\n return this.global.document.createAttribute(name);\n }\n createTextNode(text: string): Text {\n return this.global.document.createTextNode(text);\n }\n createComment(text: string): Comment {\n return this.global.document.createComment(text);\n }\n createDocumentFragment(): DocumentFragment {\n return this.global.document.createDocumentFragment();\n }\n createTemplateElement(): HTMLTemplateElement {\n return this.global.document.createElement('template');\n }\n createMutationObserver(callback: (changes: MutationRecord[], instance: MutationObserver) => void): MutationObserver {\n return new ((this.global.window).MutationObserver)(callback);\n }\n createCustomEvent(eventType: string, options: Object): CustomEvent {\n return new this.global.CustomEvent(eventType, options);\n }\n dispatchEvent(evt: Event): void {\n this.global.window.dispatchEvent(evt);\n }\n getComputedStyle(element: Element): CSSStyleDeclaration {\n return this.global.window.getComputedStyle(element);\n }\n getElementById(id: string): Element {\n return this.global.document.getElementById(id);\n }\n querySelectorAll(query: string): NodeList {\n return this.global.document.querySelectorAll(query);\n }\n nextElementSibling(element: Element): Element {\n return element.nextElementSibling;\n }\n createTemplateFromMarkup(markup: string): Element {\n let parser = this.global.document.createElement('div');\n parser.innerHTML = markup;\n\n let temp = parser.firstElementChild;\n if (!temp || temp.nodeName !== 'TEMPLATE') {\n throw new Error('Template markup must be wrapped in a