@abyss-project/commons-front-core 21.8.0 → 21.8.2

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.
Files changed (32) hide show
  1. package/CHANGELOG.md +8 -0
  2. package/dist/{CookieConsentSettings-DmdpkY4W.js → CookieConsentSettings-4BuLzLqD.js} +1 -1
  3. package/dist/{Surface-Bz9IlYzh.js → Surface-DCgywYyJ.js} +84 -82
  4. package/dist/{Tabs-BCsiGmjM.js → Tabs-CgXaaXch.js} +1 -1
  5. package/dist/cookie-consent.js +2 -2
  6. package/dist/{editors-ROEvrYr4.js → editors--itphaqU.js} +27 -27
  7. package/dist/editors.js +1 -1
  8. package/dist/{index-CXgXyfY3.js → index-4_O8oydT.js} +2 -2
  9. package/dist/{index-CeZseajO.js → index-B8xEJ2eG.js} +2 -2
  10. package/dist/{index-5A2mIQ9G.js → index-BfJqh8s4.js} +4 -4
  11. package/dist/{index-Cq_z0w7j.js → index-C7GUOCVB.js} +3 -3
  12. package/dist/{index-C_j0gA3H.js → index-CCKTE4Qk.js} +2 -2
  13. package/dist/{index-BuPLdG_9.js → index-CD7_95Mn.js} +2 -2
  14. package/dist/{index-BVTeKL8H.js → index-CGqgbd6K.js} +3 -3
  15. package/dist/{index-DoQsEkVC.js → index-Cq0ofXBo.js} +3 -3
  16. package/dist/{index-DxotIOMC.js → index-CvXHEjEU.js} +2 -2
  17. package/dist/{index-CpA0L8Ml.js → index-CzvkXNxX.js} +2 -2
  18. package/dist/{index-z_gfRs5k.js → index-DFB3_RXB.js} +2 -2
  19. package/dist/{index-BzT36p42.js → index-DH9-LTZh.js} +4 -4
  20. package/dist/{index-L5J7_NGN.js → index-DPOG4eG2.js} +2 -2
  21. package/dist/{index-BNlYqNm9.js → index-DS1sI9hs.js} +3 -3
  22. package/dist/{index-DccwknnA.js → index-DjIcGqiu.js} +2 -2
  23. package/dist/{index-D9WfqtNo.js → index-DwCc0PLB.js} +2 -2
  24. package/dist/{index-BRaIFAIi.js → index-MCwgtui1.js} +4 -4
  25. package/dist/{index-M8pctP26.js → index-PlAiyjTI.js} +2 -2
  26. package/dist/{index-BlYhAWr_.js → index-R4eCnYkE.js} +1 -1
  27. package/dist/{index-Btj0N4JN.js → index-X0wSqZY6.js} +2 -2
  28. package/dist/{index-Clxj6idW.js → index-eOvnrbaL.js} +2 -2
  29. package/dist/index.js +8175 -8061
  30. package/package.json +2 -2
  31. package/scripts/check-dist-dir-imports.cjs +42 -0
  32. package/vite.config.ts +4 -3
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@abyss-project/commons-front-core",
3
- "version": "21.8.0",
3
+ "version": "21.8.2",
4
4
  "description": "Front Core package of AbyssProject",
5
5
  "main": "dist/index.js",
6
6
  "module": "./dist/index.js",
@@ -175,7 +175,7 @@
175
175
  "lint": "eslint \"{src,apps,libs,test,core,catalog}/**/*.{ts,tsx}\" --fix",
176
176
  "lint:check": "eslint \"{src,apps,libs,test,core,catalog}/**/*.{ts,tsx}\" --max-warnings 0",
177
177
  "tsc": "tsc --noEmit && tsc --noEmit -p catalog/tsconfig.json",
178
- "build": "vite build && node scripts/check-auth-entry-isolation.cjs",
178
+ "build": "vite build && node scripts/check-auth-entry-isolation.cjs && node scripts/check-dist-dir-imports.cjs",
179
179
  "dev": "vite build --watch",
180
180
  "test": "vitest run --config vitest.config.ts",
181
181
  "test:watch": "vitest --config vitest.config.ts",
