Skip to content

Commit 6105aa8

Browse files
committed
refactor: move demo app to projects folder and more
- remove docs folder - change library name to include ngx prefix - remove "style-only" directives from library
1 parent b869c32 commit 6105aa8

File tree

204 files changed

+12349
-26913
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

204 files changed

+12349
-26913
lines changed

.gitignore

+4-2
Original file line numberDiff line numberDiff line change
@@ -4,13 +4,15 @@
44
/dist
55
/tmp
66
/out-tsc
7+
# Only exists if Bazel was run
8+
/bazel-out
79

810
# dependencies
911
/node_modules
1012

1113
# profiling files
12-
chrome-profiler-events.json
13-
speed-measure-plugin.json
14+
chrome-profiler-events*.json
15+
speed-measure-plugin*.json
1416

1517
# IDEs and editors
1618
/.idea

LICENSE

-21
This file was deleted.

README.md

+14-67
Original file line numberDiff line numberDiff line change
@@ -1,80 +1,27 @@
1-
<a target="_blank" href="https://www.npmjs.com/package/ngx-drawer-layout">![](https://img.shields.io/npm/v/ngx-drawer-layout.svg)</a>
2-
![](https://img.shields.io/circleci/project/github/kevlatus/ngx-drawer-layout/master.svg)
1+
# NgxDrawerLayout
32

4-
# Angular Drawer Layout
3+
This project was generated with [Angular CLI](https://github.com/angular/angular-cli) version 8.3.14.
54

6-
This library provides [Angular](https://angular.io/) components for implementing a
7-
[Material Design Drawer](https://material.io/design/components/navigation-drawer.html).
8-
It relies on the [Angular Material Library](https://material.angular.io/).
5+
## Development server
96

10-
## Installing
7+
Run `ng serve` for a dev server. Navigate to `http://localhost:4200/`. The app will automatically reload if you change any of the source files.
118

12-
Before installing, make sure to add Angular Material to your project. When using Angular CLI, you can run:
13-
```
14-
ng add @angular/material
15-
```
16-
For alternative installation refer to the [quick start guide](https://material.angular.io/guide/getting-started).
9+
## Code scaffolding
1710

18-
Using npm, you can install the library with:
19-
```
20-
npm install --save ngx-drawer-layout
21-
```
11+
Run `ng generate component component-name` to generate a new component. You can also use `ng generate directive|pipe|service|class|guard|interface|enum|module`.
2212

23-
### Enabling Material theming
13+
## Build
2414

25-
If you want to benefit from Material theming, you need to use Angular Material
26-
with [a custom theme](https://material.angular.io/guide/theming#defining-a-custom-theme).
27-
Then, you can add theming to the drawer layout like this:
28-
29-
```scss
30-
@import '~@angular/material/theming';
31-
@import '~ngx-drawer-layout/theming'; // <-- include SASS lib file
15+
Run `ng build` to build the project. The build artifacts will be stored in the `dist/` directory. Use the `--prod` flag for a production build.
3216

33-
@include mat-core();
17+
## Running unit tests
3418

35-
$primary: mat-palette($mat-indigo);
36-
$accent: mat-palette($mat-pink, A200, A100, A400);
37-
$warn: mat-palette($mat-red);
38-
$theme: mat-light-theme($primary, $accent, $warn);
19+
Run `ng test` to execute the unit tests via [Karma](https://karma-runner.github.io).
3920

40-
@include angular-material-theme($theme);
41-
@include ngx-drawer-layout-theme($theme); // <-- include the drawer layout theme
42-
```
21+
## Running end-to-end tests
4322

44-
## Usage
23+
Run `ng e2e` to execute the end-to-end tests via [Protractor](http://www.protractortest.org/).
4524

46-
**1. Import the DrawerLayoutModule**
25+
## Further help
4726

48-
```javascript
49-
import {BrowserModule} from '@angular/platform-browser';
50-
import {NgModule} from '@angular/core';
51-
import {DrawerLayoutModule} from 'ngx-drawer-layout';
52-
53-
@NgModule({
54-
imports: [
55-
BrowserModule,
56-
DrawerLayoutModule.forRoot() // <-- import module
57-
],
58-
bootstrap: [AppComponent]
59-
})
60-
export class AppModule { }
61-
```
62-
63-
**2. Use the DrawerLayoutComponent**
64-
65-
```html
66-
<ngx-drawer-layout>
67-
<mat-toolbar ngxDrawerAppHeader>
68-
<ngx-drawer-toggle-button></ngx-drawer-toggle-button>
69-
<div>NGX Drawer Layout Demo</div>
70-
</mat-toolbar>
71-
72-
<div ngxDrawerContent>
73-
<div>Drawer Content</div>
74-
</div>
75-
76-
<div ngxDrawerAppContent>
77-
<div>App Content</div>
78-
</div>
79-
</ngx-drawer-layout>
80-
```
27+
To get more help on the Angular CLI use `ng help` or go check out the [Angular CLI README](https://github.com/angular/angular-cli/blob/master/README.md).

angular.json

+54-71
Original file line numberDiff line numberDiff line change
@@ -3,41 +3,41 @@
33
"version": 1,
44
"newProjectRoot": "projects",
55
"projects": {
6-
"drawer-layout-app": {
7-
"root": "",
8-
"sourceRoot": "src",
6+
"demo-app": {
97
"projectType": "application",
10-
"prefix": "app",
118
"schematics": {
129
"@schematics/angular:component": {
1310
"style": "scss"
1411
}
1512
},
13+
"root": "projects/demo-app",
14+
"sourceRoot": "projects/demo-app/src",
15+
"prefix": "app",
1616
"architect": {
1717
"build": {
1818
"builder": "@angular-devkit/build-angular:browser",
1919
"options": {
20-
"outputPath": "dist/drawer-layout-app",
21-
"index": "src/index.html",
22-
"main": "src/main.ts",
23-
"polyfills": "src/polyfills.ts",
24-
"tsConfig": "src/tsconfig.app.json",
20+
"outputPath": "dist/demo-app",
21+
"index": "projects/demo-app/src/index.html",
22+
"main": "projects/demo-app/src/main.ts",
23+
"polyfills": "projects/demo-app/src/polyfills.ts",
24+
"tsConfig": "projects/demo-app/tsconfig.app.json",
25+
"aot": true,
2526
"assets": [
26-
"src/favicon.ico",
27-
"src/assets"
27+
"projects/demo-app/src/favicon.ico",
28+
"projects/demo-app/src/assets"
2829
],
2930
"styles": [
30-
"src/styles.scss"
31+
"projects/demo-app/src/styles.scss"
3132
],
32-
"scripts": [],
33-
"es5BrowserSupport": true
33+
"scripts": []
3434
},
3535
"configurations": {
3636
"production": {
3737
"fileReplacements": [
3838
{
39-
"replace": "src/environments/environment.ts",
40-
"with": "src/environments/environment.prod.ts"
39+
"replace": "projects/demo-app/src/environments/environment.ts",
40+
"with": "projects/demo-app/src/environments/environment.prod.ts"
4141
}
4242
],
4343
"optimization": true,
@@ -54,6 +54,11 @@
5454
"type": "initial",
5555
"maximumWarning": "2mb",
5656
"maximumError": "5mb"
57+
},
58+
{
59+
"type": "anyComponentStyle",
60+
"maximumWarning": "6kb",
61+
"maximumError": "10kb"
5762
}
5863
]
5964
}
@@ -62,120 +67,98 @@
6267
"serve": {
6368
"builder": "@angular-devkit/build-angular:dev-server",
6469
"options": {
65-
"browserTarget": "drawer-layout-app:build"
70+
"browserTarget": "demo-app:build"
6671
},
6772
"configurations": {
6873
"production": {
69-
"browserTarget": "drawer-layout-app:build:production"
74+
"browserTarget": "demo-app:build:production"
7075
}
7176
}
7277
},
7378
"extract-i18n": {
7479
"builder": "@angular-devkit/build-angular:extract-i18n",
7580
"options": {
76-
"browserTarget": "drawer-layout-app:build"
81+
"browserTarget": "demo-app:build"
7782
}
7883
},
7984
"test": {
8085
"builder": "@angular-devkit/build-angular:karma",
8186
"options": {
82-
"main": "src/test.ts",
83-
"polyfills": "src/polyfills.ts",
84-
"tsConfig": "src/tsconfig.spec.json",
85-
"karmaConfig": "src/karma.conf.js",
87+
"main": "projects/demo-app/src/test.ts",
88+
"polyfills": "projects/demo-app/src/polyfills.ts",
89+
"tsConfig": "projects/demo-app/tsconfig.spec.json",
90+
"karmaConfig": "projects/demo-app/karma.conf.js",
91+
"assets": [
92+
"projects/demo-app/src/favicon.ico",
93+
"projects/demo-app/src/assets"
94+
],
8695
"styles": [
87-
"./node_modules/@angular/material/prebuilt-themes/indigo-pink.css",
88-
"src/styles.scss"
96+
"projects/demo-app/src/styles.scss"
8997
],
90-
"scripts": [],
91-
"assets": [
92-
"src/favicon.ico",
93-
"src/assets"
94-
]
98+
"scripts": []
9599
}
96100
},
97101
"lint": {
98102
"builder": "@angular-devkit/build-angular:tslint",
99103
"options": {
100104
"tsConfig": [
101-
"src/tsconfig.app.json",
102-
"src/tsconfig.spec.json"
105+
"projects/demo-app/tsconfig.app.json",
106+
"projects/demo-app/tsconfig.spec.json",
107+
"projects/demo-app/e2e/tsconfig.json"
103108
],
104109
"exclude": [
105110
"**/node_modules/**"
106111
]
107112
}
108-
}
109-
}
110-
},
111-
"drawer-layout-app-e2e": {
112-
"root": "e2e/",
113-
"projectType": "application",
114-
"prefix": "",
115-
"architect": {
113+
},
116114
"e2e": {
117115
"builder": "@angular-devkit/build-angular:protractor",
118116
"options": {
119-
"protractorConfig": "e2e/protractor.conf.js",
120-
"devServerTarget": "drawer-layout-app:serve"
117+
"protractorConfig": "projects/demo-app/e2e/protractor.conf.js",
118+
"devServerTarget": "demo-app:serve"
121119
},
122120
"configurations": {
123121
"production": {
124-
"devServerTarget": "drawer-layout-app:serve:production"
122+
"devServerTarget": "demo-app:serve:production"
125123
}
126124
}
127-
},
128-
"lint": {
129-
"builder": "@angular-devkit/build-angular:tslint",
130-
"options": {
131-
"tsConfig": "e2e/tsconfig.e2e.json",
132-
"exclude": [
133-
"**/node_modules/**"
134-
]
135-
}
136125
}
137126
}
138127
},
139-
"drawer-layout": {
140-
"root": "projects/drawer-layout",
141-
"sourceRoot": "projects/drawer-layout/src",
128+
"ngx-drawer-layout": {
142129
"projectType": "library",
130+
"root": "projects/ngx-drawer-layout",
131+
"sourceRoot": "projects/ngx-drawer-layout/src",
143132
"prefix": "ngx",
144-
"schematics": {
145-
"@schematics/angular:component": {
146-
"style": "scss"
147-
}
148-
},
149133
"architect": {
150134
"build": {
151135
"builder": "@angular-devkit/build-ng-packagr:build",
152136
"options": {
153-
"tsConfig": "projects/drawer-layout/tsconfig.lib.json",
154-
"project": "projects/drawer-layout/ng-package.json"
137+
"tsConfig": "projects/ngx-drawer-layout/tsconfig.lib.json",
138+
"project": "projects/ngx-drawer-layout/ng-package.json"
155139
}
156140
},
157141
"test": {
158142
"builder": "@angular-devkit/build-angular:karma",
159143
"options": {
160-
"main": "projects/drawer-layout/src/test.ts",
161-
"tsConfig": "projects/drawer-layout/tsconfig.spec.json",
162-
"karmaConfig": "projects/drawer-layout/karma.conf.js"
144+
"main": "projects/ngx-drawer-layout/src/test.ts",
145+
"tsConfig": "projects/ngx-drawer-layout/tsconfig.spec.json",
146+
"karmaConfig": "projects/ngx-drawer-layout/karma.conf.js"
163147
}
164148
},
165149
"lint": {
166150
"builder": "@angular-devkit/build-angular:tslint",
167151
"options": {
168152
"tsConfig": [
169-
"projects/drawer-layout/tsconfig.lib.json",
170-
"projects/drawer-layout/tsconfig.spec.json"
153+
"projects/ngx-drawer-layout/tsconfig.lib.json",
154+
"projects/ngx-drawer-layout/tsconfig.spec.json"
171155
],
172156
"exclude": [
173157
"**/node_modules/**"
174158
]
175159
}
176160
}
177161
}
178-
}
179-
},
180-
"defaultProject": "drawer-layout"
181-
}
162+
}},
163+
"defaultProject": "demo-app"
164+
}

browserslist

-11
This file was deleted.

0 commit comments

Comments
 (0)