@bwat47/joplin-plugin-scripts 1.1.0 → 1.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,61 @@
1
+ /**
2
+ * Reads `package.json` and `src/manifest.json` from `root` and validates the fields the plugin
3
+ * repository depends on: plugin ID, matching versions, package name and keyword, categories, and
4
+ * local screenshots.
5
+ * @param {string} root Plugin project root.
6
+ * @returns {Promise<{ packageJson: PackageMetadata, manifest: PluginManifest }>}
7
+ */
8
+ export function readProject(root: string): Promise<{
9
+ packageJson: PackageMetadata;
10
+ manifest: PluginManifest;
11
+ }>;
12
+ /**
13
+ * Archives `<root>/dist` into `<root>/publish/<id>.jpl` and writes `<id>.json` publish metadata.
14
+ * `extraScripts` are bundle paths relative to `dist/` that must exist before packaging.
15
+ * @param {string} root Plugin project root.
16
+ * @param {PluginManifest} manifest Validated plugin manifest, including its plugin ID.
17
+ * @param {string[]} [extraScripts] Required bundle paths relative to `dist/`.
18
+ */
19
+ export function packagePlugin(root: string, manifest: PluginManifest, extraScripts?: string[]): Promise<void>;
20
+ /**
21
+ * Package metadata used by the build and version commands. Other fields are preserved.
22
+ * @typedef {object} PackageMetadata
23
+ * @property {string} name
24
+ * @property {string} version
25
+ * @property {string[]} [keywords]
26
+ */
27
+ /**
28
+ * Plugin manifest fields used by validation and packaging. Other fields are preserved.
29
+ * @typedef {object} PluginManifest
30
+ * @property {string} id
31
+ * @property {string} version
32
+ * @property {string[]} [categories]
33
+ * @property {{ src: string }[]} [screenshots] Local or remote screenshots.
34
+ */
35
+ /**
36
+ * Plugin repository categories accepted in `manifest.categories`.
37
+ * Mirrors generator-joplin's list; `update-api` warns when they differ.
38
+ */
39
+ export const VALID_CATEGORIES: Set<string>;
40
+ /**
41
+ * Package metadata used by the build and version commands. Other fields are preserved.
42
+ */
43
+ export type PackageMetadata = {
44
+ name: string;
45
+ version: string;
46
+ keywords?: string[] | undefined;
47
+ };
48
+ /**
49
+ * Plugin manifest fields used by validation and packaging. Other fields are preserved.
50
+ */
51
+ export type PluginManifest = {
52
+ id: string;
53
+ version: string;
54
+ categories?: string[] | undefined;
55
+ /**
56
+ * Local or remote screenshots.
57
+ */
58
+ screenshots?: {
59
+ src: string;
60
+ }[] | undefined;
61
+ };
@@ -0,0 +1,32 @@
1
+ /**
2
+ * Compares the hand-maintained category and content-script external lists with the ones in
3
+ * generator-joplin's `webpack.config.js` text. Returns one warning per list that differs or
4
+ * cannot be found; an empty array means both match.
5
+ * @param {string} webpackConfig
6
+ * @returns {string[]}
7
+ */
8
+ export function compareGeneratorLists(webpackConfig: string): string[];
9
+ /**
10
+ * Replaces `<root>/api` with a copy of `source`. The copy is staged next to `api/` and swapped in
11
+ * by rename, so a failed copy leaves the existing `api/` untouched. `copy` defaults to a recursive copy.
12
+ * @param {string} root Plugin project root.
13
+ * @param {string} source
14
+ * @param {CopyDirectory} [copy] Copies the API into the staging directory.
15
+ */
16
+ export function replaceApi(root: string, source: string, copy?: CopyDirectory): Promise<void>;
17
+ /**
18
+ * Replaces `<root>/api` with the API declarations from the latest generator-joplin package.
19
+ * Nothing else in the project is touched. Returns the generator version used and warnings for
20
+ * hand-maintained build lists that no longer match the generator.
21
+ * @param {string} root Plugin project root.
22
+ * @param {string} [packageSpec] npm package specification for the generator to download.
23
+ * @returns {Promise<{ version: string, warnings: string[] }>}
24
+ */
25
+ export function updateApi(root: string, packageSpec?: string): Promise<{
26
+ version: string;
27
+ warnings: string[];
28
+ }>;
29
+ /**
30
+ * Copies a source directory into a destination directory.
31
+ */
32
+ export type CopyDirectory = (from: string, to: string) => Promise<void>;
@@ -0,0 +1,7 @@
1
+ /**
2
+ * Increments the patch version in `package.json`, `src/manifest.json`, and `package-lock.json`
3
+ * together. Writes nothing unless all three files can be updated.
4
+ * @param {string} root Plugin project root.
5
+ * @returns {Promise<string>} The new version.
6
+ */
7
+ export function updateVersion(root: string): Promise<string>;