18 changes: 9 additions & 9 deletions DEPLOY.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,21 +6,21 @@ Various scripts are provided to deploy the Joplin applications, scripts and tool

Before new releases are created, all version numbers must be updated. This is done using the `setupNewRelease` script and passing it the new major.minor version number. For example:

npm run setupNewRelease -- 1.8
yarn run setupNewRelease -- 1.8

Patch numbers are going to be incremented automatically when releasing each individual package.

## Desktop application

The desktop application is built for Windows, macOS and Linux via continuous integration, by pushing a version tag to GitHub. The process is automated using:

npm run releaseDesktop
yarn run releaseDesktop

## Android application

The app is built and upload to GitHub using:

npm run releaseAndroid -- --type=prerelease
yarn run releaseAndroid -- --type=prerelease

The "type" parameter can be either "release" or "prerelease"

Expand All @@ -32,7 +32,7 @@ It must be built and released manually using XCode.

Unlike the mobile or desktop application, the CLI app doesn't bundle its dependencies and is always installed from source. For that reason, all its `@joplin` dependencies must be deployed publicly first. This is done using:

npm run publishAll
yarn run publishAll

This is going to publish all the Joplin libraries, such as `@joplin/lib`, `@joplin/tools`, etc.

Expand All @@ -52,26 +52,26 @@ Then in `app-cli/package.json`, all `@joplin` dependencies and devdependencies m

Finally, to release the actual app, run:

npm run releaseCli
yarn run releaseCli

## Joplin Server

Run:

npm run releaseServer
yarn run releaseServer

## Web clipper

Run:

npm run releaseClipper
yarn run releaseClipper

## Plugin generator

First the types should generally be updated, using `./updateTypes.sh`. Then run:

npm run releasePluginGenerator
yarn run releasePluginGenerator

## Plugin Repo Cli

Since it has dependencies to the `@joplin` packages, it is released when running `npm run publishAll`
Since it has dependencies to the `@joplin` packages, it is released when running `yarn run publishAll`
28 changes: 15 additions & 13 deletions Dockerfile.server
Original file line number Diff line number Diff line change
@@ -1,14 +1,16 @@
# https://versatile.nl/blog/deploying-lerna-web-apps-with-docker

FROM node:16-bullseye

RUN apt-get update \
&& apt-get install -y \
python \
&& rm -rf /var/lib/apt/lists/*

# Enables Yarn
RUN corepack enable

RUN echo "Node: $(node --version)"
RUN echo "Npm: $(npm --version)"
RUN echo "Yarn: $(yarn --version)"

ARG user=joplin

Expand All @@ -26,7 +28,11 @@ RUN mkdir /home/$user/logs
# this point)

COPY --chown=$user:$user package*.json ./
RUN npm install --ignore-scripts
COPY --chown=$user:$user .yarn ./.yarn
COPY --chown=$user:$user .yarnrc.yml .
COPY --chown=$user:$user yarn.lock .

RUN yarn install --inline-builds --mode=skip-build

# To take advantage of the Docker cache, we first copy all the package.json
# and package-lock.json files, as they rarely change, and then bootstrap
Expand All @@ -40,11 +46,11 @@ RUN npm install --ignore-scripts
# prevent certain sub-packages, such as sqlite3, from being built

COPY --chown=$user:$user packages/fork-sax/package*.json ./packages/fork-sax/
COPY --chown=$user:$user packages/fork-uslug/package*.json ./packages/fork-uslug/
COPY --chown=$user:$user packages/htmlpack/package*.json ./packages/htmlpack/
COPY --chown=$user:$user packages/renderer/package*.json ./packages/renderer/
COPY --chown=$user:$user packages/tools/package*.json ./packages/tools/
COPY --chown=$user:$user packages/lib/package*.json ./packages/lib/
COPY --chown=$user:$user lerna.json .
COPY --chown=$user:$user tsconfig.json .

# The following have postinstall scripts so we need to copy all the files.
Expand All @@ -53,20 +59,16 @@ COPY --chown=$user:$user tsconfig.json .
COPY --chown=$user:$user packages/turndown ./packages/turndown
COPY --chown=$user:$user packages/turndown-plugin-gfm ./packages/turndown-plugin-gfm
COPY --chown=$user:$user packages/fork-htmlparser2 ./packages/fork-htmlparser2
COPY --chown=$user:$user packages/server/package*.json ./packages/server/

# Then bootstrap only, without compiling the TypeScript files

RUN npm run bootstrap

# We have a separate step for the server files because they are more likely to
# change.

COPY --chown=$user:$user packages/server/package*.json ./packages/server/
RUN npm run bootstrapServerOnly
RUN yarn install --inline-builds --mode=skip-build

# Now copy the source files. Put lib and server last as they are more likely to change.

COPY --chown=$user:$user packages/fork-sax ./packages/fork-sax
COPY --chown=$user:$user packages/fork-uslug ./packages/fork-uslug
COPY --chown=$user:$user packages/htmlpack ./packages/htmlpack
COPY --chown=$user:$user packages/renderer ./packages/renderer
COPY --chown=$user:$user packages/tools ./packages/tools
Expand All @@ -75,12 +77,12 @@ COPY --chown=$user:$user packages/server ./packages/server

# Finally build everything, in particular the TypeScript files.

RUN npm run build
RUN yarn run build

ENV RUNNING_IN_DOCKER=1
EXPOSE ${APP_PORT}

CMD [ "npm", "--prefix", "packages/server", "start" ]
CMD [ "yarn", "--prefix", "packages/server", "start" ]

# Build-time metadata
# https://github.com/opencontainers/image-spec/blob/master/annotations.md
Expand Down
2 changes: 1 addition & 1 deletion docker-compose.db-dev.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# For development this compose file starts the database only. The app can then
# be started using `npm run start-dev`, which is useful for development, because
# be started using `yarn run start-dev`, which is useful for development, because
# it means the app Docker file doesn't have to be rebuilt on each change.

version: '3'
Expand Down
1 change: 1 addition & 0 deletions joplin.code-workspace
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
],
"settings": {
"files.exclude": {
".yarn": true,
"lerna-debug.log": true,
"_mydocs/mdtest/": true,
"./packages/lib/plugin_types": true,
Expand Down
2 changes: 1 addition & 1 deletion lint-staged.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ module.exports = {
//
// '**/*.ts?(x)': () => 'npm run tsc',
'*.{js,jsx,ts,tsx}': [
'npm run linter-precommit',
'yarn run linter-precommit',
'git add',
],
};
33,138 changes: 0 additions & 33,138 deletions package-lock.json

This file was deleted.

