1
0
mirror of https://github.com/laurent22/joplin.git synced 2024-12-24 10:27:10 +02:00

Chore: Access utils lib with relative path

This commit is contained in:
Laurent Cozic 2023-04-05 22:27:26 +02:00
parent 69a34e87f3
commit 02422a6e31
8 changed files with 70 additions and 16 deletions

View File

@ -43,7 +43,7 @@
"dependencies": {
"@joplin/lib": "~2.11",
"@joplin/renderer": "~2.11",
"@joplin/utils": "~2.11",
"@joplin/utils": "../utils",
"aws-sdk": "2.1290.0",
"chalk": "4.1.2",
"compare-version": "0.1.2",

View File

@ -680,7 +680,7 @@ EXTERNAL SOURCES:
SPEC CHECKSUMS:
boost: a7c83b31436843459a1961bfd74b96033dc77234
CocoaAsyncSocket: 065fd1e645c7abab64f7a6a2007a48038fdc6a99
DoubleConversion: 5189b271737e1565bdce30deb4a08d647e3f5f54
DoubleConversion: 831926d9b8bf8166fd87886c4abab286c2422662
FBLazyVector: 48289402952f4f7a4e235de70a9a590aa0b79ef4
FBReactNativeSpec: dd1186fd05255e3457baa2f4ca65e94c2cd1e3ac
Flipper: 26fc4b7382499f1281eb8cb921e5c3ad6de91fe0
@ -693,7 +693,7 @@ SPEC CHECKSUMS:
Flipper-RSocket: d9d9ade67cbecf6ac10730304bf5607266dd2541
FlipperKit: cbdee19bdd4e7f05472a66ce290f1b729ba3cb86
fmt: ff9d55029c625d3757ed641535fd4a75fedc7ce9
glog: 04b94705f318337d7ead9e6d17c019bd9b1f6b1b
glog: 5337263514dd6f09803962437687240c5dc39aa4
hermes-engine: 2af7b7a59128f250adfd86f15aa1d5a2ecd39995
JoplinCommonShareExtension: a8b60b02704d85a7305627912c0240e94af78db7
JoplinRNShareExtension: 485f3e6dad83b7b77f1572eabc249f869ee55c02

View File

@ -38,7 +38,7 @@
"@joplin/renderer": "~2.11",
"@joplin/turndown": "^4.0.65",
"@joplin/turndown-plugin-gfm": "^1.0.47",
"@joplin/utils": "~2.11",
"@joplin/utils": "../utils",
"@types/nanoid": "3.0.0",
"async-mutex": "0.4.0",
"base-64": "1.0.0",

View File

@ -20,7 +20,7 @@
"dependencies": {
"@joplin/lib": "~2.11",
"@joplin/tools": "~2.11",
"@joplin/utils": "~2.11",
"@joplin/utils": "../utils",
"fs-extra": "11.1.1",
"gh-release-assets": "2.0.1",
"node-fetch": "2.6.7",

View File

@ -22,7 +22,7 @@
"dependencies": {
"@joplin/lib": "~2.11",
"@joplin/renderer": "~2.11",
"@joplin/utils": "~2.11",
"@joplin/utils": "../utils",
"dayjs": "1.11.7",
"execa": "4.1.0",
"fs-extra": "11.1.1",

View File

@ -1,10 +1,8 @@
import { readFile } from 'fs-extra';
import { rootDir } from '@joplin/utils';
import { getRootDir } from '@joplin/utils';
import { fetchWithRetry } from '@joplin/utils/net';
import { githubOauthToken } from '../tool-utils';
const sponsorsPath = `${rootDir}/packages/tools/sponsors.json`;
export interface GithubSponsor {
name: string;
id: string;
@ -23,6 +21,7 @@ export interface OrgSponsor {
}
export const loadSponsors = async (): Promise<Sponsors> => {
const sponsorsPath = `${await getRootDir()}/packages/tools/sponsors.json`;
const output: Sponsors = JSON.parse(await readFile(sponsorsPath, 'utf8'));
output.orgs = output.orgs.map(o => {

View File

@ -2,12 +2,27 @@ import execCommand from './execCommand';
import commandToString from './commandToString';
import splitCommandString from './splitCommandString';
import { dirname } from 'path';
import { pathExists } from 'fs-extra';
const rootDir = dirname(dirname(dirname(__dirname)));
let rootDir_ = '';
const getRootDir = async () => {
if (rootDir_) return rootDir_;
let p = dirname(dirname(dirname(__dirname)));
for (let i = 0; i < 9999; i++) {
if (await pathExists(`${p}/.eslintrc.js`)) {
rootDir_ = p;
return rootDir_;
}
p = dirname(p);
}
throw new Error('Could not find root dir');
};
export {
execCommand,
commandToString,
splitCommandString,
rootDir,
getRootDir,
};

View File

@ -5090,7 +5090,7 @@ __metadata:
"@joplin/renderer": ~2.11
"@joplin/turndown": ^4.0.65
"@joplin/turndown-plugin-gfm": ^1.0.47
"@joplin/utils": ~2.11
"@joplin/utils": ../utils
"@types/fs-extra": 9.0.13
"@types/jest": 29.2.6
"@types/js-yaml": 4.0.5
@ -5196,7 +5196,7 @@ __metadata:
dependencies:
"@joplin/lib": ~2.11
"@joplin/tools": ~2.11
"@joplin/utils": ~2.11
"@joplin/utils": ../utils
"@types/fs-extra": 9.0.13
"@types/jest": 29.2.6
"@types/node": 18.11.18
@ -5350,7 +5350,7 @@ __metadata:
"@joplin/fork-htmlparser2": ^4.1.43
"@joplin/lib": ~2.11
"@joplin/renderer": ~2.11
"@joplin/utils": ~2.11
"@joplin/utils": ../utils
"@rmp135/sql-ts": 1.16.0
"@types/fs-extra": 9.0.13
"@types/jest": 29.2.6
@ -5414,7 +5414,47 @@ __metadata:
languageName: unknown
linkType: soft
"@joplin/utils@workspace:packages/utils, @joplin/utils@~2.11":
"@joplin/utils@file:../utils::locator=%40joplin%2Flib%40workspace%3Apackages%2Flib":
version: 2.11.0
resolution: "@joplin/utils@file:../utils#../utils::hash=19ab4d&locator=%40joplin%2Flib%40workspace%3Apackages%2Flib"
dependencies:
execa: 5.1.1
node-fetch: 2.6.7
checksum: cd6b4304347a57ec1065a1e64441c749911c714cc8df924683979321b1df4b18064e7ef8a255f19e92387f57861e6af0edda26f1196997745d977b54acf461a6
languageName: node
linkType: hard
"@joplin/utils@file:../utils::locator=%40joplin%2Fplugin-repo-cli%40workspace%3Apackages%2Fplugin-repo-cli":
version: 2.11.0
resolution: "@joplin/utils@file:../utils#../utils::hash=19ab4d&locator=%40joplin%2Fplugin-repo-cli%40workspace%3Apackages%2Fplugin-repo-cli"
dependencies:
execa: 5.1.1
node-fetch: 2.6.7
checksum: cd6b4304347a57ec1065a1e64441c749911c714cc8df924683979321b1df4b18064e7ef8a255f19e92387f57861e6af0edda26f1196997745d977b54acf461a6
languageName: node
linkType: hard
"@joplin/utils@file:../utils::locator=%40joplin%2Ftools%40workspace%3Apackages%2Ftools":
version: 2.11.0
resolution: "@joplin/utils@file:../utils#../utils::hash=19ab4d&locator=%40joplin%2Ftools%40workspace%3Apackages%2Ftools"
dependencies:
execa: 5.1.1
node-fetch: 2.6.7
checksum: cd6b4304347a57ec1065a1e64441c749911c714cc8df924683979321b1df4b18064e7ef8a255f19e92387f57861e6af0edda26f1196997745d977b54acf461a6
languageName: node
linkType: hard
"@joplin/utils@file:../utils::locator=joplin%40workspace%3Apackages%2Fapp-cli":
version: 2.11.0
resolution: "@joplin/utils@file:../utils#../utils::hash=19ab4d&locator=joplin%40workspace%3Apackages%2Fapp-cli"
dependencies:
execa: 5.1.1
node-fetch: 2.6.7
checksum: cd6b4304347a57ec1065a1e64441c749911c714cc8df924683979321b1df4b18064e7ef8a255f19e92387f57861e6af0edda26f1196997745d977b54acf461a6
languageName: node
linkType: hard
"@joplin/utils@workspace:packages/utils":
version: 0.0.0-use.local
resolution: "@joplin/utils@workspace:packages/utils"
dependencies:
@ -21170,7 +21210,7 @@ __metadata:
"@joplin/lib": ~2.11
"@joplin/renderer": ~2.11
"@joplin/tools": ~2.11
"@joplin/utils": ~2.11
"@joplin/utils": ../utils
"@types/fs-extra": 9.0.13
"@types/jest": 29.2.6
"@types/node": 18.11.18