CLI
Supercharge your spartan experience with our CLI.
Ultimately our goal is to provide a standalone CLI that allows you to simply add spartan primitives to any Angular project.
However, our initial focus is to provide a tight integration with the spartan/stack
, which runs on Nx. Therefore, the initial version of our CLI is a Nx plugin.
@spartan-ng/nx
To add spartan
to your Nx workspace simply install the plugin with the command below:
npm i -D @spartan-ng/nx
ui
To add spartan/ui
primitives to your workspace run the following command:
npx nx g @spartan-ng/nx:ui
You can then select which primitives you want to add. For each primitive we create a buildable library at a path of your choice.
Known issue: Dependencies are added to package.json, but their peer dependencies are not automatically installed
It seems like the Nx generator does not install the peer dependencies for new dependencies added to the package.json of the project when running the "install dependencies" task inside its execution context. Workaround: Manually run npm i after the plugin adds the primtives.
ui-theme
Adding a theme can also be done on itself. Use the command below:
npm nx @spartan-ng/nx:ui-theme
You can then select which application you want to add the theme to. Where your styles entrypoint is located. Which theme to add & what border radius to use.