@changesets/parse
Advanced tools
Comparing version 0.3.7 to 0.3.8
# @changesets/parse | ||
## 0.3.8 | ||
### Patch Changes | ||
- Updated dependencies [[`de2b4a5`](https://github.com/atlassian/changesets/commit/de2b4a5a7b244a37d94625bcb70ecde9dde5b612)]: | ||
- @changesets/types@4.0.0 | ||
## 0.3.7 | ||
@@ -4,0 +11,0 @@ |
@@ -5,6 +5,8 @@ 'use strict'; | ||
function _interopDefault (ex) { return (ex && (typeof ex === 'object') && 'default' in ex) ? ex['default'] : ex; } | ||
var yaml = require('js-yaml'); | ||
var yaml = _interopDefault(require('js-yaml')); | ||
function _interopDefault (e) { return e && e.__esModule ? e : { 'default': e }; } | ||
var yaml__default = /*#__PURE__*/_interopDefault(yaml); | ||
const mdRegex = /\s*---([^]*?)\n\s*---\s*\n([^]*)/; | ||
@@ -23,3 +25,3 @@ function parseChangesetFile(contents) { | ||
try { | ||
const yamlStuff = yaml.safeLoad(roughReleases); | ||
const yamlStuff = yaml__default['default'].safeLoad(roughReleases); | ||
@@ -26,0 +28,0 @@ if (yamlStuff) { |
"use strict"; | ||
function _interopDefault(ex) { | ||
return ex && "object" == typeof ex && "default" in ex ? ex.default : ex; | ||
} | ||
Object.defineProperty(exports, "__esModule", { | ||
@@ -11,4 +7,12 @@ value: !0 | ||
var yaml = _interopDefault(require("js-yaml")); | ||
var yaml = require("js-yaml"); | ||
function _interopDefault(e) { | ||
return e && e.__esModule ? e : { | ||
default: e | ||
}; | ||
} | ||
var yaml__default = _interopDefault(yaml); | ||
const mdRegex = /\s*---([^]*?)\n\s*---\s*\n([^]*)/; | ||
@@ -18,14 +22,14 @@ | ||
const execResult = mdRegex.exec(contents); | ||
if (!execResult) throw new Error(`could not parse changeset - invalid frontmatter: ${contents}`); | ||
if (!execResult) throw new Error("could not parse changeset - invalid frontmatter: " + contents); | ||
let releases, [, roughReleases, roughSummary] = execResult, summary = roughSummary.trim(); | ||
try { | ||
const yamlStuff = yaml.safeLoad(roughReleases); | ||
releases = yamlStuff ? Object.entries(yamlStuff).map(([name, type]) => ({ | ||
const yamlStuff = yaml__default.default.safeLoad(roughReleases); | ||
releases = yamlStuff ? Object.entries(yamlStuff).map((([name, type]) => ({ | ||
name: name, | ||
type: type | ||
})) : []; | ||
}))) : []; | ||
} catch (e) { | ||
throw new Error(`could not parse changeset - invalid frontmatter: ${contents}`); | ||
throw new Error("could not parse changeset - invalid frontmatter: " + contents); | ||
} | ||
if (!releases) throw new Error(`could not parse changeset - unknown error: ${contents}`); | ||
if (!releases) throw new Error("could not parse changeset - unknown error: " + contents); | ||
return { | ||
@@ -32,0 +36,0 @@ releases: releases, |
{ | ||
"name": "@changesets/parse", | ||
"version": "0.3.7", | ||
"version": "0.3.8", | ||
"description": "Parse a changeset file's contents into a usable json object", | ||
@@ -8,5 +8,5 @@ "main": "dist/parse.cjs.js", | ||
"license": "MIT", | ||
"repository": "https://github.com/changesets/changesets/tree/master/packages/parse", | ||
"repository": "https://github.com/changesets/changesets/tree/main/packages/parse", | ||
"dependencies": { | ||
"@changesets/types": "^3.0.0", | ||
"@changesets/types": "^4.0.0", | ||
"js-yaml": "^3.13.1" | ||
@@ -13,0 +13,0 @@ }, |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
No repository
Supply chain riskPackage does not have a linked source code repository. Without this field, a package will have no reference to the location of the source code use to generate the package.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
No repository
Supply chain riskPackage does not have a linked source code repository. Without this field, a package will have no reference to the location of the source code use to generate the package.
Found 1 instance in 1 package
15761
323
+ Added@changesets/types@4.1.0(transitive)
- Removed@changesets/types@3.3.0(transitive)
Updated@changesets/types@^4.0.0