-
-
Notifications
You must be signed in to change notification settings - Fork 232
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
18 changed files
with
3,693 additions
and
2,888 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
20.11.0 | ||
20.14.0 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,56 @@ | ||
import fs from 'fs-extra' | ||
import path from 'path' | ||
import { getNextronConfig } from './getNextronConfig' | ||
import * as logger from '../logger' | ||
|
||
const cwd = process.cwd() | ||
const pkgPath = path.join(cwd, 'package.json') | ||
const nextConfigPath = path.join( | ||
getNextronConfig().rendererSrcDir || 'renderer', | ||
'next.config.js' | ||
) | ||
|
||
export const useExportCommand = async (): Promise<boolean> => { | ||
const { dependencies, devDependencies } = await fs.readJSON(pkgPath) | ||
|
||
let nextronVersion: string | ||
nextronVersion = dependencies.nextron | ||
if (nextronVersion) { | ||
logger.info( | ||
'To reduce the bundle size of the electron app, we recommend placing nextron in devDependencies instead of dependencies.' | ||
) | ||
} | ||
if (!nextronVersion) { | ||
nextronVersion = devDependencies.nextron | ||
if (!nextronVersion) { | ||
logger.error( | ||
'Nextron not found in both dependencies and devDependencies.' | ||
) | ||
process.exit(1) | ||
} | ||
} | ||
|
||
const majorVersion = ~~nextronVersion | ||
.split('.') | ||
.filter((v) => v.trim() !== '')[0] | ||
if (majorVersion < 13) { | ||
return true | ||
} | ||
if (majorVersion === 13) { | ||
const { output } = await fs.readJSON(nextConfigPath) | ||
return output !== 'export' | ||
} | ||
if (majorVersion > 13) { | ||
const { output } = await fs.readJSON(nextConfigPath) | ||
if (output !== 'export') { | ||
logger.error( | ||
'We must export static files so as Electron can handle them. Please set next.config.js#output to "export".' | ||
) | ||
process.exit(1) | ||
} | ||
return false | ||
} | ||
|
||
logger.error('Unexpected error occerred') | ||
process.exit(1) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
{ | ||
"name": "nextron", | ||
"version": "8.15.0", | ||
"version": "8.16.0", | ||
"description": "⚡ NEXT.js + Electron ⚡", | ||
"repository": "[email protected]:saltyshiomix/nextron.git", | ||
"author": { | ||
|
Oops, something went wrong.