Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings
This repository was archived by the owner on Nov 1, 2021. It is now read-only.

Commit1510053

Browse files
committed
refactor(update): use new generators & update react to latest
1 parent10e609b commit1510053

17 files changed

+84
-95
lines changed

‎package-docker.json‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -50,11 +50,11 @@
5050
"ramda":"0.25.0",
5151
"randomcolor":"^0.5.3",
5252
"raven-js":"^3.26.4",
53-
"react":"16.6.0",
53+
"react":"16.8.1",
5454
"react-calendar-heatmap":"^1.6.3",
5555
"react-click-outside":"^3.0.1",
5656
"react-content-loader":"3.1.2",
57-
"react-dom":"16.6.0",
57+
"react-dom":"16.8.1",
5858
"react-intl":"2.4.0",
5959
"react-json-view":"1.19.1",
6060
"react-keydown":"1.9.7",

‎package.json‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -90,11 +90,11 @@
9090
"ramda":"0.25.0",
9191
"randomcolor":"^0.5.3",
9292
"raven-js":"^3.26.4",
93-
"react":"16.6.0",
93+
"react":"16.8.1",
9494
"react-calendar-heatmap":"^1.6.3",
9595
"react-click-outside":"^3.0.1",
9696
"react-content-loader":"3.1.2",
97-
"react-dom":"16.6.0",
97+
"react-dom":"16.8.1",
9898
"react-intl":"2.4.0",
9999
"react-json-view":"1.19.1",
100100
"react-keydown":"1.9.7",

‎utils/scripts/component_exists.js‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
constfs=require('fs')
88
constpath=require('path')
99

10-
constappComponents=fs.readdirSync(path.join(__dirname,'components'))
10+
constappComponents=fs.readdirSync(path.join(__dirname,'../../components'))
1111
constappPages=fs.readdirSync(path.join(__dirname,'../../pages'))
1212
constcomponents=appComponents.concat(appPages)
1313

‎utils/scripts/generators/component/class.js.hbs‎

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -15,16 +15,18 @@ import { FormattedMessage } from 'react-intl'
1515
import messages from './messages'
1616
{{/if}}
1717

18-
import { makeDebugger } from 'utils'
18+
import { makeDebugger } from '@utils'
1919

20-
/* eslint-disable no-unused-vars */
20+
/* eslint-disable-next-line */
2121
const debug = makeDebugger('c:{{properCasename}}:index')
22-
/* eslint-enable no-unused-vars */
22+
2323

