Skip to content
This repository was archived by the owner on Mar 7, 2024. It is now read-only.

Commit 8ebc1c9

Browse files
author
Morten Christensen
committed
2.0.1 fixes and updates
1 parent c86543d commit 8ebc1c9

File tree

4 files changed

+19
-17
lines changed

4 files changed

+19
-17
lines changed

CHANGELOG.md

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
11
v1.0.0 Initial stable release
2-
v2.0.0 ES5 retargeting.
3-
Removed isRoot.
2+
v2.0.0 ES5 retargeting for easier browser compatibility.
3+
Removed isRoot.
4+
v2.0.1 Updated dependencies to latest versions, incl. typescript to 2.1.5
5+
Arrays in model are now declared as ReadOnly.

README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# json-schema-js-gui-model
22

3-
Use this library when you need to construct many different custom UI forms that shares common
3+
Use this library typescript/javascript library when you need to construct many different custom UI forms that shares common
44
characteristics, want to be in charge of how exactly your UI form should present itself, want to
55
pick your own web framework for the UI, and want to use a json schema to drive the UI forms
66
but finds json schema complex to process and lacking of UI information.
@@ -15,7 +15,7 @@ different depending on the exact web framework used and this out of scope of thi
1515
fundamental and general project.
1616

1717
This library is on purpose keept small with few runtime-dependencies. It can be used from both nodejs v6+
18-
and with a modern es6 capable browser.
18+
and with a es5 capable browser.
1919

2020
## Getting started
2121

@@ -24,7 +24,7 @@ and with a modern es6 capable browser.
2424
Schemas can be translated using the exported GuiModelMapper class or by the the command line
2525
command *mapToGuiModel* when the library is installed with -g option by npm.
2626

27-
Code:
27+
Code (typescript example):
2828
```typescript
2929
import { GuiModelMapper, GuiModel, JsonSchema } from 'json-schema-js-gui-model';
3030

package.json

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "json-schema-js-gui-model",
3-
"version": "2.0.0",
3+
"version": "2.0.1",
44
"description": "Handy gui model and associated translator that is useful when constructing javascript UI forms from json-schemas",
55
"main": "dist/index.js",
66
"types": "dist/index.d.ts",
@@ -42,18 +42,18 @@
4242
"homepage": "https://github.com/mmc41/json-schema-js-gui-model#readme",
4343
"devDependencies": {
4444
"@types/chai": "3.4.34",
45-
"@types/core-js": "0.9.34",
46-
"@types/mocha": "2.2.32",
47-
"@types/node": "6.0.46",
45+
"@types/core-js": "0.9.35",
46+
"@types/mocha": "2.2.38",
47+
"@types/node": "7.0.0",
4848
"chai": "3.5.0",
49-
"ghooks": "^1.3.2",
50-
"mocha": "3.1.2",
49+
"ghooks": "^2.0.0",
50+
"mocha": "3.2.0",
5151
"nodemon": "1.11.0",
52-
"npm-run-all": "3.1.1",
52+
"npm-run-all": "4.0.1",
5353
"rimraf": "2.5.4",
5454
"ts-npm-lint": "0.1.0",
55-
"tslint": "3.15.1",
56-
"typescript": "2.0.9"
55+
"tslint": "4.3.1",
56+
"typescript": "2.1.5"
5757
},
5858
"engines": {
5959
"node": ">=6.0.0",

src/lib/gui-model.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -74,15 +74,15 @@ export interface FieldBase extends GuiElementBase {
7474

7575
export interface TypedField<T> extends FieldBase {
7676
readonly defaultValue: T;
77-
readonly values?: T[];
77+
readonly values?: ReadonlyArray<T>;
7878
}
7979

8080
/**
8181
* A containers for other gui elements.
8282
*/
8383
export interface Group extends GuiElementBase {
8484
readonly kind: 'group';
85-
readonly elements: GuiElement[];
85+
readonly elements: ReadonlyArray<GuiElement>;
8686
}
8787

8888
export interface TranslationError {
@@ -94,7 +94,7 @@ export interface TranslationError {
9494
* Represents a full gui model. Essentially a group but with an extra errors field.
9595
*/
9696
export interface GuiModel extends Group {
97-
readonly errors: TranslationError[];
97+
readonly errors: ReadonlyArray<TranslationError>;
9898
}
9999

100100
export type Field = TypedField<string> | TypedField<number> | TypedField<boolean>;

0 commit comments

Comments
 (0)