Skip to content

Commit

Permalink
refactor(ui): moving vite plugins from ts to js file types
Browse files Browse the repository at this point in the history
  • Loading branch information
MilosPaunovic committed Aug 7, 2024
1 parent 3a70df4 commit a587dd5
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 8 deletions.
4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@kestra-io/ui-libs",
"version": "0.0.55",
"version": "0.0.56",
"type": "module",
"files": [
"src",
Expand Down
File renamed without changes.
9 changes: 4 additions & 5 deletions src/vite/plugins/commit.ts → src/vite/plugins/commit.js
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
import type {Plugin} from "vite";
import {execSync} from "child_process";

const getInfo = (formats: string[]): string[] => formats.map(format => execSync(`git log -1 --format=${format}`).toString().trim());
const getInfo = formats => formats.map(format => execSync(`git log -1 --format=${format}`).toString().trim());

const comment = (message: string, author: string, date: string): string => `
const comment = (message, author, date) => `
<!--
Last Commit:
Expand All @@ -15,14 +14,14 @@ const comment = (message: string, author: string, date: string): string => `
-->`;

export const commit = (): Plugin => {
export const commit = () => {
const [message, author, date] = getInfo(["%s", "%an", "%cd"]);

return {
name: "commit",
transformIndexHtml: {
order: "pre",
handler(html: string): string {
handler(html) {
return comment(message, author, date) + html;
},
},
Expand Down

0 comments on commit a587dd5

Please sign in to comment.