Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

(feat) Remove special handling for "core" apps and adjust docs to match #573

Merged
merged 1 commit into from
Nov 23, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 4 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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/<app folder>
```

This will allow you to develop the app similar to the experience of developing other apps.

#### The tooling

```sh
Expand Down
3 changes: 0 additions & 3 deletions packages/shell/esm-app-shell/src/index.ejs
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,6 @@
>
<meta name="viewport" content="width=device-width, initial-scale=1">
<meta name="importmap-type" content="systemjs-importmap">
<% if (openmrsCoreImportmap) { %>
<script type="systemjs-importmap"><%= openmrsCoreImportmap %></script>
<% } %>
<%= htmlWebpackPlugin.tags.headTags %>
<% if (openmrsImportmapDef) { %>
<script type="systemjs-importmap"><%= openmrsImportmapDef %></script>
Expand Down
27 changes: 0 additions & 27 deletions packages/shell/esm-app-shell/webpack.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -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`;
Expand Down Expand Up @@ -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"),
Expand Down Expand Up @@ -222,8 +197,6 @@ module.exports = (env, argv = {}) => {
openmrsOffline,
openmrsEnvironment,
openmrsConfigUrls,
openmrsCoreImportmap:
appPatterns.length > 0 && JSON.stringify(coreImportmap),
},
}),
new CopyWebpackPlugin({
Expand Down