react4xp-mono v1.0.0
react4xp-npm
React4xp monorepo for all the NPM dependency packages required by both lib-react4xp and parent projects running react4xp (for example the react4xp starter and anything derived from it).
These packages (with this project's package names in italics) are:
- react4xp-buildconstants (constants)
- react4xp-build-components (buildcomponents)
- react4xp-regions (regions)
- react4xp-runtime-client (client)
- react4xp-runtime-externals (externals)
- react4xp-runtime-nashornpolyfills (nashornpolyfills)
These packages don't need separate installation, they are bundled as dependencies of the main react4xp package (react4xp).
Usage
Not intended for standalone installation or use. See the docs of each unique package, in the links above.
Development
You'll need Gradle 5+ (a 6.2.1 gradle wrapper is included), Java JDK 11, Enonic XP 7+, and Node.
Internal package dependencies
All the sub-packages mentioned above are dependencies of this main react4xp package. In addition, react4xp-regions and react4xp-buildconstants are dependencies of react4xp-build-components, and react4xp-buildconstants is a dependency of react4xp-runtime-nashornpolyfills:
Important: git
When committing to git, please follow the conventional commits pattern in your messages, at least use feat:
and BREAKING CHANGE
. Also leave tags and all versioning to lerna with the version NPM script (see below) - which depends on using git this way.
Terminal commands
From the project root, handles the entire file structure: triggers the same tasks in subprojects under /packages/, where needed.
npm run setup
: initial install, run this first.gradlew build
: main build commandgradlew test
: main test commandgradlew npmInstall
: install NPM dependencies. Note: in linked mode (seenpmLink
below), NPM links will be preserved (by this command and the build commands).gradlew cleanNpm
: delete node_modules/ folders in all packages. Cancels the linked mode (seenpmLink
below).gradlew cleanBuilt
: delete build/ folders in all packagesgradlew npmLink
: enter development linked mode: same as running npm link in each package, but also linking up the internal dependencies between the packages. Use the cleanNpm gradle task (above) to exit linked mode. A corresponding script,getlinks.sh
, can be run by relative path from a parent project's root folder (e.g.sh ../../react4xp-npm/getlinks.sh
) to hook up the same links below that project's node_modules/. Sorry, no windows script yet (but it should be easy to reverse-engineer).gradlew versionAndPublish [ -Pdry ] [ -Pmessage='...' ]
: Auto-versions all changed packages, and publishes to NPM, after updating internal cross-dependency references. After committing your changes, run this to let lerna handle independent versioning in the packages, by tracking changes across them (use conventional-commit flags from your commit messages to track major:minor:patch versions), tagging the commit and auto-updating version tags everywhere. IMPORTANT: before runningversion
, you should have run thetest
task. And afterversionAndPublish
, verify that the react4xp- references in all packages//package-lock.json files are up-to-date (i.e. don't still refer to the previous versions for their dependencies). Further description in comments in versionAndPublish.gradle. Optional parameters:-Pdry
: dry-run-Pmessage='...'
: Common description of the entire release for all changed packages, will be used in commit messages to clarify and group the multiple commits that will occur during the process.