diff --git a/.changeset/eleven-flies-sing.md b/.changeset/eleven-flies-sing.md new file mode 100644 index 000000000..e02c025ce --- /dev/null +++ b/.changeset/eleven-flies-sing.md @@ -0,0 +1,5 @@ +--- +"@tabler/core": patch +--- + +Init changelog script diff --git a/CHANGELOG.md b/CHANGELOG.md index 777391a70..4ee835703 100644 --- a/CHANGELOG.md +++ b/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 diff --git a/build/changelog.js b/build/changelog.js new file mode 100644 index 000000000..09fce50f6 --- /dev/null +++ b/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) \ No newline at end of file diff --git a/gulpfile.js b/gulpfile.js index 8a0bc82f4..ba27dcc88 100644 --- a/gulpfile.js +++ b/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 */ diff --git a/package.json b/package.json index cb8b19832..b1e60c9e2 100644 --- a/package.json +++ b/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",