@elliemae/pui-cli 6.0.0-beta.18 → 6.0.0-beta.21

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.
@@ -5,7 +5,9 @@ const { lintCSS, lintJS } = require('./lint');
5
5
  const { CI = false } = process.env;
6
6
 
7
7
  async function test(commandOptions) {
8
- await exec(`cross-env FORCE_COLOR=true NODE_ENV=test jest ${commandOptions}`);
8
+ await exec(
9
+ `cross-env FORCE_COLOR=true NODE_OPTIONS=--experimental-vm-modules NODE_ENV=test jest ${commandOptions}`,
10
+ );
9
11
  }
10
12
 
11
13
  // eslint-disable-next-line max-statements
package/lib/esbuild.js CHANGED
@@ -1,6 +1,7 @@
1
1
  const esbuild = require('esbuild');
2
2
  const fg = require('fast-glob');
3
3
  const fs = require('fs');
4
+ const path = require('path');
4
5
 
5
6
  const ESBUILD_TARGET = 'es2020';
6
7
 
@@ -9,17 +10,7 @@ const commonConfig = {
9
10
  target: ESBUILD_TARGET,
10
11
  loader: { '.js': 'jsx' },
11
12
  mainFields: ['module', 'browser', 'main'],
12
- plugins: [
13
- {
14
- name: 'extension',
15
- setup(build) {
16
- // eslint-disable-next-line consistent-return
17
- build.onResolve({ filter: /.*/ }, (args) => {
18
- if (args.importer) return { path: `${args.path}.js`, external: true };
19
- });
20
- },
21
- },
22
- ],
13
+ inject: [path.resolve(__dirname, './react-shim.js')],
23
14
  };
24
15
 
25
16
  const distFolder = 'dist';
@@ -39,10 +39,8 @@ const baseRules = {
39
39
  2,
40
40
  'ignorePackages',
41
41
  {
42
- js: 'never',
43
- jsx: 'never',
44
- ts: 'never',
45
- tsx: 'never',
42
+ json: 'ignorePackages',
43
+ js: 'ignorePackages',
46
44
  },
47
45
  ],
