-
Notifications
You must be signed in to change notification settings - Fork 87
Setup TypeScript Environment #291
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
Merged
Merged
Changes from all commits
Commits
Show all changes
15 commits
Select commit
Hold shift + click to select a range
4de41c5
#290 npx babel-upgrade --write --install
zaki-yama e53a7d9
#290 Install typescript, @babel/preset-typescript
zaki-yama 6bc2578
#290 Add tsconfig.json
zaki-yama 9b33c34
#290 Add @babel/preset-typescript
zaki-yama c090e17
#290 Update jest version
zaki-yama 1ae79e2
#290 Use `@babel/polyfill` instead of `babel-polyfill
zaki-yama 7423463
#290 Update storybook packages
zaki-yama 961af37
#290 Enable to compile JS files with tsc
zaki-yama 82251d5
#290 Install babel-loader to run Storybook
zaki-yama f5c7527
#290 Replace `module.exports` with `export default`
zaki-yama ce8c5aa
#290 Update storyshots
zaki-yama 73d80f7
#290 Update babel-eslint to 10.0.1
zaki-yama 42b9b0d
#290 Temporarily disable eslint `no-undef` rule
zaki-yama ccbb6dd
#290 build using Babel
zaki-yama 40669c5
#290 Add TypeScript's type-check script
zaki-yama File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,13 @@ | ||
{ | ||
"presets": ["env", "react"], | ||
"plugins": [ | ||
"transform-object-rest-spread", | ||
"transform-runtime", | ||
"transform-class-properties" | ||
], | ||
"sourceMaps": "inline" | ||
"presets": [ | ||
"@babel/preset-env", | ||
"@babel/preset-react", | ||
"@babel/preset-typescript" | ||
], | ||
"plugins": [ | ||
"@babel/plugin-proposal-object-rest-spread", | ||
"@babel/plugin-transform-runtime", | ||
"@babel/plugin-proposal-class-properties" | ||
], | ||
"sourceMaps": "inline" | ||
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -21,15 +21,17 @@ | |
}, | ||
"scripts": { | ||
"storybook": "start-storybook -s ./node_modules/@salesforce-ux/design-system -p 9001 -c .storybook", | ||
"test": "npm-run-all test:jest test:storyshots", | ||
"test": "npm-run-all type-check test:jest test:storyshots", | ||
"test:storyshots": "NODE_ENV=test jest test/storyshots/*.test.js", | ||
"test:jest": "jest test/*-spec.js", | ||
"prepublish": "npm run build", | ||
"type-check": "tsc --noEmit", | ||
"type-check:watch": "npm run type-check -- --watch", | ||
"lint": "npm run lint:src && npm run lint:stories && npm run lint:test", | ||
"lint:src": "eslint --ext .js src/scripts/**", | ||
"lint:stories": "eslint --ext .js stories/**", | ||
"lint:test": "eslint --ext .js test/**", | ||
"build": "babel -d lib/ src/", | ||
"build": "babel -d lib/ src/ --extensions \".js,.ts,.tsx\"", | ||
"build:assets": "cp -r node_modules/@salesforce-ux/design-system/assets public", | ||
"build:storybook": "build-storybook -o public", | ||
"deploy": "npm-run-all build:storybook build:assets deploy:ghpage", | ||
|
@@ -41,7 +43,7 @@ | |
"author": "Shinichi Tomita <[email protected]>", | ||
"license": "MIT", | ||
"dependencies": { | ||
"babel-runtime": "^6.6.1", | ||
"@babel/runtime": "^7.0.0", | ||
"classnames": "^2.2.5", | ||
"keycoder": "^1.1.1", | ||
"moment": "^2.13.0", | ||
|
@@ -51,37 +53,41 @@ | |
"uuid": "^2.0.2" | ||
}, | ||
"devDependencies": { | ||
"@babel/cli": "^7.0.0", | ||
"@babel/core": "^7.0.0", | ||
"@babel/plugin-proposal-class-properties": "^7.0.0", | ||
"@babel/plugin-proposal-object-rest-spread": "^7.0.0", | ||
"@babel/plugin-transform-runtime": "^7.0.0", | ||
"@babel/polyfill": "^7.0.0", | ||
"@babel/preset-env": "^7.0.0", | ||
"@babel/preset-react": "^7.0.0", | ||
"@babel/preset-typescript": "^7.1.0", | ||
"@salesforce-ux/design-system": "^2.2.1", | ||
"@storybook/addon-actions": "^3.2.17", | ||
"@storybook/addon-info": "^3.2.17", | ||
"@storybook/addon-knobs": "3.2.17", | ||
"@storybook/addon-storyshots": "^3.2.17", | ||
"@storybook/react": "3.2.17", | ||
"babel-cli": "^6.18.0", | ||
"babel-core": "^6.18.0", | ||
"babel-eslint": "^7.0.0", | ||
"babel-jest": "^16.0.0", | ||
"@storybook/addon-actions": "^4.1.11", | ||
"@storybook/addon-info": "^4.1.11", | ||
"@storybook/addon-knobs": "4.1.11", | ||
"@storybook/addon-storyshots": "^4.1.11", | ||
"@storybook/react": "4.1.11", | ||
"babel-core": "^7.0.0-bridge.0", | ||
"babel-eslint": "^10.0.1", | ||
"babel-jest": "^23.4.2", | ||
"babel-loader": "^8.0.5", | ||
"babel-plugin-espower": "^2.1.2", | ||
"babel-plugin-transform-class-properties": "^6.19.0", | ||
"babel-plugin-transform-object-rest-spread": "^6.8.0", | ||
"babel-plugin-transform-runtime": "^6.8.0", | ||
"babel-polyfill": "^6.20.0", | ||
"babel-preset-env": "^1.6.1", | ||
"babel-preset-react": "^6.5.0", | ||
"enzyme": "^2.3.0", | ||
"eslint": "3.8.1", | ||
"eslint-config-airbnb": "12.0.0", | ||
"eslint-plugin-import": "1.16.0", | ||
"eslint-plugin-jsx-a11y": "2.2.3", | ||
"eslint-plugin-react": "6.4.1", | ||
"gh-pages": "^0.12.0", | ||
"jest": "^16.0.2", | ||
"jest": "^24.0.0", | ||
"npm-run-all": "^4.0.1", | ||
"power-assert": "^1.4.1", | ||
"react": "^15.3.0", | ||
"react-addons-test-utils": "^15.3.0", | ||
"react-dom": "^15.3.0", | ||
"react-test-renderer": "^15.6.2" | ||
"react-test-renderer": "^15.6.2", | ||
"typescript": "^3.2.4" | ||
}, | ||
"jest": { | ||
"testRegex": "(/test/.*|\\.(test|spec))\\.js$", | ||
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
module.exports = ` | ||
export default ` | ||
Online Seminar | ||
Event | ||
Survey | ||
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
module.exports = ` | ||
export default ` | ||
Apple Inc. | ||
Alphabet Inc. | ||
Microsoft Corporation | ||
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
module.exports = ` | ||
export default ` | ||
New License | ||
Professional Service | ||
Additional License | ||
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
module.exports = ` | ||
export default ` | ||
Account | ||
Campaign | ||
Case | ||
|
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@stomita
After updating
babel-eslint
,no-undef
errors occured.The result of `yarn run lint:src`
Most of the errors seemed to be at where using class property.
I haven't found out why, but I'd like to deal with it in the next PR, when I update all other eslint-related packages.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Are you using yarn to build ? It should also be updated the
yarn.lock
to stabilize the dependency.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sorry, it is not caused by the dependency updates, but the parser. It seems OK by disabling it.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sure. Thank you for checking.