mirror of
https://github.com/scm-manager/scm-manager.git
synced 2025-11-08 06:25:45 +01:00
Merge with 2.0.0-m3
This commit is contained in:
@@ -1,4 +1,5 @@
|
|||||||
{
|
{
|
||||||
|
"name": "root",
|
||||||
"private": true,
|
"private": true,
|
||||||
"workspaces": [
|
"workspaces": [
|
||||||
"scm-ui/*",
|
"scm-ui/*",
|
||||||
@@ -8,10 +9,12 @@
|
|||||||
"build": "webpack --mode=production --config=scm-ui/ui-scripts/src/webpack.config.js",
|
"build": "webpack --mode=production --config=scm-ui/ui-scripts/src/webpack.config.js",
|
||||||
"build:dev": "webpack --mode=development --config=scm-ui/ui-scripts/src/webpack.config.js",
|
"build:dev": "webpack --mode=development --config=scm-ui/ui-scripts/src/webpack.config.js",
|
||||||
"test": "lerna run --scope '@scm-manager/ui-*' test",
|
"test": "lerna run --scope '@scm-manager/ui-*' test",
|
||||||
|
"typecheck": "lerna run --scope '@scm-manager/ui-*' typecheck",
|
||||||
"serve": "webpack-dev-server --mode=development --config=scm-ui/ui-scripts/src/webpack.config.js",
|
"serve": "webpack-dev-server --mode=development --config=scm-ui/ui-scripts/src/webpack.config.js",
|
||||||
"deploy": "ui-scripts publish"
|
"deploy": "ui-scripts publish"
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
|
"babel-plugin-reflow": "^0.2.7",
|
||||||
"lerna": "^3.17.0"
|
"lerna": "^3.17.0"
|
||||||
},
|
},
|
||||||
"resolutions": {
|
"resolutions": {
|
||||||
|
|||||||
18
pom.xml
18
pom.xml
@@ -398,6 +398,14 @@
|
|||||||
<version>1.1.1</version>
|
<version>1.1.1</version>
|
||||||
</dependency>
|
</dependency>
|
||||||
|
|
||||||
|
<!-- utils -->
|
||||||
|
|
||||||
|
<dependency>
|
||||||
|
<groupId>commons-codec</groupId>
|
||||||
|
<artifactId>commons-codec</artifactId>
|
||||||
|
<version>1.13</version>
|
||||||
|
</dependency>
|
||||||
|
|
||||||
</dependencies>
|
</dependencies>
|
||||||
</dependencyManagement>
|
</dependencyManagement>
|
||||||
|
|
||||||
@@ -436,7 +444,7 @@
|
|||||||
<plugin>
|
<plugin>
|
||||||
<groupId>sonia.scm.maven</groupId>
|
<groupId>sonia.scm.maven</groupId>
|
||||||
<artifactId>smp-maven-plugin</artifactId>
|
<artifactId>smp-maven-plugin</artifactId>
|
||||||
<version>1.0.0-alpha-7</version>
|
<version>1.0.0-alpha-8</version>
|
||||||
</plugin>
|
</plugin>
|
||||||
|
|
||||||
<plugin>
|
<plugin>
|
||||||
@@ -826,7 +834,7 @@
|
|||||||
<resteasy.version>3.6.2.Final</resteasy.version>
|
<resteasy.version>3.6.2.Final</resteasy.version>
|
||||||
<jersey-client.version>1.19.4</jersey-client.version>
|
<jersey-client.version>1.19.4</jersey-client.version>
|
||||||
<enunciate.version>2.11.1</enunciate.version>
|
<enunciate.version>2.11.1</enunciate.version>
|
||||||
<jackson.version>2.9.8</jackson.version>
|
<jackson.version>2.10.0</jackson.version>
|
||||||
<guice.version>4.0</guice.version>
|
<guice.version>4.0</guice.version>
|
||||||
<jaxb.version>2.3.0</jaxb.version>
|
<jaxb.version>2.3.0</jaxb.version>
|
||||||
|
|
||||||
@@ -834,12 +842,12 @@
|
|||||||
<legman.version>1.5.1</legman.version>
|
<legman.version>1.5.1</legman.version>
|
||||||
|
|
||||||
<!-- webserver -->
|
<!-- webserver -->
|
||||||
<jetty.version>9.4.14.v20181114</jetty.version>
|
<jetty.version>9.4.22.v20191022</jetty.version>
|
||||||
<jetty.maven.version>9.4.14.v20181114</jetty.maven.version>
|
<jetty.maven.version>9.4.22.v20191022</jetty.maven.version>
|
||||||
|
|
||||||
<!-- security libraries -->
|
<!-- security libraries -->
|
||||||
<ssp.version>1.2.0</ssp.version>
|
<ssp.version>1.2.0</ssp.version>
|
||||||
<shiro.version>1.4.0</shiro.version>
|
<shiro.version>1.4.1</shiro.version>
|
||||||
|
|
||||||
<!-- repository libraries -->
|
<!-- repository libraries -->
|
||||||
<jgit.version>v5.4.0.201906121030-r-scm2</jgit.version>
|
<jgit.version>v5.4.0.201906121030-r-scm2</jgit.version>
|
||||||
|
|||||||
@@ -131,6 +131,12 @@
|
|||||||
<artifactId>mapstruct-jdk8</artifactId>
|
<artifactId>mapstruct-jdk8</artifactId>
|
||||||
</dependency>
|
</dependency>
|
||||||
|
|
||||||
|
<dependency>
|
||||||
|
<groupId>org.mapstruct</groupId>
|
||||||
|
<artifactId>mapstruct-processor</artifactId>
|
||||||
|
<scope>provided</scope>
|
||||||
|
</dependency>
|
||||||
|
|
||||||
<!-- rest documentation -->
|
<!-- rest documentation -->
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>com.webcohesion.enunciate</groupId>
|
<groupId>com.webcohesion.enunciate</groupId>
|
||||||
@@ -208,6 +214,12 @@
|
|||||||
<artifactId>shiro-unit</artifactId>
|
<artifactId>shiro-unit</artifactId>
|
||||||
<scope>test</scope>
|
<scope>test</scope>
|
||||||
</dependency>
|
</dependency>
|
||||||
|
<dependency>
|
||||||
|
<groupId>org.hibernate</groupId>
|
||||||
|
<artifactId>hibernate-validator</artifactId>
|
||||||
|
<version>5.3.6.Final</version>
|
||||||
|
<scope>compile</scope>
|
||||||
|
</dependency>
|
||||||
|
|
||||||
</dependencies>
|
</dependencies>
|
||||||
|
|
||||||
|
|||||||
@@ -17,7 +17,7 @@ public class ConcurrentModificationException extends ExceptionWithContext {
|
|||||||
this(Collections.singletonList(new ContextEntry(type, id)));
|
this(Collections.singletonList(new ContextEntry(type, id)));
|
||||||
}
|
}
|
||||||
|
|
||||||
private ConcurrentModificationException(List<ContextEntry> context) {
|
public ConcurrentModificationException(List<ContextEntry> context) {
|
||||||
super(context, createMessage(context));
|
super(context, createMessage(context));
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -32,3 +32,4 @@ public class ConcurrentModificationException extends ExceptionWithContext {
|
|||||||
.collect(joining(" in ", "", " has been modified concurrently"));
|
.collect(joining(" in ", "", " has been modified concurrently"));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -68,6 +68,10 @@ public final class BranchCommandBuilder {
|
|||||||
return command.branch(request);
|
return command.branch(request);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void delete(String branchName) {
|
||||||
|
command.deleteOrClose(branchName);
|
||||||
|
}
|
||||||
|
|
||||||
private BranchCommand command;
|
private BranchCommand command;
|
||||||
private BranchRequest request = new BranchRequest();
|
private BranchRequest request = new BranchRequest();
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -178,7 +178,7 @@ public final class LogCommandBuilder
|
|||||||
logger.debug("get changeset for {} with disabled cache", id);
|
logger.debug("get changeset for {} with disabled cache", id);
|
||||||
}
|
}
|
||||||
|
|
||||||
changeset = logCommand.getChangeset(id);
|
changeset = logCommand.getChangeset(id, request);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
@@ -192,7 +192,7 @@ public final class LogCommandBuilder
|
|||||||
logger.debug("get changeset for {}", id);
|
logger.debug("get changeset for {}", id);
|
||||||
}
|
}
|
||||||
|
|
||||||
changeset = logCommand.getChangeset(id);
|
changeset = logCommand.getChangeset(id, request);
|
||||||
|
|
||||||
if (changeset != null)
|
if (changeset != null)
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -6,6 +6,8 @@ import sonia.scm.repository.spi.MergeCommand;
|
|||||||
import sonia.scm.repository.spi.MergeCommandRequest;
|
import sonia.scm.repository.spi.MergeCommandRequest;
|
||||||
import sonia.scm.repository.util.AuthorUtil;
|
import sonia.scm.repository.util.AuthorUtil;
|
||||||
|
|
||||||
|
import java.util.Set;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Use this {@link MergeCommandBuilder} to merge two branches of a repository ({@link #executeMerge()}) or to check if
|
* Use this {@link MergeCommandBuilder} to merge two branches of a repository ({@link #executeMerge()}) or to check if
|
||||||
* the branches could be merged without conflicts ({@link #dryRun()}). To do so, you have to specify the name of
|
* the branches could be merged without conflicts ({@link #dryRun()}). To do so, you have to specify the name of
|
||||||
@@ -55,6 +57,24 @@ public class MergeCommandBuilder {
|
|||||||
this.mergeCommand = mergeCommand;
|
this.mergeCommand = mergeCommand;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Use this to check if merge-strategy is supported by mergeCommand.
|
||||||
|
*
|
||||||
|
* @return boolean.
|
||||||
|
*/
|
||||||
|
public boolean isSupported(MergeStrategy strategy) {
|
||||||
|
return mergeCommand.isSupported(strategy);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Use this to get a Set of all supported merge strategies by merge command.
|
||||||
|
*
|
||||||
|
* @return boolean.
|
||||||
|
*/
|
||||||
|
public Set<MergeStrategy> getSupportedMergeStrategies() {
|
||||||
|
return mergeCommand.getSupportedMergeStrategies();
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Use this to set the branch that should be merged into the target branch.
|
* Use this to set the branch that should be merged into the target branch.
|
||||||
*
|
*
|
||||||
@@ -92,6 +112,21 @@ public class MergeCommandBuilder {
|
|||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Use this to set the strategy of the merge commit manually.
|
||||||
|
*
|
||||||
|
* This is optional and for {@link #executeMerge()} only.
|
||||||
|
*
|
||||||
|
* @return This builder instance.
|
||||||
|
*/
|
||||||
|
public MergeCommandBuilder setMergeStrategy(MergeStrategy strategy) {
|
||||||
|
if (!mergeCommand.isSupported(strategy)) {
|
||||||
|
throw new IllegalArgumentException("merge strategy not supported: " + strategy);
|
||||||
|
}
|
||||||
|
request.setMergeStrategy(strategy);
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Use this to set a template for the commit message. If no message is set, a default message will be used.
|
* Use this to set a template for the commit message. If no message is set, a default message will be used.
|
||||||
*
|
*
|
||||||
|
|||||||
@@ -0,0 +1,7 @@
|
|||||||
|
package sonia.scm.repository.api;
|
||||||
|
|
||||||
|
public enum MergeStrategy {
|
||||||
|
MERGE_COMMIT,
|
||||||
|
FAST_FORWARD_IF_POSSIBLE,
|
||||||
|
SQUASH
|
||||||
|
}
|
||||||
@@ -0,0 +1,27 @@
|
|||||||
|
package sonia.scm.repository.api;
|
||||||
|
|
||||||
|
import sonia.scm.BadRequestException;
|
||||||
|
import sonia.scm.repository.Repository;
|
||||||
|
|
||||||
|
import static sonia.scm.ContextEntry.ContextBuilder.entity;
|
||||||
|
|
||||||
|
@SuppressWarnings("squid:MaximumInheritanceDepth") // exceptions have a deep inheritance depth themselves; therefore we accept this here
|
||||||
|
public class MergeStrategyNotSupportedException extends BadRequestException {
|
||||||
|
|
||||||
|
private static final long serialVersionUID = 256498734456613496L;
|
||||||
|
|
||||||
|
private static final String CODE = "6eRhF9gU41";
|
||||||
|
|
||||||
|
public MergeStrategyNotSupportedException(Repository repository, MergeStrategy strategy) {
|
||||||
|
super(entity(repository).build(), createMessage(strategy));
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String getCode() {
|
||||||
|
return CODE;
|
||||||
|
}
|
||||||
|
|
||||||
|
private static String createMessage(MergeStrategy strategy) {
|
||||||
|
return "merge strategy " + strategy + " is not supported by this repository";
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -41,4 +41,6 @@ import sonia.scm.repository.api.BranchRequest;
|
|||||||
*/
|
*/
|
||||||
public interface BranchCommand {
|
public interface BranchCommand {
|
||||||
Branch branch(BranchRequest name);
|
Branch branch(BranchRequest name);
|
||||||
|
|
||||||
|
void deleteOrClose(String branchName);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -0,0 +1,19 @@
|
|||||||
|
package sonia.scm.repository.spi;
|
||||||
|
|
||||||
|
import sonia.scm.ContextEntry;
|
||||||
|
import sonia.scm.ExceptionWithContext;
|
||||||
|
import sonia.scm.repository.Repository;
|
||||||
|
|
||||||
|
public class CannotDeleteDefaultBranchException extends ExceptionWithContext {
|
||||||
|
|
||||||
|
public static final String CODE = "78RhWxTIw1";
|
||||||
|
|
||||||
|
public CannotDeleteDefaultBranchException(Repository repository, String branchName) {
|
||||||
|
super(ContextEntry.ContextBuilder.entity("Branch", branchName).in(repository).build(), "default branch cannot be deleted");
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String getCode() {
|
||||||
|
return CODE;
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -49,7 +49,7 @@ import java.io.IOException;
|
|||||||
*/
|
*/
|
||||||
public interface LogCommand {
|
public interface LogCommand {
|
||||||
|
|
||||||
Changeset getChangeset(String id) throws IOException;
|
Changeset getChangeset(String id, LogCommandRequest request) throws IOException;
|
||||||
|
|
||||||
ChangesetPagingResult getChangesets(LogCommandRequest request) throws IOException;
|
ChangesetPagingResult getChangesets(LogCommandRequest request) throws IOException;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -2,9 +2,16 @@ package sonia.scm.repository.spi;
|
|||||||
|
|
||||||
import sonia.scm.repository.api.MergeCommandResult;
|
import sonia.scm.repository.api.MergeCommandResult;
|
||||||
import sonia.scm.repository.api.MergeDryRunCommandResult;
|
import sonia.scm.repository.api.MergeDryRunCommandResult;
|
||||||
|
import sonia.scm.repository.api.MergeStrategy;
|
||||||
|
|
||||||
|
import java.util.Set;
|
||||||
|
|
||||||
public interface MergeCommand {
|
public interface MergeCommand {
|
||||||
MergeCommandResult merge(MergeCommandRequest request);
|
MergeCommandResult merge(MergeCommandRequest request);
|
||||||
|
|
||||||
MergeDryRunCommandResult dryRun(MergeCommandRequest request);
|
MergeDryRunCommandResult dryRun(MergeCommandRequest request);
|
||||||
|
|
||||||
|
boolean isSupported(MergeStrategy strategy);
|
||||||
|
|
||||||
|
Set<MergeStrategy> getSupportedMergeStrategies();
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -5,6 +5,7 @@ import com.google.common.base.Objects;
|
|||||||
import com.google.common.base.Strings;
|
import com.google.common.base.Strings;
|
||||||
import sonia.scm.Validateable;
|
import sonia.scm.Validateable;
|
||||||
import sonia.scm.repository.Person;
|
import sonia.scm.repository.Person;
|
||||||
|
import sonia.scm.repository.api.MergeStrategy;
|
||||||
import sonia.scm.repository.util.AuthorUtil.CommandWithAuthor;
|
import sonia.scm.repository.util.AuthorUtil.CommandWithAuthor;
|
||||||
|
|
||||||
import java.io.Serializable;
|
import java.io.Serializable;
|
||||||
@@ -17,6 +18,7 @@ public class MergeCommandRequest implements Validateable, Resetable, Serializabl
|
|||||||
private String targetBranch;
|
private String targetBranch;
|
||||||
private Person author;
|
private Person author;
|
||||||
private String messageTemplate;
|
private String messageTemplate;
|
||||||
|
private MergeStrategy mergeStrategy;
|
||||||
|
|
||||||
public String getBranchToMerge() {
|
public String getBranchToMerge() {
|
||||||
return branchToMerge;
|
return branchToMerge;
|
||||||
@@ -50,6 +52,14 @@ public class MergeCommandRequest implements Validateable, Resetable, Serializabl
|
|||||||
this.messageTemplate = messageTemplate;
|
this.messageTemplate = messageTemplate;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public MergeStrategy getMergeStrategy() {
|
||||||
|
return mergeStrategy;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setMergeStrategy(MergeStrategy mergeStrategy) {
|
||||||
|
this.mergeStrategy = mergeStrategy;
|
||||||
|
}
|
||||||
|
|
||||||
public boolean isValid() {
|
public boolean isValid() {
|
||||||
return !Strings.isNullOrEmpty(getBranchToMerge())
|
return !Strings.isNullOrEmpty(getBranchToMerge())
|
||||||
&& !Strings.isNullOrEmpty(getTargetBranch());
|
&& !Strings.isNullOrEmpty(getTargetBranch());
|
||||||
@@ -74,12 +84,13 @@ public class MergeCommandRequest implements Validateable, Resetable, Serializabl
|
|||||||
|
|
||||||
return Objects.equal(branchToMerge, other.branchToMerge)
|
return Objects.equal(branchToMerge, other.branchToMerge)
|
||||||
&& Objects.equal(targetBranch, other.targetBranch)
|
&& Objects.equal(targetBranch, other.targetBranch)
|
||||||
&& Objects.equal(author, other.author);
|
&& Objects.equal(author, other.author)
|
||||||
|
&& Objects.equal(mergeStrategy, other.mergeStrategy);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public int hashCode() {
|
public int hashCode() {
|
||||||
return Objects.hashCode(branchToMerge, targetBranch, author);
|
return Objects.hashCode(branchToMerge, targetBranch, author, mergeStrategy);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@@ -88,6 +99,7 @@ public class MergeCommandRequest implements Validateable, Resetable, Serializabl
|
|||||||
.add("branchToMerge", branchToMerge)
|
.add("branchToMerge", branchToMerge)
|
||||||
.add("targetBranch", targetBranch)
|
.add("targetBranch", targetBranch)
|
||||||
.add("author", author)
|
.add("author", author)
|
||||||
|
.add("mergeStrategy", mergeStrategy)
|
||||||
.toString();
|
.toString();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -8,7 +8,7 @@ import sonia.scm.repository.Repository;
|
|||||||
import java.io.File;
|
import java.io.File;
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
|
|
||||||
public abstract class SimpleWorkdirFactory<R, C> implements WorkdirFactory<R, C> {
|
public abstract class SimpleWorkdirFactory<R, W, C> implements WorkdirFactory<R, W, C> {
|
||||||
|
|
||||||
private static final Logger logger = LoggerFactory.getLogger(SimpleWorkdirFactory.class);
|
private static final Logger logger = LoggerFactory.getLogger(SimpleWorkdirFactory.class);
|
||||||
|
|
||||||
@@ -19,11 +19,11 @@ public abstract class SimpleWorkdirFactory<R, C> implements WorkdirFactory<R, C>
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public WorkingCopy<R> createWorkingCopy(C context, String initialBranch) {
|
public WorkingCopy<R, W> createWorkingCopy(C context, String initialBranch) {
|
||||||
try {
|
try {
|
||||||
File directory = workdirProvider.createNewWorkdir();
|
File directory = workdirProvider.createNewWorkdir();
|
||||||
ParentAndClone<R> parentAndClone = cloneRepository(context, directory, initialBranch);
|
ParentAndClone<R, W> parentAndClone = cloneRepository(context, directory, initialBranch);
|
||||||
return new WorkingCopy<>(parentAndClone.getClone(), parentAndClone.getParent(), this::close, directory);
|
return new WorkingCopy<>(parentAndClone.getClone(), parentAndClone.getParent(), this::closeWorkdir, this::closeCentral, directory);
|
||||||
} catch (IOException e) {
|
} catch (IOException e) {
|
||||||
throw new InternalRepositoryException(getScmRepository(context), "could not clone repository in temporary directory", e);
|
throw new InternalRepositoryException(getScmRepository(context), "could not clone repository in temporary directory", e);
|
||||||
}
|
}
|
||||||
@@ -32,12 +32,15 @@ public abstract class SimpleWorkdirFactory<R, C> implements WorkdirFactory<R, C>
|
|||||||
protected abstract Repository getScmRepository(C context);
|
protected abstract Repository getScmRepository(C context);
|
||||||
|
|
||||||
@SuppressWarnings("squid:S00112")
|
@SuppressWarnings("squid:S00112")
|
||||||
// We do allow implementations to throw arbitrary exceptions here, so that we can handle them in close
|
// We do allow implementations to throw arbitrary exceptions here, so that we can handle them in closeCentral
|
||||||
protected abstract void closeRepository(R repository) throws Exception;
|
protected abstract void closeRepository(R repository) throws Exception;
|
||||||
|
@SuppressWarnings("squid:S00112")
|
||||||
|
// We do allow implementations to throw arbitrary exceptions here, so that we can handle them in closeWorkdir
|
||||||
|
protected abstract void closeWorkdirInternal(W workdir) throws Exception;
|
||||||
|
|
||||||
protected abstract ParentAndClone<R> cloneRepository(C context, File target, String initialBranch) throws IOException;
|
protected abstract ParentAndClone<R, W> cloneRepository(C context, File target, String initialBranch) throws IOException;
|
||||||
|
|
||||||
private void close(R repository) {
|
private void closeCentral(R repository) {
|
||||||
try {
|
try {
|
||||||
closeRepository(repository);
|
closeRepository(repository);
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
@@ -45,11 +48,19 @@ public abstract class SimpleWorkdirFactory<R, C> implements WorkdirFactory<R, C>
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
protected static class ParentAndClone<R> {
|
private void closeWorkdir(W repository) {
|
||||||
private final R parent;
|
try {
|
||||||
private final R clone;
|
closeWorkdirInternal(repository);
|
||||||
|
} catch (Exception e) {
|
||||||
|
logger.warn("could not close temporary repository clone", e);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
public ParentAndClone(R parent, R clone) {
|
protected static class ParentAndClone<R, W> {
|
||||||
|
private final R parent;
|
||||||
|
private final W clone;
|
||||||
|
|
||||||
|
public ParentAndClone(R parent, W clone) {
|
||||||
this.parent = parent;
|
this.parent = parent;
|
||||||
this.clone = clone;
|
this.clone = clone;
|
||||||
}
|
}
|
||||||
@@ -58,7 +69,7 @@ public abstract class SimpleWorkdirFactory<R, C> implements WorkdirFactory<R, C>
|
|||||||
return parent;
|
return parent;
|
||||||
}
|
}
|
||||||
|
|
||||||
public R getClone() {
|
public W getClone() {
|
||||||
return clone;
|
return clone;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
package sonia.scm.repository.util;
|
package sonia.scm.repository.util;
|
||||||
|
|
||||||
public interface WorkdirFactory<R, C> {
|
public interface WorkdirFactory<R, W, C> {
|
||||||
WorkingCopy<R> createWorkingCopy(C context, String initialBranch);
|
WorkingCopy<R, W> createWorkingCopy(C context, String initialBranch);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -8,23 +8,25 @@ import java.io.File;
|
|||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
import java.util.function.Consumer;
|
import java.util.function.Consumer;
|
||||||
|
|
||||||
public class WorkingCopy<R> implements AutoCloseable {
|
public class WorkingCopy<R, W> implements AutoCloseable {
|
||||||
|
|
||||||
private static final Logger LOG = LoggerFactory.getLogger(WorkingCopy.class);
|
private static final Logger LOG = LoggerFactory.getLogger(WorkingCopy.class);
|
||||||
|
|
||||||
private final File directory;
|
private final File directory;
|
||||||
private final R workingRepository;
|
private final W workingRepository;
|
||||||
private final R centralRepository;
|
private final R centralRepository;
|
||||||
private final Consumer<R> cleanup;
|
private final Consumer<W> cleanupWorkdir;
|
||||||
|
private final Consumer<R> cleanupCentral;
|
||||||
|
|
||||||
public WorkingCopy(R workingRepository, R centralRepository, Consumer<R> cleanup, File directory) {
|
public WorkingCopy(W workingRepository, R centralRepository, Consumer<W> cleanupWorkdir, Consumer<R> cleanupCentral, File directory) {
|
||||||
this.directory = directory;
|
this.directory = directory;
|
||||||
this.workingRepository = workingRepository;
|
this.workingRepository = workingRepository;
|
||||||
this.centralRepository = centralRepository;
|
this.centralRepository = centralRepository;
|
||||||
this.cleanup = cleanup;
|
this.cleanupCentral = cleanupCentral;
|
||||||
|
this.cleanupWorkdir = cleanupWorkdir;
|
||||||
}
|
}
|
||||||
|
|
||||||
public R getWorkingRepository() {
|
public W getWorkingRepository() {
|
||||||
return workingRepository;
|
return workingRepository;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -39,8 +41,8 @@ public class WorkingCopy<R> implements AutoCloseable {
|
|||||||
@Override
|
@Override
|
||||||
public void close() {
|
public void close() {
|
||||||
try {
|
try {
|
||||||
cleanup.accept(workingRepository);
|
cleanupWorkdir.accept(workingRepository);
|
||||||
cleanup.accept(centralRepository);
|
cleanupCentral.accept(centralRepository);
|
||||||
IOUtil.delete(directory);
|
IOUtil.delete(directory);
|
||||||
} catch (IOException e) {
|
} catch (IOException e) {
|
||||||
LOG.warn("could not delete temporary workdir '{}'", directory, e);
|
LOG.warn("could not delete temporary workdir '{}'", directory, e);
|
||||||
|
|||||||
@@ -24,14 +24,14 @@ public class SimpleWorkdirFactoryTest {
|
|||||||
|
|
||||||
@Rule
|
@Rule
|
||||||
public TemporaryFolder temporaryFolder = new TemporaryFolder();
|
public TemporaryFolder temporaryFolder = new TemporaryFolder();
|
||||||
private SimpleWorkdirFactory<Closeable, Context> simpleWorkdirFactory;
|
private SimpleWorkdirFactory<Closeable, Closeable, Context> simpleWorkdirFactory;
|
||||||
|
|
||||||
private String initialBranchForLastCloneCall;
|
private String initialBranchForLastCloneCall;
|
||||||
|
|
||||||
@Before
|
@Before
|
||||||
public void initFactory() throws IOException {
|
public void initFactory() throws IOException {
|
||||||
WorkdirProvider workdirProvider = new WorkdirProvider(temporaryFolder.newFolder());
|
WorkdirProvider workdirProvider = new WorkdirProvider(temporaryFolder.newFolder());
|
||||||
simpleWorkdirFactory = new SimpleWorkdirFactory<Closeable, Context>(workdirProvider) {
|
simpleWorkdirFactory = new SimpleWorkdirFactory<Closeable, Closeable, Context>(workdirProvider) {
|
||||||
@Override
|
@Override
|
||||||
protected Repository getScmRepository(Context context) {
|
protected Repository getScmRepository(Context context) {
|
||||||
return REPOSITORY;
|
return REPOSITORY;
|
||||||
@@ -43,7 +43,12 @@ public class SimpleWorkdirFactoryTest {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected ParentAndClone<Closeable> cloneRepository(Context context, File target, String initialBranch) {
|
protected void closeWorkdirInternal(Closeable workdir) throws Exception {
|
||||||
|
workdir.close();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected ParentAndClone<Closeable, Closeable> cloneRepository(Context context, File target, String initialBranch) {
|
||||||
initialBranchForLastCloneCall = initialBranch;
|
initialBranchForLastCloneCall = initialBranch;
|
||||||
return new ParentAndClone<>(parent, clone);
|
return new ParentAndClone<>(parent, clone);
|
||||||
}
|
}
|
||||||
@@ -53,7 +58,7 @@ public class SimpleWorkdirFactoryTest {
|
|||||||
@Test
|
@Test
|
||||||
public void shouldCreateParentAndClone() {
|
public void shouldCreateParentAndClone() {
|
||||||
Context context = new Context();
|
Context context = new Context();
|
||||||
try (WorkingCopy<Closeable> workingCopy = simpleWorkdirFactory.createWorkingCopy(context, null)) {
|
try (WorkingCopy<Closeable, Closeable> workingCopy = simpleWorkdirFactory.createWorkingCopy(context, null)) {
|
||||||
assertThat(workingCopy.getCentralRepository()).isSameAs(parent);
|
assertThat(workingCopy.getCentralRepository()).isSameAs(parent);
|
||||||
assertThat(workingCopy.getWorkingRepository()).isSameAs(clone);
|
assertThat(workingCopy.getWorkingRepository()).isSameAs(clone);
|
||||||
}
|
}
|
||||||
@@ -62,7 +67,7 @@ public class SimpleWorkdirFactoryTest {
|
|||||||
@Test
|
@Test
|
||||||
public void shouldCloseParent() throws IOException {
|
public void shouldCloseParent() throws IOException {
|
||||||
Context context = new Context();
|
Context context = new Context();
|
||||||
try (WorkingCopy<Closeable> workingCopy = simpleWorkdirFactory.createWorkingCopy(context, null)) {}
|
try (WorkingCopy<Closeable, Closeable> workingCopy = simpleWorkdirFactory.createWorkingCopy(context, null)) {}
|
||||||
|
|
||||||
verify(parent).close();
|
verify(parent).close();
|
||||||
}
|
}
|
||||||
@@ -70,7 +75,7 @@ public class SimpleWorkdirFactoryTest {
|
|||||||
@Test
|
@Test
|
||||||
public void shouldCloseClone() throws IOException {
|
public void shouldCloseClone() throws IOException {
|
||||||
Context context = new Context();
|
Context context = new Context();
|
||||||
try (WorkingCopy<Closeable> workingCopy = simpleWorkdirFactory.createWorkingCopy(context, null)) {}
|
try (WorkingCopy<Closeable, Closeable> workingCopy = simpleWorkdirFactory.createWorkingCopy(context, null)) {}
|
||||||
|
|
||||||
verify(clone).close();
|
verify(clone).close();
|
||||||
}
|
}
|
||||||
@@ -78,7 +83,7 @@ public class SimpleWorkdirFactoryTest {
|
|||||||
@Test
|
@Test
|
||||||
public void shouldPropagateInitialBranch() {
|
public void shouldPropagateInitialBranch() {
|
||||||
Context context = new Context();
|
Context context = new Context();
|
||||||
try (WorkingCopy<Closeable> workingCopy = simpleWorkdirFactory.createWorkingCopy(context, "some")) {
|
try (WorkingCopy<Closeable, Closeable> workingCopy = simpleWorkdirFactory.createWorkingCopy(context, "some")) {
|
||||||
assertThat(initialBranchForLastCloneCall).isEqualTo("some");
|
assertThat(initialBranchForLastCloneCall).isEqualTo("some");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,17 +0,0 @@
|
|||||||
[declarations]
|
|
||||||
../../scm-ui/ui-types/.*
|
|
||||||
../../scm-ui/ui-components/.*
|
|
||||||
../../scm-ui/ui-extensions/.*
|
|
||||||
../../scm-ui/ui-tests/.*
|
|
||||||
|
|
||||||
|
|
||||||
[include]
|
|
||||||
./src/**
|
|
||||||
../../scm-ui/ui-types/.*
|
|
||||||
../../scm-ui/ui-components/.*
|
|
||||||
../../scm-ui/ui-extensions/.*
|
|
||||||
../../scm-ui/ui-tests/.*
|
|
||||||
|
|
||||||
[options]
|
|
||||||
module.system.node.resolve_dirname=../../node_modules
|
|
||||||
module.name_mapper='^@scm-manager\/ui-\([a-zA-Z0-9_\-]+\)$' -> '<PROJECT_ROOT>/../../scm-ui/ui-\1'
|
|
||||||
@@ -1,49 +0,0 @@
|
|||||||
// flow-typed signature: e87b860fca7047001bcde4b8780a8655
|
|
||||||
// flow-typed version: <<STUB>>/@scm-manager/ui-extensions_v0.1.2/flow_v0.109.0
|
|
||||||
|
|
||||||
/**
|
|
||||||
* This is an autogenerated libdef stub for:
|
|
||||||
*
|
|
||||||
* '@scm-manager/ui-extensions'
|
|
||||||
*
|
|
||||||
* Fill this stub out by replacing all the `any` types.
|
|
||||||
*
|
|
||||||
* Once filled out, we encourage you to share your work with the
|
|
||||||
* community by sending a pull request to:
|
|
||||||
* https://github.com/flowtype/flow-typed
|
|
||||||
*/
|
|
||||||
|
|
||||||
declare module '@scm-manager/ui-extensions' {
|
|
||||||
declare module.exports: any;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* We include stubs for each file inside this npm package in case you need to
|
|
||||||
* require those files directly. Feel free to delete any files that aren't
|
|
||||||
* needed.
|
|
||||||
*/
|
|
||||||
declare module '@scm-manager/ui-extensions/lib/binder' {
|
|
||||||
declare module.exports: any;
|
|
||||||
}
|
|
||||||
|
|
||||||
declare module '@scm-manager/ui-extensions/lib/ExtensionPoint' {
|
|
||||||
declare module.exports: any;
|
|
||||||
}
|
|
||||||
|
|
||||||
declare module '@scm-manager/ui-extensions/lib' {
|
|
||||||
declare module.exports: any;
|
|
||||||
}
|
|
||||||
|
|
||||||
// Filename aliases
|
|
||||||
declare module '@scm-manager/ui-extensions/lib/binder.js' {
|
|
||||||
declare module.exports: $Exports<'@scm-manager/ui-extensions/lib/binder'>;
|
|
||||||
}
|
|
||||||
declare module '@scm-manager/ui-extensions/lib/ExtensionPoint.js' {
|
|
||||||
declare module.exports: $Exports<'@scm-manager/ui-extensions/lib/ExtensionPoint'>;
|
|
||||||
}
|
|
||||||
declare module '@scm-manager/ui-extensions/lib/index' {
|
|
||||||
declare module.exports: $Exports<'@scm-manager/ui-extensions/lib'>;
|
|
||||||
}
|
|
||||||
declare module '@scm-manager/ui-extensions/lib/index.js' {
|
|
||||||
declare module.exports: $Exports<'@scm-manager/ui-extensions/lib'>;
|
|
||||||
}
|
|
||||||
@@ -1,23 +0,0 @@
|
|||||||
// flow-typed signature: cf86673cc32d185bdab1d2ea90578d37
|
|
||||||
// flow-typed version: 614bf49aa8/classnames_v2.x.x/flow_>=v0.25.x
|
|
||||||
|
|
||||||
type $npm$classnames$Classes =
|
|
||||||
| string
|
|
||||||
| { [className: string]: * }
|
|
||||||
| false
|
|
||||||
| void
|
|
||||||
| null;
|
|
||||||
|
|
||||||
declare module "classnames" {
|
|
||||||
declare module.exports: (
|
|
||||||
...classes: Array<$npm$classnames$Classes | $npm$classnames$Classes[]>
|
|
||||||
) => string;
|
|
||||||
}
|
|
||||||
|
|
||||||
declare module "classnames/bind" {
|
|
||||||
declare module.exports: $Exports<"classnames">;
|
|
||||||
}
|
|
||||||
|
|
||||||
declare module "classnames/dedupe" {
|
|
||||||
declare module.exports: $Exports<"classnames">;
|
|
||||||
}
|
|
||||||
@@ -1,269 +0,0 @@
|
|||||||
// flow-typed signature: 761f01d8db9f91fa67135cb2120c2b8e
|
|
||||||
// flow-typed version: <<STUB>>/enzyme_v3.10.0/flow_v0.109.0
|
|
||||||
|
|
||||||
/**
|
|
||||||
* This is an autogenerated libdef stub for:
|
|
||||||
*
|
|
||||||
* 'enzyme'
|
|
||||||
*
|
|
||||||
* Fill this stub out by replacing all the `any` types.
|
|
||||||
*
|
|
||||||
* Once filled out, we encourage you to share your work with the
|
|
||||||
* community by sending a pull request to:
|
|
||||||
* https://github.com/flowtype/flow-typed
|
|
||||||
*/
|
|
||||||
|
|
||||||
declare module 'enzyme' {
|
|
||||||
declare module.exports: any;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* We include stubs for each file inside this npm package in case you need to
|
|
||||||
* require those files directly. Feel free to delete any files that aren't
|
|
||||||
* needed.
|
|
||||||
*/
|
|
||||||
declare module 'enzyme/build/configuration' {
|
|
||||||
declare module.exports: any;
|
|
||||||
}
|
|
||||||
|
|
||||||
declare module 'enzyme/build/Debug' {
|
|
||||||
declare module.exports: any;
|
|
||||||
}
|
|
||||||
|
|
||||||
declare module 'enzyme/build/EnzymeAdapter' {
|
|
||||||
declare module.exports: any;
|
|
||||||
}
|
|
||||||
|
|
||||||
declare module 'enzyme/build/getAdapter' {
|
|
||||||
declare module.exports: any;
|
|
||||||
}
|
|
||||||
|
|
||||||
declare module 'enzyme/build' {
|
|
||||||
declare module.exports: any;
|
|
||||||
}
|
|
||||||
|
|
||||||
declare module 'enzyme/build/mount' {
|
|
||||||
declare module.exports: any;
|
|
||||||
}
|
|
||||||
|
|
||||||
declare module 'enzyme/build/ReactWrapper' {
|
|
||||||
declare module.exports: any;
|
|
||||||
}
|
|
||||||
|
|
||||||
declare module 'enzyme/build/render' {
|
|
||||||
declare module.exports: any;
|
|
||||||
}
|
|
||||||
|
|
||||||
declare module 'enzyme/build/RSTTraversal' {
|
|
||||||
declare module.exports: any;
|
|
||||||
}
|
|
||||||
|
|
||||||
declare module 'enzyme/build/selectors' {
|
|
||||||
declare module.exports: any;
|
|
||||||
}
|
|
||||||
|
|
||||||
declare module 'enzyme/build/shallow' {
|
|
||||||
declare module.exports: any;
|
|
||||||
}
|
|
||||||
|
|
||||||
declare module 'enzyme/build/ShallowWrapper' {
|
|
||||||
declare module.exports: any;
|
|
||||||
}
|
|
||||||
|
|
||||||
declare module 'enzyme/build/Utils' {
|
|
||||||
declare module.exports: any;
|
|
||||||
}
|
|
||||||
|
|
||||||
declare module 'enzyme/build/validateAdapter' {
|
|
||||||
declare module.exports: any;
|
|
||||||
}
|
|
||||||
|
|
||||||
declare module 'enzyme/mount' {
|
|
||||||
declare module.exports: any;
|
|
||||||
}
|
|
||||||
|
|
||||||
declare module 'enzyme/ReactWrapper' {
|
|
||||||
declare module.exports: any;
|
|
||||||
}
|
|
||||||
|
|
||||||
declare module 'enzyme/render' {
|
|
||||||
declare module.exports: any;
|
|
||||||
}
|
|
||||||
|
|
||||||
declare module 'enzyme/shallow' {
|
|
||||||
declare module.exports: any;
|
|
||||||
}
|
|
||||||
|
|
||||||
declare module 'enzyme/ShallowWrapper' {
|
|
||||||
declare module.exports: any;
|
|
||||||
}
|
|
||||||
|
|
||||||
declare module 'enzyme/src/configuration' {
|
|
||||||
declare module.exports: any;
|
|
||||||
}
|
|
||||||
|
|
||||||
declare module 'enzyme/src/Debug' {
|
|
||||||
declare module.exports: any;
|
|
||||||
}
|
|
||||||
|
|
||||||
declare module 'enzyme/src/EnzymeAdapter' {
|
|
||||||
declare module.exports: any;
|
|
||||||
}
|
|
||||||
|
|
||||||
declare module 'enzyme/src/getAdapter' {
|
|
||||||
declare module.exports: any;
|
|
||||||
}
|
|
||||||
|
|
||||||
declare module 'enzyme/src' {
|
|
||||||
declare module.exports: any;
|
|
||||||
}
|
|
||||||
|
|
||||||
declare module 'enzyme/src/mount' {
|
|
||||||
declare module.exports: any;
|
|
||||||
}
|
|
||||||
|
|
||||||
declare module 'enzyme/src/ReactWrapper' {
|
|
||||||
declare module.exports: any;
|
|
||||||
}
|
|
||||||
|
|
||||||
declare module 'enzyme/src/render' {
|
|
||||||
declare module.exports: any;
|
|
||||||
}
|
|
||||||
|
|
||||||
declare module 'enzyme/src/RSTTraversal' {
|
|
||||||
declare module.exports: any;
|
|
||||||
}
|
|
||||||
|
|
||||||
declare module 'enzyme/src/selectors' {
|
|
||||||
declare module.exports: any;
|
|
||||||
}
|
|
||||||
|
|
||||||
declare module 'enzyme/src/shallow' {
|
|
||||||
declare module.exports: any;
|
|
||||||
}
|
|
||||||
|
|
||||||
declare module 'enzyme/src/ShallowWrapper' {
|
|
||||||
declare module.exports: any;
|
|
||||||
}
|
|
||||||
|
|
||||||
declare module 'enzyme/src/Utils' {
|
|
||||||
declare module.exports: any;
|
|
||||||
}
|
|
||||||
|
|
||||||
declare module 'enzyme/src/validateAdapter' {
|
|
||||||
declare module.exports: any;
|
|
||||||
}
|
|
||||||
|
|
||||||
declare module 'enzyme/withDom' {
|
|
||||||
declare module.exports: any;
|
|
||||||
}
|
|
||||||
|
|
||||||
// Filename aliases
|
|
||||||
declare module 'enzyme/build/configuration.js' {
|
|
||||||
declare module.exports: $Exports<'enzyme/build/configuration'>;
|
|
||||||
}
|
|
||||||
declare module 'enzyme/build/Debug.js' {
|
|
||||||
declare module.exports: $Exports<'enzyme/build/Debug'>;
|
|
||||||
}
|
|
||||||
declare module 'enzyme/build/EnzymeAdapter.js' {
|
|
||||||
declare module.exports: $Exports<'enzyme/build/EnzymeAdapter'>;
|
|
||||||
}
|
|
||||||
declare module 'enzyme/build/getAdapter.js' {
|
|
||||||
declare module.exports: $Exports<'enzyme/build/getAdapter'>;
|
|
||||||
}
|
|
||||||
declare module 'enzyme/build/index' {
|
|
||||||
declare module.exports: $Exports<'enzyme/build'>;
|
|
||||||
}
|
|
||||||
declare module 'enzyme/build/index.js' {
|
|
||||||
declare module.exports: $Exports<'enzyme/build'>;
|
|
||||||
}
|
|
||||||
declare module 'enzyme/build/mount.js' {
|
|
||||||
declare module.exports: $Exports<'enzyme/build/mount'>;
|
|
||||||
}
|
|
||||||
declare module 'enzyme/build/ReactWrapper.js' {
|
|
||||||
declare module.exports: $Exports<'enzyme/build/ReactWrapper'>;
|
|
||||||
}
|
|
||||||
declare module 'enzyme/build/render.js' {
|
|
||||||
declare module.exports: $Exports<'enzyme/build/render'>;
|
|
||||||
}
|
|
||||||
declare module 'enzyme/build/RSTTraversal.js' {
|
|
||||||
declare module.exports: $Exports<'enzyme/build/RSTTraversal'>;
|
|
||||||
}
|
|
||||||
declare module 'enzyme/build/selectors.js' {
|
|
||||||
declare module.exports: $Exports<'enzyme/build/selectors'>;
|
|
||||||
}
|
|
||||||
declare module 'enzyme/build/shallow.js' {
|
|
||||||
declare module.exports: $Exports<'enzyme/build/shallow'>;
|
|
||||||
}
|
|
||||||
declare module 'enzyme/build/ShallowWrapper.js' {
|
|
||||||
declare module.exports: $Exports<'enzyme/build/ShallowWrapper'>;
|
|
||||||
}
|
|
||||||
declare module 'enzyme/build/Utils.js' {
|
|
||||||
declare module.exports: $Exports<'enzyme/build/Utils'>;
|
|
||||||
}
|
|
||||||
declare module 'enzyme/build/validateAdapter.js' {
|
|
||||||
declare module.exports: $Exports<'enzyme/build/validateAdapter'>;
|
|
||||||
}
|
|
||||||
declare module 'enzyme/mount.js' {
|
|
||||||
declare module.exports: $Exports<'enzyme/mount'>;
|
|
||||||
}
|
|
||||||
declare module 'enzyme/ReactWrapper.js' {
|
|
||||||
declare module.exports: $Exports<'enzyme/ReactWrapper'>;
|
|
||||||
}
|
|
||||||
declare module 'enzyme/render.js' {
|
|
||||||
declare module.exports: $Exports<'enzyme/render'>;
|
|
||||||
}
|
|
||||||
declare module 'enzyme/shallow.js' {
|
|
||||||
declare module.exports: $Exports<'enzyme/shallow'>;
|
|
||||||
}
|
|
||||||
declare module 'enzyme/ShallowWrapper.js' {
|
|
||||||
declare module.exports: $Exports<'enzyme/ShallowWrapper'>;
|
|
||||||
}
|
|
||||||
declare module 'enzyme/src/configuration.js' {
|
|
||||||
declare module.exports: $Exports<'enzyme/src/configuration'>;
|
|
||||||
}
|
|
||||||
declare module 'enzyme/src/Debug.js' {
|
|
||||||
declare module.exports: $Exports<'enzyme/src/Debug'>;
|
|
||||||
}
|
|
||||||
declare module 'enzyme/src/EnzymeAdapter.js' {
|
|
||||||
declare module.exports: $Exports<'enzyme/src/EnzymeAdapter'>;
|
|
||||||
}
|
|
||||||
declare module 'enzyme/src/getAdapter.js' {
|
|
||||||
declare module.exports: $Exports<'enzyme/src/getAdapter'>;
|
|
||||||
}
|
|
||||||
declare module 'enzyme/src/index' {
|
|
||||||
declare module.exports: $Exports<'enzyme/src'>;
|
|
||||||
}
|
|
||||||
declare module 'enzyme/src/index.js' {
|
|
||||||
declare module.exports: $Exports<'enzyme/src'>;
|
|
||||||
}
|
|
||||||
declare module 'enzyme/src/mount.js' {
|
|
||||||
declare module.exports: $Exports<'enzyme/src/mount'>;
|
|
||||||
}
|
|
||||||
declare module 'enzyme/src/ReactWrapper.js' {
|
|
||||||
declare module.exports: $Exports<'enzyme/src/ReactWrapper'>;
|
|
||||||
}
|
|
||||||
declare module 'enzyme/src/render.js' {
|
|
||||||
declare module.exports: $Exports<'enzyme/src/render'>;
|
|
||||||
}
|
|
||||||
declare module 'enzyme/src/RSTTraversal.js' {
|
|
||||||
declare module.exports: $Exports<'enzyme/src/RSTTraversal'>;
|
|
||||||
}
|
|
||||||
declare module 'enzyme/src/selectors.js' {
|
|
||||||
declare module.exports: $Exports<'enzyme/src/selectors'>;
|
|
||||||
}
|
|
||||||
declare module 'enzyme/src/shallow.js' {
|
|
||||||
declare module.exports: $Exports<'enzyme/src/shallow'>;
|
|
||||||
}
|
|
||||||
declare module 'enzyme/src/ShallowWrapper.js' {
|
|
||||||
declare module.exports: $Exports<'enzyme/src/ShallowWrapper'>;
|
|
||||||
}
|
|
||||||
declare module 'enzyme/src/Utils.js' {
|
|
||||||
declare module.exports: $Exports<'enzyme/src/Utils'>;
|
|
||||||
}
|
|
||||||
declare module 'enzyme/src/validateAdapter.js' {
|
|
||||||
declare module.exports: $Exports<'enzyme/src/validateAdapter'>;
|
|
||||||
}
|
|
||||||
declare module 'enzyme/withDom.js' {
|
|
||||||
declare module.exports: $Exports<'enzyme/withDom'>;
|
|
||||||
}
|
|
||||||
@@ -1,66 +0,0 @@
|
|||||||
// flow-typed signature: 9be79ea52a669f6c266677d1d0bd3e9d
|
|
||||||
// flow-typed version: <<STUB>>/gitdiff-parser_v0.1.2/flow_v0.109.0
|
|
||||||
|
|
||||||
/**
|
|
||||||
* This is an autogenerated libdef stub for:
|
|
||||||
*
|
|
||||||
* 'gitdiff-parser'
|
|
||||||
*
|
|
||||||
* Fill this stub out by replacing all the `any` types.
|
|
||||||
*
|
|
||||||
* Once filled out, we encourage you to share your work with the
|
|
||||||
* community by sending a pull request to:
|
|
||||||
* https://github.com/flowtype/flow-typed
|
|
||||||
*/
|
|
||||||
|
|
||||||
declare module 'gitdiff-parser' {
|
|
||||||
declare module.exports: any;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* We include stubs for each file inside this npm package in case you need to
|
|
||||||
* require those files directly. Feel free to delete any files that aren't
|
|
||||||
* needed.
|
|
||||||
*/
|
|
||||||
declare module 'gitdiff-parser/test/git.test' {
|
|
||||||
declare module.exports: any;
|
|
||||||
}
|
|
||||||
|
|
||||||
declare module 'gitdiff-parser/test/hg' {
|
|
||||||
declare module.exports: any;
|
|
||||||
}
|
|
||||||
|
|
||||||
declare module 'gitdiff-parser/test/hg.test' {
|
|
||||||
declare module.exports: any;
|
|
||||||
}
|
|
||||||
|
|
||||||
declare module 'gitdiff-parser/test/perf-parse-diff' {
|
|
||||||
declare module.exports: any;
|
|
||||||
}
|
|
||||||
|
|
||||||
declare module 'gitdiff-parser/test/perf' {
|
|
||||||
declare module.exports: any;
|
|
||||||
}
|
|
||||||
|
|
||||||
// Filename aliases
|
|
||||||
declare module 'gitdiff-parser/index' {
|
|
||||||
declare module.exports: $Exports<'gitdiff-parser'>;
|
|
||||||
}
|
|
||||||
declare module 'gitdiff-parser/index.js' {
|
|
||||||
declare module.exports: $Exports<'gitdiff-parser'>;
|
|
||||||
}
|
|
||||||
declare module 'gitdiff-parser/test/git.test.js' {
|
|
||||||
declare module.exports: $Exports<'gitdiff-parser/test/git.test'>;
|
|
||||||
}
|
|
||||||
declare module 'gitdiff-parser/test/hg.js' {
|
|
||||||
declare module.exports: $Exports<'gitdiff-parser/test/hg'>;
|
|
||||||
}
|
|
||||||
declare module 'gitdiff-parser/test/hg.test.js' {
|
|
||||||
declare module.exports: $Exports<'gitdiff-parser/test/hg.test'>;
|
|
||||||
}
|
|
||||||
declare module 'gitdiff-parser/test/perf-parse-diff.js' {
|
|
||||||
declare module.exports: $Exports<'gitdiff-parser/test/perf-parse-diff'>;
|
|
||||||
}
|
|
||||||
declare module 'gitdiff-parser/test/perf.js' {
|
|
||||||
declare module.exports: $Exports<'gitdiff-parser/test/perf'>;
|
|
||||||
}
|
|
||||||
File diff suppressed because it is too large
Load Diff
@@ -1,331 +0,0 @@
|
|||||||
// flow-typed signature: 23b805356f90ad9384dd88489654e380
|
|
||||||
// flow-typed version: e9374c5fe9/moment_v2.3.x/flow_>=v0.25.x
|
|
||||||
|
|
||||||
type moment$MomentOptions = {
|
|
||||||
y?: number | string,
|
|
||||||
year?: number | string,
|
|
||||||
years?: number | string,
|
|
||||||
M?: number | string,
|
|
||||||
month?: number | string,
|
|
||||||
months?: number | string,
|
|
||||||
d?: number | string,
|
|
||||||
day?: number | string,
|
|
||||||
days?: number | string,
|
|
||||||
date?: number | string,
|
|
||||||
h?: number | string,
|
|
||||||
hour?: number | string,
|
|
||||||
hours?: number | string,
|
|
||||||
m?: number | string,
|
|
||||||
minute?: number | string,
|
|
||||||
minutes?: number | string,
|
|
||||||
s?: number | string,
|
|
||||||
second?: number | string,
|
|
||||||
seconds?: number | string,
|
|
||||||
ms?: number | string,
|
|
||||||
millisecond?: number | string,
|
|
||||||
milliseconds?: number | string
|
|
||||||
};
|
|
||||||
|
|
||||||
type moment$MomentObject = {
|
|
||||||
years: number,
|
|
||||||
months: number,
|
|
||||||
date: number,
|
|
||||||
hours: number,
|
|
||||||
minutes: number,
|
|
||||||
seconds: number,
|
|
||||||
milliseconds: number
|
|
||||||
};
|
|
||||||
|
|
||||||
type moment$MomentCreationData = {
|
|
||||||
input: string,
|
|
||||||
format: string,
|
|
||||||
locale: Object,
|
|
||||||
isUTC: boolean,
|
|
||||||
strict: boolean
|
|
||||||
};
|
|
||||||
|
|
||||||
type moment$CalendarFormat = string | ((moment: moment$Moment) => string);
|
|
||||||
|
|
||||||
type moment$CalendarFormats = {
|
|
||||||
sameDay?: moment$CalendarFormat,
|
|
||||||
nextDay?: moment$CalendarFormat,
|
|
||||||
nextWeek?: moment$CalendarFormat,
|
|
||||||
lastDay?: moment$CalendarFormat,
|
|
||||||
lastWeek?: moment$CalendarFormat,
|
|
||||||
sameElse?: moment$CalendarFormat
|
|
||||||
};
|
|
||||||
|
|
||||||
declare class moment$LocaleData {
|
|
||||||
months(moment: moment$Moment): string,
|
|
||||||
monthsShort(moment: moment$Moment): string,
|
|
||||||
monthsParse(month: string): number,
|
|
||||||
weekdays(moment: moment$Moment): string,
|
|
||||||
weekdaysShort(moment: moment$Moment): string,
|
|
||||||
weekdaysMin(moment: moment$Moment): string,
|
|
||||||
weekdaysParse(weekDay: string): number,
|
|
||||||
longDateFormat(dateFormat: string): string,
|
|
||||||
isPM(date: string): boolean,
|
|
||||||
meridiem(hours: number, minutes: number, isLower: boolean): string,
|
|
||||||
calendar(
|
|
||||||
key:
|
|
||||||
| "sameDay"
|
|
||||||
| "nextDay"
|
|
||||||
| "lastDay"
|
|
||||||
| "nextWeek"
|
|
||||||
| "prevWeek"
|
|
||||||
| "sameElse",
|
|
||||||
moment: moment$Moment
|
|
||||||
): string,
|
|
||||||
relativeTime(
|
|
||||||
number: number,
|
|
||||||
withoutSuffix: boolean,
|
|
||||||
key: "s" | "m" | "mm" | "h" | "hh" | "d" | "dd" | "M" | "MM" | "y" | "yy",
|
|
||||||
isFuture: boolean
|
|
||||||
): string,
|
|
||||||
pastFuture(diff: any, relTime: string): string,
|
|
||||||
ordinal(number: number): string,
|
|
||||||
preparse(str: string): any,
|
|
||||||
postformat(str: string): any,
|
|
||||||
week(moment: moment$Moment): string,
|
|
||||||
invalidDate(): string,
|
|
||||||
firstDayOfWeek(): number,
|
|
||||||
firstDayOfYear(): number
|
|
||||||
}
|
|
||||||
declare class moment$MomentDuration {
|
|
||||||
humanize(suffix?: boolean): string,
|
|
||||||
milliseconds(): number,
|
|
||||||
asMilliseconds(): number,
|
|
||||||
seconds(): number,
|
|
||||||
asSeconds(): number,
|
|
||||||
minutes(): number,
|
|
||||||
asMinutes(): number,
|
|
||||||
hours(): number,
|
|
||||||
asHours(): number,
|
|
||||||
days(): number,
|
|
||||||
asDays(): number,
|
|
||||||
months(): number,
|
|
||||||
asWeeks(): number,
|
|
||||||
weeks(): number,
|
|
||||||
asMonths(): number,
|
|
||||||
years(): number,
|
|
||||||
asYears(): number,
|
|
||||||
add(value: number | moment$MomentDuration | Object, unit?: string): this,
|
|
||||||
subtract(value: number | moment$MomentDuration | Object, unit?: string): this,
|
|
||||||
as(unit: string): number,
|
|
||||||
get(unit: string): number,
|
|
||||||
toJSON(): string,
|
|
||||||
toISOString(): string,
|
|
||||||
isValid(): boolean
|
|
||||||
}
|
|
||||||
declare class moment$Moment {
|
|
||||||
static ISO_8601: string,
|
|
||||||
static (
|
|
||||||
string?: string,
|
|
||||||
format?: string | Array<string>,
|
|
||||||
strict?: boolean
|
|
||||||
): moment$Moment,
|
|
||||||
static (
|
|
||||||
string?: string,
|
|
||||||
format?: string | Array<string>,
|
|
||||||
locale?: string,
|
|
||||||
strict?: boolean
|
|
||||||
): moment$Moment,
|
|
||||||
static (
|
|
||||||
initDate: ?Object | number | Date | Array<number> | moment$Moment | string
|
|
||||||
): moment$Moment,
|
|
||||||
static unix(seconds: number): moment$Moment,
|
|
||||||
static utc(): moment$Moment,
|
|
||||||
static utc(number: number | Array<number>): moment$Moment,
|
|
||||||
static utc(
|
|
||||||
str: string,
|
|
||||||
str2?: string | Array<string>,
|
|
||||||
str3?: string
|
|
||||||
): moment$Moment,
|
|
||||||
static utc(moment: moment$Moment): moment$Moment,
|
|
||||||
static utc(date: Date): moment$Moment,
|
|
||||||
static parseZone(): moment$Moment,
|
|
||||||
static parseZone(rawDate: string): moment$Moment,
|
|
||||||
static parseZone(
|
|
||||||
rawDate: string,
|
|
||||||
format: string | Array<string>
|
|
||||||
): moment$Moment,
|
|
||||||
static parseZone(
|
|
||||||
rawDate: string,
|
|
||||||
format: string,
|
|
||||||
strict: boolean
|
|
||||||
): moment$Moment,
|
|
||||||
static parseZone(
|
|
||||||
rawDate: string,
|
|
||||||
format: string,
|
|
||||||
locale: string,
|
|
||||||
strict: boolean
|
|
||||||
): moment$Moment,
|
|
||||||
isValid(): boolean,
|
|
||||||
invalidAt(): 0 | 1 | 2 | 3 | 4 | 5 | 6,
|
|
||||||
creationData(): moment$MomentCreationData,
|
|
||||||
millisecond(number: number): this,
|
|
||||||
milliseconds(number: number): this,
|
|
||||||
millisecond(): number,
|
|
||||||
milliseconds(): number,
|
|
||||||
second(number: number): this,
|
|
||||||
seconds(number: number): this,
|
|
||||||
second(): number,
|
|
||||||
seconds(): number,
|
|
||||||
minute(number: number): this,
|
|
||||||
minutes(number: number): this,
|
|
||||||
minute(): number,
|
|
||||||
minutes(): number,
|
|
||||||
hour(number: number): this,
|
|
||||||
hours(number: number): this,
|
|
||||||
hour(): number,
|
|
||||||
hours(): number,
|
|
||||||
date(number: number): this,
|
|
||||||
dates(number: number): this,
|
|
||||||
date(): number,
|
|
||||||
dates(): number,
|
|
||||||
day(day: number | string): this,
|
|
||||||
days(day: number | string): this,
|
|
||||||
day(): number,
|
|
||||||
days(): number,
|
|
||||||
weekday(number: number): this,
|
|
||||||
weekday(): number,
|
|
||||||
isoWeekday(number: number): this,
|
|
||||||
isoWeekday(): number,
|
|
||||||
dayOfYear(number: number): this,
|
|
||||||
dayOfYear(): number,
|
|
||||||
week(number: number): this,
|
|
||||||
weeks(number: number): this,
|
|
||||||
week(): number,
|
|
||||||
weeks(): number,
|
|
||||||
isoWeek(number: number): this,
|
|
||||||
isoWeeks(number: number): this,
|
|
||||||
isoWeek(): number,
|
|
||||||
isoWeeks(): number,
|
|
||||||
month(number: number): this,
|
|
||||||
months(number: number): this,
|
|
||||||
month(): number,
|
|
||||||
months(): number,
|
|
||||||
quarter(number: number): this,
|
|
||||||
quarter(): number,
|
|
||||||
year(number: number): this,
|
|
||||||
years(number: number): this,
|
|
||||||
year(): number,
|
|
||||||
years(): number,
|
|
||||||
weekYear(number: number): this,
|
|
||||||
weekYear(): number,
|
|
||||||
isoWeekYear(number: number): this,
|
|
||||||
isoWeekYear(): number,
|
|
||||||
weeksInYear(): number,
|
|
||||||
isoWeeksInYear(): number,
|
|
||||||
get(string: string): number,
|
|
||||||
set(unit: string, value: number): this,
|
|
||||||
set(options: { [unit: string]: number }): this,
|
|
||||||
static max(...dates: Array<moment$Moment>): moment$Moment,
|
|
||||||
static max(dates: Array<moment$Moment>): moment$Moment,
|
|
||||||
static min(...dates: Array<moment$Moment>): moment$Moment,
|
|
||||||
static min(dates: Array<moment$Moment>): moment$Moment,
|
|
||||||
add(
|
|
||||||
value: number | moment$MomentDuration | moment$Moment | Object,
|
|
||||||
unit?: string
|
|
||||||
): this,
|
|
||||||
subtract(
|
|
||||||
value: number | moment$MomentDuration | moment$Moment | string | Object,
|
|
||||||
unit?: string
|
|
||||||
): this,
|
|
||||||
startOf(unit: string): this,
|
|
||||||
endOf(unit: string): this,
|
|
||||||
local(): this,
|
|
||||||
utc(): this,
|
|
||||||
utcOffset(
|
|
||||||
offset: number | string,
|
|
||||||
keepLocalTime?: boolean,
|
|
||||||
keepMinutes?: boolean
|
|
||||||
): this,
|
|
||||||
utcOffset(): number,
|
|
||||||
format(format?: string): string,
|
|
||||||
fromNow(removeSuffix?: boolean): string,
|
|
||||||
from(
|
|
||||||
value: moment$Moment | string | number | Date | Array<number>,
|
|
||||||
removePrefix?: boolean
|
|
||||||
): string,
|
|
||||||
toNow(removePrefix?: boolean): string,
|
|
||||||
to(
|
|
||||||
value: moment$Moment | string | number | Date | Array<number>,
|
|
||||||
removePrefix?: boolean
|
|
||||||
): string,
|
|
||||||
calendar(refTime?: any, formats?: moment$CalendarFormats): string,
|
|
||||||
diff(
|
|
||||||
date: moment$Moment | string | number | Date | Array<number>,
|
|
||||||
format?: string,
|
|
||||||
floating?: boolean
|
|
||||||
): number,
|
|
||||||
valueOf(): number,
|
|
||||||
unix(): number,
|
|
||||||
daysInMonth(): number,
|
|
||||||
toDate(): Date,
|
|
||||||
toArray(): Array<number>,
|
|
||||||
toJSON(): string,
|
|
||||||
toISOString(
|
|
||||||
keepOffset?: boolean
|
|
||||||
): string,
|
|
||||||
toObject(): moment$MomentObject,
|
|
||||||
isBefore(
|
|
||||||
date?: moment$Moment | string | number | Date | Array<number>,
|
|
||||||
units?: ?string
|
|
||||||
): boolean,
|
|
||||||
isSame(
|
|
||||||
date?: moment$Moment | string | number | Date | Array<number>,
|
|
||||||
units?: ?string
|
|
||||||
): boolean,
|
|
||||||
isAfter(
|
|
||||||
date?: moment$Moment | string | number | Date | Array<number>,
|
|
||||||
units?: ?string
|
|
||||||
): boolean,
|
|
||||||
isSameOrBefore(
|
|
||||||
date?: moment$Moment | string | number | Date | Array<number>,
|
|
||||||
units?: ?string
|
|
||||||
): boolean,
|
|
||||||
isSameOrAfter(
|
|
||||||
date?: moment$Moment | string | number | Date | Array<number>,
|
|
||||||
units?: ?string
|
|
||||||
): boolean,
|
|
||||||
isBetween(
|
|
||||||
fromDate: moment$Moment | string | number | Date | Array<number>,
|
|
||||||
toDate?: ?moment$Moment | string | number | Date | Array<number>,
|
|
||||||
granularity?: ?string,
|
|
||||||
inclusion?: ?string
|
|
||||||
): boolean,
|
|
||||||
isDST(): boolean,
|
|
||||||
isDSTShifted(): boolean,
|
|
||||||
isLeapYear(): boolean,
|
|
||||||
clone(): moment$Moment,
|
|
||||||
static isMoment(obj: any): boolean,
|
|
||||||
static isDate(obj: any): boolean,
|
|
||||||
static locale(locale: string, localeData?: Object): string,
|
|
||||||
static updateLocale(locale: string, localeData?: ?Object): void,
|
|
||||||
static locale(locales: Array<string>): string,
|
|
||||||
locale(locale: string, customization?: Object | null): moment$Moment,
|
|
||||||
locale(): string,
|
|
||||||
static months(): Array<string>,
|
|
||||||
static monthsShort(): Array<string>,
|
|
||||||
static weekdays(): Array<string>,
|
|
||||||
static weekdaysShort(): Array<string>,
|
|
||||||
static weekdaysMin(): Array<string>,
|
|
||||||
static months(): string,
|
|
||||||
static monthsShort(): string,
|
|
||||||
static weekdays(): string,
|
|
||||||
static weekdaysShort(): string,
|
|
||||||
static weekdaysMin(): string,
|
|
||||||
static localeData(key?: string): moment$LocaleData,
|
|
||||||
static duration(
|
|
||||||
value: number | Object | string,
|
|
||||||
unit?: string
|
|
||||||
): moment$MomentDuration,
|
|
||||||
static isDuration(obj: any): boolean,
|
|
||||||
static normalizeUnits(unit: string): string,
|
|
||||||
static invalid(object: any): moment$Moment
|
|
||||||
}
|
|
||||||
|
|
||||||
declare module "moment" {
|
|
||||||
declare module.exports: Class<moment$Moment>;
|
|
||||||
}
|
|
||||||
@@ -1,22 +0,0 @@
|
|||||||
// flow-typed signature: 45d44f189fa426ca21dee3f5149a4f99
|
|
||||||
// flow-typed version: c6154227d1/query-string_v5.x.x/flow_>=v0.104.x
|
|
||||||
|
|
||||||
declare module "query-string" {
|
|
||||||
declare type ArrayFormat = "none" | "bracket" | "index";
|
|
||||||
declare type ParseOptions = {|
|
|
||||||
arrayFormat?: ArrayFormat
|
|
||||||
|};
|
|
||||||
|
|
||||||
declare type StringifyOptions = {|
|
|
||||||
arrayFormat?: ArrayFormat,
|
|
||||||
encode?: boolean,
|
|
||||||
strict?: boolean
|
|
||||||
|};
|
|
||||||
|
|
||||||
declare module.exports: {
|
|
||||||
extract(str: string): string,
|
|
||||||
parse(str: string, opts?: ParseOptions): Object,
|
|
||||||
stringify(obj: Object, opts?: StringifyOptions): string,
|
|
||||||
...
|
|
||||||
};
|
|
||||||
}
|
|
||||||
@@ -1,139 +0,0 @@
|
|||||||
// flow-typed signature: 35264e970923e4f3cda147e7c17e2407
|
|
||||||
// flow-typed version: <<STUB>>/react-diff-view_v1.8.1/flow_v0.109.0
|
|
||||||
|
|
||||||
/**
|
|
||||||
* This is an autogenerated libdef stub for:
|
|
||||||
*
|
|
||||||
* 'react-diff-view'
|
|
||||||
*
|
|
||||||
* Fill this stub out by replacing all the `any` types.
|
|
||||||
*
|
|
||||||
* Once filled out, we encourage you to share your work with the
|
|
||||||
* community by sending a pull request to:
|
|
||||||
* https://github.com/flowtype/flow-typed
|
|
||||||
*/
|
|
||||||
|
|
||||||
declare module 'react-diff-view' {
|
|
||||||
declare module.exports: any;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* We include stubs for each file inside this npm package in case you need to
|
|
||||||
* require those files directly. Feel free to delete any files that aren't
|
|
||||||
* needed.
|
|
||||||
*/
|
|
||||||
declare module 'react-diff-view/parse' {
|
|
||||||
declare module.exports: any;
|
|
||||||
}
|
|
||||||
|
|
||||||
declare module 'react-diff-view/src/CodeCell' {
|
|
||||||
declare module.exports: any;
|
|
||||||
}
|
|
||||||
|
|
||||||
declare module 'react-diff-view/src/Diff' {
|
|
||||||
declare module.exports: any;
|
|
||||||
}
|
|
||||||
|
|
||||||
declare module 'react-diff-view/src/Hunk' {
|
|
||||||
declare module.exports: any;
|
|
||||||
}
|
|
||||||
|
|
||||||
declare module 'react-diff-view/src' {
|
|
||||||
declare module.exports: any;
|
|
||||||
}
|
|
||||||
|
|
||||||
declare module 'react-diff-view/src/parse' {
|
|
||||||
declare module.exports: any;
|
|
||||||
}
|
|
||||||
|
|
||||||
declare module 'react-diff-view/src/propTypes' {
|
|
||||||
declare module.exports: any;
|
|
||||||
}
|
|
||||||
|
|
||||||
declare module 'react-diff-view/src/selectors' {
|
|
||||||
declare module.exports: any;
|
|
||||||
}
|
|
||||||
|
|
||||||
declare module 'react-diff-view/src/SplitChange' {
|
|
||||||
declare module.exports: any;
|
|
||||||
}
|
|
||||||
|
|
||||||
declare module 'react-diff-view/src/SplitHunk' {
|
|
||||||
declare module.exports: any;
|
|
||||||
}
|
|
||||||
|
|
||||||
declare module 'react-diff-view/src/SplitWidget' {
|
|
||||||
declare module.exports: any;
|
|
||||||
}
|
|
||||||
|
|
||||||
declare module 'react-diff-view/src/UnifiedChange' {
|
|
||||||
declare module.exports: any;
|
|
||||||
}
|
|
||||||
|
|
||||||
declare module 'react-diff-view/src/UnifiedHunk' {
|
|
||||||
declare module.exports: any;
|
|
||||||
}
|
|
||||||
|
|
||||||
declare module 'react-diff-view/src/UnifiedWidget' {
|
|
||||||
declare module.exports: any;
|
|
||||||
}
|
|
||||||
|
|
||||||
declare module 'react-diff-view/src/utils' {
|
|
||||||
declare module.exports: any;
|
|
||||||
}
|
|
||||||
|
|
||||||
// Filename aliases
|
|
||||||
declare module 'react-diff-view/index' {
|
|
||||||
declare module.exports: $Exports<'react-diff-view'>;
|
|
||||||
}
|
|
||||||
declare module 'react-diff-view/index.js' {
|
|
||||||
declare module.exports: $Exports<'react-diff-view'>;
|
|
||||||
}
|
|
||||||
declare module 'react-diff-view/parse.js' {
|
|
||||||
declare module.exports: $Exports<'react-diff-view/parse'>;
|
|
||||||
}
|
|
||||||
declare module 'react-diff-view/src/CodeCell.js' {
|
|
||||||
declare module.exports: $Exports<'react-diff-view/src/CodeCell'>;
|
|
||||||
}
|
|
||||||
declare module 'react-diff-view/src/Diff.js' {
|
|
||||||
declare module.exports: $Exports<'react-diff-view/src/Diff'>;
|
|
||||||
}
|
|
||||||
declare module 'react-diff-view/src/Hunk.js' {
|
|
||||||
declare module.exports: $Exports<'react-diff-view/src/Hunk'>;
|
|
||||||
}
|
|
||||||
declare module 'react-diff-view/src/index' {
|
|
||||||
declare module.exports: $Exports<'react-diff-view/src'>;
|
|
||||||
}
|
|
||||||
declare module 'react-diff-view/src/index.js' {
|
|
||||||
declare module.exports: $Exports<'react-diff-view/src'>;
|
|
||||||
}
|
|
||||||
declare module 'react-diff-view/src/parse.js' {
|
|
||||||
declare module.exports: $Exports<'react-diff-view/src/parse'>;
|
|
||||||
}
|
|
||||||
declare module 'react-diff-view/src/propTypes.js' {
|
|
||||||
declare module.exports: $Exports<'react-diff-view/src/propTypes'>;
|
|
||||||
}
|
|
||||||
declare module 'react-diff-view/src/selectors.js' {
|
|
||||||
declare module.exports: $Exports<'react-diff-view/src/selectors'>;
|
|
||||||
}
|
|
||||||
declare module 'react-diff-view/src/SplitChange.js' {
|
|
||||||
declare module.exports: $Exports<'react-diff-view/src/SplitChange'>;
|
|
||||||
}
|
|
||||||
declare module 'react-diff-view/src/SplitHunk.js' {
|
|
||||||
declare module.exports: $Exports<'react-diff-view/src/SplitHunk'>;
|
|
||||||
}
|
|
||||||
declare module 'react-diff-view/src/SplitWidget.js' {
|
|
||||||
declare module.exports: $Exports<'react-diff-view/src/SplitWidget'>;
|
|
||||||
}
|
|
||||||
declare module 'react-diff-view/src/UnifiedChange.js' {
|
|
||||||
declare module.exports: $Exports<'react-diff-view/src/UnifiedChange'>;
|
|
||||||
}
|
|
||||||
declare module 'react-diff-view/src/UnifiedHunk.js' {
|
|
||||||
declare module.exports: $Exports<'react-diff-view/src/UnifiedHunk'>;
|
|
||||||
}
|
|
||||||
declare module 'react-diff-view/src/UnifiedWidget.js' {
|
|
||||||
declare module.exports: $Exports<'react-diff-view/src/UnifiedWidget'>;
|
|
||||||
}
|
|
||||||
declare module 'react-diff-view/src/utils.js' {
|
|
||||||
declare module.exports: $Exports<'react-diff-view/src/utils'>;
|
|
||||||
}
|
|
||||||
@@ -1,110 +0,0 @@
|
|||||||
// flow-typed signature: e48526194d458ea4787ca56d830092da
|
|
||||||
// flow-typed version: c6154227d1/react-i18next_v7.x.x/flow_>=v0.104.x
|
|
||||||
|
|
||||||
declare module "react-i18next" {
|
|
||||||
declare type TFunction = (key?: ?string, data?: ?Object) => string;
|
|
||||||
|
|
||||||
declare type TranslatorProps = {|
|
|
||||||
t: TFunction,
|
|
||||||
i18nLoadedAt: Date,
|
|
||||||
i18n: Object
|
|
||||||
|};
|
|
||||||
|
|
||||||
declare type TranslatorPropsVoid = {
|
|
||||||
t: TFunction | void,
|
|
||||||
i18nLoadedAt: Date | void,
|
|
||||||
i18n: Object | void,
|
|
||||||
...
|
|
||||||
};
|
|
||||||
|
|
||||||
declare type Translator<P: {...}, Component: React$ComponentType<P>> = (
|
|
||||||
WrappedComponent: Component
|
|
||||||
) => React$ComponentType<
|
|
||||||
$Diff<React$ElementConfig<Component>, TranslatorPropsVoid>
|
|
||||||
>;
|
|
||||||
|
|
||||||
declare type TranslateOptions = $Shape<{
|
|
||||||
wait: boolean,
|
|
||||||
nsMode: "default" | "fallback",
|
|
||||||
bindi18n: false | string,
|
|
||||||
bindStore: false | string,
|
|
||||||
withRef: boolean,
|
|
||||||
translateFuncName: string,
|
|
||||||
i18n: Object,
|
|
||||||
usePureComponent: boolean,
|
|
||||||
...
|
|
||||||
}>;
|
|
||||||
|
|
||||||
declare function translate<P: {...}, Component: React$ComponentType<P>>(
|
|
||||||
namespaces?: | string
|
|
||||||
| Array<string>
|
|
||||||
| (($Diff<P, TranslatorPropsVoid>) => string | Array<string>),
|
|
||||||
options?: TranslateOptions
|
|
||||||
): Translator<P, Component>;
|
|
||||||
|
|
||||||
declare type I18nProps = {
|
|
||||||
i18n?: Object,
|
|
||||||
ns?: string | Array<string>,
|
|
||||||
children: (t: TFunction, {
|
|
||||||
i18n: Object,
|
|
||||||
t: TFunction,
|
|
||||||
...
|
|
||||||
}) => React$Node,
|
|
||||||
initialI18nStore?: Object,
|
|
||||||
initialLanguage?: string,
|
|
||||||
...
|
|
||||||
};
|
|
||||||
declare var I18n: React$ComponentType<I18nProps>;
|
|
||||||
|
|
||||||
declare type InterpolateProps = {
|
|
||||||
className?: string,
|
|
||||||
dangerouslySetInnerHTMLPartElement?: string,
|
|
||||||
i18n?: Object,
|
|
||||||
i18nKey?: string,
|
|
||||||
options?: Object,
|
|
||||||
parent?: string,
|
|
||||||
style?: Object,
|
|
||||||
t?: TFunction,
|
|
||||||
useDangerouslySetInnerHTML?: boolean,
|
|
||||||
...
|
|
||||||
};
|
|
||||||
declare var Interpolate: React$ComponentType<InterpolateProps>;
|
|
||||||
|
|
||||||
declare type TransProps = {
|
|
||||||
count?: number,
|
|
||||||
parent?: string,
|
|
||||||
i18n?: Object,
|
|
||||||
i18nKey?: string,
|
|
||||||
t?: TFunction,
|
|
||||||
...
|
|
||||||
};
|
|
||||||
declare var Trans: React$ComponentType<TransProps>;
|
|
||||||
|
|
||||||
declare type ProviderProps = {
|
|
||||||
i18n: Object,
|
|
||||||
children: React$Element<*>,
|
|
||||||
...
|
|
||||||
};
|
|
||||||
declare var I18nextProvider: React$ComponentType<ProviderProps>;
|
|
||||||
|
|
||||||
declare type NamespacesProps = {
|
|
||||||
components: Array<React$ComponentType<*>>,
|
|
||||||
i18n: { loadNamespaces: Function, ... },
|
|
||||||
...
|
|
||||||
};
|
|
||||||
declare function loadNamespaces(props: NamespacesProps): Promise<void>;
|
|
||||||
|
|
||||||
declare var reactI18nextModule: {
|
|
||||||
type: "3rdParty",
|
|
||||||
init: (instance: Object) => void,
|
|
||||||
...
|
|
||||||
};
|
|
||||||
|
|
||||||
declare function setDefaults(options: TranslateOptions): void;
|
|
||||||
|
|
||||||
declare function getDefaults(): TranslateOptions;
|
|
||||||
|
|
||||||
declare function getI18n(): Object;
|
|
||||||
|
|
||||||
declare function setI18n(instance: Object): void;
|
|
||||||
}
|
|
||||||
@@ -1,137 +0,0 @@
|
|||||||
// flow-typed signature: ba35d02d668b0d0a3e04a63a6847974e
|
|
||||||
// flow-typed version: <<STUB>>/react-jss_v8.6.1/flow_v0.79.1
|
|
||||||
|
|
||||||
/**
|
|
||||||
* This is an autogenerated libdef stub for:
|
|
||||||
*
|
|
||||||
* 'react-jss'
|
|
||||||
*
|
|
||||||
* Fill this stub out by replacing all the `any` types.
|
|
||||||
*
|
|
||||||
* Once filled out, we encourage you to share your work with the
|
|
||||||
* community by sending a pull request to:
|
|
||||||
* https://github.com/flowtype/flow-typed
|
|
||||||
*/
|
|
||||||
|
|
||||||
declare module 'react-jss' {
|
|
||||||
declare module.exports: any;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* We include stubs for each file inside this npm package in case you need to
|
|
||||||
* require those files directly. Feel free to delete any files that aren't
|
|
||||||
* needed.
|
|
||||||
*/
|
|
||||||
declare module 'react-jss/dist/react-jss' {
|
|
||||||
declare module.exports: any;
|
|
||||||
}
|
|
||||||
|
|
||||||
declare module 'react-jss/dist/react-jss.min' {
|
|
||||||
declare module.exports: any;
|
|
||||||
}
|
|
||||||
|
|
||||||
declare module 'react-jss/lib/compose' {
|
|
||||||
declare module.exports: any;
|
|
||||||
}
|
|
||||||
|
|
||||||
declare module 'react-jss/lib/compose.test' {
|
|
||||||
declare module.exports: any;
|
|
||||||
}
|
|
||||||
|
|
||||||
declare module 'react-jss/lib/contextTypes' {
|
|
||||||
declare module.exports: any;
|
|
||||||
}
|
|
||||||
|
|
||||||
declare module 'react-jss/lib/createHoc' {
|
|
||||||
declare module.exports: any;
|
|
||||||
}
|
|
||||||
|
|
||||||
declare module 'react-jss/lib/getDisplayName' {
|
|
||||||
declare module.exports: any;
|
|
||||||
}
|
|
||||||
|
|
||||||
declare module 'react-jss/lib/index' {
|
|
||||||
declare module.exports: any;
|
|
||||||
}
|
|
||||||
|
|
||||||
declare module 'react-jss/lib/index.test' {
|
|
||||||
declare module.exports: any;
|
|
||||||
}
|
|
||||||
|
|
||||||
declare module 'react-jss/lib/injectSheet' {
|
|
||||||
declare module.exports: any;
|
|
||||||
}
|
|
||||||
|
|
||||||
declare module 'react-jss/lib/injectSheet.test' {
|
|
||||||
declare module.exports: any;
|
|
||||||
}
|
|
||||||
|
|
||||||
declare module 'react-jss/lib/jss' {
|
|
||||||
declare module.exports: any;
|
|
||||||
}
|
|
||||||
|
|
||||||
declare module 'react-jss/lib/JssProvider' {
|
|
||||||
declare module.exports: any;
|
|
||||||
}
|
|
||||||
|
|
||||||
declare module 'react-jss/lib/JssProvider.test' {
|
|
||||||
declare module.exports: any;
|
|
||||||
}
|
|
||||||
|
|
||||||
declare module 'react-jss/lib/ns' {
|
|
||||||
declare module.exports: any;
|
|
||||||
}
|
|
||||||
|
|
||||||
declare module 'react-jss/lib/propTypes' {
|
|
||||||
declare module.exports: any;
|
|
||||||
}
|
|
||||||
|
|
||||||
// Filename aliases
|
|
||||||
declare module 'react-jss/dist/react-jss.js' {
|
|
||||||
declare module.exports: $Exports<'react-jss/dist/react-jss'>;
|
|
||||||
}
|
|
||||||
declare module 'react-jss/dist/react-jss.min.js' {
|
|
||||||
declare module.exports: $Exports<'react-jss/dist/react-jss.min'>;
|
|
||||||
}
|
|
||||||
declare module 'react-jss/lib/compose.js' {
|
|
||||||
declare module.exports: $Exports<'react-jss/lib/compose'>;
|
|
||||||
}
|
|
||||||
declare module 'react-jss/lib/compose.test.js' {
|
|
||||||
declare module.exports: $Exports<'react-jss/lib/compose.test'>;
|
|
||||||
}
|
|
||||||
declare module 'react-jss/lib/contextTypes.js' {
|
|
||||||
declare module.exports: $Exports<'react-jss/lib/contextTypes'>;
|
|
||||||
}
|
|
||||||
declare module 'react-jss/lib/createHoc.js' {
|
|
||||||
declare module.exports: $Exports<'react-jss/lib/createHoc'>;
|
|
||||||
}
|
|
||||||
declare module 'react-jss/lib/getDisplayName.js' {
|
|
||||||
declare module.exports: $Exports<'react-jss/lib/getDisplayName'>;
|
|
||||||
}
|
|
||||||
declare module 'react-jss/lib/index.js' {
|
|
||||||
declare module.exports: $Exports<'react-jss/lib/index'>;
|
|
||||||
}
|
|
||||||
declare module 'react-jss/lib/index.test.js' {
|
|
||||||
declare module.exports: $Exports<'react-jss/lib/index.test'>;
|
|
||||||
}
|
|
||||||
declare module 'react-jss/lib/injectSheet.js' {
|
|
||||||
declare module.exports: $Exports<'react-jss/lib/injectSheet'>;
|
|
||||||
}
|
|
||||||
declare module 'react-jss/lib/injectSheet.test.js' {
|
|
||||||
declare module.exports: $Exports<'react-jss/lib/injectSheet.test'>;
|
|
||||||
}
|
|
||||||
declare module 'react-jss/lib/jss.js' {
|
|
||||||
declare module.exports: $Exports<'react-jss/lib/jss'>;
|
|
||||||
}
|
|
||||||
declare module 'react-jss/lib/JssProvider.js' {
|
|
||||||
declare module.exports: $Exports<'react-jss/lib/JssProvider'>;
|
|
||||||
}
|
|
||||||
declare module 'react-jss/lib/JssProvider.test.js' {
|
|
||||||
declare module.exports: $Exports<'react-jss/lib/JssProvider.test'>;
|
|
||||||
}
|
|
||||||
declare module 'react-jss/lib/ns.js' {
|
|
||||||
declare module.exports: $Exports<'react-jss/lib/ns'>;
|
|
||||||
}
|
|
||||||
declare module 'react-jss/lib/propTypes.js' {
|
|
||||||
declare module.exports: $Exports<'react-jss/lib/propTypes'>;
|
|
||||||
}
|
|
||||||
@@ -1,123 +0,0 @@
|
|||||||
// flow-typed signature: 6bcbadac27a01caf160321668f1e53ce
|
|
||||||
// flow-typed version: <<STUB>>/react-markdown_v4.2.2/flow_v0.109.0
|
|
||||||
|
|
||||||
/**
|
|
||||||
* This is an autogenerated libdef stub for:
|
|
||||||
*
|
|
||||||
* 'react-markdown'
|
|
||||||
*
|
|
||||||
* Fill this stub out by replacing all the `any` types.
|
|
||||||
*
|
|
||||||
* Once filled out, we encourage you to share your work with the
|
|
||||||
* community by sending a pull request to:
|
|
||||||
* https://github.com/flowtype/flow-typed
|
|
||||||
*/
|
|
||||||
|
|
||||||
declare module 'react-markdown' {
|
|
||||||
declare module.exports: any;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* We include stubs for each file inside this npm package in case you need to
|
|
||||||
* require those files directly. Feel free to delete any files that aren't
|
|
||||||
* needed.
|
|
||||||
*/
|
|
||||||
declare module 'react-markdown/lib/ast-to-react' {
|
|
||||||
declare module.exports: any;
|
|
||||||
}
|
|
||||||
|
|
||||||
declare module 'react-markdown/lib/get-definitions' {
|
|
||||||
declare module.exports: any;
|
|
||||||
}
|
|
||||||
|
|
||||||
declare module 'react-markdown/lib/plugins/disallow-node' {
|
|
||||||
declare module.exports: any;
|
|
||||||
}
|
|
||||||
|
|
||||||
declare module 'react-markdown/lib/plugins/html-parser' {
|
|
||||||
declare module.exports: any;
|
|
||||||
}
|
|
||||||
|
|
||||||
declare module 'react-markdown/lib/plugins/naive-html' {
|
|
||||||
declare module.exports: any;
|
|
||||||
}
|
|
||||||
|
|
||||||
declare module 'react-markdown/lib/react-markdown' {
|
|
||||||
declare module.exports: any;
|
|
||||||
}
|
|
||||||
|
|
||||||
declare module 'react-markdown/lib/renderers' {
|
|
||||||
declare module.exports: any;
|
|
||||||
}
|
|
||||||
|
|
||||||
declare module 'react-markdown/lib/symbols' {
|
|
||||||
declare module.exports: any;
|
|
||||||
}
|
|
||||||
|
|
||||||
declare module 'react-markdown/lib/uri-transformer' {
|
|
||||||
declare module.exports: any;
|
|
||||||
}
|
|
||||||
|
|
||||||
declare module 'react-markdown/lib/with-html' {
|
|
||||||
declare module.exports: any;
|
|
||||||
}
|
|
||||||
|
|
||||||
declare module 'react-markdown/lib/wrap-table-rows' {
|
|
||||||
declare module.exports: any;
|
|
||||||
}
|
|
||||||
|
|
||||||
declare module 'react-markdown/plugins/html-parser' {
|
|
||||||
declare module.exports: any;
|
|
||||||
}
|
|
||||||
|
|
||||||
declare module 'react-markdown/umd/react-markdown' {
|
|
||||||
declare module.exports: any;
|
|
||||||
}
|
|
||||||
|
|
||||||
declare module 'react-markdown/with-html' {
|
|
||||||
declare module.exports: any;
|
|
||||||
}
|
|
||||||
|
|
||||||
// Filename aliases
|
|
||||||
declare module 'react-markdown/lib/ast-to-react.js' {
|
|
||||||
declare module.exports: $Exports<'react-markdown/lib/ast-to-react'>;
|
|
||||||
}
|
|
||||||
declare module 'react-markdown/lib/get-definitions.js' {
|
|
||||||
declare module.exports: $Exports<'react-markdown/lib/get-definitions'>;
|
|
||||||
}
|
|
||||||
declare module 'react-markdown/lib/plugins/disallow-node.js' {
|
|
||||||
declare module.exports: $Exports<'react-markdown/lib/plugins/disallow-node'>;
|
|
||||||
}
|
|
||||||
declare module 'react-markdown/lib/plugins/html-parser.js' {
|
|
||||||
declare module.exports: $Exports<'react-markdown/lib/plugins/html-parser'>;
|
|
||||||
}
|
|
||||||
declare module 'react-markdown/lib/plugins/naive-html.js' {
|
|
||||||
declare module.exports: $Exports<'react-markdown/lib/plugins/naive-html'>;
|
|
||||||
}
|
|
||||||
declare module 'react-markdown/lib/react-markdown.js' {
|
|
||||||
declare module.exports: $Exports<'react-markdown/lib/react-markdown'>;
|
|
||||||
}
|
|
||||||
declare module 'react-markdown/lib/renderers.js' {
|
|
||||||
declare module.exports: $Exports<'react-markdown/lib/renderers'>;
|
|
||||||
}
|
|
||||||
declare module 'react-markdown/lib/symbols.js' {
|
|
||||||
declare module.exports: $Exports<'react-markdown/lib/symbols'>;
|
|
||||||
}
|
|
||||||
declare module 'react-markdown/lib/uri-transformer.js' {
|
|
||||||
declare module.exports: $Exports<'react-markdown/lib/uri-transformer'>;
|
|
||||||
}
|
|
||||||
declare module 'react-markdown/lib/with-html.js' {
|
|
||||||
declare module.exports: $Exports<'react-markdown/lib/with-html'>;
|
|
||||||
}
|
|
||||||
declare module 'react-markdown/lib/wrap-table-rows.js' {
|
|
||||||
declare module.exports: $Exports<'react-markdown/lib/wrap-table-rows'>;
|
|
||||||
}
|
|
||||||
declare module 'react-markdown/plugins/html-parser.js' {
|
|
||||||
declare module.exports: $Exports<'react-markdown/plugins/html-parser'>;
|
|
||||||
}
|
|
||||||
declare module 'react-markdown/umd/react-markdown.js' {
|
|
||||||
declare module.exports: $Exports<'react-markdown/umd/react-markdown'>;
|
|
||||||
}
|
|
||||||
declare module 'react-markdown/with-html.js' {
|
|
||||||
declare module.exports: $Exports<'react-markdown/with-html'>;
|
|
||||||
}
|
|
||||||
@@ -1,182 +0,0 @@
|
|||||||
// flow-typed signature: 0bc486c8fc04d0bb37efa138223e4f67
|
|
||||||
// flow-typed version: c6154227d1/react-router-dom_v4.x.x/flow_>=v0.104.x
|
|
||||||
|
|
||||||
declare module "react-router-dom" {
|
|
||||||
declare export var BrowserRouter: React$ComponentType<{|
|
|
||||||
basename?: string,
|
|
||||||
forceRefresh?: boolean,
|
|
||||||
getUserConfirmation?: GetUserConfirmation,
|
|
||||||
keyLength?: number,
|
|
||||||
children?: React$Node
|
|
||||||
|}>
|
|
||||||
|
|
||||||
declare export var HashRouter: React$ComponentType<{|
|
|
||||||
basename?: string,
|
|
||||||
getUserConfirmation?: GetUserConfirmation,
|
|
||||||
hashType?: "slash" | "noslash" | "hashbang",
|
|
||||||
children?: React$Node
|
|
||||||
|}>
|
|
||||||
|
|
||||||
declare export var Link: React$ComponentType<{
|
|
||||||
className?: string,
|
|
||||||
to: string | LocationShape,
|
|
||||||
replace?: boolean,
|
|
||||||
children?: React$Node,
|
|
||||||
...
|
|
||||||
}>
|
|
||||||
|
|
||||||
declare export var NavLink: React$ComponentType<{
|
|
||||||
to: string | LocationShape,
|
|
||||||
activeClassName?: string,
|
|
||||||
className?: string,
|
|
||||||
activeStyle?: Object,
|
|
||||||
style?: Object,
|
|
||||||
isActive?: (match: Match, location: Location) => boolean,
|
|
||||||
children?: React$Node,
|
|
||||||
exact?: boolean,
|
|
||||||
strict?: boolean,
|
|
||||||
...
|
|
||||||
}>
|
|
||||||
|
|
||||||
// NOTE: Below are duplicated from react-router. If updating these, please
|
|
||||||
// update the react-router and react-router-native types as well.
|
|
||||||
declare export type Location = {
|
|
||||||
pathname: string,
|
|
||||||
search: string,
|
|
||||||
hash: string,
|
|
||||||
state?: any,
|
|
||||||
key?: string,
|
|
||||||
...
|
|
||||||
};
|
|
||||||
|
|
||||||
declare export type LocationShape = {
|
|
||||||
pathname?: string,
|
|
||||||
search?: string,
|
|
||||||
hash?: string,
|
|
||||||
state?: any,
|
|
||||||
...
|
|
||||||
};
|
|
||||||
|
|
||||||
declare export type HistoryAction = "PUSH" | "REPLACE" | "POP";
|
|
||||||
|
|
||||||
declare export type RouterHistory = {
|
|
||||||
length: number,
|
|
||||||
location: Location,
|
|
||||||
action: HistoryAction,
|
|
||||||
listen(
|
|
||||||
callback: (location: Location, action: HistoryAction) => void
|
|
||||||
): () => void,
|
|
||||||
push(path: string | LocationShape, state?: any): void,
|
|
||||||
replace(path: string | LocationShape, state?: any): void,
|
|
||||||
go(n: number): void,
|
|
||||||
goBack(): void,
|
|
||||||
goForward(): void,
|
|
||||||
canGo?: (n: number) => boolean,
|
|
||||||
block(
|
|
||||||
callback: string | (location: Location, action: HistoryAction) => ?string
|
|
||||||
): () => void,
|
|
||||||
// createMemoryHistory
|
|
||||||
index?: number,
|
|
||||||
entries?: Array<Location>,
|
|
||||||
...
|
|
||||||
};
|
|
||||||
|
|
||||||
declare export type Match = {
|
|
||||||
params: { [key: string]: ?string, ... },
|
|
||||||
isExact: boolean,
|
|
||||||
path: string,
|
|
||||||
url: string,
|
|
||||||
...
|
|
||||||
};
|
|
||||||
|
|
||||||
declare export type ContextRouter = {|
|
|
||||||
history: RouterHistory,
|
|
||||||
location: Location,
|
|
||||||
match: Match,
|
|
||||||
staticContext?: StaticRouterContext
|
|
||||||
|};
|
|
||||||
|
|
||||||
declare type ContextRouterVoid = {
|
|
||||||
history: RouterHistory | void,
|
|
||||||
location: Location | void,
|
|
||||||
match: Match | void,
|
|
||||||
staticContext?: StaticRouterContext | void,
|
|
||||||
...
|
|
||||||
};
|
|
||||||
|
|
||||||
declare export type GetUserConfirmation = (
|
|
||||||
message: string,
|
|
||||||
callback: (confirmed: boolean) => void
|
|
||||||
) => void;
|
|
||||||
|
|
||||||
declare export type StaticRouterContext = { url?: string, ... };
|
|
||||||
|
|
||||||
declare export var StaticRouter: React$ComponentType<{|
|
|
||||||
basename?: string,
|
|
||||||
location?: string | Location,
|
|
||||||
context: StaticRouterContext,
|
|
||||||
children?: React$Node
|
|
||||||
|}>
|
|
||||||
|
|
||||||
declare export var MemoryRouter: React$ComponentType<{|
|
|
||||||
initialEntries?: Array<LocationShape | string>,
|
|
||||||
initialIndex?: number,
|
|
||||||
getUserConfirmation?: GetUserConfirmation,
|
|
||||||
keyLength?: number,
|
|
||||||
children?: React$Node
|
|
||||||
|}>
|
|
||||||
|
|
||||||
declare export var Router: React$ComponentType<{|
|
|
||||||
history: RouterHistory,
|
|
||||||
children?: React$Node
|
|
||||||
|}>
|
|
||||||
|
|
||||||
declare export var Prompt: React$ComponentType<{|
|
|
||||||
message: string | ((location: Location) => string | boolean),
|
|
||||||
when?: boolean
|
|
||||||
|}>
|
|
||||||
|
|
||||||
declare export var Redirect: React$ComponentType<{|
|
|
||||||
to: string | LocationShape,
|
|
||||||
push?: boolean,
|
|
||||||
from?: string,
|
|
||||||
exact?: boolean,
|
|
||||||
strict?: boolean
|
|
||||||
|}>
|
|
||||||
|
|
||||||
declare export var Route: React$ComponentType<{|
|
|
||||||
component?: React$ComponentType<*>,
|
|
||||||
render?: (router: ContextRouter) => React$Node,
|
|
||||||
children?: React$ComponentType<ContextRouter> | React$Node,
|
|
||||||
path?: string | Array<string>,
|
|
||||||
exact?: boolean,
|
|
||||||
strict?: boolean,
|
|
||||||
location?: LocationShape,
|
|
||||||
sensitive?: boolean
|
|
||||||
|}>
|
|
||||||
|
|
||||||
declare export var Switch: React$ComponentType<{|
|
|
||||||
children?: React$Node,
|
|
||||||
location?: Location
|
|
||||||
|}>
|
|
||||||
|
|
||||||
declare export function withRouter<Props: {...}, Component: React$ComponentType<Props>>(
|
|
||||||
WrappedComponent: Component
|
|
||||||
): React$ComponentType<$Diff<React$ElementConfig<Component>, ContextRouterVoid>>;
|
|
||||||
|
|
||||||
declare type MatchPathOptions = {
|
|
||||||
path?: string,
|
|
||||||
exact?: boolean,
|
|
||||||
sensitive?: boolean,
|
|
||||||
strict?: boolean,
|
|
||||||
...
|
|
||||||
};
|
|
||||||
|
|
||||||
declare export function matchPath(
|
|
||||||
pathname: string,
|
|
||||||
options?: MatchPathOptions | string,
|
|
||||||
parent?: Match
|
|
||||||
): null | Match;
|
|
||||||
|
|
||||||
declare export function generatePath(pattern?: string, params?: Object): string;
|
|
||||||
}
|
|
||||||
@@ -1,56 +0,0 @@
|
|||||||
// flow-typed signature: 030a0d51d7da2db8716b0c796bcd8992
|
|
||||||
// flow-typed version: <<STUB>>/react-router-enzyme-context_v1.2.0/flow_v0.109.0
|
|
||||||
|
|
||||||
/**
|
|
||||||
* This is an autogenerated libdef stub for:
|
|
||||||
*
|
|
||||||
* 'react-router-enzyme-context'
|
|
||||||
*
|
|
||||||
* Fill this stub out by replacing all the `any` types.
|
|
||||||
*
|
|
||||||
* Once filled out, we encourage you to share your work with the
|
|
||||||
* community by sending a pull request to:
|
|
||||||
* https://github.com/flowtype/flow-typed
|
|
||||||
*/
|
|
||||||
|
|
||||||
declare module 'react-router-enzyme-context' {
|
|
||||||
declare module.exports: any;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* We include stubs for each file inside this npm package in case you need to
|
|
||||||
* require those files directly. Feel free to delete any files that aren't
|
|
||||||
* needed.
|
|
||||||
*/
|
|
||||||
declare module 'react-router-enzyme-context/dist/react-router-enzyme-context.cjs' {
|
|
||||||
declare module.exports: any;
|
|
||||||
}
|
|
||||||
|
|
||||||
declare module 'react-router-enzyme-context/dist/react-router-enzyme-context.esm' {
|
|
||||||
declare module.exports: any;
|
|
||||||
}
|
|
||||||
|
|
||||||
declare module 'react-router-enzyme-context/rollup.config' {
|
|
||||||
declare module.exports: any;
|
|
||||||
}
|
|
||||||
|
|
||||||
declare module 'react-router-enzyme-context/src' {
|
|
||||||
declare module.exports: any;
|
|
||||||
}
|
|
||||||
|
|
||||||
// Filename aliases
|
|
||||||
declare module 'react-router-enzyme-context/dist/react-router-enzyme-context.cjs.js' {
|
|
||||||
declare module.exports: $Exports<'react-router-enzyme-context/dist/react-router-enzyme-context.cjs'>;
|
|
||||||
}
|
|
||||||
declare module 'react-router-enzyme-context/dist/react-router-enzyme-context.esm.js' {
|
|
||||||
declare module.exports: $Exports<'react-router-enzyme-context/dist/react-router-enzyme-context.esm'>;
|
|
||||||
}
|
|
||||||
declare module 'react-router-enzyme-context/rollup.config.js' {
|
|
||||||
declare module.exports: $Exports<'react-router-enzyme-context/rollup.config'>;
|
|
||||||
}
|
|
||||||
declare module 'react-router-enzyme-context/src/index' {
|
|
||||||
declare module.exports: $Exports<'react-router-enzyme-context/src'>;
|
|
||||||
}
|
|
||||||
declare module 'react-router-enzyme-context/src/index.js' {
|
|
||||||
declare module.exports: $Exports<'react-router-enzyme-context/src'>;
|
|
||||||
}
|
|
||||||
@@ -1,726 +0,0 @@
|
|||||||
// flow-typed signature: 0b6edc6705aa28ab46a24d08242af068
|
|
||||||
// flow-typed version: <<STUB>>/react-select_v2.4.4/flow_v0.109.0
|
|
||||||
|
|
||||||
/**
|
|
||||||
* This is an autogenerated libdef stub for:
|
|
||||||
*
|
|
||||||
* 'react-select'
|
|
||||||
*
|
|
||||||
* Fill this stub out by replacing all the `any` types.
|
|
||||||
*
|
|
||||||
* Once filled out, we encourage you to share your work with the
|
|
||||||
* community by sending a pull request to:
|
|
||||||
* https://github.com/flowtype/flow-typed
|
|
||||||
*/
|
|
||||||
|
|
||||||
declare module 'react-select' {
|
|
||||||
declare module.exports: any;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* We include stubs for each file inside this npm package in case you need to
|
|
||||||
* require those files directly. Feel free to delete any files that aren't
|
|
||||||
* needed.
|
|
||||||
*/
|
|
||||||
declare module 'react-select/dist/react-select.esm' {
|
|
||||||
declare module.exports: any;
|
|
||||||
}
|
|
||||||
|
|
||||||
declare module 'react-select/dist/react-select' {
|
|
||||||
declare module.exports: any;
|
|
||||||
}
|
|
||||||
|
|
||||||
declare module 'react-select/dist/react-select.min' {
|
|
||||||
declare module.exports: any;
|
|
||||||
}
|
|
||||||
|
|
||||||
declare module 'react-select/lib/accessibility' {
|
|
||||||
declare module.exports: any;
|
|
||||||
}
|
|
||||||
|
|
||||||
declare module 'react-select/lib/animated' {
|
|
||||||
declare module.exports: any;
|
|
||||||
}
|
|
||||||
|
|
||||||
declare module 'react-select/lib/animated/Input' {
|
|
||||||
declare module.exports: any;
|
|
||||||
}
|
|
||||||
|
|
||||||
declare module 'react-select/lib/animated/MultiValue' {
|
|
||||||
declare module.exports: any;
|
|
||||||
}
|
|
||||||
|
|
||||||
declare module 'react-select/lib/animated/Placeholder' {
|
|
||||||
declare module.exports: any;
|
|
||||||
}
|
|
||||||
|
|
||||||
declare module 'react-select/lib/animated/SingleValue' {
|
|
||||||
declare module.exports: any;
|
|
||||||
}
|
|
||||||
|
|
||||||
declare module 'react-select/lib/animated/transitions' {
|
|
||||||
declare module.exports: any;
|
|
||||||
}
|
|
||||||
|
|
||||||
declare module 'react-select/lib/animated/ValueContainer' {
|
|
||||||
declare module.exports: any;
|
|
||||||
}
|
|
||||||
|
|
||||||
declare module 'react-select/lib/Async' {
|
|
||||||
declare module.exports: any;
|
|
||||||
}
|
|
||||||
|
|
||||||
declare module 'react-select/lib/AsyncCreatable' {
|
|
||||||
declare module.exports: any;
|
|
||||||
}
|
|
||||||
|
|
||||||
declare module 'react-select/lib/builtins' {
|
|
||||||
declare module.exports: any;
|
|
||||||
}
|
|
||||||
|
|
||||||
declare module 'react-select/lib/components/containers' {
|
|
||||||
declare module.exports: any;
|
|
||||||
}
|
|
||||||
|
|
||||||
declare module 'react-select/lib/components/Control' {
|
|
||||||
declare module.exports: any;
|
|
||||||
}
|
|
||||||
|
|
||||||
declare module 'react-select/lib/components/Group' {
|
|
||||||
declare module.exports: any;
|
|
||||||
}
|
|
||||||
|
|
||||||
declare module 'react-select/lib/components' {
|
|
||||||
declare module.exports: any;
|
|
||||||
}
|
|
||||||
|
|
||||||
declare module 'react-select/lib/components/indicators' {
|
|
||||||
declare module.exports: any;
|
|
||||||
}
|
|
||||||
|
|
||||||
declare module 'react-select/lib/components/Input' {
|
|
||||||
declare module.exports: any;
|
|
||||||
}
|
|
||||||
|
|
||||||
declare module 'react-select/lib/components/Menu' {
|
|
||||||
declare module.exports: any;
|
|
||||||
}
|
|
||||||
|
|
||||||
declare module 'react-select/lib/components/MultiValue' {
|
|
||||||
declare module.exports: any;
|
|
||||||
}
|
|
||||||
|
|
||||||
declare module 'react-select/lib/components/Option' {
|
|
||||||
declare module.exports: any;
|
|
||||||
}
|
|
||||||
|
|
||||||
declare module 'react-select/lib/components/Placeholder' {
|
|
||||||
declare module.exports: any;
|
|
||||||
}
|
|
||||||
|
|
||||||
declare module 'react-select/lib/components/SingleValue' {
|
|
||||||
declare module.exports: any;
|
|
||||||
}
|
|
||||||
|
|
||||||
declare module 'react-select/lib/Creatable' {
|
|
||||||
declare module.exports: any;
|
|
||||||
}
|
|
||||||
|
|
||||||
declare module 'react-select/lib/diacritics' {
|
|
||||||
declare module.exports: any;
|
|
||||||
}
|
|
||||||
|
|
||||||
declare module 'react-select/lib/filters' {
|
|
||||||
declare module.exports: any;
|
|
||||||
}
|
|
||||||
|
|
||||||
declare module 'react-select/lib' {
|
|
||||||
declare module.exports: any;
|
|
||||||
}
|
|
||||||
|
|
||||||
declare module 'react-select/lib/index.umd' {
|
|
||||||
declare module.exports: any;
|
|
||||||
}
|
|
||||||
|
|
||||||
declare module 'react-select/lib/internal/A11yText' {
|
|
||||||
declare module.exports: any;
|
|
||||||
}
|
|
||||||
|
|
||||||
declare module 'react-select/lib/internal/DummyInput' {
|
|
||||||
declare module.exports: any;
|
|
||||||
}
|
|
||||||
|
|
||||||
declare module 'react-select/lib/internal' {
|
|
||||||
declare module.exports: any;
|
|
||||||
}
|
|
||||||
|
|
||||||
declare module 'react-select/lib/internal/NodeResolver' {
|
|
||||||
declare module.exports: any;
|
|
||||||
}
|
|
||||||
|
|
||||||
declare module 'react-select/lib/internal/react-fast-compare' {
|
|
||||||
declare module.exports: any;
|
|
||||||
}
|
|
||||||
|
|
||||||
declare module 'react-select/lib/internal/ScrollBlock' {
|
|
||||||
declare module.exports: any;
|
|
||||||
}
|
|
||||||
|
|
||||||
declare module 'react-select/lib/internal/ScrollCaptor' {
|
|
||||||
declare module.exports: any;
|
|
||||||
}
|
|
||||||
|
|
||||||
declare module 'react-select/lib/internal/ScrollLock/constants' {
|
|
||||||
declare module.exports: any;
|
|
||||||
}
|
|
||||||
|
|
||||||
declare module 'react-select/lib/internal/ScrollLock' {
|
|
||||||
declare module.exports: any;
|
|
||||||
}
|
|
||||||
|
|
||||||
declare module 'react-select/lib/internal/ScrollLock/utils' {
|
|
||||||
declare module.exports: any;
|
|
||||||
}
|
|
||||||
|
|
||||||
declare module 'react-select/lib/Select' {
|
|
||||||
declare module.exports: any;
|
|
||||||
}
|
|
||||||
|
|
||||||
declare module 'react-select/lib/stateManager' {
|
|
||||||
declare module.exports: any;
|
|
||||||
}
|
|
||||||
|
|
||||||
declare module 'react-select/lib/styles' {
|
|
||||||
declare module.exports: any;
|
|
||||||
}
|
|
||||||
|
|
||||||
declare module 'react-select/lib/theme' {
|
|
||||||
declare module.exports: any;
|
|
||||||
}
|
|
||||||
|
|
||||||
declare module 'react-select/lib/types' {
|
|
||||||
declare module.exports: any;
|
|
||||||
}
|
|
||||||
|
|
||||||
declare module 'react-select/lib/utils' {
|
|
||||||
declare module.exports: any;
|
|
||||||
}
|
|
||||||
|
|
||||||
declare module 'react-select/src/__tests__/Async.test' {
|
|
||||||
declare module.exports: any;
|
|
||||||
}
|
|
||||||
|
|
||||||
declare module 'react-select/src/__tests__/AsyncCreatable.test' {
|
|
||||||
declare module.exports: any;
|
|
||||||
}
|
|
||||||
|
|
||||||
declare module 'react-select/src/__tests__/constants' {
|
|
||||||
declare module.exports: any;
|
|
||||||
}
|
|
||||||
|
|
||||||
declare module 'react-select/src/__tests__/Creatable.test' {
|
|
||||||
declare module.exports: any;
|
|
||||||
}
|
|
||||||
|
|
||||||
declare module 'react-select/src/__tests__/Select.test' {
|
|
||||||
declare module.exports: any;
|
|
||||||
}
|
|
||||||
|
|
||||||
declare module 'react-select/src/__tests__/StateManaged.test' {
|
|
||||||
declare module.exports: any;
|
|
||||||
}
|
|
||||||
|
|
||||||
declare module 'react-select/src/accessibility' {
|
|
||||||
declare module.exports: any;
|
|
||||||
}
|
|
||||||
|
|
||||||
declare module 'react-select/src/animated' {
|
|
||||||
declare module.exports: any;
|
|
||||||
}
|
|
||||||
|
|
||||||
declare module 'react-select/src/animated/Input' {
|
|
||||||
declare module.exports: any;
|
|
||||||
}
|
|
||||||
|
|
||||||
declare module 'react-select/src/animated/MultiValue' {
|
|
||||||
declare module.exports: any;
|
|
||||||
}
|
|
||||||
|
|
||||||
declare module 'react-select/src/animated/Placeholder' {
|
|
||||||
declare module.exports: any;
|
|
||||||
}
|
|
||||||
|
|
||||||
declare module 'react-select/src/animated/SingleValue' {
|
|
||||||
declare module.exports: any;
|
|
||||||
}
|
|
||||||
|
|
||||||
declare module 'react-select/src/animated/transitions' {
|
|
||||||
declare module.exports: any;
|
|
||||||
}
|
|
||||||
|
|
||||||
declare module 'react-select/src/animated/ValueContainer' {
|
|
||||||
declare module.exports: any;
|
|
||||||
}
|
|
||||||
|
|
||||||
declare module 'react-select/src/Async' {
|
|
||||||
declare module.exports: any;
|
|
||||||
}
|
|
||||||
|
|
||||||
declare module 'react-select/src/AsyncCreatable' {
|
|
||||||
declare module.exports: any;
|
|
||||||
}
|
|
||||||
|
|
||||||
declare module 'react-select/src/builtins' {
|
|
||||||
declare module.exports: any;
|
|
||||||
}
|
|
||||||
|
|
||||||
declare module 'react-select/src/components/containers' {
|
|
||||||
declare module.exports: any;
|
|
||||||
}
|
|
||||||
|
|
||||||
declare module 'react-select/src/components/Control' {
|
|
||||||
declare module.exports: any;
|
|
||||||
}
|
|
||||||
|
|
||||||
declare module 'react-select/src/components/Group' {
|
|
||||||
declare module.exports: any;
|
|
||||||
}
|
|
||||||
|
|
||||||
declare module 'react-select/src/components' {
|
|
||||||
declare module.exports: any;
|
|
||||||
}
|
|
||||||
|
|
||||||
declare module 'react-select/src/components/indicators' {
|
|
||||||
declare module.exports: any;
|
|
||||||
}
|
|
||||||
|
|
||||||
declare module 'react-select/src/components/Input' {
|
|
||||||
declare module.exports: any;
|
|
||||||
}
|
|
||||||
|
|
||||||
declare module 'react-select/src/components/Menu' {
|
|
||||||
declare module.exports: any;
|
|
||||||
}
|
|
||||||
|
|
||||||
declare module 'react-select/src/components/MultiValue' {
|
|
||||||
declare module.exports: any;
|
|
||||||
}
|
|
||||||
|
|
||||||
declare module 'react-select/src/components/Option' {
|
|
||||||
declare module.exports: any;
|
|
||||||
}
|
|
||||||
|
|
||||||
declare module 'react-select/src/components/Placeholder' {
|
|
||||||
declare module.exports: any;
|
|
||||||
}
|
|
||||||
|
|
||||||
declare module 'react-select/src/components/SingleValue' {
|
|
||||||
declare module.exports: any;
|
|
||||||
}
|
|
||||||
|
|
||||||
declare module 'react-select/src/Creatable' {
|
|
||||||
declare module.exports: any;
|
|
||||||
}
|
|
||||||
|
|
||||||
declare module 'react-select/src/diacritics' {
|
|
||||||
declare module.exports: any;
|
|
||||||
}
|
|
||||||
|
|
||||||
declare module 'react-select/src/filters' {
|
|
||||||
declare module.exports: any;
|
|
||||||
}
|
|
||||||
|
|
||||||
declare module 'react-select/src' {
|
|
||||||
declare module.exports: any;
|
|
||||||
}
|
|
||||||
|
|
||||||
declare module 'react-select/src/index.umd' {
|
|
||||||
declare module.exports: any;
|
|
||||||
}
|
|
||||||
|
|
||||||
declare module 'react-select/src/internal/A11yText' {
|
|
||||||
declare module.exports: any;
|
|
||||||
}
|
|
||||||
|
|
||||||
declare module 'react-select/src/internal/DummyInput' {
|
|
||||||
declare module.exports: any;
|
|
||||||
}
|
|
||||||
|
|
||||||
declare module 'react-select/src/internal' {
|
|
||||||
declare module.exports: any;
|
|
||||||
}
|
|
||||||
|
|
||||||
declare module 'react-select/src/internal/NodeResolver' {
|
|
||||||
declare module.exports: any;
|
|
||||||
}
|
|
||||||
|
|
||||||
declare module 'react-select/src/internal/react-fast-compare' {
|
|
||||||
declare module.exports: any;
|
|
||||||
}
|
|
||||||
|
|
||||||
declare module 'react-select/src/internal/ScrollBlock' {
|
|
||||||
declare module.exports: any;
|
|
||||||
}
|
|
||||||
|
|
||||||
declare module 'react-select/src/internal/ScrollCaptor' {
|
|
||||||
declare module.exports: any;
|
|
||||||
}
|
|
||||||
|
|
||||||
declare module 'react-select/src/internal/ScrollLock/constants' {
|
|
||||||
declare module.exports: any;
|
|
||||||
}
|
|
||||||
|
|
||||||
declare module 'react-select/src/internal/ScrollLock' {
|
|
||||||
declare module.exports: any;
|
|
||||||
}
|
|
||||||
|
|
||||||
declare module 'react-select/src/internal/ScrollLock/utils' {
|
|
||||||
declare module.exports: any;
|
|
||||||
}
|
|
||||||
|
|
||||||
declare module 'react-select/src/Select' {
|
|
||||||
declare module.exports: any;
|
|
||||||
}
|
|
||||||
|
|
||||||
declare module 'react-select/src/stateManager' {
|
|
||||||
declare module.exports: any;
|
|
||||||
}
|
|
||||||
|
|
||||||
declare module 'react-select/src/styles' {
|
|
||||||
declare module.exports: any;
|
|
||||||
}
|
|
||||||
|
|
||||||
declare module 'react-select/src/theme' {
|
|
||||||
declare module.exports: any;
|
|
||||||
}
|
|
||||||
|
|
||||||
declare module 'react-select/src/types' {
|
|
||||||
declare module.exports: any;
|
|
||||||
}
|
|
||||||
|
|
||||||
declare module 'react-select/src/utils' {
|
|
||||||
declare module.exports: any;
|
|
||||||
}
|
|
||||||
|
|
||||||
// Filename aliases
|
|
||||||
declare module 'react-select/dist/react-select.esm.js' {
|
|
||||||
declare module.exports: $Exports<'react-select/dist/react-select.esm'>;
|
|
||||||
}
|
|
||||||
declare module 'react-select/dist/react-select.js' {
|
|
||||||
declare module.exports: $Exports<'react-select/dist/react-select'>;
|
|
||||||
}
|
|
||||||
declare module 'react-select/dist/react-select.min.js' {
|
|
||||||
declare module.exports: $Exports<'react-select/dist/react-select.min'>;
|
|
||||||
}
|
|
||||||
declare module 'react-select/lib/accessibility/index' {
|
|
||||||
declare module.exports: $Exports<'react-select/lib/accessibility'>;
|
|
||||||
}
|
|
||||||
declare module 'react-select/lib/accessibility/index.js' {
|
|
||||||
declare module.exports: $Exports<'react-select/lib/accessibility'>;
|
|
||||||
}
|
|
||||||
declare module 'react-select/lib/animated/index' {
|
|
||||||
declare module.exports: $Exports<'react-select/lib/animated'>;
|
|
||||||
}
|
|
||||||
declare module 'react-select/lib/animated/index.js' {
|
|
||||||
declare module.exports: $Exports<'react-select/lib/animated'>;
|
|
||||||
}
|
|
||||||
declare module 'react-select/lib/animated/Input.js' {
|
|
||||||
declare module.exports: $Exports<'react-select/lib/animated/Input'>;
|
|
||||||
}
|
|
||||||
declare module 'react-select/lib/animated/MultiValue.js' {
|
|
||||||
declare module.exports: $Exports<'react-select/lib/animated/MultiValue'>;
|
|
||||||
}
|
|
||||||
declare module 'react-select/lib/animated/Placeholder.js' {
|
|
||||||
declare module.exports: $Exports<'react-select/lib/animated/Placeholder'>;
|
|
||||||
}
|
|
||||||
declare module 'react-select/lib/animated/SingleValue.js' {
|
|
||||||
declare module.exports: $Exports<'react-select/lib/animated/SingleValue'>;
|
|
||||||
}
|
|
||||||
declare module 'react-select/lib/animated/transitions.js' {
|
|
||||||
declare module.exports: $Exports<'react-select/lib/animated/transitions'>;
|
|
||||||
}
|
|
||||||
declare module 'react-select/lib/animated/ValueContainer.js' {
|
|
||||||
declare module.exports: $Exports<'react-select/lib/animated/ValueContainer'>;
|
|
||||||
}
|
|
||||||
declare module 'react-select/lib/Async.js' {
|
|
||||||
declare module.exports: $Exports<'react-select/lib/Async'>;
|
|
||||||
}
|
|
||||||
declare module 'react-select/lib/AsyncCreatable.js' {
|
|
||||||
declare module.exports: $Exports<'react-select/lib/AsyncCreatable'>;
|
|
||||||
}
|
|
||||||
declare module 'react-select/lib/builtins.js' {
|
|
||||||
declare module.exports: $Exports<'react-select/lib/builtins'>;
|
|
||||||
}
|
|
||||||
declare module 'react-select/lib/components/containers.js' {
|
|
||||||
declare module.exports: $Exports<'react-select/lib/components/containers'>;
|
|
||||||
}
|
|
||||||
declare module 'react-select/lib/components/Control.js' {
|
|
||||||
declare module.exports: $Exports<'react-select/lib/components/Control'>;
|
|
||||||
}
|
|
||||||
declare module 'react-select/lib/components/Group.js' {
|
|
||||||
declare module.exports: $Exports<'react-select/lib/components/Group'>;
|
|
||||||
}
|
|
||||||
declare module 'react-select/lib/components/index' {
|
|
||||||
declare module.exports: $Exports<'react-select/lib/components'>;
|
|
||||||
}
|
|
||||||
declare module 'react-select/lib/components/index.js' {
|
|
||||||
declare module.exports: $Exports<'react-select/lib/components'>;
|
|
||||||
}
|
|
||||||
declare module 'react-select/lib/components/indicators.js' {
|
|
||||||
declare module.exports: $Exports<'react-select/lib/components/indicators'>;
|
|
||||||
}
|
|
||||||
declare module 'react-select/lib/components/Input.js' {
|
|
||||||
declare module.exports: $Exports<'react-select/lib/components/Input'>;
|
|
||||||
}
|
|
||||||
declare module 'react-select/lib/components/Menu.js' {
|
|
||||||
declare module.exports: $Exports<'react-select/lib/components/Menu'>;
|
|
||||||
}
|
|
||||||
declare module 'react-select/lib/components/MultiValue.js' {
|
|
||||||
declare module.exports: $Exports<'react-select/lib/components/MultiValue'>;
|
|
||||||
}
|
|
||||||
declare module 'react-select/lib/components/Option.js' {
|
|
||||||
declare module.exports: $Exports<'react-select/lib/components/Option'>;
|
|
||||||
}
|
|
||||||
declare module 'react-select/lib/components/Placeholder.js' {
|
|
||||||
declare module.exports: $Exports<'react-select/lib/components/Placeholder'>;
|
|
||||||
}
|
|
||||||
declare module 'react-select/lib/components/SingleValue.js' {
|
|
||||||
declare module.exports: $Exports<'react-select/lib/components/SingleValue'>;
|
|
||||||
}
|
|
||||||
declare module 'react-select/lib/Creatable.js' {
|
|
||||||
declare module.exports: $Exports<'react-select/lib/Creatable'>;
|
|
||||||
}
|
|
||||||
declare module 'react-select/lib/diacritics.js' {
|
|
||||||
declare module.exports: $Exports<'react-select/lib/diacritics'>;
|
|
||||||
}
|
|
||||||
declare module 'react-select/lib/filters.js' {
|
|
||||||
declare module.exports: $Exports<'react-select/lib/filters'>;
|
|
||||||
}
|
|
||||||
declare module 'react-select/lib/index' {
|
|
||||||
declare module.exports: $Exports<'react-select/lib'>;
|
|
||||||
}
|
|
||||||
declare module 'react-select/lib/index.js' {
|
|
||||||
declare module.exports: $Exports<'react-select/lib'>;
|
|
||||||
}
|
|
||||||
declare module 'react-select/lib/index.umd.js' {
|
|
||||||
declare module.exports: $Exports<'react-select/lib/index.umd'>;
|
|
||||||
}
|
|
||||||
declare module 'react-select/lib/internal/A11yText.js' {
|
|
||||||
declare module.exports: $Exports<'react-select/lib/internal/A11yText'>;
|
|
||||||
}
|
|
||||||
declare module 'react-select/lib/internal/DummyInput.js' {
|
|
||||||
declare module.exports: $Exports<'react-select/lib/internal/DummyInput'>;
|
|
||||||
}
|
|
||||||
declare module 'react-select/lib/internal/index' {
|
|
||||||
declare module.exports: $Exports<'react-select/lib/internal'>;
|
|
||||||
}
|
|
||||||
declare module 'react-select/lib/internal/index.js' {
|
|
||||||
declare module.exports: $Exports<'react-select/lib/internal'>;
|
|
||||||
}
|
|
||||||
declare module 'react-select/lib/internal/NodeResolver.js' {
|
|
||||||
declare module.exports: $Exports<'react-select/lib/internal/NodeResolver'>;
|
|
||||||
}
|
|
||||||
declare module 'react-select/lib/internal/react-fast-compare.js' {
|
|
||||||
declare module.exports: $Exports<'react-select/lib/internal/react-fast-compare'>;
|
|
||||||
}
|
|
||||||
declare module 'react-select/lib/internal/ScrollBlock.js' {
|
|
||||||
declare module.exports: $Exports<'react-select/lib/internal/ScrollBlock'>;
|
|
||||||
}
|
|
||||||
declare module 'react-select/lib/internal/ScrollCaptor.js' {
|
|
||||||
declare module.exports: $Exports<'react-select/lib/internal/ScrollCaptor'>;
|
|
||||||
}
|
|
||||||
declare module 'react-select/lib/internal/ScrollLock/constants.js' {
|
|
||||||
declare module.exports: $Exports<'react-select/lib/internal/ScrollLock/constants'>;
|
|
||||||
}
|
|
||||||
declare module 'react-select/lib/internal/ScrollLock/index' {
|
|
||||||
declare module.exports: $Exports<'react-select/lib/internal/ScrollLock'>;
|
|
||||||
}
|
|
||||||
declare module 'react-select/lib/internal/ScrollLock/index.js' {
|
|
||||||
declare module.exports: $Exports<'react-select/lib/internal/ScrollLock'>;
|
|
||||||
}
|
|
||||||
declare module 'react-select/lib/internal/ScrollLock/utils.js' {
|
|
||||||
declare module.exports: $Exports<'react-select/lib/internal/ScrollLock/utils'>;
|
|
||||||
}
|
|
||||||
declare module 'react-select/lib/Select.js' {
|
|
||||||
declare module.exports: $Exports<'react-select/lib/Select'>;
|
|
||||||
}
|
|
||||||
declare module 'react-select/lib/stateManager.js' {
|
|
||||||
declare module.exports: $Exports<'react-select/lib/stateManager'>;
|
|
||||||
}
|
|
||||||
declare module 'react-select/lib/styles.js' {
|
|
||||||
declare module.exports: $Exports<'react-select/lib/styles'>;
|
|
||||||
}
|
|
||||||
declare module 'react-select/lib/theme.js' {
|
|
||||||
declare module.exports: $Exports<'react-select/lib/theme'>;
|
|
||||||
}
|
|
||||||
declare module 'react-select/lib/types.js' {
|
|
||||||
declare module.exports: $Exports<'react-select/lib/types'>;
|
|
||||||
}
|
|
||||||
declare module 'react-select/lib/utils.js' {
|
|
||||||
declare module.exports: $Exports<'react-select/lib/utils'>;
|
|
||||||
}
|
|
||||||
declare module 'react-select/src/__tests__/Async.test.js' {
|
|
||||||
declare module.exports: $Exports<'react-select/src/__tests__/Async.test'>;
|
|
||||||
}
|
|
||||||
declare module 'react-select/src/__tests__/AsyncCreatable.test.js' {
|
|
||||||
declare module.exports: $Exports<'react-select/src/__tests__/AsyncCreatable.test'>;
|
|
||||||
}
|
|
||||||
declare module 'react-select/src/__tests__/constants.js' {
|
|
||||||
declare module.exports: $Exports<'react-select/src/__tests__/constants'>;
|
|
||||||
}
|
|
||||||
declare module 'react-select/src/__tests__/Creatable.test.js' {
|
|
||||||
declare module.exports: $Exports<'react-select/src/__tests__/Creatable.test'>;
|
|
||||||
}
|
|
||||||
declare module 'react-select/src/__tests__/Select.test.js' {
|
|
||||||
declare module.exports: $Exports<'react-select/src/__tests__/Select.test'>;
|
|
||||||
}
|
|
||||||
declare module 'react-select/src/__tests__/StateManaged.test.js' {
|
|
||||||
declare module.exports: $Exports<'react-select/src/__tests__/StateManaged.test'>;
|
|
||||||
}
|
|
||||||
declare module 'react-select/src/accessibility/index' {
|
|
||||||
declare module.exports: $Exports<'react-select/src/accessibility'>;
|
|
||||||
}
|
|
||||||
declare module 'react-select/src/accessibility/index.js' {
|
|
||||||
declare module.exports: $Exports<'react-select/src/accessibility'>;
|
|
||||||
}
|
|
||||||
declare module 'react-select/src/animated/index' {
|
|
||||||
declare module.exports: $Exports<'react-select/src/animated'>;
|
|
||||||
}
|
|
||||||
declare module 'react-select/src/animated/index.js' {
|
|
||||||
declare module.exports: $Exports<'react-select/src/animated'>;
|
|
||||||
}
|
|
||||||
declare module 'react-select/src/animated/Input.js' {
|
|
||||||
declare module.exports: $Exports<'react-select/src/animated/Input'>;
|
|
||||||
}
|
|
||||||
declare module 'react-select/src/animated/MultiValue.js' {
|
|
||||||
declare module.exports: $Exports<'react-select/src/animated/MultiValue'>;
|
|
||||||
}
|
|
||||||
declare module 'react-select/src/animated/Placeholder.js' {
|
|
||||||
declare module.exports: $Exports<'react-select/src/animated/Placeholder'>;
|
|
||||||
}
|
|
||||||
declare module 'react-select/src/animated/SingleValue.js' {
|
|
||||||
declare module.exports: $Exports<'react-select/src/animated/SingleValue'>;
|
|
||||||
}
|
|
||||||
declare module 'react-select/src/animated/transitions.js' {
|
|
||||||
declare module.exports: $Exports<'react-select/src/animated/transitions'>;
|
|
||||||
}
|
|
||||||
declare module 'react-select/src/animated/ValueContainer.js' {
|
|
||||||
declare module.exports: $Exports<'react-select/src/animated/ValueContainer'>;
|
|
||||||
}
|
|
||||||
declare module 'react-select/src/Async.js' {
|
|
||||||
declare module.exports: $Exports<'react-select/src/Async'>;
|
|
||||||
}
|
|
||||||
declare module 'react-select/src/AsyncCreatable.js' {
|
|
||||||
declare module.exports: $Exports<'react-select/src/AsyncCreatable'>;
|
|
||||||
}
|
|
||||||
declare module 'react-select/src/builtins.js' {
|
|
||||||
declare module.exports: $Exports<'react-select/src/builtins'>;
|
|
||||||
}
|
|
||||||
declare module 'react-select/src/components/containers.js' {
|
|
||||||
declare module.exports: $Exports<'react-select/src/components/containers'>;
|
|
||||||
}
|
|
||||||
declare module 'react-select/src/components/Control.js' {
|
|
||||||
declare module.exports: $Exports<'react-select/src/components/Control'>;
|
|
||||||
}
|
|
||||||
declare module 'react-select/src/components/Group.js' {
|
|
||||||
declare module.exports: $Exports<'react-select/src/components/Group'>;
|
|
||||||
}
|
|
||||||
declare module 'react-select/src/components/index' {
|
|
||||||
declare module.exports: $Exports<'react-select/src/components'>;
|
|
||||||
}
|
|
||||||
declare module 'react-select/src/components/index.js' {
|
|
||||||
declare module.exports: $Exports<'react-select/src/components'>;
|
|
||||||
}
|
|
||||||
declare module 'react-select/src/components/indicators.js' {
|
|
||||||
declare module.exports: $Exports<'react-select/src/components/indicators'>;
|
|
||||||
}
|
|
||||||
declare module 'react-select/src/components/Input.js' {
|
|
||||||
declare module.exports: $Exports<'react-select/src/components/Input'>;
|
|
||||||
}
|
|
||||||
declare module 'react-select/src/components/Menu.js' {
|
|
||||||
declare module.exports: $Exports<'react-select/src/components/Menu'>;
|
|
||||||
}
|
|
||||||
declare module 'react-select/src/components/MultiValue.js' {
|
|
||||||
declare module.exports: $Exports<'react-select/src/components/MultiValue'>;
|
|
||||||
}
|
|
||||||
declare module 'react-select/src/components/Option.js' {
|
|
||||||
declare module.exports: $Exports<'react-select/src/components/Option'>;
|
|
||||||
}
|
|
||||||
declare module 'react-select/src/components/Placeholder.js' {
|
|
||||||
declare module.exports: $Exports<'react-select/src/components/Placeholder'>;
|
|
||||||
}
|
|
||||||
declare module 'react-select/src/components/SingleValue.js' {
|
|
||||||
declare module.exports: $Exports<'react-select/src/components/SingleValue'>;
|
|
||||||
}
|
|
||||||
declare module 'react-select/src/Creatable.js' {
|
|
||||||
declare module.exports: $Exports<'react-select/src/Creatable'>;
|
|
||||||
}
|
|
||||||
declare module 'react-select/src/diacritics.js' {
|
|
||||||
declare module.exports: $Exports<'react-select/src/diacritics'>;
|
|
||||||
}
|
|
||||||
declare module 'react-select/src/filters.js' {
|
|
||||||
declare module.exports: $Exports<'react-select/src/filters'>;
|
|
||||||
}
|
|
||||||
declare module 'react-select/src/index' {
|
|
||||||
declare module.exports: $Exports<'react-select/src'>;
|
|
||||||
}
|
|
||||||
declare module 'react-select/src/index.js' {
|
|
||||||
declare module.exports: $Exports<'react-select/src'>;
|
|
||||||
}
|
|
||||||
declare module 'react-select/src/index.umd.js' {
|
|
||||||
declare module.exports: $Exports<'react-select/src/index.umd'>;
|
|
||||||
}
|
|
||||||
declare module 'react-select/src/internal/A11yText.js' {
|
|
||||||
declare module.exports: $Exports<'react-select/src/internal/A11yText'>;
|
|
||||||
}
|
|
||||||
declare module 'react-select/src/internal/DummyInput.js' {
|
|
||||||
declare module.exports: $Exports<'react-select/src/internal/DummyInput'>;
|
|
||||||
}
|
|
||||||
declare module 'react-select/src/internal/index' {
|
|
||||||
declare module.exports: $Exports<'react-select/src/internal'>;
|
|
||||||
}
|
|
||||||
declare module 'react-select/src/internal/index.js' {
|
|
||||||
declare module.exports: $Exports<'react-select/src/internal'>;
|
|
||||||
}
|
|
||||||
declare module 'react-select/src/internal/NodeResolver.js' {
|
|
||||||
declare module.exports: $Exports<'react-select/src/internal/NodeResolver'>;
|
|
||||||
}
|
|
||||||
declare module 'react-select/src/internal/react-fast-compare.js' {
|
|
||||||
declare module.exports: $Exports<'react-select/src/internal/react-fast-compare'>;
|
|
||||||
}
|
|
||||||
declare module 'react-select/src/internal/ScrollBlock.js' {
|
|
||||||
declare module.exports: $Exports<'react-select/src/internal/ScrollBlock'>;
|
|
||||||
}
|
|
||||||
declare module 'react-select/src/internal/ScrollCaptor.js' {
|
|
||||||
declare module.exports: $Exports<'react-select/src/internal/ScrollCaptor'>;
|
|
||||||
}
|
|
||||||
declare module 'react-select/src/internal/ScrollLock/constants.js' {
|
|
||||||
declare module.exports: $Exports<'react-select/src/internal/ScrollLock/constants'>;
|
|
||||||
}
|
|
||||||
declare module 'react-select/src/internal/ScrollLock/index' {
|
|
||||||
declare module.exports: $Exports<'react-select/src/internal/ScrollLock'>;
|
|
||||||
}
|
|
||||||
declare module 'react-select/src/internal/ScrollLock/index.js' {
|
|
||||||
declare module.exports: $Exports<'react-select/src/internal/ScrollLock'>;
|
|
||||||
}
|
|
||||||
declare module 'react-select/src/internal/ScrollLock/utils.js' {
|
|
||||||
declare module.exports: $Exports<'react-select/src/internal/ScrollLock/utils'>;
|
|
||||||
}
|
|
||||||
declare module 'react-select/src/Select.js' {
|
|
||||||
declare module.exports: $Exports<'react-select/src/Select'>;
|
|
||||||
}
|
|
||||||
declare module 'react-select/src/stateManager.js' {
|
|
||||||
declare module.exports: $Exports<'react-select/src/stateManager'>;
|
|
||||||
}
|
|
||||||
declare module 'react-select/src/styles.js' {
|
|
||||||
declare module.exports: $Exports<'react-select/src/styles'>;
|
|
||||||
}
|
|
||||||
declare module 'react-select/src/theme.js' {
|
|
||||||
declare module.exports: $Exports<'react-select/src/theme'>;
|
|
||||||
}
|
|
||||||
declare module 'react-select/src/types.js' {
|
|
||||||
declare module.exports: $Exports<'react-select/src/types'>;
|
|
||||||
}
|
|
||||||
declare module 'react-select/src/utils.js' {
|
|
||||||
declare module.exports: $Exports<'react-select/src/utils'>;
|
|
||||||
}
|
|
||||||
File diff suppressed because it is too large
Load Diff
@@ -1,484 +0,0 @@
|
|||||||
// flow-typed signature: a55c22479779e4f28ad4dd10c702882a
|
|
||||||
// flow-typed version: a29423bb31/styled-components_v4.x.x/flow_>=v0.104.x
|
|
||||||
|
|
||||||
// @flow
|
|
||||||
|
|
||||||
declare module 'styled-components' {
|
|
||||||
declare type BuiltinElementInstances = {
|
|
||||||
a: React$ElementRef<'a'>,
|
|
||||||
abbr: React$ElementRef<'abbr'>,
|
|
||||||
address: React$ElementRef<'address'>,
|
|
||||||
area: React$ElementRef<'area'>,
|
|
||||||
article: React$ElementRef<'article'>,
|
|
||||||
aside: React$ElementRef<'aside'>,
|
|
||||||
audio: React$ElementRef<'audio'>,
|
|
||||||
b: React$ElementRef<'b'>,
|
|
||||||
base: React$ElementRef<'base'>,
|
|
||||||
bdi: React$ElementRef<'bdi'>,
|
|
||||||
bdo: React$ElementRef<'bdo'>,
|
|
||||||
big: React$ElementRef<'big'>,
|
|
||||||
blockquote: React$ElementRef<'blockquote'>,
|
|
||||||
body: React$ElementRef<'body'>,
|
|
||||||
br: React$ElementRef<'br'>,
|
|
||||||
button: React$ElementRef<'button'>,
|
|
||||||
canvas: React$ElementRef<'canvas'>,
|
|
||||||
caption: React$ElementRef<'caption'>,
|
|
||||||
cite: React$ElementRef<'cite'>,
|
|
||||||
code: React$ElementRef<'code'>,
|
|
||||||
col: React$ElementRef<'col'>,
|
|
||||||
colgroup: React$ElementRef<'colgroup'>,
|
|
||||||
data: React$ElementRef<'data'>,
|
|
||||||
datalist: React$ElementRef<'datalist'>,
|
|
||||||
dd: React$ElementRef<'dd'>,
|
|
||||||
del: React$ElementRef<'del'>,
|
|
||||||
details: React$ElementRef<'details'>,
|
|
||||||
dfn: React$ElementRef<'dfn'>,
|
|
||||||
dialog: React$ElementRef<'dialog'>,
|
|
||||||
div: React$ElementRef<'div'>,
|
|
||||||
dl: React$ElementRef<'dl'>,
|
|
||||||
dt: React$ElementRef<'dt'>,
|
|
||||||
em: React$ElementRef<'em'>,
|
|
||||||
embed: React$ElementRef<'embed'>,
|
|
||||||
fieldset: React$ElementRef<'fieldset'>,
|
|
||||||
figcaption: React$ElementRef<'figcaption'>,
|
|
||||||
figure: React$ElementRef<'figure'>,
|
|
||||||
footer: React$ElementRef<'footer'>,
|
|
||||||
form: React$ElementRef<'form'>,
|
|
||||||
h1: React$ElementRef<'h1'>,
|
|
||||||
h2: React$ElementRef<'h2'>,
|
|
||||||
h3: React$ElementRef<'h3'>,
|
|
||||||
h4: React$ElementRef<'h4'>,
|
|
||||||
h5: React$ElementRef<'h5'>,
|
|
||||||
h6: React$ElementRef<'h6'>,
|
|
||||||
head: React$ElementRef<'head'>,
|
|
||||||
header: React$ElementRef<'header'>,
|
|
||||||
hgroup: React$ElementRef<'hgroup'>,
|
|
||||||
hr: React$ElementRef<'hr'>,
|
|
||||||
html: React$ElementRef<'html'>,
|
|
||||||
i: React$ElementRef<'i'>,
|
|
||||||
iframe: React$ElementRef<'iframe'>,
|
|
||||||
img: React$ElementRef<'img'>,
|
|
||||||
input: React$ElementRef<'input'>,
|
|
||||||
ins: React$ElementRef<'ins'>,
|
|
||||||
kbd: React$ElementRef<'kbd'>,
|
|
||||||
label: React$ElementRef<'label'>,
|
|
||||||
legend: React$ElementRef<'legend'>,
|
|
||||||
li: React$ElementRef<'li'>,
|
|
||||||
link: React$ElementRef<'link'>,
|
|
||||||
main: React$ElementRef<'main'>,
|
|
||||||
map: React$ElementRef<'map'>,
|
|
||||||
mark: React$ElementRef<'mark'>,
|
|
||||||
menu: React$ElementRef<'menu'>,
|
|
||||||
meta: React$ElementRef<'meta'>,
|
|
||||||
meter: React$ElementRef<'meter'>,
|
|
||||||
nav: React$ElementRef<'nav'>,
|
|
||||||
noscript: React$ElementRef<'noscript'>,
|
|
||||||
object: React$ElementRef<'object'>,
|
|
||||||
ol: React$ElementRef<'ol'>,
|
|
||||||
optgroup: React$ElementRef<'optgroup'>,
|
|
||||||
option: React$ElementRef<'option'>,
|
|
||||||
output: React$ElementRef<'output'>,
|
|
||||||
p: React$ElementRef<'p'>,
|
|
||||||
param: React$ElementRef<'param'>,
|
|
||||||
picture: React$ElementRef<'picture'>,
|
|
||||||
pre: React$ElementRef<'pre'>,
|
|
||||||
progress: React$ElementRef<'progress'>,
|
|
||||||
q: React$ElementRef<'q'>,
|
|
||||||
rp: React$ElementRef<'rp'>,
|
|
||||||
rt: React$ElementRef<'rt'>,
|
|
||||||
ruby: React$ElementRef<'ruby'>,
|
|
||||||
s: React$ElementRef<'s'>,
|
|
||||||
samp: React$ElementRef<'samp'>,
|
|
||||||
script: React$ElementRef<'script'>,
|
|
||||||
section: React$ElementRef<'section'>,
|
|
||||||
select: React$ElementRef<'select'>,
|
|
||||||
small: React$ElementRef<'small'>,
|
|
||||||
source: React$ElementRef<'source'>,
|
|
||||||
span: React$ElementRef<'span'>,
|
|
||||||
strong: React$ElementRef<'strong'>,
|
|
||||||
style: React$ElementRef<'style'>,
|
|
||||||
sub: React$ElementRef<'sub'>,
|
|
||||||
summary: React$ElementRef<'summary'>,
|
|
||||||
sup: React$ElementRef<'sup'>,
|
|
||||||
table: React$ElementRef<'table'>,
|
|
||||||
tbody: React$ElementRef<'tbody'>,
|
|
||||||
td: React$ElementRef<'td'>,
|
|
||||||
textarea: React$ElementRef<'textarea'>,
|
|
||||||
tfoot: React$ElementRef<'tfoot'>,
|
|
||||||
th: React$ElementRef<'th'>,
|
|
||||||
thead: React$ElementRef<'thead'>,
|
|
||||||
time: React$ElementRef<'time'>,
|
|
||||||
title: React$ElementRef<'title'>,
|
|
||||||
tr: React$ElementRef<'tr'>,
|
|
||||||
track: React$ElementRef<'track'>,
|
|
||||||
u: React$ElementRef<'u'>,
|
|
||||||
ul: React$ElementRef<'ul'>,
|
|
||||||
var: React$ElementRef<'var'>,
|
|
||||||
video: React$ElementRef<'video'>,
|
|
||||||
wbr: React$ElementRef<'wbr'>,
|
|
||||||
// SVG
|
|
||||||
circle: React$ElementRef<'circle'>,
|
|
||||||
clipPath: React$ElementRef<'clipPath'>,
|
|
||||||
defs: React$ElementRef<'defs'>,
|
|
||||||
ellipse: React$ElementRef<'ellipse'>,
|
|
||||||
g: React$ElementRef<'g'>,
|
|
||||||
image: React$ElementRef<'image'>,
|
|
||||||
line: React$ElementRef<'line'>,
|
|
||||||
linearGradient: React$ElementRef<'linearGradient'>,
|
|
||||||
mask: React$ElementRef<'mask'>,
|
|
||||||
path: React$ElementRef<'path'>,
|
|
||||||
pattern: React$ElementRef<'pattern'>,
|
|
||||||
polygon: React$ElementRef<'polygon'>,
|
|
||||||
polyline: React$ElementRef<'polyline'>,
|
|
||||||
radialGradient: React$ElementRef<'radialGradient'>,
|
|
||||||
rect: React$ElementRef<'rect'>,
|
|
||||||
stop: React$ElementRef<'stop'>,
|
|
||||||
svg: React$ElementRef<'svg'>,
|
|
||||||
text: React$ElementRef<'text'>,
|
|
||||||
tspan: React$ElementRef<'tspan'>,
|
|
||||||
// Deprecated, should be HTMLUnknownElement, but Flow doesn't support it
|
|
||||||
keygen: React$ElementRef<'keygen'>,
|
|
||||||
menuitem: React$ElementRef<'menuitem'>,
|
|
||||||
...
|
|
||||||
}
|
|
||||||
|
|
||||||
declare type BuiltinElementType<ElementName: string> = $ElementType<BuiltinElementInstances, ElementName>
|
|
||||||
|
|
||||||
declare class InterpolatableComponent<P> extends React$Component<P> {
|
|
||||||
static +styledComponentId: string;
|
|
||||||
}
|
|
||||||
|
|
||||||
declare export type Interpolation<P> =
|
|
||||||
| ((executionContext: P) =>
|
|
||||||
| ((executionContext: P) => InterpolationBase)
|
|
||||||
| InterpolationBase
|
|
||||||
)
|
|
||||||
| Class<InterpolatableComponent<mixed>>
|
|
||||||
| InterpolationBase
|
|
||||||
|
|
||||||
declare export type InterpolationBase =
|
|
||||||
| CSSRules
|
|
||||||
| KeyFrames
|
|
||||||
| string
|
|
||||||
| number
|
|
||||||
|
|
||||||
|
|
||||||
// Should this be `mixed` perhaps?
|
|
||||||
declare export type CSSRules = Interpolation<any>[] // eslint-disable-line flowtype/no-weak-types
|
|
||||||
|
|
||||||
// This is not exported on purpose, since it's an implementation detail
|
|
||||||
declare type TaggedTemplateLiteral<I, R> = (strings: string[], ...interpolations: Interpolation<I>[]) => R
|
|
||||||
|
|
||||||
declare export type CSSConstructor = TaggedTemplateLiteral<any, CSSRules> // eslint-disable-line flowtype/no-weak-types
|
|
||||||
declare export type KeyFramesConstructor = TaggedTemplateLiteral<any, KeyFrames> // eslint-disable-line flowtype/no-weak-types
|
|
||||||
declare export type CreateGlobalStyleConstructor = TaggedTemplateLiteral<any, React$ComponentType<*>> // eslint-disable-line flowtype/no-weak-types
|
|
||||||
|
|
||||||
declare interface Tag<T> {
|
|
||||||
styleTag: HTMLStyleElement | null;
|
|
||||||
getIds(): string[];
|
|
||||||
hasNameForId(id: string, name: string): boolean;
|
|
||||||
insertMarker(id: string): T;
|
|
||||||
insertRules(id: string, cssRules: string[], name: ?string): void;
|
|
||||||
removeRules(id: string): void;
|
|
||||||
css(): string;
|
|
||||||
toHTML(additionalAttrs: ?string): string;
|
|
||||||
toElement(): React$Element<*>;
|
|
||||||
clone(): Tag<T>;
|
|
||||||
sealed: boolean;
|
|
||||||
}
|
|
||||||
|
|
||||||
// The `any`/weak types in here all come from `styled-components` directly, since those definitions were just copied over
|
|
||||||
declare export class StyleSheet {
|
|
||||||
static get master() : StyleSheet;
|
|
||||||
static get instance() : StyleSheet;
|
|
||||||
static reset(forceServer? : boolean) : void;
|
|
||||||
|
|
||||||
id : number;
|
|
||||||
forceServer : boolean;
|
|
||||||
target : ?HTMLElement;
|
|
||||||
tagMap : { [string]: Tag<any>, ... }; // eslint-disable-line flowtype/no-weak-types
|
|
||||||
deferred: { [string]: string[] | void, ... };
|
|
||||||
rehydratedNames: { [string]: boolean, ... };
|
|
||||||
ignoreRehydratedNames: { [string]: boolean, ... };
|
|
||||||
tags: Tag<any>[]; // eslint-disable-line flowtype/no-weak-types
|
|
||||||
importRuleTag: Tag<any>; // eslint-disable-line flowtype/no-weak-types
|
|
||||||
capacity: number;
|
|
||||||
clones: StyleSheet[];
|
|
||||||
|
|
||||||
constructor(?HTMLElement) : this;
|
|
||||||
rehydrate() : this;
|
|
||||||
clone() : StyleSheet;
|
|
||||||
sealAllTags() : void;
|
|
||||||
makeTag(tag : ?Tag<any>) : Tag<any>; // eslint-disable-line flowtype/no-weak-types
|
|
||||||
getImportRuleTag() : Tag<any>; // eslint-disable-line flowtype/no-weak-types
|
|
||||||
getTagForId(id : string): Tag<any>; // eslint-disable-line flowtype/no-weak-types
|
|
||||||
hasId(id: string) : boolean;
|
|
||||||
hasNameForId(id: string, name: string) : boolean;
|
|
||||||
deferredInject(id : string, cssRules : string[]) : void;
|
|
||||||
inject(id: string, cssRules : string[], name? : string) : void;
|
|
||||||
remove(id : string) : void;
|
|
||||||
toHtml() : string;
|
|
||||||
toReactElements() : React$ElementType[];
|
|
||||||
}
|
|
||||||
|
|
||||||
declare export class KeyFrames {
|
|
||||||
id : string;
|
|
||||||
name : string;
|
|
||||||
rules : string[];
|
|
||||||
|
|
||||||
constructor(name : string, rules : string[]) : this;
|
|
||||||
inject(StyleSheet) : void;
|
|
||||||
toString() : string;
|
|
||||||
getName() : string;
|
|
||||||
}
|
|
||||||
|
|
||||||
// I think any is appropriate here?
|
|
||||||
// eslint-disable-next-line flowtype/no-weak-types
|
|
||||||
declare export var css : CSSConstructor;
|
|
||||||
declare export var keyframes : KeyFramesConstructor;
|
|
||||||
declare export var createGlobalStyle : CreateGlobalStyleConstructor
|
|
||||||
declare export var ThemeProvider: React$ComponentType<{
|
|
||||||
children?: ?React$Node,
|
|
||||||
theme: mixed | (mixed) => mixed,
|
|
||||||
...
|
|
||||||
}>
|
|
||||||
|
|
||||||
declare type ThemeProps<T> = {|
|
|
||||||
theme: T
|
|
||||||
|}
|
|
||||||
|
|
||||||
declare type PropsWithTheme<Props, T> = {|
|
|
||||||
...ThemeProps<T>,
|
|
||||||
...$Exact<Props>
|
|
||||||
|}
|
|
||||||
|
|
||||||
declare export function withTheme<Theme, Config: {...}, Instance>(Component: React$AbstractComponent<Config, Instance>): React$AbstractComponent<$Diff<Config, ThemeProps<Theme | void>>, Instance>
|
|
||||||
|
|
||||||
declare export type StyledComponent<Props, Theme, Instance> = React$AbstractComponent<Props, Instance> & Class<InterpolatableComponent<Props>>
|
|
||||||
|
|
||||||
declare type StyledFactory<StyleProps, Theme, Instance> = {|
|
|
||||||
[[call]]: TaggedTemplateLiteral<PropsWithTheme<StyleProps, Theme>, StyledComponent<StyleProps, Theme, Instance>>;
|
|
||||||
+attrs: <A: {...}>(((StyleProps) => A) | A) => TaggedTemplateLiteral<
|
|
||||||
PropsWithTheme<{|...$Exact<StyleProps>, ...$Exact<A>|}, Theme>,
|
|
||||||
StyledComponent<React$Config<{|...$Exact<StyleProps>, ...$Exact<A>|}, $Exact<A>>, Theme, Instance>
|
|
||||||
>;
|
|
||||||
|}
|
|
||||||
|
|
||||||
declare type StyledShorthandFactory<V> = {|
|
|
||||||
[[call]]: <StyleProps, Theme>(string[], ...Interpolation<PropsWithTheme<StyleProps, Theme>>[]) => StyledComponent<StyleProps, Theme, V>;
|
|
||||||
+attrs: <A: {...}, StyleProps = {||}, Theme = {||}>(((StyleProps) => A) | A) => TaggedTemplateLiteral<
|
|
||||||
PropsWithTheme<{|...$Exact<StyleProps>, ...$Exact<A>|}, Theme>,
|
|
||||||
StyledComponent<React$Config<{|...$Exact<StyleProps>, ...$Exact<A>|}, $Exact<A>>, Theme, V>
|
|
||||||
>;
|
|
||||||
|}
|
|
||||||
|
|
||||||
|
|
||||||
declare type ConvenientShorthands = $ObjMap<
|
|
||||||
BuiltinElementInstances,
|
|
||||||
<V>(V) => StyledShorthandFactory<V>
|
|
||||||
>
|
|
||||||
|
|
||||||
declare interface Styled {
|
|
||||||
<StyleProps, Theme, ElementName: $Keys<BuiltinElementInstances>>(ElementName): StyledFactory<StyleProps, Theme, BuiltinElementType<ElementName>>;
|
|
||||||
<Comp: React$ComponentType<any>, Theme, OwnProps = React$ElementConfig<Comp>>(Comp): StyledFactory<{|...$Exact<OwnProps>|}, Theme, Comp>;
|
|
||||||
}
|
|
||||||
|
|
||||||
declare export default Styled & ConvenientShorthands
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
declare module 'styled-components/native' {
|
|
||||||
|
|
||||||
declare class InterpolatableComponent<P> extends React$Component<P> {
|
|
||||||
static +styledComponentId: string;
|
|
||||||
}
|
|
||||||
|
|
||||||
declare export type Interpolation<P> =
|
|
||||||
| ((executionContext: P) =>
|
|
||||||
| ((executionContext: P) => InterpolationBase) // eslint-disable-line flowtype/no-weak-types
|
|
||||||
| InterpolationBase
|
|
||||||
)
|
|
||||||
| Class<InterpolatableComponent<mixed>>
|
|
||||||
| InterpolationBase
|
|
||||||
|
|
||||||
declare export type InterpolationBase =
|
|
||||||
| CSSRules
|
|
||||||
| KeyFrames
|
|
||||||
| string
|
|
||||||
| number
|
|
||||||
|
|
||||||
// Should this be `mixed` perhaps?
|
|
||||||
declare export type CSSRules = Interpolation<any>[] // eslint-disable-line flowtype/no-weak-types
|
|
||||||
|
|
||||||
// This is not exported on purpose, since it's an implementation detail
|
|
||||||
declare type TaggedTemplateLiteral<I, R> = (strings: string[], ...interpolations: Interpolation<I>[]) => R
|
|
||||||
|
|
||||||
declare export type CSSConstructor = TaggedTemplateLiteral<any, CSSRules> // eslint-disable-line flowtype/no-weak-types
|
|
||||||
declare export type KeyFramesConstructor = TaggedTemplateLiteral<any, KeyFrames> // eslint-disable-line flowtype/no-weak-types
|
|
||||||
declare export type CreateGlobalStyleConstructor = TaggedTemplateLiteral<any, React$ComponentType<*>> // eslint-disable-line flowtype/no-weak-types
|
|
||||||
|
|
||||||
declare interface Tag<T> {
|
|
||||||
styleTag: HTMLStyleElement | null;
|
|
||||||
getIds(): string[];
|
|
||||||
hasNameForId(id: string, name: string): boolean;
|
|
||||||
insertMarker(id: string): T;
|
|
||||||
insertRules(id: string, cssRules: string[], name: ?string): void;
|
|
||||||
removeRules(id: string): void;
|
|
||||||
css(): string;
|
|
||||||
toHTML(additionalAttrs: ?string): string;
|
|
||||||
toElement(): React$Element<*>;
|
|
||||||
clone(): Tag<T>;
|
|
||||||
sealed: boolean;
|
|
||||||
}
|
|
||||||
|
|
||||||
// The `any`/weak types in here all come from `styled-components` directly, since those definitions were just copied over
|
|
||||||
declare export class StyleSheet {
|
|
||||||
static get master() : StyleSheet;
|
|
||||||
static get instance() : StyleSheet;
|
|
||||||
static reset(forceServer? : boolean) : void;
|
|
||||||
|
|
||||||
id : number;
|
|
||||||
forceServer : boolean;
|
|
||||||
target : ?HTMLElement;
|
|
||||||
tagMap : { [string]: Tag<any>, ... }; // eslint-disable-line flowtype/no-weak-types
|
|
||||||
deferred: { [string]: string[] | void, ... };
|
|
||||||
rehydratedNames: { [string]: boolean, ... };
|
|
||||||
ignoreRehydratedNames: { [string]: boolean, ... };
|
|
||||||
tags: Tag<any>[]; // eslint-disable-line flowtype/no-weak-types
|
|
||||||
importRuleTag: Tag<any>; // eslint-disable-line flowtype/no-weak-types
|
|
||||||
capacity: number;
|
|
||||||
clones: StyleSheet[];
|
|
||||||
|
|
||||||
constructor(?HTMLElement) : this;
|
|
||||||
rehydrate() : this;
|
|
||||||
clone() : StyleSheet;
|
|
||||||
sealAllTags() : void;
|
|
||||||
makeTag(tag : ?Tag<any>) : Tag<any>; // eslint-disable-line flowtype/no-weak-types
|
|
||||||
getImportRuleTag() : Tag<any>; // eslint-disable-line flowtype/no-weak-types
|
|
||||||
getTagForId(id : string): Tag<any>; // eslint-disable-line flowtype/no-weak-types
|
|
||||||
hasId(id: string) : boolean;
|
|
||||||
hasNameForId(id: string, name: string) : boolean;
|
|
||||||
deferredInject(id : string, cssRules : string[]) : void;
|
|
||||||
inject(id: string, cssRules : string[], name? : string) : void;
|
|
||||||
remove(id : string) : void;
|
|
||||||
toHtml() : string;
|
|
||||||
toReactElements() : React$ElementType[];
|
|
||||||
}
|
|
||||||
|
|
||||||
declare export class KeyFrames {
|
|
||||||
id : string;
|
|
||||||
name : string;
|
|
||||||
rules : string[];
|
|
||||||
|
|
||||||
constructor(name : string, rules : string[]) : this;
|
|
||||||
inject(StyleSheet) : void;
|
|
||||||
toString() : string;
|
|
||||||
getName() : string;
|
|
||||||
}
|
|
||||||
|
|
||||||
// I think any is appropriate here?
|
|
||||||
// eslint-disable-next-line flowtype/no-weak-types
|
|
||||||
declare export var css : CSSConstructor;
|
|
||||||
declare export var keyframes : KeyFramesConstructor;
|
|
||||||
declare export var createGlobalStyle : CreateGlobalStyleConstructor
|
|
||||||
declare export var ThemeProvider: React$ComponentType<{
|
|
||||||
children?: ?React$Node,
|
|
||||||
theme: mixed | (mixed) => mixed,
|
|
||||||
...
|
|
||||||
}>
|
|
||||||
|
|
||||||
declare type ThemeProps<T> = {|
|
|
||||||
theme: T
|
|
||||||
|}
|
|
||||||
|
|
||||||
declare type PropsWithTheme<Props, T> = {|
|
|
||||||
...ThemeProps<T>,
|
|
||||||
...$Exact<Props>
|
|
||||||
|}
|
|
||||||
|
|
||||||
declare export function withTheme<Theme, Config: {...}, Instance>(Component: React$AbstractComponent<Config, Instance>): React$AbstractComponent<$Diff<Config, ThemeProps<Theme | void>>, Instance>
|
|
||||||
|
|
||||||
declare export type StyledComponent<Props, Theme, Instance> = React$AbstractComponent<Props, Instance> & Class<InterpolatableComponent<Props>>
|
|
||||||
|
|
||||||
declare type StyledFactory<StyleProps, Theme, Instance> = {|
|
|
||||||
[[call]]: TaggedTemplateLiteral<PropsWithTheme<StyleProps, Theme>, StyledComponent<StyleProps, Theme, Instance>>;
|
|
||||||
+attrs: <A: {...}>(((StyleProps) => A) | A) => TaggedTemplateLiteral<
|
|
||||||
PropsWithTheme<{|...$Exact<StyleProps>, ...$Exact<A>|}, Theme>,
|
|
||||||
StyledComponent<React$Config<{|...$Exact<StyleProps>, ...$Exact<A>|}, $Exact<A>>, Theme, Instance>
|
|
||||||
>;
|
|
||||||
|}
|
|
||||||
|
|
||||||
declare type StyledShorthandFactory<V> = {|
|
|
||||||
[[call]]: <StyleProps, Theme>(string[], ...Interpolation<PropsWithTheme<StyleProps, Theme>>[]) => StyledComponent<StyleProps, Theme, V>;
|
|
||||||
+attrs: <A: {...}, StyleProps = {||}, Theme = {||}>(((StyleProps) => A) | A) => TaggedTemplateLiteral<
|
|
||||||
PropsWithTheme<{|...$Exact<StyleProps>, ...$Exact<A>|}, Theme>,
|
|
||||||
StyledComponent<React$Config<{|...$Exact<StyleProps>, ...$Exact<A>|}, $Exact<A>>, Theme, V>
|
|
||||||
>;
|
|
||||||
|}
|
|
||||||
|
|
||||||
declare type BuiltinElementInstances = {
|
|
||||||
ActivityIndicator: React$ComponentType<{...}>,
|
|
||||||
ActivityIndicatorIOS: React$ComponentType<{...}>,
|
|
||||||
ART: React$ComponentType<{...}>,
|
|
||||||
Button: React$ComponentType<{...}>,
|
|
||||||
DatePickerIOS: React$ComponentType<{...}>,
|
|
||||||
DrawerLayoutAndroid: React$ComponentType<{...}>,
|
|
||||||
Image: React$ComponentType<{...}>,
|
|
||||||
ImageBackground: React$ComponentType<{...}>,
|
|
||||||
ImageEditor: React$ComponentType<{...}>,
|
|
||||||
ImageStore: React$ComponentType<{...}>,
|
|
||||||
KeyboardAvoidingView: React$ComponentType<{...}>,
|
|
||||||
ListView: React$ComponentType<{...}>,
|
|
||||||
MapView: React$ComponentType<{...}>,
|
|
||||||
Modal: React$ComponentType<{...}>,
|
|
||||||
NavigatorIOS: React$ComponentType<{...}>,
|
|
||||||
Picker: React$ComponentType<{...}>,
|
|
||||||
PickerIOS: React$ComponentType<{...}>,
|
|
||||||
ProgressBarAndroid: React$ComponentType<{...}>,
|
|
||||||
ProgressViewIOS: React$ComponentType<{...}>,
|
|
||||||
ScrollView: React$ComponentType<{...}>,
|
|
||||||
SegmentedControlIOS: React$ComponentType<{...}>,
|
|
||||||
Slider: React$ComponentType<{...}>,
|
|
||||||
SliderIOS: React$ComponentType<{...}>,
|
|
||||||
SnapshotViewIOS: React$ComponentType<{...}>,
|
|
||||||
Switch: React$ComponentType<{...}>,
|
|
||||||
RecyclerViewBackedScrollView: React$ComponentType<{...}>,
|
|
||||||
RefreshControl: React$ComponentType<{...}>,
|
|
||||||
SafeAreaView: React$ComponentType<{...}>,
|
|
||||||
StatusBar: React$ComponentType<{...}>,
|
|
||||||
SwipeableListView: React$ComponentType<{...}>,
|
|
||||||
SwitchAndroid: React$ComponentType<{...}>,
|
|
||||||
SwitchIOS: React$ComponentType<{...}>,
|
|
||||||
TabBarIOS: React$ComponentType<{...}>,
|
|
||||||
Text: React$ComponentType<{...}>,
|
|
||||||
TextInput: React$ComponentType<{...}>,
|
|
||||||
ToastAndroid: React$ComponentType<{...}>,
|
|
||||||
ToolbarAndroid: React$ComponentType<{...}>,
|
|
||||||
Touchable: React$ComponentType<{...}>,
|
|
||||||
TouchableHighlight: React$ComponentType<{...}>,
|
|
||||||
TouchableNativeFeedback: React$ComponentType<{...}>,
|
|
||||||
TouchableOpacity: React$ComponentType<{...}>,
|
|
||||||
TouchableWithoutFeedback: React$ComponentType<{...}>,
|
|
||||||
View: React$ComponentType<{...}>,
|
|
||||||
ViewPagerAndroid: React$ComponentType<{...}>,
|
|
||||||
WebView: React$ComponentType<{...}>,
|
|
||||||
FlatList: React$ComponentType<{...}>,
|
|
||||||
SectionList: React$ComponentType<{...}>,
|
|
||||||
VirtualizedList: React$ComponentType<{...}>,
|
|
||||||
...
|
|
||||||
}
|
|
||||||
|
|
||||||
declare type BuiltinElementType<ElementName: string> = $ElementType<BuiltinElementInstances, ElementName>
|
|
||||||
|
|
||||||
declare type ConvenientShorthands = $ObjMap<
|
|
||||||
BuiltinElementInstances,
|
|
||||||
<V>(V) => StyledShorthandFactory<V>
|
|
||||||
>
|
|
||||||
|
|
||||||
declare interface Styled {
|
|
||||||
<StyleProps, Theme, ElementName: $Keys<BuiltinElementInstances>>(ElementName): StyledFactory<StyleProps, Theme, BuiltinElementType<ElementName>>;
|
|
||||||
<Comp: React$ComponentType<any>, Theme, OwnProps = React$ElementConfig<Comp>>(Comp): StyledFactory<{|...$Exact<OwnProps>|}, Theme, Comp>;
|
|
||||||
}
|
|
||||||
|
|
||||||
declare export default Styled & ConvenientShorthands
|
|
||||||
}
|
|
||||||
@@ -3,11 +3,12 @@
|
|||||||
"private": true,
|
"private": true,
|
||||||
"version": "2.0.0-SNAPSHOT",
|
"version": "2.0.0-SNAPSHOT",
|
||||||
"license": "BSD-3-Clause",
|
"license": "BSD-3-Clause",
|
||||||
"main": "src/main/js/index.js",
|
"main": "./src/main/js/index.ts",
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"build": "ui-scripts plugin",
|
"build": "ui-scripts plugin",
|
||||||
"watch": "ui-scripts plugin-watch",
|
"watch": "ui-scripts plugin-watch",
|
||||||
"test": "jest"
|
"test": "jest",
|
||||||
|
"typecheck": "tsc"
|
||||||
},
|
},
|
||||||
"babel": {
|
"babel": {
|
||||||
"presets": [
|
"presets": [
|
||||||
|
|||||||
@@ -40,6 +40,12 @@
|
|||||||
<version>2.6</version>
|
<version>2.6</version>
|
||||||
</dependency>
|
</dependency>
|
||||||
|
|
||||||
|
<dependency>
|
||||||
|
<groupId>org.jboss.resteasy</groupId>
|
||||||
|
<artifactId>resteasy-jackson2-provider</artifactId>
|
||||||
|
<version>${resteasy.version}</version>
|
||||||
|
</dependency>
|
||||||
|
|
||||||
</dependencies>
|
</dependencies>
|
||||||
|
|
||||||
<build>
|
<build>
|
||||||
|
|||||||
@@ -4,5 +4,5 @@ import org.eclipse.jgit.lib.Repository;
|
|||||||
import sonia.scm.repository.spi.GitContext;
|
import sonia.scm.repository.spi.GitContext;
|
||||||
import sonia.scm.repository.util.WorkdirFactory;
|
import sonia.scm.repository.util.WorkdirFactory;
|
||||||
|
|
||||||
public interface GitWorkdirFactory extends WorkdirFactory<Repository, GitContext> {
|
public interface GitWorkdirFactory extends WorkdirFactory<Repository, Repository, GitContext> {
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -142,7 +142,7 @@ class AbstractGitCommand
|
|||||||
}
|
}
|
||||||
|
|
||||||
<R, W extends GitCloneWorker<R>> R inClone(Function<Git, W> workerSupplier, GitWorkdirFactory workdirFactory, String initialBranch) {
|
<R, W extends GitCloneWorker<R>> R inClone(Function<Git, W> workerSupplier, GitWorkdirFactory workdirFactory, String initialBranch) {
|
||||||
try (WorkingCopy<Repository> workingCopy = workdirFactory.createWorkingCopy(context, initialBranch)) {
|
try (WorkingCopy<Repository, Repository> workingCopy = workdirFactory.createWorkingCopy(context, initialBranch)) {
|
||||||
Repository repository = workingCopy.getWorkingRepository();
|
Repository repository = workingCopy.getWorkingRepository();
|
||||||
logger.debug("cloned repository to folder {}", repository.getWorkTree());
|
logger.debug("cloned repository to folder {}", repository.getWorkTree());
|
||||||
return workerSupplier.apply(new Git(repository)).run();
|
return workerSupplier.apply(new Git(repository)).run();
|
||||||
@@ -152,19 +152,28 @@ class AbstractGitCommand
|
|||||||
}
|
}
|
||||||
|
|
||||||
ObjectId resolveRevisionOrThrowNotFound(Repository repository, String revision) throws IOException {
|
ObjectId resolveRevisionOrThrowNotFound(Repository repository, String revision) throws IOException {
|
||||||
|
sonia.scm.repository.Repository scmRepository = context.getRepository();
|
||||||
|
return resolveRevisionOrThrowNotFound(repository, revision, scmRepository);
|
||||||
|
}
|
||||||
|
|
||||||
|
static ObjectId resolveRevisionOrThrowNotFound(Repository repository, String revision, sonia.scm.repository.Repository scmRepository) throws IOException {
|
||||||
ObjectId resolved = repository.resolve(revision);
|
ObjectId resolved = repository.resolve(revision);
|
||||||
if (resolved == null) {
|
if (resolved == null) {
|
||||||
throw notFound(entity("Revision", revision).in(context.getRepository()));
|
throw notFound(entity("Revision", revision).in(scmRepository));
|
||||||
} else {
|
} else {
|
||||||
return resolved;
|
return resolved;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
abstract class GitCloneWorker<R> {
|
abstract static class GitCloneWorker<R> {
|
||||||
private final Git clone;
|
private final Git clone;
|
||||||
|
private final GitContext context;
|
||||||
|
private final sonia.scm.repository.Repository repository;
|
||||||
|
|
||||||
GitCloneWorker(Git clone) {
|
GitCloneWorker(Git clone, GitContext context, sonia.scm.repository.Repository repository) {
|
||||||
this.clone = clone;
|
this.clone = clone;
|
||||||
|
this.context = context;
|
||||||
|
this.repository = repository;
|
||||||
}
|
}
|
||||||
|
|
||||||
abstract R run() throws IOException;
|
abstract R run() throws IOException;
|
||||||
@@ -173,6 +182,10 @@ class AbstractGitCommand
|
|||||||
return clone;
|
return clone;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
GitContext getContext() {
|
||||||
|
return context;
|
||||||
|
}
|
||||||
|
|
||||||
void checkOutBranch(String branchName) throws IOException {
|
void checkOutBranch(String branchName) throws IOException {
|
||||||
try {
|
try {
|
||||||
clone.checkout().setName(branchName).call();
|
clone.checkout().setName(branchName).call();
|
||||||
@@ -199,7 +212,7 @@ class AbstractGitCommand
|
|||||||
ObjectId resolveRevision(String revision) throws IOException {
|
ObjectId resolveRevision(String revision) throws IOException {
|
||||||
ObjectId resolved = clone.getRepository().resolve(revision);
|
ObjectId resolved = clone.getRepository().resolve(revision);
|
||||||
if (resolved == null) {
|
if (resolved == null) {
|
||||||
return resolveRevisionOrThrowNotFound(clone.getRepository(), "origin/" + revision);
|
return resolveRevisionOrThrowNotFound(clone.getRepository(), "origin/" + revision, context.getRepository());
|
||||||
} else {
|
} else {
|
||||||
return resolved;
|
return resolved;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -33,51 +33,120 @@
|
|||||||
package sonia.scm.repository.spi;
|
package sonia.scm.repository.spi;
|
||||||
|
|
||||||
import org.eclipse.jgit.api.Git;
|
import org.eclipse.jgit.api.Git;
|
||||||
|
import org.eclipse.jgit.api.errors.CannotDeleteCurrentBranchException;
|
||||||
import org.eclipse.jgit.api.errors.GitAPIException;
|
import org.eclipse.jgit.api.errors.GitAPIException;
|
||||||
import org.eclipse.jgit.lib.Ref;
|
import org.eclipse.jgit.lib.Ref;
|
||||||
import org.eclipse.jgit.transport.PushResult;
|
import sonia.scm.event.ScmEventBus;
|
||||||
import org.eclipse.jgit.transport.RemoteRefUpdate;
|
|
||||||
import sonia.scm.repository.Branch;
|
import sonia.scm.repository.Branch;
|
||||||
import sonia.scm.repository.GitUtil;
|
import sonia.scm.repository.GitUtil;
|
||||||
import sonia.scm.repository.GitWorkdirFactory;
|
|
||||||
import sonia.scm.repository.InternalRepositoryException;
|
import sonia.scm.repository.InternalRepositoryException;
|
||||||
|
import sonia.scm.repository.PostReceiveRepositoryHookEvent;
|
||||||
|
import sonia.scm.repository.PreReceiveRepositoryHookEvent;
|
||||||
import sonia.scm.repository.Repository;
|
import sonia.scm.repository.Repository;
|
||||||
|
import sonia.scm.repository.RepositoryHookEvent;
|
||||||
|
import sonia.scm.repository.RepositoryHookType;
|
||||||
import sonia.scm.repository.api.BranchRequest;
|
import sonia.scm.repository.api.BranchRequest;
|
||||||
import sonia.scm.repository.util.WorkingCopy;
|
import sonia.scm.repository.api.HookBranchProvider;
|
||||||
|
import sonia.scm.repository.api.HookContext;
|
||||||
|
import sonia.scm.repository.api.HookContextFactory;
|
||||||
|
import sonia.scm.repository.api.HookFeature;
|
||||||
|
|
||||||
import java.util.stream.StreamSupport;
|
import java.io.IOException;
|
||||||
|
import java.util.List;
|
||||||
|
import java.util.Set;
|
||||||
|
|
||||||
|
import static java.util.Collections.emptyList;
|
||||||
|
import static java.util.Collections.singleton;
|
||||||
|
import static java.util.Collections.singletonList;
|
||||||
|
import static sonia.scm.ContextEntry.ContextBuilder.entity;
|
||||||
|
|
||||||
public class GitBranchCommand extends AbstractGitCommand implements BranchCommand {
|
public class GitBranchCommand extends AbstractGitCommand implements BranchCommand {
|
||||||
|
|
||||||
private final GitWorkdirFactory workdirFactory;
|
private final HookContextFactory hookContextFactory;
|
||||||
|
private final ScmEventBus eventBus;
|
||||||
|
|
||||||
GitBranchCommand(GitContext context, Repository repository, GitWorkdirFactory workdirFactory) {
|
GitBranchCommand(GitContext context, Repository repository, HookContextFactory hookContextFactory, ScmEventBus eventBus) {
|
||||||
super(context, repository);
|
super(context, repository);
|
||||||
this.workdirFactory = workdirFactory;
|
this.hookContextFactory = hookContextFactory;
|
||||||
|
this.eventBus = eventBus;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public Branch branch(BranchRequest request) {
|
public Branch branch(BranchRequest request) {
|
||||||
try (WorkingCopy<org.eclipse.jgit.lib.Repository> workingCopy = workdirFactory.createWorkingCopy(context, request.getParentBranch())) {
|
try (Git git = new Git(context.open())) {
|
||||||
Git clone = new Git(workingCopy.getWorkingRepository());
|
RepositoryHookEvent hookEvent = createBranchHookEvent(BranchHookContextProvider.createHookEvent(request.getNewBranch()));
|
||||||
Ref ref = clone.branchCreate().setName(request.getNewBranch()).call();
|
eventBus.post(new PreReceiveRepositoryHookEvent(hookEvent));
|
||||||
Iterable<PushResult> call = clone.push().add(request.getNewBranch()).call();
|
Ref ref = git.branchCreate().setStartPoint(request.getParentBranch()).setName(request.getNewBranch()).call();
|
||||||
StreamSupport.stream(call.spliterator(), false)
|
eventBus.post(new PostReceiveRepositoryHookEvent(hookEvent));
|
||||||
.flatMap(pushResult -> pushResult.getRemoteUpdates().stream())
|
|
||||||
.filter(remoteRefUpdate -> remoteRefUpdate.getStatus() != RemoteRefUpdate.Status.OK)
|
|
||||||
.findFirst()
|
|
||||||
.ifPresent(r -> this.handlePushError(r, request, context.getRepository()));
|
|
||||||
return Branch.normalBranch(request.getNewBranch(), GitUtil.getId(ref.getObjectId()));
|
return Branch.normalBranch(request.getNewBranch(), GitUtil.getId(ref.getObjectId()));
|
||||||
} catch (GitAPIException ex) {
|
} catch (GitAPIException | IOException ex) {
|
||||||
throw new InternalRepositoryException(repository, "could not create branch " + request.getNewBranch(), ex);
|
throw new InternalRepositoryException(repository, "could not create branch " + request.getNewBranch(), ex);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private void handlePushError(RemoteRefUpdate remoteRefUpdate, BranchRequest request, Repository repository) {
|
@Override
|
||||||
if (remoteRefUpdate.getStatus() != RemoteRefUpdate.Status.OK) {
|
public void deleteOrClose(String branchName) {
|
||||||
// TODO handle failed remote update
|
try (Git gitRepo = new Git(context.open())) {
|
||||||
throw new IntegrateChangesFromWorkdirException(repository,
|
RepositoryHookEvent hookEvent = createBranchHookEvent(BranchHookContextProvider.deleteHookEvent(branchName));
|
||||||
String.format("Could not push new branch '%s' into central repository", request.getNewBranch()));
|
eventBus.post(new PreReceiveRepositoryHookEvent(hookEvent));
|
||||||
|
gitRepo
|
||||||
|
.branchDelete()
|
||||||
|
.setBranchNames(branchName)
|
||||||
|
.setForce(true)
|
||||||
|
.call();
|
||||||
|
eventBus.post(new PostReceiveRepositoryHookEvent(hookEvent));
|
||||||
|
} catch (CannotDeleteCurrentBranchException e) {
|
||||||
|
throw new CannotDeleteDefaultBranchException(context.getRepository(), branchName);
|
||||||
|
} catch (GitAPIException | IOException ex) {
|
||||||
|
throw new InternalRepositoryException(entity(context.getRepository()), String.format("Could not delete branch: %s", branchName));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private RepositoryHookEvent createBranchHookEvent(BranchHookContextProvider hookEvent) {
|
||||||
|
HookContext context = hookContextFactory.createContext(hookEvent, this.context.getRepository());
|
||||||
|
return new RepositoryHookEvent(context, this.context.getRepository(), RepositoryHookType.PRE_RECEIVE);
|
||||||
|
}
|
||||||
|
|
||||||
|
private static class BranchHookContextProvider extends HookContextProvider {
|
||||||
|
private final List<String> newBranches;
|
||||||
|
private final List<String> deletedBranches;
|
||||||
|
|
||||||
|
private BranchHookContextProvider(List<String> newBranches, List<String> deletedBranches) {
|
||||||
|
this.newBranches = newBranches;
|
||||||
|
this.deletedBranches = deletedBranches;
|
||||||
|
}
|
||||||
|
|
||||||
|
static BranchHookContextProvider createHookEvent(String newBranch) {
|
||||||
|
return new BranchHookContextProvider(singletonList(newBranch), emptyList());
|
||||||
|
}
|
||||||
|
|
||||||
|
static BranchHookContextProvider deleteHookEvent(String deletedBranch) {
|
||||||
|
return new BranchHookContextProvider(emptyList(), singletonList(deletedBranch));
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Set<HookFeature> getSupportedFeatures() {
|
||||||
|
return singleton(HookFeature.BRANCH_PROVIDER);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public HookBranchProvider getBranchProvider() {
|
||||||
|
return new HookBranchProvider() {
|
||||||
|
@Override
|
||||||
|
public List<String> getCreatedOrModified() {
|
||||||
|
return newBranches;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public List<String> getDeletedOrClosed() {
|
||||||
|
return deletedBranches;
|
||||||
|
}
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public HookChangesetProvider getChangesetProvider() {
|
||||||
|
return r -> new HookChangesetResponse(emptyList());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -213,8 +213,14 @@ public class GitBrowseCommand extends AbstractGitCommand
|
|||||||
|
|
||||||
if (lfsPointer.isPresent()) {
|
if (lfsPointer.isPresent()) {
|
||||||
BlobStore lfsBlobStore = lfsBlobStoreFactory.getLfsBlobStore(repository);
|
BlobStore lfsBlobStore = lfsBlobStoreFactory.getLfsBlobStore(repository);
|
||||||
Blob blob = lfsBlobStore.get(lfsPointer.get().getOid().getName());
|
String oid = lfsPointer.get().getOid().getName();
|
||||||
|
Blob blob = lfsBlobStore.get(oid);
|
||||||
|
if (blob == null) {
|
||||||
|
logger.error("lfs blob for lob id {} not found in lfs store of repository {}", oid, repository.getNamespaceAndName());
|
||||||
|
file.setLength(-1);
|
||||||
|
} else {
|
||||||
file.setLength(blob.getSize());
|
file.setLength(blob.getSize());
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
file.setLength(loader.getSize());
|
file.setLength(loader.getSize());
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -145,7 +145,12 @@ public class GitCatCommand extends AbstractGitCommand implements CatCommand {
|
|||||||
|
|
||||||
private Loader loadFromLfsStore(TreeWalk treeWalk, RevWalk revWalk, LfsPointer lfsPointer) throws IOException {
|
private Loader loadFromLfsStore(TreeWalk treeWalk, RevWalk revWalk, LfsPointer lfsPointer) throws IOException {
|
||||||
BlobStore lfsBlobStore = lfsBlobStoreFactory.getLfsBlobStore(repository);
|
BlobStore lfsBlobStore = lfsBlobStoreFactory.getLfsBlobStore(repository);
|
||||||
Blob blob = lfsBlobStore.get(lfsPointer.getOid().getName());
|
String oid = lfsPointer.getOid().getName();
|
||||||
|
Blob blob = lfsBlobStore.get(oid);
|
||||||
|
if (blob == null) {
|
||||||
|
logger.error("lfs blob for lob id {} not found in lfs store of repository {}", oid, repository.getNamespaceAndName());
|
||||||
|
throw notFound(entity("LFS", oid).in(repository));
|
||||||
|
}
|
||||||
GitUtil.release(revWalk);
|
GitUtil.release(revWalk);
|
||||||
GitUtil.release(treeWalk);
|
GitUtil.release(treeWalk);
|
||||||
return new BlobLoader(blob);
|
return new BlobLoader(blob);
|
||||||
|
|||||||
@@ -0,0 +1,36 @@
|
|||||||
|
package sonia.scm.repository.spi;
|
||||||
|
|
||||||
|
import org.eclipse.jgit.api.Git;
|
||||||
|
import org.eclipse.jgit.api.MergeCommand;
|
||||||
|
import org.eclipse.jgit.api.MergeResult;
|
||||||
|
import sonia.scm.repository.Repository;
|
||||||
|
import sonia.scm.repository.api.MergeCommandResult;
|
||||||
|
|
||||||
|
import java.io.IOException;
|
||||||
|
|
||||||
|
class GitFastForwardIfPossible extends GitMergeStrategy {
|
||||||
|
|
||||||
|
private GitMergeStrategy fallbackMerge;
|
||||||
|
|
||||||
|
GitFastForwardIfPossible(Git clone, MergeCommandRequest request, GitContext context, Repository repository) {
|
||||||
|
super(clone, request, context, repository);
|
||||||
|
fallbackMerge = new GitMergeCommit(clone, request, context, repository);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
MergeCommandResult run() throws IOException {
|
||||||
|
MergeResult fastForwardResult = mergeWithFastForwardOnlyMode();
|
||||||
|
if (fastForwardResult.getMergeStatus().isSuccessful()) {
|
||||||
|
push();
|
||||||
|
return MergeCommandResult.success();
|
||||||
|
} else {
|
||||||
|
return fallbackMerge.run();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private MergeResult mergeWithFastForwardOnlyMode() throws IOException {
|
||||||
|
MergeCommand mergeCommand = getClone().merge();
|
||||||
|
mergeCommand.setFastForward(MergeCommand.FastForwardMode.FF_ONLY);
|
||||||
|
return doMergeInClone(mergeCommand);
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -106,7 +106,7 @@ public class GitLogCommand extends AbstractGitCommand implements LogCommand
|
|||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
public Changeset getChangeset(String revision)
|
public Changeset getChangeset(String revision, LogCommandRequest request)
|
||||||
{
|
{
|
||||||
if (logger.isDebugEnabled())
|
if (logger.isDebugEnabled())
|
||||||
{
|
{
|
||||||
@@ -131,8 +131,19 @@ public class GitLogCommand extends AbstractGitCommand implements LogCommand
|
|||||||
if (commit != null)
|
if (commit != null)
|
||||||
{
|
{
|
||||||
converter = new GitChangesetConverter(gr, revWalk);
|
converter = new GitChangesetConverter(gr, revWalk);
|
||||||
|
|
||||||
|
if (isBranchRequested(request)) {
|
||||||
|
String branch = request.getBranch();
|
||||||
|
if (isMergedIntoBranch(gr, revWalk, commit, branch)) {
|
||||||
|
logger.trace("returning commit {} with branch {}", commit.getId(), branch);
|
||||||
|
changeset = converter.createChangeset(commit, branch);
|
||||||
|
} else {
|
||||||
|
logger.debug("returning null, because commit {} was not merged into branch {}", commit.getId(), branch);
|
||||||
|
}
|
||||||
|
} else {
|
||||||
changeset = converter.createChangeset(commit);
|
changeset = converter.createChangeset(commit);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
else if (logger.isWarnEnabled())
|
else if (logger.isWarnEnabled())
|
||||||
{
|
{
|
||||||
logger.warn("could not find revision {}", revision);
|
logger.warn("could not find revision {}", revision);
|
||||||
@@ -157,6 +168,18 @@ public class GitLogCommand extends AbstractGitCommand implements LogCommand
|
|||||||
return changeset;
|
return changeset;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private boolean isMergedIntoBranch(Repository repository, RevWalk revWalk, RevCommit commit, String branchName) throws IOException {
|
||||||
|
return revWalk.isMergedInto(commit, findHeadCommitOfBranch(repository, revWalk, branchName));
|
||||||
|
}
|
||||||
|
|
||||||
|
private boolean isBranchRequested(LogCommandRequest request) {
|
||||||
|
return request != null && !Strings.isNullOrEmpty(request.getBranch());
|
||||||
|
}
|
||||||
|
|
||||||
|
private RevCommit findHeadCommitOfBranch(Repository repository, RevWalk revWalk, String branchName) throws IOException {
|
||||||
|
return revWalk.parseCommit(GitUtil.getCommit(repository, revWalk, repository.findRef(branchName)));
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Method description
|
* Method description
|
||||||
*
|
*
|
||||||
|
|||||||
@@ -1,36 +1,30 @@
|
|||||||
package sonia.scm.repository.spi;
|
package sonia.scm.repository.spi;
|
||||||
|
|
||||||
import com.google.common.base.Strings;
|
import com.google.common.collect.ImmutableSet;
|
||||||
import org.eclipse.jgit.api.Git;
|
|
||||||
import org.eclipse.jgit.api.MergeCommand.FastForwardMode;
|
|
||||||
import org.eclipse.jgit.api.MergeResult;
|
|
||||||
import org.eclipse.jgit.api.errors.GitAPIException;
|
|
||||||
import org.eclipse.jgit.lib.ObjectId;
|
|
||||||
import org.eclipse.jgit.lib.Repository;
|
import org.eclipse.jgit.lib.Repository;
|
||||||
import org.eclipse.jgit.merge.MergeStrategy;
|
|
||||||
import org.eclipse.jgit.merge.ResolveMerger;
|
import org.eclipse.jgit.merge.ResolveMerger;
|
||||||
import org.slf4j.Logger;
|
|
||||||
import org.slf4j.LoggerFactory;
|
|
||||||
import sonia.scm.repository.GitWorkdirFactory;
|
import sonia.scm.repository.GitWorkdirFactory;
|
||||||
import sonia.scm.repository.InternalRepositoryException;
|
import sonia.scm.repository.InternalRepositoryException;
|
||||||
import sonia.scm.repository.Person;
|
|
||||||
import sonia.scm.repository.api.MergeCommandResult;
|
import sonia.scm.repository.api.MergeCommandResult;
|
||||||
import sonia.scm.repository.api.MergeDryRunCommandResult;
|
import sonia.scm.repository.api.MergeDryRunCommandResult;
|
||||||
|
import sonia.scm.repository.api.MergeStrategy;
|
||||||
|
import sonia.scm.repository.api.MergeStrategyNotSupportedException;
|
||||||
|
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
import java.text.MessageFormat;
|
import java.util.Set;
|
||||||
|
|
||||||
|
import static org.eclipse.jgit.merge.MergeStrategy.RECURSIVE;
|
||||||
|
|
||||||
public class GitMergeCommand extends AbstractGitCommand implements MergeCommand {
|
public class GitMergeCommand extends AbstractGitCommand implements MergeCommand {
|
||||||
|
|
||||||
private static final Logger logger = LoggerFactory.getLogger(GitMergeCommand.class);
|
|
||||||
|
|
||||||
private static final String MERGE_COMMIT_MESSAGE_TEMPLATE = String.join("\n",
|
|
||||||
"Merge of branch {0} into {1}",
|
|
||||||
"",
|
|
||||||
"Automatic merge by SCM-Manager.");
|
|
||||||
|
|
||||||
private final GitWorkdirFactory workdirFactory;
|
private final GitWorkdirFactory workdirFactory;
|
||||||
|
|
||||||
|
private static final Set<MergeStrategy> STRATEGIES = ImmutableSet.of(
|
||||||
|
MergeStrategy.MERGE_COMMIT,
|
||||||
|
MergeStrategy.FAST_FORWARD_IF_POSSIBLE,
|
||||||
|
MergeStrategy.SQUASH
|
||||||
|
);
|
||||||
|
|
||||||
GitMergeCommand(GitContext context, sonia.scm.repository.Repository repository, GitWorkdirFactory workdirFactory) {
|
GitMergeCommand(GitContext context, sonia.scm.repository.Repository repository, GitWorkdirFactory workdirFactory) {
|
||||||
super(context, repository);
|
super(context, repository);
|
||||||
this.workdirFactory = workdirFactory;
|
this.workdirFactory = workdirFactory;
|
||||||
@@ -38,14 +32,30 @@ public class GitMergeCommand extends AbstractGitCommand implements MergeCommand
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public MergeCommandResult merge(MergeCommandRequest request) {
|
public MergeCommandResult merge(MergeCommandRequest request) {
|
||||||
return inClone(clone -> new MergeWorker(clone, request), workdirFactory, request.getTargetBranch());
|
return mergeWithStrategy(request);
|
||||||
|
}
|
||||||
|
|
||||||
|
private MergeCommandResult mergeWithStrategy(MergeCommandRequest request) {
|
||||||
|
switch(request.getMergeStrategy()) {
|
||||||
|
case SQUASH:
|
||||||
|
return inClone(clone -> new GitMergeWithSquash(clone, request, context, repository), workdirFactory, request.getTargetBranch());
|
||||||
|
|
||||||
|
case FAST_FORWARD_IF_POSSIBLE:
|
||||||
|
return inClone(clone -> new GitFastForwardIfPossible(clone, request, context, repository), workdirFactory, request.getTargetBranch());
|
||||||
|
|
||||||
|
case MERGE_COMMIT:
|
||||||
|
return inClone(clone -> new GitMergeCommit(clone, request, context, repository), workdirFactory, request.getTargetBranch());
|
||||||
|
|
||||||
|
default:
|
||||||
|
throw new MergeStrategyNotSupportedException(repository, request.getMergeStrategy());
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public MergeDryRunCommandResult dryRun(MergeCommandRequest request) {
|
public MergeDryRunCommandResult dryRun(MergeCommandRequest request) {
|
||||||
try {
|
try {
|
||||||
Repository repository = context.open();
|
Repository repository = context.open();
|
||||||
ResolveMerger merger = (ResolveMerger) MergeStrategy.RECURSIVE.newMerger(repository, true);
|
ResolveMerger merger = (ResolveMerger) RECURSIVE.newMerger(repository, true);
|
||||||
return new MergeDryRunCommandResult(
|
return new MergeDryRunCommandResult(
|
||||||
merger.merge(
|
merger.merge(
|
||||||
resolveRevisionOrThrowNotFound(repository, request.getBranchToMerge()),
|
resolveRevisionOrThrowNotFound(repository, request.getBranchToMerge()),
|
||||||
@@ -55,64 +65,14 @@ public class GitMergeCommand extends AbstractGitCommand implements MergeCommand
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private class MergeWorker extends GitCloneWorker<MergeCommandResult> {
|
@Override
|
||||||
|
public boolean isSupported(MergeStrategy strategy) {
|
||||||
private final String target;
|
return STRATEGIES.contains(strategy);
|
||||||
private final String toMerge;
|
|
||||||
private final Person author;
|
|
||||||
private final String messageTemplate;
|
|
||||||
|
|
||||||
private MergeWorker(Git clone, MergeCommandRequest request) {
|
|
||||||
super(clone);
|
|
||||||
this.target = request.getTargetBranch();
|
|
||||||
this.toMerge = request.getBranchToMerge();
|
|
||||||
this.author = request.getAuthor();
|
|
||||||
this.messageTemplate = request.getMessageTemplate();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
MergeCommandResult run() throws IOException {
|
public Set<MergeStrategy> getSupportedMergeStrategies() {
|
||||||
MergeResult result = doMergeInClone();
|
return STRATEGIES;
|
||||||
if (result.getMergeStatus().isSuccessful()) {
|
|
||||||
doCommit();
|
|
||||||
push();
|
|
||||||
return MergeCommandResult.success();
|
|
||||||
} else {
|
|
||||||
return analyseFailure(result);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private MergeResult doMergeInClone() throws IOException {
|
|
||||||
MergeResult result;
|
|
||||||
try {
|
|
||||||
ObjectId sourceRevision = resolveRevision(toMerge);
|
|
||||||
result = getClone().merge()
|
|
||||||
.setFastForward(FastForwardMode.NO_FF)
|
|
||||||
.setCommit(false) // we want to set the author manually
|
|
||||||
.include(toMerge, sourceRevision)
|
|
||||||
.call();
|
|
||||||
} catch (GitAPIException e) {
|
|
||||||
throw new InternalRepositoryException(context.getRepository(), "could not merge branch " + toMerge + " into " + target, e);
|
|
||||||
}
|
|
||||||
return result;
|
|
||||||
}
|
|
||||||
|
|
||||||
private void doCommit() {
|
|
||||||
logger.debug("merged branch {} into {}", toMerge, target);
|
|
||||||
doCommit(MessageFormat.format(determineMessageTemplate(), toMerge, target), author);
|
|
||||||
}
|
|
||||||
|
|
||||||
private String determineMessageTemplate() {
|
|
||||||
if (Strings.isNullOrEmpty(messageTemplate)) {
|
|
||||||
return MERGE_COMMIT_MESSAGE_TEMPLATE;
|
|
||||||
} else {
|
|
||||||
return messageTemplate;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
private MergeCommandResult analyseFailure(MergeResult result) {
|
|
||||||
logger.info("could not merged branch {} into {} due to conflict in paths {}", toMerge, target, result.getConflicts().keySet());
|
|
||||||
return MergeCommandResult.failure(result.getConflicts().keySet());
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -0,0 +1,31 @@
|
|||||||
|
package sonia.scm.repository.spi;
|
||||||
|
|
||||||
|
import org.eclipse.jgit.api.Git;
|
||||||
|
import org.eclipse.jgit.api.MergeCommand;
|
||||||
|
import org.eclipse.jgit.api.MergeResult;
|
||||||
|
import sonia.scm.repository.Repository;
|
||||||
|
import sonia.scm.repository.api.MergeCommandResult;
|
||||||
|
|
||||||
|
import java.io.IOException;
|
||||||
|
|
||||||
|
class GitMergeCommit extends GitMergeStrategy {
|
||||||
|
|
||||||
|
GitMergeCommit(Git clone, MergeCommandRequest request, GitContext context, Repository repository) {
|
||||||
|
super(clone, request, context, repository);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
MergeCommandResult run() throws IOException {
|
||||||
|
MergeCommand mergeCommand = getClone().merge();
|
||||||
|
mergeCommand.setFastForward(MergeCommand.FastForwardMode.NO_FF);
|
||||||
|
MergeResult result = doMergeInClone(mergeCommand);
|
||||||
|
|
||||||
|
if (result.getMergeStatus().isSuccessful()) {
|
||||||
|
doCommit();
|
||||||
|
push();
|
||||||
|
return MergeCommandResult.success();
|
||||||
|
} else {
|
||||||
|
return analyseFailure(result);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,72 @@
|
|||||||
|
package sonia.scm.repository.spi;
|
||||||
|
|
||||||
|
import com.google.common.base.Strings;
|
||||||
|
import org.eclipse.jgit.api.Git;
|
||||||
|
import org.eclipse.jgit.api.MergeCommand;
|
||||||
|
import org.eclipse.jgit.api.MergeResult;
|
||||||
|
import org.eclipse.jgit.api.errors.GitAPIException;
|
||||||
|
import org.eclipse.jgit.lib.ObjectId;
|
||||||
|
import org.slf4j.Logger;
|
||||||
|
import org.slf4j.LoggerFactory;
|
||||||
|
import sonia.scm.repository.InternalRepositoryException;
|
||||||
|
import sonia.scm.repository.Person;
|
||||||
|
import sonia.scm.repository.api.MergeCommandResult;
|
||||||
|
|
||||||
|
import java.io.IOException;
|
||||||
|
import java.text.MessageFormat;
|
||||||
|
|
||||||
|
abstract class GitMergeStrategy extends AbstractGitCommand.GitCloneWorker<MergeCommandResult> {
|
||||||
|
|
||||||
|
private static final Logger logger = LoggerFactory.getLogger(GitMergeStrategy.class);
|
||||||
|
|
||||||
|
private static final String MERGE_COMMIT_MESSAGE_TEMPLATE = String.join("\n",
|
||||||
|
"Merge of branch {0} into {1}",
|
||||||
|
"",
|
||||||
|
"Automatic merge by SCM-Manager.");
|
||||||
|
|
||||||
|
private final String target;
|
||||||
|
private final String toMerge;
|
||||||
|
private final Person author;
|
||||||
|
private final String messageTemplate;
|
||||||
|
|
||||||
|
GitMergeStrategy(Git clone, MergeCommandRequest request, GitContext context, sonia.scm.repository.Repository repository) {
|
||||||
|
super(clone, context, repository);
|
||||||
|
this.target = request.getTargetBranch();
|
||||||
|
this.toMerge = request.getBranchToMerge();
|
||||||
|
this.author = request.getAuthor();
|
||||||
|
this.messageTemplate = request.getMessageTemplate();
|
||||||
|
}
|
||||||
|
|
||||||
|
MergeResult doMergeInClone(MergeCommand mergeCommand) throws IOException {
|
||||||
|
MergeResult result;
|
||||||
|
try {
|
||||||
|
ObjectId sourceRevision = resolveRevision(toMerge);
|
||||||
|
mergeCommand
|
||||||
|
.setCommit(false) // we want to set the author manually
|
||||||
|
.include(toMerge, sourceRevision);
|
||||||
|
|
||||||
|
result = mergeCommand.call();
|
||||||
|
} catch (GitAPIException e) {
|
||||||
|
throw new InternalRepositoryException(getContext().getRepository(), "could not merge branch " + toMerge + " into " + target, e);
|
||||||
|
}
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
|
||||||
|
void doCommit() {
|
||||||
|
logger.debug("merged branch {} into {}", toMerge, target);
|
||||||
|
doCommit(MessageFormat.format(determineMessageTemplate(), toMerge, target), author);
|
||||||
|
}
|
||||||
|
|
||||||
|
private String determineMessageTemplate() {
|
||||||
|
if (Strings.isNullOrEmpty(messageTemplate)) {
|
||||||
|
return MERGE_COMMIT_MESSAGE_TEMPLATE;
|
||||||
|
} else {
|
||||||
|
return messageTemplate;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
MergeCommandResult analyseFailure(MergeResult result) {
|
||||||
|
logger.info("could not merge branch {} into {} due to conflict in paths {}", toMerge, target, result.getConflicts().keySet());
|
||||||
|
return MergeCommandResult.failure(result.getConflicts().keySet());
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,31 @@
|
|||||||
|
package sonia.scm.repository.spi;
|
||||||
|
|
||||||
|
import org.eclipse.jgit.api.Git;
|
||||||
|
import org.eclipse.jgit.api.MergeResult;
|
||||||
|
import sonia.scm.repository.Repository;
|
||||||
|
import sonia.scm.repository.api.MergeCommandResult;
|
||||||
|
import org.eclipse.jgit.api.MergeCommand;
|
||||||
|
|
||||||
|
import java.io.IOException;
|
||||||
|
|
||||||
|
class GitMergeWithSquash extends GitMergeStrategy {
|
||||||
|
|
||||||
|
GitMergeWithSquash(Git clone, MergeCommandRequest request, GitContext context, Repository repository) {
|
||||||
|
super(clone, request, context, repository);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
MergeCommandResult run() throws IOException {
|
||||||
|
MergeCommand mergeCommand = getClone().merge();
|
||||||
|
mergeCommand.setSquash(true);
|
||||||
|
MergeResult result = doMergeInClone(mergeCommand);
|
||||||
|
|
||||||
|
if (result.getMergeStatus().isSuccessful()) {
|
||||||
|
doCommit();
|
||||||
|
push();
|
||||||
|
return MergeCommandResult.success();
|
||||||
|
} else {
|
||||||
|
return analyseFailure(result);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -46,7 +46,7 @@ public class GitModifyCommand extends AbstractGitCommand implements ModifyComman
|
|||||||
private final ModifyCommandRequest request;
|
private final ModifyCommandRequest request;
|
||||||
|
|
||||||
ModifyWorker(Git clone, ModifyCommandRequest request) {
|
ModifyWorker(Git clone, ModifyCommandRequest request) {
|
||||||
super(clone);
|
super(clone, context, repository);
|
||||||
this.workDir = clone.getRepository().getWorkTree();
|
this.workDir = clone.getRepository().getWorkTree();
|
||||||
this.request = request;
|
this.request = request;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -35,10 +35,12 @@ package sonia.scm.repository.spi;
|
|||||||
|
|
||||||
import com.google.common.collect.ImmutableSet;
|
import com.google.common.collect.ImmutableSet;
|
||||||
import sonia.scm.api.v2.resources.GitRepositoryConfigStoreProvider;
|
import sonia.scm.api.v2.resources.GitRepositoryConfigStoreProvider;
|
||||||
|
import sonia.scm.event.ScmEventBus;
|
||||||
import sonia.scm.repository.Feature;
|
import sonia.scm.repository.Feature;
|
||||||
import sonia.scm.repository.GitRepositoryHandler;
|
import sonia.scm.repository.GitRepositoryHandler;
|
||||||
import sonia.scm.repository.Repository;
|
import sonia.scm.repository.Repository;
|
||||||
import sonia.scm.repository.api.Command;
|
import sonia.scm.repository.api.Command;
|
||||||
|
import sonia.scm.repository.api.HookContextFactory;
|
||||||
import sonia.scm.web.lfs.LfsBlobStoreFactory;
|
import sonia.scm.web.lfs.LfsBlobStoreFactory;
|
||||||
|
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
@@ -64,6 +66,7 @@ public class GitRepositoryServiceProvider extends RepositoryServiceProvider
|
|||||||
Command.DIFF_RESULT,
|
Command.DIFF_RESULT,
|
||||||
Command.LOG,
|
Command.LOG,
|
||||||
Command.TAGS,
|
Command.TAGS,
|
||||||
|
Command.BRANCH,
|
||||||
Command.BRANCHES,
|
Command.BRANCHES,
|
||||||
Command.INCOMING,
|
Command.INCOMING,
|
||||||
Command.OUTGOING,
|
Command.OUTGOING,
|
||||||
@@ -77,10 +80,12 @@ public class GitRepositoryServiceProvider extends RepositoryServiceProvider
|
|||||||
|
|
||||||
//~--- constructors ---------------------------------------------------------
|
//~--- constructors ---------------------------------------------------------
|
||||||
|
|
||||||
public GitRepositoryServiceProvider(GitRepositoryHandler handler, Repository repository, GitRepositoryConfigStoreProvider storeProvider, LfsBlobStoreFactory lfsBlobStoreFactory) {
|
public GitRepositoryServiceProvider(GitRepositoryHandler handler, Repository repository, GitRepositoryConfigStoreProvider storeProvider, LfsBlobStoreFactory lfsBlobStoreFactory, HookContextFactory hookContextFactory, ScmEventBus eventBus) {
|
||||||
this.handler = handler;
|
this.handler = handler;
|
||||||
this.repository = repository;
|
this.repository = repository;
|
||||||
this.lfsBlobStoreFactory = lfsBlobStoreFactory;
|
this.lfsBlobStoreFactory = lfsBlobStoreFactory;
|
||||||
|
this.hookContextFactory = hookContextFactory;
|
||||||
|
this.eventBus = eventBus;
|
||||||
this.context = new GitContext(handler.getDirectory(repository.getId()), repository, storeProvider);
|
this.context = new GitContext(handler.getDirectory(repository.getId()), repository, storeProvider);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -133,7 +138,7 @@ public class GitRepositoryServiceProvider extends RepositoryServiceProvider
|
|||||||
@Override
|
@Override
|
||||||
public BranchCommand getBranchCommand()
|
public BranchCommand getBranchCommand()
|
||||||
{
|
{
|
||||||
return new GitBranchCommand(context, repository, handler.getWorkdirFactory());
|
return new GitBranchCommand(context, repository, hookContextFactory, eventBus);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -292,4 +297,8 @@ public class GitRepositoryServiceProvider extends RepositoryServiceProvider
|
|||||||
private final Repository repository;
|
private final Repository repository;
|
||||||
|
|
||||||
private final LfsBlobStoreFactory lfsBlobStoreFactory;
|
private final LfsBlobStoreFactory lfsBlobStoreFactory;
|
||||||
|
|
||||||
|
private final HookContextFactory hookContextFactory;
|
||||||
|
|
||||||
|
private final ScmEventBus eventBus;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -36,9 +36,11 @@ package sonia.scm.repository.spi;
|
|||||||
|
|
||||||
import com.google.inject.Inject;
|
import com.google.inject.Inject;
|
||||||
import sonia.scm.api.v2.resources.GitRepositoryConfigStoreProvider;
|
import sonia.scm.api.v2.resources.GitRepositoryConfigStoreProvider;
|
||||||
|
import sonia.scm.event.ScmEventBus;
|
||||||
import sonia.scm.plugin.Extension;
|
import sonia.scm.plugin.Extension;
|
||||||
import sonia.scm.repository.GitRepositoryHandler;
|
import sonia.scm.repository.GitRepositoryHandler;
|
||||||
import sonia.scm.repository.Repository;
|
import sonia.scm.repository.Repository;
|
||||||
|
import sonia.scm.repository.api.HookContextFactory;
|
||||||
import sonia.scm.web.lfs.LfsBlobStoreFactory;
|
import sonia.scm.web.lfs.LfsBlobStoreFactory;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -51,12 +53,16 @@ public class GitRepositoryServiceResolver implements RepositoryServiceResolver {
|
|||||||
private final GitRepositoryHandler handler;
|
private final GitRepositoryHandler handler;
|
||||||
private final GitRepositoryConfigStoreProvider storeProvider;
|
private final GitRepositoryConfigStoreProvider storeProvider;
|
||||||
private final LfsBlobStoreFactory lfsBlobStoreFactory;
|
private final LfsBlobStoreFactory lfsBlobStoreFactory;
|
||||||
|
private final HookContextFactory hookContextFactory;
|
||||||
|
private final ScmEventBus eventBus;
|
||||||
|
|
||||||
@Inject
|
@Inject
|
||||||
public GitRepositoryServiceResolver(GitRepositoryHandler handler, GitRepositoryConfigStoreProvider storeProvider, LfsBlobStoreFactory lfsBlobStoreFactory) {
|
public GitRepositoryServiceResolver(GitRepositoryHandler handler, GitRepositoryConfigStoreProvider storeProvider, LfsBlobStoreFactory lfsBlobStoreFactory, HookContextFactory hookContextFactory, ScmEventBus eventBus) {
|
||||||
this.handler = handler;
|
this.handler = handler;
|
||||||
this.storeProvider = storeProvider;
|
this.storeProvider = storeProvider;
|
||||||
this.lfsBlobStoreFactory = lfsBlobStoreFactory;
|
this.lfsBlobStoreFactory = lfsBlobStoreFactory;
|
||||||
|
this.hookContextFactory = hookContextFactory;
|
||||||
|
this.eventBus = eventBus;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@@ -64,7 +70,7 @@ public class GitRepositoryServiceResolver implements RepositoryServiceResolver {
|
|||||||
GitRepositoryServiceProvider provider = null;
|
GitRepositoryServiceProvider provider = null;
|
||||||
|
|
||||||
if (GitRepositoryHandler.TYPE_NAME.equalsIgnoreCase(repository.getType())) {
|
if (GitRepositoryHandler.TYPE_NAME.equalsIgnoreCase(repository.getType())) {
|
||||||
provider = new GitRepositoryServiceProvider(handler, repository, storeProvider, lfsBlobStoreFactory);
|
provider = new GitRepositoryServiceProvider(handler, repository, storeProvider, lfsBlobStoreFactory, hookContextFactory, eventBus);
|
||||||
}
|
}
|
||||||
|
|
||||||
return provider;
|
return provider;
|
||||||
|
|||||||
@@ -18,7 +18,7 @@ import java.io.IOException;
|
|||||||
import static sonia.scm.ContextEntry.ContextBuilder.entity;
|
import static sonia.scm.ContextEntry.ContextBuilder.entity;
|
||||||
import static sonia.scm.NotFoundException.notFound;
|
import static sonia.scm.NotFoundException.notFound;
|
||||||
|
|
||||||
public class SimpleGitWorkdirFactory extends SimpleWorkdirFactory<Repository, GitContext> implements GitWorkdirFactory {
|
public class SimpleGitWorkdirFactory extends SimpleWorkdirFactory<Repository, Repository, GitContext> implements GitWorkdirFactory {
|
||||||
|
|
||||||
@Inject
|
@Inject
|
||||||
public SimpleGitWorkdirFactory(WorkdirProvider workdirProvider) {
|
public SimpleGitWorkdirFactory(WorkdirProvider workdirProvider) {
|
||||||
@@ -26,7 +26,7 @@ public class SimpleGitWorkdirFactory extends SimpleWorkdirFactory<Repository, Gi
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public ParentAndClone<Repository> cloneRepository(GitContext context, File target, String initialBranch) {
|
public ParentAndClone<Repository, Repository> cloneRepository(GitContext context, File target, String initialBranch) {
|
||||||
try {
|
try {
|
||||||
Repository clone = Git.cloneRepository()
|
Repository clone = Git.cloneRepository()
|
||||||
.setURI(createScmTransportProtocolUri(context.getDirectory()))
|
.setURI(createScmTransportProtocolUri(context.getDirectory()))
|
||||||
@@ -60,6 +60,13 @@ public class SimpleGitWorkdirFactory extends SimpleWorkdirFactory<Repository, Gi
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected void closeWorkdirInternal(Repository workdir) throws Exception {
|
||||||
|
if (workdir != null) {
|
||||||
|
workdir.close();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected sonia.scm.repository.Repository getScmRepository(GitContext context) {
|
protected sonia.scm.repository.Repository getScmRepository(GitContext context) {
|
||||||
return context.getRepository();
|
return context.getRepository();
|
||||||
|
|||||||
@@ -0,0 +1,28 @@
|
|||||||
|
package sonia.scm.web.lfs;
|
||||||
|
|
||||||
|
import org.eclipse.jgit.lfs.server.Response;
|
||||||
|
import sonia.scm.security.AccessToken;
|
||||||
|
|
||||||
|
import java.text.DateFormat;
|
||||||
|
import java.text.SimpleDateFormat;
|
||||||
|
import java.util.Collections;
|
||||||
|
import java.util.TimeZone;
|
||||||
|
|
||||||
|
class ExpiringAction extends Response.Action {
|
||||||
|
|
||||||
|
@SuppressWarnings({"squid:S00116"})
|
||||||
|
// This class is used for json serialization, only
|
||||||
|
public final String expires_at;
|
||||||
|
|
||||||
|
ExpiringAction(String href, AccessToken accessToken) {
|
||||||
|
this.expires_at = createDateFormat().format(accessToken.getExpiration());
|
||||||
|
this.href = href;
|
||||||
|
this.header = Collections.singletonMap("Authorization", "Bearer " + accessToken.compact());
|
||||||
|
}
|
||||||
|
|
||||||
|
private DateFormat createDateFormat() {
|
||||||
|
SimpleDateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss'Z'");
|
||||||
|
dateFormat.setTimeZone(TimeZone.getTimeZone("GMT"));
|
||||||
|
return dateFormat;
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,98 @@
|
|||||||
|
package sonia.scm.web.lfs;
|
||||||
|
|
||||||
|
import com.fasterxml.jackson.databind.ObjectMapper;
|
||||||
|
import com.google.common.base.Charsets;
|
||||||
|
import org.slf4j.Logger;
|
||||||
|
import org.slf4j.LoggerFactory;
|
||||||
|
import sonia.scm.config.ScmConfiguration;
|
||||||
|
import sonia.scm.plugin.Extension;
|
||||||
|
import sonia.scm.protocolcommand.CommandInterpreter;
|
||||||
|
import sonia.scm.protocolcommand.CommandInterpreterFactory;
|
||||||
|
import sonia.scm.protocolcommand.RepositoryContext;
|
||||||
|
import sonia.scm.protocolcommand.RepositoryContextResolver;
|
||||||
|
import sonia.scm.protocolcommand.ScmCommandProtocol;
|
||||||
|
import sonia.scm.protocolcommand.git.GitRepositoryContextResolver;
|
||||||
|
import sonia.scm.repository.Repository;
|
||||||
|
import sonia.scm.security.AccessToken;
|
||||||
|
|
||||||
|
import javax.inject.Inject;
|
||||||
|
import java.io.IOException;
|
||||||
|
import java.util.Optional;
|
||||||
|
|
||||||
|
import static java.lang.String.format;
|
||||||
|
|
||||||
|
@Extension
|
||||||
|
public class LFSAuthCommand implements CommandInterpreterFactory {
|
||||||
|
|
||||||
|
private static final Logger LOG = LoggerFactory.getLogger(LFSAuthCommand.class);
|
||||||
|
|
||||||
|
private static final String LFS_INFO_URL_PATTERN = "%s/repo/%s/%s.git/info/lfs/";
|
||||||
|
|
||||||
|
private final LfsAccessTokenFactory tokenFactory;
|
||||||
|
private final GitRepositoryContextResolver gitRepositoryContextResolver;
|
||||||
|
private final ObjectMapper objectMapper;
|
||||||
|
private final ScmConfiguration configuration;
|
||||||
|
|
||||||
|
@Inject
|
||||||
|
public LFSAuthCommand(LfsAccessTokenFactory tokenFactory, GitRepositoryContextResolver gitRepositoryContextResolver, ScmConfiguration configuration) {
|
||||||
|
this.tokenFactory = tokenFactory;
|
||||||
|
this.gitRepositoryContextResolver = gitRepositoryContextResolver;
|
||||||
|
|
||||||
|
objectMapper = new ObjectMapper();
|
||||||
|
this.configuration = configuration;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Optional<CommandInterpreter> canHandle(String command) {
|
||||||
|
if (command.startsWith("git-lfs-authenticate")) {
|
||||||
|
LOG.trace("create command for input: {}", command);
|
||||||
|
return Optional.of(new LfsAuthCommandInterpreter(command));
|
||||||
|
} else {
|
||||||
|
return Optional.empty();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private class LfsAuthCommandInterpreter implements CommandInterpreter {
|
||||||
|
|
||||||
|
private final String command;
|
||||||
|
|
||||||
|
LfsAuthCommandInterpreter(String command) {
|
||||||
|
this.command = command;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String[] getParsedArgs() {
|
||||||
|
// we are interested only in the 'repo' argument, so we discard the rest
|
||||||
|
return new String[]{command.split("\\s+")[1]};
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public ScmCommandProtocol getProtocolHandler() {
|
||||||
|
return (context, repositoryContext) -> {
|
||||||
|
ExpiringAction response = createResponseObject(repositoryContext);
|
||||||
|
// we buffer the response and write it with a single write,
|
||||||
|
// because otherwise the ssh connection is not closed
|
||||||
|
String buffer = serializeResponse(response);
|
||||||
|
context.getOutputStream().write(buffer.getBytes(Charsets.UTF_8));
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public RepositoryContextResolver getRepositoryContextResolver() {
|
||||||
|
return gitRepositoryContextResolver;
|
||||||
|
}
|
||||||
|
|
||||||
|
private ExpiringAction createResponseObject(RepositoryContext repositoryContext) {
|
||||||
|
Repository repository = repositoryContext.getRepository();
|
||||||
|
|
||||||
|
String url = format(LFS_INFO_URL_PATTERN, configuration.getBaseUrl(), repository.getNamespace(), repository.getName());
|
||||||
|
AccessToken accessToken = tokenFactory.createReadAccessToken(repository);
|
||||||
|
|
||||||
|
return new ExpiringAction(url, accessToken);
|
||||||
|
}
|
||||||
|
|
||||||
|
private String serializeResponse(ExpiringAction response) throws IOException {
|
||||||
|
return objectMapper.writeValueAsString(response);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,70 @@
|
|||||||
|
package sonia.scm.web.lfs;
|
||||||
|
|
||||||
|
import com.github.sdorra.ssp.PermissionCheck;
|
||||||
|
import org.slf4j.Logger;
|
||||||
|
import org.slf4j.LoggerFactory;
|
||||||
|
import sonia.scm.repository.Repository;
|
||||||
|
import sonia.scm.repository.RepositoryPermissions;
|
||||||
|
import sonia.scm.security.AccessToken;
|
||||||
|
import sonia.scm.security.AccessTokenBuilderFactory;
|
||||||
|
import sonia.scm.security.Scope;
|
||||||
|
|
||||||
|
import javax.inject.Inject;
|
||||||
|
import java.util.ArrayList;
|
||||||
|
import java.util.List;
|
||||||
|
import java.util.concurrent.TimeUnit;
|
||||||
|
|
||||||
|
public class LfsAccessTokenFactory {
|
||||||
|
|
||||||
|
private static final Logger LOG = LoggerFactory.getLogger(LfsAccessTokenFactory.class);
|
||||||
|
|
||||||
|
private final AccessTokenBuilderFactory tokenBuilderFactory;
|
||||||
|
|
||||||
|
@Inject
|
||||||
|
LfsAccessTokenFactory(AccessTokenBuilderFactory tokenBuilderFactory) {
|
||||||
|
this.tokenBuilderFactory = tokenBuilderFactory;
|
||||||
|
}
|
||||||
|
|
||||||
|
AccessToken createReadAccessToken(Repository repository) {
|
||||||
|
PermissionCheck read = RepositoryPermissions.read(repository);
|
||||||
|
read.check();
|
||||||
|
|
||||||
|
PermissionCheck pull = RepositoryPermissions.pull(repository);
|
||||||
|
pull.check();
|
||||||
|
|
||||||
|
List<String> permissions = new ArrayList<>();
|
||||||
|
permissions.add(read.asShiroString());
|
||||||
|
permissions.add(pull.asShiroString());
|
||||||
|
|
||||||
|
PermissionCheck push = RepositoryPermissions.push(repository);
|
||||||
|
if (push.isPermitted()) {
|
||||||
|
// we have to add push permissions,
|
||||||
|
// because this token is also used to obtain the write access token
|
||||||
|
permissions.add(push.asShiroString());
|
||||||
|
}
|
||||||
|
|
||||||
|
return createToken(Scope.valueOf(permissions));
|
||||||
|
}
|
||||||
|
|
||||||
|
AccessToken createWriteAccessToken(Repository repository) {
|
||||||
|
PermissionCheck read = RepositoryPermissions.read(repository);
|
||||||
|
read.check();
|
||||||
|
|
||||||
|
PermissionCheck pull = RepositoryPermissions.pull(repository);
|
||||||
|
pull.check();
|
||||||
|
|
||||||
|
PermissionCheck push = RepositoryPermissions.push(repository);
|
||||||
|
push.check();
|
||||||
|
|
||||||
|
return createToken(Scope.valueOf(read.asShiroString(), pull.asShiroString(), push.asShiroString()));
|
||||||
|
}
|
||||||
|
|
||||||
|
private AccessToken createToken(Scope scope) {
|
||||||
|
LOG.trace("create access token with scope: {}", scope);
|
||||||
|
return tokenBuilderFactory
|
||||||
|
.create()
|
||||||
|
.expiresIn(5, TimeUnit.MINUTES)
|
||||||
|
.scope(scope)
|
||||||
|
.build();
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -2,12 +2,13 @@ package sonia.scm.web.lfs;
|
|||||||
|
|
||||||
import org.eclipse.jgit.lfs.lib.AnyLongObjectId;
|
import org.eclipse.jgit.lfs.lib.AnyLongObjectId;
|
||||||
import org.eclipse.jgit.lfs.server.LargeFileRepository;
|
import org.eclipse.jgit.lfs.server.LargeFileRepository;
|
||||||
import org.eclipse.jgit.lfs.server.Response;
|
import org.slf4j.Logger;
|
||||||
|
import org.slf4j.LoggerFactory;
|
||||||
|
import sonia.scm.repository.Repository;
|
||||||
|
import sonia.scm.security.AccessToken;
|
||||||
import sonia.scm.store.Blob;
|
import sonia.scm.store.Blob;
|
||||||
import sonia.scm.store.BlobStore;
|
import sonia.scm.store.BlobStore;
|
||||||
|
|
||||||
import java.io.IOException;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* This LargeFileRepository is used for jGit-Servlet implementation. Under the jgit LFS Servlet hood, the
|
* This LargeFileRepository is used for jGit-Servlet implementation. Under the jgit LFS Servlet hood, the
|
||||||
* SCM-Repository API is used to implement the Repository.
|
* SCM-Repository API is used to implement the Repository.
|
||||||
@@ -17,49 +18,67 @@ import java.io.IOException;
|
|||||||
*/
|
*/
|
||||||
public class ScmBlobLfsRepository implements LargeFileRepository {
|
public class ScmBlobLfsRepository implements LargeFileRepository {
|
||||||
|
|
||||||
|
private static final Logger LOG = LoggerFactory.getLogger(ScmBlobLfsRepository.class);
|
||||||
|
|
||||||
private final BlobStore blobStore;
|
private final BlobStore blobStore;
|
||||||
|
private final LfsAccessTokenFactory tokenFactory;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* This URI is used to determine the actual URI for Upload / Download. Must be full URI (or rewritable by reverse
|
* This URI is used to determine the actual URI for Upload / Download. Must be full URI (or rewritable by reverse
|
||||||
* proxy).
|
* proxy).
|
||||||
*/
|
*/
|
||||||
private final String baseUri;
|
private final String baseUri;
|
||||||
|
private final Repository repository;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* A {@link ScmBlobLfsRepository} is created for either download or upload, not both. Therefore we can cache the
|
||||||
|
* access token and do not have to create them anew for each action.
|
||||||
|
*/
|
||||||
|
private AccessToken accessToken;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Creates a {@link ScmBlobLfsRepository} for the provided repository.
|
* Creates a {@link ScmBlobLfsRepository} for the provided repository.
|
||||||
*
|
*
|
||||||
|
* @param repository The current scm repository this LFS repository is used for.
|
||||||
* @param blobStore The SCM Blobstore used for this @{@link LargeFileRepository}.
|
* @param blobStore The SCM Blobstore used for this @{@link LargeFileRepository}.
|
||||||
|
* @param tokenFactory The token builder for subsequent LFS requests.
|
||||||
* @param baseUri This URI is used to determine the actual URI for Upload / Download. Must be full URI (or
|
* @param baseUri This URI is used to determine the actual URI for Upload / Download. Must be full URI (or
|
||||||
* rewritable by reverse proxy).
|
|
||||||
*/
|
*/
|
||||||
|
|
||||||
public ScmBlobLfsRepository(BlobStore blobStore, String baseUri) {
|
public ScmBlobLfsRepository(Repository repository, BlobStore blobStore, LfsAccessTokenFactory tokenFactory, String baseUri) {
|
||||||
|
this.repository = repository;
|
||||||
this.blobStore = blobStore;
|
this.blobStore = blobStore;
|
||||||
|
this.tokenFactory = tokenFactory;
|
||||||
this.baseUri = baseUri;
|
this.baseUri = baseUri;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public Response.Action getDownloadAction(AnyLongObjectId id) {
|
public ExpiringAction getDownloadAction(AnyLongObjectId id) {
|
||||||
|
if (accessToken == null) {
|
||||||
return getAction(id);
|
LOG.trace("create access token to download lfs object {} from repository {}", id, repository.getNamespaceAndName());
|
||||||
|
accessToken = tokenFactory.createReadAccessToken(repository);
|
||||||
|
}
|
||||||
|
return getAction(id, accessToken);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public Response.Action getUploadAction(AnyLongObjectId id, long size) {
|
public ExpiringAction getUploadAction(AnyLongObjectId id, long size) {
|
||||||
|
if (accessToken == null) {
|
||||||
return getAction(id);
|
LOG.trace("create access token to upload lfs object {} to repository {}", id, repository.getNamespaceAndName());
|
||||||
|
accessToken = tokenFactory.createWriteAccessToken(repository);
|
||||||
|
}
|
||||||
|
return getAction(id, accessToken);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public Response.Action getVerifyAction(AnyLongObjectId id) {
|
public ExpiringAction getVerifyAction(AnyLongObjectId id) {
|
||||||
|
|
||||||
//validation is optional. We do not support it.
|
//validation is optional. We do not support it.
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public long getSize(AnyLongObjectId id) throws IOException {
|
public long getSize(AnyLongObjectId id) {
|
||||||
|
|
||||||
//this needs to be size of what is will be written into the response of the download. Clients are likely to
|
//this needs to be size of what is will be written into the response of the download. Clients are likely to
|
||||||
// verify it.
|
// verify it.
|
||||||
@@ -77,14 +96,11 @@ public class ScmBlobLfsRepository implements LargeFileRepository {
|
|||||||
/**
|
/**
|
||||||
* Constructs the Download / Upload actions to be supplied to the client.
|
* Constructs the Download / Upload actions to be supplied to the client.
|
||||||
*/
|
*/
|
||||||
private Response.Action getAction(AnyLongObjectId id) {
|
private ExpiringAction getAction(AnyLongObjectId id, AccessToken token) {
|
||||||
|
|
||||||
//LFS protocol has to provide the information on where to put or get the actual content, i. e.
|
//LFS protocol has to provide the information on where to put or get the actual content, i. e.
|
||||||
//the actual URI for up- and download.
|
//the actual URI for up- and download.
|
||||||
|
|
||||||
Response.Action a = new Response.Action();
|
return new ExpiringAction(baseUri + id.getName(), token);
|
||||||
a.href = baseUri + id.getName();
|
|
||||||
|
|
||||||
return a;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -9,6 +9,7 @@ import org.slf4j.LoggerFactory;
|
|||||||
import sonia.scm.repository.Repository;
|
import sonia.scm.repository.Repository;
|
||||||
import sonia.scm.store.BlobStore;
|
import sonia.scm.store.BlobStore;
|
||||||
import sonia.scm.util.HttpUtil;
|
import sonia.scm.util.HttpUtil;
|
||||||
|
import sonia.scm.web.lfs.LfsAccessTokenFactory;
|
||||||
import sonia.scm.web.lfs.LfsBlobStoreFactory;
|
import sonia.scm.web.lfs.LfsBlobStoreFactory;
|
||||||
import sonia.scm.web.lfs.ScmBlobLfsRepository;
|
import sonia.scm.web.lfs.ScmBlobLfsRepository;
|
||||||
|
|
||||||
@@ -27,13 +28,15 @@ import javax.servlet.http.HttpServletRequest;
|
|||||||
@Singleton
|
@Singleton
|
||||||
public class LfsServletFactory {
|
public class LfsServletFactory {
|
||||||
|
|
||||||
private static final Logger logger = LoggerFactory.getLogger(LfsServletFactory.class);
|
private static final Logger LOG = LoggerFactory.getLogger(LfsServletFactory.class);
|
||||||
|
|
||||||
private final LfsBlobStoreFactory lfsBlobStoreFactory;
|
private final LfsBlobStoreFactory lfsBlobStoreFactory;
|
||||||
|
private final LfsAccessTokenFactory tokenFactory;
|
||||||
|
|
||||||
@Inject
|
@Inject
|
||||||
public LfsServletFactory(LfsBlobStoreFactory lfsBlobStoreFactory) {
|
public LfsServletFactory(LfsBlobStoreFactory lfsBlobStoreFactory, LfsAccessTokenFactory tokenFactory) {
|
||||||
this.lfsBlobStoreFactory = lfsBlobStoreFactory;
|
this.lfsBlobStoreFactory = lfsBlobStoreFactory;
|
||||||
|
this.tokenFactory = tokenFactory;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -44,10 +47,11 @@ public class LfsServletFactory {
|
|||||||
* @return The {@link LfsProtocolServlet} to provide the LFS Batch API for a SCM Repository.
|
* @return The {@link LfsProtocolServlet} to provide the LFS Batch API for a SCM Repository.
|
||||||
*/
|
*/
|
||||||
public LfsProtocolServlet createProtocolServletFor(Repository repository, HttpServletRequest request) {
|
public LfsProtocolServlet createProtocolServletFor(Repository repository, HttpServletRequest request) {
|
||||||
|
LOG.trace("create lfs protocol servlet for repository {}", repository.getNamespaceAndName());
|
||||||
BlobStore blobStore = lfsBlobStoreFactory.getLfsBlobStore(repository);
|
BlobStore blobStore = lfsBlobStoreFactory.getLfsBlobStore(repository);
|
||||||
String baseUri = buildBaseUri(repository, request);
|
String baseUri = buildBaseUri(repository, request);
|
||||||
|
|
||||||
LargeFileRepository largeFileRepository = new ScmBlobLfsRepository(blobStore, baseUri);
|
LargeFileRepository largeFileRepository = new ScmBlobLfsRepository(repository, blobStore, tokenFactory, baseUri);
|
||||||
return new ScmLfsProtocolServlet(largeFileRepository);
|
return new ScmLfsProtocolServlet(largeFileRepository);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -59,6 +63,7 @@ public class LfsServletFactory {
|
|||||||
* @return The {@link FileLfsServlet} to provide the LFS Upload / Download API for a SCM Repository.
|
* @return The {@link FileLfsServlet} to provide the LFS Upload / Download API for a SCM Repository.
|
||||||
*/
|
*/
|
||||||
public HttpServlet createFileLfsServletFor(Repository repository, HttpServletRequest request) {
|
public HttpServlet createFileLfsServletFor(Repository repository, HttpServletRequest request) {
|
||||||
|
LOG.trace("create lfs file servlet for repository {}", repository.getNamespaceAndName());
|
||||||
return new ScmFileTransferServlet(lfsBlobStoreFactory.getLfsBlobStore(repository));
|
return new ScmFileTransferServlet(lfsBlobStoreFactory.getLfsBlobStore(repository));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -1,14 +1,10 @@
|
|||||||
//@flow
|
|
||||||
import React from "react";
|
import React from "react";
|
||||||
import { translate } from "react-i18next";
|
import { WithTranslation, withTranslation } from "react-i18next";
|
||||||
import type { Repository } from "@scm-manager/ui-types";
|
import { Repository } from "@scm-manager/ui-types";
|
||||||
|
|
||||||
type Props = {
|
type Props = WithTranslation & {
|
||||||
url: string,
|
url: string;
|
||||||
repository: Repository,
|
repository: Repository;
|
||||||
|
|
||||||
// context props
|
|
||||||
t: string => string
|
|
||||||
};
|
};
|
||||||
|
|
||||||
class CloneInformation extends React.Component<Props> {
|
class CloneInformation extends React.Component<Props> {
|
||||||
@@ -28,7 +24,8 @@ class CloneInformation extends React.Component<Props> {
|
|||||||
<br />
|
<br />
|
||||||
cd {repository.name}
|
cd {repository.name}
|
||||||
<br />
|
<br />
|
||||||
echo "# {repository.name}" > README.md
|
echo "# {repository.name}
|
||||||
|
" > README.md
|
||||||
<br />
|
<br />
|
||||||
git add README.md
|
git add README.md
|
||||||
<br />
|
<br />
|
||||||
@@ -54,4 +51,4 @@ class CloneInformation extends React.Component<Props> {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
export default translate("plugins")(CloneInformation);
|
export default withTranslation("plugins")(CloneInformation);
|
||||||
@@ -1,16 +1,12 @@
|
|||||||
//@flow
|
|
||||||
import React from "react";
|
import React from "react";
|
||||||
import { Image } from "@scm-manager/ui-components";
|
import { Image } from "@scm-manager/ui-components";
|
||||||
|
|
||||||
type Props = {
|
type Props = {};
|
||||||
};
|
|
||||||
|
|
||||||
class GitAvatar extends React.Component<Props> {
|
class GitAvatar extends React.Component<Props> {
|
||||||
|
|
||||||
render() {
|
render() {
|
||||||
return <Image src="/images/git-logo.png" alt="Git Logo" />;
|
return <Image src="/images/git-logo.png" alt="Git Logo" />;
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
export default GitAvatar;
|
export default GitAvatar;
|
||||||
@@ -1,11 +1,9 @@
|
|||||||
//@flow
|
|
||||||
import React from "react";
|
import React from "react";
|
||||||
import type { Branch } from "@scm-manager/ui-types";
|
import { WithTranslation, withTranslation } from "react-i18next";
|
||||||
import { translate } from "react-i18next";
|
import { Branch } from "@scm-manager/ui-types";
|
||||||
|
|
||||||
type Props = {
|
type Props = WithTranslation & {
|
||||||
branch: Branch,
|
branch: Branch;
|
||||||
t: string => string
|
|
||||||
};
|
};
|
||||||
|
|
||||||
class GitBranchInformation extends React.Component<Props> {
|
class GitBranchInformation extends React.Component<Props> {
|
||||||
@@ -27,4 +25,4 @@ class GitBranchInformation extends React.Component<Props> {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
export default translate("plugins")(GitBranchInformation);
|
export default withTranslation("plugins")(GitBranchInformation);
|
||||||
@@ -1,25 +1,20 @@
|
|||||||
//@flow
|
|
||||||
import React from "react";
|
import React from "react";
|
||||||
import { translate } from "react-i18next";
|
import { WithTranslation, withTranslation } from "react-i18next";
|
||||||
import type { Links } from "@scm-manager/ui-types";
|
import { Links } from "@scm-manager/ui-types";
|
||||||
|
|
||||||
import { InputField, Checkbox } from "@scm-manager/ui-components";
|
import { InputField, Checkbox } from "@scm-manager/ui-components";
|
||||||
|
|
||||||
type Configuration = {
|
type Configuration = {
|
||||||
repositoryDirectory?: string,
|
repositoryDirectory?: string;
|
||||||
gcExpression?: string,
|
gcExpression?: string;
|
||||||
nonFastForwardDisallowed: boolean,
|
nonFastForwardDisallowed: boolean;
|
||||||
_links: Links
|
_links: Links;
|
||||||
};
|
};
|
||||||
|
|
||||||
type Props = {
|
type Props = WithTranslation & {
|
||||||
initialConfiguration: Configuration,
|
initialConfiguration: Configuration;
|
||||||
readOnly: boolean,
|
readOnly: boolean;
|
||||||
|
|
||||||
onConfigurationChange: (Configuration, boolean) => void,
|
onConfigurationChange: (p1: Configuration, p2: boolean) => void;
|
||||||
|
|
||||||
// context props
|
|
||||||
t: string => string
|
|
||||||
};
|
};
|
||||||
|
|
||||||
type State = Configuration & {};
|
type State = Configuration & {};
|
||||||
@@ -27,13 +22,24 @@ type State = Configuration & {};
|
|||||||
class GitConfigurationForm extends React.Component<Props, State> {
|
class GitConfigurationForm extends React.Component<Props, State> {
|
||||||
constructor(props: Props) {
|
constructor(props: Props) {
|
||||||
super(props);
|
super(props);
|
||||||
this.state = { ...props.initialConfiguration };
|
this.state = {
|
||||||
|
...props.initialConfiguration
|
||||||
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
handleChange = (value: any, name: string) => {
|
onGcExpressionChange = (value: string) => {
|
||||||
this.setState(
|
this.setState(
|
||||||
{
|
{
|
||||||
[name]: value
|
gcExpression: value
|
||||||
|
},
|
||||||
|
() => this.props.onConfigurationChange(this.state, true)
|
||||||
|
);
|
||||||
|
};
|
||||||
|
|
||||||
|
onNonFastForwardDisallowed = (value: boolean) => {
|
||||||
|
this.setState(
|
||||||
|
{
|
||||||
|
nonFastForwardDisallowed: value
|
||||||
},
|
},
|
||||||
() => this.props.onConfigurationChange(this.state, true)
|
() => this.props.onConfigurationChange(this.state, true)
|
||||||
);
|
);
|
||||||
@@ -50,7 +56,7 @@ class GitConfigurationForm extends React.Component<Props, State> {
|
|||||||
label={t("scm-git-plugin.config.gcExpression")}
|
label={t("scm-git-plugin.config.gcExpression")}
|
||||||
helpText={t("scm-git-plugin.config.gcExpressionHelpText")}
|
helpText={t("scm-git-plugin.config.gcExpressionHelpText")}
|
||||||
value={gcExpression}
|
value={gcExpression}
|
||||||
onChange={this.handleChange}
|
onChange={this.onGcExpressionChange}
|
||||||
disabled={readOnly}
|
disabled={readOnly}
|
||||||
/>
|
/>
|
||||||
<Checkbox
|
<Checkbox
|
||||||
@@ -58,7 +64,7 @@ class GitConfigurationForm extends React.Component<Props, State> {
|
|||||||
label={t("scm-git-plugin.config.nonFastForwardDisallowed")}
|
label={t("scm-git-plugin.config.nonFastForwardDisallowed")}
|
||||||
helpText={t("scm-git-plugin.config.nonFastForwardDisallowedHelpText")}
|
helpText={t("scm-git-plugin.config.nonFastForwardDisallowedHelpText")}
|
||||||
checked={nonFastForwardDisallowed}
|
checked={nonFastForwardDisallowed}
|
||||||
onChange={this.handleChange}
|
onChange={this.onNonFastForwardDisallowed}
|
||||||
disabled={readOnly}
|
disabled={readOnly}
|
||||||
/>
|
/>
|
||||||
</>
|
</>
|
||||||
@@ -66,4 +72,4 @@ class GitConfigurationForm extends React.Component<Props, State> {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
export default translate("plugins")(GitConfigurationForm);
|
export default withTranslation("plugins")(GitConfigurationForm);
|
||||||
@@ -1,32 +0,0 @@
|
|||||||
//@flow
|
|
||||||
import React from "react";
|
|
||||||
import { translate } from "react-i18next";
|
|
||||||
import { Title, Configuration } from "@scm-manager/ui-components";
|
|
||||||
import GitConfigurationForm from "./GitConfigurationForm";
|
|
||||||
|
|
||||||
type Props = {
|
|
||||||
link: string,
|
|
||||||
|
|
||||||
t: (string) => string
|
|
||||||
};
|
|
||||||
|
|
||||||
class GitGlobalConfiguration extends React.Component<Props> {
|
|
||||||
|
|
||||||
constructor(props: Props) {
|
|
||||||
super(props);
|
|
||||||
}
|
|
||||||
|
|
||||||
render() {
|
|
||||||
const { link, t } = this.props;
|
|
||||||
|
|
||||||
return (
|
|
||||||
<div>
|
|
||||||
<Title title={t("scm-git-plugin.config.title")}/>
|
|
||||||
<Configuration link={link} render={props => <GitConfigurationForm {...props} />}/>
|
|
||||||
</div>
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
export default translate("plugins")(GitGlobalConfiguration);
|
|
||||||
@@ -0,0 +1,23 @@
|
|||||||
|
import React from "react";
|
||||||
|
import { WithTranslation, withTranslation } from "react-i18next";
|
||||||
|
import { Title, Configuration } from "@scm-manager/ui-components";
|
||||||
|
import GitConfigurationForm from "./GitConfigurationForm";
|
||||||
|
|
||||||
|
type Props = WithTranslation & {
|
||||||
|
link: string;
|
||||||
|
};
|
||||||
|
|
||||||
|
class GitGlobalConfiguration extends React.Component<Props> {
|
||||||
|
render() {
|
||||||
|
const { link, t } = this.props;
|
||||||
|
|
||||||
|
return (
|
||||||
|
<div>
|
||||||
|
<Title title={t("scm-git-plugin.config.title")} />
|
||||||
|
<Configuration link={link} render={(props: any) => <GitConfigurationForm {...props} />} />
|
||||||
|
</div>
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
export default withTranslation("plugins")(GitGlobalConfiguration);
|
||||||
@@ -1,13 +1,11 @@
|
|||||||
//@flow
|
|
||||||
import React from "react";
|
import React from "react";
|
||||||
import type { Repository } from "@scm-manager/ui-types";
|
import { WithTranslation, withTranslation } from "react-i18next";
|
||||||
import { translate } from "react-i18next";
|
import { Repository } from "@scm-manager/ui-types";
|
||||||
|
|
||||||
type Props = {
|
type Props = WithTranslation & {
|
||||||
repository: Repository,
|
repository: Repository;
|
||||||
target: string,
|
target: string;
|
||||||
source: string,
|
source: string;
|
||||||
t: string => string
|
|
||||||
};
|
};
|
||||||
|
|
||||||
class GitMergeInformation extends React.Component<Props> {
|
class GitMergeInformation extends React.Component<Props> {
|
||||||
@@ -23,21 +21,15 @@ class GitMergeInformation extends React.Component<Props> {
|
|||||||
</pre>
|
</pre>
|
||||||
{t("scm-git-plugin.information.merge.update")}
|
{t("scm-git-plugin.information.merge.update")}
|
||||||
<pre>
|
<pre>
|
||||||
<code>
|
<code>git pull</code>
|
||||||
git pull
|
|
||||||
</code>
|
|
||||||
</pre>
|
</pre>
|
||||||
{t("scm-git-plugin.information.merge.merge")}
|
{t("scm-git-plugin.information.merge.merge")}
|
||||||
<pre>
|
<pre>
|
||||||
<code>
|
<code>git merge {source}</code>
|
||||||
git merge {source}
|
|
||||||
</code>
|
|
||||||
</pre>
|
</pre>
|
||||||
{t("scm-git-plugin.information.merge.resolve")}
|
{t("scm-git-plugin.information.merge.resolve")}
|
||||||
<pre>
|
<pre>
|
||||||
<code>
|
<code>git add <conflict file></code>
|
||||||
git add <conflict file>
|
|
||||||
</code>
|
|
||||||
</pre>
|
</pre>
|
||||||
{t("scm-git-plugin.information.merge.commit")}
|
{t("scm-git-plugin.information.merge.commit")}
|
||||||
<pre>
|
<pre>
|
||||||
@@ -47,13 +39,11 @@ class GitMergeInformation extends React.Component<Props> {
|
|||||||
</pre>
|
</pre>
|
||||||
{t("scm-git-plugin.information.merge.push")}
|
{t("scm-git-plugin.information.merge.push")}
|
||||||
<pre>
|
<pre>
|
||||||
<code>
|
<code>git push</code>
|
||||||
git push
|
|
||||||
</code>
|
|
||||||
</pre>
|
</pre>
|
||||||
</div>
|
</div>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
export default translate("plugins")(GitMergeInformation);
|
export default withTranslation("plugins")(GitMergeInformation);
|
||||||
@@ -1,7 +1,6 @@
|
|||||||
//@flow
|
|
||||||
import React from "react";
|
import React from "react";
|
||||||
import styled from "styled-components";
|
import styled from "styled-components";
|
||||||
import type { Repository, Link } from "@scm-manager/ui-types";
|
import { Repository, Link } from "@scm-manager/ui-types";
|
||||||
import { ButtonAddons, Button } from "@scm-manager/ui-components";
|
import { ButtonAddons, Button } from "@scm-manager/ui-components";
|
||||||
import CloneInformation from "./CloneInformation";
|
import CloneInformation from "./CloneInformation";
|
||||||
|
|
||||||
@@ -16,17 +15,17 @@ const Switcher = styled(ButtonAddons)`
|
|||||||
`;
|
`;
|
||||||
|
|
||||||
type Props = {
|
type Props = {
|
||||||
repository: Repository
|
repository: Repository;
|
||||||
};
|
};
|
||||||
|
|
||||||
type State = {
|
type State = {
|
||||||
selected?: Link
|
selected?: Link;
|
||||||
};
|
};
|
||||||
|
|
||||||
function selectHttpOrFirst(repository: Repository) {
|
function selectHttpOrFirst(repository: Repository) {
|
||||||
const protocols = repository._links["protocol"] || [];
|
const protocols = (repository._links["protocol"] as Link[]) || [];
|
||||||
|
|
||||||
for (let protocol of protocols) {
|
for (const protocol of protocols) {
|
||||||
if (protocol.name === "http") {
|
if (protocol.name === "http") {
|
||||||
return protocol;
|
return protocol;
|
||||||
}
|
}
|
||||||
@@ -55,7 +54,7 @@ export default class ProtocolInformation extends React.Component<Props, State> {
|
|||||||
renderProtocolButton = (protocol: Link) => {
|
renderProtocolButton = (protocol: Link) => {
|
||||||
const name = protocol.name || "unknown";
|
const name = protocol.name || "unknown";
|
||||||
|
|
||||||
let color = null;
|
let color;
|
||||||
|
|
||||||
const { selected } = this.state;
|
const { selected } = this.state;
|
||||||
if (selected && protocol.name === selected.name) {
|
if (selected && protocol.name === selected.name) {
|
||||||
@@ -72,23 +71,19 @@ export default class ProtocolInformation extends React.Component<Props, State> {
|
|||||||
render() {
|
render() {
|
||||||
const { repository } = this.props;
|
const { repository } = this.props;
|
||||||
|
|
||||||
const protocols = repository._links["protocol"];
|
const protocols = repository._links["protocol"] as Link[];
|
||||||
if (!protocols || protocols.length === 0) {
|
if (!protocols || protocols.length === 0) {
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (protocols.length === 1) {
|
if (protocols.length === 1) {
|
||||||
return (
|
return <CloneInformation url={protocols[0].href} repository={repository} />;
|
||||||
<CloneInformation url={protocols[0].href} repository={repository} />
|
|
||||||
);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
const { selected } = this.state;
|
const { selected } = this.state;
|
||||||
let cloneInformation = null;
|
let cloneInformation = null;
|
||||||
if (selected) {
|
if (selected) {
|
||||||
cloneInformation = (
|
cloneInformation = <CloneInformation repository={repository} url={selected.href} />;
|
||||||
<CloneInformation repository={repository} url={selected.href} />
|
|
||||||
);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return (
|
return (
|
||||||
@@ -1,31 +1,26 @@
|
|||||||
// @flow
|
import React, { FormEvent } from "react";
|
||||||
|
import { WithTranslation, withTranslation } from "react-i18next";
|
||||||
import React from "react";
|
import { Branch, Repository, Link } from "@scm-manager/ui-types";
|
||||||
|
|
||||||
import { apiClient, BranchSelector, ErrorPage, Loading, Subtitle, SubmitButton } from "@scm-manager/ui-components";
|
import { apiClient, BranchSelector, ErrorPage, Loading, Subtitle, SubmitButton } from "@scm-manager/ui-components";
|
||||||
import type {Branch, Repository} from "@scm-manager/ui-types";
|
|
||||||
import {translate} from "react-i18next";
|
|
||||||
|
|
||||||
type Props = {
|
type Props = WithTranslation & {
|
||||||
repository: Repository,
|
repository: Repository;
|
||||||
t: string => string
|
|
||||||
};
|
};
|
||||||
|
|
||||||
type State = {
|
type State = {
|
||||||
loadingBranches: boolean,
|
loadingBranches: boolean;
|
||||||
loadingDefaultBranch: boolean,
|
loadingDefaultBranch: boolean;
|
||||||
submitPending: boolean,
|
submitPending: boolean;
|
||||||
error?: Error,
|
error?: Error;
|
||||||
branches: Branch[],
|
branches: Branch[];
|
||||||
selectedBranchName?: string,
|
selectedBranchName?: string;
|
||||||
defaultBranchChanged: boolean,
|
defaultBranchChanged: boolean;
|
||||||
disabled: boolean
|
disabled: boolean;
|
||||||
};
|
};
|
||||||
|
|
||||||
const GIT_CONFIG_CONTENT_TYPE = "application/vnd.scmm-gitConfig+json";
|
const GIT_CONFIG_CONTENT_TYPE = "application/vnd.scmm-gitConfig+json";
|
||||||
|
|
||||||
class RepositoryConfig extends React.Component<Props, State> {
|
class RepositoryConfig extends React.Component<Props, State> {
|
||||||
|
|
||||||
constructor(props: Props) {
|
constructor(props: Props) {
|
||||||
super(props);
|
super(props);
|
||||||
|
|
||||||
@@ -41,19 +36,36 @@ class RepositoryConfig extends React.Component<Props, State> {
|
|||||||
|
|
||||||
componentDidMount() {
|
componentDidMount() {
|
||||||
const { repository } = this.props;
|
const { repository } = this.props;
|
||||||
this.setState({ ...this.state, loadingBranches: true });
|
this.setState({
|
||||||
|
...this.state,
|
||||||
|
loadingBranches: true
|
||||||
|
});
|
||||||
|
const branchesLink = repository._links.branches as Link;
|
||||||
apiClient
|
apiClient
|
||||||
.get(repository._links.branches.href)
|
.get(branchesLink.href)
|
||||||
.then(response => response.json())
|
.then(response => response.json())
|
||||||
.then(payload => payload._embedded.branches)
|
.then(payload => payload._embedded.branches)
|
||||||
.then(branches =>
|
.then(branches =>
|
||||||
this.setState({ ...this.state, branches, loadingBranches: false })
|
this.setState({
|
||||||
|
...this.state,
|
||||||
|
branches,
|
||||||
|
loadingBranches: false
|
||||||
|
})
|
||||||
)
|
)
|
||||||
.catch(error => this.setState({ ...this.state, error }));
|
.catch(error =>
|
||||||
|
this.setState({
|
||||||
|
...this.state,
|
||||||
|
error
|
||||||
|
})
|
||||||
|
);
|
||||||
|
|
||||||
this.setState({ ...this.state, loadingDefaultBranch: true });
|
const configurationLink = repository._links.configuration as Link;
|
||||||
|
this.setState({
|
||||||
|
...this.state,
|
||||||
|
loadingDefaultBranch: true
|
||||||
|
});
|
||||||
apiClient
|
apiClient
|
||||||
.get(repository._links.configuration.href)
|
.get(configurationLink.href)
|
||||||
.then(response => response.json())
|
.then(response => response.json())
|
||||||
.then(payload =>
|
.then(payload =>
|
||||||
this.setState({
|
this.setState({
|
||||||
@@ -63,31 +75,44 @@ class RepositoryConfig extends React.Component<Props, State> {
|
|||||||
loadingDefaultBranch: false
|
loadingDefaultBranch: false
|
||||||
})
|
})
|
||||||
)
|
)
|
||||||
.catch(error => this.setState({ ...this.state, error }));
|
.catch(error =>
|
||||||
|
this.setState({
|
||||||
|
...this.state,
|
||||||
|
error
|
||||||
|
})
|
||||||
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
branchSelected = (branch: Branch) => {
|
branchSelected = (branch?: Branch) => {
|
||||||
if (!branch) {
|
if (!branch) {
|
||||||
this.setState({ ...this.state, selectedBranchName: undefined, defaultBranchChanged: false});
|
this.setState({
|
||||||
|
...this.state,
|
||||||
|
selectedBranchName: undefined,
|
||||||
|
defaultBranchChanged: false
|
||||||
|
});
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
this.setState({ ...this.state, selectedBranchName: branch.name, defaultBranchChanged: false });
|
this.setState({
|
||||||
|
...this.state,
|
||||||
|
selectedBranchName: branch.name,
|
||||||
|
defaultBranchChanged: false
|
||||||
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
submit = (event: Event) => {
|
submit = (event: FormEvent) => {
|
||||||
event.preventDefault();
|
event.preventDefault();
|
||||||
|
|
||||||
const { repository } = this.props;
|
const { repository } = this.props;
|
||||||
const newConfig = {
|
const newConfig = {
|
||||||
defaultBranch: this.state.selectedBranchName
|
defaultBranch: this.state.selectedBranchName
|
||||||
};
|
};
|
||||||
this.setState({ ...this.state, submitPending: true });
|
this.setState({
|
||||||
|
...this.state,
|
||||||
|
submitPending: true
|
||||||
|
});
|
||||||
|
const configurationLink = repository._links.configuration as Link;
|
||||||
apiClient
|
apiClient
|
||||||
.put(
|
.put(configurationLink.href, newConfig, GIT_CONFIG_CONTENT_TYPE)
|
||||||
repository._links.configuration.href,
|
|
||||||
newConfig,
|
|
||||||
GIT_CONFIG_CONTENT_TYPE
|
|
||||||
)
|
|
||||||
.then(() =>
|
.then(() =>
|
||||||
this.setState({
|
this.setState({
|
||||||
...this.state,
|
...this.state,
|
||||||
@@ -95,7 +120,12 @@ class RepositoryConfig extends React.Component<Props, State> {
|
|||||||
defaultBranchChanged: true
|
defaultBranchChanged: true
|
||||||
})
|
})
|
||||||
)
|
)
|
||||||
.catch(error => this.setState({ ...this.state, error }));
|
.catch(error =>
|
||||||
|
this.setState({
|
||||||
|
...this.state,
|
||||||
|
error
|
||||||
|
})
|
||||||
|
);
|
||||||
};
|
};
|
||||||
|
|
||||||
render() {
|
render() {
|
||||||
@@ -112,11 +142,13 @@ class RepositoryConfig extends React.Component<Props, State> {
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
const submitButton = disabled? null: <SubmitButton
|
const submitButton = disabled ? null : (
|
||||||
|
<SubmitButton
|
||||||
label={t("scm-git-plugin.repo-config.submit")}
|
label={t("scm-git-plugin.repo-config.submit")}
|
||||||
loading={submitPending}
|
loading={submitPending}
|
||||||
disabled={!this.state.selectedBranchName}
|
disabled={!this.state.selectedBranchName}
|
||||||
/>;
|
/>
|
||||||
|
);
|
||||||
|
|
||||||
if (!(loadingBranches || loadingDefaultBranch)) {
|
if (!(loadingBranches || loadingDefaultBranch)) {
|
||||||
return (
|
return (
|
||||||
@@ -148,7 +180,10 @@ class RepositoryConfig extends React.Component<Props, State> {
|
|||||||
<button
|
<button
|
||||||
className="delete"
|
className="delete"
|
||||||
onClick={() =>
|
onClick={() =>
|
||||||
this.setState({ ...this.state, defaultBranchChanged: false })
|
this.setState({
|
||||||
|
...this.state,
|
||||||
|
defaultBranchChanged: false
|
||||||
|
})
|
||||||
}
|
}
|
||||||
/>
|
/>
|
||||||
{this.props.t("scm-git-plugin.repo-config.success")}
|
{this.props.t("scm-git-plugin.repo-config.success")}
|
||||||
@@ -159,4 +194,4 @@ class RepositoryConfig extends React.Component<Props, State> {
|
|||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
export default translate("plugins")(RepositoryConfig);
|
export default withTranslation("plugins")(RepositoryConfig);
|
||||||
@@ -1,16 +0,0 @@
|
|||||||
// @flow
|
|
||||||
import "@scm-manager/ui-tests/i18n";
|
|
||||||
import { gitPredicate } from "./index";
|
|
||||||
|
|
||||||
describe("test git predicate", () => {
|
|
||||||
it("should return false", () => {
|
|
||||||
expect(gitPredicate()).toBe(false);
|
|
||||||
expect(gitPredicate({})).toBe(false);
|
|
||||||
expect(gitPredicate({ repository: {} })).toBe(false);
|
|
||||||
expect(gitPredicate({ repository: { type: "hg" } })).toBe(false);
|
|
||||||
});
|
|
||||||
|
|
||||||
it("should return true", () => {
|
|
||||||
expect(gitPredicate({ repository: { type: "git" } })).toBe(true);
|
|
||||||
});
|
|
||||||
});
|
|
||||||
31
scm-plugins/scm-git-plugin/src/main/js/index.test.ts
Normal file
31
scm-plugins/scm-git-plugin/src/main/js/index.test.ts
Normal file
@@ -0,0 +1,31 @@
|
|||||||
|
import "@scm-manager/ui-tests/i18n";
|
||||||
|
import { gitPredicate } from "./index";
|
||||||
|
|
||||||
|
describe("test git predicate", () => {
|
||||||
|
it("should return false", () => {
|
||||||
|
expect(gitPredicate(undefined)).toBe(false);
|
||||||
|
expect(gitPredicate({})).toBe(false);
|
||||||
|
expect(
|
||||||
|
gitPredicate({
|
||||||
|
repository: {}
|
||||||
|
})
|
||||||
|
).toBe(false);
|
||||||
|
expect(
|
||||||
|
gitPredicate({
|
||||||
|
repository: {
|
||||||
|
type: "hg"
|
||||||
|
}
|
||||||
|
})
|
||||||
|
).toBe(false);
|
||||||
|
});
|
||||||
|
|
||||||
|
it("should return true", () => {
|
||||||
|
expect(
|
||||||
|
gitPredicate({
|
||||||
|
repository: {
|
||||||
|
type: "git"
|
||||||
|
}
|
||||||
|
})
|
||||||
|
).toBe(true);
|
||||||
|
});
|
||||||
|
});
|
||||||
@@ -1,4 +1,3 @@
|
|||||||
//@flow
|
|
||||||
import React from "react";
|
import React from "react";
|
||||||
import { binder } from "@scm-manager/ui-extensions";
|
import { binder } from "@scm-manager/ui-extensions";
|
||||||
import ProtocolInformation from "./ProtocolInformation";
|
import ProtocolInformation from "./ProtocolInformation";
|
||||||
@@ -13,33 +12,16 @@ import RepositoryConfig from "./RepositoryConfig";
|
|||||||
// repository
|
// repository
|
||||||
|
|
||||||
// @visibleForTesting
|
// @visibleForTesting
|
||||||
export const gitPredicate = (props: Object) => {
|
export const gitPredicate = (props: any) => {
|
||||||
return !!(props && props.repository && props.repository.type === "git");
|
return !!(props && props.repository && props.repository.type === "git");
|
||||||
};
|
};
|
||||||
|
|
||||||
binder.bind(
|
binder.bind("repos.repository-details.information", ProtocolInformation, gitPredicate);
|
||||||
"repos.repository-details.information",
|
binder.bind("repos.branch-details.information", GitBranchInformation, gitPredicate);
|
||||||
ProtocolInformation,
|
binder.bind("repos.repository-merge.information", GitMergeInformation, gitPredicate);
|
||||||
gitPredicate
|
|
||||||
);
|
|
||||||
binder.bind(
|
|
||||||
"repos.branch-details.information",
|
|
||||||
GitBranchInformation,
|
|
||||||
gitPredicate
|
|
||||||
);
|
|
||||||
binder.bind(
|
|
||||||
"repos.repository-merge.information",
|
|
||||||
GitMergeInformation,
|
|
||||||
gitPredicate
|
|
||||||
);
|
|
||||||
binder.bind("repos.repository-avatar", GitAvatar, gitPredicate);
|
binder.bind("repos.repository-avatar", GitAvatar, gitPredicate);
|
||||||
|
|
||||||
binder.bind("repo-config.route", RepositoryConfig, gitPredicate);
|
binder.bind("repo-config.route", RepositoryConfig, gitPredicate);
|
||||||
|
|
||||||
// global config
|
// global config
|
||||||
cfgBinder.bindGlobal(
|
cfgBinder.bindGlobal("/git", "scm-git-plugin.config.link", "gitConfig", GitGlobalConfiguration);
|
||||||
"/git",
|
|
||||||
"scm-git-plugin.config.link",
|
|
||||||
"gitConfig",
|
|
||||||
GitGlobalConfiguration
|
|
||||||
);
|
|
||||||
@@ -1,20 +1,37 @@
|
|||||||
package sonia.scm.repository.spi;
|
package sonia.scm.repository.spi;
|
||||||
|
|
||||||
import org.assertj.core.api.Assertions;
|
|
||||||
import org.junit.Rule;
|
|
||||||
import org.junit.Test;
|
import org.junit.Test;
|
||||||
|
import org.junit.runner.RunWith;
|
||||||
|
import org.mockito.ArgumentCaptor;
|
||||||
|
import org.mockito.Mock;
|
||||||
|
import org.mockito.invocation.InvocationOnMock;
|
||||||
|
import org.mockito.junit.MockitoJUnitRunner;
|
||||||
|
import sonia.scm.event.ScmEventBus;
|
||||||
import sonia.scm.repository.Branch;
|
import sonia.scm.repository.Branch;
|
||||||
|
import sonia.scm.repository.PostReceiveRepositoryHookEvent;
|
||||||
|
import sonia.scm.repository.PreReceiveRepositoryHookEvent;
|
||||||
import sonia.scm.repository.api.BranchRequest;
|
import sonia.scm.repository.api.BranchRequest;
|
||||||
import sonia.scm.repository.util.WorkdirProvider;
|
import sonia.scm.repository.api.HookContext;
|
||||||
|
import sonia.scm.repository.api.HookContextFactory;
|
||||||
|
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
|
import static org.assertj.core.api.Assertions.assertThat;
|
||||||
|
import static org.junit.jupiter.api.Assertions.assertThrows;
|
||||||
|
import static org.mockito.ArgumentMatchers.any;
|
||||||
|
import static org.mockito.Mockito.doNothing;
|
||||||
|
import static org.mockito.Mockito.mock;
|
||||||
|
import static org.mockito.Mockito.when;
|
||||||
|
|
||||||
|
|
||||||
|
@RunWith(MockitoJUnitRunner.class)
|
||||||
public class GitBranchCommandTest extends AbstractGitCommandTestBase {
|
public class GitBranchCommandTest extends AbstractGitCommandTestBase {
|
||||||
|
|
||||||
@Rule
|
@Mock
|
||||||
public BindTransportProtocolRule transportProtocolRule = new BindTransportProtocolRule();
|
private HookContextFactory hookContextFactory;
|
||||||
|
@Mock
|
||||||
|
private ScmEventBus eventBus;
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void shouldCreateBranchWithDefinedSourceBranch() throws IOException {
|
public void shouldCreateBranchWithDefinedSourceBranch() throws IOException {
|
||||||
@@ -26,10 +43,10 @@ public class GitBranchCommandTest extends AbstractGitCommandTestBase {
|
|||||||
branchRequest.setParentBranch(source.getName());
|
branchRequest.setParentBranch(source.getName());
|
||||||
branchRequest.setNewBranch("new_branch");
|
branchRequest.setNewBranch("new_branch");
|
||||||
|
|
||||||
new GitBranchCommand(context, repository, new SimpleGitWorkdirFactory(new WorkdirProvider())).branch(branchRequest);
|
createCommand().branch(branchRequest);
|
||||||
|
|
||||||
Branch newBranch = findBranch(context, "new_branch");
|
Branch newBranch = findBranch(context, "new_branch");
|
||||||
Assertions.assertThat(newBranch.getRevision()).isEqualTo(source.getRevision());
|
assertThat(newBranch.getRevision()).isEqualTo(source.getRevision());
|
||||||
}
|
}
|
||||||
|
|
||||||
private Branch findBranch(GitContext context, String name) throws IOException {
|
private Branch findBranch(GitContext context, String name) throws IOException {
|
||||||
@@ -41,17 +58,79 @@ public class GitBranchCommandTest extends AbstractGitCommandTestBase {
|
|||||||
public void shouldCreateBranch() throws IOException {
|
public void shouldCreateBranch() throws IOException {
|
||||||
GitContext context = createContext();
|
GitContext context = createContext();
|
||||||
|
|
||||||
Assertions.assertThat(readBranches(context)).filteredOn(b -> b.getName().equals("new_branch")).isEmpty();
|
assertThat(readBranches(context)).filteredOn(b -> b.getName().equals("new_branch")).isEmpty();
|
||||||
|
|
||||||
BranchRequest branchRequest = new BranchRequest();
|
BranchRequest branchRequest = new BranchRequest();
|
||||||
branchRequest.setNewBranch("new_branch");
|
branchRequest.setNewBranch("new_branch");
|
||||||
|
|
||||||
new GitBranchCommand(context, repository, new SimpleGitWorkdirFactory(new WorkdirProvider())).branch(branchRequest);
|
createCommand().branch(branchRequest);
|
||||||
|
|
||||||
Assertions.assertThat(readBranches(context)).filteredOn(b -> b.getName().equals("new_branch")).isNotEmpty();
|
assertThat(readBranches(context)).filteredOn(b -> b.getName().equals("new_branch")).isNotEmpty();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
public void shouldDeleteBranch() throws IOException {
|
||||||
|
GitContext context = createContext();
|
||||||
|
String branchToBeDeleted = "squash";
|
||||||
|
createCommand().deleteOrClose(branchToBeDeleted);
|
||||||
|
assertThat(readBranches(context)).filteredOn(b -> b.getName().equals(branchToBeDeleted)).isEmpty();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
public void shouldThrowExceptionWhenDeletingDefaultBranch() {
|
||||||
|
String branchToBeDeleted = "master";
|
||||||
|
assertThrows(CannotDeleteDefaultBranchException.class, () -> createCommand().deleteOrClose(branchToBeDeleted));
|
||||||
|
}
|
||||||
|
|
||||||
|
private GitBranchCommand createCommand() {
|
||||||
|
return new GitBranchCommand(createContext(), repository, hookContextFactory, eventBus);
|
||||||
}
|
}
|
||||||
|
|
||||||
private List<Branch> readBranches(GitContext context) throws IOException {
|
private List<Branch> readBranches(GitContext context) throws IOException {
|
||||||
return new GitBranchesCommand(context, repository).getBranches();
|
return new GitBranchesCommand(context, repository).getBranches();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
public void shouldPostCreateEvents() {
|
||||||
|
ArgumentCaptor<Object> captor = ArgumentCaptor.forClass(Object.class);
|
||||||
|
doNothing().when(eventBus).post(captor.capture());
|
||||||
|
when(hookContextFactory.createContext(any(), any())).thenAnswer(this::createMockedContext);
|
||||||
|
|
||||||
|
BranchRequest branchRequest = new BranchRequest();
|
||||||
|
branchRequest.setParentBranch("mergeable");
|
||||||
|
branchRequest.setNewBranch("new_branch");
|
||||||
|
|
||||||
|
createCommand().branch(branchRequest);
|
||||||
|
|
||||||
|
List<Object> events = captor.getAllValues();
|
||||||
|
assertThat(events.get(0)).isInstanceOf(PreReceiveRepositoryHookEvent.class);
|
||||||
|
assertThat(events.get(1)).isInstanceOf(PostReceiveRepositoryHookEvent.class);
|
||||||
|
|
||||||
|
PreReceiveRepositoryHookEvent event = (PreReceiveRepositoryHookEvent) events.get(0);
|
||||||
|
assertThat(event.getContext().getBranchProvider().getCreatedOrModified()).containsExactly("new_branch");
|
||||||
|
assertThat(event.getContext().getBranchProvider().getDeletedOrClosed()).isEmpty();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
public void shouldPostDeleteEvents() {
|
||||||
|
ArgumentCaptor<Object> captor = ArgumentCaptor.forClass(Object.class);
|
||||||
|
doNothing().when(eventBus).post(captor.capture());
|
||||||
|
when(hookContextFactory.createContext(any(), any())).thenAnswer(this::createMockedContext);
|
||||||
|
|
||||||
|
createCommand().deleteOrClose("squash");
|
||||||
|
|
||||||
|
List<Object> events = captor.getAllValues();
|
||||||
|
assertThat(events.get(0)).isInstanceOf(PreReceiveRepositoryHookEvent.class);
|
||||||
|
assertThat(events.get(1)).isInstanceOf(PostReceiveRepositoryHookEvent.class);
|
||||||
|
|
||||||
|
PreReceiveRepositoryHookEvent event = (PreReceiveRepositoryHookEvent) events.get(0);
|
||||||
|
assertThat(event.getContext().getBranchProvider().getDeletedOrClosed()).containsExactly("squash");
|
||||||
|
assertThat(event.getContext().getBranchProvider().getCreatedOrModified()).isEmpty();
|
||||||
|
}
|
||||||
|
|
||||||
|
private HookContext createMockedContext(InvocationOnMock invocation) {
|
||||||
|
HookContext mock = mock(HookContext.class);
|
||||||
|
when(mock.getBranchProvider()).thenReturn(((HookContextProvider) invocation.getArgument(0)).getBranchProvider());
|
||||||
|
return mock;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -35,7 +35,11 @@
|
|||||||
package sonia.scm.repository.spi;
|
package sonia.scm.repository.spi;
|
||||||
|
|
||||||
import com.google.common.io.Files;
|
import com.google.common.io.Files;
|
||||||
|
import org.assertj.core.api.Assertions;
|
||||||
import org.junit.Test;
|
import org.junit.Test;
|
||||||
|
import org.junit.runner.RunWith;
|
||||||
|
import org.mockito.Mock;
|
||||||
|
import org.mockito.junit.MockitoJUnitRunner;
|
||||||
import sonia.scm.repository.Changeset;
|
import sonia.scm.repository.Changeset;
|
||||||
import sonia.scm.repository.ChangesetPagingResult;
|
import sonia.scm.repository.ChangesetPagingResult;
|
||||||
import sonia.scm.repository.GitRepositoryConfig;
|
import sonia.scm.repository.GitRepositoryConfig;
|
||||||
@@ -51,14 +55,18 @@ import static org.junit.Assert.assertFalse;
|
|||||||
import static org.junit.Assert.assertNotNull;
|
import static org.junit.Assert.assertNotNull;
|
||||||
import static org.junit.Assert.assertThat;
|
import static org.junit.Assert.assertThat;
|
||||||
import static org.junit.Assert.assertTrue;
|
import static org.junit.Assert.assertTrue;
|
||||||
|
import static org.mockito.Mockito.when;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Unit tests for {@link GitLogCommand}.
|
* Unit tests for {@link GitLogCommand}.
|
||||||
*
|
*
|
||||||
* @author Sebastian Sdorra
|
* @author Sebastian Sdorra
|
||||||
*/
|
*/
|
||||||
|
@RunWith(MockitoJUnitRunner.class)
|
||||||
public class GitLogCommandTest extends AbstractGitCommandTestBase
|
public class GitLogCommandTest extends AbstractGitCommandTestBase
|
||||||
{
|
{
|
||||||
|
@Mock
|
||||||
|
LogCommandRequest request;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Tests log command with the usage of a default branch.
|
* Tests log command with the usage of a default branch.
|
||||||
@@ -171,7 +179,7 @@ public class GitLogCommandTest extends AbstractGitCommandTestBase
|
|||||||
public void testGetCommit()
|
public void testGetCommit()
|
||||||
{
|
{
|
||||||
GitLogCommand command = createCommand();
|
GitLogCommand command = createCommand();
|
||||||
Changeset c = command.getChangeset("435df2f061add3589cb3");
|
Changeset c = command.getChangeset("435df2f061add3589cb3", null);
|
||||||
|
|
||||||
assertNotNull(c);
|
assertNotNull(c);
|
||||||
String revision = "435df2f061add3589cb326cc64be9b9c3897ceca";
|
String revision = "435df2f061add3589cb326cc64be9b9c3897ceca";
|
||||||
@@ -193,6 +201,23 @@ public class GitLogCommandTest extends AbstractGitCommandTestBase
|
|||||||
assertThat(modifications.getAdded(), contains("a.txt", "b.txt"));
|
assertThat(modifications.getAdded(), contains("a.txt", "b.txt"));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
public void commitShouldContainBranchIfLogCommandRequestHasBranch()
|
||||||
|
{
|
||||||
|
when(request.getBranch()).thenReturn("master");
|
||||||
|
GitLogCommand command = createCommand();
|
||||||
|
Changeset c = command.getChangeset("435df2f061add3589cb3", request);
|
||||||
|
|
||||||
|
Assertions.assertThat(c.getBranches()).containsOnly("master");
|
||||||
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
public void shouldNotReturnCommitFromDifferentBranch() {
|
||||||
|
when(request.getBranch()).thenReturn("master");
|
||||||
|
Changeset changeset = createCommand().getChangeset("3f76a12f08a6ba0dc988c68b7f0b2cd190efc3c4", request);
|
||||||
|
Assertions.assertThat(changeset).isNull();
|
||||||
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void testGetRange()
|
public void testGetRange()
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -15,10 +15,12 @@ import org.junit.Test;
|
|||||||
import sonia.scm.NotFoundException;
|
import sonia.scm.NotFoundException;
|
||||||
import sonia.scm.repository.Person;
|
import sonia.scm.repository.Person;
|
||||||
import sonia.scm.repository.api.MergeCommandResult;
|
import sonia.scm.repository.api.MergeCommandResult;
|
||||||
|
import sonia.scm.repository.api.MergeStrategy;
|
||||||
import sonia.scm.repository.util.WorkdirProvider;
|
import sonia.scm.repository.util.WorkdirProvider;
|
||||||
import sonia.scm.user.User;
|
import sonia.scm.user.User;
|
||||||
|
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
import static org.assertj.core.api.Assertions.assertThat;
|
import static org.assertj.core.api.Assertions.assertThat;
|
||||||
|
|
||||||
@@ -62,6 +64,7 @@ public class GitMergeCommandTest extends AbstractGitCommandTestBase {
|
|||||||
MergeCommandRequest request = new MergeCommandRequest();
|
MergeCommandRequest request = new MergeCommandRequest();
|
||||||
request.setTargetBranch("master");
|
request.setTargetBranch("master");
|
||||||
request.setBranchToMerge("mergeable");
|
request.setBranchToMerge("mergeable");
|
||||||
|
request.setMergeStrategy(MergeStrategy.MERGE_COMMIT);
|
||||||
request.setAuthor(new Person("Dirk Gently", "dirk@holistic.det"));
|
request.setAuthor(new Person("Dirk Gently", "dirk@holistic.det"));
|
||||||
|
|
||||||
MergeCommandResult mergeCommandResult = command.merge(request);
|
MergeCommandResult mergeCommandResult = command.merge(request);
|
||||||
@@ -88,6 +91,7 @@ public class GitMergeCommandTest extends AbstractGitCommandTestBase {
|
|||||||
MergeCommandRequest request = new MergeCommandRequest();
|
MergeCommandRequest request = new MergeCommandRequest();
|
||||||
request.setTargetBranch("master");
|
request.setTargetBranch("master");
|
||||||
request.setBranchToMerge("empty_merge");
|
request.setBranchToMerge("empty_merge");
|
||||||
|
request.setMergeStrategy(MergeStrategy.MERGE_COMMIT);
|
||||||
request.setAuthor(new Person("Dirk Gently", "dirk@holistic.det"));
|
request.setAuthor(new Person("Dirk Gently", "dirk@holistic.det"));
|
||||||
|
|
||||||
MergeCommandResult mergeCommandResult = command.merge(request);
|
MergeCommandResult mergeCommandResult = command.merge(request);
|
||||||
@@ -109,6 +113,7 @@ public class GitMergeCommandTest extends AbstractGitCommandTestBase {
|
|||||||
request.setTargetBranch("master");
|
request.setTargetBranch("master");
|
||||||
request.setBranchToMerge("mergeable");
|
request.setBranchToMerge("mergeable");
|
||||||
request.setAuthor(new Person("Dirk Gently", "dirk@holistic.det"));
|
request.setAuthor(new Person("Dirk Gently", "dirk@holistic.det"));
|
||||||
|
request.setMergeStrategy(MergeStrategy.MERGE_COMMIT);
|
||||||
|
|
||||||
MergeCommandResult mergeCommandResult = command.merge(request);
|
MergeCommandResult mergeCommandResult = command.merge(request);
|
||||||
|
|
||||||
@@ -132,6 +137,7 @@ public class GitMergeCommandTest extends AbstractGitCommandTestBase {
|
|||||||
MergeCommandRequest request = new MergeCommandRequest();
|
MergeCommandRequest request = new MergeCommandRequest();
|
||||||
request.setTargetBranch("master");
|
request.setTargetBranch("master");
|
||||||
request.setBranchToMerge("mergeable");
|
request.setBranchToMerge("mergeable");
|
||||||
|
request.setMergeStrategy(MergeStrategy.MERGE_COMMIT);
|
||||||
request.setAuthor(new Person("Dirk Gently", "dirk@holistic.det"));
|
request.setAuthor(new Person("Dirk Gently", "dirk@holistic.det"));
|
||||||
request.setMessageTemplate("simple");
|
request.setMessageTemplate("simple");
|
||||||
|
|
||||||
@@ -152,6 +158,7 @@ public class GitMergeCommandTest extends AbstractGitCommandTestBase {
|
|||||||
MergeCommandRequest request = new MergeCommandRequest();
|
MergeCommandRequest request = new MergeCommandRequest();
|
||||||
request.setBranchToMerge("test-branch");
|
request.setBranchToMerge("test-branch");
|
||||||
request.setTargetBranch("master");
|
request.setTargetBranch("master");
|
||||||
|
request.setMergeStrategy(MergeStrategy.MERGE_COMMIT);
|
||||||
|
|
||||||
MergeCommandResult mergeCommandResult = command.merge(request);
|
MergeCommandResult mergeCommandResult = command.merge(request);
|
||||||
|
|
||||||
@@ -173,6 +180,7 @@ public class GitMergeCommandTest extends AbstractGitCommandTestBase {
|
|||||||
MergeCommandRequest request = new MergeCommandRequest();
|
MergeCommandRequest request = new MergeCommandRequest();
|
||||||
request.setTargetBranch("master");
|
request.setTargetBranch("master");
|
||||||
request.setBranchToMerge("mergeable");
|
request.setBranchToMerge("mergeable");
|
||||||
|
request.setMergeStrategy(MergeStrategy.MERGE_COMMIT);
|
||||||
|
|
||||||
MergeCommandResult mergeCommandResult = command.merge(request);
|
MergeCommandResult mergeCommandResult = command.merge(request);
|
||||||
|
|
||||||
@@ -192,6 +200,7 @@ public class GitMergeCommandTest extends AbstractGitCommandTestBase {
|
|||||||
request.setAuthor(new Person("Dirk Gently", "dirk@holistic.det"));
|
request.setAuthor(new Person("Dirk Gently", "dirk@holistic.det"));
|
||||||
request.setTargetBranch("mergeable");
|
request.setTargetBranch("mergeable");
|
||||||
request.setBranchToMerge("master");
|
request.setBranchToMerge("master");
|
||||||
|
request.setMergeStrategy(MergeStrategy.MERGE_COMMIT);
|
||||||
|
|
||||||
MergeCommandResult mergeCommandResult = command.merge(request);
|
MergeCommandResult mergeCommandResult = command.merge(request);
|
||||||
|
|
||||||
@@ -211,12 +220,112 @@ public class GitMergeCommandTest extends AbstractGitCommandTestBase {
|
|||||||
assertThat(new String(contentOfFileB)).isEqualTo("b\ncontent from branch\n");
|
assertThat(new String(contentOfFileB)).isEqualTo("b\ncontent from branch\n");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
public void shouldSquashCommitsIfSquashIsEnabled() throws IOException, GitAPIException {
|
||||||
|
GitMergeCommand command = createCommand();
|
||||||
|
MergeCommandRequest request = new MergeCommandRequest();
|
||||||
|
request.setAuthor(new Person("Dirk Gently", "dirk@holistic.det"));
|
||||||
|
request.setBranchToMerge("squash");
|
||||||
|
request.setTargetBranch("master");
|
||||||
|
request.setMessageTemplate("this is a squash");
|
||||||
|
request.setMergeStrategy(MergeStrategy.SQUASH);
|
||||||
|
|
||||||
|
MergeCommandResult mergeCommandResult = command.merge(request);
|
||||||
|
|
||||||
|
Repository repository = createContext().open();
|
||||||
|
assertThat(mergeCommandResult.isSuccess()).isTrue();
|
||||||
|
|
||||||
|
Iterable<RevCommit> commits = new Git(repository).log().add(repository.resolve("master")).setMaxCount(1).call();
|
||||||
|
RevCommit mergeCommit = commits.iterator().next();
|
||||||
|
PersonIdent mergeAuthor = mergeCommit.getAuthorIdent();
|
||||||
|
String message = mergeCommit.getFullMessage();
|
||||||
|
assertThat(mergeAuthor.getName()).isEqualTo("Dirk Gently");
|
||||||
|
assertThat(message).isEqualTo("this is a squash");
|
||||||
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
public void shouldSquashThreeCommitsIntoOne() throws IOException, GitAPIException {
|
||||||
|
GitMergeCommand command = createCommand();
|
||||||
|
MergeCommandRequest request = new MergeCommandRequest();
|
||||||
|
request.setAuthor(new Person("Dirk Gently", "dirk@holistic.det"));
|
||||||
|
request.setBranchToMerge("squash");
|
||||||
|
request.setTargetBranch("master");
|
||||||
|
request.setMessageTemplate("squash three commits");
|
||||||
|
request.setMergeStrategy(MergeStrategy.SQUASH);
|
||||||
|
Repository gitRepository = createContext().open();
|
||||||
|
MergeCommandResult mergeCommandResult = command.merge(request);
|
||||||
|
|
||||||
|
assertThat(mergeCommandResult.isSuccess()).isTrue();
|
||||||
|
|
||||||
|
Iterable<RevCommit> commits = new Git(gitRepository).log().add(gitRepository.resolve("master")).setMaxCount(1).call();
|
||||||
|
RevCommit mergeCommit = commits.iterator().next();
|
||||||
|
PersonIdent mergeAuthor = mergeCommit.getAuthorIdent();
|
||||||
|
String message = mergeCommit.getFullMessage();
|
||||||
|
assertThat(mergeAuthor.getName()).isEqualTo("Dirk Gently");
|
||||||
|
assertThat(message).isEqualTo("squash three commits");
|
||||||
|
|
||||||
|
GitModificationsCommand modificationsCommand = new GitModificationsCommand(createContext(), repository);
|
||||||
|
List<String> changes = modificationsCommand.getModifications("master").getAdded();
|
||||||
|
assertThat(changes.size()).isEqualTo(3);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@Test
|
||||||
|
public void shouldMergeWithFastForward() throws IOException, GitAPIException {
|
||||||
|
Repository repository = createContext().open();
|
||||||
|
|
||||||
|
ObjectId featureBranchHead = new Git(repository).log().add(repository.resolve("squash")).setMaxCount(1).call().iterator().next().getId();
|
||||||
|
|
||||||
|
GitMergeCommand command = createCommand();
|
||||||
|
MergeCommandRequest request = new MergeCommandRequest();
|
||||||
|
request.setBranchToMerge("squash");
|
||||||
|
request.setTargetBranch("master");
|
||||||
|
request.setMergeStrategy(MergeStrategy.FAST_FORWARD_IF_POSSIBLE);
|
||||||
|
request.setAuthor(new Person("Dirk Gently", "dirk@holistic.det"));
|
||||||
|
|
||||||
|
MergeCommandResult mergeCommandResult = command.merge(request);
|
||||||
|
|
||||||
|
assertThat(mergeCommandResult.isSuccess()).isTrue();
|
||||||
|
|
||||||
|
Iterable<RevCommit> commits = new Git(repository).log().add(repository.resolve("master")).setMaxCount(1).call();
|
||||||
|
RevCommit mergeCommit = commits.iterator().next();
|
||||||
|
assertThat(mergeCommit.getParentCount()).isEqualTo(1);
|
||||||
|
PersonIdent mergeAuthor = mergeCommit.getAuthorIdent();
|
||||||
|
assertThat(mergeAuthor.getName()).isEqualTo("Philip J Fry");
|
||||||
|
assertThat(mergeCommit.getId()).isEqualTo(featureBranchHead);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
public void shouldDoMergeCommitIfFastForwardIsNotPossible() throws IOException, GitAPIException {
|
||||||
|
GitMergeCommand command = createCommand();
|
||||||
|
MergeCommandRequest request = new MergeCommandRequest();
|
||||||
|
request.setTargetBranch("master");
|
||||||
|
request.setBranchToMerge("mergeable");
|
||||||
|
request.setMergeStrategy(MergeStrategy.FAST_FORWARD_IF_POSSIBLE);
|
||||||
|
request.setAuthor(new Person("Dirk Gently", "dirk@holistic.det"));
|
||||||
|
|
||||||
|
MergeCommandResult mergeCommandResult = command.merge(request);
|
||||||
|
|
||||||
|
assertThat(mergeCommandResult.isSuccess()).isTrue();
|
||||||
|
|
||||||
|
Repository repository = createContext().open();
|
||||||
|
Iterable<RevCommit> commits = new Git(repository).log().add(repository.resolve("master")).setMaxCount(1).call();
|
||||||
|
RevCommit mergeCommit = commits.iterator().next();
|
||||||
|
PersonIdent mergeAuthor = mergeCommit.getAuthorIdent();
|
||||||
|
assertThat(mergeCommit.getParentCount()).isEqualTo(2);
|
||||||
|
String message = mergeCommit.getFullMessage();
|
||||||
|
assertThat(mergeAuthor.getName()).isEqualTo("Dirk Gently");
|
||||||
|
assertThat(mergeAuthor.getEmailAddress()).isEqualTo("dirk@holistic.det");
|
||||||
|
assertThat(message).contains("master", "mergeable");
|
||||||
|
}
|
||||||
|
|
||||||
@Test(expected = NotFoundException.class)
|
@Test(expected = NotFoundException.class)
|
||||||
public void shouldHandleNotExistingSourceBranchInMerge() {
|
public void shouldHandleNotExistingSourceBranchInMerge() {
|
||||||
GitMergeCommand command = createCommand();
|
GitMergeCommand command = createCommand();
|
||||||
MergeCommandRequest request = new MergeCommandRequest();
|
MergeCommandRequest request = new MergeCommandRequest();
|
||||||
request.setTargetBranch("mergeable");
|
request.setTargetBranch("mergeable");
|
||||||
request.setBranchToMerge("not_existing");
|
request.setBranchToMerge("not_existing");
|
||||||
|
request.setMergeStrategy(MergeStrategy.MERGE_COMMIT);
|
||||||
|
|
||||||
command.merge(request);
|
command.merge(request);
|
||||||
}
|
}
|
||||||
@@ -225,6 +334,7 @@ public class GitMergeCommandTest extends AbstractGitCommandTestBase {
|
|||||||
public void shouldHandleNotExistingTargetBranchInMerge() {
|
public void shouldHandleNotExistingTargetBranchInMerge() {
|
||||||
GitMergeCommand command = createCommand();
|
GitMergeCommand command = createCommand();
|
||||||
MergeCommandRequest request = new MergeCommandRequest();
|
MergeCommandRequest request = new MergeCommandRequest();
|
||||||
|
request.setMergeStrategy(MergeStrategy.MERGE_COMMIT);
|
||||||
request.setTargetBranch("not_existing");
|
request.setTargetBranch("not_existing");
|
||||||
request.setBranchToMerge("master");
|
request.setBranchToMerge("master");
|
||||||
|
|
||||||
|
|||||||
@@ -45,7 +45,7 @@ public class SimpleGitWorkdirFactoryTest extends AbstractGitCommandTestBase {
|
|||||||
SimpleGitWorkdirFactory factory = new SimpleGitWorkdirFactory(workdirProvider);
|
SimpleGitWorkdirFactory factory = new SimpleGitWorkdirFactory(workdirProvider);
|
||||||
File masterRepo = createRepositoryDirectory();
|
File masterRepo = createRepositoryDirectory();
|
||||||
|
|
||||||
try (WorkingCopy<Repository> workingCopy = factory.createWorkingCopy(createContext(), null)) {
|
try (WorkingCopy<Repository, Repository> workingCopy = factory.createWorkingCopy(createContext(), null)) {
|
||||||
|
|
||||||
assertThat(workingCopy.getDirectory())
|
assertThat(workingCopy.getDirectory())
|
||||||
.exists()
|
.exists()
|
||||||
@@ -62,7 +62,7 @@ public class SimpleGitWorkdirFactoryTest extends AbstractGitCommandTestBase {
|
|||||||
public void shouldCheckoutInitialBranch() {
|
public void shouldCheckoutInitialBranch() {
|
||||||
SimpleGitWorkdirFactory factory = new SimpleGitWorkdirFactory(workdirProvider);
|
SimpleGitWorkdirFactory factory = new SimpleGitWorkdirFactory(workdirProvider);
|
||||||
|
|
||||||
try (WorkingCopy<Repository> workingCopy = factory.createWorkingCopy(createContext(), "test-branch")) {
|
try (WorkingCopy<Repository, Repository> workingCopy = factory.createWorkingCopy(createContext(), "test-branch")) {
|
||||||
assertThat(new File(workingCopy.getWorkingRepository().getWorkTree(), "a.txt"))
|
assertThat(new File(workingCopy.getWorkingRepository().getWorkTree(), "a.txt"))
|
||||||
.exists()
|
.exists()
|
||||||
.isFile()
|
.isFile()
|
||||||
@@ -75,10 +75,10 @@ public class SimpleGitWorkdirFactoryTest extends AbstractGitCommandTestBase {
|
|||||||
SimpleGitWorkdirFactory factory = new SimpleGitWorkdirFactory(workdirProvider);
|
SimpleGitWorkdirFactory factory = new SimpleGitWorkdirFactory(workdirProvider);
|
||||||
|
|
||||||
File firstDirectory;
|
File firstDirectory;
|
||||||
try (WorkingCopy<Repository> workingCopy = factory.createWorkingCopy(createContext(), null)) {
|
try (WorkingCopy<Repository, Repository> workingCopy = factory.createWorkingCopy(createContext(), null)) {
|
||||||
firstDirectory = workingCopy.getDirectory();
|
firstDirectory = workingCopy.getDirectory();
|
||||||
}
|
}
|
||||||
try (WorkingCopy<Repository> workingCopy = factory.createWorkingCopy(createContext(), null)) {
|
try (WorkingCopy<Repository, Repository> workingCopy = factory.createWorkingCopy(createContext(), null)) {
|
||||||
File secondDirectory = workingCopy.getDirectory();
|
File secondDirectory = workingCopy.getDirectory();
|
||||||
assertThat(secondDirectory).isNotEqualTo(firstDirectory);
|
assertThat(secondDirectory).isNotEqualTo(firstDirectory);
|
||||||
}
|
}
|
||||||
@@ -89,7 +89,7 @@ public class SimpleGitWorkdirFactoryTest extends AbstractGitCommandTestBase {
|
|||||||
SimpleGitWorkdirFactory factory = new SimpleGitWorkdirFactory(workdirProvider);
|
SimpleGitWorkdirFactory factory = new SimpleGitWorkdirFactory(workdirProvider);
|
||||||
|
|
||||||
File directory;
|
File directory;
|
||||||
try (WorkingCopy<Repository> workingCopy = factory.createWorkingCopy(createContext(), null)) {
|
try (WorkingCopy<Repository, Repository> workingCopy = factory.createWorkingCopy(createContext(), null)) {
|
||||||
directory = workingCopy.getWorkingRepository().getWorkTree();
|
directory = workingCopy.getWorkingRepository().getWorkTree();
|
||||||
}
|
}
|
||||||
assertThat(directory).doesNotExist();
|
assertThat(directory).doesNotExist();
|
||||||
|
|||||||
@@ -0,0 +1,92 @@
|
|||||||
|
package sonia.scm.web.lfs;
|
||||||
|
|
||||||
|
import org.junit.jupiter.api.BeforeEach;
|
||||||
|
import org.junit.jupiter.api.Test;
|
||||||
|
import org.junit.jupiter.api.extension.ExtendWith;
|
||||||
|
import org.mockito.InjectMocks;
|
||||||
|
import org.mockito.Mock;
|
||||||
|
import org.mockito.junit.jupiter.MockitoExtension;
|
||||||
|
import sonia.scm.config.ScmConfiguration;
|
||||||
|
import sonia.scm.protocolcommand.CommandContext;
|
||||||
|
import sonia.scm.protocolcommand.CommandInterpreter;
|
||||||
|
import sonia.scm.protocolcommand.RepositoryContext;
|
||||||
|
import sonia.scm.protocolcommand.git.GitRepositoryContextResolver;
|
||||||
|
import sonia.scm.repository.Repository;
|
||||||
|
import sonia.scm.security.AccessToken;
|
||||||
|
|
||||||
|
import java.io.ByteArrayOutputStream;
|
||||||
|
import java.io.IOException;
|
||||||
|
import java.util.Date;
|
||||||
|
import java.util.Optional;
|
||||||
|
|
||||||
|
import static java.time.Instant.parse;
|
||||||
|
import static java.util.Date.from;
|
||||||
|
import static org.assertj.core.api.Assertions.assertThat;
|
||||||
|
import static org.mockito.Mockito.lenient;
|
||||||
|
import static org.mockito.Mockito.mock;
|
||||||
|
|
||||||
|
@ExtendWith(MockitoExtension.class)
|
||||||
|
class LFSAuthCommandTest {
|
||||||
|
|
||||||
|
static final Repository REPOSITORY = new Repository("1", "git", "space", "X");
|
||||||
|
static final Date EXPIRATION = from(parse("2007-05-03T10:15:30.00Z"));
|
||||||
|
|
||||||
|
@Mock
|
||||||
|
LfsAccessTokenFactory tokenFactory;
|
||||||
|
@Mock
|
||||||
|
GitRepositoryContextResolver gitRepositoryContextResolver;
|
||||||
|
@Mock
|
||||||
|
ScmConfiguration configuration;
|
||||||
|
|
||||||
|
@InjectMocks
|
||||||
|
LFSAuthCommand lfsAuthCommand;
|
||||||
|
|
||||||
|
@BeforeEach
|
||||||
|
void initAuthorizationToken() {
|
||||||
|
AccessToken accessToken = mock(AccessToken.class);
|
||||||
|
lenient().when(this.tokenFactory.createReadAccessToken(REPOSITORY)).thenReturn(accessToken);
|
||||||
|
lenient().when(this.tokenFactory.createWriteAccessToken(REPOSITORY)).thenReturn(accessToken);
|
||||||
|
lenient().when(accessToken.getExpiration()).thenReturn(EXPIRATION);
|
||||||
|
lenient().when(accessToken.compact()).thenReturn("ACCESS_TOKEN");
|
||||||
|
}
|
||||||
|
|
||||||
|
@BeforeEach
|
||||||
|
void initConfig() {
|
||||||
|
lenient().when(configuration.getBaseUrl()).thenReturn("http://example.com");
|
||||||
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
void shouldHandleGitLfsAuthenticate() {
|
||||||
|
Optional<CommandInterpreter> commandInterpreter = lfsAuthCommand.canHandle("git-lfs-authenticate repo/space/X upload");
|
||||||
|
assertThat(commandInterpreter).isPresent();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
void shouldNotHandleOtherCommands() {
|
||||||
|
Optional<CommandInterpreter> commandInterpreter = lfsAuthCommand.canHandle("git-lfs-something repo/space/X upload");
|
||||||
|
assertThat(commandInterpreter).isEmpty();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
void shouldExtractRepositoryArgument() {
|
||||||
|
CommandInterpreter commandInterpreter = lfsAuthCommand.canHandle("git-lfs-authenticate repo/space/X\t upload").get();
|
||||||
|
assertThat(commandInterpreter.getParsedArgs()).containsOnly("repo/space/X");
|
||||||
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
void shouldCreateJsonResponse() throws IOException {
|
||||||
|
CommandInterpreter commandInterpreter = lfsAuthCommand.canHandle("git-lfs-authenticate repo/space/X\t upload").get();
|
||||||
|
CommandContext commandContext = createCommandContext();
|
||||||
|
commandInterpreter.getProtocolHandler().handle(commandContext, createRepositoryContext());
|
||||||
|
assertThat(commandContext.getOutputStream().toString())
|
||||||
|
.isEqualTo("{\"href\":\"http://example.com/repo/space/X.git/info/lfs/\",\"header\":{\"Authorization\":\"Bearer ACCESS_TOKEN\"},\"expires_at\":\"2007-05-03T10:15:30Z\"}");
|
||||||
|
}
|
||||||
|
|
||||||
|
private CommandContext createCommandContext() {
|
||||||
|
return new CommandContext(null, null, null, new ByteArrayOutputStream(), null);
|
||||||
|
}
|
||||||
|
|
||||||
|
private RepositoryContext createRepositoryContext() {
|
||||||
|
return new RepositoryContext(REPOSITORY, null);
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,98 @@
|
|||||||
|
package sonia.scm.web.lfs;
|
||||||
|
|
||||||
|
import org.eclipse.jgit.lfs.lib.LongObjectId;
|
||||||
|
import org.junit.jupiter.api.BeforeEach;
|
||||||
|
import org.junit.jupiter.api.Test;
|
||||||
|
import org.junit.jupiter.api.extension.ExtendWith;
|
||||||
|
import org.mockito.Mock;
|
||||||
|
import org.mockito.junit.jupiter.MockitoExtension;
|
||||||
|
import sonia.scm.repository.Repository;
|
||||||
|
import sonia.scm.security.AccessToken;
|
||||||
|
import sonia.scm.store.BlobStore;
|
||||||
|
|
||||||
|
import java.util.Date;
|
||||||
|
|
||||||
|
import static java.time.Instant.parse;
|
||||||
|
import static java.util.Date.from;
|
||||||
|
import static org.assertj.core.api.Assertions.assertThat;
|
||||||
|
import static org.eclipse.jgit.lfs.lib.LongObjectId.fromString;
|
||||||
|
import static org.mockito.Mockito.lenient;
|
||||||
|
import static org.mockito.Mockito.mock;
|
||||||
|
import static org.mockito.Mockito.times;
|
||||||
|
import static org.mockito.Mockito.verify;
|
||||||
|
|
||||||
|
@ExtendWith(MockitoExtension.class)
|
||||||
|
class ScmBlobLfsRepositoryTest {
|
||||||
|
|
||||||
|
static final Repository REPOSITORY = new Repository("1", "git", "space", "X");
|
||||||
|
static final Date EXPIRATION = from(parse("2007-05-03T10:15:30.00Z"));
|
||||||
|
static final LongObjectId OBJECT_ID = fromString("976ed944c37cc5d1606af316937edb9d286ecf6c606af316937edb9d286ecf6c");
|
||||||
|
|
||||||
|
@Mock
|
||||||
|
BlobStore blobStore;
|
||||||
|
@Mock
|
||||||
|
LfsAccessTokenFactory tokenFactory;
|
||||||
|
|
||||||
|
ScmBlobLfsRepository lfsRepository;
|
||||||
|
|
||||||
|
@BeforeEach
|
||||||
|
void initializeLfsRepository() {
|
||||||
|
lfsRepository = new ScmBlobLfsRepository(REPOSITORY, blobStore, tokenFactory, "http://scm.org/");
|
||||||
|
}
|
||||||
|
|
||||||
|
@BeforeEach
|
||||||
|
void initAuthorizationToken() {
|
||||||
|
AccessToken readToken = createToken("READ_TOKEN");
|
||||||
|
lenient().when(this.tokenFactory.createReadAccessToken(REPOSITORY))
|
||||||
|
.thenReturn(readToken);
|
||||||
|
AccessToken writeToken = createToken("WRITE_TOKEN");
|
||||||
|
lenient().when(this.tokenFactory.createWriteAccessToken(REPOSITORY))
|
||||||
|
.thenReturn(writeToken);
|
||||||
|
}
|
||||||
|
|
||||||
|
AccessToken createToken(String mockedValue) {
|
||||||
|
AccessToken accessToken = mock(AccessToken.class);
|
||||||
|
lenient().when(accessToken.getExpiration()).thenReturn(EXPIRATION);
|
||||||
|
lenient().when(accessToken.compact()).thenReturn(mockedValue);
|
||||||
|
return accessToken;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
void shouldTakeExpirationFromToken() {
|
||||||
|
ExpiringAction downloadAction = lfsRepository.getDownloadAction(OBJECT_ID);
|
||||||
|
assertThat(downloadAction.expires_at).isEqualTo("2007-05-03T10:15:30Z");
|
||||||
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
void shouldContainReadTokenForDownlo() {
|
||||||
|
ExpiringAction downloadAction = lfsRepository.getDownloadAction(OBJECT_ID);
|
||||||
|
assertThat(downloadAction.header.get("Authorization")).isEqualTo("Bearer READ_TOKEN");
|
||||||
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
void shouldContainWriteTokenForUpload() {
|
||||||
|
ExpiringAction downloadAction = lfsRepository.getUploadAction(OBJECT_ID, 42L);
|
||||||
|
assertThat(downloadAction.header.get("Authorization")).isEqualTo("Bearer WRITE_TOKEN");
|
||||||
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
void shouldContainUrl() {
|
||||||
|
ExpiringAction downloadAction = lfsRepository.getDownloadAction(OBJECT_ID);
|
||||||
|
assertThat(downloadAction.href).isEqualTo("http://scm.org/976ed944c37cc5d1606af316937edb9d286ecf6c606af316937edb9d286ecf6c");
|
||||||
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
void shouldCreateTokenForDownloadActionOnlyOnce() {
|
||||||
|
lfsRepository.getDownloadAction(OBJECT_ID);
|
||||||
|
lfsRepository.getDownloadAction(OBJECT_ID);
|
||||||
|
verify(tokenFactory, times(1)).createReadAccessToken(REPOSITORY);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
void shouldCreateTokenForUploadActionOnlyOnce() {
|
||||||
|
lfsRepository.getUploadAction(OBJECT_ID, 42L);
|
||||||
|
lfsRepository.getUploadAction(OBJECT_ID, 42L);
|
||||||
|
verify(tokenFactory, times(1)).createWriteAccessToken(REPOSITORY);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
@@ -11,41 +11,26 @@ import static org.junit.Assert.assertThat;
|
|||||||
import static org.mockito.Mockito.mock;
|
import static org.mockito.Mockito.mock;
|
||||||
import static org.mockito.Mockito.when;
|
import static org.mockito.Mockito.when;
|
||||||
|
|
||||||
/**
|
|
||||||
* Created by omilke on 18.05.2017.
|
|
||||||
*/
|
|
||||||
public class LfsServletFactoryTest {
|
public class LfsServletFactoryTest {
|
||||||
|
|
||||||
|
private static final String NAMESPACE = "space";
|
||||||
|
private static final String NAME = "git-lfs-demo";
|
||||||
|
private static final Repository REPOSITORY = new Repository("", "GIT", NAMESPACE, NAME);
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void buildBaseUri() {
|
public void shouldBuildBaseUri() {
|
||||||
|
String result = LfsServletFactory.buildBaseUri(REPOSITORY, requestWithUri("git-lfs-demo"));
|
||||||
String repositoryNamespace = "space";
|
|
||||||
String repositoryName = "git-lfs-demo";
|
|
||||||
|
|
||||||
String result = LfsServletFactory.buildBaseUri(new Repository("", "GIT", repositoryNamespace, repositoryName), RequestWithUri(repositoryName, true));
|
|
||||||
assertThat(result, is(equalTo("http://localhost:8081/scm/repo/space/git-lfs-demo.git/info/lfs/objects/")));
|
|
||||||
|
|
||||||
|
|
||||||
//result will be with dot-git suffix, ide
|
|
||||||
result = LfsServletFactory.buildBaseUri(new Repository("", "GIT", repositoryNamespace, repositoryName), RequestWithUri(repositoryName, false));
|
|
||||||
assertThat(result, is(equalTo("http://localhost:8081/scm/repo/space/git-lfs-demo.git/info/lfs/objects/")));
|
assertThat(result, is(equalTo("http://localhost:8081/scm/repo/space/git-lfs-demo.git/info/lfs/objects/")));
|
||||||
}
|
}
|
||||||
|
|
||||||
private HttpServletRequest RequestWithUri(String repositoryName, boolean withDotGitSuffix) {
|
private HttpServletRequest requestWithUri(String repositoryName) {
|
||||||
|
|
||||||
HttpServletRequest mockedRequest = mock(HttpServletRequest.class);
|
HttpServletRequest mockedRequest = mock(HttpServletRequest.class);
|
||||||
|
|
||||||
final String suffix;
|
|
||||||
if (withDotGitSuffix) {
|
|
||||||
suffix = ".git";
|
|
||||||
} else {
|
|
||||||
suffix = "";
|
|
||||||
}
|
|
||||||
|
|
||||||
//build from valid live request data
|
//build from valid live request data
|
||||||
when(mockedRequest.getRequestURL()).thenReturn(
|
when(mockedRequest.getRequestURL()).thenReturn(
|
||||||
new StringBuffer(String.format("http://localhost:8081/scm/repo/%s%s/info/lfs/objects/batch", repositoryName, suffix)));
|
new StringBuffer(String.format("http://localhost:8081/scm/repo/%s/info/lfs/objects/batch", repositoryName)));
|
||||||
when(mockedRequest.getRequestURI()).thenReturn(String.format("/scm/repo/%s%s/info/lfs/objects/batch", repositoryName, suffix));
|
when(mockedRequest.getRequestURI()).thenReturn(String.format("/scm/repo/%s/info/lfs/objects/batch", repositoryName));
|
||||||
when(mockedRequest.getContextPath()).thenReturn("/scm");
|
when(mockedRequest.getContextPath()).thenReturn("/scm");
|
||||||
|
|
||||||
return mockedRequest;
|
return mockedRequest;
|
||||||
|
|||||||
Binary file not shown.
6
scm-plugins/scm-git-plugin/tsconfig.json
Normal file
6
scm-plugins/scm-git-plugin/tsconfig.json
Normal file
@@ -0,0 +1,6 @@
|
|||||||
|
{
|
||||||
|
"extends": "@scm-manager/tsconfig",
|
||||||
|
"include": [
|
||||||
|
"./src/main/js"
|
||||||
|
]
|
||||||
|
}
|
||||||
@@ -1,14 +0,0 @@
|
|||||||
[declarations]
|
|
||||||
../../scm-ui/ui-types/.*
|
|
||||||
../../scm-ui/ui-components/.*
|
|
||||||
../../scm-ui/ui-extensions/.*
|
|
||||||
|
|
||||||
[include]
|
|
||||||
./src/**
|
|
||||||
../../scm-ui/ui-types/.*
|
|
||||||
../../scm-ui/ui-components/.*
|
|
||||||
../../scm-ui/ui-extensions/.*
|
|
||||||
|
|
||||||
[options]
|
|
||||||
module.system.node.resolve_dirname=../../node_modules
|
|
||||||
module.name_mapper='^@scm-manager\/ui-\([a-zA-Z0-9_\-]+\)$' -> '<PROJECT_ROOT>/../../scm-ui/ui-\1'
|
|
||||||
@@ -1,49 +0,0 @@
|
|||||||
// flow-typed signature: e87b860fca7047001bcde4b8780a8655
|
|
||||||
// flow-typed version: <<STUB>>/@scm-manager/ui-extensions_v0.1.2/flow_v0.109.0
|
|
||||||
|
|
||||||
/**
|
|
||||||
* This is an autogenerated libdef stub for:
|
|
||||||
*
|
|
||||||
* '@scm-manager/ui-extensions'
|
|
||||||
*
|
|
||||||
* Fill this stub out by replacing all the `any` types.
|
|
||||||
*
|
|
||||||
* Once filled out, we encourage you to share your work with the
|
|
||||||
* community by sending a pull request to:
|
|
||||||
* https://github.com/flowtype/flow-typed
|
|
||||||
*/
|
|
||||||
|
|
||||||
declare module '@scm-manager/ui-extensions' {
|
|
||||||
declare module.exports: any;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* We include stubs for each file inside this npm package in case you need to
|
|
||||||
* require those files directly. Feel free to delete any files that aren't
|
|
||||||
* needed.
|
|
||||||
*/
|
|
||||||
declare module '@scm-manager/ui-extensions/lib/binder' {
|
|
||||||
declare module.exports: any;
|
|
||||||
}
|
|
||||||
|
|
||||||
declare module '@scm-manager/ui-extensions/lib/ExtensionPoint' {
|
|
||||||
declare module.exports: any;
|
|
||||||
}
|
|
||||||
|
|
||||||
declare module '@scm-manager/ui-extensions/lib' {
|
|
||||||
declare module.exports: any;
|
|
||||||
}
|
|
||||||
|
|
||||||
// Filename aliases
|
|
||||||
declare module '@scm-manager/ui-extensions/lib/binder.js' {
|
|
||||||
declare module.exports: $Exports<'@scm-manager/ui-extensions/lib/binder'>;
|
|
||||||
}
|
|
||||||
declare module '@scm-manager/ui-extensions/lib/ExtensionPoint.js' {
|
|
||||||
declare module.exports: $Exports<'@scm-manager/ui-extensions/lib/ExtensionPoint'>;
|
|
||||||
}
|
|
||||||
declare module '@scm-manager/ui-extensions/lib/index' {
|
|
||||||
declare module.exports: $Exports<'@scm-manager/ui-extensions/lib'>;
|
|
||||||
}
|
|
||||||
declare module '@scm-manager/ui-extensions/lib/index.js' {
|
|
||||||
declare module.exports: $Exports<'@scm-manager/ui-extensions/lib'>;
|
|
||||||
}
|
|
||||||
@@ -1,23 +0,0 @@
|
|||||||
// flow-typed signature: cf86673cc32d185bdab1d2ea90578d37
|
|
||||||
// flow-typed version: 614bf49aa8/classnames_v2.x.x/flow_>=v0.25.x
|
|
||||||
|
|
||||||
type $npm$classnames$Classes =
|
|
||||||
| string
|
|
||||||
| { [className: string]: * }
|
|
||||||
| false
|
|
||||||
| void
|
|
||||||
| null;
|
|
||||||
|
|
||||||
declare module "classnames" {
|
|
||||||
declare module.exports: (
|
|
||||||
...classes: Array<$npm$classnames$Classes | $npm$classnames$Classes[]>
|
|
||||||
) => string;
|
|
||||||
}
|
|
||||||
|
|
||||||
declare module "classnames/bind" {
|
|
||||||
declare module.exports: $Exports<"classnames">;
|
|
||||||
}
|
|
||||||
|
|
||||||
declare module "classnames/dedupe" {
|
|
||||||
declare module.exports: $Exports<"classnames">;
|
|
||||||
}
|
|
||||||
@@ -1,269 +0,0 @@
|
|||||||
// flow-typed signature: 761f01d8db9f91fa67135cb2120c2b8e
|
|
||||||
// flow-typed version: <<STUB>>/enzyme_v3.10.0/flow_v0.109.0
|
|
||||||
|
|
||||||
/**
|
|
||||||
* This is an autogenerated libdef stub for:
|
|
||||||
*
|
|
||||||
* 'enzyme'
|
|
||||||
*
|
|
||||||
* Fill this stub out by replacing all the `any` types.
|
|
||||||
*
|
|
||||||
* Once filled out, we encourage you to share your work with the
|
|
||||||
* community by sending a pull request to:
|
|
||||||
* https://github.com/flowtype/flow-typed
|
|
||||||
*/
|
|
||||||
|
|
||||||
declare module 'enzyme' {
|
|
||||||
declare module.exports: any;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* We include stubs for each file inside this npm package in case you need to
|
|
||||||
* require those files directly. Feel free to delete any files that aren't
|
|
||||||
* needed.
|
|
||||||
*/
|
|
||||||
declare module 'enzyme/build/configuration' {
|
|
||||||
declare module.exports: any;
|
|
||||||
}
|
|
||||||
|
|
||||||
declare module 'enzyme/build/Debug' {
|
|
||||||
declare module.exports: any;
|
|
||||||
}
|
|
||||||
|
|
||||||
declare module 'enzyme/build/EnzymeAdapter' {
|
|
||||||
declare module.exports: any;
|
|
||||||
}
|
|
||||||
|
|
||||||
declare module 'enzyme/build/getAdapter' {
|
|
||||||
declare module.exports: any;
|
|
||||||
}
|
|
||||||
|
|
||||||
declare module 'enzyme/build' {
|
|
||||||
declare module.exports: any;
|
|
||||||
}
|
|
||||||
|
|
||||||
declare module 'enzyme/build/mount' {
|
|
||||||
declare module.exports: any;
|
|
||||||
}
|
|
||||||
|
|
||||||
declare module 'enzyme/build/ReactWrapper' {
|
|
||||||
declare module.exports: any;
|
|
||||||
}
|
|
||||||
|
|
||||||
declare module 'enzyme/build/render' {
|
|
||||||
declare module.exports: any;
|
|
||||||
}
|
|
||||||
|
|
||||||
declare module 'enzyme/build/RSTTraversal' {
|
|
||||||
declare module.exports: any;
|
|
||||||
}
|
|
||||||
|
|
||||||
declare module 'enzyme/build/selectors' {
|
|
||||||
declare module.exports: any;
|
|
||||||
}
|
|
||||||
|
|
||||||
declare module 'enzyme/build/shallow' {
|
|
||||||
declare module.exports: any;
|
|
||||||
}
|
|
||||||
|
|
||||||
declare module 'enzyme/build/ShallowWrapper' {
|
|
||||||
declare module.exports: any;
|
|
||||||
}
|
|
||||||
|
|
||||||
declare module 'enzyme/build/Utils' {
|
|
||||||
declare module.exports: any;
|
|
||||||
}
|
|
||||||
|
|
||||||
declare module 'enzyme/build/validateAdapter' {
|
|
||||||
declare module.exports: any;
|
|
||||||
}
|
|
||||||
|
|
||||||
declare module 'enzyme/mount' {
|
|
||||||
declare module.exports: any;
|
|
||||||
}
|
|
||||||
|
|
||||||
declare module 'enzyme/ReactWrapper' {
|
|
||||||
declare module.exports: any;
|
|
||||||
}
|
|
||||||
|
|
||||||
declare module 'enzyme/render' {
|
|
||||||
declare module.exports: any;
|
|
||||||
}
|
|
||||||
|
|
||||||
declare module 'enzyme/shallow' {
|
|
||||||
declare module.exports: any;
|
|
||||||
}
|
|
||||||
|
|
||||||
declare module 'enzyme/ShallowWrapper' {
|
|
||||||
declare module.exports: any;
|
|
||||||
}
|
|
||||||
|
|
||||||
declare module 'enzyme/src/configuration' {
|
|
||||||
declare module.exports: any;
|
|
||||||
}
|
|
||||||
|
|
||||||
declare module 'enzyme/src/Debug' {
|
|
||||||
declare module.exports: any;
|
|
||||||
}
|
|
||||||
|
|
||||||
declare module 'enzyme/src/EnzymeAdapter' {
|
|
||||||
declare module.exports: any;
|
|
||||||
}
|
|
||||||
|
|
||||||
declare module 'enzyme/src/getAdapter' {
|
|
||||||
declare module.exports: any;
|
|
||||||
}
|
|
||||||
|
|
||||||
declare module 'enzyme/src' {
|
|
||||||
declare module.exports: any;
|
|
||||||
}
|
|
||||||
|
|
||||||
declare module 'enzyme/src/mount' {
|
|
||||||
declare module.exports: any;
|
|
||||||
}
|
|
||||||
|
|
||||||
declare module 'enzyme/src/ReactWrapper' {
|
|
||||||
declare module.exports: any;
|
|
||||||
}
|
|
||||||
|
|
||||||
declare module 'enzyme/src/render' {
|
|
||||||
declare module.exports: any;
|
|
||||||
}
|
|
||||||
|
|
||||||
declare module 'enzyme/src/RSTTraversal' {
|
|
||||||
declare module.exports: any;
|
|
||||||
}
|
|
||||||
|
|
||||||
declare module 'enzyme/src/selectors' {
|
|
||||||
declare module.exports: any;
|
|
||||||
}
|
|
||||||
|
|
||||||
declare module 'enzyme/src/shallow' {
|
|
||||||
declare module.exports: any;
|
|
||||||
}
|
|
||||||
|
|
||||||
declare module 'enzyme/src/ShallowWrapper' {
|
|
||||||
declare module.exports: any;
|
|
||||||
}
|
|
||||||
|
|
||||||
declare module 'enzyme/src/Utils' {
|
|
||||||
declare module.exports: any;
|
|
||||||
}
|
|
||||||
|
|
||||||
declare module 'enzyme/src/validateAdapter' {
|
|
||||||
declare module.exports: any;
|
|
||||||
}
|
|
||||||
|
|
||||||
declare module 'enzyme/withDom' {
|
|
||||||
declare module.exports: any;
|
|
||||||
}
|
|
||||||
|
|
||||||
// Filename aliases
|
|
||||||
declare module 'enzyme/build/configuration.js' {
|
|
||||||
declare module.exports: $Exports<'enzyme/build/configuration'>;
|
|
||||||
}
|
|
||||||
declare module 'enzyme/build/Debug.js' {
|
|
||||||
declare module.exports: $Exports<'enzyme/build/Debug'>;
|
|
||||||
}
|
|
||||||
declare module 'enzyme/build/EnzymeAdapter.js' {
|
|
||||||
declare module.exports: $Exports<'enzyme/build/EnzymeAdapter'>;
|
|
||||||
}
|
|
||||||
declare module 'enzyme/build/getAdapter.js' {
|
|
||||||
declare module.exports: $Exports<'enzyme/build/getAdapter'>;
|
|
||||||
}
|
|
||||||
declare module 'enzyme/build/index' {
|
|
||||||
declare module.exports: $Exports<'enzyme/build'>;
|
|
||||||
}
|
|
||||||
declare module 'enzyme/build/index.js' {
|
|
||||||
declare module.exports: $Exports<'enzyme/build'>;
|
|
||||||
}
|
|
||||||
declare module 'enzyme/build/mount.js' {
|
|
||||||
declare module.exports: $Exports<'enzyme/build/mount'>;
|
|
||||||
}
|
|
||||||
declare module 'enzyme/build/ReactWrapper.js' {
|
|
||||||
declare module.exports: $Exports<'enzyme/build/ReactWrapper'>;
|
|
||||||
}
|
|
||||||
declare module 'enzyme/build/render.js' {
|
|
||||||
declare module.exports: $Exports<'enzyme/build/render'>;
|
|
||||||
}
|
|
||||||
declare module 'enzyme/build/RSTTraversal.js' {
|
|
||||||
declare module.exports: $Exports<'enzyme/build/RSTTraversal'>;
|
|
||||||
}
|
|
||||||
declare module 'enzyme/build/selectors.js' {
|
|
||||||
declare module.exports: $Exports<'enzyme/build/selectors'>;
|
|
||||||
}
|
|
||||||
declare module 'enzyme/build/shallow.js' {
|
|
||||||
declare module.exports: $Exports<'enzyme/build/shallow'>;
|
|
||||||
}
|
|
||||||
declare module 'enzyme/build/ShallowWrapper.js' {
|
|
||||||
declare module.exports: $Exports<'enzyme/build/ShallowWrapper'>;
|
|
||||||
}
|
|
||||||
declare module 'enzyme/build/Utils.js' {
|
|
||||||
declare module.exports: $Exports<'enzyme/build/Utils'>;
|
|
||||||
}
|
|
||||||
declare module 'enzyme/build/validateAdapter.js' {
|
|
||||||
declare module.exports: $Exports<'enzyme/build/validateAdapter'>;
|
|
||||||
}
|
|
||||||
declare module 'enzyme/mount.js' {
|
|
||||||
declare module.exports: $Exports<'enzyme/mount'>;
|
|
||||||
}
|
|
||||||
declare module 'enzyme/ReactWrapper.js' {
|
|
||||||
declare module.exports: $Exports<'enzyme/ReactWrapper'>;
|
|
||||||
}
|
|
||||||
declare module 'enzyme/render.js' {
|
|
||||||
declare module.exports: $Exports<'enzyme/render'>;
|
|
||||||
}
|
|
||||||
declare module 'enzyme/shallow.js' {
|
|
||||||
declare module.exports: $Exports<'enzyme/shallow'>;
|
|
||||||
}
|
|
||||||
declare module 'enzyme/ShallowWrapper.js' {
|
|
||||||
declare module.exports: $Exports<'enzyme/ShallowWrapper'>;
|
|
||||||
}
|
|
||||||
declare module 'enzyme/src/configuration.js' {
|
|
||||||
declare module.exports: $Exports<'enzyme/src/configuration'>;
|
|
||||||
}
|
|
||||||
declare module 'enzyme/src/Debug.js' {
|
|
||||||
declare module.exports: $Exports<'enzyme/src/Debug'>;
|
|
||||||
}
|
|
||||||
declare module 'enzyme/src/EnzymeAdapter.js' {
|
|
||||||
declare module.exports: $Exports<'enzyme/src/EnzymeAdapter'>;
|
|
||||||
}
|
|
||||||
declare module 'enzyme/src/getAdapter.js' {
|
|
||||||
declare module.exports: $Exports<'enzyme/src/getAdapter'>;
|
|
||||||
}
|
|
||||||
declare module 'enzyme/src/index' {
|
|
||||||
declare module.exports: $Exports<'enzyme/src'>;
|
|
||||||
}
|
|
||||||
declare module 'enzyme/src/index.js' {
|
|
||||||
declare module.exports: $Exports<'enzyme/src'>;
|
|
||||||
}
|
|
||||||
declare module 'enzyme/src/mount.js' {
|
|
||||||
declare module.exports: $Exports<'enzyme/src/mount'>;
|
|
||||||
}
|
|
||||||
declare module 'enzyme/src/ReactWrapper.js' {
|
|
||||||
declare module.exports: $Exports<'enzyme/src/ReactWrapper'>;
|
|
||||||
}
|
|
||||||
declare module 'enzyme/src/render.js' {
|
|
||||||
declare module.exports: $Exports<'enzyme/src/render'>;
|
|
||||||
}
|
|
||||||
declare module 'enzyme/src/RSTTraversal.js' {
|
|
||||||
declare module.exports: $Exports<'enzyme/src/RSTTraversal'>;
|
|
||||||
}
|
|
||||||
declare module 'enzyme/src/selectors.js' {
|
|
||||||
declare module.exports: $Exports<'enzyme/src/selectors'>;
|
|
||||||
}
|
|
||||||
declare module 'enzyme/src/shallow.js' {
|
|
||||||
declare module.exports: $Exports<'enzyme/src/shallow'>;
|
|
||||||
}
|
|
||||||
declare module 'enzyme/src/ShallowWrapper.js' {
|
|
||||||
declare module.exports: $Exports<'enzyme/src/ShallowWrapper'>;
|
|
||||||
}
|
|
||||||
declare module 'enzyme/src/Utils.js' {
|
|
||||||
declare module.exports: $Exports<'enzyme/src/Utils'>;
|
|
||||||
}
|
|
||||||
declare module 'enzyme/src/validateAdapter.js' {
|
|
||||||
declare module.exports: $Exports<'enzyme/src/validateAdapter'>;
|
|
||||||
}
|
|
||||||
declare module 'enzyme/withDom.js' {
|
|
||||||
declare module.exports: $Exports<'enzyme/withDom'>;
|
|
||||||
}
|
|
||||||
@@ -1,66 +0,0 @@
|
|||||||
// flow-typed signature: 9be79ea52a669f6c266677d1d0bd3e9d
|
|
||||||
// flow-typed version: <<STUB>>/gitdiff-parser_v0.1.2/flow_v0.109.0
|
|
||||||
|
|
||||||
/**
|
|
||||||
* This is an autogenerated libdef stub for:
|
|
||||||
*
|
|
||||||
* 'gitdiff-parser'
|
|
||||||
*
|
|
||||||
* Fill this stub out by replacing all the `any` types.
|
|
||||||
*
|
|
||||||
* Once filled out, we encourage you to share your work with the
|
|
||||||
* community by sending a pull request to:
|
|
||||||
* https://github.com/flowtype/flow-typed
|
|
||||||
*/
|
|
||||||
|
|
||||||
declare module 'gitdiff-parser' {
|
|
||||||
declare module.exports: any;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* We include stubs for each file inside this npm package in case you need to
|
|
||||||
* require those files directly. Feel free to delete any files that aren't
|
|
||||||
* needed.
|
|
||||||
*/
|
|
||||||
declare module 'gitdiff-parser/test/git.test' {
|
|
||||||
declare module.exports: any;
|
|
||||||
}
|
|
||||||
|
|
||||||
declare module 'gitdiff-parser/test/hg' {
|
|
||||||
declare module.exports: any;
|
|
||||||
}
|
|
||||||
|
|
||||||
declare module 'gitdiff-parser/test/hg.test' {
|
|
||||||
declare module.exports: any;
|
|
||||||
}
|
|
||||||
|
|
||||||
declare module 'gitdiff-parser/test/perf-parse-diff' {
|
|
||||||
declare module.exports: any;
|
|
||||||
}
|
|
||||||
|
|
||||||
declare module 'gitdiff-parser/test/perf' {
|
|
||||||
declare module.exports: any;
|
|
||||||
}
|
|
||||||
|
|
||||||
// Filename aliases
|
|
||||||
declare module 'gitdiff-parser/index' {
|
|
||||||
declare module.exports: $Exports<'gitdiff-parser'>;
|
|
||||||
}
|
|
||||||
declare module 'gitdiff-parser/index.js' {
|
|
||||||
declare module.exports: $Exports<'gitdiff-parser'>;
|
|
||||||
}
|
|
||||||
declare module 'gitdiff-parser/test/git.test.js' {
|
|
||||||
declare module.exports: $Exports<'gitdiff-parser/test/git.test'>;
|
|
||||||
}
|
|
||||||
declare module 'gitdiff-parser/test/hg.js' {
|
|
||||||
declare module.exports: $Exports<'gitdiff-parser/test/hg'>;
|
|
||||||
}
|
|
||||||
declare module 'gitdiff-parser/test/hg.test.js' {
|
|
||||||
declare module.exports: $Exports<'gitdiff-parser/test/hg.test'>;
|
|
||||||
}
|
|
||||||
declare module 'gitdiff-parser/test/perf-parse-diff.js' {
|
|
||||||
declare module.exports: $Exports<'gitdiff-parser/test/perf-parse-diff'>;
|
|
||||||
}
|
|
||||||
declare module 'gitdiff-parser/test/perf.js' {
|
|
||||||
declare module.exports: $Exports<'gitdiff-parser/test/perf'>;
|
|
||||||
}
|
|
||||||
1108
scm-plugins/scm-hg-plugin/flow-typed/npm/jest_v23.x.x.js
vendored
1108
scm-plugins/scm-hg-plugin/flow-typed/npm/jest_v23.x.x.js
vendored
File diff suppressed because it is too large
Load Diff
@@ -1,331 +0,0 @@
|
|||||||
// flow-typed signature: 23b805356f90ad9384dd88489654e380
|
|
||||||
// flow-typed version: e9374c5fe9/moment_v2.3.x/flow_>=v0.25.x
|
|
||||||
|
|
||||||
type moment$MomentOptions = {
|
|
||||||
y?: number | string,
|
|
||||||
year?: number | string,
|
|
||||||
years?: number | string,
|
|
||||||
M?: number | string,
|
|
||||||
month?: number | string,
|
|
||||||
months?: number | string,
|
|
||||||
d?: number | string,
|
|
||||||
day?: number | string,
|
|
||||||
days?: number | string,
|
|
||||||
date?: number | string,
|
|
||||||
h?: number | string,
|
|
||||||
hour?: number | string,
|
|
||||||
hours?: number | string,
|
|
||||||
m?: number | string,
|
|
||||||
minute?: number | string,
|
|
||||||
minutes?: number | string,
|
|
||||||
s?: number | string,
|
|
||||||
second?: number | string,
|
|
||||||
seconds?: number | string,
|
|
||||||
ms?: number | string,
|
|
||||||
millisecond?: number | string,
|
|
||||||
milliseconds?: number | string
|
|
||||||
};
|
|
||||||
|
|
||||||
type moment$MomentObject = {
|
|
||||||
years: number,
|
|
||||||
months: number,
|
|
||||||
date: number,
|
|
||||||
hours: number,
|
|
||||||
minutes: number,
|
|
||||||
seconds: number,
|
|
||||||
milliseconds: number
|
|
||||||
};
|
|
||||||
|
|
||||||
type moment$MomentCreationData = {
|
|
||||||
input: string,
|
|
||||||
format: string,
|
|
||||||
locale: Object,
|
|
||||||
isUTC: boolean,
|
|
||||||
strict: boolean
|
|
||||||
};
|
|
||||||
|
|
||||||
type moment$CalendarFormat = string | ((moment: moment$Moment) => string);
|
|
||||||
|
|
||||||
type moment$CalendarFormats = {
|
|
||||||
sameDay?: moment$CalendarFormat,
|
|
||||||
nextDay?: moment$CalendarFormat,
|
|
||||||
nextWeek?: moment$CalendarFormat,
|
|
||||||
lastDay?: moment$CalendarFormat,
|
|
||||||
lastWeek?: moment$CalendarFormat,
|
|
||||||
sameElse?: moment$CalendarFormat
|
|
||||||
};
|
|
||||||
|
|
||||||
declare class moment$LocaleData {
|
|
||||||
months(moment: moment$Moment): string,
|
|
||||||
monthsShort(moment: moment$Moment): string,
|
|
||||||
monthsParse(month: string): number,
|
|
||||||
weekdays(moment: moment$Moment): string,
|
|
||||||
weekdaysShort(moment: moment$Moment): string,
|
|
||||||
weekdaysMin(moment: moment$Moment): string,
|
|
||||||
weekdaysParse(weekDay: string): number,
|
|
||||||
longDateFormat(dateFormat: string): string,
|
|
||||||
isPM(date: string): boolean,
|
|
||||||
meridiem(hours: number, minutes: number, isLower: boolean): string,
|
|
||||||
calendar(
|
|
||||||
key:
|
|
||||||
| "sameDay"
|
|
||||||
| "nextDay"
|
|
||||||
| "lastDay"
|
|
||||||
| "nextWeek"
|
|
||||||
| "prevWeek"
|
|
||||||
| "sameElse",
|
|
||||||
moment: moment$Moment
|
|
||||||
): string,
|
|
||||||
relativeTime(
|
|
||||||
number: number,
|
|
||||||
withoutSuffix: boolean,
|
|
||||||
key: "s" | "m" | "mm" | "h" | "hh" | "d" | "dd" | "M" | "MM" | "y" | "yy",
|
|
||||||
isFuture: boolean
|
|
||||||
): string,
|
|
||||||
pastFuture(diff: any, relTime: string): string,
|
|
||||||
ordinal(number: number): string,
|
|
||||||
preparse(str: string): any,
|
|
||||||
postformat(str: string): any,
|
|
||||||
week(moment: moment$Moment): string,
|
|
||||||
invalidDate(): string,
|
|
||||||
firstDayOfWeek(): number,
|
|
||||||
firstDayOfYear(): number
|
|
||||||
}
|
|
||||||
declare class moment$MomentDuration {
|
|
||||||
humanize(suffix?: boolean): string,
|
|
||||||
milliseconds(): number,
|
|
||||||
asMilliseconds(): number,
|
|
||||||
seconds(): number,
|
|
||||||
asSeconds(): number,
|
|
||||||
minutes(): number,
|
|
||||||
asMinutes(): number,
|
|
||||||
hours(): number,
|
|
||||||
asHours(): number,
|
|
||||||
days(): number,
|
|
||||||
asDays(): number,
|
|
||||||
months(): number,
|
|
||||||
asWeeks(): number,
|
|
||||||
weeks(): number,
|
|
||||||
asMonths(): number,
|
|
||||||
years(): number,
|
|
||||||
asYears(): number,
|
|
||||||
add(value: number | moment$MomentDuration | Object, unit?: string): this,
|
|
||||||
subtract(value: number | moment$MomentDuration | Object, unit?: string): this,
|
|
||||||
as(unit: string): number,
|
|
||||||
get(unit: string): number,
|
|
||||||
toJSON(): string,
|
|
||||||
toISOString(): string,
|
|
||||||
isValid(): boolean
|
|
||||||
}
|
|
||||||
declare class moment$Moment {
|
|
||||||
static ISO_8601: string,
|
|
||||||
static (
|
|
||||||
string?: string,
|
|
||||||
format?: string | Array<string>,
|
|
||||||
strict?: boolean
|
|
||||||
): moment$Moment,
|
|
||||||
static (
|
|
||||||
string?: string,
|
|
||||||
format?: string | Array<string>,
|
|
||||||
locale?: string,
|
|
||||||
strict?: boolean
|
|
||||||
): moment$Moment,
|
|
||||||
static (
|
|
||||||
initDate: ?Object | number | Date | Array<number> | moment$Moment | string
|
|
||||||
): moment$Moment,
|
|
||||||
static unix(seconds: number): moment$Moment,
|
|
||||||
static utc(): moment$Moment,
|
|
||||||
static utc(number: number | Array<number>): moment$Moment,
|
|
||||||
static utc(
|
|
||||||
str: string,
|
|
||||||
str2?: string | Array<string>,
|
|
||||||
str3?: string
|
|
||||||
): moment$Moment,
|
|
||||||
static utc(moment: moment$Moment): moment$Moment,
|
|
||||||
static utc(date: Date): moment$Moment,
|
|
||||||
static parseZone(): moment$Moment,
|
|
||||||
static parseZone(rawDate: string): moment$Moment,
|
|
||||||
static parseZone(
|
|
||||||
rawDate: string,
|
|
||||||
format: string | Array<string>
|
|
||||||
): moment$Moment,
|
|
||||||
static parseZone(
|
|
||||||
rawDate: string,
|
|
||||||
format: string,
|
|
||||||
strict: boolean
|
|
||||||
): moment$Moment,
|
|
||||||
static parseZone(
|
|
||||||
rawDate: string,
|
|
||||||
format: string,
|
|
||||||
locale: string,
|
|
||||||
strict: boolean
|
|
||||||
): moment$Moment,
|
|
||||||
isValid(): boolean,
|
|
||||||
invalidAt(): 0 | 1 | 2 | 3 | 4 | 5 | 6,
|
|
||||||
creationData(): moment$MomentCreationData,
|
|
||||||
millisecond(number: number): this,
|
|
||||||
milliseconds(number: number): this,
|
|
||||||
millisecond(): number,
|
|
||||||
milliseconds(): number,
|
|
||||||
second(number: number): this,
|
|
||||||
seconds(number: number): this,
|
|
||||||
second(): number,
|
|
||||||
seconds(): number,
|
|
||||||
minute(number: number): this,
|
|
||||||
minutes(number: number): this,
|
|
||||||
minute(): number,
|
|
||||||
minutes(): number,
|
|
||||||
hour(number: number): this,
|
|
||||||
hours(number: number): this,
|
|
||||||
hour(): number,
|
|
||||||
hours(): number,
|
|
||||||
date(number: number): this,
|
|
||||||
dates(number: number): this,
|
|
||||||
date(): number,
|
|
||||||
dates(): number,
|
|
||||||
day(day: number | string): this,
|
|
||||||
days(day: number | string): this,
|
|
||||||
day(): number,
|
|
||||||
days(): number,
|
|
||||||
weekday(number: number): this,
|
|
||||||
weekday(): number,
|
|
||||||
isoWeekday(number: number): this,
|
|
||||||
isoWeekday(): number,
|
|
||||||
dayOfYear(number: number): this,
|
|
||||||
dayOfYear(): number,
|
|
||||||
week(number: number): this,
|
|
||||||
weeks(number: number): this,
|
|
||||||
week(): number,
|
|
||||||
weeks(): number,
|
|
||||||
isoWeek(number: number): this,
|
|
||||||
isoWeeks(number: number): this,
|
|
||||||
isoWeek(): number,
|
|
||||||
isoWeeks(): number,
|
|
||||||
month(number: number): this,
|
|
||||||
months(number: number): this,
|
|
||||||
month(): number,
|
|
||||||
months(): number,
|
|
||||||
quarter(number: number): this,
|
|
||||||
quarter(): number,
|
|
||||||
year(number: number): this,
|
|
||||||
years(number: number): this,
|
|
||||||
year(): number,
|
|
||||||
years(): number,
|
|
||||||
weekYear(number: number): this,
|
|
||||||
weekYear(): number,
|
|
||||||
isoWeekYear(number: number): this,
|
|
||||||
isoWeekYear(): number,
|
|
||||||
weeksInYear(): number,
|
|
||||||
isoWeeksInYear(): number,
|
|
||||||
get(string: string): number,
|
|
||||||
set(unit: string, value: number): this,
|
|
||||||
set(options: { [unit: string]: number }): this,
|
|
||||||
static max(...dates: Array<moment$Moment>): moment$Moment,
|
|
||||||
static max(dates: Array<moment$Moment>): moment$Moment,
|
|
||||||
static min(...dates: Array<moment$Moment>): moment$Moment,
|
|
||||||
static min(dates: Array<moment$Moment>): moment$Moment,
|
|
||||||
add(
|
|
||||||
value: number | moment$MomentDuration | moment$Moment | Object,
|
|
||||||
unit?: string
|
|
||||||
): this,
|
|
||||||
subtract(
|
|
||||||
value: number | moment$MomentDuration | moment$Moment | string | Object,
|
|
||||||
unit?: string
|
|
||||||
): this,
|
|
||||||
startOf(unit: string): this,
|
|
||||||
endOf(unit: string): this,
|
|
||||||
local(): this,
|
|
||||||
utc(): this,
|
|
||||||
utcOffset(
|
|
||||||
offset: number | string,
|
|
||||||
keepLocalTime?: boolean,
|
|
||||||
keepMinutes?: boolean
|
|
||||||
): this,
|
|
||||||
utcOffset(): number,
|
|
||||||
format(format?: string): string,
|
|
||||||
fromNow(removeSuffix?: boolean): string,
|
|
||||||
from(
|
|
||||||
value: moment$Moment | string | number | Date | Array<number>,
|
|
||||||
removePrefix?: boolean
|
|
||||||
): string,
|
|
||||||
toNow(removePrefix?: boolean): string,
|
|
||||||
to(
|
|
||||||
value: moment$Moment | string | number | Date | Array<number>,
|
|
||||||
removePrefix?: boolean
|
|
||||||
): string,
|
|
||||||
calendar(refTime?: any, formats?: moment$CalendarFormats): string,
|
|
||||||
diff(
|
|
||||||
date: moment$Moment | string | number | Date | Array<number>,
|
|
||||||
format?: string,
|
|
||||||
floating?: boolean
|
|
||||||
): number,
|
|
||||||
valueOf(): number,
|
|
||||||
unix(): number,
|
|
||||||
daysInMonth(): number,
|
|
||||||
toDate(): Date,
|
|
||||||
toArray(): Array<number>,
|
|
||||||
toJSON(): string,
|
|
||||||
toISOString(
|
|
||||||
keepOffset?: boolean
|
|
||||||
): string,
|
|
||||||
toObject(): moment$MomentObject,
|
|
||||||
isBefore(
|
|
||||||
date?: moment$Moment | string | number | Date | Array<number>,
|
|
||||||
units?: ?string
|
|
||||||
): boolean,
|
|
||||||
isSame(
|
|
||||||
date?: moment$Moment | string | number | Date | Array<number>,
|
|
||||||
units?: ?string
|
|
||||||
): boolean,
|
|
||||||
isAfter(
|
|
||||||
date?: moment$Moment | string | number | Date | Array<number>,
|
|
||||||
units?: ?string
|
|
||||||
): boolean,
|
|
||||||
isSameOrBefore(
|
|
||||||
date?: moment$Moment | string | number | Date | Array<number>,
|
|
||||||
units?: ?string
|
|
||||||
): boolean,
|
|
||||||
isSameOrAfter(
|
|
||||||
date?: moment$Moment | string | number | Date | Array<number>,
|
|
||||||
units?: ?string
|
|
||||||
): boolean,
|
|
||||||
isBetween(
|
|
||||||
fromDate: moment$Moment | string | number | Date | Array<number>,
|
|
||||||
toDate?: ?moment$Moment | string | number | Date | Array<number>,
|
|
||||||
granularity?: ?string,
|
|
||||||
inclusion?: ?string
|
|
||||||
): boolean,
|
|
||||||
isDST(): boolean,
|
|
||||||
isDSTShifted(): boolean,
|
|
||||||
isLeapYear(): boolean,
|
|
||||||
clone(): moment$Moment,
|
|
||||||
static isMoment(obj: any): boolean,
|
|
||||||
static isDate(obj: any): boolean,
|
|
||||||
static locale(locale: string, localeData?: Object): string,
|
|
||||||
static updateLocale(locale: string, localeData?: ?Object): void,
|
|
||||||
static locale(locales: Array<string>): string,
|
|
||||||
locale(locale: string, customization?: Object | null): moment$Moment,
|
|
||||||
locale(): string,
|
|
||||||
static months(): Array<string>,
|
|
||||||
static monthsShort(): Array<string>,
|
|
||||||
static weekdays(): Array<string>,
|
|
||||||
static weekdaysShort(): Array<string>,
|
|
||||||
static weekdaysMin(): Array<string>,
|
|
||||||
static months(): string,
|
|
||||||
static monthsShort(): string,
|
|
||||||
static weekdays(): string,
|
|
||||||
static weekdaysShort(): string,
|
|
||||||
static weekdaysMin(): string,
|
|
||||||
static localeData(key?: string): moment$LocaleData,
|
|
||||||
static duration(
|
|
||||||
value: number | Object | string,
|
|
||||||
unit?: string
|
|
||||||
): moment$MomentDuration,
|
|
||||||
static isDuration(obj: any): boolean,
|
|
||||||
static normalizeUnits(unit: string): string,
|
|
||||||
static invalid(object: any): moment$Moment
|
|
||||||
}
|
|
||||||
|
|
||||||
declare module "moment" {
|
|
||||||
declare module.exports: Class<moment$Moment>;
|
|
||||||
}
|
|
||||||
@@ -1,22 +0,0 @@
|
|||||||
// flow-typed signature: 45d44f189fa426ca21dee3f5149a4f99
|
|
||||||
// flow-typed version: c6154227d1/query-string_v5.x.x/flow_>=v0.104.x
|
|
||||||
|
|
||||||
declare module "query-string" {
|
|
||||||
declare type ArrayFormat = "none" | "bracket" | "index";
|
|
||||||
declare type ParseOptions = {|
|
|
||||||
arrayFormat?: ArrayFormat
|
|
||||||
|};
|
|
||||||
|
|
||||||
declare type StringifyOptions = {|
|
|
||||||
arrayFormat?: ArrayFormat,
|
|
||||||
encode?: boolean,
|
|
||||||
strict?: boolean
|
|
||||||
|};
|
|
||||||
|
|
||||||
declare module.exports: {
|
|
||||||
extract(str: string): string,
|
|
||||||
parse(str: string, opts?: ParseOptions): Object,
|
|
||||||
stringify(obj: Object, opts?: StringifyOptions): string,
|
|
||||||
...
|
|
||||||
};
|
|
||||||
}
|
|
||||||
@@ -1,139 +0,0 @@
|
|||||||
// flow-typed signature: 35264e970923e4f3cda147e7c17e2407
|
|
||||||
// flow-typed version: <<STUB>>/react-diff-view_v1.8.1/flow_v0.109.0
|
|
||||||
|
|
||||||
/**
|
|
||||||
* This is an autogenerated libdef stub for:
|
|
||||||
*
|
|
||||||
* 'react-diff-view'
|
|
||||||
*
|
|
||||||
* Fill this stub out by replacing all the `any` types.
|
|
||||||
*
|
|
||||||
* Once filled out, we encourage you to share your work with the
|
|
||||||
* community by sending a pull request to:
|
|
||||||
* https://github.com/flowtype/flow-typed
|
|
||||||
*/
|
|
||||||
|
|
||||||
declare module 'react-diff-view' {
|
|
||||||
declare module.exports: any;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* We include stubs for each file inside this npm package in case you need to
|
|
||||||
* require those files directly. Feel free to delete any files that aren't
|
|
||||||
* needed.
|
|
||||||
*/
|
|
||||||
declare module 'react-diff-view/parse' {
|
|
||||||
declare module.exports: any;
|
|
||||||
}
|
|
||||||
|
|
||||||
declare module 'react-diff-view/src/CodeCell' {
|
|
||||||
declare module.exports: any;
|
|
||||||
}
|
|
||||||
|
|
||||||
declare module 'react-diff-view/src/Diff' {
|
|
||||||
declare module.exports: any;
|
|
||||||
}
|
|
||||||
|
|
||||||
declare module 'react-diff-view/src/Hunk' {
|
|
||||||
declare module.exports: any;
|
|
||||||
}
|
|
||||||
|
|
||||||
declare module 'react-diff-view/src' {
|
|
||||||
declare module.exports: any;
|
|
||||||
}
|
|
||||||
|
|
||||||
declare module 'react-diff-view/src/parse' {
|
|
||||||
declare module.exports: any;
|
|
||||||
}
|
|
||||||
|
|
||||||
declare module 'react-diff-view/src/propTypes' {
|
|
||||||
declare module.exports: any;
|
|
||||||
}
|
|
||||||
|
|
||||||
declare module 'react-diff-view/src/selectors' {
|
|
||||||
declare module.exports: any;
|
|
||||||
}
|
|
||||||
|
|
||||||
declare module 'react-diff-view/src/SplitChange' {
|
|
||||||
declare module.exports: any;
|
|
||||||
}
|
|
||||||
|
|
||||||
declare module 'react-diff-view/src/SplitHunk' {
|
|
||||||
declare module.exports: any;
|
|
||||||
}
|
|
||||||
|
|
||||||
declare module 'react-diff-view/src/SplitWidget' {
|
|
||||||
declare module.exports: any;
|
|
||||||
}
|
|
||||||
|
|
||||||
declare module 'react-diff-view/src/UnifiedChange' {
|
|
||||||
declare module.exports: any;
|
|
||||||
}
|
|
||||||
|
|
||||||
declare module 'react-diff-view/src/UnifiedHunk' {
|
|
||||||
declare module.exports: any;
|
|
||||||
}
|
|
||||||
|
|
||||||
declare module 'react-diff-view/src/UnifiedWidget' {
|
|
||||||
declare module.exports: any;
|
|
||||||
}
|
|
||||||
|
|
||||||
declare module 'react-diff-view/src/utils' {
|
|
||||||
declare module.exports: any;
|
|
||||||
}
|
|
||||||
|
|
||||||
// Filename aliases
|
|
||||||
declare module 'react-diff-view/index' {
|
|
||||||
declare module.exports: $Exports<'react-diff-view'>;
|
|
||||||
}
|
|
||||||
declare module 'react-diff-view/index.js' {
|
|
||||||
declare module.exports: $Exports<'react-diff-view'>;
|
|
||||||
}
|
|
||||||
declare module 'react-diff-view/parse.js' {
|
|
||||||
declare module.exports: $Exports<'react-diff-view/parse'>;
|
|
||||||
}
|
|
||||||
declare module 'react-diff-view/src/CodeCell.js' {
|
|
||||||
declare module.exports: $Exports<'react-diff-view/src/CodeCell'>;
|
|
||||||
}
|
|
||||||
declare module 'react-diff-view/src/Diff.js' {
|
|
||||||
declare module.exports: $Exports<'react-diff-view/src/Diff'>;
|
|
||||||
}
|
|
||||||
declare module 'react-diff-view/src/Hunk.js' {
|
|
||||||
declare module.exports: $Exports<'react-diff-view/src/Hunk'>;
|
|
||||||
}
|
|
||||||
declare module 'react-diff-view/src/index' {
|
|
||||||
declare module.exports: $Exports<'react-diff-view/src'>;
|
|
||||||
}
|
|
||||||
declare module 'react-diff-view/src/index.js' {
|
|
||||||
declare module.exports: $Exports<'react-diff-view/src'>;
|
|
||||||
}
|
|
||||||
declare module 'react-diff-view/src/parse.js' {
|
|
||||||
declare module.exports: $Exports<'react-diff-view/src/parse'>;
|
|
||||||
}
|
|
||||||
declare module 'react-diff-view/src/propTypes.js' {
|
|
||||||
declare module.exports: $Exports<'react-diff-view/src/propTypes'>;
|
|
||||||
}
|
|
||||||
declare module 'react-diff-view/src/selectors.js' {
|
|
||||||
declare module.exports: $Exports<'react-diff-view/src/selectors'>;
|
|
||||||
}
|
|
||||||
declare module 'react-diff-view/src/SplitChange.js' {
|
|
||||||
declare module.exports: $Exports<'react-diff-view/src/SplitChange'>;
|
|
||||||
}
|
|
||||||
declare module 'react-diff-view/src/SplitHunk.js' {
|
|
||||||
declare module.exports: $Exports<'react-diff-view/src/SplitHunk'>;
|
|
||||||
}
|
|
||||||
declare module 'react-diff-view/src/SplitWidget.js' {
|
|
||||||
declare module.exports: $Exports<'react-diff-view/src/SplitWidget'>;
|
|
||||||
}
|
|
||||||
declare module 'react-diff-view/src/UnifiedChange.js' {
|
|
||||||
declare module.exports: $Exports<'react-diff-view/src/UnifiedChange'>;
|
|
||||||
}
|
|
||||||
declare module 'react-diff-view/src/UnifiedHunk.js' {
|
|
||||||
declare module.exports: $Exports<'react-diff-view/src/UnifiedHunk'>;
|
|
||||||
}
|
|
||||||
declare module 'react-diff-view/src/UnifiedWidget.js' {
|
|
||||||
declare module.exports: $Exports<'react-diff-view/src/UnifiedWidget'>;
|
|
||||||
}
|
|
||||||
declare module 'react-diff-view/src/utils.js' {
|
|
||||||
declare module.exports: $Exports<'react-diff-view/src/utils'>;
|
|
||||||
}
|
|
||||||
@@ -1,110 +0,0 @@
|
|||||||
// flow-typed signature: e48526194d458ea4787ca56d830092da
|
|
||||||
// flow-typed version: c6154227d1/react-i18next_v7.x.x/flow_>=v0.104.x
|
|
||||||
|
|
||||||
declare module "react-i18next" {
|
|
||||||
declare type TFunction = (key?: ?string, data?: ?Object) => string;
|
|
||||||
|
|
||||||
declare type TranslatorProps = {|
|
|
||||||
t: TFunction,
|
|
||||||
i18nLoadedAt: Date,
|
|
||||||
i18n: Object
|
|
||||||
|};
|
|
||||||
|
|
||||||
declare type TranslatorPropsVoid = {
|
|
||||||
t: TFunction | void,
|
|
||||||
i18nLoadedAt: Date | void,
|
|
||||||
i18n: Object | void,
|
|
||||||
...
|
|
||||||
};
|
|
||||||
|
|
||||||
declare type Translator<P: {...}, Component: React$ComponentType<P>> = (
|
|
||||||
WrappedComponent: Component
|
|
||||||
) => React$ComponentType<
|
|
||||||
$Diff<React$ElementConfig<Component>, TranslatorPropsVoid>
|
|
||||||
>;
|
|
||||||
|
|
||||||
declare type TranslateOptions = $Shape<{
|
|
||||||
wait: boolean,
|
|
||||||
nsMode: "default" | "fallback",
|
|
||||||
bindi18n: false | string,
|
|
||||||
bindStore: false | string,
|
|
||||||
withRef: boolean,
|
|
||||||
translateFuncName: string,
|
|
||||||
i18n: Object,
|
|
||||||
usePureComponent: boolean,
|
|
||||||
...
|
|
||||||
}>;
|
|
||||||
|
|
||||||
declare function translate<P: {...}, Component: React$ComponentType<P>>(
|
|
||||||
namespaces?: | string
|
|
||||||
| Array<string>
|
|
||||||
| (($Diff<P, TranslatorPropsVoid>) => string | Array<string>),
|
|
||||||
options?: TranslateOptions
|
|
||||||
): Translator<P, Component>;
|
|
||||||
|
|
||||||
declare type I18nProps = {
|
|
||||||
i18n?: Object,
|
|
||||||
ns?: string | Array<string>,
|
|
||||||
children: (t: TFunction, {
|
|
||||||
i18n: Object,
|
|
||||||
t: TFunction,
|
|
||||||
...
|
|
||||||
}) => React$Node,
|
|
||||||
initialI18nStore?: Object,
|
|
||||||
initialLanguage?: string,
|
|
||||||
...
|
|
||||||
};
|
|
||||||
declare var I18n: React$ComponentType<I18nProps>;
|
|
||||||
|
|
||||||
declare type InterpolateProps = {
|
|
||||||
className?: string,
|
|
||||||
dangerouslySetInnerHTMLPartElement?: string,
|
|
||||||
i18n?: Object,
|
|
||||||
i18nKey?: string,
|
|
||||||
options?: Object,
|
|
||||||
parent?: string,
|
|
||||||
style?: Object,
|
|
||||||
t?: TFunction,
|
|
||||||
useDangerouslySetInnerHTML?: boolean,
|
|
||||||
...
|
|
||||||
};
|
|
||||||
declare var Interpolate: React$ComponentType<InterpolateProps>;
|
|
||||||
|
|
||||||
declare type TransProps = {
|
|
||||||
count?: number,
|
|
||||||
parent?: string,
|
|
||||||
i18n?: Object,
|
|
||||||
i18nKey?: string,
|
|
||||||
t?: TFunction,
|
|
||||||
...
|
|
||||||
};
|
|
||||||
declare var Trans: React$ComponentType<TransProps>;
|
|
||||||
|
|
||||||
declare type ProviderProps = {
|
|
||||||
i18n: Object,
|
|
||||||
children: React$Element<*>,
|
|
||||||
...
|
|
||||||
};
|
|
||||||
declare var I18nextProvider: React$ComponentType<ProviderProps>;
|
|
||||||
|
|
||||||
declare type NamespacesProps = {
|
|
||||||
components: Array<React$ComponentType<*>>,
|
|
||||||
i18n: { loadNamespaces: Function, ... },
|
|
||||||
...
|
|
||||||
};
|
|
||||||
declare function loadNamespaces(props: NamespacesProps): Promise<void>;
|
|
||||||
|
|
||||||
declare var reactI18nextModule: {
|
|
||||||
type: "3rdParty",
|
|
||||||
init: (instance: Object) => void,
|
|
||||||
...
|
|
||||||
};
|
|
||||||
|
|
||||||
declare function setDefaults(options: TranslateOptions): void;
|
|
||||||
|
|
||||||
declare function getDefaults(): TranslateOptions;
|
|
||||||
|
|
||||||
declare function getI18n(): Object;
|
|
||||||
|
|
||||||
declare function setI18n(instance: Object): void;
|
|
||||||
}
|
|
||||||
@@ -1,137 +0,0 @@
|
|||||||
// flow-typed signature: ba35d02d668b0d0a3e04a63a6847974e
|
|
||||||
// flow-typed version: <<STUB>>/react-jss_v8.6.1/flow_v0.79.1
|
|
||||||
|
|
||||||
/**
|
|
||||||
* This is an autogenerated libdef stub for:
|
|
||||||
*
|
|
||||||
* 'react-jss'
|
|
||||||
*
|
|
||||||
* Fill this stub out by replacing all the `any` types.
|
|
||||||
*
|
|
||||||
* Once filled out, we encourage you to share your work with the
|
|
||||||
* community by sending a pull request to:
|
|
||||||
* https://github.com/flowtype/flow-typed
|
|
||||||
*/
|
|
||||||
|
|
||||||
declare module 'react-jss' {
|
|
||||||
declare module.exports: any;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* We include stubs for each file inside this npm package in case you need to
|
|
||||||
* require those files directly. Feel free to delete any files that aren't
|
|
||||||
* needed.
|
|
||||||
*/
|
|
||||||
declare module 'react-jss/dist/react-jss' {
|
|
||||||
declare module.exports: any;
|
|
||||||
}
|
|
||||||
|
|
||||||
declare module 'react-jss/dist/react-jss.min' {
|
|
||||||
declare module.exports: any;
|
|
||||||
}
|
|
||||||
|
|
||||||
declare module 'react-jss/lib/compose' {
|
|
||||||
declare module.exports: any;
|
|
||||||
}
|
|
||||||
|
|
||||||
declare module 'react-jss/lib/compose.test' {
|
|
||||||
declare module.exports: any;
|
|
||||||
}
|
|
||||||
|
|
||||||
declare module 'react-jss/lib/contextTypes' {
|
|
||||||
declare module.exports: any;
|
|
||||||
}
|
|
||||||
|
|
||||||
declare module 'react-jss/lib/createHoc' {
|
|
||||||
declare module.exports: any;
|
|
||||||
}
|
|
||||||
|
|
||||||
declare module 'react-jss/lib/getDisplayName' {
|
|
||||||
declare module.exports: any;
|
|
||||||
}
|
|
||||||
|
|
||||||
declare module 'react-jss/lib/index' {
|
|
||||||
declare module.exports: any;
|
|
||||||
}
|
|
||||||
|
|
||||||
declare module 'react-jss/lib/index.test' {
|
|
||||||
declare module.exports: any;
|
|
||||||
}
|
|
||||||
|
|
||||||
declare module 'react-jss/lib/injectSheet' {
|
|
||||||
declare module.exports: any;
|
|
||||||
}
|
|
||||||
|
|
||||||
declare module 'react-jss/lib/injectSheet.test' {
|
|
||||||
declare module.exports: any;
|
|
||||||
}
|
|
||||||
|
|
||||||
declare module 'react-jss/lib/jss' {
|
|
||||||
declare module.exports: any;
|
|
||||||
}
|
|
||||||
|
|
||||||
declare module 'react-jss/lib/JssProvider' {
|
|
||||||
declare module.exports: any;
|
|
||||||
}
|
|
||||||
|
|
||||||
declare module 'react-jss/lib/JssProvider.test' {
|
|
||||||
declare module.exports: any;
|
|
||||||
}
|
|
||||||
|
|
||||||
declare module 'react-jss/lib/ns' {
|
|
||||||
declare module.exports: any;
|
|
||||||
}
|
|
||||||
|
|
||||||
declare module 'react-jss/lib/propTypes' {
|
|
||||||
declare module.exports: any;
|
|
||||||
}
|
|
||||||
|
|
||||||
// Filename aliases
|
|
||||||
declare module 'react-jss/dist/react-jss.js' {
|
|
||||||
declare module.exports: $Exports<'react-jss/dist/react-jss'>;
|
|
||||||
}
|
|
||||||
declare module 'react-jss/dist/react-jss.min.js' {
|
|
||||||
declare module.exports: $Exports<'react-jss/dist/react-jss.min'>;
|
|
||||||
}
|
|
||||||
declare module 'react-jss/lib/compose.js' {
|
|
||||||
declare module.exports: $Exports<'react-jss/lib/compose'>;
|
|
||||||
}
|
|
||||||
declare module 'react-jss/lib/compose.test.js' {
|
|
||||||
declare module.exports: $Exports<'react-jss/lib/compose.test'>;
|
|
||||||
}
|
|
||||||
declare module 'react-jss/lib/contextTypes.js' {
|
|
||||||
declare module.exports: $Exports<'react-jss/lib/contextTypes'>;
|
|
||||||
}
|
|
||||||
declare module 'react-jss/lib/createHoc.js' {
|
|
||||||
declare module.exports: $Exports<'react-jss/lib/createHoc'>;
|
|
||||||
}
|
|
||||||
declare module 'react-jss/lib/getDisplayName.js' {
|
|
||||||
declare module.exports: $Exports<'react-jss/lib/getDisplayName'>;
|
|
||||||
}
|
|
||||||
declare module 'react-jss/lib/index.js' {
|
|
||||||
declare module.exports: $Exports<'react-jss/lib/index'>;
|
|
||||||
}
|
|
||||||
declare module 'react-jss/lib/index.test.js' {
|
|
||||||
declare module.exports: $Exports<'react-jss/lib/index.test'>;
|
|
||||||
}
|
|
||||||
declare module 'react-jss/lib/injectSheet.js' {
|
|
||||||
declare module.exports: $Exports<'react-jss/lib/injectSheet'>;
|
|
||||||
}
|
|
||||||
declare module 'react-jss/lib/injectSheet.test.js' {
|
|
||||||
declare module.exports: $Exports<'react-jss/lib/injectSheet.test'>;
|
|
||||||
}
|
|
||||||
declare module 'react-jss/lib/jss.js' {
|
|
||||||
declare module.exports: $Exports<'react-jss/lib/jss'>;
|
|
||||||
}
|
|
||||||
declare module 'react-jss/lib/JssProvider.js' {
|
|
||||||
declare module.exports: $Exports<'react-jss/lib/JssProvider'>;
|
|
||||||
}
|
|
||||||
declare module 'react-jss/lib/JssProvider.test.js' {
|
|
||||||
declare module.exports: $Exports<'react-jss/lib/JssProvider.test'>;
|
|
||||||
}
|
|
||||||
declare module 'react-jss/lib/ns.js' {
|
|
||||||
declare module.exports: $Exports<'react-jss/lib/ns'>;
|
|
||||||
}
|
|
||||||
declare module 'react-jss/lib/propTypes.js' {
|
|
||||||
declare module.exports: $Exports<'react-jss/lib/propTypes'>;
|
|
||||||
}
|
|
||||||
@@ -1,123 +0,0 @@
|
|||||||
// flow-typed signature: 6bcbadac27a01caf160321668f1e53ce
|
|
||||||
// flow-typed version: <<STUB>>/react-markdown_v4.2.2/flow_v0.109.0
|
|
||||||
|
|
||||||
/**
|
|
||||||
* This is an autogenerated libdef stub for:
|
|
||||||
*
|
|
||||||
* 'react-markdown'
|
|
||||||
*
|
|
||||||
* Fill this stub out by replacing all the `any` types.
|
|
||||||
*
|
|
||||||
* Once filled out, we encourage you to share your work with the
|
|
||||||
* community by sending a pull request to:
|
|
||||||
* https://github.com/flowtype/flow-typed
|
|
||||||
*/
|
|
||||||
|
|
||||||
declare module 'react-markdown' {
|
|
||||||
declare module.exports: any;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* We include stubs for each file inside this npm package in case you need to
|
|
||||||
* require those files directly. Feel free to delete any files that aren't
|
|
||||||
* needed.
|
|
||||||
*/
|
|
||||||
declare module 'react-markdown/lib/ast-to-react' {
|
|
||||||
declare module.exports: any;
|
|
||||||
}
|
|
||||||
|
|
||||||
declare module 'react-markdown/lib/get-definitions' {
|
|
||||||
declare module.exports: any;
|
|
||||||
}
|
|
||||||
|
|
||||||
declare module 'react-markdown/lib/plugins/disallow-node' {
|
|
||||||
declare module.exports: any;
|
|
||||||
}
|
|
||||||
|
|
||||||
declare module 'react-markdown/lib/plugins/html-parser' {
|
|
||||||
declare module.exports: any;
|
|
||||||
}
|
|
||||||
|
|
||||||
declare module 'react-markdown/lib/plugins/naive-html' {
|
|
||||||
declare module.exports: any;
|
|
||||||
}
|
|
||||||
|
|
||||||
declare module 'react-markdown/lib/react-markdown' {
|
|
||||||
declare module.exports: any;
|
|
||||||
}
|
|
||||||
|
|
||||||
declare module 'react-markdown/lib/renderers' {
|
|
||||||
declare module.exports: any;
|
|
||||||
}
|
|
||||||
|
|
||||||
declare module 'react-markdown/lib/symbols' {
|
|
||||||
declare module.exports: any;
|
|
||||||
}
|
|
||||||
|
|
||||||
declare module 'react-markdown/lib/uri-transformer' {
|
|
||||||
declare module.exports: any;
|
|
||||||
}
|
|
||||||
|
|
||||||
declare module 'react-markdown/lib/with-html' {
|
|
||||||
declare module.exports: any;
|
|
||||||
}
|
|
||||||
|
|
||||||
declare module 'react-markdown/lib/wrap-table-rows' {
|
|
||||||
declare module.exports: any;
|
|
||||||
}
|
|
||||||
|
|
||||||
declare module 'react-markdown/plugins/html-parser' {
|
|
||||||
declare module.exports: any;
|
|
||||||
}
|
|
||||||
|
|
||||||
declare module 'react-markdown/umd/react-markdown' {
|
|
||||||
declare module.exports: any;
|
|
||||||
}
|
|
||||||
|
|
||||||
declare module 'react-markdown/with-html' {
|
|
||||||
declare module.exports: any;
|
|
||||||
}
|
|
||||||
|
|
||||||
// Filename aliases
|
|
||||||
declare module 'react-markdown/lib/ast-to-react.js' {
|
|
||||||
declare module.exports: $Exports<'react-markdown/lib/ast-to-react'>;
|
|
||||||
}
|
|
||||||
declare module 'react-markdown/lib/get-definitions.js' {
|
|
||||||
declare module.exports: $Exports<'react-markdown/lib/get-definitions'>;
|
|
||||||
}
|
|
||||||
declare module 'react-markdown/lib/plugins/disallow-node.js' {
|
|
||||||
declare module.exports: $Exports<'react-markdown/lib/plugins/disallow-node'>;
|
|
||||||
}
|
|
||||||
declare module 'react-markdown/lib/plugins/html-parser.js' {
|
|
||||||
declare module.exports: $Exports<'react-markdown/lib/plugins/html-parser'>;
|
|
||||||
}
|
|
||||||
declare module 'react-markdown/lib/plugins/naive-html.js' {
|
|
||||||
declare module.exports: $Exports<'react-markdown/lib/plugins/naive-html'>;
|
|
||||||
}
|
|
||||||
declare module 'react-markdown/lib/react-markdown.js' {
|
|
||||||
declare module.exports: $Exports<'react-markdown/lib/react-markdown'>;
|
|
||||||
}
|
|
||||||
declare module 'react-markdown/lib/renderers.js' {
|
|
||||||
declare module.exports: $Exports<'react-markdown/lib/renderers'>;
|
|
||||||
}
|
|
||||||
declare module 'react-markdown/lib/symbols.js' {
|
|
||||||
declare module.exports: $Exports<'react-markdown/lib/symbols'>;
|
|
||||||
}
|
|
||||||
declare module 'react-markdown/lib/uri-transformer.js' {
|
|
||||||
declare module.exports: $Exports<'react-markdown/lib/uri-transformer'>;
|
|
||||||
}
|
|
||||||
declare module 'react-markdown/lib/with-html.js' {
|
|
||||||
declare module.exports: $Exports<'react-markdown/lib/with-html'>;
|
|
||||||
}
|
|
||||||
declare module 'react-markdown/lib/wrap-table-rows.js' {
|
|
||||||
declare module.exports: $Exports<'react-markdown/lib/wrap-table-rows'>;
|
|
||||||
}
|
|
||||||
declare module 'react-markdown/plugins/html-parser.js' {
|
|
||||||
declare module.exports: $Exports<'react-markdown/plugins/html-parser'>;
|
|
||||||
}
|
|
||||||
declare module 'react-markdown/umd/react-markdown.js' {
|
|
||||||
declare module.exports: $Exports<'react-markdown/umd/react-markdown'>;
|
|
||||||
}
|
|
||||||
declare module 'react-markdown/with-html.js' {
|
|
||||||
declare module.exports: $Exports<'react-markdown/with-html'>;
|
|
||||||
}
|
|
||||||
@@ -1,182 +0,0 @@
|
|||||||
// flow-typed signature: 0bc486c8fc04d0bb37efa138223e4f67
|
|
||||||
// flow-typed version: c6154227d1/react-router-dom_v4.x.x/flow_>=v0.104.x
|
|
||||||
|
|
||||||
declare module "react-router-dom" {
|
|
||||||
declare export var BrowserRouter: React$ComponentType<{|
|
|
||||||
basename?: string,
|
|
||||||
forceRefresh?: boolean,
|
|
||||||
getUserConfirmation?: GetUserConfirmation,
|
|
||||||
keyLength?: number,
|
|
||||||
children?: React$Node
|
|
||||||
|}>
|
|
||||||
|
|
||||||
declare export var HashRouter: React$ComponentType<{|
|
|
||||||
basename?: string,
|
|
||||||
getUserConfirmation?: GetUserConfirmation,
|
|
||||||
hashType?: "slash" | "noslash" | "hashbang",
|
|
||||||
children?: React$Node
|
|
||||||
|}>
|
|
||||||
|
|
||||||
declare export var Link: React$ComponentType<{
|
|
||||||
className?: string,
|
|
||||||
to: string | LocationShape,
|
|
||||||
replace?: boolean,
|
|
||||||
children?: React$Node,
|
|
||||||
...
|
|
||||||
}>
|
|
||||||
|
|
||||||
declare export var NavLink: React$ComponentType<{
|
|
||||||
to: string | LocationShape,
|
|
||||||
activeClassName?: string,
|
|
||||||
className?: string,
|
|
||||||
activeStyle?: Object,
|
|
||||||
style?: Object,
|
|
||||||
isActive?: (match: Match, location: Location) => boolean,
|
|
||||||
children?: React$Node,
|
|
||||||
exact?: boolean,
|
|
||||||
strict?: boolean,
|
|
||||||
...
|
|
||||||
}>
|
|
||||||
|
|
||||||
// NOTE: Below are duplicated from react-router. If updating these, please
|
|
||||||
// update the react-router and react-router-native types as well.
|
|
||||||
declare export type Location = {
|
|
||||||
pathname: string,
|
|
||||||
search: string,
|
|
||||||
hash: string,
|
|
||||||
state?: any,
|
|
||||||
key?: string,
|
|
||||||
...
|
|
||||||
};
|
|
||||||
|
|
||||||
declare export type LocationShape = {
|
|
||||||
pathname?: string,
|
|
||||||
search?: string,
|
|
||||||
hash?: string,
|
|
||||||
state?: any,
|
|
||||||
...
|
|
||||||
};
|
|
||||||
|
|
||||||
declare export type HistoryAction = "PUSH" | "REPLACE" | "POP";
|
|
||||||
|
|
||||||
declare export type RouterHistory = {
|
|
||||||
length: number,
|
|
||||||
location: Location,
|
|
||||||
action: HistoryAction,
|
|
||||||
listen(
|
|
||||||
callback: (location: Location, action: HistoryAction) => void
|
|
||||||
): () => void,
|
|
||||||
push(path: string | LocationShape, state?: any): void,
|
|
||||||
replace(path: string | LocationShape, state?: any): void,
|
|
||||||
go(n: number): void,
|
|
||||||
goBack(): void,
|
|
||||||
goForward(): void,
|
|
||||||
canGo?: (n: number) => boolean,
|
|
||||||
block(
|
|
||||||
callback: string | (location: Location, action: HistoryAction) => ?string
|
|
||||||
): () => void,
|
|
||||||
// createMemoryHistory
|
|
||||||
index?: number,
|
|
||||||
entries?: Array<Location>,
|
|
||||||
...
|
|
||||||
};
|
|
||||||
|
|
||||||
declare export type Match = {
|
|
||||||
params: { [key: string]: ?string, ... },
|
|
||||||
isExact: boolean,
|
|
||||||
path: string,
|
|
||||||
url: string,
|
|
||||||
...
|
|
||||||
};
|
|
||||||
|
|
||||||
declare export type ContextRouter = {|
|
|
||||||
history: RouterHistory,
|
|
||||||
location: Location,
|
|
||||||
match: Match,
|
|
||||||
staticContext?: StaticRouterContext
|
|
||||||
|};
|
|
||||||
|
|
||||||
declare type ContextRouterVoid = {
|
|
||||||
history: RouterHistory | void,
|
|
||||||
location: Location | void,
|
|
||||||
match: Match | void,
|
|
||||||
staticContext?: StaticRouterContext | void,
|
|
||||||
...
|
|
||||||
};
|
|
||||||
|
|
||||||
declare export type GetUserConfirmation = (
|
|
||||||
message: string,
|
|
||||||
callback: (confirmed: boolean) => void
|
|
||||||
) => void;
|
|
||||||
|
|
||||||
declare export type StaticRouterContext = { url?: string, ... };
|
|
||||||
|
|
||||||
declare export var StaticRouter: React$ComponentType<{|
|
|
||||||
basename?: string,
|
|
||||||
location?: string | Location,
|
|
||||||
context: StaticRouterContext,
|
|
||||||
children?: React$Node
|
|
||||||
|}>
|
|
||||||
|
|
||||||
declare export var MemoryRouter: React$ComponentType<{|
|
|
||||||
initialEntries?: Array<LocationShape | string>,
|
|
||||||
initialIndex?: number,
|
|
||||||
getUserConfirmation?: GetUserConfirmation,
|
|
||||||
keyLength?: number,
|
|
||||||
children?: React$Node
|
|
||||||
|}>
|
|
||||||
|
|
||||||
declare export var Router: React$ComponentType<{|
|
|
||||||
history: RouterHistory,
|
|
||||||
children?: React$Node
|
|
||||||
|}>
|
|
||||||
|
|
||||||
declare export var Prompt: React$ComponentType<{|
|
|
||||||
message: string | ((location: Location) => string | boolean),
|
|
||||||
when?: boolean
|
|
||||||
|}>
|
|
||||||
|
|
||||||
declare export var Redirect: React$ComponentType<{|
|
|
||||||
to: string | LocationShape,
|
|
||||||
push?: boolean,
|
|
||||||
from?: string,
|
|
||||||
exact?: boolean,
|
|
||||||
strict?: boolean
|
|
||||||
|}>
|
|
||||||
|
|
||||||
declare export var Route: React$ComponentType<{|
|
|
||||||
component?: React$ComponentType<*>,
|
|
||||||
render?: (router: ContextRouter) => React$Node,
|
|
||||||
children?: React$ComponentType<ContextRouter> | React$Node,
|
|
||||||
path?: string | Array<string>,
|
|
||||||
exact?: boolean,
|
|
||||||
strict?: boolean,
|
|
||||||
location?: LocationShape,
|
|
||||||
sensitive?: boolean
|
|
||||||
|}>
|
|
||||||
|
|
||||||
declare export var Switch: React$ComponentType<{|
|
|
||||||
children?: React$Node,
|
|
||||||
location?: Location
|
|
||||||
|}>
|
|
||||||
|
|
||||||
declare export function withRouter<Props: {...}, Component: React$ComponentType<Props>>(
|
|
||||||
WrappedComponent: Component
|
|
||||||
): React$ComponentType<$Diff<React$ElementConfig<Component>, ContextRouterVoid>>;
|
|
||||||
|
|
||||||
declare type MatchPathOptions = {
|
|
||||||
path?: string,
|
|
||||||
exact?: boolean,
|
|
||||||
sensitive?: boolean,
|
|
||||||
strict?: boolean,
|
|
||||||
...
|
|
||||||
};
|
|
||||||
|
|
||||||
declare export function matchPath(
|
|
||||||
pathname: string,
|
|
||||||
options?: MatchPathOptions | string,
|
|
||||||
parent?: Match
|
|
||||||
): null | Match;
|
|
||||||
|
|
||||||
declare export function generatePath(pattern?: string, params?: Object): string;
|
|
||||||
}
|
|
||||||
@@ -1,56 +0,0 @@
|
|||||||
// flow-typed signature: 030a0d51d7da2db8716b0c796bcd8992
|
|
||||||
// flow-typed version: <<STUB>>/react-router-enzyme-context_v1.2.0/flow_v0.109.0
|
|
||||||
|
|
||||||
/**
|
|
||||||
* This is an autogenerated libdef stub for:
|
|
||||||
*
|
|
||||||
* 'react-router-enzyme-context'
|
|
||||||
*
|
|
||||||
* Fill this stub out by replacing all the `any` types.
|
|
||||||
*
|
|
||||||
* Once filled out, we encourage you to share your work with the
|
|
||||||
* community by sending a pull request to:
|
|
||||||
* https://github.com/flowtype/flow-typed
|
|
||||||
*/
|
|
||||||
|
|
||||||
declare module 'react-router-enzyme-context' {
|
|
||||||
declare module.exports: any;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* We include stubs for each file inside this npm package in case you need to
|
|
||||||
* require those files directly. Feel free to delete any files that aren't
|
|
||||||
* needed.
|
|
||||||
*/
|
|
||||||
declare module 'react-router-enzyme-context/dist/react-router-enzyme-context.cjs' {
|
|
||||||
declare module.exports: any;
|
|
||||||
}
|
|
||||||
|
|
||||||
declare module 'react-router-enzyme-context/dist/react-router-enzyme-context.esm' {
|
|
||||||
declare module.exports: any;
|
|
||||||
}
|
|
||||||
|
|
||||||
declare module 'react-router-enzyme-context/rollup.config' {
|
|
||||||
declare module.exports: any;
|
|
||||||
}
|
|
||||||
|
|
||||||
declare module 'react-router-enzyme-context/src' {
|
|
||||||
declare module.exports: any;
|
|
||||||
}
|
|
||||||
|
|
||||||
// Filename aliases
|
|
||||||
declare module 'react-router-enzyme-context/dist/react-router-enzyme-context.cjs.js' {
|
|
||||||
declare module.exports: $Exports<'react-router-enzyme-context/dist/react-router-enzyme-context.cjs'>;
|
|
||||||
}
|
|
||||||
declare module 'react-router-enzyme-context/dist/react-router-enzyme-context.esm.js' {
|
|
||||||
declare module.exports: $Exports<'react-router-enzyme-context/dist/react-router-enzyme-context.esm'>;
|
|
||||||
}
|
|
||||||
declare module 'react-router-enzyme-context/rollup.config.js' {
|
|
||||||
declare module.exports: $Exports<'react-router-enzyme-context/rollup.config'>;
|
|
||||||
}
|
|
||||||
declare module 'react-router-enzyme-context/src/index' {
|
|
||||||
declare module.exports: $Exports<'react-router-enzyme-context/src'>;
|
|
||||||
}
|
|
||||||
declare module 'react-router-enzyme-context/src/index.js' {
|
|
||||||
declare module.exports: $Exports<'react-router-enzyme-context/src'>;
|
|
||||||
}
|
|
||||||
@@ -1,726 +0,0 @@
|
|||||||
// flow-typed signature: 0b6edc6705aa28ab46a24d08242af068
|
|
||||||
// flow-typed version: <<STUB>>/react-select_v2.4.4/flow_v0.109.0
|
|
||||||
|
|
||||||
/**
|
|
||||||
* This is an autogenerated libdef stub for:
|
|
||||||
*
|
|
||||||
* 'react-select'
|
|
||||||
*
|
|
||||||
* Fill this stub out by replacing all the `any` types.
|
|
||||||
*
|
|
||||||
* Once filled out, we encourage you to share your work with the
|
|
||||||
* community by sending a pull request to:
|
|
||||||
* https://github.com/flowtype/flow-typed
|
|
||||||
*/
|
|
||||||
|
|
||||||
declare module 'react-select' {
|
|
||||||
declare module.exports: any;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* We include stubs for each file inside this npm package in case you need to
|
|
||||||
* require those files directly. Feel free to delete any files that aren't
|
|
||||||
* needed.
|
|
||||||
*/
|
|
||||||
declare module 'react-select/dist/react-select.esm' {
|
|
||||||
declare module.exports: any;
|
|
||||||
}
|
|
||||||
|
|
||||||
declare module 'react-select/dist/react-select' {
|
|
||||||
declare module.exports: any;
|
|
||||||
}
|
|
||||||
|
|
||||||
declare module 'react-select/dist/react-select.min' {
|
|
||||||
declare module.exports: any;
|
|
||||||
}
|
|
||||||
|
|
||||||
declare module 'react-select/lib/accessibility' {
|
|
||||||
declare module.exports: any;
|
|
||||||
}
|
|
||||||
|
|
||||||
declare module 'react-select/lib/animated' {
|
|
||||||
declare module.exports: any;
|
|
||||||
}
|
|
||||||
|
|
||||||
declare module 'react-select/lib/animated/Input' {
|
|
||||||
declare module.exports: any;
|
|
||||||
}
|
|
||||||
|
|
||||||
declare module 'react-select/lib/animated/MultiValue' {
|
|
||||||
declare module.exports: any;
|
|
||||||
}
|
|
||||||
|
|
||||||
declare module 'react-select/lib/animated/Placeholder' {
|
|
||||||
declare module.exports: any;
|
|
||||||
}
|
|
||||||
|
|
||||||
declare module 'react-select/lib/animated/SingleValue' {
|
|
||||||
declare module.exports: any;
|
|
||||||
}
|
|
||||||
|
|
||||||
declare module 'react-select/lib/animated/transitions' {
|
|
||||||
declare module.exports: any;
|
|
||||||
}
|
|
||||||
|
|
||||||
declare module 'react-select/lib/animated/ValueContainer' {
|
|
||||||
declare module.exports: any;
|
|
||||||
}
|
|
||||||
|
|
||||||
declare module 'react-select/lib/Async' {
|
|
||||||
declare module.exports: any;
|
|
||||||
}
|
|
||||||
|
|
||||||
declare module 'react-select/lib/AsyncCreatable' {
|
|
||||||
declare module.exports: any;
|
|
||||||
}
|
|
||||||
|
|
||||||
declare module 'react-select/lib/builtins' {
|
|
||||||
declare module.exports: any;
|
|
||||||
}
|
|
||||||
|
|
||||||
declare module 'react-select/lib/components/containers' {
|
|
||||||
declare module.exports: any;
|
|
||||||
}
|
|
||||||
|
|
||||||
declare module 'react-select/lib/components/Control' {
|
|
||||||
declare module.exports: any;
|
|
||||||
}
|
|
||||||
|
|
||||||
declare module 'react-select/lib/components/Group' {
|
|
||||||
declare module.exports: any;
|
|
||||||
}
|
|
||||||
|
|
||||||
declare module 'react-select/lib/components' {
|
|
||||||
declare module.exports: any;
|
|
||||||
}
|
|
||||||
|
|
||||||
declare module 'react-select/lib/components/indicators' {
|
|
||||||
declare module.exports: any;
|
|
||||||
}
|
|
||||||
|
|
||||||
declare module 'react-select/lib/components/Input' {
|
|
||||||
declare module.exports: any;
|
|
||||||
}
|
|
||||||
|
|
||||||
declare module 'react-select/lib/components/Menu' {
|
|
||||||
declare module.exports: any;
|
|
||||||
}
|
|
||||||
|
|
||||||
declare module 'react-select/lib/components/MultiValue' {
|
|
||||||
declare module.exports: any;
|
|
||||||
}
|
|
||||||
|
|
||||||
declare module 'react-select/lib/components/Option' {
|
|
||||||
declare module.exports: any;
|
|
||||||
}
|
|
||||||
|
|
||||||
declare module 'react-select/lib/components/Placeholder' {
|
|
||||||
declare module.exports: any;
|
|
||||||
}
|
|
||||||
|
|
||||||
declare module 'react-select/lib/components/SingleValue' {
|
|
||||||
declare module.exports: any;
|
|
||||||
}
|
|
||||||
|
|
||||||
declare module 'react-select/lib/Creatable' {
|
|
||||||
declare module.exports: any;
|
|
||||||
}
|
|
||||||
|
|
||||||
declare module 'react-select/lib/diacritics' {
|
|
||||||
declare module.exports: any;
|
|
||||||
}
|
|
||||||
|
|
||||||
declare module 'react-select/lib/filters' {
|
|
||||||
declare module.exports: any;
|
|
||||||
}
|
|
||||||
|
|
||||||
declare module 'react-select/lib' {
|
|
||||||
declare module.exports: any;
|
|
||||||
}
|
|
||||||
|
|
||||||
declare module 'react-select/lib/index.umd' {
|
|
||||||
declare module.exports: any;
|
|
||||||
}
|
|
||||||
|
|
||||||
declare module 'react-select/lib/internal/A11yText' {
|
|
||||||
declare module.exports: any;
|
|
||||||
}
|
|
||||||
|
|
||||||
declare module 'react-select/lib/internal/DummyInput' {
|
|
||||||
declare module.exports: any;
|
|
||||||
}
|
|
||||||
|
|
||||||
declare module 'react-select/lib/internal' {
|
|
||||||
declare module.exports: any;
|
|
||||||
}
|
|
||||||
|
|
||||||
declare module 'react-select/lib/internal/NodeResolver' {
|
|
||||||
declare module.exports: any;
|
|
||||||
}
|
|
||||||
|
|
||||||
declare module 'react-select/lib/internal/react-fast-compare' {
|
|
||||||
declare module.exports: any;
|
|
||||||
}
|
|
||||||
|
|
||||||
declare module 'react-select/lib/internal/ScrollBlock' {
|
|
||||||
declare module.exports: any;
|
|
||||||
}
|
|
||||||
|
|
||||||
declare module 'react-select/lib/internal/ScrollCaptor' {
|
|
||||||
declare module.exports: any;
|
|
||||||
}
|
|
||||||
|
|
||||||
declare module 'react-select/lib/internal/ScrollLock/constants' {
|
|
||||||
declare module.exports: any;
|
|
||||||
}
|
|
||||||
|
|
||||||
declare module 'react-select/lib/internal/ScrollLock' {
|
|
||||||
declare module.exports: any;
|
|
||||||
}
|
|
||||||
|
|
||||||
declare module 'react-select/lib/internal/ScrollLock/utils' {
|
|
||||||
declare module.exports: any;
|
|
||||||
}
|
|
||||||
|
|
||||||
declare module 'react-select/lib/Select' {
|
|
||||||
declare module.exports: any;
|
|
||||||
}
|
|
||||||
|
|
||||||
declare module 'react-select/lib/stateManager' {
|
|
||||||
declare module.exports: any;
|
|
||||||
}
|
|
||||||
|
|
||||||
declare module 'react-select/lib/styles' {
|
|
||||||
declare module.exports: any;
|
|
||||||
}
|
|
||||||
|
|
||||||
declare module 'react-select/lib/theme' {
|
|
||||||
declare module.exports: any;
|
|
||||||
}
|
|
||||||
|
|
||||||
declare module 'react-select/lib/types' {
|
|
||||||
declare module.exports: any;
|
|
||||||
}
|
|
||||||
|
|
||||||
declare module 'react-select/lib/utils' {
|
|
||||||
declare module.exports: any;
|
|
||||||
}
|
|
||||||
|
|
||||||
declare module 'react-select/src/__tests__/Async.test' {
|
|
||||||
declare module.exports: any;
|
|
||||||
}
|
|
||||||
|
|
||||||
declare module 'react-select/src/__tests__/AsyncCreatable.test' {
|
|
||||||
declare module.exports: any;
|
|
||||||
}
|
|
||||||
|
|
||||||
declare module 'react-select/src/__tests__/constants' {
|
|
||||||
declare module.exports: any;
|
|
||||||
}
|
|
||||||
|
|
||||||
declare module 'react-select/src/__tests__/Creatable.test' {
|
|
||||||
declare module.exports: any;
|
|
||||||
}
|
|
||||||
|
|
||||||
declare module 'react-select/src/__tests__/Select.test' {
|
|
||||||
declare module.exports: any;
|
|
||||||
}
|
|
||||||
|
|
||||||
declare module 'react-select/src/__tests__/StateManaged.test' {
|
|
||||||
declare module.exports: any;
|
|
||||||
}
|
|
||||||
|
|
||||||
declare module 'react-select/src/accessibility' {
|
|
||||||
declare module.exports: any;
|
|
||||||
}
|
|
||||||
|
|
||||||
declare module 'react-select/src/animated' {
|
|
||||||
declare module.exports: any;
|
|
||||||
}
|
|
||||||
|
|
||||||
declare module 'react-select/src/animated/Input' {
|
|
||||||
declare module.exports: any;
|
|
||||||
}
|
|
||||||
|
|
||||||
declare module 'react-select/src/animated/MultiValue' {
|
|
||||||
declare module.exports: any;
|
|
||||||
}
|
|
||||||
|
|
||||||
declare module 'react-select/src/animated/Placeholder' {
|
|
||||||
declare module.exports: any;
|
|
||||||
}
|
|
||||||
|
|
||||||
declare module 'react-select/src/animated/SingleValue' {
|
|
||||||
declare module.exports: any;
|
|
||||||
}
|
|
||||||
|
|
||||||
declare module 'react-select/src/animated/transitions' {
|
|
||||||
declare module.exports: any;
|
|
||||||
}
|
|
||||||
|
|
||||||
declare module 'react-select/src/animated/ValueContainer' {
|
|
||||||
declare module.exports: any;
|
|
||||||
}
|
|
||||||
|
|
||||||
declare module 'react-select/src/Async' {
|
|
||||||
declare module.exports: any;
|
|
||||||
}
|
|
||||||
|
|
||||||
declare module 'react-select/src/AsyncCreatable' {
|
|
||||||
declare module.exports: any;
|
|
||||||
}
|
|
||||||
|
|
||||||
declare module 'react-select/src/builtins' {
|
|
||||||
declare module.exports: any;
|
|
||||||
}
|
|
||||||
|
|
||||||
declare module 'react-select/src/components/containers' {
|
|
||||||
declare module.exports: any;
|
|
||||||
}
|
|
||||||
|
|
||||||
declare module 'react-select/src/components/Control' {
|
|
||||||
declare module.exports: any;
|
|
||||||
}
|
|
||||||
|
|
||||||
declare module 'react-select/src/components/Group' {
|
|
||||||
declare module.exports: any;
|
|
||||||
}
|
|
||||||
|
|
||||||
declare module 'react-select/src/components' {
|
|
||||||
declare module.exports: any;
|
|
||||||
}
|
|
||||||
|
|
||||||
declare module 'react-select/src/components/indicators' {
|
|
||||||
declare module.exports: any;
|
|
||||||
}
|
|
||||||
|
|
||||||
declare module 'react-select/src/components/Input' {
|
|
||||||
declare module.exports: any;
|
|
||||||
}
|
|
||||||
|
|
||||||
declare module 'react-select/src/components/Menu' {
|
|
||||||
declare module.exports: any;
|
|
||||||
}
|
|
||||||
|
|
||||||
declare module 'react-select/src/components/MultiValue' {
|
|
||||||
declare module.exports: any;
|
|
||||||
}
|
|
||||||
|
|
||||||
declare module 'react-select/src/components/Option' {
|
|
||||||
declare module.exports: any;
|
|
||||||
}
|
|
||||||
|
|
||||||
declare module 'react-select/src/components/Placeholder' {
|
|
||||||
declare module.exports: any;
|
|
||||||
}
|
|
||||||
|
|
||||||
declare module 'react-select/src/components/SingleValue' {
|
|
||||||
declare module.exports: any;
|
|
||||||
}
|
|
||||||
|
|
||||||
declare module 'react-select/src/Creatable' {
|
|
||||||
declare module.exports: any;
|
|
||||||
}
|
|
||||||
|
|
||||||
declare module 'react-select/src/diacritics' {
|
|
||||||
declare module.exports: any;
|
|
||||||
}
|
|
||||||
|
|
||||||
declare module 'react-select/src/filters' {
|
|
||||||
declare module.exports: any;
|
|
||||||
}
|
|
||||||
|
|
||||||
declare module 'react-select/src' {
|
|
||||||
declare module.exports: any;
|
|
||||||
}
|
|
||||||
|
|
||||||
declare module 'react-select/src/index.umd' {
|
|
||||||
declare module.exports: any;
|
|
||||||
}
|
|
||||||
|
|
||||||
declare module 'react-select/src/internal/A11yText' {
|
|
||||||
declare module.exports: any;
|
|
||||||
}
|
|
||||||
|
|
||||||
declare module 'react-select/src/internal/DummyInput' {
|
|
||||||
declare module.exports: any;
|
|
||||||
}
|
|
||||||
|
|
||||||
declare module 'react-select/src/internal' {
|
|
||||||
declare module.exports: any;
|
|
||||||
}
|
|
||||||
|
|
||||||
declare module 'react-select/src/internal/NodeResolver' {
|
|
||||||
declare module.exports: any;
|
|
||||||
}
|
|
||||||
|
|
||||||
declare module 'react-select/src/internal/react-fast-compare' {
|
|
||||||
declare module.exports: any;
|
|
||||||
}
|
|
||||||
|
|
||||||
declare module 'react-select/src/internal/ScrollBlock' {
|
|
||||||
declare module.exports: any;
|
|
||||||
}
|
|
||||||
|
|
||||||
declare module 'react-select/src/internal/ScrollCaptor' {
|
|
||||||
declare module.exports: any;
|
|
||||||
}
|
|
||||||
|
|
||||||
declare module 'react-select/src/internal/ScrollLock/constants' {
|
|
||||||
declare module.exports: any;
|
|
||||||
}
|
|
||||||
|
|
||||||
declare module 'react-select/src/internal/ScrollLock' {
|
|
||||||
declare module.exports: any;
|
|
||||||
}
|
|
||||||
|
|
||||||
declare module 'react-select/src/internal/ScrollLock/utils' {
|
|
||||||
declare module.exports: any;
|
|
||||||
}
|
|
||||||
|
|
||||||
declare module 'react-select/src/Select' {
|
|
||||||
declare module.exports: any;
|
|
||||||
}
|
|
||||||
|
|
||||||
declare module 'react-select/src/stateManager' {
|
|
||||||
declare module.exports: any;
|
|
||||||
}
|
|
||||||
|
|
||||||
declare module 'react-select/src/styles' {
|
|
||||||
declare module.exports: any;
|
|
||||||
}
|
|
||||||
|
|
||||||
declare module 'react-select/src/theme' {
|
|
||||||
declare module.exports: any;
|
|
||||||
}
|
|
||||||
|
|
||||||
declare module 'react-select/src/types' {
|
|
||||||
declare module.exports: any;
|
|
||||||
}
|
|
||||||
|
|
||||||
declare module 'react-select/src/utils' {
|
|
||||||
declare module.exports: any;
|
|
||||||
}
|
|
||||||
|
|
||||||
// Filename aliases
|
|
||||||
declare module 'react-select/dist/react-select.esm.js' {
|
|
||||||
declare module.exports: $Exports<'react-select/dist/react-select.esm'>;
|
|
||||||
}
|
|
||||||
declare module 'react-select/dist/react-select.js' {
|
|
||||||
declare module.exports: $Exports<'react-select/dist/react-select'>;
|
|
||||||
}
|
|
||||||
declare module 'react-select/dist/react-select.min.js' {
|
|
||||||
declare module.exports: $Exports<'react-select/dist/react-select.min'>;
|
|
||||||
}
|
|
||||||
declare module 'react-select/lib/accessibility/index' {
|
|
||||||
declare module.exports: $Exports<'react-select/lib/accessibility'>;
|
|
||||||
}
|
|
||||||
declare module 'react-select/lib/accessibility/index.js' {
|
|
||||||
declare module.exports: $Exports<'react-select/lib/accessibility'>;
|
|
||||||
}
|
|
||||||
declare module 'react-select/lib/animated/index' {
|
|
||||||
declare module.exports: $Exports<'react-select/lib/animated'>;
|
|
||||||
}
|
|
||||||
declare module 'react-select/lib/animated/index.js' {
|
|
||||||
declare module.exports: $Exports<'react-select/lib/animated'>;
|
|
||||||
}
|
|
||||||
declare module 'react-select/lib/animated/Input.js' {
|
|
||||||
declare module.exports: $Exports<'react-select/lib/animated/Input'>;
|
|
||||||
}
|
|
||||||
declare module 'react-select/lib/animated/MultiValue.js' {
|
|
||||||
declare module.exports: $Exports<'react-select/lib/animated/MultiValue'>;
|
|
||||||
}
|
|
||||||
declare module 'react-select/lib/animated/Placeholder.js' {
|
|
||||||
declare module.exports: $Exports<'react-select/lib/animated/Placeholder'>;
|
|
||||||
}
|
|
||||||
declare module 'react-select/lib/animated/SingleValue.js' {
|
|
||||||
declare module.exports: $Exports<'react-select/lib/animated/SingleValue'>;
|
|
||||||
}
|
|
||||||
declare module 'react-select/lib/animated/transitions.js' {
|
|
||||||
declare module.exports: $Exports<'react-select/lib/animated/transitions'>;
|
|
||||||
}
|
|
||||||
declare module 'react-select/lib/animated/ValueContainer.js' {
|
|
||||||
declare module.exports: $Exports<'react-select/lib/animated/ValueContainer'>;
|
|
||||||
}
|
|
||||||
declare module 'react-select/lib/Async.js' {
|
|
||||||
declare module.exports: $Exports<'react-select/lib/Async'>;
|
|
||||||
}
|
|
||||||
declare module 'react-select/lib/AsyncCreatable.js' {
|
|
||||||
declare module.exports: $Exports<'react-select/lib/AsyncCreatable'>;
|
|
||||||
}
|
|
||||||
declare module 'react-select/lib/builtins.js' {
|
|
||||||
declare module.exports: $Exports<'react-select/lib/builtins'>;
|
|
||||||
}
|
|
||||||
declare module 'react-select/lib/components/containers.js' {
|
|
||||||
declare module.exports: $Exports<'react-select/lib/components/containers'>;
|
|
||||||
}
|
|
||||||
declare module 'react-select/lib/components/Control.js' {
|
|
||||||
declare module.exports: $Exports<'react-select/lib/components/Control'>;
|
|
||||||
}
|
|
||||||
declare module 'react-select/lib/components/Group.js' {
|
|
||||||
declare module.exports: $Exports<'react-select/lib/components/Group'>;
|
|
||||||
}
|
|
||||||
declare module 'react-select/lib/components/index' {
|
|
||||||
declare module.exports: $Exports<'react-select/lib/components'>;
|
|
||||||
}
|
|
||||||
declare module 'react-select/lib/components/index.js' {
|
|
||||||
declare module.exports: $Exports<'react-select/lib/components'>;
|
|
||||||
}
|
|
||||||
declare module 'react-select/lib/components/indicators.js' {
|
|
||||||
declare module.exports: $Exports<'react-select/lib/components/indicators'>;
|
|
||||||
}
|
|
||||||
declare module 'react-select/lib/components/Input.js' {
|
|
||||||
declare module.exports: $Exports<'react-select/lib/components/Input'>;
|
|
||||||
}
|
|
||||||
declare module 'react-select/lib/components/Menu.js' {
|
|
||||||
declare module.exports: $Exports<'react-select/lib/components/Menu'>;
|
|
||||||
}
|
|
||||||
declare module 'react-select/lib/components/MultiValue.js' {
|
|
||||||
declare module.exports: $Exports<'react-select/lib/components/MultiValue'>;
|
|
||||||
}
|
|
||||||
declare module 'react-select/lib/components/Option.js' {
|
|
||||||
declare module.exports: $Exports<'react-select/lib/components/Option'>;
|
|
||||||
}
|
|
||||||
declare module 'react-select/lib/components/Placeholder.js' {
|
|
||||||
declare module.exports: $Exports<'react-select/lib/components/Placeholder'>;
|
|
||||||
}
|
|
||||||
declare module 'react-select/lib/components/SingleValue.js' {
|
|
||||||
declare module.exports: $Exports<'react-select/lib/components/SingleValue'>;
|
|
||||||
}
|
|
||||||
declare module 'react-select/lib/Creatable.js' {
|
|
||||||
declare module.exports: $Exports<'react-select/lib/Creatable'>;
|
|
||||||
}
|
|
||||||
declare module 'react-select/lib/diacritics.js' {
|
|
||||||
declare module.exports: $Exports<'react-select/lib/diacritics'>;
|
|
||||||
}
|
|
||||||
declare module 'react-select/lib/filters.js' {
|
|
||||||
declare module.exports: $Exports<'react-select/lib/filters'>;
|
|
||||||
}
|
|
||||||
declare module 'react-select/lib/index' {
|
|
||||||
declare module.exports: $Exports<'react-select/lib'>;
|
|
||||||
}
|
|
||||||
declare module 'react-select/lib/index.js' {
|
|
||||||
declare module.exports: $Exports<'react-select/lib'>;
|
|
||||||
}
|
|
||||||
declare module 'react-select/lib/index.umd.js' {
|
|
||||||
declare module.exports: $Exports<'react-select/lib/index.umd'>;
|
|
||||||
}
|
|
||||||
declare module 'react-select/lib/internal/A11yText.js' {
|
|
||||||
declare module.exports: $Exports<'react-select/lib/internal/A11yText'>;
|
|
||||||
}
|
|
||||||
declare module 'react-select/lib/internal/DummyInput.js' {
|
|
||||||
declare module.exports: $Exports<'react-select/lib/internal/DummyInput'>;
|
|
||||||
}
|
|
||||||
declare module 'react-select/lib/internal/index' {
|
|
||||||
declare module.exports: $Exports<'react-select/lib/internal'>;
|
|
||||||
}
|
|
||||||
declare module 'react-select/lib/internal/index.js' {
|
|
||||||
declare module.exports: $Exports<'react-select/lib/internal'>;
|
|
||||||
}
|
|
||||||
declare module 'react-select/lib/internal/NodeResolver.js' {
|
|
||||||
declare module.exports: $Exports<'react-select/lib/internal/NodeResolver'>;
|
|
||||||
}
|
|
||||||
declare module 'react-select/lib/internal/react-fast-compare.js' {
|
|
||||||
declare module.exports: $Exports<'react-select/lib/internal/react-fast-compare'>;
|
|
||||||
}
|
|
||||||
declare module 'react-select/lib/internal/ScrollBlock.js' {
|
|
||||||
declare module.exports: $Exports<'react-select/lib/internal/ScrollBlock'>;
|
|
||||||
}
|
|
||||||
declare module 'react-select/lib/internal/ScrollCaptor.js' {
|
|
||||||
declare module.exports: $Exports<'react-select/lib/internal/ScrollCaptor'>;
|
|
||||||
}
|
|
||||||
declare module 'react-select/lib/internal/ScrollLock/constants.js' {
|
|
||||||
declare module.exports: $Exports<'react-select/lib/internal/ScrollLock/constants'>;
|
|
||||||
}
|
|
||||||
declare module 'react-select/lib/internal/ScrollLock/index' {
|
|
||||||
declare module.exports: $Exports<'react-select/lib/internal/ScrollLock'>;
|
|
||||||
}
|
|
||||||
declare module 'react-select/lib/internal/ScrollLock/index.js' {
|
|
||||||
declare module.exports: $Exports<'react-select/lib/internal/ScrollLock'>;
|
|
||||||
}
|
|
||||||
declare module 'react-select/lib/internal/ScrollLock/utils.js' {
|
|
||||||
declare module.exports: $Exports<'react-select/lib/internal/ScrollLock/utils'>;
|
|
||||||
}
|
|
||||||
declare module 'react-select/lib/Select.js' {
|
|
||||||
declare module.exports: $Exports<'react-select/lib/Select'>;
|
|
||||||
}
|
|
||||||
declare module 'react-select/lib/stateManager.js' {
|
|
||||||
declare module.exports: $Exports<'react-select/lib/stateManager'>;
|
|
||||||
}
|
|
||||||
declare module 'react-select/lib/styles.js' {
|
|
||||||
declare module.exports: $Exports<'react-select/lib/styles'>;
|
|
||||||
}
|
|
||||||
declare module 'react-select/lib/theme.js' {
|
|
||||||
declare module.exports: $Exports<'react-select/lib/theme'>;
|
|
||||||
}
|
|
||||||
declare module 'react-select/lib/types.js' {
|
|
||||||
declare module.exports: $Exports<'react-select/lib/types'>;
|
|
||||||
}
|
|
||||||
declare module 'react-select/lib/utils.js' {
|
|
||||||
declare module.exports: $Exports<'react-select/lib/utils'>;
|
|
||||||
}
|
|
||||||
declare module 'react-select/src/__tests__/Async.test.js' {
|
|
||||||
declare module.exports: $Exports<'react-select/src/__tests__/Async.test'>;
|
|
||||||
}
|
|
||||||
declare module 'react-select/src/__tests__/AsyncCreatable.test.js' {
|
|
||||||
declare module.exports: $Exports<'react-select/src/__tests__/AsyncCreatable.test'>;
|
|
||||||
}
|
|
||||||
declare module 'react-select/src/__tests__/constants.js' {
|
|
||||||
declare module.exports: $Exports<'react-select/src/__tests__/constants'>;
|
|
||||||
}
|
|
||||||
declare module 'react-select/src/__tests__/Creatable.test.js' {
|
|
||||||
declare module.exports: $Exports<'react-select/src/__tests__/Creatable.test'>;
|
|
||||||
}
|
|
||||||
declare module 'react-select/src/__tests__/Select.test.js' {
|
|
||||||
declare module.exports: $Exports<'react-select/src/__tests__/Select.test'>;
|
|
||||||
}
|
|
||||||
declare module 'react-select/src/__tests__/StateManaged.test.js' {
|
|
||||||
declare module.exports: $Exports<'react-select/src/__tests__/StateManaged.test'>;
|
|
||||||
}
|
|
||||||
declare module 'react-select/src/accessibility/index' {
|
|
||||||
declare module.exports: $Exports<'react-select/src/accessibility'>;
|
|
||||||
}
|
|
||||||
declare module 'react-select/src/accessibility/index.js' {
|
|
||||||
declare module.exports: $Exports<'react-select/src/accessibility'>;
|
|
||||||
}
|
|
||||||
declare module 'react-select/src/animated/index' {
|
|
||||||
declare module.exports: $Exports<'react-select/src/animated'>;
|
|
||||||
}
|
|
||||||
declare module 'react-select/src/animated/index.js' {
|
|
||||||
declare module.exports: $Exports<'react-select/src/animated'>;
|
|
||||||
}
|
|
||||||
declare module 'react-select/src/animated/Input.js' {
|
|
||||||
declare module.exports: $Exports<'react-select/src/animated/Input'>;
|
|
||||||
}
|
|
||||||
declare module 'react-select/src/animated/MultiValue.js' {
|
|
||||||
declare module.exports: $Exports<'react-select/src/animated/MultiValue'>;
|
|
||||||
}
|
|
||||||
declare module 'react-select/src/animated/Placeholder.js' {
|
|
||||||
declare module.exports: $Exports<'react-select/src/animated/Placeholder'>;
|
|
||||||
}
|
|
||||||
declare module 'react-select/src/animated/SingleValue.js' {
|
|
||||||
declare module.exports: $Exports<'react-select/src/animated/SingleValue'>;
|
|
||||||
}
|
|
||||||
declare module 'react-select/src/animated/transitions.js' {
|
|
||||||
declare module.exports: $Exports<'react-select/src/animated/transitions'>;
|
|
||||||
}
|
|
||||||
declare module 'react-select/src/animated/ValueContainer.js' {
|
|
||||||
declare module.exports: $Exports<'react-select/src/animated/ValueContainer'>;
|
|
||||||
}
|
|
||||||
declare module 'react-select/src/Async.js' {
|
|
||||||
declare module.exports: $Exports<'react-select/src/Async'>;
|
|
||||||
}
|
|
||||||
declare module 'react-select/src/AsyncCreatable.js' {
|
|
||||||
declare module.exports: $Exports<'react-select/src/AsyncCreatable'>;
|
|
||||||
}
|
|
||||||
declare module 'react-select/src/builtins.js' {
|
|
||||||
declare module.exports: $Exports<'react-select/src/builtins'>;
|
|
||||||
}
|
|
||||||
declare module 'react-select/src/components/containers.js' {
|
|
||||||
declare module.exports: $Exports<'react-select/src/components/containers'>;
|
|
||||||
}
|
|
||||||
declare module 'react-select/src/components/Control.js' {
|
|
||||||
declare module.exports: $Exports<'react-select/src/components/Control'>;
|
|
||||||
}
|
|
||||||
declare module 'react-select/src/components/Group.js' {
|
|
||||||
declare module.exports: $Exports<'react-select/src/components/Group'>;
|
|
||||||
}
|
|
||||||
declare module 'react-select/src/components/index' {
|
|
||||||
declare module.exports: $Exports<'react-select/src/components'>;
|
|
||||||
}
|
|
||||||
declare module 'react-select/src/components/index.js' {
|
|
||||||
declare module.exports: $Exports<'react-select/src/components'>;
|
|
||||||
}
|
|
||||||
declare module 'react-select/src/components/indicators.js' {
|
|
||||||
declare module.exports: $Exports<'react-select/src/components/indicators'>;
|
|
||||||
}
|
|
||||||
declare module 'react-select/src/components/Input.js' {
|
|
||||||
declare module.exports: $Exports<'react-select/src/components/Input'>;
|
|
||||||
}
|
|
||||||
declare module 'react-select/src/components/Menu.js' {
|
|
||||||
declare module.exports: $Exports<'react-select/src/components/Menu'>;
|
|
||||||
}
|
|
||||||
declare module 'react-select/src/components/MultiValue.js' {
|
|
||||||
declare module.exports: $Exports<'react-select/src/components/MultiValue'>;
|
|
||||||
}
|
|
||||||
declare module 'react-select/src/components/Option.js' {
|
|
||||||
declare module.exports: $Exports<'react-select/src/components/Option'>;
|
|
||||||
}
|
|
||||||
declare module 'react-select/src/components/Placeholder.js' {
|
|
||||||
declare module.exports: $Exports<'react-select/src/components/Placeholder'>;
|
|
||||||
}
|
|
||||||
declare module 'react-select/src/components/SingleValue.js' {
|
|
||||||
declare module.exports: $Exports<'react-select/src/components/SingleValue'>;
|
|
||||||
}
|
|
||||||
declare module 'react-select/src/Creatable.js' {
|
|
||||||
declare module.exports: $Exports<'react-select/src/Creatable'>;
|
|
||||||
}
|
|
||||||
declare module 'react-select/src/diacritics.js' {
|
|
||||||
declare module.exports: $Exports<'react-select/src/diacritics'>;
|
|
||||||
}
|
|
||||||
declare module 'react-select/src/filters.js' {
|
|
||||||
declare module.exports: $Exports<'react-select/src/filters'>;
|
|
||||||
}
|
|
||||||
declare module 'react-select/src/index' {
|
|
||||||
declare module.exports: $Exports<'react-select/src'>;
|
|
||||||
}
|
|
||||||
declare module 'react-select/src/index.js' {
|
|
||||||
declare module.exports: $Exports<'react-select/src'>;
|
|
||||||
}
|
|
||||||
declare module 'react-select/src/index.umd.js' {
|
|
||||||
declare module.exports: $Exports<'react-select/src/index.umd'>;
|
|
||||||
}
|
|
||||||
declare module 'react-select/src/internal/A11yText.js' {
|
|
||||||
declare module.exports: $Exports<'react-select/src/internal/A11yText'>;
|
|
||||||
}
|
|
||||||
declare module 'react-select/src/internal/DummyInput.js' {
|
|
||||||
declare module.exports: $Exports<'react-select/src/internal/DummyInput'>;
|
|
||||||
}
|
|
||||||
declare module 'react-select/src/internal/index' {
|
|
||||||
declare module.exports: $Exports<'react-select/src/internal'>;
|
|
||||||
}
|
|
||||||
declare module 'react-select/src/internal/index.js' {
|
|
||||||
declare module.exports: $Exports<'react-select/src/internal'>;
|
|
||||||
}
|
|
||||||
declare module 'react-select/src/internal/NodeResolver.js' {
|
|
||||||
declare module.exports: $Exports<'react-select/src/internal/NodeResolver'>;
|
|
||||||
}
|
|
||||||
declare module 'react-select/src/internal/react-fast-compare.js' {
|
|
||||||
declare module.exports: $Exports<'react-select/src/internal/react-fast-compare'>;
|
|
||||||
}
|
|
||||||
declare module 'react-select/src/internal/ScrollBlock.js' {
|
|
||||||
declare module.exports: $Exports<'react-select/src/internal/ScrollBlock'>;
|
|
||||||
}
|
|
||||||
declare module 'react-select/src/internal/ScrollCaptor.js' {
|
|
||||||
declare module.exports: $Exports<'react-select/src/internal/ScrollCaptor'>;
|
|
||||||
}
|
|
||||||
declare module 'react-select/src/internal/ScrollLock/constants.js' {
|
|
||||||
declare module.exports: $Exports<'react-select/src/internal/ScrollLock/constants'>;
|
|
||||||
}
|
|
||||||
declare module 'react-select/src/internal/ScrollLock/index' {
|
|
||||||
declare module.exports: $Exports<'react-select/src/internal/ScrollLock'>;
|
|
||||||
}
|
|
||||||
declare module 'react-select/src/internal/ScrollLock/index.js' {
|
|
||||||
declare module.exports: $Exports<'react-select/src/internal/ScrollLock'>;
|
|
||||||
}
|
|
||||||
declare module 'react-select/src/internal/ScrollLock/utils.js' {
|
|
||||||
declare module.exports: $Exports<'react-select/src/internal/ScrollLock/utils'>;
|
|
||||||
}
|
|
||||||
declare module 'react-select/src/Select.js' {
|
|
||||||
declare module.exports: $Exports<'react-select/src/Select'>;
|
|
||||||
}
|
|
||||||
declare module 'react-select/src/stateManager.js' {
|
|
||||||
declare module.exports: $Exports<'react-select/src/stateManager'>;
|
|
||||||
}
|
|
||||||
declare module 'react-select/src/styles.js' {
|
|
||||||
declare module.exports: $Exports<'react-select/src/styles'>;
|
|
||||||
}
|
|
||||||
declare module 'react-select/src/theme.js' {
|
|
||||||
declare module.exports: $Exports<'react-select/src/theme'>;
|
|
||||||
}
|
|
||||||
declare module 'react-select/src/types.js' {
|
|
||||||
declare module.exports: $Exports<'react-select/src/types'>;
|
|
||||||
}
|
|
||||||
declare module 'react-select/src/utils.js' {
|
|
||||||
declare module.exports: $Exports<'react-select/src/utils'>;
|
|
||||||
}
|
|
||||||
File diff suppressed because it is too large
Load Diff
@@ -1,484 +0,0 @@
|
|||||||
// flow-typed signature: a55c22479779e4f28ad4dd10c702882a
|
|
||||||
// flow-typed version: a29423bb31/styled-components_v4.x.x/flow_>=v0.104.x
|
|
||||||
|
|
||||||
// @flow
|
|
||||||
|
|
||||||
declare module 'styled-components' {
|
|
||||||
declare type BuiltinElementInstances = {
|
|
||||||
a: React$ElementRef<'a'>,
|
|
||||||
abbr: React$ElementRef<'abbr'>,
|
|
||||||
address: React$ElementRef<'address'>,
|
|
||||||
area: React$ElementRef<'area'>,
|
|
||||||
article: React$ElementRef<'article'>,
|
|
||||||
aside: React$ElementRef<'aside'>,
|
|
||||||
audio: React$ElementRef<'audio'>,
|
|
||||||
b: React$ElementRef<'b'>,
|
|
||||||
base: React$ElementRef<'base'>,
|
|
||||||
bdi: React$ElementRef<'bdi'>,
|
|
||||||
bdo: React$ElementRef<'bdo'>,
|
|
||||||
big: React$ElementRef<'big'>,
|
|
||||||
blockquote: React$ElementRef<'blockquote'>,
|
|
||||||
body: React$ElementRef<'body'>,
|
|
||||||
br: React$ElementRef<'br'>,
|
|
||||||
button: React$ElementRef<'button'>,
|
|
||||||
canvas: React$ElementRef<'canvas'>,
|
|
||||||
caption: React$ElementRef<'caption'>,
|
|
||||||
cite: React$ElementRef<'cite'>,
|
|
||||||
code: React$ElementRef<'code'>,
|
|
||||||
col: React$ElementRef<'col'>,
|
|
||||||
colgroup: React$ElementRef<'colgroup'>,
|
|
||||||
data: React$ElementRef<'data'>,
|
|
||||||
datalist: React$ElementRef<'datalist'>,
|
|
||||||
dd: React$ElementRef<'dd'>,
|
|
||||||
del: React$ElementRef<'del'>,
|
|
||||||
details: React$ElementRef<'details'>,
|
|
||||||
dfn: React$ElementRef<'dfn'>,
|
|
||||||
dialog: React$ElementRef<'dialog'>,
|
|
||||||
div: React$ElementRef<'div'>,
|
|
||||||
dl: React$ElementRef<'dl'>,
|
|
||||||
dt: React$ElementRef<'dt'>,
|
|
||||||
em: React$ElementRef<'em'>,
|
|
||||||
embed: React$ElementRef<'embed'>,
|
|
||||||
fieldset: React$ElementRef<'fieldset'>,
|
|
||||||
figcaption: React$ElementRef<'figcaption'>,
|
|
||||||
figure: React$ElementRef<'figure'>,
|
|
||||||
footer: React$ElementRef<'footer'>,
|
|
||||||
form: React$ElementRef<'form'>,
|
|
||||||
h1: React$ElementRef<'h1'>,
|
|
||||||
h2: React$ElementRef<'h2'>,
|
|
||||||
h3: React$ElementRef<'h3'>,
|
|
||||||
h4: React$ElementRef<'h4'>,
|
|
||||||
h5: React$ElementRef<'h5'>,
|
|
||||||
h6: React$ElementRef<'h6'>,
|
|
||||||
head: React$ElementRef<'head'>,
|
|
||||||
header: React$ElementRef<'header'>,
|
|
||||||
hgroup: React$ElementRef<'hgroup'>,
|
|
||||||
hr: React$ElementRef<'hr'>,
|
|
||||||
html: React$ElementRef<'html'>,
|
|
||||||
i: React$ElementRef<'i'>,
|
|
||||||
iframe: React$ElementRef<'iframe'>,
|
|
||||||
img: React$ElementRef<'img'>,
|
|
||||||
input: React$ElementRef<'input'>,
|
|
||||||
ins: React$ElementRef<'ins'>,
|
|
||||||
kbd: React$ElementRef<'kbd'>,
|
|
||||||
label: React$ElementRef<'label'>,
|
|
||||||
legend: React$ElementRef<'legend'>,
|
|
||||||
li: React$ElementRef<'li'>,
|
|
||||||
link: React$ElementRef<'link'>,
|
|
||||||
main: React$ElementRef<'main'>,
|
|
||||||
map: React$ElementRef<'map'>,
|
|
||||||
mark: React$ElementRef<'mark'>,
|
|
||||||
menu: React$ElementRef<'menu'>,
|
|
||||||
meta: React$ElementRef<'meta'>,
|
|
||||||
meter: React$ElementRef<'meter'>,
|
|
||||||
nav: React$ElementRef<'nav'>,
|
|
||||||
noscript: React$ElementRef<'noscript'>,
|
|
||||||
object: React$ElementRef<'object'>,
|
|
||||||
ol: React$ElementRef<'ol'>,
|
|
||||||
optgroup: React$ElementRef<'optgroup'>,
|
|
||||||
option: React$ElementRef<'option'>,
|
|
||||||
output: React$ElementRef<'output'>,
|
|
||||||
p: React$ElementRef<'p'>,
|
|
||||||
param: React$ElementRef<'param'>,
|
|
||||||
picture: React$ElementRef<'picture'>,
|
|
||||||
pre: React$ElementRef<'pre'>,
|
|
||||||
progress: React$ElementRef<'progress'>,
|
|
||||||
q: React$ElementRef<'q'>,
|
|
||||||
rp: React$ElementRef<'rp'>,
|
|
||||||
rt: React$ElementRef<'rt'>,
|
|
||||||
ruby: React$ElementRef<'ruby'>,
|
|
||||||
s: React$ElementRef<'s'>,
|
|
||||||
samp: React$ElementRef<'samp'>,
|
|
||||||
script: React$ElementRef<'script'>,
|
|
||||||
section: React$ElementRef<'section'>,
|
|
||||||
select: React$ElementRef<'select'>,
|
|
||||||
small: React$ElementRef<'small'>,
|
|
||||||
source: React$ElementRef<'source'>,
|
|
||||||
span: React$ElementRef<'span'>,
|
|
||||||
strong: React$ElementRef<'strong'>,
|
|
||||||
style: React$ElementRef<'style'>,
|
|
||||||
sub: React$ElementRef<'sub'>,
|
|
||||||
summary: React$ElementRef<'summary'>,
|
|
||||||
sup: React$ElementRef<'sup'>,
|
|
||||||
table: React$ElementRef<'table'>,
|
|
||||||
tbody: React$ElementRef<'tbody'>,
|
|
||||||
td: React$ElementRef<'td'>,
|
|
||||||
textarea: React$ElementRef<'textarea'>,
|
|
||||||
tfoot: React$ElementRef<'tfoot'>,
|
|
||||||
th: React$ElementRef<'th'>,
|
|
||||||
thead: React$ElementRef<'thead'>,
|
|
||||||
time: React$ElementRef<'time'>,
|
|
||||||
title: React$ElementRef<'title'>,
|
|
||||||
tr: React$ElementRef<'tr'>,
|
|
||||||
track: React$ElementRef<'track'>,
|
|
||||||
u: React$ElementRef<'u'>,
|
|
||||||
ul: React$ElementRef<'ul'>,
|
|
||||||
var: React$ElementRef<'var'>,
|
|
||||||
video: React$ElementRef<'video'>,
|
|
||||||
wbr: React$ElementRef<'wbr'>,
|
|
||||||
// SVG
|
|
||||||
circle: React$ElementRef<'circle'>,
|
|
||||||
clipPath: React$ElementRef<'clipPath'>,
|
|
||||||
defs: React$ElementRef<'defs'>,
|
|
||||||
ellipse: React$ElementRef<'ellipse'>,
|
|
||||||
g: React$ElementRef<'g'>,
|
|
||||||
image: React$ElementRef<'image'>,
|
|
||||||
line: React$ElementRef<'line'>,
|
|
||||||
linearGradient: React$ElementRef<'linearGradient'>,
|
|
||||||
mask: React$ElementRef<'mask'>,
|
|
||||||
path: React$ElementRef<'path'>,
|
|
||||||
pattern: React$ElementRef<'pattern'>,
|
|
||||||
polygon: React$ElementRef<'polygon'>,
|
|
||||||
polyline: React$ElementRef<'polyline'>,
|
|
||||||
radialGradient: React$ElementRef<'radialGradient'>,
|
|
||||||
rect: React$ElementRef<'rect'>,
|
|
||||||
stop: React$ElementRef<'stop'>,
|
|
||||||
svg: React$ElementRef<'svg'>,
|
|
||||||
text: React$ElementRef<'text'>,
|
|
||||||
tspan: React$ElementRef<'tspan'>,
|
|
||||||
// Deprecated, should be HTMLUnknownElement, but Flow doesn't support it
|
|
||||||
keygen: React$ElementRef<'keygen'>,
|
|
||||||
menuitem: React$ElementRef<'menuitem'>,
|
|
||||||
...
|
|
||||||
}
|
|
||||||
|
|
||||||
declare type BuiltinElementType<ElementName: string> = $ElementType<BuiltinElementInstances, ElementName>
|
|
||||||
|
|
||||||
declare class InterpolatableComponent<P> extends React$Component<P> {
|
|
||||||
static +styledComponentId: string;
|
|
||||||
}
|
|
||||||
|
|
||||||
declare export type Interpolation<P> =
|
|
||||||
| ((executionContext: P) =>
|
|
||||||
| ((executionContext: P) => InterpolationBase)
|
|
||||||
| InterpolationBase
|
|
||||||
)
|
|
||||||
| Class<InterpolatableComponent<mixed>>
|
|
||||||
| InterpolationBase
|
|
||||||
|
|
||||||
declare export type InterpolationBase =
|
|
||||||
| CSSRules
|
|
||||||
| KeyFrames
|
|
||||||
| string
|
|
||||||
| number
|
|
||||||
|
|
||||||
|
|
||||||
// Should this be `mixed` perhaps?
|
|
||||||
declare export type CSSRules = Interpolation<any>[] // eslint-disable-line flowtype/no-weak-types
|
|
||||||
|
|
||||||
// This is not exported on purpose, since it's an implementation detail
|
|
||||||
declare type TaggedTemplateLiteral<I, R> = (strings: string[], ...interpolations: Interpolation<I>[]) => R
|
|
||||||
|
|
||||||
declare export type CSSConstructor = TaggedTemplateLiteral<any, CSSRules> // eslint-disable-line flowtype/no-weak-types
|
|
||||||
declare export type KeyFramesConstructor = TaggedTemplateLiteral<any, KeyFrames> // eslint-disable-line flowtype/no-weak-types
|
|
||||||
declare export type CreateGlobalStyleConstructor = TaggedTemplateLiteral<any, React$ComponentType<*>> // eslint-disable-line flowtype/no-weak-types
|
|
||||||
|
|
||||||
declare interface Tag<T> {
|
|
||||||
styleTag: HTMLStyleElement | null;
|
|
||||||
getIds(): string[];
|
|
||||||
hasNameForId(id: string, name: string): boolean;
|
|
||||||
insertMarker(id: string): T;
|
|
||||||
insertRules(id: string, cssRules: string[], name: ?string): void;
|
|
||||||
removeRules(id: string): void;
|
|
||||||
css(): string;
|
|
||||||
toHTML(additionalAttrs: ?string): string;
|
|
||||||
toElement(): React$Element<*>;
|
|
||||||
clone(): Tag<T>;
|
|
||||||
sealed: boolean;
|
|
||||||
}
|
|
||||||
|
|
||||||
// The `any`/weak types in here all come from `styled-components` directly, since those definitions were just copied over
|
|
||||||
declare export class StyleSheet {
|
|
||||||
static get master() : StyleSheet;
|
|
||||||
static get instance() : StyleSheet;
|
|
||||||
static reset(forceServer? : boolean) : void;
|
|
||||||
|
|
||||||
id : number;
|
|
||||||
forceServer : boolean;
|
|
||||||
target : ?HTMLElement;
|
|
||||||
tagMap : { [string]: Tag<any>, ... }; // eslint-disable-line flowtype/no-weak-types
|
|
||||||
deferred: { [string]: string[] | void, ... };
|
|
||||||
rehydratedNames: { [string]: boolean, ... };
|
|
||||||
ignoreRehydratedNames: { [string]: boolean, ... };
|
|
||||||
tags: Tag<any>[]; // eslint-disable-line flowtype/no-weak-types
|
|
||||||
importRuleTag: Tag<any>; // eslint-disable-line flowtype/no-weak-types
|
|
||||||
capacity: number;
|
|
||||||
clones: StyleSheet[];
|
|
||||||
|
|
||||||
constructor(?HTMLElement) : this;
|
|
||||||
rehydrate() : this;
|
|
||||||
clone() : StyleSheet;
|
|
||||||
sealAllTags() : void;
|
|
||||||
makeTag(tag : ?Tag<any>) : Tag<any>; // eslint-disable-line flowtype/no-weak-types
|
|
||||||
getImportRuleTag() : Tag<any>; // eslint-disable-line flowtype/no-weak-types
|
|
||||||
getTagForId(id : string): Tag<any>; // eslint-disable-line flowtype/no-weak-types
|
|
||||||
hasId(id: string) : boolean;
|
|
||||||
hasNameForId(id: string, name: string) : boolean;
|
|
||||||
deferredInject(id : string, cssRules : string[]) : void;
|
|
||||||
inject(id: string, cssRules : string[], name? : string) : void;
|
|
||||||
remove(id : string) : void;
|
|
||||||
toHtml() : string;
|
|
||||||
toReactElements() : React$ElementType[];
|
|
||||||
}
|
|
||||||
|
|
||||||
declare export class KeyFrames {
|
|
||||||
id : string;
|
|
||||||
name : string;
|
|
||||||
rules : string[];
|
|
||||||
|
|
||||||
constructor(name : string, rules : string[]) : this;
|
|
||||||
inject(StyleSheet) : void;
|
|
||||||
toString() : string;
|
|
||||||
getName() : string;
|
|
||||||
}
|
|
||||||
|
|
||||||
// I think any is appropriate here?
|
|
||||||
// eslint-disable-next-line flowtype/no-weak-types
|
|
||||||
declare export var css : CSSConstructor;
|
|
||||||
declare export var keyframes : KeyFramesConstructor;
|
|
||||||
declare export var createGlobalStyle : CreateGlobalStyleConstructor
|
|
||||||
declare export var ThemeProvider: React$ComponentType<{
|
|
||||||
children?: ?React$Node,
|
|
||||||
theme: mixed | (mixed) => mixed,
|
|
||||||
...
|
|
||||||
}>
|
|
||||||
|
|
||||||
declare type ThemeProps<T> = {|
|
|
||||||
theme: T
|
|
||||||
|}
|
|
||||||
|
|
||||||
declare type PropsWithTheme<Props, T> = {|
|
|
||||||
...ThemeProps<T>,
|
|
||||||
...$Exact<Props>
|
|
||||||
|}
|
|
||||||
|
|
||||||
declare export function withTheme<Theme, Config: {...}, Instance>(Component: React$AbstractComponent<Config, Instance>): React$AbstractComponent<$Diff<Config, ThemeProps<Theme | void>>, Instance>
|
|
||||||
|
|
||||||
declare export type StyledComponent<Props, Theme, Instance> = React$AbstractComponent<Props, Instance> & Class<InterpolatableComponent<Props>>
|
|
||||||
|
|
||||||
declare type StyledFactory<StyleProps, Theme, Instance> = {|
|
|
||||||
[[call]]: TaggedTemplateLiteral<PropsWithTheme<StyleProps, Theme>, StyledComponent<StyleProps, Theme, Instance>>;
|
|
||||||
+attrs: <A: {...}>(((StyleProps) => A) | A) => TaggedTemplateLiteral<
|
|
||||||
PropsWithTheme<{|...$Exact<StyleProps>, ...$Exact<A>|}, Theme>,
|
|
||||||
StyledComponent<React$Config<{|...$Exact<StyleProps>, ...$Exact<A>|}, $Exact<A>>, Theme, Instance>
|
|
||||||
>;
|
|
||||||
|}
|
|
||||||
|
|
||||||
declare type StyledShorthandFactory<V> = {|
|
|
||||||
[[call]]: <StyleProps, Theme>(string[], ...Interpolation<PropsWithTheme<StyleProps, Theme>>[]) => StyledComponent<StyleProps, Theme, V>;
|
|
||||||
+attrs: <A: {...}, StyleProps = {||}, Theme = {||}>(((StyleProps) => A) | A) => TaggedTemplateLiteral<
|
|
||||||
PropsWithTheme<{|...$Exact<StyleProps>, ...$Exact<A>|}, Theme>,
|
|
||||||
StyledComponent<React$Config<{|...$Exact<StyleProps>, ...$Exact<A>|}, $Exact<A>>, Theme, V>
|
|
||||||
>;
|
|
||||||
|}
|
|
||||||
|
|
||||||
|
|
||||||
declare type ConvenientShorthands = $ObjMap<
|
|
||||||
BuiltinElementInstances,
|
|
||||||
<V>(V) => StyledShorthandFactory<V>
|
|
||||||
>
|
|
||||||
|
|
||||||
declare interface Styled {
|
|
||||||
<StyleProps, Theme, ElementName: $Keys<BuiltinElementInstances>>(ElementName): StyledFactory<StyleProps, Theme, BuiltinElementType<ElementName>>;
|
|
||||||
<Comp: React$ComponentType<any>, Theme, OwnProps = React$ElementConfig<Comp>>(Comp): StyledFactory<{|...$Exact<OwnProps>|}, Theme, Comp>;
|
|
||||||
}
|
|
||||||
|
|
||||||
declare export default Styled & ConvenientShorthands
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
declare module 'styled-components/native' {
|
|
||||||
|
|
||||||
declare class InterpolatableComponent<P> extends React$Component<P> {
|
|
||||||
static +styledComponentId: string;
|
|
||||||
}
|
|
||||||
|
|
||||||
declare export type Interpolation<P> =
|
|
||||||
| ((executionContext: P) =>
|
|
||||||
| ((executionContext: P) => InterpolationBase) // eslint-disable-line flowtype/no-weak-types
|
|
||||||
| InterpolationBase
|
|
||||||
)
|
|
||||||
| Class<InterpolatableComponent<mixed>>
|
|
||||||
| InterpolationBase
|
|
||||||
|
|
||||||
declare export type InterpolationBase =
|
|
||||||
| CSSRules
|
|
||||||
| KeyFrames
|
|
||||||
| string
|
|
||||||
| number
|
|
||||||
|
|
||||||
// Should this be `mixed` perhaps?
|
|
||||||
declare export type CSSRules = Interpolation<any>[] // eslint-disable-line flowtype/no-weak-types
|
|
||||||
|
|
||||||
// This is not exported on purpose, since it's an implementation detail
|
|
||||||
declare type TaggedTemplateLiteral<I, R> = (strings: string[], ...interpolations: Interpolation<I>[]) => R
|
|
||||||
|
|
||||||
declare export type CSSConstructor = TaggedTemplateLiteral<any, CSSRules> // eslint-disable-line flowtype/no-weak-types
|
|
||||||
declare export type KeyFramesConstructor = TaggedTemplateLiteral<any, KeyFrames> // eslint-disable-line flowtype/no-weak-types
|
|
||||||
declare export type CreateGlobalStyleConstructor = TaggedTemplateLiteral<any, React$ComponentType<*>> // eslint-disable-line flowtype/no-weak-types
|
|
||||||
|
|
||||||
declare interface Tag<T> {
|
|
||||||
styleTag: HTMLStyleElement | null;
|
|
||||||
getIds(): string[];
|
|
||||||
hasNameForId(id: string, name: string): boolean;
|
|
||||||
insertMarker(id: string): T;
|
|
||||||
insertRules(id: string, cssRules: string[], name: ?string): void;
|
|
||||||
removeRules(id: string): void;
|
|
||||||
css(): string;
|
|
||||||
toHTML(additionalAttrs: ?string): string;
|
|
||||||
toElement(): React$Element<*>;
|
|
||||||
clone(): Tag<T>;
|
|
||||||
sealed: boolean;
|
|
||||||
}
|
|
||||||
|
|
||||||
// The `any`/weak types in here all come from `styled-components` directly, since those definitions were just copied over
|
|
||||||
declare export class StyleSheet {
|
|
||||||
static get master() : StyleSheet;
|
|
||||||
static get instance() : StyleSheet;
|
|
||||||
static reset(forceServer? : boolean) : void;
|
|
||||||
|
|
||||||
id : number;
|
|
||||||
forceServer : boolean;
|
|
||||||
target : ?HTMLElement;
|
|
||||||
tagMap : { [string]: Tag<any>, ... }; // eslint-disable-line flowtype/no-weak-types
|
|
||||||
deferred: { [string]: string[] | void, ... };
|
|
||||||
rehydratedNames: { [string]: boolean, ... };
|
|
||||||
ignoreRehydratedNames: { [string]: boolean, ... };
|
|
||||||
tags: Tag<any>[]; // eslint-disable-line flowtype/no-weak-types
|
|
||||||
importRuleTag: Tag<any>; // eslint-disable-line flowtype/no-weak-types
|
|
||||||
capacity: number;
|
|
||||||
clones: StyleSheet[];
|
|
||||||
|
|
||||||
constructor(?HTMLElement) : this;
|
|
||||||
rehydrate() : this;
|
|
||||||
clone() : StyleSheet;
|
|
||||||
sealAllTags() : void;
|
|
||||||
makeTag(tag : ?Tag<any>) : Tag<any>; // eslint-disable-line flowtype/no-weak-types
|
|
||||||
getImportRuleTag() : Tag<any>; // eslint-disable-line flowtype/no-weak-types
|
|
||||||
getTagForId(id : string): Tag<any>; // eslint-disable-line flowtype/no-weak-types
|
|
||||||
hasId(id: string) : boolean;
|
|
||||||
hasNameForId(id: string, name: string) : boolean;
|
|
||||||
deferredInject(id : string, cssRules : string[]) : void;
|
|
||||||
inject(id: string, cssRules : string[], name? : string) : void;
|
|
||||||
remove(id : string) : void;
|
|
||||||
toHtml() : string;
|
|
||||||
toReactElements() : React$ElementType[];
|
|
||||||
}
|
|
||||||
|
|
||||||
declare export class KeyFrames {
|
|
||||||
id : string;
|
|
||||||
name : string;
|
|
||||||
rules : string[];
|
|
||||||
|
|
||||||
constructor(name : string, rules : string[]) : this;
|
|
||||||
inject(StyleSheet) : void;
|
|
||||||
toString() : string;
|
|
||||||
getName() : string;
|
|
||||||
}
|
|
||||||
|
|
||||||
// I think any is appropriate here?
|
|
||||||
// eslint-disable-next-line flowtype/no-weak-types
|
|
||||||
declare export var css : CSSConstructor;
|
|
||||||
declare export var keyframes : KeyFramesConstructor;
|
|
||||||
declare export var createGlobalStyle : CreateGlobalStyleConstructor
|
|
||||||
declare export var ThemeProvider: React$ComponentType<{
|
|
||||||
children?: ?React$Node,
|
|
||||||
theme: mixed | (mixed) => mixed,
|
|
||||||
...
|
|
||||||
}>
|
|
||||||
|
|
||||||
declare type ThemeProps<T> = {|
|
|
||||||
theme: T
|
|
||||||
|}
|
|
||||||
|
|
||||||
declare type PropsWithTheme<Props, T> = {|
|
|
||||||
...ThemeProps<T>,
|
|
||||||
...$Exact<Props>
|
|
||||||
|}
|
|
||||||
|
|
||||||
declare export function withTheme<Theme, Config: {...}, Instance>(Component: React$AbstractComponent<Config, Instance>): React$AbstractComponent<$Diff<Config, ThemeProps<Theme | void>>, Instance>
|
|
||||||
|
|
||||||
declare export type StyledComponent<Props, Theme, Instance> = React$AbstractComponent<Props, Instance> & Class<InterpolatableComponent<Props>>
|
|
||||||
|
|
||||||
declare type StyledFactory<StyleProps, Theme, Instance> = {|
|
|
||||||
[[call]]: TaggedTemplateLiteral<PropsWithTheme<StyleProps, Theme>, StyledComponent<StyleProps, Theme, Instance>>;
|
|
||||||
+attrs: <A: {...}>(((StyleProps) => A) | A) => TaggedTemplateLiteral<
|
|
||||||
PropsWithTheme<{|...$Exact<StyleProps>, ...$Exact<A>|}, Theme>,
|
|
||||||
StyledComponent<React$Config<{|...$Exact<StyleProps>, ...$Exact<A>|}, $Exact<A>>, Theme, Instance>
|
|
||||||
>;
|
|
||||||
|}
|
|
||||||
|
|
||||||
declare type StyledShorthandFactory<V> = {|
|
|
||||||
[[call]]: <StyleProps, Theme>(string[], ...Interpolation<PropsWithTheme<StyleProps, Theme>>[]) => StyledComponent<StyleProps, Theme, V>;
|
|
||||||
+attrs: <A: {...}, StyleProps = {||}, Theme = {||}>(((StyleProps) => A) | A) => TaggedTemplateLiteral<
|
|
||||||
PropsWithTheme<{|...$Exact<StyleProps>, ...$Exact<A>|}, Theme>,
|
|
||||||
StyledComponent<React$Config<{|...$Exact<StyleProps>, ...$Exact<A>|}, $Exact<A>>, Theme, V>
|
|
||||||
>;
|
|
||||||
|}
|
|
||||||
|
|
||||||
declare type BuiltinElementInstances = {
|
|
||||||
ActivityIndicator: React$ComponentType<{...}>,
|
|
||||||
ActivityIndicatorIOS: React$ComponentType<{...}>,
|
|
||||||
ART: React$ComponentType<{...}>,
|
|
||||||
Button: React$ComponentType<{...}>,
|
|
||||||
DatePickerIOS: React$ComponentType<{...}>,
|
|
||||||
DrawerLayoutAndroid: React$ComponentType<{...}>,
|
|
||||||
Image: React$ComponentType<{...}>,
|
|
||||||
ImageBackground: React$ComponentType<{...}>,
|
|
||||||
ImageEditor: React$ComponentType<{...}>,
|
|
||||||
ImageStore: React$ComponentType<{...}>,
|
|
||||||
KeyboardAvoidingView: React$ComponentType<{...}>,
|
|
||||||
ListView: React$ComponentType<{...}>,
|
|
||||||
MapView: React$ComponentType<{...}>,
|
|
||||||
Modal: React$ComponentType<{...}>,
|
|
||||||
NavigatorIOS: React$ComponentType<{...}>,
|
|
||||||
Picker: React$ComponentType<{...}>,
|
|
||||||
PickerIOS: React$ComponentType<{...}>,
|
|
||||||
ProgressBarAndroid: React$ComponentType<{...}>,
|
|
||||||
ProgressViewIOS: React$ComponentType<{...}>,
|
|
||||||
ScrollView: React$ComponentType<{...}>,
|
|
||||||
SegmentedControlIOS: React$ComponentType<{...}>,
|
|
||||||
Slider: React$ComponentType<{...}>,
|
|
||||||
SliderIOS: React$ComponentType<{...}>,
|
|
||||||
SnapshotViewIOS: React$ComponentType<{...}>,
|
|
||||||
Switch: React$ComponentType<{...}>,
|
|
||||||
RecyclerViewBackedScrollView: React$ComponentType<{...}>,
|
|
||||||
RefreshControl: React$ComponentType<{...}>,
|
|
||||||
SafeAreaView: React$ComponentType<{...}>,
|
|
||||||
StatusBar: React$ComponentType<{...}>,
|
|
||||||
SwipeableListView: React$ComponentType<{...}>,
|
|
||||||
SwitchAndroid: React$ComponentType<{...}>,
|
|
||||||
SwitchIOS: React$ComponentType<{...}>,
|
|
||||||
TabBarIOS: React$ComponentType<{...}>,
|
|
||||||
Text: React$ComponentType<{...}>,
|
|
||||||
TextInput: React$ComponentType<{...}>,
|
|
||||||
ToastAndroid: React$ComponentType<{...}>,
|
|
||||||
ToolbarAndroid: React$ComponentType<{...}>,
|
|
||||||
Touchable: React$ComponentType<{...}>,
|
|
||||||
TouchableHighlight: React$ComponentType<{...}>,
|
|
||||||
TouchableNativeFeedback: React$ComponentType<{...}>,
|
|
||||||
TouchableOpacity: React$ComponentType<{...}>,
|
|
||||||
TouchableWithoutFeedback: React$ComponentType<{...}>,
|
|
||||||
View: React$ComponentType<{...}>,
|
|
||||||
ViewPagerAndroid: React$ComponentType<{...}>,
|
|
||||||
WebView: React$ComponentType<{...}>,
|
|
||||||
FlatList: React$ComponentType<{...}>,
|
|
||||||
SectionList: React$ComponentType<{...}>,
|
|
||||||
VirtualizedList: React$ComponentType<{...}>,
|
|
||||||
...
|
|
||||||
}
|
|
||||||
|
|
||||||
declare type BuiltinElementType<ElementName: string> = $ElementType<BuiltinElementInstances, ElementName>
|
|
||||||
|
|
||||||
declare type ConvenientShorthands = $ObjMap<
|
|
||||||
BuiltinElementInstances,
|
|
||||||
<V>(V) => StyledShorthandFactory<V>
|
|
||||||
>
|
|
||||||
|
|
||||||
declare interface Styled {
|
|
||||||
<StyleProps, Theme, ElementName: $Keys<BuiltinElementInstances>>(ElementName): StyledFactory<StyleProps, Theme, BuiltinElementType<ElementName>>;
|
|
||||||
<Comp: React$ComponentType<any>, Theme, OwnProps = React$ElementConfig<Comp>>(Comp): StyledFactory<{|...$Exact<OwnProps>|}, Theme, Comp>;
|
|
||||||
}
|
|
||||||
|
|
||||||
declare export default Styled & ConvenientShorthands
|
|
||||||
}
|
|
||||||
@@ -3,10 +3,11 @@
|
|||||||
"private": true,
|
"private": true,
|
||||||
"version": "2.0.0-SNAPSHOT",
|
"version": "2.0.0-SNAPSHOT",
|
||||||
"license": "BSD-3-Clause",
|
"license": "BSD-3-Clause",
|
||||||
"main": "src/main/js/index.js",
|
"main": "./src/main/js/index.ts",
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"build": "ui-scripts plugin",
|
"build": "ui-scripts plugin",
|
||||||
"watch": "ui-scripts plugin-watch"
|
"watch": "ui-scripts plugin-watch",
|
||||||
|
"typecheck": "tsc"
|
||||||
},
|
},
|
||||||
"babel": {
|
"babel": {
|
||||||
"presets": [
|
"presets": [
|
||||||
|
|||||||
@@ -36,7 +36,9 @@ import com.aragost.javahg.commands.PullCommand;
|
|||||||
import org.apache.shiro.SecurityUtils;
|
import org.apache.shiro.SecurityUtils;
|
||||||
import org.slf4j.Logger;
|
import org.slf4j.Logger;
|
||||||
import org.slf4j.LoggerFactory;
|
import org.slf4j.LoggerFactory;
|
||||||
|
import sonia.scm.ContextEntry;
|
||||||
import sonia.scm.repository.Branch;
|
import sonia.scm.repository.Branch;
|
||||||
|
import sonia.scm.repository.InternalRepositoryException;
|
||||||
import sonia.scm.repository.Repository;
|
import sonia.scm.repository.Repository;
|
||||||
import sonia.scm.repository.api.BranchRequest;
|
import sonia.scm.repository.api.BranchRequest;
|
||||||
import sonia.scm.repository.util.WorkingCopy;
|
import sonia.scm.repository.util.WorkingCopy;
|
||||||
@@ -59,7 +61,7 @@ public class HgBranchCommand extends AbstractCommand implements BranchCommand {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public Branch branch(BranchRequest request) {
|
public Branch branch(BranchRequest request) {
|
||||||
try (WorkingCopy<com.aragost.javahg.Repository> workingCopy = workdirFactory.createWorkingCopy(getContext(), request.getParentBranch())) {
|
try (WorkingCopy<com.aragost.javahg.Repository, com.aragost.javahg.Repository> workingCopy = workdirFactory.createWorkingCopy(getContext(), request.getParentBranch())) {
|
||||||
com.aragost.javahg.Repository repository = workingCopy.getWorkingRepository();
|
com.aragost.javahg.Repository repository = workingCopy.getWorkingRepository();
|
||||||
|
|
||||||
Changeset emptyChangeset = createNewBranchWithEmptyCommit(request, repository);
|
Changeset emptyChangeset = createNewBranchWithEmptyCommit(request, repository);
|
||||||
@@ -67,23 +69,46 @@ public class HgBranchCommand extends AbstractCommand implements BranchCommand {
|
|||||||
LOG.debug("Created new branch '{}' in repository {} with changeset {}",
|
LOG.debug("Created new branch '{}' in repository {} with changeset {}",
|
||||||
request.getNewBranch(), getRepository().getNamespaceAndName(), emptyChangeset.getNode());
|
request.getNewBranch(), getRepository().getNamespaceAndName(), emptyChangeset.getNode());
|
||||||
|
|
||||||
pullNewBranchIntoCentralRepository(request, workingCopy);
|
pullChangesIntoCentralRepository(workingCopy, request.getNewBranch());
|
||||||
|
|
||||||
return Branch.normalBranch(request.getNewBranch(), emptyChangeset.getNode());
|
return Branch.normalBranch(request.getNewBranch(), emptyChangeset.getNode());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void deleteOrClose(String branchName) {
|
||||||
|
try (WorkingCopy<com.aragost.javahg.Repository, com.aragost.javahg.Repository> workingCopy = workdirFactory.createWorkingCopy(getContext(), branchName)) {
|
||||||
|
User currentUser = SecurityUtils.getSubject().getPrincipals().oneByType(User.class);
|
||||||
|
|
||||||
|
LOG.debug("Closing branch '{}' in repository {}", branchName, getRepository().getNamespaceAndName());
|
||||||
|
|
||||||
|
com.aragost.javahg.commands.CommitCommand
|
||||||
|
.on(workingCopy.getWorkingRepository())
|
||||||
|
.user(getFormattedUser(currentUser))
|
||||||
|
.message(String.format("Close branch: %s", branchName))
|
||||||
|
.closeBranch()
|
||||||
|
.execute();
|
||||||
|
pullChangesIntoCentralRepository(workingCopy, branchName);
|
||||||
|
} catch (Exception ex) {
|
||||||
|
throw new InternalRepositoryException(ContextEntry.ContextBuilder.entity(getContext().getScmRepository()), String.format("Could not close branch: %s", branchName));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private String getFormattedUser(User currentUser) {
|
||||||
|
return String.format("%s <%s>", currentUser.getDisplayName(), currentUser.getMail());
|
||||||
|
}
|
||||||
|
|
||||||
private Changeset createNewBranchWithEmptyCommit(BranchRequest request, com.aragost.javahg.Repository repository) {
|
private Changeset createNewBranchWithEmptyCommit(BranchRequest request, com.aragost.javahg.Repository repository) {
|
||||||
com.aragost.javahg.commands.BranchCommand.on(repository).set(request.getNewBranch());
|
com.aragost.javahg.commands.BranchCommand.on(repository).set(request.getNewBranch());
|
||||||
User currentUser = SecurityUtils.getSubject().getPrincipals().oneByType(User.class);
|
User currentUser = SecurityUtils.getSubject().getPrincipals().oneByType(User.class);
|
||||||
return CommitCommand
|
return CommitCommand
|
||||||
.on(repository)
|
.on(repository)
|
||||||
.user(String.format("%s <%s>", currentUser.getDisplayName(), currentUser.getMail()))
|
.user(getFormattedUser(currentUser))
|
||||||
.message("Create new branch " + request.getNewBranch())
|
.message("Create new branch " + request.getNewBranch())
|
||||||
.execute();
|
.execute();
|
||||||
}
|
}
|
||||||
|
|
||||||
private void pullNewBranchIntoCentralRepository(BranchRequest request, WorkingCopy<com.aragost.javahg.Repository> workingCopy) {
|
private void pullChangesIntoCentralRepository(WorkingCopy<com.aragost.javahg.Repository, com.aragost.javahg.Repository> workingCopy, String branch) {
|
||||||
try {
|
try {
|
||||||
PullCommand pullCommand = PullCommand.on(workingCopy.getCentralRepository());
|
PullCommand pullCommand = PullCommand.on(workingCopy.getCentralRepository());
|
||||||
workdirFactory.configure(pullCommand);
|
workdirFactory.configure(pullCommand);
|
||||||
@@ -91,7 +116,7 @@ public class HgBranchCommand extends AbstractCommand implements BranchCommand {
|
|||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
// TODO handle failed update
|
// TODO handle failed update
|
||||||
throw new IntegrateChangesFromWorkdirException(getRepository(),
|
throw new IntegrateChangesFromWorkdirException(getRepository(),
|
||||||
String.format("Could not pull new branch '%s' into central repository", request.getNewBranch()),
|
String.format("Could not pull changes '%s' into central repository", branch),
|
||||||
e);
|
e);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -35,6 +35,8 @@ package sonia.scm.repository.spi;
|
|||||||
|
|
||||||
//~--- non-JDK imports --------------------------------------------------------
|
//~--- non-JDK imports --------------------------------------------------------
|
||||||
|
|
||||||
|
import com.aragost.javahg.Changeset;
|
||||||
|
import com.aragost.javahg.commands.LogCommand;
|
||||||
import com.google.common.base.MoreObjects;
|
import com.google.common.base.MoreObjects;
|
||||||
import com.google.common.base.Strings;
|
import com.google.common.base.Strings;
|
||||||
import sonia.scm.repository.BrowserResult;
|
import sonia.scm.repository.BrowserResult;
|
||||||
@@ -72,9 +74,11 @@ public class HgBrowseCommand extends AbstractCommand implements BrowseCommand
|
|||||||
public BrowserResult getBrowserResult(BrowseCommandRequest request) throws IOException {
|
public BrowserResult getBrowserResult(BrowseCommandRequest request) throws IOException {
|
||||||
HgFileviewCommand cmd = HgFileviewCommand.on(open());
|
HgFileviewCommand cmd = HgFileviewCommand.on(open());
|
||||||
|
|
||||||
if (!Strings.isNullOrEmpty(request.getRevision()))
|
String revision = MoreObjects.firstNonNull(request.getRevision(), "tip");
|
||||||
{
|
Changeset c = LogCommand.on(getContext().open()).rev(revision).limit(1).single();
|
||||||
cmd.rev(request.getRevision());
|
|
||||||
|
if (c != null) {
|
||||||
|
cmd.rev(c.getNode());
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!Strings.isNullOrEmpty(request.getPath()))
|
if (!Strings.isNullOrEmpty(request.getPath()))
|
||||||
@@ -98,6 +102,6 @@ public class HgBrowseCommand extends AbstractCommand implements BrowseCommand
|
|||||||
}
|
}
|
||||||
|
|
||||||
FileObject file = cmd.execute();
|
FileObject file = cmd.execute();
|
||||||
return new BrowserResult(MoreObjects.firstNonNull(request.getRevision(), "tip"), file);
|
return new BrowserResult(c == null? "tip": c.getNode(), revision, file);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -68,7 +68,7 @@ public class HgLogCommand extends AbstractCommand implements LogCommand
|
|||||||
//~--- get methods ----------------------------------------------------------
|
//~--- get methods ----------------------------------------------------------
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public Changeset getChangeset(String id) {
|
public Changeset getChangeset(String id, LogCommandRequest request) {
|
||||||
com.aragost.javahg.Repository repository = open();
|
com.aragost.javahg.Repository repository = open();
|
||||||
HgLogChangesetCommand cmd = on(repository);
|
HgLogChangesetCommand cmd = on(repository);
|
||||||
|
|
||||||
|
|||||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user