mirror of
https://github.com/laurent22/joplin.git
synced 2024-11-27 08:21:03 +02:00
This commit is contained in:
parent
a0d77d10ba
commit
0b32a29cce
@ -8,5 +8,6 @@
|
|||||||
"author": "<%= pluginAuthor %>",
|
"author": "<%= pluginAuthor %>",
|
||||||
"homepage_url": "<%= pluginHomepageUrl %>",
|
"homepage_url": "<%= pluginHomepageUrl %>",
|
||||||
"repository_url": "<%= pluginRepositoryUrl %>",
|
"repository_url": "<%= pluginRepositoryUrl %>",
|
||||||
"keywords": []
|
"keywords": [],
|
||||||
|
"categories": []
|
||||||
}
|
}
|
@ -29,6 +29,7 @@ const userConfig = Object.assign({}, {
|
|||||||
|
|
||||||
const manifestPath = `${srcDir}/manifest.json`;
|
const manifestPath = `${srcDir}/manifest.json`;
|
||||||
const packageJsonPath = `${rootDir}/package.json`;
|
const packageJsonPath = `${rootDir}/package.json`;
|
||||||
|
const allPossibleCategories = ['appearance', 'developer tools', 'productivity', 'themes', 'integrations', 'viewer', 'search', 'tags', 'editor', 'files', 'personal knowledge management'];
|
||||||
const manifest = readManifest(manifestPath);
|
const manifest = readManifest(manifestPath);
|
||||||
const pluginArchiveFilePath = path.resolve(publishDir, `${manifest.id}.jpl`);
|
const pluginArchiveFilePath = path.resolve(publishDir, `${manifest.id}.jpl`);
|
||||||
const pluginInfoFilePath = path.resolve(publishDir, `${manifest.id}.json`);
|
const pluginInfoFilePath = path.resolve(publishDir, `${manifest.id}.json`);
|
||||||
@ -67,10 +68,19 @@ function currentGitInfo() {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function validateCategories(categories) {
|
||||||
|
if (!categories) return null;
|
||||||
|
if ((categories.length !== new Set(categories).size)) throw new Error('Repeated categories are not allowed');
|
||||||
|
categories.forEach(category => {
|
||||||
|
if (!allPossibleCategories.includes(category)) throw new Error(`${category} is not a valid category. Please make sure that the category name is lowercase. Valid Categories are: \n${allPossibleCategories}\n`);
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
function readManifest(manifestPath) {
|
function readManifest(manifestPath) {
|
||||||
const content = fs.readFileSync(manifestPath, 'utf8');
|
const content = fs.readFileSync(manifestPath, 'utf8');
|
||||||
const output = JSON.parse(content);
|
const output = JSON.parse(content);
|
||||||
if (!output.id) throw new Error(`Manifest plugin ID is not set in ${manifestPath}`);
|
if (!output.id) throw new Error(`Manifest plugin ID is not set in ${manifestPath}`);
|
||||||
|
validateCategories(output.categories);
|
||||||
return output;
|
return output;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -45,6 +45,7 @@ export default function manifestFromObject(o: any): PluginManifest {
|
|||||||
homepage_url: getString('homepage_url', false),
|
homepage_url: getString('homepage_url', false),
|
||||||
repository_url: getString('repository_url', false),
|
repository_url: getString('repository_url', false),
|
||||||
keywords: getStrings('keywords', false),
|
keywords: getStrings('keywords', false),
|
||||||
|
categories: getStrings('categories', false),
|
||||||
permissions: permissions,
|
permissions: permissions,
|
||||||
|
|
||||||
_recommended: getBoolean('_recommended', false, false),
|
_recommended: getBoolean('_recommended', false, false),
|
||||||
|
@ -13,6 +13,7 @@ export interface PluginManifest {
|
|||||||
homepage_url?: string;
|
homepage_url?: string;
|
||||||
repository_url?: string;
|
repository_url?: string;
|
||||||
keywords?: string[];
|
keywords?: string[];
|
||||||
|
categories?: string[];
|
||||||
permissions?: PluginPermission[];
|
permissions?: PluginPermission[];
|
||||||
|
|
||||||
// Private keys
|
// Private keys
|
||||||
|
@ -13,6 +13,23 @@ Name | Type | Required? | Description
|
|||||||
`keywords` | string[] | No | Keywords associated with the plugins. They are used in search in particular.
|
`keywords` | string[] | No | Keywords associated with the plugins. They are used in search in particular.
|
||||||
`homepage_url` | string | No | Homepage URL of the plugin. It can also be, for example, a link to a GitHub repository.
|
`homepage_url` | string | No | Homepage URL of the plugin. It can also be, for example, a link to a GitHub repository.
|
||||||
`repository_url` | string | No | Repository URL where the plugin source code is hosted.
|
`repository_url` | string | No | Repository URL where the plugin source code is hosted.
|
||||||
|
`categories` | string[] | No | [Categories](#categories) that describes the functionality of the plugin. |
|
||||||
|
|
||||||
|
## Categories
|
||||||
|
|
||||||
|
| Category | Description |
|
||||||
|
| --- | --- |
|
||||||
|
| appearance | dealing with appearance of some element/s of the app. For example line numbers, layout, etc. |
|
||||||
|
| developer tools | built for the developers. |
|
||||||
|
| editor | enhancing note editor. |
|
||||||
|
| files | dealing with files. For example import, export, backup, etc. |
|
||||||
|
| integrations | integrating third party services or apps. |
|
||||||
|
| personal knowledge management | managing and organizing notes. |
|
||||||
|
| productivity | making Joplin more productive to use. |
|
||||||
|
| search | enhancing search inside the app. |
|
||||||
|
| tags | dealing with note tags. |
|
||||||
|
| themes | changing theme of the app. |
|
||||||
|
| viewer | enhancing the rendering of a note. |
|
||||||
|
|
||||||
## Manifest example
|
## Manifest example
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user