Skip to content

Commit 9de67e8

Browse files
Merge branch 'sdk-v4.0.1' into 'master'
[DOC][SDK] v4.0.1 See merge request codingame/game-engine!293
2 parents f77dff8 + 660f34b commit 9de67e8

File tree

4 files changed

+22
-4
lines changed

4 files changed

+22
-4
lines changed

engine/core/src/main/resources/view/core/Drawer.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -93,9 +93,9 @@ export class Drawer {
9393
this.modules = {}
9494
for (const Module of config.modules) {
9595
try {
96-
this.modules[Module.name] = new Module(assets)
96+
this.modules[Module.moduleName || Module.name] = new Module(assets)
9797
} catch (error) {
98-
this.handleModuleError(Module.name, error)
98+
this.handleModuleError(Module.moduleName || Module.name, error)
9999
}
100100
}
101101
}

playground/extensions/extensions-2-tutorial.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,7 @@ export class MyModule {
9292
/**
9393
* Corresponds to the moduleName variable used in the Java module.
9494
*/
95-
static get name () {
95+
static get moduleName () {
9696
return 'myModuleName'
9797
}
9898

playground/misc/misc-3-release-notes.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,13 @@
22

33
The CodinGame SDK is regularly updated and improved. This document lets you know what changed in the latest releases.
44

5+
6+
## 4.0.1
7+
8+
### 🐞 Bug fix
9+
10+
- When exporting a game, folders named "node_modules" are now ignored.
11+
- Renamed viewer modules' `name` variable to `moduleName` for consistency and future-proofing.
512
## 4.0.0
613

714
### 🎁 Features

runner/src/main/java/com/codingame/gameengine/runner/Renderer.java

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -612,13 +612,24 @@ private Path exportSourceCode(Path sourceFolderPath, Path zipPath) throws IOExce
612612
@Override
613613
public FileVisitResult visitFile(Path file, BasicFileAttributes attrs) throws IOException {
614614
String relativePath = sourceFolderPath.relativize(file).toString();
615-
if (relativePath.startsWith("config") || relativePath.startsWith("src") || relativePath.equals("pom.xml")) {
615+
616+
if (whiteListed(relativePath) && !blacklisted(relativePath)) {
616617
zos.putNextEntry(new ZipEntry(sourceFolderPath.relativize(file).toString().replace('\\', '/')));
617618
Files.copy(file, zos);
618619
zos.closeEntry();
619620
}
620621
return FileVisitResult.CONTINUE;
621622
}
623+
624+
private boolean blacklisted(String relativePath) {
625+
return relativePath.contains("/node_modules/");
626+
}
627+
628+
private boolean whiteListed(String relativePath) {
629+
return relativePath.startsWith("config")
630+
|| relativePath.startsWith("src")
631+
|| relativePath.equals("pom.xml");
632+
}
622633
}
623634
);
624635
}

0 commit comments

Comments
 (0)