@elliemae/pui-cli 8.29.0 → 8.29.1
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.
- package/dist/cjs/commands/utils.js +3 -1
- package/dist/cjs/monorepo/set-registry-version.js +3 -3
- package/dist/cjs/monorepo/set-workspace-version.js +3 -3
- package/dist/cjs/transpile/esbuild.js +3 -3
- package/dist/cjs/webpack/webpack.lib.dev.babel.js +3 -1
- package/dist/cjs/webpack/webpack.lib.prod.babel.js +3 -1
- package/dist/esm/commands/utils.js +3 -1
- package/dist/esm/monorepo/set-registry-version.js +3 -3
- package/dist/esm/monorepo/set-workspace-version.js +3 -3
- package/dist/esm/transpile/esbuild.js +3 -3
- package/dist/esm/webpack/webpack.lib.dev.babel.js +3 -1
- package/dist/esm/webpack/webpack.lib.prod.babel.js +3 -1
- package/package.json +20 -20
- package/dist/cjs/babel.config.cjs +0 -97
- package/dist/cjs/index.cjs +0 -23
- package/dist/cjs/jsdoc.conf.json +0 -17
- package/dist/cjs/lint-config/commitlint.config.cjs +0 -1
- package/dist/cjs/lint-config/eslint/common.cjs +0 -164
- package/dist/cjs/lint-config/eslint/non-react.cjs +0 -14
- package/dist/cjs/lint-config/eslint/react.cjs +0 -26
- package/dist/cjs/lint-config/eslint/typescript/common.cjs +0 -49
- package/dist/cjs/lint-config/eslint/typescript/non-react.cjs +0 -12
- package/dist/cjs/lint-config/eslint/typescript/react.cjs +0 -19
- package/dist/cjs/lint-config/prettier.config.cjs +0 -8
- package/dist/cjs/lint-config/stylelint.config.cjs +0 -20
- package/dist/cjs/monorepo/utils.cjs +0 -30
- package/dist/cjs/release.config.cjs +0 -24
- package/dist/cjs/testing/jest.config.cjs +0 -110
- package/dist/cjs/testing/jest.node.config.cjs +0 -8
- package/dist/cjs/testing/resolver.cjs +0 -47
- package/dist/cjs/transpile/.swcrc +0 -11
- package/dist/cjs/transpile/swcrc.config.cjs +0 -13
- package/dist/cjs/typedoc.cjs +0 -12
- package/dist/cjs/utils.cjs +0 -23
- package/dist/esm/babel.config.cjs +0 -97
- package/dist/esm/index.cjs +0 -23
- package/dist/esm/jsdoc.conf.json +0 -17
- package/dist/esm/lint-config/commitlint.config.cjs +0 -1
- package/dist/esm/lint-config/eslint/common.cjs +0 -164
- package/dist/esm/lint-config/eslint/non-react.cjs +0 -14
- package/dist/esm/lint-config/eslint/react.cjs +0 -26
- package/dist/esm/lint-config/eslint/typescript/common.cjs +0 -49
- package/dist/esm/lint-config/eslint/typescript/non-react.cjs +0 -12
- package/dist/esm/lint-config/eslint/typescript/react.cjs +0 -19
- package/dist/esm/lint-config/prettier.config.cjs +0 -8
- package/dist/esm/lint-config/stylelint.config.cjs +0 -20
- package/dist/esm/monorepo/utils.cjs +0 -30
- package/dist/esm/release.config.cjs +0 -24
- package/dist/esm/testing/jest.config.cjs +0 -110
- package/dist/esm/testing/jest.node.config.cjs +0 -8
- package/dist/esm/testing/resolver.cjs +0 -47
- package/dist/esm/transpile/.swcrc +0 -11
- package/dist/esm/transpile/swcrc.config.cjs +0 -13
- package/dist/esm/typedoc.cjs +0 -12
- package/dist/esm/utils.cjs +0 -23
|
@@ -1,49 +0,0 @@
|
|
|
1
|
-
const { baseExtends, basePlugins } = require('../common.cjs');
|
|
2
|
-
|
|
3
|
-
exports.tsBaseExtends = [
|
|
4
|
-
'plugin:@typescript-eslint/recommended',
|
|
5
|
-
'plugin:import/typescript',
|
|
6
|
-
'plugin:@typescript-eslint/recommended-requiring-type-checking',
|
|
7
|
-
].concat(baseExtends);
|
|
8
|
-
|
|
9
|
-
exports.tsBaseRules = {
|
|
10
|
-
'@typescript-eslint/explicit-module-boundary-types': 'off',
|
|
11
|
-
'@typescript-eslint/explicit-function-return-type': 'off',
|
|
12
|
-
'@typescript-eslint/no-use-before-define': [
|
|
13
|
-
'error',
|
|
14
|
-
{ functions: false, classes: true, variables: true, typedefs: true },
|
|
15
|
-
],
|
|
16
|
-
'max-lines': ['error', { max: 200, skipComments: true }],
|
|
17
|
-
'@typescript-eslint/unbound-method': [
|
|
18
|
-
'error',
|
|
19
|
-
{
|
|
20
|
-
ignoreStatic: true,
|
|
21
|
-
},
|
|
22
|
-
],
|
|
23
|
-
'@typescript-eslint/no-floating-promises': [
|
|
24
|
-
'error',
|
|
25
|
-
{
|
|
26
|
-
ignoreIIFE: true,
|
|
27
|
-
},
|
|
28
|
-
],
|
|
29
|
-
};
|
|
30
|
-
|
|
31
|
-
exports.tsBaseConfig = {
|
|
32
|
-
files: ['*.ts', '*.tsx'],
|
|
33
|
-
parser: '@typescript-eslint/parser',
|
|
34
|
-
plugins: ['@typescript-eslint'].concat(basePlugins),
|
|
35
|
-
parserOptions: {
|
|
36
|
-
tsconfigRootDir: process.cwd(),
|
|
37
|
-
project: 'tsconfig.json',
|
|
38
|
-
},
|
|
39
|
-
settings: {
|
|
40
|
-
'import/resolver': {
|
|
41
|
-
typescript: {
|
|
42
|
-
alwaysTryTypes: true,
|
|
43
|
-
},
|
|
44
|
-
},
|
|
45
|
-
'import/parsers': {
|
|
46
|
-
'@typescript-eslint/parser': ['.ts', '.tsx'],
|
|
47
|
-
},
|
|
48
|
-
},
|
|
49
|
-
};
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
/* eslint-disable max-lines */
|
|
2
|
-
const { baseRules } = require('../common.cjs');
|
|
3
|
-
const { tsBaseExtends, tsBaseRules, tsBaseConfig } = require('./common.cjs');
|
|
4
|
-
|
|
5
|
-
exports.tsConfig = {
|
|
6
|
-
...tsBaseConfig,
|
|
7
|
-
extends: ['airbnb-base', 'airbnb-typescript/base'].concat(tsBaseExtends),
|
|
8
|
-
rules: {
|
|
9
|
-
...baseRules,
|
|
10
|
-
...tsBaseRules,
|
|
11
|
-
},
|
|
12
|
-
};
|
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
/* eslint-disable max-lines */
|
|
2
|
-
const { baseRules, reactRules } = require('../common.cjs');
|
|
3
|
-
const { tsBaseExtends, tsBaseRules, tsBaseConfig } = require('./common.cjs');
|
|
4
|
-
|
|
5
|
-
exports.tsReactConfig = {
|
|
6
|
-
...tsBaseConfig,
|
|
7
|
-
extends: [
|
|
8
|
-
'airbnb',
|
|
9
|
-
'airbnb/hooks',
|
|
10
|
-
'plugin:redux-saga/recommended',
|
|
11
|
-
'airbnb-typescript',
|
|
12
|
-
].concat(tsBaseExtends),
|
|
13
|
-
rules: {
|
|
14
|
-
...baseRules,
|
|
15
|
-
...tsBaseRules,
|
|
16
|
-
...reactRules,
|
|
17
|
-
'react/prop-types': 0,
|
|
18
|
-
},
|
|
19
|
-
};
|
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
exports.stylelintConfig = {
|
|
2
|
-
ignoreFiles: [
|
|
3
|
-
"/dist/**/*",
|
|
4
|
-
"/coverage/**/*",
|
|
5
|
-
"/build/**/*",
|
|
6
|
-
"/reports/**/*",
|
|
7
|
-
"/temp/**/*",
|
|
8
|
-
"/docs/**/*",
|
|
9
|
-
"/demo/**/*",
|
|
10
|
-
"/node_modules/**/*",
|
|
11
|
-
"/vendor/**/*",
|
|
12
|
-
],
|
|
13
|
-
customSyntax: "@stylelint/postcss-css-in-js",
|
|
14
|
-
// customSyntax: "postcss-styled-components", // '@stylelint/postcss-css-in-js' is deprecated, this may be a replacement?
|
|
15
|
-
extends: [
|
|
16
|
-
"stylelint-config-recommended",
|
|
17
|
-
"stylelint-config-styled-components",
|
|
18
|
-
],
|
|
19
|
-
rules: { "selector-type-no-unknown": null, "function-no-unknown": null },
|
|
20
|
-
};
|
|
@@ -1,30 +0,0 @@
|
|
|
1
|
-
const path = require('path');
|
|
2
|
-
const { execSync } = require('child_process');
|
|
3
|
-
|
|
4
|
-
const WORKSPACE_DIR_ENV_VAR = 'NPM_CONFIG_WORKSPACE_DIR';
|
|
5
|
-
const WORKSPACE_MANIFEST_FILENAME = 'pnpm-workspace.yaml';
|
|
6
|
-
|
|
7
|
-
const getPNPMWorkspaceLocation = (cwd) => {
|
|
8
|
-
let location = null;
|
|
9
|
-
// eslint-disable-next-line no-restricted-syntax
|
|
10
|
-
for (const fileName of [WORKSPACE_MANIFEST_FILENAME, 'pnpm-workspace.yml']) {
|
|
11
|
-
try {
|
|
12
|
-
const result = execSync(`npx find-up ${fileName}`, { cwd });
|
|
13
|
-
location = result.toString().trim();
|
|
14
|
-
break;
|
|
15
|
-
} catch (err) {
|
|
16
|
-
// ignore
|
|
17
|
-
}
|
|
18
|
-
}
|
|
19
|
-
return location;
|
|
20
|
-
};
|
|
21
|
-
|
|
22
|
-
exports.findMonoRepoRoot = (cwd = process.cwd()) => {
|
|
23
|
-
const workspaceManifestDirEnvVar =
|
|
24
|
-
process.env[WORKSPACE_DIR_ENV_VAR] ??
|
|
25
|
-
process.env[WORKSPACE_DIR_ENV_VAR.toLowerCase()];
|
|
26
|
-
const workspaceManifestLocation = workspaceManifestDirEnvVar
|
|
27
|
-
? path.join(workspaceManifestDirEnvVar, 'pnpm-workspace.yaml')
|
|
28
|
-
: getPNPMWorkspaceLocation(cwd);
|
|
29
|
-
return workspaceManifestLocation && path.dirname(workspaceManifestLocation);
|
|
30
|
-
};
|
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
module.exports = {
|
|
2
|
-
branches: [
|
|
3
|
-
'+([0-9])?(.{+([0-9]),x}).x',
|
|
4
|
-
'master',
|
|
5
|
-
'next-major',
|
|
6
|
-
{ name: 'beta', prerelease: true },
|
|
7
|
-
{ name: 'alpha', prerelease: true },
|
|
8
|
-
{ name: 'hotfix', prerelease: true },
|
|
9
|
-
{ name: 'next', prerelease: true },
|
|
10
|
-
],
|
|
11
|
-
plugins: [
|
|
12
|
-
'@semantic-release/commit-analyzer',
|
|
13
|
-
'@semantic-release/release-notes-generator',
|
|
14
|
-
[
|
|
15
|
-
'@semantic-release/changelog',
|
|
16
|
-
{
|
|
17
|
-
changelogTitle:
|
|
18
|
-
'# Changelog\n\nAll notable changes to this project will be documented in this file. See\n[Conventional Commits](https://conventionalcommits.org) for commit guidelines.',
|
|
19
|
-
},
|
|
20
|
-
],
|
|
21
|
-
'@semantic-release/npm',
|
|
22
|
-
'@semantic-release/github',
|
|
23
|
-
],
|
|
24
|
-
};
|
|
@@ -1,110 +0,0 @@
|
|
|
1
|
-
const path = require('path');
|
|
2
|
-
const normalizePath = require('normalize-path');
|
|
3
|
-
const { getAppConfig, basePath } = require('../utils.cjs');
|
|
4
|
-
const { swcrcConfig } = require('../transpile/swcrc.config.cjs');
|
|
5
|
-
const { findMonoRepoRoot } = require('../monorepo/utils.cjs');
|
|
6
|
-
|
|
7
|
-
let isReactModule = true;
|
|
8
|
-
try {
|
|
9
|
-
/* eslint-disable global-require, import/no-unresolved */
|
|
10
|
-
require('react');
|
|
11
|
-
require('styled-components');
|
|
12
|
-
/* eslint-enable global-require, import/no-unresolved */
|
|
13
|
-
} catch (err) {
|
|
14
|
-
isReactModule = false;
|
|
15
|
-
}
|
|
16
|
-
|
|
17
|
-
const getMockFilePath = (fileName) =>
|
|
18
|
-
normalizePath(path.resolve(__dirname, './mocks', fileName));
|
|
19
|
-
|
|
20
|
-
const getNodeModulesPath = (fileName) => {
|
|
21
|
-
const monorepoRoot = findMonoRepoRoot(process.cwd());
|
|
22
|
-
return normalizePath(
|
|
23
|
-
monorepoRoot
|
|
24
|
-
? path.join(monorepoRoot, 'node_modules', fileName)
|
|
25
|
-
: `<rootDir>/node_modules/${fileName}`,
|
|
26
|
-
);
|
|
27
|
-
};
|
|
28
|
-
|
|
29
|
-
const jestConfig = {
|
|
30
|
-
collectCoverageFrom: [
|
|
31
|
-
'app/**/*.{js,ts,jsx,tsx}',
|
|
32
|
-
'lib/**/*.{js,ts,jsx,tsx}',
|
|
33
|
-
'!app/**/*.d.ts',
|
|
34
|
-
'!lib/**/*.d.ts',
|
|
35
|
-
'!app/**/*.test.{js,ts,jsx,tsx}',
|
|
36
|
-
'!lib/**/*.test.{js,ts,jsx,tsx}',
|
|
37
|
-
'!app/**/*.stories.{js,ts,jsx,tsx}',
|
|
38
|
-
'!lib/**/*.stories.{js,ts,jsx,tsx}',
|
|
39
|
-
'!app/**/*.endpoint.{js,ts,jsx,tsx}',
|
|
40
|
-
'!lib/**/*.endpoint.{js,ts,jsx,tsx}',
|
|
41
|
-
'!app/*/RbGenerated*/*.{js,ts,jsx,tsx}',
|
|
42
|
-
'!app/index.{js,ts,jsx,tsx}',
|
|
43
|
-
'!app/global-styles.{js,ts,jsx,tsx}',
|
|
44
|
-
'!app/**/loadable.{js,ts,jsx,tsx}',
|
|
45
|
-
'!lib/**/loadable.{js,ts,jsx,tsx}',
|
|
46
|
-
],
|
|
47
|
-
coverageThreshold: {
|
|
48
|
-
// Todo: enable the coverage threshold later
|
|
49
|
-
// global: {
|
|
50
|
-
// statements: 95,
|
|
51
|
-
// branches: 90,
|
|
52
|
-
// functions: 95,
|
|
53
|
-
// lines: 95,
|
|
54
|
-
// },
|
|
55
|
-
},
|
|
56
|
-
coverageDirectory: 'reports',
|
|
57
|
-
coverageReporters: ['lcov', 'html', 'text-summary'],
|
|
58
|
-
moduleDirectories: ['node_modules', 'app', 'lib'],
|
|
59
|
-
moduleNameMapper: {
|
|
60
|
-
d3: '<rootDir>/node_modules/d3/dist/d3.min.js',
|
|
61
|
-
'^d3-(.*)$': '<rootDir>/node_modules/d3-$1/dist/d3-$1.min.js',
|
|
62
|
-
'.*\\webpack-hmr(.[t|j]s)?$': getMockFilePath('webpack-hmr.js'),
|
|
63
|
-
'.*\\.(css|scss)$': getMockFilePath('cssModule.js'),
|
|
64
|
-
'.*\\.(jpg|jpeg|png|gif|eot|otf|webp|ttf|woff|woff2|mp4|webm|wav|mp3|m4a|aac|oga|ico)$':
|
|
65
|
-
getMockFilePath('image.js'),
|
|
66
|
-
'.*\\.svg(?:\\?[a-zA-Z]+)?$': getMockFilePath('svg.js'),
|
|
67
|
-
'.*\\.html(?:\\?[a-zA-Z]+)?$': getMockFilePath('html.js'),
|
|
68
|
-
'@elliemae/pui-user-monitoring': getMockFilePath('pui-user-monitoring.js'),
|
|
69
|
-
'@elliemae/pui-app-loader': getMockFilePath('pui-app-loader.js'),
|
|
70
|
-
'@elliemae/pui-diagnostics': getMockFilePath('pui-diagnostics.js'),
|
|
71
|
-
'react-spring/web': getNodeModulesPath('react-spring/web.cjs.js'),
|
|
72
|
-
'react-spring/renderprops': getNodeModulesPath(
|
|
73
|
-
'react-spring/renderprops.cjs.js',
|
|
74
|
-
),
|
|
75
|
-
},
|
|
76
|
-
moduleFileExtensions: ['ts', 'tsx', 'js', 'jsx', 'json', 'node'],
|
|
77
|
-
setupFilesAfterEnv: [path.resolve(__dirname, './setup-tests.js')],
|
|
78
|
-
setupFiles: ['raf/polyfill', 'whatwg-fetch'],
|
|
79
|
-
testRegex: '(app|lib).*/tests/.*\\.test\\.[jt]sx?$',
|
|
80
|
-
snapshotSerializers: [],
|
|
81
|
-
testResultsProcessor: 'jest-sonar-reporter',
|
|
82
|
-
resolver: path.resolve(__dirname, './resolver.cjs'),
|
|
83
|
-
transform: {
|
|
84
|
-
'^.+\\.[jt]sx?$': ['@swc/jest', swcrcConfig],
|
|
85
|
-
},
|
|
86
|
-
transformIgnorePatterns: [
|
|
87
|
-
'node_modules/(?!(.*@elliemae/pui-cli|lodash-es|react-select|react-dates|d3|internmap|delaunator|robust-predicates)/)',
|
|
88
|
-
],
|
|
89
|
-
globals: {
|
|
90
|
-
APP_CONFIG: getAppConfig(),
|
|
91
|
-
__webpack_public_path__: '/',
|
|
92
|
-
},
|
|
93
|
-
testEnvironmentOptions: {
|
|
94
|
-
url: `http://localhost:3111${basePath}`,
|
|
95
|
-
resources: 'usable',
|
|
96
|
-
},
|
|
97
|
-
testEnvironment: 'jsdom',
|
|
98
|
-
watchPlugins: [
|
|
99
|
-
'jest-watch-typeahead/filename',
|
|
100
|
-
'jest-watch-typeahead/testname',
|
|
101
|
-
],
|
|
102
|
-
testTimeout: 5000,
|
|
103
|
-
};
|
|
104
|
-
|
|
105
|
-
if (isReactModule && jestConfig.setupFilesAfterEnv)
|
|
106
|
-
jestConfig.setupFilesAfterEnv.push(
|
|
107
|
-
path.resolve(__dirname, './setup-react-env.js'),
|
|
108
|
-
);
|
|
109
|
-
|
|
110
|
-
exports.jestConfig = jestConfig;
|
|
@@ -1,47 +0,0 @@
|
|
|
1
|
-
const resolutions = [
|
|
2
|
-
{
|
|
3
|
-
matcher: /\.jsx?$/i,
|
|
4
|
-
extensions: ['.tsx', '.ts'],
|
|
5
|
-
},
|
|
6
|
-
{
|
|
7
|
-
matcher: /\.mjs$/i,
|
|
8
|
-
extensions: ['.mts'],
|
|
9
|
-
},
|
|
10
|
-
{
|
|
11
|
-
matcher: /\.cjs$/i,
|
|
12
|
-
extensions: ['.cts'],
|
|
13
|
-
},
|
|
14
|
-
];
|
|
15
|
-
|
|
16
|
-
const resolveConfig = {
|
|
17
|
-
conditionNames: ['import', 'node', 'default'],
|
|
18
|
-
extensions: ['.ts', '.tsx', '.js', '.jsx', '.json', '.node'],
|
|
19
|
-
modules: ['node_modules', 'app', 'lib'],
|
|
20
|
-
};
|
|
21
|
-
|
|
22
|
-
const importResolver = require('enhanced-resolve').create.sync(resolveConfig);
|
|
23
|
-
const requireResolver = require('enhanced-resolve').create.sync({
|
|
24
|
-
...resolveConfig,
|
|
25
|
-
conditionNames: ['require', 'node', 'default'],
|
|
26
|
-
});
|
|
27
|
-
|
|
28
|
-
module.exports = (request, options) => {
|
|
29
|
-
let resolver = requireResolver;
|
|
30
|
-
if (options.conditions?.includes('import')) {
|
|
31
|
-
resolver = importResolver;
|
|
32
|
-
}
|
|
33
|
-
const resolution = resolutions.find(({ matcher }) => matcher.test(request));
|
|
34
|
-
if (resolution) {
|
|
35
|
-
// eslint-disable-next-line no-restricted-syntax
|
|
36
|
-
for (const extension of resolution.extensions) {
|
|
37
|
-
try {
|
|
38
|
-
return resolver(
|
|
39
|
-
options.basedir,
|
|
40
|
-
request.replace(resolution.matcher, extension),
|
|
41
|
-
);
|
|
42
|
-
// eslint-disable-next-line no-empty
|
|
43
|
-
} catch {}
|
|
44
|
-
}
|
|
45
|
-
}
|
|
46
|
-
return resolver(options.basedir, request);
|
|
47
|
-
};
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
const fs = require('fs');
|
|
2
|
-
const path = require('path');
|
|
3
|
-
const { merge } = require('lodash');
|
|
4
|
-
|
|
5
|
-
let projectConfig = {};
|
|
6
|
-
const projectPath = path.join(process.cwd(), '.swcrc');
|
|
7
|
-
if (fs.existsSync(projectPath)) {
|
|
8
|
-
projectConfig = JSON.parse(fs.readFileSync(projectPath, 'utf-8'));
|
|
9
|
-
}
|
|
10
|
-
const localConfig = JSON.parse(
|
|
11
|
-
fs.readFileSync(path.join(__dirname, '.swcrc'), 'utf-8'),
|
|
12
|
-
);
|
|
13
|
-
exports.swcrcConfig = merge(localConfig, projectConfig);
|
package/dist/cjs/typedoc.cjs
DELETED
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
const path = require('path');
|
|
2
|
-
const fs = require('fs');
|
|
3
|
-
|
|
4
|
-
const isApp = () => fs.existsSync(path.join(process.cwd(), 'app'));
|
|
5
|
-
|
|
6
|
-
const srcPath = path.join(process.cwd(), isApp() ? 'app' : 'lib');
|
|
7
|
-
|
|
8
|
-
module.exports = {
|
|
9
|
-
entryPoints: [srcPath],
|
|
10
|
-
exclude: ['**/*+(.spec|.e2e|.test).ts'],
|
|
11
|
-
out: path.join(process.cwd(), 'docs'),
|
|
12
|
-
};
|
package/dist/cjs/utils.cjs
DELETED
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
const path = require('path');
|
|
2
|
-
const fs = require('fs');
|
|
3
|
-
|
|
4
|
-
exports.basePath = (process.env.BASE_PATH || '/').replace(/\/?$/, '/');
|
|
5
|
-
|
|
6
|
-
const isApp = () => fs.existsSync(path.join(process.cwd(), 'app'));
|
|
7
|
-
|
|
8
|
-
exports.getAppConfig = () => {
|
|
9
|
-
const appConfigPath = path.join(
|
|
10
|
-
process.cwd(),
|
|
11
|
-
isApp() ? 'app' : 'lib',
|
|
12
|
-
'app.config.json',
|
|
13
|
-
);
|
|
14
|
-
|
|
15
|
-
if (!fs.existsSync(appConfigPath)) return '{}';
|
|
16
|
-
const appConfig = fs.readFileSync(appConfigPath);
|
|
17
|
-
return appConfig || '{}';
|
|
18
|
-
};
|
|
19
|
-
|
|
20
|
-
exports.isApp = isApp;
|
|
21
|
-
|
|
22
|
-
exports.isTypeScriptEnabled = () =>
|
|
23
|
-
fs.existsSync(path.join(process.cwd(), 'tsconfig.json'));
|
|
@@ -1,97 +0,0 @@
|
|
|
1
|
-
const { isApp } = require('./utils.cjs');
|
|
2
|
-
|
|
3
|
-
const nodeEnvPreset = {
|
|
4
|
-
modules: process.env.ES_MODULES === 'false' ? 'commonjs' : false,
|
|
5
|
-
targets: {
|
|
6
|
-
node: 'current',
|
|
7
|
-
},
|
|
8
|
-
};
|
|
9
|
-
|
|
10
|
-
const webEnvPreset = {
|
|
11
|
-
modules: process.env.ES_MODULES === 'false' ? 'commonjs' : false,
|
|
12
|
-
useBuiltIns: 'usage',
|
|
13
|
-
corejs: { version: '3.22', proposals: true },
|
|
14
|
-
};
|
|
15
|
-
|
|
16
|
-
const presetEnvOptions =
|
|
17
|
-
process.env.TARGET_ENV === 'node' ? nodeEnvPreset : webEnvPreset;
|
|
18
|
-
|
|
19
|
-
const config = {
|
|
20
|
-
ignore: [/\/core-js/],
|
|
21
|
-
sourceType: 'unambiguous',
|
|
22
|
-
presets: [
|
|
23
|
-
['@babel/preset-env', presetEnvOptions],
|
|
24
|
-
['@babel/preset-react', { runtime: 'automatic' }],
|
|
25
|
-
'@babel/preset-typescript',
|
|
26
|
-
],
|
|
27
|
-
plugins: [
|
|
28
|
-
[
|
|
29
|
-
'babel-plugin-module-resolver',
|
|
30
|
-
{
|
|
31
|
-
alias: {
|
|
32
|
-
'@': isApp() ? './app' : './lib',
|
|
33
|
-
},
|
|
34
|
-
stripExtensions: [],
|
|
35
|
-
},
|
|
36
|
-
],
|
|
37
|
-
['babel-plugin-styled-components', { displayName: true }],
|
|
38
|
-
['@babel/plugin-transform-runtime', { regenerator: true }],
|
|
39
|
-
'@babel/plugin-proposal-class-properties',
|
|
40
|
-
'@babel/plugin-syntax-dynamic-import',
|
|
41
|
-
'@babel/plugin-proposal-export-default-from',
|
|
42
|
-
'lodash',
|
|
43
|
-
'date-fns',
|
|
44
|
-
],
|
|
45
|
-
env: {
|
|
46
|
-
development: {
|
|
47
|
-
plugins: [
|
|
48
|
-
['babel-plugin-styled-components', { displayName: true }],
|
|
49
|
-
'@babel/plugin-transform-react-jsx-source',
|
|
50
|
-
],
|
|
51
|
-
},
|
|
52
|
-
production: {
|
|
53
|
-
plugins: [
|
|
54
|
-
['babel-plugin-styled-components', { displayName: false, pure: true }],
|
|
55
|
-
['transform-remove-console', { exclude: ['error', 'warn'] }],
|
|
56
|
-
'transform-react-remove-prop-types',
|
|
57
|
-
'@babel/plugin-transform-react-inline-elements',
|
|
58
|
-
'@babel/plugin-transform-react-constant-elements',
|
|
59
|
-
],
|
|
60
|
-
},
|
|
61
|
-
test: {
|
|
62
|
-
plugins: [
|
|
63
|
-
['babel-plugin-styled-components', { displayName: true }],
|
|
64
|
-
'@babel/plugin-transform-modules-commonjs',
|
|
65
|
-
'dynamic-import-node',
|
|
66
|
-
[
|
|
67
|
-
'babel-plugin-transform-strip-block',
|
|
68
|
-
{
|
|
69
|
-
requireDirective: true,
|
|
70
|
-
identifiers: [{ start: 'block:start', end: 'block:end' }],
|
|
71
|
-
},
|
|
72
|
-
],
|
|
73
|
-
'babel-plugin-import-remove-resource-query',
|
|
74
|
-
],
|
|
75
|
-
},
|
|
76
|
-
},
|
|
77
|
-
};
|
|
78
|
-
|
|
79
|
-
if (
|
|
80
|
-
process.env.STORYBOOK_BUILD !== 'true' &&
|
|
81
|
-
process.env.TARGET_ENV !== 'node'
|
|
82
|
-
) {
|
|
83
|
-
config.env?.development?.plugins?.push?.('react-refresh/babel');
|
|
84
|
-
}
|
|
85
|
-
|
|
86
|
-
// ToDo: Once ECC team migrates from webpack 3 to webpack 5 remove this strip-block plugin from commonjs output. without this they are receiving error when import.meta is used in app sdk
|
|
87
|
-
if (process.env.ES_MODULES === 'false') {
|
|
88
|
-
config.plugins.push([
|
|
89
|
-
'babel-plugin-transform-strip-block',
|
|
90
|
-
{
|
|
91
|
-
requireDirective: true,
|
|
92
|
-
identifiers: [{ start: 'block:start', end: 'block:end' }],
|
|
93
|
-
},
|
|
94
|
-
]);
|
|
95
|
-
}
|
|
96
|
-
|
|
97
|
-
exports.babelConfig = config;
|
package/dist/esm/index.cjs
DELETED
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
const { babelConfig } = require('./babel.config.cjs');
|
|
2
|
-
const {
|
|
3
|
-
esConfig: eslintBaseConfig,
|
|
4
|
-
} = require('./lint-config/eslint/non-react.cjs');
|
|
5
|
-
const {
|
|
6
|
-
esReactConfig: eslintConfig,
|
|
7
|
-
} = require('./lint-config/eslint/react.cjs');
|
|
8
|
-
const { stylelintConfig } = require('./lint-config/stylelint.config.cjs');
|
|
9
|
-
const { prettierConfig } = require('./lint-config/prettier.config.cjs');
|
|
10
|
-
const { commitlintConfig } = require('./lint-config/commitlint.config.cjs');
|
|
11
|
-
const { jestConfig } = require('./testing/jest.config.cjs');
|
|
12
|
-
const { jestNodeConfig } = require('./testing/jest.node.config.cjs');
|
|
13
|
-
|
|
14
|
-
module.exports = {
|
|
15
|
-
babelConfig,
|
|
16
|
-
eslintBaseConfig,
|
|
17
|
-
eslintConfig,
|
|
18
|
-
stylelintConfig,
|
|
19
|
-
prettierConfig,
|
|
20
|
-
commitlintConfig,
|
|
21
|
-
jestConfig,
|
|
22
|
-
jestNodeConfig,
|
|
23
|
-
};
|
package/dist/esm/jsdoc.conf.json
DELETED
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"plugins": ["plugins/markdown"],
|
|
3
|
-
"opts": {
|
|
4
|
-
"template": "node_modules/docdash"
|
|
5
|
-
},
|
|
6
|
-
"docdash": {
|
|
7
|
-
"sort": true,
|
|
8
|
-
"search": true,
|
|
9
|
-
"collapse": true,
|
|
10
|
-
"wrap": true
|
|
11
|
-
},
|
|
12
|
-
"templates": {
|
|
13
|
-
"default": {
|
|
14
|
-
"includeDate": false
|
|
15
|
-
}
|
|
16
|
-
}
|
|
17
|
-
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
exports.commitlintConfig = { extends: ['@commitlint/config-conventional'] };
|