@elliemae/pui-cli 6.0.0-beta.19 → 6.0.0-beta.22

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.
@@ -4,7 +4,7 @@ const path = require('path');
4
4
  const { writeFile, readFile } = require('fs/promises');
5
5
  const { exec, logInfo, logError, logSuccess } = require('./utils');
6
6
  const { isTypeScriptEnabled } = require('../typescript/util');
7
- const { esBuild } = require('../esbuild');
7
+ const { esBuild } = require('../transpile/esbuild');
8
8
 
9
9
  const { name } = require('../../package.json');
10
10
 
@@ -1,11 +1,13 @@
1
1
  const { exit } = require('yargs');
2
2
  const { exec, logError, logSuccess } = require('./utils');
3
- const { lintCSS, lintJS } = require('./lint');
3
+ // const { lintCSS, lintJS } = require('./lint');
4
4
 
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
@@ -19,20 +21,18 @@ async function handler(argv) {
19
21
  if (argv.r) commandOptions += ' --bail --findRelatedTests';
20
22
  if (argv.s) commandOptions += ' --silent';
21
23
  try {
22
- if (!CI) {
23
- try {
24
- await lintJS();
25
- await lintCSS();
26
- logSuccess('Linting completed');
27
- } catch (err) {
28
- logError('Linting failed');
29
- exit(-1, err);
30
- return -1;
31
- }
32
- } else {
33
- await exec('rimraf ./reports');
34
- }
35
-
24
+ // if (!CI) {
25
+ // try {
26
+ // await lintJS();
27
+ // await lintCSS();
28
+ // logSuccess('Linting completed');
29
+ // } catch (err) {
30
+ // logError('Linting failed');
31
+ // exit(-1, err);
32
+ // return -1;
33
+ // }
34
+ // }
35
+ await exec('rimraf ./reports');
36
36
  // eslint-disable-next-line jest/valid-title, jest/no-disabled-tests, jest/expect-expect
37
37
  await test(commandOptions);
38
38
  logSuccess('Unit test execution completed');
@@ -37,12 +37,10 @@ const baseRules = {
37
37
  'import/prefer-default-export': 0,
38
38
  'import/extensions': [
39
39
  2,
40
- 'ignorePackages',
40
+ 'never',
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,
@@ -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) => {
@@ -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,6 +10,7 @@ const commonConfig = {
9
10
  target: ESBUILD_TARGET,
10
11
  loader: { '.js': 'jsx' },
11
12
  mainFields: ['module', 'browser', 'main'],
13
+ inject: [path.resolve(__dirname, './react-shim.js')],
12
14
  };
13
15
 
14
16
  const distFolder = 'dist';
@@ -0,0 +1,2 @@
1
+ import * as React from 'react';
2
+ export { React };
@@ -17,7 +17,7 @@ const {
17
17
  getAlias,
18
18
  getPaths,
19
19
  } = require('./helpers');
20
- const { ESBUILD_TARGET } = require('../esbuild');
20
+ const { ESBUILD_TARGET } = require('../transpile/esbuild');
21
21
 
22
22
  const minicssLoader = {
23
23
  loader: MiniCssExtractPlugin.loader,
@@ -240,6 +240,6 @@ module.exports = (options) => ({
240
240
  '@elliemae/pui-diagnostics': 'emuiDiagnostics',
241
241
  },
242
242
  devtool: options.devtool || 'eval-source-map',
243
- target: 'web', // Make web variables accessible to webpack, e.g. window
243
+ target: 'web',
244
244
  performance: options.performance || {},
245
245
  });
@@ -105,8 +105,6 @@ const devConfig = {
105
105
  }),
106
106
  ],
107
107
 
108
- // Emit a source map for easier debugging
109
- // See https://webpack.js.org/configuration/devtool/#devtool
110
108
  devtool: 'eval-source-map',
111
109
 
112
110
  performance: {
@@ -19,7 +19,7 @@ const {
19
19
  getAssetPath,
20
20
  getAlias,
21
21
  } = require('./helpers');
22
- const { ESBUILD_TARGET } = require('../esbuild');
22
+ const { ESBUILD_TARGET } = require('../transpile/esbuild');
23
23
 
24
24
  const minicssLoader = {
25
25
  loader: MiniCssExtractPlugin.loader,
@@ -74,7 +74,7 @@ module.exports = (options) => ({
74
74
  module: {
75
75
  rules: [
76
76
  {
77
- test: /^(?!.*\.exec\.js$).*\.(js|ts|jsx|tsx)$/,
77
+ test: /^(?!.*\.exec\.js$).*\.[jt]sx?$/,
78
78
  enforce: 'pre',
79
79
  exclude: /node_modules/,
80
80
  resolve: {
@@ -91,7 +91,7 @@ module.exports = (options) => ({
91
91
  ],
92
92
  },
93
93
  {
94
- test: /^(?!.*\.exec\.js$).*\.(js|ts|jsx|tsx)$/, // Transform all .js and .jsx files with Babel
94
+ test: /^(?!.*\.exec\.js$).*\.jsx?$/, // Transform all .js and .jsx files with Babel
95
95
  exclude: excludeNodeModulesExcept(modulesToTranspile),
96
96
  resolve: {
97
97
  fullySpecified: false,
@@ -104,6 +104,20 @@ module.exports = (options) => ({
104
104
  },
105
105
  },
106
106
  },
107
+ {
108
+ test: /^(?!.*\.exec\.js$).*\.tsx?$/, // Transform all .js and .jsx files with Babel
109
+ exclude: excludeNodeModulesExcept(modulesToTranspile),
110
+ resolve: {
111
+ fullySpecified: false,
112
+ },
113
+ use: {
114
+ loader: 'esbuild-loader',
115
+ options: {
116
+ loader: 'tsx',
117
+ target: ESBUILD_TARGET,
118
+ },
119
+ },
120
+ },
107
121
  {
108
122
  test: /\.exec\.js$/,
109
123
  exclude: /node_modules/,
@@ -155,10 +169,6 @@ module.exports = (options) => ({
155
169
  exclude: excludeNodeModulesExcept(['@elliemae/*']),
156
170
  type: 'asset/resource',
157
171
  },
158
- {
159
- type: 'asset',
160
- resourceQuery: /url/, // *.svg?react
161
- },
162
172
  {
163
173
  test: /\.svg$/i,
164
174
  issuer: /\.[jt]sx?$/,
@@ -183,6 +193,10 @@ module.exports = (options) => ({
183
193
  resourceQuery: /resource/,
184
194
  type: 'asset/resource',
185
195
  },
196
+ {
197
+ type: 'asset',
198
+ resourceQuery: /url/,
199
+ },
186
200
  ],
187
201
  },
188
202
  plugins: plugins.concat(options.plugins || []),
@@ -191,7 +205,6 @@ module.exports = (options) => ({
191
205
  extensions: ['.wasm', '.mjs', '.ts', '.tsx', '.js', '.jsx', '.json'],
192
206
  mainFields: ['browser', 'module', 'main'],
193
207
  alias: {
194
- 'lodash-es': 'lodash',
195
208
  ...getAlias(),
196
209
  ...((options.resolve || {}).alias || {}),
197
210
  },
@@ -43,8 +43,6 @@ module.exports = require('./webpack.lib.base.babel')({
43
43
  }),
44
44
  ],
45
45
 
46
- // Emit a source map for easier debugging
47
- // See https://webpack.js.org/configuration/devtool/#devtool
48
46
  devtool: 'eval-source-map',
49
47
 
50
48
  performance: {
@@ -4,7 +4,7 @@ const HtmlWebpackPlugin = require('html-webpack-plugin');
4
4
  const { BundleAnalyzerPlugin } = require('webpack-bundle-analyzer');
5
5
  const { ESBuildMinifyPlugin } = require('esbuild-loader');
6
6
  const { getLibraryName, getCompressionPlugins } = require('./helpers');
7
- const { ESBUILD_TARGET } = require('../esbuild');
7
+ const { ESBUILD_TARGET } = require('../transpile/esbuild');
8
8
 
9
9
  const libraryName = getLibraryName();
10
10
 
@@ -16,7 +16,7 @@ const {
16
16
  isGoogleTagManagerEnabled,
17
17
  getCompressionPlugins,
18
18
  } = require('./helpers');
19
- const { ESBUILD_TARGET } = require('../esbuild');
19
+ const { ESBUILD_TARGET } = require('../transpile/esbuild');
20
20
 
21
21
  const getProdConfig = ({ latestVersion = true } = {}) => {
22
22
  const { buildPath, publicPath } = getPaths(latestVersion);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@elliemae/pui-cli",
3
- "version": "6.0.0-beta.19",
3
+ "version": "6.0.0-beta.22",
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",
@@ -125,11 +125,11 @@
125
125
  "dotenv": "~10.0.0",
126
126
  "dotenv-webpack": "~7.0.3",
127
127
  "duplicate-package-checker-webpack-plugin": "~3.0.0",
128
- "esbuild": "~0.14.1",
128
+ "esbuild": "~0.14.2",
129
129
  "esbuild-jest": "~0.5.0",
130
130
  "esbuild-loader": "~2.16.0",
131
131
  "esbuild-plugin-svgr": "~0.0.3",
132
- "eslint": "~8.3.0",
132
+ "eslint": "~8.4.0",
133
133
  "eslint-config-airbnb": "~18.2.1",
134
134
  "eslint-config-airbnb-base": "~15.0.0",
135
135
  "eslint-config-airbnb-typescript": "~15.0.0",
@@ -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",
@@ -179,7 +179,7 @@
179
179
  "minimist": "~1.2.5",
180
180
  "moment": "~2.29.1",
181
181
  "moment-locales-webpack-plugin": "~1.2.0",
182
- "msw": "~0.35.0",
182
+ "msw": "~0.36.0",
183
183
  "node-plop": "~0.30.0",
184
184
  "nodemon": "~2.0.15",
185
185
  "npm-check-updates": "12.0.2",
@@ -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",
@@ -195,7 +195,7 @@
195
195
  "postcss-syntax": "~0.36.2",
196
196
  "postcss-loader": "~6.2.1",
197
197
  "postcss-preset-env": "~7.0.1",
198
- "prettier": "~2.5.0",
198
+ "prettier": "~2.5.1",
199
199
  "pug": "~3.0.2",
200
200
  "pug-loader": "~2.4.0",
201
201
  "raf": "~3.4.1",
@@ -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",