48
46
  indent: [
@@ -105,7 +103,7 @@ const reactRules = {
105
103
  'react/react-in-jsx-scope': 0,
106
104
  'react/jsx-filename-extension': [
107
105
  1,
108
- { extensions: ['.js', '.jsx', '.ts', '.tsx'] },
106
+ { extensions: ['.js', '.jsx', '.tsx', '.mdx'] },
109
107
  ],
110
108
  'redux-saga/no-yield-in-race': 2,
111
109
  'redux-saga/yield-effects': 2,
@@ -0,0 +1,2 @@
1
+ import * as React from 'react';
2
+ export { React };
@@ -42,8 +42,8 @@ const jestConfig = {
42
42
  '!app/*/RbGenerated*/*.{js, ts, jsx, tsx}',
43
43
  '!app/index.{js, ts, jsx, tsx}',
44
44
  '!app/global-styles.{js, ts, jsx, tsx}',
45
- '!app/*/*/loadable.{js, ts, jsx, tsx}',
46
- '!lib/*/*/loadable.{js, ts, jsx, tsx}',
45
+ '!app/**/loadable.{js, ts, jsx, tsx}',
46
+ '!lib/**/loadable.{js, ts, jsx, tsx}',
47
47
  ],
48
48
  coverageThreshold: {
49
49
  // Todo: enable the coverage threshold later
@@ -71,12 +71,20 @@ const jestConfig = {
71
71
  },
72
72
  setupFilesAfterEnv: [`${getRootDir()}/lib/testing/setup-tests.js`],
73
73
  setupFiles: ['raf/polyfill', 'whatwg-fetch'],
74
- testRegex: '(app|lib).*/tests/.*\\.test\\.(js|ts)$',
74
+ testRegex: '(app|lib).*/tests/.*\\.test\\.[jt]sx?$',
75
75
  snapshotSerializers: [],
76
76
  testResultsProcessor: 'jest-sonar-reporter',
77
+ resolver: 'ts-jest-resolver',
78
+ transform: {
79
+ '^.+\\.[jt]sx?$': [
80
+ 'esbuild-jest',
81
+ {
82
+ target: 'node14',
83
+ },
84
+ ],
85
+ },
77
86
  transformIgnorePatterns: [
78
- 'node_modules/(?!(@elliemae/*|lodash-es/*)/)',
79
- 'node_modules/@elliemae/em-platform-document-viewer',
87
+ 'node_modules/(?!(@elliemae/pui-cli/lib/testing/*)/)',
80
88
  ],
81
89
  globals: {
82
90
  APP_CONFIG: getAppConfig(),
@@ -86,7 +94,7 @@ const jestConfig = {
86
94
  testEnvironment: 'jsdom',
87
95
  };
88
96
 
89
- if (isReactModule)
97
+ if (isReactModule && jestConfig.setupFilesAfterEnv)
90
98
  jestConfig.setupFilesAfterEnv.push(
91
99
  `${getRootDir()}/lib/testing/setup-styled-components-tests.js`,
92
100
  );
@@ -1,7 +1,7 @@
1
1
  /**
2
2
  *
3
3
  */
4
- export default function () {
4
+ export default () => {
5
5
  Object.defineProperty(window, 'matchMedia', {
6
6
  value: () => ({
7
7
  matches: false,
@@ -15,4 +15,4 @@ export default function () {
15
15
  getPropertyValue: () => {},
16
16
  }),
17
17
  });
18
- }
18
+ };
@@ -1,3 +1 @@
1
- module.exports = {
2
- load: () => {},
3
- };
1
+ export const load = () => {};
@@ -1,36 +1,28 @@
1
- module.exports = {
2
- logger() {
3
- return {
4
- setLogLevel() {},
5
- setOptions() {},
6
- info() {},
7
- warn() {},
8
- error() {},
9
- trace() {},
10
- debug() {},
11
- audit() {},
12
- fatal() {},
13
- };
14
- },
15
- LogLevel: {
16
- info: 'info',
17
- debug: 'debug',
18
- trace: 'trace',
19
- warn: 'warn',
20
- error: 'error',
21
- audit: 'audit',
22
- fatal: 'fatal',
23
- },
24
- Console() {
25
- return {
26
- log() {},
27
- };
28
- },
29
- http() {
30
- return {
31
- log() {},
32
- };
33
- },
34
- webvitals() {},
35
- logUnhandledErrors() {},
1
+ export const logger = () => ({
2
+ setLogLevel() {},
3
+ setOptions() {},
4
+ info() {},
5
+ warn() {},
6
+ error() {},
7
+ trace() {},
8
+ debug() {},
9
+ audit() {},
10
+ fatal() {},
11
+ });
12
+ export const LogLevel = {
13
+ info: 'info',
14
+ debug: 'debug',
15
+ trace: 'trace',
16
+ warn: 'warn',
17
+ error: 'error',
18
+ audit: 'audit',
19
+ fatal: 'fatal',
36
20
  };
21
+ export const Console = () => ({
22
+ log: () => {},
23
+ });
24
+ export const http = () => ({
25
+ log() {},
26
+ });
27
+ export const webvitals = () => {};
28
+ export const logUnhandledErrors = () => {};
@@ -1,5 +1,3 @@
1
- module.exports = {
2
- setCustomUserData: () => {},
3
- setCustomVirtualPageName: () => {},
4
- startVirtualPageMonitoringWithAutoEnd: () => {},
5
- };
1
+ export const setCustomUserData = () => {};
2
+ export const setCustomVirtualPageName = () => {};
3
+ export const startVirtualPageMonitoringWithAutoEnd = () => {};
@@ -1,5 +1,3 @@
1
- module.exports = {
2
- attach: jest.fn(),
3
- detach: jest.fn(),
4
- getConfig: jest.fn(),
5
- };
1
+ export const attach = jest.fn();
2
+ export const detach = jest.fn();
3
+ export const getConfig = jest.fn();
@@ -3,12 +3,12 @@
3
3
  import 'core-js/stable';
4
4
  import 'regenerator-runtime/runtime';
5
5
  import '@testing-library/jest-dom/extend-expect';
6
- import { toHaveNoViolations } from 'jest-axe';
6
+ import jestAxe from 'jest-axe';
7
7
  import ResizeObserver from 'resize-observer-polyfill';
8
- import addMatchMedia from './mocks/matchMedia';
9
- import { logger } from './mocks/pui-diagnostics';
8
+ import addMatchMedia from './mocks/matchMedia.js';
9
+ import { logger } from './mocks/pui-diagnostics.js';
10
10
 
11
- if (expect) expect.extend(toHaveNoViolations);
11
+ if (expect) expect.extend(jestAxe.toHaveNoViolations);
12
12
  jest.setTimeout(60000);
13
13
 
14
14
  const addElementToBody = (element) => {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@elliemae/pui-cli",
3
- "version": "6.0.0-beta.18",
3
+ "version": "6.0.0-beta.21",
4
4
  "private": false,
5
5
  "description": "ICE MT UI Platform CLI",
6
6
  "sideEffects": false,
@@ -70,19 +70,19 @@
70
70
  "@semantic-release/changelog": "~6.0.1",
71
71
  "@semantic-release/exec": "~6.0.2",
72
72
  "@semantic-release/git": "~10.0.1",
73
- "@storybook/addon-a11y": "~6.4.4",
74
- "@storybook/addon-essentials": "~6.4.4",
73
+ "@storybook/addon-a11y": "~6.4.7",
74
+ "@storybook/addon-essentials": "~6.4.7",
75
75
  "@storybook/addon-events": "~6.2.9",
76
- "@storybook/addon-interactions": "~6.4.4",
77
- "@storybook/addon-links": "~6.4.4",
78
- "@storybook/addon-storysource": "~6.4.4",
79
- "@storybook/builder-webpack5": "~6.4.4",
80
- "@storybook/manager-webpack5": "~6.4.4",
81
- "@storybook/react": "~6.4.4",
82
- "@storybook/theming": "~6.4.4",
76
+ "@storybook/addon-interactions": "~6.4.7",
77
+ "@storybook/addon-links": "~6.4.7",
78
+ "@storybook/addon-storysource": "~6.4.7",
79
+ "@storybook/builder-webpack5": "~6.4.7",
80
+ "@storybook/manager-webpack5": "~6.4.7",
81
+ "@storybook/react": "~6.4.7",
82
+ "@storybook/theming": "~6.4.7",
83
83
  "@stylelint/postcss-css-in-js": "~0.37.2",
84
84
  "@svgr/webpack": "~6.1.0",
85
- "@testing-library/jest-dom": "~5.15.1",
85
+ "@testing-library/jest-dom": "~5.16.0",
86
86
  "@testing-library/react": "~12.1.2",
87
87
  "@testing-library/react-hooks": "~7.0.2",
88
88
  "@types/jest": "~27.0.3",
@@ -149,7 +149,7 @@
149
149
  "eslint-plugin-react": "~7.27.1",
150
150
  "eslint-plugin-react-hooks": "~4.3.0",
151
151
  "eslint-plugin-redux-saga": "~1.2.1",
152
- "eslint-plugin-storybook": "~0.5.2",
152
+ "eslint-plugin-storybook": "~0.5.3",
153
153
  "eslint-plugin-testing-library": "~5.0.1",
154
154
  "eslint-plugin-wdio": "~7.4.2",
155
155
  "express-static-gzip": "~2.1.1",
@@ -187,7 +187,7 @@
187
187
  "pino": "~7.5.1",
188
188
  "pino-pretty": "~7.2.0",
189
189
  "pinst": "~2.1.6",
190
- "plop": "~3.0.1",
190
+ "plop": "~3.0.2",
191
191
  "postcss": "~8.4.4",
192
192
  "postcss-jsx": "~0.36.4",
193
193
  "postcss-html": "~1.3.0",
@@ -222,6 +222,7 @@
222
222
  "svg-url-loader": "~7.1.1",
223
223
  "svgo": "~2.8.0",
224
224
  "terser-webpack-plugin": "~5.2.5",
225
+ "ts-jest-resolver": "~2.0.0",
225
226
  "ts-node": "~10.4.0",
226
227
  "tsc-alias": "~1.4.2",
227
228
  "tsc-files": "~1.1.3",