@elliemae/pui-cli 9.0.0-next.62 → 9.0.0-next.63

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.
@@ -32,6 +32,7 @@ __export(eslint_config_exports, {
32
32
  });
33
33
  module.exports = __toCommonJS(eslint_config_exports);
34
34
  var import_node_path = __toESM(require("node:path"));
35
+ var import_node_fs = require("node:fs");
35
36
  var import_node_url = require("node:url");
36
37
  var import_globals = __toESM(require("globals"));
37
38
  var import_js = __toESM(require("@eslint/js"));
@@ -237,9 +238,12 @@ const reactConfig = {
237
238
  ...import_eslint_plugin_react_hooks.default.configs.recommended.rules
238
239
  }
239
240
  };
240
- const config = import_typescript_eslint.default.config(
241
- ignores,
242
- (0, import_compat.includeIgnoreFile)(gitignorePath),
241
+ const gitignorExists = (0, import_node_fs.existsSync)(gitignorePath);
242
+ const tseslintConfigArgs = [ignores];
243
+ if (gitignorExists) {
244
+ tseslintConfigArgs.push((0, import_compat.includeIgnoreFile)(gitignorePath));
245
+ }
246
+ tseslintConfigArgs.push(
243
247
  {
244
248
  ignores: ["**/*.stories.mdx"],
245
249
  extends: [mdx.flat]
@@ -250,10 +254,10 @@ const config = import_typescript_eslint.default.config(
250
254
  import_eslint_plugin_import_x.default.flatConfigs.typescript,
251
255
  jestConfig,
252
256
  import_recommended.default,
253
- //jsdoc.configs["flat/recommended"],
254
257
  reactConfig,
255
258
  e2eTestConfig,
256
259
  sbConfig,
257
260
  jsRulesConfig,
258
261
  options
259
262
  );
263
+ const config = import_typescript_eslint.default.config(...tseslintConfigArgs);
@@ -1,3 +1,4 @@
1
+ /* eslint-disable complexity */
1
2
  const { TestEnvironment } = require('jest-environment-jsdom');
2
3
 
3
4
  // ICE platform is meant to be run on node > 18
@@ -19,9 +20,27 @@ class FixJSDOMEnvironment extends TestEnvironment {
19
20
  super(...args);
20
21
 
21
22
  // From here on we are using "node" (currently running version of it) to polyfill jsdom this.global
23
+ if (ReadableStream) this.global.ReadableStream = ReadableStream;
24
+ if (TextDecoder) this.global.TextDecoder = TextDecoder;
25
+ if (TextEncoder) this.global.TextEncoder = TextEncoder;
26
+
27
+ if (Blob) this.global.Blob = Blob;
28
+ if (File) this.global.File = File;
29
+ if (Headers) this.global.Headers = Headers;
30
+ if (FormData) this.global.FormData = FormData;
31
+ if (Request) this.global.Request = Request;
32
+ if (Response) this.global.Response = Response;
33
+ if (Request) this.global.Request = Request;
34
+ if (Response) this.global.Response = Response;
35
+ if (fetch) this.global.fetch = fetch;
22
36
 
23
37
  // FIXME https://github.com/jsdom/jsdom/issues/3363
24
38
  if (structuredClone) this.global.structuredClone = structuredClone;
39
+
40
+ // "mocking" MessagePort so undici can work
41
+ if (MessagePort) this.global.MessagePort = MessagePort;
42
+ // if MessagePort is not defined, we are creating a mock class that does nothing but won't throw
43
+ else this.global.MessagePort = class {};
25
44
  }
26
45
  }
27
46
  module.exports = FixJSDOMEnvironment;
@@ -1,4 +1,5 @@
1
1
  import path from "node:path";
2
+ import { existsSync } from "node:fs";
2
3
  import { fileURLToPath } from "node:url";
3
4
  import globals from "globals";
4
5
  import eslint from "@eslint/js";
@@ -203,9 +204,12 @@ const reactConfig = {
203
204
  ...reactHookPlugin.configs.recommended.rules
204
205
  }
205
206
  };
206
- const config = tseslint.config(
207
- ignores,
208
- includeIgnoreFile(gitignorePath),
207
+ const gitignorExists = existsSync(gitignorePath);
208
+ const tseslintConfigArgs = [ignores];
209
+ if (gitignorExists) {
210
+ tseslintConfigArgs.push(includeIgnoreFile(gitignorePath));
211
+ }
212
+ tseslintConfigArgs.push(
209
213
  {
210
214
  ignores: ["**/*.stories.mdx"],
211
215
  extends: [mdx.flat]
@@ -216,13 +220,13 @@ const config = tseslint.config(
216
220
  eslintPluginImportX.flatConfigs.typescript,
217
221
  jestConfig,
218
222
  prettierRecommended,
219
- //jsdoc.configs["flat/recommended"],
220
223
  reactConfig,
221
224
  e2eTestConfig,
222
225
  sbConfig,
223
226
  jsRulesConfig,
224
227
  options
225
228
  );
229
+ const config = tseslint.config(...tseslintConfigArgs);
226
230
  export {
227
231
  config
228
232
  };
@@ -1,3 +1,4 @@
1
+ /* eslint-disable complexity */
1
2
  const { TestEnvironment } = require('jest-environment-jsdom');
2
3
 
3
4
  // ICE platform is meant to be run on node > 18
@@ -19,9 +20,27 @@ class FixJSDOMEnvironment extends TestEnvironment {
19
20
  super(...args);
20
21
 
21
22
  // From here on we are using "node" (currently running version of it) to polyfill jsdom this.global
23
+ if (ReadableStream) this.global.ReadableStream = ReadableStream;
24
+ if (TextDecoder) this.global.TextDecoder = TextDecoder;
25
+ if (TextEncoder) this.global.TextEncoder = TextEncoder;
26
+
27
+ if (Blob) this.global.Blob = Blob;
28
+ if (File) this.global.File = File;
29
+ if (Headers) this.global.Headers = Headers;
30
+ if (FormData) this.global.FormData = FormData;
31
+ if (Request) this.global.Request = Request;
32
+ if (Response) this.global.Response = Response;
33
+ if (Request) this.global.Request = Request;
34
+ if (Response) this.global.Response = Response;
35
+ if (fetch) this.global.fetch = fetch;
22
36
 
23
37
  // FIXME https://github.com/jsdom/jsdom/issues/3363
24
38
  if (structuredClone) this.global.structuredClone = structuredClone;
39
+
40
+ // "mocking" MessagePort so undici can work
41
+ if (MessagePort) this.global.MessagePort = MessagePort;
42
+ // if MessagePort is not defined, we are creating a mock class that does nothing but won't throw
43
+ else this.global.MessagePort = class {};
25
44
  }
26
45
  }
27
46
  module.exports = FixJSDOMEnvironment;
@@ -1,3 +1,4 @@
1
1
  export type { TSESLint } from "@typescript-eslint/utils";
2
- export declare const config: import("@typescript-eslint/utils/ts-eslint").FlatConfig.ConfigArray;
2
+ declare const config: import("@typescript-eslint/utils/ts-eslint").FlatConfig.ConfigArray;
3
+ export { config };
3
4
  //# sourceMappingURL=eslint.config.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"eslint.config.d.ts","sourceRoot":"","sources":["../../../../lib/lint-config/eslint.config.ts"],"names":[],"mappings":"AAqBA,YAAY,EAAE,QAAQ,EAAE,MAAM,0BAA0B,CAAC;AAuMzD,eAAO,MAAM,MAAM,qEAmBlB,CAAC"}
1
+ {"version":3,"file":"eslint.config.d.ts","sourceRoot":"","sources":["../../../../lib/lint-config/eslint.config.ts"],"names":[],"mappings":"AAyBA,YAAY,EAAE,QAAQ,EAAE,MAAM,0BAA0B,CAAC;AAkOzD,QAAA,MAAM,MAAM,qEAAyC,CAAC;AAEtD,OAAO,EAAE,MAAM,EAAE,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"ExtendedJSDomEnv.d.cts","sourceRoot":"","sources":["../../../../lib/testing/ExtendedJSDomEnv.cjs"],"names":[],"mappings":";;AAgBA;IACE,4BAOC;CACF"}
1
+ {"version":3,"file":"ExtendedJSDomEnv.d.cts","sourceRoot":"","sources":["../../../../lib/testing/ExtendedJSDomEnv.cjs"],"names":[],"mappings":";;AAiBA;IACE,4BAyBC;CACF"}