@changesets/read
Advanced tools
+7
-0
| # @changesets/read | ||
| ## 0.6.7 | ||
| ### Patch Changes | ||
| - Updated dependencies [[`1f91879`](https://github.com/changesets/changesets/commit/1f91879d4977c49593619b07e1374cd804f16757)]: | ||
| - @changesets/parse@0.4.3 | ||
| ## 0.6.6 | ||
@@ -4,0 +11,0 @@ |
@@ -130,4 +130,4 @@ 'use strict'; | ||
| } | ||
| async function getChangesets(cwd, sinceRef) { | ||
| let changesetBase = path__default["default"].join(cwd, ".changeset"); | ||
| async function getChangesets(rootDir, sinceRef) { | ||
| let changesetBase = path__default["default"].join(rootDir, ".changeset"); | ||
| let contents; | ||
@@ -134,0 +134,0 @@ try { |
@@ -100,4 +100,4 @@ import * as fs from 'fs-extra'; | ||
| } | ||
| async function getChangesets(cwd, sinceRef) { | ||
| let changesetBase = path.join(cwd, ".changeset"); | ||
| async function getChangesets(rootDir, sinceRef) { | ||
| let changesetBase = path.join(rootDir, ".changeset"); | ||
| let contents; | ||
@@ -104,0 +104,0 @@ try { |
| import { NewChangeset } from "@changesets/types"; | ||
| export default function getChangesets(cwd: string, sinceRef?: string): Promise<Array<NewChangeset>>; | ||
| export default function getChangesets(rootDir: string, sinceRef?: string): Promise<Array<NewChangeset>>; |
+2
-2
| { | ||
| "name": "@changesets/read", | ||
| "version": "0.6.6", | ||
| "version": "0.6.7", | ||
| "description": "Read changesets from disc, and return the information as JSON", | ||
@@ -24,3 +24,3 @@ "main": "dist/changesets-read.cjs.js", | ||
| "@changesets/logger": "^0.1.1", | ||
| "@changesets/parse": "^0.4.2", | ||
| "@changesets/parse": "^0.4.3", | ||
| "@changesets/types": "^6.1.0", | ||
@@ -27,0 +27,0 @@ "fs-extra": "^7.0.1", |
+19
-6
| import fs from "fs-extra"; | ||
| import path from "node:path"; | ||
| import outdent from "outdent"; | ||
@@ -101,2 +100,3 @@ import read from "./"; | ||
| }); | ||
| it("should return an empty array when no changesets are found", async () => { | ||
@@ -109,2 +109,3 @@ const cwd = await testdir({}); | ||
| }); | ||
| it("should error when there is no changeset folder", async () => { | ||
@@ -123,3 +124,4 @@ const cwd = await testdir({}); | ||
| }); | ||
| it("should error on broken changeset?", async () => { | ||
| it("should error on broken changeset", async () => { | ||
| const cwd = await testdir({ | ||
@@ -135,5 +137,14 @@ ".changeset/broken-changeset.md": `--- | ||
| expect(read(cwd)).rejects.toThrow( | ||
| outdent`could not parse changeset - invalid frontmatter: --- | ||
| await expect(read(cwd)).rejects.toThrowErrorMatchingInlineSnapshot(` | ||
| "could not parse changeset - missing or invalid frontmatter. | ||
| Changesets must start with frontmatter delimited by "---". | ||
| Example: | ||
| --- | ||
| "package-name": patch | ||
| --- | ||
| Your changeset summary here. | ||
| Received content: | ||
| --- | ||
| "cool-package": minor | ||
@@ -143,5 +154,6 @@ | ||
| Everything is wrong` | ||
| ); | ||
| Everything is wrong" | ||
| `); | ||
| }); | ||
| it("should return no releases and empty summary when the changeset is empty", async () => { | ||
@@ -162,2 +174,3 @@ const cwd = await testdir({ | ||
| }); | ||
| it("should filter out ignored changesets", async () => { | ||
@@ -164,0 +177,0 @@ const cwd = await testdir({ |
+2
-2
@@ -23,6 +23,6 @@ import fs from "fs-extra"; | ||
| export default async function getChangesets( | ||
| cwd: string, | ||
| rootDir: string, | ||
| sinceRef?: string | ||
| ): Promise<Array<NewChangeset>> { | ||
| let changesetBase = path.join(cwd, ".changeset"); | ||
| let changesetBase = path.join(rootDir, ".changeset"); | ||
| let contents: string[]; | ||
@@ -29,0 +29,0 @@ try { |
Filesystem access
Supply chain riskAccesses the file system, and could potentially read sensitive data.
Found 1 instance in 1 package
Filesystem access
Supply chain riskAccesses the file system, and could potentially read sensitive data.
Found 1 instance in 1 package
37356
1.14%612
1.16%Updated