Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[RFR] Bootstrap TypeScript migration #2426

Merged
merged 15 commits into from
Oct 17, 2018
Merged
56 changes: 0 additions & 56 deletions .babelrc

This file was deleted.

7 changes: 0 additions & 7 deletions .eslintignore

This file was deleted.

61 changes: 0 additions & 61 deletions .eslintrc

This file was deleted.

30 changes: 15 additions & 15 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -28,62 +28,62 @@ run-graphcool-demo: ## run the demo example

build-ra-core:
@echo "Transpiling ra-core files...";
@cd ./packages/ra-core && yarn -s build && yarn -s build-esm
@cd ./packages/ra-core && yarn -s build

build-ra-ui-materialui:
@echo "Transpiling ra-ui-materialui files...";
@cd ./packages/ra-ui-materialui && yarn -s build && yarn -s build-esm
@cd ./packages/ra-ui-materialui && yarn -s build

build-react-admin:
@echo "Transpiling react-admin files...";
@rm -rf ./packages/react-admin/docs
@cd ./packages/react-admin && yarn -s build && yarn -s build-esm
@cd ./packages/react-admin && yarn -s build
@mkdir packages/react-admin/docs
@cp docs/*.md packages/react-admin/docs

build-ra-data-fakerest:
@echo "Transpiling ra-data-fakerest files...";
@cd ./packages/ra-data-fakerest && yarn -s build && yarn -s build-esm
@cd ./packages/ra-data-fakerest && yarn -s build

build-ra-data-json-server:
@echo "Transpiling ra-data-json-server files...";
@cd ./packages/ra-data-json-server && yarn -s build && yarn -s build-esm
@cd ./packages/ra-data-json-server && yarn -s build

build-ra-data-simple-rest:
@echo "Transpiling ra-data-simple-rest files...";
@cd ./packages/ra-data-simple-rest && yarn -s build && yarn -s build-esm
@cd ./packages/ra-data-simple-rest && yarn -s build

build-ra-data-graphql:
@echo "Transpiling ra-data-graphql files...";
@cd ./packages/ra-data-graphql && yarn -s build && yarn -s build-esm
@cd ./packages/ra-data-graphql && yarn -s build

build-ra-data-graphcool:
@echo "Transpiling ra-data-graphcool files...";
@cd ./packages/ra-data-graphcool && yarn -s build && yarn -s build-esm
@cd ./packages/ra-data-graphcool && yarn -s build

build-ra-data-graphql-simple:
@echo "Transpiling ra-data-graphql-simple files...";
@cd ./packages/ra-data-graphql-simple && yarn -s build && yarn -s build-esm
@cd ./packages/ra-data-graphql-simple && yarn -s build

build-ra-input-rich-text:
@echo "Transpiling ra-input-rich-text files...";
@cd ./packages/ra-input-rich-text && yarn -s build && yarn -s build-esm
@cd ./packages/ra-input-rich-text && yarn -s build

build-ra-realtime:
@echo "Transpiling ra-realtime files...";
@cd ./packages/ra-realtime && yarn -s build && yarn -s build-esm
@cd ./packages/ra-realtime && yarn -s build

build-ra-tree-core:
@echo "Transpiling ra-tree-core files...";
@cd ./packages/ra-tree-core && yarn -s build && yarn -s build-esm
@cd ./packages/ra-tree-core && yarn -s build

build-ra-tree-ui-materialui:
@echo "Transpiling ra-tree-ui-materialui files...";
@cd ./packages/ra-tree-ui-materialui && yarn -s build && yarn -s build-esm
@cd ./packages/ra-tree-ui-materialui && yarn -s build

build-data-generator:
@echo "Transpiling data-generator files...";
@cd ./examples/data-generator && yarn -s build && yarn -s build-esm
@cd ./examples/data-generator && yarn -s build

build: build-ra-core build-ra-ui-materialui build-react-admin build-ra-data-fakerest build-ra-data-json-server build-ra-data-simple-rest build-ra-data-graphql build-ra-data-graphcool build-ra-data-graphql-simple build-ra-input-rich-text build-ra-realtime build-ra-tree-core build-ra-tree-ui-materialui build-data-generator ## compile ES6 files to JS

Expand All @@ -92,7 +92,7 @@ doc: ## compile doc as html and launch doc web server

lint: ## lint the code and check coding conventions
@echo "Running linter..."
@yarn -s lint
@yarn -s tslint 'packages/*/src/**/*.*s'

