Skip to content
This repository was archived by the owner on Mar 21, 2025. It is now read-only.

Commit 3408d45

Browse files
committed
refactor(button-bar): refactoring to better support multiple independent modules
- rename DevintentModule to ButtonBarModule - rename _theming.scss to _all-theme.scss - create a lib/core/ folder
1 parent a1f6789 commit 3408d45

16 files changed

+1058
-3029
lines changed

package-lock.json

+1,016-2,987
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

+20-20
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
"homepage": "https://devintent-dev.web.app",
77
"bugs": "https://github.com/DevIntent/dev/issues",
88
"engines": {
9-
"node": ">=10"
9+
"node": ">=12"
1010
},
1111
"scripts": {
1212
"ng": "ng",
@@ -30,18 +30,18 @@
3030
},
3131
"private": true,
3232
"dependencies": {
33-
"@angular/animations": "~9.1.4",
34-
"@angular/cdk": "~9.2.2",
35-
"@angular/common": "~9.1.4",
36-
"@angular/compiler": "~9.1.4",
37-
"@angular/core": "~9.1.4",
33+
"@angular/animations": "~9.1.9",
34+
"@angular/cdk": "~9.2.4",
35+
"@angular/common": "~9.1.9",
36+
"@angular/compiler": "~9.1.9",
37+
"@angular/core": "~9.1.9",
3838
"@angular/fire": "^6.0.0",
3939
"@angular/flex-layout": "^9.0.0-beta.29",
40-
"@angular/forms": "~9.1.4",
41-
"@angular/material": "~9.2.2",
42-
"@angular/platform-browser": "~9.1.4",
43-
"@angular/platform-browser-dynamic": "~9.1.4",
44-
"@angular/router": "~9.1.4",
40+
"@angular/forms": "~9.1.9",
41+
"@angular/material": "~9.2.4",
42+
"@angular/platform-browser": "~9.1.9",
43+
"@angular/platform-browser-dynamic": "~9.1.9",
44+
"@angular/router": "~9.1.9",
4545
"@schuchard/prettier": "^3.1.0",
4646
"firebase": "^7.14.2",
4747
"logrocket": "^1.0.7",
@@ -50,14 +50,14 @@
5050
"zone.js": "~0.10.2"
5151
},
5252
"devDependencies": {
53-
"@angular-devkit/architect": "~0.901.4",
54-
"@angular-devkit/build-angular": "~0.901.4",
55-
"@angular-devkit/build-ng-packagr": "~0.901.4",
56-
"@angular-devkit/core": "^9.1.4",
57-
"@angular-devkit/schematics": "^9.1.4",
58-
"@angular/cli": "~9.1.4",
59-
"@angular/compiler-cli": "~9.1.4",
60-
"@angular/language-service": "~9.1.4",
53+
"@angular-devkit/architect": "~0.901.7",
54+
"@angular-devkit/build-angular": "~0.901.7",
55+
"@angular-devkit/build-ng-packagr": "~0.901.7",
56+
"@angular-devkit/core": "^9.1.7",
57+
"@angular-devkit/schematics": "^9.1.7",
58+
"@angular/cli": "~9.1.7",
59+
"@angular/compiler-cli": "~9.1.9",
60+
"@angular/language-service": "~9.1.9",
6161
"@types/jasmine": "^3.5.10",
6262
"@types/jasminewd2": "^2.0.8",
6363
"@types/node": "^13.13.4",
@@ -75,7 +75,7 @@
7575
"karma-jasmine": "^3.1.1",
7676
"karma-jasmine-html-reporter": "^1.5.3",
7777
"lint-staged": "10.2.2",
78-
"ng-packagr": "^9.0.0",
78+
"ng-packagr": "^9.1.5",
7979
"npm-check": "~5.9.2",
8080
"prettier": "2.0.5",
8181
"protractor": "~5.4.4",

projects/dev/README.md

+6-6
Original file line numberDiff line numberDiff line change
@@ -50,10 +50,10 @@ Find icon names by searching the [Material Design Icons Tool](https://material.i
5050
#### Button Bar Module
5151

5252
```ts
53-
import {DevintentModule} from '@devintent/dev';
53+
import {ButtonBarModule} from '@devintent/dev';
5454
...
5555
imports: [
56-
DevintentModule
56+
ButtonBarModule
5757
],
5858
```
5959

@@ -94,12 +94,12 @@ $demo-typography: mat-typography-config(
9494
);
9595
```
9696

97-
Then your primary SCSS entrypoint should import this theme file and pass the theme into both the Angular Material
97+
Then your primary SCSS entry point should import this theme file and pass the theme into both the Angular Material
9898
and DevIntent Dev components.
9999

100100
```scss
101101
@import 'theme';
102-
@import '~@devintent/dev/theming';
102+
@import '~@devintent/dev/all-theme';
103103

104104
// Include the common styles for Angular Material. We include this here so that you only
105105
// have to load a single css file for Angular Material in your app.
@@ -114,5 +114,5 @@ and DevIntent Dev components.
114114
@include dev-theme($demo-theme);
115115
```
116116

117-
Note: Custom typography is not yet implemented for these components, but you can use it with Angular Material components.
118-
See more in their [Typography Guide](https://material.angular.io/guide/typography).
117+
**Note:** We have not yet implemented custom typography for these components, but you can use it with
118+
Angular Material components. See more in their [Typography Guide](https://material.angular.io/guide/typography).

projects/dev/ng-package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,6 @@
22
"$schema": "../../node_modules/ng-packagr/ng-package.schema.json",
33
"dest": "../../dist/dev",
44
"lib": {
5-
"entryFile": "src/public_api.ts"
5+
"entryFile": "src/lib/public-api.ts"
66
}
77
}

projects/dev/src/lib/button-bar/button-bar.component.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import { Component, OnInit, OnDestroy, Input } from '@angular/core';
22
import { MediaObserver } from '@angular/flex-layout';
3-
import { NavItem } from '../nav-item';
3+
import { NavItem } from '../core/nav-item';
44
import { Subscription } from 'rxjs';
55

66
@Component({

projects/dev/src/lib/devintent.module.ts renamed to projects/dev/src/lib/button-bar/button-bar.module.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ import { MatMenuModule } from '@angular/material/menu';
88
import { MatToolbarModule } from '@angular/material/toolbar';
99
import { MatTooltipModule } from '@angular/material/tooltip';
1010

11-
import { ButtonBarComponent } from './button-bar/button-bar.component';
11+
import { ButtonBarComponent } from './button-bar.component';
1212

1313
@NgModule({
1414
imports: [
@@ -33,4 +33,4 @@ import { ButtonBarComponent } from './button-bar/button-bar.component';
3333
FlexLayoutModule,
3434
],
3535
})
36-
export class DevintentModule {}
36+
export class ButtonBarModule {}
+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
export * from './public-api';
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
export * from './button-bar.module';
2+
export * from './button-bar.component';
3+
export * from '../core/nav-item';

projects/dev/src/lib/theming/_theming.scss renamed to projects/dev/src/lib/core/theming/_all-theme.scss

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
// Import library functions for theme creation.
2-
@import '../button-bar/button-bar-theme';
2+
@import '../../button-bar/button-bar-theme';
33

44
// Define a mixin that accepts a theme and outputs the theme-specific styles.
55
@mixin dev-theme($theme) {

projects/dev/src/lib/index.ts

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
export * from './public-api';

projects/dev/src/lib/public-api.ts

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
export * from './button-bar/index';

projects/dev/src/public_api.ts

-6
This file was deleted.

scss-bundle.config.json

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"bundlerOptions": {
3-
"entryFile": "./projects/dev/src/lib/theming/_theming.scss",
3+
"entryFile": "./projects/dev/src/lib/core/theming/_all-theme.scss",
44
"rootDir": "./",
5-
"outFile": "dist/dev/_theming.scss"
5+
"outFile": "dist/dev/_all-theme.scss"
66
}
77
}

src/app/app.module.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ import { ReactiveFormsModule } from '@angular/forms';
77
import { BrowserModule } from '@angular/platform-browser';
88
import { BrowserAnimationsModule } from '@angular/platform-browser/animations';
99
import { RouterModule, Routes } from '@angular/router';
10-
import { DevintentModule } from '@devintent/dev';
10+
import { ButtonBarModule } from '@devintent/dev';
1111
import { environment } from '../environments/environment';
1212

1313
import { AppComponent } from './app.component';
@@ -74,7 +74,7 @@ export const appRoutes: Routes = [
7474
BrowserAnimationsModule,
7575
FlexLayoutModule,
7676
ReactiveFormsModule,
77-
DevintentModule,
77+
ButtonBarModule,
7878
RouterModule.forRoot(appRoutes, { useHash: false }),
7979
AngularFireModule.initializeApp(environment.firebase),
8080
AngularFirePerformanceModule,

src/styles.scss

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
@import 'theme';
2-
@import '../dist/dev/theming';
2+
@import '../dist/dev/all-theme';
33

44
// Include the common styles for Angular Material. We include this here so that you only
55
// have to load a single css file for Angular Material in your app.

0 commit comments

Comments
 (0)