Skip to content

Commit 5158216

Browse files
committed
Fix hover behavior in Filter btn
1 parent 7494093 commit 5158216

File tree

8 files changed

+100
-366
lines changed

8 files changed

+100
-366
lines changed

build.js

Lines changed: 24 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,34 +1,48 @@
11
import fs from "fs";
22
import path from "path";
33

4-
// package.jsonとソースファイルのパスを設定
54
const packageFile = path.join(process.cwd(), "./package.json");
65
const layoutFile = path.join(process.cwd(), "./src/routes/+layout.svelte");
6+
const manifestFile = path.join(process.cwd(), "./static/manifest.json");
77

8-
// package.jsonを読み込んでバージョンを取得
98
const packageJson = JSON.parse(fs.readFileSync(packageFile, 'utf-8'));
109
const version = packageJson.version;
1110

12-
// UTCタイムスタンプを生成
11+
// Create UTC Timestamp
1312
const now = new Date();
1413
const timestamp = `${now.getUTCFullYear()}${String(now.getUTCMonth() + 1).padStart(
1514
2,
16-
"0")}${String(now.getUTCDate()).padStart(2, "0")}${String(now.getUTCHours()).padStart(
15+
"0"
16+
)}${String(now.getUTCDate()).padStart(2, "0")}${String(now.getUTCHours()).padStart(
1717
2,
18-
"0")}${String(now.getUTCMinutes()).padStart(2, "0")}${String(
18+
"0"
19+
)}${String(now.getUTCMinutes()).padStart(2, "0")}${String(
1920
now.getUTCSeconds()
2021
).padStart(2, "0")}`;
2122

22-
// レイアウトファイルを読み込んで更新
23-
fs.readFile(layoutFile, "utf-8", (err, content) => {
23+
// Update manifest.json
24+
fs.readFile(manifestFile, "utf-8", (err, content) => {
2425
if (err) throw err;
26+
27+
const manifestJson = JSON.parse(content);
28+
manifestJson.version = version;
29+
30+
fs.writeFile(manifestFile, JSON.stringify(manifestJson, null, 2), "utf-8", (err) => {
31+
if (err) throw err;
32+
console.log(`Version ${version} updated in ${manifestFile}`);
33+
});
34+
});
2535

26-
const regex = /<div id="buildTimestamp">(.*?)<\/div>/;
36+
// Update layout.svelte(Header)
37+
fs.readFile(layoutFile, "utf-8", (err, content) => {
38+
if (err) throw err;
39+
40+
const regex = /\<div class="version"\>(.*?)\<\/div\>/;
2741
const updatedContent = content.replace(
2842
regex,
29-
`<div id="buildTimestamp" class="text-xs">v${version} (Build: ${timestamp} UTC)</div>`
43+
`<div class="version">v${version} (Build: ${timestamp} UTC)</div>`
3044
);
31-
45+
3246
fs.writeFile(layoutFile, updatedContent, "utf-8", (err) => {
3347
if (err) throw err;
3448
console.log(`Version ${version} and UTC build timestamp added to ${layoutFile}`);

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "harlytics",
3-
"version": "0.1.3",
3+
"version": "0.1.4",
44
"private": true,
55
"scripts": {
66
"preinstall": "npx only-allow pnpm",

0 commit comments

Comments
 (0)