@blockcerts/blockcerts-verifier 1.37.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.eslintrc.js +27 -0
- package/.husky/commit-msg +4 -0
- package/.husky/pre-commit +4 -0
- package/.husky/pre-push +5 -0
- package/LICENSE.md +21 -0
- package/README.md +260 -0
- package/__mocks__/@polymer/lit-element.js +10 -0
- package/demo/allow-download-flag.html +35 -0
- package/demo/allow-social-share-flag.html +35 -0
- package/demo/bright-theme.html +40 -0
- package/demo/bundle-ie11.html +38 -0
- package/demo/bundle.html +36 -0
- package/demo/dark-theme.html +40 -0
- package/demo/disable-auto-verify-flag.html +35 -0
- package/demo/disable-verify-flag.html +35 -0
- package/demo/display-mode-card.html +35 -0
- package/demo/display-mode-full.html +35 -0
- package/demo/display-mode-fullscreen.html +35 -0
- package/demo/events.html +43 -0
- package/demo/explorer-api-overwrite-default.html +47 -0
- package/demo/explorer-api.html +66 -0
- package/demo/no-api.html +35 -0
- package/demo/show-metadata.html +35 -0
- package/demo/with-api-certificate.html +35 -0
- package/dist/ie11.js +195 -0
- package/dist/main.js +664 -0
- package/docs/ADR/adr-000-what-is-an-ADR.md +23 -0
- package/docs/ADR/adr-001-tools-and-methodologies.md +35 -0
- package/docs/ADR/adr-002-css-structure.md +36 -0
- package/docs/ADR/adr-003-store-connector-container-component.md +164 -0
- package/docs/ADR/adr-004-domain.md +38 -0
- package/docs/ADR/adr-005-substeps-list.md +35 -0
- package/docs/ADR/adr-006-handling-plural-i18n.md +20 -0
- package/karma.conf.js +26 -0
- package/package.json +125 -0
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
# ADR 0: What is an ADR?
|
|
2
|
+
|
|
3
|
+
It stands for an Architectural Decision Report, and is described more thoroughly in this blog post: http://thinkrelevance.com/blog/2011/11/15/documenting-architecture-decisions
|
|
4
|
+
|
|
5
|
+
# Context
|
|
6
|
+
Projects tend to see a lot of different contributors intervene. Each of these contributors might influence the architecture in one way or another, and decisions remain, potentially hard to change, let alone understand.
|
|
7
|
+
|
|
8
|
+
# Decision
|
|
9
|
+
In order to maintain some sort of quick reference as to why some decisions have been made, we have decided to introduce this format. The purpose is to allow any new developer to the project to easily understand why some of the more important things have been done one way and not the other.
|
|
10
|
+
|
|
11
|
+
### Naming Convention
|
|
12
|
+
The naming of files should be made as follows:
|
|
13
|
+
|
|
14
|
+
`adr-XXX-title-summary.md`
|
|
15
|
+
|
|
16
|
+
where XXX is a unique sequential number.
|
|
17
|
+
|
|
18
|
+
# Status
|
|
19
|
+
Accepted
|
|
20
|
+
|
|
21
|
+
# Consequences
|
|
22
|
+
Tricky/exposed/controversial architectural decisions now need to be documented in this file.
|
|
23
|
+
As stated in the original blog post, decisions can be superseded or deprecated, but need to be explicted once again via a new ADR.
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
# ADR 1: Explaining the Tools and Methodologies
|
|
2
|
+
|
|
3
|
+
## Context
|
|
4
|
+
Learning Machine handles a Blockcerts verifier in multiple repository and with different ways of deploying. This is costly and hard to maintain.
|
|
5
|
+
|
|
6
|
+
Decision has been made to unify the verifier into one sole component and repository, with scalibility and maintainability at heart.
|
|
7
|
+
|
|
8
|
+
## Decision
|
|
9
|
+
#### JS
|
|
10
|
+
We decided to use Polymer 3.0 as previous versions of the verifier were already written with Polymer. Also because Web Components seem like a promising technology that could open a interesting future for the usage of the component.
|
|
11
|
+
|
|
12
|
+
State of the application will be handled by Redux, as demonstrated in the [example project of Polymer](https://github.com/Polymer/pwa-starter-kit).
|
|
13
|
+
|
|
14
|
+
#### CSS
|
|
15
|
+
We decided to use ITCSS for its interesting way to handle CSS scalability and maintainability.
|
|
16
|
+
More information about this methodology can be found here:
|
|
17
|
+
|
|
18
|
+
https://github.com/sky-uk/css
|
|
19
|
+
|
|
20
|
+
https://www.xfive.co/blog/itcss-scalable-maintainable-css-architecture/
|
|
21
|
+
|
|
22
|
+
#### Testing
|
|
23
|
+
We are using the tools provided by the Polymer Project, hence [WCT](https://github.com/Polymer/tools/tree/master/packages/web-component-tester). We also test for accessibility.
|
|
24
|
+
|
|
25
|
+
#### Accessibility
|
|
26
|
+
The Web Component needs to be WCAG2.0 AA compliant.
|
|
27
|
+
|
|
28
|
+
## Status
|
|
29
|
+
Accepted
|
|
30
|
+
|
|
31
|
+
## Consequences
|
|
32
|
+
Follow above standards and methodologies for development. Maintain a good level of separation of concerns between state and views. Architecture for the communication with external APIs has not yet been decided, and will be subject of a future ADR.
|
|
33
|
+
|
|
34
|
+
#### Testing
|
|
35
|
+
Since WCT exposes Mocha methods, prefer using the BDD methods `describe`, `it` and `expect`.
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
# ADR 2: Understanding the CSS structure
|
|
2
|
+
|
|
3
|
+
## Context
|
|
4
|
+
Web Components encapsulate their shadow dom away from the rest of the DOM, meaning that a general stylesheet cannot style the internals of a Web Component.
|
|
5
|
+
|
|
6
|
+
As such, we need to find a strategy to maintain component level styles but enable shared styles so that we limit code duplication.
|
|
7
|
+
|
|
8
|
+
We had previously decided to follow ITCSS for its way to enable scalability as well as limit specificity war, and would like to keep following this approach.
|
|
9
|
+
|
|
10
|
+
## Exploration
|
|
11
|
+
Using a general stylesheet is by essence out of the way.
|
|
12
|
+
|
|
13
|
+
Using `css-variables` cannot work as not all the problems that it solves are based on variables. Indeed we need to be able to apply blocks of styles in some cases, and maintaining a variable API for each component might lead to insanity.
|
|
14
|
+
|
|
15
|
+
[@apply](https://tabatkins.github.io/specs/css-apply-rule/) seemed promising, but the proposal has been discontinued, and its replacements (see [ShadyCSS Readme](https://github.com/webcomponents/shadycss/blob/master/README.md#about-applyshim)) are still in proposal stage and might not become the standard.
|
|
16
|
+
|
|
17
|
+
Finally it seems that the only option in front of us is to embed styles per component.
|
|
18
|
+
|
|
19
|
+
## Decision
|
|
20
|
+
Considering the outcome of the exploration, and seeing that we want to maintain a sense of scalability and separation of concerns as advocated by the ITCSS methodology, we have decided to maintain component specific stylesheets at component directory level, and use Sass `import` within these sheets to add specific classes that many component might use (basically any other layer from ITCSS beyond components).
|
|
21
|
+
|
|
22
|
+
Shared styles will be hosted under `src/shared-styles` folder and organized following the ITCSS nomenclature.
|
|
23
|
+
|
|
24
|
+
At this moment the `main.scss` file is maintained as it contains information around the available files, and may prove worthy in the future. The value of this needs to be reassessed.
|
|
25
|
+
|
|
26
|
+
## Status
|
|
27
|
+
Accepted
|
|
28
|
+
|
|
29
|
+
## Consequences
|
|
30
|
+
We are using [wc-sass-render](https://github.com/tristanMatthias/wc-sass-render) instead of our initial in-house solution, as it solves the exact problem we are facing, and provides the options we need.
|
|
31
|
+
|
|
32
|
+
CSS files under the components need to follow ITCSS convention in terms of naming, in order to better highlight their layer in the inverted triangle concepts.
|
|
33
|
+
|
|
34
|
+
Code duplication has been accepted as tech-debt, and might incur solutions to better handle large imports (such as tree-shaking, file splitting, etc).
|
|
35
|
+
|
|
36
|
+
|
|
@@ -0,0 +1,164 @@
|
|
|
1
|
+
# ADR 3: Connecting the store to a component
|
|
2
|
+
|
|
3
|
+
## Context
|
|
4
|
+
[pwa-starter-kit](https://github.com/Polymer/pwa-starter-kit) is an example of a Redux application working with Polymer 3. While it serves its purpose, the separation of concerns is not entirely clear between the state and the views, which means that in the example views have too much knowledge of what provides and modfies the state.
|
|
5
|
+
|
|
6
|
+
This is potentially dangerous for scalability, and bloats the view code with decisions that shouldn't be of its concerns.
|
|
7
|
+
|
|
8
|
+
React provides an architectural pattern to handle this abstraction, in the shape of `Containers`. Containers are wrapper around the view component, which connect (via the `react-redux` helper function of the same name) the view and the state (to read it, and to action it).
|
|
9
|
+
|
|
10
|
+
This pattern is interesting because from an architectural standpoint every responsibility is properly distributed. The view receives props, may they be data or callback functions, and utilizes them, the container selects where to retrieve the data or callback functions, and the state solely stores the data and provide mechanisms to modify it.
|
|
11
|
+
|
|
12
|
+
## Decision
|
|
13
|
+
We decided to keep this approach for a Polymer project too. Because the out-of-the-box tools do not provide that abstraction, we implemented our own architectural approach to fit this need.
|
|
14
|
+
|
|
15
|
+
A visual representation of the intent is as follows:
|
|
16
|
+

|
|
17
|
+
|
|
18
|
+
- The state handles the live data of the application.
|
|
19
|
+
- The connector has an instantiation of the store, but is also a metaview, which enables communication with the methods of the store, without exposing it elsewhere.
|
|
20
|
+
- The container is an instance of the connector, which allows defining which part of the state and which actions we would like to bind to its wrapped component.
|
|
21
|
+
- And the wrapped component is just a regular component which expects some props, but does not know nor care where they come from.
|
|
22
|
+
|
|
23
|
+
## Status
|
|
24
|
+
Accepted
|
|
25
|
+
|
|
26
|
+
## Consequences
|
|
27
|
+
Implementation of components that need to access the state must follow this pattern.
|
|
28
|
+
|
|
29
|
+
There are 2 types of components in Polymer, pure functions and classes (extending `LitElement`).
|
|
30
|
+
The implementation of this approach differs a little bit, due to technical constraints of LitElement.
|
|
31
|
+
|
|
32
|
+
Example of a pure function:
|
|
33
|
+
|
|
34
|
+
**Component**
|
|
35
|
+
|
|
36
|
+
```javascript
|
|
37
|
+
const Input = ({ onInput = () => {} } = {}) => {
|
|
38
|
+
return html`
|
|
39
|
+
<label
|
|
40
|
+
for='input'>Label for input</label>
|
|
41
|
+
<input
|
|
42
|
+
type='text'
|
|
43
|
+
id='input'
|
|
44
|
+
on-input='${(e) => { onInput(e.target.value); }}'
|
|
45
|
+
/>
|
|
46
|
+
`;
|
|
47
|
+
};
|
|
48
|
+
|
|
49
|
+
export default Input;
|
|
50
|
+
```
|
|
51
|
+
**Container**
|
|
52
|
+
|
|
53
|
+
```javascript
|
|
54
|
+
import foo from '../../../actions/foo';
|
|
55
|
+
import connector from '../../../store/connector';
|
|
56
|
+
import Input from './Input';
|
|
57
|
+
|
|
58
|
+
const mapDispatchToProps = {
|
|
59
|
+
onInput: foo
|
|
60
|
+
};
|
|
61
|
+
|
|
62
|
+
const InputContainer = connector(Input, { mapDispatchToProps });
|
|
63
|
+
export { InputContainer };
|
|
64
|
+
```
|
|
65
|
+
|
|
66
|
+
Example of a class component:
|
|
67
|
+
|
|
68
|
+
**Component**
|
|
69
|
+
```javascript
|
|
70
|
+
class Button extends LitElement {
|
|
71
|
+
static get properties () {
|
|
72
|
+
return {
|
|
73
|
+
onClick: Function
|
|
74
|
+
};
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
_render (_props) {
|
|
78
|
+
return html`
|
|
79
|
+
<button on-click='${_props.onClick}'>
|
|
80
|
+
Label
|
|
81
|
+
</button>
|
|
82
|
+
`;
|
|
83
|
+
}
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
window.customElements.define('buv-verify-button-raw', Button);
|
|
87
|
+
|
|
88
|
+
// wrap VerifyButton in order to plug into Container
|
|
89
|
+
// necessary trade-off to deal with class component in the store connector
|
|
90
|
+
function ButtonWrapper (props) {
|
|
91
|
+
return html`<buv-verify-button-raw onClick='${props.onClick}'></buv-verify-button-raw>`;
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
export { ButtonWrapper as Button };
|
|
95
|
+
```
|
|
96
|
+
We need to encapsulate the button (that we need to define as a reusable component for this purpose) into a pure function, in order to simplify the rendering of the connector. This function is then exported and reused in the container.
|
|
97
|
+
|
|
98
|
+
**Container**
|
|
99
|
+
|
|
100
|
+
```javascript
|
|
101
|
+
import bar from '../../../actions/bar';
|
|
102
|
+
import connector from '../../../store/connector';
|
|
103
|
+
import { Button } from './Button';
|
|
104
|
+
|
|
105
|
+
const mapDispatchToProps = {
|
|
106
|
+
onClick: bar
|
|
107
|
+
};
|
|
108
|
+
|
|
109
|
+
const VerifyButtonContainer = connector(Button, { mapDispatchToProps });
|
|
110
|
+
export { VerifyButtonContainer };
|
|
111
|
+
```
|
|
112
|
+
Encapsulating the wrapping function inside the component allows for containers to always follow the same pattern and improves expectability.
|
|
113
|
+
|
|
114
|
+
#### mapping actions to a component
|
|
115
|
+
use `mapDispatchToProps`.
|
|
116
|
+
It should be an object expect the key (prop that is going to be passed down to the component), and the value should be the action creator to be mapped. See above example for more details.
|
|
117
|
+
|
|
118
|
+
#### mapping state to a component
|
|
119
|
+
use `mapStateToProps`.
|
|
120
|
+
It should be a function taking `state` as a parameter, and returning an object with as the key the prop that is going to be passed down to the component, and as a value the selector method reading the state.
|
|
121
|
+
|
|
122
|
+
```javascript
|
|
123
|
+
import connector from '../../../store/connector';
|
|
124
|
+
import Input from './Input';
|
|
125
|
+
import { foo } from '../../../selectors/foo';
|
|
126
|
+
|
|
127
|
+
const mapStateToProps = (state) => ({
|
|
128
|
+
isValid: foo(state)
|
|
129
|
+
});
|
|
130
|
+
|
|
131
|
+
const InputContainer = connector(Input, { mapStateToProps });
|
|
132
|
+
export { InputContainer };
|
|
133
|
+
|
|
134
|
+
```
|
|
135
|
+
|
|
136
|
+
#### exposing the component own props
|
|
137
|
+
use `ownProps`.
|
|
138
|
+
Sometimes you want to be able to pass the props from where you use the component directly.
|
|
139
|
+
In the case of a connected component, this is not as straightforward as expected.
|
|
140
|
+
In order to do so, you need to map the `ownProps` object to the component's actual properties.
|
|
141
|
+
|
|
142
|
+
In practice, this means exposing your component as `SourceComponent`, and matching `ownProps` to `SourceComponents.properties`.
|
|
143
|
+
|
|
144
|
+
ie:
|
|
145
|
+
```javascript
|
|
146
|
+
export {
|
|
147
|
+
BlockcertsVerifier as SourceComponent,
|
|
148
|
+
BUVWrapper as BlockcertsVerifier
|
|
149
|
+
};
|
|
150
|
+
```
|
|
151
|
+
|
|
152
|
+
and in the container:
|
|
153
|
+
|
|
154
|
+
```javascript
|
|
155
|
+
import connector from '../store/connector';
|
|
156
|
+
import { BlockcertsVerifier, SourceComponent } from './BlockcertsVerifier';
|
|
157
|
+
|
|
158
|
+
const ownProps = SourceComponent.properties;
|
|
159
|
+
|
|
160
|
+
const BlockcertsVerifierContainer = connector(BlockcertsVerifier, { ownProps });
|
|
161
|
+
export { BlockcertsVerifierContainer };
|
|
162
|
+
|
|
163
|
+
```
|
|
164
|
+
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
# ADR 4: Explaining the Domain
|
|
2
|
+
|
|
3
|
+
## Context
|
|
4
|
+
Redux provides a good mechanism to handle the state and its mutations, but not so much to handle the business logic.
|
|
5
|
+
|
|
6
|
+
However, like always, to keep a good segregation of concerns, we want to handle all business related logic, as well as all external communication of the application isolated.
|
|
7
|
+
|
|
8
|
+
## Decision
|
|
9
|
+
To do so, we introduce the concept of domain.
|
|
10
|
+
|
|
11
|
+
The domain is the part responsible for everything that's not the view concern, nor the state concern.
|
|
12
|
+
|
|
13
|
+
The view concern is to render data.
|
|
14
|
+
The state concern is to store and modify data.
|
|
15
|
+
|
|
16
|
+
The rest belongs to the domain.
|
|
17
|
+
|
|
18
|
+
A visual representation is as follows:
|
|
19
|
+
|
|
20
|
+

|
|
21
|
+
|
|
22
|
+
Each method of the next inner layer only knows about the layer above it.
|
|
23
|
+
|
|
24
|
+
This domain is only inspired from Domain Driven Design and aims at being a simpler implementation of the approach.
|
|
25
|
+
|
|
26
|
+
## Status
|
|
27
|
+
Accepted
|
|
28
|
+
|
|
29
|
+
## Consequences
|
|
30
|
+
Domain concerns must be implemented so that methods (use cases) can be called as follows:
|
|
31
|
+
|
|
32
|
+
```
|
|
33
|
+
domain.concern.usecase
|
|
34
|
+
```
|
|
35
|
+
|
|
36
|
+
Use cases must be tested.
|
|
37
|
+
|
|
38
|
+
Objects resulting from domain methods can be stored in either Entities or Value Objects (see definitions: https://en.wikipedia.org/wiki/Domain-driven_design#Building_blocks), depending on the shape and concept they represent.
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
# ADR 5: Substeps List size calculation
|
|
2
|
+
|
|
3
|
+
## Context
|
|
4
|
+
SubstepsList needs to be animated between showing and hiding the substeps of a step.
|
|
5
|
+
Animating proves convenient on `max-height`
|
|
6
|
+
We were initially hard coding the `max-height` property of the substeps list to have a maximum to animate too (from 0).
|
|
7
|
+
However, hard-coding that value proved not flexible, especially when the substep was also holding an `ErrorMessage`, which could span an undeterminate height (multiple lines, responsiveness, etc).
|
|
8
|
+
|
|
9
|
+
The height of the list all determines the height of the progress bar which at this point is settled and working with little work.
|
|
10
|
+
|
|
11
|
+
## Exploration
|
|
12
|
+
Not many options are available to make sure we can pre-calculate the dynamic, correct, potential `max-height` of the list.
|
|
13
|
+
|
|
14
|
+
- One way could be render the list somewhere on the DOM, hidden, in order to retrieve its height. However this proves problematic as we need to do a prerender which means complicating the DOM and the application code.
|
|
15
|
+
- Another solution is to read the height of the list element once it has been rendered, and maintain it locally within the parent class. It is not super elegant as we need to overwrite the style property after rendering.
|
|
16
|
+
|
|
17
|
+
## Decision
|
|
18
|
+
We chose to follow the second approach which requires less code to work. It is however creating issues with the `html` templating function of `lit-element`, since we change the state of the attribute without informing the library.
|
|
19
|
+
Doing the latter would mean re-rendering via a state prop which would have to be updated at the `_didRender` moment, and would create complains from Polymer.
|
|
20
|
+
|
|
21
|
+
We thus decided to trick the component:
|
|
22
|
+
- we only calculate the `totalHeight` once, since content will not change once rendered.
|
|
23
|
+
- we only force the `max-height` with the calculated height once, if the component was forced rendered and if we haven't applied the trick already
|
|
24
|
+
|
|
25
|
+
We discovered that it would then require 3 clicks on the `hide` button to finally close the list. Some research led us to discover that the `html` templating function handles the values of the attributes, and does not trigger a change (cf: https://github.com/Polymer/lit-html/blob/master/src/core.ts#L538). As such, in the state of the code, the active value is `0` and not `[totalHeight]px` as we forced it to be. Since the closing value is 0 too, the code didn't see the reason for the change.
|
|
26
|
+
|
|
27
|
+
To circumvent this issue, we are now setting the `hidden` state value to be 1px, which allows for the initial closing.
|
|
28
|
+
|
|
29
|
+
## Status
|
|
30
|
+
Accepted
|
|
31
|
+
|
|
32
|
+
## Consequences
|
|
33
|
+
It is not a very elegant hack, but it seems the least aggressive for the browser.
|
|
34
|
+
You should avoid such approaches if you can, though.
|
|
35
|
+
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
# ADR 5: Handling plural for i18n label
|
|
2
|
+
|
|
3
|
+
## Context
|
|
4
|
+
Sometimes labels need to handle pluralization. While it could be just as easy as adding a `s` at the end of the word in English (it is not), French or Spanish, other languages have a variation of their plural form that require a better handling.
|
|
5
|
+
|
|
6
|
+
## Exploration
|
|
7
|
+
We could use a pluralization library but that comes at the cost of added weight to the bundle as well as not guaranteeing success for more complex strings.
|
|
8
|
+
Or we could also simply handle both strings in the translation files.
|
|
9
|
+
|
|
10
|
+
## Decision
|
|
11
|
+
We chose to follow the second approach which adds less overhead to the bundle.
|
|
12
|
+
It comes at the cost of having the contributor to add the plural version of the string they want translated. But this explicit approach also reduces the risk of error and inconsistency.
|
|
13
|
+
|
|
14
|
+
## Status
|
|
15
|
+
Accepted
|
|
16
|
+
|
|
17
|
+
## Consequences
|
|
18
|
+
The contributor will make sure they add a `keyPlural` version mapping to the singular version `key` to the translation files.
|
|
19
|
+
Using the `getText` method, they will have to set the third argument (`usePlural`) to true, and pass as the fourth argument the `count` property which will decide which string to use.
|
|
20
|
+
|
package/karma.conf.js
ADDED
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
/* eslint-disable import/no-extraneous-dependencies */
|
|
2
|
+
const { createDefaultConfig } = require('@open-wc/testing-karma');
|
|
3
|
+
const merge = require('deepmerge');
|
|
4
|
+
|
|
5
|
+
module.exports = config => {
|
|
6
|
+
config.set(
|
|
7
|
+
merge(createDefaultConfig(config), {
|
|
8
|
+
files: [
|
|
9
|
+
// runs all files ending with .test in the test folder,
|
|
10
|
+
// can be overwritten by passing a --grep flag. examples:
|
|
11
|
+
//
|
|
12
|
+
// npm run test -- --grep test/foo/bar.test.js
|
|
13
|
+
// npm run test -- --grep test/bar/*
|
|
14
|
+
{ pattern: config.grep ? config.grep : 'test/e2e/*.test.js', type: 'module' }
|
|
15
|
+
],
|
|
16
|
+
|
|
17
|
+
browsers: ['FirefoxHeadless'], // Chrome from default config
|
|
18
|
+
|
|
19
|
+
esm: {
|
|
20
|
+
nodeResolve: true
|
|
21
|
+
}
|
|
22
|
+
// you can overwrite/extend the config further
|
|
23
|
+
})
|
|
24
|
+
);
|
|
25
|
+
return config;
|
|
26
|
+
};
|
package/package.json
ADDED
|
@@ -0,0 +1,125 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@blockcerts/blockcerts-verifier",
|
|
3
|
+
"version": "1.37.0",
|
|
4
|
+
"description": "A standalone universal viewer and verifier for blockcerts credentials",
|
|
5
|
+
"repository": {
|
|
6
|
+
"type": "git",
|
|
7
|
+
"url": "https://github.com/blockchain-certificates/blockcerts-verifier.git"
|
|
8
|
+
},
|
|
9
|
+
"main": "dist/main.js",
|
|
10
|
+
"dependencies": {
|
|
11
|
+
"@babel/runtime": "^7.6.0",
|
|
12
|
+
"@blockcerts/cert-verifier-js": "^4.11.0",
|
|
13
|
+
"@polymer/lit-element": "0.5.1",
|
|
14
|
+
"@polymer/polymer": "3.4.1",
|
|
15
|
+
"@webcomponents/webcomponentsjs": "2.6.0",
|
|
16
|
+
"autolinker": "^3.14.1",
|
|
17
|
+
"cssfilter": "0.0.10",
|
|
18
|
+
"proxy-polyfill": "^0.3.0",
|
|
19
|
+
"redux": "^4.0.0",
|
|
20
|
+
"redux-thunk": "^2.3.0",
|
|
21
|
+
"whatwg-fetch": "^3.0.0",
|
|
22
|
+
"xss": "^1.0.3"
|
|
23
|
+
},
|
|
24
|
+
"devDependencies": {
|
|
25
|
+
"@babel/core": "^7.6.0",
|
|
26
|
+
"@babel/plugin-transform-runtime": "^7.6.0",
|
|
27
|
+
"@babel/preset-env": "^7.6.0",
|
|
28
|
+
"@babel/preset-typescript": "^7.9.0",
|
|
29
|
+
"@commitlint/cli": "^13.1.0",
|
|
30
|
+
"@commitlint/config-conventional": "^12.0.1",
|
|
31
|
+
"@open-wc/testing": "^2.5.16",
|
|
32
|
+
"@open-wc/testing-karma": "^4.0.3",
|
|
33
|
+
"@polymer/iron-demo-helpers": "^3.0.0-pre.19",
|
|
34
|
+
"@types/jest": "^27.0.0",
|
|
35
|
+
"@types/sinon": "^10.0.0",
|
|
36
|
+
"@typescript-eslint/eslint-plugin": "^4.16.1",
|
|
37
|
+
"@typescript-eslint/parser": "^4.16.1",
|
|
38
|
+
"axe-core": "^4.0.1",
|
|
39
|
+
"babel-jest": "^26.0.0",
|
|
40
|
+
"codecov": "^3.1.0",
|
|
41
|
+
"concurrently": "^6.0.0",
|
|
42
|
+
"deepmerge": "^4.2.2",
|
|
43
|
+
"eslint": "^7.21.0",
|
|
44
|
+
"eslint-config-standard": "^16.0.2",
|
|
45
|
+
"eslint-config-standard-with-typescript": "^20.0.0",
|
|
46
|
+
"eslint-plugin-import": "^2.20.2",
|
|
47
|
+
"eslint-plugin-node": "^11.1.0",
|
|
48
|
+
"eslint-plugin-promise": "^4.2.1",
|
|
49
|
+
"eslint-plugin-standard": "^5.0.0",
|
|
50
|
+
"express": "^4.16.3",
|
|
51
|
+
"husky": "^7.0.1",
|
|
52
|
+
"jest": "^25.5.4",
|
|
53
|
+
"jest-fetch-mock": "^3.0.0",
|
|
54
|
+
"karma-firefox-launcher": "^2.0.0",
|
|
55
|
+
"polymer-cli": "^1.8.1",
|
|
56
|
+
"pwa-helpers": "^0.8.2",
|
|
57
|
+
"rollup": "^2.2.0",
|
|
58
|
+
"rollup-plugin-babel": "^4.3.3",
|
|
59
|
+
"rollup-plugin-commonjs": "^10.0.0",
|
|
60
|
+
"rollup-plugin-livereload": "^2.0.0",
|
|
61
|
+
"rollup-plugin-node-resolve": "^5.0.0",
|
|
62
|
+
"rollup-plugin-replace": "^2.0.0",
|
|
63
|
+
"rollup-plugin-serve": "^1.0.1",
|
|
64
|
+
"rollup-plugin-terser": "^7.0.0",
|
|
65
|
+
"rollup-plugin-typescript": "^1.0.1",
|
|
66
|
+
"sass-lint": "^1.12.1",
|
|
67
|
+
"semantic-release": "^17.0.2",
|
|
68
|
+
"semistandard": "^14.1.0",
|
|
69
|
+
"sinon": "^11.1.0",
|
|
70
|
+
"snazzy": "^9.0.0",
|
|
71
|
+
"ts-jest": "^26.5.2",
|
|
72
|
+
"typescript": "^4.2.2",
|
|
73
|
+
"watch": "^1.0.2",
|
|
74
|
+
"wc-sass-render": "1.0.0",
|
|
75
|
+
"wct-browser-legacy": "^1.0.2",
|
|
76
|
+
"web-component-tester": "^6.9.0"
|
|
77
|
+
},
|
|
78
|
+
"scripts": {
|
|
79
|
+
"build": "rollup -c rollup.config.js",
|
|
80
|
+
"build:sanitizer": "rollup -c rollup-sanitizer.config.js",
|
|
81
|
+
"test": "npm run test:application",
|
|
82
|
+
"test:build": "npm run test:components:retrieve && polymer test; npm run test:karma",
|
|
83
|
+
"test:karma": "tsc -p tsconfig-test.json && karma start; npm run test:karma:cleanup",
|
|
84
|
+
"test:karma:cleanup": "git clean -dfq",
|
|
85
|
+
"test:components:retrieve": "node test/wct-script/retrieveTestFiles",
|
|
86
|
+
"test:components:retrieve:watch": "npm run test:components:retrieve -- --watch",
|
|
87
|
+
"test:components:persist": "concurrently 'npm run test:components:retrieve:watch' 'polymer test -p'",
|
|
88
|
+
"test:application": "jest --runInBand --silent",
|
|
89
|
+
"test:application:watch": "jest --watch",
|
|
90
|
+
"test:coverage": "jest --maxWorkers=4 --silent --noStackTrace --coverage",
|
|
91
|
+
"test:coverage:report": "codecov",
|
|
92
|
+
"start": "concurrently 'rollup -c rollup.dev.config.js -w' 'npm run styles:compile:watch' 'npm run start:mock-server'",
|
|
93
|
+
"start:mock-server": "node test/mock-server",
|
|
94
|
+
"styles:compile": "sass-render ./src/components/**/*.scss",
|
|
95
|
+
"styles:compile:watch": "sass-render ./src/components/**/*.scss -w",
|
|
96
|
+
"lint": "npm run lint:js && npm run lint:ts && npm run lint:styles",
|
|
97
|
+
"lint:fix": "semistandard --fix",
|
|
98
|
+
"lint:js": "semistandard \"**/*.js\" | snazzy",
|
|
99
|
+
"lint:ts": "eslint . --ext .ts",
|
|
100
|
+
"lint:styles": "sass-lint --verbose",
|
|
101
|
+
"semantic-release": "semantic-release",
|
|
102
|
+
"prepare": "husky install"
|
|
103
|
+
},
|
|
104
|
+
"publishConfig": {
|
|
105
|
+
"access": "public"
|
|
106
|
+
},
|
|
107
|
+
"semistandard": {
|
|
108
|
+
"globals": [
|
|
109
|
+
"performance",
|
|
110
|
+
"fetch",
|
|
111
|
+
"FileReader",
|
|
112
|
+
"atob",
|
|
113
|
+
"CustomEvent",
|
|
114
|
+
"Image",
|
|
115
|
+
"domainParseStub"
|
|
116
|
+
],
|
|
117
|
+
"ignore": [
|
|
118
|
+
"sanitizer/sanitizer.js",
|
|
119
|
+
"test/wct-script/getTestFiles.js",
|
|
120
|
+
"test/assertions/*",
|
|
121
|
+
"*-css.js"
|
|
122
|
+
],
|
|
123
|
+
"env": "jest"
|
|
124
|
+
}
|
|
125
|
+
}
|