@elliemae/pui-cli 7.0.0-alpha.1 → 7.0.0-alpha.4
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/{lib/babel/babel.config.js → dist/cjs/babel/babel.config.cjs} +2 -2
- package/dist/cjs/cli-commands/build.js +72 -0
- package/dist/cjs/cli-commands/codemod.js +51 -0
- package/dist/cjs/cli-commands/gendoc.js +52 -0
- package/dist/cjs/cli-commands/lint.js +86 -0
- package/dist/cjs/cli-commands/pack.js +88 -0
- package/dist/cjs/cli-commands/start.js +61 -0
- package/dist/cjs/cli-commands/storybook.js +63 -0
- package/dist/cjs/cli-commands/test.js +86 -0
- package/dist/cjs/cli-commands/tsc.js +103 -0
- package/dist/cjs/cli-commands/utils.js +137 -0
- package/dist/cjs/cli-commands/version.js +71 -0
- package/dist/cjs/cli-commands/vitest.js +84 -0
- package/dist/cjs/cli.js +47 -0
- package/dist/cjs/docgen/jsdoc.conf.json +17 -0
- package/{lib/dummy.ts → dist/cjs/dummy.js} +0 -0
- package/dist/cjs/index.js +41 -0
- package/dist/cjs/lint/commitlint.config.cjs +1 -0
- package/{lib/lint/eslint/common.js → dist/cjs/lint/eslint/common.cjs} +8 -8
- package/{lib/lint/eslint/non-react.js → dist/cjs/lint/eslint/non-react.cjs} +2 -2
- package/{lib/lint/eslint/react.js → dist/cjs/lint/eslint/react.cjs} +2 -2
- package/{lib/lint/eslint/typescript/common.js → dist/cjs/lint/eslint/typescript/common.cjs} +1 -1
- package/{lib/lint/eslint/typescript/non-react.js → dist/cjs/lint/eslint/typescript/non-react.cjs} +2 -2
- package/{lib/lint/eslint/typescript/react.js → dist/cjs/lint/eslint/typescript/react.cjs} +2 -2
- package/dist/cjs/lint/lint-staged.config.js +42 -0
- package/{lib/lint/prettier.config.js → dist/cjs/lint/prettier.config.cjs} +1 -1
- package/{lib/lint/stylelint.config.js → dist/cjs/lint/stylelint.config.cjs} +2 -2
- package/dist/cjs/monorepo/delete-merged-tags.js +57 -0
- package/dist/cjs/monorepo/set-registry-version.js +43 -0
- package/dist/cjs/monorepo/set-workspace-version.js +44 -0
- package/dist/cjs/monorepo/utils.js +34 -0
- package/dist/cjs/package.json +4 -0
- package/dist/cjs/pui-config/index.js +40 -0
- package/{lib/release/release.config.js → dist/cjs/release/release.config.cjs} +0 -0
- package/dist/cjs/scripts/helpers/checkmark.js +32 -0
- package/dist/cjs/scripts/helpers/get-npm-config.js +27 -0
- package/dist/cjs/scripts/helpers/progress.js +35 -0
- package/dist/cjs/scripts/helpers/xmark.js +31 -0
- package/dist/cjs/scripts/npmcheckversion.js +8 -0
- package/dist/cjs/scripts/update-notifier.js +33 -0
- package/dist/cjs/server/csp.js +88 -0
- package/dist/cjs/server/index.js +29 -0
- package/dist/cjs/server/logger.js +50 -0
- package/dist/cjs/server/middlewares/addProdMiddlewares.js +44 -0
- package/dist/cjs/server/middlewares/index.js +57 -0
- package/dist/cjs/server/util/index.js +68 -0
- package/{lib/testing/jest.config.js → dist/cjs/testing/jest.config.cjs} +15 -15
- package/{lib/testing/jest.node.config.js → dist/cjs/testing/jest.node.config.cjs} +1 -1
- package/{lib/testing/mocks/axios.js → dist/cjs/testing/mocks/axios.cjs} +0 -0
- package/{lib/testing/mocks/cssModule.js → dist/cjs/testing/mocks/cssModule.cjs} +0 -0
- package/{lib/testing/mocks/html.js → dist/cjs/testing/mocks/html.cjs} +0 -0
- package/{lib/testing/mocks/image.js → dist/cjs/testing/mocks/image.cjs} +0 -0
- package/{lib/testing/mocks/matchMedia.js → dist/cjs/testing/mocks/matchMedia.cjs} +0 -0
- package/{lib/testing/mocks/pui-app-loader.js → dist/cjs/testing/mocks/pui-app-loader.cjs} +0 -0
- package/{lib/testing/mocks/pui-diagnostics.js → dist/cjs/testing/mocks/pui-diagnostics.cjs} +0 -0
- package/{lib/testing/mocks/pui-user-monitoring.js → dist/cjs/testing/mocks/pui-user-monitoring.cjs} +0 -0
- package/{lib/testing/mocks/retry-axios.js → dist/cjs/testing/mocks/retry-axios.cjs} +0 -0
- package/{lib/testing/mocks/svg.js → dist/cjs/testing/mocks/svg.cjs} +0 -0
- package/{lib/testing/mocks/webpack-hmr.js → dist/cjs/testing/mocks/webpack-hmr.cjs} +0 -0
- package/{lib/testing/resolver.js → dist/cjs/testing/resolver.cjs} +0 -0
- package/dist/cjs/testing/setup-react-env.js +18 -0
- package/dist/cjs/testing/setup-tests.js +63 -0
- package/dist/cjs/testing/vitest.config.js +39 -0
- package/{lib/testing/vitest.setup.ts → dist/cjs/testing/vitest.setup.js} +0 -0
- package/dist/cjs/transpile/esbuild.js +138 -0
- package/dist/cjs/transpile/react-shim.js +26 -0
- package/{lib/transpile/swcrc.config.js → dist/cjs/transpile/swcrc.config.cjs} +1 -1
- package/{lib → dist/cjs}/typescript/app.tsconfig.json +0 -0
- package/{lib → dist/cjs}/typescript/library.tsconfig.json +0 -0
- package/dist/cjs/typescript/tsc-files/index.js +68 -0
- package/dist/cjs/typescript/tsc-files/utils.js +31 -0
- package/dist/cjs/typescript/util.js +28 -0
- package/dist/cjs/utils.cjs +20 -0
- package/dist/cjs/webpack/helpers.js +216 -0
- package/dist/cjs/webpack/webpack.base.babel.js +262 -0
- package/dist/cjs/webpack/webpack.dev.babel.js +136 -0
- package/dist/cjs/webpack/webpack.lib.base.babel.js +217 -0
- package/dist/cjs/webpack/webpack.lib.dev.babel.js +67 -0
- package/dist/cjs/webpack/webpack.lib.prod.babel.js +92 -0
- package/dist/cjs/webpack/webpack.prod.babel.js +139 -0
- package/{lib/webpack/webpack.storybook.js → dist/cjs/webpack/webpack.storybook.cjs} +1 -1
- package/dist/esm/babel/babel.config.cjs +101 -0
- package/dist/esm/cli-commands/build.js +56 -0
- package/dist/esm/cli-commands/codemod.js +29 -0
- package/dist/esm/cli-commands/gendoc.js +29 -0
- package/dist/esm/cli-commands/lint.js +64 -0
- package/dist/esm/cli-commands/pack.js +65 -0
- package/dist/esm/cli-commands/start.js +38 -0
- package/dist/esm/cli-commands/storybook.js +41 -0
- package/dist/esm/cli-commands/test.js +64 -0
- package/dist/esm/cli-commands/tsc.js +83 -0
- package/dist/esm/cli-commands/utils.js +120 -0
- package/dist/esm/cli-commands/version.js +49 -0
- package/dist/esm/cli-commands/vitest.js +61 -0
- package/dist/esm/cli.js +31 -0
- package/dist/esm/docgen/jsdoc.conf.json +17 -0
- package/dist/esm/dummy.js +0 -0
- package/dist/esm/index.js +22 -0
- package/dist/esm/lint/commitlint.config.cjs +1 -0
- package/dist/esm/lint/eslint/common.cjs +160 -0
- package/dist/esm/lint/eslint/non-react.cjs +14 -0
- package/dist/esm/lint/eslint/react.cjs +26 -0
- package/dist/esm/lint/eslint/typescript/common.cjs +43 -0
- package/dist/esm/lint/eslint/typescript/non-react.cjs +12 -0
- package/dist/esm/lint/eslint/typescript/react.cjs +19 -0
- package/dist/esm/lint/lint-staged.config.js +19 -0
- package/dist/esm/lint/prettier.config.cjs +8 -0
- package/dist/esm/lint/stylelint.config.cjs +19 -0
- package/dist/esm/monorepo/delete-merged-tags.js +38 -0
- package/dist/esm/monorepo/set-registry-version.js +21 -0
- package/dist/esm/monorepo/set-workspace-version.js +22 -0
- package/dist/esm/monorepo/utils.js +12 -0
- package/dist/esm/package.json +4 -0
- package/dist/esm/pui-config/index.js +18 -0
- package/dist/esm/release/release.config.cjs +31 -0
- package/dist/esm/scripts/helpers/checkmark.js +10 -0
- package/dist/esm/scripts/helpers/get-npm-config.js +5 -0
- package/dist/esm/scripts/helpers/progress.js +13 -0
- package/dist/esm/scripts/helpers/xmark.js +9 -0
- package/dist/esm/scripts/npmcheckversion.js +8 -0
- package/dist/esm/scripts/update-notifier.js +11 -0
- package/dist/esm/server/csp.js +66 -0
- package/dist/esm/server/index.js +17 -0
- package/dist/esm/server/logger.js +28 -0
- package/dist/esm/server/middlewares/addProdMiddlewares.js +22 -0
- package/dist/esm/server/middlewares/index.js +35 -0
- package/dist/esm/server/util/index.js +46 -0
- package/dist/esm/testing/jest.config.cjs +105 -0
- package/dist/esm/testing/jest.node.config.cjs +8 -0
- package/dist/esm/testing/mocks/axios.cjs +15 -0
- package/dist/esm/testing/mocks/cssModule.cjs +1 -0
- package/dist/esm/testing/mocks/html.cjs +1 -0
- package/dist/esm/testing/mocks/image.cjs +1 -0
- package/dist/esm/testing/mocks/matchMedia.cjs +24 -0
- package/dist/esm/testing/mocks/pui-app-loader.cjs +1 -0
- package/dist/esm/testing/mocks/pui-diagnostics.cjs +28 -0
- package/dist/esm/testing/mocks/pui-user-monitoring.cjs +3 -0
- package/dist/esm/testing/mocks/retry-axios.cjs +3 -0
- package/dist/esm/testing/mocks/svg.cjs +5 -0
- package/dist/esm/testing/mocks/webpack-hmr.cjs +1 -0
- package/dist/esm/testing/resolver.cjs +47 -0
- package/dist/esm/testing/setup-react-env.js +3 -0
- package/dist/esm/testing/setup-tests.js +48 -0
- package/dist/esm/testing/vitest.config.js +17 -0
- package/dist/esm/testing/vitest.setup.js +0 -0
- package/dist/esm/transpile/esbuild.js +117 -0
- package/dist/esm/transpile/react-shim.js +4 -0
- package/dist/esm/transpile/swcrc.config.cjs +13 -0
- package/dist/esm/typescript/app.tsconfig.json +23 -0
- package/dist/esm/typescript/library.tsconfig.json +23 -0
- package/dist/esm/typescript/tsc-files/index.js +55 -0
- package/{lib → dist/esm}/typescript/tsc-files/utils.js +3 -7
- package/dist/esm/typescript/util.js +6 -0
- package/dist/esm/utils.cjs +20 -0
- package/dist/esm/webpack/helpers.js +196 -0
- package/dist/esm/webpack/webpack.base.babel.js +248 -0
- package/dist/esm/webpack/webpack.dev.babel.js +118 -0
- package/dist/esm/webpack/webpack.lib.base.babel.js +208 -0
- package/dist/esm/webpack/webpack.lib.dev.babel.js +45 -0
- package/dist/esm/webpack/webpack.lib.prod.babel.js +70 -0
- package/dist/esm/webpack/webpack.prod.babel.js +122 -0
- package/dist/esm/webpack/webpack.storybook.cjs +87 -0
- package/dist/types/babel/babel.config.d.cts +59 -0
- package/dist/types/cli-commands/build.d.ts +14 -0
- package/dist/types/cli-commands/codemod.d.ts +6 -0
- package/dist/types/cli-commands/gendoc.d.ts +6 -0
- package/dist/types/cli-commands/lint.d.ts +29 -0
- package/dist/types/cli-commands/pack.d.ts +26 -0
- package/dist/types/cli-commands/start.d.ts +13 -0
- package/dist/types/cli-commands/storybook.d.ts +19 -0
- package/dist/types/cli-commands/test.d.ts +35 -0
- package/dist/types/cli-commands/tsc.d.ts +20 -0
- package/dist/types/cli-commands/utils.d.ts +14 -0
- package/dist/types/cli-commands/version.d.ts +30 -0
- package/dist/types/cli-commands/vitest.d.ts +35 -0
- package/dist/types/cli.d.ts +2 -0
- package/dist/types/dummy.d.ts +0 -0
- package/dist/types/index.d.ts +10 -0
- package/dist/types/lint/commitlint.config.d.cts +4 -0
- package/dist/types/lint/eslint/common.d.cts +124 -0
- package/dist/types/lint/eslint/non-react.d.cts +88 -0
- package/dist/types/lint/eslint/react.d.cts +118 -0
- package/dist/types/lint/eslint/typescript/common.d.cts +37 -0
- package/dist/types/lint/eslint/typescript/non-react.d.cts +87 -0
- package/dist/types/lint/eslint/typescript/react.d.cts +118 -0
- package/dist/types/lint/lint-staged.config.d.ts +5 -0
- package/dist/types/lint/prettier.config.d.cts +8 -0
- package/dist/types/lint/stylelint.config.d.cts +11 -0
- package/dist/types/monorepo/delete-merged-tags.d.ts +1 -0
- package/dist/types/monorepo/set-registry-version.d.ts +1 -0
- package/dist/types/monorepo/set-workspace-version.d.ts +1 -0
- package/dist/types/monorepo/utils.d.ts +1 -0
- package/dist/types/pui-config/index.d.ts +1 -0
- package/dist/types/release/release.config.d.cts +9 -0
- package/dist/types/scripts/helpers/checkmark.d.ts +7 -0
- package/dist/types/scripts/helpers/get-npm-config.d.ts +2 -0
- package/dist/types/scripts/helpers/progress.d.ts +7 -0
- package/dist/types/scripts/helpers/xmark.d.ts +6 -0
- package/dist/types/scripts/npmcheckversion.d.ts +1 -0
- package/dist/types/scripts/update-notifier.d.ts +2 -0
- package/dist/types/server/csp.d.ts +10 -0
- package/dist/types/server/index.d.ts +1 -0
- package/dist/types/server/logger.d.ts +4 -0
- package/dist/types/server/middlewares/addProdMiddlewares.d.ts +1 -0
- package/dist/types/server/middlewares/index.d.ts +2 -0
- package/dist/types/server/util/index.d.ts +4 -0
- package/dist/types/testing/jest.config.d.cts +38 -0
- package/dist/types/testing/jest.node.config.d.cts +38 -0
- package/dist/types/testing/mocks/axios.d.cts +14 -0
- package/dist/types/testing/mocks/cssModule.d.cts +2 -0
- package/dist/types/testing/mocks/html.d.cts +2 -0
- package/dist/types/testing/mocks/image.d.cts +2 -0
- package/dist/types/testing/mocks/matchMedia.d.cts +2 -0
- package/dist/types/testing/mocks/pui-app-loader.d.cts +1 -0
- package/dist/types/testing/mocks/pui-diagnostics.d.cts +28 -0
- package/dist/types/testing/mocks/pui-user-monitoring.d.cts +3 -0
- package/dist/types/testing/mocks/retry-axios.d.cts +3 -0
- package/dist/types/testing/mocks/svg.d.cts +3 -0
- package/dist/types/testing/mocks/webpack-hmr.d.cts +1 -0
- package/dist/types/testing/resolver.d.cts +2 -0
- package/dist/types/testing/setup-react-env.d.ts +1 -0
- package/dist/types/testing/setup-tests.d.ts +1 -0
- package/dist/types/testing/vitest.config.d.ts +2 -0
- package/dist/types/testing/vitest.setup.d.ts +0 -0
- package/dist/types/transpile/esbuild.d.ts +13 -0
- package/dist/types/transpile/react-shim.d.ts +2 -0
- package/dist/types/transpile/swcrc.config.d.cts +1 -0
- package/dist/types/typescript/tsc-files/index.d.ts +1 -0
- package/dist/types/typescript/tsc-files/utils.d.ts +3 -0
- package/dist/types/typescript/util.d.ts +1 -0
- package/dist/types/utils.d.cts +3 -0
- package/dist/types/webpack/helpers.d.ts +28 -0
- package/dist/types/webpack/webpack.base.babel.d.ts +90 -0
- package/dist/types/webpack/webpack.dev.babel.d.ts +1 -0
- package/dist/types/webpack/webpack.lib.base.babel.d.ts +107 -0
- package/dist/types/webpack/webpack.lib.dev.babel.d.ts +91 -0
- package/dist/types/webpack/webpack.lib.prod.babel.d.ts +91 -0
- package/dist/types/webpack/webpack.prod.babel.d.ts +2 -0
- package/dist/types/webpack/webpack.storybook.d.cts +4 -0
- package/package.json +45 -37
- package/lib/cli-commands/build.js +0 -60
- package/lib/cli-commands/codemod.js +0 -31
- package/lib/cli-commands/gendoc.js +0 -36
- package/lib/cli-commands/lint.js +0 -75
- package/lib/cli-commands/pack.js +0 -67
- package/lib/cli-commands/start.js +0 -49
- package/lib/cli-commands/storybook.js +0 -53
- package/lib/cli-commands/test.js +0 -63
- package/lib/cli-commands/tsc.js +0 -103
- package/lib/cli-commands/utils.js +0 -135
- package/lib/cli-commands/version.js +0 -53
- package/lib/cli-commands/vitest.js +0 -66
- package/lib/cli.js +0 -33
- package/lib/docgen/jsdoc.config.js +0 -17
- package/lib/index.js +0 -25
- package/lib/lint/commitlint.config.js +0 -1
- package/lib/lint/lint-staged.config.js +0 -16
- package/lib/monorepo/delete-merged-tags.js +0 -48
- package/lib/monorepo/set-registry-version.js +0 -22
- package/lib/monorepo/set-workspace-version.js +0 -29
- package/lib/monorepo/utils.js +0 -15
- package/lib/pui-config/index.js +0 -18
- package/lib/scripts/helpers/checkmark.js +0 -15
- package/lib/scripts/helpers/get-npm-config.js +0 -3
- package/lib/scripts/helpers/progress.js +0 -19
- package/lib/scripts/helpers/xmark.js +0 -13
- package/lib/scripts/npmcheckversion.js +0 -8
- package/lib/scripts/update-notifier.js +0 -7
- package/lib/server/csp.js +0 -74
- package/lib/server/index.js +0 -37
- package/lib/server/logger.js +0 -42
- package/lib/server/middlewares/addDevMiddlewares.js +0 -39
- package/lib/server/middlewares/addProdMiddlewares.js +0 -30
- package/lib/server/middlewares/index.js +0 -37
- package/lib/server/util/index.js +0 -52
- package/lib/testing/setup-react-env.js +0 -3
- package/lib/testing/setup-tests.js +0 -58
- package/lib/testing/vitest.config.ts +0 -16
- package/lib/transpile/.swcrc +0 -11
- package/lib/transpile/esbuild.js +0 -116
- package/lib/transpile/react-shim.js +0 -2
- package/lib/typescript/tsc-files/index.js +0 -66
- package/lib/typescript/util.js +0 -5
- package/lib/webpack/helpers.js +0 -252
- package/lib/webpack/webpack.base.babel.js +0 -242
- package/lib/webpack/webpack.dev.babel.js +0 -137
- package/lib/webpack/webpack.lib.base.babel.js +0 -205
- package/lib/webpack/webpack.lib.dev.babel.js +0 -49
- package/lib/webpack/webpack.lib.prod.babel.js +0 -77
- package/lib/webpack/webpack.prod.babel.js +0 -142
|
@@ -1,10 +1,12 @@
|
|
|
1
1
|
const path = require('path');
|
|
2
2
|
const normalizePath = require('normalize-path');
|
|
3
|
-
const { getAppConfig,
|
|
4
|
-
const swcrcConfig = require('../transpile/swcrc.config.
|
|
5
|
-
const { findMonoRepoRoot } = require('../monorepo/utils');
|
|
3
|
+
const { getAppConfig, basePath } = require('../utils.cjs');
|
|
4
|
+
const { swcrcConfig } = require('../transpile/swcrc.config.cjs');
|
|
6
5
|
|
|
7
|
-
|
|
6
|
+
let monorepoRoot = null;
|
|
7
|
+
import('../monorepo/utils.js').then(({ findMonoRepoRoot }) => {
|
|
8
|
+
monorepoRoot = findMonoRepoRoot(process.cwd());
|
|
9
|
+
}).catch((ex) => console.error('Error loading monorepo utils:', ex));
|
|
8
10
|
|
|
9
11
|
let isReactModule = true;
|
|
10
12
|
try {
|
|
@@ -20,7 +22,6 @@ const getMockFilePath = (fileName) =>
|
|
|
20
22
|
normalizePath(path.resolve(__dirname, './mocks', fileName));
|
|
21
23
|
|
|
22
24
|
const getNodeModulesPath = (fileName) => {
|
|
23
|
-
const monorepoRoot = findMonoRepoRoot(process.cwd());
|
|
24
25
|
return normalizePath(
|
|
25
26
|
monorepoRoot
|
|
26
27
|
? path.join(monorepoRoot, 'node_modules', fileName)
|
|
@@ -59,16 +60,15 @@ const jestConfig = {
|
|
|
59
60
|
coverageReporters: ['lcov', 'html', 'text-summary'],
|
|
60
61
|
moduleDirectories: ['node_modules', 'app', 'lib'],
|
|
61
62
|
moduleNameMapper: {
|
|
62
|
-
'.*\\webpack-hmr(.[t|j]s)?$': getMockFilePath('webpack-hmr.
|
|
63
|
-
'.*\\.(css|scss)$': getMockFilePath('cssModule.
|
|
63
|
+
'.*\\webpack-hmr(.[t|j]s)?$': getMockFilePath('webpack-hmr.cjs'),
|
|
64
|
+
'.*\\.(css|scss)$': getMockFilePath('cssModule.cjs'),
|
|
64
65
|
'.*\\.(jpg|jpeg|png|gif|eot|otf|webp|ttf|woff|woff2|mp4|webm|wav|mp3|m4a|aac|oga|ico)$':
|
|
65
|
-
getMockFilePath('image.
|
|
66
|
-
'.*\\.svg
|
|
67
|
-
'.*\\.(
|
|
68
|
-
'
|
|
69
|
-
'@elliemae/pui-
|
|
70
|
-
'@elliemae/pui-
|
|
71
|
-
'@elliemae/pui-diagnostics': getMockFilePath('pui-diagnostics.js'),
|
|
66
|
+
getMockFilePath('image.cjs'),
|
|
67
|
+
'.*\\.svg(?:\\?[a-zA-Z]+)?$': getMockFilePath('svg.cjs'),
|
|
68
|
+
'.*\\.html$(?:\\?[a-zA-Z]+)?$': getMockFilePath('html.cjs'),
|
|
69
|
+
'@elliemae/pui-user-monitoring': getMockFilePath('pui-user-monitoring.cjs'),
|
|
70
|
+
'@elliemae/pui-app-loader': getMockFilePath('pui-app-loader.cjs'),
|
|
71
|
+
'@elliemae/pui-diagnostics': getMockFilePath('pui-diagnostics.cjs'),
|
|
72
72
|
'react-spring/web': getNodeModulesPath('react-spring/web.cjs.js'),
|
|
73
73
|
'react-spring/renderprops': getNodeModulesPath(
|
|
74
74
|
'react-spring/renderprops.cjs.js',
|
|
@@ -80,7 +80,7 @@ const jestConfig = {
|
|
|
80
80
|
testRegex: '(app|lib).*/tests/.*\\.test\\.[jt]sx?$',
|
|
81
81
|
snapshotSerializers: [],
|
|
82
82
|
testResultsProcessor: 'jest-sonar-reporter',
|
|
83
|
-
resolver: path.resolve(__dirname, './resolver.
|
|
83
|
+
resolver: path.resolve(__dirname, './resolver.cjs'),
|
|
84
84
|
transform: {
|
|
85
85
|
'^.+\\.[jt]sx?$': ['@swc/jest', swcrcConfig],
|
|
86
86
|
},
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
package/{lib/testing/mocks/pui-user-monitoring.js → dist/cjs/testing/mocks/pui-user-monitoring.cjs}
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
var __create = Object.create;
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
3
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
+
var __getProtoOf = Object.getPrototypeOf;
|
|
6
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
7
|
+
var __copyProps = (to, from, except, desc) => {
|
|
8
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
9
|
+
for (let key of __getOwnPropNames(from))
|
|
10
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
11
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
12
|
+
}
|
|
13
|
+
return to;
|
|
14
|
+
};
|
|
15
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target, mod));
|
|
16
|
+
var React = __toESM(require("react"), 1);
|
|
17
|
+
var import_jest_styled_components = require("jest-styled-components");
|
|
18
|
+
global.React = React;
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
var __create = Object.create;
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
3
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
+
var __getProtoOf = Object.getPrototypeOf;
|
|
6
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
7
|
+
var __copyProps = (to, from, except, desc) => {
|
|
8
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
9
|
+
for (let key of __getOwnPropNames(from))
|
|
10
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
11
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
12
|
+
}
|
|
13
|
+
return to;
|
|
14
|
+
};
|
|
15
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target, mod));
|
|
16
|
+
var import_stable = require("core-js/stable");
|
|
17
|
+
var import_runtime = require("regenerator-runtime/runtime");
|
|
18
|
+
var import_extend_expect = require("@testing-library/jest-dom/extend-expect");
|
|
19
|
+
var import_jest_axe = __toESM(require("jest-axe"), 1);
|
|
20
|
+
var import_resize_observer_polyfill = __toESM(require("resize-observer-polyfill"), 1);
|
|
21
|
+
var import_matchMedia = __toESM(require("./mocks/matchMedia.cjs"), 1);
|
|
22
|
+
var import_pui_diagnostics = require("./mocks/pui-diagnostics.cjs");
|
|
23
|
+
const originalError = console.error;
|
|
24
|
+
console.error = (...args) => {
|
|
25
|
+
const ignoreList = [
|
|
26
|
+
`Warning: Can't perform a React state update on an unmounted component`,
|
|
27
|
+
`Warning: Function components cannot be given refs`,
|
|
28
|
+
`Warning: Failed %s type:`,
|
|
29
|
+
`Warning: Invalid DOM property`,
|
|
30
|
+
`Warning: Each child in a list should have a unique`,
|
|
31
|
+
"Warning: Received `%s` for a non-boolean attribute",
|
|
32
|
+
"Warning: <%s /> is using incorrect casing.",
|
|
33
|
+
"Warning: The tag <%s> is unrecognized in this browser",
|
|
34
|
+
"Warning: Invalid arguments supplied to oneOf"
|
|
35
|
+
];
|
|
36
|
+
if (ignoreList.find((ignoreMsg) => !!args.find((arg) => arg?.includes?.(ignoreMsg))))
|
|
37
|
+
return false;
|
|
38
|
+
return originalError(...args);
|
|
39
|
+
};
|
|
40
|
+
if (expect)
|
|
41
|
+
expect.extend(import_jest_axe.default.toHaveNoViolations);
|
|
42
|
+
jest.setTimeout(6e4);
|
|
43
|
+
const addElementToBody = (element) => {
|
|
44
|
+
const documentEle = (window || {}).document;
|
|
45
|
+
if (!documentEle)
|
|
46
|
+
return null;
|
|
47
|
+
const bodyEle = documentEle.body;
|
|
48
|
+
const newEle = documentEle.createElement(...element);
|
|
49
|
+
if (!newEle)
|
|
50
|
+
return null;
|
|
51
|
+
bodyEle.appendChild(newEle);
|
|
52
|
+
return newEle;
|
|
53
|
+
};
|
|
54
|
+
const addRootElement = (id) => {
|
|
55
|
+
const rootEle = addElementToBody("div");
|
|
56
|
+
if (rootEle)
|
|
57
|
+
rootEle.id = id;
|
|
58
|
+
};
|
|
59
|
+
addRootElement("root");
|
|
60
|
+
(0, import_matchMedia.default)();
|
|
61
|
+
window.ResizeObserver = import_resize_observer_polyfill.default;
|
|
62
|
+
window.emui = {};
|
|
63
|
+
window.emui.logger = (0, import_pui_diagnostics.logger)();
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
var __create = Object.create;
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
3
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
+
var __getProtoOf = Object.getPrototypeOf;
|
|
6
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
7
|
+
var __export = (target, all) => {
|
|
8
|
+
for (var name in all)
|
|
9
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
10
|
+
};
|
|
11
|
+
var __copyProps = (to, from, except, desc) => {
|
|
12
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
13
|
+
for (let key of __getOwnPropNames(from))
|
|
14
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
15
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
16
|
+
}
|
|
17
|
+
return to;
|
|
18
|
+
};
|
|
19
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target, mod));
|
|
20
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
21
|
+
var vitest_config_exports = {};
|
|
22
|
+
__export(vitest_config_exports, {
|
|
23
|
+
default: () => vitest_config_default
|
|
24
|
+
});
|
|
25
|
+
module.exports = __toCommonJS(vitest_config_exports);
|
|
26
|
+
var import_vite = require("vite");
|
|
27
|
+
var import_path = __toESM(require("path"), 1);
|
|
28
|
+
var vitest_config_default = (0, import_vite.defineConfig)({
|
|
29
|
+
test: {
|
|
30
|
+
globals: true,
|
|
31
|
+
root: process.cwd(),
|
|
32
|
+
exclude: ["node_modules", "dist", ".idea", ".git", ".cache", "e2e"],
|
|
33
|
+
setupFiles: [import_path.default.resolve(__dirname, "./vitest.setup.ts")],
|
|
34
|
+
coverage: {
|
|
35
|
+
reportsDirectory: "./reports/coverage"
|
|
36
|
+
},
|
|
37
|
+
environment: "happy-dom"
|
|
38
|
+
}
|
|
39
|
+
});
|
|
File without changes
|
|
@@ -0,0 +1,138 @@
|
|
|
1
|
+
var __create = Object.create;
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
3
|
+
var __defProps = Object.defineProperties;
|
|
4
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
5
|
+
var __getOwnPropDescs = Object.getOwnPropertyDescriptors;
|
|
6
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
7
|
+
var __getOwnPropSymbols = Object.getOwnPropertySymbols;
|
|
8
|
+
var __getProtoOf = Object.getPrototypeOf;
|
|
9
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
10
|
+
var __propIsEnum = Object.prototype.propertyIsEnumerable;
|
|
11
|
+
var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
12
|
+
var __spreadValues = (a, b) => {
|
|
13
|
+
for (var prop in b || (b = {}))
|
|
14
|
+
if (__hasOwnProp.call(b, prop))
|
|
15
|
+
__defNormalProp(a, prop, b[prop]);
|
|
16
|
+
if (__getOwnPropSymbols)
|
|
17
|
+
for (var prop of __getOwnPropSymbols(b)) {
|
|
18
|
+
if (__propIsEnum.call(b, prop))
|
|
19
|
+
__defNormalProp(a, prop, b[prop]);
|
|
20
|
+
}
|
|
21
|
+
return a;
|
|
22
|
+
};
|
|
23
|
+
var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
|
|
24
|
+
var __export = (target, all) => {
|
|
25
|
+
for (var name in all)
|
|
26
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
27
|
+
};
|
|
28
|
+
var __copyProps = (to, from, except, desc) => {
|
|
29
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
30
|
+
for (let key of __getOwnPropNames(from))
|
|
31
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
32
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
33
|
+
}
|
|
34
|
+
return to;
|
|
35
|
+
};
|
|
36
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target, mod));
|
|
37
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
38
|
+
var esbuild_exports = {};
|
|
39
|
+
__export(esbuild_exports, {
|
|
40
|
+
TARGETS: () => TARGETS,
|
|
41
|
+
esBuild: () => esBuild
|
|
42
|
+
});
|
|
43
|
+
module.exports = __toCommonJS(esbuild_exports);
|
|
44
|
+
var import_node_path = __toESM(require("node:path"), 1);
|
|
45
|
+
var import_node_url = require("node:url");
|
|
46
|
+
var import_fast_glob = __toESM(require("fast-glob"), 1);
|
|
47
|
+
var import_esbuild = require("esbuild");
|
|
48
|
+
var import_promises = require("node:fs/promises");
|
|
49
|
+
var import_browserslist_to_esbuild = __toESM(require("browserslist-to-esbuild"), 1);
|
|
50
|
+
const import_meta = {};
|
|
51
|
+
const __dirname = import_node_path.default.dirname((0, import_node_url.fileURLToPath)(import_meta.url));
|
|
52
|
+
const TARGETS = {
|
|
53
|
+
browserslist: (0, import_browserslist_to_esbuild.default)(),
|
|
54
|
+
web: "es2020",
|
|
55
|
+
node: "node14"
|
|
56
|
+
};
|
|
57
|
+
const ESBUILD_FORMAT = {
|
|
58
|
+
CJS: "cjs",
|
|
59
|
+
ESM: "esm"
|
|
60
|
+
};
|
|
61
|
+
const NODE_MODULE_TYPES = {
|
|
62
|
+
CJS: "commonjs",
|
|
63
|
+
ESM: "module"
|
|
64
|
+
};
|
|
65
|
+
const getCommonConfig = ({ injectReactShim }) => ({
|
|
66
|
+
bundle: false,
|
|
67
|
+
loader: { ".js": "jsx" },
|
|
68
|
+
mainFields: ["module", "browser", "main"],
|
|
69
|
+
inject: [
|
|
70
|
+
injectReactShim ? import_node_path.default.resolve(__dirname, "./react-shim.js") : ""
|
|
71
|
+
].filter(Boolean)
|
|
72
|
+
});
|
|
73
|
+
const copyFiles = async ({ srcdir, outdir }) => {
|
|
74
|
+
const files = await (0, import_fast_glob.default)([
|
|
75
|
+
`${srcdir}/**/*.*`,
|
|
76
|
+
`!${srcdir}/**/*.{js,jsx,ts,tsx,mjs}`
|
|
77
|
+
]);
|
|
78
|
+
await Promise.all(files.map(async (srcFilePath) => {
|
|
79
|
+
const destFilePath = srcFilePath.replace(srcdir, outdir);
|
|
80
|
+
const fileDir = import_node_path.default.dirname(destFilePath);
|
|
81
|
+
await (0, import_promises.mkdir)(fileDir, { recursive: true });
|
|
82
|
+
await (0, import_promises.copyFile)(srcFilePath, destFilePath);
|
|
83
|
+
}));
|
|
84
|
+
};
|
|
85
|
+
const getSideEffects = async () => {
|
|
86
|
+
const data = await (0, import_promises.readFile)(import_node_path.default.join(process.cwd(), "./package.json"));
|
|
87
|
+
const packageJSON = JSON.parse(data);
|
|
88
|
+
return packageJSON?.sideEffects || false;
|
|
89
|
+
};
|
|
90
|
+
const createPackageJson = async ({ outdir, type = NODE_MODULE_TYPES.ESM }) => {
|
|
91
|
+
const filePath = import_node_path.default.join(process.cwd(), outdir, "package.json");
|
|
92
|
+
const packageJSON = JSON.stringify({
|
|
93
|
+
type,
|
|
94
|
+
sideEffects: await getSideEffects()
|
|
95
|
+
}, null, 2);
|
|
96
|
+
await (0, import_promises.writeFile)(filePath, packageJSON);
|
|
97
|
+
};
|
|
98
|
+
const esBuild = async ({
|
|
99
|
+
srcdir,
|
|
100
|
+
outdir = "dist",
|
|
101
|
+
esmOnly = false,
|
|
102
|
+
target = TARGETS.browserslist,
|
|
103
|
+
injectReactShim = true,
|
|
104
|
+
skipNestedPackageJSON = false
|
|
105
|
+
}) => {
|
|
106
|
+
const inputFiles = [
|
|
107
|
+
`${srcdir}/**/*.{js,jsx,ts,tsx}`,
|
|
108
|
+
`!${srcdir}/**/*.d.ts`,
|
|
109
|
+
`!${srcdir}/**/*.test.{js,jsx,ts,tsx}`,
|
|
110
|
+
`!${srcdir}/**/*.stories.{js,jsx,ts,tsx}`,
|
|
111
|
+
`!${srcdir}/**/*.endpoint.{js,jsx,ts,tsx}`
|
|
112
|
+
];
|
|
113
|
+
if (!esmOnly) {
|
|
114
|
+
const cjsOutdir = `${outdir}/cjs`;
|
|
115
|
+
const commonJSEntryPoints = await (0, import_fast_glob.default)(inputFiles);
|
|
116
|
+
await (0, import_esbuild.build)(__spreadProps(__spreadValues({
|
|
117
|
+
entryPoints: commonJSEntryPoints
|
|
118
|
+
}, getCommonConfig({ injectReactShim })), {
|
|
119
|
+
outdir: cjsOutdir,
|
|
120
|
+
format: ESBUILD_FORMAT.CJS,
|
|
121
|
+
target
|
|
122
|
+
}));
|
|
123
|
+
await copyFiles({ srcdir, outdir: cjsOutdir });
|
|
124
|
+
await createPackageJson({ outdir: cjsOutdir, type: NODE_MODULE_TYPES.CJS });
|
|
125
|
+
}
|
|
126
|
+
const esmOutdir = esmOnly ? outdir : `${outdir}/esm`;
|
|
127
|
+
const entryPoints = await (0, import_fast_glob.default)(inputFiles.concat([`!${srcdir}/**/cjs/**/*.{js,jsx,ts,tsx}`]));
|
|
128
|
+
await (0, import_esbuild.build)(__spreadProps(__spreadValues({
|
|
129
|
+
entryPoints
|
|
130
|
+
}, getCommonConfig({ injectReactShim })), {
|
|
131
|
+
outdir: esmOutdir,
|
|
132
|
+
format: ESBUILD_FORMAT.ESM,
|
|
133
|
+
target
|
|
134
|
+
}));
|
|
135
|
+
await copyFiles({ srcdir, outdir: esmOutdir });
|
|
136
|
+
if (!skipNestedPackageJSON)
|
|
137
|
+
await createPackageJson({ outdir: esmOutdir, type: NODE_MODULE_TYPES.ESM });
|
|
138
|
+
};
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
var __create = Object.create;
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
3
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
+
var __getProtoOf = Object.getPrototypeOf;
|
|
6
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
7
|
+
var __export = (target, all) => {
|
|
8
|
+
for (var name in all)
|
|
9
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
10
|
+
};
|
|
11
|
+
var __copyProps = (to, from, except, desc) => {
|
|
12
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
13
|
+
for (let key of __getOwnPropNames(from))
|
|
14
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
15
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
16
|
+
}
|
|
17
|
+
return to;
|
|
18
|
+
};
|
|
19
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target, mod));
|
|
20
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
21
|
+
var react_shim_exports = {};
|
|
22
|
+
__export(react_shim_exports, {
|
|
23
|
+
React: () => React
|
|
24
|
+
});
|
|
25
|
+
module.exports = __toCommonJS(react_shim_exports);
|
|
26
|
+
var React = __toESM(require("react"), 1);
|
|
File without changes
|
|
File without changes
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
var __create = Object.create;
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
3
|
+
var __defProps = Object.defineProperties;
|
|
4
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
5
|
+
var __getOwnPropDescs = Object.getOwnPropertyDescriptors;
|
|
6
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
7
|
+
var __getOwnPropSymbols = Object.getOwnPropertySymbols;
|
|
8
|
+
var __getProtoOf = Object.getPrototypeOf;
|
|
9
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
10
|
+
var __propIsEnum = Object.prototype.propertyIsEnumerable;
|
|
11
|
+
var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
12
|
+
var __spreadValues = (a, b) => {
|
|
13
|
+
for (var prop in b || (b = {}))
|
|
14
|
+
if (__hasOwnProp.call(b, prop))
|
|
15
|
+
__defNormalProp(a, prop, b[prop]);
|
|
16
|
+
if (__getOwnPropSymbols)
|
|
17
|
+
for (var prop of __getOwnPropSymbols(b)) {
|
|
18
|
+
if (__propIsEnum.call(b, prop))
|
|
19
|
+
__defNormalProp(a, prop, b[prop]);
|
|
20
|
+
}
|
|
21
|
+
return a;
|
|
22
|
+
};
|
|
23
|
+
var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
|
|
24
|
+
var __copyProps = (to, from, except, desc) => {
|
|
25
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
26
|
+
for (let key of __getOwnPropNames(from))
|
|
27
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
28
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
29
|
+
}
|
|
30
|
+
return to;
|
|
31
|
+
};
|
|
32
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target, mod));
|
|
33
|
+
var import_execa = require("execa");
|
|
34
|
+
var import_node_fs = __toESM(require("node:fs"), 1);
|
|
35
|
+
var import_node_path = __toESM(require("node:path"), 1);
|
|
36
|
+
var import_utils = require("./utils.js");
|
|
37
|
+
const args = process.argv.slice(2);
|
|
38
|
+
const argsProjectIndex = args.findIndex((arg) => ["-p", "--project"].includes(arg));
|
|
39
|
+
const argsProjectValue = argsProjectIndex !== -1 ? args[argsProjectIndex + 1] : void 0;
|
|
40
|
+
const files = args.filter((file) => /\.(ts|tsx)$/.test(file));
|
|
41
|
+
if (files.length === 0) {
|
|
42
|
+
process.exit(0);
|
|
43
|
+
}
|
|
44
|
+
const remainingArgsToForward = args.slice().filter((arg) => !files.includes(arg));
|
|
45
|
+
if (argsProjectIndex !== -1) {
|
|
46
|
+
remainingArgsToForward.splice(argsProjectIndex, 2);
|
|
47
|
+
}
|
|
48
|
+
const tsconfigPath = argsProjectValue || (0, import_utils.resolveFromRoot)("tsconfig.json");
|
|
49
|
+
const tsconfigContent = import_node_fs.default.readFileSync(tsconfigPath).toString();
|
|
50
|
+
let tsconfig = {};
|
|
51
|
+
eval(`tsconfig = ${tsconfigContent}`);
|
|
52
|
+
const tmpTsconfigPath = (0, import_utils.resolveFromRoot)(`tsconfig.${(0, import_utils.randomChars)()}.json`);
|
|
53
|
+
const tmpTsconfig = __spreadProps(__spreadValues({}, tsconfig), {
|
|
54
|
+
compilerOptions: __spreadProps(__spreadValues({}, tsconfig.compilerOptions), {
|
|
55
|
+
skipLibCheck: true
|
|
56
|
+
}),
|
|
57
|
+
files,
|
|
58
|
+
include: ["app", "lib"]
|
|
59
|
+
});
|
|
60
|
+
import_node_fs.default.writeFileSync(tmpTsconfigPath, JSON.stringify(tmpTsconfig, null, 2));
|
|
61
|
+
let status = 0;
|
|
62
|
+
try {
|
|
63
|
+
import_execa.execa.sync(import_node_path.default.resolve(process.cwd(), `./node_modules/.bin/tsc${process.platform === "win32" ? ".cmd" : ""}`), ["-p", tmpTsconfigPath, ...remainingArgsToForward], { stdio: "inherit" });
|
|
64
|
+
} catch (ex) {
|
|
65
|
+
status = ex.exitCode;
|
|
66
|
+
}
|
|
67
|
+
import_node_fs.default.unlinkSync(tmpTsconfigPath);
|
|
68
|
+
process.exit(status);
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
var __defProp = Object.defineProperty;
|
|
2
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
3
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
4
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
5
|
+
var __export = (target, all) => {
|
|
6
|
+
for (var name in all)
|
|
7
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
8
|
+
};
|
|
9
|
+
var __copyProps = (to, from, except, desc) => {
|
|
10
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
11
|
+
for (let key of __getOwnPropNames(from))
|
|
12
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
13
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
14
|
+
}
|
|
15
|
+
return to;
|
|
16
|
+
};
|
|
17
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
18
|
+
var utils_exports = {};
|
|
19
|
+
__export(utils_exports, {
|
|
20
|
+
randomChars: () => randomChars,
|
|
21
|
+
resolveFromModule: () => resolveFromModule,
|
|
22
|
+
resolveFromRoot: () => resolveFromRoot
|
|
23
|
+
});
|
|
24
|
+
module.exports = __toCommonJS(utils_exports);
|
|
25
|
+
var import_node_path = require("node:path");
|
|
26
|
+
const randomChars = () => Math.random().toString(36).slice(2);
|
|
27
|
+
const resolveFromModule = (moduleName, ...paths) => {
|
|
28
|
+
const modulePath = (0, import_node_path.dirname)(require.resolve(`${moduleName}/package.json`));
|
|
29
|
+
return (0, import_node_path.join)(modulePath, ...paths);
|
|
30
|
+
};
|
|
31
|
+
const resolveFromRoot = (...paths) => (0, import_node_path.join)(process.cwd(), ...paths);
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
var __create = Object.create;
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
3
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
+
var __getProtoOf = Object.getPrototypeOf;
|
|
6
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
7
|
+
var __export = (target, all) => {
|
|
8
|
+
for (var name in all)
|
|
9
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
10
|
+
};
|
|
11
|
+
var __copyProps = (to, from, except, desc) => {
|
|
12
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
13
|
+
for (let key of __getOwnPropNames(from))
|
|
14
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
15
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
16
|
+
}
|
|
17
|
+
return to;
|
|
18
|
+
};
|
|
19
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target, mod));
|
|
20
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
21
|
+
var util_exports = {};
|
|
22
|
+
__export(util_exports, {
|
|
23
|
+
isTypeScriptEnabled: () => isTypeScriptEnabled
|
|
24
|
+
});
|
|
25
|
+
module.exports = __toCommonJS(util_exports);
|
|
26
|
+
var import_node_fs = __toESM(require("node:fs"), 1);
|
|
27
|
+
var import_node_path = __toESM(require("node:path"), 1);
|
|
28
|
+
const isTypeScriptEnabled = () => import_node_fs.default.existsSync(import_node_path.default.join(process.cwd(), "tsconfig.json"));
|
|
@@ -0,0 +1,20 @@
|
|
|
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;
|