Repository: atlassian/changesets (ts)

Issue:
Expand on range types changesets supports
Currently changesets supports `1.0.0`, `~1.0.0`, and `^1.0.0`, which is a subset of valid semver definitions.

@mitchellhamilton found the range types that yarn supports, and suggested we should do that.

So we need to: refind that info (I have lost the link he gave me soz)
Align our range type function with it.

Pull request description:
Add support for other range types
Closes #99

Patch:
diff --git a/.changeset/selfish-papayas-mix.md b/.changeset/selfish-papayas-mix.md
new file mode 100644
index 0000000..0189d45
--- /dev/null
+++ b/.changeset/selfish-papayas-mix.md
@@ -0,0 +1,5 @@
+---
+"@changesets/get-version-range-type": minor
+---
+
+Add support for other range types
diff --git a/packages/get-version-range-type/src/index.ts b/packages/get-version-range-type/src/index.ts
index 4e96188..49fd0aa 100644
--- a/packages/get-version-range-type/src/index.ts
+++ b/packages/get-version-range-type/src/index.ts
@@ -1,8 +1,10 @@
 export default function getVersionRangeType(
   versionRange: string
-): "^" | "~" | ">=" | "" {
+): "^" | "~" | ">=" | "<=" | ">" | "" {
   if (versionRange.charAt(0) === "^") return "^";
   if (versionRange.charAt(0) === "~") return "~";
   if (versionRange.startsWith(">=")) return ">=";
+  if (versionRange.startsWith("<=")) return "<=";
+  if (versionRange.charAt(0) === ">") return ">";
   return "";
 }


Test patch:
diff --git a/packages/get-version-range-type/src/index.test.ts b/packages/get-version-range-type/src/index.test.ts
new file mode 100644
index 0000000..60e7310
--- /dev/null
+++ b/packages/get-version-range-type/src/index.test.ts
@@ -0,0 +1,12 @@
+import getVersionRangeType from "./";
+
+test.each([
+  ["^1.0.0", "^"],
+  ["~1.0.0", "~"],
+  [">=1.0.0", ">="],
+  ["<=1.0.0", "<="],
+  [">1.0.0", ">"],
+  ["1.0.0", ""]
+])('getVersionRangeType should return "%s" if passed "%s"', (input, output) => {
+  expect(getVersionRangeType(input)).toEqual(output);
+});