diff --git a/package.json b/package.json index 282d93ecc..05cd19078 100644 --- a/package.json +++ b/package.json @@ -8,6 +8,7 @@ "license": "MIT", "scripts": { "buildApiDoc": "npm start --prefix=packages/app-cli -- apidoc ../../readme/api/references/rest_api.md", + "buildDoc": "./packages/tools/build-all.sh", "buildPluginDoc": "typedoc --name 'Joplin Plugin API Documentation' --mode file -theme './Assets/PluginDocTheme/' --readme './Assets/PluginDocTheme/index.md' --excludeNotExported --excludeExternals --excludePrivate --excludeProtected --out docs/api/references/plugin_api packages/lib/services/plugins/api/", "buildWebsite": "npm run buildApiDoc && node ./packages/tools/build-website.js && npm run buildPluginDoc", "clean": "lerna clean -y && lerna run clean", diff --git a/packages/tools/build-all.sh b/packages/tools/build-all.sh index 2677c476d..94aa536e9 100755 --- a/packages/tools/build-all.sh +++ b/packages/tools/build-all.sh @@ -3,13 +3,7 @@ set -e ROOT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" -# echo "---------------------------------------------------" -# echo "Rebuild API doc..." -# echo "---------------------------------------------------" -# cd "$ROOT_DIR/../packages/app-cli" -# API_DOC="$(npm run --silent start -- apidoc)" -# echo "$API_DOC" > "$ROOT_DIR/../readme/api/references/rest_api.md" -# cd "$ROOT_DIR" +git pull echo "---------------------------------------------------" echo "$ROOT_DIR/update-readme-download.js..." diff --git a/packages/tools/build-release-stats.js b/packages/tools/build-release-stats.js index 6ed00d7fa..e0ff3391b 100644 --- a/packages/tools/build-release-stats.js +++ b/packages/tools/build-release-stats.js @@ -5,7 +5,7 @@ const fs = require('fs-extra'); const { dirname } = require('@joplinapp/lib/path-utils'); const markdownUtils = require('@joplinapp/lib/markdownUtils').default; -const rootDir = dirname(__dirname); +const rootDir = dirname(dirname(__dirname)); function endsWith(str, suffix) { return str.indexOf(suffix, str.length - suffix.length) !== -1; diff --git a/packages/tools/build-welcome.js b/packages/tools/build-welcome.js index 472e2f8e1..e55eef599 100644 --- a/packages/tools/build-welcome.js +++ b/packages/tools/build-welcome.js @@ -3,7 +3,7 @@ const dirname = require('path').dirname; const { fileExtension, basename } = require('@joplinapp/lib/path-utils'); const markdownUtils = require('@joplinapp/lib/markdownUtils').default; -const rootDir = dirname(__dirname); +const rootDir = dirname(dirname(__dirname)); const welcomeDir = `${rootDir}/readme/welcome`; const createdDate = new Date('2018-06-22T12:00:00Z'); @@ -141,7 +141,7 @@ async function main() { const content = { notes: notes, folders: folders, tags: tags, timestamp: createdDate.getTime() }; const jsonContent = JSON.stringify(content, null, 4); const jsContent = `module.exports = ${jsonContent}`; - fs.writeFileSync(`${rootDir}/packages/app-mobile/lib/welcomeAssets.js`, jsContent, { encoding: 'utf8' }); + fs.writeFileSync(`${rootDir}/packages/lib/welcomeAssets.js`, jsContent, { encoding: 'utf8' }); } main().catch((error) => { diff --git a/packages/tools/update-readme-download.js b/packages/tools/update-readme-download.js index ce1a81ce9..6a2cc6146 100644 --- a/packages/tools/update-readme-download.js +++ b/packages/tools/update-readme-download.js @@ -5,7 +5,7 @@ const request = require('request'); const { fileExtension } = require('@joplinapp/lib/path-utils'); const url = 'https://api.github.com/repos/laurent22/joplin/releases/latest'; -const readmePath = `${__dirname}/../README.md`; +const readmePath = `${__dirname}/../../README.md`; async function msleep(ms) { return new Promise((resolve) => {