Migrated from react-scripts-ts to react-scripts

This commit is contained in:
Przemek Wiech
2019-02-06 22:57:38 +01:00
parent aa78a3253d
commit f0addd57a9
8 changed files with 27 additions and 34 deletions

1
.gitignore vendored
View File

@@ -1,3 +1,4 @@
build build
node_modules node_modules
package-lock.json package-lock.json
src/react-app-env.d.ts

View File

@@ -29,14 +29,14 @@
"@types/react-router-dom": "^4.3.1", "@types/react-router-dom": "^4.3.1",
"gh-pages": "^2.0.1", "gh-pages": "^2.0.1",
"prettier": "^1.15.3", "prettier": "^1.15.3",
"react-scripts-ts": "^4.0.8", "react-scripts": "^2.1.3",
"tslint-config-prettier": "^1.17.0", "tslint-config-prettier": "^1.17.0",
"typescript": "latest" "typescript": "latest"
}, },
"scripts": { "scripts": {
"start": "react-scripts-ts start", "start": "react-scripts start",
"build": "react-scripts-ts build", "build": "react-scripts build",
"test": "react-scripts-ts test --env=jsdom", "test": "react-scripts test --env=jsdom",
"prettier": "prettier --write src/**/*.{ts,tsx,json}", "prettier": "prettier --write src/**/*.{ts,tsx,json}",
"predeploy": "npm run build", "predeploy": "npm run build",
"deploy": "gh-pages -d build" "deploy": "gh-pages -d build"

View File

@@ -20,7 +20,7 @@ function zoomed() {
/** Called when the scrollbars are used. */ /** Called when the scrollbars are used. */
function scrolled() { function scrolled() {
const svg = d3.select('#chart'); const svg = d3.select('#chart');
const parent = (svg.node() as HTMLElement).parentElement!; const parent = (svg.node() as HTMLElement).parentElement as Element;
const x = parent.scrollLeft + parent.clientWidth / 2; const x = parent.scrollLeft + parent.clientWidth / 2;
const y = parent.scrollTop + parent.clientHeight / 2; const y = parent.scrollTop + parent.clientHeight / 2;
d3.select(parent).call(d3.zoom().translateTo, x, y); d3.select(parent).call(d3.zoom().translateTo, x, y);
@@ -59,7 +59,7 @@ export class Chart extends React.PureComponent<ChartProps, {}> {
baseGeneration: this.props.selection.generation, baseGeneration: this.props.selection.generation,
}); });
const svg = d3.select('#chart'); const svg = d3.select('#chart');
const parent = (svg.node() as HTMLElement).parentElement!; const parent = (svg.node() as HTMLElement).parentElement as Element;
d3.select(parent) d3.select(parent)
.on('scroll', scrolled) .on('scroll', scrolled)

View File

@@ -1,7 +1,7 @@
import * as md5 from 'md5';
import * as queryString from 'query-string'; import * as queryString from 'query-string';
import * as React from 'react'; import * as React from 'react';
import axios from 'axios'; import axios from 'axios';
import md5 from 'md5';
import {Chart} from './chart'; import {Chart} from './chart';
import {convertGedcom} from './gedcom_util'; import {convertGedcom} from './gedcom_util';
import {IndiInfo, JsonGedcomData} from 'topola'; import {IndiInfo, JsonGedcomData} from 'topola';

View File

@@ -1,8 +1,8 @@
import * as locale_en from 'react-intl/locale-data/en'; import * as locale_en from 'react-intl/locale-data/en';
import * as locale_pl from 'react-intl/locale-data/pl'; import * as locale_pl from 'react-intl/locale-data/pl';
import * as messages_pl from './translations/pl.json';
import * as React from 'react'; import * as React from 'react';
import * as ReactDOM from 'react-dom'; import * as ReactDOM from 'react-dom';
import messages_pl from './translations/pl.json';
import {addLocaleData} from 'react-intl'; import {addLocaleData} from 'react-intl';
import {ChartView} from './chart_view'; import {ChartView} from './chart_view';
import {HashRouter as Router, Route, Switch} from 'react-router-dom'; import {HashRouter as Router, Route, Switch} from 'react-router-dom';

View File

@@ -1,6 +1,6 @@
import * as md5 from 'md5';
import * as queryString from 'query-string'; import * as queryString from 'query-string';
import * as React from 'react'; import * as React from 'react';
import md5 from 'md5';
import {FormattedMessage} from 'react-intl'; import {FormattedMessage} from 'react-intl';
import {Link} from 'react-router-dom'; import {Link} from 'react-router-dom';
import {RouteComponentProps} from 'react-router-dom'; import {RouteComponentProps} from 'react-router-dom';

View File

@@ -1,32 +1,25 @@
{ {
"compilerOptions": { "compilerOptions": {
"baseUrl": ".",
"outDir": "build/dist",
"module": "esnext",
"target": "es5", "target": "es5",
"lib": ["es6", "dom"], "lib": [
"sourceMap": true, "dom",
"esnext"
],
"allowJs": true, "allowJs": true,
"jsx": "react", "skipLibCheck": true,
"moduleResolution": "node", "esModuleInterop": true,
"rootDir": "src", "strict": true,
"types": [],
"forceConsistentCasingInFileNames": true, "forceConsistentCasingInFileNames": true,
"noImplicitReturns": true, "module": "esnext",
"noImplicitThis": true, "moduleResolution": "node",
"noImplicitAny": true, "resolveJsonModule": true,
"strictNullChecks": true, "isolatedModules": true,
"suppressImplicitAnyIndexErrors": true, "noEmit": true,
"noUnusedLocals": true, "jsx": "preserve",
"resolveJsonModule": true "allowSyntheticDefaultImports": true,
"suppressImplicitAnyIndexErrors": true
}, },
"exclude": [ "include": [
"node_modules", "src"
"build",
"scripts",
"acceptance-tests",
"webpack",
"jest",
"src/setupTests.ts"
] ]
} }

View File

@@ -1 +0,0 @@
{ "extends": "./tsconfig.json" }