Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: jsx files are not taken into front-end build from add-ons #17820

Merged
merged 3 commits into from
Oct 12, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,8 @@
public class TaskCopyFrontendFiles implements FallibleCommand {
private static final String[] WILDCARD_INCLUSIONS = new String[] {
"**/*.js", "**/*.js.map", "**/*.css", "**/*.css.map", "**/*.ts",
"**/*.ts.map", "**/*.tsx", "**/*.tsx.map" };
"**/*.ts.map", "**/*.tsx", "**/*.tsx.map", "**/*.jsx",
"**/*.jsx.map" };
private static final String WILDCARD_INCLUSION_APP_THEME_JAR = "**/themes/**/*";
private final Options options;
private Set<File> resourceLocations = null;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -57,13 +57,13 @@ public void setup() throws IOException, ExecutionFailedException {
public void frontendResources_should_beCopiedFromJars_when_TaskUpdatePackagesRemovesThem()
throws IOException, ExecutionFailedException {
copyResources();
assertCopiedFrontendFileAmount(8);
assertCopiedFrontendFileAmount(10);

performPackageClean();
assertCopiedFrontendFileAmount(0);

copyResources();
assertCopiedFrontendFileAmount(8);
assertCopiedFrontendFileAmount(10);
}

private void assertCopiedFrontendFileAmount(int fileCount)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@ private void should_collectJsAndCssFilesFromJars(String jarFile,
task.execute();

List<String> files = TestUtils.listFilesRecursively(frontendDepsFolder);
Assert.assertEquals(10, files.size());
Assert.assertEquals(12, files.size());

Assert.assertTrue("TS resource should have been copied from jar file",
files.contains("example.ts"));
Expand Down Expand Up @@ -155,6 +155,13 @@ private void should_collectJsAndCssFilesFromJars(String jarFile,
Assert.assertTrue(
"TSX resource source map should have been copied from jar file",
files.contains("react.tsx.map"));

Assert.assertTrue("JSX resource should have been copied from jar file",
files.contains("test.jsx"));

Assert.assertTrue(
"JSX resource source map should have been copied from jar file",
files.contains("test.jsx.map"));
}

private static Set<File> jars(File... files) {
Expand Down
Binary file modified flow-server/src/test/resources/jar-with-frontend-resources.jar
Binary file not shown.
Binary file modified flow-server/src/test/resources/jar-with-modern-frontend.jar
Binary file not shown.
Loading