Skip to content

Commit

Permalink
Merge pull request #75 from xpepermint/master
Browse files Browse the repository at this point in the history
Consolidate createModelClass interfaces
  • Loading branch information
xpepermint authored Sep 27, 2019
2 parents aabfeed + 16ba51c commit 270ba24
Show file tree
Hide file tree
Showing 24 changed files with 104 additions and 41 deletions.
8 changes: 4 additions & 4 deletions common/config/rush/npm-shrinkwrap.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion common/config/rush/version-policies.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
{
"policyName": "patchAll",
"definitionName": "lockStepVersion",
"version": "3.1.0",
"version": "3.2.0",
"nextBump": "patch"
}
]
6 changes: 6 additions & 0 deletions packages/rawmodel-core/CHANGELOG.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,12 @@
{
"name": "@rawmodel/core",
"entries": [
{
"version": "3.2.0",
"tag": "@rawmodel/core_v3.2.0",
"date": "Fri, 27 Sep 2019 23:06:25 GMT",
"comments": {}
},
{
"version": "3.1.0",
"tag": "@rawmodel/core_v3.1.0",
Expand Down
7 changes: 6 additions & 1 deletion packages/rawmodel-core/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,11 @@
# Change Log - @rawmodel/core

This log was last generated on Fri, 27 Sep 2019 22:48:59 GMT and should not be manually modified.
This log was last generated on Fri, 27 Sep 2019 23:06:25 GMT and should not be manually modified.

## 3.2.0
Fri, 27 Sep 2019 23:06:25 GMT

*Version update only*

## 3.1.0
Fri, 27 Sep 2019 22:48:59 GMT
Expand Down
6 changes: 3 additions & 3 deletions packages/rawmodel-core/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@rawmodel/core",
"version": "3.1.0",
"version": "3.2.0",
"description": "Strongly-typed JavaScript object with support for validation and error handling.",
"main": "./dist/index.js",
"types": "./dist/index.d.ts",
Expand Down Expand Up @@ -84,13 +84,13 @@
"devDependencies": {
"@hayspec/cli": "^0.8.4",
"@hayspec/spec": "^0.8.4",
"@rawmodel/parsers": "3.1.0",
"@rawmodel/parsers": "3.2.0",
"nyc": "^14.1.1",
"ts-node": "^8.3.0",
"tslint": "^5.18.0",
"typescript": "^3.5.3"
},
"dependencies": {
"@rawmodel/utils": "3.1.0"
"@rawmodel/utils": "3.2.0"
}
}
2 changes: 1 addition & 1 deletion packages/rawmodel-core/src/core/builder.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ export function createModelClass(props: PropDefinition[]): typeof Model {
});

props.forEach((prop) => {
Klass.$props[prop.name] = { ...prop.prop };
Klass.$props[prop.name] = { ...prop };
});

return Klass;
Expand Down
3 changes: 1 addition & 2 deletions packages/rawmodel-core/src/core/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -52,9 +52,8 @@ export interface PropConfig {
/**
* Model property class configuration object.
*/
export interface PropDefinition {
export interface PropDefinition extends PropConfig {
name: string;
prop?: PropConfig;
}

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,16 +15,14 @@ spec.test('generates model with properties', (ctx) => {
},
{
name: 'book',
prop: {
parse: {
resolver: createModelClass([
{
name: 'title',
}
]),
},
}
}
parse: {
resolver: createModelClass([
{
name: 'title',
}
]),
},
},
]);
const data = {
name: 'foo',
Expand Down
6 changes: 6 additions & 0 deletions packages/rawmodel-handlers/CHANGELOG.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,12 @@
{
"name": "@rawmodel/handlers",
"entries": [
{
"version": "3.2.0",
"tag": "@rawmodel/handlers_v3.2.0",
"date": "Fri, 27 Sep 2019 23:06:25 GMT",
"comments": {}
},
{
"version": "3.1.0",
"tag": "@rawmodel/handlers_v3.1.0",
Expand Down
7 changes: 6 additions & 1 deletion packages/rawmodel-handlers/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,11 @@
# Change Log - @rawmodel/handlers

This log was last generated on Fri, 27 Sep 2019 22:48:59 GMT and should not be manually modified.
This log was last generated on Fri, 27 Sep 2019 23:06:25 GMT and should not be manually modified.

## 3.2.0
Fri, 27 Sep 2019 23:06:25 GMT

*Version update only*

## 3.1.0
Fri, 27 Sep 2019 22:48:59 GMT
Expand Down
2 changes: 1 addition & 1 deletion packages/rawmodel-handlers/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@rawmodel/handlers",
"version": "3.1.0",
"version": "3.2.0",
"description": "General property error handlers for RawModel.",
"main": "./dist/index.js",
"types": "./dist/index.d.ts",
Expand Down
6 changes: 6 additions & 0 deletions packages/rawmodel-parsers/CHANGELOG.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,12 @@
{
"name": "@rawmodel/parsers",
"entries": [
{
"version": "3.2.0",
"tag": "@rawmodel/parsers_v3.2.0",
"date": "Fri, 27 Sep 2019 23:06:25 GMT",
"comments": {}
},
{
"version": "3.1.0",
"tag": "@rawmodel/parsers_v3.1.0",
Expand Down
7 changes: 6 additions & 1 deletion packages/rawmodel-parsers/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,11 @@
# Change Log - @rawmodel/parsers

This log was last generated on Fri, 27 Sep 2019 22:48:59 GMT and should not be manually modified.
This log was last generated on Fri, 27 Sep 2019 23:06:25 GMT and should not be manually modified.

## 3.2.0
Fri, 27 Sep 2019 23:06:25 GMT

*Version update only*

## 3.1.0
Fri, 27 Sep 2019 22:48:59 GMT
Expand Down
4 changes: 2 additions & 2 deletions packages/rawmodel-parsers/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@rawmodel/parsers",
"version": "3.1.0",
"version": "3.2.0",
"description": "General data parsers for RawModel.",
"main": "./dist/index.js",
"types": "./dist/index.d.ts",
Expand Down Expand Up @@ -91,6 +91,6 @@
"typescript": "^3.5.3"
},
"dependencies": {
"@rawmodel/utils": "3.1.0"
"@rawmodel/utils": "3.2.0"
}
}
6 changes: 6 additions & 0 deletions packages/rawmodel-schema/CHANGELOG.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,12 @@
{
"name": "@rawmodel/schema",
"entries": [
{
"version": "3.2.0",
"tag": "@rawmodel/schema_v3.2.0",
"date": "Fri, 27 Sep 2019 23:06:25 GMT",
"comments": {}
},
{
"version": "3.1.0",
"tag": "@rawmodel/schema_v3.1.0",
Expand Down
7 changes: 6 additions & 1 deletion packages/rawmodel-schema/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,11 @@
# Change Log - @rawmodel/schema

This log was last generated on Fri, 27 Sep 2019 22:48:59 GMT and should not be manually modified.
This log was last generated on Fri, 27 Sep 2019 23:06:25 GMT and should not be manually modified.

## 3.2.0
Fri, 27 Sep 2019 23:06:25 GMT

*Version update only*

## 3.1.0
Fri, 27 Sep 2019 22:48:59 GMT
Expand Down
12 changes: 6 additions & 6 deletions packages/rawmodel-schema/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@rawmodel/schema",
"version": "3.1.0",
"version": "3.2.0",
"description": "JSON Schema utils for RawModel.",
"main": "./dist/index.js",
"types": "./dist/index.d.ts",
Expand Down Expand Up @@ -84,16 +84,16 @@
"devDependencies": {
"@hayspec/cli": "^0.8.4",
"@hayspec/spec": "^0.8.4",
"@rawmodel/handlers": "3.1.0",
"@rawmodel/parsers": "3.1.0",
"@rawmodel/validators": "3.1.0",
"@rawmodel/handlers": "3.2.0",
"@rawmodel/parsers": "3.2.0",
"@rawmodel/validators": "3.2.0",
"nyc": "^14.1.1",
"ts-node": "^8.3.0",
"tslint": "^5.18.0",
"typescript": "^3.5.3"
},
"dependencies": {
"@rawmodel/core": "3.1.0",
"@rawmodel/utils": "3.1.0"
"@rawmodel/core": "3.2.0",
"@rawmodel/utils": "3.2.0"
}
}
4 changes: 2 additions & 2 deletions packages/rawmodel-schema/src/core/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,13 +13,13 @@ export interface SchemaRecipe {
parsers?: { [name: string]: (o?: any) => ParserResolver };
validators?: { [name: string]: (o?: any) => ValidatorResolver };
handlers?: { [name: string]: (o?: any) => HandlerResolver };
props?: PropRecipe[];
props?: PropDefinition[];
}

/**
* Schema property recipe.
*/
export interface PropRecipe {
export interface PropDefinition {
name: string;
set?: string;
get?: string;
Expand Down
6 changes: 6 additions & 0 deletions packages/rawmodel-utils/CHANGELOG.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,12 @@
{
"name": "@rawmodel/utils",
"entries": [
{
"version": "3.2.0",
"tag": "@rawmodel/utils_v3.2.0",
"date": "Fri, 27 Sep 2019 23:06:25 GMT",
"comments": {}
},
{
"version": "3.1.0",
"tag": "@rawmodel/utils_v3.1.0",
Expand Down
7 changes: 6 additions & 1 deletion packages/rawmodel-utils/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,11 @@
# Change Log - @rawmodel/utils

This log was last generated on Fri, 27 Sep 2019 22:48:59 GMT and should not be manually modified.
This log was last generated on Fri, 27 Sep 2019 23:06:25 GMT and should not be manually modified.

## 3.2.0
Fri, 27 Sep 2019 23:06:25 GMT

*Version update only*

## 3.1.0
Fri, 27 Sep 2019 22:48:59 GMT
Expand Down
2 changes: 1 addition & 1 deletion packages/rawmodel-utils/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@rawmodel/utils",
"version": "3.1.0",
"version": "3.2.0",
"description": "Shared helpers for RawModel.",
"main": "./dist/index.js",
"types": "./dist/index.d.ts",
Expand Down
6 changes: 6 additions & 0 deletions packages/rawmodel-validators/CHANGELOG.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,12 @@
{
"name": "@rawmodel/validators",
"entries": [
{
"version": "3.2.0",
"tag": "@rawmodel/validators_v3.2.0",
"date": "Fri, 27 Sep 2019 23:06:25 GMT",
"comments": {}
},
{
"version": "3.1.0",
"tag": "@rawmodel/validators_v3.1.0",
Expand Down
7 changes: 6 additions & 1 deletion packages/rawmodel-validators/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,11 @@
# Change Log - @rawmodel/validators

This log was last generated on Fri, 27 Sep 2019 22:48:59 GMT and should not be manually modified.
This log was last generated on Fri, 27 Sep 2019 23:06:25 GMT and should not be manually modified.

## 3.2.0
Fri, 27 Sep 2019 23:06:25 GMT

*Version update only*

## 3.1.0
Fri, 27 Sep 2019 22:48:59 GMT
Expand Down
4 changes: 2 additions & 2 deletions packages/rawmodel-validators/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@rawmodel/validators",
"version": "3.1.0",
"version": "3.2.0",
"description": "General validators for RawModel.",
"main": "./dist/index.js",
"types": "./dist/index.d.ts",
Expand Down Expand Up @@ -91,6 +91,6 @@
"typescript": "^3.5.3"
},
"dependencies": {
"@rawmodel/utils": "3.1.0"
"@rawmodel/utils": "3.2.0"
}
}

0 comments on commit 270ba24

Please sign in to comment.