io.quarkiverse.quinoa.deployment.framework.override.ReactFramework Maven / Gradle / Ivy
package io.quarkiverse.quinoa.deployment.framework.override;
import java.util.HashMap;
import java.util.Map;
import java.util.Optional;
import jakarta.json.JsonObject;
import io.quarkiverse.quinoa.deployment.config.PackageManagerCommandConfig;
import io.quarkiverse.quinoa.deployment.config.QuinoaConfig;
import io.quarkiverse.quinoa.deployment.config.delegate.PackageManagerCommandConfigDelegate;
import io.quarkiverse.quinoa.deployment.config.delegate.QuinoaConfigDelegate;
public class ReactFramework extends GenericFramework {
public ReactFramework() {
super("build", "start", 3000);
}
@Override
public QuinoaConfig override(QuinoaConfig delegate, Optional packageJson, Optional detectedDevScript,
boolean isCustomized) {
return new QuinoaConfigDelegate(super.override(delegate, packageJson, detectedDevScript, isCustomized)) {
@Override
public PackageManagerCommandConfig packageManagerCommand() {
return new PackageManagerCommandConfigDelegate(super.packageManagerCommand()) {
@Override
public Map devEnv() {
// BROWSER=NONE so the browser is not automatically opened with React
Map envs = new HashMap<>(super.testEnv());
envs.put("BROWSER", "NONE");
return envs;
}
};
}
};
}
}