Skip to content

Commit

Permalink
fix build
Browse files Browse the repository at this point in the history
  • Loading branch information
ocavue committed Oct 21, 2023
1 parent c65f287 commit b3e9108
Show file tree
Hide file tree
Showing 5 changed files with 21 additions and 12 deletions.
3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -50,10 +50,11 @@
"@size-limit/preset-small-lib": "^8.1.0",
"@types/js-yaml": "^4.0.5",
"@types/lodash-es": "^4.17.6",
"@types/prettier": "^2.0.0",
"@types/wicg-file-system-access": "^2020.9.6",
"bumpp": "^9.1.0",
"eslint": "^8.28.0",
"prettier": "^2.8.0",
"prettier": "^2.8.8",
"size-limit": "^8.1.0",
"tsup": "^6.5.0",
"typescript": "^4.9.3",
Expand Down
9 changes: 6 additions & 3 deletions src/convertors/roam/roam-backlinks.ts
Original file line number Diff line number Diff line change
Expand Up @@ -39,8 +39,11 @@ export class RoamBacklinks {
// We want to iterate deeply through the note and map
// all the titles to their corresponding note IDs.
private processNote(note: RoamNote, result: TitleToIdMap = new Map()) {
this.titleToIdMap.set(note.title, normalizeUidToId(note.uid))
this.idToTitleMap.set(normalizeUidToId(note.uid), note.title)
const id = normalizeUidToId(note.uid)
const title = note.title || id

Check warning on line 43 in src/convertors/roam/roam-backlinks.ts

View workflow job for this annotation

GitHub Actions / Build, lint, and test on Node 14.x and ubuntu-latest

Delete `·`

this.titleToIdMap.set(title, id)
this.idToTitleMap.set(id, title)

if (note.children) {
note.children.map((child) => {
Expand All @@ -64,7 +67,7 @@ export class RoamBacklinks {

// We are treating noteString.uid as the block ref title
this.titleToIdMap.set(noteString.uid, normalizeUidToId(note.uid))
this.idToTitleMap.set(normalizeUidToId(noteString.uid), note.title)
this.idToTitleMap.set(normalizeUidToId(noteString.uid), note.title || "")

Check warning on line 70 in src/convertors/roam/roam-backlinks.ts

View workflow job for this annotation

GitHub Actions / Build, lint, and test on Node 14.x and ubuntu-latest

Replace `""` with `''`

if (noteString.children) {
noteString.children.map((child) => {
Expand Down
4 changes: 2 additions & 2 deletions src/helpers/markdown/markdown.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,10 +27,10 @@ export const markdownToHtml = (

const processor = unified()
.data('micromarkExtensions', [
gfmAutolinkLiteral,
gfmAutolinkLiteral(),
{disable: {null: constructsToDisable}},
])
.data('fromMarkdownExtensions', [gfmAutolinkLiteralFromMarkdown])
.data('fromMarkdownExtensions', [gfmAutolinkLiteralFromMarkdown()])
.use(pipeToMarkdown)
.use(wikiLinkPlugin, {
wikiLinkClassName: 'backlink',
Expand Down
4 changes: 2 additions & 2 deletions src/helpers/markdown/plugins/parse-tags.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import {type Root, type StaticPhrasingContent} from 'mdast'
import {type Root, type PhrasingContent} from 'mdast'
import {findAndReplace, type ReplaceFunction} from 'mdast-util-find-and-replace'
import {Plugin} from 'unified'

Expand Down Expand Up @@ -26,7 +26,7 @@ export const parseTags: Plugin<[ParseTagOptions], Root> = (options: ParseTagOpti

const url = buildTagUrl({graphId: options.graphId, linkHost: options.linkHost, tag})

const node: StaticPhrasingContent = {type: 'text', value}
const node: PhrasingContent = {type: 'text', value}

return {type: 'link', title: null, url, children: [node]}
}
Expand Down
13 changes: 9 additions & 4 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -503,6 +503,11 @@
resolved "https://registry.yarnpkg.com/@types/normalize-package-data/-/normalize-package-data-2.4.1.tgz#d3357479a0fdfdd5907fe67e17e0a85c906e1301"
integrity sha512-Gj7cI7z+98M282Tqmp2K5EIsoouUEzbBJhQQzDE3jSIRk6r9gsz0oUokqIUR4u1R3dMHo0pDHM7sNOHyhulypw==

"@types/prettier@^2.0.0":
version "2.7.3"
resolved "https://registry.yarnpkg.com/@types/prettier/-/prettier-2.7.3.tgz#3e51a17e291d01d17d3fc61422015a933af7a08f"
integrity sha512-+68kP9yzs4LMp7VNh8gdzMSPZFL44MLGqiHWvttYJe+6qnuVr4Ek9wSBQoveqY/r+LwjCcU29kNVkidwim+kYA==

"@types/semver@^7.3.12":
version "7.3.13"
resolved "https://registry.yarnpkg.com/@types/semver/-/semver-7.3.13.tgz#da4bfd73f49bd541d28920ab0e2bf0ee80f71c91"
Expand Down Expand Up @@ -3328,10 +3333,10 @@ prettier-linter-helpers@^1.0.0:
dependencies:
fast-diff "^1.1.2"

prettier@^2.8.0:
version "2.8.3"
resolved "https://registry.yarnpkg.com/prettier/-/prettier-2.8.3.tgz#ab697b1d3dd46fb4626fbe2f543afe0cc98d8632"
integrity sha512-tJ/oJ4amDihPoufT5sM0Z1SKEuKay8LfVAMlbbhnnkvt6BUserZylqo2PN+p9KeljLr0OHa2rXHU1T8reeoTrw==
prettier@^2.8.8:
version "2.8.8"
resolved "https://registry.yarnpkg.com/prettier/-/prettier-2.8.8.tgz#e8c5d7e98a4305ffe3de2e1fc4aca1a71c28b1da"
integrity sha512-tdN8qQGvNjw4CHbY+XXk0JgCXn9QiF21a55rBe5LJAU+kDyC4WQn4+awm2Xfk2lQMk5fKup9XgzTZtGkjBdP9Q==

prompts@^2.4.2:
version "2.4.2"
Expand Down

0 comments on commit b3e9108

Please sign in to comment.