Skip to content

Commit b9ba970

Browse files
committed
chore: bump release
1 parent 8269846 commit b9ba970

File tree

7 files changed

+84
-24
lines changed

7 files changed

+84
-24
lines changed

.release-it.cjs

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,8 @@
11
module.exports = {
22
hooks: {
3-
"before:init": ["pnpm run build"],
3+
"before:init": ["node esbuild.config.mjs production"],
44
"after:bump": [
5-
"pnpm run build",
6-
"node -e \"const fs=require('fs'); if(!fs.existsSync('dist')) fs.mkdirSync('dist'); ['main.js','manifest.json','styles.css'].forEach(f=>fs.copyFileSync(f,'dist/'+f))\"",
5+
"node esbuild.config.mjs production",
76
"node ./scripts/zip.mjs",
87
"git add .",
98
],

dist/manifest.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
{
22
"id": "obsidian-task-progress-bar",
33
"name": "Task Genius",
4-
"version": "9.3.0",
4+
"version": "9.2.2",
55
"minAppVersion": "0.15.2",
66
"description": "Comprehensive task management that includes progress bars, task status cycling, and advanced task tracking features.",
77
"author": "Boninall",
88
"authorUrl": "https://github.com/Quorafind",
99
"isDesktopOnly": false
10-
}
10+
}

esbuild.config.mjs

Lines changed: 66 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,68 @@ const renamePlugin = {
5555
};
5656

5757
const prod = process.argv[2] === "production";
58+
const outDir = prod ? "dist" : ".";
59+
60+
// Ensure dist directory exists in production mode
61+
if (prod && !fs.existsSync("dist")) {
62+
fs.mkdirSync("dist", { recursive: true });
63+
}
64+
65+
// Update plugins to handle output directory
66+
const renamePluginWithDir = {
67+
name: "rename-styles",
68+
setup(build) {
69+
build.onEnd(() => {
70+
const { outfile } = build.initialOptions;
71+
const outcss = outfile.replace(/\.js$/, ".css");
72+
const fixcss = outfile.replace(/main\.js$/, "styles.css");
73+
if (fs.existsSync(outcss)) {
74+
console.log("Renaming", outcss, "to", fixcss);
75+
fs.renameSync(outcss, fixcss);
76+
}
77+
});
78+
},
79+
};
80+
81+
// Update CSS settings plugin to handle output directory
82+
const cssSettingsPluginWithDir = {
83+
name: "css-settings-plugin",
84+
setup(build) {
85+
build.onEnd(async (result) => {
86+
// Path to the output CSS file
87+
const cssOutfile = path.join(outDir, "styles.css");
88+
89+
// The settings comment to prepend
90+
const settingsComment =
91+
fs.readFileSync("src/styles/index.css", "utf8").split("*/")[0] +
92+
"*/\n\n";
93+
94+
if (fs.existsSync(cssOutfile)) {
95+
// Read the current content
96+
const cssContent = fs.readFileSync(cssOutfile, "utf8");
97+
98+
// Check if the settings comment is already there
99+
if (!cssContent.includes("/* @settings")) {
100+
// Prepend the settings comment
101+
fs.writeFileSync(cssOutfile, settingsComment + cssContent);
102+
}
103+
}
104+
});
105+
},
106+
};
107+
108+
// Copy manifest to output directory in production
109+
const copyManifestPlugin = {
110+
name: "copy-manifest",
111+
setup(build) {
112+
build.onEnd(() => {
113+
if (prod) {
114+
fs.copyFileSync("manifest.json", path.join(outDir, "manifest.json"));
115+
console.log("Copied manifest.json to", outDir);
116+
}
117+
});
118+
},
119+
};
58120

59121
esbuild
60122
.build({
@@ -65,9 +127,9 @@ esbuild
65127
entryPoints: ["src/index.ts"],
66128
plugins: [
67129
inlineWorkerPlugin({ workerName: "Task Genius Indexer" }),
68-
69-
renamePlugin,
70-
cssSettingsPlugin,
130+
renamePluginWithDir,
131+
cssSettingsPluginWithDir,
132+
copyManifestPlugin,
71133
],
72134
bundle: true,
73135
external: [
@@ -107,7 +169,7 @@ esbuild
107169
logLevel: "info",
108170
sourcemap: prod ? false : "inline",
109171
treeShaking: true,
110-
outfile: "main.js",
172+
outfile: path.join(outDir, "main.js"),
111173
pure: prod ? ["console.log"] : [],
112174
})
113175
.catch(() => process.exit(1));

manifest-beta.json

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
{
2-
"id": "obsidian-task-progress-bar",
3-
"name": "Task Genius",
4-
"version": "9.3.0",
5-
"minAppVersion": "0.15.2",
6-
"description": "Comprehensive task management that includes progress bars, task status cycling, and advanced task tracking features.",
7-
"author": "Boninall",
8-
"authorUrl": "https://github.com/Quorafind",
9-
"isDesktopOnly": false
10-
}
2+
"id": "obsidian-task-progress-bar",
3+
"name": "Task Genius",
4+
"version": "9.2.2",
5+
"minAppVersion": "0.15.2",
6+
"description": "Comprehensive task management that includes progress bars, task status cycling, and advanced task tracking features.",
7+
"author": "Boninall",
8+
"authorUrl": "https://github.com/Quorafind",
9+
"isDesktopOnly": false
10+
}

manifest.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
{
22
"id": "obsidian-task-progress-bar",
33
"name": "Task Genius",
4-
"version": "9.3.0",
4+
"version": "9.2.2",
55
"minAppVersion": "0.15.2",
66
"description": "Comprehensive task management that includes progress bars, task status cycling, and advanced task tracking features.",
77
"author": "Boninall",
88
"authorUrl": "https://github.com/Quorafind",
99
"isDesktopOnly": false
10-
}
10+
}

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "task-genius",
3-
"version": "9.3.0",
3+
"version": "9.2.2",
44
"description": "Comprehensive task management plugin for Obsidian with progress bars, task status cycling, and advanced task tracking features.",
55
"main": "main.js",
66
"scripts": {

versions.json

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -103,6 +103,5 @@
103103
"9.1.5": "0.15.2",
104104
"9.2.0": "0.15.2",
105105
"9.2.1": "0.15.2",
106-
"9.2.2": "0.15.2",
107-
"9.3.0": "0.15.2"
108-
}
106+
"9.2.2": "0.15.2"
107+
}

0 commit comments

Comments
 (0)