We provide an application called playground
inside the TALY workspace where you can test your changes locally by running
npx nx develop playground
This command will trigger the generate-and-serve
executor implemented inside the taly-nx
library directly. It will then generate the playground application based on the configuration files in the apps/playground/config
folder. You can modify them to suit your use cases. Any changes in TALY libraries and configuration files will trigger a reload automatically.
💡 Keep in mind that since the playground application does not consume
taly-nx
ortaly-sdk
library at runtime, you must restart thenpx nx develop playground
command after making any changes totaly-nx
and/ortaly-sdk
.
In certain situations, testing your implementation inside the TALY workspace alone might not be enough. You can consider using the recipes
workspace where there are multiple setups for different TALY features (e.g. web component integration, module integration, plugins). The best way to proceed is installing a package built locally.
First, let's build the library you want to test by running:
npx nx build <library-name>
Then go to the workspace that you want to test and install the recently built package:
# for workspace that uses yarn
yarn add <path to the built library e.g. ../../../taly-workspace/dist/libs/nx>
# for workspace that uses npm
npm i <path to the built library e.g. ../../../taly-workspace/dist/libs/nx> --install-links
💡 Note that
--install-links
flag should be used when installing a local package using npm. It ensures that npm will install a source copy of your package instead of a symbolic link
Every time you apply a change to the TALY package, you need to build and install the package again.
There are two ways to enable Trackify debug mode:
?trackifydebug=true
query param to the URL of any application.trackifyDebug=true
.You can choose either of these methods and begin interacting with the form elements to observe the tracking events being fired in the console.
The TALY SDK can be tested locally by running:
# build the package
npx nx build sdk
# execute the TALY SDK command
node ./dist/libs/sdk/src/cli/index.js <command> <options>
If you want to test it against other workspaces, please follow the steps in Use a Local TALY Package in Other Workspaces and run npx taly <command> <options>
.
Follow these steps to run an Nx migration of a locally installed package manually.
Create a migrations.json
file in the root of the workspace. The content has to list the migrations that should run. For example:
{
"migrations": [
{
"package": "@allianz/taly-nx",
"name": "update-policy-format",
"version": "25.0.0",
"implementation": "./src/migrations/update-policy-format/update-policy-format",
"cli": "nx"
},
{
"package": "@allianz/taly-nx",
"name": "update-acl-defaults",
"version": "25.0.0",
"implementation": "./src/migrations/update-acl-defaults/update-acl-defaults",
"cli": "nx"
}
]
}
The version mentioned in the migrations.json
files do not have to match the version of the package.json
file.
Run it
NX_MIGRATE_SKIP_INSTALL=true npx nx migrate --run-migrations=migrations.json