prettier: ## prettify the source code using prettier
@echo "Running prettier..."
Expand Down
9 changes: 4 additions & 5 deletions examples/data-generator/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,17 +4,16 @@
"private": true,
"main": "./lib/index.js",
"scripts": {
"build": "rimraf ./lib && cross-env NODE_ENV=production BABEL_ENV=cjs babel --quiet ./src -d ./lib --ignore spec.js,test.js",
"build-esm": "rimraf ./esm && cross-env NODE_ENV=production BABEL_ENV=esm babel --quiet ./src -d ./esm --ignore spec.js,test.js",
"watch": "rimraf ./lib && cross-env NODE_ENV=production babel --watch ./src -d ./lib --ignore spec.js,test.js"
"build": "yarn run build-cjs && yarn run build-esm",
"build-cjs": "rimraf ./lib && tsc",
"build-esm": "rimraf ./esm && tsc --outDir esm --module es2015",
"watch": "rimraf ./lib && tsc --watch"
},
"dependencies": {
"babel-core": "~6.26.0",
"date-fns": "~1.29.0",
"faker": "^4.1.0"
},
"devDependencies": {
"babel-cli": "~6.26.0",
"cross-env": "^5.2.0",
"rimraf": "^2.6.2"
}
Expand Down
9 changes: 9 additions & 0 deletions examples/data-generator/tsconfig.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
{
"extends": "../../tsconfig.json",
"compilerOptions": {
"outDir": "lib",
"rootDir": "src"
},
"exclude": ["**/*.spec.ts", "**/*.spec.tsx", "**/*.spec.js"],
"include": ["src"]
}
70 changes: 38 additions & 32 deletions examples/demo/package.json
Original file line number Diff line number Diff line change
@@ -1,34 +1,40 @@
{
"name": "demo",
"version": "0.1.0",
"private": true,
"dependencies": {
"@material-ui/core": "~1.4.0",
"@material-ui/icons": "~1.1.0",
"data-generator": "^2.1.4",
"fakerest": "~2.1.0",
"fetch-mock": "~6.3.0",
"json-graphql-server": "~2.1.1",
"ra-data-fakerest": "^2.0.0",
"ra-data-graphql-simple": "^2.0.0",
"ra-data-simple-rest": "~2.0.0",
"ra-input-rich-text": "^2.0.0",
"ra-language-english": "^2.0.0",
"ra-language-french": "^2.0.0",
"react": "~16.3.1",
"react-admin": "^2.0.0",
"react-dom": "~16.3.1",
"react-redux": "~5.0.7",
"react-router-dom": "~4.2.2",
"react-scripts": "1.1.4",
"recompose": "~0.26.0",
"redux-form": "~7.4.0",
"redux-saga": "~0.16.0"
},
"scripts": {
"start": "react-scripts start",
"build": "react-scripts build",
"eject": "react-scripts eject"
},
"homepage": "https://marmelab.com/react-admin-demo"
"name": "demo",
"version": "0.1.0",
"private": true,
"dependencies": {
"@material-ui/core": "~1.4.0",
"@material-ui/icons": "~1.1.0",
"data-generator": "^2.1.4",
"fakerest": "~2.1.0",
"fetch-mock": "~6.3.0",
"json-graphql-server": "~2.1.1",
"ra-data-fakerest": "^2.0.0",
"ra-data-graphql-simple": "^2.0.0",
"ra-data-simple-rest": "~2.0.0",
"ra-input-rich-text": "^2.0.0",
"ra-language-english": "^2.0.0",
"ra-language-french": "^2.0.0",
"react": "~16.3.1",
"react-admin": "^2.0.0",
"react-dom": "~16.3.1",
"react-redux": "~5.0.7",
"react-router-dom": "~4.2.2",
"react-scripts": "^2.0.5",
"recompose": "~0.26.0",
"redux-form": "~7.4.0",
"redux-saga": "~0.16.0"
},
"scripts": {
"start": "react-scripts start",
"build": "react-scripts build",
"eject": "react-scripts eject"
},
"homepage": "https://marmelab.com/react-admin-demo",
"browserslist": [
">0.2%",
"not dead",
"not ie <= 11",
"not op_mini all"
]
}
2 changes: 1 addition & 1 deletion examples/graphcool-demo/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
"react-dom": "~16.3.1",
"react-redux": "~5.0.7",
"react-router-dom": "~4.2.2",
"react-scripts": "1.1.4",
"react-scripts": "^2.0.5",
"recompose": "~0.26.0",
"redux-form": "~7.4.0",
"redux-saga": "~0.16.0"
Expand Down
10 changes: 0 additions & 10 deletions examples/simple/.babelrc

This file was deleted.

24 changes: 24 additions & 0 deletions examples/simple/babel.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
const presets = [
[
'@babel/env',
{
targets: {
edge: '17',
firefox: '60',
chrome: '67',
safari: '11.1',
},
useBuiltIns: 'usage',
},
],
'@babel/preset-react',
'@babel/preset-typescript',
];

const plugins = [
'@babel/plugin-proposal-class-properties',
'@babel/plugin-proposal-object-rest-spread',
'@babel/plugin-syntax-dynamic-import',
];

module.exports = { presets, plugins };
Loading