Skip to content

Commit 1c0fced

Browse files
author
Martynas Žilinskas
authored
Updated simplr-validation package structure with building (#42)
1 parent f3a397a commit 1c0fced

32 files changed

+281
-85
lines changed

packages/simplr-validation/.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
11
dist
22
@types
33
coverage
4+
*.js
5+
**/*.d.ts

packages/simplr-validation/__tests__/subscribers/form-store-subscriber.test.tsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,13 +6,13 @@ import {
66
FieldStateProps,
77
FormStateProps,
88
FieldValidationType
9-
} from "simplr-forms-core/contracts";
10-
import { FormStore } from "simplr-forms-core/stores";
9+
} from "simplr-forms/contracts";
10+
import { FormStore } from "simplr-forms/stores";
1111
import {
1212
FieldRegistered,
1313
FieldPropsChanged,
1414
ValueChanged,
15-
} from "simplr-forms-core/actions";
15+
} from "simplr-forms/actions";
1616

1717
import { BaseFormValidator, BaseFormValidatorProps } from "../../src/abstractions/base-form-validator";
1818
import { ValidationResult } from "../../src/contracts";

packages/simplr-validation/__tests__/subscribers/form-stores-handler-subscriber.test.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
import { FSHContainer, FormStoresHandler } from "simplr-forms-core/stores";
2-
import { FormRegistered, FormUnregistered } from "simplr-forms-core/actions";
1+
import { FSHContainer, FormStoresHandler } from "simplr-forms/stores";
2+
import { FormRegistered, FormUnregistered } from "simplr-forms/actions";
33
import * as Sinon from "sinon";
44

55
import { FormStoresHandlerSubscriber } from "../../src/subscribers/form-stores-handler-subscriber";

packages/simplr-validation/package.json

Lines changed: 12 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -15,20 +15,27 @@
1515
"watch": "webpack -w",
1616
"release": "npm run build && npm run uglifyjs",
1717
"tslint": "tslint --config ./tslint.json --project . --exclude __tests__/**/* && echo TsLint test successfully passed.",
18-
"uglifyjs": "uglifyjs ./dist/simplr-forms-core.js -o ./dist/simplr-forms-core.min.js --compress --mangle"
18+
"uglifyjs": "echo \"Uglify is not implemented\" && exit 1",
19+
"gulp-build": "tsc -p ./tools/tsconfig.gulp.json",
20+
"gulp-watch": "npm run gulp-build -- -w"
1921
},
2022
"license": "AGPL-3.0",
2123
"files": [
22-
"dist",
23-
"@types",
2424
"**/*.md",
2525
"*.js",
26-
"!*.config.js"
26+
"**/*.d.ts",
27+
"!*.config.js",
28+
"!gulpfile.js",
29+
"!node_modules/**"
2730
],
2831
"devDependencies": {
32+
"@types/gulp": "^4.0.2",
33+
"@types/webpack": "^2.2.15",
2934
"@types/enzyme": "^2.7.7",
3035
"@types/jest": "^19.2.2",
3136
"@types/sinon": "^2.1.2",
37+
"gulp": "github:gulpjs/gulp#4.0",
38+
"simplr-mvdir": "0.0.1-beta.7",
3239
"enzyme": "^2.8.2",
3340
"jest": "^19.0.2",
3441
"jest-enzyme": "^3.0.1",
@@ -49,7 +56,7 @@
4956
"action-emitter": "^0.2.1",
5057
"immutable": "^3.8.1",
5158
"react": "^15.5.4",
52-
"simplr-forms-core": "4.0.0-pre-alpha.18",
59+
"simplr-forms": "4.0.0-pre-alpha.20",
5360
"validator": "^7.0.0"
5461
},
5562
"jest": {
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
export * from "./abstractions";

packages/simplr-validation/src/abstractions/base-validator.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import * as React from "react";
2-
import { FieldValue } from "simplr-forms-core/contracts";
2+
import { FieldValue } from "simplr-forms/contracts";
33

44
import { Validator, ValidationResult, ValidationError } from "../contracts";
55

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1 +1,3 @@
11
export * from "./base-field-validator";
2+
export * from "./base-form-validator";
3+
export * from "./base-validator";

packages/simplr-validation/src/contracts.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { FormError } from "simplr-forms-core/contracts";
1+
import { FormError } from "simplr-forms/contracts";
22

33
export interface Validator {
44
Validate(value: any): ValidationResult;
Lines changed: 1 addition & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1 @@
1-
import * as Abstractions from "./abstractions/index";
2-
import * as Contracts from "./contracts";
3-
import * as Validators from "./validators/index";
4-
import * as Subscribers from "./subscribers/index";
5-
6-
const { Subscriber } = Subscribers;
7-
8-
export {
9-
Abstractions,
10-
Contracts,
11-
Validators,
12-
Subscribers,
13-
Subscriber
14-
};
1+
export * from "./validators/index";
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
export * from "./subscribers/index";

0 commit comments

Comments
 (0)