Skip to content

Commit

Permalink
init changelog script (#1883)
Browse files Browse the repository at this point in the history
* init changelog script

* Create eleven-flies-sing.md
  • Loading branch information
codecalm committed Apr 29, 2024
1 parent 6cbe888 commit d8605f2
Show file tree
Hide file tree
Showing 5 changed files with 36 additions and 31 deletions.
5 changes: 5 additions & 0 deletions .changeset/eleven-flies-sing.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@tabler/core": patch
---

Init changelog script
3 changes: 2 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down
28 changes: 28 additions & 0 deletions build/changelog.js
Original file line number Diff line number Diff line change
@@ -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)
29 changes: 0 additions & 29 deletions gulpfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -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'),
Expand Down Expand Up @@ -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
*/
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down

0 comments on commit d8605f2

Please sign in to comment.