Skip to content
This repository was archived by the owner on Nov 8, 2022. It is now read-only.

Commit d5be468

Browse files
committed
refactor(generator): add src scope
1 parent 3d58dae commit d5be468

File tree

4 files changed

+17
-15
lines changed

4 files changed

+17
-15
lines changed

utils/scripts/component_exists.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,9 @@
77
const fs = require('fs')
88
const path = require('path')
99

10-
const appComponents = fs.readdirSync(path.join(__dirname, '../../components'))
10+
const appComponents = fs.readdirSync(
11+
path.join(__dirname, '../../src/components')
12+
)
1113
const appPages = fs.readdirSync(path.join(__dirname, '../../pages'))
1214
const components = appComponents.concat(appPages)
1315

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
const actions = [
6464
{
6565
type: 'add',
66-
path: '../../../components/{{properCase name}}/index.js',
66+
path: '../../../src/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: '../../../src/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: '../../../src/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: '../../../src/components/{{properCase name}}/styles/index.js',
9292
templateFile: './component/styles.js.hbs',
9393
abortOnFail: true,
9494
})

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
const actions = [
4545
{
4646
type: 'add',
47-
path: '../../../containers/{{properCase name}}/index.js',
47+
path: '../../../src/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: '../../../src/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: '../../../src/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: '../../../src/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: '../../../src/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: '../../../src/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: '../../../src/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: '../../../src/containers/{{properCase name}}/lang.js',
9797
templateFile: './container/lang.js.hbs',
9898
abortOnFail: true,
9999
})

utils/scripts/generators/store/index.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,13 +31,13 @@ module.exports = {
3131
const actions = [
3232
{
3333
type: 'add',
34-
path: '../stores/{{properCase name}}/index.js',
34+
path: '../src/stores/{{properCase name}}/index.js',
3535
templateFile: './store/store.js.hbs',
3636
abortOnFail: true,
3737
},
3838
{
3939
type: 'add',
40-
path: '../stores/{{properCase name}}/test/index.test.js',
40+
path: '../src/stores/{{properCase name}}/test/index.test.js',
4141
templateFile: './store/store.test.js.hbs',
4242
abortOnFail: true,
4343
},

0 commit comments

Comments
 (0)