Copyright (C) 2015-2020 The Open Library Foundation
This software is distributed under the terms of the Apache License, Version 2.0. See the file "LICENSE" for more information.
This is the ERM Stripes "platform". It consists simply of an
NPM package.json that
specifies the version of @folio/stripes-core and of any Stripes
modules you wish to make available as part of the ERM platform
to generate client bundles along with a utility for generating
module descriptors for each Stripes module.
Please see the quick start guide for more information.
The stripes.config.js is a configuration for a specific tenant. In
general, a platform supports multiple tenants, each of which may
include a different set of the available modules. You can copy the
stripes.config.js file to be your stripes.config.js.local
configuration file.
After cloning and cding into the directory, install platform dependencies.
$ yarn config set @folio:registry https://repository.folio.org/repository/npm-folioci/
$ yarn
Note that if you want to run a quarterly release version of
platform-erm, then you should stay onmasterand also use thehttps://repository.folio.org/repository/npm-folio/repository rather than thenpm-foliocirepository in the aboveyarn configcommand.
To build and serve platform-erm in isolation for development purposes, run the "start" package script.
$ yarn start
The default configuration assumes an Okapi instance is running on http://localhost:9130 with tenant "diku". The options --okapi and --tenant can be provided to match your environment.
$ yarn start --okapi http://localhost:9130 --tenant diku
To build a platform-erm bundle for production, modify stripes.config.js with your Okapi and tenant, then run the "build" script, passing it the name of the desired directory to place build artifacts.
$ yarn build ./output
See the build and serve command reference in stripes-cli for a list of available options.
To contribute to the modules (ui-agreements, ui-licenses, etc) that compose this platform, we recommend using the stripes-cli Yarn Workspace functionality.
- After installing
stripes-cli, create a workspace usingstripes workspaceand selecting which modules you wish to wish to clone locally, enabling you to make local modifications and contribute to them.- Note: Ensure you have selected
platform-ermso that you can run the entire platform.
- Note: Ensure you have selected
cdinto the created workspace (titledstripesby default) and runyarnto install the dependencies.- Note: Run
stripes platform pulltogit pullchanges to the cloned repos. - Note: Rerun
yarnwhenever you want to fetch new versions of NPM modules that have not been cloned locally.
- Note: Run
cdintoplatform-erm, and runyarn startto start serving.- Note: If you do not have permissions to push branches to the repos directly, you can create a fork of that repo on Github, delete the copy that was cloned when running
stripes workspace, and replace it with a manual clone of your forked repo. Then you'll be able to push changes to that fork and make pull requests from that fork into the official folio-org repo.
Integration tests require a running Okapi. The default configuration expects Okapi running on http://localhost:9130 with tenant "diku". To build and run integration tests for platform-erm with these defaults, run the test-int script.
$ yarn test-int
To view tests while they are run, provide the --show option.
$ yarn test-int --show
To skip the build step and run integration tests against a build that is already running, provide the URL.
$ yarn test-int --url https://folio-testing.dev.folio.org/
As a convenience, --local can be used in place of --url http://localhost:3000 for running tests against a development server that has already been started.
$ yarn test-int --local
Integration tests for the entire platform and its apps can be run with the "test-regression" script. This will invoke both cross-module tests defined in this platform's repository as well as all integration tests defined for the individual apps.
$ yarn test-regression --url https://folio-testing.dev.folio.org/
The test-int package script, when combined with the --run option, can be used for running specific tests for the platform and/or apps. Use WD (working directory) when referencing platform tests, otherwise use the module app module name.
Example running "loan_renewal" test in platform-erm:
$ yarn test-int --run WD:loan_renewal
Example running "new_user" test in ui-users:
$ yarn test-regression --run users:new_user
Building this in a workspace the commands are simple
yarn config get @folio:registry will return which registry is currently configured.
From there you can yarn config set @folio:registry https://repository.folio.org/repository/npm-folio/ for example, to swap to release-only artifacts.
If there is a workspace OR platform level yarnrc or npmrc file the build will take that as the authoritative registry definition, so those may need changing at this point also.
Then run yarn cache clean to ensure that your build is doing a brand new pull of the artifacts necessary.
Finally, running yarn clean-install from the platform should rebuild using the expected registry.
A developer can confirm this by running yarn why @folio/stripes. This should return a short semantic version number on the npm registry (eg 9.2.3) and a much longer one on the ci registry (eg 9.3.10990000000014)
See project FOLIO at the FOLIO issue tracker.
Other FOLIO Developer documentation is at dev.folio.org