From 83d2f7fccf5665188dc4dc83715001e56587c802 Mon Sep 17 00:00:00 2001 From: Ian Date: Tue, 22 Nov 2022 12:07:00 -0500 Subject: [PATCH] (feat) Remove special handling for "core" apps and adjust docs to match --- README.md | 10 +++---- packages/shell/esm-app-shell/src/index.ejs | 3 --- .../shell/esm-app-shell/webpack.config.js | 27 ------------------- 3 files changed, 4 insertions(+), 36 deletions(-) diff --git a/README.md b/README.md index be15d88ae..c0a6d0c1a 100644 --- a/README.md +++ b/README.md @@ -87,18 +87,16 @@ yarn verify yarn run:shell ``` -This will use the built versions of the apps in `apps/`. Those are built -by `yarn setup` or `yarn build:apps`, or by running `yarn build` in the -directory for any app. +`run:shell` will run the latest version of the shell and the framework only. #### The frontend modules in `apps` ```sh -cd packages/apps/esm-[xyz]-app -yarn serve -# Use with [Import Map Overrides](https://openmrs.github.io/openmrs-esm-core/#/getting_started/setup?id=import-map-overrides) +yarn run:omrs develop --sources packages/apps/ ``` +This will allow you to develop the app similar to the experience of developing other apps. + #### The tooling ```sh diff --git a/packages/shell/esm-app-shell/src/index.ejs b/packages/shell/esm-app-shell/src/index.ejs index 83523566c..7f7d09618 100644 --- a/packages/shell/esm-app-shell/src/index.ejs +++ b/packages/shell/esm-app-shell/src/index.ejs @@ -11,9 +11,6 @@ > -<% if (openmrsCoreImportmap) { %> - -<% } %> <%= htmlWebpackPlugin.tags.headTags %> <% if (openmrsImportmapDef) { %> diff --git a/packages/shell/esm-app-shell/webpack.config.js b/packages/shell/esm-app-shell/webpack.config.js index 08bcbc8da..436d20c3f 100644 --- a/packages/shell/esm-app-shell/webpack.config.js +++ b/packages/shell/esm-app-shell/webpack.config.js @@ -32,8 +32,6 @@ const openmrsPageTitle = process.env.OMRS_PAGE_TITLE || "OpenMRS"; const openmrsFavicon = process.env.OMRS_FAVICON || "favicon.ico"; const openmrsOffline = process.env.OMRS_OFFLINE !== "disable"; const openmrsImportmapDef = process.env.OMRS_ESM_IMPORTMAP; -const openmrsCoreApps = - process.env.OMRS_ESM_CORE_APPS_DIR || resolve(__dirname, "../../apps"); const openmrsEnvironment = process.env.OMRS_ENV || process.env.NODE_ENV || ""; const openmrsImportmapUrl = process.env.OMRS_ESM_IMPORTMAP_URL || `${openmrsPublicPath}/importmap.json`; @@ -69,29 +67,6 @@ module.exports = (env, argv = {}) => { const outDir = mode === production ? "dist" : "lib"; const isProd = mode === "production"; const appPatterns = []; - const coreImportmap = { - imports: {}, - }; - - if (checkDirectoryExists(openmrsCoreApps)) { - readdirSync(openmrsCoreApps).forEach((dir) => { - const appDir = resolve(openmrsCoreApps, dir); - const { name, browser } = require(resolve(appDir, "package.json")); - const distDir = resolve(appDir, dirname(browser)); - if (allowedSuffixes.some((suffix) => name.endsWith(suffix))) { - if (checkDirectoryHasContents(distDir)) { - appPatterns.push({ - from: distDir, - to: dir, - }); - coreImportmap.imports[name] = `./${dir}/${basename(browser)}`; - console.info(`Serving built artifact for ${name} from ${distDir}`); - } else { - console.warn(`Not serving ${name} because couldn't find ${distDir}`); - } - } - }); - } return { entry: resolve(__dirname, "src/index.ts"), @@ -222,8 +197,6 @@ module.exports = (env, argv = {}) => { openmrsOffline, openmrsEnvironment, openmrsConfigUrls, - openmrsCoreImportmap: - appPatterns.length > 0 && JSON.stringify(coreImportmap), }, }), new CopyWebpackPlugin({