@elliemae/pui-cli 8.17.0-alpha.1 → 8.17.0-alpha.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,37 @@
1
+ const JSDOMEnvironment = require('jest-environment-jsdom');
2
+
3
+ // ICE platform is meant to be run on node > 18
4
+ // "jest-environment-jsdom": "~29.6.3" is instead meant to support node >16
5
+ // features that are supported since node 17 & 18 are not supported in jsdom env
6
+ // the limitation is not relevant for us since we are already running on node 18 anyway,
7
+ // this "ExtendedJSDomEnv" is an extension of the
8
+ // jest.config.cjs
9
+ // {
10
+ // ...
11
+ // testEnvironment: 'jsdom'
12
+ // ...
13
+ // }
14
+ // that actually uses node 18 features that are not supported in "jest-environment-jsdom": "~29.6.3"
15
+
16
+ // https://github.com/facebook/jest/blob/v29.4.3/website/versioned_docs/version-29.4/Configuration.md#testenvironment-string
17
+ class FixJSDOMEnvironment extends JSDOMEnvironment {
18
+ constructor(...args) {
19
+ super(...args);
20
+
21
+ // From here on we are using "node" (currently running version of it) to polyfill jsdom this.global
22
+
23
+ // FIXME https://github.com/jsdom/jsdom/issues/3363
24
+ if (structuredClone) this.global.structuredClone = structuredClone;
25
+
26
+ // FIXME https://github.com/jsdom/jsdom/issues/1724
27
+ if (fetch) this.global.fetch = fetch;
28
+ if (Headers) this.global.Headers = Headers;
29
+ if (Request) this.global.Request = Request;
30
+ if (Response) this.global.Response = Response;
31
+
32
+ // FIXME https://github.com/jsdom/jsdom/issues/1721
33
+ if (URL) this.global.URL = URL;
34
+ if (Blob) this.global.Blob = Blob;
35
+ }
36
+ }
37
+ module.exports = FixJSDOMEnvironment;
@@ -94,7 +94,7 @@ const jestConfig = {
94
94
  url: `http://localhost:3111${basePath}`,
95
95
  resources: 'usable',
96
96
  },
