Skip to content

Commit

Permalink
feat: initial commit
Browse files Browse the repository at this point in the history
  • Loading branch information
shanejonas committed Jul 2, 2019
1 parent 7a46c4a commit 2cf2f38
Show file tree
Hide file tree
Showing 10 changed files with 11,525 additions and 2,910 deletions.
4 changes: 1 addition & 3 deletions .releaserc
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,9 @@
"@semantic-release/changelog",
"@semantic-release/github",
"@semantic-release/git",
"@semantic-release/npm"
],
"verifyConditions": [
"@semantic-release/changelog",
"@semantic-release/npm",
"@semantic-release/git",
"@semantic-release/github",
"@qiwi/semantic-release-gh-pages-plugin"
Expand All @@ -21,7 +19,7 @@
{
"path": "@qiwi/semantic-release-gh-pages-plugin",
"msg": "github pages release",
"src": "docs/",
"src": "build/",
"branch": "gh-pages"
},
"@semantic-release/npm"
Expand Down
14,328 changes: 11,443 additions & 2,885 deletions package-lock.json

Large diffs are not rendered by default.

29 changes: 24 additions & 5 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,20 +1,39 @@
{
"name": "@etclabscore/pristine-typescript",
"version": "1.0.0",
"name": "@etclabscore/pristine-typescript-react",
"version": "0.0.0-development",
"description": "",
"main": "build/index.js",
"scripts": {
"build": "tsc",
"start": "react-scripts start",
"build": "react-scripts build",
"lint": "tslint --fix -p .",
"test": "npm run lint && jest --coverage"
"test": "npm run lint && react-scripts test --coverage"
},
"author": "",
"license": "Apache-2.0",
"devDependencies": {
"@types/jest": "^24.0.13",
"jest": "^24.8.0",
"@types/react-dom": "^16.8.4",
"jest": "24.7.1",
"react-scripts": "^3.0.1",
"ts-jest": "^24.0.2",
"tslint": "^5.17.0",
"typescript": "^3.5.1"
},
"browserslist": {
"production": [
">0.2%",
"not dead",
"not op_mini all"
],
"development": [
"last 1 chrome version",
"last 1 firefox version",
"last 1 safari version"
]
},
"dependencies": {
"react": "^16.8.6",
"react-dom": "^16.8.6"
}
}
7 changes: 7 additions & 0 deletions public/index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
<html>

<body>
<div id="root"></div>
</body>

</html>
29 changes: 29 additions & 0 deletions src/containers/MyApp.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
import React, { useState } from "react";

interface IProps {
greeting: string;
}

function useCounter(defaultValue: number) {
const [counter, setCounter] = useState(defaultValue);

const incrementCounter = () => {
setCounter(counter + 1);
};

return [counter, incrementCounter];
}

const MyApp = (props: IProps) => {
const [counter, incrementCounter] = useCounter(0);
return (
<div>
<div>
{props.greeting}
<button onClick={incrementCounter as any}>Counter = {counter}</button>
</div>
</div>
);
};

export default MyApp;
7 changes: 0 additions & 7 deletions src/index.test.ts

This file was deleted.

6 changes: 0 additions & 6 deletions src/index.ts

This file was deleted.

5 changes: 5 additions & 0 deletions src/index.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
import ReactDOM from "react-dom";
import React from "react";
import MyApp from "./containers/MyApp";

ReactDOM.render(<MyApp greeting="foo" />, document.getElementById("root"));
1 change: 1 addition & 0 deletions src/react-app-env.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
/// <reference types="react-scripts" />
19 changes: 15 additions & 4 deletions tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,14 +1,25 @@
{
"compilerOptions": {
"target": "es5",
"module": "commonjs",
"module": "esnext",
"lib": [
"es2015",
"dom"
],
"declaration": true,
"outDir": "./build",
"strict": true,
"esModuleInterop": true
}
"esModuleInterop": true,
"skipLibCheck": true,
"allowSyntheticDefaultImports": true,
"forceConsistentCasingInFileNames": true,
"moduleResolution": "node",
"resolveJsonModule": true,
"isolatedModules": true,
"noEmit": true,
"jsx": "preserve",
"allowJs": true
},
"include": [
"src"
]
}

0 comments on commit 2cf2f38

Please sign in to comment.