Skip to content

Commit 92bf156

Browse files
refactor = add getEntryFilePath
1 parent 0114741 commit 92bf156

File tree

1 file changed

+9
-4
lines changed

1 file changed

+9
-4
lines changed

packages/devextreme-cli/src/applications/application.nextjs.js

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ const create = async(appName, options) => {
7474
commandArguments = [
7575
...commandArguments,
7676
`${templateOptions.isTypeScript ? '--typescript' : '--javascript'}`,
77-
'--no-eslint',
77+
'--eslint',
7878
'--no-tailwind',
7979
'--src-dir',
8080
'--app',
@@ -136,8 +136,7 @@ const addTemplate = (appPath, appName, templateOptions) => {
136136
install({ isTypeScript: templateOptions.isTypeScript }, appPath, styles);
137137
};
138138

139-
const install = (options, appPath, styles) => {
140-
appPath = appPath ? appPath : process.cwd();
139+
const getEntryFilePath = (options, appPath) => {
141140
const extension = options.isTypeScript || isTsApp() ? 'ts' : 'js';
142141
const srcFolder = fs.existsSync(path.join(appPath, 'src')) ? 'src' : '';
143142
const isAppRouterApp = fs.existsSync(path.join(appPath, srcFolder, 'app')) && fs.lstatSync(appPath).isDirectory();
@@ -148,7 +147,13 @@ const install = (options, appPath, styles) => {
148147

149148
const jsx = fs.existsSync(path.join(appPath, srcFolder, entryFilePath + 'x')) ? 'x' : '';
150149

151-
const pathToMainComponent = path.join(appPath, srcFolder, entryFilePath + jsx);
150+
return path.join(srcFolder, entryFilePath + jsx);
151+
};
152+
153+
const install = (options, appPath, styles) => {
154+
appPath = appPath ? appPath : process.cwd();
155+
156+
const pathToMainComponent = path.join(appPath, getEntryFilePath(options, appPath));
152157

153158
addStylesToApp(pathToMainComponent, styles || defaultStyles);
154159
packageJsonUtils.addDevextreme(appPath, options.dxversion, 'react');

0 commit comments

Comments
 (0)