@openmrs/esm-api 4.5.1-pre.804 → 5.0.0
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
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@openmrs/esm-api",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "5.0.0",
|
|
4
4
|
"license": "MPL-2.0",
|
|
5
5
|
"description": "The javascript module for interacting with the OpenMRS API",
|
|
6
6
|
"browser": "dist/openmrs-esm-api.js",
|
|
@@ -9,6 +9,7 @@
|
|
|
9
9
|
"scripts": {
|
|
10
10
|
"test": "jest --config jest.config.js --passWithNoTests",
|
|
11
11
|
"build": "webpack --mode=production",
|
|
12
|
+
"build:development": "webpack --mode development",
|
|
12
13
|
"analyze": "webpack --mode=production --env analyze=true",
|
|
13
14
|
"typescript": "tsc",
|
|
14
15
|
"lint": "eslint src --ext ts,tsx"
|
|
@@ -45,10 +46,10 @@
|
|
|
45
46
|
"@openmrs/esm-offline": "4.x"
|
|
46
47
|
},
|
|
47
48
|
"devDependencies": {
|
|
48
|
-
"@openmrs/esm-config": "^
|
|
49
|
-
"@openmrs/esm-error-handling": "^
|
|
50
|
-
"@openmrs/esm-state": "^
|
|
49
|
+
"@openmrs/esm-config": "^5.0.0",
|
|
50
|
+
"@openmrs/esm-error-handling": "^5.0.0",
|
|
51
|
+
"@openmrs/esm-state": "^5.0.0",
|
|
51
52
|
"rxjs": "^6.5.3"
|
|
52
53
|
},
|
|
53
|
-
"gitHead": "
|
|
54
|
+
"gitHead": "2de5bf392a036e12c6d48425ff61881be7e32344"
|
|
54
55
|
}
|
package/src/openmrs-fetch.ts
CHANGED
|
@@ -21,6 +21,13 @@ export const sessionEndpoint = `${restBaseUrl}session`;
|
|
|
21
21
|
* ```
|
|
22
22
|
*/
|
|
23
23
|
export function makeUrl(path: string) {
|
|
24
|
+
if (path && path.startsWith("http")) {
|
|
25
|
+
return path;
|
|
26
|
+
} else if (path[0] !== "/") {
|
|
27
|
+
// ensure path starts with /
|
|
28
|
+
path = "/" + path;
|
|
29
|
+
}
|
|
30
|
+
|
|
24
31
|
return window.openmrsBase + path;
|
|
25
32
|
}
|
|
26
33
|
|
|
@@ -96,11 +103,6 @@ export function openmrsFetch<T = any>(
|
|
|
96
103
|
);
|
|
97
104
|
}
|
|
98
105
|
|
|
99
|
-
// ensure path starts with /
|
|
100
|
-
if (path[0] !== "/") {
|
|
101
|
-
path = "/" + path;
|
|
102
|
-
}
|
|
103
|
-
|
|
104
106
|
// Prefix the url with the openmrs spa base
|
|
105
107
|
let url: string = makeUrl(path);
|
|
106
108
|
|
package/webpack.config.js
CHANGED
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
const ForkTsCheckerWebpackPlugin = require("fork-ts-checker-webpack-plugin");
|
|
2
|
-
const SystemJSPublicPathWebpackPlugin = require("systemjs-webpack-interop/SystemJSPublicPathWebpackPlugin");
|
|
3
2
|
const { resolve } = require("path");
|
|
4
3
|
const { CleanWebpackPlugin } = require("clean-webpack-plugin");
|
|
5
4
|
const { BundleAnalyzerPlugin } = require("webpack-bundle-analyzer");
|
|
@@ -11,7 +10,7 @@ module.exports = (env) => ({
|
|
|
11
10
|
output: {
|
|
12
11
|
filename: "openmrs-esm-api.js",
|
|
13
12
|
path: resolve(__dirname, "dist"),
|
|
14
|
-
|
|
13
|
+
library: { type: "var", name: "_openmrs_esm_api" },
|
|
15
14
|
},
|
|
16
15
|
devtool: "source-map",
|
|
17
16
|
module: {
|
|
@@ -19,7 +18,7 @@ module.exports = (env) => ({
|
|
|
19
18
|
{
|
|
20
19
|
test: /\.m?(js|ts|tsx)$/,
|
|
21
20
|
exclude: /(node_modules|bower_components)/,
|
|
22
|
-
use: "swc-loader",
|
|
21
|
+
use: "@swc-node/loader",
|
|
23
22
|
},
|
|
24
23
|
],
|
|
25
24
|
},
|
|
@@ -27,14 +26,12 @@ module.exports = (env) => ({
|
|
|
27
26
|
extensions: [".ts", ".js", ".tsx", ".jsx"],
|
|
28
27
|
},
|
|
29
28
|
plugins: [
|
|
30
|
-
new SystemJSPublicPathWebpackPlugin(),
|
|
31
29
|
new CleanWebpackPlugin(),
|
|
32
30
|
new ForkTsCheckerWebpackPlugin(),
|
|
33
31
|
new BundleAnalyzerPlugin({
|
|
34
32
|
analyzerMode: env && env.analyze ? "static" : "disabled",
|
|
35
33
|
}),
|
|
36
34
|
],
|
|
37
|
-
externals: Object.keys(peerDependencies || {}),
|
|
38
35
|
devServer: {
|
|
39
36
|
disableHostCheck: true,
|
|
40
37
|
headers: {
|