@@ -0,0 +1,42 @@
1
+ #!/usr/bin/env node
2
+ /* eslint-disable no-console */
3
+ 'use strict';
4
+
5
+ /**
6
+ * check-dist-dir-imports.cjs — build guard against bare DIRECTORY imports left in `dist/`.
7
+ *
8
+ * `@mui/x-date-pickers` v6 ships sub-paths (`AdapterDateFns`, `PickersDay`, `locales`) as
9
+ * directories without an `exports` map entry. A consumer that loads the dist under Node ESM (vitest
10
+ * in every satellite front) fails on such an import with ERR_UNSUPPORTED_DIR_IMPORT, so
11
+ * `vite.config.ts` bundles them. This guard fails the build when a chunk still imports one of them,
12
+ * so the next sub-path added to a date component cannot reach npm unbundled (core 21.8.0 did, #821).
13
+ *
14
+ * Exit 0: no such import. Exit 1: offending files and specifiers printed. Exit 2: dist absent.
15
+ */
16
+
17
+ const fs = require('fs');
18
+ const path = require('path');
19
+
20
+ const DIST_DIR = path.resolve(__dirname, '../dist');
21
+ const PATTERN = /from\s*["'](@mui\/x-date-pickers\/[^"']+)["']|import\s*\(\s*["'](@mui\/x-date-pickers\/[^"']+)["']/g;
22
+
23
+ if (!fs.existsSync(DIST_DIR)) {
24
+ console.error('check-dist-dir-imports: dist/ is missing, build the package first.');
25
+ process.exit(2);
26
+ }
27
+
28
+ const offenders = [];
29
+ for (const name of fs.readdirSync(DIST_DIR)) {
30
+ if (!name.endsWith('.js')) continue;
31
+ const source = fs.readFileSync(path.join(DIST_DIR, name), 'utf8');
32
+ for (const match of source.matchAll(PATTERN)) {
33
+ offenders.push(`${name}: ${match[1] ?? match[2]}`);
34
+ }
35
+ }
36
+
37
+ if (offenders.length > 0) {
38
+ console.error('check-dist-dir-imports: @mui/x-date-pickers sub-path imports left in dist/ (bundle them in vite.config.ts):');
39
+ for (const offender of offenders) console.error(` ${offender}`);
40
+ process.exit(1);
41
+ }
42
+ console.log('check-dist-dir-imports: no @mui/x-date-pickers sub-path import in dist/.');
package/vite.config.ts CHANGED
@@ -107,16 +107,17 @@ export default defineConfig({
107
107
  if (exactNames.includes(id)) return true;
108
108
  if (exactNames.some((name) => id.startsWith(name + '/'))) return true;
109
109
  // x-date-pickers v6's `exports` map exposes only the bare ROOT and a few
110
- // named entries — NOT the DIRECTORY sub-paths `AdapterDateFns` and
111
- // `PickersDay` that DatePeriodPicker.component imports directly. Left
110
+ // named entries — NOT the DIRECTORY sub-paths `AdapterDateFns`, `PickersDay`
111
+ // and `locales` that the date components import directly. Left
112
112
  // externalized, those bare directory imports are unresolvable under Node
113
113
  // ESM (ERR_UNSUPPORTED_DIR_IMPORT — breaks vitest in every consumer that
114
- // pulls the theme/date components). Bundle exactly those two sub-paths so
114
+ // pulls the theme/date components). Bundle exactly those sub-paths so
115
115
  // the dist carries no such import (the bare root stays external below).
116
116
  // (Icon sub-paths like `@mui/icons-material/AddRounded` are `.js` FILES
117
117
  // and resolve fine, so they stay externalized.)
118
118
  if (id === '@mui/x-date-pickers/AdapterDateFns') return false;
119
119
  if (id === '@mui/x-date-pickers/PickersDay') return false;
120
+ if (id === '@mui/x-date-pickers/locales') return false;
120
121
  // Bundled on purpose, see `resolve.alias` above.
121
122
  if (id === '@abyss-project/main/plan-name') return false;
122
123
  if (id === '@abyss-project/main/billing-metric-label') return false;