-
Notifications
You must be signed in to change notification settings - Fork 33
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
feat!: typescript configuration and jest v29 upgrade #429
Changes from 123 commits
2fab543
12dfae5
8e64e9e
cd1e726
4b5d84a
200a8ac
177d154
2af8b42
0edf13f
9908041
602b7a0
357334c
1c81573
e298637
68457f1
0519c40
5500920
632a667
4a5d559
5e4f2c2
1dcd666
30887b1
70b01a5
fa974a3
0e20e2b
d7d790c
e05d46b
23954c4
a105af8
1980b75
8df0d32
6931415
37313b2
d3a4c0f
93a04eb
3a6db3f
b6169a8
b759a41
10c56c1
d52a18a
54c1f51
5e4658d
466e4a0
8e0f7e4
97d45e7
f37b842
d10c1c6
8a88f62
733ea4f
4241f47
0cb6885
6ca555f
488686d
8674978
05edd10
c07fa91
5b86133
69899aa
06eee29
ee71d3e
71ee361
cc50692
3299605
64fe89f
85b3c54
909fd27
b28e6bc
a5c307b
cd408cd
088793c
a49ad49
012c4ee
bbf58fe
2529a1e
589b78e
ca26dca
6245a84
536bff7
deacfed
3b8f66a
a0f24df
efed83d
b682f25
73ec49a
4f794d2
d67776d
c756d4d
709e3d1
8e7e068
7fbbe26
66d1f43
7cbdcaa
2040f67
e56ef6e
4e456e3
dd0a21f
5e9de99
e8136dc
26c67bb
b3f6406
8dec2ba
5e1f332
b351065
6986459
04068a7
edb8de8
4b0b1fb
0020ea0
3926fa2
5a61aa6
5bf2fa2
c2aaff8
9ea50a6
4c98ab5
3d6ee96
06e1b86
ccb91a3
861a040
4c76eb5
a1bb895
bd87fa6
5779e9f
c6372b7
caa1ff7
088ada9
f325dca
4ba4acf
11d1cab
2c4ef22
3dfca7d
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -218,6 +218,25 @@ locally. To serve a production build locally: | |
attempt to run the build on the same port specified in the | ||
`env.config.js` file. | ||
|
||
## Local module configuration for TypeScript | ||
|
||
#. Create file in repository `tsconfig.json`, with a clause `"extends": "@openedx/frontend-build"` | ||
#. Set "rootDir" to the root of the source code folders | ||
#. Set "include" to wildcard patterns specifying the subdirectories/files under rootDir where source code can be found | ||
#. Include any wildcards under rootDir that should be excluded using "exclude" | ||
|
||
```Sample json | ||
{ | ||
"extends": "@openedx/frontend-build", | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. It looks like we're actually extending There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Also, it might be good to recommend setting There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
@arbrandes I believe the original intent for recommending For example, the base ESLint config provided to MFEs via frontend-build extends That said, if supporting MFE-only TypeScript config isn't necessary (which is probably isn't; I don't really see legacy UI repos like edx-platform adopting TypeScript anytime soon), I agree recommending to extend There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Ah, I've always wondered why |
||
"compilerOptions": { | ||
"rootDir": ".", | ||
"outDir": "dist" | ||
}, | ||
"include": ["src/**/*"], | ||
"exclude": ["dist", "node_modules"] | ||
} | ||
``` | ||
|
||
## Development | ||
|
||
This project leverages the command line interface for webpack, jest, | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
import React, { CSSProperties } from 'react'; | ||
|
||
type ImageProps = { | ||
src: string; | ||
alt?: string; | ||
style?: CSSProperties; | ||
}; | ||
|
||
const Image = ({ alt, ...rest }:ImageProps) => <img alt={alt} {...rest} />; | ||
|
||
const defaultProps = { | ||
alt: undefined, | ||
style: undefined, | ||
}; | ||
Image.defaultProps = defaultProps; | ||
export default Image; |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
{ | ||
"extends": "../tsconfig.json", | ||
arbrandes marked this conversation as resolved.
Show resolved
Hide resolved
|
||
"compilerOptions": { | ||
"rootDir": ".", | ||
"outDir": "dist" | ||
}, | ||
"include": [ | ||
".eslintrc.js", | ||
"env.config.js", | ||
"src" | ||
], | ||
"exclude": [ | ||
"node_modules", | ||
"dist", | ||
] | ||
} |
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.
We're not going to need this, going forward. See this comment on a Paragon PR: openedx/paragon#2867 (comment)