@plasius/schema 1.0.11 → 1.0.13

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -38,7 +38,7 @@ jobs:
38
38
  NEW_VER=$(npm version patch -m "chore: release v%s [skip ci]")
39
39
  echo "New version: $NEW_VER"
40
40
  git push --follow-tags
41
-
41
+
42
42
  # Expose tag (vX.Y.Z) and version (X.Y.Z) for later steps
43
43
  VER_NO_V=${NEW_VER#v}
44
44
  echo "tag=$NEW_VER" >> "$GITHUB_OUTPUT"
@@ -52,6 +52,89 @@ jobs:
52
52
  echo "flags=--access public" >> "$GITHUB_OUTPUT"
53
53
  fi
54
54
 
55
+ - name: Update CHANGELOG.md (move Unreleased to new version)
56
+ env:
57
+ VERSION: ${{ steps.pkg.outputs.version }}
58
+ TAG: ${{ steps.pkg.outputs.tag }}
59
+ GITHUB_REPOSITORY: ${{ github.repository }}
60
+ run: |
61
+ set -euo pipefail
62
+
63
+ FILE="CHANGELOG.md"
64
+ if [ ! -f "$FILE" ]; then
65
+ echo "No CHANGELOG.md found; skipping changelog update."
66
+ exit 0
67
+ fi
68
+
69
+ DATE=$(date -u +%Y-%m-%d)
70
+ VERSION_LINE="## [${VERSION}] - ${DATE}"
71
+
72
+ # Identify Unreleased block boundaries
73
+ UNREL_START=$(grep -n '^## \[Unreleased\]' "$FILE" | cut -d: -f1 || true)
74
+ if [ -z "$UNREL_START" ]; then
75
+ echo "No '## [Unreleased]' section found; skipping changelog update."
76
+ exit 0
77
+ fi
78
+ NEXT_HDR=$(awk 'NR>'"$UNREL_START"' && /^## \[/{print NR; exit}' "$FILE")
79
+ if [ -z "$NEXT_HDR" ]; then
80
+ NEXT_HDR=$(wc -l < "$FILE")
81
+ NEXT_HDR=$((NEXT_HDR+1))
82
+ fi
83
+
84
+ # Extract sections
85
+ HEADER=$(sed -n "1,${UNREL_START}p" "$FILE")
86
+ UNREL_CONTENT=$(sed -n "$((UNREL_START+1)),$((NEXT_HDR-1))p" "$FILE")
87
+ TAIL=$(sed -n "${NEXT_HDR},\$p" "$FILE")
88
+
89
+ # Prepare new Unreleased template (Keep a Changelog style) without tabs/indent issues
90
+ NEW_UNRELEASED=$(printf '%s\n' \
91
+ '## [Unreleased]' \
92
+ '- **Added**' \
93
+ ' - (placeholder)' \
94
+ '' \
95
+ '- **Changed**' \
96
+ ' - (placeholder)' \
97
+ '' \
98
+ '- **Fixed**' \
99
+ ' - (placeholder)' \
100
+ '' \
101
+ '- **Security**' \
102
+ ' - (placeholder)')
103
+
104
+ # Build the new CHANGELOG content
105
+ TMP_FILE=$(mktemp)
106
+ {
107
+ printf "%s\n" "$HEADER"
108
+ printf "%s\n\n" "$NEW_UNRELEASED"
109
+ printf "%s\n" "$VERSION_LINE"
110
+ # If Unreleased was empty, at least add a placeholder so the section isn't blank
111
+ if [ -z "$(echo "$UNREL_CONTENT" | tr -d '\n' | tr -d '[:space:]')" ]; then
112
+ printf "### Changed\n- (no notable changes)\n\n"
113
+ else
114
+ printf "%s\n" "$UNREL_CONTENT"
115
+ # Ensure a trailing newline after the inserted section
116
+ printf "\n"
117
+ fi
118
+ printf "%s\n" "$TAIL"
119
+ } > "$TMP_FILE"
120
+
121
+ mv "$TMP_FILE" "$FILE"
122
+
123
+ # Update bottom compare links
124
+ # Update [Unreleased] compare to start at v${VERSION}
125
+ COMPARE_URL="https://github.com/${GITHUB_REPOSITORY}/compare/v${VERSION}...HEAD"
126
+ sed -E -i.bak "s|^\[Unreleased\]: .*|[Unreleased]: ${COMPARE_URL}|" "$FILE" || true
127
+ rm -f "$FILE.bak"
128
+
129
+ # Append a link for the new version if not present
130
+ if ! grep -q "^\[${VERSION}\]:" "$FILE"; then
131
+ echo "[${VERSION}]: https://github.com/${GITHUB_REPOSITORY}/releases/tag/v${VERSION}" >> "$FILE"
132
+ fi
133
+
134
+ git add "$FILE"
135
+ git commit -m "docs(changelog): release v${VERSION}"
136
+ git push
137
+
55
138
  - name: Create GitHub Release from tag (first-party)
56
139
  env:
57
140
  GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
package/CHANGELOG.md CHANGED
@@ -8,6 +8,20 @@ The format is based on **[Keep a Changelog](https://keepachangelog.com/en/1.1.0/
8
8
  ---
9
9
 
10
10
  ## [Unreleased]
11
+ ## [Unreleased]
12
+ - **Added**
13
+ - (placeholder)
14
+
15
+ - **Changed**
16
+ - (placeholder)
17
+
18
+ - **Fixed**
19
+ - (placeholder)
20
+
21
+ - **Security**
22
+ - (placeholder)
23
+
24
+ ## [1.0.13] - 2025-09-16
11
25
 
12
26
  - **Added**
13
27
  - (placeholder) Add new validators, field helpers, or PII utilities here.
@@ -61,5 +75,6 @@ The format is based on **[Keep a Changelog](https://keepachangelog.com/en/1.1.0/
61
75
 
62
76
  ---
63
77
 
64
- [Unreleased]: https://github.com/Plasius-LTD/plasius-schema/compare/v1.0.0...HEAD
78
+ [Unreleased]: https://github.com/Plasius-LTD/schema/compare/v1.0.13...HEAD
65
79
  [1.0.0]: https://github.com/Plasius-LTD/plasius-schema/releases/tag/v1.0.0
80
+ [1.0.13]: https://github.com/Plasius-LTD/schema/releases/tag/v1.0.13
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@plasius/schema",
3
- "version": "1.0.11",
3
+ "version": "1.0.13",
4
4
  "description": "Entity schema definition & validation helpers for Plasius ecosystem",
5
5
  "type": "module",
6
6
  "main": "./dist/index.cjs",