Skip to content

Commit 885f1a7

Browse files
authored
Merge pull request #22 from cosmos/reorg-evm
Reorg evm
2 parents ef50320 + 1505a9b commit 885f1a7

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

79 files changed

+7103
-799
lines changed

.github/workflows/sync-evm-changelog.yml

Lines changed: 50 additions & 74 deletions
Original file line numberDiff line numberDiff line change
@@ -59,65 +59,20 @@ jobs:
5959
let categories = {};
6060
let allVersions = [];
6161
62+
// For init mode, just parse UNRELEASED as the initial version
6263
if (initMode) {
63-
// Parse all versions for initialization
64-
let currentVersion = null;
65-
let currentVersionContent = {};
66-
let inVersionSection = false;
67-
68-
for (let i = 0; i < lines.length; i++) {
69-
const line = lines[i].trim();
70-
71-
// Look for version headers (## [version] - date or ## version - date or ## version)
72-
const versionMatch = line.match(/^##\s*(?:\[([^\]]+)\](?:\s*-\s*(.+))?|([^-\s]+)(?:\s*-\s*(.+))?)/);
73-
74-
if (versionMatch && line !== '## UNRELEASED') {
75-
// Save previous version if exists
76-
if (currentVersion && Object.keys(currentVersionContent).length > 0) {
77-
allVersions.push({
78-
version: currentVersion,
79-
date: currentVersionDate || 'Unknown',
80-
categories: currentVersionContent
81-
});
82-
}
83-
84-
currentVersion = versionMatch[1] || versionMatch[3];
85-
var currentVersionDate = versionMatch[2] || versionMatch[4];
86-
currentVersionContent = {};
87-
currentCategory = null;
88-
inVersionSection = true;
89-
continue;
90-
}
91-
92-
// Skip UNRELEASED section for init mode
93-
if (line === '## UNRELEASED') {
94-
inVersionSection = false;
95-
continue;
96-
}
97-
98-
// Look for category headers (### CATEGORY)
99-
if (inVersionSection && line.startsWith('### ')) {
100-
currentCategory = line.replace('### ', '').trim();
101-
currentVersionContent[currentCategory] = [];
102-
continue;
103-
}
104-
105-
// Collect content under each category
106-
if (inVersionSection && currentCategory && line && !line.startsWith('#')) {
107-
currentVersionContent[currentCategory].push(line);
108-
}
64+
const result = parseChangelog(content, releaseTag, false);
65+
if (result.hasContent) {
66+
return {
67+
allVersions: [{
68+
version: releaseTag,
69+
date: new Date().toISOString().split('T')[0],
70+
categories: result.categories
71+
}],
72+
hasContent: true
73+
};
10974
}
110-
111-
// Don't forget the last version
112-
if (currentVersion && Object.keys(currentVersionContent).length > 0) {
113-
allVersions.push({
114-
version: currentVersion,
115-
date: currentVersionDate || 'Unknown',
116-
categories: currentVersionContent
117-
});
118-
}
119-
120-
return { allVersions, hasContent: allVersions.length > 0 };
75+
return { allVersions: [], hasContent: false };
12176
}
12277
12378
// Original single version parsing for regular updates
@@ -321,7 +276,7 @@ jobs:
321276
EOF
322277
323278
# Check if this is initialization mode (changelog file doesn't exist)
324-
CHANGELOG_FILE="docs/evm/changelog.mdx"
279+
CHANGELOG_FILE="docs/changelog/release-notes.mdx"
325280
if [ ! -f "$CHANGELOG_FILE" ]; then
326281
echo "Initializing changelog with all previous versions..."
327282
node parse_changelog.js "${{ steps.fetch-changelog.outputs.release_tag }}" init
@@ -332,7 +287,7 @@ jobs:
332287
333288
- name: Update changelog file
334289
run: |
335-
CHANGELOG_FILE="docs/evm/changelog.mdx"
290+
CHANGELOG_FILE="docs/changelog/release-notes.mdx"
336291
UPDATE_CONTENT=$(cat /tmp/update_component.mdx)
337292
338293
# Check if the changelog file exists
@@ -343,11 +298,11 @@ jobs:
343298
344299
# Create the file with proper YAML front matter using printf
345300
printf '%s\n' '---' > "$CHANGELOG_FILE"
346-
printf '%s\n' 'title: "EVM Changelog"' >> "$CHANGELOG_FILE"
347-
printf '%s\n' 'description: "Track changes and updates to the Cosmos EVM"' >> "$CHANGELOG_FILE"
301+
printf '%s\n' 'title: "Changelog"' >> "$CHANGELOG_FILE"
302+
printf '%s\n' 'description: "Follows the \`CHANGELOG.md\` for \`cosmos/evm\`"' >> "$CHANGELOG_FILE"
348303
printf '%s\n' '---' >> "$CHANGELOG_FILE"
349304
printf '\n' >> "$CHANGELOG_FILE"
350-
printf '%s\n' '# EVM Changelog' >> "$CHANGELOG_FILE"
305+
printf '%s\n' '# Changelog' >> "$CHANGELOG_FILE"
351306
printf '\n' >> "$CHANGELOG_FILE"
352307
printf '%s\n' 'This page tracks all releases and changes to the Cosmos EVM module.' >> "$CHANGELOG_FILE"
353308
printf '\n' >> "$CHANGELOG_FILE"
@@ -359,22 +314,43 @@ jobs:
359314
# Find the insertion point (after the front matter and title)
360315
# Insert the new update at the top of the changelog entries
361316
awk -v update="$UPDATE_CONTENT" '
362-
BEGIN { found_title = 0; inserted = 0 }
363-
/^# / && found_title == 0 {
364-
print $0
365-
print ""
366-
print update
367-
inserted = 1
368-
found_title = 1
317+
BEGIN { found_header = 0; found_intro = 0; inserted = 0 }
318+
319+
# Skip frontmatter
320+
/^---$/ && NR == 1 { in_frontmatter = 1; print; next }
321+
/^---$/ && in_frontmatter { in_frontmatter = 0; print; next }
322+
in_frontmatter { print; next }
323+
324+
# Find the main title
325+
/^# / && !found_header {
326+
print
327+
found_header = 1
369328
next
370329
}
371-
/^<Update/ && inserted == 0 {
372-
print update
373-
inserted = 1
330+
331+
# After title, look for intro text or existing Update
332+
found_header && !inserted {
333+
if (/^This page tracks/ || /^$/) {
334+
print
335+
if (/^This page tracks/) found_intro = 1
336+
if (found_intro && /^$/) {
337+
print update
338+
inserted = 1
339+
}
340+
} else if (/^<Update/) {
341+
print update
342+
print
343+
inserted = 1
344+
} else {
345+
print
346+
}
347+
next
374348
}
349+
375350
{ print }
351+
376352
END {
377-
if (inserted == 0) {
353+
if (!inserted) {
378354
print ""
379355
print update
380356
}
@@ -388,7 +364,7 @@ jobs:
388364
git config --local user.email "[email protected]"
389365
git config --local user.name "GitHub Action"
390366
391-
git add docs/evm/changelog.mdx
367+
git add docs/changelog/release-notes.mdx
392368
393369
if git diff --staged --quiet; then
394370
echo "No changes to commit"

.gitignore

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -36,9 +36,6 @@ Thumbs.db
3636
.cursorrules
3737
.context/
3838
context/
39-
./.claude
40-
*/.claude/
41-
*/**/.claude/
4239

4340
# Optional: lock files if using alternative package managers
4441

@@ -57,23 +54,20 @@ __pycache__/
5754
*.pyc
5855
*.pyo
5956

60-
# Temporary protobuf files
61-
proto-sources/
62-
6357
# Mintlify build files
6458
.mintlify/
6559

6660
# Misc
67-
6861
docs/logs/
6962
logs/
7063
dist/
7164
build/
7265
.yarn/
7366
docs/devnet/tests/*
7467
scripts/*
68+
tests/*
69+
.ingress/
7570

7671
# Markdown lint cache
77-
7872
.md-cache
7973
.claude/settings.local.json

.yarnrc.yml

Lines changed: 0 additions & 27 deletions
This file was deleted.

README.md

Lines changed: 18 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -4,30 +4,30 @@
44
55
## Contributing
66

7-
1. **Fork the repository**
7+
Fork the repository
88

9-
- Click “Fork” in the GitHub UI to create your own copy.
9+
- Click “Fork” in the GitHub UI to create your own copy.
10+
11+
Clone your fork
1012

11-
3. **Clone your fork**
12-
1313
```bash
1414
git clone https://github.com/<your-username>/cosmos-docs.git
1515
cd cosmos-docs
16-
````
16+
```
1717

18-
3. **Create a branch**
18+
Create a branch
1919

2020
```bash
2121
git checkout -b my-feature
2222
```
2323

24-
4. **Make your changes**
24+
Make your changes
2525

26-
* Edit or add files under `docs/` as needed.
27-
* Follow existing file structure and naming conventions.
28-
* Ensure Markdown is valid and links resolve.
26+
- Edit or add files under `docs/` as needed.
27+
- Follow existing file structure and naming conventions.
28+
- Ensure Markdown is valid and links resolve.
2929

30-
5. **Local testing & validation**
30+
Local testing & validation
3131

3232
```bash
3333
# Start a live-reload preview
@@ -41,19 +41,18 @@
4141
```
4242

4343
*Source: [Mintlify CLI docs](https://mintlify.com/docs)*
44-
6. **Commit and push**
44+
45+
Commit and push
4546

4647
```bash
4748
git add .
4849
git commit -m "Brief description of your change"
4950
git push origin my-feature
5051
```
5152

52-
7. **Open a Pull Request**
53-
54-
* On GitHub, navigate to your fork.
55-
* Click “Compare & pull request.”
56-
* Provide a concise title and description.
57-
* Submit the PR for review.
58-
53+
Open a Pull Request
5954

55+
- On GitHub, navigate to your fork.
56+
- Click “Compare & pull request.”
57+
- Provide a concise title and description.
58+
- Submit the PR for review.

assets/public/remix-provider.png

49 KB
Loading

0 commit comments

Comments
 (0)