Browse Source

init changelog script (#1883)

* init changelog script

* Create eleven-flies-sing.md
Paweł Kuna 1 year ago
parent
commit
d8605f217c
5 changed files with 36 additions and 31 deletions
  1. 5 0
      .changeset/eleven-flies-sing.md
  2. 2 1
      CHANGELOG.md
  3. 28 0
      build/changelog.js
  4. 0 29
      gulpfile.js
  5. 1 1
      package.json

+ 5 - 0
.changeset/eleven-flies-sing.md

@@ -0,0 +1,5 @@
+---
+"@tabler/core": patch
+---
+
+Init changelog script

+ 2 - 1
CHANGELOG.md

@@ -2,6 +2,7 @@
 
 All notable changes to this project will be documented in this file.
 
+
 ## `1.0.0-beta20` - 2023-08-24
 
 - Update `bootstrap` to v5.3.1
@@ -109,7 +110,7 @@ All notable changes to this project will be documented in this file.
 - exclude `playgrounds` from build
 - update jekyll to v4.3.1
 - fix: facebook color update
-- navbar aria attributes fixes
+- navbar aria atributes fixes
 - fix #808 - `navbar-menu` and `sidebar-menu` has the same `id`
 - fix #1335 - missing color variables usage in `alert` and `btn-ghost-*`
 - move border style to CSS variables

+ 28 - 0
build/changelog.js

@@ -0,0 +1,28 @@
+#!/usr/bin/env node
+
+'use strict'
+
+const fs = require('fs'),
+	path = require('path'),
+	YAML = require('yaml');
+
+const content = YAML.parse(fs.readFileSync(path.join(__dirname, '../src/pages/_data/changelog.yml'), 'utf8')).reverse()
+let readme = `# Changelog
+
+All notable changes to this project will be documented in this file.\n`
+
+content.forEach((change) => {
+	readme += `\n\n## \`${change.version}\` - ${change.date}\n\n`
+
+	if (change.description) {
+		readme += `**${change.description}**\n\n`
+	}
+
+	change.changes.forEach((line) => {
+		readme += `- ${line}\n`
+	})
+
+	console.log(change.version);
+})
+
+fs.writeFileSync(path.join(__dirname, '../CHANGELOG.md'), readme)

+ 0 - 29
gulpfile.js

@@ -22,7 +22,6 @@ const gulp = require('gulp'),
 	spawn = require('cross-spawn'),
 	fs = require('fs'),
 	path = require('path'),
-	YAML = require('yaml'),
 	yargs = require('yargs/yargs'),
 	cp = require('child_process'),
 	pkg = require('./package.json'),
@@ -73,34 +72,6 @@ if (!Array.prototype.flat) {
 	})
 }
 
-/**
- * Generate CHANGELOG.md
- */
-gulp.task('changelog', (cb) => {
-	const content = YAML.parse(fs.readFileSync('./src/pages/_data/changelog.yml', 'utf8')).reverse()
-	let readme = `# Changelog
-
-All notable changes to this project will be documented in this file.\n`
-
-	content.forEach((change) => {
-		readme += `\n\n## \`${change.version}\` - ${change.date}\n\n`
-
-		if (change.description) {
-			readme += `**${change.description}**\n\n`
-		}
-
-		change.changes.forEach((line) => {
-			readme += `- ${line}\n`
-		})
-
-		console.log(change.version);
-	})
-
-	fs.writeFileSync('CHANGELOG.md', readme)
-
-	cb()
-})
-
 /**
  * Check unused Jekyll partials
  */

+ 1 - 1
package.json

@@ -16,7 +16,7 @@
     "svg-icons": "node build/import-icons.js",
     "bundlewatch": "bundlewatch",
     "storybook": "start-storybook -p 6006",
-    "changelog": "gulp changelog",
+    "changelog": "node build/changelog.js",
     "icons": "ncu -u @tabler/icons && pnpm install && gulp svg-icons && git add . && git commit -am \"update icons to v`pnpm info @tabler/icons version`\" && git push",
     "download-images": "node build/download-images.js",
     "optimize-images": "for i in ./src/static/photos/*.jpg; do convert \"$i\" -quality 80% \"${i%.jpg}.jpg\"; done",