mirror of
https://github.com/wekan/wekan.git
synced 2026-11-25 10:48:06 -05:00
A transitive walk from client/main.js found the remaining CommonJS
(module.exports) helpers that the rspack client build pulls into the ES
module graph and rejects: 3 client/lib helpers (cardDragGeometry,
inlinedFormManager, popupOffset), 4 imports/lib helpers (boardAutoScroll,
datePickerTime, fileNameDisplay, staleWhileRevalidate), imports/simpleSchema
(its meteor/aldeed:simple-schema require becomes a namespace import),
imports/i18n/loadHelpers, and 4 more models/lib helpers (cardLinkRedirect,
sandstormAutoOpen, securityCategories, securityLogFormat). All become
`export { ... }`; their .cjs unit tests use `await import(...js)`.
The only CJS files still reachable in the walk are server-only: the
server/lib/* files (Meteor never bundles server/ to the client) and the
fs-using models/lib file-storage helpers (reached only via the server-side
fileStoreStrategy; they would fail on require("fs") if they were actually in
the client bundle). Those correctly stay CommonJS.
Full tests/*.test.cjs suite: same 7 pre-existing failures, no new ones.
12 lines
324 B
JavaScript
12 lines
324 B
JavaScript
import * as schemaPackage from 'meteor/aldeed:simple-schema';
|
|
|
|
const SimpleSchema =
|
|
schemaPackage.default || schemaPackage.SimpleSchema || schemaPackage;
|
|
|
|
if (!SimpleSchema._wekanExtendedOptions) {
|
|
SimpleSchema.extendOptions(['index', 'unique']);
|
|
SimpleSchema._wekanExtendedOptions = true;
|
|
}
|
|
|
|
export { SimpleSchema };
|