Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: add schematics for angular and nx projects #1277

Merged
merged 7 commits into from
Jan 15, 2024
Merged
Show file tree
Hide file tree
Changes from 5 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .changeset/shiny-rockets-shake.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@baloise/design-system-schematics': minor
---

Add an Angular schematic to seamlessly integrate the design system into your existing project.
6 changes: 6 additions & 0 deletions .eslintignore
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ packages/icons/src/icons.ts

packages/components/loader/
packages/components/www/
packages/components/components/
packages/components/.storybook/vue/generated/
packages/components/src/assets/fonts
packages/components/src/components/**/readme.md
Expand All @@ -42,3 +43,8 @@ packages/components-angular/src/directives/
packages/components-angular/src/overlays
packages/components-vue/src/proxies.ts
packages/components-vue/.build/template/utils.ts

packages/components-angular/**/*.d.ts
packages/components-angular/esm2020
packages/components-angular/fesm2015
packages/components-angular/fesm2020
4 changes: 4 additions & 0 deletions .prettierignore
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,10 @@ packages/components-angular/src/directives/value-accessor.ts
packages/components-angular/src/directives/proxies.ts
packages/components-angular/src/directives/proxies-list.ts
packages/components-angular/src/directives/proxies.module.ts
packages/components-angular/esm2020
packages/components-angular/fesm2015
packages/components-angular/fesm2020
packages/components-angular/**/*.d.ts
packages/components/src/utils/constants/icons.constant.ts
packages/css/css
packages/components-vue/src/proxies.ts
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,9 +36,43 @@ If you do not have an Angular app yet create one with the [Angular CLI](https://
- Use **SCSS** as stylesheet format to be able to breakpoint mixins and more.
- For the translations use [\{TRANSLOCO\}](https://ngneat.github.io/transloco/).
- For a reactive store use [Elf](https://ngneat.github.io/elf/).
- Smart build system [Nx](https://nx.dev/getting-started/tutorials/angular-standalone-tutorial).

</InfoQuote>

## Installation

<InfoQuote>
If the projects requires translations, then install [\{TRANSLOCO\}](https://ngneat.github.io/transloco/) before the Baloise Design System.

<Code language="bash" noPreview code={`npm install @ngneat/transloco`} />

Configure project:

```bash
ng add @ngneat/transloco
# On an nx workspace
nx g @ngneat/transloco:ng-add
```

</InfoQuote>

Lets install the schematics to configure and add the design system to an Angular project.

<Code language="bash" noPreview code={`npm install @baloise/design-system-cli`} />

Install the library using Angular CLI:

```bash
ng add @baloise/design-system-cli:ng-add
# On an nx workspace
nx g @baloise/design-system-cli:ng-add
```

## Manual Installation

Continue here for the manual instalation guide without schematics.

### Zone.js

Configuring zone.js is essential for enhancing the performance of the web components.
Expand Down Expand Up @@ -93,13 +127,13 @@ Open the `angular.json` file and make the following adjustment to `architect.bui
}
```

## Installation
### Installation

Let's install the latest Angular components. This package includes the Font, Token, Icon, and CSS-Utilities packages.

<Code language="bash" noPreview code={`npm install @baloise/design-system-components-angular`} />

## Import Styles
### Import Styles

Component styles are automatically loaded lazily in the browser. However, CSS Utilities and other
fundamentals need to be imported into the global stylesheet of the application. These stylesheets can be
Expand Down Expand Up @@ -141,7 +175,7 @@ However, if the application requires all styles regardless of payload size, simp
@import '@baloise/design-system-css/css/typography';
```

## Standalone
### Standalone

Use the `provideBaloiseDesignSystem` provider within the `app.config.ts` file, where Angular providers are typically defined.

Expand Down Expand Up @@ -196,7 +230,7 @@ Add the `bal-app` to your `app.component.html` root element.
</bal-app>
```

## Module Based
### Module Based

Import the `BaloiseDesignSystemModule.forRoot()` into your angular root module.
To use the custom web components add the schema `CUSTOM_ELEMENTS_SCHEMA` to your root angular module.
Expand Down Expand Up @@ -249,7 +283,7 @@ Add the `bal-app` to your `app.component.html` root element.
`}
/>

### Shared Modules
#### Shared Modules

It is recommended to import the `BaloiseDesignSystemModule` in your `SharedModule` to provide access to the components and value accessors.

Expand Down
Loading