Skip to content
This repository was archived by the owner on Mar 17, 2025. It is now read-only.

Commit cabee39

Browse files
committed
Merge branch 'develop'
# Conflicts: # scripts/utils/changesets.js
2 parents 6387bc0 + 640b612 commit cabee39

File tree

6 files changed

+76
-13
lines changed

6 files changed

+76
-13
lines changed
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
---
2+
title: 'feat: datetime-scalar'
3+
pr: 62
4+
author: jasonbahl
5+
type: feat
6+
breaking: false
7+
branch: milestone/custom-scalars
8+
---
9+
null
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
---
2+
title: 'feat: date scalar'
3+
pr: 65
4+
author: jasonbahl
5+
type: feat
6+
breaking: false
7+
branch: milestone/custom-scalars
8+
---
9+
null

.github/workflows/generate-changeset.yml

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -179,14 +179,12 @@ jobs:
179179
# Create a temporary directory for release notes
180180
mkdir -p /tmp/release-notes
181181
182-
# Generate release notes from all changesets to a temporary file
183-
# For develop branch, include all changesets (including those from milestone branches)
182+
# For develop branch, don't filter by branch to include all changesets
184183
if [[ "${{ steps.target_branch.outputs.name }}" == "develop" ]]; then
185184
echo "Generating release notes for develop branch (including milestone branch changesets)"
186185
npm run release:notes > /tmp/release-notes/temp_notes_raw.md
187186
else
188-
# For other branches, filter by branch
189-
echo "Generating release notes for ${{ steps.target_branch.outputs.name }} branch"
187+
# For other branches, filter by branch as before
190188
npm run release:notes -- --branch="${{ steps.target_branch.outputs.name }}" > /tmp/release-notes/temp_notes_raw.md
191189
fi
192190
@@ -317,7 +315,7 @@ jobs:
317315
if: steps.target_branch.outputs.is_milestone == 'true' && steps.check_milestone_pr.outputs.exists == 'false'
318316
run: |
319317
# Create a new PR from milestone branch to develop
320-
PR_TITLE="feat: ${{ steps.target_branch.outputs.milestone_name }} 🚀"
318+
PR_TITLE="milestone: ${{ steps.target_branch.outputs.milestone_name }} 🚀"
321319
322320
# Create the PR body with proper formatting
323321
PR_BODY="## Milestone: ${{ steps.target_branch.outputs.milestone_name }}"

automation-tests.php

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,8 @@
2020
// SCALARS:
2121
// - Email
2222
// - Phone
23+
// - DateTime
24+
// - Date
2325

2426
// BREAKING CHANGE
25-
// We're simulating a breaking change with this comment.
27+
// We're simulating a breaking change with this comment.

scripts/generate-release-notes.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -159,7 +159,7 @@ async function generateMarkdownReleaseNotes(changesets, repoUrl, token) {
159159
const bumpType = determineBumpType(changesets);
160160

161161
// Start building the release notes
162-
let notes = `## Release Notes\n\n`;
162+
let notes = ``;
163163

164164
// Add breaking changes section if there are any
165165
if (categories.breaking.length > 0) {

scripts/utils/changesets.js

Lines changed: 51 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ async function readChangeset(filePath) {
7575
* @returns {Promise<Array>} Array of changeset objects
7676
*/
7777
async function readAllChangesets(options = {}) {
78-
const { branch } = options;
78+
const { branch } = options || {};
7979

8080
// Get all changeset files
8181
const changesetDir = path.join(process.cwd(), '.changesets');
@@ -103,22 +103,66 @@ async function readAllChangesets(options = {}) {
103103
// Special case for develop branch - include milestone branch changesets
104104
if (branch === 'develop') {
105105
return changesets.filter(changeset =>
106+
!changeset.branch || // Include changesets without branch info
106107
changeset.branch === branch ||
107-
changeset.branch === undefined || // Include changesets without branch info
108108
changeset.branch.startsWith('milestone/')
109109
);
110110
}
111111

112-
// Otherwise, filter by the specified branch
112+
// Otherwise, use the original filtering logic
113113
return changesets.filter(changeset =>
114-
changeset.branch === branch ||
115-
changeset.branch === undefined // Include changesets without branch info
114+
!changeset.branch || // Include changesets without branch info
115+
changeset.branch === branch
116116
);
117117
}
118118

119119
return changesets;
120120
}
121121

122+
/**
123+
* Parse changeset content from a file
124+
*
125+
* @param {string} content The content of the changeset file
126+
* @returns {Object} Parsed changeset object
127+
*/
128+
function parseChangesetContent(content) {
129+
// Use your existing parsing logic here
130+
// This should extract title, PR number, author, type, breaking flag, branch, etc.
131+
// from the changeset content
132+
133+
// Example implementation (adjust based on your actual changeset format):
134+
const lines = content.split('\n');
135+
const changeset = {
136+
title: '',
137+
pr: null,
138+
author: '',
139+
type: 'other',
140+
breaking: false,
141+
branch: undefined,
142+
description: ''
143+
};
144+
145+
// Parse metadata lines (key: value format)
146+
const metadataLines = lines.filter(line => line.includes(':'));
147+
for (const line of metadataLines) {
148+
const [key, value] = line.split(':', 2).map(part => part.trim());
149+
if (key === 'title') changeset.title = value;
150+
else if (key === 'pr') changeset.pr = parseInt(value, 10) || null;
151+
else if (key === 'author') changeset.author = value;
152+
else if (key === 'type') changeset.type = value;
153+
else if (key === 'breaking') changeset.breaking = value === 'true';
154+
else if (key === 'branch') changeset.branch = value;
155+
}
156+
157+
// Extract description (everything after metadata)
158+
const descriptionStartIndex = metadataLines.length;
159+
if (descriptionStartIndex < lines.length) {
160+
changeset.description = lines.slice(descriptionStartIndex).join('\n').trim();
161+
}
162+
163+
return changeset;
164+
}
165+
122166
/**
123167
* Determine the version bump type based on changesets
124168
*
@@ -236,5 +280,6 @@ module.exports = {
236280
determineBumpType,
237281
categorizeChangesets,
238282
createChangeset,
239-
deleteAllChangesets
283+
deleteAllChangesets,
284+
parseChangesetContent
240285
};

0 commit comments

Comments
 (0)