THIS REPOS IN ITS CURRENT STATE WAS THE RESULT OF THESE COMMANDS:
npx create-nx-workspace hylo --workspaceType integrated --preset ts --packageManager yarn --useGitHub --nxCloud skip
cd hylo
npx nx add @nx/node
npx nx add @nx/react
npx nx add @nx/react-native
git commit -a -m "Add base nx plugins"
Prepare individual legacy repos to be merged, and then merge into the monorepo using this sequence for each app (https://nx.dev/recipes/adopting-nx/preserving-git-histories):
cd <hylo-node|hylo-evo|HyloReactNative|hylo-shared>
git pull
git checkout -b monorepo-setup
# assuming this repo is checked out at ../hylo relative to the legacy repo root,
# where apps/web could be apps/<web|backend|mobile> or libs/shared
../hylo/move-mono.sh
git commit -m "Move files in preparation for monorepo migration (<backend|web|mobile|hylo-shared>)"
git push -u
# then merge each repo into the new monorepo generated above
cd ../hylo
git remote add <backend|web|mobile|shared> <repository url>
git fetch <backend|web|mobile|shared>
git merge <backend|web|mobile|shared>/monorepo-setup --allow-unrelated-histories
nx run-many -t dev
to start every app in dev mode at once... This should "just work" if we add dev
to scripts in each app's package.json
set to do the right thing.nx release prerelease --first-release --dry-run
gives us expected results... MOSTLY DOES now, however needs to configure this to what we really want.
package.json
is updated (like react-native-version
already does, likely can still use that)Remaining work:
nx-generated README follows# Hylo
✨ Your new, shiny Nx workspace is ready ✨.
Learn more about this workspace setup and its capabilities or run npx nx graph
to visually explore what was created. Now, let's get you up to speed!
To run tasks with Nx use:
npx nx <target> <project-name>
For example:
npx nx build myproject
These targets are either inferred automatically or defined in the project.json
or package.json
files.
More about running tasks in the docs »
To version and release the library use
npx nx release
Pass --dry-run
to see what would happen without actually releasing the library.
While you could add new projects to your workspace manually, you might want to leverage Nx plugins and their code generation feature.
To install a new plugin you can use the nx add
command. Here's an example of adding the React plugin:
npx nx add @nx/react
Use the plugin's generator to create new projects. For example, to create a new React app or library:
# Genenerate an app
npx nx g @nx/react:app demo
# Generate a library
npx nx g @nx/react:lib some-lib
You can use npx nx list
to get a list of installed plugins. Then, run npx nx list <plugin-name>
to learn about more specific capabilities of a particular plugin. Alternatively, install Nx Console to browse plugins and generators in your IDE.
Learn more about Nx plugins » | Browse the plugin registry »
To connect to Nx Cloud, run the following command:
npx nx connect
Connecting to Nx Cloud ensures a fast and scalable CI pipeline. It includes features such as:
Use the following command to configure a CI workflow for your workspace:
npx nx g ci-workflow
Nx Console is an editor extension that enriches your developer experience. It lets you run tasks, generate code, and improves code autocompletion in your IDE. It is available for VSCode and IntelliJ.
Learn more:
And join the Nx community: