Skip to content

Commit

Permalink
fix: revert ts config PR (#315)
Browse files Browse the repository at this point in the history
  • Loading branch information
Mashal-m authored Mar 24, 2023
1 parent 8340ab4 commit 07a58ad
Show file tree
Hide file tree
Showing 9 changed files with 23 additions and 100 deletions.
8 changes: 0 additions & 8 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -157,14 +157,6 @@ You may create a `.env.private` with any overrides of the environment settings c

**Note: .env.private should be added to your project's .gitignore so it does not get checked in.**

Local module configuration for TypeScript
-----------------------------------------

#. Copy tsconfig.json into the root of the module
#. Set "rootDir" to the root of the source code folders, and "outDir" to the distribution folder
#. 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". Make sure the "outDir" directory is excluded here, if it is under "include".

Development
-----------

Expand Down
4 changes: 1 addition & 3 deletions config/jest.config.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
const path = require('path');
const fs = require('fs');
const { jsWithTs: tsjPreset } = require('ts-jest/presets');

const presets = require('../lib/presets');

Expand Down Expand Up @@ -34,12 +33,11 @@ module.exports = {
'/node_modules/(?!@edx)',
],
transform: {
'^.+\\.jsx?$': [
'^.+\\.[t|j]sx?$': [
'babel-jest',
{
configFile: presets.babel.resolvedFilepath,
},
],
...tsjPreset.transform,
},
};
4 changes: 2 additions & 2 deletions config/webpack.prod.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -62,12 +62,12 @@ module.exports = merge(commonConfig, {
// The babel-loader transforms newer ES2015+ syntax to older ES5 for older browsers.
// Babel is configured with the .babelrc file at the root of the project.
{
test: /\.(js|jsx|ts|tsx)$/,
test: /\.(js|jsx)$/,
exclude: /node_modules\/(?!@edx)/,
use: {
loader: 'babel-loader',
options: {
configFile: presets['babel-typescript'].resolvedFilepath,
configFile: presets.babel.resolvedFilepath,
},
},
},
Expand Down
3 changes: 0 additions & 3 deletions example/src/App.jsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import config from 'env.config';
import Image from './Image.tsx';
import appleUrl, { ReactComponent as Apple } from './apple.svg';
import appleImg from './apple.jpg';

Expand All @@ -20,8 +19,6 @@ export default function App() {
</ul>
<h2>JSX parsing tests</h2>
<Apple style={{ width: '10rem' }} />
<h2>TSX parsing tests</h2>
<Image src={appleUrl} alt="appleFromTsx" style={{ width: '10rem' }} />
<h2>Asset import tests</h2>
<img src={appleUrl} alt="apple" style={{ width: '10rem' }} />
<img src={appleUrl} alt="apple" style={{ width: '10rem' }} />
Expand Down
11 changes: 0 additions & 11 deletions example/src/Image.tsx

This file was deleted.

12 changes: 0 additions & 12 deletions example/src/__snapshots__/App.test.jsx.snap
Original file line number Diff line number Diff line change
Expand Up @@ -39,18 +39,6 @@ exports[`Basic test should render 1`] = `
}
}
/>
<h2>
TSX parsing tests
</h2>
<img
alt="appleFromTsx"
src="icon/mock/path"
style={
Object {
"width": "10rem",
}
}
/>
<h2>
Asset import tests
</h2>
Expand Down
52 changes: 20 additions & 32 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 0 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -81,10 +81,8 @@
},
"devDependencies": {
"@babel/preset-typescript": "^7.18.6",
"@types/jest": "^26.0.0",
"@types/react": "^17.0.0",
"@types/react-dom": "^17.0.11",
"ts-jest": "^26.5.0",
"typescript": "^4.9.4"
},
"peerDependencies": {
Expand Down
27 changes: 0 additions & 27 deletions tsconfig.json

This file was deleted.

0 comments on commit 07a58ad

Please sign in to comment.