0.2.15 • Published 4 years ago
@focuson/orgcmd v0.2.15
What is this project?
This project is a number of projects bundled together in a mono repo
- @focuson/lens: Easy - perhaps even beautiful - code for editing deep immutable objects
- @focuson/state: State management for projects (including React) using the lens in the above project
The code on demand is still work in progress.
Getting started
These show how to use the lenses for state management in React.
Working with the project
You can optionally use the laoban tool to help manage the monorepo. There are currently 16 projects in the repo and it is difficult to manage them without some automation. Laoban provides that automation
Compiling
This project uses yarn workspaces. Normally the sequence of commands to build / run everything is
# from the root directory
yarn # this gets all the dependencies
laoban tsc # this executes tsc in all the projects
laoban test # This executes the tests in all the projects that have tests in them
laoban status # This shows the status of tsc and the tests
laoban start # This executes 'yarn start' in all the react projects
Editing in an IDE
Unfortunately IDEs don't seem to work well with mono repos. When using an IDE such as IntelliJ it can be helpful to run the scripts in the scripts
directory
- ideify.sh - This changes imports such as @focuson/lens to relative addresses, which allows the ide access to the code
- prepare.sh - This changes the imports back again. You should do this before running anything (such as tests/the actual code in react)
This is quite painful:
- To run the tests from the command line you must run
scripts/prepare.sh
first - To run the examples in react you must run
scripts/prepare.sh
first - to edit the files in the IDE with codeinsight., compiling and linking working you must run
scripts/ideify.sh
first
Publishing
Setting up to publish
# From the root directory...
scripts/stage.sh
# Please check the status is suitable for publishing
And the publish itself
# From the root directory...
laoban publish && laoban status
#Check the status of the publish