Socket
Socket
Sign inDemoInstall

@changesets/apply-release-plan

Package Overview
Dependencies
Maintainers
4
Versions
47
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@changesets/apply-release-plan - npm Package Compare versions

Comparing version 7.0.0 to 7.0.1

6

CHANGELOG.md
# @changesets/apply-release-plan
## 7.0.1
### Patch Changes
- [#1351](https://github.com/changesets/changesets/pull/1351) [`c6da182`](https://github.com/changesets/changesets/commit/c6da182ece2ec40974f15f3efcf9d9ba20cf122b) Thanks [@TheHolyWaffle](https://github.com/TheHolyWaffle)! - Fix an issue with not applying a custom `.prettierrc` configuration with `prettier@>= 3.1.1`
## 7.0.0

@@ -4,0 +10,0 @@

19

dist/changesets-apply-release-plan.cjs.js

@@ -309,3 +309,2 @@ 'use strict';

let prettierInstance = getPrettierInstance(cwd);
let prettierConfig = await prettierInstance.resolveConfig(cwd);

@@ -325,3 +324,3 @@ for (let release of finalisedRelease) {

const changelogPath = path__default["default"].resolve(dir, "CHANGELOG.md");
await updateChangelog(changelogPath, changelog, name, prettierInstance, prettierConfig);
await updateChangelog(changelogPath, changelog, name, prettierInstance);
touchedFiles.push(changelogPath);

@@ -405,3 +404,3 @@ }

async function updateChangelog(changelogPath, changelog, name, prettierInstance, prettierConfig) {
async function updateChangelog(changelogPath, changelog, name, prettierInstance) {
let templateString = `\n\n${changelog.trim()}\n`;

@@ -411,5 +410,5 @@

if (fs__default["default"].existsSync(changelogPath)) {
await prependFile(changelogPath, templateString, name, prettierInstance, prettierConfig);
await prependFile(changelogPath, templateString, name, prettierInstance);
} else {
await writeFormattedMarkdownFile(changelogPath, `# ${name}${templateString}`, prettierInstance, prettierConfig);
await writeFormattedMarkdownFile(changelogPath, `# ${name}${templateString}`, prettierInstance);
}

@@ -428,3 +427,3 @@ } catch (e) {

async function prependFile(filePath, data, name, prettierInstance, prettierConfig) {
async function prependFile(filePath, data, name, prettierInstance) {
const fileData = fs__default["default"].readFileSync(filePath).toString(); // if the file exists but doesn't have the header, we'll add it in

@@ -434,3 +433,3 @@

const completelyNewChangelog = `# ${name}${data}`;
await writeFormattedMarkdownFile(filePath, completelyNewChangelog, prettierInstance, prettierConfig);
await writeFormattedMarkdownFile(filePath, completelyNewChangelog, prettierInstance);
return;

@@ -440,8 +439,8 @@ }

const newChangelog = fileData.replace("\n", data);
await writeFormattedMarkdownFile(filePath, newChangelog, prettierInstance, prettierConfig);
await writeFormattedMarkdownFile(filePath, newChangelog, prettierInstance);
}
async function writeFormattedMarkdownFile(filePath, content, prettierInstance, prettierConfig) {
async function writeFormattedMarkdownFile(filePath, content, prettierInstance) {
await fs__default["default"].writeFile(filePath, // Prettier v3 returns a promise
await prettierInstance.format(content, _objectSpread(_objectSpread({}, prettierConfig), {}, {
await prettierInstance.format(content, _objectSpread(_objectSpread({}, await prettierInstance.resolveConfig(filePath)), {}, {
filepath: filePath,

@@ -448,0 +447,0 @@ parser: "markdown"

@@ -273,3 +273,2 @@ import _objectSpread from '@babel/runtime/helpers/esm/objectSpread2';

let prettierInstance = getPrettierInstance(cwd);
let prettierConfig = await prettierInstance.resolveConfig(cwd);

@@ -289,3 +288,3 @@ for (let release of finalisedRelease) {

const changelogPath = path.resolve(dir, "CHANGELOG.md");
await updateChangelog(changelogPath, changelog, name, prettierInstance, prettierConfig);
await updateChangelog(changelogPath, changelog, name, prettierInstance);
touchedFiles.push(changelogPath);

@@ -369,3 +368,3 @@ }

async function updateChangelog(changelogPath, changelog, name, prettierInstance, prettierConfig) {
async function updateChangelog(changelogPath, changelog, name, prettierInstance) {
let templateString = `\n\n${changelog.trim()}\n`;

@@ -375,5 +374,5 @@

if (fs.existsSync(changelogPath)) {
await prependFile(changelogPath, templateString, name, prettierInstance, prettierConfig);
await prependFile(changelogPath, templateString, name, prettierInstance);
} else {
await writeFormattedMarkdownFile(changelogPath, `# ${name}${templateString}`, prettierInstance, prettierConfig);
await writeFormattedMarkdownFile(changelogPath, `# ${name}${templateString}`, prettierInstance);
}

@@ -392,3 +391,3 @@ } catch (e) {

async function prependFile(filePath, data, name, prettierInstance, prettierConfig) {
async function prependFile(filePath, data, name, prettierInstance) {
const fileData = fs.readFileSync(filePath).toString(); // if the file exists but doesn't have the header, we'll add it in

@@ -398,3 +397,3 @@

const completelyNewChangelog = `# ${name}${data}`;
await writeFormattedMarkdownFile(filePath, completelyNewChangelog, prettierInstance, prettierConfig);
await writeFormattedMarkdownFile(filePath, completelyNewChangelog, prettierInstance);
return;

@@ -404,8 +403,8 @@ }

const newChangelog = fileData.replace("\n", data);
await writeFormattedMarkdownFile(filePath, newChangelog, prettierInstance, prettierConfig);
await writeFormattedMarkdownFile(filePath, newChangelog, prettierInstance);
}
async function writeFormattedMarkdownFile(filePath, content, prettierInstance, prettierConfig) {
async function writeFormattedMarkdownFile(filePath, content, prettierInstance) {
await fs.writeFile(filePath, // Prettier v3 returns a promise
await prettierInstance.format(content, _objectSpread(_objectSpread({}, prettierConfig), {}, {
await prettierInstance.format(content, _objectSpread(_objectSpread({}, await prettierInstance.resolveConfig(filePath)), {}, {
filepath: filePath,

@@ -412,0 +411,0 @@ parser: "markdown"

{
"name": "@changesets/apply-release-plan",
"version": "7.0.0",
"version": "7.0.1",
"description": "Takes a release plan and applies it to packages",

@@ -5,0 +5,0 @@ "main": "dist/changesets-apply-release-plan.cjs.js",

@@ -136,3 +136,2 @@ import {

let prettierInstance = getPrettierInstance(cwd);
let prettierConfig = await prettierInstance.resolveConfig(cwd);

@@ -148,9 +147,3 @@ for (let release of finalisedRelease) {

const changelogPath = path.resolve(dir, "CHANGELOG.md");
await updateChangelog(
changelogPath,
changelog,
name,
prettierInstance,
prettierConfig
);
await updateChangelog(changelogPath, changelog, name, prettierInstance);
touchedFiles.push(changelogPath);

@@ -278,4 +271,3 @@ }

name: string,
prettierInstance: typeof prettier,
prettierConfig: prettier.Options | null
prettierInstance: typeof prettier
) {

@@ -286,9 +278,3 @@ let templateString = `\n\n${changelog.trim()}\n`;

if (fs.existsSync(changelogPath)) {
await prependFile(
changelogPath,
templateString,
name,
prettierInstance,
prettierConfig
);
await prependFile(changelogPath, templateString, name, prettierInstance);
} else {

@@ -298,4 +284,3 @@ await writeFormattedMarkdownFile(

`# ${name}${templateString}`,
prettierInstance,
prettierConfig
prettierInstance
);

@@ -324,4 +309,3 @@ }

name: string,
prettierInstance: typeof prettier,
prettierConfig: prettier.Options | null
prettierInstance: typeof prettier
) {

@@ -335,4 +319,3 @@ const fileData = fs.readFileSync(filePath).toString();

completelyNewChangelog,
prettierInstance,
prettierConfig
prettierInstance
);

@@ -343,8 +326,3 @@ return;

await writeFormattedMarkdownFile(
filePath,
newChangelog,
prettierInstance,
prettierConfig
);
await writeFormattedMarkdownFile(filePath, newChangelog, prettierInstance);
}

@@ -355,4 +333,3 @@

content: string,
prettierInstance: typeof prettier,
prettierConfig: prettier.Options | null
prettierInstance: typeof prettier
) {

@@ -363,3 +340,3 @@ await fs.writeFile(

await prettierInstance.format(content, {
...prettierConfig,
...(await prettierInstance.resolveConfig(filePath)),
filepath: filePath,

@@ -366,0 +343,0 @@ parser: "markdown",

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc