Skip to content

Commit e623fef

Browse files
Merge pull request #126 from team-reactype/development
Development
2 parents 0dd12c3 + e8bd518 commit e623fef

File tree

3 files changed

+17
-22
lines changed

3 files changed

+17
-22
lines changed

src/utils/createApplication.util.ts

Lines changed: 9 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -44,10 +44,9 @@ function createIndexHtml(path, appName) {
4444
export const createIndexTsx = (path, appName) => {
4545
const filePath = `${path}/${appName}/src/index.tsx`;
4646
const data = `
47-
import * as React from 'react';
48-
import * as ReactDOM from 'react-dom';
49-
50-
import App from './components/App.tsx';
47+
import React from 'react';
48+
import ReactDOM from 'react-dom';
49+
import App from './components/App';
5150
5251
ReactDOM.render(<App />, document.getElementById('root'));
5352
`;
@@ -71,7 +70,7 @@ export const createPackage = (path, appName) => {
7170
"scripts": {
7271
"start": "node server/server.js",
7372
"build": "cross-env NODE_ENV=production webpack",
74-
"dev": "nodemon server/server.js & cross-env NODE_ENV=development webpack-dev-server --open"
73+
"dev": "cross-env NODE_ENV=development webpack-dev-server"
7574
},
7675
"nodemonConfig": {
7776
"ignore": [
@@ -148,9 +147,6 @@ module.exports = {
148147
mode: status,
149148
devServer: {
150149
publicPath: '/build/',
151-
// proxy: {
152-
// '/testDev': 'http://localhost:3000',
153-
// },
154150
},
155151
156152
module: {
@@ -207,7 +203,8 @@ export const createTsConfig = (path, appName) => {
207203
"noImplicitAny": true,
208204
"module": "commonjs",
209205
"target": "es6",
210-
"jsx": "react"
206+
"jsx": "react",
207+
"allowSyntheticDefaultImports": true
211208
},
212209
"include": ["./src/**/*"]
213210
}
@@ -271,9 +268,9 @@ app.get('/', (req, res) => {
271268
res.sendFile(path.join(__dirname, '../index.html'));
272269
});
273270
274-
app.listen(3000, () => {
275-
console.log('listening on port 3000');
276-
}); //listens on port 3000 -> http://localhost:3000/
271+
app.listen(8080, () => {
272+
console.log('listening on port 8080');
273+
}); //listens on port 8080 -> http://localhost:8080/
277274
`;
278275
fs.writeFile(filePath, data, err => {
279276
if (err) {

src/utils/htmlElements.util.ts

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -18,32 +18,32 @@ const HTMLelements: htmlElementsInt = {
1818
Image: {
1919
width: 100,
2020
height: 100,
21-
attributes: ["ClassName", "id", "Src"]
21+
attributes: ['className', 'id', 'src']
2222
},
2323
Button: {
2424
width: 75,
2525
height: 28,
26-
attributes: ["ClassName", "id", "Text"]
26+
attributes: ['className', 'id', 'text']
2727
},
2828
Form: {
2929
width: 150,
3030
height: 150,
31-
attributes: ["ClassName", "id", "Text"]
31+
attributes: ['className', 'id', 'text']
3232
},
3333
Paragraph: {
3434
width: 250,
3535
height: 75,
36-
attributes: ["ClassName", "id", "Text"]
36+
attributes: ['className', 'id', 'text']
3737
},
3838
List: {
3939
width: 75,
4040
height: 75,
41-
attributes: ["ClassName", "id", "Text"]
41+
attributes: ['className', 'id', 'text']
4242
},
4343
Link: {
4444
width: 50,
4545
height: 50,
46-
attributes: ["ClassName", "id", "Text"]
46+
attributes: ['className', 'id', 'text']
4747
}
4848
};
4949

tsconfig.json

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,12 +6,10 @@
66
"module": "commonjs",
77
"target": "es6",
88
"jsx": "react",
9-
"lib": ["es6", "dom", "es2017"]
9+
"lib": ["es6", "dom", "es2017"],
1010
// "strict": true,
1111
// "alwaysStrict": true
12-
//these two options are recommended but don't work, maybe an issue with awesome-typsecript-loader vs babel
13-
// "esModuleInterop": true
14-
// "allowSyntheticDefaultImports": true
12+
"allowSyntheticDefaultImports": true
1513
},
1614
"include": ["./src/**/*"]
1715
}

0 commit comments

Comments
 (0)