97
- testEnvironment: './ExtendedJSDomEnv.js',
97
+ testEnvironment: path.resolve(__dirname, './ExtendedJSDomEnv.cjs'),
98
98
  watchPlugins: [
99
99
  'jest-watch-typeahead/filename',
100
100
  'jest-watch-typeahead/testname',
@@ -0,0 +1,37 @@
1
+ const JSDOMEnvironment = require('jest-environment-jsdom');
2
+
3
+ // ICE platform is meant to be run on node > 18
4
+ // "jest-environment-jsdom": "~29.6.3" is instead meant to support node >16
5
+ // features that are supported since node 17 & 18 are not supported in jsdom env
6
+ // the limitation is not relevant for us since we are already running on node 18 anyway,
7
+ // this "ExtendedJSDomEnv" is an extension of the
8
+ // jest.config.cjs
9
+ // {
10
+ // ...
11
+ // testEnvironment: 'jsdom'
12
+ // ...
13
+ // }
14
+ // that actually uses node 18 features that are not supported in "jest-environment-jsdom": "~29.6.3"
15
+
16
+ // https://github.com/facebook/jest/blob/v29.4.3/website/versioned_docs/version-29.4/Configuration.md#testenvironment-string
17
+ class FixJSDOMEnvironment extends JSDOMEnvironment {
18
+ constructor(...args) {
19
+ super(...args);
20
+
21
+ // From here on we are using "node" (currently running version of it) to polyfill jsdom this.global
22
+
23
+ // FIXME https://github.com/jsdom/jsdom/issues/3363
24
+ if (structuredClone) this.global.structuredClone = structuredClone;
25
+
26
+ // FIXME https://github.com/jsdom/jsdom/issues/1724
27
+ if (fetch) this.global.fetch = fetch;
28
+ if (Headers) this.global.Headers = Headers;
29
+ if (Request) this.global.Request = Request;
30
+ if (Response) this.global.Response = Response;
31
+
32
+ // FIXME https://github.com/jsdom/jsdom/issues/1721
33
+ if (URL) this.global.URL = URL;
34
+ if (Blob) this.global.Blob = Blob;
35
+ }
36
+ }
37
+ module.exports = FixJSDOMEnvironment;
@@ -94,7 +94,7 @@ const jestConfig = {
94
94
  url: `http://localhost:3111${basePath}`,
95
95
  resources: 'usable',
96
96
  },
97
- testEnvironment: './ExtendedJSDomEnv.js',
97
+ testEnvironment: path.resolve(__dirname, './ExtendedJSDomEnv.cjs'),
98
98
  watchPlugins: [
99
99
  'jest-watch-typeahead/filename',
100
100
  'jest-watch-typeahead/testname',
@@ -0,0 +1,4 @@
1
+ export = FixJSDOMEnvironment;
2
+ declare class FixJSDOMEnvironment {
3
+ constructor(...args: any[]);
4
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@elliemae/pui-cli",
3
- "version": "8.17.0-alpha.1",
3
+ "version": "8.17.0-alpha.3",
4
4
  "description": "ICE MT UI Platform CLI",
5
5
  "sideEffects": false,
6
6
  "type": "module",
@@ -1,53 +0,0 @@
1
- "use strict";
2
- var __create = Object.create;
3
- var __defProp = Object.defineProperty;
4
- var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
5
- var __getOwnPropNames = Object.getOwnPropertyNames;
6
- var __getProtoOf = Object.getPrototypeOf;
7
- var __hasOwnProp = Object.prototype.hasOwnProperty;
8
- var __export = (target, all) => {
9
- for (var name in all)
10
- __defProp(target, name, { get: all[name], enumerable: true });
11
- };
12
- var __copyProps = (to, from, except, desc) => {
13
- if (from && typeof from === "object" || typeof from === "function") {
14
- for (let key of __getOwnPropNames(from))
15
- if (!__hasOwnProp.call(to, key) && key !== except)
16
- __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
17
- }
18
- return to;
19
- };
20
- var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
21
- // If the importer is in node compatibility mode or this is not an ESM
22
- // file that has been converted to a CommonJS file using a Babel-
23
- // compatible transform (i.e. "__esModule" has not been set), then set
24
- // "default" to the CommonJS "module.exports" for node compatibility.
25
- isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
26
- mod
27
- ));
28
- var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
29
- var ExtendedJSDomEnv_exports = {};
30
- __export(ExtendedJSDomEnv_exports, {
31
- default: () => FixJSDOMEnvironment
32
- });
33
- module.exports = __toCommonJS(ExtendedJSDomEnv_exports);
34
- var import_jest_environment_jsdom = __toESM(require("jest-environment-jsdom"), 1);
35
- class FixJSDOMEnvironment extends import_jest_environment_jsdom.default {
36
- constructor(...args) {
37
- super(...args);
38
- if (structuredClone)
39
- this.global.structuredClone = structuredClone;
40
- if (fetch)
41
- this.global.fetch = fetch;
42
- if (Headers)
43
- this.global.Headers = Headers;
44
- if (Request)
45
- this.global.Request = Request;
46
- if (Response)
47
- this.global.Response = Response;
48
- if (URL)
49
- this.global.URL = URL;
50
- if (Blob)
51
- this.global.Blob = Blob;
52
- }
53
- }
@@ -1,23 +0,0 @@
1
- import JSDOMEnvironment from "jest-environment-jsdom";
2
- class FixJSDOMEnvironment extends JSDOMEnvironment {
3
- constructor(...args) {
4
- super(...args);
5
- if (structuredClone)
6
- this.global.structuredClone = structuredClone;
7
- if (fetch)
8
- this.global.fetch = fetch;
9
- if (Headers)
10
- this.global.Headers = Headers;
11
- if (Request)
12
- this.global.Request = Request;
13
- if (Response)
14
- this.global.Response = Response;
15
- if (URL)
16
- this.global.URL = URL;
17
- if (Blob)
18
- this.global.Blob = Blob;
19
- }
20
- }
21
- export {
22
- FixJSDOMEnvironment as default
23
- };
@@ -1,4 +0,0 @@
1
- export default class FixJSDOMEnvironment extends JSDOMEnvironment {
2
- constructor(...args: any[]);
3
- }
4
- import JSDOMEnvironment from 'jest-environment-jsdom';