2424
class{{properCasename}} extends React.PureComponent {
25-
componentDidMount() {}
25+
constructor(props) {
26+
super(props)
27+
}
2628

27-
componentWillUnmount() {}
29+
//componentWillUnmount() {}
2830

2931
render() {
3032
return (

‎utils/scripts/generators/component/index.js‎

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -63,13 +63,13 @@ module.exports = {
6363
constactions=[
6464
{
6565
type:'add',
66-
path:'components/{{properCase name}}/index.js',
66+
path:'../../../components/{{properCase name}}/index.js',
6767
templateFile:componentTemplate,
6868
abortOnFail:true,
6969
},
7070
{
7171
type:'add',
72-
path:'components/{{properCase name}}/tests/index.test.js',
72+
path:'../../../components/{{properCase name}}/tests/index.test.js',
7373
templateFile:'./component/test.js.hbs',
7474
abortOnFail:true,
7575
},
@@ -79,7 +79,7 @@ module.exports = {
7979
if(data.wantI18n){
8080
actions.push({
8181
type:'add',
82-
path:'components/{{properCase name}}/lang.js',
82+
path:'../../../components/{{properCase name}}/lang.js',
8383
templateFile:'./component/lang.js.hbs',
8484
abortOnFail:true,
8585
})
@@ -88,7 +88,7 @@ module.exports = {
8888
if(data.wantStyle){
8989
actions.push({
9090
type:'add',
91-
path:'components/{{properCase name}}/styles/index.js',
91+
path:'../../../components/{{properCase name}}/styles/index.js',
9292
templateFile:'./component/styles.js.hbs',
9393
abortOnFail:true,
9494
})

‎utils/scripts/generators/component/loadable.js.hbs‎

Lines changed: 0 additions & 12 deletions
This file was deleted.

‎utils/scripts/generators/component/stateless.js.hbs‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,11 +15,11 @@ import { FormattedMessage as I18n } from 'react-intl'
1515
import lang from './lang'
1616
{{/if}}
1717

18-
import { makeDebugger } from 'utils'
18+
import { makeDebugger } from '@utils'
1919

20-
/* eslint-disable no-unused-vars */
20+
/* eslint-disable-next-line */
2121
const debug = makeDebugger('c:{{properCasename}}:index')
22-
/* eslint-enable no-unused-vars */
22+
2323

2424
const{{properCasename}} = (props) => {
2525
return (
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import styled from 'styled-components'
22

3-
// import Img from '../../Img'
4-
// import { theme } from 'utils'
3+
// import Img from '@Img'
4+
// import { theme } from '@utils'
55

66
export const Wrapper = styled.div``
77
export const Title = styled.div``

‎utils/scripts/generators/container/class.js.hbs‎

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -5,28 +5,30 @@
55
*/
66

77
import React from 'react'
8-
import { inject, observer } from 'mobx-react'
98
{{#ifwantMessages}}
109
import { FormattedMessage } from 'react-intl'
1110
import messages from './messages'
1211
{{/if}}
1312

14-
// import { } from './styles'
15-
16-
import { makeDebugger, storePlug } from 'utils'
13+
import { connectStore, makeDebugger } from '@utils'
1714

15+
// import { } from './styles'
1816
import * as logic from './logic'
19-
/* eslint-disable no-unused-vars */
17+
18+
/* eslint-disable-next-line */
2019
const debug = makeDebugger('C:{{properCasename}}')
21-
/* eslint-enable no-unused-vars */
2220

23-
// NOTE: add me to containers/index
21+
2422
class{{properCasename}}Container extends React.Component {
2523
componentDidMount() {
2624
const{{preCurly""}}{{camelCasename}}{{afterCurly""}} = this.props
2725
logic.init({{camelCasename}})
2826
}
2927

28+
componentWillUnmount() {
29+
logic.uninit()
30+
}
31+
3032
render() {
3133
return (
3234
<div>
@@ -40,4 +42,4 @@ class {{ properCase name }}Container extends React.Component {
4042
}
4143
}
4244

43-
export defaultinject(storePlug('{{camelCasename}}'))(observer({{properCasename}}Container))
45+
export defaultconnectStore({{properCasename}}Container)

‎utils/scripts/generators/container/index.js‎

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -44,37 +44,37 @@ module.exports = {
4444
constactions=[
4545
{
4646
type:'add',
47-
path:'containers/{{properCase name}}/index.js',
47+
path:'../../../containers/{{properCase name}}/index.js',
4848
templateFile:'./container/class.js.hbs',
4949
abortOnFail:true,
5050
},
5151
{
5252
type:'add',
53-
path:'containers/{{properCase name}}/logic.js',
53+
path:'../../../containers/{{properCase name}}/logic.js',
5454
templateFile:'./container/logic.js.hbs',
5555
abortOnFail:true,
5656
},
5757
{
5858
type:'add',
59-
path:'containers/{{properCase name}}/store.js',
59+
path:'../../../containers/{{properCase name}}/store.js',
6060
templateFile:'./container/store.js.hbs',
6161
abortOnFail:true,
6262
},
6363
{
6464
type:'add',
65-
path:'containers/{{properCase name}}/styles/index.js',
65+
path:'../../../containers/{{properCase name}}/styles/index.js',
6666
templateFile:'./container/styles.js.hbs',
6767
abortOnFail:true,
6868
},
6969
{
7070
type:'add',
71-
path:'containers/{{properCase name}}/tests/index.test.js',
71+
path:'../../../containers/{{properCase name}}/tests/index.test.js',
7272
templateFile:'./container/test.js.hbs',
7373
abortOnFail:true,
7474
},
7575
{
7676
type:'add',
77-
path:'containers/{{properCase name}}/tests/store.test.js',
77+
path:'../../../containers/{{properCase name}}/tests/store.test.js',
7878
templateFile:'./container/store.test.js.hbs',
7979
abortOnFail:true,
8080
},
@@ -83,7 +83,7 @@ module.exports = {
8383
if(data.wantSchema){
8484
actions.push({
8585
type:'add',
86-
path:'containers/{{properCase name}}/schema.js',
86+
path:'../../../containers/{{properCase name}}/schema.js',
8787
templateFile:'./container/schema.js.hbs',
8888
abortOnFail:true,
8989
})
@@ -93,7 +93,7 @@ module.exports = {
9393
if(data.wantI18n){
9494
actions.push({
9595
type:'add',
96-
path:'containers/{{properCase name}}/lang.js',
96+
path:'../../../containers/{{properCase name}}/lang.js',
9797
templateFile:'./container/lang.js.hbs',
9898
abortOnFail:true,
9999
})

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp