1
0
mirror of https://github.com/laurent22/joplin.git synced 2024-11-27 08:21:03 +02:00

Merge branch 'release-1.5' into dev

This commit is contained in:
Laurent Cozic 2020-12-27 22:40:26 +00:00
commit 158fafc4a0
21 changed files with 79 additions and 57 deletions

View File

@ -1,6 +1,7 @@
const gulp = require('gulp');
const fs = require('fs-extra');
const utils = require('@joplin/tools/gulp/utils');
const { setPackagePrivateField } = require('@joplin/tools/tool-utils');
const tasks = {
// compileExtensions: {
// fn: require('../Tools/gulp/tasks/compileExtensions.js'),
@ -10,12 +11,12 @@ const tasks = {
// updateIgnoredTypeScriptBuild: require('../Tools/gulp/tasks/updateIgnoredTypeScriptBuild'),
};
async function makePackagePublic(filePath) {
const text = await fs.readFile(filePath, 'utf8');
const obj = JSON.parse(text);
delete obj.private;
await fs.writeFile(filePath, JSON.stringify(obj), 'utf8');
}
// async function makePackagePublic(filePath) {
// const text = await fs.readFile(filePath, 'utf8');
// const obj = JSON.parse(text);
// delete obj.private;
// await fs.writeFile(filePath, JSON.stringify(obj), 'utf8');
// }
tasks.prepareBuild = {
fn: async () => {
@ -25,7 +26,8 @@ tasks.prepareBuild = {
});
await utils.copyFile(`${__dirname}/package.json`, `${buildDir}/package.json`);
await makePackagePublic(`${buildDir}/package.json`);
// await makePackagePublic(`${buildDir}/package.json`);
await setPackagePrivateField(`${buildDir}/package.json`, false);
await utils.copyFile(`${__dirname}/package-lock.json`, `${buildDir}/package-lock.json`);
await utils.copyFile(`${__dirname}/gulpfile.js`, `${buildDir}/gulpfile.js`);

View File

@ -208,7 +208,7 @@ export enum MenuItemLocation {
Note = 'note',
Tools = 'tools',
Help = 'help',
/**
* @deprecated Do not use - same as NoteListContextMenu
*/
@ -223,7 +223,7 @@ export enum MenuItemLocation {
* - `noteIds:string[]`: IDs of the notes that were right-clicked on.
*/
NoteListContextMenu = 'noteListContextMenu',
EditorContextMenu = 'editorContextMenu',
/**
@ -243,7 +243,7 @@ export enum MenuItemLocation {
TagContextMenu = 'tagContextMenu',
}
export function isContextMenuItemLocation(location:MenuItemLocation):boolean {
export function isContextMenuItemLocation(location: MenuItemLocation): boolean {
return [
MenuItemLocation.Context,
MenuItemLocation.NoteListContextMenu,

View File

@ -208,7 +208,7 @@ export enum MenuItemLocation {
Note = 'note',
Tools = 'tools',
Help = 'help',
/**
* @deprecated Do not use - same as NoteListContextMenu
*/
@ -223,7 +223,7 @@ export enum MenuItemLocation {
* - `noteIds:string[]`: IDs of the notes that were right-clicked on.
*/
NoteListContextMenu = 'noteListContextMenu',
EditorContextMenu = 'editorContextMenu',
/**
@ -243,7 +243,7 @@ export enum MenuItemLocation {
TagContextMenu = 'tagContextMenu',
}
export function isContextMenuItemLocation(location:MenuItemLocation):boolean {
export function isContextMenuItemLocation(location: MenuItemLocation): boolean {
return [
MenuItemLocation.Context,
MenuItemLocation.NoteListContextMenu,

View File

@ -208,7 +208,7 @@ export enum MenuItemLocation {
Note = 'note',
Tools = 'tools',
Help = 'help',
/**
* @deprecated Do not use - same as NoteListContextMenu
*/
@ -223,7 +223,7 @@ export enum MenuItemLocation {
* - `noteIds:string[]`: IDs of the notes that were right-clicked on.
*/
NoteListContextMenu = 'noteListContextMenu',
EditorContextMenu = 'editorContextMenu',
/**
@ -243,7 +243,7 @@ export enum MenuItemLocation {
TagContextMenu = 'tagContextMenu',
}
export function isContextMenuItemLocation(location:MenuItemLocation):boolean {
export function isContextMenuItemLocation(location: MenuItemLocation): boolean {
return [
MenuItemLocation.Context,
MenuItemLocation.NoteListContextMenu,

View File

@ -208,7 +208,7 @@ export enum MenuItemLocation {
Note = 'note',
Tools = 'tools',
Help = 'help',
/**
* @deprecated Do not use - same as NoteListContextMenu
*/
@ -223,7 +223,7 @@ export enum MenuItemLocation {
* - `noteIds:string[]`: IDs of the notes that were right-clicked on.
*/
NoteListContextMenu = 'noteListContextMenu',
EditorContextMenu = 'editorContextMenu',
/**
@ -243,7 +243,7 @@ export enum MenuItemLocation {
TagContextMenu = 'tagContextMenu',
}
export function isContextMenuItemLocation(location:MenuItemLocation):boolean {
export function isContextMenuItemLocation(location: MenuItemLocation): boolean {
return [
MenuItemLocation.Context,
MenuItemLocation.NoteListContextMenu,

View File

@ -208,7 +208,7 @@ export enum MenuItemLocation {
Note = 'note',
Tools = 'tools',
Help = 'help',
/**
* @deprecated Do not use - same as NoteListContextMenu
*/
@ -223,7 +223,7 @@ export enum MenuItemLocation {
* - `noteIds:string[]`: IDs of the notes that were right-clicked on.
*/
NoteListContextMenu = 'noteListContextMenu',
EditorContextMenu = 'editorContextMenu',
/**
@ -243,7 +243,7 @@ export enum MenuItemLocation {
TagContextMenu = 'tagContextMenu',
}
export function isContextMenuItemLocation(location:MenuItemLocation):boolean {
export function isContextMenuItemLocation(location: MenuItemLocation): boolean {
return [
MenuItemLocation.Context,
MenuItemLocation.NoteListContextMenu,

View File

@ -1,2 +1,3 @@
dist/*
node_modules/
*.jpl

View File

@ -208,7 +208,7 @@ export enum MenuItemLocation {
Note = 'note',
Tools = 'tools',
Help = 'help',
/**
* @deprecated Do not use - same as NoteListContextMenu
*/
@ -223,7 +223,7 @@ export enum MenuItemLocation {
* - `noteIds:string[]`: IDs of the notes that were right-clicked on.
*/
NoteListContextMenu = 'noteListContextMenu',
EditorContextMenu = 'editorContextMenu',
/**
@ -243,7 +243,7 @@ export enum MenuItemLocation {
TagContextMenu = 'tagContextMenu',
}
export function isContextMenuItemLocation(location:MenuItemLocation):boolean {
export function isContextMenuItemLocation(location: MenuItemLocation): boolean {
return [
MenuItemLocation.Context,
MenuItemLocation.NoteListContextMenu,

View File

@ -208,7 +208,7 @@ export enum MenuItemLocation {
Note = 'note',
Tools = 'tools',
Help = 'help',
/**
* @deprecated Do not use - same as NoteListContextMenu
*/
@ -223,7 +223,7 @@ export enum MenuItemLocation {
* - `noteIds:string[]`: IDs of the notes that were right-clicked on.
*/
NoteListContextMenu = 'noteListContextMenu',
EditorContextMenu = 'editorContextMenu',
/**
@ -243,7 +243,7 @@ export enum MenuItemLocation {
TagContextMenu = 'tagContextMenu',
}
export function isContextMenuItemLocation(location:MenuItemLocation):boolean {
export function isContextMenuItemLocation(location: MenuItemLocation): boolean {
return [
MenuItemLocation.Context,
MenuItemLocation.NoteListContextMenu,

View File

@ -208,7 +208,7 @@ export enum MenuItemLocation {
Note = 'note',
Tools = 'tools',
Help = 'help',
/**
* @deprecated Do not use - same as NoteListContextMenu
*/
@ -223,7 +223,7 @@ export enum MenuItemLocation {
* - `noteIds:string[]`: IDs of the notes that were right-clicked on.
*/
NoteListContextMenu = 'noteListContextMenu',
EditorContextMenu = 'editorContextMenu',
/**
@ -243,7 +243,7 @@ export enum MenuItemLocation {
TagContextMenu = 'tagContextMenu',
}
export function isContextMenuItemLocation(location:MenuItemLocation):boolean {
export function isContextMenuItemLocation(location: MenuItemLocation): boolean {
return [
MenuItemLocation.Context,
MenuItemLocation.NoteListContextMenu,

View File

@ -208,7 +208,7 @@ export enum MenuItemLocation {
Note = 'note',
Tools = 'tools',
Help = 'help',
/**
* @deprecated Do not use - same as NoteListContextMenu
*/
@ -223,7 +223,7 @@ export enum MenuItemLocation {
* - `noteIds:string[]`: IDs of the notes that were right-clicked on.
*/
NoteListContextMenu = 'noteListContextMenu',
EditorContextMenu = 'editorContextMenu',
/**
@ -243,7 +243,7 @@ export enum MenuItemLocation {
TagContextMenu = 'tagContextMenu',
}
export function isContextMenuItemLocation(location:MenuItemLocation):boolean {
export function isContextMenuItemLocation(location: MenuItemLocation): boolean {
return [
MenuItemLocation.Context,
MenuItemLocation.NoteListContextMenu,

View File

@ -208,7 +208,7 @@ export enum MenuItemLocation {
Note = 'note',
Tools = 'tools',
Help = 'help',
/**
* @deprecated Do not use - same as NoteListContextMenu
*/
@ -223,7 +223,7 @@ export enum MenuItemLocation {
* - `noteIds:string[]`: IDs of the notes that were right-clicked on.
*/
NoteListContextMenu = 'noteListContextMenu',
EditorContextMenu = 'editorContextMenu',
/**
@ -243,7 +243,7 @@ export enum MenuItemLocation {
TagContextMenu = 'tagContextMenu',
}
export function isContextMenuItemLocation(location:MenuItemLocation):boolean {
export function isContextMenuItemLocation(location: MenuItemLocation): boolean {
return [
MenuItemLocation.Context,
MenuItemLocation.NoteListContextMenu,

View File

@ -20,4 +20,4 @@
"webpack": "^4.43.0",
"webpack-cli": "^3.3.11"
}
}
}

View File

@ -208,7 +208,7 @@ export enum MenuItemLocation {
Note = 'note',
Tools = 'tools',
Help = 'help',
/**
* @deprecated Do not use - same as NoteListContextMenu
*/
@ -223,7 +223,7 @@ export enum MenuItemLocation {
* - `noteIds:string[]`: IDs of the notes that were right-clicked on.
*/
NoteListContextMenu = 'noteListContextMenu',
EditorContextMenu = 'editorContextMenu',
/**
@ -243,7 +243,7 @@ export enum MenuItemLocation {
TagContextMenu = 'tagContextMenu',
}
export function isContextMenuItemLocation(location:MenuItemLocation):boolean {
export function isContextMenuItemLocation(location: MenuItemLocation): boolean {
return [
MenuItemLocation.Context,
MenuItemLocation.NoteListContextMenu,

View File

@ -208,7 +208,7 @@ export enum MenuItemLocation {
Note = 'note',
Tools = 'tools',
Help = 'help',
/**
* @deprecated Do not use - same as NoteListContextMenu
*/
@ -223,7 +223,7 @@ export enum MenuItemLocation {
* - `noteIds:string[]`: IDs of the notes that were right-clicked on.
*/
NoteListContextMenu = 'noteListContextMenu',
EditorContextMenu = 'editorContextMenu',
/**
@ -243,7 +243,7 @@ export enum MenuItemLocation {
TagContextMenu = 'tagContextMenu',
}
export function isContextMenuItemLocation(location:MenuItemLocation):boolean {
export function isContextMenuItemLocation(location: MenuItemLocation): boolean {
return [
MenuItemLocation.Context,
MenuItemLocation.NoteListContextMenu,

View File

@ -208,7 +208,7 @@ export enum MenuItemLocation {
Note = 'note',
Tools = 'tools',
Help = 'help',
/**
* @deprecated Do not use - same as NoteListContextMenu
*/
@ -223,7 +223,7 @@ export enum MenuItemLocation {
* - `noteIds:string[]`: IDs of the notes that were right-clicked on.
*/
NoteListContextMenu = 'noteListContextMenu',
EditorContextMenu = 'editorContextMenu',
/**
@ -243,7 +243,7 @@ export enum MenuItemLocation {
TagContextMenu = 'tagContextMenu',
}
export function isContextMenuItemLocation(location:MenuItemLocation):boolean {
export function isContextMenuItemLocation(location: MenuItemLocation): boolean {
return [
MenuItemLocation.Context,
MenuItemLocation.NoteListContextMenu,

View File

@ -208,7 +208,7 @@ export enum MenuItemLocation {
Note = 'note',
Tools = 'tools',
Help = 'help',
/**
* @deprecated Do not use - same as NoteListContextMenu
*/
@ -223,7 +223,7 @@ export enum MenuItemLocation {
* - `noteIds:string[]`: IDs of the notes that were right-clicked on.
*/
NoteListContextMenu = 'noteListContextMenu',
EditorContextMenu = 'editorContextMenu',
/**
@ -243,7 +243,7 @@ export enum MenuItemLocation {
TagContextMenu = 'tagContextMenu',
}
export function isContextMenuItemLocation(location:MenuItemLocation):boolean {
export function isContextMenuItemLocation(location: MenuItemLocation): boolean {
return [
MenuItemLocation.Context,
MenuItemLocation.NoteListContextMenu,

View File

@ -1,6 +1,6 @@
{
"name": "generator-joplin",
"version": "1.5.0",
"version": "1.5.3",
"lockfileVersion": 1,
"requires": true,
"dependencies": {

View File

@ -1,9 +1,8 @@
{
"name": "generator-joplin",
"version": "1.5.0",
"version": "1.5.3",
"description": "Scaffolds out a new Joplin plugin",
"homepage": "https://joplinapp.org",
"private": true,
"author": {
"name": "Laurent Cozic",
"url": "https://joplinapp.org"
@ -25,5 +24,6 @@
"yosay": "^2.0.1"
},
"repository": "https://github.com/laurent22/generator-joplin",
"license": "MIT"
}
"license": "MIT",
"private": true
}

View File

@ -1,10 +1,12 @@
const { execCommand, execCommandVerbose, rootDir, gitPullTry } = require('./tool-utils.js');
const { execCommand, execCommandVerbose, rootDir, gitPullTry, setPackagePrivateField } = require('./tool-utils.js');
const genDir = `${rootDir}/packages/generator-joplin`;
async function main() {
process.chdir(genDir);
const packageFilePath = `${genDir}/package.json`;
console.info(`Running from: ${process.cwd()}`);
await gitPullTry();
@ -14,7 +16,13 @@ async function main() {
console.info(`New version number: ${version}`);
await execCommandVerbose('npm', ['publish']);
await setPackagePrivateField(packageFilePath, false);
try {
await execCommandVerbose('npm', ['publish']);
} finally {
await setPackagePrivateField(packageFilePath, true);
}
await gitPullTry();
await execCommandVerbose('git', ['add', '-A']);
await execCommandVerbose('git', ['commit', '-m', `Plugin Generator release ${version}`]);

View File

@ -89,6 +89,17 @@ toolUtils.deleteLink = async function(path) {
}
};
toolUtils.setPackagePrivateField = async function(filePath, value) {
const text = await fs.readFile(filePath, 'utf8');
const obj = JSON.parse(text);
if (!value) {
delete obj.private;
} else {
obj.private = true;
}
await fs.writeFile(filePath, JSON.stringify(obj, null, 2), 'utf8');
};
toolUtils.credentialDir = async function() {
const username = require('os').userInfo().username;