Skip to content

Commit de17a50

Browse files
committed
Copy-paste root tsconfig.json because of StackBlitz
- Switch from CodeSandbox to StackBlitz - Various small fixes
1 parent 4b9ad3f commit de17a50

File tree

26 files changed

+311
-65
lines changed

26 files changed

+311
-65
lines changed

README.md

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -78,16 +78,17 @@ Resources:
7878

7979
## Examples
8080

81-
- CodePen basic Password example: https://codepen.io/tkrotoff/pen/BRGdqL ([CodeSandbox version](https://codesandbox.io/s/github/tkrotoff/react-form-with-constraints/tree/master/examples/Password))
81+
- CodePen basic Password example: https://codepen.io/tkrotoff/pen/BRGdqL ([StackBlitz version](https://stackblitz.com/github/tkrotoff/react-form-with-constraints/tree/master/examples/Password))
8282

8383
![example-password](doc/example-password.png)
8484

85-
- [Bootstrap example (React hooks)](https://codesandbox.io/s/github/tkrotoff/react-form-with-constraints/tree/master/examples/Bootstrap)
86-
- [Material-UI example (React hooks)](https://codesandbox.io/s/github/tkrotoff/react-form-with-constraints/tree/master/examples/MaterialUI)
87-
- [WizardForm example (React hooks)](https://codesandbox.io/s/github/tkrotoff/react-form-with-constraints/tree/master/examples/WizardForm)
88-
- [SignUp example (React classes)](https://codesandbox.io/s/github/tkrotoff/react-form-with-constraints/tree/master/examples/SignUp)
89-
- [ClubMembers example (React classes + MobX)](https://codesandbox.io/s/github/tkrotoff/react-form-with-constraints/tree/master/examples/ClubMembers)
90-
- [Password without state example (React hooks)](https://codesandbox.io/s/github/tkrotoff/react-form-with-constraints/tree/master/examples/PasswordWithoutState)
85+
- [Bootstrap example (React hooks)](https://stackblitz.com/github/tkrotoff/react-form-with-constraints/tree/master/examples/Bootstrap)
86+
- [Material-UI example (React hooks)](https://stackblitz.com/github/tkrotoff/react-form-with-constraints/tree/master/examples/MaterialUI)
87+
- [WizardForm example (React hooks)](https://stackblitz.com/github/tkrotoff/react-form-with-constraints/tree/master/examples/WizardForm)
88+
- [SignUp example (React classes)](https://stackblitz.com/github/tkrotoff/react-form-with-constraints/tree/master/examples/SignUp)
89+
- [ClubMembers example (React classes + MobX)](https://stackblitz.com/github/tkrotoff/react-form-with-constraints/tree/master/examples/ClubMembers)
90+
- [Password without state example (React hooks)](https://stackblitz.com/github/tkrotoff/react-form-with-constraints/tree/master/examples/PasswordWithoutState)
91+
- [Server-side rendering example (React hooks)](https://stackblitz.com/github/tkrotoff/react-form-with-constraints/tree/master/examples/ServerSideRendering)
9192

9293
- [React Native example (React classes)](examples/ReactNative):
9394

@@ -96,9 +97,8 @@ Resources:
9697
| ![react-native-example-ios](doc/react-native-ios.png) | ![react-native-example-android](doc/react-native-android.png) |
9798

9899
- Other examples from [the examples directory](examples):
99-
- [Plain old React form validation example (React hooks)](https://codesandbox.io/s/github/tkrotoff/react-form-with-constraints/tree/master/examples/PlainOldReact)
100-
- [React with HTML5 constraint validation API example (React hooks)](https://codesandbox.io/s/github/tkrotoff/react-form-with-constraints/tree/master/examples/HTML5ConstraintValidationAPI)
101-
- [Server-side rendering example (React hooks)](examples/ServerSideRendering)
100+
- [Plain old React form validation example (React hooks)](https://stackblitz.com/github/tkrotoff/react-form-with-constraints/tree/master/examples/PlainOldReact)
101+
- [React with HTML5 constraint validation API example (React hooks)](https://stackblitz.com/github/tkrotoff/react-form-with-constraints/tree/master/examples/HTML5ConstraintValidationAPI)
102102

103103
## How it works
104104

examples/ClubMembers/package.json

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313
"scripts": {
1414
"clean": "rm -rf build",
1515
"tsc": "tsc",
16+
"start": "webpack serve --mode=development --host 0.0.0.0",
1617
"build": "webpack --mode=development",
1718
"build:watch": "webpack --mode=development --watch"
1819
},
@@ -38,6 +39,7 @@
3839
"ts-node": "^10.9.1",
3940
"typescript": "^4.7.4",
4041
"webpack": "^5.73.0",
41-
"webpack-cli": "^4.10.0"
42+
"webpack-cli": "^4.10.0",
43+
"webpack-dev-server": "^4.9.3"
4244
}
4345
}

examples/ClubMembers/tsconfig.json

Lines changed: 24 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,29 @@
11
{
2-
"extends": "../../tsconfig",
32
"compilerOptions": {
3+
"noEmit": true,
4+
5+
// Nullish coalescing operator (??) needs to be transpiled by TypeScript to support Node.js 12
6+
// https://stackoverflow.com/a/59787575
7+
"target": "es2019",
8+
49
"module": "commonjs",
5-
"experimentalDecorators": true
10+
"moduleResolution": "node",
11+
"jsx": "preserve",
12+
"esModuleInterop": false,
13+
"resolveJsonModule": true,
14+
"isolatedModules": true,
15+
"experimentalDecorators": true,
16+
17+
"strict": true,
18+
"noUnusedLocals": true,
19+
"noUnusedParameters": true,
20+
"noImplicitReturns": true,
21+
"noFallthroughCasesInSwitch": true,
22+
"forceConsistentCasingInFileNames": true,
23+
24+
// FIXME
25+
// [error TS2300: Duplicate identifier 'require'](https://github.com/tkrotoff/react-form-with-constraints/issues/12)
26+
// [@types/react-native definitions for `global` and `require` conflict with @types/node](https://github.com/DefinitelyTyped/DefinitelyTyped/issues/16825)
27+
"skipLibCheck": true
628
}
729
}

examples/HTML5ConstraintValidationAPI/package.json

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@
1515
"scripts": {
1616
"clean": "rm -rf build",
1717
"tsc": "tsc",
18+
"start": "webpack serve --mode=development --host 0.0.0.0",
1819
"build": "webpack --mode=development",
1920
"build:watch": "webpack --mode=development --watch"
2021
},
@@ -34,6 +35,7 @@
3435
"ts-node": "^10.9.1",
3536
"typescript": "^4.7.4",
3637
"webpack": "^5.73.0",
37-
"webpack-cli": "^4.10.0"
38+
"webpack-cli": "^4.10.0",
39+
"webpack-dev-server": "^4.9.3"
3840
}
3941
}

examples/HTML5ConstraintValidationAPI/style.css

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
/*
22
Copy-pasted from PlainOldReact/style.css
3-
Cannot use a symlink nor "import '../PlainOldReact/style.css'" because of CodeSandbox
3+
Cannot use a symlink nor "import '../PlainOldReact/style.css'" because of StackBlitz
44
*/
55

66
body {
Lines changed: 24 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,28 @@
11
{
2-
"extends": "../../tsconfig",
32
"compilerOptions": {
4-
"module": "commonjs"
3+
"noEmit": true,
4+
5+
// Nullish coalescing operator (??) needs to be transpiled by TypeScript to support Node.js 12
6+
// https://stackoverflow.com/a/59787575
7+
"target": "es2019",
8+
9+
"module": "commonjs",
10+
"moduleResolution": "node",
11+
"jsx": "preserve",
12+
"esModuleInterop": false,
13+
"resolveJsonModule": true,
14+
"isolatedModules": true,
15+
16+
"strict": true,
17+
"noUnusedLocals": true,
18+
"noUnusedParameters": true,
19+
"noImplicitReturns": true,
20+
"noFallthroughCasesInSwitch": true,
21+
"forceConsistentCasingInFileNames": true,
22+
23+
// FIXME
24+
// [error TS2300: Duplicate identifier 'require'](https://github.com/tkrotoff/react-form-with-constraints/issues/12)
25+
// [@types/react-native definitions for `global` and `require` conflict with @types/node](https://github.com/DefinitelyTyped/DefinitelyTyped/issues/16825)
26+
"skipLibCheck": true
527
}
628
}

examples/MaterialUI/package.json

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@
1515
"scripts": {
1616
"clean": "rm -rf build",
1717
"tsc": "tsc",
18+
"start": "webpack serve --mode=development --host 0.0.0.0",
1819
"build": "webpack --mode=development",
1920
"build:prod": "webpack --mode=production",
2021
"build:watch": "webpack --mode=development --watch"
@@ -39,6 +40,7 @@
3940
"ts-node": "^10.9.1",
4041
"typescript": "^4.7.4",
4142
"webpack": "^5.73.0",
42-
"webpack-cli": "^4.10.0"
43+
"webpack-cli": "^4.10.0",
44+
"webpack-dev-server": "^4.9.3"
4345
}
4446
}

examples/MaterialUI/tsconfig.json

Lines changed: 24 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,28 @@
11
{
2-
"extends": "../../tsconfig",
32
"compilerOptions": {
4-
"module": "commonjs"
3+
"noEmit": true,
4+
5+
// Nullish coalescing operator (??) needs to be transpiled by TypeScript to support Node.js 12
6+
// https://stackoverflow.com/a/59787575
7+
"target": "es2019",
8+
9+
"module": "commonjs",
10+
"moduleResolution": "node",
11+
"jsx": "preserve",
12+
"esModuleInterop": false,
13+
"resolveJsonModule": true,
14+
"isolatedModules": true,
15+
16+
"strict": true,
17+
"noUnusedLocals": true,
18+
"noUnusedParameters": true,
19+
"noImplicitReturns": true,
20+
"noFallthroughCasesInSwitch": true,
21+
"forceConsistentCasingInFileNames": true,
22+
23+
// FIXME
24+
// [error TS2300: Duplicate identifier 'require'](https://github.com/tkrotoff/react-form-with-constraints/issues/12)
25+
// [@types/react-native definitions for `global` and `require` conflict with @types/node](https://github.com/DefinitelyTyped/DefinitelyTyped/issues/16825)
26+
"skipLibCheck": true
527
}
628
}

examples/Password/package.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,7 @@
4040
"ts-node": "^10.9.1",
4141
"typescript": "^4.7.4",
4242
"webpack": "^5.73.0",
43-
"webpack-cli": "^4.10.0"
43+
"webpack-cli": "^4.10.0",
44+
"webpack-dev-server": "^4.9.3"
4445
}
4546
}

examples/Password/tsconfig.json

Lines changed: 24 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,28 @@
11
{
2-
"extends": "../../tsconfig",
32
"compilerOptions": {
4-
"module": "commonjs"
3+
"noEmit": true,
4+
5+
// Nullish coalescing operator (??) needs to be transpiled by TypeScript to support Node.js 12
6+
// https://stackoverflow.com/a/59787575
7+
"target": "es2019",
8+
9+
"module": "commonjs",
10+
"moduleResolution": "node",
11+
"jsx": "preserve",
12+
"esModuleInterop": false,
13+
"resolveJsonModule": true,
14+
"isolatedModules": true,
15+
16+
"strict": true,
17+
"noUnusedLocals": true,
18+
"noUnusedParameters": true,
19+
"noImplicitReturns": true,
20+
"noFallthroughCasesInSwitch": true,
21+
"forceConsistentCasingInFileNames": true,
22+
23+
// FIXME
24+
// [error TS2300: Duplicate identifier 'require'](https://github.com/tkrotoff/react-form-with-constraints/issues/12)
25+
// [@types/react-native definitions for `global` and `require` conflict with @types/node](https://github.com/DefinitelyTyped/DefinitelyTyped/issues/16825)
26+
"skipLibCheck": true
527
}
628
}

examples/PasswordWithoutState/package.json

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313
"scripts": {
1414
"clean": "rm -rf build",
1515
"tsc": "tsc",
16+
"start": "webpack serve --mode=development --host 0.0.0.0",
1617
"build": "webpack --mode=development",
1718
"build:watch": "webpack --mode=development --watch"
1819
},
@@ -33,6 +34,7 @@
3334
"ts-node": "^10.9.1",
3435
"typescript": "^4.7.4",
3536
"webpack": "^5.73.0",
36-
"webpack-cli": "^4.10.0"
37+
"webpack-cli": "^4.10.0",
38+
"webpack-dev-server": "^4.9.3"
3739
}
3840
}

examples/PasswordWithoutState/style.css

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
/*
22
Copy-pasted from Password/style.css
3-
Cannot use a symlink nor "import '../Password/style.css'" because of CodeSandbox
3+
Cannot use a symlink nor "import '../Password/style.css'" because of StackBlitz
44
*/
55

66
body {
Lines changed: 24 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,28 @@
11
{
2-
"extends": "../../tsconfig",
32
"compilerOptions": {
4-
"module": "commonjs"
3+
"noEmit": true,
4+
5+
// Nullish coalescing operator (??) needs to be transpiled by TypeScript to support Node.js 12
6+
// https://stackoverflow.com/a/59787575
7+
"target": "es2019",
8+
9+
"module": "commonjs",
10+
"moduleResolution": "node",
11+
"jsx": "preserve",
12+
"esModuleInterop": false,
13+
"resolveJsonModule": true,
14+
"isolatedModules": true,
15+
16+
"strict": true,
17+
"noUnusedLocals": true,
18+
"noUnusedParameters": true,
19+
"noImplicitReturns": true,
20+
"noFallthroughCasesInSwitch": true,
21+
"forceConsistentCasingInFileNames": true,
22+
23+
// FIXME
24+
// [error TS2300: Duplicate identifier 'require'](https://github.com/tkrotoff/react-form-with-constraints/issues/12)
25+
// [@types/react-native definitions for `global` and `require` conflict with @types/node](https://github.com/DefinitelyTyped/DefinitelyTyped/issues/16825)
26+
"skipLibCheck": true
527
}
628
}

examples/PlainOldReact/package.json

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212
"scripts": {
1313
"clean": "rm -rf build",
1414
"tsc": "tsc",
15+
"start": "webpack serve --mode=development --host 0.0.0.0",
1516
"build": "webpack --mode=development",
1617
"build:watch": "webpack --mode=development --watch"
1718
},
@@ -31,6 +32,7 @@
3132
"ts-node": "^10.9.1",
3233
"typescript": "^4.7.4",
3334
"webpack": "^5.73.0",
34-
"webpack-cli": "^4.10.0"
35+
"webpack-cli": "^4.10.0",
36+
"webpack-dev-server": "^4.9.3"
3537
}
3638
}

examples/PlainOldReact/tsconfig.json

Lines changed: 24 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,28 @@
11
{
2-
"extends": "../../tsconfig",
32
"compilerOptions": {
4-
"module": "commonjs"
3+
"noEmit": true,
4+
5+
// Nullish coalescing operator (??) needs to be transpiled by TypeScript to support Node.js 12
6+
// https://stackoverflow.com/a/59787575
7+
"target": "es2019",
8+
9+
"module": "commonjs",
10+
"moduleResolution": "node",
11+
"jsx": "preserve",
12+
"esModuleInterop": false,
13+
"resolveJsonModule": true,
14+
"isolatedModules": true,
15+
16+
"strict": true,
17+
"noUnusedLocals": true,
18+
"noUnusedParameters": true,
19+
"noImplicitReturns": true,
20+
"noFallthroughCasesInSwitch": true,
21+
"forceConsistentCasingInFileNames": true,
22+
23+
// FIXME
24+
// [error TS2300: Duplicate identifier 'require'](https://github.com/tkrotoff/react-form-with-constraints/issues/12)
25+
// [@types/react-native definitions for `global` and `require` conflict with @types/node](https://github.com/DefinitelyTyped/DefinitelyTyped/issues/16825)
26+
"skipLibCheck": true
527
}
628
}

examples/ReactNative/tsconfig.json

Lines changed: 21 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,26 @@
11
{
2-
"extends": "../../tsconfig",
32
"compilerOptions": {
3+
"noEmit": true,
4+
45
"target": "es2015",
5-
"jsx": "react-native"
6+
7+
"module": "commonjs",
8+
"moduleResolution": "node",
9+
"jsx": "react-native",
10+
"esModuleInterop": false,
11+
"resolveJsonModule": true,
12+
"isolatedModules": true,
13+
14+
"strict": true,
15+
"noUnusedLocals": true,
16+
"noUnusedParameters": true,
17+
"noImplicitReturns": true,
18+
"noFallthroughCasesInSwitch": true,
19+
"forceConsistentCasingInFileNames": true,
20+
21+
// FIXME
22+
// [error TS2300: Duplicate identifier 'require'](https://github.com/tkrotoff/react-form-with-constraints/issues/12)
23+
// [@types/react-native definitions for `global` and `require` conflict with @types/node](https://github.com/DefinitelyTyped/DefinitelyTyped/issues/16825)
24+
"skipLibCheck": true
625
}
726
}
Lines changed: 24 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,28 @@
11
{
2-
"extends": "../../tsconfig",
32
"compilerOptions": {
4-
"module": "commonjs"
3+
"noEmit": true,
4+
5+
// Nullish coalescing operator (??) needs to be transpiled by TypeScript to support Node.js 12
6+
// https://stackoverflow.com/a/59787575
7+
"target": "es2019",
8+
9+
"module": "commonjs",
10+
"moduleResolution": "node",
11+
"jsx": "preserve",
12+
"esModuleInterop": false,
13+
"resolveJsonModule": true,
14+
"isolatedModules": true,
15+
16+
"strict": true,
17+
"noUnusedLocals": true,
18+
"noUnusedParameters": true,
19+
"noImplicitReturns": true,
20+
"noFallthroughCasesInSwitch": true,
21+
"forceConsistentCasingInFileNames": true,
22+
23+
// FIXME
24+
// [error TS2300: Duplicate identifier 'require'](https://github.com/tkrotoff/react-form-with-constraints/issues/12)
25+
// [@types/react-native definitions for `global` and `require` conflict with @types/node](https://github.com/DefinitelyTyped/DefinitelyTyped/issues/16825)
26+
"skipLibCheck": true
527
}
628
}

0 commit comments

Comments
 (0)