@vv0rkz/js-template 1.6.1 → 1.6.2

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.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@vv0rkz/js-template",
3
- "version": "1.6.1",
3
+ "version": "1.6.2",
4
4
  "description": "Reusable setup for JS projects with husky, changelog, gh tools",
5
5
  "type": "module",
6
6
  "bin": {
@@ -23,7 +23,6 @@ let readme = readFileSync('README.md', 'utf8')
23
23
  let repoUrl
24
24
  try {
25
25
  const remoteUrl = execSync('git config --get remote.origin.url').toString().trim()
26
- // Преобразуем git@github.com:user/repo.git в https://github.com/user/repo
27
26
  if (remoteUrl.includes('github.com')) {
28
27
  repoUrl = remoteUrl.replace('git@github.com:', 'https://github.com/').replace('.git', '')
29
28
  }
@@ -51,8 +50,10 @@ versionBlocks.forEach((versionBlock) => {
51
50
  return
52
51
  }
53
52
 
54
- // Пропускаем если нет фич
55
- if (!versionBlock.includes('### ✨ Фичи') && !versionBlock.includes('### 🚀')) {
53
+ // Пропускаем если нет фич (поддержка разных форматов заголовков)
54
+ if (!versionBlock.includes('### ✨ Новые фичи') &&
55
+ !versionBlock.includes('### ✨ Фичи') &&
56
+ !versionBlock.includes('### 🚀')) {
56
57
  console.log(`⏭️ Пропускаем ${version} - нет фич`)
57
58
  return
58
59
  }
@@ -63,7 +64,10 @@ versionBlocks.forEach((versionBlock) => {
63
64
  let inFeaturesSection = false
64
65
 
65
66
  for (const line of lines) {
66
- if (line.includes('### Фичи') || line.includes('### 🚀')) {
67
+ // Поддержка разных форматов заголовков фич
68
+ if (line.includes('### ✨ Новые фичи') ||
69
+ line.includes('### ✨ Фичи') ||
70
+ line.includes('### 🚀')) {
67
71
  inFeaturesSection = true
68
72
  continue
69
73
  }
@@ -120,32 +124,4 @@ if (readme.includes('<!-- AUTOGENERATED_SECTION START -->')) {
120
124
  const endIndex = readme.indexOf(endMarker, startIndex + startMarker.length)
121
125
 
122
126
  if (startIndex !== -1 && endIndex !== -1) {
123
- readme = readme.substring(0, startIndex + startMarker.length) + '\n' + prettyChangelog + readme.substring(endIndex)
124
- console.log('✅ Секция обновлена')
125
- }
126
- } else {
127
- console.log('⚠️ Маркер <!-- AUTOGENERATED_SECTION START --> не найден в README.md')
128
- console.log('💡 Добавь в README.md:')
129
- console.log(' <!-- AUTOGENERATED_SECTION START -->')
130
- console.log(' <!-- AUTOGENERATED_SECTION END -->')
131
- process.exit(1)
132
- }
133
-
134
- // Сохраняем
135
- writeFileSync('README.md', readme)
136
- console.log('✅ README обновлён с релизами, у которых есть демо!')
137
-
138
- // Пытаемся закоммитить и запушить
139
- try {
140
- const status = execSync('git status --porcelain README.md').toString().trim()
141
- if (status) {
142
- execSync('git add README.md', { stdio: 'inherit' })
143
- execSync('git commit -m "docs: update README with demo releases"', { stdio: 'inherit' })
144
- execSync('git push', { stdio: 'inherit' })
145
- console.log('🚀 Изменения запушены!')
146
- } else {
147
- console.log('💡 README не изменился')
148
- }
149
- } catch (error) {
150
- console.log('💡 README обновлён локально (не удалось запушить автоматически)')
151
- }
127
+ readme = readme.substring(0, startIndex + star