47 changes: 25 additions & 22 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,34 +1,37 @@
{
"name": "root",
"private": true,
"workspaces": [
"packages/*"
],
"repository": {
"type": "git",
"url": "git+https://github.com/laurent22/joplin.git"
},
"engines": {
"node": ">=16"
},
"scripts": {
"audit": "lerna-audit",
"bootstrap": "lerna bootstrap --force-local --no-ci",
"bootstrapServerOnly": "lerna bootstrap --force-local --no-ci --include-dependents --include-dependencies --scope @joplin/server",
"build": "lerna run build && npm run tsc",
"buildApiDoc": "npm start --prefix=packages/app-cli -- apidoc ../../readme/api/references/rest_api.md",
"build": "yarn workspaces foreach --verbose --interlaced --parallel run build && yarn run tsc",
"buildApiDoc": "yarn workspace joplin start apidoc ../../readme/api/references/rest_api.md",
"buildCommandIndex": "gulp buildCommandIndex",
"updateMarkdownDoc": "node ./packages/tools/updateMarkdownDoc",
"buildPluginDoc": "typedoc --name 'Joplin Plugin API Documentation' --mode file -theme './Assets/PluginDocTheme/' --readme './Assets/PluginDocTheme/index.md' --excludeNotExported --excludeExternals --excludePrivate --excludeProtected --out ../joplin-website/docs/api/references/plugin_api packages/lib/services/plugins/api/",
"buildSettingJsonSchema": "npm start --prefix=packages/app-cli -- settingschema ../../../joplin-website/docs/schema/settings.json",
"buildTranslations": "npm run tsc && node packages/tools/build-translation.js",
"updateMarkdownDoc": "node ./packages/tools/updateMarkdownDoc",
"buildSettingJsonSchema": "yarn workspace joplin start -- settingschema ../../../joplin-website/docs/schema/settings.json",
"buildTranslations": "yarn run tsc && node packages/tools/build-translation.js",
"buildTranslationsNoTsc": "node packages/tools/build-translation.js",
"buildWebsite": "node ./packages/tools/website/build.js && npm run buildPluginDoc && npm run buildSettingJsonSchema",
"buildWebsite": "node ./packages/tools/website/build.js && yarn run buildPluginDoc && yarn run buildSettingJsonSchema",
"circularDependencyCheck": "madge --warning --circular --extensions js ./",
"clean": "lerna clean -y && lerna run clean",
"clean": "npm run clean --workspaces --if-present && node packages/tools/clean && yarn cache clean",
"dependencyTree": "madge",
"generateDatabaseTypes": "node packages/tools/generate-database-types",
"linkChecker": "linkchecker https://joplinapp.org",
"linter-ci": "eslint --resolve-plugins-relative-to . --quiet --ext .js --ext .jsx --ext .ts --ext .tsx",
"linter-precommit": "eslint --resolve-plugins-relative-to . --fix --ext .js --ext .jsx --ext .ts --ext .tsx",
"linter": "eslint --resolve-plugins-relative-to . --fix --quiet --ext .js --ext .jsx --ext .ts --ext .tsx",
"postinstall": "npm run bootstrap --no-ci && npm run build",
"publishAll": "git pull && npm run build && lerna version --yes --no-private --no-git-tag-version && gulp completePublishAll",
"releaseAndroid": "npm run build && export PATH=\"/usr/local/opt/openjdk@11/bin:$PATH\" && node packages/tools/release-android.js",
"postinstall": "yarn run build",
"publishAll": "git pull && yarn run build && lerna version --yes --no-private --no-git-tag-version && gulp completePublishAll",
"releaseAndroid": "yarn run build && export PATH=\"/usr/local/opt/openjdk@11/bin:$PATH\" && node packages/tools/release-android.js",
"releaseAndroidClean": "node packages/tools/release-android.js",
"releaseCli": "node packages/tools/release-cli.js",
"releaseClipper": "node packages/tools/release-clipper.js",
Expand All @@ -39,14 +42,13 @@
"tagServerLatest": "node packages/tools/tagServerLatest.js",
"buildServerDocker": "node packages/tools/buildServerDocker.js",
"setupNewRelease": "node ./packages/tools/setupNewRelease",
"test-ci": "lerna run test-ci --stream",
"test": "lerna run test --stream",
"tsc": "lerna run tsc --stream --parallel",
"test-ci": "yarn workspaces foreach --parallel --verbose --interlaced run test-ci",
"test": "yarn workspaces foreach --parallel --verbose --interlaced run test",
"tsc": "yarn workspaces foreach --parallel --verbose --interlaced run tsc",
"updateIgnored": "gulp updateIgnoredTypeScriptBuild",
"updatePluginTypes": "./packages/generator-joplin/updateTypes.sh",
"watch": "lerna run watch --stream --parallel",
"watchWebsite": "nodemon --verbose --watch Assets/WebsiteAssets --watch packages/tools/website/build.js --ext md,ts,js,mustache,css,tsx,gif,png,svg --exec \"node packages/tools/website/build.js && http-server --port 8077 ../joplin-website/docs -a localhost\"",
"i": "node packages/tools/lernaInstall"
"watch": "yarn workspaces foreach --parallel --verbose --interlaced run watch",
"watchWebsite": "nodemon --verbose --watch Assets/WebsiteAssets --watch packages/tools/website/build.js --ext md,ts,js,mustache,css,tsx,gif,png,svg --exec \"node packages/tools/website/build.js && http-server --port 8077 ../joplin-website/docs -a localhost\""
},
"husky": {
"hooks": {
Expand All @@ -65,14 +67,15 @@
"gulp": "^4.0.2",
"husky": "^3.0.2",
"lerna": "^3.22.1",
"lerna-audit": "^1.3.2",
"lint-staged": "^9.2.1",
"madge": "^4.0.2",
"typedoc": "^0.17.8",
"typescript": "^4.0.5"
"typescript": "4.0.5"
},
"dependencies": {
"http-server": "^0.12.3",
"node-gyp": "^8.4.1",
"nodemon": "^2.0.9"
}
},
"packageManager": "yarn@3.1.1"
}
2 changes: 1 addition & 1 deletion packages/app-cli/app/services/plugins/PluginRunner.ts
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
import * as vm from 'vm';
import Plugin from '@joplin/lib/services/plugins/Plugin';
import sandboxProxy from '@joplin/lib/services/plugins/sandboxProxy';
import BasePluginRunner from '@joplin/lib/services/plugins/BasePluginRunner';
import executeSandboxCall from '@joplin/lib/services/plugins/utils/executeSandboxCall';
import Global from '@joplin/lib/services/plugins/api/Global';
import mapEventHandlersToIds, { EventHandlers } from '@joplin/lib/services/plugins/utils/mapEventHandlersToIds';
import uuid from '@joplin/lib/uuid';
const sandboxProxy = require('@joplin/lib/services/plugins/sandboxProxy');

