-
-
Notifications
You must be signed in to change notification settings - Fork 5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Desktop: Resolves #7934: Add Simple Backup as a default plugin #9360
Desktop: Resolves #7934: Add Simple Backup as a default plugin #9360
Conversation
// We support requiring 7zip-bin through require('7zip-bin') | ||
externalsType: 'commonjs', | ||
externals: { | ||
'7zip-bin': { commonjs: '7zip-bin' }, | ||
}, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
// We support requiring 7zip-bin through require('7zip-bin') | |
externalsType: 'commonjs', | |
externals: { | |
'7zip-bin': { commonjs: '7zip-bin' }, | |
}, |
We may not want to include this for all plugins.
packages/default-plugins/build.ts
Outdated
import { dirname, join, resolve, basename } from 'path'; | ||
import { tmpdir } from 'os'; | ||
import { chdir, cwd } from 'process'; | ||
import { execCommand } from '@joplin/utils'; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
To-do: Using @joplin/utils
during the first build fails if @joplin/utils
hasn't been built yet.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is it added to package.json?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes — however, the default plugins build script is currently run during the build process, which seems to sometimes happen before tsc
compiles @joplin/utils
.
Edit 1: --topological
is being passed to yarn workspaces foreach
, so it's possible that I've added @joplin/utils
incorrectly.
Edit 2: It may be because @joplin/utils
lacks a build
command in its package.json
. Adding "build": "yarn run tsc"
seems to fix the issue (though I've only tested with one full build).
packages/default-plugins/plugin-patches/io.github.jackgruber.backup.diff
Show resolved
Hide resolved
Absolutely, many plugins should become defaults in Joplin.
@personalizedrefrigerator if you could look at this repo SeptemberHX/joplin-plugin-enhancement#52 and integrate some of it into joplin that would be very good I think, but now I will stop spamming |
Some issue on CI:
|
This may be related to
Footnotes |
We may also need to change the default location for backups. In the
However, it seems that the Simple Backup plugin can clear the backup directory (and thus the profile directory) in some cases: Edit: Not an issue as Simple Backup by default creates a subfolder to store backups. This would only be an issue if subfolder creation was not enabled. Additional issues (though possibly not actually issues):
|
The CI is failing — `export NODE_OPTIONS="--openssl-legacy-provider" was added to support building with Webpack 4. However, Windows has different syntax for setting environment variables. |
Yes thats true, but when you uncheck
I created a issue JackGruber/joplin-plugin-backup#61
Is a place holder, both passwords are different :) |
…uild on desktop app build)
…for easier debugging
Before this PR can be merged
We may also want to:
|
{ | ||
"name": "@joplin/default-plugins", | ||
"version": "2.13.0", | ||
"description": "Default plugins bundeler", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
"bundler"
packages/default-plugins/plugin-patches/io.github.jackgruber.backup.diff
Show resolved
Hide resolved
…hors access to 7zip-bin
…caused can be ignored
Ok I think we can merge now, and we'll handle update in a follow up pull request. Thanks for implementing this! |
Summary
require
d by pluginsgit submodule init && git submodule update
)7zip-bin
as an external dependency.externalsType
which allows keeping arequire
for7zip-bin
, even though the built plugin script doesn't useexports....
to export functions.7zip-bin
is required witheval('require("7zip-bin")')
to preserve therequire
statement.postinstall
To-do
This pull request
postinstall
, the default plugin build script tries to useexecCommand
from@joplin/utils
before@joplin/utils
has been built.7zip-bin
as an external dependency in Webpack 4.default-plugins
currently writes to a directory in a different package (packages/app-desktop/build/
) on build. For maintainability, it may make sense to makedefault-plugins
a dependency ofapp-desktop
.app-desktop
can then trigger the build and provide an output path.Follow-up pull request