chore: cleanup unused code and enhance marketplace author links

This commit is contained in:
Aleix Soler 2026-03-18 16:58:41 +01:00
parent 6ab760df98
commit 2537227678
5 changed files with 19 additions and 43 deletions

View file

@ -113,10 +113,9 @@ You can contribute your own status templates to the plugin!
]
}
```
4. Run `node scripts/generate-templates.mjs` to update the predefined templates.
5. Submit a Pull Request!
4. Submit a Pull Request with your JSON file!
Once accepted, your template will be available to all users of the plugin.
Once accepted, maintainers will include your template in the next plugin update.
## Installation

View file

@ -59,7 +59,21 @@ export const MarketplaceBrowseModal: React.FC<MarketplaceBrowseModalProps> = ({
</span>
{template.author && (
<div className="marketplace-card-author">
by {template.author}
by{" "}
{template.github ? (
<a
href={template.github}
target="_blank"
rel="noopener noreferrer"
onClick={(e) =>
e.stopPropagation()
}
>
{template.author}
</a>
) : (
template.author
)}
</div>
)}
</div>

View file

@ -249,8 +249,3 @@ export const PREDEFINED_TEMPLATES: StatusTemplate[] = [
],
},
];
/**
* Default template IDs that should be enabled by default
*/
export const DEFAULT_ENABLED_TEMPLATES = ["colorful"];

View file

@ -4,8 +4,8 @@
"description": "Enhance your note organization with a status management system. Assign and track statuses (active, on hold, completed, dropped) for your notes with a customizable interface including status pane, dropdown, and file explorer integration.",
"main": "main.js",
"scripts": {
"dev": "node scripts/generate-templates.mjs && node esbuild.config.mjs",
"build": "node scripts/generate-templates.mjs && tsc -noEmit -skipLibCheck && node esbuild.config.mjs production",
"dev": "node esbuild.config.mjs",
"build": "tsc -noEmit -skipLibCheck && node esbuild.config.mjs production",
"version": "node version-bump.mjs && git add manifest.json versions.json",
"format": "prettier --write \"**/*.{ts,tsx,js,jsx,json,css,md}\"",
"format:check": "prettier --check \"**/*.{ts,tsx,js,jsx,json,css,md}\"",

View file

@ -1,32 +0,0 @@
import fs from 'fs';
import path from 'path';
const templatesDir = './templates';
const outputFile = './constants/predefinedTemplates.ts';
const files = fs.readdirSync(templatesDir);
const templates = [];
files.forEach(file => {
if (file.endsWith('.json')) {
const filePath = path.join(templatesDir, file);
const content = JSON.parse(fs.readFileSync(filePath, 'utf8'));
templates.push(content);
}
});
const content = `import { StatusTemplate } from "types/pluginSettings";
/**
* Predefined status templates generated from the templates directory
*/
export const PREDEFINED_TEMPLATES: StatusTemplate[] = ${JSON.stringify(templates, null, '\t')};
/**
* Default template IDs that should be enabled by default
*/
export const DEFAULT_ENABLED_TEMPLATES = ["colorful"];
`;
fs.writeFileSync(outputFile, content);
console.log(`Generated ${outputFile} with ${templates.length} templates.`);