function createConsoleWrapper(pluginId: string) {
const wrapper: any = {};
Expand Down
2 changes: 1 addition & 1 deletion packages/app-cli/build-doc.sh
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
#!/bin/bash
set -e
npm run build && NODE_PATH=build node build/build-doc.js
yarn run build && NODE_PATH=build node build/build-doc.js
2 changes: 1 addition & 1 deletion packages/app-cli/cli-integration.sh
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
#!/bin/bash
set -e
npm run build && NODE_PATH="build/" node build/cli-integration-tests.js
yarn run build && NODE_PATH="build/" node build/cli-integration-tests.js
4 changes: 2 additions & 2 deletions packages/app-cli/createUsers.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

# Start the server with:
#
# JOPLIN_IS_TESTING=1 npm run start-dev
# JOPLIN_IS_TESTING=1 yarn run start-dev

SCRIPT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" &> /dev/null && pwd )"

Expand Down Expand Up @@ -48,5 +48,5 @@ while [ "$NUM" -lt 400 ]; do
echo "config sync.10.password hunter1hunter2hunter3" >> "$CMD_FILE"
echo "sync" >> "$CMD_FILE"

npm start -- --profile "$PROFILE_DIR" batch "$CMD_FILE"
yarn start -- --profile "$PROFILE_DIR" batch "$CMD_FILE"
done
2 changes: 1 addition & 1 deletion packages/app-cli/fuzzing.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/bin/bash
#
set -e
npm run build && NODE_PATH="build/" node build/fuzzing.js
yarn run build && NODE_PATH="build/" node build/fuzzing.js
2 changes: 1 addition & 1 deletion packages/app-cli/gulpfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ tasks.prepareBuild = {
await utils.copyFile(`${__dirname}/package.json`, `${buildDir}/package.json`);
await utils.setPackagePrivateField(`${buildDir}/package.json`, false);

await utils.copyFile(`${__dirname}/package-lock.json`, `${buildDir}/package-lock.json`);
// await utils.copyFile(`${__dirname}/package-lock.json`, `${buildDir}/package-lock.json`);
await utils.copyFile(`${__dirname}/gulpfile.js`, `${buildDir}/gulpfile.js`);

fs.chmodSync(`${buildDir}/main.js`, 0o755);
Expand Down
18,867 changes: 0 additions & 18,867 deletions packages/app-cli/package-lock.json

This file was deleted.

12 changes: 5 additions & 7 deletions packages/app-cli/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@
"build": "gulp build",
"start": "gulp build -L && node \"build/main.js\" --stack-trace-enabled --log-level debug --env dev",
"start-no-build": "node \"build/main.js\" --stack-trace-enabled --log-level debug --env dev",
"tsc": "node node_modules/typescript/bin/tsc --project tsconfig.json",
"watch": "node node_modules/typescript/bin/tsc --watch --project tsconfig.json"
"tsc": "tsc --project tsconfig.json",
"watch": "tsc --watch --project tsconfig.json"
},
"bugs": {
"url": "https://github.com/laurent22/joplin/issues"
Expand All @@ -34,9 +34,7 @@
"owner": "Laurent Cozic"
},
"version": "2.6.2",
"bin": {
"joplin": "./main.js"
},
"bin": "./main.js",
"engines": {
"node": ">=10.0.0"
},
Expand All @@ -61,9 +59,9 @@
"sqlite3": "^5.0.2",
"string-padding": "^1.0.2",
"strip-ansi": "^4.0.0",
"tcp-port-used": "^0.1.2",
"tcp-port-used": "^1.0.2",
"terminal-kit": "^1.30.0",
"tkwidgets": "^0.5.26",
"tkwidgets": "0.5.27",
"url-parse": "^1.4.7",
"word-wrap": "^1.2.3",
"yargs-parser": "^7.0.0"
Expand Down
6 changes: 3 additions & 3 deletions packages/app-cli/tests/services/plugins/sandboxProxy.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import sandboxProxy, { Target } from '@joplin/lib/services/plugins/sandboxProxy';
const sandboxProxy = require('@joplin/lib/services/plugins/sandboxProxy');
import { setupDatabaseAndSynchronizer, switchClient } from '@joplin/lib/testing/test-utils';

describe('services_plugins_sandboxProxy', function() {
Expand All @@ -17,7 +17,7 @@ describe('services_plugins_sandboxProxy', function() {

const results: Result[] = [];

const target: Target = (path: string, args: any[]) => {
const target: any = (path: string, args: any[]) => {
results.push({ path, args });
};

Expand All @@ -40,7 +40,7 @@ describe('services_plugins_sandboxProxy', function() {

const results: Result[] = [];

const target: Target = (path: string, args: any[]) => {
const target: any = (path: string, args: any[]) => {
results.push({ path, args });
};

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,4 @@
# - Run the below command
# - Then the file /manifests.json also needs to be updated with the new manifest file

npm run dist && cp publish/org.joplinapp.plugins.RegisterCommandDemo.jpl ~/src/joplin-plugins-test/plugins/org.joplinapp.plugins.RegisterCommandDemo/plugin.jpl && cp publish/org.joplinapp.plugins.RegisterCommandDemo.json ~/src/joplin-plugins-test/plugins/org.joplinapp.plugins.RegisterCommandDemo/plugin.json
yarn run dist && cp publish/org.joplinapp.plugins.RegisterCommandDemo.jpl ~/src/joplin-plugins-test/plugins/org.joplinapp.plugins.RegisterCommandDemo/plugin.jpl && cp publish/org.joplinapp.plugins.RegisterCommandDemo.json ~/src/joplin-plugins-test/plugins/org.joplinapp.plugins.RegisterCommandDemo/plugin.json
2 changes: 1 addition & 1 deletion packages/app-cli/tests/support/plugins/toc/src/index.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import joplin from 'api';
import { ToolbarButtonLocation } from 'api/types';

const uslug = require('uslug');
const uslug = require('@joplin/fork-uslug');

// From https://stackoverflow.com/a/6234804/561309
function escapeHtml(unsafe:string) {
Expand Down
8 changes: 4 additions & 4 deletions packages/app-cli/tests/support/serverPerformances/testPerf.sh
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ do
done

cd "$ROOT_DIR/packages/app-cli"
npm start -- --profile "$PROFILE_DIR" batch "$CMD_FILE"
npm start -- --profile "$PROFILE_DIR" import ~/Desktop/Joplin_17_06_2021.jex
# npm start -- --profile "$PROFILE_DIR" import ~/Desktop/Tout_18_06_2021.jex
npm start -- --profile "$PROFILE_DIR" sync --use-lock 1
yarn start -- --profile "$PROFILE_DIR" batch "$CMD_FILE"
yarn start -- --profile "$PROFILE_DIR" import ~/Desktop/Joplin_17_06_2021.jex
# yarn start -- --profile "$PROFILE_DIR" import ~/Desktop/Tout_18_06_2021.jex
yarn start -- --profile "$PROFILE_DIR" sync --use-lock 1
6 changes: 3 additions & 3 deletions packages/app-cli/tools/populateDatabase.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
// - Run the Postgres database -- `sudo docker-compose --file docker-compose.db-dev.yml up`
// - Update the DB parameters in ~/joplin-credentials/server.env to use the dev
// database
// - Run the server - `JOPLIN_IS_TESTING=1 npm run start-dev`
// - Run the server - `JOPLIN_IS_TESTING=1 yarn run start-dev`
// - Then run this script - `node populateDatabase.js`
//
// Currently it doesn't actually create the users, so that should be done using:
Expand Down Expand Up @@ -64,7 +64,7 @@ const processUser = async (userNum: number) => {

await chdir(cliDir);

await execCommand2(['npm', 'run', 'start-no-build', '--', '--profile', profileDir, 'batch', commandFile]);
await execCommand2(['yarn', 'run', 'start-no-build', '--', '--profile', profileDir, 'batch', commandFile]);
} catch (error) {
console.error(`Could not process user ${userNum}:`, error);
} finally {
Expand All @@ -88,7 +88,7 @@ const main = async () => {

// Build the app once before starting, because we'll use start-no-build to
// run the scripts (faster)
await execCommand2(['npm', 'run', 'build']);
await execCommand2(['yarn', 'run', 'build']);

const focusUserNum = 0;

Expand Down
5 changes: 0 additions & 5 deletions packages/app-clipper/package-lock.json

This file was deleted.

1 change: 1 addition & 0 deletions packages/app-desktop/.gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -11,3 +11,4 @@ gui/NoteEditor/NoteBody/TinyMCE/supportedLocales.js
runForSharingCommands-*
runForTestingCommands-*
style.min.css
build/lib/
1 change: 1 addition & 0 deletions packages/app-desktop/.yarnrc.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
nodeLinker: node-modules
2 changes: 1 addition & 1 deletion packages/app-desktop/gui/ConfigScreen/ConfigScreen.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ class ConfigScreenComponent extends React.Component<any, any> {
}

screenFromName(screenName: string) {
if (screenName === 'encryption') return <EncryptionConfigScreen themeId={this.props.themeId}/>;
if (screenName === 'encryption') return <EncryptionConfigScreen/>;
if (screenName === 'server') return <ClipperConfigScreen themeId={this.props.themeId}/>;
if (screenName === 'keymap') return <KeymapConfigScreen themeId={this.props.themeId}/>;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ export interface PluginItem {
hasBeenUpdated: boolean;
}

const CellRoot = styled.div`
const CellRoot = styled.div<{isCompatible: boolean}>`
display: flex;
box-sizing: border-box;
background-color: ${props => props.theme.backgroundColor};
Expand Down Expand Up @@ -104,7 +104,7 @@ const DevModeLabel = styled.div`
color: ${props => props.theme.color};
`;

const StyledNameAndVersion = styled.div`
const StyledNameAndVersion = styled.div<{mb: any}>`
font-family: ${props => props.theme.fontFamily};
color: ${props => props.theme.color};
font-size: ${props => props.theme.fontSize}px;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ const Root = styled.div`
flex-direction: column;
`;

const UserPluginsRoot = styled.div`
const UserPluginsRoot = styled.div<any>`
${space}
display: flex;
flex-wrap: wrap;
Expand All @@ -37,7 +37,7 @@ const ToolsButton = styled(Button)`
margin-right: 6px;
`;

const RepoApiErrorMessage = styled(StyledMessage)`
const RepoApiErrorMessage = styled(StyledMessage)<any>`
max-width: ${props => props.maxWidth}px;
margin-bottom: 10px;
`;
Expand Down
2 changes: 1 addition & 1 deletion packages/app-desktop/gui/DialogTitle.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import styled from 'styled-components';

const Root = styled.div`
const Root = styled.div<any>`
display: flex;
justify-content: ${props => props.justifyContent ? props.justifyContent : 'center'};
font-family: ${props => props.theme.fontFamily};
Expand Down
2 changes: 1 addition & 1 deletion packages/app-desktop/gui/EditFolderDialog/IconSelector.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ export const IconSelector = (props: Props) => {

await loadScript({
id: 'emoji-button-lib',
src: 'node_modules/@joeattardi/emoji-button/dist/index.js',
src: 'build/lib/@joeattardi/emoji-button/dist/index.js',
attrs: {
type: 'module',
},
Expand Down
2 changes: 1 addition & 1 deletion packages/app-desktop/gui/EditFolderDialog/loadEmojiLib.js
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
import { EmojiButton } from '../../node_modules/@joeattardi/emoji-button/dist/index.js';
import { EmojiButton } from '../../build/lib/@joeattardi/emoji-button/dist/index.js';
window.EmojiButton = EmojiButton;
2 changes: 2 additions & 0 deletions packages/app-desktop/gui/MainScreen/MainScreen.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -832,7 +832,9 @@ class MainScreenComponent extends React.Component<Props, State> {
{this.renderPluginDialogs()}
{noteContentPropertiesDialogOptions.visible && <NoteContentPropertiesDialog markupLanguage={noteContentPropertiesDialogOptions.markupLanguage} themeId={this.props.themeId} onClose={this.noteContentPropertiesDialog_close} text={noteContentPropertiesDialogOptions.text}/>}
{notePropertiesDialogOptions.visible && <NotePropertiesDialog themeId={this.props.themeId} noteId={notePropertiesDialogOptions.noteId} onClose={this.notePropertiesDialog_close} onRevisionLinkClick={notePropertiesDialogOptions.onRevisionLinkClick} />}
{/* @ts-ignore */}
{shareNoteDialogOptions.visible && <ShareNoteDialog themeId={this.props.themeId} noteIds={shareNoteDialogOptions.noteIds} onClose={this.shareNoteDialog_close} />}
{/* @ts-ignore */}
{shareFolderDialogOptions.visible && <ShareFolderDialog themeId={this.props.themeId} folderId={shareFolderDialogOptions.folderId} onClose={this.shareFolderDialog_close} />}

<PromptDialog autocomplete={promptOptions && 'autocomplete' in promptOptions ? promptOptions.autocomplete : null} defaultValue={promptOptions && promptOptions.value ? promptOptions.value : ''} themeId={this.props.themeId} style={styles.prompt} onClose={this.promptOnClose_} label={promptOptions ? promptOptions.label : ''} description={promptOptions ? promptOptions.description : null} visible={!!this.state.promptOptions} buttons={promptOptions && 'buttons' in promptOptions ? promptOptions.buttons : null} inputType={promptOptions && 'inputType' in promptOptions ? promptOptions.inputType : null} />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -336,7 +336,7 @@ function CodeMirror(props: NoteBodyEditorProps, ref: any) {
async function loadScripts() {
const scriptsToLoad: {src: string; id: string; loaded: boolean}[] = [
{
src: 'node_modules/codemirror/addon/dialog/dialog.css',
src: 'build/lib/codemirror/addon/dialog/dialog.css',
id: 'codemirrorDialogStyle',
loaded: false,
},
Expand All @@ -351,7 +351,7 @@ function CodeMirror(props: NoteBodyEditorProps, ref: any) {
if (theme.indexOf('solarized') >= 0) theme = 'solarized';

scriptsToLoad.push({
src: `node_modules/codemirror/theme/${theme}.css`,
src: `build/lib/codemirror/theme/${theme}.css`,
id: `codemirrorTheme${theme}`,
loaded: false,
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -320,7 +320,7 @@ const TinyMCE = (props: NoteBodyEditorProps, ref: any) => {
async function loadScripts() {
const scriptsToLoad: any[] = [
{
src: 'node_modules/tinymce/tinymce.min.js',
src: 'build/lib/tinymce/tinymce.min.js',
id: 'tinyMceScript',
loaded: false,
},
Expand Down Expand Up @@ -571,7 +571,7 @@ const TinyMCE = (props: NoteBodyEditorProps, ref: any) => {
statusbar: false,
target_list: false,
table_resize_bars: false,
language: ['en_US', 'en_GB'].includes(language) ? undefined : language,
language_url: ['en_US', 'en_GB'].includes(language) ? undefined : `build/lib/tinymce/langs/${language}`,
toolbar: toolbar.join(' '),
localization_function: _,
contextmenu: false,
Expand Down Expand Up @@ -708,7 +708,7 @@ const TinyMCE = (props: NoteBodyEditorProps, ref: any) => {
}

const cssFiles = [
'node_modules/@fortawesome/fontawesome-free/css/all.min.css',
'build/lib/@fortawesome/fontawesome-free/css/all.min.css',
`gui/note-viewer/pluginAssets/highlight.js/${theme.codeThemeCss}`,
].concat(
pluginAssets
Expand Down
2 changes: 1 addition & 1 deletion packages/app-desktop/gui/ResizableLayout/utils/style.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import styled from 'styled-components';
// Need to use `attrs` otherwise styled-components creates many instances of the
// style when the component is resized.
// https://github.com/styled-components/styled-components/issues/1212
export const StyledWrapperRoot = styled.div.attrs((props: any) => ({
export const StyledWrapperRoot: any = styled.div.attrs((props: any) => ({
style: {
width: props.size.width,
height: props.size.height,
Expand Down
4 changes: 2 additions & 2 deletions packages/app-desktop/gui/Root.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -82,11 +82,11 @@ const GlobalStyle = createGlobalStyle`
box-sizing: border-box;
}
/*
div, span, a {
/*color: ${(props: any) => props.theme.color};*/
/*font-size: ${(props: any) => props.theme.fontSize}px;*/
font-family: ${(props: any) => props.theme.fontFamily};
}
*/
`;

let wcsTimeoutId_: any = null;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ const StyledAddRecipient = styled.div`
margin-bottom: 1em;
`;

const StyledRecipient = styled(StyledMessage)`
const StyledRecipient = styled(StyledMessage)<any>`
display: flex;
flex-direction: row;
padding: .6em 1em;
Expand Down Expand Up @@ -80,7 +80,7 @@ const StyledError = styled(StyledMessage)`
margin-bottom: 1em;
`;

const StyledShareState = styled(StyledMessage)`
const StyledShareState = styled(StyledMessage)<any>`
word-break: break-all;
margin-bottom: 1em;
`;
Expand Down
6 changes: 3 additions & 3 deletions packages/app-desktop/gui/SyncWizard/Dialog.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ const StyledRoot = styled.div`
max-width: 1200px;
`;

const SyncTargetDescription = styled.div`
const SyncTargetDescription = styled.div<{height: number}>`
${props => props.height ? `height: ${props.height}px` : ''};
margin-bottom: 1.3em;
line-height: ${props => props.theme.lineHeight};
Expand Down Expand Up @@ -69,7 +69,7 @@ const SyncTargetLogo = styled.img`
margin-right: 0.4em;
`;

const SyncTargetBox = styled.div`
const SyncTargetBox = styled.div<{faded: boolean}>`
display: flex;
flex: 1;
flex-direction: column;
Expand All @@ -96,7 +96,7 @@ const FeatureIcon = styled.i`
position: absolute;
`;

const FeatureLine = styled.div`
const FeatureLine = styled.div<{enabled: boolean}>`
margin-bottom: .5em;
opacity: ${props => props.enabled ? 1 : 0.5};
position: relative;
Expand Down
2 changes: 1 addition & 1 deletion packages/app-desktop/gui/note-viewer/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -430,7 +430,7 @@
setMarkers(markLoader_.whenDone.keywords, markLoader_.whenDone.options);
};

script.src = '../../node_modules/mark.js/dist/mark.min.js';
script.src = '../../build/lib/mark.js/dist/mark.min.js';
document.getElementById('joplin-container-markScriptContainer').appendChild(script);
} else if (markLoader_.state === 'ready') {
setMarkers(keywords, options);
Expand Down
2 changes: 1 addition & 1 deletion packages/app-desktop/gui/style/StyledMessage.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import styled from 'styled-components';

const StyledMessage = styled.div`
const StyledMessage = styled.div<{type: string}>`
border-radius: 3px;
background-color: ${props => props.type === 'error' ? props.theme.warningBackgroundColor : 'transparent'};
font-size: ${props => props.theme.fontSize}px;
Expand Down
6 changes: 3 additions & 3 deletions packages/app-desktop/gulpfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@ const tasks = {
copyPluginAssets: {
fn: require('./tools/copyPluginAssets.js'),
},
copyTinyMceLangs: {
fn: require('./tools/copyTinyMceLangs.js'),
copyApplicationAssets: {
fn: require('./tools/copyApplicationAssets.js'),
},
electronRebuild: {
fn: require('./tools/electronRebuild.js'),
Expand All @@ -40,7 +40,7 @@ const buildParallel = [
'compileScripts',
'compilePackageInfo',
'copyPluginAssets',
'copyTinyMceLangs',
'copyApplicationAssets',
'updateIgnoredTypeScriptBuild',
'buildCommandIndex',
'compileSass',
Expand Down
10 changes: 5 additions & 5 deletions packages/app-desktop/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,11 @@
<title>Joplin</title>
<link rel="stylesheet" href="style.min.css">
<link rel="stylesheet" href="style/icons/style.css">
<link rel="stylesheet" href="node_modules/@fortawesome/fontawesome-free/css/all.min.css">
<link rel="stylesheet" href="node_modules/react-datetime/css/react-datetime.css">
<link rel="stylesheet" href="node_modules/smalltalk/css/smalltalk.css">
<link rel="stylesheet" href="node_modules/roboto-fontface/css/roboto/roboto-fontface.css">
<link rel="stylesheet" href="node_modules/codemirror/lib/codemirror.css">
<link rel="stylesheet" href="build/lib/@fortawesome/fontawesome-free/css/all.min.css">
<link rel="stylesheet" href="build/lib/react-datetime/css/react-datetime.css">
<link rel="stylesheet" href="build/lib/smalltalk/css/smalltalk.css">
<link rel="stylesheet" href="build/lib/roboto-fontface/css/roboto/roboto-fontface.css">
<link rel="stylesheet" href="build/lib/codemirror/lib/codemirror.css">

<style>
.smalltalk {
Expand Down
21 changes: 0 additions & 21 deletions packages/app-desktop/jest.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,11 +23,6 @@ module.exports = {
// The directory where Jest should output its coverage files
// coverageDirectory: undefined,

// An array of regexp pattern strings used to skip coverage collection
// coveragePathIgnorePatterns: [
// "/node_modules/"
// ],

// Indicates which provider should be used to instrument code for coverage
coverageProvider: 'v8',

Expand Down Expand Up @@ -63,11 +58,6 @@ module.exports = {
// The maximum amount of workers used to run your tests. Can be specified as % or a number. E.g. maxWorkers: 10% will use 10% of your CPU amount + 1 as the maximum worker number. maxWorkers: 2 will use a maximum of 2 workers.
// maxWorkers: "50%",

// An array of directory names to be searched recursively up from the requiring module's location
// moduleDirectories: [
// "node_modules"
// ],

// An array of file extensions your modules use
// moduleFileExtensions: [
// "js",
Expand Down Expand Up @@ -148,11 +138,6 @@ module.exports = {
'**/*.test.js',
],

// An array of regexp pattern strings that are matched against all test paths, matched tests are skipped
// testPathIgnorePatterns: [
// "/node_modules/"
// ],

// The regexp pattern or array of patterns that Jest uses to detect test files
// testRegex: [],

Expand All @@ -171,12 +156,6 @@ module.exports = {
// A map from regular expressions to paths to transformers
// transform: undefined,

// An array of regexp pattern strings that are matched against all source file paths, matched files will skip transformation
// transformIgnorePatterns: [
// "/node_modules/",
// "\\.pnp\\.[^\\/]+$"
// ],

// An array of regexp pattern strings that are matched against all modules before the module loader will automatically return a mock for them
// unmockedModulePathPatterns: undefined,

Expand Down
4 changes: 4 additions & 0 deletions packages/app-desktop/main.scss
Original file line number Diff line number Diff line change
Expand Up @@ -154,6 +154,10 @@ body, button {
font-size: 16px;
}

div, span, a {
font-family: Roboto;
}

h2 {
font-size: 24px;

Expand Down
31,990 changes: 0 additions & 31,990 deletions packages/app-desktop/package-lock.json

This file was deleted.

29 changes: 15 additions & 14 deletions packages/app-desktop/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,15 +5,15 @@
"main": "main.js",
"private": true,
"scripts": {
"dist": "npm run electronRebuild && npx electron-builder",
"dist": "yarn run electronRebuild && npx electron-builder",
"build": "gulp build",
"postinstall": "npm run build",
"postinstall": "yarn run build",
"electronRebuild": "gulp electronRebuild",
"tsc": "node node_modules/typescript/bin/tsc --project tsconfig.json",
"watch": "node node_modules/typescript/bin/tsc --watch --project tsconfig.json",
"tsc": "tsc --project tsconfig.json",
"watch": "tsc --watch --project tsconfig.json",
"start": "gulp build && electron . --env dev --log-level debug --no-welcome --open-dev-tools",
"test": "jest",
"test-ci": "npm run test"
"test-ci": "yarn test"
},
"repository": {
"type": "git",
Expand All @@ -31,7 +31,8 @@
"afterSign": "./tools/notarizeMacApp.js",
"extraResources": [
"build/icons/*",
"build/images/*"
"build/images/*",
"build/lib/*"
],
"afterAllArtifactBuild": "./generateSha512.js",
"asar": true,
Expand Down Expand Up @@ -110,13 +111,13 @@
"@types/jest": "^26.0.15",
"@types/node": "^14.14.6",
"@types/react": "16.9.55",
"@types/react-redux": "^7.1.9",
"@types/styled-components": "^5.1.4",
"@types/react-redux": "7.1.9",
"@types/styled-components": "5.1.4",
"ajv": "^6.5.0",
"app-builder-bin": "^1.9.11",
"babel-cli": "^6.26.0",
"babel-preset-react": "^6.24.1",
"electron": "^14.1.0",
"electron": "14.1.0",
"electron-builder": "^22.11.7",
"electron-notarize": "^1.0.0",
"electron-rebuild": "^3.2.3",
Expand All @@ -126,7 +127,7 @@
"js-sha512": "^0.8.0",
"nan": "2.14.2",
"react-test-renderer": "^16.14.0",
"typescript": "^4.0.5"
"typescript": "4.0.5"
},
"optionalDependencies": {
"7zip-bin-linux": "^1.0.1",
Expand Down Expand Up @@ -162,17 +163,17 @@
"react": "16.13.1",
"react-datetime": "^2.14.0",
"react-dom": "16.9.0",
"react-redux": "^5.0.7",
"react-redux": "5.0.7",
"react-select": "^2.4.3",
"react-toggle-button": "^2.2.0",
"react-tooltip": "^3.10.0",
"redux": "^3.7.2",
"redux": "3.7.2",
"reselect": "^4.0.0",
"roboto-fontface": "^0.10.0",
"smalltalk": "^2.5.1",
"sqlite3": "^5.0.2",
"styled-components": "^5.1.1",
"styled-system": "^5.1.5",
"styled-components": "5.1.1",
"styled-system": "5.1.5",
"taboverride": "^4.0.3",
"tinymce": "^5.2.0"
}
Expand Down
4 changes: 2 additions & 2 deletions packages/app-desktop/runForTesting.sh
Original file line number Diff line number Diff line change
Expand Up @@ -101,11 +101,11 @@ do
done

cd "$ROOT_DIR/packages/app-cli"
npm start -- --profile "$PROFILE_DIR" batch "$CMD_FILE"
yarn start -- --profile "$PROFILE_DIR" batch "$CMD_FILE"

if [[ $COMMANDS != "" ]]; then
exit 0
fi

cd "$ROOT_DIR/packages/app-desktop"
npm start -- --profile "$PROFILE_DIR"
yarn start -- --profile "$PROFILE_DIR"
4 changes: 2 additions & 2 deletions packages/app-desktop/services/plugins/UserWebview.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -28,13 +28,13 @@ export interface Props {
onReady?: Function;
}

const StyledFrame = styled.iframe`
const StyledFrame = styled.iframe<{fitToContent: boolean; borderBottom: boolean}>`
padding: 0;
margin: 0;
width: ${(props: any) => props.fitToContent ? `${props.width}px` : '100%'};
height: ${(props: any) => props.fitToContent ? `${props.height}px` : '100%'};
border: none;
border-bottom: ${(props: Props) => props.borderBottom ? `1px solid ${props.theme.dividerColor}` : 'none'};
border-bottom: ${(props: any) => props.borderBottom ? `1px solid ${props.theme.dividerColor}` : 'none'};
`;

function serializeForm(form: any) {
Expand Down
4 changes: 2 additions & 2 deletions packages/app-desktop/services/plugins/UserWebviewIndex.html
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@
<meta charset="UTF-8">
<script src="UserWebviewIndex.js"></script>
<link rel="stylesheet" href="../../style/icons/style.css">
<link rel="stylesheet" href="../../node_modules/@fortawesome/fontawesome-free/css/all.min.css">
<link rel="stylesheet" href="../../node_modules/roboto-fontface/css/roboto/roboto-fontface.css">
<link rel="stylesheet" href="../../build/lib/@fortawesome/fontawesome-free/css/all.min.css">
<link rel="stylesheet" href="../../build/lib/roboto-fontface/css/roboto/roboto-fontface.css">
<style>
html {
overflow: hidden;
Expand Down
2 changes: 1 addition & 1 deletion packages/app-desktop/services/plugins/plugin_index.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
(function(globalObject) {
// TODO: Not sure if that will work once packaged in Electron
const sandboxProxy = require('../../node_modules/@joplin/lib/services/plugins/sandboxProxy.js').default;
const sandboxProxy = require('../../build/lib/@joplin/lib/services/plugins/sandboxProxy.js');
const ipcRenderer = require('electron').ipcRenderer;

const ipcRendererSend = (message, args) => {
Expand Down
4 changes: 2 additions & 2 deletions packages/app-desktop/testPluginDemo.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,5 @@
# It could be used to develop plugins too.

SCRIPT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd )"
PLUGIN_PATH="$SCRIPT_DIR/../app-cli/tests/support/plugins/load_css"
npm i --prefix="$PLUGIN_PATH" && npm start -- --dev-plugins "$PLUGIN_PATH"
PLUGIN_PATH="$SCRIPT_DIR/../app-cli/tests/support/plugins/toc"
yarn i --prefix="$PLUGIN_PATH" && yarn start -- --dev-plugins "$PLUGIN_PATH"
6 changes: 4 additions & 2 deletions packages/app-desktop/tools/compileScripts.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
const fs = require('fs-extra');
const spawnSync = require('child_process').spawnSync;
const { chdir } = require('process');

const babelPath = `${__dirname}/../node_modules/.bin/babel${process.platform === 'win32' ? '.cmd' : ''}`;
const basePath = `${__dirname}/../../..`;

function fileIsNewerThan(path1, path2) {
Expand All @@ -14,6 +14,8 @@ function fileIsNewerThan(path1, path2) {
}

function convertJsx(path) {
chdir(`${__dirname}/..`);

fs.readdirSync(path).forEach((filename) => {
const jsxPath = `${path}/${filename}`;
const p = jsxPath.split('.');
Expand All @@ -28,7 +30,7 @@ function convertJsx(path) {

if (fileIsNewerThan(jsxPath, jsPath)) {
console.info(`Compiling ${jsxPath}...`);
const result = spawnSync(babelPath, ['--presets', 'react', '--out-file', jsPath, jsxPath]);
const result = spawnSync('yarn', ['run', 'babel', '--presets', 'react', '--out-file', jsPath, jsxPath]);
if (result.status !== 0) {
const msg = [];
if (result.stdout) msg.push(result.stdout.toString());
Expand Down
83 changes: 83 additions & 0 deletions packages/app-desktop/tools/copyApplicationAssets.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,83 @@
const fs = require('fs-extra');
const glob = require('glob');
const { resolve } = require('path');
const { copyDir, dirname, copyFile, mkdir } = require('@joplin/tools/gulp/utils');

const nodeModulesDir = resolve(__dirname, '../node_modules');

async function main() {
const langSourceDir = resolve(__dirname, '../../../Assets/TinyMCE/langs');
const buildLibDir = resolve(__dirname, '../build/lib');

const dirs = [
'tinymce',
'@fortawesome/fontawesome-free/webfonts',
'roboto-fontface/fonts',
'codemirror/theme',
{
src: langSourceDir,
dest: `${buildLibDir}/tinymce/langs`,
},
];

const files = [
'@fortawesome/fontawesome-free/css/all.min.css',
'react-datetime/css/react-datetime.css',
'smalltalk/css/smalltalk.css',
'roboto-fontface/css/roboto/roboto-fontface.css',
'codemirror/lib/codemirror.css',
'codemirror/addon/dialog/dialog.css',
'@joeattardi/emoji-button/dist/index.js',
'mark.js/dist/mark.min.js',
{
src: resolve(__dirname, '../../lib/services/plugins/sandboxProxy.js'),
dest: `${buildLibDir}/@joplin/lib/services/plugins/sandboxProxy.js`,
},
];

for (const dir of dirs) {
let sourceDir, destDir;

if (typeof dir !== 'string') {
sourceDir = dir.src;
destDir = dir.dest;
} else {
sourceDir = `${nodeModulesDir}/${dir}`;
destDir = `${buildLibDir}/${dir}`;
}

console.info(`Copying ${sourceDir} => ${destDir}`);
await mkdir(destDir);
await copyDir(sourceDir, destDir);
}

for (const file of files) {
let sourceFile, destFile;

if (typeof file !== 'string') {
sourceFile = file.src;
destFile = file.dest;
} else {
sourceFile = `${nodeModulesDir}/${file}`;
destFile = `${buildLibDir}/${file}`;
}

await mkdir(dirname(destFile));

console.info(`Copying ${sourceFile} => ${destFile}`);
await copyFile(sourceFile, destFile);
}

const supportedLocales = glob.sync(`${langSourceDir}/*.js`).map(s => {
s = s.split('/');
s = s[s.length - 1];
s = s.split('.');
return s[0];
});

const content = `module.exports = ${JSON.stringify(supportedLocales, null, 2)}`;

await fs.writeFile(`${__dirname}/../gui/NoteEditor/NoteBody/TinyMCE/supportedLocales.js`, content, 'utf8');
}

module.exports = main;
2 changes: 1 addition & 1 deletion packages/app-desktop/tools/copyPluginAssets.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ const utils = require('@joplin/tools/gulp/utils');

async function main() {
const rootDir = `${__dirname}/..`;
// TODO: should take from node_modules/@joplin/renderer

const sourceDir = `${rootDir}/../../packages/renderer/assets`;
const destDirs = [
`${rootDir}/gui/note-viewer/pluginAssets`,
Expand Down
23 changes: 0 additions & 23 deletions packages/app-desktop/tools/copyTinyMceLangs.js

This file was deleted.

10 changes: 5 additions & 5 deletions packages/app-desktop/tools/electronRebuild.js
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,8 @@ async function main() {
// console.warn('!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!');
// return;

let exePath = `${__dirname}/../node_modules/.bin/electron-rebuild`;
if (isWindows()) exePath += '.cmd';
// let exePath = `${__dirname}/../node_modules/.bin/electron-rebuild`;
// if (isWindows()) exePath += '.cmd';

process.chdir(`${__dirname}/..`);

Expand All @@ -44,10 +44,10 @@ async function main() {
if (isWindows()) {
// Cannot run this in parallel, or the 64-bit version might end up
// with 32-bit files and vice-versa
console.info(await execCommand([`"${exePath}"`, forceAbiArgs, '--arch ia32'].join(' ')));
console.info(await execCommand([`"${exePath}"`, forceAbiArgs, '--arch x64'].join(' ')));
console.info(await execCommand(['yarn', 'run', 'electron-rebuild', forceAbiArgs, '--arch ia32'].join(' ')));
console.info(await execCommand(['yarn', 'run', 'electron-rebuild', forceAbiArgs, '--arch x64'].join(' ')));
} else {
console.info(await execCommand([`"${exePath}"`, forceAbiArgs].join(' ')));
console.info(await execCommand(['yarn', 'run', 'electron-rebuild', forceAbiArgs].join(' ')));
}
}

Expand Down
13 changes: 0 additions & 13 deletions packages/app-desktop/tools/unlinkReact.js

This file was deleted.

4 changes: 2 additions & 2 deletions packages/app-mobile/clean_build.bat
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,5 @@ rmdir /s/q android\app\build
rmdir /s/q android\build
rmdir /s/q android\.gradle
rmdir /s/q node_modules
npm install
npm run start
yarn install
yarn run start
56 changes: 28 additions & 28 deletions packages/app-mobile/ios/Podfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -215,35 +215,35 @@ PODS:
- glog
- react-native-alarm-notification (1.0.5):
- React
- react-native-camera (3.40.0):
- react-native-camera (3.44.3):
- React-Core
- react-native-camera/RCT (= 3.40.0)
- react-native-camera/RN (= 3.40.0)
- react-native-camera/RCT (3.40.0):
- react-native-camera/RCT (= 3.44.3)
- react-native-camera/RN (= 3.44.3)
- react-native-camera/RCT (3.44.3):
- React-Core
- react-native-camera/RN (3.40.0):
- react-native-camera/RN (3.44.3):
- React-Core
- react-native-document-picker (4.0.0):
- react-native-document-picker (4.3.0):
- React-Core
- react-native-geolocation (2.0.2):
- React
- react-native-get-random-values (1.7.1):
- React-Core
- react-native-image-picker (2.3.4):
- React-Core
- react-native-image-resizer (1.3.0):
- react-native-image-resizer (1.4.5):
- React-Core
- react-native-netinfo (6.0.0):
- react-native-netinfo (6.2.1):
- React-Core
- react-native-rsa-native (2.0.4):
- React
- react-native-slider (3.0.3):
- React
- react-native-sqlite-storage (5.0.0):
- React
- react-native-version-info (1.1.0):
- react-native-version-info (1.1.1):
- React-Core
- react-native-webview (10.9.2):
- react-native-webview (10.10.2):
- React-Core
- React-perflogger (0.66.1)
- React-RCTActionSheet (0.66.1):
Expand Down Expand Up @@ -312,21 +312,21 @@ PODS:
- React-perflogger (= 0.66.1)
- rn-fetch-blob (0.12.0):
- React-Core
- RNCClipboard (1.5.0):
- RNCClipboard (1.5.1):
- React-Core
- RNCPushNotificationIOS (1.6.0):
- RNCPushNotificationIOS (1.10.1):
- React-Core
- RNDateTimePicker (3.0.3):
- RNDateTimePicker (3.5.2):
- React-Core
- RNFileViewer (2.1.4):
- React-Core
- RNFS (2.16.6):
- RNFS (2.18.0):
- React
- RNQuickAction (0.3.13):
- React
- RNSecureRandom (1.0.0-rc.0):
- RNSecureRandom (1.0.0):
- React
- RNShare (7.2.1):
- RNShare (7.3.2):
- React-Core
- RNVectorIcons (7.1.0):
- React
Expand Down Expand Up @@ -529,18 +529,18 @@ SPEC CHECKSUMS:
React-jsinspector: 8c0517dee5e8c70cd6c3066f20213ff7ce54f176
React-logger: bfddd3418dc1d45b77b822958f3e31422e2c179b
react-native-alarm-notification: 4817a2a0d7cc2ed2acc97337ebcdf9ae2a69c9d5
react-native-camera: 35854c4f764a4a6cf61c1c3525888b92f0fe4b31
react-native-document-picker: 0bba80cc56caab1f67dbaa81ff557e3a9b7f2b9f
react-native-camera: b8cc03e2feec0c04403d0998e37cf519d8fd4c6f
react-native-document-picker: 20f652c2402d3ddc81f396d8167c3bd978add4a2
react-native-geolocation: c956aeb136625c23e0dce0467664af2c437888c9
react-native-get-random-values: 2c4ff6b44cb71291dabe9a8ae87d3877dcf387da
react-native-image-picker: c6d75c4ab2cf46f9289f341242b219cb3c1180d3
react-native-image-resizer: a79bcffdef1b52160ff91db0d6fa24816a4ff332
react-native-netinfo: e849fc21ca2f4128a5726c801a82fc6f4a6db50d
react-native-image-resizer: d9fb629a867335bdc13230ac2a58702bb8c8828f
react-native-netinfo: 3d3769f0d65de15c83a9bf1346f8be71de5a24bf
react-native-rsa-native: 1f6bba06dd02f0e652a66a384c75c270f7a0062f
react-native-slider: e99fc201cefe81270fc9d81714a7a0f5e566b168
react-native-sqlite-storage: 418ef4afc5e6df6ce3574c4617e5f0b65cffde55
react-native-version-info: 36490da17d2c6b5cc21321c70e433784dee7ed0b
react-native-webview: 4e96d493f9f90ba4f03b28933f30b2964df07e39
react-native-version-info: a106f23009ac0db4ee00de39574eb546682579b9
react-native-webview: 0aa2cde4ee7e3e1c5fffdf64dbce9c709aa18155
React-perflogger: fcac6090a80e3d967791b4c7f1b1a017f9d4a398
React-RCTActionSheet: caf5913d9f9e605f5467206cf9d1caa6d47d7ad6
React-RCTAnimation: 6539e3bf594f6a529cd861985ba6548286ae1ead
Expand All @@ -554,14 +554,14 @@ SPEC CHECKSUMS:
React-runtimeexecutor: 33a949a51bec5f8a3c9e8d8092deb259600d761e
ReactCommon: 620442811dc6f707b4bf5e3b27d4f19c12d5a821
rn-fetch-blob: f065bb7ab7fb48dd002629f8bdcb0336602d3cba
RNCClipboard: c7abea1baea58adca5c1f29e56dd5261837b4892
RNCPushNotificationIOS: ec7ffe65c7b5097f8d287fd627e1c1674ea69cef
RNDateTimePicker: 6f62fd42ac8b58bcc30c43ac3620e5097e8a227f
RNCClipboard: 41d8d918092ae8e676f18adada19104fa3e68495
RNCPushNotificationIOS: 87b8d16d3ede4532745e05b03c42cff33a36cc45
RNDateTimePicker: 7658208086d86d09e1627b5c34ba0cf237c60140
RNFileViewer: 83cc066ad795b1f986791d03b56fe0ee14b6a69f
RNFS: 2bd9eb49dc82fa9676382f0585b992c424cd59df
RNFS: 3ab21fa6c56d65566d1fb26c2228e2b6132e5e32
RNQuickAction: 6d404a869dc872cde841ad3147416a670d13fa93
RNSecureRandom: 1f19ad1492f7ed416b8fc79e92216a1f73f13a4c
RNShare: edd621a71124961e29a7ba43a84bd1c6f9980d88
RNSecureRandom: 0dcee021fdb3d50cd5cee5db0ebf583c42f5af0e
RNShare: d76b8c9c6e6ffb38fc18f40b4338c9d867592ed3
RNVectorIcons: bc69e6a278b14842063605de32bec61f0b251a59
Yoga: 2b4a01651f42a32f82e6cef3830a3ba48088237f

Expand Down
22,632 changes: 0 additions & 22,632 deletions packages/app-mobile/package-lock.json

This file was deleted.

4 changes: 2 additions & 2 deletions packages/app-mobile/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@
"watch": "node node_modules/typescript/bin/tsc --watch --project tsconfig.json",
"clean": "node tools/clean.js",
"buildInjectedJs": "gulp buildInjectedJs",
"watchInjectedJs": "nodemon --verbose --watch components/NoteEditor/CodeMirror.ts --exec \"npm run buildInjectedJs\"",
"postinstall": "jetify && npm run build"
"watchInjectedJs": "nodemon --verbose --watch components/NoteEditor/CodeMirror.ts --exec \"yarn run buildInjectedJs\"",
"postinstall": "jetify && yarn run build"
},
"dependencies": {
"@joplin/lib": "~2.6",
Expand Down
9 changes: 6 additions & 3 deletions packages/app-mobile/tools/buildInjectedJs.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,8 @@ async function buildCodeMirrorBundle() {
const sourceFile = `${mobileDir}/components/NoteEditor/CodeMirror.ts`;
const fullBundleFile = `${mobileDir}/components/NoteEditor/CodeMirror.bundle.js`;

await execa('./node_modules/rollup/dist/bin/rollup', [
await execa('yarn', [
'run', 'rollup',
sourceFile,
'--name', 'codeMirrorBundle',
'-f', 'iife',
Expand All @@ -35,7 +36,9 @@ async function buildCodeMirrorBundle() {
'-p', '@rollup/plugin-typescript',
]);

await execa('./node_modules/uglify-js/bin/uglifyjs', [
// await execa('./node_modules/uglify-js/bin/uglifyjs', [
await execa('yarn', [
'run', 'uglifyjs',
'--compress',
'-o', codeMirrorBundleFile,
fullBundleFile,
Expand All @@ -45,7 +48,7 @@ async function buildCodeMirrorBundle() {
async function main() {
await fs.mkdirp(outputDir);
await buildCodeMirrorBundle();
await copyJs('webviewLib', `${mobileDir}/node_modules/@joplin/lib/renderers/webviewLib.js`);
await copyJs('webviewLib', `${mobileDir}/../lib/renderers/webviewLib.js`);
await copyJs('CodeMirror.bundle', `${mobileDir}/components/NoteEditor/CodeMirror.bundle.min.js`);
}

Expand Down
16 changes: 9 additions & 7 deletions packages/app-mobile/tools/clean.js
Original file line number Diff line number Diff line change
@@ -1,17 +1,19 @@
// We don't make that a gulp task because we might want to run it before
// gulp has been installed.

const fs = require('fs-extra');
const fs = require('fs');

async function main() {
function main() {
const mobileDir = `${__dirname}/..`;
await fs.remove(`${mobileDir}/android/.gradle`);
await fs.remove(`${mobileDir}/android/app/build`);
await fs.remove(`${mobileDir}/ios/Pods`);
fs.rmSync(`${mobileDir}/android/.gradle`, { recursive: true, force: true });
fs.rmSync(`${mobileDir}/android/app/build`, { recursive: true, force: true });
fs.rmSync(`${mobileDir}/ios/Pods`, { recursive: true, force: true });
console.info('To clean the Android build, in some rare cases you might also need to clear the cache in ~/.android and ~/.gradle');
}

main().catch((error) => {
try {
main();
} catch (error) {
console.error('Could not clean mobile app build', error);
process.exit(1);
});
}
2 changes: 1 addition & 1 deletion packages/app-mobile/tools/encodeAssets.js
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ async function main() {
await fs.mkdirp(outputDir);

const encodedFiles = [];
const sourceAssetDir = `${rootDir}/node_modules/@joplin/renderer/assets`;
const sourceAssetDir = `${rootDir}/../renderer/assets`;
const files = walk(sourceAssetDir);

for (const file of files) {
Expand Down
15,762 changes: 0 additions & 15,762 deletions packages/fork-htmlparser2/package-lock.json

This file was deleted.

4 changes: 2 additions & 2 deletions packages/fork-htmlparser2/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@
},
"dependencies": {
"domelementtype": "^2.0.1",
"domhandler": "^3.0.0",
"domhandler": "3.0.0",
"domutils": "^2.0.0",
"entities": "^2.0.0"
},
Expand All @@ -55,7 +55,7 @@
"jest": "^26.6.3",
"prettier": "^1.18.2",
"ts-jest": "^24.0.2",
"typescript": "^3.5.3"
"typescript": "3.8.2"
},
"jest": {
"preset": "ts-jest",
Expand Down
10 changes: 5 additions & 5 deletions packages/fork-htmlparser2/src/FeedHandler.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import DomHandler, { DomHandlerOptions, Node, Element } from "domhandler";
import DomHandler, { DomHandlerOptions, Element } from "domhandler";
import * as DomUtils from "domutils";
import { Parser, ParserOptions } from "./Parser";

Expand Down Expand Up @@ -147,16 +147,16 @@ export class FeedHandler extends DomHandler {
}
}

function getElements(what: string, where: Node | Node[]) {
function getElements(what: string, where: any) {
return DomUtils.getElementsByTagName(what, where, true);
}
function getOneElement(
what: string | ((name: string) => boolean),
where: Node | Node[]
where: any
) {
return DomUtils.getElementsByTagName(what, where, true, 1)[0];
}
function fetch(what: string, where: Node | Node[], recurse = false): string {
function fetch(what: string, where: any, recurse = false): string {
return DomUtils.getText(
DomUtils.getElementsByTagName(what, where, recurse, 1)
).trim();
Expand All @@ -175,7 +175,7 @@ function addConditionally<T>(
obj: T,
prop: keyof T,
what: string,
where: Node | Node[],
where: any,
recurse = false
) {
const tmp = fetch(what, where, recurse);
Expand Down
11,686 changes: 0 additions & 11,686 deletions packages/fork-sax/package-lock.json

This file was deleted.

19 changes: 19 additions & 0 deletions packages/fork-uslug/LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
Copyright (c) 2012 Jeremy Selier

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.
51 changes: 51 additions & 0 deletions packages/fork-uslug/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
# Uslug.js

* * *

Modified for Joplin:

- Added support for emojis - "🐶🐶🐶🐱" => "dogdogdogcat"

* * *

Permissive slug generator that works with unicode.
We keep only characters from the categories Letter, Number and Separator (see [Unicode Categories](http://www.unicode.org/versions/Unicode6.0.0/ch04.pdf))
and the common [CJK Unified Ideographs](http://www.unicode.org/versions/Unicode6.0.0/ch12.pdf) as defined in the version 6.0.0 of the Unicode specification.

Inspired by [unicode-slugify](https://github.com/mozilla/unicode-slugify).
Note that this slug generator is different from [node-slug](https://github.com/dodo/node-slug) which focus on translating unicode characters to english or latin equivalent.


## Quick Examples

uslug('Быстрее и лучше!') // 'быстрее-и-лучше'
uslug('汉语/漢語') // '汉语漢語'

uslug('Y U NO', { lower: false })) // 'Y-U-NO'
uslug('Y U NO', { spaces: true })) // 'y u no'
uslug('Y-U|NO', { allowedChars: '|' })) // 'yu|no'


## Installation

npm install uslug


## Options

### uslug(string, options)

Generate a slug for the string passed.

__Arguments__

* string - The string you want to slugify.
* options - An optional object that can contain:
* allowedChars: a String of chars that you want to be whitelisted. Default: '-_~'.
* lower: a Boolean to force to lower case the slug. Default: true.
* spaces: a Boolean to allow spaces. Default: false.


## License

This project is distributed under the MIT License. See LICENSE file for more information.
1 change: 1 addition & 0 deletions packages/fork-uslug/index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
module.exports = require('./lib/uslug');
15 changes: 15 additions & 0 deletions packages/fork-uslug/lib/L.js

Large diffs are not rendered by default.

13 changes: 13 additions & 0 deletions packages/fork-uslug/lib/M.js
13 changes: 13 additions & 0 deletions packages/fork-uslug/lib/N.js
13 changes: 13 additions & 0 deletions packages/fork-uslug/lib/Z.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
/*
* List of Unicode code that are flagged as separator.
*
* Contains Unicode code of:
* - Zs = Separator, space
* - Zl = Separator, line
* - Zp = Separator, paragraph
*
* This list has been computed from http://unicode.org/Public/UNIDATA/UnicodeData.txt
* curl -s http://unicode.org/Public/UNIDATA/UnicodeData.txt | grep -E ';Zs;|;Zl;|;Zp;' | cut -d \; -f 1 | xargs -I{} printf '%d, ' 0x{}
*
*/
exports.Z = [32, 160, 5760, 8192, 8193, 8194, 8195, 8196, 8197, 8198, 8199, 8200, 8201, 8202, 8232, 8233, 8239, 8287, 12288];
61 changes: 61 additions & 0 deletions packages/fork-uslug/lib/uslug.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
(function() {
var L = require('./L').L,
N = require('./N').N,
Z = require('./Z').Z,
M = require('./M').M,
unorm = require('unorm');

var nodeEmoji = require('node-emoji')

var _unicodeCategory = function(code) {
if (~L.indexOf(code)) return 'L';
if (~N.indexOf(code)) return 'N';
if (~Z.indexOf(code)) return 'Z';
if (~M.indexOf(code)) return 'M';
return undefined;
};

module.exports = function(string, options) {
string = string || '';
options = options || {};
var allowedChars = options.allowedChars || '-_~';
var lower = typeof options.lower === 'boolean' ? options.lower : true;
var spaces = typeof options.spaces === 'boolean' ? options.spaces : false;
var rv = [];
var noEmojiString = nodeEmoji.unemojify(string);
var chars = unorm.nfkc(noEmojiString);
for(var i = 0; i < chars.length; i++) {
var c = chars[i];
var code = c.charCodeAt(0);
// Allow Common CJK Unified Ideographs
// See: http://www.unicode.org/versions/Unicode6.0.0/ch12.pdf - Table 12-2
if (0x4E00 <= code && code <= 0x9FFF) {
rv.push(c);
continue;
}

// Allow Hangul
if (0xAC00 <= code && code <= 0xD7A3) {
rv.push(c);
continue;
}

// Japanese ideographic punctuation
if ((0x3000 <= code && code <= 0x3002) || (0xFF01 <= code && code <= 0xFF02)) {
rv.push(' ');
}

if (allowedChars.indexOf(c) != -1) {
rv.push(c);
continue;
}
var val = _unicodeCategory(code);
if (val && ~'LNM'.indexOf(val)) rv.push(c);
if (val && ~'Z'.indexOf(val)) rv.push(' ');
}
var slug = rv.join('').replace(/^\s+|\s+$/g, '').replace(/\s+/g,' ');
if (!spaces) slug = slug.replace(/[\s\-]+/g,'-');
if (lower) slug = slug.toLowerCase();
return slug;
};
}());
33 changes: 33 additions & 0 deletions packages/fork-uslug/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
{
"name": "@joplin/fork-uslug",
"version": "1.0.4",
"description": "A permissive slug generator that works with unicode.",
"author": "Jeremy Selier <jerem.selier@gmail.com>",
"publishConfig": {
"access": "public"
},
"dependencies": {
"node-emoji": "1.11.0",
"unorm": ">= 1.0.0"
},
"devDependencies": {
"should": ">= 0.2.1"
},
"repository": {
"type": "git",
"url": "http://github.com/jeremys/uslug.git"
},
"main": "./index",
"engines": {
"node": ">= 0.4.0"
},
"bugs": {
"url": "http://github.com/jeremys/uslug/issues"
},
"licenses": [
{
"type": "MIT",
"url": "http://github.com/jeremys/uslug/raw/master/LICENSE"
}
]
}
44 changes: 44 additions & 0 deletions packages/fork-uslug/test/test.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
var should = require('should'),
uslug = require('../lib/uslug');


var word0 = 'Ελληνικά';
var word1 = [word0, word0].join('-');
var word2 = [word0, word0].join(' - ');

var tests = [
['', ''],
['The \u212B symbol invented by A. J. \u00C5ngstr\u00F6m (1814, L\u00F6gd\u00F6, \u2013 1874) denotes the length 10\u207B\u00B9\u2070 m.', 'the-å-symbol-invented-by-a-j-ångström-1814-lögdö-1874-denotes-the-length-1010-m'],
['Быстрее и лучше!', 'быстрее-и-лучше'],
['xx x - "#$@ x', 'xx-x-x'],
['Bän...g (bang)', 'bäng-bang'],
[word0, word0.toLowerCase()],
[word1, word1.toLowerCase()],
[word2, word1.toLowerCase()],
[' a ', 'a'],
['tags/', 'tags'],
['y_u_no', 'y_u_no'],
['el-ni\xf1o', 'el-ni\xf1o'],
['x荿', 'x荿'],
['ϧ΃蒬蓣', '\u03e7蒬蓣'],
['¿x', 'x'],
['汉语/漢語', '汉语漢語'],
['فار,سي', 'فارسي'],
['เแโ|ใไ', 'เแโใไ'],
['日本語ドキュメンテ(ーション)', '日本語ドキュメンテーション'],
['一二三四五六七八九十!。。。', '一二三四五六七八九十'],
['संसद में काम नहीं तो वेतन क्यों?', 'संसद-में-काम-नहीं-तो-वेतन-क्यों'],
['เร่งรัด \'ปรับเงินเดือนท้องถิ่น 1 ขั้น\' ตามมติ ครม.', 'เร่งรัด-ปรับเงินเดือนท้องถิ่น-1-ขั้น-ตามมติ-ครม'],
['オバマ大統領が病院爆撃の調査へ同意するように、協力してください!', 'オバマ大統領が病院爆撃の調査へ同意するように-協力してください'],
['일본정부 법무대신(法務大臣): 우리는 일본 입관법의 재검토를 요구한다!', '일본정부-법무대신法務大臣-우리는-일본-입관법의-재검토를-요구한다'],
['😁', 'grin'],
['😁a', 'grina'],
['🐶🐶🐶🐱', 'dogdogdogcat'],
];

for (var t in tests) {
var test = tests[t];
uslug(test[0]).should.equal(test[1]);
}

uslug('qbc,fe', { allowedChars: 'q' }).should.equal('qbcfe');
18,370 changes: 0 additions & 18,370 deletions packages/generator-joplin/package-lock.json

This file was deleted.

2 changes: 1 addition & 1 deletion packages/generator-joplin/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
},
"scripts": {
"test": "jest",
"test-ci": "npm run test"
"test-ci": "yarn test"
},
"files": [
"generators"
Expand Down
4 changes: 2 additions & 2 deletions packages/generator-joplin/updateTypes.sh
Original file line number Diff line number Diff line change
Expand Up @@ -12,15 +12,15 @@ CLI_DIR="$SCRIPT_DIR/../app-cli"
LIB_DIR="$SCRIPT_DIR/../lib"

cd "$LIB_DIR"
npm run generatePluginTypes
yarn run generatePluginTypes

cd "$SCRIPT_DIR"
rsync -a --delete "$LIB_DIR/plugin_types/services/plugins/api/" "$SCRIPT_DIR/generators/app/templates/api/"
cp "$LIB_DIR/services/plugins/api/types.ts" "$SCRIPT_DIR/generators/app/templates/api/"
cp "$SCRIPT_DIR/generators/app/templates/api_index.ts" "$SCRIPT_DIR/generators/app/templates/api/index.ts"
rm -f "$SCRIPT_DIR/generators/app/templates/api/types.d.ts"

npm link
yarn link

"$CLI_DIR/tests/support/plugins/updatePlugins.sh"

Expand Down
321 changes: 0 additions & 321 deletions packages/htmlpack/package-lock.json

This file was deleted.

Loading