diff --git a/package-lock.json b/package-lock.json index a34f1fe8..bb2edc00 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "@labkey/api", - "version": "1.52.0", + "version": "1.52.1", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "@labkey/api", - "version": "1.52.0", + "version": "1.52.1", "license": "Apache-2.0", "devDependencies": { "@babel/core": "8.0.1", diff --git a/package.json b/package.json index 2528d3e9..ab29d5aa 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@labkey/api", - "version": "1.52.0", + "version": "1.52.1", "description": "JavaScript client API for LabKey Server", "scripts": { "build": "npm run build:dist && npm run build:docs", diff --git a/src/wrapper.ts b/src/wrapper.ts index b6cc2be3..8ded3311 100644 --- a/src/wrapper.ts +++ b/src/wrapper.ts @@ -31,8 +31,10 @@ declare let LABKEY: any; LABKEY.ActionURL = API.ActionURL; LABKEY.Ajax = API.Ajax; LABKEY.App = API.App; +LABKEY.Assay = API.Assay; LABKEY.Domain = API.Domain; LABKEY.Exp = API.Exp; +LABKEY.Experiment = API.Experiment; LABKEY.FieldKey = API.FieldKey; LABKEY.Filter = API.Filter; LABKEY.List = API.List; @@ -40,21 +42,16 @@ LABKEY.Message = API.Message; LABKEY.MultiRequest = API.MultiRequest; LABKEY.ParticipantGroup = API.ParticipantGroup; LABKEY.Pipeline = API.Pipeline; +LABKEY.Query = API.Query; LABKEY.QueryKey = API.QueryKey; LABKEY.Report = API.Report; LABKEY.SchemaKey = API.SchemaKey; +LABKEY.Security = API.Security; LABKEY.Specimen = API.Specimen; LABKEY.Storage = API.Storage; +LABKEY.Utils = API.Utils; LABKEY.Visualization = API.Visualization; -// The following namespaces are extended at runtime by legacy DOM overrides. -// Since we are now targeting ES2023+, we need to create writable plain objects so the overrides can mutate. -LABKEY.Assay = Object.assign({}, API.Assay); -LABKEY.Experiment = Object.assign({}, API.Experiment); -LABKEY.Query = Object.assign({}, API.Query); -LABKEY.Security = Object.assign({}, API.Security); -LABKEY.Utils = Object.assign({}, API.Utils); - LABKEY.__package__ = __package__; // The app registry needs to be initialized after the namespace has been established. diff --git a/webpack.config.js b/webpack.config.js index fa782998..30375df4 100644 --- a/webpack.config.js +++ b/webpack.config.js @@ -24,11 +24,22 @@ const apiGlobalConfig = { loader: 'ts-loader', options: { onlyCompileBundledFiles: true, + // Emit CommonJS ("nodenext", since package.json intentionally has no "type":"module") so LABKEY + // namespaces stay shared, writable exports that legacy runtime overrides can patch. + compilerOptions: { + module: 'nodenext', + moduleResolution: 'nodenext', + }, }, }, ], }, + optimization: { + // Disable scope hoisting so cross-module references resolve through the shared, patchable exports objects. + concatenateModules: false, + }, + output: { filename: 'labkey-api-js-[name].min.js', }, @@ -57,7 +68,6 @@ const umdPackageConfig = { outDir: path.resolve(__dirname, 'dist'), declaration: true, removeComments: true, - target: 'ES6', }, onlyCompileBundledFiles: true, },