4
4
* [ Build Commands] ( #commands )
5
5
* [ Building the Documentation] ( #livedocs )
6
6
* [ Building the Library] ( #builds )
7
- * [ Using the Library with Bower ] ( #bower ) <br /><br />
8
- * [ Introducing Components ] ( #comp )
7
+ <br /><br />
8
+ * [ Component Modules ] ( #comp )
9
9
* [ Building Individual Components] ( #comp_builds )
10
- * [ Component Debugging] ( #comp_debug ) <br /><br />
11
- * [ Theming] ( #themes )
12
-
10
+ * [ Component Debugging] ( #comp_debug )
13
11
14
12
## <a name =" intro " ></a > Introduction
15
13
16
- AngularJS Material has a sophisticated collection of build process and commands available... to deploy
17
- distribution files, test components, and more.
14
+ AngularJS Material has a collection of build processes and commands available to deploy distribution
15
+ files, test components, and more.
18
16
19
- These commands are defined within two (2) ** gulp** files:
17
+ These commands are defined within the ` package.json ` and two (2) ** gulp** files:
20
18
19
+ * [ package.json] ( ../../package.json )
21
20
* [ Project Gulp] ( ../../gulpfile.js )
22
21
* [ Documentation Gulp] ( ../gulpfile.js )
23
22
23
+ From the project root, install the NPM packages by running
24
+ - ` npm install ` or ` npm i `
24
25
25
26
### <a name =" commands " ></a > Build Commands
26
27
27
- For each milestone release, always run:
28
-
29
- - ` npm update ` to update your local gulp dependencies
30
- - ` bower update ` to update AngularJS dependencies
31
-
32
28
The following command line tasks are available:
33
29
34
- - ` gulp build ` (alias ` gulp ` ) to build, add ` --release ` flag to uglify & strip ` console.log `
35
- - ` gulp docs ` to build the Live Docs into dist/docs
36
- - ` gulp watch ` to build & rebuild on changes
30
+ - ` npm run build ` to build
31
+ - ` npm run build:prod ` to uglify, strip ` console.log ` , and autoprefix CSS
32
+ - ` npm run docs:build ` to build the docs into ` dist/docs `
33
+ - ` npm run docs:watch ` to build the library and docs, and rebuild on file changes
37
34
38
35
<a separator ></a >
39
36
40
- - ` gulp karma ` to test once
41
- - ` gulp karma-watch ` to test & watch for changes
37
+ - ` npm run lint ` to run ESLint
38
+ - ` npm run test:fast ` to run smoke tests
39
+ - ` npm run test:full ` to run all of the unit tests
42
40
43
41
### <a name =" livedocs " ></a > Building the Documentation
44
42
45
- The AngularJS Material ** Live Docs** are generated from the source code and demos and actually use the
46
- AngularJS Material components and themes.
43
+ The AngularJS Material Docs are generated from the source code. The documentation itself uses the
44
+ AngularJS Material layout, components, and themes.
47
45
48
46
> Our build process uses ** [ dgeni] ( https://github.com/angular/dgeni ) ** , the wonderful documentation
49
- generator built by [ Pete Bacon Darwin] ( https://github.com/petebacondarwin ) .
47
+ generator built by [ Pete Bacon Darwin] ( https://github.com/petebacondarwin ) .
48
+
49
+ To view the Docs (locally):
50
50
51
- See the [ Building the Live Documentation] ( ../README.md#docs ) document for details.
51
+ 1 . Build the docs and serve with 'live reload' using ` npm run docs:watch `
52
+ 1 . Open Browser to [ http://localhost:8080 ] ( http://localhost:8080 )
52
53
53
54
### <a name =" builds " ></a > Building the Library
54
55
55
56
Developers can build the entire AngularJS Material library or individual component modules. The
56
57
library comprises:
57
58
58
- * ` angular-material.js ` - components
59
- * ` angular-material.css ` - styles and default theme stylesheet
60
- * ` /themes/ **.css` - default theme override stylesheets
59
+ * ` angular-material.js ` - components, services, and theming
60
+ * ` angular-material.css|scss ` - styles
61
+ * ` layouts/ **.css|scss ` - default layout stylesheets
61
62
62
63
To build from the source, simply use:
63
-
64
64
``` bash
65
- # Build and deploy the library to
65
+ # Build the library to
66
66
#
67
67
# - `dist/angular-material.js`
68
- # - `dist/angular-material.css`
69
- # - `dist/themes `
68
+ # - `dist/angular-material.css|scss `
69
+ # - `dist/layouts `
70
70
71
- gulp build
71
+ npm run build
72
72
73
73
# Build minified assets
74
74
#
75
75
# - `dist/angular-material.min.js`
76
- # - `dist/angular-material.min.css`
77
- # - `dist/themes `
76
+ # - `dist/angular-material.min.css|scss `
77
+ # - `dist/layouts `
78
78
79
- gulp build --release
79
+ npm run build:prod
80
80
```
81
81
82
- ### <a name =" bower " ></a > Using the Library with Bower
83
-
84
- For developers not interested in building the AngularJS Material library, use ** bower** to install and
85
- use the AngularJS Material distribution files.
86
-
87
- Change to your project's root directory.
88
-
89
- ``` bash
90
- # To get the latest stable version, use Bower from the command line.
91
- bower install angular-material
92
-
93
- # To get the most recent, latest committed-to-master version use:
94
- bower install angular-material#master
95
- ```
96
-
97
- Visit [ Bower-Material] ( https://github.com/angular/bower-material/blob/master/README.md ) for more
98
- details on how to install and use the AngularJS Material distribution files within your own local
99
- project.
100
-
101
- <br />
102
- ##<a name =" comp " ></a > Introducing Components
82
+ ##<a name =" comp " ></a > Component Modules
103
83
104
- AngularJS Material supports the construction and deployment of individual component builds. Within
105
- AngularJS Material, each component is contained within its own module and specifies its own
106
- dependencies.
84
+ AngularJS Material supports the construction and deployment of individual component builds.
85
+ Each component is contained within its own module and specifies its own dependencies.
107
86
108
87
> At a minimum, all components have a dependency upon the ` core ` module.
109
88
110
- For example, the ** slider** component is registered as a ** material.components.slider** module.
89
+ For example, the ** slider** component is registered as the ** material.components.slider** module.
111
90
112
91
### <a name =" comp_builds " ></a > Building Individual Components
113
92
114
- To build and deploy assets for each component individually, run the command
115
-
93
+ To build and deploy assets for each component individually, run:
116
94
``` bash
117
- gulp build-all- modules
95
+ npm run build: modules
118
96
```
119
97
120
98
All component modules are compiled and distributed to:
121
-
122
99
``` text
123
100
-- dist
124
101
-- modules
@@ -128,8 +105,6 @@ All component modules are compiled and distributed to:
128
105
```
129
106
130
107
Let's consider the Slider component with its module definition:
131
-
132
-
133
108
``` js
134
109
/**
135
110
* @ngdoc module
@@ -144,8 +119,6 @@ First build all the component modules.
144
119
145
120
To use - for example - the Slider component within your own application, simply load the stylesheets
146
121
and JS from both the ** slider** and the ** core** modules:
147
-
148
-
149
122
``` text
150
123
-- dist
151
124
-- modules
@@ -161,7 +134,7 @@ and JS from both the **slider** and the **core** modules:
161
134
162
135
### <a name =" comp_debug " ></a > Component Debugging
163
136
164
- Debugging a demo in the Live Docs is complicated due the multiple demos loading and initializing. A
137
+ Debugging a demo in the Docs is complicated due the multiple demos loading and initializing. A
165
138
more practical approach is to open and debug a specific, standalone Component demo.
166
139
167
140
To open a Component demo outside of the Docs application, just build, deploy and debug that
@@ -170,19 +143,14 @@ component's demo(s).
170
143
For example, to debug the ** textfield** component:
171
144
172
145
``` bash
173
- # Watch, build and deploy the 'textfield' demos
146
+ # Watch and build the 'textfield' demos
174
147
#
175
148
# NOTE: watch-demo will rebuild your component source
176
- # and demos upon each `save`
149
+ # and demos upon each `save`.
150
+ # Note: server will livereload demos on port 8080 after updates are
151
+ # built (by watch-demo) to the dist/demos/ dir.
177
152
#
178
- gulp watch-demo -c textfield
179
-
180
- # launch the liveReload server on port 8080
181
- #
182
- # Note: livereload will reload demos after updates are
183
- # deployed (by watch-demo) to the dist/demos/
184
- #
185
- gulp server
153
+ gulp watch-demo -c textfield server
186
154
```
187
155
188
156
The demo build process will deploy a * self-contained* AngularJS application that runs the specified
@@ -192,13 +160,8 @@ component's demo(s). E.g.:
192
160
* ` dist/demos/tabs/**/*.* `
193
161
* etc.
194
162
195
- After running ` gulp server ` to start a * LiveReload * server in your project root :
163
+ After running the appropriate ` watch-demo ` and ` server ` tasks :
196
164
197
- * Open browser to url ` http://localhost:8080/ `
198
- * Navigate to ` dist/demos/ <component>/<demo>/index.html `
165
+ * Open browser to [ http://localhost:8080/dist/demos ] ( http://localhost:8080/dist/demos )
166
+ * Navigate to ` <component>/<demo> `
199
167
* Open Dev Tools and debug...
200
-
201
-
202
- ## <a name =" themes " ></a > Theming
203
-
204
- [ Go to the Theming Guide] ( https://material.angularjs.org/latest/Theming/01_introduction )
0 commit comments