Skip to content

Commit 8674270

Browse files
authored
Merge pull request #5 from Netcentric/feature/#1-readme-update
Feature/#1 readme update
2 parents 14dac4c + e6f3afa commit 8674270

File tree

2 files changed

+62
-71
lines changed

2 files changed

+62
-71
lines changed

README.md

+10-70
Original file line numberDiff line numberDiff line change
@@ -8,25 +8,11 @@ Description
88
[![semver: semantic-release](https://img.shields.io/badge/semver-semantic--release-blue.svg)](https://github.com/semantic-release/semantic-release)
99
[![License](https://img.shields.io/badge/License-Apache%202.0-blue.svg)](https://opensource.org/licenses/Apache-2.0)
1010

11-
## Table of Changes
12-
13-
| Problem | Solution |
14-
|---------------------------------------------------|---------------------------------------|
15-
| components asynchronous, not blocking event loop | async function |
16-
| singleton vs static class vs function exports | splitted into functions |
17-
| Registering syntax | ```loaderRegister({ component })``` |
18-
| Used named exports vs export default | Named exports |
19-
| configurable data attribute? | function param defaults |
20-
| Object for component list vs Set with name inside | Object for component list |
21-
| Mutation Observer vs AEM edit Iframe Postmessage | Mutation Observer |
22-
| Iteration over nodes instead of components | Nodes define with components to init |
23-
24-
25-
### Installation
11+
## Installation
2612

2713
```npm install @netcentric/component-loader```
2814

29-
#### important! babel
15+
**important!**
3016

3117
This module is not transpiled. If your project is excluding `node_modules` you will have to update regex to include this module.
3218

@@ -35,19 +21,16 @@ Eg:
3521
```javascript
3622
// webpack babel-loader config
3723
module.exports = {
38-
test: /\.js$/,
3924
exclude: /node_modules\/(?!@netcentric)/,
4025
loader: 'babel-loader',
41-
options: {
42-
presets: '@babel/preset-env'
43-
}
26+
...
4427
};
4528
```
4629

4730
Here we are excluding node_modules, except the ones under node_modules/@netcentric/*
4831

4932

50-
### Usage
33+
## Usage
5134

5235
1. Register component:
5336
```javascript
@@ -69,16 +52,16 @@ run();
6952

7053
### Example
7154

72-
#### at the component `.entry.` file you should register your component
55+
#### in the component file you should register your component
7356

7457
```javascript
7558
import { register } from '@netcentric/component-loader';
76-
import { text } from './text.component';
7759

60+
class Text {
61+
...
62+
}
7863
// register your component to be loaded
79-
register({ text });
80-
// if you want to run just this component, eg if you are using http2
81-
// runComponent(text.name or 'text');
64+
register({ Text });
8265
```
8366

8467
#### At your main entry file you should run all registered components
@@ -89,7 +72,7 @@ import {
8972
run
9073
} from '@netcentric/component-loader';
9174

92-
// Run all registered component - used usually with http1
75+
// Run all registered component
9376
run();
9477
// Optional: Use observe to initialize new components which are added to the DOM after initial run.
9578
observe();
@@ -260,46 +243,3 @@ const getTitleByUUID = (uuid) => instances.title.filter(instance => instance.el.
260243
const mytitle = getTitleByUUID('a8c405b5-1928-46ed-afa1-5a0a3f4dde6c');
261244

262245
```
263-
264-
### Docs
265-
- LICENSE
266-
- docs/CODE_OF_CONDUCT.md
267-
- docs/CONTRIBUTING.md
268-
- docs/CHANGELOG.md --> dynamically updated
269-
270-
### Issue template
271-
- .github/ISSUE_TEMPLATE.md
272-
273-
### PR template
274-
- .github/PULL_REQUEST_TEMPLATE.md --> automatically closes connected issue
275-
276-
### Workflows
277-
- CI --> npm ci, test and build
278-
- CodeQL --> Perform CodeQL Analysis (Security, etc.)
279-
- Release --> semantic-release:
280-
* Creates release notes
281-
* Updates CHANGELOG
282-
* Updates package.json version
283-
* Creates Git tag/release
284-
* Publish package to NPM
285-
- Manual Release --> same as Release, but can be triggered manually in Actions tab
286-
287-
### Release
288-
- based on Angular Commit Message Conventions in commits -
289-
https://github.com/angular/angular/blob/master/CONTRIBUTING.md#commit-message-header
290-
- Commit message format is used to build:
291-
* Release notes
292-
* Changelog updates
293-
* NPM package semver
294-
295-
### Commit message Convention
296-
297-
```
298-
<type>(<scope>): <short summary>
299-
│ │ │
300-
│ │ └─⫸ Summary in present tense. Not capitalized. No period at the end.
301-
│ │
302-
│ └─⫸ Commit Scope (optional): project|based|list
303-
304-
└─⫸ Commit Type: build|ci|docs|feat|fix|perf|refactor|test
305-
```

docs/CONTRIBUTING.md

+52-1
Original file line numberDiff line numberDiff line change
@@ -21,5 +21,56 @@ All submissions should come in the form of pull requests and need to be reviewed
2121
by project committers. Read [GitHub's pull request documentation](https://help.github.com/articles/about-pull-requests/)
2222
for more information on sending pull requests.
2323

24-
Lastly, please follow the [pull request template](../.github/PULL_REQUEST_TEMPLATE.md) when
24+
Please follow the [pull request template](../.github/PULL_REQUEST_TEMPLATE.md) when
2525
submitting a pull request!
26+
27+
## Commit messages
28+
- Releasew is based on Angular Commit Message Conventions in commits -
29+
https://github.com/angular/angular/blob/master/CONTRIBUTING.md#commit-message-header
30+
- Commit message format is used to build:
31+
* Release notes
32+
* Changelog updates
33+
* NPM package semver
34+
35+
### Commit message Convention
36+
37+
```
38+
<type>(<scope>): <short summary>
39+
│ │ │
40+
│ │ └─⫸ Summary in present tense. Not capitalized. No period at the end.
41+
│ │
42+
│ └─⫸ Commit Scope (optional): project|based|list
43+
44+
└─⫸ Commit Type: build|ci|docs|feat|fix|perf|refactor|test
45+
```
46+
47+
### Example
48+
49+
- Triggers `patch` version update
50+
51+
Appears under "Bug Fixes" header, graphite subheader, with a link to issue #28:
52+
53+
```
54+
fix(graphite): stop graphite breaking when width < 0.1
55+
56+
Closes #28
57+
```
58+
59+
- Triggers `minor` version update
60+
61+
Appears under "Features" header, pencil subheader:
62+
63+
```
64+
feat(pencil): add 'graphiteWidth' option
65+
```
66+
67+
- Triggers `major` version update
68+
69+
Appears under "Performance Improvements" header, and under "Breaking Changes" with the breaking change explanation:
70+
71+
```
72+
perf(pencil): remove graphiteWidth option
73+
74+
BREAKING CHANGE: The graphiteWidth option has been removed. The default graphite width of 10mm is always used for performance reason.
75+
```
76+

0 commit comments

Comments
 (0)