openmrs 4.0.0-pre.0 → 4.0.1-pre.206

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.
@@ -1,2 +1,2 @@
1
- openmrs:build: cache hit, replaying output 993b6d9a8dbe6dab
1
+ openmrs:build: cache hit, replaying output 7ce886572b36e4ff
2
2
  openmrs:build: $ tsc
package/dist/cli.js CHANGED
@@ -83,7 +83,7 @@ yargs.command("debug", "Starts a new debugging session of the OpenMRS app shell.
83
83
  .string("importmap")
84
84
  .default("importmap", "importmap.json")
85
85
  .describe("importmap", "The import map to use. Can be a path to a valid import map to be taken literally, an URL, or a fixed JSON object."), (args) => __awaiter(void 0, void 0, void 0, function* () {
86
- return runCommand("runDebug", Object.assign(Object.assign({ apiUrl: args["api-url"], spaPath: args["spa-path"], configUrls: args["config-url"], pageTitle: args["page-title"], supportOffline: args["support-offline"], addCookie: args["add-cookie"] }, args), { importmap: (0, utils_1.proxyImportmap)(yield (0, utils_1.mergeImportmap)(yield (0, utils_1.getImportmap)(args.importmap, args.port), (args["run-project"] || args.runProject) &&
86
+ return runCommand("runDebug", Object.assign(Object.assign({ configUrls: args["config-url"] }, args), { importmap: (0, utils_1.proxyImportmap)(yield (0, utils_1.mergeImportmap)(yield (0, utils_1.getImportmap)(args.importmap, args.port), (args["run-project"] || args.runProject) &&
87
87
  (yield (0, utils_1.runProject)(args.port, args["shared-dependencies"], args.sources))), args.backend, args.host, args.port) }));
88
88
  }));
89
89
  yargs.command("develop", "Starts a new frontend module development session with the OpenMRS app shell.", (argv) => argv
@@ -120,7 +120,7 @@ yargs.command("develop", "Starts a new frontend module development session with
120
120
  .string("importmap")
121
121
  .default("importmap", "importmap.json")
122
122
  .describe("importmap", "The import map to use. Can be a path to a valid import map to be taken literally, an URL, or a fixed JSON object."), (args) => __awaiter(void 0, void 0, void 0, function* () {
123
- return runCommand("runDevelop", Object.assign(Object.assign({ apiUrl: args["api-url"], spaPath: args["spa-path"], configUrls: args["config-url"], addCookie: args["add-cookie"] }, args), { importmap: (0, utils_1.proxyImportmap)(yield (0, utils_1.mergeImportmap)(yield (0, utils_1.getImportmap)(args.importmap, args.port), args.sources[0] !== false &&
123
+ return runCommand("runDevelop", Object.assign(Object.assign({ configUrls: args["config-url"] }, args), { importmap: (0, utils_1.proxyImportmap)(yield (0, utils_1.mergeImportmap)(yield (0, utils_1.getImportmap)(args.importmap, args.port), args.sources[0] !== false &&
124
124
  (yield (0, utils_1.runProject)(args.port, args["shared-dependencies"], args.sources))), args.backend, args.host, args.port) }));
125
125
  }));
126
126
  yargs.command("build", "Builds a new app shell.", (argv) => argv
@@ -158,7 +158,7 @@ yargs.command("build", "Builds a new app shell.", (argv) => argv
158
158
  .boolean("download-coreapps")
159
159
  .default("download-coreapps", false)
160
160
  .describe("download-coreapps", "Downloads and bundles the core apps. For cases where the core apps are not in the import map."), (args) => __awaiter(void 0, void 0, void 0, function* () {
161
- return runCommand("runBuild", Object.assign(Object.assign({ apiUrl: args["api-url"], spaPath: args["spa-path"], configUrls: args["config-url"], configPaths: args["config-path"].map((p) => (0, path_1.resolve)(process.cwd(), p)), pageTitle: args["page-title"], supportOffline: args["support-offline"], downloadCoreapps: args["download-coreapps"] }, args), { importmap: args.importmap, buildConfig: args["build-config"] && (0, path_1.resolve)(process.cwd(), args["build-config"]), target: (0, path_1.resolve)(process.cwd(), args.target) }));
161
+ return runCommand("runBuild", Object.assign(Object.assign({ configUrls: args["config-url"], configPaths: args["config-path"].map((p) => (0, path_1.resolve)(process.cwd(), p)) }, args), { importmap: args.importmap, buildConfig: args["build-config"] && (0, path_1.resolve)(process.cwd(), args["build-config"]), target: (0, path_1.resolve)(process.cwd(), args.target) }));
162
162
  }));
163
163
  yargs.command("assemble", "Assembles an import map incl. all required resources.", (argv) => argv
164
164
  .string("target")
@@ -191,7 +191,7 @@ yargs.command(["start", "$0"], "Starts the app shell using the provided configur
191
191
  .describe("add-cookie", "Additional cookies to provide when proxying.")
192
192
  .boolean("open")
193
193
  .default("open", false)
194
- .describe("open", "Immediately opens the SPA page URL in the browser."), (args) => runCommand("runStart", Object.assign({ addCookie: args["add-cookie"] }, args)));
194
+ .describe("open", "Immediately opens the SPA page URL in the browser."), (args) => runCommand("runStart", Object.assign({}, args)));
195
195
  yargs
196
196
  .epilog("The SPA build config JSON is a JSON file, typically `frontend.json`, which defines parameters for the `build` and `assemble` " +
197
197
  "commands. The keys used by `build` are:\n" +
@@ -118,6 +118,7 @@ function extractFiles(sourceFile, targetDir) {
118
118
  const sourceDir = (0, path_1.dirname)(entryModule);
119
119
  Object.keys(files)
120
120
  .filter((m) => m.startsWith(`${packageRoot}/${sourceDir}`))
121
+ .filter((m) => !m.endsWith(".map"))
121
122
  .forEach((m) => {
122
123
  const content = files[m];
123
124
  const fileName = m.replace(`${packageRoot}/${sourceDir}/`, "");
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "openmrs",
3
- "version": "4.0.0-pre.0",
3
+ "version": "4.0.1-pre.206",
4
4
  "license": "MPL-2.0",
5
5
  "main": "dist/index.js",
6
6
  "bin": {
@@ -15,7 +15,7 @@
15
15
  "test": "jest --passWithNoTests",
16
16
  "build": "tsc",
17
17
  "lint": "eslint src --ext ts,tsx",
18
- "postversion": "yarn add @openmrs/esm-app-shell@$npm_package_version @openmrs/esm-webpack-config@$npm_package_version --exact"
18
+ "version": "yarn add @openmrs/esm-app-shell@$npm_package_version @openmrs/webpack-config@$npm_package_version --exact"
19
19
  },
20
20
  "repository": {
21
21
  "type": "git",
@@ -33,8 +33,8 @@
33
33
  "homepage": "https://github.com/openmrs/openmrs-esm-core#readme",
34
34
  "dependencies": {
35
35
  "@babel/preset-typescript": "^7.16.7",
36
- "@openmrs/esm-app-shell": "^4.0.0-pre.0",
37
- "@openmrs/webpack-config": "^4.0.0-pre.0",
36
+ "@openmrs/esm-app-shell": "4.0.1-pre.206",
37
+ "@openmrs/webpack-config": "4.0.1-pre.206",
38
38
  "autoprefixer": "^10.4.2",
39
39
  "axios": "^0.21.1",
40
40
  "browserslist-config-openmrs": "^1.0.1",
@@ -68,5 +68,5 @@
68
68
  "@types/systemjs": "^6.1.0",
69
69
  "@types/tar": "^4.0.3"
70
70
  },
71
- "gitHead": "254a7226212aac82df4434639b2584e24ac240e4"
71
+ "gitHead": "7ac6e01b41238739cdf5d20efdff50062f46f500"
72
72
  }
package/src/cli.ts CHANGED
@@ -103,12 +103,7 @@ yargs.command(
103
103
  ),
104
104
  async (args) =>
105
105
  runCommand("runDebug", {
106
- apiUrl: args["api-url"],
107
- spaPath: args["spa-path"],
108
106
  configUrls: args["config-url"],
109
- pageTitle: args["page-title"],
110
- supportOffline: args["support-offline"],
111
- addCookie: args["add-cookie"],
112
107
  ...args,
113
108
  importmap: proxyImportmap(
114
109
  await mergeImportmap(
@@ -182,10 +177,7 @@ yargs.command(
182
177
  ),
183
178
  async (args) =>
184
179
  runCommand("runDevelop", {
185
- apiUrl: args["api-url"],
186
- spaPath: args["spa-path"],
187
180
  configUrls: args["config-url"],
188
- addCookie: args["add-cookie"],
189
181
  ...args,
190
182
  importmap: proxyImportmap(
191
183
  await mergeImportmap(
@@ -272,13 +264,8 @@ yargs.command(
272
264
  ),
273
265
  async (args) =>
274
266
  runCommand("runBuild", {
275
- apiUrl: args["api-url"],
276
- spaPath: args["spa-path"],
277
267
  configUrls: args["config-url"],
278
268
  configPaths: args["config-path"].map((p) => resolve(process.cwd(), p)),
279
- pageTitle: args["page-title"],
280
- supportOffline: args["support-offline"],
281
- downloadCoreapps: args["download-coreapps"],
282
269
  ...args,
283
270
  importmap: args.importmap,
284
271
  buildConfig:
@@ -347,7 +334,6 @@ yargs.command(
347
334
  .describe("open", "Immediately opens the SPA page URL in the browser."),
348
335
  (args) =>
349
336
  runCommand("runStart", {
350
- addCookie: args["add-cookie"],
351
337
  ...args,
352
338
  })
353
339
  );
@@ -159,6 +159,7 @@ async function extractFiles(sourceFile: string, targetDir: string) {
159
159
 
160
160
  Object.keys(files)
161
161
  .filter((m) => m.startsWith(`${packageRoot}/${sourceDir}`))
162
+ .filter((m) => !m.endsWith(".map"))
162
163
  .forEach((m) => {
163
164
  const content = files[m];
164
165
  const fileName = m.replace(`${packageRoot}/${sourceDir}/`, "");
@@ -1,2 +0,0 @@
1
- openmrs:lint: cache hit, replaying output 6eb49c7482b0e512
2
- openmrs:lint: $ eslint src --ext ts,tsx
@@ -1,3 +0,0 @@
1
- openmrs:test: cache hit, replaying output 2f645df933f52e8f
2
- openmrs:test: $ jest --passWithNoTests
3
- openmrs:test: No tests found, exiting with code 0
@@ -1,24 +0,0 @@
1
- "use strict";
2
- var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
3
- function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
4
- return new (P || (P = Promise))(function (resolve, reject) {
5
- function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
6
- function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
7
- function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
8
- step((generator = generator.apply(thisArg, _arguments || [])).next());
9
- });
10
- };
11
- Object.defineProperty(exports, "__esModule", { value: true });
12
- exports.runServe = void 0;
13
- const path_1 = require("path");
14
- const webpackServer_1 = require("../utils/webpackServer");
15
- function runServe({ sourceDirectory, port }) {
16
- return __awaiter(this, void 0, void 0, function* () {
17
- console.log("run the traaap");
18
- const baseDir = process.env.INIT_CWD || process.cwd();
19
- const configPath = (0, path_1.resolve)(baseDir, sourceDirectory, "webpack.config.js");
20
- console.log("config at", configPath);
21
- (0, webpackServer_1.debug)(configPath, port);
22
- });
23
- }
24
- exports.runServe = runServe;
@@ -1,43 +0,0 @@
1
- "use strict";
2
- var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
3
- function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
4
- return new (P || (P = Promise))(function (resolve, reject) {
5
- function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
6
- function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
7
- function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
8
- step((generator = generator.apply(thisArg, _arguments || [])).next());
9
- });
10
- };
11
- Object.defineProperty(exports, "__esModule", { value: true });
12
- exports.debug = void 0;
13
- const path_1 = require("path");
14
- const logger_1 = require("./logger");
15
- function getWebpackEnv() {
16
- return Object.assign(Object.assign({}, process.env), { analyze: process.env.BUNDLE_ANALYZE === "true", production: process.env.NODE_ENV === "production", development: process.env.NODE_ENV === "development" });
17
- }
18
- function loadConfig(configPath) {
19
- const content = require(configPath);
20
- if (typeof content === "function") {
21
- return content(getWebpackEnv());
22
- }
23
- return content;
24
- }
25
- function debug(configPath, port) {
26
- const webpack = require("webpack");
27
- const WebpackDevServer = require("webpack-dev-server");
28
- const config = loadConfig(configPath);
29
- const options = Object.assign(Object.assign({}, config.devServer), { host: "localhost", port, static: (0, path_1.dirname)(configPath) });
30
- console.log("debugger.ts: starting dev server with options", options);
31
- console.log(" and config", config);
32
- const server = new WebpackDevServer(webpack(config), options);
33
- (() => __awaiter(this, void 0, void 0, function* () {
34
- try {
35
- yield server.start();
36
- }
37
- catch (err) {
38
- (0, logger_1.logWarn)(`Error: ${err}`);
39
- }
40
- (0, logger_1.logInfo)(`Listening at http://localhost:${port}`);
41
- }))();
42
- }
43
- exports.debug = debug;