@corva/dc-platform-shared 0.0.0-4ac3d4f → 0.0.0-509acba
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/package.json +1 -1
- package/vite/corva-vite-config.mjs +23 -5
package/package.json
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"name":"@corva/dc-platform-shared","version":"0.0.0-
|
|
1
|
+
{"name":"@corva/dc-platform-shared","version":"0.0.0-509acba","description":"A library to share internal DC platform specific code","main":"./dist","module":"./src/index.js","repository":{"type":"git","url":"https://github.com/corva-ai/corva-dc-platform-shared"},"author":"Oleksandr Krupko <oleksandr.krupko@corva.ai>","license":"MIT","//sass-alias":"sass-embedded installed under the name 'sass' (see dependencies) because rollup-plugin-postcss@4.0.2 hard-requires require('sass') with no override hook (see rollup.config.js). Drop this alias when rollup-plugin-postcss is replaced.","scripts":{"helper-cli":"npx @corva/fe-dev-helper-cli@latest","lint":"eslint --cache ./src/","lint-staged":"lint-staged","build":"./scripts/build.sh production","build-watch":"./scripts/build.sh development -w","get-changelog":"conventional-changelog -r 2 -p angular","release":"git fetch --tags && git add -A && standard-version -a","generate-css-themes":"echo 'skip: css themes generated by @corva/ui build'","start":"yarn generate-css-themes && cross-env NODE_ENV=local rollup -c -w","test":"jest","test-coverage":"jest --watchAll --coverage && http-serve coverage","test-watch":"jest --watch"},"lint-staged":{"*.js":["eslint --fix"]},"standard-version":{"skip":{"tag":true}},"jest":{"collectCoverageFrom":["./**/*.{js,jsx,mjs}"],"coverageReporters":["html","text-summary"],"moduleNameMapper":{"~(.*)":"<rootDir>/src/$1","\\.(css|less|scss|sass)$":"identity-obj-proxy"},"setupFiles":["<rootDir>/jest/setEnvVars.js"],"testMatch":["**/__tests__/**/?(*.)+(spec|test).[jt]s?(x)"],"transform":{"^.+\\.jsx?$":"babel-jest","^.+\\.mjs$":"babel-jest","^.+\\.svg$":"<rootDir>/jest/svgTransform.js"},"transformIgnorePatterns":["/node_modules/(?!@corva/ui|@icon-park/react)"],"moduleFileExtensions":["js","jsx","json","mjs","node"],"testEnvironment":"jsdom"},"dependencies":{"@babel/core":"^7.12.10","@babel/plugin-transform-react-jsx":"^7.12.11","@babel/plugin-transform-runtime":"^7.12.10","@babel/preset-env":"^7.12.11","@babel/preset-react":"^7.12.10","@corva/eslint-config-browser":"^0.0.4","@date-io/moment":"1.3.13","@icon-park/react":"1.4.2","@material-ui/core":"4.11.2","@material-ui/icons":"4.9.1","@material-ui/lab":"4.0.0-alpha.57","@material-ui/pickers":"3.2.10","@pmmmwh/react-refresh-webpack-plugin":"0.5.10","@vitejs/plugin-react":"6.1.1","@vitest/coverage-v8":"4.1.11","babel-eslint":"10.0.3","babel-jest":"^30.2.0","babel-loader":"^10.0.0","babel-plugin-file-loader":"^2.0.0","babel-plugin-root-import":"^6.5.0","chalk":"4.1.1","classnames":"2.2.6","clean-webpack-plugin":"3.0.0","copy-webpack-plugin":"^13.0.1","css-loader":"^7.1.0","dotenv":"16.4.7","dotenv-expand":"11.0.7","eslint-config-airbnb":"17.1.0","eslint-plugin-jest-dom":"3.9.4","eslint-plugin-prettier":"3.1.1","eslint-plugin-testing-library":"^3.9.2","express":"4.21.2","fs":"0.0.1-security","html-webpack-plugin":"^5.6.4","identity-obj-proxy":"^3.0.0","jest":"^30.2.0","jest-environment-jsdom":"^30.2.0","jsdom":"22.1.0","jsona":"1.5.1","lodash":"4.18.1","moment":"2.29.4","node-fetch":"^2.6.1","path":"0.12.7","postcss":"^8.5.26","postcss-import":"12.0.1","postcss-loader":"^8.1.0","postcss-preset-env":"^11.3.0","prettier":"^2.1.2","process":"^0.11.10","prop-types":"15.7.2","react":"18.3.1","react-dom":"18.3.1","react-grid-layout":"1.3.4","react-router-dom":"^5.3.4","react-sizeme":"2.5.2","rollup-plugin-copy":"^3.4.0","rollup-plugin-license":"3.6.0","sass":"npm:sass-embedded@^1.99.0","sass-loader":"^16.0.5","semver":"7.5.2","style-loader":"^4.0.0","svg-url-loader":"^8.1.0","terser-webpack-plugin":"^5.3.14","uuid":"3.4.0","vite":"8.3.0","vite-plugin-static-copy":"4.1.0","vitest":"4.1.11","webpack":"5.94.0","webpack-cli":"5.1.4","webpack-dev-server":"^5.2.2","webpack-merge":"5.9.0"},"peerDependencies":{"@corva/ui":"*"},"devDependencies":{"@corva/ui":"3.78.0-2","@rollup/plugin-babel":"^5.2.1","@rollup/plugin-commonjs":"^15.0.0","@rollup/plugin-image":"^2.0.6","@rollup/plugin-json":"^4.1.0","@rollup/plugin-node-resolve":"^9.0.0","@testing-library/jest-dom":"5.16.5","@testing-library/react":"^14.0.0","babel-plugin-external-helpers":"^6.22.0","conventional-changelog-cli":"^2.1.0","cross-env":"^7.0.3","git-conventional-commits":"^1.1.0","lint-staged":"^10.5.4","postcss-url":"9.0.0","pre-commit":"1.2.2","rollup":"^2.28.2","rollup-plugin-cleanup":"^3.2.1","rollup-plugin-css-bundle":"^1.0.4","rollup-plugin-css-only":"^2.1.0","rollup-plugin-node-externals":"^2.2.0","rollup-plugin-postcss":"^4.0.2","rollup-plugin-rename-node-modules":"^1.0.1","rollup-plugin-terser":"^7.0.2","rollup-plugin-visualizer":"^4.1.1","standard-version":"^9.0.0"},"engines":{"node":">=24.15.0"},"resolutions":{"braces":"3.0.3","@babel/runtime":"^7.18.0","lodash":"4.18.1"}}
|
|
@@ -145,7 +145,7 @@ const finalizeJsBundle = ({ outDir, cssFileNames, appIdentifier, emittedGlobalNa
|
|
|
145
145
|
// inlined only SVGs under svg-url-loader's 10 KB limit. Vite's library mode inlines every asset
|
|
146
146
|
// whatever `assetsInlineLimit` says — `?no-inline` is the one thing it still honours, so the
|
|
147
147
|
// same split is restored by tagging the id.
|
|
148
|
-
const EMITTED_ASSET_RE = /\.(png|jpe?g|gif|webp|avif|woff2?|eot|ttf|otf|mp4|webm|ogg|mp3|wav)$/i;
|
|
148
|
+
const EMITTED_ASSET_RE = /\.(png|jpe?g|gif|webp|avif|woff2?|eot|ttf|otf|mp4|webm|ogg|mp3|wav|glb|gltf)$/i;
|
|
149
149
|
const SVG_INLINE_LIMIT = 10000;
|
|
150
150
|
|
|
151
151
|
const emitAssetsAsFilesPlugin = () => {
|
|
@@ -651,10 +651,18 @@ export const createViteConfig = ({ pwd, overrides = {} }) => {
|
|
|
651
651
|
return {
|
|
652
652
|
...defaultAlias,
|
|
653
653
|
...Object.fromEntries(
|
|
654
|
-
Object.entries(compilerOptions?.paths || {})
|
|
655
|
-
|
|
656
|
-
|
|
657
|
-
|
|
654
|
+
Object.entries(compilerOptions?.paths || {})
|
|
655
|
+
// `"react": ["./node_modules/@types/react"]` tells tsc where the types live; as a runtime
|
|
656
|
+
// alias it points the bundler at a package with no code, and every `react/...` subpath
|
|
657
|
+
// then fails to resolve
|
|
658
|
+
.filter(([, [value]]) => !/(^|\/)@types\//.test(value))
|
|
659
|
+
.map(([key, [value]]) => (
|
|
660
|
+
key.endsWith('/*')
|
|
661
|
+
// keep the `/*` boundary: a bare `@` prefix-matches @types/react, @corva/ui and
|
|
662
|
+
// every other scoped package and rewrites them into src/
|
|
663
|
+
? [`${key.slice(0, -1)}`, `${resolve(pwd, value.replace('/*', ''))}/`]
|
|
664
|
+
: [key, resolve(pwd, value)]
|
|
665
|
+
)),
|
|
658
666
|
),
|
|
659
667
|
};
|
|
660
668
|
};
|
|
@@ -675,6 +683,11 @@ export const createViteConfig = ({ pwd, overrides = {} }) => {
|
|
|
675
683
|
server: {
|
|
676
684
|
host: process.env.HOST || 'app.local.corva.ai',
|
|
677
685
|
port: Number(process.env.PORT) || 8080,
|
|
686
|
+
// the local-debug flow loads this bundle into the platform from another origin, which
|
|
687
|
+
// webpack allowed with `allowedHosts: 'all'` plus a permissive CORS header. Without the
|
|
688
|
+
// same here the HMR socket is refused and the bundle stops live-reloading.
|
|
689
|
+
allowedHosts: true,
|
|
690
|
+
cors: true,
|
|
678
691
|
},
|
|
679
692
|
css: {
|
|
680
693
|
modules: {
|
|
@@ -692,6 +705,11 @@ export const createViteConfig = ({ pwd, overrides = {} }) => {
|
|
|
692
705
|
test: {
|
|
693
706
|
watch: false,
|
|
694
707
|
globals: true,
|
|
708
|
+
// vitest transforms and imports a file's module graph the first time a worker touches it,
|
|
709
|
+
// where babel-jest served it from its cache. Under a full parallel run that first touch can
|
|
710
|
+
// outlast vitest's 5s default and fail a test that does no async work at all - it passes
|
|
711
|
+
// alone on a dev machine and times out on a CI runner.
|
|
712
|
+
testTimeout: 20000,
|
|
695
713
|
// jest ran with resetMocks: true; vitest defaults it to false
|
|
696
714
|
mockReset: true,
|
|
697
715
|
// measured on a 169-file app before the pre-bundle below: threads 105 s, the default
|