You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
*Note:* If you chose a different `port` earlier, change `8080` to its value.
85
+
*Note:* If you've chosen a different `port` earlier, change `8080` to its value.
86
86
87
87
You can also run the tests:
88
88
@@ -107,42 +107,42 @@ That's it!
107
107
108
108
## Understanding the project structure
109
109
110
-
### package.json
110
+
### `package.json`
111
111
112
112
The initialization script will create several NPM scripts for you in `package.json`.
113
113
114
114
Task | Purpose
115
115
-----|-------
116
-
clean | Deletes the `dist/` directory with the build output
117
-
build | Production build to the `dist/` directory
118
-
lint | Run a static code scan with `eslint`
119
-
start | Build the project for development, run the dev server and watch for changes
120
-
watch | Watch for changes only
121
-
serve | Run the dev server only
122
-
test | Run the dev server and execute the specs from the `test/specs/` directory
123
-
create-ui5-element | Create an empty web component with the given name
116
+
clean | Delete the `dist/` directory with the build output.
117
+
build | Production build to the `dist/` directory.
118
+
lint | Run a static code scan with `eslint`.
119
+
start | Build the project for development, run the dev server and watch for changes.
120
+
watch | Watch for changes only.
121
+
serve | Run the dev server only.
122
+
test | Run the dev server and execute the specs from the `test/specs/` directory.
123
+
create-ui5-element | Create an empty Web Component with the given name.
124
124
125
125
### Files in the main directory
126
126
127
127
The initialization script will create several files in your package's main directory.
128
128
129
129
File | Purpose
130
130
------|-------
131
-
.eslintignore | Excludes the `dist/` and `test/` directories from static code scans
132
-
package-scripts.js | An [nps](https://www.npmjs.com/package/nps) package scripts configuration file
133
-
bundle.esm.js | Entry point for the ES6 bundle, used for development and tests. Intended for modern browsers.
134
-
bundle.es5.js | Entry point for the ES5 bundle, used for development and tests. Intended for IE11 only. Delete this file if you don't need IE11 support.
131
+
.eslintignore | Excludes the `dist/` and `test/` directories from static code scans.
132
+
package-scripts.js | An [nps](https://www.npmjs.com/package/nps) package scripts configuration file.
133
+
bundle.esm.js | Entry point for the ES6 bundle used for development and tests. Intended for modern browsers.
134
+
bundle.es5.js | Entry point for the ES5 bundle used for development and tests. Intended for IE11 only. Delete this file if you don't need IE11 support.
135
135
136
136
You'll likely only need to change `bundle.esm.js` to import your new components there.
137
137
138
138
### The `config/` directory
139
139
140
-
The `config/` directory serves as a central place for most build and test tools' configuration assets. Normally you
140
+
The `config/` directory serves as a central place for most build and test tools configuration assets. Normally, you
141
141
don't need to change any files there.
142
142
143
143
#### Custom configuration
144
144
145
-
The files in the `config/` directory simply import UI5 Web Components' default configuration for all tasks: `rollup`, `wdio`, `eslint`, etc...
145
+
The files in the `config/` directory simply import UI5 Web Components default configuration for all tasks: `rollup`, `wdio`, `eslint`, etc.
146
146
147
147
If you need to customize any configuration, simply put your own content into the respective file in `config/`.
Again, this is a proxy to UI5 Web Components' default configuration.
178
+
Again, this is a proxy to UI5 Web Components default configuration.
179
179
180
180
You could just paste the content of`@ui5/webcomponents-tools/components-package/wdio.js` here and modify at will.
181
181
@@ -192,22 +192,21 @@ Examples:
192
192
193
193
### The `src/` directory
194
194
195
-
This is where you'll do most of the development.
196
-
Let's see the necessary files for a `my-first-component` component.
195
+
This is where you'll do most of the development. Let's see the necessary files for a `my-first-component` component.
197
196
198
197
#### Class and template files
199
198
200
-
The main files describing a web component are:
199
+
The main files describing a Web Component are:
201
200
202
201
File | Purpose
203
202
------------|-------------
204
-
`src/MyFirstComponent.js`| Web componentclass
203
+
`src/MyFirstComponent.js` | Web Component class
205
204
`src/MyFirstComponent.hbs` | Handlebars template
206
205
207
206
In order to understand how a UI5 Web Component works and what lies behind these two files, make sure you check the
208
207
[Developing Web Components](./Developing%20Web%20Components.md) section of the documentation.
209
208
210
-
For the purposes ofthis tutorial however, you don't need to understand their internals, as they are automatically generated by the
209
+
For the purposes of this tutorial, however, you don't need to understand their internals, as they are automatically generated by the
211
210
script and are in a working state already.
212
211
213
212
#### Theming-related files
@@ -219,17 +218,17 @@ In addition, you can define your own CSS Vars and provide different values for t
219
218
220
219
File| Purpose
221
220
------------|-------------
222
-
`src/themes/MyFirstComponent.css` | All CSS rules for the web component, same for all themes. Will be inserted in the shadow root.
223
-
`src/themes/sap_belize/parameters-bundle.css` | Values for the component-specific CSS Vars for the `sap_belize` theme.
224
-
`src/themes/sap_belize_hcb/parameters-bundle.css` | Values for the component-specific CSS Vars for the `sap_belize_hcb` theme.
225
-
`src/themes/sap_belize_hcw/parameters-bundle.css` | Values for the component-specific CSS Vars for the `sap_belize_hcw` theme.
226
-
`src/themes/sap_fiori_3/parameters-bundle.css` | Values for the component-specific CSS Vars for the `sap_fiori_3` theme.
227
-
`src/themes/sap_fiori_3_dark/parameters-bundle.css` | Values for the component-specific CSS Vars for the `sap_fiori_3_dark` theme.
228
-
`src/themes/sap_fiori_3_hcb/parameters-bundle.css` | Values for the component-specific CSS Vars for the `sap_fiori_3_hcb` theme.
229
-
`src/themes/sap_fiori_3_hcw/parameters-bundle.css` | Values for the component-specific CSS Vars for the `sap_fiori_3_hcw` theme.
221
+
`src/themes/MyFirstComponent.css`| All CSS rules for the Web Component, same for all themes; will be inserted in the shadow root.
222
+
`src/themes/sap_belize/parameters-bundle.css`| Values for the component-specific CSS Vars for the `sap_belize` theme
223
+
`src/themes/sap_belize_hcb/parameters-bundle.css`| Values for the component-specific CSS Vars for the `sap_belize_hcb` theme
224
+
`src/themes/sap_belize_hcw/parameters-bundle.css`| Values for the component-specific CSS Vars for the `sap_belize_hcw` theme
225
+
`src/themes/sap_fiori_3/parameters-bundle.css`| Values for the component-specific CSS Vars for the `sap_fiori_3` theme
226
+
`src/themes/sap_fiori_3_dark/parameters-bundle.css`| Values for the component-specific CSS Vars for the `sap_fiori_3_dark` theme
227
+
`src/themes/sap_fiori_3_hcb/parameters-bundle.css`| Values for the component-specific CSS Vars for the `sap_fiori_3_hcb` theme
228
+
`src/themes/sap_fiori_3_hcw/parameters-bundle.css`| Values for the component-specific CSS Vars for the `sap_fiori_3_hcw` theme
230
229
231
230
*Note:* It's up to you whether to put the CSS Vars directly in the `parameters-bundle.css` files for the different themes or to
232
-
importthemfrom separate `.css` files. You could have for example a `MyFirstComponent-params.css` file for each theme and
231
+
import them from separate `.css` files. You could have, for example, a `MyFirstComponent-params.css` file for each theme and
233
232
import it into the `parameters-bundle.css` file: `@import "MyFirstComponent-params.css";`.
234
233
235
234
Again, to know more about how these files work, you could have a look at the [Developing Web Components](./Developing%20Web%20Components.md#css) section of the documentation.
@@ -265,20 +264,18 @@ PLEASE_WAIT=Espere
265
264
266
265
File | Purpose
267
266
------------|-------------
268
-
`src/Assets.js` | Entry point for your package's assets
267
+
`src/Assets.js` | Entry point for your package assets.
269
268
270
269
This module imports all base assets (such as `CLDR` and the base theme parameters), but also your own
271
-
package's assets (i18n and package-specific theme parameters).
272
-
Users of your package will have to import this module in their production applications in order to get additional themes support
273
-
and i18n support.
270
+
package assets (i18n and package-specific theme parameters). Users of your package will have to import this module in their production applications in order to get additional themes support and i18n support.
274
271
275
272
*Note:* For easier development and testing, `Assets.js` is also imported in the dev/test bundle `bundle.esm.js` by the initialization script.
276
273
277
274
### The `test/` directory
278
275
279
276
File | Purpose
280
277
------------|-------------
281
-
`test/pages/*` | Simple `.html` pages used for development and tests
278
+
`test/pages/*` | Simple `.html` pages used for development and tests.
282
279
`src/specs/*` | Test specs, based on [WDIO](https://www.npmjs.com/package/wdio). They use the test pages for setup.
283
280
284
281
You can execute all specs by running `yarn test` or `npm run test`.
0 commit comments