Skip to content

Commit a8f29fd

Browse files
committed
Merge branch 'develop'
2 parents bd49c66 + cae6000 commit a8f29fd

12 files changed

+60
-19
lines changed

CHANGELOG.md

+4
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,10 @@
22

33
## not released
44

5+
## v1.3.6 (2024-01-11)
6+
7+
- Add: Screenshots / icon for [https://joplinapp.org/plugins/](https://joplinapp.org/plugins/)
8+
59
## v1.3.5 (2023-12-26)
610

711
- Fix: #64 With single JEX backups, some notebooks were backuped/exported twice

GENERATOR_DOC.md

+1-8
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ This documentation describes how to create a plugin, and how to work with the pl
77
First, install [Yeoman](http://yeoman.io) and generator-joplin using [npm](https://www.npmjs.com/) (we assume you have pre-installed [node.js](https://nodejs.org/)).
88

99
```bash
10-
npm install -g yo
10+
npm install -g yo@4.3.1
1111
npm install -g generator-joplin
1212
```
1313

@@ -56,13 +56,6 @@ In general this command tries to do the right thing - in particular it's going t
5656

5757
The file that may cause problem is "webpack.config.js" because it's going to be overwritten. For that reason, if you want to change it, consider creating a separate JavaScript file and include it in webpack.config.js. That way, when you update, you only have to restore the line that include your file.
5858

59-
### Simple backup changes to `webpack.config.js`
60-
61-
To support including `7zip-bin` in the plugin's built `.jpl` file, the following changes are made:
62-
63-
- Added `node: { __dirname: 'mock' },` to the plugin `baseConfig`. This causes `7zip-bin` to return a more correct path to `7za` (e.g. `/linux/x64/7za` instead of `/tmp/.mount_Joplin/resources/app.asar/services/plugins/linux/x64/7za`).
64-
- Added a `new CopyPlugin({ ... })` to `pluginConfig`'s `plugins` object to copy `7zip-bin` from `node_modules` to the `dist` directory.
65-
6659
## External script files
6760

6861
By default, the compiler (webpack) is going to compile `src/index.ts` only (as well as any file it imports), and any other file will simply be copied to the plugin package. In some cases this is sufficient, however if you have [content scripts](https://joplinapp.org/api/references/plugin_api/classes/joplincontentscripts.html) or [webview scripts](https://joplinapp.org/api/references/plugin_api/classes/joplinviewspanels.html#addscript) you might want to compile them too, in particular in these two cases:

README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# Joplin Backup Plugin
1+
# Joplin Backup Plugin <img src=img/icon_32.png>
22

33
A plugin to extend Joplin with a manual and automatic backup function.
44

img/icon.svg

+28
Loading

img/icon_256.png

4.22 KB
Loading

img/icon_32.png

1.99 KB
Loading

img/main.png

-82.3 KB
Loading

img/showcase1.png

95.3 KB
Loading

package-lock.json

+2-2
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "joplin-plugin-backup",
3-
"version": "1.3.5",
3+
"version": "1.3.6",
44
"scripts": {
55
"dist": "webpack --env joplin-plugin-config=buildMain && webpack --env joplin-plugin-config=buildExtraScripts && webpack --env joplin-plugin-config=createArchive",
66
"prepare": "npm run dist && husky install",

src/manifest.json

+14-3
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
"manifest_version": 1,
33
"id": "io.github.jackgruber.backup",
44
"app_min_version": "2.1.3",
5-
"version": "1.3.5",
5+
"version": "1.3.6",
66
"name": "Simple Backup",
77
"description": "Plugin to create manual and automatic backups.",
88
"author": "JackGruber",
@@ -18,6 +18,17 @@
1818
"archive"
1919
],
2020
"categories": ["productivity", "files"],
21-
"screenshots": [],
22-
"icons": {}
21+
"screenshots": [
22+
{
23+
"src": "img/main.png",
24+
"label": "Screenshot: Showing the basic settings"
25+
},
26+
{
27+
"src": "img/showcase1.png",
28+
"label": "Screenshot: Showing the advanced settings"
29+
}
30+
],
31+
"icons": {
32+
"256": "img/icon_256.png"
33+
}
2334
}

webpack.config.js

+9-4
Original file line numberDiff line numberDiff line change
@@ -93,19 +93,24 @@ function validateCategories(categories) {
9393

9494
function validateScreenshots(screenshots) {
9595
if (!screenshots) return null;
96-
// eslint-disable-next-line github/array-foreach -- Old code before rule was applied
97-
screenshots.forEach(screenshot => {
96+
for (const screenshot of screenshots) {
9897
if (!screenshot.src) throw new Error('You must specify a src for each screenshot');
9998

99+
// Avoid attempting to download and verify URL screenshots.
100+
if (screenshot.src.startsWith('https://') || screenshot.src.startsWith('http://')) {
101+
continue;
102+
}
103+
100104
const screenshotType = screenshot.src.split('.').pop();
101105
if (!allPossibleScreenshotsType.includes(screenshotType)) throw new Error(`${screenshotType} is not a valid screenshot type. Valid types are: \n${allPossibleScreenshotsType}\n`);
102106

103-
const screenshotPath = path.resolve(srcDir, screenshot.src);
107+
const screenshotPath = path.resolve(rootDir, screenshot.src);
108+
104109
// Max file size is 1MB
105110
const fileMaxSize = 1024;
106111
const fileSize = fs.statSync(screenshotPath).size / 1024;
107112
if (fileSize > fileMaxSize) throw new Error(`Max screenshot file size is ${fileMaxSize}KB. ${screenshotPath} is ${fileSize}KB`);
108-
});
113+
}
109114
}
110115

111116
function readManifest(manifestPath) {

0 commit comments

Comments
 (0)