Skip to content

Commit 9220e0a

Browse files
committed
feat(slim): update slim recipe to be faster
1 parent 1d59981 commit 9220e0a

File tree

45 files changed

+24
-740
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

45 files changed

+24
-740
lines changed

recipes/slim/config.js

Lines changed: 14 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -1,47 +1,39 @@
11
const getConfig = () => {
22
return {
33
bundler: "webpack",
4-
ui: "material-ui",
5-
state: "redux",
64
buildDir: "public",
75
sourceDir: {
86
main: "src",
97
static: "static",
108
assets: "assets",
119
images: "images",
12-
containers: "modules",
13-
i18n: "i18n",
1410
components: "components",
15-
businessLogic: "blocks",
16-
userInterface: "widgets",
17-
utility: "utils",
18-
hooks: "hooks",
19-
theme: "theme",
20-
store: "store",
21-
services: "services",
22-
locales: "translations",
2311
},
24-
modules: {
25-
signIn: "SignIn",
26-
dashboard: "Dashboard",
12+
canAdd: {
13+
eslint: false,
14+
prettier: false,
15+
husky: false,
16+
hookForm: false,
17+
routes: false,
18+
utils: false,
19+
static: true,
20+
i18n: false,
21+
modules: false,
22+
componentsCopy: true,
23+
fullComponents: false,
2724
},
2825
};
2926
};
3027

3128
const getModulesList = () => {
3229
return [
33-
"react",
34-
"router",
35-
"utils"
30+
"react"
3631
];
3732
};
3833

3934
const getDevModulesList = () => {
4035
return [
41-
"webpack",
42-
"webpackPlugins",
43-
"webpackLoaders",
44-
"babel"
36+
"slimDev"
4537
];
4638
};
4739

recipes/slim/index.js

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

recipes/slim/snippets/.eslintrc.json

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

recipes/slim/snippets/.prettierrc.json

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

recipes/slim/snippets/index.js

Lines changed: 1 addition & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -2,24 +2,10 @@ const shell = require('shelljs')
22
const { getWebPackConfig } = require('./webpack.config')
33
const rootIndex = require('./sources/index')
44
const rootApp = require('./sources/App')
5-
const rootRoutes = require('./sources/Routes')
6-
const withI18n = require('./sources/withI18n')
7-
const signInModule = require('./sources/SignIn')
8-
const dashboardModule = require('./sources/Dashboard')
9-
const pageLoaderBlock = require('./sources/PageLoader')
10-
const sidebarBlock = require('./sources/Sidebar')
11-
const topBarBlock = require('./sources/TopBar')
125

136
const sourceCodes = {
147
'index.js': rootIndex,
15-
'App.js': rootApp,
16-
'Routes.js': rootRoutes,
17-
'withI18n.js': withI18n,
18-
'SignIn.js': signInModule,
19-
'Dashboard.js': dashboardModule,
20-
'PageLoader.js': pageLoaderBlock,
21-
'Sidebar.js': sidebarBlock,
22-
'TopBar.js': topBarBlock,
8+
'App.js': rootApp
239
}
2410

2511
const getFileContent = (fileName) => {

recipes/slim/snippets/sources/App.js

Lines changed: 4 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,31 +1,20 @@
11
function getSourceCode(appName, { sourceDir }) {
22
return `import React from 'react'
3-
import { BrowserRouter as Router } from 'react-router-dom'
4-
import { createBrowserHistory } from 'history'
53
6-
import Routes from './Routes'
7-
8-
// Block Components.
9-
import { ErrorHandler, PageLoader } from '@${appName}/${sourceDir.businessLogic}'
10-
11-
import { withTranslation } from '@${appName}/${sourceDir.i18n}'
12-
13-
const browserHistory = createBrowserHistory()
4+
// Components.
5+
import { ErrorHandler } from '@${appName}/${sourceDir.components}'
146
157
function App() {
168
return (
179
<>
1810
<ErrorHandler>
19-
<PageLoader />
20-
<Router history={browserHistory}>
21-
<Routes />
22-
</Router>
11+
<h1>Welcome to Slim App</h1>
2312
</ErrorHandler>
2413
</>
2514
)
2615
}
2716
28-
export default withTranslation(App)
17+
export default App
2918
`
3019
}
3120

0 commit comments

Comments
 (0)