-
-
Notifications
You must be signed in to change notification settings - Fork 131
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
⚡ Make a versions.js file that checks and returns used nw.js and pixi…
….js versions. versions.js should now be used as a source of truth about used nw.js and pixi versions. Closes #305
- Loading branch information
1 parent
1e7b967
commit ed2874a
Showing
13 changed files
with
68 additions
and
44 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 |
---|---|---|
|
@@ -85,6 +85,7 @@ app/export | |
|
||
# editor-specific | ||
.vscode/settings.json | ||
.vscode/launch.json | ||
|
||
# docs | ||
docs/db.json | ||
|
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 was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
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
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
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,37 @@ | ||
/* | ||
* This file returns versions for nw.js and pixi.js, as well as checks | ||
* that pixi.js versions used for game packaging are the same. | ||
*/ | ||
|
||
const appManifest = require('./app/package.json'); | ||
|
||
const unfixedRegex = /^[~^]|^[\d.]+-[\d.]+$/; | ||
|
||
const versionMessage = 'versions.js has found an error in ct.js configuration!'; | ||
const makeTab = () => console.error(`╭─${'─'.repeat(versionMessage.length)}─╮ | ||
│ ${versionMessage} │ | ||
╰─${'─'.repeat(versionMessage.length)}─╯`); | ||
|
||
const packagesToCheck = { | ||
pixi: 'pixi.js', | ||
pixiLegacy: 'pixi.js-legacy', | ||
pixiParticles: 'pixi-particles' | ||
}; | ||
const packageVersions = {}; | ||
for (const packageKey in packagesToCheck) { | ||
packageVersions[packageKey] = appManifest.dependencies[packagesToCheck[packageKey]]; | ||
if (!packageVersions[packageKey] || unfixedRegex.test(packageVersions[packageKey])) { | ||
makeTab(); | ||
throw new Error(`${packageKey} package used in the app folder is not set to a fixed version. This must be fixed. Current value is "${packageVersions[packageKey]}".`); | ||
} | ||
} | ||
|
||
if (packageVersions.pixi !== packageVersions.pixiLegacy) { | ||
makeTab(); | ||
throw new Error(`pixi.js-legacy and pixi.js packages in the app folder are not equal. This must be fixed. Current values are "${packageVersions.pixiLegacy}" for pixi.js-legacy and "${packageVersions.pixi}" for pixi.js.`); | ||
} | ||
|
||
module.exports = { | ||
nwjs: '0.59.0', | ||
...packageVersions | ||
}; |