From def3c1844ae0a0d547de2b0a01689a302b58ab61 Mon Sep 17 00:00:00 2001 From: "Thomas F. K. Jorna" Date: Fri, 1 Sep 2023 21:14:00 +0200 Subject: [PATCH] fix: don't use shady custom builder, just run a script that fixes the package.json --- .eslintrc.json | 4 +- .../src/app/components/SelectFormat.tsx | 2 +- apps/convert/src/app/layout.tsx | 4 +- apps/convert/src/app/page.tsx | 6 +- .../src/integration/app.spec.ts | 2 +- .../add-latex-preamble.spec.tsx | 2 +- .../app-shell-layout.spec.tsx | 2 +- .../app-shell-layout/app-shell-layout.tsx | 13 +- .../components/conversion/conversion.spec.tsx | 2 +- .../converted-block-local.spec.tsx | 2 +- .../converted-block/converted-block.spec.tsx | 2 +- .../components/ext-icon/ext-icon.spec.tsx | 2 +- .../publications-list/citations.tsx | 2 +- .../publications-list/file-reel.tsx | 40 +- .../publications-list/file-stage.tsx | 4 +- .../publications-list/meta-item.tsx | 4 +- .../publications-list.spec.tsx | 2 +- .../publications-list/render-pub-meta.tsx | 44 +- .../select-item/select-item.spec.tsx | 2 +- .../components/settings/settings.spec.tsx | 2 +- .../components/stack/stack.spec.tsx | 2 +- apps/converter-frontend/pages/api/ojs/file.ts | 4 +- .../converter-frontend/pages/api/ojs/files.ts | 4 +- .../converter-frontend/pages/api/ojs/index.ts | 4 +- .../pages/api/ojs/publication.ts | 4 +- .../pages/api/tex-to-pdf.ts | 4 +- apps/converter-frontend/pages/authors.tsx | 9 +- apps/converter-frontend/pages/index.tsx | 2 +- apps/converter-frontend/pages/remote.tsx | 25 +- apps/converter-frontend/specs/index.spec.tsx | 2 +- apps/converter-frontend/tsconfig.json | 1 - .../react-pdf-e2e/src/integration/app.spec.ts | 2 +- apps/react-pdf/specs/index.spec.tsx | 2 +- libs/ast-stringify/project.json | 5 +- libs/ast-stringify/src/index.ts | 2 +- .../src/lib/ast-stringify.spec.ts | 2 +- libs/book-converter/project.json | 5 +- .../src/lib/book-converter.spec.ts | 2 +- libs/book-converter/src/lib/book-converter.ts | 4 +- .../book-converter/src/lib/make-index.spec.ts | 2 +- .../book-converter/src/lib/paragraph/index.ts | 2 +- libs/citations/apa-parser/project.json | 5 +- .../apa-parser/src/spec/apa-parser.spec.ts | 8 +- .../apa-parser/src/spec/testcites.ts | 80 +- .../apa-parser/src/spec/testnames.ts | 2 +- libs/citations/crossref-json/project.json | 5 +- .../citations/crossref-json/tsconfig.lib.json | 2 +- libs/citations/crossref-to-csl/project.json | 5 +- .../src/lib/crossref-to-csl.ts | 11 +- libs/citations/csl-consolidate/project.json | 5 +- libs/citations/csl-to-biblatex/project.json | 5 +- libs/citations/ojs-types/project.json | 5 +- libs/citations/parse-text-cite/project.json | 5 +- libs/citations/parse-text-cite/src/lib/apa.ne | 8 +- libs/citations/parse-text-cite/src/lib/apa.ts | 1447 ++++++++++++----- .../reference-parser-chatgpt/project.json | 5 +- .../src/lib/format-references.ts | 2 +- libs/hybrid-builder/project.json | 5 +- .../src/executors/build/executor.spec.ts | 4 +- .../src/executors/build/executor.ts | 25 +- .../hybrid-builder/generator.spec.ts | 4 +- .../generators/hybrid-builder/generator.ts | 27 +- libs/jast/jast-util-from-csl/project.json | 5 +- .../src/lib/csl-to-jast.spec.ts | 11 +- libs/jast/jast-util-to-csl/project.json | 5 +- libs/jast/jast-util-to-texast/project.json | 5 +- libs/jast/jast-util-to-texast/src/lib/all.ts | 8 +- .../src/lib/handlers/article.ts | 24 +- .../src/lib/handlers/body.ts | 4 +- .../src/lib/handlers/bold.ts | 4 +- .../src/lib/handlers/command.ts | 34 +- .../src/lib/handlers/disp-quote.ts | 6 +- .../src/lib/handlers/environment.ts | 68 +- .../src/lib/handlers/extLink.ts | 8 +- .../src/lib/handlers/fig.ts | 4 +- .../src/lib/handlers/fnGroup.ts | 6 +- .../src/lib/handlers/front.ts | 14 +- .../src/lib/handlers/graphic.ts | 10 +- .../src/lib/handlers/index.ts | 52 +- .../src/lib/handlers/inlineFormula.ts | 4 +- .../src/lib/handlers/italic.ts | 8 +- .../src/lib/handlers/list.ts | 7 +- .../src/lib/handlers/listItem.ts | 6 +- .../jast-util-to-texast/src/lib/handlers/p.ts | 17 +- .../src/lib/handlers/refList.ts | 4 +- .../src/lib/handlers/root.ts | 4 +- .../src/lib/handlers/sec.ts | 10 +- .../src/lib/handlers/sub.ts | 4 +- .../src/lib/handlers/sup.ts | 4 +- .../src/lib/handlers/table.ts | 12 +- .../src/lib/handlers/tableWrap.ts | 4 +- .../src/lib/handlers/td.ts | 4 +- .../src/lib/handlers/text.ts | 4 +- .../src/lib/handlers/tr.ts | 15 +- .../src/lib/handlers/xref.ts | 75 +- .../src/lib/jast-util-to-texast.ts | 10 +- libs/jast/jast-util-to-texast/src/lib/one.ts | 14 +- .../src/lib/test/test.spec.ts | 23 +- .../src/lib/util/wrap-children.ts | 6 +- .../src/lib/util/wrap-command-arg.ts | 8 +- .../src/lib/util/wrap-text.ts | 2 +- .../jast-util-to-texast/src/lib/util/wrap.ts | 25 +- libs/jast/jast/project.json | 5 +- .../notion/html-to-notion-blocks/project.json | 5 +- libs/notion/rehype-notion/project.json | 5 +- libs/ojs/ojs-relatex/project.json | 5 +- .../ojs-relatex/src/lib/ojs-relatex.spec.ts | 2 +- .../ooxast-util-citation-plugin/project.json | 5 +- .../ooxast/ooxast-util-citations/project.json | 5 +- .../src/lib/constructMendeleyCitation.ts | 4 +- .../src/lib/ooxast-util-citations.ts | 2 +- .../ooxast-util-citations/tsconfig.lib.json | 2 +- .../ooxast/ooxast-util-get-style/project.json | 5 +- .../ooxast-util-get-style/tsconfig.spec.json | 4 +- .../ooxast-util-markup-to-style/project.json | 5 +- .../tsconfig.lib.json | 4 +- .../project.json | 5 +- .../src/lib/fix-csl.ts | 2 +- .../src/lib/ooxast-util-parse-bib.spec.ts | 12 +- .../tsconfig.spec.json | 4 +- .../ooxast-util-parse-bib-node/project.json | 5 +- .../src/lib/bib-to-csl-node.ts | 8 +- .../src/lib/ooxast-util-parse-bib.spec.ts | 6 +- .../src/lib/ooxast-util-parse-bib.ts | 2 +- .../tsconfig.spec.json | 4 +- .../ooxast/ooxast-util-parse-bib/project.json | 5 +- .../ooxast-util-parse-bib/tsconfig.spec.json | 4 +- .../ooxast-util-properties/project.json | 5 +- .../ooxast-util-properties/tsconfig.lib.json | 2 +- .../ooxast-util-remove-rsid/project.json | 5 +- .../src/lib/ooxast-util-remove-rsid.ts | 11 +- libs/ooxast/ooxast-util-to-hast/project.json | 5 +- libs/ooxast/ooxast-util-to-hast/src/index.ts | 2 +- .../ooxast/ooxast-util-to-hast/src/lib/all.ts | 6 +- .../src/lib/handlers/body.spec.ts | 14 +- .../src/lib/handlers/body.ts | 6 +- .../src/lib/handlers/citation.ts | 75 +- .../src/lib/handlers/document.ts | 4 +- .../src/lib/handlers/drawing.ts | 4 +- .../src/lib/handlers/footnote.ts | 4 +- .../src/lib/handlers/footnotes.ts | 4 +- .../src/lib/handlers/index.ts | 28 +- .../src/lib/handlers/p.spec.ts | 7 +- .../ooxast-util-to-hast/src/lib/handlers/p.ts | 6 +- .../src/lib/handlers/pHandlers/heading.ts | 4 +- .../src/lib/handlers/pHandlers/title.ts | 4 +- .../ooxast-util-to-hast/src/lib/handlers/r.ts | 6 +- .../src/lib/handlers/root.ts | 10 +- .../src/lib/handlers/tbl.ts | 4 +- .../src/lib/handlers/text.ts | 2 +- .../src/lib/handlers/tr.ts | 4 +- .../ooxast/ooxast-util-to-hast/src/lib/one.ts | 14 +- .../src/lib/ooxast-util-to-hast.ts | 26 +- .../src/lib/util/get-pstyle.spec.ts | 2 +- .../src/lib/util/get-pstyle.ts | 2 +- .../src/lib/util/wrap-children.ts | 6 +- .../src/lib/util/wrap-section.spec.ts | 4 +- .../src/lib/util/wrap-section.ts | 16 +- .../src/lib/util/wrap-text.ts | 2 +- .../ooxast-util-to-hast/src/lib/util/wrap.ts | 14 +- libs/ooxast/ooxast-util-to-jast/project.json | 5 +- .../src/lib/ooxast-util-to-jast.ts | 4 +- .../src/lib/util/wrap-section.spec.ts | 2 +- libs/ooxast/ooxast-util-to-mdast/project.json | 5 +- .../ooxast-util-to-unified-latex/project.json | 5 +- .../src/lib/handlers/r.spec.ts | 2 +- .../lib/ooxast-util-to-unified-latex.spec.ts | 2 +- libs/ooxast/ooxast/project.json | 5 +- .../lib/ooxml/officeDocument/sharedTypes.ts | 2 +- .../ooxast/ooxast/src/lib/xml-primitives.d.ts | 2 +- libs/ooxast/ooxast/tsconfig.lib.json | 3 +- libs/plugins/better-nx-tsc/executors.json | 5 + libs/plugins/better-nx-tsc/project.json | 5 +- .../executors/publishable/executor.spec.ts | 11 + .../src/executors/publishable/executor.ts | 123 ++ .../src/executors/publishable/schema.d.ts | 4 + .../src/executors/publishable/schema.json | 20 + .../src/executors/tsc/executor.spec.ts | 75 +- .../src/executors/tsc/hasher.spec.ts | 348 ++-- .../src/utils/check-dependencies.ts | 32 +- .../plugins/better-nx-tsc/src/utils/inline.ts | 253 ++- .../utils/package-json/create-package-json.ts | 6 - .../package-json/get-filtered-dependencies.ts | 41 +- .../src/utils/package-json/index.ts | 55 +- .../package-json/update-package-json.spec.ts | 166 +- .../utils/package-json/update-package-json.ts | 3 - libs/plugins/better-nx-tsc/tsconfig.lib.json | 2 +- .../src/lib/processors-docx-to-jats.spec.ts | 2 +- .../docx-to-jats/tsconfig.spec.json | 1 - libs/processors/jats-to-tex/src/index.ts | 2 +- libs/processors/jats-to-tex/tsconfig.lib.json | 2 +- .../processors/jats-to-tex/tsconfig.spec.json | 1 - .../jote-docx-tex/tsconfig.spec.json | 1 - libs/rejour/rejour-frontmatter/project.json | 5 +- libs/rejour/rejour-meta/project.json | 5 +- .../rejour-meta/src/lib/rejour-meta.spec.ts | 2 +- libs/rejour/rejour-move-abstract/project.json | 5 +- libs/rejour/rejour-parse/project.json | 5 +- .../rejour-parse/src/lib/rejour-parse.ts | 17 +- libs/rejour/rejour-relatex/project.json | 5 +- libs/rejour/rejour-stringify/project.json | 5 +- .../relatex/relatex-add-preamble/project.json | 5 +- .../relatex/relatex-add-preamble/src/index.ts | 2 +- .../relatex-add-preamble/tsconfig.lib.json | 1 - .../relatex-add-preamble/tsconfig.spec.json | 1 - libs/relatex/relatex-stringify/project.json | 5 +- libs/reoff/docx-to-vfile/project.json | 13 +- libs/reoff/docx-to-vfile/tsconfig.json | 5 +- libs/reoff/reoff-cite/project.json | 5 +- libs/reoff/reoff-cite/tsconfig.lib.json | 1 - libs/reoff/reoff-cite/tsconfig.spec.json | 1 - libs/reoff/reoff-clean/project.json | 5 +- libs/reoff/reoff-compile/project.json | 25 +- libs/reoff/reoff-compile/tsconfig.lib.json | 2 +- libs/reoff/reoff-infer-headings/project.json | 5 +- libs/reoff/reoff-markup-to-style/project.json | 2 +- .../reoff-markup-to-style/tsconfig.lib.json | 2 +- .../project.json | 5 +- .../src/lib/reoff-parse-references.spec.ts | 7 - .../tsconfig.spec.json | 1 - .../reoff/reoff-parse-references/project.json | 5 +- .../reoff-parse-references/tsconfig.spec.json | 1 - libs/reoff/reoff-parse/project.json | 5 +- libs/reoff/reoff-parse/tsconfig.lib.json | 10 +- libs/reoff/reoff-rejour/project.json | 5 +- libs/reoff/reoff-remark/project.json | 5 +- libs/reoff/reoff-remark/tsconfig.lib.json | 2 +- libs/reoff/reoff-unified-latex/project.json | 8 +- .../src/lib/reoff-unified-latex.ts | 2 +- .../reoff-unified-latex/tsconfig.lib.json | 2 +- .../texast-util-add-preamble/project.json | 5 +- .../src/lib/texast-util-add-preamble.spec.ts | 4 +- .../tsconfig.lib.json | 1 - .../tsconfig.spec.json | 1 - libs/texast/texast-util-to-latex/project.json | 5 +- libs/texast/texast-util-to-latex/src/index.ts | 2 +- .../src/lib/handle/command-arg.ts | 13 +- .../src/lib/handle/command.ts | 21 +- .../src/lib/handle/comment.ts | 11 +- .../src/lib/handle/display-math.ts | 12 +- .../src/lib/handle/document.ts | 9 +- .../src/lib/handle/environment.ts | 18 +- .../src/lib/handle/group.ts | 4 +- .../src/lib/handle/index.ts | 40 +- .../src/lib/handle/inline-math.ts | 12 +- .../src/lib/handle/linebreak.ts | 9 +- .../src/lib/handle/listItem.ts | 9 +- .../src/lib/handle/math-character.ts | 9 +- .../src/lib/handle/math-container.ts | 13 +- .../src/lib/handle/math-environment.ts | 9 +- .../src/lib/handle/paragraph.ts | 7 +- .../src/lib/handle/preamble.ts | 9 +- .../src/lib/handle/root.ts | 4 +- .../src/lib/handle/script.ts | 4 +- .../src/lib/handle/softbreak.ts | 8 +- .../src/lib/handle/table-cell.ts | 14 +- .../src/lib/handle/table-row.ts | 9 +- .../src/lib/handle/text proper.ts | 6 +- .../src/lib/handle/text.spec.ts | 4 +- .../src/lib/handle/text.ts | 4 +- .../texast-util-to-latex/src/lib/join.ts | 4 +- .../src/lib/texast-util-to-latex proper.ts | 82 - .../src/lib/texast-util-to-latex.spec.ts | 45 +- libs/texast/texast/project.json | 5 +- libs/texast/texast/src/lib/utensil-types.d.ts | 11 +- .../unified-latex-stringify/project.json | 5 +- .../unified-latex-stringify/tsconfig.lib.json | 2 +- .../src/executors/build/executor.ts | 2 +- libs/utils/misc/project.json | 5 +- .../src/lib/utils-ojs-to-preamble.spec.ts | 2 +- libs/utils/ojs-to-preamble/tsconfig.lib.json | 1 - libs/utils/ojs-to-preamble/tsconfig.spec.json | 1 - .../executors/update-readme/executor.spec.ts | 2 +- .../src/executors/update-readme/executor.ts | 4 +- .../executors/update-readme/readmeAction.ts | 2 +- .../executors/update-readme/readmeAction.ts | 3 +- .../xast/xast-util-has-attribute/project.json | 5 +- libs/xast/xast-util-is-element/project.json | 5 +- libs/xast/xast-util-select/.swcrc | 33 - libs/xast/xast-util-select/project.json | 5 +- .../xast-util-select/src/lib/enter-state.ts | 4 +- libs/xast/xast-util-select/src/lib/nest.ts | 10 +- .../xast-util-select/src/test/all.spec.ts | 18 +- libs/xast/xast-util-select/tsconfig.lib.json | 2 +- nx.json | 23 +- package.json | 6 +- pnpm-lock.yaml | 591 ++++--- scripts/generateGlobalTOC.ts | 41 +- scripts/readmeAction.ts | 2 +- .../lib/src/lib/__fileName__.spec.ts__tmpl__ | 4 +- .../files/lib/tsconfig.lib.json__tmpl__ | 2 +- tools/generators/node-lib/index.ts | 2 +- tsconfig.base.json | 2 - 293 files changed, 2939 insertions(+), 2508 deletions(-) create mode 100644 libs/plugins/better-nx-tsc/src/executors/publishable/executor.spec.ts create mode 100644 libs/plugins/better-nx-tsc/src/executors/publishable/executor.ts create mode 100644 libs/plugins/better-nx-tsc/src/executors/publishable/schema.d.ts create mode 100644 libs/plugins/better-nx-tsc/src/executors/publishable/schema.json delete mode 100755 libs/texast/texast-util-to-latex/src/lib/texast-util-to-latex proper.ts delete mode 100644 libs/xast/xast-util-select/.swcrc diff --git a/.eslintrc.json b/.eslintrc.json index f5b01046..37347614 100755 --- a/.eslintrc.json +++ b/.eslintrc.json @@ -26,7 +26,9 @@ { "files": ["*.ts", "*.tsx"], "extends": ["plugin:@nrwl/nx/typescript"], - "rules": {} + "rules": { + "@typescript-eslint/no-explicit-any": "off" + } }, { "files": ["*.js", "*.jsx"], diff --git a/apps/convert/src/app/components/SelectFormat.tsx b/apps/convert/src/app/components/SelectFormat.tsx index 151030b9..30aa9226 100644 --- a/apps/convert/src/app/components/SelectFormat.tsx +++ b/apps/convert/src/app/components/SelectFormat.tsx @@ -3,7 +3,7 @@ import { Fragment, useState } from 'react' import { Listbox, Transition } from '@headlessui/react' import { CheckIcon, ChevronUpDownIcon } from '@heroicons/react/20/solid' -import { GenericIcon } from './ExtIcon' +import { GenericIcon } from './ExtIcon.js' // const options = [ // { id: 1, name: 'Wade Cooper', online: true }, diff --git a/apps/convert/src/app/layout.tsx b/apps/convert/src/app/layout.tsx index 3414a7e1..32234531 100644 --- a/apps/convert/src/app/layout.tsx +++ b/apps/convert/src/app/layout.tsx @@ -4,8 +4,8 @@ import type { Metadata } from 'next' import '../styles/globals.css' import Script from 'next/script' import { env } from '../env/server.mjs' -import { AnalyticsWrapper } from './Analytics' -import { Shell } from './components/Shell' +import { AnalyticsWrapper } from './Analytics.js' +import { Shell } from './components/Shell.js' // If loading a variable font, you don't need to specify the font weight const overpass = Overpass({ //weight: ['600', '900'], diff --git a/apps/convert/src/app/page.tsx b/apps/convert/src/app/page.tsx index 3d419430..270dc362 100644 --- a/apps/convert/src/app/page.tsx +++ b/apps/convert/src/app/page.tsx @@ -1,11 +1,11 @@ 'use client' import { z } from 'zod' import { useState } from 'react' -import { SelectFormat } from './components/SelectFormat' +import { SelectFormat } from './components/SelectFormat.js' import { zodResolver } from '@hookform/resolvers/zod' import { useForm } from 'react-hook-form' -import { Form } from './components/Form' -import { SelectFormatNative } from './components/SelectFormatNative' +import { Form } from './components/Form.js' +import { SelectFormatNative } from './components/SelectFormatNative.js' function onSubmit() {} diff --git a/apps/converter-frontend-e2e/src/integration/app.spec.ts b/apps/converter-frontend-e2e/src/integration/app.spec.ts index da063624..3c3c8074 100755 --- a/apps/converter-frontend-e2e/src/integration/app.spec.ts +++ b/apps/converter-frontend-e2e/src/integration/app.spec.ts @@ -1,4 +1,4 @@ -import { getGreeting } from '../support/app.po' +import { getGreeting } from '../support/app.po.js' describe('converter-frontend', () => { beforeEach(() => cy.visit('/')) diff --git a/apps/converter-frontend/components/add-latex-preamble/add-latex-preamble.spec.tsx b/apps/converter-frontend/components/add-latex-preamble/add-latex-preamble.spec.tsx index 012cb77c..745a173b 100755 --- a/apps/converter-frontend/components/add-latex-preamble/add-latex-preamble.spec.tsx +++ b/apps/converter-frontend/components/add-latex-preamble/add-latex-preamble.spec.tsx @@ -1,6 +1,6 @@ import { render } from '@testing-library/react' -import AddLatexPreamble from './add-latex-preamble' +import AddLatexPreamble from './add-latex-preamble.js' describe('AddLatexPreamble', () => { it('should render successfully', () => { diff --git a/apps/converter-frontend/components/app-shell-layout/app-shell-layout.spec.tsx b/apps/converter-frontend/components/app-shell-layout/app-shell-layout.spec.tsx index 7b05463e..051cd34c 100755 --- a/apps/converter-frontend/components/app-shell-layout/app-shell-layout.spec.tsx +++ b/apps/converter-frontend/components/app-shell-layout/app-shell-layout.spec.tsx @@ -1,6 +1,6 @@ import { render } from '@testing-library/react' -import AppShellLayout from './app-shell-layout' +import AppShellLayout from './app-shell-layout.js' describe('AppShellLayout', () => { it('should render successfully', () => { diff --git a/apps/converter-frontend/components/app-shell-layout/app-shell-layout.tsx b/apps/converter-frontend/components/app-shell-layout/app-shell-layout.tsx index 10f10deb..a9e35c3f 100755 --- a/apps/converter-frontend/components/app-shell-layout/app-shell-layout.tsx +++ b/apps/converter-frontend/components/app-shell-layout/app-shell-layout.tsx @@ -9,7 +9,7 @@ import { useMantineTheme, } from '@mantine/core' import React, { useState } from 'react' -import { HStack, VStack } from '../stack/stack' +import { HStack, VStack } from '../stack/stack.js' import Image from 'next/image' import Link from 'next/link' @@ -32,9 +32,7 @@ export function AppShellLayout(props: AppShellLayoutProps) { header={
{/* Handle other responsive styles with MediaQuery component or createStyles function */} -
+
- Journal of Trial and Error + Journal of Trial and Error Convert diff --git a/apps/converter-frontend/components/conversion/conversion.spec.tsx b/apps/converter-frontend/components/conversion/conversion.spec.tsx index a1f9f6bb..1255b800 100755 --- a/apps/converter-frontend/components/conversion/conversion.spec.tsx +++ b/apps/converter-frontend/components/conversion/conversion.spec.tsx @@ -1,6 +1,6 @@ import { render } from '@testing-library/react' -import Conversion from './conversion' +import Conversion from './conversion.js' describe('Conversion', () => { it('should render successfully', () => { diff --git a/apps/converter-frontend/components/converted-block-local/converted-block-local.spec.tsx b/apps/converter-frontend/components/converted-block-local/converted-block-local.spec.tsx index c73cab8b..6ccbfde3 100755 --- a/apps/converter-frontend/components/converted-block-local/converted-block-local.spec.tsx +++ b/apps/converter-frontend/components/converted-block-local/converted-block-local.spec.tsx @@ -1,6 +1,6 @@ import { render } from '@testing-library/react' -import ConvertedBlockLocal from './converted-block-local' +import ConvertedBlockLocal from './converted-block-local.js' describe('ConvertedBlockLocal', () => { it('should render successfully', () => { diff --git a/apps/converter-frontend/components/converted-block/converted-block.spec.tsx b/apps/converter-frontend/components/converted-block/converted-block.spec.tsx index 93be9898..4cc9d9af 100755 --- a/apps/converter-frontend/components/converted-block/converted-block.spec.tsx +++ b/apps/converter-frontend/components/converted-block/converted-block.spec.tsx @@ -1,6 +1,6 @@ import { render } from '@testing-library/react' -import ConvertedBlock from './converted-block' +import ConvertedBlock from './converted-block.js' describe('ConvertedBlock', () => { it('should render successfully', () => { diff --git a/apps/converter-frontend/components/ext-icon/ext-icon.spec.tsx b/apps/converter-frontend/components/ext-icon/ext-icon.spec.tsx index 92d3c2f6..f1f8a945 100755 --- a/apps/converter-frontend/components/ext-icon/ext-icon.spec.tsx +++ b/apps/converter-frontend/components/ext-icon/ext-icon.spec.tsx @@ -1,6 +1,6 @@ import { render } from '@testing-library/react' -import ExtIcon from './ext-icon' +import ExtIcon from './ext-icon.js' describe('ExtIcon', () => { it('should render successfully', () => { diff --git a/apps/converter-frontend/components/publications-list/citations.tsx b/apps/converter-frontend/components/publications-list/citations.tsx index fdf7eeeb..31edeeac 100755 --- a/apps/converter-frontend/components/publications-list/citations.tsx +++ b/apps/converter-frontend/components/publications-list/citations.tsx @@ -18,7 +18,7 @@ export const Citations = ({ : process.env.NEXT_PUBLIC_STYLE_DEV_URL || 'http://localhost:8000/api/style' const splitextra = extra ?.replace(/\\r/g, '') - ?.replace(/\n([A-Z])/gm, '\n\n\n$1') + ?.replace(/\n([A-Z])/g, '\n\n\n$1') ?.replace(/\n([^A-Z])/g, '$1') //console.log(splitextra) const { data, error } = useSWR(url, (resource: string, init: any) => diff --git a/apps/converter-frontend/components/publications-list/file-reel.tsx b/apps/converter-frontend/components/publications-list/file-reel.tsx index 2a94acfc..9e2f1a7f 100755 --- a/apps/converter-frontend/components/publications-list/file-reel.tsx +++ b/apps/converter-frontend/components/publications-list/file-reel.tsx @@ -2,7 +2,7 @@ import { Loader, Tabs, Text } from '@mantine/core' import { paths, definitions } from 'ojs-client' import React from 'react' import useSWR from 'swr' -import { FileStage } from './file-stage' +import { FileStage } from './file-stage.js' export const FileReel = (props: { data: Exclude< @@ -17,8 +17,8 @@ export const FileReel = (props: { const { data, error } = useSWR( `/api/ojs/files?apiToken=${apiToken}&submissionId=${id}&stageId=${stageId}&endpoint=${encodeURIComponent( - endpoint - )}` + endpoint, + )}`, ) if (!data) { return @@ -59,21 +59,20 @@ export const FileReel = (props: { 'Production', ] - const sortedFiles: { [key: number]: definitions['SubmissionFile'][] } = - data.items.reduce( - ( - acc: { [key: number]: definitions['SubmissionFile'][] }, - curr: definitions['SubmissionFile'] - ) => { - const id = getStageId(curr) - if (!id) { - return - } - acc[id] = [...(acc?.[id] || []), curr] - return acc - }, - {} as { [key: number]: definitions['SubmissionFile'][] } - ) + const sortedFiles: { [key: number]: definitions['SubmissionFile'][] } = data.items.reduce( + ( + acc: { [key: number]: definitions['SubmissionFile'][] }, + curr: definitions['SubmissionFile'], + ) => { + const id = getStageId(curr) + if (!id) { + return + } + acc[id] = [...(acc?.[id] || []), curr] + return acc + }, + {} as { [key: number]: definitions['SubmissionFile'][] }, + ) return ( @@ -82,10 +81,7 @@ export const FileReel = (props: { //console.log(stageInt) //console.log(data) return ( - + { it('should render successfully', () => { diff --git a/apps/converter-frontend/components/publications-list/render-pub-meta.tsx b/apps/converter-frontend/components/publications-list/render-pub-meta.tsx index 27bf58e4..6d9f097a 100755 --- a/apps/converter-frontend/components/publications-list/render-pub-meta.tsx +++ b/apps/converter-frontend/components/publications-list/render-pub-meta.tsx @@ -3,8 +3,8 @@ import Link from 'next/link' import { definitions } from 'ojs-client' import React from 'react' import { FaOrcid } from 'react-icons/fa' -import { HStack } from '../stack/stack' -import { Citations } from './citations' +import { HStack } from '../stack/stack.js' +import { Citations } from './citations.js' export type PublicationKeys = keyof definitions['Publication'] export type PublicationTypes = definitions['Publication'][PublicationKeys] @@ -39,25 +39,23 @@ export const RenderPubMeta = ({ return ( {/*@ts-expect-error booo*/} - {(value as definitions['Publication']['keywords'])?.en_US?.map( - (keyw: string) => ( - - {keyw} - - ) - )} + {(value as definitions['Publication']['keywords'])?.en_US?.map((keyw: string) => ( + + {keyw} + + ))} ) case 'title': @@ -75,9 +73,7 @@ export const RenderPubMeta = ({ } } -export const AuthorsContainer = (props: { - authors: definitions['Publication']['authors'] -}) => { +export const AuthorsContainer = (props: { authors: definitions['Publication']['authors'] }) => { const { authors } = props return ( { it('should render successfully', () => { diff --git a/apps/converter-frontend/components/settings/settings.spec.tsx b/apps/converter-frontend/components/settings/settings.spec.tsx index a162fc90..8090ad7d 100755 --- a/apps/converter-frontend/components/settings/settings.spec.tsx +++ b/apps/converter-frontend/components/settings/settings.spec.tsx @@ -1,6 +1,6 @@ import { render } from '@testing-library/react' -import Settings from './settings' +import Settings from './settings.js' describe('Settings', () => { it('should render successfully', () => { diff --git a/apps/converter-frontend/components/stack/stack.spec.tsx b/apps/converter-frontend/components/stack/stack.spec.tsx index 6ff9055b..d214c210 100755 --- a/apps/converter-frontend/components/stack/stack.spec.tsx +++ b/apps/converter-frontend/components/stack/stack.spec.tsx @@ -1,6 +1,6 @@ import { render } from '@testing-library/react' -import Stack from './stack' +import Stack from './stack.js' describe('Stack', () => { it('should render successfully', () => { diff --git a/apps/converter-frontend/pages/api/ojs/file.ts b/apps/converter-frontend/pages/api/ojs/file.ts index 5861af0f..458b73e1 100755 --- a/apps/converter-frontend/pages/api/ojs/file.ts +++ b/apps/converter-frontend/pages/api/ojs/file.ts @@ -1,6 +1,6 @@ -import { replaceCookieRes, getSID } from '../../../utils/forgeCookie' +import { replaceCookieRes, getSID } from '../../../utils/forgeCookie.js' -import { setCookie } from '../../../utils/cookies' +import { setCookie } from '../../../utils/cookies.js' import axios from 'axios' import { NextApiRequest, NextApiResponse } from 'next' import { getSession } from 'next-auth/react' diff --git a/apps/converter-frontend/pages/api/ojs/files.ts b/apps/converter-frontend/pages/api/ojs/files.ts index 11eded2a..d6cee40a 100755 --- a/apps/converter-frontend/pages/api/ojs/files.ts +++ b/apps/converter-frontend/pages/api/ojs/files.ts @@ -1,9 +1,9 @@ import axios from 'axios' import { NextApiRequest, NextApiResponse } from 'next' import qs from 'querystring' -import { replaceCookieRes, getSID } from '../../../utils/forgeCookie' +import { replaceCookieRes, getSID } from '../../../utils/forgeCookie.js' -import { setCookie } from '../../../utils/cookies' +import { setCookie } from '../../../utils/cookies.js' const handler = async (req: NextApiRequest, res: NextApiResponse) => { const { endpoint, apiToken, submissionId, stageId } = req.query diff --git a/apps/converter-frontend/pages/api/ojs/index.ts b/apps/converter-frontend/pages/api/ojs/index.ts index 7c421780..f4426421 100755 --- a/apps/converter-frontend/pages/api/ojs/index.ts +++ b/apps/converter-frontend/pages/api/ojs/index.ts @@ -1,9 +1,9 @@ -import { getSID, replaceCookieRes } from '../../../utils/forgeCookie' +import { getSID, replaceCookieRes } from '../../../utils/forgeCookie.js' import axios from 'axios' import { NextApiRequest, NextApiResponse } from 'next' import { getSession } from 'next-auth/react' import qs from 'querystring' -import { setCookie } from '../../../utils/cookies' +import { setCookie } from '../../../utils/cookies.js' const handler = async (req: NextApiRequest, res: NextApiResponse) => { const { apiToken: token, searchPhrase, endpoint, ...rest } = req.query diff --git a/apps/converter-frontend/pages/api/ojs/publication.ts b/apps/converter-frontend/pages/api/ojs/publication.ts index beb3d809..fa377e66 100755 --- a/apps/converter-frontend/pages/api/ojs/publication.ts +++ b/apps/converter-frontend/pages/api/ojs/publication.ts @@ -1,8 +1,8 @@ -import { getSID, replaceCookieRes } from '../../../utils/forgeCookie' +import { getSID, replaceCookieRes } from '../../../utils/forgeCookie.js' import axios from 'axios' import { NextApiRequest, NextApiResponse } from 'next' import { getSession } from 'next-auth/react' -import { setCookie } from '../../../utils/cookies' +import { setCookie } from '../../../utils/cookies.js' const handler = async (req: NextApiRequest, res: NextApiResponse) => { const { url, apiToken: token } = req.query diff --git a/apps/converter-frontend/pages/api/tex-to-pdf.ts b/apps/converter-frontend/pages/api/tex-to-pdf.ts index 895ef7ed..bb449975 100755 --- a/apps/converter-frontend/pages/api/tex-to-pdf.ts +++ b/apps/converter-frontend/pages/api/tex-to-pdf.ts @@ -3,7 +3,7 @@ import tar from 'tar-stream' import { Writable } from 'stream' import axios from 'axios' import FormData from 'form-data' -import { cls } from '../../public/jote-article' +import { cls } from '../../public/jote-article.js' const handler = async (req: NextApiRequest, res: NextApiResponse) => { req.statusCode = 200 @@ -49,7 +49,7 @@ const handler = async (req: NextApiRequest, res: NextApiResponse) => { ...formdata.getHeaders(), Accept: 'application/pdf', }, - } + }, ) .then(async (result) => { console.log('PDF Received!') diff --git a/apps/converter-frontend/pages/authors.tsx b/apps/converter-frontend/pages/authors.tsx index a8e40d8e..24e24e15 100755 --- a/apps/converter-frontend/pages/authors.tsx +++ b/apps/converter-frontend/pages/authors.tsx @@ -3,8 +3,8 @@ import { signIn, useSession } from 'next-auth/react' import React from 'react' import { FaMicrosoft } from 'react-icons/fa' import useSWR from 'swr' -import { PublicationData } from '../components/publications-list/publication-data' -import { VStack } from '../components/stack/stack' +import { PublicationData } from '../components/publications-list/publication-data.js' +import { VStack } from '../components/stack/stack.js' import qs from 'querystring' function AuthorPage() { @@ -57,10 +57,7 @@ export function AuthAuthorPage(props: { query?: Record }) { Issue {issue} */} {data?.items?.map((item: any) => ( - + { diff --git a/apps/converter-frontend/pages/remote.tsx b/apps/converter-frontend/pages/remote.tsx index a1fe562a..a197fec8 100755 --- a/apps/converter-frontend/pages/remote.tsx +++ b/apps/converter-frontend/pages/remote.tsx @@ -1,21 +1,12 @@ import React, { useEffect, useState } from 'react' -import { - Button, - Code, - Container, - Group, - Select, - Text, - Title, - useMantineTheme, -} from '@mantine/core' -import { HStack } from '../components/stack/stack' -import SelectItem from '../components/select-item/select-item' +import { Button, Code, Container, Group, Select, Text, Title, useMantineTheme } from '@mantine/core' +import { HStack } from '../components/stack/stack.js' +import SelectItem from '../components/select-item/select-item.js' import { AiOutlineUpload } from 'react-icons/ai' -import { JATSIcon, TexIcon, WordIcon } from '../components/ext-icon/ext-icon' +import { JATSIcon, TexIcon, WordIcon } from '../components/ext-icon/ext-icon.js' import { Dropzone } from '@mantine/dropzone' -import ConvertedBlock from '../components/converted-block/converted-block' +import ConvertedBlock from '../components/converted-block/converted-block.js' export default function Index() { const [thing, setThing] = useState() const [tex, setTex] = useState('') @@ -89,11 +80,7 @@ export default function Index() { setThing(buf) }} > - + { it('should render successfully', () => { diff --git a/apps/converter-frontend/tsconfig.json b/apps/converter-frontend/tsconfig.json index d70132d1..68a3bb31 100755 --- a/apps/converter-frontend/tsconfig.json +++ b/apps/converter-frontend/tsconfig.json @@ -12,7 +12,6 @@ "resolveJsonModule": true, "isolatedModules": true, "incremental": true, - "moduleResolution": "nodenext", "module": "ESNext", "target": "ESNext" }, diff --git a/apps/react-pdf-e2e/src/integration/app.spec.ts b/apps/react-pdf-e2e/src/integration/app.spec.ts index 5b0b92ea..bb90bde4 100644 --- a/apps/react-pdf-e2e/src/integration/app.spec.ts +++ b/apps/react-pdf-e2e/src/integration/app.spec.ts @@ -1,4 +1,4 @@ -import { getGreeting } from '../support/app.po' +import { getGreeting } from '../support/app.po.js' describe('react-pdf', () => { beforeEach(() => cy.visit('/')) diff --git a/apps/react-pdf/specs/index.spec.tsx b/apps/react-pdf/specs/index.spec.tsx index 1dd006ef..a4efe8a3 100644 --- a/apps/react-pdf/specs/index.spec.tsx +++ b/apps/react-pdf/specs/index.spec.tsx @@ -1,7 +1,7 @@ import React from 'react' import { render } from '@testing-library/react' -import Index from '../pages/index' +import Index from '../pages/index.js' describe('Index', () => { it('should render successfully', () => { diff --git a/libs/ast-stringify/project.json b/libs/ast-stringify/project.json index a7b6386e..7be3d9f1 100755 --- a/libs/ast-stringify/project.json +++ b/libs/ast-stringify/project.json @@ -26,8 +26,11 @@ "passWithNoTests": true } }, + "make-publishable": { + "executor": "better-nx-tsc:publishable" + }, "build": { - "executor": "better-nx-tsc:tsc", + "executor": "@nrwl/js:tsc", "outputs": ["{options.outputPath}"], "options": { "rootDir": "libs/ast-stringify/src", diff --git a/libs/ast-stringify/src/index.ts b/libs/ast-stringify/src/index.ts index 3e4515ed..6923ae3f 100755 --- a/libs/ast-stringify/src/index.ts +++ b/libs/ast-stringify/src/index.ts @@ -1 +1 @@ -export { default } from './lib/ast-stringify' +export { default } from './lib/ast-stringify.js' diff --git a/libs/ast-stringify/src/lib/ast-stringify.spec.ts b/libs/ast-stringify/src/lib/ast-stringify.spec.ts index a0c295f2..c9a890e4 100755 --- a/libs/ast-stringify/src/lib/ast-stringify.spec.ts +++ b/libs/ast-stringify/src/lib/ast-stringify.spec.ts @@ -1,4 +1,4 @@ -import astStringify from './ast-stringify' +import astStringify from './ast-stringify.js' describe('ast-stringify', () => { it('should work', () => { expect(typeof astStringify).toEqual('function') diff --git a/libs/book-converter/project.json b/libs/book-converter/project.json index dae52b3e..0c910779 100644 --- a/libs/book-converter/project.json +++ b/libs/book-converter/project.json @@ -4,8 +4,11 @@ "sourceRoot": "libs/book-converter/src", "projectType": "library", "targets": { + "make-publishable": { + "executor": "better-nx-tsc:publishable" + }, "build": { - "executor": "better-nx-tsc:tsc", + "executor": "@nrwl/js:tsc", "outputs": ["{options.outputPath}"], "options": { "rootDir": "libs/book-converter/src", diff --git a/libs/book-converter/src/lib/book-converter.spec.ts b/libs/book-converter/src/lib/book-converter.spec.ts index 5765d143..4673a317 100644 --- a/libs/book-converter/src/lib/book-converter.spec.ts +++ b/libs/book-converter/src/lib/book-converter.spec.ts @@ -1,5 +1,5 @@ import { writeFile } from 'fs/promises' -import { bookConverter } from './book-converter' +import { bookConverter } from './book-converter.js' import { describe, expect, it } from 'vitest' describe('bookConverter', () => { diff --git a/libs/book-converter/src/lib/book-converter.ts b/libs/book-converter/src/lib/book-converter.ts index b1afd4d6..1301a75f 100644 --- a/libs/book-converter/src/lib/book-converter.ts +++ b/libs/book-converter/src/lib/book-converter.ts @@ -3,11 +3,11 @@ import reoffParse from 'reoff-parse' import reoffUnifiedLatex from 'reoff-unified-latex' import unifiedLatexStringify from 'unified-latex-stringify' import { docxToVFile } from 'docx-to-vfile' -import { paragraphHandlers } from './paragraph' +import { paragraphHandlers } from './paragraph.js' import { readFile, writeFile } from 'fs/promises' import { s } from '@unified-latex/unified-latex-builder' import { existsSync, mkdirSync, writeFileSync } from 'fs' -import { Output, makeIndex } from './make-index' +import { Output, makeIndex } from './make-index.js' export async function bookConverter(book: string): Promise export async function bookConverter(book: string, indexCSV: string): Promise diff --git a/libs/book-converter/src/lib/make-index.spec.ts b/libs/book-converter/src/lib/make-index.spec.ts index 78543a33..b7f1cb69 100644 --- a/libs/book-converter/src/lib/make-index.spec.ts +++ b/libs/book-converter/src/lib/make-index.spec.ts @@ -1,5 +1,5 @@ import { readFile } from 'fs/promises' -import { makeIndex } from './make-index' +import { makeIndex } from './make-index.js' import { describe, expect, it } from 'vitest' describe('makeIndex', () => { diff --git a/libs/book-converter/src/lib/paragraph/index.ts b/libs/book-converter/src/lib/paragraph/index.ts index b3573d6c..cb6ee809 100644 --- a/libs/book-converter/src/lib/paragraph/index.ts +++ b/libs/book-converter/src/lib/paragraph/index.ts @@ -1,5 +1,5 @@ import { all, defaultParagraphHandlers } from 'ooxast-util-to-unified-latex' -import { textboxhandler } from './textbox' +import { textboxhandler } from './textbox.js' import { arg, args, env, m, s } from '@unified-latex/unified-latex-builder' import { PB } from 'libs/ooxast/ooxast-util-to-unified-latex/src/lib/util/PB' import { toString } from 'xast-util-to-string' diff --git a/libs/citations/apa-parser/project.json b/libs/citations/apa-parser/project.json index 5934ec7e..dff08ce8 100644 --- a/libs/citations/apa-parser/project.json +++ b/libs/citations/apa-parser/project.json @@ -11,8 +11,11 @@ "packageJSON": "libs/citations/apa-parser/package.json" } }, + "make-publishable": { + "executor": "better-nx-tsc:publishable" + }, "build": { - "executor": "better-nx-tsc:tsc", + "executor": "@nrwl/js:tsc", "outputs": ["{options.outputPath}"], "options": { "rootDir": "libs/citations/apa-parser/src", diff --git a/libs/citations/apa-parser/src/spec/apa-parser.spec.ts b/libs/citations/apa-parser/src/spec/apa-parser.spec.ts index a18754b2..58d27eaa 100755 --- a/libs/citations/apa-parser/src/spec/apa-parser.spec.ts +++ b/libs/citations/apa-parser/src/spec/apa-parser.spec.ts @@ -1,6 +1,6 @@ -import { tests } from './testcites' -import { names } from './testnames' -import { apaParser } from '../lib/apa-parser' +import { tests } from './testcites.js' +import { names } from './testnames.js' +import { apaParser } from '../lib/apa-parser.js' import nearley, { Parser } from 'nearley' import { unified } from 'unified' import fs from 'fs' @@ -11,7 +11,7 @@ import { removePosition } from 'unist-util-remove-position' const MODE: 'dev' | 'test' = 'test' // eslint-disable-next-line //@ts-ignore it's there sweaty -//import grammar from './apa.ne' +//import grammar from './apa.ne.js' type ContentArr = [ description: string, diff --git a/libs/citations/apa-parser/src/spec/testcites.ts b/libs/citations/apa-parser/src/spec/testcites.ts index 473859c1..c1eae4df 100755 --- a/libs/citations/apa-parser/src/spec/testcites.ts +++ b/libs/citations/apa-parser/src/spec/testcites.ts @@ -1,4 +1,4 @@ -import type { TestData } from './apa-parser.spec' +import type { TestData } from './apa-parser.spec.js' export const tests: TestData = { 'Custom-Shit': { description: 'own cases i wanna catch', @@ -299,9 +299,7 @@ export const tests: TestData = { { id: 'vanRavenzwaai2016', itemData: { - author: [ - { family: 'Ravenzwaai', 'non-dropping-particle': 'van' }, - ], + author: [{ family: 'Ravenzwaai', 'non-dropping-particle': 'van' }], issued: { 'date-parts': [['2016']] }, }, }, @@ -390,11 +388,9 @@ export const tests: TestData = { }, ], properties: { noteIndex: 0 }, - originalText: - '(Adams et al., 2019; Shumway & Shulman, 2015; Westinghouse, 2017)', + originalText: '(Adams et al., 2019; Shumway & Shulman, 2015; Westinghouse, 2017)', }, - input: - '(Adams et al., 2019; Shumway & Shulman, 2015; Westinghouse, 2017)', + input: '(Adams et al., 2019; Shumway & Shulman, 2015; Westinghouse, 2017)', }, { description: 'tough for some reason', @@ -421,8 +417,7 @@ export const tests: TestData = { ], properties: { noteIndex: 0 }, - originalText: - '(Gillich et al., 2019; van Moorselaar & Slagter, 2019)', + originalText: '(Gillich et al., 2019; van Moorselaar & Slagter, 2019)', }, input: '(Gillich et al., 2019; van Moorselaar & Slagter, 2019)', }, @@ -436,10 +431,7 @@ export const tests: TestData = { { id: 'Vallée-Tourangeau2020', itemData: { - author: [ - { family: 'Vallée-Tourangeau' }, - { family: 'March' }, - ], + author: [{ family: 'Vallée-Tourangeau' }, { family: 'March' }], issued: { 'date-parts': [['2020']] }, }, }, @@ -478,8 +470,7 @@ export const tests: TestData = { ], properties: { noteIndex: 0 }, - originalText: - '(Gillich et al., 2019; van Moorselaar & Slagter, 2019)', + originalText: '(Gillich et al., 2019; van Moorselaar & Slagter, 2019)', }, ], input: @@ -561,33 +552,21 @@ export const tests: TestData = { { id: 'Carraway2013', itemData: { - author: [ - { family: 'Carraway' }, - { family: 'Guy' }, - { family: 'Man' }, - ], + author: [{ family: 'Carraway' }, { family: 'Guy' }, { family: 'Man' }], issued: { 'date-parts': [['2013']] }, }, }, { id: 'Carraway2014', itemData: { - author: [ - { family: 'Carraway' }, - { family: 'Guy' }, - { family: 'Man' }, - ], + author: [{ family: 'Carraway' }, { family: 'Guy' }, { family: 'Man' }], issued: { 'date-parts': [['2014']] }, }, }, { id: 'Carraway2019', itemData: { - author: [ - { family: 'Carraway' }, - { family: 'Guy' }, - { family: 'Man' }, - ], + author: [{ family: 'Carraway' }, { family: 'Guy' }, { family: 'Man' }], issued: { 'date-parts': [['2019']] }, }, }, @@ -729,8 +708,7 @@ export const tests: TestData = { }, ], properties: { noteIndex: 0 }, - originalText: - '(Centers for Disease Control and Prevention, 2019, p. 10)', + originalText: '(Centers for Disease Control and Prevention, 2019, p. 10)', }, input: '(Centers for Disease Control and Prevention, 2019, p. 10)', }, @@ -842,9 +820,7 @@ export const tests: TestData = { { id: 'BeckInstituteforCognitiveBehaviourTherapy2012', itemData: { - author: [ - { family: 'BeckInstituteforCognitiveBehaviourTherapy' }, - ], + author: [{ family: 'BeckInstituteforCognitiveBehaviourTherapy' }], issued: { 'date-parts': [['2012']] }, }, label: 'none', @@ -852,11 +828,9 @@ export const tests: TestData = { }, ], properties: { noteIndex: 0 }, - originalText: - '(Beck Institute for Cognitive Behaviour Therapy, 2012, 1:30:40)', + originalText: '(Beck Institute for Cognitive Behaviour Therapy, 2012, 1:30:40)', }, - input: - '(Beck Institute for Cognitive Behaviour Therapy, 2012, 1:30:40)', + input: '(Beck Institute for Cognitive Behaviour Therapy, 2012, 1:30:40)', }, { description: '', @@ -965,8 +939,7 @@ export const tests: TestData = { }, ], properties: { noteIndex: 0 }, - originalText: - '(Shakespeare, 1623/1995, 1.3.36–37; Johnson, 2021, p. 1)', + originalText: '(Shakespeare, 1623/1995, 1.3.36–37; Johnson, 2021, p. 1)', }, input: '(Shakespeare, 1623/1995, 1.3.36–37; Johnson, 2021, p. 1)', }, @@ -1100,8 +1073,7 @@ export const tests: TestData = { }, ], properties: { noteIndex: 0 }, - originalText: - '(American Educational Research Association et al., 2014)', + originalText: '(American Educational Research Association et al., 2014)', }, input: '(American Educational Research Association et al., 2014)', }, @@ -1119,11 +1091,7 @@ export const tests: TestData = { { id: 'Kapoor2017', itemData: { - author: [ - { family: 'Kapoor' }, - { family: 'Bloom' }, - { family: 'Montez' }, - ], + author: [{ family: 'Kapoor' }, { family: 'Bloom' }, { family: 'Montez' }], issued: { 'date-parts': [['2017']] }, }, }, @@ -1141,11 +1109,7 @@ export const tests: TestData = { { id: 'Kapoor2017', itemData: { - author: [ - { family: 'Kapoor' }, - { family: 'Bloom' }, - { family: 'Zucker' }, - ], + author: [{ family: 'Kapoor' }, { family: 'Bloom' }, { family: 'Zucker' }], issued: { 'date-parts': [['2017']] }, }, }, @@ -1341,10 +1305,7 @@ export const tests: TestData = { { id: 'Taylor2015', itemData: { - author: [ - { family: 'Taylor', given: 'J M' }, - { family: 'Neimeyer' }, - ], + author: [{ family: 'Taylor', given: 'J M' }, { family: 'Neimeyer' }], issued: { 'date-parts': [['2015']] }, }, }, @@ -1362,8 +1323,7 @@ export const tests: TestData = { input: '(J. M. Taylor & Neimeyer, 2015; T. Taylor, 2014)', }, { - description: - 'When initials are also the same, revert to standard format', + description: 'When initials are also the same, revert to standard format', result: { citationId: 'CITE-X', citationItems: [ diff --git a/libs/citations/apa-parser/src/spec/testnames.ts b/libs/citations/apa-parser/src/spec/testnames.ts index e640d07e..187af66b 100755 --- a/libs/citations/apa-parser/src/spec/testnames.ts +++ b/libs/citations/apa-parser/src/spec/testnames.ts @@ -1,4 +1,4 @@ -import { TestData } from './apa-parser.spec' +import { TestData } from './apa-parser.spec.js' export const names: TestData = { 'Boring names': { diff --git a/libs/citations/crossref-json/project.json b/libs/citations/crossref-json/project.json index 23916d63..4e44413b 100755 --- a/libs/citations/crossref-json/project.json +++ b/libs/citations/crossref-json/project.json @@ -18,8 +18,11 @@ "lintFilePatterns": ["libs/citations/crossref-json/**/*.ts"] } }, + "make-publishable": { + "executor": "better-nx-tsc:publishable" + }, "build": { - "executor": "better-nx-tsc:tsc", + "executor": "@nrwl/js:tsc", "outputs": ["{options.outputPath}"], "options": { "rootDir": "libs/citations/crossref-json/src", diff --git a/libs/citations/crossref-json/tsconfig.lib.json b/libs/citations/crossref-json/tsconfig.lib.json index 4e148db0..61f33d60 100755 --- a/libs/citations/crossref-json/tsconfig.lib.json +++ b/libs/citations/crossref-json/tsconfig.lib.json @@ -6,5 +6,5 @@ "types": ["node"] }, "exclude": ["**/*.spec.ts", "**/*.test.ts"], - "include": ["src/**/*.ts"] + "include": ["**/*.ts"] } diff --git a/libs/citations/crossref-to-csl/project.json b/libs/citations/crossref-to-csl/project.json index 7c2fbbec..aa3b361c 100755 --- a/libs/citations/crossref-to-csl/project.json +++ b/libs/citations/crossref-to-csl/project.json @@ -26,8 +26,11 @@ "passWithNoTests": true } }, + "make-publishable": { + "executor": "better-nx-tsc:publishable" + }, "build": { - "executor": "better-nx-tsc:tsc", + "executor": "@nrwl/js:tsc", "outputs": ["{options.outputPath}"], "options": { "rootDir": "libs/citations/crossref-to-csl/src", diff --git a/libs/citations/crossref-to-csl/src/lib/crossref-to-csl.ts b/libs/citations/crossref-to-csl/src/lib/crossref-to-csl.ts index 28e5d542..e53aaedf 100755 --- a/libs/citations/crossref-to-csl/src/lib/crossref-to-csl.ts +++ b/libs/citations/crossref-to-csl/src/lib/crossref-to-csl.ts @@ -2,7 +2,6 @@ import { CrossrefJSON } from 'crossref-json' import { Data as CSL } from 'csl-json' import { PickByValue } from 'utility-types' -type I = keyof CrossrefJSON & keyof CSL type CRArraylike = keyof PickByValue type CRSinglets = Exclude type CSLArraylike = keyof PickByValue @@ -35,14 +34,7 @@ const sames: Same[] = [ //'source', //'type', ] -const arrs: Arr[] = [ - 'ISBN', - 'ISSN', - 'archive', - 'container-title', - 'original-title', - 'title', -] +const arrs: Arr[] = ['ISBN', 'ISSN', 'archive', 'container-title', 'original-title', 'title'] const maps: [key1: keyof CSL, key2: keyof CrossrefJSON][] = [ ['publisher-place', 'publisher-location'], @@ -52,7 +44,6 @@ const maps: [key1: keyof CSL, key2: keyof CrossrefJSON][] = [ export function crossrefToCsl(item: CrossrefJSON): CSL { const map = (key: keyof CSL, newkey: keyof CrossrefJSON) => item[newkey] ? { [key]: item[newkey] } : {} - const cond = (key: keyof CSL, value: any) => (value ? { [key]: value } : {}) const same = (key: Same) => (item[key] ? { [key]: item[key] } : {}) const arr = (key: Arr) => (item[key] ? { [key]: item[key][0] } : {}) diff --git a/libs/citations/csl-consolidate/project.json b/libs/citations/csl-consolidate/project.json index 5fd0179b..fe28590d 100755 --- a/libs/citations/csl-consolidate/project.json +++ b/libs/citations/csl-consolidate/project.json @@ -26,8 +26,11 @@ "passWithNoTests": true } }, + "make-publishable": { + "executor": "better-nx-tsc:publishable" + }, "build": { - "executor": "better-nx-tsc:tsc", + "executor": "@nrwl/js:tsc", "outputs": ["{options.outputPath}"], "options": { "rootDir": "libs/citations/csl-consolidate/src", diff --git a/libs/citations/csl-to-biblatex/project.json b/libs/citations/csl-to-biblatex/project.json index 132cf6a9..6396764a 100644 --- a/libs/citations/csl-to-biblatex/project.json +++ b/libs/citations/csl-to-biblatex/project.json @@ -11,8 +11,11 @@ "packageJSON": "libs/citations/csl-to-biblatex/package.json" } }, + "make-publishable": { + "executor": "better-nx-tsc:publishable" + }, "build": { - "executor": "better-nx-tsc:tsc", + "executor": "@nrwl/js:tsc", "outputs": ["{options.outputPath}"], "options": { "rootDir": "libs/citations/csl-to-biblatex/src", diff --git a/libs/citations/ojs-types/project.json b/libs/citations/ojs-types/project.json index 0c368482..fe01f26b 100644 --- a/libs/citations/ojs-types/project.json +++ b/libs/citations/ojs-types/project.json @@ -11,8 +11,11 @@ "packageJSON": "libs/citations/ojs-types/package.json" } }, + "make-publishable": { + "executor": "better-nx-tsc:publishable" + }, "build": { - "executor": "better-nx-tsc:tsc", + "executor": "@nrwl/js:tsc", "outputs": ["{options.outputPath}"], "options": { "rootDir": "libs/citations/ojs-types/src", diff --git a/libs/citations/parse-text-cite/project.json b/libs/citations/parse-text-cite/project.json index 0da4fa8c..aaa026f3 100755 --- a/libs/citations/parse-text-cite/project.json +++ b/libs/citations/parse-text-cite/project.json @@ -26,8 +26,11 @@ "passWithNoTests": true } }, + "make-publishable": { + "executor": "better-nx-tsc:publishable" + }, "build": { - "executor": "better-nx-tsc:tsc", + "executor": "@nrwl/js:tsc", "outputs": ["{options.outputPath}"], "options": { "rootDir": "libs/citations/parse-text-cite/src", diff --git a/libs/citations/parse-text-cite/src/lib/apa.ne b/libs/citations/parse-text-cite/src/lib/apa.ne index ab460ee7..eb5dac6b 100755 --- a/libs/citations/parse-text-cite/src/lib/apa.ne +++ b/libs/citations/parse-text-cite/src/lib/apa.ne @@ -2,7 +2,7 @@ @preprocessor typescript @{% -import {lexer} from './lexer' +import {lexer} from './lexer.js' // TODO: [parser] It's currently extremely slow for large sentences, not good. const getFullName = (name) => `${name?.['non-dropping-particle'] @@ -213,7 +213,7 @@ PreAuthsPre -> GenericContent:+ %Sem %__ {% | GenericContent:+ %Com %__ {% ([content, com, space]) => content?.join('') + com + space %} | GenericContent:+ %__ {% ([content, space]) => { return content?.join('') + space - } + } %} # Things like (...; see also Gooden, 2021; Kant, 1800) @@ -264,7 +264,7 @@ LocContent -> if(!labelMaybe || (!labelMap[labelMaybe] && !locators.includes(labelMaybe))){ return {locator: loc.join(''),label:'none'} } - + return {label: labelMap[labelMaybe] || labelMaybe, locator: locator?.join('') || loc.join('') } } %} @@ -338,7 +338,7 @@ NameList -> Name {% name=>name %} | NameList %Com %__ Etal {% ([name])=>([name].flat()) %} | NameList Etal {% ([name])=>([name].flat()) %} | NameList %Apo "s" {% ([name])=>([name, "'s"].flat()) %} - + ParenNameMaybeList -> ParenNameMaybe {% name=>name %} | ParenNameMaybeList %Com %__ Name {% ([name,,,n])=>([name,n].flat()) %} | ParenNameMaybeList %Com %__ NameList {% ([name,,,n])=>([name,n].flat()) %} diff --git a/libs/citations/parse-text-cite/src/lib/apa.ts b/libs/citations/parse-text-cite/src/lib/apa.ts index d058422f..92116d7a 100755 --- a/libs/citations/parse-text-cite/src/lib/apa.ts +++ b/libs/citations/parse-text-cite/src/lib/apa.ts @@ -2,468 +2,1051 @@ // http://github.com/Hardmath123/nearley // Bypasses TS6133. Allow declared but unused functions. // @ts-ignore -function id(d: any[]): any { return d[0]; } -declare var Rp: any; -declare var Lp: any; -declare var Year: any; -declare var __: any; -declare var Number: any; -declare var Com: any; -declare var Dot: any; -declare var Sem: any; -declare var Col: any; -declare var Amp: any; -declare var And: any; -declare var Ca: any; -declare var Quote: any; -declare var Apo: any; -declare var Slash: any; -declare var Dash: any; -declare var Punct: any; -declare var Mc: any; -declare var DutchPref: any; -declare var Cap: any; -declare var Lowword: any; -declare var NL: any; -declare var Misc: any; -declare var End: any; -declare var Et: any; -declare var Low: any; -declare var BCE: any; +function id(d: any[]): any { + return d[0] +} +declare var Rp: any +declare var Lp: any +declare var Year: any +declare var __: any +declare var Number: any +declare var Com: any +declare var Dot: any +declare var Sem: any +declare var Col: any +declare var Amp: any +declare var And: any +declare var Ca: any +declare var Quote: any +declare var Apo: any +declare var Slash: any +declare var Dash: any +declare var Punct: any +declare var Mc: any +declare var DutchPref: any +declare var Cap: any +declare var Lowword: any +declare var NL: any +declare var Misc: any +declare var End: any +declare var Et: any +declare var Low: any +declare var BCE: any -import {lexer} from './lexer' +import { lexer } from './lexer.js' // TODO: [parser] It's currently extremely slow for large sentences, not good. -const getFullName = (name) => `${name?.['non-dropping-particle'] - ? name?.['non-dropping-particle']+' ' - :''}${name.family}` - +const getFullName = (name) => + `${name?.['non-dropping-particle'] ? name?.['non-dropping-particle'] + ' ' : ''}${name.family}` const locators = [ - "act", - "appendix", - "article-locator", - "book", - "canon", - "chapter", - "column", - "elocation", - "equation", - "figure", - "folio", - "issue", - "line", - "note", - "opus", - "page", - "paragraph", - "part", - "rule", - "scene", - "section", - "sub-verbo", - "supplement", - "table", - "timestamp", - "title-locator", - "verse", - "version", - "volume" + 'act', + 'appendix', + 'article-locator', + 'book', + 'canon', + 'chapter', + 'column', + 'elocation', + 'equation', + 'figure', + 'folio', + 'issue', + 'line', + 'note', + 'opus', + 'page', + 'paragraph', + 'part', + 'rule', + 'scene', + 'section', + 'sub-verbo', + 'supplement', + 'table', + 'timestamp', + 'title-locator', + 'verse', + 'version', + 'volume', ] -const labelMap: {[key:string]:string}= { - 'p': 'page', - 'pp': 'page', - 'chapter': 'chapter', - 'ch': 'chapter', - 'sec': 'section', - 'par': 'paragraph', - 'paras': 'paragraph', - "vol": 'volume', - 'app':'appendix', - 'tab':'table', +const labelMap: { [key: string]: string } = { + p: 'page', + pp: 'page', + chapter: 'chapter', + ch: 'chapter', + sec: 'section', + par: 'paragraph', + paras: 'paragraph', + vol: 'volume', + app: 'appendix', + tab: 'table', } interface NearleyToken { - value: any; - [key: string]: any; -}; + value: any + [key: string]: any +} interface NearleyLexer { - reset: (chunk: string, info: any) => void; - next: () => NearleyToken | undefined; - save: () => any; - formatError: (token: never) => string; - has: (tokenType: string) => boolean; -}; + reset: (chunk: string, info: any) => void + next: () => NearleyToken | undefined + save: () => any + formatError: (token: never) => string + has: (tokenType: string) => boolean +} interface NearleyRule { - name: string; - symbols: NearleySymbol[]; - postprocess?: (d: any[], loc?: number, reject?: {}) => any; -}; + name: string + symbols: NearleySymbol[] + postprocess?: (d: any[], loc?: number, reject?: {}) => any +} -type NearleySymbol = string | { literal: any } | { test: (token: any) => boolean }; +type NearleySymbol = string | { literal: any } | { test: (token: any) => boolean } interface Grammar { - Lexer: NearleyLexer | undefined; - ParserRules: NearleyRule[]; - ParserStart: string; -}; + Lexer: NearleyLexer | undefined + ParserRules: NearleyRule[] + ParserStart: string +} const grammar: Grammar = { Lexer: lexer, ParserRules: [ - {"name": "Input$ebnf$1", "symbols": ["InputContent"]}, - {"name": "Input$ebnf$1", "symbols": ["Input$ebnf$1", "InputContent"], "postprocess": (d) => d[0].concat([d[1]])}, - {"name": "Input", "symbols": ["Input$ebnf$1"], "postprocess": (inp)=>{ + { name: 'Input$ebnf$1', symbols: ['InputContent'] }, + { + name: 'Input$ebnf$1', + symbols: ['Input$ebnf$1', 'InputContent'], + postprocess: (d) => d[0].concat([d[1]]), + }, + { + name: 'Input', + symbols: ['Input$ebnf$1'], + postprocess: (inp) => { const [content] = inp - return content - .reduce((acc: any[], - curr: Record - )=>{ - - if(!curr.value){ - acc.push(curr) - return acc - } - - if(typeof acc[acc.length - 1] === 'string'){ - acc[acc.length - 1] += curr.value - return acc - } - - acc.push(curr.value) - return acc - - }, []) - } - }, - {"name": "InputContent", "symbols": ["ParenCite"], "postprocess": id}, - {"name": "InputContent", "symbols": ["NarrCite"], "postprocess": id}, - {"name": "InputContent", "symbols": ["NonCiteContent"], "postprocess": id}, - {"name": "InputContent", "symbols": [(lexer.has("Rp") ? {type: "Rp"} : Rp)], "postprocess": id}, - {"name": "InputContent", "symbols": [(lexer.has("Lp") ? {type: "Lp"} : Lp)], "postprocess": id}, - {"name": "NonCiteContent", "symbols": [(lexer.has("Year") ? {type: "Year"} : Year)], "postprocess": id}, - {"name": "NonCiteContent", "symbols": ["NonYearParenContent"], "postprocess": id}, - {"name": "NonCiteContent$ebnf$1", "symbols": ["NonYearParenContent"]}, - {"name": "NonCiteContent$ebnf$1", "symbols": ["NonCiteContent$ebnf$1", "NonYearParenContent"], "postprocess": (d) => d[0].concat([d[1]])}, - {"name": "NonCiteContent", "symbols": [(lexer.has("Lp") ? {type: "Lp"} : Lp), "NonCiteContent$ebnf$1", (lexer.has("Rp") ? {type: "Rp"} : Rp)], "postprocess": ([l,c,r]) => l + c.join('') + r}, - {"name": "NonYearParenContent", "symbols": [(lexer.has("__") ? {type: "__"} : __)], "postprocess": id}, - {"name": "NonYearParenContent", "symbols": [(lexer.has("Number") ? {type: "Number"} : Number)], "postprocess": id}, - {"name": "NonYearParenContent", "symbols": [(lexer.has("Com") ? {type: "Com"} : Com)], "postprocess": id}, - {"name": "NonYearParenContent", "symbols": [(lexer.has("Dot") ? {type: "Dot"} : Dot)], "postprocess": id}, - {"name": "NonYearParenContent", "symbols": [(lexer.has("Sem") ? {type: "Sem"} : Sem)], "postprocess": id}, - {"name": "NonYearParenContent", "symbols": [(lexer.has("Col") ? {type: "Col"} : Col)], "postprocess": id}, - {"name": "NonYearParenContent", "symbols": [(lexer.has("Amp") ? {type: "Amp"} : Amp)], "postprocess": id}, - {"name": "NonYearParenContent", "symbols": [(lexer.has("And") ? {type: "And"} : And)], "postprocess": id}, - {"name": "NonYearParenContent", "symbols": [(lexer.has("Ca") ? {type: "Ca"} : Ca)], "postprocess": id}, - {"name": "NonYearParenContent", "symbols": [(lexer.has("Quote") ? {type: "Quote"} : Quote)], "postprocess": id}, - {"name": "NonYearParenContent", "symbols": [(lexer.has("Apo") ? {type: "Apo"} : Apo)], "postprocess": id}, - {"name": "NonYearParenContent", "symbols": [(lexer.has("Slash") ? {type: "Slash"} : Slash)], "postprocess": id}, - {"name": "NonYearParenContent", "symbols": [(lexer.has("Dash") ? {type: "Dash"} : Dash)], "postprocess": id}, - {"name": "NonYearParenContent", "symbols": [(lexer.has("Punct") ? {type: "Punct"} : Punct)], "postprocess": id}, - {"name": "NonYearParenContent", "symbols": [(lexer.has("Mc") ? {type: "Mc"} : Mc)], "postprocess": id}, - {"name": "NonYearParenContent", "symbols": [(lexer.has("DutchPref") ? {type: "DutchPref"} : DutchPref)], "postprocess": id}, - {"name": "NonYearParenContent", "symbols": [(lexer.has("Cap") ? {type: "Cap"} : Cap)], "postprocess": id}, - {"name": "NonYearParenContent", "symbols": [(lexer.has("Lowword") ? {type: "Lowword"} : Lowword)], "postprocess": id}, - {"name": "NonYearParenContent", "symbols": [(lexer.has("NL") ? {type: "NL"} : NL)], "postprocess": id}, - {"name": "NonYearParenContent", "symbols": [(lexer.has("Misc") ? {type: "Misc"} : Misc)], "postprocess": id}, - {"name": "NonYearParenContent", "symbols": [(lexer.has("End") ? {type: "End"} : End)], "postprocess": id}, - {"name": "NarrCite$ebnf$1", "symbols": ["Loc"], "postprocess": id}, - {"name": "NarrCite$ebnf$1", "symbols": [], "postprocess": () => null}, - {"name": "NarrCite", "symbols": ["NameList", (lexer.has("__") ? {type: "__"} : __), (lexer.has("Lp") ? {type: "Lp"} : Lp), "YearList", "NarrCite$ebnf$1", (lexer.has("Rp") ? {type: "Rp"} : Rp)], "postprocess": ([name,,,yearlist])=>( - { - citationId: 'CITE-X', - citationItems: - yearlist.map((y)=>({ - "id": getFullName(name[0]) - .replace(/ /g,'')+y[0], - itemData: { - author: name.filter(name=>typeof name === 'object'), - issued: { - 'date-parts': [[y[0] - .replace(/(\d|.-?)[a-z]/,'$1')]] - - }, - ...(y[1]? {'original-date': { - 'date-parts': [[y[1].replace(/(\d)[a-z]/,'$1')]] - } - }:{}) - } - })), - properties: {noteIndex: 0, mode: "composite", ...( name.includes("'s") ? {possessive: true} : {}) } - } - ) - }, - {"name": "ParenCite", "symbols": [(lexer.has("Lp") ? {type: "Lp"} : Lp), "ParenContent", (lexer.has("Rp") ? {type: "Rp"} : Rp)], "postprocess": ([,content,])=>{ - // This is CSL-JSON cite items - return { - citationId:"CITE-X", - citationItems: content.flat(), - properties: {"noteIndex":0} + return content.reduce((acc: any[], curr: Record) => { + if (!curr.value) { + acc.push(curr) + return acc } - } - }, - {"name": "ParenContent", "symbols": ["SingleParenEntry"], "postprocess": id}, - {"name": "ParenContent", "symbols": ["ParenContent", (lexer.has("Sem") ? {type: "Sem"} : Sem), (lexer.has("__") ? {type: "__"} : __), "SingleParenEntry"], "postprocess": - ([content, semi,,single])=> [ - ...(content.flat()), - ...single - ] - }, - {"name": "ParenContent", "symbols": ["ParenContent", "PreAuthsMiddle", "SingleParenEntry"], "postprocess": - ([content, pre, single])=>{ - //const sing = single[0] - if(pre){ - single[0].prefix = pre.join('') - } - return [ - ...(content.flat()), - ...single - ] - } - }, - {"name": "SingleParenEntry$ebnf$1", "symbols": []}, - {"name": "SingleParenEntry$ebnf$1", "symbols": ["SingleParenEntry$ebnf$1", "PreAuthsPre"], "postprocess": (d) => d[0].concat([d[1]])}, - {"name": "SingleParenEntry$ebnf$2", "symbols": ["Loc"], "postprocess": id}, - {"name": "SingleParenEntry$ebnf$2", "symbols": [], "postprocess": () => null}, - {"name": "SingleParenEntry", "symbols": ["SingleParenEntry$ebnf$1", "ParenCiteAuthYear", "SingleParenEntry$ebnf$2"], "postprocess": - ([pre, content, loc]) => { - const l = Object.assign({},loc) - const p = pre.length - ? {prefix: pre?.join('')?.replace(/ $/,'')} - : {} - - - if(content.length===1){ - content[0] = {...content[0], - ...l, - ...p} - return content + + if (typeof acc[acc.length - 1] === 'string') { + acc[acc.length - 1] += curr.value + return acc } - content[0] = {...content[0], - ...p} - content[content.length-1]={... - content[content.length-1], ...l} - return content - } - }, - {"name": "PreAuthsPre$ebnf$1", "symbols": ["GenericContent"]}, - {"name": "PreAuthsPre$ebnf$1", "symbols": ["PreAuthsPre$ebnf$1", "GenericContent"], "postprocess": (d) => d[0].concat([d[1]])}, - {"name": "PreAuthsPre", "symbols": ["PreAuthsPre$ebnf$1", (lexer.has("Sem") ? {type: "Sem"} : Sem), (lexer.has("__") ? {type: "__"} : __)], "postprocess": - ([content, sem, space]) => content?.join('') + sem + space - }, - {"name": "PreAuthsPre$ebnf$2", "symbols": ["GenericContent"]}, - {"name": "PreAuthsPre$ebnf$2", "symbols": ["PreAuthsPre$ebnf$2", "GenericContent"], "postprocess": (d) => d[0].concat([d[1]])}, - {"name": "PreAuthsPre", "symbols": ["PreAuthsPre$ebnf$2", (lexer.has("Com") ? {type: "Com"} : Com), (lexer.has("__") ? {type: "__"} : __)], "postprocess": ([content, com, space]) => content?.join('') + com + space}, - {"name": "PreAuthsPre$ebnf$3", "symbols": ["GenericContent"]}, - {"name": "PreAuthsPre$ebnf$3", "symbols": ["PreAuthsPre$ebnf$3", "GenericContent"], "postprocess": (d) => d[0].concat([d[1]])}, - {"name": "PreAuthsPre", "symbols": ["PreAuthsPre$ebnf$3", (lexer.has("__") ? {type: "__"} : __)], "postprocess": ([content, space]) => { - return content?.join('') + space - } + + acc.push(curr.value) + return acc + }, []) + }, + }, + { name: 'InputContent', symbols: ['ParenCite'], postprocess: id }, + { name: 'InputContent', symbols: ['NarrCite'], postprocess: id }, + { name: 'InputContent', symbols: ['NonCiteContent'], postprocess: id }, + { name: 'InputContent', symbols: [lexer.has('Rp') ? { type: 'Rp' } : Rp], postprocess: id }, + { name: 'InputContent', symbols: [lexer.has('Lp') ? { type: 'Lp' } : Lp], postprocess: id }, + { + name: 'NonCiteContent', + symbols: [lexer.has('Year') ? { type: 'Year' } : Year], + postprocess: id, + }, + { name: 'NonCiteContent', symbols: ['NonYearParenContent'], postprocess: id }, + { name: 'NonCiteContent$ebnf$1', symbols: ['NonYearParenContent'] }, + { + name: 'NonCiteContent$ebnf$1', + symbols: ['NonCiteContent$ebnf$1', 'NonYearParenContent'], + postprocess: (d) => d[0].concat([d[1]]), + }, + { + name: 'NonCiteContent', + symbols: [ + lexer.has('Lp') ? { type: 'Lp' } : Lp, + 'NonCiteContent$ebnf$1', + lexer.has('Rp') ? { type: 'Rp' } : Rp, + ], + postprocess: ([l, c, r]) => l + c.join('') + r, + }, + { + name: 'NonYearParenContent', + symbols: [lexer.has('__') ? { type: '__' } : __], + postprocess: id, + }, + { + name: 'NonYearParenContent', + symbols: [lexer.has('Number') ? { type: 'Number' } : Number], + postprocess: id, + }, + { + name: 'NonYearParenContent', + symbols: [lexer.has('Com') ? { type: 'Com' } : Com], + postprocess: id, + }, + { + name: 'NonYearParenContent', + symbols: [lexer.has('Dot') ? { type: 'Dot' } : Dot], + postprocess: id, + }, + { + name: 'NonYearParenContent', + symbols: [lexer.has('Sem') ? { type: 'Sem' } : Sem], + postprocess: id, + }, + { + name: 'NonYearParenContent', + symbols: [lexer.has('Col') ? { type: 'Col' } : Col], + postprocess: id, + }, + { + name: 'NonYearParenContent', + symbols: [lexer.has('Amp') ? { type: 'Amp' } : Amp], + postprocess: id, + }, + { + name: 'NonYearParenContent', + symbols: [lexer.has('And') ? { type: 'And' } : And], + postprocess: id, + }, + { + name: 'NonYearParenContent', + symbols: [lexer.has('Ca') ? { type: 'Ca' } : Ca], + postprocess: id, + }, + { + name: 'NonYearParenContent', + symbols: [lexer.has('Quote') ? { type: 'Quote' } : Quote], + postprocess: id, + }, + { + name: 'NonYearParenContent', + symbols: [lexer.has('Apo') ? { type: 'Apo' } : Apo], + postprocess: id, + }, + { + name: 'NonYearParenContent', + symbols: [lexer.has('Slash') ? { type: 'Slash' } : Slash], + postprocess: id, + }, + { + name: 'NonYearParenContent', + symbols: [lexer.has('Dash') ? { type: 'Dash' } : Dash], + postprocess: id, + }, + { + name: 'NonYearParenContent', + symbols: [lexer.has('Punct') ? { type: 'Punct' } : Punct], + postprocess: id, + }, + { + name: 'NonYearParenContent', + symbols: [lexer.has('Mc') ? { type: 'Mc' } : Mc], + postprocess: id, + }, + { + name: 'NonYearParenContent', + symbols: [lexer.has('DutchPref') ? { type: 'DutchPref' } : DutchPref], + postprocess: id, + }, + { + name: 'NonYearParenContent', + symbols: [lexer.has('Cap') ? { type: 'Cap' } : Cap], + postprocess: id, + }, + { + name: 'NonYearParenContent', + symbols: [lexer.has('Lowword') ? { type: 'Lowword' } : Lowword], + postprocess: id, + }, + { + name: 'NonYearParenContent', + symbols: [lexer.has('NL') ? { type: 'NL' } : NL], + postprocess: id, + }, + { + name: 'NonYearParenContent', + symbols: [lexer.has('Misc') ? { type: 'Misc' } : Misc], + postprocess: id, + }, + { + name: 'NonYearParenContent', + symbols: [lexer.has('End') ? { type: 'End' } : End], + postprocess: id, + }, + { name: 'NarrCite$ebnf$1', symbols: ['Loc'], postprocess: id }, + { name: 'NarrCite$ebnf$1', symbols: [], postprocess: () => null }, + { + name: 'NarrCite', + symbols: [ + 'NameList', + lexer.has('__') ? { type: '__' } : __, + lexer.has('Lp') ? { type: 'Lp' } : Lp, + 'YearList', + 'NarrCite$ebnf$1', + lexer.has('Rp') ? { type: 'Rp' } : Rp, + ], + postprocess: ([name, , , yearlist]) => ({ + citationId: 'CITE-X', + citationItems: yearlist.map((y) => ({ + id: getFullName(name[0]).replace(/ /g, '') + y[0], + itemData: { + author: name.filter((name) => typeof name === 'object'), + issued: { + 'date-parts': [[y[0].replace(/(\d|.-?)[a-z]/, '$1')]], + }, + ...(y[1] + ? { + 'original-date': { + 'date-parts': [[y[1].replace(/(\d)[a-z]/, '$1')]], + }, + } + : {}), + }, + })), + properties: { + noteIndex: 0, + mode: 'composite', + ...(name.includes("'s") ? { possessive: true } : {}), }, - {"name": "PreAuthsMiddle$ebnf$1", "symbols": ["GenericContent"]}, - {"name": "PreAuthsMiddle$ebnf$1", "symbols": ["PreAuthsMiddle$ebnf$1", "GenericContent"], "postprocess": (d) => d[0].concat([d[1]])}, - {"name": "PreAuthsMiddle", "symbols": [(lexer.has("Sem") ? {type: "Sem"} : Sem), (lexer.has("__") ? {type: "__"} : __), "PreAuthsMiddle$ebnf$1"], "postprocess": - content=> { - return content[2] - } - }, - {"name": "Loc", "symbols": [(lexer.has("Com") ? {type: "Com"} : Com), (lexer.has("__") ? {type: "__"} : __), "LocContent"], "postprocess": ([,,loc])=>loc}, - {"name": "LocContent$ebnf$1", "symbols": ["LocGenericContent"]}, - {"name": "LocContent$ebnf$1", "symbols": ["LocContent$ebnf$1", "LocGenericContent"], "postprocess": (d) => d[0].concat([d[1]])}, - {"name": "LocContent$ebnf$2", "symbols": ["LocGenericContent"]}, - {"name": "LocContent$ebnf$2", "symbols": ["LocContent$ebnf$2", "LocGenericContent"], "postprocess": (d) => d[0].concat([d[1]])}, - {"name": "LocContent", "symbols": ["LocContent$ebnf$1", (lexer.has("__") ? {type: "__"} : __), "LocContent$ebnf$2"], "postprocess": ([label,space,loc]) => { - const rawLabel=label - .join('') - .trim() - .toLowerCase() - .replace(/\./g,'') - - if(!(labelMap[rawLabel]) - && !locators.includes(rawLabel)){ - return { - label:'none', - locator: label - .join('') - + space + - loc - .join('') - } - } - - const properLabel = labelMap[rawLabel] || rawLabel - - return { - label: properLabel, - locator: loc.join('').trim() - } + }), + }, + { + name: 'ParenCite', + symbols: [ + lexer.has('Lp') ? { type: 'Lp' } : Lp, + 'ParenContent', + lexer.has('Rp') ? { type: 'Rp' } : Rp, + ], + postprocess: ([, content]) => { + // This is CSL-JSON cite items + return { + citationId: 'CITE-X', + citationItems: content.flat(), + properties: { noteIndex: 0 }, + } + }, + }, + { name: 'ParenContent', symbols: ['SingleParenEntry'], postprocess: id }, + { + name: 'ParenContent', + symbols: [ + 'ParenContent', + lexer.has('Sem') ? { type: 'Sem' } : Sem, + lexer.has('__') ? { type: '__' } : __, + 'SingleParenEntry', + ], + postprocess: ([content, semi, , single]) => [...content.flat(), ...single], + }, + { + name: 'ParenContent', + symbols: ['ParenContent', 'PreAuthsMiddle', 'SingleParenEntry'], + postprocess: ([content, pre, single]) => { + //const sing = single[0] + if (pre) { + single[0].prefix = pre.join('') + } + return [...content.flat(), ...single] + }, + }, + { name: 'SingleParenEntry$ebnf$1', symbols: [] }, + { + name: 'SingleParenEntry$ebnf$1', + symbols: ['SingleParenEntry$ebnf$1', 'PreAuthsPre'], + postprocess: (d) => d[0].concat([d[1]]), + }, + { name: 'SingleParenEntry$ebnf$2', symbols: ['Loc'], postprocess: id }, + { name: 'SingleParenEntry$ebnf$2', symbols: [], postprocess: () => null }, + { + name: 'SingleParenEntry', + symbols: ['SingleParenEntry$ebnf$1', 'ParenCiteAuthYear', 'SingleParenEntry$ebnf$2'], + postprocess: ([pre, content, loc]) => { + const l = Object.assign({}, loc) + const p = pre.length ? { prefix: pre?.join('')?.replace(/ $/, '') } : {} + + if (content.length === 1) { + content[0] = { ...content[0], ...l, ...p } + return content } - }, - {"name": "LocContent$ebnf$3", "symbols": ["LocGenericContent"]}, - {"name": "LocContent$ebnf$3", "symbols": ["LocContent$ebnf$3", "LocGenericContent"], "postprocess": (d) => d[0].concat([d[1]])}, - {"name": "LocContent", "symbols": ["LocContent$ebnf$3"], "postprocess": ([loc]) => { - const [maybeLabel, ...locator] = loc?.join('')?.split(' ') - const labelMaybe = maybeLabel.trim()?.toLowerCase()?.replace(/\./g,'') - if(!labelMaybe || (!labelMap[labelMaybe] && !locators.includes(labelMaybe))){ - return {locator: loc.join(''),label:'none'} + content[0] = { ...content[0], ...p } + content[content.length - 1] = { ...content[content.length - 1], ...l } + return content + }, + }, + { name: 'PreAuthsPre$ebnf$1', symbols: ['GenericContent'] }, + { + name: 'PreAuthsPre$ebnf$1', + symbols: ['PreAuthsPre$ebnf$1', 'GenericContent'], + postprocess: (d) => d[0].concat([d[1]]), + }, + { + name: 'PreAuthsPre', + symbols: [ + 'PreAuthsPre$ebnf$1', + lexer.has('Sem') ? { type: 'Sem' } : Sem, + lexer.has('__') ? { type: '__' } : __, + ], + postprocess: ([content, sem, space]) => content?.join('') + sem + space, + }, + { name: 'PreAuthsPre$ebnf$2', symbols: ['GenericContent'] }, + { + name: 'PreAuthsPre$ebnf$2', + symbols: ['PreAuthsPre$ebnf$2', 'GenericContent'], + postprocess: (d) => d[0].concat([d[1]]), + }, + { + name: 'PreAuthsPre', + symbols: [ + 'PreAuthsPre$ebnf$2', + lexer.has('Com') ? { type: 'Com' } : Com, + lexer.has('__') ? { type: '__' } : __, + ], + postprocess: ([content, com, space]) => content?.join('') + com + space, + }, + { name: 'PreAuthsPre$ebnf$3', symbols: ['GenericContent'] }, + { + name: 'PreAuthsPre$ebnf$3', + symbols: ['PreAuthsPre$ebnf$3', 'GenericContent'], + postprocess: (d) => d[0].concat([d[1]]), + }, + { + name: 'PreAuthsPre', + symbols: ['PreAuthsPre$ebnf$3', lexer.has('__') ? { type: '__' } : __], + postprocess: ([content, space]) => { + return content?.join('') + space + }, + }, + { name: 'PreAuthsMiddle$ebnf$1', symbols: ['GenericContent'] }, + { + name: 'PreAuthsMiddle$ebnf$1', + symbols: ['PreAuthsMiddle$ebnf$1', 'GenericContent'], + postprocess: (d) => d[0].concat([d[1]]), + }, + { + name: 'PreAuthsMiddle', + symbols: [ + lexer.has('Sem') ? { type: 'Sem' } : Sem, + lexer.has('__') ? { type: '__' } : __, + 'PreAuthsMiddle$ebnf$1', + ], + postprocess: (content) => { + return content[2] + }, + }, + { + name: 'Loc', + symbols: [ + lexer.has('Com') ? { type: 'Com' } : Com, + lexer.has('__') ? { type: '__' } : __, + 'LocContent', + ], + postprocess: ([, , loc]) => loc, + }, + { name: 'LocContent$ebnf$1', symbols: ['LocGenericContent'] }, + { + name: 'LocContent$ebnf$1', + symbols: ['LocContent$ebnf$1', 'LocGenericContent'], + postprocess: (d) => d[0].concat([d[1]]), + }, + { name: 'LocContent$ebnf$2', symbols: ['LocGenericContent'] }, + { + name: 'LocContent$ebnf$2', + symbols: ['LocContent$ebnf$2', 'LocGenericContent'], + postprocess: (d) => d[0].concat([d[1]]), + }, + { + name: 'LocContent', + symbols: ['LocContent$ebnf$1', lexer.has('__') ? { type: '__' } : __, 'LocContent$ebnf$2'], + postprocess: ([label, space, loc]) => { + const rawLabel = label.join('').trim().toLowerCase().replace(/\./g, '') + + if (!labelMap[rawLabel] && !locators.includes(rawLabel)) { + return { + label: 'none', + locator: label.join('') + space + loc.join(''), } - - return {label: labelMap[labelMaybe] || labelMaybe, locator: locator?.join('') || loc.join('') } } - }, - {"name": "LocGenericContent", "symbols": ["GenericContent"], "postprocess": content => content}, - {"name": "LocGenericContent", "symbols": [(lexer.has("Cap") ? {type: "Cap"} : Cap), (lexer.has("Lowword") ? {type: "Lowword"} : Lowword), "LocGenericContent"], "postprocess": ([cap,low,rest])=> [cap+low+rest.join('')]}, - {"name": "LocGenericContent", "symbols": [(lexer.has("Cap") ? {type: "Cap"} : Cap), (lexer.has("Lowword") ? {type: "Lowword"} : Lowword)], "postprocess": ([cap,low])=> [cap+low]}, - {"name": "LocGenericContent", "symbols": ["LocGenericContent", "Year"], "postprocess": ([content, year]) => `${content}${year}`}, - {"name": "GenericContent", "symbols": [(lexer.has("Lowword") ? {type: "Lowword"} : Lowword)], "postprocess": id}, - {"name": "GenericContent$ebnf$1", "symbols": [(lexer.has("Cap") ? {type: "Cap"} : Cap)]}, - {"name": "GenericContent$ebnf$1", "symbols": ["GenericContent$ebnf$1", (lexer.has("Cap") ? {type: "Cap"} : Cap)], "postprocess": (d) => d[0].concat([d[1]])}, - {"name": "GenericContent", "symbols": [(lexer.has("Cap") ? {type: "Cap"} : Cap), "GenericContent$ebnf$1"], "postprocess": ([cap,caps]) => cap+caps.join('')}, - {"name": "GenericContent", "symbols": [(lexer.has("Cap") ? {type: "Cap"} : Cap), (lexer.has("__") ? {type: "__"} : __)], "postprocess": content=>content.join('')}, - {"name": "GenericContent", "symbols": ["GenericContent", (lexer.has("Cap") ? {type: "Cap"} : Cap), (lexer.has("Lowword") ? {type: "Lowword"} : Lowword)], "postprocess": content=>content.join('')}, - {"name": "GenericContent$ebnf$2$subexpression$1", "symbols": [(lexer.has("Cap") ? {type: "Cap"} : Cap), (lexer.has("Dot") ? {type: "Dot"} : Dot)]}, - {"name": "GenericContent$ebnf$2", "symbols": ["GenericContent$ebnf$2$subexpression$1"]}, - {"name": "GenericContent$ebnf$2$subexpression$2", "symbols": [(lexer.has("Cap") ? {type: "Cap"} : Cap), (lexer.has("Dot") ? {type: "Dot"} : Dot)]}, - {"name": "GenericContent$ebnf$2", "symbols": ["GenericContent$ebnf$2", "GenericContent$ebnf$2$subexpression$2"], "postprocess": (d) => d[0].concat([d[1]])}, - {"name": "GenericContent", "symbols": [(lexer.has("Cap") ? {type: "Cap"} : Cap), (lexer.has("Dot") ? {type: "Dot"} : Dot), "GenericContent$ebnf$2"], "postprocess": ([c,d,content])=>c+d+content.flat().join('')}, - {"name": "GenericContent", "symbols": [(lexer.has("Col") ? {type: "Col"} : Col)], "postprocess": id}, - {"name": "GenericContent", "symbols": [(lexer.has("Number") ? {type: "Number"} : Number)], "postprocess": id}, - {"name": "GenericContent", "symbols": [(lexer.has("Dot") ? {type: "Dot"} : Dot)], "postprocess": id}, - {"name": "GenericContent", "symbols": [(lexer.has("Dash") ? {type: "Dash"} : Dash)], "postprocess": id}, - {"name": "GenericContent", "symbols": [(lexer.has("Com") ? {type: "Com"} : Com)], "postprocess": id}, - {"name": "GenericContent", "symbols": [(lexer.has("Quote") ? {type: "Quote"} : Quote)], "postprocess": id}, - {"name": "GenericContent", "symbols": [(lexer.has("__") ? {type: "__"} : __)], "postprocess": id}, - {"name": "GenericContent", "symbols": [{"literal":"and"}], "postprocess": id}, - {"name": "ParenCiteAuthYear", "symbols": ["ParenNameMaybeList", (lexer.has("Com") ? {type: "Com"} : Com), (lexer.has("__") ? {type: "__"} : __), "YearList"], "postprocess": (content) => { - const [name,,,yearlist] = content - return yearlist.map((y)=>({ - "id":getFullName(name[0]).replace(/ /g,'')+y[0], - itemData:{ - author: name, - issued: { - 'date-parts': [[y[0].replace(/(\d)[a-z]/,'$1')]] - }, - ...(y[1]? {'original-date': { - 'date-parts': [[y[1].replace(/(\d)[a-z]/,'$1')]] - } - }:{}) - } - })) + + const properLabel = labelMap[rawLabel] || rawLabel + + return { + label: properLabel, + locator: loc.join('').trim(), } - }, - {"name": "YearList", "symbols": ["Year"], "postprocess": year=>year}, - {"name": "YearList$ebnf$1", "symbols": [(lexer.has("__") ? {type: "__"} : __)]}, - {"name": "YearList$ebnf$1", "symbols": ["YearList$ebnf$1", (lexer.has("__") ? {type: "__"} : __)], "postprocess": (d) => d[0].concat([d[1]])}, - {"name": "YearList", "symbols": ["YearList", (lexer.has("Com") ? {type: "Com"} : Com), "YearList$ebnf$1", "Year"], "postprocess": ([list,,,year])=> { - return [...list,year] + }, + }, + { name: 'LocContent$ebnf$3', symbols: ['LocGenericContent'] }, + { + name: 'LocContent$ebnf$3', + symbols: ['LocContent$ebnf$3', 'LocGenericContent'], + postprocess: (d) => d[0].concat([d[1]]), + }, + { + name: 'LocContent', + symbols: ['LocContent$ebnf$3'], + postprocess: ([loc]) => { + const [maybeLabel, ...locator] = loc?.join('')?.split(' ') + const labelMaybe = maybeLabel.trim()?.toLowerCase()?.replace(/\./g, '') + if (!labelMaybe || (!labelMap[labelMaybe] && !locators.includes(labelMaybe))) { + return { locator: loc.join(''), label: 'none' } } - }, - {"name": "NameList", "symbols": ["Name"], "postprocess": name=>name}, - {"name": "NameList$ebnf$1", "symbols": [(lexer.has("Com") ? {type: "Com"} : Com)], "postprocess": id}, - {"name": "NameList$ebnf$1", "symbols": [], "postprocess": () => null}, - {"name": "NameList", "symbols": ["Name", (lexer.has("Com") ? {type: "Com"} : Com), (lexer.has("__") ? {type: "__"} : __), "Name", (lexer.has("Com") ? {type: "Com"} : Com), (lexer.has("__") ? {type: "__"} : __), "Name", "NameList$ebnf$1", (lexer.has("__") ? {type: "__"} : __), "Comp", (lexer.has("__") ? {type: "__"} : __), "NameList"], "postprocess": ([name,,,nametwo,,,namethree,,,,,namefour])=>([name,nametwo,namethree,namefour].flat())}, - {"name": "NameList$ebnf$2", "symbols": [(lexer.has("Com") ? {type: "Com"} : Com)], "postprocess": id}, - {"name": "NameList$ebnf$2", "symbols": [], "postprocess": () => null}, - {"name": "NameList", "symbols": ["Name", (lexer.has("Com") ? {type: "Com"} : Com), (lexer.has("__") ? {type: "__"} : __), "Name", "NameList$ebnf$2", (lexer.has("__") ? {type: "__"} : __), "Comp", (lexer.has("__") ? {type: "__"} : __), "NameList"], "postprocess": ([name,,,n,,,,,nn])=>([name,n,nn].flat())}, - {"name": "NameList", "symbols": ["NameList", (lexer.has("Com") ? {type: "Com"} : Com), (lexer.has("__") ? {type: "__"} : __), "Comp", (lexer.has("__") ? {type: "__"} : __), "NameList"], "postprocess": ([name,,,,,n])=>([name,n].flat())}, - {"name": "NameList", "symbols": ["NameList", (lexer.has("Com") ? {type: "Com"} : Com), (lexer.has("__") ? {type: "__"} : __), "Comp", (lexer.has("__") ? {type: "__"} : __)], "postprocess": ([name,,,,])=>([name].flat())}, - {"name": "NameList", "symbols": ["NameList", "Comp", (lexer.has("__") ? {type: "__"} : __), "NameList"], "postprocess": ([name,,,,])=>([name].flat())}, - {"name": "NameList", "symbols": ["NameList", (lexer.has("__") ? {type: "__"} : __), "Comp", (lexer.has("__") ? {type: "__"} : __), "Name"], "postprocess": ([name,_,and,,n])=>([name,n].flat())}, - {"name": "NameList", "symbols": ["NameList", (lexer.has("__") ? {type: "__"} : __), "Comp", (lexer.has("__") ? {type: "__"} : __)], "postprocess": ([name])=>([name].flat())}, - {"name": "NameList", "symbols": ["NameList", (lexer.has("Com") ? {type: "Com"} : Com), (lexer.has("__") ? {type: "__"} : __), "Etal"], "postprocess": ([name])=>([name].flat())}, - {"name": "NameList", "symbols": ["NameList", "Etal"], "postprocess": ([name])=>([name].flat())}, - {"name": "NameList", "symbols": ["NameList", (lexer.has("Apo") ? {type: "Apo"} : Apo), {"literal":"s"}], "postprocess": ([name])=>([name, "'s"].flat())}, - {"name": "ParenNameMaybeList", "symbols": ["ParenNameMaybe"], "postprocess": name=>name}, - {"name": "ParenNameMaybeList", "symbols": ["ParenNameMaybeList", (lexer.has("Com") ? {type: "Com"} : Com), (lexer.has("__") ? {type: "__"} : __), "Name"], "postprocess": ([name,,,n])=>([name,n].flat())}, - {"name": "ParenNameMaybeList", "symbols": ["ParenNameMaybeList", (lexer.has("Com") ? {type: "Com"} : Com), (lexer.has("__") ? {type: "__"} : __), "NameList"], "postprocess": ([name,,,n])=>([name,n].flat())}, - {"name": "ParenNameMaybeList", "symbols": ["ParenNameMaybeList", (lexer.has("Com") ? {type: "Com"} : Com), (lexer.has("__") ? {type: "__"} : __), "Comp", (lexer.has("__") ? {type: "__"} : __), "NameList"], "postprocess": ([name,,,,,n])=>([name,n].flat())}, - {"name": "ParenNameMaybeList", "symbols": ["ParenNameMaybeList", (lexer.has("Com") ? {type: "Com"} : Com), (lexer.has("__") ? {type: "__"} : __), "Comp", (lexer.has("__") ? {type: "__"} : __)], "postprocess": ([name])=>([name].flat())}, - {"name": "ParenNameMaybeList", "symbols": ["ParenNameMaybeList", (lexer.has("__") ? {type: "__"} : __), "Comp", (lexer.has("__") ? {type: "__"} : __), "NameList"], "postprocess": ([name,,,,n])=>([name,n].flat())}, - {"name": "ParenNameMaybeList", "symbols": ["ParenNameMaybeList", (lexer.has("__") ? {type: "__"} : __), "Comp", (lexer.has("__") ? {type: "__"} : __)], "postprocess": ([name])=>([name].flat())}, - {"name": "ParenNameMaybe", "symbols": ["Name"], "postprocess": id}, - {"name": "ParenNameMaybe", "symbols": ["Name", "Etal"], "postprocess": ([n])=>n}, - {"name": "ParenNameMaybe", "symbols": ["ParenNameMaybe", (lexer.has("__") ? {type: "__"} : __), "ParenNameMaybe"], "postprocess": ([n,,nn]) => ({...n,...nn,family:n.family+nn.family})}, - {"name": "ParenNameMaybe", "symbols": ["ParenNameMaybe", (lexer.has("__") ? {type: "__"} : __), (lexer.has("Lowword") ? {type: "Lowword"} : Lowword)], "postprocess": ([n,,nn]) => ({...n,family:n.family+nn})}, - {"name": "Etal$ebnf$1", "symbols": [(lexer.has("__") ? {type: "__"} : __)], "postprocess": id}, - {"name": "Etal$ebnf$1", "symbols": [], "postprocess": () => null}, - {"name": "Etal", "symbols": ["Etal$ebnf$1", (lexer.has("Et") ? {type: "Et"} : Et)], "postprocess": etal=>null}, - {"name": "Name", "symbols": ["Initials", (lexer.has("__") ? {type: "__"} : __), "LastName"], "postprocess": ([initials, ,name])=> ({given: initials.join(''),...name})}, - {"name": "Name", "symbols": ["LastName"], "postprocess": id}, - {"name": "LastName", "symbols": ["SingleName"], "postprocess": id}, - {"name": "LastName", "symbols": ["HyphenName"], "postprocess": id}, - {"name": "LastName", "symbols": ["AbbrevName"], "postprocess": id}, - {"name": "AbbrevName$ebnf$1", "symbols": [(lexer.has("Cap") ? {type: "Cap"} : Cap)]}, - {"name": "AbbrevName$ebnf$1", "symbols": ["AbbrevName$ebnf$1", (lexer.has("Cap") ? {type: "Cap"} : Cap)], "postprocess": (d) => d[0].concat([d[1]])}, - {"name": "AbbrevName", "symbols": ["AbbrevName$ebnf$1", (lexer.has("Cap") ? {type: "Cap"} : Cap)], "postprocess": ([caps,cap])=> ({family: `${caps.join('')}${cap}`})}, - {"name": "Comp", "symbols": [(lexer.has("And") ? {type: "And"} : And)], "postprocess": id}, - {"name": "Comp", "symbols": [(lexer.has("Amp") ? {type: "Amp"} : Amp)], "postprocess": id}, - {"name": "HyphenName", "symbols": ["SingleName", (lexer.has("Dash") ? {type: "Dash"} : Dash), "SingleName"], "postprocess": ([first,d,last])=> ( { - family: `${getFullName(first) - + d - + getFullName(last)}` - } - ) - }, - {"name": "SingleName", "symbols": ["BoringNameMaybe"], "postprocess": ([name]) => ({family:name})}, - {"name": "SingleName", "symbols": ["DutchName"], "postprocess": id}, - {"name": "SingleName", "symbols": ["OReilly"], "postprocess": id}, - {"name": "SingleName", "symbols": ["McConnel"], "postprocess": id}, - {"name": "SingleName", "symbols": ["SpanishName"], "postprocess": id}, - {"name": "Initials", "symbols": ["Initial"]}, - {"name": "Initials$ebnf$1", "symbols": []}, - {"name": "Initials$ebnf$1", "symbols": ["Initials$ebnf$1", (lexer.has("__") ? {type: "__"} : __)], "postprocess": (d) => d[0].concat([d[1]])}, - {"name": "Initials", "symbols": ["Initials", "Initials$ebnf$1", "Initial"]}, - {"name": "Initial", "symbols": [(lexer.has("Cap") ? {type: "Cap"} : Cap), (lexer.has("Dot") ? {type: "Dot"} : Dot)], "postprocess": id}, - {"name": "SpanishName", "symbols": ["BoringNameMaybe", (lexer.has("__") ? {type: "__"} : __), "BoringNameMaybe"], "postprocess": - ([first,,last]) => ({ - family: `${first} ${last}` - }) - }, - {"name": "DutchName", "symbols": ["DutchPrefix", (lexer.has("__") ? {type: "__"} : __), "BoringNameMaybe"], "postprocess": ([pref,space, rest]) => { - return { - family: rest, - 'non-dropping-particle': pref - .join('') - } + + return { + label: labelMap[labelMaybe] || labelMaybe, + locator: locator?.join('') || loc.join(''), } - }, - {"name": "OReilly", "symbols": ["BoringNameMaybe", {"literal":"'"}, "BoringNameMaybe"], "postprocess": ([o, a, name]) =>({family:o+a+name })}, - {"name": "OReilly", "symbols": ["BoringNameMaybe", {"literal":"’"}, "BoringNameMaybe"], "postprocess": ([o, a, name]) =>({family:o+a+name })}, - {"name": "McConnel", "symbols": [(lexer.has("Mc") ? {type: "Mc"} : Mc), "BoringNameMaybe"], "postprocess": (name) =>({family:name.join('')})}, - {"name": "McConnel$ebnf$1", "symbols": [(lexer.has("Lowword") ? {type: "Lowword"} : Lowword)]}, - {"name": "McConnel$ebnf$1", "symbols": ["McConnel$ebnf$1", (lexer.has("Lowword") ? {type: "Lowword"} : Lowword)], "postprocess": (d) => d[0].concat([d[1]])}, - {"name": "McConnel", "symbols": [(lexer.has("Mc") ? {type: "Mc"} : Mc), "McConnel$ebnf$1"], "postprocess": ([mac, low]) =>({family:[mac, low.join('')].join('')})}, - {"name": "BoringNameMaybe$ebnf$1", "symbols": []}, - {"name": "BoringNameMaybe$ebnf$1", "symbols": ["BoringNameMaybe$ebnf$1", (lexer.has("Lowword") ? {type: "Lowword"} : Lowword)], "postprocess": (d) => d[0].concat([d[1]])}, - {"name": "BoringNameMaybe", "symbols": [(lexer.has("Cap") ? {type: "Cap"} : Cap), "BoringNameMaybe$ebnf$1"], "postprocess": ([cap, rest]) =>( `${cap}${rest.join('')}`)}, - {"name": "BoringNameMaybe$ebnf$2", "symbols": [(lexer.has("Lowword") ? {type: "Lowword"} : Lowword)]}, - {"name": "BoringNameMaybe$ebnf$2", "symbols": ["BoringNameMaybe$ebnf$2", (lexer.has("Lowword") ? {type: "Lowword"} : Lowword)], "postprocess": (d) => d[0].concat([d[1]])}, - {"name": "BoringNameMaybe$ebnf$3", "symbols": []}, - {"name": "BoringNameMaybe$ebnf$3", "symbols": ["BoringNameMaybe$ebnf$3", (lexer.has("Lowword") ? {type: "Lowword"} : Lowword)], "postprocess": (d) => d[0].concat([d[1]])}, - {"name": "BoringNameMaybe", "symbols": [(lexer.has("Cap") ? {type: "Cap"} : Cap), "BoringNameMaybe$ebnf$2", (lexer.has("Cap") ? {type: "Cap"} : Cap), "BoringNameMaybe$ebnf$3"], "postprocess": ([cap, low, capp, loww]) =>( `${cap}${low.join('')}${capp}${loww.join('')}`)}, - {"name": "BoringWord$ebnf$1", "symbols": [(lexer.has("Low") ? {type: "Low"} : Low)]}, - {"name": "BoringWord$ebnf$1", "symbols": ["BoringWord$ebnf$1", (lexer.has("Low") ? {type: "Low"} : Low)], "postprocess": (d) => d[0].concat([d[1]])}, - {"name": "BoringWord", "symbols": ["BoringWord$ebnf$1"], "postprocess": (word) =>(word.join(''))}, - {"name": "DutchPrefix", "symbols": [(lexer.has("DutchPref") ? {type: "DutchPref"} : DutchPref)]}, - {"name": "DutchPrefix", "symbols": ["DutchPrefix", (lexer.has("__") ? {type: "__"} : __), (lexer.has("DutchPref") ? {type: "DutchPref"} : DutchPref)]}, - {"name": "Year", "symbols": [(lexer.has("Year") ? {type: "Year"} : Year)], "postprocess": ([year]) => ([`${year}`.replace(/\./g,'').toUpperCase()])}, - {"name": "Year$ebnf$1", "symbols": [(lexer.has("Dash") ? {type: "Dash"} : Dash)], "postprocess": id}, - {"name": "Year$ebnf$1", "symbols": [], "postprocess": () => null}, - {"name": "Year", "symbols": [(lexer.has("Year") ? {type: "Year"} : Year), "Year$ebnf$1", (lexer.has("Lowword") ? {type: "Lowword"} : Lowword)], "postprocess": ([year,, low])=> ([year + low])}, - {"name": "Year", "symbols": ["Year", (lexer.has("Slash") ? {type: "Slash"} : Slash), "Year"], "postprocess": (content) => {const[year, sl, year2]=content - return([...year2,...year])} - }, - {"name": "Year$ebnf$2", "symbols": [(lexer.has("Number") ? {type: "Number"} : Number)]}, - {"name": "Year$ebnf$2", "symbols": ["Year$ebnf$2", (lexer.has("Number") ? {type: "Number"} : Number)], "postprocess": (d) => d[0].concat([d[1]])}, - {"name": "Year$ebnf$3", "symbols": []}, - {"name": "Year$ebnf$3", "symbols": ["Year$ebnf$3", (lexer.has("__") ? {type: "__"} : __)], "postprocess": (d) => d[0].concat([d[1]])}, - {"name": "Year", "symbols": ["Year$ebnf$2", "Year$ebnf$3", (lexer.has("BCE") ? {type: "BCE"} : BCE)], "postprocess": ([num,,rest])=> ([`${/b\.?c\.?/i.test(rest) ? '-' : ''}${num}`])}, - {"name": "Year", "symbols": [(lexer.has("Ca") ? {type: "Ca"} : Ca), (lexer.has("__") ? {type: "__"} : __), "Year"], "postprocess": ([ca,,year])=> ([`${year}`])} + }, + }, + { name: 'LocGenericContent', symbols: ['GenericContent'], postprocess: (content) => content }, + { + name: 'LocGenericContent', + symbols: [ + lexer.has('Cap') ? { type: 'Cap' } : Cap, + lexer.has('Lowword') ? { type: 'Lowword' } : Lowword, + 'LocGenericContent', + ], + postprocess: ([cap, low, rest]) => [cap + low + rest.join('')], + }, + { + name: 'LocGenericContent', + symbols: [ + lexer.has('Cap') ? { type: 'Cap' } : Cap, + lexer.has('Lowword') ? { type: 'Lowword' } : Lowword, + ], + postprocess: ([cap, low]) => [cap + low], + }, + { + name: 'LocGenericContent', + symbols: ['LocGenericContent', 'Year'], + postprocess: ([content, year]) => `${content}${year}`, + }, + { + name: 'GenericContent', + symbols: [lexer.has('Lowword') ? { type: 'Lowword' } : Lowword], + postprocess: id, + }, + { name: 'GenericContent$ebnf$1', symbols: [lexer.has('Cap') ? { type: 'Cap' } : Cap] }, + { + name: 'GenericContent$ebnf$1', + symbols: ['GenericContent$ebnf$1', lexer.has('Cap') ? { type: 'Cap' } : Cap], + postprocess: (d) => d[0].concat([d[1]]), + }, + { + name: 'GenericContent', + symbols: [lexer.has('Cap') ? { type: 'Cap' } : Cap, 'GenericContent$ebnf$1'], + postprocess: ([cap, caps]) => cap + caps.join(''), + }, + { + name: 'GenericContent', + symbols: [lexer.has('Cap') ? { type: 'Cap' } : Cap, lexer.has('__') ? { type: '__' } : __], + postprocess: (content) => content.join(''), + }, + { + name: 'GenericContent', + symbols: [ + 'GenericContent', + lexer.has('Cap') ? { type: 'Cap' } : Cap, + lexer.has('Lowword') ? { type: 'Lowword' } : Lowword, + ], + postprocess: (content) => content.join(''), + }, + { + name: 'GenericContent$ebnf$2$subexpression$1', + symbols: [lexer.has('Cap') ? { type: 'Cap' } : Cap, lexer.has('Dot') ? { type: 'Dot' } : Dot], + }, + { name: 'GenericContent$ebnf$2', symbols: ['GenericContent$ebnf$2$subexpression$1'] }, + { + name: 'GenericContent$ebnf$2$subexpression$2', + symbols: [lexer.has('Cap') ? { type: 'Cap' } : Cap, lexer.has('Dot') ? { type: 'Dot' } : Dot], + }, + { + name: 'GenericContent$ebnf$2', + symbols: ['GenericContent$ebnf$2', 'GenericContent$ebnf$2$subexpression$2'], + postprocess: (d) => d[0].concat([d[1]]), + }, + { + name: 'GenericContent', + symbols: [ + lexer.has('Cap') ? { type: 'Cap' } : Cap, + lexer.has('Dot') ? { type: 'Dot' } : Dot, + 'GenericContent$ebnf$2', + ], + postprocess: ([c, d, content]) => c + d + content.flat().join(''), + }, + { + name: 'GenericContent', + symbols: [lexer.has('Col') ? { type: 'Col' } : Col], + postprocess: id, + }, + { + name: 'GenericContent', + symbols: [lexer.has('Number') ? { type: 'Number' } : Number], + postprocess: id, + }, + { + name: 'GenericContent', + symbols: [lexer.has('Dot') ? { type: 'Dot' } : Dot], + postprocess: id, + }, + { + name: 'GenericContent', + symbols: [lexer.has('Dash') ? { type: 'Dash' } : Dash], + postprocess: id, + }, + { + name: 'GenericContent', + symbols: [lexer.has('Com') ? { type: 'Com' } : Com], + postprocess: id, + }, + { + name: 'GenericContent', + symbols: [lexer.has('Quote') ? { type: 'Quote' } : Quote], + postprocess: id, + }, + { name: 'GenericContent', symbols: [lexer.has('__') ? { type: '__' } : __], postprocess: id }, + { name: 'GenericContent', symbols: [{ literal: 'and' }], postprocess: id }, + { + name: 'ParenCiteAuthYear', + symbols: [ + 'ParenNameMaybeList', + lexer.has('Com') ? { type: 'Com' } : Com, + lexer.has('__') ? { type: '__' } : __, + 'YearList', + ], + postprocess: (content) => { + const [name, , , yearlist] = content + return yearlist.map((y) => ({ + id: getFullName(name[0]).replace(/ /g, '') + y[0], + itemData: { + author: name, + issued: { + 'date-parts': [[y[0].replace(/(\d)[a-z]/, '$1')]], + }, + ...(y[1] + ? { + 'original-date': { + 'date-parts': [[y[1].replace(/(\d)[a-z]/, '$1')]], + }, + } + : {}), + }, + })) + }, + }, + { name: 'YearList', symbols: ['Year'], postprocess: (year) => year }, + { name: 'YearList$ebnf$1', symbols: [lexer.has('__') ? { type: '__' } : __] }, + { + name: 'YearList$ebnf$1', + symbols: ['YearList$ebnf$1', lexer.has('__') ? { type: '__' } : __], + postprocess: (d) => d[0].concat([d[1]]), + }, + { + name: 'YearList', + symbols: ['YearList', lexer.has('Com') ? { type: 'Com' } : Com, 'YearList$ebnf$1', 'Year'], + postprocess: ([list, , , year]) => { + return [...list, year] + }, + }, + { name: 'NameList', symbols: ['Name'], postprocess: (name) => name }, + { + name: 'NameList$ebnf$1', + symbols: [lexer.has('Com') ? { type: 'Com' } : Com], + postprocess: id, + }, + { name: 'NameList$ebnf$1', symbols: [], postprocess: () => null }, + { + name: 'NameList', + symbols: [ + 'Name', + lexer.has('Com') ? { type: 'Com' } : Com, + lexer.has('__') ? { type: '__' } : __, + 'Name', + lexer.has('Com') ? { type: 'Com' } : Com, + lexer.has('__') ? { type: '__' } : __, + 'Name', + 'NameList$ebnf$1', + lexer.has('__') ? { type: '__' } : __, + 'Comp', + lexer.has('__') ? { type: '__' } : __, + 'NameList', + ], + postprocess: ([name, , , nametwo, , , namethree, , , , , namefour]) => + [name, nametwo, namethree, namefour].flat(), + }, + { + name: 'NameList$ebnf$2', + symbols: [lexer.has('Com') ? { type: 'Com' } : Com], + postprocess: id, + }, + { name: 'NameList$ebnf$2', symbols: [], postprocess: () => null }, + { + name: 'NameList', + symbols: [ + 'Name', + lexer.has('Com') ? { type: 'Com' } : Com, + lexer.has('__') ? { type: '__' } : __, + 'Name', + 'NameList$ebnf$2', + lexer.has('__') ? { type: '__' } : __, + 'Comp', + lexer.has('__') ? { type: '__' } : __, + 'NameList', + ], + postprocess: ([name, , , n, , , , , nn]) => [name, n, nn].flat(), + }, + { + name: 'NameList', + symbols: [ + 'NameList', + lexer.has('Com') ? { type: 'Com' } : Com, + lexer.has('__') ? { type: '__' } : __, + 'Comp', + lexer.has('__') ? { type: '__' } : __, + 'NameList', + ], + postprocess: ([name, , , , , n]) => [name, n].flat(), + }, + { + name: 'NameList', + symbols: [ + 'NameList', + lexer.has('Com') ? { type: 'Com' } : Com, + lexer.has('__') ? { type: '__' } : __, + 'Comp', + lexer.has('__') ? { type: '__' } : __, + ], + postprocess: ([name, , , ,]) => [name].flat(), + }, + { + name: 'NameList', + symbols: ['NameList', 'Comp', lexer.has('__') ? { type: '__' } : __, 'NameList'], + postprocess: ([name, , , ,]) => [name].flat(), + }, + { + name: 'NameList', + symbols: [ + 'NameList', + lexer.has('__') ? { type: '__' } : __, + 'Comp', + lexer.has('__') ? { type: '__' } : __, + 'Name', + ], + postprocess: ([name, _, and, , n]) => [name, n].flat(), + }, + { + name: 'NameList', + symbols: [ + 'NameList', + lexer.has('__') ? { type: '__' } : __, + 'Comp', + lexer.has('__') ? { type: '__' } : __, + ], + postprocess: ([name]) => [name].flat(), + }, + { + name: 'NameList', + symbols: [ + 'NameList', + lexer.has('Com') ? { type: 'Com' } : Com, + lexer.has('__') ? { type: '__' } : __, + 'Etal', + ], + postprocess: ([name]) => [name].flat(), + }, + { name: 'NameList', symbols: ['NameList', 'Etal'], postprocess: ([name]) => [name].flat() }, + { + name: 'NameList', + symbols: ['NameList', lexer.has('Apo') ? { type: 'Apo' } : Apo, { literal: 's' }], + postprocess: ([name]) => [name, "'s"].flat(), + }, + { name: 'ParenNameMaybeList', symbols: ['ParenNameMaybe'], postprocess: (name) => name }, + { + name: 'ParenNameMaybeList', + symbols: [ + 'ParenNameMaybeList', + lexer.has('Com') ? { type: 'Com' } : Com, + lexer.has('__') ? { type: '__' } : __, + 'Name', + ], + postprocess: ([name, , , n]) => [name, n].flat(), + }, + { + name: 'ParenNameMaybeList', + symbols: [ + 'ParenNameMaybeList', + lexer.has('Com') ? { type: 'Com' } : Com, + lexer.has('__') ? { type: '__' } : __, + 'NameList', + ], + postprocess: ([name, , , n]) => [name, n].flat(), + }, + { + name: 'ParenNameMaybeList', + symbols: [ + 'ParenNameMaybeList', + lexer.has('Com') ? { type: 'Com' } : Com, + lexer.has('__') ? { type: '__' } : __, + 'Comp', + lexer.has('__') ? { type: '__' } : __, + 'NameList', + ], + postprocess: ([name, , , , , n]) => [name, n].flat(), + }, + { + name: 'ParenNameMaybeList', + symbols: [ + 'ParenNameMaybeList', + lexer.has('Com') ? { type: 'Com' } : Com, + lexer.has('__') ? { type: '__' } : __, + 'Comp', + lexer.has('__') ? { type: '__' } : __, + ], + postprocess: ([name]) => [name].flat(), + }, + { + name: 'ParenNameMaybeList', + symbols: [ + 'ParenNameMaybeList', + lexer.has('__') ? { type: '__' } : __, + 'Comp', + lexer.has('__') ? { type: '__' } : __, + 'NameList', + ], + postprocess: ([name, , , , n]) => [name, n].flat(), + }, + { + name: 'ParenNameMaybeList', + symbols: [ + 'ParenNameMaybeList', + lexer.has('__') ? { type: '__' } : __, + 'Comp', + lexer.has('__') ? { type: '__' } : __, + ], + postprocess: ([name]) => [name].flat(), + }, + { name: 'ParenNameMaybe', symbols: ['Name'], postprocess: id }, + { name: 'ParenNameMaybe', symbols: ['Name', 'Etal'], postprocess: ([n]) => n }, + { + name: 'ParenNameMaybe', + symbols: ['ParenNameMaybe', lexer.has('__') ? { type: '__' } : __, 'ParenNameMaybe'], + postprocess: ([n, , nn]) => ({ ...n, ...nn, family: n.family + nn.family }), + }, + { + name: 'ParenNameMaybe', + symbols: [ + 'ParenNameMaybe', + lexer.has('__') ? { type: '__' } : __, + lexer.has('Lowword') ? { type: 'Lowword' } : Lowword, + ], + postprocess: ([n, , nn]) => ({ ...n, family: n.family + nn }), + }, + { name: 'Etal$ebnf$1', symbols: [lexer.has('__') ? { type: '__' } : __], postprocess: id }, + { name: 'Etal$ebnf$1', symbols: [], postprocess: () => null }, + { + name: 'Etal', + symbols: ['Etal$ebnf$1', lexer.has('Et') ? { type: 'Et' } : Et], + postprocess: (etal) => null, + }, + { + name: 'Name', + symbols: ['Initials', lexer.has('__') ? { type: '__' } : __, 'LastName'], + postprocess: ([initials, , name]) => ({ given: initials.join(''), ...name }), + }, + { name: 'Name', symbols: ['LastName'], postprocess: id }, + { name: 'LastName', symbols: ['SingleName'], postprocess: id }, + { name: 'LastName', symbols: ['HyphenName'], postprocess: id }, + { name: 'LastName', symbols: ['AbbrevName'], postprocess: id }, + { name: 'AbbrevName$ebnf$1', symbols: [lexer.has('Cap') ? { type: 'Cap' } : Cap] }, + { + name: 'AbbrevName$ebnf$1', + symbols: ['AbbrevName$ebnf$1', lexer.has('Cap') ? { type: 'Cap' } : Cap], + postprocess: (d) => d[0].concat([d[1]]), + }, + { + name: 'AbbrevName', + symbols: ['AbbrevName$ebnf$1', lexer.has('Cap') ? { type: 'Cap' } : Cap], + postprocess: ([caps, cap]) => ({ family: `${caps.join('')}${cap}` }), + }, + { name: 'Comp', symbols: [lexer.has('And') ? { type: 'And' } : And], postprocess: id }, + { name: 'Comp', symbols: [lexer.has('Amp') ? { type: 'Amp' } : Amp], postprocess: id }, + { + name: 'HyphenName', + symbols: ['SingleName', lexer.has('Dash') ? { type: 'Dash' } : Dash, 'SingleName'], + postprocess: ([first, d, last]) => ({ + family: `${getFullName(first) + d + getFullName(last)}`, + }), + }, + { + name: 'SingleName', + symbols: ['BoringNameMaybe'], + postprocess: ([name]) => ({ family: name }), + }, + { name: 'SingleName', symbols: ['DutchName'], postprocess: id }, + { name: 'SingleName', symbols: ['OReilly'], postprocess: id }, + { name: 'SingleName', symbols: ['McConnel'], postprocess: id }, + { name: 'SingleName', symbols: ['SpanishName'], postprocess: id }, + { name: 'Initials', symbols: ['Initial'] }, + { name: 'Initials$ebnf$1', symbols: [] }, + { + name: 'Initials$ebnf$1', + symbols: ['Initials$ebnf$1', lexer.has('__') ? { type: '__' } : __], + postprocess: (d) => d[0].concat([d[1]]), + }, + { name: 'Initials', symbols: ['Initials', 'Initials$ebnf$1', 'Initial'] }, + { + name: 'Initial', + symbols: [lexer.has('Cap') ? { type: 'Cap' } : Cap, lexer.has('Dot') ? { type: 'Dot' } : Dot], + postprocess: id, + }, + { + name: 'SpanishName', + symbols: ['BoringNameMaybe', lexer.has('__') ? { type: '__' } : __, 'BoringNameMaybe'], + postprocess: ([first, , last]) => ({ + family: `${first} ${last}`, + }), + }, + { + name: 'DutchName', + symbols: ['DutchPrefix', lexer.has('__') ? { type: '__' } : __, 'BoringNameMaybe'], + postprocess: ([pref, space, rest]) => { + return { + family: rest, + 'non-dropping-particle': pref.join(''), + } + }, + }, + { + name: 'OReilly', + symbols: ['BoringNameMaybe', { literal: "'" }, 'BoringNameMaybe'], + postprocess: ([o, a, name]) => ({ family: o + a + name }), + }, + { + name: 'OReilly', + symbols: ['BoringNameMaybe', { literal: '’' }, 'BoringNameMaybe'], + postprocess: ([o, a, name]) => ({ family: o + a + name }), + }, + { + name: 'McConnel', + symbols: [lexer.has('Mc') ? { type: 'Mc' } : Mc, 'BoringNameMaybe'], + postprocess: (name) => ({ family: name.join('') }), + }, + { name: 'McConnel$ebnf$1', symbols: [lexer.has('Lowword') ? { type: 'Lowword' } : Lowword] }, + { + name: 'McConnel$ebnf$1', + symbols: ['McConnel$ebnf$1', lexer.has('Lowword') ? { type: 'Lowword' } : Lowword], + postprocess: (d) => d[0].concat([d[1]]), + }, + { + name: 'McConnel', + symbols: [lexer.has('Mc') ? { type: 'Mc' } : Mc, 'McConnel$ebnf$1'], + postprocess: ([mac, low]) => ({ family: [mac, low.join('')].join('') }), + }, + { name: 'BoringNameMaybe$ebnf$1', symbols: [] }, + { + name: 'BoringNameMaybe$ebnf$1', + symbols: ['BoringNameMaybe$ebnf$1', lexer.has('Lowword') ? { type: 'Lowword' } : Lowword], + postprocess: (d) => d[0].concat([d[1]]), + }, + { + name: 'BoringNameMaybe', + symbols: [lexer.has('Cap') ? { type: 'Cap' } : Cap, 'BoringNameMaybe$ebnf$1'], + postprocess: ([cap, rest]) => `${cap}${rest.join('')}`, + }, + { + name: 'BoringNameMaybe$ebnf$2', + symbols: [lexer.has('Lowword') ? { type: 'Lowword' } : Lowword], + }, + { + name: 'BoringNameMaybe$ebnf$2', + symbols: ['BoringNameMaybe$ebnf$2', lexer.has('Lowword') ? { type: 'Lowword' } : Lowword], + postprocess: (d) => d[0].concat([d[1]]), + }, + { name: 'BoringNameMaybe$ebnf$3', symbols: [] }, + { + name: 'BoringNameMaybe$ebnf$3', + symbols: ['BoringNameMaybe$ebnf$3', lexer.has('Lowword') ? { type: 'Lowword' } : Lowword], + postprocess: (d) => d[0].concat([d[1]]), + }, + { + name: 'BoringNameMaybe', + symbols: [ + lexer.has('Cap') ? { type: 'Cap' } : Cap, + 'BoringNameMaybe$ebnf$2', + lexer.has('Cap') ? { type: 'Cap' } : Cap, + 'BoringNameMaybe$ebnf$3', + ], + postprocess: ([cap, low, capp, loww]) => `${cap}${low.join('')}${capp}${loww.join('')}`, + }, + { name: 'BoringWord$ebnf$1', symbols: [lexer.has('Low') ? { type: 'Low' } : Low] }, + { + name: 'BoringWord$ebnf$1', + symbols: ['BoringWord$ebnf$1', lexer.has('Low') ? { type: 'Low' } : Low], + postprocess: (d) => d[0].concat([d[1]]), + }, + { name: 'BoringWord', symbols: ['BoringWord$ebnf$1'], postprocess: (word) => word.join('') }, + { name: 'DutchPrefix', symbols: [lexer.has('DutchPref') ? { type: 'DutchPref' } : DutchPref] }, + { + name: 'DutchPrefix', + symbols: [ + 'DutchPrefix', + lexer.has('__') ? { type: '__' } : __, + lexer.has('DutchPref') ? { type: 'DutchPref' } : DutchPref, + ], + }, + { + name: 'Year', + symbols: [lexer.has('Year') ? { type: 'Year' } : Year], + postprocess: ([year]) => [`${year}`.replace(/\./g, '').toUpperCase()], + }, + { + name: 'Year$ebnf$1', + symbols: [lexer.has('Dash') ? { type: 'Dash' } : Dash], + postprocess: id, + }, + { name: 'Year$ebnf$1', symbols: [], postprocess: () => null }, + { + name: 'Year', + symbols: [ + lexer.has('Year') ? { type: 'Year' } : Year, + 'Year$ebnf$1', + lexer.has('Lowword') ? { type: 'Lowword' } : Lowword, + ], + postprocess: ([year, , low]) => [year + low], + }, + { + name: 'Year', + symbols: ['Year', lexer.has('Slash') ? { type: 'Slash' } : Slash, 'Year'], + postprocess: (content) => { + const [year, sl, year2] = content + return [...year2, ...year] + }, + }, + { name: 'Year$ebnf$2', symbols: [lexer.has('Number') ? { type: 'Number' } : Number] }, + { + name: 'Year$ebnf$2', + symbols: ['Year$ebnf$2', lexer.has('Number') ? { type: 'Number' } : Number], + postprocess: (d) => d[0].concat([d[1]]), + }, + { name: 'Year$ebnf$3', symbols: [] }, + { + name: 'Year$ebnf$3', + symbols: ['Year$ebnf$3', lexer.has('__') ? { type: '__' } : __], + postprocess: (d) => d[0].concat([d[1]]), + }, + { + name: 'Year', + symbols: ['Year$ebnf$2', 'Year$ebnf$3', lexer.has('BCE') ? { type: 'BCE' } : BCE], + postprocess: ([num, , rest]) => [`${/b\.?c\.?/i.test(rest) ? '-' : ''}${num}`], + }, + { + name: 'Year', + symbols: [ + lexer.has('Ca') ? { type: 'Ca' } : Ca, + lexer.has('__') ? { type: '__' } : __, + 'Year', + ], + postprocess: ([ca, , year]) => [`${year}`], + }, ], - ParserStart: "Input", -}; + ParserStart: 'Input', +} -export default grammar; +export default grammar diff --git a/libs/citations/reference-parser-chatgpt/project.json b/libs/citations/reference-parser-chatgpt/project.json index 2752a593..cb6b5f99 100644 --- a/libs/citations/reference-parser-chatgpt/project.json +++ b/libs/citations/reference-parser-chatgpt/project.json @@ -4,8 +4,11 @@ "sourceRoot": "libs/citations/reference-parser-chatgpt/src", "projectType": "library", "targets": { + "make-publishable": { + "executor": "better-nx-tsc:publishable" + }, "build": { - "executor": "better-nx-tsc:tsc", + "executor": "@nrwl/js:tsc", "outputs": ["{options.outputPath}"], "options": { "rootDir": "libs/citations/reference-parser-chatgpt/src", diff --git a/libs/citations/reference-parser-chatgpt/src/lib/format-references.ts b/libs/citations/reference-parser-chatgpt/src/lib/format-references.ts index 0d25e50f..59f9cfd7 100644 --- a/libs/citations/reference-parser-chatgpt/src/lib/format-references.ts +++ b/libs/citations/reference-parser-chatgpt/src/lib/format-references.ts @@ -72,7 +72,7 @@ Respond with code only, do not provide explanations or any other text other than content: referenceString, }) - let chatResponse = await fetch('https://api.openai.com/v1/chat/completions', { + const chatResponse = await fetch('https://api.openai.com/v1/chat/completions', { headers: { 'Content-Type': 'application/json', Authorization: `Bearer ${process.env.OPENAI_API_KEY}`, diff --git a/libs/hybrid-builder/project.json b/libs/hybrid-builder/project.json index c4821a67..a21c4920 100644 --- a/libs/hybrid-builder/project.json +++ b/libs/hybrid-builder/project.json @@ -4,8 +4,11 @@ "sourceRoot": "libs/hybrid-builder/src", "projectType": "library", "targets": { + "make-publishable": { + "executor": "better-nx-tsc:publishable" + }, "build": { - "executor": "better-nx-tsc:tsc", + "executor": "@nrwl/js:tsc", "outputs": ["{options.outputPath}"], "options": { "rootDir": "libs/hybrid-builder/src", diff --git a/libs/hybrid-builder/src/executors/build/executor.spec.ts b/libs/hybrid-builder/src/executors/build/executor.spec.ts index b5c8abcc..311054dd 100644 --- a/libs/hybrid-builder/src/executors/build/executor.spec.ts +++ b/libs/hybrid-builder/src/executors/build/executor.spec.ts @@ -1,5 +1,5 @@ -import { BuildExecutorSchema } from './schema' -import executor from './executor' +import { BuildExecutorSchema } from './schema.js' +import executor from './executor.js' const options: BuildExecutorSchema = {} diff --git a/libs/hybrid-builder/src/executors/build/executor.ts b/libs/hybrid-builder/src/executors/build/executor.ts index 4b1e09dd..c2ffbdf1 100644 --- a/libs/hybrid-builder/src/executors/build/executor.ts +++ b/libs/hybrid-builder/src/executors/build/executor.ts @@ -1,9 +1,6 @@ -import { BuildExecutorSchema } from './schema' +import { BuildExecutorSchema } from './schema.js' import fs from 'fs' -import { - swcExecutor, - normalizeOptions, -} from '@nrwl/js/src/executors/swc/swc.impl' +import { swcExecutor, normalizeOptions } from '@nrwl/js/src/executors/swc/swc.impl' import { ExecutorContext } from '@nrwl/devkit' import { Config as SWCrc } from '@swc/core' @@ -11,7 +8,7 @@ function getSwcOptions( options: BuildExecutorSchema, contextRoot: string, sourceRoot?: string, - projectRoot?: string + projectRoot?: string, ) { return { ...normalizeOptions(options, contextRoot, sourceRoot, projectRoot), @@ -22,11 +19,10 @@ function getSwcOptions( // convert an swcrc config file which outputs esm to one which outputs cjs function convertESMSWCrctoCJS( swcOptions: ReturnType, - context: ExecutorContext + context: ExecutorContext, ): SWCrc { const swcrc = - swcOptions.swcrc || - `${context.workspace.projects[context.projectName as string].root}/.swcrc` + swcOptions.swcrc || `${context.workspace.projects[context.projectName as string].root}/.swcrc` const swcrcConfig = JSON.parse(fs.readFileSync(swcrc, 'utf8')) as SWCrc @@ -39,16 +35,11 @@ function convertESMSWCrctoCJS( } } -export default async function runExecutor( - options: BuildExecutorSchema, - context: ExecutorContext -) { +export default async function runExecutor(options: BuildExecutorSchema, context: ExecutorContext) { const swcrc = - options.swcrc || - `${context.workspace.projects[context.projectName as string].root}/.swcrc` + options.swcrc || `${context.workspace.projects[context.projectName as string].root}/.swcrc` - const { sourceRoot, root } = - context.workspace.projects[context.projectName as string] + const { sourceRoot, root } = context.workspace.projects[context.projectName as string] const swcOptions = getSwcOptions(options, context.root, sourceRoot, root) diff --git a/libs/hybrid-builder/src/generators/hybrid-builder/generator.spec.ts b/libs/hybrid-builder/src/generators/hybrid-builder/generator.spec.ts index 5057a566..546b3200 100644 --- a/libs/hybrid-builder/src/generators/hybrid-builder/generator.spec.ts +++ b/libs/hybrid-builder/src/generators/hybrid-builder/generator.spec.ts @@ -1,8 +1,8 @@ import { createTreeWithEmptyWorkspace } from '@nrwl/devkit/testing' import { Tree, readProjectConfiguration } from '@nrwl/devkit' -import generator from './generator' -import { HybridBuilderGeneratorSchema } from './schema' +import generator from './generator.js' +import { HybridBuilderGeneratorSchema } from './schema.js' describe('hybrid-builder generator', () => { let appTree: Tree diff --git a/libs/hybrid-builder/src/generators/hybrid-builder/generator.ts b/libs/hybrid-builder/src/generators/hybrid-builder/generator.ts index 63b0db49..0b6950dc 100644 --- a/libs/hybrid-builder/src/generators/hybrid-builder/generator.ts +++ b/libs/hybrid-builder/src/generators/hybrid-builder/generator.ts @@ -8,7 +8,7 @@ import { Tree, } from '@nrwl/devkit' import * as path from 'path' -import { HybridBuilderGeneratorSchema } from './schema' +import { HybridBuilderGeneratorSchema } from './schema.js' interface NormalizedSchema extends HybridBuilderGeneratorSchema { projectName: string @@ -17,19 +17,12 @@ interface NormalizedSchema extends HybridBuilderGeneratorSchema { parsedTags: string[] } -function normalizeOptions( - tree: Tree, - options: HybridBuilderGeneratorSchema -): NormalizedSchema { +function normalizeOptions(tree: Tree, options: HybridBuilderGeneratorSchema): NormalizedSchema { const name = names(options.name).fileName - const projectDirectory = options.directory - ? `${names(options.directory).fileName}/${name}` - : name + const projectDirectory = options.directory ? `${names(options.directory).fileName}/${name}` : name const projectName = projectDirectory.replace(new RegExp('/', 'g'), '-') const projectRoot = `${getWorkspaceLayout(tree).libsDir}/${projectDirectory}` - const parsedTags = options.tags - ? options.tags.split(',').map((s) => s.trim()) - : [] + const parsedTags = options.tags ? options.tags.split(',').map((s) => s.trim()) : [] return { ...options, @@ -47,18 +40,10 @@ function addFiles(tree: Tree, options: NormalizedSchema) { offsetFromRoot: offsetFromRoot(options.projectRoot), template: '', } - generateFiles( - tree, - path.join(__dirname, 'files'), - options.projectRoot, - templateOptions - ) + generateFiles(tree, path.join(__dirname, 'files'), options.projectRoot, templateOptions) } -export default async function ( - tree: Tree, - options: HybridBuilderGeneratorSchema -) { +export default async function (tree: Tree, options: HybridBuilderGeneratorSchema) { const normalizedOptions = normalizeOptions(tree, options) addProjectConfiguration(tree, normalizedOptions.projectName, { root: normalizedOptions.projectRoot, diff --git a/libs/jast/jast-util-from-csl/project.json b/libs/jast/jast-util-from-csl/project.json index 1fcdbc73..e21eada3 100755 --- a/libs/jast/jast-util-from-csl/project.json +++ b/libs/jast/jast-util-from-csl/project.json @@ -26,8 +26,11 @@ "passWithNoTests": true } }, + "make-publishable": { + "executor": "better-nx-tsc:publishable" + }, "build": { - "executor": "better-nx-tsc:tsc", + "executor": "@nrwl/js:tsc", "outputs": ["{options.outputPath}"], "options": { "rootDir": "libs/jast/jast-util-from-csl/src", diff --git a/libs/jast/jast-util-from-csl/src/lib/csl-to-jast.spec.ts b/libs/jast/jast-util-from-csl/src/lib/csl-to-jast.spec.ts index e489e323..d350f848 100755 --- a/libs/jast/jast-util-from-csl/src/lib/csl-to-jast.spec.ts +++ b/libs/jast/jast-util-from-csl/src/lib/csl-to-jast.spec.ts @@ -1,17 +1,12 @@ -import { cslToRefList } from './csl-to-jast' +import { cslToRefList } from './csl-to-jast.js' import { readFileSync, writeFileSync } from 'fs' -const test = JSON.parse( - readFileSync(new URL('test.json', import.meta.url), { encoding: 'utf-8' }) -) +const test = JSON.parse(readFileSync(new URL('test.json', import.meta.url), { encoding: 'utf-8' })) describe('cslToRefList', () => { it('should map csl to reflist', () => { const res = cslToRefList(test) - writeFileSync( - new URL('test-jast.json', import.meta.url), - JSON.stringify(res, null, 2) - ) + writeFileSync(new URL('test-jast.json', import.meta.url), JSON.stringify(res, null, 2)) expect(res).toBeDefined() }) }) diff --git a/libs/jast/jast-util-to-csl/project.json b/libs/jast/jast-util-to-csl/project.json index 45b4cd8e..a8234a8d 100755 --- a/libs/jast/jast-util-to-csl/project.json +++ b/libs/jast/jast-util-to-csl/project.json @@ -11,8 +11,11 @@ "packageJSON": "libs/jast/jast-util-to-csl/package.json" } }, + "make-publishable": { + "executor": "better-nx-tsc:publishable" + }, "build": { - "executor": "better-nx-tsc:tsc", + "executor": "@nrwl/js:tsc", "outputs": ["{options.outputPath}"], "options": { "rootDir": "libs/jast/jast-util-to-csl/src", diff --git a/libs/jast/jast-util-to-texast/project.json b/libs/jast/jast-util-to-texast/project.json index 7004f87f..f41838a8 100755 --- a/libs/jast/jast-util-to-texast/project.json +++ b/libs/jast/jast-util-to-texast/project.json @@ -26,8 +26,11 @@ "passWithNoTests": true } }, + "make-publishable": { + "executor": "better-nx-tsc:publishable" + }, "build": { - "executor": "better-nx-tsc:tsc", + "executor": "@nrwl/js:tsc", "outputs": ["{options.outputPath}"], "options": { "rootDir": "libs/jast/jast-util-to-texast/src", diff --git a/libs/jast/jast-util-to-texast/src/lib/all.ts b/libs/jast/jast-util-to-texast/src/lib/all.ts index e351e507..2e006496 100755 --- a/libs/jast/jast-util-to-texast/src/lib/all.ts +++ b/libs/jast/jast-util-to-texast/src/lib/all.ts @@ -1,5 +1,5 @@ -import { one } from './one' -import { J, TexastContent, Node, Parent, Handle } from './types' +import { one } from './one.js' +import { J, TexastContent, Node, Parent, Handle } from './types.js' /** * Convert all nodes in tree using j @@ -12,8 +12,8 @@ export function all(j: J, parent: Node): Array { const nodes: Array = parent.children || [] const values: Array = [] let index = -1 - let length = nodes.length - let child = nodes[index + 1] + const length = nodes.length + // let child = nodes[index + 1] // Trim initial and final `
`s. // They’re not semantic per HTML, and they can’t be made in markdown things diff --git a/libs/jast/jast-util-to-texast/src/lib/handlers/article.ts b/libs/jast/jast-util-to-texast/src/lib/handlers/article.ts index a9e15cd8..b8ee0145 100755 --- a/libs/jast/jast-util-to-texast/src/lib/handlers/article.ts +++ b/libs/jast/jast-util-to-texast/src/lib/handlers/article.ts @@ -1,24 +1,15 @@ // based on https://github.com/syntax-tree/hast-util-to-mdast/blob/main/lib/handlers/em -import { - Article, - Parent, - TagHavers, - Element, - Content, - FnGroup, -} from 'jast-types' +import { Article, Parent, TagHavers, Element, Content, FnGroup } from 'jast-types' import { select } from 'xast-util-select' -import { all } from '../all' -import { J, Node, Root } from '../types' -import { fnGroup } from './fnGroup' +import { all } from '../all.js' +import { J, Node, Root } from '../types.js' +import { fnGroup } from './fnGroup.js' export function article(j: J, node: Root) { const front = select('front', node) if (!front) { - throw new Error( - `Node ${node.type} requires a "front" child, but none were found.` - ) + throw new Error(`Node ${node.type} requires a "front" child, but none were found.`) } const refList = select('back > refList', node) @@ -35,10 +26,7 @@ export function article(j: J, node: Root) { const body = select('body', node) if (!body) { - return j(node, 'root', { name: 'article' }, [ - ...all(j, node), - j(node, 'body'), - ]) + return j(node, 'root', { name: 'article' }, [...all(j, node), j(node, 'body')]) } node.children = [front as Content, body as Content] diff --git a/libs/jast/jast-util-to-texast/src/lib/handlers/body.ts b/libs/jast/jast-util-to-texast/src/lib/handlers/body.ts index 11e33916..e3c5f3f4 100755 --- a/libs/jast/jast-util-to-texast/src/lib/handlers/body.ts +++ b/libs/jast/jast-util-to-texast/src/lib/handlers/body.ts @@ -1,8 +1,8 @@ // based on https://github.com/syntax-tree/hast-util-to-mdast/blob/main/lib/handlers/em import { Article, Parent, TagHavers } from 'jast-types' -import { all } from '../all' -import { J, Node, Root } from '../types' +import { all } from '../all.js' +import { J, Node, Root } from '../types.js' export function body(j: J, node: Root) { return j(node, 'environment', { name: 'document' }, all(j, node)) diff --git a/libs/jast/jast-util-to-texast/src/lib/handlers/bold.ts b/libs/jast/jast-util-to-texast/src/lib/handlers/bold.ts index 71819201..e9ae9dbb 100755 --- a/libs/jast/jast-util-to-texast/src/lib/handlers/bold.ts +++ b/libs/jast/jast-util-to-texast/src/lib/handlers/bold.ts @@ -1,7 +1,7 @@ // based on https://github.com/syntax-tree/hast-util-to-mdast/blob/main/lib/handlers/em -import { all } from '../all' -import { J, Node } from '../types' +import { all } from '../all.js' +import { J, Node } from '../types.js' export function bold(j: J, node: Node) { return j(node, 'command', { name: 'textbf' }, all(j, node)) diff --git a/libs/jast/jast-util-to-texast/src/lib/handlers/command.ts b/libs/jast/jast-util-to-texast/src/lib/handlers/command.ts index 2cd55260..1ec87527 100755 --- a/libs/jast/jast-util-to-texast/src/lib/handlers/command.ts +++ b/libs/jast/jast-util-to-texast/src/lib/handlers/command.ts @@ -1,10 +1,10 @@ import { Names } from 'jast-types' import { CommandArg, CommandArgOpt } from 'texast' -import { all } from '../all' -import { one } from '../one' -import { J, Node, Parent, Parents, Root, Text } from '../types' -import { wrap } from '../util/wrap' -import { wrapCommandArg } from '../util/wrap-command-arg' +import { all } from '../all.js' +import { one } from '../one.js' +import { J, Node, Parent, Parents, Root, Text } from '../types.js' +import { wrap } from '../util/wrap.js' +import { wrapCommandArg } from '../util/wrap-command-arg.js' const typeCommandMap: { [key: string]: { @@ -39,32 +39,26 @@ export function command(j: J, node: Parents, parent: Parent) { } const firstCommandArg = wrapCommandArg( j, - node?.children - // @ts-expect-error dude just chill - ?.filter( - (child: Node) => - mapEntry?.first?.includes( - // @ts-expect-error dude just chill - child.name - ) || child?.type === 'text' - ) + // @ts-expect-error dude just chill + node?.children?.filter( + (child: Node) => + ('name' in child && mapEntry?.first?.includes(child.name)) || child?.type === 'text', + ), ) const requiredCommandArgs: CommandArg[] = node?.children - // @ts-expect-error dude just chill ?.filter((child: Node) => mapEntry?.required?.includes( // @ts-expect-error dude just chill - child.name - ) + child.name, + ), ) .map((child: any) => { return wrapCommandArg(j, [child]) }) - const optionalCommandArgs: CommandArgOpt[] = node?.children - // @ts-expect-error dude just chill - ?.filter((child: Parents) => mapEntry?.optional?.includes(child.name)) + const optionalCommandArgs = node?.children + ?.filter((child) => mapEntry?.optional?.some((opt) => 'name' in child && opt === child.name)) .map((child: any) => wrapCommandArg(j, [child], true)) return j(node, 'command', { name: commandName }, [ diff --git a/libs/jast/jast-util-to-texast/src/lib/handlers/disp-quote.ts b/libs/jast/jast-util-to-texast/src/lib/handlers/disp-quote.ts index 7466c0d7..84026f04 100644 --- a/libs/jast/jast-util-to-texast/src/lib/handlers/disp-quote.ts +++ b/libs/jast/jast-util-to-texast/src/lib/handlers/disp-quote.ts @@ -1,8 +1,8 @@ import { DispQuote, Graphic, List } from 'jast-types' import { Environment } from 'texast' -import { all } from '../all' -import { J } from '../types' -import { wrapCommandArg } from '../util/wrap-command-arg' +import { all } from '../all.js' +import { J } from '../types.js' +import { wrapCommandArg } from '../util/wrap-command-arg.js' export function dispQuote(j: J, node: DispQuote): Environment { return { diff --git a/libs/jast/jast-util-to-texast/src/lib/handlers/environment.ts b/libs/jast/jast-util-to-texast/src/lib/handlers/environment.ts index a594c335..c4af620d 100755 --- a/libs/jast/jast-util-to-texast/src/lib/handlers/environment.ts +++ b/libs/jast/jast-util-to-texast/src/lib/handlers/environment.ts @@ -1,8 +1,8 @@ import { isElement, Names } from 'jast-types' -import { J, Parents, Name, Node } from '../types' -import { wrap } from '../util/wrap' -import { wrapChildren } from '../util/wrap-children' -import { wrapCommandArg } from '../util/wrap-command-arg' +import { J, Parents, Name, Node, TexastContent, Text } from '../types.js' +import { wrap } from '../util/wrap.js' +import { wrapChildren } from '../util/wrap-children.js' +import { wrapCommandArg } from '../util/wrap-command-arg.js' const typeEnvArgMap: { [key: string]: { @@ -26,39 +26,45 @@ export function environment(j: J, node: Parents) { return j(node, 'environment', { name: envName }, wrapChildren(j, node)) } - const things = node.children - // @ts-expect-error dude just chill - .reduce( - ( - acc: { - req: Node[] - opt: Node - children: Node[] - }, - child: Node - ) => { - if (isElement(child)) { - if (mapEntry?.optional?.includes(child.name)) { - acc.opt = child + const things = node.children.reduce( + ( + acc: { + req: Parents['children'] + opt: Parents['children'] + children: Text[] + }, + child, + ) => { + if (isElement(child)) { + if (mapEntry?.optional?.includes(child.name)) { + // @ts-expect-error bruh + acc.opt = [child] + return acc + } + mapEntry?.required?.forEach((arg, i) => { + if (arg.includes(child.name)) { + // @ts-expect-error bruh + acc.req.push(child) return acc } - mapEntry?.required?.forEach((arg, i) => { - if (arg.includes(child.name)) { - acc.req.push(child) - return acc - } - }) - } + }) + } + + if (child.type === 'text') { acc.children.push(child) - return acc - }, + } + + return acc + }, - { req: [], opt: [], children: [] } - ) + { req: [], opt: [], children: [] }, + ) return j(node, 'environment', { name: envName }, [ - wrapCommandArg(j, [things.opt], true), + // @ts-expect-error bruh + wrapCommandArg(j, things.opt, true), + // @ts-expect-error bruh wrapCommandArg(j, things.req), - ...wrap(things.children), + ...wrap('children' in things ? things.children : [things]), ]) } diff --git a/libs/jast/jast-util-to-texast/src/lib/handlers/extLink.ts b/libs/jast/jast-util-to-texast/src/lib/handlers/extLink.ts index 6df4c7ec..caf6e7eb 100755 --- a/libs/jast/jast-util-to-texast/src/lib/handlers/extLink.ts +++ b/libs/jast/jast-util-to-texast/src/lib/handlers/extLink.ts @@ -1,17 +1,15 @@ // based on https://github.com/syntax-tree/hast-util-to-mdast/blob/main/lib/handlers/em import { ExtLink, Fig } from 'jast-types' -import { J } from '../types' -import { wrapCommandArg } from '../util/wrap-command-arg' +import { J } from '../types.js' +import { wrapCommandArg } from '../util/wrap-command-arg.js' export function extLink(j: J, node: ExtLink) { return { type: 'command', name: 'href', children: [ - wrapCommandArg(j, [ - { type: 'text', value: node.attributes['xlink:href'] }, - ]), + wrapCommandArg(j, [{ type: 'text', value: node.attributes['xlink:href'] }]), wrapCommandArg(j, node.children), ], } diff --git a/libs/jast/jast-util-to-texast/src/lib/handlers/fig.ts b/libs/jast/jast-util-to-texast/src/lib/handlers/fig.ts index de8fee91..7beeea18 100755 --- a/libs/jast/jast-util-to-texast/src/lib/handlers/fig.ts +++ b/libs/jast/jast-util-to-texast/src/lib/handlers/fig.ts @@ -1,8 +1,8 @@ // based on https://github.com/syntax-tree/hast-util-to-mdast/blob/main/lib/handlers/em import { Fig, isElement } from 'jast-types' -import { all } from '../all' -import { J } from '../types' +import { all } from '../all.js' +import { J } from '../types.js' // try to turn of typechecking for visit as it it bugged // https://github.com/syntax-tree/unist-util-visit/issues/33 diff --git a/libs/jast/jast-util-to-texast/src/lib/handlers/fnGroup.ts b/libs/jast/jast-util-to-texast/src/lib/handlers/fnGroup.ts index 5bfa6cbd..afba8ec1 100644 --- a/libs/jast/jast-util-to-texast/src/lib/handlers/fnGroup.ts +++ b/libs/jast/jast-util-to-texast/src/lib/handlers/fnGroup.ts @@ -1,10 +1,10 @@ import { Fn, FnGroup } from 'jast-types' -import { all } from '../all' -import { J, TexastContent } from '../types' +import { all } from '../all.js' +import { J, TexastContent } from '../types.js' export const fnGroup = (j: J, node: FnGroup) => { const children = node.children.filter( - (child): child is Fn => 'name' in child && child.name === 'fn' + (child): child is Fn => 'name' in child && child.name === 'fn', ) const footnotes = children.map((child, idx) => { diff --git a/libs/jast/jast-util-to-texast/src/lib/handlers/front.ts b/libs/jast/jast-util-to-texast/src/lib/handlers/front.ts index a7baea6e..93911b31 100755 --- a/libs/jast/jast-util-to-texast/src/lib/handlers/front.ts +++ b/libs/jast/jast-util-to-texast/src/lib/handlers/front.ts @@ -1,10 +1,10 @@ // based on https://github.com/syntax-tree/hast-util-to-mdast/blob/main/lib/handlers/em import { Article, Parent, TagHavers } from 'jast-types' -import { all } from '../all' -import { J, Node, Root } from '../types' -import { wrapCommandArg } from '../util/wrap-command-arg' -import { wrap } from '../util/wrap' +import { all } from '../all.js' +import { J, Node, Root } from '../types.js' +import { wrapCommandArg } from '../util/wrap-command-arg.js' +import { wrap } from '../util/wrap.js' import { CommandArg } from 'texast' export function front(j: J, node: Root) { @@ -26,9 +26,7 @@ export function front(j: J, node: Root) { { type: 'commandArg', optional: true, - children: [ - { type: 'text', value: j.documentClass.options.join(', ') }, - ], + children: [{ type: 'text', value: j.documentClass.options.join(', ') }], } as CommandArg, ] : []), @@ -91,6 +89,6 @@ export function front(j: J, node: Root) { }, { type: 'text', value: '\n' }, ...all(j, node), - ]) + ]), ) } diff --git a/libs/jast/jast-util-to-texast/src/lib/handlers/graphic.ts b/libs/jast/jast-util-to-texast/src/lib/handlers/graphic.ts index cdc2b358..6207fb7d 100755 --- a/libs/jast/jast-util-to-texast/src/lib/handlers/graphic.ts +++ b/libs/jast/jast-util-to-texast/src/lib/handlers/graphic.ts @@ -1,16 +1,14 @@ import { Graphic, List } from 'jast-types' -import { all } from '../all' -import { J } from '../types' -import { wrapCommandArg } from '../util/wrap-command-arg' +import { all } from '../all.js' +import { J } from '../types.js' +import { wrapCommandArg } from '../util/wrap-command-arg.js' export function graphic(j: J, node: Graphic) { return { type: 'command', name: 'includegraphics', children: [ - wrapCommandArg(j, [ - { type: 'text', value: node.attributes['xlink:href'] || '' }, - ]), + wrapCommandArg(j, [{ type: 'text', value: node.attributes['xlink:href'] || '' }]), { type: 'text', value: '\n' }, ], } diff --git a/libs/jast/jast-util-to-texast/src/lib/handlers/index.ts b/libs/jast/jast-util-to-texast/src/lib/handlers/index.ts index 9ef9487e..640ca826 100755 --- a/libs/jast/jast-util-to-texast/src/lib/handlers/index.ts +++ b/libs/jast/jast-util-to-texast/src/lib/handlers/index.ts @@ -1,29 +1,29 @@ -import { italic } from './italic' -import { all } from '../all' -import { command } from './command' -import { root } from './root' -import { article } from './article' -import { body } from './body' -import { text } from './text' -import { front } from './front' -import { wrapChildren } from '../util/wrap-children' -import { environment } from './environment' -import { sub } from './sub' -import { sup } from './sup' -import { sec } from './sec' -import { listItem } from './listItem' -import { list } from './list' -import { tableWrap } from './tableWrap' -import { table } from './table' -import { tr } from './tr' -import { td } from './td' -import { refList } from './refList' -import { xref } from './xref' -import { fig } from './fig' -import { graphic } from './graphic' -import { extLink } from './extLink' -import { p } from './p' -import { dispQuote } from './disp-quote' +import { italic } from './italic.js' +import { all } from '../all.js' +import { command } from './command.js' +import { root } from './root.js' +import { article } from './article.js' +import { body } from './body.js' +import { text } from './text.js' +import { front } from './front.js' +import { wrapChildren } from '../util/wrap-children.js' +import { environment } from './environment.js' +import { sub } from './sub.js' +import { sup } from './sup.js' +import { sec } from './sec.js' +import { listItem } from './listItem.js' +import { list } from './list.js' +import { tableWrap } from './tableWrap.js' +import { table } from './table.js' +import { tr } from './tr.js' +import { td } from './td.js' +import { refList } from './refList.js' +import { xref } from './xref.js' +import { fig } from './fig.js' +import { graphic } from './graphic.js' +import { extLink } from './extLink.js' +import { p } from './p.js' +import { dispQuote } from './disp-quote.js' export * from './italic.js' export const handlers = { diff --git a/libs/jast/jast-util-to-texast/src/lib/handlers/inlineFormula.ts b/libs/jast/jast-util-to-texast/src/lib/handlers/inlineFormula.ts index c6875c62..151ba033 100755 --- a/libs/jast/jast-util-to-texast/src/lib/handlers/inlineFormula.ts +++ b/libs/jast/jast-util-to-texast/src/lib/handlers/inlineFormula.ts @@ -1,7 +1,7 @@ // based on https://github.com/syntax-tree/hast-util-to-mdast/blob/main/lib/handlers/em -import { all } from '../all' -import { J, Node } from '../types' +import { all } from '../all.js' +import { J, Node } from '../types.js' export function inlineFormula(j: J, node: Node) { return j(node, 'inlineMath', all(j, node)) diff --git a/libs/jast/jast-util-to-texast/src/lib/handlers/italic.ts b/libs/jast/jast-util-to-texast/src/lib/handlers/italic.ts index 20f11697..0649d043 100755 --- a/libs/jast/jast-util-to-texast/src/lib/handlers/italic.ts +++ b/libs/jast/jast-util-to-texast/src/lib/handlers/italic.ts @@ -1,10 +1,8 @@ // based on https://github.com/syntax-tree/hast-util-to-mdast/blob/main/lib/handlers/em -import { all } from '../all' -import { J, Node } from '../types' +import { all } from '../all.js' +import { J, Node } from '../types.js' export function italic(j: J, node: Node) { - return j(node, 'command', { name: j['italics'] }, [ - j(node, 'commandArg', all(j, node)), - ]) + return j(node, 'command', { name: j['italics'] }, [j(node, 'commandArg', all(j, node))]) } diff --git a/libs/jast/jast-util-to-texast/src/lib/handlers/list.ts b/libs/jast/jast-util-to-texast/src/lib/handlers/list.ts index 0809fa0e..55d2809e 100755 --- a/libs/jast/jast-util-to-texast/src/lib/handlers/list.ts +++ b/libs/jast/jast-util-to-texast/src/lib/handlers/list.ts @@ -1,14 +1,13 @@ import { List } from 'jast-types' -import { all } from 'jast-util-to-texast' -import { J } from '../types' +import { all } from '../all.js' +import { J } from '../types.js' export function list(j: J, list: List) { // if (!typeCommandMap[node.type]) { // return j(node, 'paragraph', all(j, node)) // } - const name = - list?.attributes?.['listType'] === 'order' ? 'enumerate' : 'itemize' + const name = list?.attributes?.['listType'] === 'order' ? 'enumerate' : 'itemize' // we're assuming that the list does not have any more arguments // someone else can figure that one out if you want some kind of fancy list or smth diff --git a/libs/jast/jast-util-to-texast/src/lib/handlers/listItem.ts b/libs/jast/jast-util-to-texast/src/lib/handlers/listItem.ts index 9f0ea6ce..c221ec3b 100755 --- a/libs/jast/jast-util-to-texast/src/lib/handlers/listItem.ts +++ b/libs/jast/jast-util-to-texast/src/lib/handlers/listItem.ts @@ -1,8 +1,6 @@ import { ListItem } from 'jast-types' -import { all } from 'jast-util-to-texast' -import { CommandArg } from 'texast' -import { wrap } from '../util/wrap' -import { J } from '../types' +import { all } from '../all.js' +import { J } from '../types.js' export function listItem(j: J, item: ListItem) { return j(item, 'listItem', all(j, item)) diff --git a/libs/jast/jast-util-to-texast/src/lib/handlers/p.ts b/libs/jast/jast-util-to-texast/src/lib/handlers/p.ts index ec9e29e6..e3a16972 100755 --- a/libs/jast/jast-util-to-texast/src/lib/handlers/p.ts +++ b/libs/jast/jast-util-to-texast/src/lib/handlers/p.ts @@ -1,6 +1,6 @@ import { isElement, P, Xref } from 'jast-types' -import { all } from '../all' -import { J, Text } from '../types' +import { all } from '../all.js' +import { J, Text } from '../types.js' export function p(j: J, p: P) { return j(p, 'paragraph', all(j, p)) @@ -12,12 +12,8 @@ const combineCitations = (p: P): P => { p.children = p.children.reduce((acc: typeof p.children, node, index) => { if ( !( - (isElement(node) && - node.name === 'xref' && - node.attributes.refType === 'bibr') || - (stack.length > 0 && - node.type === 'text' && - node.value.replace(/[ ,]+/g, '') === '') + (isElement(node) && node.name === 'xref' && node.attributes.refType === 'bibr') || + (stack.length > 0 && node.type === 'text' && node.value.replace(/[ ,]+/g, '') === '') ) ) { stack.length > 1 ? acc.push(...combineStack(stack)) : acc.push(...stack) @@ -40,10 +36,7 @@ const combineStack = (nodes: (Text | Xref)[]): (Xref | Text)[] => { lastXref = index + 1 }) - const [rawCitations, stragglers] = [ - nodes.slice(0, lastXref), - nodes.slice(lastXref, -1), - ] + const [rawCitations, stragglers] = [nodes.slice(0, lastXref), nodes.slice(lastXref, -1)] const combinedCitation: Xref = { type: 'element', diff --git a/libs/jast/jast-util-to-texast/src/lib/handlers/refList.ts b/libs/jast/jast-util-to-texast/src/lib/handlers/refList.ts index 78c09c01..8f671f46 100755 --- a/libs/jast/jast-util-to-texast/src/lib/handlers/refList.ts +++ b/libs/jast/jast-util-to-texast/src/lib/handlers/refList.ts @@ -1,8 +1,8 @@ -import { J } from '../types' +import { J } from '../types.js' import { RefList } from 'jast-types' import { Data as CSL } from 'csl-json' import { Environment } from 'texast' -import { wrapCommandArg } from '../util/wrap-command-arg' +import { wrapCommandArg } from '../util/wrap-command-arg.js' import { refListToCSL } from 'jast-util-to-csl' import { cslToBiblatex } from 'csl-to-biblatex' diff --git a/libs/jast/jast-util-to-texast/src/lib/handlers/root.ts b/libs/jast/jast-util-to-texast/src/lib/handlers/root.ts index 1bc96613..df9b23f4 100755 --- a/libs/jast/jast-util-to-texast/src/lib/handlers/root.ts +++ b/libs/jast/jast-util-to-texast/src/lib/handlers/root.ts @@ -1,8 +1,8 @@ // based on https://github.com/syntax-tree/hast-util-to-mdast/blob/main/lib/handlers/em import { Article, Parent, TagHavers } from 'jast-types' -import { all } from '../all' -import { J, Node, Root } from '../types' +import { all } from '../all.js' +import { J, Node, Root } from '../types.js' export function root(j: J, node: Root) { const kids = node.children as TagHavers[] diff --git a/libs/jast/jast-util-to-texast/src/lib/handlers/sec.ts b/libs/jast/jast-util-to-texast/src/lib/handlers/sec.ts index 69648494..e468daab 100755 --- a/libs/jast/jast-util-to-texast/src/lib/handlers/sec.ts +++ b/libs/jast/jast-util-to-texast/src/lib/handlers/sec.ts @@ -1,10 +1,10 @@ import { isElement, Title } from 'jast-types' import { CommandArg, CommandArgOpt, EnvironmentContent } from 'texast' -import { all } from '../all' -import { J, Parents, Name, Node } from '../types' -import { wrap } from '../util/wrap' -import { wrapChildren } from '../util/wrap-children' -import { wrapCommandArg } from '../util/wrap-command-arg' +import { all } from '../all.js' +import { J, Parents, Name, Node } from '../types.js' +import { wrap } from '../util/wrap.js' +import { wrapChildren } from '../util/wrap-children.js' +import { wrapCommandArg } from '../util/wrap-command-arg.js' export const sectionDepth = [ 'part', diff --git a/libs/jast/jast-util-to-texast/src/lib/handlers/sub.ts b/libs/jast/jast-util-to-texast/src/lib/handlers/sub.ts index 6de686f3..ea18fd2a 100755 --- a/libs/jast/jast-util-to-texast/src/lib/handlers/sub.ts +++ b/libs/jast/jast-util-to-texast/src/lib/handlers/sub.ts @@ -1,5 +1,5 @@ -import { all } from '../all' -import { J, Node } from '../types' +import { all } from '../all.js' +import { J, Node } from '../types.js' export function sub(j: J, node: Node) { return j(node, 'sub', all(j, node)) diff --git a/libs/jast/jast-util-to-texast/src/lib/handlers/sup.ts b/libs/jast/jast-util-to-texast/src/lib/handlers/sup.ts index eda1361d..d52d1686 100755 --- a/libs/jast/jast-util-to-texast/src/lib/handlers/sup.ts +++ b/libs/jast/jast-util-to-texast/src/lib/handlers/sup.ts @@ -1,5 +1,5 @@ -import { all } from '../all' -import { J, Node } from '../types' +import { all } from '../all.js' +import { J, Node } from '../types.js' export function sup(j: J, node: Node) { return j(node, 'super', all(j, node)) diff --git a/libs/jast/jast-util-to-texast/src/lib/handlers/table.ts b/libs/jast/jast-util-to-texast/src/lib/handlers/table.ts index b24094dd..0e39d6b8 100755 --- a/libs/jast/jast-util-to-texast/src/lib/handlers/table.ts +++ b/libs/jast/jast-util-to-texast/src/lib/handlers/table.ts @@ -1,8 +1,8 @@ // based on https://github.com/syntax-tree/hast-util-to-mdast/blob/main/lib/handlers/em import { Table, isElement, Element, Tr, Col } from 'jast-types' -import { all } from '../all' -import { J, Node } from '../types' +import { all } from '../all.js' +import { J, Node } from '../types.js' import { visit as origVisit } from 'unist-util-visit' import { CommandArg } from 'texast' @@ -42,7 +42,11 @@ export function table(j: J, table: Table) { if (child.name !== 'td') return - for (let i = 0; i < (child?.attributes?.colspan ?? 1); i++) { + for ( + let i = 0; + i < (child?.attributes?.colspan ? parseInt(child?.attributes?.colspan) : 1); + i++ + ) { tempCols.push('l') } }) @@ -51,7 +55,7 @@ export function table(j: J, table: Table) { if (tempCols.length > columns.length) columns = tempCols tempCols = [] return - } + }, ) const colAlignment = columns.join(` ${j.columnSeparator ? '|' : ''} `) diff --git a/libs/jast/jast-util-to-texast/src/lib/handlers/tableWrap.ts b/libs/jast/jast-util-to-texast/src/lib/handlers/tableWrap.ts index 9ba1a995..0f81922c 100755 --- a/libs/jast/jast-util-to-texast/src/lib/handlers/tableWrap.ts +++ b/libs/jast/jast-util-to-texast/src/lib/handlers/tableWrap.ts @@ -1,8 +1,8 @@ // based on https://github.com/syntax-tree/hast-util-to-mdast/blob/main/lib/handlers/em import { Article, isElement, Parent, TableWrap, TagHavers } from 'jast-types' -import { all } from '../all' -import { J, Node, Root } from '../types' +import { all } from '../all.js' +import { J, Node, Root } from '../types.js' const relativeOrderTable = (element: TableWrap['children'][number]) => { if (!isElement(element)) return 4 diff --git a/libs/jast/jast-util-to-texast/src/lib/handlers/td.ts b/libs/jast/jast-util-to-texast/src/lib/handlers/td.ts index bd0e3c82..7912ca79 100755 --- a/libs/jast/jast-util-to-texast/src/lib/handlers/td.ts +++ b/libs/jast/jast-util-to-texast/src/lib/handlers/td.ts @@ -2,8 +2,8 @@ import { Td } from 'jast-types' import { TableCell } from 'texast' -import { all } from '../all' -import { J, Node } from '../types' +import { all } from '../all.js' +import { J, Node } from '../types.js' export function td(j: J, node: Td) { const { colspan, style, valign } = node.attributes diff --git a/libs/jast/jast-util-to-texast/src/lib/handlers/text.ts b/libs/jast/jast-util-to-texast/src/lib/handlers/text.ts index f8aa6eef..801576f2 100755 --- a/libs/jast/jast-util-to-texast/src/lib/handlers/text.ts +++ b/libs/jast/jast-util-to-texast/src/lib/handlers/text.ts @@ -1,5 +1,5 @@ -import { all } from '../all' -import { J, Node, Text } from '../types' +import { all } from '../all.js' +import { J, Node, Text } from '../types.js' export function text(j: J, node: Text) { return j(node, 'text', node.value) diff --git a/libs/jast/jast-util-to-texast/src/lib/handlers/tr.ts b/libs/jast/jast-util-to-texast/src/lib/handlers/tr.ts index 7708844e..23df103a 100755 --- a/libs/jast/jast-util-to-texast/src/lib/handlers/tr.ts +++ b/libs/jast/jast-util-to-texast/src/lib/handlers/tr.ts @@ -2,8 +2,8 @@ import { Tr } from 'jast-types' import { AlignmentTab, Command, Linebreak, Text } from 'texast' -import { all } from '../all' -import { J, Node } from '../types' +import { all } from '../all.js' +import { J, Node } from '../types.js' export function tr(j: J, node: Tr) { j.rowNumber += 1 @@ -11,10 +11,7 @@ export function tr(j: J, node: Tr) { // too many alignment tabs const contents = contentsNoTabs .filter((node) => node.type === 'tableCell') - .flatMap((cell) => [ - { type: 'alignmentTab', value: '&' } as AlignmentTab, - cell, - ]) + .flatMap((cell) => [{ type: 'alignmentTab', value: '&' } as AlignmentTab, cell]) .slice(1) contents.push({ type: 'linebreak', value: '\\' } as Linebreak) @@ -23,7 +20,7 @@ export function tr(j: J, node: Tr) { (child) => child.type === 'element' && child.name === 'td' && - child.attributes.style?.includes('border-bottom') + child.attributes.style?.includes('border-bottom'), ) ) { const commandName = j.booktabs @@ -39,7 +36,7 @@ export function tr(j: J, node: Tr) { name: commandName, children: [], } as Command, - ] + ], ) } @@ -49,7 +46,7 @@ export function tr(j: J, node: Tr) { (child) => child.type === 'element' && child.name === 'td' && - child.attributes.style?.includes('border-top') + child.attributes.style?.includes('border-top'), ) ) { const commandName = j.booktabs ? 'toprule' : 'hline' diff --git a/libs/jast/jast-util-to-texast/src/lib/handlers/xref.ts b/libs/jast/jast-util-to-texast/src/lib/handlers/xref.ts index 2ae88a56..7410ec03 100755 --- a/libs/jast/jast-util-to-texast/src/lib/handlers/xref.ts +++ b/libs/jast/jast-util-to-texast/src/lib/handlers/xref.ts @@ -2,8 +2,8 @@ import { Xref, Text } from 'jast-types' import { CommandArg } from 'texast' -import { J } from '../types' -import { wrapCommandArg } from '../util/wrap-command-arg' +import { J } from '../types.js' +import { wrapCommandArg } from '../util/wrap-command-arg.js' export function xref(j: J, node: Xref) { // if (!article) { @@ -54,29 +54,17 @@ export function xref(j: J, node: Xref) { let pre let post if (customType) { - const customData: Record = - JSON.parse(customType) - const { - prefix, - infix, - label, - locator, - mode, - suffix, - plainCitation, - formattedCitation, - } = customData + const customData: Record = JSON.parse(customType) + const { prefix, infix, label, locator, mode, suffix, plainCitation, formattedCitation } = + customData const pref = (mode ? infix : prefix) || '' const suff = `${ - label && label !== 'none' - ? `${labelToText[label] || label || 'pp.'} ` - : '' + label && label !== 'none' ? `${labelToText[label] || label || 'pp.'} ` : '' }${locator || ''}` - const isParenthetical = - plainCitation?.startsWith('(') && plainCitation?.endsWith(')') + const isParenthetical = plainCitation?.startsWith('(') && plainCitation?.endsWith(')') command = isParenthetical ? 'parencite' : 'textcite' @@ -85,32 +73,27 @@ export function xref(j: J, node: Xref) { } const optCommandArgs = createOptCiteArgs(pre, post) - return j( - node, - 'command', - { name: command || j.citationAnalyzer(node) || 'autocite' }, - [ - ...optCommandArgs, - { - type: 'commandArg', - children: [ - { - type: 'text', - value: - node.attributes.rid || - node.children - .map((node) => { - //@ts-expect-error it is text, it has value - const n = node?.value?.replace(/[[\], ]/g, '') - return n ? `bib${n}` : undefined - }) - .filter((n) => !!n) - .join(','), - }, - ], - }, - ] - ) + return j(node, 'command', { name: command || j.citationAnalyzer(node) || 'autocite' }, [ + ...optCommandArgs, + { + type: 'commandArg', + children: [ + { + type: 'text', + value: + node.attributes.rid || + node.children + .map((node) => { + //@ts-expect-error it is text, it has value + const n = node?.value?.replace(/[[\], ]/g, '') + return n ? `bib${n}` : undefined + }) + .filter((n) => !!n) + .join(','), + }, + ], + }, + ]) } case 'fig': { return j(node, 'command', { name: 'autocite' }, [ @@ -148,7 +131,7 @@ export function xref(j: J, node: Xref) { node, 'command', { name: refTypeMap[node.attributes.refType || 'default'] || 'ref' }, - [wrapCommandArg(j, node.children)] + [wrapCommandArg(j, node.children)], ) } // } diff --git a/libs/jast/jast-util-to-texast/src/lib/jast-util-to-texast.ts b/libs/jast/jast-util-to-texast/src/lib/jast-util-to-texast.ts index 5d0a413b..70c0cbe5 100755 --- a/libs/jast/jast-util-to-texast/src/lib/jast-util-to-texast.ts +++ b/libs/jast/jast-util-to-texast/src/lib/jast-util-to-texast.ts @@ -1,5 +1,5 @@ -import { one } from './one' -import { handlers } from './handlers/index' +import { one } from './one.js' +import { handlers } from './handlers/index.js' import { Context, @@ -11,12 +11,12 @@ import { Node, Options, Attributes, -} from './types' +} from './types.js' import { convert } from 'unist-util-is' import rehypeMinifyWhitespace from 'rehype-minify-whitespace' -export { one } from './one' -export { all } from './all' +export { one } from './one.js' +export { all } from './all.js' export { handlers as defaultHandlers } const block = convert(['heading', 'paragraph', 'root']) diff --git a/libs/jast/jast-util-to-texast/src/lib/one.ts b/libs/jast/jast-util-to-texast/src/lib/one.ts index 889cc564..68d80c6b 100755 --- a/libs/jast/jast-util-to-texast/src/lib/one.ts +++ b/libs/jast/jast-util-to-texast/src/lib/one.ts @@ -1,14 +1,10 @@ import { Parent } from 'jast-types' -import { all } from './all' -import { Handle, J, TexastContent, Node, Element } from './types' -import { own } from './util/own' -import { wrapText } from './util/wrap-text' +import { all } from './all.js' +import { Handle, J, TexastContent, Node, Element } from './types.js' +import { own } from './util/own.js' +import { wrapText } from './util/wrap-text.js' -export function one( - j: J, - node: Node, - parent: Parent -): TexastContent | Array | void { +export function one(j: J, node: Node, parent: Parent): TexastContent | Array | void { let fn: Handle | undefined if (node.type === 'element') { diff --git a/libs/jast/jast-util-to-texast/src/lib/test/test.spec.ts b/libs/jast/jast-util-to-texast/src/lib/test/test.spec.ts index 67bece59..75d6c394 100755 --- a/libs/jast/jast-util-to-texast/src/lib/test/test.spec.ts +++ b/libs/jast/jast-util-to-texast/src/lib/test/test.spec.ts @@ -1,10 +1,10 @@ import { readdirSync, readFileSync, writeFileSync } from 'fs' import { join } from 'path' import rejourParse from 'rejour-parse' -import { toTexast } from '../jast-util-to-texast' +import { toTexast } from '../jast-util-to-texast.js' import relatexStringify from 'relatex-stringify' import { unified } from 'unified' -import { TexastContent, Options, TexastRoot } from '../types' +import { TexastContent, Options, TexastRoot } from '../types.js' import { removePosition } from 'unist-util-remove-position' import { toLatex } from 'texast-util-to-latex' @@ -25,14 +25,14 @@ const fixtures = new URL('fixtures', import.meta.url) const dir = readdirSync(fixtures) const arrDir = dir.map((f) => f) const doubleDir = dir.map((f) => [ - join(fixtures, f, 'index.jats.xml'), - join(fixtures, f, 'index.tex'), - join(fixtures, f, 'indexon'), + join(fixtures.pathname, f, 'index.jats.xml'), + join(fixtures.pathname, f, 'index.tex'), + join(fixtures.pathname, f, 'indexon'), ]) describe.each(dir)('parses correctly for %s', (name: string) => { - const [jats, latex, json] = ['index.jats.xml', 'index.tex', 'index.json'].map( - (ext) => join(fixtures, name, ext) + const [jats, latex, json] = ['index.jats.xml', 'index.tex', 'index.json'].map((ext) => + join(fixtures.pathname, name, ext), ) const jatsIn = String(readFileSync(jats)) @@ -51,7 +51,6 @@ describe.each(dir)('parses correctly for %s', (name: string) => { let tree: TexastRoot = { type: 'root', children: [] } try { - //@ts-expect-error tree = removePosition(proc.runSync(xmlTree), true) } catch (e) { console.error('woops') @@ -69,11 +68,11 @@ describe.each(dir)('parses correctly for %s', (name: string) => { if (name === 'complete') { writeFileSync( join('libs', 'rejour', 'jast-util-to-texast', 'jasttree'), - JSON.stringify(xmlTree, null, 2) + JSON.stringify(xmlTree, null, 2), ) writeFileSync( join('libs', 'rejour', 'jast-util-to-texast', 'texasttree'), - JSON.stringify(tree, null, 2) + JSON.stringify(tree, null, 2), ) writeFileSync( join( @@ -85,9 +84,9 @@ describe.each(dir)('parses correctly for %s', (name: string) => { 'test', 'fixtures', 'complete', - 'test.tex' + 'test.tex', ), - lx + lx, ) } test('should match snapshot', () => { diff --git a/libs/jast/jast-util-to-texast/src/lib/util/wrap-children.ts b/libs/jast/jast-util-to-texast/src/lib/util/wrap-children.ts index 3b342f02..03205735 100755 --- a/libs/jast/jast-util-to-texast/src/lib/util/wrap-children.ts +++ b/libs/jast/jast-util-to-texast/src/lib/util/wrap-children.ts @@ -1,6 +1,6 @@ -import { all } from '../all' -import { J, TexastContent, Node } from '../types' -import { wrap } from './wrap' +import { all } from '../all.js' +import { J, TexastContent, Node } from '../types.js' +import { wrap } from './wrap.js' export function wrapChildren(j: J, node: Node): Array { return wrap(all(j, node)) diff --git a/libs/jast/jast-util-to-texast/src/lib/util/wrap-command-arg.ts b/libs/jast/jast-util-to-texast/src/lib/util/wrap-command-arg.ts index f868568d..75293c5b 100755 --- a/libs/jast/jast-util-to-texast/src/lib/util/wrap-command-arg.ts +++ b/libs/jast/jast-util-to-texast/src/lib/util/wrap-command-arg.ts @@ -1,13 +1,13 @@ import { P } from 'jast-types' import { CommandArg, CommandContent, ParagraphContent } from 'texast' -import { all } from '../all' -import { one } from '../one' -import { Content, J, Node, Parent, Element } from '../types' +import { all } from '../all.js' +import { one } from '../one.js' +import { Content, J, Node, Parent, Element } from '../types.js' export function wrapCommandArg( j: J, nodes: P['children'][number][], - optional?: boolean + optional?: boolean, ): CommandArg { const fakeNode: P = { type: 'element', diff --git a/libs/jast/jast-util-to-texast/src/lib/util/wrap-text.ts b/libs/jast/jast-util-to-texast/src/lib/util/wrap-text.ts index c900bdc4..6a82d656 100755 --- a/libs/jast/jast-util-to-texast/src/lib/util/wrap-text.ts +++ b/libs/jast/jast-util-to-texast/src/lib/util/wrap-text.ts @@ -1,4 +1,4 @@ -import { J } from '../types' +import { J } from '../types.js' export function wrapText(j: J, value: string): string { return j.wrapText ? value : value.replace(/\r?\n|\r/g, ' ') diff --git a/libs/jast/jast-util-to-texast/src/lib/util/wrap.ts b/libs/jast/jast-util-to-texast/src/lib/util/wrap.ts index c489af4d..0ddef2b0 100755 --- a/libs/jast/jast-util-to-texast/src/lib/util/wrap.ts +++ b/libs/jast/jast-util-to-texast/src/lib/util/wrap.ts @@ -1,20 +1,14 @@ import { isParagraphContent } from 'texast' -import { TexastContent, TexastParagraphContent } from '../types' +import { TexastContent, TexastParagraphContent } from '../types.js' //import { phrasing } from 'mdast-util-phrasing' export function wrap(nodes: Array) { return runs(nodes, onphrasing) - function onphrasing( - nodes: Array - ): TexastContent | Array { + function onphrasing(nodes: Array): TexastContent | Array { const head = nodes[0] - if ( - nodes.length === 1 && - head.type === 'text' && - (head.value === ' ' || head.value === '\n') - ) { + if (nodes.length === 1 && head.type === 'text' && (head.value === ' ' || head.value === '\n')) { return [] } @@ -38,10 +32,7 @@ export function wrapNeeded(nodes: Array): boolean { while (++index < nodes.length) { node = nodes[index] - if ( - !isParagraphContent(node) || - ('children' in node && wrapNeeded(node.children)) - ) { + if (!isParagraphContent(node) || ('children' in node && wrapNeeded(node.children))) { return true } } @@ -54,10 +45,8 @@ export function wrapNeeded(nodes: Array): boolean { */ function runs( nodes: Array, - onphrasing: ( - nodes: Array - ) => TexastContent | Array, - onnonphrasing?: (node: TexastContent) => TexastContent + onphrasing: (nodes: Array) => TexastContent | Array, + onnonphrasing?: (node: TexastContent) => TexastContent, ) { const nonphrasing = onnonphrasing || identity const flattened: Array = flatten(nodes) @@ -94,7 +83,7 @@ function runs( */ function flatten(nodes: Array): Array { /** @type {Array.TexastContent>} */ - let flattened: Array = [] + const flattened: Array = [] let index = -1 /** @type TexastContent} */ let node: TexastContent diff --git a/libs/jast/jast/project.json b/libs/jast/jast/project.json index 841a963c..06f6bb2a 100755 --- a/libs/jast/jast/project.json +++ b/libs/jast/jast/project.json @@ -11,8 +11,11 @@ "packageJSON": "libs/jast/jast/package.json" } }, + "make-publishable": { + "executor": "better-nx-tsc:publishable" + }, "build": { - "executor": "better-nx-tsc:tsc", + "executor": "@nrwl/js:tsc", "outputs": ["{options.outputPath}"], "options": { "rootDir": "libs/jast/jast/src", diff --git a/libs/notion/html-to-notion-blocks/project.json b/libs/notion/html-to-notion-blocks/project.json index 78d58b88..d2ea3f52 100644 --- a/libs/notion/html-to-notion-blocks/project.json +++ b/libs/notion/html-to-notion-blocks/project.json @@ -11,8 +11,11 @@ "packageJSON": "libs/notion/html-to-notion-blocks/package.json" } }, + "make-publishable": { + "executor": "better-nx-tsc:publishable" + }, "build": { - "executor": "better-nx-tsc:tsc", + "executor": "@nrwl/js:tsc", "outputs": ["{options.outputPath}"], "options": { "rootDir": "libs/notion/html-to-notion-blocks/src", diff --git a/libs/notion/rehype-notion/project.json b/libs/notion/rehype-notion/project.json index f8070125..77c2dd9b 100644 --- a/libs/notion/rehype-notion/project.json +++ b/libs/notion/rehype-notion/project.json @@ -11,8 +11,11 @@ "packageJSON": "libs/notion/rehype-notion/package.json" } }, + "make-publishable": { + "executor": "better-nx-tsc:publishable" + }, "build": { - "executor": "better-nx-tsc:tsc", + "executor": "@nrwl/js:tsc", "outputs": ["{options.outputPath}"], "options": { "rootDir": "libs/notion/rehype-notion/src", diff --git a/libs/ojs/ojs-relatex/project.json b/libs/ojs/ojs-relatex/project.json index aeeea0ec..7be36b0e 100755 --- a/libs/ojs/ojs-relatex/project.json +++ b/libs/ojs/ojs-relatex/project.json @@ -18,8 +18,11 @@ "lintFilePatterns": ["libs/ojs/ojs-relatex/**/*.ts"] } }, + "make-publishable": { + "executor": "better-nx-tsc:publishable" + }, "build": { - "executor": "better-nx-tsc:tsc", + "executor": "@nrwl/js:tsc", "outputs": ["{options.outputPath}"], "options": { "rootDir": "libs/ojs/ojs-relatex/src", diff --git a/libs/ojs/ojs-relatex/src/lib/ojs-relatex.spec.ts b/libs/ojs/ojs-relatex/src/lib/ojs-relatex.spec.ts index 2777dd1c..99e8dbac 100755 --- a/libs/ojs/ojs-relatex/src/lib/ojs-relatex.spec.ts +++ b/libs/ojs/ojs-relatex/src/lib/ojs-relatex.spec.ts @@ -1,5 +1,5 @@ import {Node} from 'unist' -import { ojs-relatex } from './ojs-relatex'; +import { ojs-relatex } from './ojs-relatex.js'; describe('ojs-relatex', () => { diff --git a/libs/ooxast/ooxast-util-citation-plugin/project.json b/libs/ooxast/ooxast-util-citation-plugin/project.json index 76f62bae..3f2cb883 100755 --- a/libs/ooxast/ooxast-util-citation-plugin/project.json +++ b/libs/ooxast/ooxast-util-citation-plugin/project.json @@ -26,8 +26,11 @@ "passWithNoTests": true } }, + "make-publishable": { + "executor": "better-nx-tsc:publishable" + }, "build": { - "executor": "better-nx-tsc:tsc", + "executor": "@nrwl/js:tsc", "outputs": ["{options.outputPath}"], "options": { "rootDir": "libs/ooxast/ooxast-util-citation-plugin/src", diff --git a/libs/ooxast/ooxast-util-citations/project.json b/libs/ooxast/ooxast-util-citations/project.json index e4649400..3c21267e 100755 --- a/libs/ooxast/ooxast-util-citations/project.json +++ b/libs/ooxast/ooxast-util-citations/project.json @@ -26,8 +26,11 @@ "passWithNoTests": true } }, + "make-publishable": { + "executor": "better-nx-tsc:publishable" + }, "build": { - "executor": "better-nx-tsc:tsc", + "executor": "@nrwl/js:tsc", "outputs": ["{options.outputPath}"], "options": { "rootDir": "libs/ooxast/ooxast-util-citations/src", diff --git a/libs/ooxast/ooxast-util-citations/src/lib/constructMendeleyCitation.ts b/libs/ooxast/ooxast-util-citations/src/lib/constructMendeleyCitation.ts index 6ccadc42..62f9c51c 100755 --- a/libs/ooxast/ooxast-util-citations/src/lib/constructMendeleyCitation.ts +++ b/libs/ooxast/ooxast-util-citations/src/lib/constructMendeleyCitation.ts @@ -1,13 +1,13 @@ import { Citation, CitationItem, Mendeley, MendeleyCitation } from './types.js' import { Data as CSL } from 'csl-json' import { findRef } from './findRefInBib.js' -import { VFile } from 'vfile' +// import { VFile } from 'vfile' export function constructMendeleyCitation( curr: Citation, index: number, bibliography?: CSL[], - message?: VFile['message'], + // message?: VFile['message'], ): MendeleyCitation { const schema = 'https://github.com/citation-style-language/schema/raw/master/csl-citation.json' diff --git a/libs/ooxast/ooxast-util-citations/src/lib/ooxast-util-citations.ts b/libs/ooxast/ooxast-util-citations/src/lib/ooxast-util-citations.ts index 5f43d971..b69e013f 100755 --- a/libs/ooxast/ooxast-util-citations/src/lib/ooxast-util-citations.ts +++ b/libs/ooxast/ooxast-util-citations/src/lib/ooxast-util-citations.ts @@ -234,7 +234,7 @@ export function constructCitation( ): { citation: MendeleyCitation | ZoteroCitation; instr: string } { switch (type) { case 'mendeley': { - const citation = constructMendeleyCitation(curr, index, bibliography, message) + const citation = constructMendeleyCitation(curr, index, bibliography) return { instr: `ADDIN CSL_CITATION ${JSON.stringify(citation)}`, citation, diff --git a/libs/ooxast/ooxast-util-citations/tsconfig.lib.json b/libs/ooxast/ooxast-util-citations/tsconfig.lib.json index 53047cda..5c108b84 100755 --- a/libs/ooxast/ooxast-util-citations/tsconfig.lib.json +++ b/libs/ooxast/ooxast-util-citations/tsconfig.lib.json @@ -6,5 +6,5 @@ "types": ["node"] }, "exclude": ["**/*.spec.ts", "**/*.test.ts", "jest.config.ts"], - "include": ["src/**/*.ts"] + "include": ["**/*.ts"] } diff --git a/libs/ooxast/ooxast-util-get-style/project.json b/libs/ooxast/ooxast-util-get-style/project.json index e7f4a652..fd468d92 100755 --- a/libs/ooxast/ooxast-util-get-style/project.json +++ b/libs/ooxast/ooxast-util-get-style/project.json @@ -26,8 +26,11 @@ "passWithNoTests": true } }, + "make-publishable": { + "executor": "better-nx-tsc:publishable" + }, "build": { - "executor": "better-nx-tsc:tsc", + "executor": "@nrwl/js:tsc", "outputs": ["{options.outputPath}"], "options": { "rootDir": "libs/ooxast/ooxast-util-get-style/src", diff --git a/libs/ooxast/ooxast-util-get-style/tsconfig.spec.json b/libs/ooxast/ooxast-util-get-style/tsconfig.spec.json index f61dd898..7e1d3b87 100755 --- a/libs/ooxast/ooxast-util-get-style/tsconfig.spec.json +++ b/libs/ooxast/ooxast-util-get-style/tsconfig.spec.json @@ -2,9 +2,7 @@ "extends": "./tsconfig.json", "compilerOptions": { "outDir": "../../../dist/out-tsc", - "types": ["jest", "node"], - "module": "ESNext", - "target": "ESNext" + "types": ["jest", "node"] }, "include": [ "**/*.test.ts", diff --git a/libs/ooxast/ooxast-util-markup-to-style/project.json b/libs/ooxast/ooxast-util-markup-to-style/project.json index f55610a2..f6f465a9 100644 --- a/libs/ooxast/ooxast-util-markup-to-style/project.json +++ b/libs/ooxast/ooxast-util-markup-to-style/project.json @@ -4,8 +4,11 @@ "sourceRoot": "libs/ooxast/ooxast-util-markup-to-style/src", "projectType": "library", "targets": { + "make-publishable": { + "executor": "better-nx-tsc:publishable" + }, "build": { - "executor": "better-nx-tsc:tsc", + "executor": "@nrwl/js:tsc", "outputs": ["{options.outputPath}"], "options": { "rootDir": "libs/ooxast/ooxast-util-markup-to-style/src", diff --git a/libs/ooxast/ooxast-util-markup-to-style/tsconfig.lib.json b/libs/ooxast/ooxast-util-markup-to-style/tsconfig.lib.json index 53047cda..7466385a 100644 --- a/libs/ooxast/ooxast-util-markup-to-style/tsconfig.lib.json +++ b/libs/ooxast/ooxast-util-markup-to-style/tsconfig.lib.json @@ -5,6 +5,6 @@ "declaration": true, "types": ["node"] }, - "exclude": ["**/*.spec.ts", "**/*.test.ts", "jest.config.ts"], - "include": ["src/**/*.ts"] + "exclude": ["**/*.spec.ts", "**/*.test.ts", "vite.config.ts"], + "include": ["**/*.ts"] } diff --git a/libs/ooxast/ooxast-util-parse-bib-browser/project.json b/libs/ooxast/ooxast-util-parse-bib-browser/project.json index 9c07a7d5..a6b4104e 100755 --- a/libs/ooxast/ooxast-util-parse-bib-browser/project.json +++ b/libs/ooxast/ooxast-util-parse-bib-browser/project.json @@ -26,8 +26,11 @@ "passWithNoTests": true } }, + "make-publishable": { + "executor": "better-nx-tsc:publishable" + }, "build": { - "executor": "better-nx-tsc:tsc", + "executor": "@nrwl/js:tsc", "outputs": ["{options.outputPath}"], "options": { "rootDir": "libs/ooxast/ooxast-util-parse-bib-browser/src", diff --git a/libs/ooxast/ooxast-util-parse-bib-browser/src/lib/fix-csl.ts b/libs/ooxast/ooxast-util-parse-bib-browser/src/lib/fix-csl.ts index 3f863575..d539c4da 100755 --- a/libs/ooxast/ooxast-util-parse-bib-browser/src/lib/fix-csl.ts +++ b/libs/ooxast/ooxast-util-parse-bib-browser/src/lib/fix-csl.ts @@ -28,7 +28,7 @@ export function fixCSLAbbreviations(csl: CSL): CSL { return auth } - if (/^([A-Z]\.)+$/.test(auth.given)) { + if (/^(?:[A-Z]\.)+$/.test(auth.given)) { auth.given = auth.given.replace(/\./g, '') } diff --git a/libs/ooxast/ooxast-util-parse-bib-browser/src/lib/ooxast-util-parse-bib.spec.ts b/libs/ooxast/ooxast-util-parse-bib-browser/src/lib/ooxast-util-parse-bib.spec.ts index 1910dc80..85b37270 100755 --- a/libs/ooxast/ooxast-util-parse-bib-browser/src/lib/ooxast-util-parse-bib.spec.ts +++ b/libs/ooxast/ooxast-util-parse-bib-browser/src/lib/ooxast-util-parse-bib.spec.ts @@ -2,17 +2,13 @@ import { docxToVFile } from 'docx-to-vfile' import reoffParse from 'reoff-parse' import { readFile } from 'fs/promises' import { unified } from 'unified' -import { parseBib } from './ooxast-util-parse-bib-browser' -import { toString } from 'xast-util-to-string' -import { writeFileSync } from 'fs' -import { bibToCSL } from './bib-to-csl' -import { findBib } from './find-bib' +import { parseBib } from './ooxast-util-parse-bib-browser.js' +import { bibToCSL } from './bib-to-csl.js' +import { findBib } from './find-bib.js' async function getTree() { // If in node, get the correct docx uintarray like so - const docxBuff = await readFile( - new URL('../fixtures/index.docx', import.meta.url) - ) + const docxBuff = await readFile(new URL('../fixtures/index.docx', import.meta.url)) const docxArr = new Uint8Array(docxBuff) // if in the browser, find some way diff --git a/libs/ooxast/ooxast-util-parse-bib-browser/tsconfig.spec.json b/libs/ooxast/ooxast-util-parse-bib-browser/tsconfig.spec.json index f61dd898..7e1d3b87 100755 --- a/libs/ooxast/ooxast-util-parse-bib-browser/tsconfig.spec.json +++ b/libs/ooxast/ooxast-util-parse-bib-browser/tsconfig.spec.json @@ -2,9 +2,7 @@ "extends": "./tsconfig.json", "compilerOptions": { "outDir": "../../../dist/out-tsc", - "types": ["jest", "node"], - "module": "ESNext", - "target": "ESNext" + "types": ["jest", "node"] }, "include": [ "**/*.test.ts", diff --git a/libs/ooxast/ooxast-util-parse-bib-node/project.json b/libs/ooxast/ooxast-util-parse-bib-node/project.json index 4525ec49..2da7c9b5 100755 --- a/libs/ooxast/ooxast-util-parse-bib-node/project.json +++ b/libs/ooxast/ooxast-util-parse-bib-node/project.json @@ -26,8 +26,11 @@ "passWithNoTests": true } }, + "make-publishable": { + "executor": "better-nx-tsc:publishable" + }, "build": { - "executor": "better-nx-tsc:tsc", + "executor": "@nrwl/js:tsc", "outputs": ["{options.outputPath}"], "options": { "rootDir": "libs/ooxast/ooxast-util-parse-bib-node/src", diff --git a/libs/ooxast/ooxast-util-parse-bib-node/src/lib/bib-to-csl-node.ts b/libs/ooxast/ooxast-util-parse-bib-node/src/lib/bib-to-csl-node.ts index 2d247086..27ef2244 100755 --- a/libs/ooxast/ooxast-util-parse-bib-node/src/lib/bib-to-csl-node.ts +++ b/libs/ooxast/ooxast-util-parse-bib-node/src/lib/bib-to-csl-node.ts @@ -1,7 +1,7 @@ -import { callAnystyleApi } from './anystyle-api' -import { findBib } from './find-bib' -import { fixBib } from './fix-csl' -import { Options } from './ooxast-util-parse-bib' +import { callAnystyleApi } from './anystyle-api.js' +import { findBib } from './find-bib.js' +import { fixBib } from './fix-csl.js' +import { Options } from './ooxast-util-parse-bib.js' import { Data as CSL } from 'csl-json' import { Node } from 'ooxast' diff --git a/libs/ooxast/ooxast-util-parse-bib-node/src/lib/ooxast-util-parse-bib.spec.ts b/libs/ooxast/ooxast-util-parse-bib-node/src/lib/ooxast-util-parse-bib.spec.ts index daca51cb..ba98a3a9 100755 --- a/libs/ooxast/ooxast-util-parse-bib-node/src/lib/ooxast-util-parse-bib.spec.ts +++ b/libs/ooxast/ooxast-util-parse-bib-node/src/lib/ooxast-util-parse-bib.spec.ts @@ -8,15 +8,13 @@ import { findBib, bibToCSL, parseBib, -} from './ooxast-util-parse-bib' +} from './ooxast-util-parse-bib.js' import { toString } from 'xast-util-to-string' import { writeFileSync } from 'fs' async function getTree() { // If in node, get the correct docx uintarray like so - const docxBuff = await readFile( - new URL('../fixtures/index.docx', import.meta.url) - ) + const docxBuff = await readFile(new URL('../fixtures/index.docx', import.meta.url)) const docxArr = new Uint8Array(docxBuff) // if in the browser, find some way diff --git a/libs/ooxast/ooxast-util-parse-bib-node/src/lib/ooxast-util-parse-bib.ts b/libs/ooxast/ooxast-util-parse-bib-node/src/lib/ooxast-util-parse-bib.ts index 2b4eb060..99fabb4d 100755 --- a/libs/ooxast/ooxast-util-parse-bib-node/src/lib/ooxast-util-parse-bib.ts +++ b/libs/ooxast/ooxast-util-parse-bib-node/src/lib/ooxast-util-parse-bib.ts @@ -1,6 +1,6 @@ import { Node } from 'ooxast' import { consolidate } from 'csl-consolidate' -import { bibToCSL } from './bib-to-csl-node' +import { bibToCSL } from './bib-to-csl-node.js' export interface Options { apiUrl?: string apiParams?: { param: string } diff --git a/libs/ooxast/ooxast-util-parse-bib-node/tsconfig.spec.json b/libs/ooxast/ooxast-util-parse-bib-node/tsconfig.spec.json index f61dd898..7e1d3b87 100755 --- a/libs/ooxast/ooxast-util-parse-bib-node/tsconfig.spec.json +++ b/libs/ooxast/ooxast-util-parse-bib-node/tsconfig.spec.json @@ -2,9 +2,7 @@ "extends": "./tsconfig.json", "compilerOptions": { "outDir": "../../../dist/out-tsc", - "types": ["jest", "node"], - "module": "ESNext", - "target": "ESNext" + "types": ["jest", "node"] }, "include": [ "**/*.test.ts", diff --git a/libs/ooxast/ooxast-util-parse-bib/project.json b/libs/ooxast/ooxast-util-parse-bib/project.json index 71eae76c..f5d3a9d4 100755 --- a/libs/ooxast/ooxast-util-parse-bib/project.json +++ b/libs/ooxast/ooxast-util-parse-bib/project.json @@ -26,8 +26,11 @@ "passWithNoTests": true } }, + "make-publishable": { + "executor": "better-nx-tsc:publishable" + }, "build": { - "executor": "better-nx-tsc:tsc", + "executor": "@nrwl/js:tsc", "outputs": ["{options.outputPath}"], "options": { "rootDir": "libs/ooxast/ooxast-util-parse-bib/src", diff --git a/libs/ooxast/ooxast-util-parse-bib/tsconfig.spec.json b/libs/ooxast/ooxast-util-parse-bib/tsconfig.spec.json index f61dd898..7e1d3b87 100755 --- a/libs/ooxast/ooxast-util-parse-bib/tsconfig.spec.json +++ b/libs/ooxast/ooxast-util-parse-bib/tsconfig.spec.json @@ -2,9 +2,7 @@ "extends": "./tsconfig.json", "compilerOptions": { "outDir": "../../../dist/out-tsc", - "types": ["jest", "node"], - "module": "ESNext", - "target": "ESNext" + "types": ["jest", "node"] }, "include": [ "**/*.test.ts", diff --git a/libs/ooxast/ooxast-util-properties/project.json b/libs/ooxast/ooxast-util-properties/project.json index 91c80aee..dadb11a8 100644 --- a/libs/ooxast/ooxast-util-properties/project.json +++ b/libs/ooxast/ooxast-util-properties/project.json @@ -11,8 +11,11 @@ "packageJSON": "libs/ooxast/ooxast-util-properties/package.json" } }, + "make-publishable": { + "executor": "better-nx-tsc:publishable" + }, "build": { - "executor": "better-nx-tsc:tsc", + "executor": "@nrwl/js:tsc", "outputs": ["{options.outputPath}"], "options": { "rootDir": "libs/ooxast/ooxast-util-properties/src", diff --git a/libs/ooxast/ooxast-util-properties/tsconfig.lib.json b/libs/ooxast/ooxast-util-properties/tsconfig.lib.json index b171559d..fd5452b1 100644 --- a/libs/ooxast/ooxast-util-properties/tsconfig.lib.json +++ b/libs/ooxast/ooxast-util-properties/tsconfig.lib.json @@ -6,5 +6,5 @@ "types": ["node"] }, "exclude": ["**/*.spec.ts", "**/*.test.ts", "jest.config.js"], - "include": ["**/*.ts", "jest.config.js"] + "include": ["**/*.ts"] } diff --git a/libs/ooxast/ooxast-util-remove-rsid/project.json b/libs/ooxast/ooxast-util-remove-rsid/project.json index 63c9ff92..2a3b7984 100755 --- a/libs/ooxast/ooxast-util-remove-rsid/project.json +++ b/libs/ooxast/ooxast-util-remove-rsid/project.json @@ -26,8 +26,11 @@ "passWithNoTests": true } }, + "make-publishable": { + "executor": "better-nx-tsc:publishable" + }, "build": { - "executor": "better-nx-tsc:tsc", + "executor": "@nrwl/js:tsc", "outputs": ["{options.outputPath}"], "options": { "rootDir": "libs/ooxast/ooxast-util-remove-rsid/src", diff --git a/libs/ooxast/ooxast-util-remove-rsid/src/lib/ooxast-util-remove-rsid.ts b/libs/ooxast/ooxast-util-remove-rsid/src/lib/ooxast-util-remove-rsid.ts index 9db1ff8f..dfd4211d 100755 --- a/libs/ooxast/ooxast-util-remove-rsid/src/lib/ooxast-util-remove-rsid.ts +++ b/libs/ooxast/ooxast-util-remove-rsid/src/lib/ooxast-util-remove-rsid.ts @@ -2,10 +2,8 @@ import { visit, remove } from 'misc' import { Text, Root, Node, P, R } from 'ooxast' import { convertElement, isElement } from 'xast-util-is-element' import { select } from 'xast-util-select' -import { removePosition } from 'unist-util-remove-position' import { select as unistSelect } from 'unist-util-select' import { getRStyle } from 'ooxast-util-get-style' -import { toString } from 'xast-util-to-string' // Check to see if node is a paragraph, because we want to merge elements in a paragraph const isP = convertElement

('w:p') @@ -21,9 +19,13 @@ export function ooxastUtilRemoveRsid(tree: Root | Node, options?: Options): Root visit(tree, isP, (node: P) => { // Clean rsid props from P const { - 'w:rsidR': rr, - 'w:rsidRPr': rpr, + // eslint-disable-next-line @typescript-eslint/no-unused-vars + 'w:rsidR': _rr, + // eslint-disable-next-line @typescript-eslint/no-unused-vars + 'w:rsidRPr': _rpr, + // eslint-disable-next-line @typescript-eslint/no-unused-vars 'w:rsidRDefault': rd, + // eslint-disable-next-line @typescript-eslint/no-unused-vars 'w:rsidP': rp, ...rest } = node.attributes @@ -121,6 +123,7 @@ function merge(prev: R, curr: R): R { } function removeRsid(node: R): R { + // eslint-disable-next-line @typescript-eslint/no-unused-vars const { 'w:rsidRPr': rp, 'w:rsidR': r, ...rest } = node.attributes node.attributes = rest as any return node diff --git a/libs/ooxast/ooxast-util-to-hast/project.json b/libs/ooxast/ooxast-util-to-hast/project.json index 80501536..0a1577d8 100644 --- a/libs/ooxast/ooxast-util-to-hast/project.json +++ b/libs/ooxast/ooxast-util-to-hast/project.json @@ -4,8 +4,11 @@ "sourceRoot": "libs/ooxast/ooxast-util-to-hast/src", "projectType": "library", "targets": { + "make-publishable": { + "executor": "better-nx-tsc:publishable" + }, "build": { - "executor": "better-nx-tsc:tsc", + "executor": "@nrwl/js:tsc", "outputs": ["{options.outputPath}"], "options": { "rootDir": "libs/ooxast/ooxast-util-to-hast/src", diff --git a/libs/ooxast/ooxast-util-to-hast/src/index.ts b/libs/ooxast/ooxast-util-to-hast/src/index.ts index 0240af8e..5a09e884 100644 --- a/libs/ooxast/ooxast-util-to-hast/src/index.ts +++ b/libs/ooxast/ooxast-util-to-hast/src/index.ts @@ -1 +1 @@ -export { toHast } from './lib/ooxast-util-to-hast' +export { toHast } from './lib/ooxast-util-to-hast.js' diff --git a/libs/ooxast/ooxast-util-to-hast/src/lib/all.ts b/libs/ooxast/ooxast-util-to-hast/src/lib/all.ts index dc40d9c3..0e374b9e 100755 --- a/libs/ooxast/ooxast-util-to-hast/src/lib/all.ts +++ b/libs/ooxast/ooxast-util-to-hast/src/lib/all.ts @@ -1,5 +1,5 @@ -import { one } from './one' -import { H, HastContent, Node, Parent, Handle, HastParent } from './types' +import { one } from './one.js' +import { H, HastContent, Node, Parent, Handle, HastParent } from './types.js' /** * Convert all nodes in tree using h @@ -11,7 +11,7 @@ import { H, HastContent, Node, Parent, Handle, HastParent } from './types' export function all( // h: H, - parent: Node + parent: Node, ): // Array HastContent[] { // @ts-expect-error Assume `parent` is a parent. diff --git a/libs/ooxast/ooxast-util-to-hast/src/lib/handlers/body.spec.ts b/libs/ooxast/ooxast-util-to-hast/src/lib/handlers/body.spec.ts index 99883012..700f84ce 100755 --- a/libs/ooxast/ooxast-util-to-hast/src/lib/handlers/body.spec.ts +++ b/libs/ooxast/ooxast-util-to-hast/src/lib/handlers/body.spec.ts @@ -1,6 +1,6 @@ import { x } from 'xastscript' import { h } from 'hastscript' -import { toHast } from '../ooxast-util-to-hast' +import { toHast } from '../ooxast-util-to-hast.js' import fs from 'fs' // import { removePosition } from 'unist-util-remove-position' @@ -9,24 +9,18 @@ it('should work', () => { x('w:body', {}, [ x('w:p', {}, [ x('w:pPr', {}, [x('w:pStyle', { 'w:val': 'Heading1' })]), - x('w:r', {}, [ - x('w:rPr', {}, []), - x('w:t', {}, [{ type: 'text', value: 'hey' }]), - ]), + x('w:r', {}, [x('w:rPr', {}, []), x('w:t', {}, [{ type: 'text', value: 'hey' }])]), ]), x('w:p', {}, []), ]), ]) expect(toHast(doc)).toEqual( - h('body', h('sec', {}, [h('title', {}, [{ type: 'text', value: 'hey' }])])) + h('body', h('sec', {}, [h('title', {}, [{ type: 'text', value: 'hey' }])])), ) }) it('lets try', () => { - const ooxloc = new URL( - '../../../../../reoff/reoff-parse/src/test/ooxasttree', - import.meta.url - ) + const ooxloc = new URL('../../../../../reoff/reoff-parse/src/test/ooxasttree', import.meta.url) const x = fs.readFileSync(ooxloc, { encoding: 'utf-8' }) const tree = JSON.parse(x) diff --git a/libs/ooxast/ooxast-util-to-hast/src/lib/handlers/body.ts b/libs/ooxast/ooxast-util-to-hast/src/lib/handlers/body.ts index 3174e685..326d5137 100755 --- a/libs/ooxast/ooxast-util-to-hast/src/lib/handlers/body.ts +++ b/libs/ooxast/ooxast-util-to-hast/src/lib/handlers/body.ts @@ -1,10 +1,10 @@ // based on https://github.com/syntax-tree/hast-util-to-mdast/blob/main/lib/handlers/em import { P } from 'ooxast' -import { H, Node, Root, Body } from '../types' +import { H, Node, Root, Body } from '../types.js' import { convertElement } from 'xast-util-is-element' -import { wrapSections } from '../util/wrap-section' -import { all } from '../all' +import { wrapSections } from '../util/wrap-section.js' +import { all } from '../all.js' export function body(h: H, body: Body) { return h(body, 'body', all(h, body)) diff --git a/libs/ooxast/ooxast-util-to-hast/src/lib/handlers/citation.ts b/libs/ooxast/ooxast-util-to-hast/src/lib/handlers/citation.ts index 5277f13c..0b1b685b 100755 --- a/libs/ooxast/ooxast-util-to-hast/src/lib/handlers/citation.ts +++ b/libs/ooxast/ooxast-util-to-hast/src/lib/handlers/citation.ts @@ -1,4 +1,4 @@ -import { H } from '../types' +import { H } from '../types.js' import { Parent, T } from 'ooxast' import { Data as CSL } from 'csl-json' import { CitationItem, MendeleyCitationItem } from 'ooxast-util-citations' @@ -54,9 +54,7 @@ export function citation(h: H, citation: T, parent: Parent) { // console.log(json) console.log(h.partialCitation) - console.error( - 'Corrupt citation! This might be because the text is too long. Skipping...' - ) + console.error('Corrupt citation! This might be because the text is too long. Skipping...') return } @@ -69,10 +67,7 @@ export function citation(h: H, citation: T, parent: Parent) { ? citation.properties.formattedCitation : citation.mendeley.formattedCitation - const sectionedCitations = formattedCitation?.replace( - /(\d{4}), (\d{4})/g, - '$1; $2' - ) + const sectionedCitations = formattedCitation?.replace(/(\d{4}), (\d{4})/g, '$1; $2') const formattedCitations = sectionedCitations.split(';') @@ -80,39 +75,34 @@ export function citation(h: H, citation: T, parent: Parent) { h.deleteNextRun = true } - return citation.citationItems.map( - (cite: CitationItem | MendeleyCitationItem, i: number) => { - const itemData: CSL = cite.itemData - h.citationNumber++ - // const citeKey = - const citeKey = - generateAuthYearFromCSL(h, itemData) || `bib${h.citationNumber}` - - h.collectCitation(itemData, citeKey) - - const { id, itemData: itemdata, ...rest } = cite - const customCiteData = { ...rest, ...citation.properties } - return h( - itemData, - 'xref', + return citation.citationItems.map((cite: CitationItem | MendeleyCitationItem, i: number) => { + const itemData: CSL = cite.itemData + h.citationNumber++ + // const citeKey = + const citeKey = generateAuthYearFromCSL(h, itemData) || `bib${h.citationNumber}` + + h.collectCitation(itemData, citeKey) + + const { id, itemData: itemdata, ...rest } = cite + const customCiteData = { ...rest, ...citation.properties } + return h( + itemData, + 'xref', + { + id: `_xref-${h.citationNumber}`, + refType: 'bibr', + rid: citeKey, + // We store more value in the custom citation space, such as infix/suffix etc. + ...(customCiteData ? { customType: JSON.stringify(customCiteData) } : {}), // customType: JSON.stringify() + }, + [ { - id: `_xref-${h.citationNumber}`, - refType: 'bibr', - rid: citeKey, - // We store more value in the custom citation space, such as infix/suffix etc. - ...(customCiteData - ? { customType: JSON.stringify(customCiteData) } - : {}), // customType: JSON.stringify() + type: 'text', + value: formattedCitations?.[i] || `[${h.citationNumber}]`, }, - [ - { - type: 'text', - value: formattedCitations?.[i] || `[${h.citationNumber}]`, - }, - ] - ) - } - ) + ], + ) + }) } } // Endnote/Citavi citation @@ -135,7 +125,7 @@ function generateAuthYearFromCSL(h: H, csl: CSL): string { csl?.author?.[0]?.family && csl?.issued?.['date-parts']?.[0]?.[0] ? `${csl.author[0].family}${csl.issued['date-parts'][0][0]}` : `${csl.id}`, - csl + csl, ) } function makeUniqueSuffix(h: H, key: string, data: CSL) { @@ -150,8 +140,5 @@ function incrementSuffix(text: string) { if (!text.slice(-1).match(/[a-zA-Z]/)) { return `${text}a` } - return ( - text.slice(0, -1) + - String.fromCharCode(text.charCodeAt(text.length - 1) + 1) - ) + return text.slice(0, -1) + String.fromCharCode(text.charCodeAt(text.length - 1) + 1) } diff --git a/libs/ooxast/ooxast-util-to-hast/src/lib/handlers/document.ts b/libs/ooxast/ooxast-util-to-hast/src/lib/handlers/document.ts index 882e5c01..8a7121c3 100755 --- a/libs/ooxast/ooxast-util-to-hast/src/lib/handlers/document.ts +++ b/libs/ooxast/ooxast-util-to-hast/src/lib/handlers/document.ts @@ -1,5 +1,5 @@ -import { all } from '../all' -import { H, Node, Root, HastContent } from '../types' +import { all } from '../all.js' +import { H, Node, Root, HastContent } from '../types.js' // import { Article, Front, Body, Back } from 'hast-types' import { Document } from 'ooxast' import { select } from 'xast-util-select' diff --git a/libs/ooxast/ooxast-util-to-hast/src/lib/handlers/drawing.ts b/libs/ooxast/ooxast-util-to-hast/src/lib/handlers/drawing.ts index 386c579b..6bdd2661 100755 --- a/libs/ooxast/ooxast-util-to-hast/src/lib/handlers/drawing.ts +++ b/libs/ooxast/ooxast-util-to-hast/src/lib/handlers/drawing.ts @@ -1,5 +1,5 @@ -import { all } from '../all' -import { H, HastContent, Node, Root } from '../types' +import { all } from '../all.js' +import { H, HastContent, Node, Root } from '../types.js' import { h as hast } from 'hastscript' // import { Article, Front, Body, Back, Fig } from 'jast-types' import { Drawing } from 'ooxast' diff --git a/libs/ooxast/ooxast-util-to-hast/src/lib/handlers/footnote.ts b/libs/ooxast/ooxast-util-to-hast/src/lib/handlers/footnote.ts index 6880afc6..569c107e 100755 --- a/libs/ooxast/ooxast-util-to-hast/src/lib/handlers/footnote.ts +++ b/libs/ooxast/ooxast-util-to-hast/src/lib/handlers/footnote.ts @@ -1,5 +1,5 @@ -import { H, Element } from '../types' -import { all } from '../all' +import { H, Element } from '../types.js' +import { all } from '../all.js' export function footnote(h: H, node: Element) { if (node?.attributes?.type === 'separator') return diff --git a/libs/ooxast/ooxast-util-to-hast/src/lib/handlers/footnotes.ts b/libs/ooxast/ooxast-util-to-hast/src/lib/handlers/footnotes.ts index a083b31f..87559757 100755 --- a/libs/ooxast/ooxast-util-to-hast/src/lib/handlers/footnotes.ts +++ b/libs/ooxast/ooxast-util-to-hast/src/lib/handlers/footnotes.ts @@ -1,6 +1,6 @@ import { Footnotes } from 'ooxast' -import { H } from '../types' -import { all } from '../all' +import { H } from '../types.js' +import { all } from '../all.js' export function footnotes(h: H, node: Footnotes) { h(node, 'fnGroup', all(h, node)) diff --git a/libs/ooxast/ooxast-util-to-hast/src/lib/handlers/index.ts b/libs/ooxast/ooxast-util-to-hast/src/lib/handlers/index.ts index 894dff8e..9ca3c5b1 100755 --- a/libs/ooxast/ooxast-util-to-hast/src/lib/handlers/index.ts +++ b/libs/ooxast/ooxast-util-to-hast/src/lib/handlers/index.ts @@ -1,17 +1,17 @@ -import { all } from '../all' -import { body } from './body' -import { p } from './p' -import { root } from './root' -import { text } from './text' -import { wrapChildren } from '../util/wrap-children' -import { citation } from './citation' -import { tbl } from './tbl' -import { footnotes } from './footnotes' -import { footnote } from './footnote' -import { document } from './document' -import { r } from './r' -import { tr } from './tr' -import { drawing } from './drawing' +import { all } from '../all.js' +import { body } from './body.js' +import { p } from './p.js' +import { root } from './root.js' +import { text } from './text.js' +import { wrapChildren } from '../util/wrap-children.js' +import { citation } from './citation.js' +import { tbl } from './tbl.js' +import { footnotes } from './footnotes.js' +import { footnote } from './footnote.js' +import { document } from './document.js' +import { r } from './r.js' +import { tr } from './tr.js' +import { drawing } from './drawing.js' export const handlers = { p, diff --git a/libs/ooxast/ooxast-util-to-hast/src/lib/handlers/p.spec.ts b/libs/ooxast/ooxast-util-to-hast/src/lib/handlers/p.spec.ts index d32503cf..8a1ca8ee 100755 --- a/libs/ooxast/ooxast-util-to-hast/src/lib/handlers/p.spec.ts +++ b/libs/ooxast/ooxast-util-to-hast/src/lib/handlers/p.spec.ts @@ -1,14 +1,11 @@ import { x } from 'xastscript' import { h } from 'hastscript' -import { toHast } from '../ooxast-util-to-hast' +import { toHast } from '../ooxast-util-to-hast.js' describe('p', () => { it('should do something', () => { const basicp = x('p', { id: 'ayy' }, [ x('w:pPr', {}, []), - x('w:r', {}, [ - x('w:rPr', {}, []), - x('w:t', {}, [{ type: 'text', value: 'lmao' }]), - ]), + x('w:r', {}, [x('w:rPr', {}, []), x('w:t', {}, [{ type: 'text', value: 'lmao' }])]), ]) expect(toHast(basicp)).toEqual(h('p', [{ type: 'text', value: 'lmao' }])) }) diff --git a/libs/ooxast/ooxast-util-to-hast/src/lib/handlers/p.ts b/libs/ooxast/ooxast-util-to-hast/src/lib/handlers/p.ts index eee87734..a5cfa426 100755 --- a/libs/ooxast/ooxast-util-to-hast/src/lib/handlers/p.ts +++ b/libs/ooxast/ooxast-util-to-hast/src/lib/handlers/p.ts @@ -1,7 +1,7 @@ import { P, Parent } from 'ooxast' -import { all } from '../all' -import { H, Text } from '../types' -import { getPStyle } from '../util/get-pstyle' +import { all } from '../all.js' +import { H, Text } from '../types.js' +import { getPStyle } from '../util/get-pstyle.js' export function p(h: H, p: P, parent: Parent) { if (h.inTable) return all(h, p) diff --git a/libs/ooxast/ooxast-util-to-hast/src/lib/handlers/pHandlers/heading.ts b/libs/ooxast/ooxast-util-to-hast/src/lib/handlers/pHandlers/heading.ts index aa06b8d6..64401a2d 100644 --- a/libs/ooxast/ooxast-util-to-hast/src/lib/handlers/pHandlers/heading.ts +++ b/libs/ooxast/ooxast-util-to-hast/src/lib/handlers/pHandlers/heading.ts @@ -1,5 +1,5 @@ -import { all } from '../../all' -import { H, P, StyleHandle } from '../../types' +import { all } from '../../all.js' +import { H, P, StyleHandle } from '../../types.js' const headingHandler: StyleHandle = (h: H, node: P, style: string) => { const level = Number(style.replace(/Heading(\d+)/, '$1')) diff --git a/libs/ooxast/ooxast-util-to-hast/src/lib/handlers/pHandlers/title.ts b/libs/ooxast/ooxast-util-to-hast/src/lib/handlers/pHandlers/title.ts index 3aa6ac5b..0b83c1a9 100644 --- a/libs/ooxast/ooxast-util-to-hast/src/lib/handlers/pHandlers/title.ts +++ b/libs/ooxast/ooxast-util-to-hast/src/lib/handlers/pHandlers/title.ts @@ -1,5 +1,5 @@ -import { all } from '../../all' -import { H, P, StyleHandle } from '../../types' +import { all } from '../../all.js' +import { H, P, StyleHandle } from '../../types.js' const headingHandler: StyleHandle = (h: H, node: P) => { return h(node, `h1`, all(h, node)) diff --git a/libs/ooxast/ooxast-util-to-hast/src/lib/handlers/r.ts b/libs/ooxast/ooxast-util-to-hast/src/lib/handlers/r.ts index 189857c5..28854bf2 100755 --- a/libs/ooxast/ooxast-util-to-hast/src/lib/handlers/r.ts +++ b/libs/ooxast/ooxast-util-to-hast/src/lib/handlers/r.ts @@ -1,8 +1,8 @@ import { FldChar, R, RPr, VerticalAlignRun } from 'ooxast' import { select } from 'xast-util-select' -import { all } from '../all' +import { all } from '../all.js' import { x } from 'xastscript' -import { H } from '../types' +import { H } from '../types.js' import { convertElement } from 'xast-util-is-element' //const isVert = convertElement('w:vertAlign') @@ -29,7 +29,7 @@ export function r(h: H, node: R) { return x( 'xref', { refType: 'fn' }, - { type: 'text', value: `[${footnoteReference.attributes?.['w:id']}]` } + { type: 'text', value: `[${footnoteReference.attributes?.['w:id']}]` }, ) } diff --git a/libs/ooxast/ooxast-util-to-hast/src/lib/handlers/root.ts b/libs/ooxast/ooxast-util-to-hast/src/lib/handlers/root.ts index a48c4af5..42fe5c48 100755 --- a/libs/ooxast/ooxast-util-to-hast/src/lib/handlers/root.ts +++ b/libs/ooxast/ooxast-util-to-hast/src/lib/handlers/root.ts @@ -1,7 +1,7 @@ // based on https://github.com/syntax-tree/hast-util-to-mdast/blob/main/lib/handlers/em -import { all } from '../all' -import { H, Node, Root } from '../types' +import { all } from '../all.js' +import { H, Node, Root } from '../types.js' export function root(h: H, node: Root) { // if (!article) { @@ -14,10 +14,8 @@ export function root(h: H, node: Root) { { type: 'doctype', name: 'article', - public: - '-//NLM//DTD JATS (Z39.96) Journal Publishing DTD v1.2 20190208//EN', - system: - 'https://jats.nlm.nih.gov/publishing/1.2/JATS-journalpublishing1.dtd', + public: '-//NLM//DTD JATS (Z39.96) Journal Publishing DTD v1.2 20190208//EN', + system: 'https://jats.nlm.nih.gov/publishing/1.2/JATS-journalpublishing1.dtd', }, ] diff --git a/libs/ooxast/ooxast-util-to-hast/src/lib/handlers/tbl.ts b/libs/ooxast/ooxast-util-to-hast/src/lib/handlers/tbl.ts index 295c79f1..b11588f0 100755 --- a/libs/ooxast/ooxast-util-to-hast/src/lib/handlers/tbl.ts +++ b/libs/ooxast/ooxast-util-to-hast/src/lib/handlers/tbl.ts @@ -1,6 +1,6 @@ -import { H } from '../types' +import { H } from '../types.js' import { Tbl } from 'ooxast' -import { all } from '../all' +import { all } from '../all.js' export function tbl(h: H, tbl: Tbl) { h.inTable = true diff --git a/libs/ooxast/ooxast-util-to-hast/src/lib/handlers/text.ts b/libs/ooxast/ooxast-util-to-hast/src/lib/handlers/text.ts index b4da6410..61c7ac16 100755 --- a/libs/ooxast/ooxast-util-to-hast/src/lib/handlers/text.ts +++ b/libs/ooxast/ooxast-util-to-hast/src/lib/handlers/text.ts @@ -1,4 +1,4 @@ -import { H, Text } from '../types' +import { H, Text } from '../types.js' export function text(h: H, node: Text) { return node diff --git a/libs/ooxast/ooxast-util-to-hast/src/lib/handlers/tr.ts b/libs/ooxast/ooxast-util-to-hast/src/lib/handlers/tr.ts index 6c79a15a..8b419e0d 100755 --- a/libs/ooxast/ooxast-util-to-hast/src/lib/handlers/tr.ts +++ b/libs/ooxast/ooxast-util-to-hast/src/lib/handlers/tr.ts @@ -1,7 +1,7 @@ -import { H, HastContent } from '../types' +import { H, HastContent } from '../types.js' import { Row } from 'ooxast' // import { Td } from 'hast-types' -import { all } from '../all' +import { all } from '../all.js' export function tr(h: H, tr: Row) { const rowcontents = all(h, tr) diff --git a/libs/ooxast/ooxast-util-to-hast/src/lib/one.ts b/libs/ooxast/ooxast-util-to-hast/src/lib/one.ts index 6ef17404..1a84059d 100755 --- a/libs/ooxast/ooxast-util-to-hast/src/lib/one.ts +++ b/libs/ooxast/ooxast-util-to-hast/src/lib/one.ts @@ -1,15 +1,11 @@ import { isElement } from 'xast-util-is-element' import { Parent } from 'ooxast' -import { all } from './all' -import { Handle, H, HastContent, Node, Element } from './types' -import { own } from './util/own' -import { wrapText } from './util/wrap-text' +import { all } from './all.js' +import { Handle, H, HastContent, Node, Element } from './types.js' +import { own } from './util/own.js' +import { wrapText } from './util/wrap-text.js' -export function one( - h: H, - node: Node, - parent: Parent -): HastContent | Array | void { +export function one(h: H, node: Node, parent: Parent): HastContent | Array | void { let fn: Handle | undefined if (isElement(node)) { diff --git a/libs/ooxast/ooxast-util-to-hast/src/lib/ooxast-util-to-hast.ts b/libs/ooxast/ooxast-util-to-hast/src/lib/ooxast-util-to-hast.ts index bdcee3eb..2d57f08d 100755 --- a/libs/ooxast/ooxast-util-to-hast/src/lib/ooxast-util-to-hast.ts +++ b/libs/ooxast/ooxast-util-to-hast/src/lib/ooxast-util-to-hast.ts @@ -1,5 +1,5 @@ -import { one } from './one' -import { handlers } from './handlers/index' +import { one } from './one.js' +import { handlers } from './handlers/index.js' import { Data as CSL } from 'csl-json' import { @@ -15,15 +15,15 @@ import { Root, Element, Text, -} from './types' +} from './types.js' import { convert } from 'unist-util-is' import rehypeMinifyWhitespace from 'rehype-minify-whitespace' import { select } from 'xast-util-select' // import { h } from 'hastscript' import { cslToRefList } from 'jast-util-from-csl' -export { one } from './one' -export { all } from './all' +export { one } from './one.js' +export { all } from './all.js' export { handlers as defaultHandlers } const block = convert(['heading', 'paragraph', 'root']) @@ -41,7 +41,7 @@ export function toHast( bibname: 'References', //relations: {}, - } + }, ) { // const byId: { [s: string]: Element } = {} let hast: HastContent | HastRoot @@ -52,7 +52,7 @@ export function toHast( node: HastRoot | HastContent, type: string, props?: Attributes | string | Array, - children?: string | Array + children?: string | Array, ): HastContent => { let attributes: Attributes | undefined @@ -65,10 +65,8 @@ export function toHast( const result: Node = Object.assign( {}, - ['root', 'text'].includes(type) - ? { type } - : { type: 'element', tagName: type }, - { properties: attributes } + ['root', 'text'].includes(type) ? { type } : { type: 'element', tagName: type }, + { properties: attributes }, ) if (typeof children === 'string') { @@ -93,9 +91,7 @@ export function toHast( /** @type {string|null} */ frozenBaseUrl: null, qNesting: 0, - handlers: options.handlers - ? { ...handlers, ...options.handlers } - : handlers, + handlers: options.handlers ? { ...handlers, ...options.handlers } : handlers, document: options.document, checked: options.checked || '[x]', unchecked: options.unchecked || '[ ]', @@ -114,7 +110,7 @@ export function toHast( citeKeys: {}, citationType: options.citationType || 'mendeley', pHandlers: options.pHandlers || [], - } as Context + } as Context, ) // visit(tree, 'element', (node) => { diff --git a/libs/ooxast/ooxast-util-to-hast/src/lib/util/get-pstyle.spec.ts b/libs/ooxast/ooxast-util-to-hast/src/lib/util/get-pstyle.spec.ts index de8316a7..51467dec 100755 --- a/libs/ooxast/ooxast-util-to-hast/src/lib/util/get-pstyle.spec.ts +++ b/libs/ooxast/ooxast-util-to-hast/src/lib/util/get-pstyle.spec.ts @@ -1,5 +1,5 @@ import { P, PPr, R } from 'ooxast' -import { getPStyle } from './get-pstyle' +import { getPStyle } from './get-pstyle.js' export const test: any = { type: 'element', diff --git a/libs/ooxast/ooxast-util-to-hast/src/lib/util/get-pstyle.ts b/libs/ooxast/ooxast-util-to-hast/src/lib/util/get-pstyle.ts index 191b2e79..0bd8d676 100755 --- a/libs/ooxast/ooxast-util-to-hast/src/lib/util/get-pstyle.ts +++ b/libs/ooxast/ooxast-util-to-hast/src/lib/util/get-pstyle.ts @@ -1,5 +1,5 @@ import { P, BdoContentRun } from 'ooxast' -import { Element } from '../types' +import { Element } from '../types.js' import { select, selectAll } from 'xast-util-select' export function getPStyle(p: P): string | null | undefined { diff --git a/libs/ooxast/ooxast-util-to-hast/src/lib/util/wrap-children.ts b/libs/ooxast/ooxast-util-to-hast/src/lib/util/wrap-children.ts index a36b363f..21802874 100755 --- a/libs/ooxast/ooxast-util-to-hast/src/lib/util/wrap-children.ts +++ b/libs/ooxast/ooxast-util-to-hast/src/lib/util/wrap-children.ts @@ -1,6 +1,6 @@ -import { all } from '../all' -import { H, HastContent, Node } from '../types' -import { wrap } from './wrap' +import { all } from '../all.js' +import { H, HastContent, Node } from '../types.js' +import { wrap } from './wrap.js' export function wrapChildren(h: H, node: Node): Array { return wrap(all(h, node)) diff --git a/libs/ooxast/ooxast-util-to-hast/src/lib/util/wrap-section.spec.ts b/libs/ooxast/ooxast-util-to-hast/src/lib/util/wrap-section.spec.ts index c0487324..322374db 100755 --- a/libs/ooxast/ooxast-util-to-hast/src/lib/util/wrap-section.spec.ts +++ b/libs/ooxast/ooxast-util-to-hast/src/lib/util/wrap-section.spec.ts @@ -1,6 +1,6 @@ -import { wrapSec, getHeadingLevel } from './wrap-section' +import { wrapSec, getHeadingLevel } from './wrap-section.js' -import { test } from './get-pstyle.spec' +import { test } from './get-pstyle.spec.js' it('should get heading level', () => { expect(getHeadingLevel(test)).toEqual(1) diff --git a/libs/ooxast/ooxast-util-to-hast/src/lib/util/wrap-section.ts b/libs/ooxast/ooxast-util-to-hast/src/lib/util/wrap-section.ts index c4f885ff..f01cc96c 100755 --- a/libs/ooxast/ooxast-util-to-hast/src/lib/util/wrap-section.ts +++ b/libs/ooxast/ooxast-util-to-hast/src/lib/util/wrap-section.ts @@ -1,10 +1,10 @@ -import { H } from '../types' +import { H } from '../types.js' import { convertElement, isElement } from 'xast-util-is-element' -import { Parent, Element, P, Node, Body } from '../types' -import { getPStyle } from './get-pstyle' +import { Parent, Element, P, Node, Body } from '../types.js' +import { getPStyle } from './get-pstyle.js' import { Sec, Body as HastBody } from 'hast-types' -import { all } from '../all' -import { one } from '../one' +import { all } from '../all.js' +import { one } from '../one.js' function parseDepth(str: string) { return parseInt(str.slice(-1), 10) @@ -19,7 +19,7 @@ export function wrapSec( h: H, sectionCounter: number[], child: Element | null, - parent?: Parent + parent?: Parent, ): Sec | HastBody { const parentSec: Element = { type: 'element', @@ -56,9 +56,7 @@ export function getHastHeadingLevel(p: Element) { return parseInt(p?.attributes?.style?.slice(-1) || '0') || 0 } export function currentWrapperDepth(wrapperStack: any[]) { - return wrapperStack[wrapperStack.length - 1]?.attributes?.id - ?.replace('sec-') - ?.split('-')?.length + return wrapperStack[wrapperStack.length - 1]?.attributes?.id?.replace('sec-')?.split('-')?.length } export function wrapSections(h: H, bodyChildren: Element[]) { diff --git a/libs/ooxast/ooxast-util-to-hast/src/lib/util/wrap-text.ts b/libs/ooxast/ooxast-util-to-hast/src/lib/util/wrap-text.ts index 2c20def1..159a1960 100755 --- a/libs/ooxast/ooxast-util-to-hast/src/lib/util/wrap-text.ts +++ b/libs/ooxast/ooxast-util-to-hast/src/lib/util/wrap-text.ts @@ -1,4 +1,4 @@ -import { H } from '../types' +import { H } from '../types.js' export function wrapText(h: H, value: string): string { return h.wrapText ? value : value.replace(/\r?\n|\r/g, ' ') diff --git a/libs/ooxast/ooxast-util-to-hast/src/lib/util/wrap.ts b/libs/ooxast/ooxast-util-to-hast/src/lib/util/wrap.ts index 2f4bab4e..003f5f9f 100755 --- a/libs/ooxast/ooxast-util-to-hast/src/lib/util/wrap.ts +++ b/libs/ooxast/ooxast-util-to-hast/src/lib/util/wrap.ts @@ -1,20 +1,14 @@ // import { isParagraphContent } from 'hast-types' -import { HastContent, Element } from '../types' +import { HastContent, Element } from '../types.js' //import { phrasing } from 'mdast-util-phrasing' export function wrap(nodes: Array) { return runs(nodes, onphrasing) - function onphrasing( - nodes: Array - ): HastContent | Array { + function onphrasing(nodes: Array): HastContent | Array { const head = nodes[0] - if ( - nodes.length === 1 && - head.type === 'text' && - (head.value === ' ' || head.value === '\n') - ) { + if (nodes.length === 1 && head.type === 'text' && (head.value === ' ' || head.value === '\n')) { return [] } @@ -57,7 +51,7 @@ export function wrapNeeded(nodes: Array): boolean { function runs( nodes: Array, onphrasing: (nodes: Array) => HastContent | Array, - onnonphrasing?: (node: HastContent) => HastContent + onnonphrasing?: (node: HastContent) => HastContent, ) { const nonphrasing = onnonphrasing || identity const flattened: Array = flatten(nodes) diff --git a/libs/ooxast/ooxast-util-to-jast/project.json b/libs/ooxast/ooxast-util-to-jast/project.json index 08ceaae7..e8d965ab 100755 --- a/libs/ooxast/ooxast-util-to-jast/project.json +++ b/libs/ooxast/ooxast-util-to-jast/project.json @@ -26,8 +26,11 @@ "passWithNoTests": true } }, + "make-publishable": { + "executor": "better-nx-tsc:publishable" + }, "build": { - "executor": "better-nx-tsc:tsc", + "executor": "@nrwl/js:tsc", "outputs": ["{options.outputPath}"], "options": { "rootDir": "libs/ooxast/ooxast-util-to-jast/src", diff --git a/libs/ooxast/ooxast-util-to-jast/src/lib/ooxast-util-to-jast.ts b/libs/ooxast/ooxast-util-to-jast/src/lib/ooxast-util-to-jast.ts index 8c76ae63..046adb55 100755 --- a/libs/ooxast/ooxast-util-to-jast/src/lib/ooxast-util-to-jast.ts +++ b/libs/ooxast/ooxast-util-to-jast/src/lib/ooxast-util-to-jast.ts @@ -22,8 +22,8 @@ import { select } from 'xast-util-select' import { cslToRefList } from 'jast-util-from-csl' import { VFile } from 'vfile' -// export { one } from './one' -// export { all } from './all' +// export { one } from './one.js' +// export { all } from './all.js' export { handlers as defaultHandlers } const block = convert(['heading', 'paragraph', 'root']) diff --git a/libs/ooxast/ooxast-util-to-jast/src/lib/util/wrap-section.spec.ts b/libs/ooxast/ooxast-util-to-jast/src/lib/util/wrap-section.spec.ts index 7a7b3eb2..e0857d83 100755 --- a/libs/ooxast/ooxast-util-to-jast/src/lib/util/wrap-section.spec.ts +++ b/libs/ooxast/ooxast-util-to-jast/src/lib/util/wrap-section.spec.ts @@ -1,6 +1,6 @@ import { wrapSec, getHeadingLevel } from './wrap-section.js' -import { test } from './get-pstyle.spec' +import { test } from './get-pstyle.spec.js' it('should get heading level', () => { expect(getHeadingLevel(test)).toEqual(1) diff --git a/libs/ooxast/ooxast-util-to-mdast/project.json b/libs/ooxast/ooxast-util-to-mdast/project.json index 8e58d896..72c1c5d8 100644 --- a/libs/ooxast/ooxast-util-to-mdast/project.json +++ b/libs/ooxast/ooxast-util-to-mdast/project.json @@ -4,8 +4,11 @@ "sourceRoot": "libs/ooxast/ooxast-util-to-mdast/src", "projectType": "library", "targets": { + "make-publishable": { + "executor": "better-nx-tsc:publishable" + }, "build": { - "executor": "better-nx-tsc:tsc", + "executor": "@nrwl/js:tsc", "outputs": ["{options.outputPath}"], "options": { "rootDir": "libs/ooxast/ooxast-util-to-mdast/src", diff --git a/libs/ooxast/ooxast-util-to-unified-latex/project.json b/libs/ooxast/ooxast-util-to-unified-latex/project.json index afdb2c3b..2aa38daa 100644 --- a/libs/ooxast/ooxast-util-to-unified-latex/project.json +++ b/libs/ooxast/ooxast-util-to-unified-latex/project.json @@ -4,8 +4,11 @@ "sourceRoot": "libs/ooxast/ooxast-util-to-unified-latex/src", "projectType": "library", "targets": { + "make-publishable": { + "executor": "better-nx-tsc:publishable" + }, "build": { - "executor": "better-nx-tsc:tsc", + "executor": "@nrwl/js:tsc", "outputs": ["{options.outputPath}"], "options": { "rootDir": "libs/ooxast/ooxast-util-to-unified-latex/src", diff --git a/libs/ooxast/ooxast-util-to-unified-latex/src/lib/handlers/r.spec.ts b/libs/ooxast/ooxast-util-to-unified-latex/src/lib/handlers/r.spec.ts index 271e83f8..a4565c92 100644 --- a/libs/ooxast/ooxast-util-to-unified-latex/src/lib/handlers/r.spec.ts +++ b/libs/ooxast/ooxast-util-to-unified-latex/src/lib/handlers/r.spec.ts @@ -2,7 +2,7 @@ import { describe, expect, it } from 'vitest' import { arg, m, s } from '@unified-latex/unified-latex-builder' import { R } from 'ooxast' -// import { r } from './r' +// import { r } from './r.js' import { toUnifiedLatex } from '../ooxast-util-to-unified-latex.js' const makeR = (text: string, styles: string[]) => diff --git a/libs/ooxast/ooxast-util-to-unified-latex/src/lib/ooxast-util-to-unified-latex.spec.ts b/libs/ooxast/ooxast-util-to-unified-latex/src/lib/ooxast-util-to-unified-latex.spec.ts index 5006edfa..f647a749 100644 --- a/libs/ooxast/ooxast-util-to-unified-latex/src/lib/ooxast-util-to-unified-latex.spec.ts +++ b/libs/ooxast/ooxast-util-to-unified-latex/src/lib/ooxast-util-to-unified-latex.spec.ts @@ -4,7 +4,7 @@ import { toString } from '@unified-latex/unified-latex-util-to-string' import { m } from '@unified-latex/unified-latex-builder' import { updateRenderInfo } from '@unified-latex/unified-latex-util-render-info' import { PB } from './util/PB.js' -import listTree from '../test/list.json' +import listTree from '../test/list.json.js' // test whether a ooxast p node with style 'Heading1' is converted to a macro with name 'section' describe('ooxast-util-to-unified-latex', () => { diff --git a/libs/ooxast/ooxast/project.json b/libs/ooxast/ooxast/project.json index 3d8c0ab3..adf79dfd 100755 --- a/libs/ooxast/ooxast/project.json +++ b/libs/ooxast/ooxast/project.json @@ -26,8 +26,11 @@ "passWithNoTests": true } }, + "make-publishable": { + "executor": "better-nx-tsc:publishable" + }, "build": { - "executor": "better-nx-tsc:tsc", + "executor": "@nrwl/js:tsc", "outputs": ["{options.outputPath}"], "options": { "rootDir": "libs/ooxast/ooxast/src", diff --git a/libs/ooxast/ooxast/src/lib/ooxml/officeDocument/sharedTypes.ts b/libs/ooxast/ooxast/src/lib/ooxml/officeDocument/sharedTypes.ts index 2b86eb85..8a75387e 100755 --- a/libs/ooxast/ooxast/src/lib/ooxml/officeDocument/sharedTypes.ts +++ b/libs/ooxast/ooxast/src/lib/ooxml/officeDocument/sharedTypes.ts @@ -62,5 +62,5 @@ export type XstringVal = string export type YAlignVal = 'inline' | 'top' | 'center' | 'bottom' | 'inside' | 'outside' -export interface document extends UnistNode {} +export type document = UnistNode export var document: document diff --git a/libs/ooxast/ooxast/src/lib/xml-primitives.d.ts b/libs/ooxast/ooxast/src/lib/xml-primitives.d.ts index bede207f..c3cd018a 100755 --- a/libs/ooxast/ooxast/src/lib/xml-primitives.d.ts +++ b/libs/ooxast/ooxast/src/lib/xml-primitives.d.ts @@ -18,5 +18,5 @@ export interface _number extends UnistNode { content: number } -export interface document extends UnistNode {} +export type document = UnistNode export var document: document diff --git a/libs/ooxast/ooxast/tsconfig.lib.json b/libs/ooxast/ooxast/tsconfig.lib.json index 5d395d34..c8223e02 100755 --- a/libs/ooxast/ooxast/tsconfig.lib.json +++ b/libs/ooxast/ooxast/tsconfig.lib.json @@ -3,8 +3,7 @@ "compilerOptions": { "outDir": "../../../dist/out-tsc", "declaration": true, - "types": ["node"], - "moduleResolution": "nodenext" + "types": ["node"] }, "exclude": ["**/*.spec.ts", "**/*.test.ts", "jest.config.ts"], "include": ["**/*.ts", "**/*.d.ts"] diff --git a/libs/plugins/better-nx-tsc/executors.json b/libs/plugins/better-nx-tsc/executors.json index 9f60542d..687d92dc 100644 --- a/libs/plugins/better-nx-tsc/executors.json +++ b/libs/plugins/better-nx-tsc/executors.json @@ -6,6 +6,11 @@ "schema": "./src/executors/tsc/schema.json", "description": "TSC executor" }, + "publishable": { + "implementation": "./src/executors/publishable/executor", + "schema": "./src/executors/publishable/schema.json", + "description": "fix output of @nx/js" + }, "execute": { "implementation": "./src/executors/execute/executor", "schema": "./src/executors/execute/schema.json", diff --git a/libs/plugins/better-nx-tsc/project.json b/libs/plugins/better-nx-tsc/project.json index ee2cbd7a..c1aa8a20 100644 --- a/libs/plugins/better-nx-tsc/project.json +++ b/libs/plugins/better-nx-tsc/project.json @@ -4,8 +4,11 @@ "sourceRoot": "packages/better-nx-tsc/src", "projectType": "library", "targets": { + "make-publishable": { + "executor": "better-nx-tsc:publishable" + }, "build": { - "executor": "better-nx-tsc:tsc", + "executor": "@nrwl/js:tsc", "outputs": ["{options.outputPath}"], "options": { "outputPath": "dist/packages/better-nx-tsc", diff --git a/libs/plugins/better-nx-tsc/src/executors/publishable/executor.spec.ts b/libs/plugins/better-nx-tsc/src/executors/publishable/executor.spec.ts new file mode 100644 index 00000000..19a24da4 --- /dev/null +++ b/libs/plugins/better-nx-tsc/src/executors/publishable/executor.spec.ts @@ -0,0 +1,11 @@ +import { PublishableExecutorSchema } from './schema'; +import executor from './executor'; + +const options: PublishableExecutorSchema = {}; + +describe('Publishable Executor', () => { + it('can run', async () => { + const output = await executor(options); + expect(output.success).toBe(true); + }); +}); \ No newline at end of file diff --git a/libs/plugins/better-nx-tsc/src/executors/publishable/executor.ts b/libs/plugins/better-nx-tsc/src/executors/publishable/executor.ts new file mode 100644 index 00000000..dee9c866 --- /dev/null +++ b/libs/plugins/better-nx-tsc/src/executors/publishable/executor.ts @@ -0,0 +1,123 @@ +import { ExecutorContext, FileData } from '@nrwl/devkit' +import { PublishableExecutorSchema } from './schema' +import { readdir, readFile, writeFile } from 'fs/promises' + +function getNonTestDependencies(context: ExecutorContext) { + const dependencies = context.projectGraph?.nodes[context.projectName!].data.files + return new Set( + (dependencies ?? []) + .filter((dep) => !/.*\.(test|spec).ts/.test(dep.file)) + .flatMap((dep) => dep.dependencies?.map((d) => d.target.replace('npm:', ''))) + .filter(Boolean) as string[], + ) +} + +function updatePackageJson(packageJson: any, nonTestDependencies: Set, distDir: string) { + const dependencies = packageJson.dependencies ?? {} + const devDependencies = packageJson.devDependencies ?? {} + + const newDependencies = Object.fromEntries( + Object.entries(dependencies).filter(([dep]) => nonTestDependencies.has(dep)), + ) + const newDevDependencies = Object.fromEntries( + Object.entries(devDependencies).filter(([dep]) => nonTestDependencies.has(dep)), + ) + + return { + ...packageJson, + dependencies: newDependencies, + devDependencies: newDevDependencies, + } +} + +// function findMissingDependencies(packageJson: any, nonTestDependencies: Set) { +// const dependencies = packageJson.dependencies ?? {} + +// const missingDependencies = Array.from(nonTestDependencies).filter((dep) => !dependencies[dep]) + +// console.log({ +// missingDependencies, +// }) + +// return [...missingDependencies] +// } + +// async function supplementMissingDependencies( +// packageJson: any, +// context: ExecutorContext, +// missingDependencies: string[], +// ) { +// const rootPackageJson = JSON.parse(await readFile(`${context.root}/package.json`, 'utf-8')) +// const rootDependencies = rootPackageJson.dependencies ?? {} +// const rootDevDependencies = rootPackageJson.devDependencies ?? {} + +// const newDependencies = Object.fromEntries( +// Object.entries(rootDependencies).filter(([dep]) => missingDependencies.includes(dep)), +// ) +// const newDevDependencies = Object.fromEntries( +// Object.entries(rootDevDependencies).filter(([dep]) => missingDependencies.includes(dep)), +// ) + +// return { +// ...packageJson, +// dependencies: { +// ...packageJson.dependencies, +// ...newDependencies, +// }, +// devDependencies: { +// ...packageJson.devDependencies, +// ...newDevDependencies, +// }, +// } +// } + +function removeRequireExports(packageJson: any) { + const newPackageJson = { ...packageJson } + + delete newPackageJson?.exports?.['.']?.require + + return newPackageJson +} + +export default async function runExecutor( + options: PublishableExecutorSchema, + context: ExecutorContext, +) { + const distDir = options.dist + + const packageJson = JSON.parse(await readFile(`${distDir}/package.json`, 'utf-8')) + + const packageJsonWithoutRequireExports = removeRequireExports(packageJson) + + const nonTestDependencies = getNonTestDependencies(context) + + const newPackageJson = updatePackageJson( + packageJsonWithoutRequireExports, + nonTestDependencies, + distDir, + ) + + if (JSON.stringify(newPackageJson) === JSON.stringify(packageJson)) { + console.log('No changes to package.json') + return { + success: true, + } + } + + if (options.dryRun) { + console.log('Dry run, not writing package.json') + + console.log(`// ${distDir}/package.json`) + console.log(JSON.stringify(newPackageJson, null, 2)) + + return { + success: true, + } + } + + await writeFile(`${distDir}/package.json`, JSON.stringify(newPackageJson, null, 2)) + console.log(`Wrote ${distDir}/package.json`) + return { + success: true, + } +} diff --git a/libs/plugins/better-nx-tsc/src/executors/publishable/schema.d.ts b/libs/plugins/better-nx-tsc/src/executors/publishable/schema.d.ts new file mode 100644 index 00000000..6d9ee23b --- /dev/null +++ b/libs/plugins/better-nx-tsc/src/executors/publishable/schema.d.ts @@ -0,0 +1,4 @@ +export interface PublishableExecutorSchema { + dist: string + dryRun?: boolean +} // eslint-disable-line diff --git a/libs/plugins/better-nx-tsc/src/executors/publishable/schema.json b/libs/plugins/better-nx-tsc/src/executors/publishable/schema.json new file mode 100644 index 00000000..7aef10a5 --- /dev/null +++ b/libs/plugins/better-nx-tsc/src/executors/publishable/schema.json @@ -0,0 +1,20 @@ +{ + "$schema": "http://json-schema.org/schema", + "version": 2, + "cli": "nx", + "title": "Publishable executor", + "description": "", + "type": "object", + "properties": { + "dist": { + "type": "string", + "description": "The path to the dist directory", + "x-completion-type": "directory" + }, + "dryRun": { + "type": "boolean", + "description": "Run through all the steps without actually publishing" + } + }, + "required": ["dist"] +} diff --git a/libs/plugins/better-nx-tsc/src/executors/tsc/executor.spec.ts b/libs/plugins/better-nx-tsc/src/executors/tsc/executor.spec.ts index dba7dfaf..740d7c03 100644 --- a/libs/plugins/better-nx-tsc/src/executors/tsc/executor.spec.ts +++ b/libs/plugins/better-nx-tsc/src/executors/tsc/executor.spec.ts @@ -1,13 +1,10 @@ -import { ExecutorContext } from '@nrwl/devkit'; -import { ExecutorOptions } from '@nrwl/js/src/utils/schema'; -import { - createTypeScriptCompilationOptions, - normalizeOptions, -} from './executor'; +import { ExecutorContext } from '@nrwl/devkit' +import { ExecutorOptions } from '@nrwl/js/src/utils/schema' +import { createTypeScriptCompilationOptions, normalizeOptions } from './executor.js' describe('tscExecutor', () => { - let context: ExecutorContext; - let testOptions: ExecutorOptions; + let context: ExecutorContext + let testOptions: ExecutorOptions beforeEach(async () => { context = { @@ -23,7 +20,7 @@ describe('tscExecutor', () => { isVerbose: false, projectName: 'example', targetName: 'build', - }; + } testOptions = { main: 'libs/ui/src/index.ts', outputPath: 'dist/libs/ui', @@ -32,20 +29,15 @@ describe('tscExecutor', () => { transformers: [], watch: false, clean: true, - }; - }); + } + }) describe('createTypeScriptCompilationOptions', () => { it('should create typescript compilation options for valid config', () => { const result = createTypeScriptCompilationOptions( - normalizeOptions( - testOptions, - '/root', - '/root/libs/ui/src', - '/root/libs/ui' - ), - context - ); + normalizeOptions(testOptions, '/root', '/root/libs/ui/src', '/root/libs/ui'), + context, + ) expect(result).toMatchObject({ outputPath: '/root/dist/libs/ui', @@ -55,8 +47,8 @@ describe('tscExecutor', () => { tsConfig: '/root/libs/ui/tsconfig.json', watch: false, deleteOutputPath: true, - }); - }); + }) + }) it('should handle custom rootDir', () => { const result = createTypeScriptCompilationOptions( @@ -64,28 +56,23 @@ describe('tscExecutor', () => { { ...testOptions, rootDir: 'libs/ui/src' }, '/root', '/root/libs/ui/src', - '/root/libs/ui' + '/root/libs/ui', ), - context - ); + context, + ) expect(result).toMatchObject({ rootDir: '/root/libs/ui/src', - }); - }); - }); + }) + }) + }) describe('packageJSON', () => { it('should create package.json', () => { const result = createTypeScriptCompilationOptions( - normalizeOptions( - testOptions, - '/root', - '/root/libs/ui/src', - '/root/libs/ui' - ), - context - ); + normalizeOptions(testOptions, '/root', '/root/libs/ui/src', '/root/libs/ui'), + context, + ) expect(result).toMatchObject({ outputPath: '/root/dist/libs/ui', @@ -95,8 +82,8 @@ describe('tscExecutor', () => { tsConfig: '/root/libs/ui/tsconfig.json', watch: false, deleteOutputPath: true, - }); - }); + }) + }) it('should not include dependencies from *.spec.* or *.test.* files in the package.json', () => { const result = createTypeScriptCompilationOptions( @@ -104,10 +91,10 @@ describe('tscExecutor', () => { { ...testOptions, main: 'libs/ui/src/index.ts' }, '/root', '/root/libs/ui/src', - '/root/libs/ui' + '/root/libs/ui', ), - context - ); + context, + ) expect(result).toMatchObject({ outputPath: '/root/dist/libs/ui', @@ -117,7 +104,7 @@ describe('tscExecutor', () => { tsConfig: '/root/libs/ui/tsconfig.json', watch: false, deleteOutputPath: true, - }); - }); - }); -}); + }) + }) + }) +}) diff --git a/libs/plugins/better-nx-tsc/src/executors/tsc/hasher.spec.ts b/libs/plugins/better-nx-tsc/src/executors/tsc/hasher.spec.ts index 340ec856..3fd85702 100644 --- a/libs/plugins/better-nx-tsc/src/executors/tsc/hasher.spec.ts +++ b/libs/plugins/better-nx-tsc/src/executors/tsc/hasher.spec.ts @@ -1,28 +1,23 @@ // This must come before the Hasher import -import { DependencyType } from 'nx/src/config/project-graph'; +import { DependencyType } from 'nx/src/config/project-graph' jest.doMock('nx/src/utils/workspace-root', () => { return { workspaceRoot: '/root', - }; -}); + } +}) -jest.mock('fs', () => require('memfs').fs); -jest.mock('nx/src/utils/typescript'); +jest.mock('fs', () => require('memfs').fs) +jest.mock('nx/src/utils/typescript') -import { vol } from 'memfs'; -import tsUtils = require('nx/src/utils/typescript'); -import { - expandNamedInput, - filterUsingGlobPatterns, - Hash, - Hasher, -} from './hasher'; +import { vol } from 'memfs' +import tsUtils = require('nx/src/utils/typescript') +import { expandNamedInput, filterUsingGlobPatterns, Hash, Hasher } from './hasher.js' describe('Hasher', () => { const packageJson = { name: 'nrwl', - }; + } const tsConfigBaseJson = JSON.stringify({ compilerOptions: { @@ -31,7 +26,7 @@ describe('Hasher', () => { '@nrwl/child': ['libs/child/src/index.ts'], }, }, - }); + }) const allWorkspaceFiles = [ { file: 'yarn.lock', hash: 'yarn.lock.hash' }, { file: 'nx.json', hash: 'nx.json.hash' }, @@ -42,12 +37,12 @@ describe('Hasher', () => { { file: 'workspace.json', hash: 'workspace.json.hash' }, { file: 'global1', hash: 'global1.hash' }, { file: 'global2', hash: 'global2.hash' }, - ]; + ] function createHashing(): any { return { hashArray: (values: string[]) => values.join('|'), - }; + } } beforeEach(() => { @@ -57,18 +52,18 @@ describe('Hasher', () => { 'yarn.lock': 'content', 'package.json': JSON.stringify(packageJson), }, - '/root' - ); - tsUtils.getRootTsConfigFileName = () => '/root/tsconfig.base.json'; - }); + '/root', + ) + tsUtils.getRootTsConfigFileName = () => '/root/tsconfig.base.json' + }) afterEach(() => { - jest.resetAllMocks(); - vol.reset(); - }); + jest.resetAllMocks() + vol.reset() + }) it('should create task hash', async () => { - process.env.TESTENV = 'env123'; + process.env.TESTENV = 'env123' const hasher = new Hasher( { nodes: { @@ -103,24 +98,24 @@ describe('Hasher', () => { { runtimeCacheInputs: ['echo runtime456'], }, - createHashing() - ); + createHashing(), + ) const hash = await hasher.hashTask({ target: { project: 'parent', target: 'build' }, id: 'parent-build', overrides: { prop: 'prop-value' }, - }); + }) - expect(hash.value).toContain('file.hash'); //project files - expect(hash.value).toContain('prop-value'); //overrides - expect(hash.value).toContain('parent'); //project - expect(hash.value).toContain('build'); //target - expect(hash.value).toContain('runtime123'); - expect(hash.value).toContain('runtime456'); - expect(hash.value).toContain('env123'); + expect(hash.value).toContain('file.hash') //project files + expect(hash.value).toContain('prop-value') //overrides + expect(hash.value).toContain('parent') //project + expect(hash.value).toContain('build') //target + expect(hash.value).toContain('runtime123') + expect(hash.value).toContain('runtime456') + expect(hash.value).toContain('env123') - expect(hash.details.command).toEqual('parent|build||{"prop":"prop-value"}'); + expect(hash.details.command).toEqual('parent|build||{"prop":"prop-value"}') expect(hash.details.nodes).toEqual({ 'parent:{projectRoot}/**/*': '/file|file.hash|{"root":"libs/parent","targets":{"build":{"executor":"unknown","inputs":["default","^default",{"runtime":"echo runtime123"},{"env":"TESTENV"},{"env":"NONEXISTENTENV"}]}}}|{"compilerOptions":{"paths":{"@nrwl/parent":["libs/parent/src/index.ts"],"@nrwl/child":["libs/child/src/index.ts"]}}}', @@ -132,8 +127,8 @@ describe('Hasher', () => { 'runtime:echo runtime456': 'runtime456', 'env:TESTENV': 'env123', 'env:NONEXISTENTENV': '', - }); - }); + }) + }) it('should hash task where the project has dependencies', async () => { const hasher = new Hasher( @@ -171,14 +166,14 @@ describe('Hasher', () => { }, {} as any, {}, - createHashing() - ); + createHashing(), + ) const hash = await hasher.hashTask({ target: { project: 'parent', target: 'build' }, id: 'parent-build', overrides: { prop: 'prop-value' }, - }); + }) assertFilesets(hash, { 'child:{projectRoot}/**/*': { @@ -189,8 +184,8 @@ describe('Hasher', () => { contains: '/filea.ts|/filea.spec.ts', excludes: '/fileb.ts', }, - }); - }); + }) + }) it('should hash non-default filesets', async () => { const hasher = new Hasher( @@ -240,14 +235,14 @@ describe('Hasher', () => { }, } as any, {}, - createHashing() - ); + createHashing(), + ) const hash = await hasher.hashTask({ target: { project: 'parent', target: 'build' }, id: 'parent-build', overrides: { prop: 'prop-value' }, - }); + }) assertFilesets(hash, { 'child:{projectRoot}/**/*': { @@ -258,8 +253,8 @@ describe('Hasher', () => { contains: 'filea.ts', excludes: 'filea.spec.ts', }, - }); - }); + }) + }) it('should hash multiple filesets of a project', async () => { const hasher = new Hasher( @@ -299,37 +294,37 @@ describe('Hasher', () => { }, } as any, {}, - createHashing() - ); + createHashing(), + ) const test = await hasher.hashTask({ target: { project: 'parent', target: 'test' }, id: 'parent-test', overrides: { prop: 'prop-value' }, - }); + }) assertFilesets(test, { 'parent:{projectRoot}/**/*': { contains: 'libs/parent/filea.ts|libs/parent/filea.spec.ts', }, - }); + }) const build = await hasher.hashTask({ target: { project: 'parent', target: 'build' }, id: 'parent-build', overrides: { prop: 'prop-value' }, - }); + }) assertFilesets(build, { 'parent:!{projectRoot}/**/*.spec.ts': { contains: 'libs/parent/filea.ts', excludes: 'libs/parent/filea.spec.ts', }, - }); - }); + }) + }) it('should be able to handle multiple filesets per project', async () => { - process.env.MY_TEST_HASH_ENV = 'MY_TEST_HASH_ENV_VALUE'; + process.env.MY_TEST_HASH_ENV = 'MY_TEST_HASH_ENV_VALUE' const hasher = new Hasher( { nodes: { @@ -387,14 +382,14 @@ describe('Hasher', () => { }, } as any, {}, - createHashing() - ); + createHashing(), + ) const parentHash = await hasher.hashTask({ target: { project: 'parent', target: 'test' }, id: 'parent-test', overrides: { prop: 'prop-value' }, - }); + }) assertFilesets(parentHash, { 'child:!{projectRoot}/**/*.spec.ts': { @@ -404,35 +399,27 @@ describe('Hasher', () => { 'parent:{projectRoot}/**/*': { contains: 'libs/parent/filea.ts|libs/parent/filea.spec.ts', }, - }); + }) - expect(parentHash.details.nodes['{workspaceRoot}/global1']).toEqual( - 'global1.hash' - ); - expect(parentHash.details.nodes['{workspaceRoot}/global2']).toBe( - 'global2.hash' - ); - expect(parentHash.details.nodes['env:MY_TEST_HASH_ENV']).toEqual( - 'MY_TEST_HASH_ENV_VALUE' - ); + expect(parentHash.details.nodes['{workspaceRoot}/global1']).toEqual('global1.hash') + expect(parentHash.details.nodes['{workspaceRoot}/global2']).toBe('global2.hash') + expect(parentHash.details.nodes['env:MY_TEST_HASH_ENV']).toEqual('MY_TEST_HASH_ENV_VALUE') const childHash = await hasher.hashTask({ target: { project: 'child', target: 'test' }, id: 'child-test', overrides: { prop: 'prop-value' }, - }); + }) assertFilesets(childHash, { 'child:{projectRoot}/**/*': { contains: 'libs/child/fileb.ts|libs/child/fileb.spec.ts', }, - }); - expect(childHash.details.nodes['{workspaceRoot}/global1']).toEqual( - 'global1.hash' - ); - expect(childHash.details.nodes['{workspaceRoot}/global2']).toBe(undefined); - expect(childHash.details.nodes['env:MY_TEST_HASH_ENV']).toBeUndefined(); - }); + }) + expect(childHash.details.nodes['{workspaceRoot}/global1']).toEqual('global1.hash') + expect(childHash.details.nodes['{workspaceRoot}/global2']).toBe(undefined) + expect(childHash.details.nodes['env:MY_TEST_HASH_ENV']).toBeUndefined() + }) it('should use targetdefaults from nx.json', async () => { const hasher = new Hasher( @@ -481,14 +468,14 @@ describe('Hasher', () => { }, } as any, {}, - createHashing() - ); + createHashing(), + ) const hash = await hasher.hashTask({ target: { project: 'parent', target: 'build' }, id: 'parent-build', overrides: { prop: 'prop-value' }, - }); + }) assertFilesets(hash, { 'child:!{projectRoot}/**/*.spec.ts': { @@ -499,8 +486,8 @@ describe('Hasher', () => { contains: 'libs/parent/filea.ts', excludes: 'libs/parent/filea.spec.ts', }, - }); - }); + }) + }) it('should be able to include only a part of the base tsconfig', async () => { const hasher = new Hasher( @@ -526,30 +513,30 @@ describe('Hasher', () => { runtimeCacheInputs: ['echo runtime123', 'echo runtime456'], selectivelyHashTsConfig: true, }, - createHashing() - ); + createHashing(), + ) const hash = await hasher.hashTask({ target: { project: 'parent', target: 'build' }, id: 'parent-build', overrides: { prop: 'prop-value' }, - }); + }) - expect(hash.value).toContain('file.hash'); //project files - expect(hash.value).toContain('prop-value'); //overrides - expect(hash.value).toContain('parent'); //project - expect(hash.value).toContain('build'); //target - expect(hash.value).toContain('runtime123'); //target - expect(hash.value).toContain('runtime456'); //target + expect(hash.value).toContain('file.hash') //project files + expect(hash.value).toContain('prop-value') //overrides + expect(hash.value).toContain('parent') //project + expect(hash.value).toContain('build') //target + expect(hash.value).toContain('runtime123') //target + expect(hash.value).toContain('runtime456') //target - expect(hash.details.command).toEqual('parent|build||{"prop":"prop-value"}'); + expect(hash.details.command).toEqual('parent|build||{"prop":"prop-value"}') assertFilesets(hash, { 'parent:{projectRoot}/**/*': { contains: '/file', }, - }); - }); + }) + }) it('should hash tasks where the project graph has circular dependencies', async () => { const hasher = new Hasher( @@ -582,20 +569,20 @@ describe('Hasher', () => { }, {} as any, {}, - createHashing() - ); + createHashing(), + ) const tasksHash = await hasher.hashTask({ target: { project: 'parent', target: 'build' }, id: 'parent-build', overrides: { prop: 'prop-value' }, - }); + }) - expect(tasksHash.value).toContain('a.hash'); //project files - expect(tasksHash.value).toContain('b.hash'); //project files - expect(tasksHash.value).toContain('prop-value'); //overrides - expect(tasksHash.value).toContain('parent|build'); //project and target - expect(tasksHash.value).toContain('build'); //target + expect(tasksHash.value).toContain('a.hash') //project files + expect(tasksHash.value).toContain('b.hash') //project files + expect(tasksHash.value).toContain('prop-value') //overrides + expect(tasksHash.value).toContain('parent|build') //project and target + expect(tasksHash.value).toContain('build') //target assertFilesets(tasksHash, { 'child:{projectRoot}/**/*': { @@ -606,19 +593,19 @@ describe('Hasher', () => { contains: 'filea.ts', excludes: 'fileb.tx', }, - }); + }) const hashb = await hasher.hashTask({ target: { project: 'child', target: 'build' }, id: 'child-build', overrides: { prop: 'prop-value' }, - }); + }) - expect(hashb.value).toContain('a.hash'); //project files - expect(hashb.value).toContain('b.hash'); //project files - expect(hashb.value).toContain('prop-value'); //overrides - expect(hashb.value).toContain('child|build'); //project and target - expect(hashb.value).toContain('build'); //target + expect(hashb.value).toContain('a.hash') //project files + expect(hashb.value).toContain('b.hash') //project files + expect(hashb.value).toContain('prop-value') //overrides + expect(hashb.value).toContain('child|build') //project and target + expect(hashb.value).toContain('build') //target assertFilesets(hashb, { 'child:{projectRoot}/**/*': { @@ -629,8 +616,8 @@ describe('Hasher', () => { contains: 'filea.ts', excludes: 'fileb.tx', }, - }); - }); + }) + }) it('should throw an error when failed to execute runtimeCacheInputs', async () => { const hasher = new Hasher( @@ -655,24 +642,22 @@ describe('Hasher', () => { { runtimeCacheInputs: ['boom'], }, - createHashing() - ); + createHashing(), + ) try { await hasher.hashTask({ target: { project: 'parent', target: 'build' }, id: 'parent-build', overrides: {}, - }); - fail('Should not be here'); + }) + fail('Should not be here') } catch (e) { - expect(e.message).toContain('Nx failed to execute'); - expect(e.message).toContain('boom'); - expect( - e.message.includes(' not found') || e.message.includes('not recognized') - ).toBeTruthy(); + expect(e.message).toContain('Nx failed to execute') + expect(e.message).toContain('boom') + expect(e.message.includes(' not found') || e.message.includes('not recognized')).toBeTruthy() } - }); + }) it('should hash implicit deps', async () => { const hasher = new Hasher( @@ -697,18 +682,18 @@ describe('Hasher', () => { }, } as any, {}, - createHashing() - ); + createHashing(), + ) const tasksHash = await hasher.hashTask({ target: { project: 'parent', target: 'build' }, id: 'parent-build', overrides: { prop: 'prop-value' }, - }); + }) - expect(tasksHash.value).toContain('global1.hash'); - expect(tasksHash.value).toContain('global2.hash'); - }); + expect(tasksHash.value).toContain('global1.hash') + expect(tasksHash.value).toContain('global2.hash') + }) it('should hash npm project versions', async () => { const hasher = new Hasher( @@ -736,28 +721,26 @@ describe('Hasher', () => { }, dependencies: { 'npm:react': [], - app: [ - { source: 'app', target: 'npm:react', type: DependencyType.static }, - ], + app: [{ source: 'app', target: 'npm:react', type: DependencyType.static }], }, allWorkspaceFiles, }, {} as any, {}, - createHashing() - ); + createHashing(), + ) const hash = await hasher.hashTask({ target: { project: 'app', target: 'build' }, id: 'app-build', overrides: { prop: 'prop-value' }, - }); + }) // note that the parent hash is based on parent source files only! assertFilesets(hash, { 'npm:react': { contains: '17.0.0' }, - }); - }); + }) + }) it('should hash missing dependent npm project versions', async () => { const hasher = new Hasher( @@ -788,20 +771,20 @@ describe('Hasher', () => { }, {} as any, {}, - createHashing() - ); + createHashing(), + ) const hash = await hasher.hashTask({ target: { project: 'app', target: 'build' }, id: 'app-build', overrides: { prop: 'prop-value' }, - }); + }) // note that the parent hash is based on parent source files only! assertFilesets(hash, { 'npm:react': { contains: '__npm:react__' }, - }); - }); + }) + }) describe('expandNamedInput', () => { it('should expand named inputs', () => { @@ -809,38 +792,38 @@ describe('Hasher', () => { a: ['a.txt', { fileset: 'myfileset' }], b: ['b.txt'], c: ['a', { input: 'b', projects: 'self' }], - }); + }) expect(expanded).toEqual([ { fileset: 'a.txt' }, { fileset: 'myfileset' }, { fileset: 'b.txt' }, - ]); - }); + ]) + }) it('should throw when an input is not defined"', () => { - expect(() => expandNamedInput('c', {})).toThrow(); + expect(() => expandNamedInput('c', {})).toThrow() expect(() => expandNamedInput('b', { b: [{ input: 'c', projects: 'self' }], - }) - ).toThrow(); - }); + }), + ).toThrow() + }) it('should throw when ^ is used', () => { expect(() => expandNamedInput('b', { b: ['^c'], - }) - ).toThrowError('namedInputs definitions cannot start with ^'); - }); + }), + ).toThrowError('namedInputs definitions cannot start with ^') + }) it('should treat strings as filesets when no matching inputs', () => { const expanded = expandNamedInput('b', { b: ['c'], - }); - expect(expanded).toEqual([{ fileset: 'c' }]); - }); - }); + }) + expect(expanded).toEqual([{ fileset: 'c' }]) + }) + }) describe('filterUsingGlobPatterns', () => { it('should OR all positive patterns and AND all negative patterns (when positive and negative patterns)', () => { @@ -857,11 +840,11 @@ describe('Hasher', () => { '{projectRoot}/**/*.js', '!{projectRoot}/**/*.spec.ts', '!{projectRoot}/**/*.md', - ] - ); + ], + ) - expect(filtered.map((f) => f.file)).toEqual(['root/a.ts', 'root/b.js']); - }); + expect(filtered.map((f) => f.file)).toEqual(['root/a.ts', 'root/b.js']) + }) it('should OR all positive patterns and AND all negative patterns (when negative patterns)', () => { const filtered = filterUsingGlobPatterns( @@ -872,11 +855,11 @@ describe('Hasher', () => { { file: 'root/c.spec.ts' }, { file: 'root/d.md' }, ] as any, - ['!{projectRoot}/**/*.spec.ts', '!{projectRoot}/**/*.md'] - ); + ['!{projectRoot}/**/*.spec.ts', '!{projectRoot}/**/*.md'], + ) - expect(filtered.map((f) => f.file)).toEqual(['root/a.ts', 'root/b.js']); - }); + expect(filtered.map((f) => f.file)).toEqual(['root/a.ts', 'root/b.js']) + }) it('should OR all positive patterns and AND all negative patterns (when positive patterns)', () => { const filtered = filterUsingGlobPatterns( @@ -887,45 +870,36 @@ describe('Hasher', () => { { file: 'root/c.spec.ts' }, { file: 'root/d.md' }, ] as any, - ['{projectRoot}/**/*.ts', '{projectRoot}/**/*.js'] - ); + ['{projectRoot}/**/*.ts', '{projectRoot}/**/*.js'], + ) - expect(filtered.map((f) => f.file)).toEqual([ - 'root/a.ts', - 'root/b.js', - 'root/c.spec.ts', - ]); - }); + expect(filtered.map((f) => f.file)).toEqual(['root/a.ts', 'root/b.js', 'root/c.spec.ts']) + }) it('should handle projects with the root set to .', () => { const filtered = filterUsingGlobPatterns( '.', - [ - { file: 'a.ts' }, - { file: 'b.md' }, - { file: 'dir/a.ts' }, - { file: 'dir/b.md' }, - ] as any, - ['{projectRoot}/**/*.ts', '!{projectRoot}/**/*.md'] - ); + [{ file: 'a.ts' }, { file: 'b.md' }, { file: 'dir/a.ts' }, { file: 'dir/b.md' }] as any, + ['{projectRoot}/**/*.ts', '!{projectRoot}/**/*.md'], + ) - expect(filtered.map((f) => f.file)).toEqual(['a.ts', 'dir/a.ts']); - }); - }); -}); + expect(filtered.map((f) => f.file)).toEqual(['a.ts', 'dir/a.ts']) + }) + }) +}) function assertFilesets( hash: Hash, - assertions: { [name: string]: { contains?: string; excludes?: string } } + assertions: { [name: string]: { contains?: string; excludes?: string } }, ) { - const nodes = hash.details.nodes; + const nodes = hash.details.nodes for (let k of Object.keys(assertions)) { - expect(nodes[k]).toBeDefined(); + expect(nodes[k]).toBeDefined() if (assertions[k].contains) { - expect(nodes[k]).toContain(assertions[k].contains); + expect(nodes[k]).toContain(assertions[k].contains) } if (assertions[k].excludes) { - expect(nodes[k]).not.toContain(assertions[k].excludes); + expect(nodes[k]).not.toContain(assertions[k].excludes) } } } diff --git a/libs/plugins/better-nx-tsc/src/utils/check-dependencies.ts b/libs/plugins/better-nx-tsc/src/utils/check-dependencies.ts index 885478f6..4b3392e9 100644 --- a/libs/plugins/better-nx-tsc/src/utils/check-dependencies.ts +++ b/libs/plugins/better-nx-tsc/src/utils/check-dependencies.ts @@ -1,18 +1,18 @@ -import { ExecutorContext, ProjectGraphProjectNode } from '@nrwl/devkit'; +import { ExecutorContext, ProjectGraphProjectNode } from '@nrwl/devkit' import { calculateProjectDependencies, createTmpTsConfig, DependentBuildableProjectNode, -} from '@nrwl/workspace/src/utilities/buildable-libs-utils'; +} from '@nrwl/workspace/src/utilities/buildable-libs-utils' export function checkDependencies( context: ExecutorContext, - tsConfigPath: string + tsConfigPath: string, ): { - tmpTsConfig: string | null; - projectRoot: string; - target: ProjectGraphProjectNode; - dependencies: DependentBuildableProjectNode[]; + tmpTsConfig: string | null + projectRoot: string + target: ProjectGraphProjectNode + dependencies: DependentBuildableProjectNode[] } { const { target, dependencies } = calculateProjectDependencies( context.projectGraph, @@ -20,24 +20,18 @@ export function checkDependencies( context.projectName, context.targetName, context.configurationName, - true - ); + true, + ) - console.log({ dependencies }); - const projectRoot = target.data.root; + const projectRoot = target.data.root if (dependencies.length > 0) { return { - tmpTsConfig: createTmpTsConfig( - tsConfigPath, - context.root, - projectRoot, - dependencies - ), + tmpTsConfig: createTmpTsConfig(tsConfigPath, context.root, projectRoot, dependencies), projectRoot, target, dependencies, - }; + } } return { @@ -45,5 +39,5 @@ export function checkDependencies( projectRoot, target, dependencies, - }; + } } diff --git a/libs/plugins/better-nx-tsc/src/utils/inline.ts b/libs/plugins/better-nx-tsc/src/utils/inline.ts index 1d486a15..b405730f 100644 --- a/libs/plugins/better-nx-tsc/src/utils/inline.ts +++ b/libs/plugins/better-nx-tsc/src/utils/inline.ts @@ -1,123 +1,108 @@ -import type { ExecutorContext, ProjectGraphProjectNode } from '@nrwl/devkit'; -import { normalizePath, readJsonFile } from '@nrwl/devkit'; -import { - copySync, - readdirSync, - readFileSync, - removeSync, - writeFileSync, -} from 'fs-extra'; -import { join, relative } from 'path'; -import type { NormalizedExecutorOptions } from '../executors/tsc/schema'; -import { existsSync } from 'fs'; +import type { ExecutorContext, ProjectGraphProjectNode } from '@nrwl/devkit' +import { normalizePath, readJsonFile } from '@nrwl/devkit' +import { copySync, readdirSync, readFileSync, removeSync, writeFileSync } from 'fs-extra' +import { join, relative } from 'path' +import type { NormalizedExecutorOptions } from '../executors/tsc/schema' +import { existsSync } from 'fs' interface InlineProjectNode { - name: string; - root: string; - sourceRoot: string; - pathAlias: string; - buildOutputPath?: string; + name: string + root: string + sourceRoot: string + pathAlias: string + buildOutputPath?: string } export interface InlineProjectGraph { - nodes: Record; - externals: Record; - dependencies: Record; + nodes: Record + externals: Record + dependencies: Record } export function isInlineGraphEmpty(inlineGraph: InlineProjectGraph): boolean { - return Object.keys(inlineGraph.nodes).length === 0; + return Object.keys(inlineGraph.nodes).length === 0 } export function handleInliningBuild( context: ExecutorContext, options: NormalizedExecutorOptions, - tsConfigPath: string + tsConfigPath: string, ): InlineProjectGraph { - const tsConfigJson = readJsonFile(tsConfigPath); - const pathAliases = - tsConfigJson['compilerOptions']['paths'] || readBasePathAliases(context); - const inlineGraph = createInlineGraph(context, options, pathAliases); + const tsConfigJson = readJsonFile(tsConfigPath) + const pathAliases = tsConfigJson['compilerOptions']['paths'] || readBasePathAliases(context) + const inlineGraph = createInlineGraph(context, options, pathAliases) if (isInlineGraphEmpty(inlineGraph)) { - return inlineGraph; + return inlineGraph } - buildInlineGraphExternals(context, inlineGraph, pathAliases); + buildInlineGraphExternals(context, inlineGraph, pathAliases) - return inlineGraph; + return inlineGraph } export function postProcessInlinedDependencies( outputPath: string, parentOutputPath: string, - inlineGraph: InlineProjectGraph + inlineGraph: InlineProjectGraph, ) { if (isInlineGraphEmpty(inlineGraph)) { - return; + return } - const parentDistPath = join(outputPath, parentOutputPath); + const parentDistPath = join(outputPath, parentOutputPath) // move parentOutput - movePackage(parentDistPath, outputPath); + movePackage(parentDistPath, outputPath) - const inlinedDepsDestOutputRecord: Record = {}; + const inlinedDepsDestOutputRecord: Record = {} // move inlined outputs - for (const inlineDependenciesNames of Object.values( - inlineGraph.dependencies - )) { + for (const inlineDependenciesNames of Object.values(inlineGraph.dependencies)) { for (const inlineDependenciesName of inlineDependenciesNames) { - const inlineDependency = inlineGraph.nodes[inlineDependenciesName]; + const inlineDependency = inlineGraph.nodes[inlineDependenciesName] const depOutputPath = - inlineDependency.buildOutputPath || - join(outputPath, inlineDependency.root); - const destDepOutputPath = join(outputPath, inlineDependency.name); - const isBuildable = !!inlineDependency.buildOutputPath; + inlineDependency.buildOutputPath || join(outputPath, inlineDependency.root) + const destDepOutputPath = join(outputPath, inlineDependency.name) + const isBuildable = !!inlineDependency.buildOutputPath if (isBuildable) { - copySync(depOutputPath, destDepOutputPath, { overwrite: true }); + copySync(depOutputPath, destDepOutputPath, { overwrite: true }) } else { - movePackage(depOutputPath, destDepOutputPath); + movePackage(depOutputPath, destDepOutputPath) } // TODO: hard-coded "src" - inlinedDepsDestOutputRecord[inlineDependency.pathAlias] = - destDepOutputPath + '/src'; + inlinedDepsDestOutputRecord[inlineDependency.pathAlias] = destDepOutputPath + '/src' } } - updateImports(outputPath, inlinedDepsDestOutputRecord); + updateImports(outputPath, inlinedDepsDestOutputRecord) } function readBasePathAliases(context: ExecutorContext) { - return readJsonFile(getRootTsConfigPath(context))?.['compilerOptions'][ - 'paths' - ]; + return readJsonFile(getRootTsConfigPath(context))?.['compilerOptions']['paths'] } export function getRootTsConfigPath(context: ExecutorContext): string | null { for (const tsConfigName of ['tsconfig.base.json', 'tsconfig.json']) { - const tsConfigPath = join(context.root, tsConfigName); + const tsConfigPath = join(context.root, tsConfigName) if (existsSync(tsConfigPath)) { - return tsConfigPath; + return tsConfigPath } } - throw new Error( - 'Could not find a root tsconfig.json or tsconfig.base.json file.' - ); + throw new Error('Could not find a root tsconfig.json or tsconfig.base.json file.') } function emptyInlineGraph(): InlineProjectGraph { - return { nodes: {}, externals: {}, dependencies: {} }; + return { nodes: {}, externals: {}, dependencies: {} } } function projectNodeToInlineProjectNode( projectNode: ProjectGraphProjectNode, pathAlias = '', - buildOutputPath = '' + buildOutputPath = '', ): InlineProjectNode { return { name: projectNode.name, @@ -125,7 +110,7 @@ function projectNodeToInlineProjectNode( sourceRoot: projectNode.data.sourceRoot, pathAlias, buildOutputPath, - }; + } } function createInlineGraph( @@ -133,45 +118,40 @@ function createInlineGraph( options: NormalizedExecutorOptions, pathAliases: Record, projectName: string = context.projectName, - inlineGraph: InlineProjectGraph = emptyInlineGraph() + inlineGraph: InlineProjectGraph = emptyInlineGraph(), ) { - if (options.external == null && options.internal == null) return inlineGraph; + if (options.external == null && options.internal == null) return inlineGraph - const projectDependencies = - context.projectGraph.dependencies[projectName] || []; + const projectDependencies = context.projectGraph.dependencies[projectName] || [] - if (projectDependencies.length === 0) return inlineGraph; + if (projectDependencies.length === 0) return inlineGraph if (!inlineGraph.nodes[projectName]) { inlineGraph.nodes[projectName] = projectNodeToInlineProjectNode( - context.projectGraph.nodes[projectName] - ); + context.projectGraph.nodes[projectName], + ) } const implicitDependencies = - context.projectGraph.nodes[projectName].data.implicitDependencies || []; + context.projectGraph.nodes[projectName].data.implicitDependencies || [] for (const projectDependency of projectDependencies) { // skip npm packages if (projectDependency.target.startsWith('npm')) { - continue; + continue } // skip implicitDependencies if (implicitDependencies.includes(projectDependency.target)) { - continue; + continue } const pathAlias = getPathAliasForPackage( context.projectGraph.nodes[projectDependency.target], - pathAliases - ); + pathAliases, + ) - const buildOutputPath = getBuildOutputPath( - projectDependency.target, - context, - options - ); + const buildOutputPath = getBuildOutputPath(projectDependency.target, context, options) const shouldInline = /** @@ -195,162 +175,145 @@ function createInlineGraph( (Array.isArray(options.external) && options.external.length > 0 && !options.external.includes(projectDependency.target)) || - !buildOutputPath; + !buildOutputPath - console.log(shouldInline, projectDependency.target); if (shouldInline) { - inlineGraph.dependencies[projectName] ??= []; - inlineGraph.dependencies[projectName].push(projectDependency.target); + inlineGraph.dependencies[projectName] ??= [] + inlineGraph.dependencies[projectName].push(projectDependency.target) } - inlineGraph.nodes[projectDependency.target] = - projectNodeToInlineProjectNode( - context.projectGraph.nodes[projectDependency.target], - pathAlias, - buildOutputPath - ); + inlineGraph.nodes[projectDependency.target] = projectNodeToInlineProjectNode( + context.projectGraph.nodes[projectDependency.target], + pathAlias, + buildOutputPath, + ) - if ( - context.projectGraph.dependencies[projectDependency.target].length > 0 - ) { + if (context.projectGraph.dependencies[projectDependency.target].length > 0) { inlineGraph = createInlineGraph( context, options, pathAliases, projectDependency.target, - inlineGraph - ); + inlineGraph, + ) } } - return inlineGraph; + return inlineGraph } function buildInlineGraphExternals( context: ExecutorContext, inlineProjectGraph: InlineProjectGraph, - pathAliases: Record + pathAliases: Record, ) { - const allNodes = { ...context.projectGraph.nodes }; + const allNodes = { ...context.projectGraph.nodes } - for (const [parent, dependencies] of Object.entries( - inlineProjectGraph.dependencies - )) { + for (const [parent, dependencies] of Object.entries(inlineProjectGraph.dependencies)) { if (allNodes[parent]) { - delete allNodes[parent]; + delete allNodes[parent] } for (const dependencyName of dependencies) { - const dependencyNode = inlineProjectGraph.nodes[dependencyName]; + const dependencyNode = inlineProjectGraph.nodes[dependencyName] // buildable is still external even if it is a dependency if (dependencyNode.buildOutputPath) { - continue; + continue } if (allNodes[dependencyName]) { - delete allNodes[dependencyName]; + delete allNodes[dependencyName] } } } for (const [projectName, projectNode] of Object.entries(allNodes)) { if (!inlineProjectGraph.externals[projectName]) { - inlineProjectGraph.externals[projectName] = - projectNodeToInlineProjectNode( - projectNode, - getPathAliasForPackage(projectNode, pathAliases) - ); + inlineProjectGraph.externals[projectName] = projectNodeToInlineProjectNode( + projectNode, + getPathAliasForPackage(projectNode, pathAliases), + ) } } } function movePackage(from: string, to: string) { - if (from === to) return; - copySync(from, to, { overwrite: true }); - removeSync(from); + if (from === to) return + copySync(from, to, { overwrite: true }) + removeSync(from) } function updateImports( destOutputPath: string, - inlinedDepsDestOutputRecord: Record + inlinedDepsDestOutputRecord: Record, ) { const importRegex = new RegExp( Object.keys(inlinedDepsDestOutputRecord) .map((pathAlias) => `["'](${pathAlias})["']`) .join('|'), - 'g' - ); - recursiveUpdateImport( - destOutputPath, - importRegex, - inlinedDepsDestOutputRecord - ); + 'g', + ) + recursiveUpdateImport(destOutputPath, importRegex, inlinedDepsDestOutputRecord) } function recursiveUpdateImport( dirPath: string, importRegex: RegExp, inlinedDepsDestOutputRecord: Record, - rootParentDir?: string + rootParentDir?: string, ) { - const files = readdirSync(dirPath, { withFileTypes: true }); + const files = readdirSync(dirPath, { withFileTypes: true }) for (const file of files) { // only check .js and .d.ts files - if ( - file.isFile() && - (file.name.endsWith('.js') || file.name.endsWith('.d.ts')) - ) { - const filePath = join(dirPath, file.name); - const fileContent = readFileSync(filePath, 'utf-8'); + if (file.isFile() && (file.name.endsWith('.js') || file.name.endsWith('.d.ts'))) { + const filePath = join(dirPath, file.name) + const fileContent = readFileSync(filePath, 'utf-8') const updatedContent = fileContent.replace(importRegex, (matched) => { - const result = matched.replace(/['"]/g, ''); + const result = matched.replace(/['"]/g, '') // If a match is the same as the rootParentDir, we're checking its own files so we return the matched as in no changes. - if (result === rootParentDir) return matched; - const importPath = `"${relative( - dirPath, - inlinedDepsDestOutputRecord[result] - )}"`; - return normalizePath(importPath); - }); - writeFileSync(filePath, updatedContent); + if (result === rootParentDir) return matched + const importPath = `"${relative(dirPath, inlinedDepsDestOutputRecord[result])}"` + return normalizePath(importPath) + }) + writeFileSync(filePath, updatedContent) } else if (file.isDirectory()) { recursiveUpdateImport( join(dirPath, file.name), importRegex, inlinedDepsDestOutputRecord, - rootParentDir || file.name - ); + rootParentDir || file.name, + ) } } } function getPathAliasForPackage( packageNode: ProjectGraphProjectNode, - pathAliases: Record + pathAliases: Record, ): string { - if (!packageNode) return ''; + if (!packageNode) return '' for (const [alias, paths] of Object.entries(pathAliases)) { if (paths.some((path) => path.includes(packageNode.data.root))) { - return alias; + return alias } } - return ''; + return '' } function getBuildOutputPath( projectName: string, context: ExecutorContext, - options: NormalizedExecutorOptions + options: NormalizedExecutorOptions, ): string { - const projectTargets = context.projectGraph.nodes[projectName]?.data?.targets; - if (!projectTargets) return ''; + const projectTargets = context.projectGraph.nodes[projectName]?.data?.targets + if (!projectTargets) return '' const buildTarget = options.externalBuildTargets.find( - (buildTarget) => projectTargets[buildTarget] - ); + (buildTarget) => projectTargets[buildTarget], + ) - return buildTarget ? projectTargets[buildTarget].options['outputPath'] : ''; + return buildTarget ? projectTargets[buildTarget].options['outputPath'] : '' } diff --git a/libs/plugins/better-nx-tsc/src/utils/package-json/create-package-json.ts b/libs/plugins/better-nx-tsc/src/utils/package-json/create-package-json.ts index e5606f94..4da35668 100644 --- a/libs/plugins/better-nx-tsc/src/utils/package-json/create-package-json.ts +++ b/libs/plugins/better-nx-tsc/src/utils/package-json/create-package-json.ts @@ -30,7 +30,6 @@ export function createPackageJson( } = {}, ): PackageJson { const projectNode = graph.nodes[projectName] - console.dir({ projectNode, options }, { depth: null }) const { selfInputs, dependencyInputs } = options.target ? getTargetInputs(readNxJson(), projectNode, options.target) @@ -70,7 +69,6 @@ export function createPackageJson( } } catch (e) {} } - console.dir({ npmDeps }, { depth: null }) const rootPackageJson = readJsonFile(`${options.root || workspaceRoot}/package.json`) @@ -144,16 +142,12 @@ function findAllNpmDeps( rootPatterns ?? dependencyPatterns, ) - console.dir(projectNode.data.files, { depth: null }) - const projectDependencies = new Set() projectFiles.forEach((fileData) => fileData.dependencies?.forEach((dep) => projectDependencies.add(dep.target)), ) - console.dir([...projectDependencies], { depth: null }) - for (const dep of projectDependencies) { const node = graph.externalNodes[dep] diff --git a/libs/plugins/better-nx-tsc/src/utils/package-json/get-filtered-dependencies.ts b/libs/plugins/better-nx-tsc/src/utils/package-json/get-filtered-dependencies.ts index 12fac5b5..8c437189 100644 --- a/libs/plugins/better-nx-tsc/src/utils/package-json/get-filtered-dependencies.ts +++ b/libs/plugins/better-nx-tsc/src/utils/package-json/get-filtered-dependencies.ts @@ -1,42 +1,33 @@ -import { DependentBuildableProjectNode } from '@nrwl/workspace/src/utilities/buildable-libs-utils'; -import { readNxJson } from 'nx/src/config/configuration'; -import { ProjectGraphProjectNode } from 'nx/src/config/project-graph'; -import { - filterUsingGlobPatterns, - getTargetInputs, -} from '../../executors/tsc/hasher'; +import { DependentBuildableProjectNode } from '@nrwl/workspace/src/utilities/buildable-libs-utils' +import { readNxJson } from 'nx/src/config/configuration' +import { ProjectGraphProjectNode } from 'nx/src/config/project-graph' +import { filterUsingGlobPatterns, getTargetInputs } from '../../executors/tsc/hasher' export function getFilteredDependencies( projectNode: ProjectGraphProjectNode, options: { - target?: string; - root?: string; - dependencies: DependentBuildableProjectNode[]; - } + target?: string + root?: string + dependencies: DependentBuildableProjectNode[] + }, ) { - console.log({ options, projectNode }); const { selfInputs, dependencyInputs } = options.target ? getTargetInputs(readNxJson(), projectNode, options.target) - : { selfInputs: [], dependencyInputs: [] }; - console.log({ selfInputs, dependencyInputs }); + : { selfInputs: [], dependencyInputs: [] } const projectFiles = filterUsingGlobPatterns( projectNode.data.root, projectNode.data.files, - selfInputs ?? dependencyInputs - ); + selfInputs ?? dependencyInputs, + ) const topLevelDependenciesInFiles = projectFiles.flatMap((fileData) => - fileData.dependencies?.map((dep) => dep.target) - ); - console.log({ topLevelDependenciesInFiles }); + fileData.dependencies?.map((dep) => dep.target), + ) const filteredDependencies = options.dependencies.filter((dep) => { - console.log({ dep }); - return topLevelDependenciesInFiles.includes(dep.name); - }); + return topLevelDependenciesInFiles.includes(dep.name) + }) - console.log({ filteredDependencies }); - - return filteredDependencies; + return filteredDependencies } diff --git a/libs/plugins/better-nx-tsc/src/utils/package-json/index.ts b/libs/plugins/better-nx-tsc/src/utils/package-json/index.ts index 081b602e..47d0c077 100644 --- a/libs/plugins/better-nx-tsc/src/utils/package-json/index.ts +++ b/libs/plugins/better-nx-tsc/src/utils/package-json/index.ts @@ -1,46 +1,45 @@ -import { join } from 'path'; -import { ExecutorContext } from '@nrwl/devkit'; -import { DependentBuildableProjectNode } from '@nrwl/workspace/src/utilities/buildable-libs-utils'; +import { join } from 'path' +import { ExecutorContext } from '@nrwl/devkit' +import { DependentBuildableProjectNode } from '@nrwl/workspace/src/utilities/buildable-libs-utils' -import { watchForSingleFileChanges } from '@nrwl/js/src/utils/watch-for-single-file-changes'; -import type { UpdatePackageJsonOption } from './update-package-json'; -import { updatePackageJson } from './update-package-json'; -import { checkDependencies } from '../check-dependencies'; +import { watchForSingleFileChanges } from '@nrwl/js/src/utils/watch-for-single-file-changes' +import type { UpdatePackageJsonOption } from './update-package-json.js' +import { updatePackageJson } from './update-package-json.js' +import { checkDependencies } from '../check-dependencies.js' -export interface CopyPackageJsonOptions - extends Omit { - watch?: boolean; - extraDependencies?: DependentBuildableProjectNode[]; - overrideDependencies?: DependentBuildableProjectNode[]; +export interface CopyPackageJsonOptions extends Omit { + watch?: boolean + extraDependencies?: DependentBuildableProjectNode[] + overrideDependencies?: DependentBuildableProjectNode[] } export interface CopyPackageJsonResult { - success?: boolean; + success?: boolean // Only when "watch: true" - stop?: () => void; + stop?: () => void } export async function copyPackageJson( _options: CopyPackageJsonOptions, - context: ExecutorContext + context: ExecutorContext, ): Promise { if (!context.target.options.tsConfig) { throw new Error( - `Could not find tsConfig option for "${context.targetName}" target of "${context.projectName}" project. Check that your project configuration is correct.` - ); + `Could not find tsConfig option for "${context.targetName}" target of "${context.projectName}" project. Check that your project configuration is correct.`, + ) } let { target, dependencies, projectRoot } = checkDependencies( context, - context.target.options.tsConfig - ); + context.target.options.tsConfig, + ) - const options = { ..._options, projectRoot }; + const options = { ..._options, projectRoot } if (options.extraDependencies) { - dependencies.push(...options.extraDependencies); + dependencies.push(...options.extraDependencies) } if (options.overrideDependencies) { - dependencies = options.overrideDependencies; + dependencies = options.overrideDependencies } if (options.watch) { @@ -48,13 +47,13 @@ export async function copyPackageJson( context.projectName, options.projectRoot, 'package.json', - () => updatePackageJson(options, context, target, dependencies) - ); + () => updatePackageJson(options, context, target, dependencies), + ) // Copy it once before changes - updatePackageJson(options, context, target, dependencies); - return { success: true, stop: dispose }; + updatePackageJson(options, context, target, dependencies) + return { success: true, stop: dispose } } else { - updatePackageJson(options, context, target, dependencies); - return { success: true }; + updatePackageJson(options, context, target, dependencies) + return { success: true } } } diff --git a/libs/plugins/better-nx-tsc/src/utils/package-json/update-package-json.spec.ts b/libs/plugins/better-nx-tsc/src/utils/package-json/update-package-json.spec.ts index 3e883e5b..922ddfef 100644 --- a/libs/plugins/better-nx-tsc/src/utils/package-json/update-package-json.spec.ts +++ b/libs/plugins/better-nx-tsc/src/utils/package-json/update-package-json.spec.ts @@ -1,17 +1,17 @@ -import 'nx/src/utils/testing/mock-fs'; +import 'nx/src/utils/testing/mock-fs' import { getUpdatedPackageJsonContent, updatePackageJson, UpdatePackageJsonOption, -} from './update-package-json'; -import { vol } from 'memfs'; -import { DependencyType, ExecutorContext, ProjectGraph } from '@nrwl/devkit'; -import { DependentBuildableProjectNode } from '@nrwl/workspace/src/utilities/buildable-libs-utils'; +} from './update-package-json.js' +import { vol } from 'memfs' +import { DependencyType, ExecutorContext, ProjectGraph } from '@nrwl/devkit' +import { DependentBuildableProjectNode } from '@nrwl/workspace/src/utilities/buildable-libs-utils' jest.mock('nx/src/utils/workspace-root', () => ({ workspaceRoot: '/root', -})); +})) describe('getUpdatedPackageJsonContent', () => { it('should update fields for commonjs only (default)', () => { @@ -24,16 +24,16 @@ describe('getUpdatedPackageJsonContent', () => { main: 'proj/src/index.ts', outputPath: 'dist/proj', projectRoot: 'proj', - } - ); + }, + ) expect(json).toEqual({ name: 'test', main: './src/index.js', types: './src/index.d.ts', version: '0.0.1', - }); - }); + }) + }) it('should update fields for esm only', () => { const json = getUpdatedPackageJsonContent( @@ -46,8 +46,8 @@ describe('getUpdatedPackageJsonContent', () => { outputPath: 'dist/proj', projectRoot: 'proj', format: ['esm'], - } - ); + }, + ) expect(json).toEqual({ name: 'test', @@ -56,8 +56,8 @@ describe('getUpdatedPackageJsonContent', () => { main: './src/index.js', types: './src/index.d.ts', version: '0.0.1', - }); - }); + }) + }) it('should update fields for commonjs + esm', () => { const json = getUpdatedPackageJsonContent( @@ -70,8 +70,8 @@ describe('getUpdatedPackageJsonContent', () => { outputPath: 'dist/proj', projectRoot: 'proj', format: ['esm', 'cjs'], - } - ); + }, + ) expect(json).toEqual({ name: 'test', @@ -79,8 +79,8 @@ describe('getUpdatedPackageJsonContent', () => { module: './src/index.js', types: './src/index.d.ts', version: '0.0.1', - }); - }); + }) + }) it('should support skipping types', () => { const json = getUpdatedPackageJsonContent( @@ -93,15 +93,15 @@ describe('getUpdatedPackageJsonContent', () => { outputPath: 'dist/proj', projectRoot: 'proj', skipTypings: true, - } - ); + }, + ) expect(json).toEqual({ name: 'test', main: './src/index.js', version: '0.0.1', - }); - }); + }) + }) it('should support generated exports field', () => { const json = getUpdatedPackageJsonContent( @@ -115,8 +115,8 @@ describe('getUpdatedPackageJsonContent', () => { projectRoot: 'proj', format: ['esm'], generateExportsField: true, - } - ); + }, + ) expect(json).toEqual({ name: 'test', @@ -128,8 +128,8 @@ describe('getUpdatedPackageJsonContent', () => { exports: { '.': { import: './src/index.js' }, }, - }); - }); + }) + }) it('should support different CJS file extension', () => { const json = getUpdatedPackageJsonContent( @@ -144,8 +144,8 @@ describe('getUpdatedPackageJsonContent', () => { format: ['esm', 'cjs'], outputFileExtensionForCjs: '.cjs', generateExportsField: true, - } - ); + }, + ) expect(json).toEqual({ name: 'test', @@ -156,8 +156,8 @@ describe('getUpdatedPackageJsonContent', () => { exports: { '.': { require: './src/index.cjs', import: './src/index.js' }, }, - }); - }); + }) + }) it('should not set types when { skipTypings: true }', () => { const json = getUpdatedPackageJsonContent( @@ -170,15 +170,15 @@ describe('getUpdatedPackageJsonContent', () => { outputPath: 'dist/proj', projectRoot: 'proj', skipTypings: true, - } - ); + }, + ) expect(json).toEqual({ name: 'test', main: './src/index.js', version: '0.0.1', - }); - }); + }) + }) it('should support different exports field shape', () => { // exports: string @@ -196,8 +196,8 @@ describe('getUpdatedPackageJsonContent', () => { format: ['esm', 'cjs'], outputFileExtensionForCjs: '.cjs', generateExportsField: true, - } - ) + }, + ), ).toEqual({ name: 'test', main: './src/index.cjs', @@ -205,7 +205,7 @@ describe('getUpdatedPackageJsonContent', () => { types: './src/index.d.ts', version: '0.0.1', exports: './custom.js', - }); + }) // exports: { '.': string } expect( @@ -224,8 +224,8 @@ describe('getUpdatedPackageJsonContent', () => { format: ['esm', 'cjs'], outputFileExtensionForCjs: '.cjs', generateExportsField: true, - } - ) + }, + ), ).toEqual({ name: 'test', main: './src/index.cjs', @@ -235,7 +235,7 @@ describe('getUpdatedPackageJsonContent', () => { exports: { '.': './custom.js', }, - }); + }) // exports: { './custom': string } expect( @@ -254,8 +254,8 @@ describe('getUpdatedPackageJsonContent', () => { format: ['esm', 'cjs'], outputFileExtensionForCjs: '.cjs', generateExportsField: true, - } - ) + }, + ), ).toEqual({ name: 'test', main: './src/index.cjs', @@ -269,9 +269,9 @@ describe('getUpdatedPackageJsonContent', () => { }, './custom': './custom.js', }, - }); - }); -}); + }) + }) +}) describe('updatePackageJson', () => { const originalPackageJson = { @@ -279,13 +279,13 @@ describe('updatePackageJson', () => { version: '0.0.3', dependencies: { lib2: '^0.0.1' }, devDependencies: { jest: '27' }, - }; + } const rootPackageJson = { name: '@org/root', version: '1.2.3', dependencies: { external1: '~1.0.0', external2: '^4.0.0' }, devDependencies: { jest: '27' }, - }; + } const projectGraph: ProjectGraph = { nodes: { '@org/lib1': { @@ -359,7 +359,7 @@ describe('updatePackageJson', () => { }, ], }, - }; + } const context: ExecutorContext = { root: '/root', projectName: '@org/lib1', @@ -367,23 +367,23 @@ describe('updatePackageJson', () => { cwd: '', targetName: 'build', projectGraph, - }; + } it('should generate new package if missing', () => { - const fsJson = {}; - vol.fromJSON(fsJson, '/root'); + const fsJson = {} + vol.fromJSON(fsJson, '/root') const options: UpdatePackageJsonOption = { outputPath: 'dist/libs/lib1', projectRoot: 'libs/lib1', main: 'libs/lib1/main.ts', - }; - const dependencies: DependentBuildableProjectNode[] = []; - updatePackageJson(options, context, undefined, dependencies); + } + const dependencies: DependentBuildableProjectNode[] = [] + updatePackageJson(options, context, undefined, dependencies) - expect(vol.existsSync('dist/libs/lib1/package.json')).toEqual(true); + expect(vol.existsSync('dist/libs/lib1/package.json')).toEqual(true) const distPackageJson = JSON.parse( - vol.readFileSync('dist/libs/lib1/package.json', 'utf-8').toString() - ); + vol.readFileSync('dist/libs/lib1/package.json', 'utf-8').toString(), + ) expect(distPackageJson).toMatchInlineSnapshot(` { "main": "./main.js", @@ -391,52 +391,50 @@ describe('updatePackageJson', () => { "types": "./main.d.ts", "version": "0.0.1", } - `); - }); + `) + }) it('should keep package unchanged if "updateBuildableProjectDepsInPackageJson" not set', () => { const fsJson = { 'libs/lib1/package.json': JSON.stringify(originalPackageJson, null, 2), - }; - vol.fromJSON(fsJson, '/root'); + } + vol.fromJSON(fsJson, '/root') const options: UpdatePackageJsonOption = { outputPath: 'dist/libs/lib1', projectRoot: 'libs/lib1', main: 'libs/lib1/main.ts', - }; - const dependencies: DependentBuildableProjectNode[] = []; - updatePackageJson(options, context, undefined, dependencies); + } + const dependencies: DependentBuildableProjectNode[] = [] + updatePackageJson(options, context, undefined, dependencies) - expect(vol.existsSync('dist/libs/lib1/package.json')).toEqual(true); + expect(vol.existsSync('dist/libs/lib1/package.json')).toEqual(true) const distPackageJson = JSON.parse( - vol.readFileSync('dist/libs/lib1/package.json', 'utf-8').toString() - ); - expect(distPackageJson.dependencies).toEqual( - originalPackageJson.dependencies - ); - expect(distPackageJson.main).toEqual('./main.js'); - expect(distPackageJson.types).toEqual('./main.d.ts'); - }); + vol.readFileSync('dist/libs/lib1/package.json', 'utf-8').toString(), + ) + expect(distPackageJson.dependencies).toEqual(originalPackageJson.dependencies) + expect(distPackageJson.main).toEqual('./main.js') + expect(distPackageJson.types).toEqual('./main.d.ts') + }) it('should modify package if "updateBuildableProjectDepsInPackageJson" is set', () => { const fsJson = { 'package.json': JSON.stringify(rootPackageJson, null, 2), 'libs/lib1/package.json': JSON.stringify(originalPackageJson, null, 2), - }; - vol.fromJSON(fsJson, '/root'); + } + vol.fromJSON(fsJson, '/root') const options: UpdatePackageJsonOption = { outputPath: 'dist/libs/lib1', projectRoot: 'libs/lib1', main: 'libs/lib1/main.ts', updateBuildableProjectDepsInPackageJson: true, - }; - const dependencies: DependentBuildableProjectNode[] = []; - updatePackageJson(options, context, undefined, dependencies); + } + const dependencies: DependentBuildableProjectNode[] = [] + updatePackageJson(options, context, undefined, dependencies) - expect(vol.existsSync('dist/libs/lib1/package.json')).toEqual(true); + expect(vol.existsSync('dist/libs/lib1/package.json')).toEqual(true) const distPackageJson = JSON.parse( - vol.readFileSync('dist/libs/lib1/package.json', 'utf-8').toString() - ); + vol.readFileSync('dist/libs/lib1/package.json', 'utf-8').toString(), + ) expect(distPackageJson).toMatchInlineSnapshot(` { "dependencies": { @@ -448,6 +446,6 @@ describe('updatePackageJson', () => { "types": "./main.d.ts", "version": "0.0.1", } - `); - }); -}); + `) + }) +}) diff --git a/libs/plugins/better-nx-tsc/src/utils/package-json/update-package-json.ts b/libs/plugins/better-nx-tsc/src/utils/package-json/update-package-json.ts index 22085d5b..772cce90 100644 --- a/libs/plugins/better-nx-tsc/src/utils/package-json/update-package-json.ts +++ b/libs/plugins/better-nx-tsc/src/utils/package-json/update-package-json.ts @@ -91,7 +91,6 @@ export function updatePackageJson( const { dependencies: maybeWrongDeps } = packageJson const fixedDeps = Object.entries(maybeWrongDeps ?? {}).reduce((acc, [key, value]) => { - console.log({ key, value }) if (key.startsWith('@') && !key.includes('/')) { const [pkg, version] = value.split('@') acc[`${key}/${pkg}`] = `^${version}` @@ -203,7 +202,6 @@ export function getUpdatedPackageJsonContent( if (typeof exports !== 'string') { if (typeof exports['.'] !== 'string') { if (hasCjsFormat) { - console.log('HAS CJS FORMAT') exports['.']['import'] ??= mainJsFile } } else if (!hasCjsFormat) { @@ -212,7 +210,6 @@ export function getUpdatedPackageJsonContent( } } - console.log({ hasCjsFormat, hasEsmFormat }) // CJS output may have .cjs or .js file extensions. // Bundlers like rollup and esbuild supports .cjs for CJS and .js for ESM. // Bundlers/Compilers like webpack, tsc, swc do not have different file extensions. diff --git a/libs/plugins/better-nx-tsc/tsconfig.lib.json b/libs/plugins/better-nx-tsc/tsconfig.lib.json index 0ebf7897..78305d50 100644 --- a/libs/plugins/better-nx-tsc/tsconfig.lib.json +++ b/libs/plugins/better-nx-tsc/tsconfig.lib.json @@ -7,6 +7,6 @@ "target": "esnext", "lib": ["ES2022"] }, - "include": ["src/**/*.ts"], + "include": ["**/*.ts"], "exclude": ["jest.config.ts", "src/**/*.spec.ts", "src/**/*.test.ts"] } diff --git a/libs/processors/docx-to-jats/src/lib/processors-docx-to-jats.spec.ts b/libs/processors/docx-to-jats/src/lib/processors-docx-to-jats.spec.ts index 224eb7c1..a018dec6 100755 --- a/libs/processors/docx-to-jats/src/lib/processors-docx-to-jats.spec.ts +++ b/libs/processors/docx-to-jats/src/lib/processors-docx-to-jats.spec.ts @@ -1,4 +1,4 @@ -import { processorsDocxToJats } from './processors-docx-to-jats' +import { processorsDocxToJats } from './processors-docx-to-jats.js' describe('processorsDocxToJats', () => { it('should work', () => { diff --git a/libs/processors/docx-to-jats/tsconfig.spec.json b/libs/processors/docx-to-jats/tsconfig.spec.json index 83cd0e83..7e1d3b87 100755 --- a/libs/processors/docx-to-jats/tsconfig.spec.json +++ b/libs/processors/docx-to-jats/tsconfig.spec.json @@ -2,7 +2,6 @@ "extends": "./tsconfig.json", "compilerOptions": { "outDir": "../../../dist/out-tsc", - "module": "commonjs", "types": ["jest", "node"] }, "include": [ diff --git a/libs/processors/jats-to-tex/src/index.ts b/libs/processors/jats-to-tex/src/index.ts index faca716d..d9532c0e 100755 --- a/libs/processors/jats-to-tex/src/index.ts +++ b/libs/processors/jats-to-tex/src/index.ts @@ -1 +1 @@ -export * from './lib/processors-jats-to-tex' +export * from './lib/processors-jats-to-tex.js' diff --git a/libs/processors/jats-to-tex/tsconfig.lib.json b/libs/processors/jats-to-tex/tsconfig.lib.json index 53047cda..5c108b84 100755 --- a/libs/processors/jats-to-tex/tsconfig.lib.json +++ b/libs/processors/jats-to-tex/tsconfig.lib.json @@ -6,5 +6,5 @@ "types": ["node"] }, "exclude": ["**/*.spec.ts", "**/*.test.ts", "jest.config.ts"], - "include": ["src/**/*.ts"] + "include": ["**/*.ts"] } diff --git a/libs/processors/jats-to-tex/tsconfig.spec.json b/libs/processors/jats-to-tex/tsconfig.spec.json index 83cd0e83..7e1d3b87 100755 --- a/libs/processors/jats-to-tex/tsconfig.spec.json +++ b/libs/processors/jats-to-tex/tsconfig.spec.json @@ -2,7 +2,6 @@ "extends": "./tsconfig.json", "compilerOptions": { "outDir": "../../../dist/out-tsc", - "module": "commonjs", "types": ["jest", "node"] }, "include": [ diff --git a/libs/processors/jote-docx-tex/tsconfig.spec.json b/libs/processors/jote-docx-tex/tsconfig.spec.json index 83cd0e83..7e1d3b87 100755 --- a/libs/processors/jote-docx-tex/tsconfig.spec.json +++ b/libs/processors/jote-docx-tex/tsconfig.spec.json @@ -2,7 +2,6 @@ "extends": "./tsconfig.json", "compilerOptions": { "outDir": "../../../dist/out-tsc", - "module": "commonjs", "types": ["jest", "node"] }, "include": [ diff --git a/libs/rejour/rejour-frontmatter/project.json b/libs/rejour/rejour-frontmatter/project.json index 51776bc2..f357504a 100755 --- a/libs/rejour/rejour-frontmatter/project.json +++ b/libs/rejour/rejour-frontmatter/project.json @@ -11,8 +11,11 @@ "packageJSON": "libs/rejour/rejour-frontmatter/package.json" } }, + "make-publishable": { + "executor": "better-nx-tsc:publishable" + }, "build": { - "executor": "better-nx-tsc:tsc", + "executor": "@nrwl/js:tsc", "outputs": ["{options.outputPath}"], "options": { "rootDir": "libs/rejour/rejour-frontmatter/src", diff --git a/libs/rejour/rejour-meta/project.json b/libs/rejour/rejour-meta/project.json index c4de9e1e..9acff437 100755 --- a/libs/rejour/rejour-meta/project.json +++ b/libs/rejour/rejour-meta/project.json @@ -26,8 +26,11 @@ "passWithNoTests": true } }, + "make-publishable": { + "executor": "better-nx-tsc:publishable" + }, "build": { - "executor": "better-nx-tsc:tsc", + "executor": "@nrwl/js:tsc", "outputs": ["{options.outputPath}"], "options": { "rootDir": "libs/rejour/rejour-meta/src", diff --git a/libs/rejour/rejour-meta/src/lib/rejour-meta.spec.ts b/libs/rejour/rejour-meta/src/lib/rejour-meta.spec.ts index 08f46195..c21a6a2a 100755 --- a/libs/rejour/rejour-meta/src/lib/rejour-meta.spec.ts +++ b/libs/rejour/rejour-meta/src/lib/rejour-meta.spec.ts @@ -1,4 +1,4 @@ -import { rejourMoveAbstract } from './rejour-meta' +import { rejourMoveAbstract } from './rejour-meta.js' describe('rejourMeta', () => { it('should work', () => { diff --git a/libs/rejour/rejour-move-abstract/project.json b/libs/rejour/rejour-move-abstract/project.json index 747264fc..9258e480 100755 --- a/libs/rejour/rejour-move-abstract/project.json +++ b/libs/rejour/rejour-move-abstract/project.json @@ -26,8 +26,11 @@ "passWithNoTests": true } }, + "make-publishable": { + "executor": "better-nx-tsc:publishable" + }, "build": { - "executor": "better-nx-tsc:tsc", + "executor": "@nrwl/js:tsc", "outputs": ["{options.outputPath}"], "options": { "rootDir": "libs/rejour/rejour-move-abstract/src", diff --git a/libs/rejour/rejour-parse/project.json b/libs/rejour/rejour-parse/project.json index dd3276ca..5ed92c07 100755 --- a/libs/rejour/rejour-parse/project.json +++ b/libs/rejour/rejour-parse/project.json @@ -26,8 +26,11 @@ "passWithNoTests": true } }, + "make-publishable": { + "executor": "better-nx-tsc:publishable" + }, "build": { - "executor": "better-nx-tsc:tsc", + "executor": "@nrwl/js:tsc", "outputs": ["{options.outputPath}"], "options": { "rootDir": "libs/rejour/rejour-parse/src", diff --git a/libs/rejour/rejour-parse/src/lib/rejour-parse.ts b/libs/rejour/rejour-parse/src/lib/rejour-parse.ts index 6002ec82..bb789f13 100755 --- a/libs/rejour/rejour-parse/src/lib/rejour-parse.ts +++ b/libs/rejour/rejour-parse/src/lib/rejour-parse.ts @@ -1,11 +1,7 @@ import { fromXml } from 'xast-util-from-xml' import { ParserFunction } from 'unified' -import { - Root as xastRoot, - Node as XastNode, - Element as XastElement, -} from 'xast' +import { Node as XastNode, Element as XastElement } from 'xast' import { Root } from 'jast-types' import { filter } from 'unist-util-filter' import { map } from 'misc' @@ -57,14 +53,11 @@ export default function rejourParse(options: Settings = {}) { const attributes = element.attributes ? Object.entries(element.attributes).reduce( - ( - acc: { [key: string]: any }, - [key, value]: [key: string, value: any] - ) => { + (acc: { [key: string]: any }, [key, value]: [key: string, value: any]) => { acc[pascalToCamelCase(key)] = value return acc }, - {} + {}, ) : {} return { @@ -87,7 +80,5 @@ export default function rejourParse(options: Settings = {}) { * Necessary because working with pascal-case in js is annoying. */ function pascalToCamelCase(input: string): string { - return input.replace(/-(\w)/g, (string, lowercaseLetter) => - lowercaseLetter.toUpperCase() - ) + return input.replace(/-(\w)/g, (string, lowercaseLetter) => lowercaseLetter.toUpperCase()) } diff --git a/libs/rejour/rejour-relatex/project.json b/libs/rejour/rejour-relatex/project.json index bd5366f3..2a6a6fe1 100755 --- a/libs/rejour/rejour-relatex/project.json +++ b/libs/rejour/rejour-relatex/project.json @@ -26,8 +26,11 @@ "passWithNoTests": true } }, + "make-publishable": { + "executor": "better-nx-tsc:publishable" + }, "build": { - "executor": "better-nx-tsc:tsc", + "executor": "@nrwl/js:tsc", "outputs": ["{options.outputPath}"], "options": { "rootDir": "libs/rejour/rejour-relatex/src", diff --git a/libs/rejour/rejour-stringify/project.json b/libs/rejour/rejour-stringify/project.json index a10a682a..b2f2411f 100755 --- a/libs/rejour/rejour-stringify/project.json +++ b/libs/rejour/rejour-stringify/project.json @@ -26,8 +26,11 @@ "passWithNoTests": true } }, + "make-publishable": { + "executor": "better-nx-tsc:publishable" + }, "build": { - "executor": "better-nx-tsc:tsc", + "executor": "@nrwl/js:tsc", "outputs": ["{options.outputPath}"], "options": { "rootDir": "libs/rejour/rejour-stringify/src", diff --git a/libs/relatex/relatex-add-preamble/project.json b/libs/relatex/relatex-add-preamble/project.json index 5593e291..85fc93be 100755 --- a/libs/relatex/relatex-add-preamble/project.json +++ b/libs/relatex/relatex-add-preamble/project.json @@ -26,8 +26,11 @@ "passWithNoTests": true } }, + "make-publishable": { + "executor": "better-nx-tsc:publishable" + }, "build": { - "executor": "better-nx-tsc:tsc", + "executor": "@nrwl/js:tsc", "outputs": ["{options.outputPath}"], "options": { "rootDir": "libs/relatex/relatex-add-preamble/src", diff --git a/libs/relatex/relatex-add-preamble/src/index.ts b/libs/relatex/relatex-add-preamble/src/index.ts index ce15f5b4..2080ef0f 100755 --- a/libs/relatex/relatex-add-preamble/src/index.ts +++ b/libs/relatex/relatex-add-preamble/src/index.ts @@ -1 +1 @@ -export { default } from './lib/relatex-add-preamble' +export { default } from './lib/relatex-add-preamble.js' diff --git a/libs/relatex/relatex-add-preamble/tsconfig.lib.json b/libs/relatex/relatex-add-preamble/tsconfig.lib.json index ff64bb51..5c108b84 100755 --- a/libs/relatex/relatex-add-preamble/tsconfig.lib.json +++ b/libs/relatex/relatex-add-preamble/tsconfig.lib.json @@ -1,7 +1,6 @@ { "extends": "./tsconfig.json", "compilerOptions": { - "module": "commonjs", "outDir": "../../../dist/out-tsc", "declaration": true, "types": ["node"] diff --git a/libs/relatex/relatex-add-preamble/tsconfig.spec.json b/libs/relatex/relatex-add-preamble/tsconfig.spec.json index 83cd0e83..7e1d3b87 100755 --- a/libs/relatex/relatex-add-preamble/tsconfig.spec.json +++ b/libs/relatex/relatex-add-preamble/tsconfig.spec.json @@ -2,7 +2,6 @@ "extends": "./tsconfig.json", "compilerOptions": { "outDir": "../../../dist/out-tsc", - "module": "commonjs", "types": ["jest", "node"] }, "include": [ diff --git a/libs/relatex/relatex-stringify/project.json b/libs/relatex/relatex-stringify/project.json index 747c04db..269f3b56 100755 --- a/libs/relatex/relatex-stringify/project.json +++ b/libs/relatex/relatex-stringify/project.json @@ -26,8 +26,11 @@ "passWithNoTests": true } }, + "make-publishable": { + "executor": "better-nx-tsc:publishable" + }, "build": { - "executor": "better-nx-tsc:tsc", + "executor": "@nrwl/js:tsc", "outputs": ["{options.outputPath}"], "options": { "rootDir": "libs/relatex/relatex-stringify/src", diff --git a/libs/reoff/docx-to-vfile/project.json b/libs/reoff/docx-to-vfile/project.json index f8135984..4a3d83be 100755 --- a/libs/reoff/docx-to-vfile/project.json +++ b/libs/reoff/docx-to-vfile/project.json @@ -25,24 +25,21 @@ "passWithNoTests": true } }, + "make-publishable": { + "executor": "better-nx-tsc:publishable" + }, "build": { - "executor": "better-nx-tsc:tsc", + "executor": "@nrwl/js:tsc", "outputs": ["{options.outputPath}"], "options": { "rootDir": "libs/reoff/docx-to-vfile/src", - "outputPath": "dist/libs/reoff/docx-to-vfile/", + "outputPath": "dist/libs/reoff/docx-to-vfile", "tsConfig": "libs/reoff/docx-to-vfile/tsconfig.lib.json", "main": "libs/reoff/docx-to-vfile/src/index.ts", "assets": ["libs/reoff/docx-to-vfile/*.md"], "updateBuildableProjectDepsInPackageJson": true, "buildableProjectDepsInPackageJsonType": "dependencies" }, - "configurations": { - "cjs": { - "swcrc": "libs/reoff/docx-to-vfile/.cjs.swcrc", - "clean": false - } - }, "dependsOn": [ { "projects": "dependencies", diff --git a/libs/reoff/docx-to-vfile/tsconfig.json b/libs/reoff/docx-to-vfile/tsconfig.json index 65528198..667a3463 100755 --- a/libs/reoff/docx-to-vfile/tsconfig.json +++ b/libs/reoff/docx-to-vfile/tsconfig.json @@ -9,8 +9,5 @@ { "path": "./tsconfig.spec.json" } - ], - "compilerOptions": { - "types": ["vitest"] - } + ] } diff --git a/libs/reoff/reoff-cite/project.json b/libs/reoff/reoff-cite/project.json index 9e9efeb1..61acdbee 100755 --- a/libs/reoff/reoff-cite/project.json +++ b/libs/reoff/reoff-cite/project.json @@ -26,8 +26,11 @@ "passWithNoTests": true } }, + "make-publishable": { + "executor": "better-nx-tsc:publishable" + }, "build": { - "executor": "better-nx-tsc:tsc", + "executor": "@nrwl/js:tsc", "outputs": ["{options.outputPath}"], "options": { "rootDir": "libs/reoff/reoff-cite/src", diff --git a/libs/reoff/reoff-cite/tsconfig.lib.json b/libs/reoff/reoff-cite/tsconfig.lib.json index ff64bb51..5c108b84 100755 --- a/libs/reoff/reoff-cite/tsconfig.lib.json +++ b/libs/reoff/reoff-cite/tsconfig.lib.json @@ -1,7 +1,6 @@ { "extends": "./tsconfig.json", "compilerOptions": { - "module": "commonjs", "outDir": "../../../dist/out-tsc", "declaration": true, "types": ["node"] diff --git a/libs/reoff/reoff-cite/tsconfig.spec.json b/libs/reoff/reoff-cite/tsconfig.spec.json index 83cd0e83..7e1d3b87 100755 --- a/libs/reoff/reoff-cite/tsconfig.spec.json +++ b/libs/reoff/reoff-cite/tsconfig.spec.json @@ -2,7 +2,6 @@ "extends": "./tsconfig.json", "compilerOptions": { "outDir": "../../../dist/out-tsc", - "module": "commonjs", "types": ["jest", "node"] }, "include": [ diff --git a/libs/reoff/reoff-clean/project.json b/libs/reoff/reoff-clean/project.json index e4152686..76b29072 100755 --- a/libs/reoff/reoff-clean/project.json +++ b/libs/reoff/reoff-clean/project.json @@ -26,8 +26,11 @@ "passWithNoTests": true } }, + "make-publishable": { + "executor": "better-nx-tsc:publishable" + }, "build": { - "executor": "better-nx-tsc:tsc", + "executor": "@nrwl/js:tsc", "outputs": ["{options.outputPath}"], "options": { "rootDir": "libs/reoff/reoff-clean/src", diff --git a/libs/reoff/reoff-compile/project.json b/libs/reoff/reoff-compile/project.json index be46103d..ca6f5d88 100644 --- a/libs/reoff/reoff-compile/project.json +++ b/libs/reoff/reoff-compile/project.json @@ -4,20 +4,19 @@ "sourceRoot": "libs/reoff/reoff-compile/src", "projectType": "library", "targets": { + "make-publishable": { + "executor": "better-nx-tsc:publishable" + }, "build": { - "executor": "better-nx-tsc:tsc", - "outputs": [ - "{options.outputPath}" - ], + "executor": "@nrwl/js:tsc", + "outputs": ["{options.outputPath}"], "options": { "rootDir": "libs/reoff/reoff-compile/src", "outputPath": "dist/libs/reoff/reoff-compile", "tsConfig": "libs/reoff/reoff-compile/tsconfig.lib.json", "packageJson": "libs/reoff/reoff-compile/package.json", "main": "libs/reoff/reoff-compile/src/index.ts", - "assets": [ - "libs/reoff/reoff-compile/*.md" - ], + "assets": ["libs/reoff/reoff-compile/*.md"], "updateBuildableProjectDepsInPackageJson": true, "clean": true, "buildableProjectDepsInPackageJsonType": "dependencies" @@ -76,9 +75,7 @@ }, "test": { "executor": "@nrwl/vite:test", - "outputs": [ - "{workspaceRoot}/coverage/{projectRoot}" - ], + "outputs": ["{workspaceRoot}/coverage/{projectRoot}"], "options": { "passWithNoTests": true }, @@ -98,13 +95,9 @@ }, "lint": { "executor": "@nrwl/linter:eslint", - "outputs": [ - "{options.outputFile}" - ], + "outputs": ["{options.outputFile}"], "options": { - "lintFilePatterns": [ - "libs/reoff/reoff-compile/**/*.ts" - ] + "lintFilePatterns": ["libs/reoff/reoff-compile/**/*.ts"] } } }, diff --git a/libs/reoff/reoff-compile/tsconfig.lib.json b/libs/reoff/reoff-compile/tsconfig.lib.json index 77516001..a7303eae 100644 --- a/libs/reoff/reoff-compile/tsconfig.lib.json +++ b/libs/reoff/reoff-compile/tsconfig.lib.json @@ -6,5 +6,5 @@ "types": ["node"] }, "exclude": ["**/*.spec.ts", "**/*.test.ts", "jest.config.ts", "vite.config.ts"], - "include": ["src/**/*.ts"] + "include": ["**/*.ts"] } diff --git a/libs/reoff/reoff-infer-headings/project.json b/libs/reoff/reoff-infer-headings/project.json index 59d31a19..cc97240c 100644 --- a/libs/reoff/reoff-infer-headings/project.json +++ b/libs/reoff/reoff-infer-headings/project.json @@ -4,8 +4,11 @@ "sourceRoot": "libs/reoff/reoff-infer-headings/src", "projectType": "library", "targets": { + "make-publishable": { + "executor": "better-nx-tsc:publishable" + }, "build": { - "executor": "better-nx-tsc:tsc", + "executor": "@nrwl/js:tsc", "outputs": ["{options.outputPath}"], "options": { "rootDir": "libs/reoff/reoff-infer-headings/src", diff --git a/libs/reoff/reoff-markup-to-style/project.json b/libs/reoff/reoff-markup-to-style/project.json index 1504abf2..39f9ee7a 100644 --- a/libs/reoff/reoff-markup-to-style/project.json +++ b/libs/reoff/reoff-markup-to-style/project.json @@ -5,7 +5,7 @@ "projectType": "library", "targets": { "build": { - // "executor": "better-nx-tsc:tsc", + // "executor": "@nrwl/js:tsc", "executor": "@nrwl/js:tsc", "outputs": ["{options.outputPath}"], "options": { diff --git a/libs/reoff/reoff-markup-to-style/tsconfig.lib.json b/libs/reoff/reoff-markup-to-style/tsconfig.lib.json index 77516001..a7303eae 100644 --- a/libs/reoff/reoff-markup-to-style/tsconfig.lib.json +++ b/libs/reoff/reoff-markup-to-style/tsconfig.lib.json @@ -6,5 +6,5 @@ "types": ["node"] }, "exclude": ["**/*.spec.ts", "**/*.test.ts", "jest.config.ts", "vite.config.ts"], - "include": ["src/**/*.ts"] + "include": ["**/*.ts"] } diff --git a/libs/reoff/reoff-parse-references-browser/project.json b/libs/reoff/reoff-parse-references-browser/project.json index 027be31d..6c2e935c 100755 --- a/libs/reoff/reoff-parse-references-browser/project.json +++ b/libs/reoff/reoff-parse-references-browser/project.json @@ -26,8 +26,11 @@ "passWithNoTests": true } }, + "make-publishable": { + "executor": "better-nx-tsc:publishable" + }, "build": { - "executor": "better-nx-tsc:tsc", + "executor": "@nrwl/js:tsc", "outputs": ["{options.outputPath}"], "options": { "rootDir": "libs/reoff/reoff-parse-references-browser/src", diff --git a/libs/reoff/reoff-parse-references-browser/src/lib/reoff-parse-references.spec.ts b/libs/reoff/reoff-parse-references-browser/src/lib/reoff-parse-references.spec.ts index 6f8857be..e69de29b 100755 --- a/libs/reoff/reoff-parse-references-browser/src/lib/reoff-parse-references.spec.ts +++ b/libs/reoff/reoff-parse-references-browser/src/lib/reoff-parse-references.spec.ts @@ -1,7 +0,0 @@ -import reoffReoffParseReferences from './reoff-parse-references.js' - -describe('reoffReoffParseReferences', () => { - it('should work', () => { - expect(reoffParseReferences()).toEqual('reoff-reoff-parse-references') - }) -}) diff --git a/libs/reoff/reoff-parse-references-browser/tsconfig.spec.json b/libs/reoff/reoff-parse-references-browser/tsconfig.spec.json index 83cd0e83..7e1d3b87 100755 --- a/libs/reoff/reoff-parse-references-browser/tsconfig.spec.json +++ b/libs/reoff/reoff-parse-references-browser/tsconfig.spec.json @@ -2,7 +2,6 @@ "extends": "./tsconfig.json", "compilerOptions": { "outDir": "../../../dist/out-tsc", - "module": "commonjs", "types": ["jest", "node"] }, "include": [ diff --git a/libs/reoff/reoff-parse-references/project.json b/libs/reoff/reoff-parse-references/project.json index 0e1a5c9b..c0853cbf 100755 --- a/libs/reoff/reoff-parse-references/project.json +++ b/libs/reoff/reoff-parse-references/project.json @@ -26,8 +26,11 @@ "passWithNoTests": true } }, + "make-publishable": { + "executor": "better-nx-tsc:publishable" + }, "build": { - "executor": "better-nx-tsc:tsc", + "executor": "@nrwl/js:tsc", "outputs": ["{options.outputPath}"], "options": { "rootDir": "libs/reoff/reoff-parse-references/src", diff --git a/libs/reoff/reoff-parse-references/tsconfig.spec.json b/libs/reoff/reoff-parse-references/tsconfig.spec.json index 83cd0e83..7e1d3b87 100755 --- a/libs/reoff/reoff-parse-references/tsconfig.spec.json +++ b/libs/reoff/reoff-parse-references/tsconfig.spec.json @@ -2,7 +2,6 @@ "extends": "./tsconfig.json", "compilerOptions": { "outDir": "../../../dist/out-tsc", - "module": "commonjs", "types": ["jest", "node"] }, "include": [ diff --git a/libs/reoff/reoff-parse/project.json b/libs/reoff/reoff-parse/project.json index 18c6a980..bcbad4df 100755 --- a/libs/reoff/reoff-parse/project.json +++ b/libs/reoff/reoff-parse/project.json @@ -26,8 +26,11 @@ "passWithNoTests": true } }, + "make-publishable": { + "executor": "better-nx-tsc:publishable" + }, "build": { - "executor": "better-nx-tsc:tsc", + "executor": "@nrwl/js:tsc", "outputs": ["{options.outputPath}"], "options": { "rootDir": "libs/reoff/reoff-parse/src", diff --git a/libs/reoff/reoff-parse/tsconfig.lib.json b/libs/reoff/reoff-parse/tsconfig.lib.json index 53047cda..3136add1 100755 --- a/libs/reoff/reoff-parse/tsconfig.lib.json +++ b/libs/reoff/reoff-parse/tsconfig.lib.json @@ -5,6 +5,12 @@ "declaration": true, "types": ["node"] }, - "exclude": ["**/*.spec.ts", "**/*.test.ts", "jest.config.ts"], - "include": ["src/**/*.ts"] + "exclude": [ + "**/*.spec.ts", + "**/*.test.ts", + "jest.config.ts", + "vite.config.ts", + "docs/example.ts" + ], + "include": ["**/*.ts"] } diff --git a/libs/reoff/reoff-rejour/project.json b/libs/reoff/reoff-rejour/project.json index 3856c17b..c1a881ac 100755 --- a/libs/reoff/reoff-rejour/project.json +++ b/libs/reoff/reoff-rejour/project.json @@ -26,8 +26,11 @@ "passWithNoTests": true } }, + "make-publishable": { + "executor": "better-nx-tsc:publishable" + }, "build": { - "executor": "better-nx-tsc:tsc", + "executor": "@nrwl/js:tsc", "outputs": ["{options.outputPath}"], "options": { "rootDir": "libs/reoff/reoff-rejour/src", diff --git a/libs/reoff/reoff-remark/project.json b/libs/reoff/reoff-remark/project.json index bf3b40dd..4476af5d 100644 --- a/libs/reoff/reoff-remark/project.json +++ b/libs/reoff/reoff-remark/project.json @@ -26,8 +26,11 @@ "passWithNoTests": true } }, + "make-publishable": { + "executor": "better-nx-tsc:publishable" + }, "build": { - "executor": "better-nx-tsc:tsc", + "executor": "@nrwl/js:tsc", "outputs": ["{options.outputPath}"], "options": { "rootDir": "libs/reoff/reoff-remark/src", diff --git a/libs/reoff/reoff-remark/tsconfig.lib.json b/libs/reoff/reoff-remark/tsconfig.lib.json index 53047cda..5c108b84 100644 --- a/libs/reoff/reoff-remark/tsconfig.lib.json +++ b/libs/reoff/reoff-remark/tsconfig.lib.json @@ -6,5 +6,5 @@ "types": ["node"] }, "exclude": ["**/*.spec.ts", "**/*.test.ts", "jest.config.ts"], - "include": ["src/**/*.ts"] + "include": ["**/*.ts"] } diff --git a/libs/reoff/reoff-unified-latex/project.json b/libs/reoff/reoff-unified-latex/project.json index 4733ba68..637c6519 100644 --- a/libs/reoff/reoff-unified-latex/project.json +++ b/libs/reoff/reoff-unified-latex/project.json @@ -26,8 +26,11 @@ "passWithNoTests": true } }, + "make-publishable": { + "executor": "better-nx-tsc:publishable" + }, "build": { - "executor": "better-nx-tsc:tsc", + "executor": "@nrwl/js:tsc", "outputs": ["{options.outputPath}"], "options": { "rootDir": "libs/reoff/reoff-unified-latex/src", @@ -52,6 +55,9 @@ } ] }, + "make-publishable": { + "executor": "better-nx-tsc:publishable" + }, "deploy": { "executor": "ngx-deploy-npm:deploy", "options": { diff --git a/libs/reoff/reoff-unified-latex/src/lib/reoff-unified-latex.ts b/libs/reoff/reoff-unified-latex/src/lib/reoff-unified-latex.ts index b5822e80..7d303de1 100644 --- a/libs/reoff/reoff-unified-latex/src/lib/reoff-unified-latex.ts +++ b/libs/reoff/reoff-unified-latex/src/lib/reoff-unified-latex.ts @@ -1,4 +1,4 @@ -import { Processor as UnifiedProcessor, Transformer, Plugin } from 'unified' +import { Processor as UnifiedProcessor, Plugin } from 'unified' import { toUnifiedLatex, Options } from 'ooxast-util-to-unified-latex' import { Root as OoxastRoot } from 'ooxast' import { Root } from '@unified-latex/unified-latex-types' diff --git a/libs/reoff/reoff-unified-latex/tsconfig.lib.json b/libs/reoff/reoff-unified-latex/tsconfig.lib.json index 53047cda..5c108b84 100644 --- a/libs/reoff/reoff-unified-latex/tsconfig.lib.json +++ b/libs/reoff/reoff-unified-latex/tsconfig.lib.json @@ -6,5 +6,5 @@ "types": ["node"] }, "exclude": ["**/*.spec.ts", "**/*.test.ts", "jest.config.ts"], - "include": ["src/**/*.ts"] + "include": ["**/*.ts"] } diff --git a/libs/texast/texast-util-add-preamble/project.json b/libs/texast/texast-util-add-preamble/project.json index e1733491..f2dcb0d8 100755 --- a/libs/texast/texast-util-add-preamble/project.json +++ b/libs/texast/texast-util-add-preamble/project.json @@ -26,8 +26,11 @@ "passWithNoTests": true } }, + "make-publishable": { + "executor": "better-nx-tsc:publishable" + }, "build": { - "executor": "better-nx-tsc:tsc", + "executor": "@nrwl/js:tsc", "outputs": ["{options.outputPath}"], "options": { "rootDir": "libs/texast/texast-util-add-preamble/src", diff --git a/libs/texast/texast-util-add-preamble/src/lib/texast-util-add-preamble.spec.ts b/libs/texast/texast-util-add-preamble/src/lib/texast-util-add-preamble.spec.ts index 2c29fd19..1a380b7a 100755 --- a/libs/texast/texast-util-add-preamble/src/lib/texast-util-add-preamble.spec.ts +++ b/libs/texast/texast-util-add-preamble/src/lib/texast-util-add-preamble.spec.ts @@ -1,4 +1,4 @@ -import { addPreamble } from './texast-util-add-preamble' +import { addPreamble } from './texast-util-add-preamble.js' import { u } from 'unist-builder' import { Preamble, Root } from 'texast' @@ -21,7 +21,7 @@ describe('texastTexastUtilAddPreamble', () => { { type: 'text', value: '\\n' }, ]), u('document', []), - ]) + ]), ) }) }) diff --git a/libs/texast/texast-util-add-preamble/tsconfig.lib.json b/libs/texast/texast-util-add-preamble/tsconfig.lib.json index ff64bb51..5c108b84 100755 --- a/libs/texast/texast-util-add-preamble/tsconfig.lib.json +++ b/libs/texast/texast-util-add-preamble/tsconfig.lib.json @@ -1,7 +1,6 @@ { "extends": "./tsconfig.json", "compilerOptions": { - "module": "commonjs", "outDir": "../../../dist/out-tsc", "declaration": true, "types": ["node"] diff --git a/libs/texast/texast-util-add-preamble/tsconfig.spec.json b/libs/texast/texast-util-add-preamble/tsconfig.spec.json index 83cd0e83..7e1d3b87 100755 --- a/libs/texast/texast-util-add-preamble/tsconfig.spec.json +++ b/libs/texast/texast-util-add-preamble/tsconfig.spec.json @@ -2,7 +2,6 @@ "extends": "./tsconfig.json", "compilerOptions": { "outDir": "../../../dist/out-tsc", - "module": "commonjs", "types": ["jest", "node"] }, "include": [ diff --git a/libs/texast/texast-util-to-latex/project.json b/libs/texast/texast-util-to-latex/project.json index a1129808..5a720451 100755 --- a/libs/texast/texast-util-to-latex/project.json +++ b/libs/texast/texast-util-to-latex/project.json @@ -26,8 +26,11 @@ "passWithNoTests": true } }, + "make-publishable": { + "executor": "better-nx-tsc:publishable" + }, "build": { - "executor": "better-nx-tsc:tsc", + "executor": "@nrwl/js:tsc", "outputs": ["{options.outputPath}"], "options": { "rootDir": "libs/texast/texast-util-to-latex/src", diff --git a/libs/texast/texast-util-to-latex/src/index.ts b/libs/texast/texast-util-to-latex/src/index.ts index 37206289..2529028c 100755 --- a/libs/texast/texast-util-to-latex/src/index.ts +++ b/libs/texast/texast-util-to-latex/src/index.ts @@ -1,3 +1,3 @@ export * from './lib/texast-util-to-latex.js' export * from './lib/types.js' -export { default } from './lib/texast-util-to-latex' +export { default } from './lib/texast-util-to-latex.js' diff --git a/libs/texast/texast-util-to-latex/src/lib/handle/command-arg.ts b/libs/texast/texast-util-to-latex/src/lib/handle/command-arg.ts index f2995cc7..05329941 100755 --- a/libs/texast/texast-util-to-latex/src/lib/handle/command-arg.ts +++ b/libs/texast/texast-util-to-latex/src/lib/handle/command-arg.ts @@ -1,12 +1,7 @@ import { CommandArg, isOptionalCommandArg } from 'texast' -import { toLatex } from '../texast-util-to-latex' -import { BasicHandle, Handle, Options } from '../types' +import { toLatex } from '../texast-util-to-latex.js' +import { BasicHandle, Handle, Options } from '../types.js' -export const commandArg: BasicHandle = ( - node: CommandArg, - options: Options = {} -) => { - return isOptionalCommandArg(node) - ? `[${toLatex(node.children)}]` - : `{${toLatex(node.children)}}` +export const commandArg: BasicHandle = (node: CommandArg, options: Options = {}) => { + return isOptionalCommandArg(node) ? `[${toLatex(node.children)}]` : `{${toLatex(node.children)}}` } diff --git a/libs/texast/texast-util-to-latex/src/lib/handle/command.ts b/libs/texast/texast-util-to-latex/src/lib/handle/command.ts index 0bfd5d74..229c5bf3 100755 --- a/libs/texast/texast-util-to-latex/src/lib/handle/command.ts +++ b/libs/texast/texast-util-to-latex/src/lib/handle/command.ts @@ -1,22 +1,13 @@ -import { - Command, - CommandArg, - CommandArgOpt, - isOptionalCommandArg, - TexastContent, -} from 'texast' -import { toLatex } from '../texast-util-to-latex' -import { BasicHandle, Options } from '../types' -import { commandArg } from './command-arg' +import { Command, CommandArg, CommandArgOpt, isOptionalCommandArg, TexastContent } from 'texast' +import { toLatex } from '../texast-util-to-latex.js' +import { BasicHandle, Options } from '../types.js' +import { commandArg } from './command-arg.js' interface CommandChildren { optargs: CommandArgOpt[] args: CommandArg[] } -export const command: BasicHandle = ( - node: Command, - options?: Options -): string => { +export const command: BasicHandle = (node: Command, options?: Options): string => { const contents = node.children?.reduce( (acc: CommandChildren, child: CommandArg) => { if (isOptionalCommandArg(child)) { @@ -27,7 +18,7 @@ export const command: BasicHandle = ( acc.args.push(child) return acc }, - { optargs: [], args: [] } + { optargs: [], args: [] }, ) return `\\${node.name}${toLatex(contents.optargs)}${toLatex(contents.args)}` diff --git a/libs/texast/texast-util-to-latex/src/lib/handle/comment.ts b/libs/texast/texast-util-to-latex/src/lib/handle/comment.ts index f5487587..9c98b844 100755 --- a/libs/texast/texast-util-to-latex/src/lib/handle/comment.ts +++ b/libs/texast/texast-util-to-latex/src/lib/handle/comment.ts @@ -1,11 +1,8 @@ import { Command, TexastContent, Comment } from 'texast' -import { toLatex } from '../texast-util-to-latex' -import { BasicHandle, Options } from '../types' -import { commandArg } from './command-arg' +import { toLatex } from '../texast-util-to-latex.js' +import { BasicHandle, Options } from '../types.js' +import { commandArg } from './command-arg.js' -export const comment: BasicHandle = ( - node: Comment, - options?: Options -): string => { +export const comment: BasicHandle = (node: Comment, options?: Options): string => { return `%${node.value}\\n` } diff --git a/libs/texast/texast-util-to-latex/src/lib/handle/display-math.ts b/libs/texast/texast-util-to-latex/src/lib/handle/display-math.ts index d382d8ff..f501b592 100755 --- a/libs/texast/texast-util-to-latex/src/lib/handle/display-math.ts +++ b/libs/texast/texast-util-to-latex/src/lib/handle/display-math.ts @@ -1,13 +1,9 @@ import { DisplayMath } from 'texast' -import { toLatex } from '../texast-util-to-latex' -import { BasicHandle, Options } from '../types' +import { toLatex } from '../texast-util-to-latex.js' +import { BasicHandle, Options } from '../types.js' -export const displayMath: BasicHandle = ( - node: DisplayMath, - options: Options = {} -) => { - const builtInDelimiters = - node.delimiters === '[]' ? ['\\[', '\\]'] : ['$$', '$$'] +export const displayMath: BasicHandle = (node: DisplayMath, options: Options = {}) => { + const builtInDelimiters = node.delimiters === '[]' ? ['\\[', '\\]'] : ['$$', '$$'] // TODO: Clean up delimiter picking for math env const delimiters = options.inlineMathDelimiters diff --git a/libs/texast/texast-util-to-latex/src/lib/handle/document.ts b/libs/texast/texast-util-to-latex/src/lib/handle/document.ts index c984a9a4..e532e6d1 100755 --- a/libs/texast/texast-util-to-latex/src/lib/handle/document.ts +++ b/libs/texast/texast-util-to-latex/src/lib/handle/document.ts @@ -1,11 +1,8 @@ import { DocumentEnvironment } from 'texast' -import { toLatex } from '../texast-util-to-latex' -import { BasicHandle, Handle, Node, Options } from '../types' +import { toLatex } from '../texast-util-to-latex.js' +import { BasicHandle, Handle, Node, Options } from '../types.js' -export const document: BasicHandle = ( - node: DocumentEnvironment, - options: Options = {} -) => { +export const document: BasicHandle = (node: DocumentEnvironment, options: Options = {}) => { return `\\begin{document} ${toLatex(node.children)} diff --git a/libs/texast/texast-util-to-latex/src/lib/handle/environment.ts b/libs/texast/texast-util-to-latex/src/lib/handle/environment.ts index f36e2f58..2a053b0d 100755 --- a/libs/texast/texast-util-to-latex/src/lib/handle/environment.ts +++ b/libs/texast/texast-util-to-latex/src/lib/handle/environment.ts @@ -1,21 +1,13 @@ -import { - CommandArg, - Environment, - isCommandArg, - isOptionalCommandArg, -} from 'texast' -import { toLatex } from '../texast-util-to-latex' -import { BasicHandle, Handle, Node, Options } from '../types' +import { CommandArg, Environment, isCommandArg, isOptionalCommandArg } from 'texast' +import { toLatex } from '../texast-util-to-latex.js' +import { BasicHandle, Handle, Node, Options } from '../types.js' interface EnvChildren { children: Node[] optargs: CommandArg[] args: CommandArg[] } -export const environment: BasicHandle = ( - node: Environment, - options: Options = {} -) => { +export const environment: BasicHandle = (node: Environment, options: Options = {}) => { const contents: EnvChildren = node.children.reduce( (acc: EnvChildren, child: Node) => { if (isCommandArg(child)) { @@ -31,7 +23,7 @@ export const environment: BasicHandle = ( acc.children.push(child) return acc }, - { children: [], optargs: [], args: [] } + { children: [], optargs: [], args: [] }, ) // prettier-ignore diff --git a/libs/texast/texast-util-to-latex/src/lib/handle/group.ts b/libs/texast/texast-util-to-latex/src/lib/handle/group.ts index d68089ce..0be99695 100755 --- a/libs/texast/texast-util-to-latex/src/lib/handle/group.ts +++ b/libs/texast/texast-util-to-latex/src/lib/handle/group.ts @@ -1,6 +1,6 @@ import { Environment, Group } from 'texast' -import { toLatex } from '../texast-util-to-latex' -import { BasicHandle, Handle, Node, Options } from '../types' +import { toLatex } from '../texast-util-to-latex.js' +import { BasicHandle, Handle, Node, Options } from '../types.js' export const group: BasicHandle = (node: Group, options: Options = {}) => { return `\\begingroup diff --git a/libs/texast/texast-util-to-latex/src/lib/handle/index.ts b/libs/texast/texast-util-to-latex/src/lib/handle/index.ts index be1179e5..2734f7de 100755 --- a/libs/texast/texast-util-to-latex/src/lib/handle/index.ts +++ b/libs/texast/texast-util-to-latex/src/lib/handle/index.ts @@ -1,23 +1,23 @@ -import { alignmentTab } from './alignment-tab' -import { command } from './command' -import { commandArg } from './command-arg' -import { comment } from './comment' -import { displayMath } from './display-math' -import { environment } from './environment' -import { group } from './group' -import { inlineMath } from './inline-math' -import { text } from './text' -import { document } from './document' -import { mathContainer } from './math-container' -import { paragraph } from './paragraph' -import { mathCharacter } from './math-character' -import { linebreak } from './linebreak' -import { root } from './root' -import { preamble } from './preamble' -import { listItem } from './listItem' -import { tableRow } from './table-row' -import { tableCell } from './table-cell' -import { script } from './script' +import { alignmentTab } from './alignment-tab.js' +import { command } from './command.js' +import { commandArg } from './command-arg.js' +import { comment } from './comment.js' +import { displayMath } from './display-math.js' +import { environment } from './environment.js' +import { group } from './group.js' +import { inlineMath } from './inline-math.js' +import { text } from './text.js' +import { document } from './document.js' +import { mathContainer } from './math-container.js' +import { paragraph } from './paragraph.js' +import { mathCharacter } from './math-character.js' +import { linebreak } from './linebreak.js' +import { root } from './root.js' +import { preamble } from './preamble.js' +import { listItem } from './listItem.js' +import { tableRow } from './table-row.js' +import { tableCell } from './table-cell.js' +import { script } from './script.js' export const handle = { alignmentTab, diff --git a/libs/texast/texast-util-to-latex/src/lib/handle/inline-math.ts b/libs/texast/texast-util-to-latex/src/lib/handle/inline-math.ts index 237ce01e..0270e9d5 100755 --- a/libs/texast/texast-util-to-latex/src/lib/handle/inline-math.ts +++ b/libs/texast/texast-util-to-latex/src/lib/handle/inline-math.ts @@ -1,13 +1,9 @@ import { InlineMath } from 'texast' -import { toLatex } from '../texast-util-to-latex' -import { BasicHandle, Options } from '../types' +import { toLatex } from '../texast-util-to-latex.js' +import { BasicHandle, Options } from '../types.js' -export const inlineMath: BasicHandle = ( - node: InlineMath, - options: Options = {} -) => { - const builtInDelimiters = - node.delimiters === '()' ? ['\\(', '\\)'] : ['$', '$'] +export const inlineMath: BasicHandle = (node: InlineMath, options: Options = {}) => { + const builtInDelimiters = node.delimiters === '()' ? ['\\(', '\\)'] : ['$', '$'] // console.log(node.delimiters) // TODO: Clean up delimiter picking for math env diff --git a/libs/texast/texast-util-to-latex/src/lib/handle/linebreak.ts b/libs/texast/texast-util-to-latex/src/lib/handle/linebreak.ts index d8fcb2ea..512eac1d 100755 --- a/libs/texast/texast-util-to-latex/src/lib/handle/linebreak.ts +++ b/libs/texast/texast-util-to-latex/src/lib/handle/linebreak.ts @@ -1,11 +1,8 @@ import { Linebreak } from 'texast' -import { toLatex } from '../texast-util-to-latex' -import { BasicHandle, Options } from '../types' +import { toLatex } from '../texast-util-to-latex.js' +import { BasicHandle, Options } from '../types.js' -export const linebreak: BasicHandle = ( - node: Linebreak, - options: Options = {} -) => { +export const linebreak: BasicHandle = (node: Linebreak, options: Options = {}) => { const height = node.height ? `[${node.height}]` : '' return `\\\\${height}` } diff --git a/libs/texast/texast-util-to-latex/src/lib/handle/listItem.ts b/libs/texast/texast-util-to-latex/src/lib/handle/listItem.ts index b90f11b6..e5cc7b34 100755 --- a/libs/texast/texast-util-to-latex/src/lib/handle/listItem.ts +++ b/libs/texast/texast-util-to-latex/src/lib/handle/listItem.ts @@ -1,11 +1,8 @@ import { ListItem } from 'texast' -import { toLatex } from '../texast-util-to-latex' -import { BasicHandle, Options } from '../types' +import { toLatex } from '../texast-util-to-latex.js' +import { BasicHandle, Options } from '../types.js' -export const listItem: BasicHandle = ( - node: ListItem, - options: Options = {} -) => { +export const listItem: BasicHandle = (node: ListItem, options: Options = {}) => { return `\\item ${toLatex(node.children)} ` } diff --git a/libs/texast/texast-util-to-latex/src/lib/handle/math-character.ts b/libs/texast/texast-util-to-latex/src/lib/handle/math-character.ts index 00df8cad..d21f12f5 100755 --- a/libs/texast/texast-util-to-latex/src/lib/handle/math-character.ts +++ b/libs/texast/texast-util-to-latex/src/lib/handle/math-character.ts @@ -1,10 +1,7 @@ import { MathCharacter } from 'texast' -import { toLatex } from '../texast-util-to-latex' -import { BasicHandle, Options } from '../types' +import { toLatex } from '../texast-util-to-latex.js' +import { BasicHandle, Options } from '../types.js' -export const mathCharacter: BasicHandle = ( - node: MathCharacter, - options: Options = {} -) => { +export const mathCharacter: BasicHandle = (node: MathCharacter, options: Options = {}) => { return node.value } diff --git a/libs/texast/texast-util-to-latex/src/lib/handle/math-container.ts b/libs/texast/texast-util-to-latex/src/lib/handle/math-container.ts index f5d14755..13d2b198 100755 --- a/libs/texast/texast-util-to-latex/src/lib/handle/math-container.ts +++ b/libs/texast/texast-util-to-latex/src/lib/handle/math-container.ts @@ -1,13 +1,10 @@ import { MathContainer } from 'texast' -import { toLatex } from '../texast-util-to-latex' -import { BasicHandle, Options } from '../types' -import { displayMath } from './display-math' -import { inlineMath } from './inline-math' +import { toLatex } from '../texast-util-to-latex.js' +import { BasicHandle, Options } from '../types.js' +import { displayMath } from './display-math.js' +import { inlineMath } from './inline-math.js' -export const mathContainer: BasicHandle = ( - node: MathContainer, - options: Options = {} -) => { +export const mathContainer: BasicHandle = (node: MathContainer, options: Options = {}) => { switch (node.name) { case 'inlineMath': return inlineMath(node, options) diff --git a/libs/texast/texast-util-to-latex/src/lib/handle/math-environment.ts b/libs/texast/texast-util-to-latex/src/lib/handle/math-environment.ts index 3d212f69..713b5ff7 100755 --- a/libs/texast/texast-util-to-latex/src/lib/handle/math-environment.ts +++ b/libs/texast/texast-util-to-latex/src/lib/handle/math-environment.ts @@ -1,11 +1,8 @@ import { MathEnvironment } from 'texast' -import { toLatex } from '../texast-util-to-latex' -import { BasicHandle, Options } from '../types' +import { toLatex } from '../texast-util-to-latex.js' +import { BasicHandle, Options } from '../types.js' -export const mathEnvironment: BasicHandle = ( - node: MathEnvironment, - options: Options = {} -) => { +export const mathEnvironment: BasicHandle = (node: MathEnvironment, options: Options = {}) => { return `\\begin{${node.name}} ${toLatex(node.children)} diff --git a/libs/texast/texast-util-to-latex/src/lib/handle/paragraph.ts b/libs/texast/texast-util-to-latex/src/lib/handle/paragraph.ts index 742598b4..ac296ac3 100755 --- a/libs/texast/texast-util-to-latex/src/lib/handle/paragraph.ts +++ b/libs/texast/texast-util-to-latex/src/lib/handle/paragraph.ts @@ -1,6 +1,6 @@ import { Command, Paragraph } from 'texast' -import { toLatex } from '../texast-util-to-latex' -import { Options } from '../types' +import { toLatex } from '../texast-util-to-latex.js' +import { Options } from '../types.js' export const paragraph = (node: Paragraph, options: Options = {}) => { const parbreak = options.parbreak === 'par' ? '\\parbreak' : '\n\n' @@ -10,5 +10,4 @@ export const paragraph = (node: Paragraph, options: Options = {}) => { return shittyCombineCites(paragraph) } -const shittyCombineCites = (par: string) => - par.replace(/(\}\\(\w+cite)\{)+/g, ', ') +const shittyCombineCites = (par: string) => par.replace(/(\}\\(\w+cite)\{)+/g, ', ') diff --git a/libs/texast/texast-util-to-latex/src/lib/handle/preamble.ts b/libs/texast/texast-util-to-latex/src/lib/handle/preamble.ts index 1de1d847..e9b56ad1 100755 --- a/libs/texast/texast-util-to-latex/src/lib/handle/preamble.ts +++ b/libs/texast/texast-util-to-latex/src/lib/handle/preamble.ts @@ -1,11 +1,8 @@ import { Preamble } from 'texast' -import { toLatex } from '../texast-util-to-latex' -import { BasicHandle, Handle, Options } from '../types' +import { toLatex } from '../texast-util-to-latex.js' +import { BasicHandle, Handle, Options } from '../types.js' -export const preamble: BasicHandle = ( - node: Preamble, - options: Options = {} -) => { +export const preamble: BasicHandle = (node: Preamble, options: Options = {}) => { // TODO: Add checks to preamble to not print non-command content return toLatex(node.children) } diff --git a/libs/texast/texast-util-to-latex/src/lib/handle/root.ts b/libs/texast/texast-util-to-latex/src/lib/handle/root.ts index 03f5065e..75625df4 100755 --- a/libs/texast/texast-util-to-latex/src/lib/handle/root.ts +++ b/libs/texast/texast-util-to-latex/src/lib/handle/root.ts @@ -1,6 +1,6 @@ import { Root } from 'texast' -import { toLatex } from '../texast-util-to-latex' -import { BasicHandle, Handle, Options } from '../types' +import { toLatex } from '../texast-util-to-latex.js' +import { BasicHandle, Handle, Options } from '../types.js' export const root: BasicHandle = (node: Root, options: Options = {}) => { return toLatex(node.children) diff --git a/libs/texast/texast-util-to-latex/src/lib/handle/script.ts b/libs/texast/texast-util-to-latex/src/lib/handle/script.ts index a3b9a493..efe2e372 100755 --- a/libs/texast/texast-util-to-latex/src/lib/handle/script.ts +++ b/libs/texast/texast-util-to-latex/src/lib/handle/script.ts @@ -1,6 +1,6 @@ import { Script } from 'texast' -import { toLatex } from '../texast-util-to-latex' -import { BasicHandle, Options } from '../types' +import { toLatex } from '../texast-util-to-latex.js' +import { BasicHandle, Options } from '../types.js' export const script: BasicHandle = (node: Script, options: Options = {}) => { return node.type === 'super' diff --git a/libs/texast/texast-util-to-latex/src/lib/handle/softbreak.ts b/libs/texast/texast-util-to-latex/src/lib/handle/softbreak.ts index 36d7b93a..9eac415a 100755 --- a/libs/texast/texast-util-to-latex/src/lib/handle/softbreak.ts +++ b/libs/texast/texast-util-to-latex/src/lib/handle/softbreak.ts @@ -1,10 +1,6 @@ import { Softbreak } from 'texast' -import { toLatex } from '../texast-util-to-latex' -import { BasicHandle, Options } from '../types' +import { BasicHandle, Options } from '../types.js' -export const softbreak: BasicHandle = ( - node: Softbreak, - options: Options = {} -) => { +export const softbreak: BasicHandle = (node: Softbreak, options: Options = {}) => { return `\n` } diff --git a/libs/texast/texast-util-to-latex/src/lib/handle/table-cell.ts b/libs/texast/texast-util-to-latex/src/lib/handle/table-cell.ts index 028a9551..3768931d 100755 --- a/libs/texast/texast-util-to-latex/src/lib/handle/table-cell.ts +++ b/libs/texast/texast-util-to-latex/src/lib/handle/table-cell.ts @@ -1,16 +1,10 @@ import { TableCell } from 'texast' -import { toLatex } from '../texast-util-to-latex' -import { BasicHandle, Options } from '../types' +import { toLatex } from '../texast-util-to-latex.js' +import { BasicHandle, Options } from '../types.js' -export const tableCell: BasicHandle = ( - node: TableCell, - options: Options = {} -) => { +export const tableCell: BasicHandle = (node: TableCell, options: Options = {}) => { if (node.span) { - return `\\multicolumn{${node.span}}{@{} l @{}}{${toLatex( - node.children, - options - )}}` + return `\\multicolumn{${node.span}}{@{} l @{}}{${toLatex(node.children, options)}}` } return toLatex(node.children) } diff --git a/libs/texast/texast-util-to-latex/src/lib/handle/table-row.ts b/libs/texast/texast-util-to-latex/src/lib/handle/table-row.ts index 61098db5..bd37976d 100755 --- a/libs/texast/texast-util-to-latex/src/lib/handle/table-row.ts +++ b/libs/texast/texast-util-to-latex/src/lib/handle/table-row.ts @@ -1,10 +1,7 @@ import { AlignmentTab, TableRow } from 'texast' -import { toLatex } from '../texast-util-to-latex' -import { BasicHandle, Options } from '../types' +import { toLatex } from '../texast-util-to-latex.js' +import { BasicHandle, Options } from '../types.js' -export const tableRow: BasicHandle = ( - node: TableRow, - options: Options = {} -) => { +export const tableRow: BasicHandle = (node: TableRow, options: Options = {}) => { return `${toLatex(node.children, options)}\n` } diff --git a/libs/texast/texast-util-to-latex/src/lib/handle/text proper.ts b/libs/texast/texast-util-to-latex/src/lib/handle/text proper.ts index 403478e6..6198bc04 100755 --- a/libs/texast/texast-util-to-latex/src/lib/handle/text proper.ts +++ b/libs/texast/texast-util-to-latex/src/lib/handle/text proper.ts @@ -1,12 +1,12 @@ import { Text } from 'texast' -import { Handle, Context, Options, SafeOptions, Parent } from '../types' -import { safe } from '../util/safe' +import { Handle, Context, Options, SafeOptions, Parent } from '../types.js' +import { safe } from '../util/safe.js' export const text: Handle = ( node: Text, _: Parent | null | undefined, context: Context, - safeOptions: SafeOptions + safeOptions: SafeOptions, ) => { return safe(context, node.value, safeOptions) } diff --git a/libs/texast/texast-util-to-latex/src/lib/handle/text.spec.ts b/libs/texast/texast-util-to-latex/src/lib/handle/text.spec.ts index f537d377..2ad56489 100755 --- a/libs/texast/texast-util-to-latex/src/lib/handle/text.spec.ts +++ b/libs/texast/texast-util-to-latex/src/lib/handle/text.spec.ts @@ -1,8 +1,8 @@ -import { toLatex } from '../texast-util-to-latex' +import { toLatex } from '../texast-util-to-latex.js' describe('text', () => { it('should render', () => { - const basic = { type: 'text', value: 'Hello world!' } + const basic = { type: 'text' as const, value: 'Hello world!' } expect(toLatex(basic)).toBe('Hello world!') }) }) diff --git a/libs/texast/texast-util-to-latex/src/lib/handle/text.ts b/libs/texast/texast-util-to-latex/src/lib/handle/text.ts index 8da2d6f4..c56ca13e 100755 --- a/libs/texast/texast-util-to-latex/src/lib/handle/text.ts +++ b/libs/texast/texast-util-to-latex/src/lib/handle/text.ts @@ -1,6 +1,6 @@ import { Text } from 'texast' -import { Handle, Context, Options, SafeOptions, Parent, BasicHandle } from '../types' -import { safe } from '../util/safe' +import { Handle, Context, Options, SafeOptions, Parent, BasicHandle } from '../types.js' +import { safe } from '../util/safe.js' //@ts-expect-error escape-latex is not typed correctly import lxescape from 'escape-latex' diff --git a/libs/texast/texast-util-to-latex/src/lib/join.ts b/libs/texast/texast-util-to-latex/src/lib/join.ts index 9907c29f..58f9112e 100755 --- a/libs/texast/texast-util-to-latex/src/lib/join.ts +++ b/libs/texast/texast-util-to-latex/src/lib/join.ts @@ -2,8 +2,8 @@ // * @typedef {import('./types').Join} Join // */ -// import {formatCodeAsIndented} from './util/format-code-as-indented' -// import {formatHeadingAsSetext} from './util/format-heading-as-setext' +// import {formatCodeAsIndented} from './util/format-code-as-indented.js' +// import {formatHeadingAsSetext} from './util/format-heading-as-setext.js' // /** @type {Array} */ // export const join = [joinDefaults] diff --git a/libs/texast/texast-util-to-latex/src/lib/texast-util-to-latex proper.ts b/libs/texast/texast-util-to-latex/src/lib/texast-util-to-latex proper.ts deleted file mode 100755 index ae93cf1b..00000000 --- a/libs/texast/texast-util-to-latex/src/lib/texast-util-to-latex proper.ts +++ /dev/null @@ -1,82 +0,0 @@ -import { handle } from './handle' -import { zwitch } from 'zwitch' -import { configure } from './configure' -import { Options, Context, Node, Handle } from './types' - -const invalid: Handle = (value: unknown) => { - throw new Error('Cannot handle value `' + value + '`, expected node') -} -const unknown: Handle = (node: Node) => { - throw new Error(`Unknown type ${node.type}, skipping...`) -} - -export function toLatex(tree: Node, options: Options = {}): string { - // const handle = zwitch('type', { invalid, - - // // @ts-expect-error hush - // unknown, - // handlers: node }) - // const result = Array.isArray(node) - // ? node.map((node) => toLatex(node, options)).join('') - // : handle[node.type](node) - // return result - // } - - /** @type {Context} */ - // @ts-expect-error: we’ll add `handle` later. - const context: Context = { - enter, - stack: [], - unsafe: [], - join: [], - handlers: {}, - options: {}, - indexStack: [], - math: false, - align: false, - } - - // @ts-expect-error: we’ll add `handle` later. - configure(context, { handlers: handle }) - configure(context, options) - - // if (context.options.tightDefinitions) { - // configure(context, {join: [joinDefinition]}) - // } - - context.handle = zwitch('type', { - // @ts-expect-error: hush. - invalid, - // @ts-expect-error: hush. - unknown, - // @ts-expect-error: hush. - handlers: context.handlers, - }) as Handle - - let result = context.handle(tree, null, context, { - before: '\n', - after: '\n', - now: { line: 1, column: 1 }, - lineShift: 0, - }) - - if ( - result && - result.charCodeAt(result.length - 1) !== 10 && - result.charCodeAt(result.length - 1) !== 13 - ) { - result += '\n' - } - - return result - - /** @type {Context['enter']} */ - function enter(name: string) { - context.stack.push(name) - return exit - - function exit() { - context.stack.pop() - } - } -} diff --git a/libs/texast/texast-util-to-latex/src/lib/texast-util-to-latex.spec.ts b/libs/texast/texast-util-to-latex/src/lib/texast-util-to-latex.spec.ts index 05029f3a..a0200f1f 100755 --- a/libs/texast/texast-util-to-latex/src/lib/texast-util-to-latex.spec.ts +++ b/libs/texast/texast-util-to-latex/src/lib/texast-util-to-latex.spec.ts @@ -1,12 +1,5 @@ -import { - Text, - Command, - CommandArg, - CommandArgOpt, - Environment, - InlineMath, -} from 'texast' -import { toLatex } from './texast-util-to-latex' +import { Text, Command, CommandArg, CommandArgOpt, Environment, InlineMath } from 'texast' +import { toLatex } from './texast-util-to-latex.js' const text: Text = { type: 'text', value: 'hello world!' } const commandWithNoArgs: Command = { @@ -58,7 +51,9 @@ describe('text', () => { }) describe('paragraph', () => { - it('should stringify paragraph', () => {}) + it('should stringify paragraph', () => { + // + }) }) describe('command', () => { @@ -69,17 +64,15 @@ describe('command', () => { expect(toLatex(commandWithOneArgs)).toEqual('\\includepackage{biblatex}') }) it('should render command with one argument', () => { - expect(toLatex(commandWith3Args)).toEqual( - '\\includepackage{biblatex}{biblatex}{biblatex}' - ) + expect(toLatex(commandWith3Args)).toEqual('\\includepackage{biblatex}{biblatex}{biblatex}') }) it('should render command with one argument', () => { - expect(toLatex(commandWithArgAndOptArg)).toEqual( - '\\includepackage[style=apa]{biblatex}' - ) + expect(toLatex(commandWithArgAndOptArg)).toEqual('\\includepackage[style=apa]{biblatex}') }) - it('should render italics', () => {}) + it('should render italics', () => { + // + }) }) describe('environment', () => { const basicEnv: Environment = { @@ -110,7 +103,7 @@ describe('environment', () => { hello world! - \\end{basic}` + \\end{basic}`, ) }) @@ -120,7 +113,7 @@ describe('environment', () => { hello world! - \\end{basic}` + \\end{basic}`, ) }) it('should stringify environment with manadatory arg', () => { @@ -129,7 +122,7 @@ describe('environment', () => { hello world! - \\end{basic}` + \\end{basic}`, ) }) it('should stringify both necessary and opt args', () => { @@ -138,7 +131,7 @@ describe('environment', () => { hello world! - \\end{basic}` + \\end{basic}`, ) }) }) @@ -188,16 +181,14 @@ describe('math', () => { ...inlineMath, delimiters: '()', } - expect(toLatex(inlineMathWithDelimiters)).toEqual( - ` \\( 8 + 9 = \\frac{8}{8} \\) ` - ) + expect(toLatex(inlineMathWithDelimiters)).toEqual(` \\( 8 + 9 = \\frac{8}{8} \\) `) }) it('should change delimiters based on global options', () => { const inlineMathWithDelimiters = { ...inlineMath, } - expect( - toLatex(inlineMathWithDelimiters, { inlineMathDelimiters: '()' }) - ).toEqual(` \\( 8 + 9 = \\frac{8}{8} \\) `) + expect(toLatex(inlineMathWithDelimiters, { inlineMathDelimiters: '()' })).toEqual( + ` \\( 8 + 9 = \\frac{8}{8} \\) `, + ) }) }) diff --git a/libs/texast/texast/project.json b/libs/texast/texast/project.json index 34c2433e..f06aa64f 100755 --- a/libs/texast/texast/project.json +++ b/libs/texast/texast/project.json @@ -26,8 +26,11 @@ "passWithNoTests": true } }, + "make-publishable": { + "executor": "better-nx-tsc:publishable" + }, "build": { - "executor": "better-nx-tsc:tsc", + "executor": "@nrwl/js:tsc", "outputs": ["{options.outputPath}"], "options": { "rootDir": "libs/texast/texast/src", diff --git a/libs/texast/texast/src/lib/utensil-types.d.ts b/libs/texast/texast/src/lib/utensil-types.d.ts index 6d43a8c9..fa859d94 100755 --- a/libs/texast/texast/src/lib/utensil-types.d.ts +++ b/libs/texast/texast/src/lib/utensil-types.d.ts @@ -1,8 +1,6 @@ import type { - LatexAst as UtensilRoot, Node as UtensilNodesWithMisspelledInlienMath, InlienMath, - Command, AmsMathTextCommand as AmsMathTextCommandWithoutName, MathEnvAligned, MathEnv, @@ -17,9 +15,7 @@ import { Position } from 'unist' // More extensivelf type the Utensil nodes type InlineMath = InlienMath -export type UtensilNodes = - | Exclude - | InlineMath +export type UtensilNodes = Exclude | InlineMath export type AmsMathTextCommand = AmsMathTextCommandWithoutName & { name: 'text' @@ -47,10 +43,7 @@ export interface UtensilCommandNode extends UtensilNode { } export type UtensilParents = Extract -export type UtensilLiterals = - | Extract - | Space - | AlignmentTab +export type UtensilLiterals = Extract | Space | AlignmentTab export type UtensilCommands = Extract export type UtensilBreaks = Softbreak | Linebreak | Parbreak diff --git a/libs/unified-latex/unified-latex-stringify/project.json b/libs/unified-latex/unified-latex-stringify/project.json index 37e8f799..5a9ad229 100644 --- a/libs/unified-latex/unified-latex-stringify/project.json +++ b/libs/unified-latex/unified-latex-stringify/project.json @@ -4,8 +4,11 @@ "sourceRoot": "libs/unified-latex/unified-latex-stringify/src", "projectType": "library", "targets": { + "make-publishable": { + "executor": "better-nx-tsc:publishable" + }, "build": { - "executor": "better-nx-tsc:tsc", + "executor": "@nrwl/js:tsc", "outputs": ["{options.outputPath}"], "options": { "rootDir": "libs/unified-latex/unified-latex-stringify/src", diff --git a/libs/unified-latex/unified-latex-stringify/tsconfig.lib.json b/libs/unified-latex/unified-latex-stringify/tsconfig.lib.json index 53047cda..5c108b84 100644 --- a/libs/unified-latex/unified-latex-stringify/tsconfig.lib.json +++ b/libs/unified-latex/unified-latex-stringify/tsconfig.lib.json @@ -6,5 +6,5 @@ "types": ["node"] }, "exclude": ["**/*.spec.ts", "**/*.test.ts", "jest.config.ts"], - "include": ["src/**/*.ts"] + "include": ["**/*.ts"] } diff --git a/libs/update-readme/src/executors/build/executor.ts b/libs/update-readme/src/executors/build/executor.ts index 9a2f1e7c..3675a06b 100644 --- a/libs/update-readme/src/executors/build/executor.ts +++ b/libs/update-readme/src/executors/build/executor.ts @@ -1,4 +1,4 @@ -import { BuildExecutorSchema } from './schema' +import { BuildExecutorSchema } from './schema.js' export default async function runExecutor(options: BuildExecutorSchema) { console.log('Executor ran for Build', options) diff --git a/libs/utils/misc/project.json b/libs/utils/misc/project.json index e225cee7..1ae9f039 100755 --- a/libs/utils/misc/project.json +++ b/libs/utils/misc/project.json @@ -11,8 +11,11 @@ "packageJSON": "libs/utils/misc/package.json" } }, + "make-publishable": { + "executor": "better-nx-tsc:publishable" + }, "build": { - "executor": "better-nx-tsc:tsc", + "executor": "@nrwl/js:tsc", "outputs": ["{options.outputPath}"], "options": { "rootDir": "libs/utils/misc/src", diff --git a/libs/utils/ojs-to-preamble/src/lib/utils-ojs-to-preamble.spec.ts b/libs/utils/ojs-to-preamble/src/lib/utils-ojs-to-preamble.spec.ts index b8cdfd83..3ee147df 100755 --- a/libs/utils/ojs-to-preamble/src/lib/utils-ojs-to-preamble.spec.ts +++ b/libs/utils/ojs-to-preamble/src/lib/utils-ojs-to-preamble.spec.ts @@ -1,4 +1,4 @@ -import { utilsOjsToPreamble } from './utils-ojs-to-preamble' +import { utilsOjsToPreamble } from './utils-ojs-to-preamble.js' describe('utilsOjsToPreamble', () => { it('should work', () => { diff --git a/libs/utils/ojs-to-preamble/tsconfig.lib.json b/libs/utils/ojs-to-preamble/tsconfig.lib.json index ff64bb51..5c108b84 100755 --- a/libs/utils/ojs-to-preamble/tsconfig.lib.json +++ b/libs/utils/ojs-to-preamble/tsconfig.lib.json @@ -1,7 +1,6 @@ { "extends": "./tsconfig.json", "compilerOptions": { - "module": "commonjs", "outDir": "../../../dist/out-tsc", "declaration": true, "types": ["node"] diff --git a/libs/utils/ojs-to-preamble/tsconfig.spec.json b/libs/utils/ojs-to-preamble/tsconfig.spec.json index 83cd0e83..7e1d3b87 100755 --- a/libs/utils/ojs-to-preamble/tsconfig.spec.json +++ b/libs/utils/ojs-to-preamble/tsconfig.spec.json @@ -2,7 +2,6 @@ "extends": "./tsconfig.json", "compilerOptions": { "outDir": "../../../dist/out-tsc", - "module": "commonjs", "types": ["jest", "node"] }, "include": [ diff --git a/libs/utils/readme/src/executors/update-readme/executor.spec.ts b/libs/utils/readme/src/executors/update-readme/executor.spec.ts index fbd5a115..6563f0a6 100644 --- a/libs/utils/readme/src/executors/update-readme/executor.spec.ts +++ b/libs/utils/readme/src/executors/update-readme/executor.spec.ts @@ -1,4 +1,4 @@ -import { UpdateReadmeExecutorSchema } from './schema.d' +import { UpdateReadmeExecutorSchema } from './schema.d.js' import executor from './executor.js' const options: UpdateReadmeExecutorSchema = {} diff --git a/libs/utils/readme/src/executors/update-readme/executor.ts b/libs/utils/readme/src/executors/update-readme/executor.ts index c5a44047..9214b772 100644 --- a/libs/utils/readme/src/executors/update-readme/executor.ts +++ b/libs/utils/readme/src/executors/update-readme/executor.ts @@ -1,6 +1,6 @@ -import { UpdateReadmeExecutorSchema } from './schema' +import { UpdateReadmeExecutorSchema } from './schema.js' import { ExecutorContext, workspaceRoot } from '@nrwl/devkit' -import { readmeAction } from './readmeAction' +import { readmeAction } from './readmeAction.js' import path from 'path' import { exec } from 'child_process' import { promisify } from 'util' diff --git a/libs/utils/readme/src/executors/update-readme/readmeAction.ts b/libs/utils/readme/src/executors/update-readme/readmeAction.ts index 00bb5dac..2c1ec733 100644 --- a/libs/utils/readme/src/executors/update-readme/readmeAction.ts +++ b/libs/utils/readme/src/executors/update-readme/readmeAction.ts @@ -96,7 +96,7 @@ const findTypeDocFilesAndInterfaces = async ( try { const moduleFileContent = await readFile(typeDocModuleFilePath, 'utf-8') - const newModuleFileContent = moduleFileContent.replace(/^# .*?\n.*$/, '') //+ interfaceFiles.join('\n') + const newModuleFileContent = moduleFileContent.replace(/^# .*\n.*$/, '') //+ interfaceFiles.join('\n') const downshiftedContent = newModuleFileContent // .replace(/((^|\n)#+) /g, '$1## ') diff --git a/libs/utils/update-readme/src/executors/update-readme/readmeAction.ts b/libs/utils/update-readme/src/executors/update-readme/readmeAction.ts index 2af42834..80b1a9f7 100644 --- a/libs/utils/update-readme/src/executors/update-readme/readmeAction.ts +++ b/libs/utils/update-readme/src/executors/update-readme/readmeAction.ts @@ -1,4 +1,4 @@ -import { loopOverDirs } from './loopOverDirs' +import { loopOverDirs } from './loopOverDirs.js' import { remark } from 'remark' import remarkLicense from 'remark-license' import remarkToc, { Root } from 'remark-toc' @@ -212,7 +212,6 @@ const proc = ( .process(readme) export async function readmeAction(readmePath: string, packagePath: string, dev?: boolean) { - const readme = await readFile(readmePath, 'utf-8') const packageJSON = JSON.parse(await readFile(packagePath, 'utf-8')) diff --git a/libs/xast/xast-util-has-attribute/project.json b/libs/xast/xast-util-has-attribute/project.json index f5bf436f..e103dce2 100755 --- a/libs/xast/xast-util-has-attribute/project.json +++ b/libs/xast/xast-util-has-attribute/project.json @@ -11,8 +11,11 @@ "packageJSON": "libs/xast/xast-util-has-attribute/package.json" } }, + "make-publishable": { + "executor": "better-nx-tsc:publishable" + }, "build": { - "executor": "better-nx-tsc:tsc", + "executor": "@nrwl/js:tsc", "outputs": ["{options.outputPath}"], "options": { "rootDir": "libs/xast/xast-util-has-attribute/src", diff --git a/libs/xast/xast-util-is-element/project.json b/libs/xast/xast-util-is-element/project.json index b2227178..c2a70e50 100755 --- a/libs/xast/xast-util-is-element/project.json +++ b/libs/xast/xast-util-is-element/project.json @@ -26,8 +26,11 @@ "passWithNoTests": true } }, + "make-publishable": { + "executor": "better-nx-tsc:publishable" + }, "build": { - "executor": "better-nx-tsc:tsc", + "executor": "@nrwl/js:tsc", "outputs": ["{options.outputPath}"], "options": { "rootDir": "libs/xast/xast-util-is-element/src", diff --git a/libs/xast/xast-util-select/.swcrc b/libs/xast/xast-util-select/.swcrc deleted file mode 100644 index f9daa011..00000000 --- a/libs/xast/xast-util-select/.swcrc +++ /dev/null @@ -1,33 +0,0 @@ -{ - "$schema": "https://json.schemastore.org/swcrc", - "jsc": { - "target": "es2016", - "parser": { - "syntax": "typescript", - "decorators": true, - "dynamicImport": true - }, - "transform": { - "decoratorMetadata": true, - "legacyDecorator": true - }, - - "externalHelpers": true, - "loose": true - }, - "module": { - "type": "es6", - "strict": true, - "noInterop": true - }, - "minify": true, - "sourceMaps": true, - "exclude": [ - "jest.config.ts", - ".*.spec.tsx?$", - ".*.test.tsx?$", - "./src/jest-setup.ts$", - "./**/jest-setup.ts$", - ".*.js$" - ] -} diff --git a/libs/xast/xast-util-select/project.json b/libs/xast/xast-util-select/project.json index 54fc3c1a..edba32df 100755 --- a/libs/xast/xast-util-select/project.json +++ b/libs/xast/xast-util-select/project.json @@ -11,8 +11,11 @@ "packageJSON": "libs/xast/xast-util-select/package.json" } }, + "make-publishable": { + "executor": "better-nx-tsc:publishable" + }, "build": { - "executor": "better-nx-tsc:tsc", + "executor": "@nrwl/js:tsc", "outputs": ["{options.outputPath}"], "options": { "rootDir": "libs/xast/xast-util-select/src", diff --git a/libs/xast/xast-util-select/src/lib/enter-state.ts b/libs/xast/xast-util-select/src/lib/enter-state.ts index a84ca98b..44b1d019 100755 --- a/libs/xast/xast-util-select/src/lib/enter-state.ts +++ b/libs/xast/xast-util-select/src/lib/enter-state.ts @@ -3,10 +3,12 @@ import { SelectState, XastNode, ElementChild, Direction } from './types.js' import { direction } from 'direction' import { isElement } from 'xast-util-is-element' -import { visit, EXIT, SKIP } from 'unist-util-visit' +// import { visit, EXIT, SKIP } from 'unist-util-visit' import { element } from './util.js' import { Parent } from 'xast' +const EXIT = true +const SKIP = 'skip' /** * @param {SelectState} state * @param {HastNode} node diff --git a/libs/xast/xast-util-select/src/lib/nest.ts b/libs/xast/xast-util-select/src/lib/nest.ts index 8afb8706..57ee9b80 100755 --- a/libs/xast/xast-util-select/src/lib/nest.ts +++ b/libs/xast/xast-util-select/src/lib/nest.ts @@ -1,12 +1,4 @@ -import { - Rule, - XastNode as Node, - Element, - XastParent as Parent, - SelectState, - SelectIterator, - Handler, -} from './types.js' +import { Rule, XastNode as Node, Element, XastParent as Parent, SelectState } from './types.js' import { zwitch } from 'zwitch' import { enterState } from './enter-state.js' diff --git a/libs/xast/xast-util-select/src/test/all.spec.ts b/libs/xast/xast-util-select/src/test/all.spec.ts index 7549288f..b5bcd16c 100755 --- a/libs/xast/xast-util-select/src/test/all.spec.ts +++ b/libs/xast/xast-util-select/src/test/all.spec.ts @@ -2,7 +2,7 @@ import { u } from 'unist-builder' import { x } from 'xastscript' import { selectAll } from '../index.js' -test('all together now', (t) => { +test('all together now', () => { expect( selectAll( 'dl > dt.foo:nth-of-type(odd)', @@ -22,8 +22,8 @@ test('all together now', (t) => { x('dd', 'Foxtrot'), '\n', ]), - ]) - ) + ]), + ), ).toEqual([x('dt.foo', 'Alpha')]) expect( @@ -49,8 +49,8 @@ test('all together now', (t) => { x('dd', 'Hotel'), '\n', ]), - ]) - ) + ]), + ), ).toEqual([x('dd', 'Delta'), x('dd', 'Hotel')]) expect( @@ -76,8 +76,8 @@ test('all together now', (t) => { x('dd', 'Hotel'), '\n', ]), - ]) - ) + ]), + ), ).toEqual([x('dd', 'Delta')]) expect( @@ -94,8 +94,8 @@ test('all together now', (t) => { x('dt', 'Golf'), x('dd', 'Hotel'), ]), - ]) - ) + ]), + ), ).toEqual([ x('dt.foo', 'Charlie'), x('dd.foo', { title: 'baz' }, 'Foxtrot'), diff --git a/libs/xast/xast-util-select/tsconfig.lib.json b/libs/xast/xast-util-select/tsconfig.lib.json index 3feb5e3c..3a8b3f9e 100755 --- a/libs/xast/xast-util-select/tsconfig.lib.json +++ b/libs/xast/xast-util-select/tsconfig.lib.json @@ -6,5 +6,5 @@ "types": ["node"] }, "exclude": ["**/*.spec.ts", "jest.config.ts", "**/*.test.ts"], - "include": ["**/*.ts"] + "include": ["src/**/*.ts"] } diff --git a/nx.json b/nx.json index 801ea313..8cb261a5 100755 --- a/nx.json +++ b/nx.json @@ -50,8 +50,18 @@ "dependsOn": ["^build", "lint"], "inputs": ["production", "^production"] }, + "make-publishable": { + "dependsOn": ["^build", "lint"], + "inputs": ["production", "^production"], + "executor": "better-nx-tsc:publishable" + }, + "better-nx-tsc:publishable": { + "options": { + "dist": "dist/{projectRoot}" + } + }, "version": { - "dependsOn": ["^version", "build"], + "dependsOn": ["^version", "make-publishable"], "options": { "preset": "conventional", "trackDeps": true @@ -68,7 +78,16 @@ "default": { "runner": "nx/tasks-runners/default", "options": { - "cacheableOperations": ["build", "lint", "test", "e2e", "npm", "readme", "version"] + "cacheableOperations": [ + "build", + "make-publishable", + "lint", + "test", + "e2e", + "npm", + "readme", + "version" + ] } } } diff --git a/package.json b/package.json index 57a708bb..9bbf4fc9 100755 --- a/package.json +++ b/package.json @@ -64,6 +64,7 @@ "@types/unist": "^2.0.6", "@types/xast": "^1.0.2", "@unified-latex/unified-latex-builder": "^1.3.1", + "@unified-latex/unified-latex-types": "^1.3.1", "@unified-latex/unified-latex-util-render-info": "^1.3.1", "@unified-latex/unified-latex-util-to-string": "^1.3.1", "@vercel/analytics": "^0.1.11", @@ -220,9 +221,8 @@ "@types/tmp": "^0.2.3", "@types/yauzl": "^2.10.0", "@typescript-eslint/eslint-plugin": "5.30.6", - "@typescript-eslint/parser": "5.30.6", + "@typescript-eslint/parser": "6.5.0", "@typescript/analyze-trace": "^0.9.0", - "@unified-latex/unified-latex-types": "^1.3.1", "@vercel/remote-nx": "^1.0.1", "@vitest/coverage-c8": "~0.29.8", "@vitest/ui": "^0.29.8", @@ -275,7 +275,7 @@ "tsx": "^3.12.6", "typedoc": "^0.23.28", "typedoc-plugin-markdown": "4.0.0-next.3", - "typescript": "5.1.3", + "typescript": "5.2.2", "unist-util-remove-position": "4.0.2", "unist-util-visit-parents": "5.1.3", "vercel": "^27.0.1", diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 39757cbb..d746c14d 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -25,7 +25,7 @@ dependencies: version: 11.10.5(@babel/core@7.20.5)(@types/react@18.0.31)(react@18.2.0) '@enio.ai/typedoc': specifier: ^1.0.8 - version: 1.0.8(nx@15.8.7)(typedoc-plugin-rename-defaults@0.6.5)(typedoc-theme-hierarchy@3.2.0)(typedoc@0.23.28)(typescript@5.1.3) + version: 1.0.8(nx@15.8.7)(typedoc-plugin-rename-defaults@0.6.5)(typedoc-theme-hierarchy@3.2.0)(typedoc@0.23.28)(typescript@5.2.2) '@headlessui/react': specifier: ^1.7.13 version: 1.7.13(react-dom@18.2.0)(react@18.2.0) @@ -79,13 +79,13 @@ dependencies: version: 8.4.7(@nestjs/common@8.4.7)(@nestjs/core@8.4.7) '@nrwl/esbuild': specifier: 15.8.5 - version: 15.8.5(@swc-node/register@1.6.2)(@swc/core@1.3.37)(esbuild@0.17.14)(eslint@8.36.0)(nx@15.8.7)(prettier@2.8.4)(typescript@5.1.3) + version: 15.8.5(@swc-node/register@1.6.2)(@swc/core@1.3.37)(esbuild@0.17.14)(eslint@8.36.0)(nx@15.8.7)(prettier@2.8.4)(typescript@5.2.2) '@nrwl/next': specifier: 15.8.5 - version: 15.8.5(@babel/core@7.20.5)(@swc-node/register@1.6.2)(@swc/core@1.3.37)(@types/node@18.15.11)(cypress@12.8.1)(esbuild@0.17.14)(eslint@8.36.0)(next@13.2.4)(nx@15.8.7)(prettier@2.8.4)(typescript@5.1.3)(webpack@5.86.0) + version: 15.8.5(@babel/core@7.20.5)(@swc-node/register@1.6.2)(@swc/core@1.3.37)(@types/node@18.15.11)(cypress@12.8.1)(esbuild@0.17.14)(eslint@8.36.0)(next@13.2.4)(nx@15.8.7)(prettier@2.8.4)(typescript@5.2.2)(webpack@5.86.0) '@nrwl/nx-plugin': specifier: 15.8.5 - version: 15.8.5(@swc-node/register@1.6.2)(@swc/core@1.3.37)(@types/node@18.15.11)(eslint@8.36.0)(nx@15.8.7)(prettier@2.8.4)(ts-node@10.9.1)(typescript@5.1.3) + version: 15.8.5(@swc-node/register@1.6.2)(@swc/core@1.3.37)(@types/node@18.15.11)(eslint@8.36.0)(nx@15.8.7)(prettier@2.8.4)(ts-node@10.9.1)(typescript@5.2.2) '@nrwl/tao': specifier: 15.8.5 version: 15.8.5(@swc-node/register@1.6.2)(@swc/core@1.3.37) @@ -128,6 +128,9 @@ dependencies: '@unified-latex/unified-latex-builder': specifier: ^1.3.1 version: 1.3.1 + '@unified-latex/unified-latex-types': + specifier: ^1.3.1 + version: 1.3.1 '@unified-latex/unified-latex-util-render-info': specifier: ^1.3.1 version: 1.3.1 @@ -456,7 +459,7 @@ devDependencies: version: 2.30.1(@nrwl/devkit@15.8.5) '@nestjs/schematics': specifier: ^8.0.0 - version: 8.0.11(typescript@5.1.3) + version: 8.0.11(typescript@5.2.2) '@nestjs/testing': specifier: ^8.0.0 version: 8.4.7(@nestjs/common@8.4.7)(@nestjs/core@8.4.7)(@nestjs/platform-express@8.4.7) @@ -468,43 +471,43 @@ devDependencies: version: 15.8.5(@swc-node/register@1.6.2)(@swc/core@1.3.37) '@nrwl/cypress': specifier: 15.8.5 - version: 15.8.5(@swc-node/register@1.6.2)(@swc/core@1.3.37)(cypress@12.8.1)(eslint@8.36.0)(nx@15.8.7)(prettier@2.8.4)(typescript@5.1.3) + version: 15.8.5(@swc-node/register@1.6.2)(@swc/core@1.3.37)(cypress@12.8.1)(eslint@8.36.0)(nx@15.8.7)(prettier@2.8.4)(typescript@5.2.2) '@nrwl/devkit': specifier: 15.8.5 - version: 15.8.5(nx@15.8.7)(typescript@5.1.3) + version: 15.8.5(nx@15.8.7)(typescript@5.2.2) '@nrwl/eslint-plugin-nx': specifier: 15.8.5 - version: 15.8.5(@typescript-eslint/parser@5.30.6)(eslint-config-prettier@8.8.0)(eslint@8.36.0)(nx@15.8.7)(typescript@5.1.3) + version: 15.8.5(@typescript-eslint/parser@6.5.0)(eslint-config-prettier@8.8.0)(eslint@8.36.0)(nx@15.8.7)(typescript@5.2.2) '@nrwl/jest': specifier: 15.8.5 - version: 15.8.5(@swc-node/register@1.6.2)(@swc/core@1.3.37)(@types/node@18.15.11)(eslint@8.36.0)(nx@15.8.7)(prettier@2.8.4)(ts-node@10.9.1)(typescript@5.1.3) + version: 15.8.5(@swc-node/register@1.6.2)(@swc/core@1.3.37)(@types/node@18.15.11)(eslint@8.36.0)(nx@15.8.7)(prettier@2.8.4)(ts-node@10.9.1)(typescript@5.2.2) '@nrwl/js': specifier: 15.8.5 - version: 15.8.5(@swc-node/register@1.6.2)(@swc/core@1.3.37)(eslint@8.36.0)(nx@15.8.7)(prettier@2.8.4)(typescript@5.1.3) + version: 15.8.5(@swc-node/register@1.6.2)(@swc/core@1.3.37)(eslint@8.36.0)(nx@15.8.7)(prettier@2.8.4)(typescript@5.2.2) '@nrwl/linter': specifier: 15.8.5 - version: 15.8.5(@swc-node/register@1.6.2)(@swc/core@1.3.37)(eslint@8.36.0)(nx@15.8.7)(prettier@2.8.4)(typescript@5.1.3) + version: 15.8.5(@swc-node/register@1.6.2)(@swc/core@1.3.37)(eslint@8.36.0)(nx@15.8.7)(prettier@2.8.4)(typescript@5.2.2) '@nrwl/nest': specifier: 15.8.5 - version: 15.8.5(@babel/core@7.20.5)(@swc-node/register@1.6.2)(@swc/core@1.3.37)(@types/node@18.15.11)(esbuild@0.17.14)(eslint@8.36.0)(nx@15.8.7)(prettier@2.8.4)(ts-node@10.9.1)(typescript@5.1.3) + version: 15.8.5(@babel/core@7.20.5)(@swc-node/register@1.6.2)(@swc/core@1.3.37)(@types/node@18.15.11)(esbuild@0.17.14)(eslint@8.36.0)(nx@15.8.7)(prettier@2.8.4)(ts-node@10.9.1)(typescript@5.2.2) '@nrwl/node': specifier: 15.8.5 - version: 15.8.5(@babel/core@7.20.5)(@swc-node/register@1.6.2)(@swc/core@1.3.37)(@types/node@18.15.11)(esbuild@0.17.14)(eslint@8.36.0)(nx@15.8.7)(prettier@2.8.4)(ts-node@10.9.1)(typescript@5.1.3) + version: 15.8.5(@babel/core@7.20.5)(@swc-node/register@1.6.2)(@swc/core@1.3.37)(@types/node@18.15.11)(esbuild@0.17.14)(eslint@8.36.0)(nx@15.8.7)(prettier@2.8.4)(ts-node@10.9.1)(typescript@5.2.2) '@nrwl/react': specifier: 15.8.5 - version: 15.8.5(@swc-node/register@1.6.2)(@swc/core@1.3.37)(eslint@8.36.0)(nx@15.8.7)(prettier@2.8.4)(typescript@5.1.3) + version: 15.8.5(@swc-node/register@1.6.2)(@swc/core@1.3.37)(eslint@8.36.0)(nx@15.8.7)(prettier@2.8.4)(typescript@5.2.2) '@nrwl/vite': specifier: ^15.8.8 - version: 15.8.8(@swc-node/register@1.6.2)(@swc/core@1.3.37)(eslint@8.36.0)(nx@15.8.7)(prettier@2.8.4)(typescript@5.1.3)(vite@4.2.1)(vitest@0.29.8) + version: 15.8.8(@swc-node/register@1.6.2)(@swc/core@1.3.37)(eslint@8.36.0)(nx@15.8.7)(prettier@2.8.4)(typescript@5.2.2)(vite@4.2.1)(vitest@0.29.8) '@nrwl/web': specifier: 15.8.5 - version: 15.8.5(@babel/core@7.20.5)(@swc-node/register@1.6.2)(@swc/core@1.3.37)(@types/node@18.15.11)(cypress@12.8.1)(eslint@8.36.0)(nx@15.8.7)(prettier@2.8.4)(ts-node@10.9.1)(typescript@5.1.3) + version: 15.8.5(@babel/core@7.20.5)(@swc-node/register@1.6.2)(@swc/core@1.3.37)(@types/node@18.15.11)(cypress@12.8.1)(eslint@8.36.0)(nx@15.8.7)(prettier@2.8.4)(ts-node@10.9.1)(typescript@5.2.2) '@nrwl/workspace': specifier: 15.8.5 - version: 15.8.5(@swc-node/register@1.6.2)(@swc/core@1.3.37)(eslint@8.36.0)(prettier@2.8.4)(typescript@5.1.3) + version: 15.8.5(@swc-node/register@1.6.2)(@swc/core@1.3.37)(eslint@8.36.0)(prettier@2.8.4)(typescript@5.2.2) '@nxext/sveltekit': specifier: 14.0.0-next.2 - version: 14.0.0-next.2(nx@15.8.7)(typescript@5.1.3) + version: 14.0.0-next.2(nx@15.8.7)(typescript@5.2.2) '@sveltejs/adapter-node': specifier: ^1.2.3 version: 1.2.3(@sveltejs/kit@1.13.0) @@ -513,7 +516,7 @@ devDependencies: version: 1.13.0(svelte@3.57.0)(vite@4.2.1) '@swc-node/register': specifier: ^1.6.2 - version: 1.6.2(@swc/core@1.3.37)(typescript@5.1.3) + version: 1.6.2(@swc/core@1.3.37)(typescript@5.2.2) '@swc/cli': specifier: ^0.1.62 version: 0.1.62(@swc/core@1.3.37) @@ -591,16 +594,13 @@ devDependencies: version: 2.10.0 '@typescript-eslint/eslint-plugin': specifier: 5.30.6 - version: 5.30.6(@typescript-eslint/parser@5.30.6)(eslint@8.36.0)(typescript@5.1.3) + version: 5.30.6(@typescript-eslint/parser@6.5.0)(eslint@8.36.0)(typescript@5.2.2) '@typescript-eslint/parser': - specifier: 5.30.6 - version: 5.30.6(eslint@8.36.0)(typescript@5.1.3) + specifier: 6.5.0 + version: 6.5.0(eslint@8.36.0)(typescript@5.2.2) '@typescript/analyze-trace': specifier: ^0.9.0 version: 0.9.1 - '@unified-latex/unified-latex-types': - specifier: ^1.3.1 - version: 1.3.1 '@vercel/remote-nx': specifier: ^1.0.1 version: 1.0.1(@nrwl/workspace@15.8.5) @@ -642,7 +642,7 @@ devDependencies: version: 8.36.0 eslint-config-next: specifier: 13.2.4 - version: 13.2.4(eslint@8.36.0)(typescript@5.1.3) + version: 13.2.4(eslint@8.36.0)(typescript@5.2.2) eslint-config-prettier: specifier: 8.8.0 version: 8.8.0(eslint@8.36.0) @@ -651,7 +651,7 @@ devDependencies: version: 2.12.1(eslint@8.36.0) eslint-plugin-import: specifier: 2.27.5 - version: 2.27.5(@typescript-eslint/parser@5.30.6)(eslint@8.36.0) + version: 2.27.5(@typescript-eslint/parser@6.5.0)(eslint@8.36.0) eslint-plugin-jsx-a11y: specifier: 6.7.1 version: 6.7.1(eslint@8.36.0) @@ -735,7 +735,7 @@ devDependencies: version: 3.1.4(@babel/core@7.20.5)(less@4.1.3)(postcss@8.4.19)(stylus@0.55.0)(svelte@3.57.0) svelte-preprocess: specifier: ^5.0.3 - version: 5.0.3(@babel/core@7.20.5)(less@4.1.3)(postcss@8.4.19)(stylus@0.55.0)(svelte@3.57.0)(typescript@5.1.3) + version: 5.0.3(@babel/core@7.20.5)(less@4.1.3)(postcss@8.4.19)(stylus@0.55.0)(svelte@3.57.0)(typescript@5.2.2) tailwindcss: specifier: 3.2.7 version: 3.2.7(postcss@8.4.19)(ts-node@10.9.1) @@ -744,22 +744,22 @@ devDependencies: version: 7.2.4 ts-jest: specifier: 29.0.5 - version: 29.0.5(@babel/core@7.20.5)(babel-jest@29.4.3)(esbuild@0.17.14)(jest@29.4.3)(typescript@5.1.3) + version: 29.0.5(@babel/core@7.20.5)(babel-jest@29.4.3)(esbuild@0.17.14)(jest@29.4.3)(typescript@5.2.2) ts-node: specifier: 10.9.1 - version: 10.9.1(@swc/core@1.3.37)(@types/node@18.15.11)(typescript@5.1.3) + version: 10.9.1(@swc/core@1.3.37)(@types/node@18.15.11)(typescript@5.2.2) tsx: specifier: ^3.12.6 version: 3.12.6 typedoc: specifier: ^0.23.28 - version: 0.23.28(typescript@5.1.3) + version: 0.23.28(typescript@5.2.2) typedoc-plugin-markdown: specifier: 4.0.0-next.3 version: 4.0.0-next.3(typedoc@0.23.28) typescript: - specifier: 5.1.3 - version: 5.1.3 + specifier: 5.2.2 + version: 5.2.2 unist-util-remove-position: specifier: 4.0.2 version: 4.0.2 @@ -774,7 +774,7 @@ devDependencies: version: 1.8.1(eslint@8.36.0)(vite@4.2.1) vite-tsconfig-paths: specifier: ^4.0.2 - version: 4.0.7(typescript@5.1.3)(vite@4.2.1) + version: 4.0.7(typescript@5.2.2)(vite@4.2.1) vitest: specifier: ^0.29.8 version: 0.29.8(@vitest/ui@0.29.8)(jsdom@20.0.3)(less@4.1.3)(stylus@0.55.0) @@ -2436,13 +2436,13 @@ packages: '@types/node': 18.15.11 chalk: 4.1.2 cosmiconfig: 8.1.3 - cosmiconfig-typescript-loader: 4.3.0(@types/node@18.15.11)(cosmiconfig@8.1.3)(ts-node@10.9.1)(typescript@5.1.3) + cosmiconfig-typescript-loader: 4.3.0(@types/node@18.15.11)(cosmiconfig@8.1.3)(ts-node@10.9.1)(typescript@5.2.2) lodash.isplainobject: 4.0.6 lodash.merge: 4.6.2 lodash.uniq: 4.5.0 resolve-from: 5.0.0 - ts-node: 10.9.1(@swc/core@1.3.37)(@types/node@18.15.11)(typescript@5.1.3) - typescript: 5.1.3 + ts-node: 10.9.1(@swc/core@1.3.37)(@types/node@18.15.11)(typescript@5.2.2) + typescript: 5.2.2 transitivePeerDependencies: - '@swc/core' - '@swc/wasm' @@ -2663,16 +2663,16 @@ packages: resolution: {integrity: sha512-AHPmaAx+RYfZz0eYu6Gviiagpmiyw98ySSlQvCUhVGDRtDFe4DBS0x1bSjdF3gqUDYOczB+yYvBTtEylYSdRhg==} dev: false - /@enio.ai/typedoc@1.0.8(nx@15.8.7)(typedoc-plugin-rename-defaults@0.6.5)(typedoc-theme-hierarchy@3.2.0)(typedoc@0.23.28)(typescript@5.1.3): + /@enio.ai/typedoc@1.0.8(nx@15.8.7)(typedoc-plugin-rename-defaults@0.6.5)(typedoc-theme-hierarchy@3.2.0)(typedoc@0.23.28)(typescript@5.2.2): resolution: {integrity: sha512-oZtYpvAXYEnrV/b8KD2HMdE3upHfW0HN5Fh9BD7LXIvoA7f2vEJK2chBT4c3Tb/ZLdy9UwNmH288sP+z/7pVTg==} peerDependencies: typedoc: ^0.23.26 typedoc-plugin-rename-defaults: ^0.6.4 typedoc-theme-hierarchy: ^3.0.0 dependencies: - '@nrwl/devkit': 15.8.5(nx@15.8.7)(typescript@5.1.3) + '@nrwl/devkit': 15.8.5(nx@15.8.7)(typescript@5.2.2) tslib: 2.5.0 - typedoc: 0.23.28(typescript@5.1.3) + typedoc: 0.23.28(typescript@5.2.2) typedoc-plugin-rename-defaults: 0.6.5(typedoc@0.23.28) typedoc-theme-hierarchy: 3.2.0(typedoc@0.23.28) transitivePeerDependencies: @@ -3542,7 +3542,7 @@ packages: peerDependencies: '@nrwl/devkit': ^15.0.0 dependencies: - '@nrwl/devkit': 15.8.5(nx@15.8.7)(typescript@5.1.3) + '@nrwl/devkit': 15.8.5(nx@15.8.7)(typescript@5.2.2) chalk: 4.1.2 conventional-changelog: 3.1.25 conventional-recommended-bump: 6.1.0 @@ -3829,7 +3829,7 @@ packages: transitivePeerDependencies: - supports-color - /@nestjs/schematics@8.0.11(typescript@5.1.3): + /@nestjs/schematics@8.0.11(typescript@5.2.2): resolution: {integrity: sha512-W/WzaxgH5aE01AiIErE9QrQJ73VR/M/8p8pq0LZmjmNcjZqU5kQyOWUxZg13WYfSpJdOa62t6TZRtFDmgZPoIg==} peerDependencies: typescript: ^3.4.5 || ^4.3.5 @@ -3839,12 +3839,12 @@ packages: fs-extra: 10.1.0 jsonc-parser: 3.0.0 pluralize: 8.0.0 - typescript: 5.1.3 + typescript: 5.2.2 transitivePeerDependencies: - chokidar dev: true - /@nestjs/schematics@9.0.4(typescript@5.1.3): + /@nestjs/schematics@9.0.4(typescript@5.2.2): resolution: {integrity: sha512-egurCfAc4e5i1r2TmeAF0UrOKejFmT5oTdv4b7HcOVPupc3QGU7CbEfGleL3mkM5AjrixTQeMxU9bJ00ttAbGg==} peerDependencies: typescript: ^4.3.5 @@ -3854,7 +3854,7 @@ packages: fs-extra: 11.1.0 jsonc-parser: 3.2.0 pluralize: 8.0.0 - typescript: 5.1.3 + typescript: 5.2.2 transitivePeerDependencies: - chokidar dev: true @@ -4071,7 +4071,7 @@ packages: - debug dev: true - /@nrwl/cypress@15.8.5(@swc-node/register@1.6.2)(@swc/core@1.3.37)(cypress@12.8.1)(eslint@8.36.0)(nx@15.8.7)(prettier@2.8.4)(typescript@5.1.3): + /@nrwl/cypress@15.8.5(@swc-node/register@1.6.2)(@swc/core@1.3.37)(cypress@12.8.1)(eslint@8.36.0)(nx@15.8.7)(prettier@2.8.4)(typescript@5.2.2): resolution: {integrity: sha512-y9+mLL5Yw8RRaCBkdmFG8br39rYUPF03P3kx2AI7KbCs0e1kfPe6E7TaPOgdtEeSTvitjE9YeamFlWfOEHXp0A==} peerDependencies: cypress: '>= 3 < 13' @@ -4079,11 +4079,11 @@ packages: cypress: optional: true dependencies: - '@nrwl/devkit': 15.8.5(nx@15.8.7)(typescript@5.1.3) - '@nrwl/js': 15.8.5(@swc-node/register@1.6.2)(@swc/core@1.3.37)(eslint@8.36.0)(nx@15.8.7)(prettier@2.8.4)(typescript@5.1.3) - '@nrwl/linter': 15.8.5(@swc-node/register@1.6.2)(@swc/core@1.3.37)(eslint@8.36.0)(nx@15.8.7)(prettier@2.8.4)(typescript@5.1.3) - '@nrwl/workspace': 15.8.5(@swc-node/register@1.6.2)(@swc/core@1.3.37)(eslint@8.36.0)(prettier@2.8.4)(typescript@5.1.3) - '@phenomnomnominal/tsquery': 4.1.1(typescript@5.1.3) + '@nrwl/devkit': 15.8.5(nx@15.8.7)(typescript@5.2.2) + '@nrwl/js': 15.8.5(@swc-node/register@1.6.2)(@swc/core@1.3.37)(eslint@8.36.0)(nx@15.8.7)(prettier@2.8.4)(typescript@5.2.2) + '@nrwl/linter': 15.8.5(@swc-node/register@1.6.2)(@swc/core@1.3.37)(eslint@8.36.0)(nx@15.8.7)(prettier@2.8.4)(typescript@5.2.2) + '@nrwl/workspace': 15.8.5(@swc-node/register@1.6.2)(@swc/core@1.3.37)(eslint@8.36.0)(prettier@2.8.4)(typescript@5.2.2) + '@phenomnomnominal/tsquery': 4.1.1(typescript@5.2.2) cypress: 12.8.1 dotenv: 10.0.0 semver: 7.3.4 @@ -4098,12 +4098,12 @@ packages: - supports-color - typescript - /@nrwl/devkit@14.7.17(nx@15.8.7)(typescript@5.1.3): + /@nrwl/devkit@14.7.17(nx@15.8.7)(typescript@5.2.2): resolution: {integrity: sha512-flTV8BuC7oacWGHseoKsyOAYmWsMSP6iYGRjrCaV0MyRbDkNy0P07elXXFUW01er+l7x/awZYQR9/n/eNyqfXA==} peerDependencies: nx: '>= 13.10 <= 15' dependencies: - '@phenomnomnominal/tsquery': 4.1.1(typescript@5.1.3) + '@phenomnomnominal/tsquery': 4.1.1(typescript@5.2.2) ejs: 3.1.8 ignore: 5.2.4 nx: 15.8.7(@swc-node/register@1.6.2)(@swc/core@1.3.37) @@ -4112,12 +4112,12 @@ packages: - typescript dev: true - /@nrwl/devkit@15.8.5(nx@15.8.5)(typescript@5.1.3): + /@nrwl/devkit@15.8.5(nx@15.8.5)(typescript@5.2.2): resolution: {integrity: sha512-NgpD1I1BfFb6wRxB5i5PGP4hMyRhPsArCyENWWvY4gCn8tylAc7yjpQyiDiy2QnymL2PjWM8QeAeCOy1eF2xgw==} peerDependencies: nx: '>= 14.1 <= 16' dependencies: - '@phenomnomnominal/tsquery': 4.1.1(typescript@5.1.3) + '@phenomnomnominal/tsquery': 4.1.1(typescript@5.2.2) ejs: 3.1.8 ignore: 5.2.4 nx: 15.8.5(@swc-node/register@1.6.2)(@swc/core@1.3.37) @@ -4127,12 +4127,12 @@ packages: transitivePeerDependencies: - typescript - /@nrwl/devkit@15.8.5(nx@15.8.7)(typescript@5.1.3): + /@nrwl/devkit@15.8.5(nx@15.8.7)(typescript@5.2.2): resolution: {integrity: sha512-NgpD1I1BfFb6wRxB5i5PGP4hMyRhPsArCyENWWvY4gCn8tylAc7yjpQyiDiy2QnymL2PjWM8QeAeCOy1eF2xgw==} peerDependencies: nx: '>= 14.1 <= 16' dependencies: - '@phenomnomnominal/tsquery': 4.1.1(typescript@5.1.3) + '@phenomnomnominal/tsquery': 4.1.1(typescript@5.2.2) ejs: 3.1.8 ignore: 5.2.4 nx: 15.8.7(@swc-node/register@1.6.2)(@swc/core@1.3.37) @@ -4142,12 +4142,12 @@ packages: transitivePeerDependencies: - typescript - /@nrwl/devkit@15.8.8(nx@15.8.7)(typescript@5.1.3): + /@nrwl/devkit@15.8.8(nx@15.8.7)(typescript@5.2.2): resolution: {integrity: sha512-4cm1ZGb0AY+l1TvtSHupCwVKk7OGEsTTFQ1KrZ/6hSngIZ/F7ixrzq2N0ASri29g18f05mWtnYd2TvETq9yYnw==} peerDependencies: nx: '>= 14.1 <= 16' dependencies: - '@phenomnomnominal/tsquery': 4.1.1(typescript@5.1.3) + '@phenomnomnominal/tsquery': 4.1.1(typescript@5.2.2) ejs: 3.1.8 ignore: 5.2.4 nx: 15.8.7(@swc-node/register@1.6.2)(@swc/core@1.3.37) @@ -4158,12 +4158,12 @@ packages: - typescript dev: true - /@nrwl/devkit@15.8.8(nx@15.8.8)(typescript@5.1.3): + /@nrwl/devkit@15.8.8(nx@15.8.8)(typescript@5.2.2): resolution: {integrity: sha512-4cm1ZGb0AY+l1TvtSHupCwVKk7OGEsTTFQ1KrZ/6hSngIZ/F7ixrzq2N0ASri29g18f05mWtnYd2TvETq9yYnw==} peerDependencies: nx: '>= 14.1 <= 16' dependencies: - '@phenomnomnominal/tsquery': 4.1.1(typescript@5.1.3) + '@phenomnomnominal/tsquery': 4.1.1(typescript@5.2.2) ejs: 3.1.8 ignore: 5.2.4 nx: 15.8.8(@swc-node/register@1.6.2)(@swc/core@1.3.37) @@ -4174,7 +4174,7 @@ packages: - typescript dev: true - /@nrwl/esbuild@15.8.5(@swc-node/register@1.6.2)(@swc/core@1.3.37)(esbuild@0.17.14)(eslint@8.36.0)(nx@15.8.7)(prettier@2.8.4)(typescript@5.1.3): + /@nrwl/esbuild@15.8.5(@swc-node/register@1.6.2)(@swc/core@1.3.37)(esbuild@0.17.14)(eslint@8.36.0)(nx@15.8.7)(prettier@2.8.4)(typescript@5.2.2): resolution: {integrity: sha512-xWovcqJmPKE66uBIITYpEIkbDAf9qkm2SZg047s9WyewgzXXd6QwUd01mCycmy4xeVFockE1S9h5pCnw30eNeQ==} peerDependencies: esbuild: ~0.17.5 @@ -4182,9 +4182,9 @@ packages: esbuild: optional: true dependencies: - '@nrwl/devkit': 15.8.5(nx@15.8.7)(typescript@5.1.3) - '@nrwl/js': 15.8.5(@swc-node/register@1.6.2)(@swc/core@1.3.37)(eslint@8.36.0)(nx@15.8.7)(prettier@2.8.4)(typescript@5.1.3) - '@nrwl/workspace': 15.8.5(@swc-node/register@1.6.2)(@swc/core@1.3.37)(eslint@8.36.0)(prettier@2.8.4)(typescript@5.1.3) + '@nrwl/devkit': 15.8.5(nx@15.8.7)(typescript@5.2.2) + '@nrwl/js': 15.8.5(@swc-node/register@1.6.2)(@swc/core@1.3.37)(eslint@8.36.0)(nx@15.8.7)(prettier@2.8.4)(typescript@5.2.2) + '@nrwl/workspace': 15.8.5(@swc-node/register@1.6.2)(@swc/core@1.3.37)(eslint@8.36.0)(prettier@2.8.4)(typescript@5.2.2) chalk: 4.1.2 dotenv: 10.0.0 esbuild: 0.17.14 @@ -4204,7 +4204,7 @@ packages: - typescript dev: false - /@nrwl/eslint-plugin-nx@15.8.5(@typescript-eslint/parser@5.30.6)(eslint-config-prettier@8.8.0)(eslint@8.36.0)(nx@15.8.7)(typescript@5.1.3): + /@nrwl/eslint-plugin-nx@15.8.5(@typescript-eslint/parser@6.5.0)(eslint-config-prettier@8.8.0)(eslint@8.36.0)(nx@15.8.7)(typescript@5.2.2): resolution: {integrity: sha512-gfUD++6LhGPr6QtcFant41geZGyC5d9i2NZX7+vk4AQEttMiLgMu9t7hb1RUE8CUXX3UxsL0xM45YnJdxCIGww==} peerDependencies: '@typescript-eslint/parser': ^5.29.0 @@ -4213,9 +4213,9 @@ packages: eslint-config-prettier: optional: true dependencies: - '@nrwl/devkit': 15.8.5(nx@15.8.7)(typescript@5.1.3) - '@typescript-eslint/parser': 5.30.6(eslint@8.36.0)(typescript@5.1.3) - '@typescript-eslint/utils': 5.54.0(eslint@8.36.0)(typescript@5.1.3) + '@nrwl/devkit': 15.8.5(nx@15.8.7)(typescript@5.2.2) + '@typescript-eslint/parser': 6.5.0(eslint@8.36.0)(typescript@5.2.2) + '@typescript-eslint/utils': 5.54.0(eslint@8.36.0)(typescript@5.2.2) chalk: 4.1.2 confusing-browser-globals: 1.0.11 eslint-config-prettier: 8.8.0(eslint@8.36.0) @@ -4227,14 +4227,14 @@ packages: - typescript dev: true - /@nrwl/jest@15.8.5(@swc-node/register@1.6.2)(@swc/core@1.3.37)(@types/node@18.15.11)(eslint@8.36.0)(nx@15.8.7)(prettier@2.8.4)(ts-node@10.9.1)(typescript@5.1.3): + /@nrwl/jest@15.8.5(@swc-node/register@1.6.2)(@swc/core@1.3.37)(@types/node@18.15.11)(eslint@8.36.0)(nx@15.8.7)(prettier@2.8.4)(ts-node@10.9.1)(typescript@5.2.2): resolution: {integrity: sha512-19je0KLYqQnjGvjt8CN4jBnGquRnNnRUnH948atIRjW0AyV1INeHxqtrYUJKaOx3m8snQCa01FqJvJjVjl1oAg==} dependencies: '@jest/reporters': 28.1.1 '@jest/test-result': 28.1.1 - '@nrwl/devkit': 15.8.5(nx@15.8.7)(typescript@5.1.3) - '@nrwl/js': 15.8.5(@swc-node/register@1.6.2)(@swc/core@1.3.37)(eslint@8.36.0)(nx@15.8.7)(prettier@2.8.4)(typescript@5.1.3) - '@phenomnomnominal/tsquery': 4.1.1(typescript@5.1.3) + '@nrwl/devkit': 15.8.5(nx@15.8.7)(typescript@5.2.2) + '@nrwl/js': 15.8.5(@swc-node/register@1.6.2)(@swc/core@1.3.37)(eslint@8.36.0)(nx@15.8.7)(prettier@2.8.4)(typescript@5.2.2) + '@phenomnomnominal/tsquery': 4.1.1(typescript@5.2.2) chalk: 4.1.2 dotenv: 10.0.0 identity-obj-proxy: 3.0.0 @@ -4257,7 +4257,7 @@ packages: - ts-node - typescript - /@nrwl/js@15.8.5(@swc-node/register@1.6.2)(@swc/core@1.3.37)(eslint@8.36.0)(nx@15.8.7)(prettier@2.8.4)(typescript@5.1.3): + /@nrwl/js@15.8.5(@swc-node/register@1.6.2)(@swc/core@1.3.37)(eslint@8.36.0)(nx@15.8.7)(prettier@2.8.4)(typescript@5.2.2): resolution: {integrity: sha512-G9CADL++MQCAgiPTUuWs2YIGrhDKU92dVb39e37p/2WH75vEnMoYykW7nCHItGCGVa726INYBPjStqL6GxH8XQ==} dependencies: '@babel/core': 7.20.5 @@ -4267,9 +4267,9 @@ packages: '@babel/preset-env': 7.20.2(@babel/core@7.20.5) '@babel/preset-typescript': 7.21.0(@babel/core@7.20.5) '@babel/runtime': 7.21.0 - '@nrwl/devkit': 15.8.5(nx@15.8.7)(typescript@5.1.3) - '@nrwl/workspace': 15.8.5(@swc-node/register@1.6.2)(@swc/core@1.3.37)(eslint@8.36.0)(prettier@2.8.4)(typescript@5.1.3) - '@phenomnomnominal/tsquery': 4.1.1(typescript@5.1.3) + '@nrwl/devkit': 15.8.5(nx@15.8.7)(typescript@5.2.2) + '@nrwl/workspace': 15.8.5(@swc-node/register@1.6.2)(@swc/core@1.3.37)(eslint@8.36.0)(prettier@2.8.4)(typescript@5.2.2) + '@phenomnomnominal/tsquery': 4.1.1(typescript@5.2.2) babel-plugin-const-enum: 1.2.0(@babel/core@7.20.5) babel-plugin-macros: 2.8.0 babel-plugin-transform-typescript-metadata: 0.3.2(@babel/core@7.20.5) @@ -4293,7 +4293,7 @@ packages: - supports-color - typescript - /@nrwl/js@15.8.5(nx@15.8.5)(typescript@5.1.3): + /@nrwl/js@15.8.5(nx@15.8.5)(typescript@5.2.2): resolution: {integrity: sha512-G9CADL++MQCAgiPTUuWs2YIGrhDKU92dVb39e37p/2WH75vEnMoYykW7nCHItGCGVa726INYBPjStqL6GxH8XQ==} dependencies: '@babel/core': 7.20.5 @@ -4303,9 +4303,9 @@ packages: '@babel/preset-env': 7.20.2(@babel/core@7.20.5) '@babel/preset-typescript': 7.21.0(@babel/core@7.20.5) '@babel/runtime': 7.21.0 - '@nrwl/devkit': 15.8.5(nx@15.8.5)(typescript@5.1.3) - '@nrwl/workspace': 15.8.5(@swc-node/register@1.6.2)(@swc/core@1.3.37)(eslint@8.36.0)(prettier@2.8.4)(typescript@5.1.3) - '@phenomnomnominal/tsquery': 4.1.1(typescript@5.1.3) + '@nrwl/devkit': 15.8.5(nx@15.8.5)(typescript@5.2.2) + '@nrwl/workspace': 15.8.5(@swc-node/register@1.6.2)(@swc/core@1.3.37)(eslint@8.36.0)(prettier@2.8.4)(typescript@5.2.2) + '@phenomnomnominal/tsquery': 4.1.1(typescript@5.2.2) babel-plugin-const-enum: 1.2.0(@babel/core@7.20.5) babel-plugin-macros: 2.8.0 babel-plugin-transform-typescript-metadata: 0.3.2(@babel/core@7.20.5) @@ -4324,7 +4324,7 @@ packages: - supports-color - typescript - /@nrwl/js@15.8.8(@swc-node/register@1.6.2)(@swc/core@1.3.37)(eslint@8.36.0)(nx@15.8.7)(prettier@2.8.4)(typescript@5.1.3): + /@nrwl/js@15.8.8(@swc-node/register@1.6.2)(@swc/core@1.3.37)(eslint@8.36.0)(nx@15.8.7)(prettier@2.8.4)(typescript@5.2.2): resolution: {integrity: sha512-t/UZbivAEEPC1O0lEqxkhO5Aqp8tJWHA6fVlVOaoIdfut/lTQPIONgOXi/iArSuNTHehzBvZkfIQbH+3wdkdMA==} dependencies: '@babel/core': 7.20.5 @@ -4334,9 +4334,9 @@ packages: '@babel/preset-env': 7.20.2(@babel/core@7.20.5) '@babel/preset-typescript': 7.21.0(@babel/core@7.20.5) '@babel/runtime': 7.21.0 - '@nrwl/devkit': 15.8.8(nx@15.8.7)(typescript@5.1.3) - '@nrwl/workspace': 15.8.8(@swc-node/register@1.6.2)(@swc/core@1.3.37)(eslint@8.36.0)(prettier@2.8.4)(typescript@5.1.3) - '@phenomnomnominal/tsquery': 4.1.1(typescript@5.1.3) + '@nrwl/devkit': 15.8.8(nx@15.8.7)(typescript@5.2.2) + '@nrwl/workspace': 15.8.8(@swc-node/register@1.6.2)(@swc/core@1.3.37)(eslint@8.36.0)(prettier@2.8.4)(typescript@5.2.2) + '@phenomnomnominal/tsquery': 4.1.1(typescript@5.2.2) babel-plugin-const-enum: 1.2.0(@babel/core@7.20.5) babel-plugin-macros: 2.8.0 babel-plugin-transform-typescript-metadata: 0.3.2(@babel/core@7.20.5) @@ -4361,7 +4361,7 @@ packages: - typescript dev: true - /@nrwl/js@15.8.8(nx@15.8.8)(typescript@5.1.3): + /@nrwl/js@15.8.8(nx@15.8.8)(typescript@5.2.2): resolution: {integrity: sha512-t/UZbivAEEPC1O0lEqxkhO5Aqp8tJWHA6fVlVOaoIdfut/lTQPIONgOXi/iArSuNTHehzBvZkfIQbH+3wdkdMA==} dependencies: '@babel/core': 7.20.5 @@ -4371,9 +4371,9 @@ packages: '@babel/preset-env': 7.20.2(@babel/core@7.20.5) '@babel/preset-typescript': 7.21.0(@babel/core@7.20.5) '@babel/runtime': 7.21.0 - '@nrwl/devkit': 15.8.8(nx@15.8.8)(typescript@5.1.3) - '@nrwl/workspace': 15.8.8(@swc-node/register@1.6.2)(@swc/core@1.3.37)(eslint@8.36.0)(prettier@2.8.4)(typescript@5.1.3) - '@phenomnomnominal/tsquery': 4.1.1(typescript@5.1.3) + '@nrwl/devkit': 15.8.8(nx@15.8.8)(typescript@5.2.2) + '@nrwl/workspace': 15.8.8(@swc-node/register@1.6.2)(@swc/core@1.3.37)(eslint@8.36.0)(prettier@2.8.4)(typescript@5.2.2) + '@phenomnomnominal/tsquery': 4.1.1(typescript@5.2.2) babel-plugin-const-enum: 1.2.0(@babel/core@7.20.5) babel-plugin-macros: 2.8.0 babel-plugin-transform-typescript-metadata: 0.3.2(@babel/core@7.20.5) @@ -4393,7 +4393,7 @@ packages: - typescript dev: true - /@nrwl/linter@15.8.5(@swc-node/register@1.6.2)(@swc/core@1.3.37)(eslint@8.36.0)(nx@15.8.7)(prettier@2.8.4)(typescript@5.1.3): + /@nrwl/linter@15.8.5(@swc-node/register@1.6.2)(@swc/core@1.3.37)(eslint@8.36.0)(nx@15.8.7)(prettier@2.8.4)(typescript@5.2.2): resolution: {integrity: sha512-EJxIAME87JaE1Iao9S9/yfWdoC3IvKsstjGVQssVZmAoWaDVhW3c/EYDRkrk2c9SFLD+tascvxDV5OpXXRVhSA==} peerDependencies: eslint: ^8.0.0 @@ -4401,9 +4401,9 @@ packages: eslint: optional: true dependencies: - '@nrwl/devkit': 15.8.5(nx@15.8.7)(typescript@5.1.3) - '@nrwl/js': 15.8.5(@swc-node/register@1.6.2)(@swc/core@1.3.37)(eslint@8.36.0)(nx@15.8.7)(prettier@2.8.4)(typescript@5.1.3) - '@phenomnomnominal/tsquery': 4.1.1(typescript@5.1.3) + '@nrwl/devkit': 15.8.5(nx@15.8.7)(typescript@5.2.2) + '@nrwl/js': 15.8.5(@swc-node/register@1.6.2)(@swc/core@1.3.37)(eslint@8.36.0)(nx@15.8.7)(prettier@2.8.4)(typescript@5.2.2) + '@phenomnomnominal/tsquery': 4.1.1(typescript@5.2.2) eslint: 8.36.0 tmp: 0.2.1 tslib: 2.5.0 @@ -4417,7 +4417,7 @@ packages: - supports-color - typescript - /@nrwl/linter@15.8.5(eslint@8.36.0)(nx@15.8.5)(typescript@5.1.3): + /@nrwl/linter@15.8.5(eslint@8.36.0)(nx@15.8.5)(typescript@5.2.2): resolution: {integrity: sha512-EJxIAME87JaE1Iao9S9/yfWdoC3IvKsstjGVQssVZmAoWaDVhW3c/EYDRkrk2c9SFLD+tascvxDV5OpXXRVhSA==} peerDependencies: eslint: ^8.0.0 @@ -4425,9 +4425,9 @@ packages: eslint: optional: true dependencies: - '@nrwl/devkit': 15.8.5(nx@15.8.5)(typescript@5.1.3) - '@nrwl/js': 15.8.5(nx@15.8.5)(typescript@5.1.3) - '@phenomnomnominal/tsquery': 4.1.1(typescript@5.1.3) + '@nrwl/devkit': 15.8.5(nx@15.8.5)(typescript@5.2.2) + '@nrwl/js': 15.8.5(nx@15.8.5)(typescript@5.2.2) + '@phenomnomnominal/tsquery': 4.1.1(typescript@5.2.2) eslint: 8.36.0 tmp: 0.2.1 tslib: 2.5.0 @@ -4437,7 +4437,7 @@ packages: - supports-color - typescript - /@nrwl/linter@15.8.8(eslint@8.36.0)(nx@15.8.8)(typescript@5.1.3): + /@nrwl/linter@15.8.8(eslint@8.36.0)(nx@15.8.8)(typescript@5.2.2): resolution: {integrity: sha512-z8SXcOogqaDGQndNr7avuV5Gp6vzP7AKbjEAQSIyQSn4Ey6uUycGq3GJeX+kMfmUMWK2p+Bhhj62sO4CxzPV9Q==} peerDependencies: eslint: ^8.0.0 @@ -4445,9 +4445,9 @@ packages: eslint: optional: true dependencies: - '@nrwl/devkit': 15.8.8(nx@15.8.8)(typescript@5.1.3) - '@nrwl/js': 15.8.8(nx@15.8.8)(typescript@5.1.3) - '@phenomnomnominal/tsquery': 4.1.1(typescript@5.1.3) + '@nrwl/devkit': 15.8.8(nx@15.8.8)(typescript@5.2.2) + '@nrwl/js': 15.8.8(nx@15.8.8)(typescript@5.2.2) + '@phenomnomnominal/tsquery': 4.1.1(typescript@5.2.2) eslint: 8.36.0 tmp: 0.2.1 tslib: 2.5.0 @@ -4458,14 +4458,14 @@ packages: - typescript dev: true - /@nrwl/nest@15.8.5(@babel/core@7.20.5)(@swc-node/register@1.6.2)(@swc/core@1.3.37)(@types/node@18.15.11)(esbuild@0.17.14)(eslint@8.36.0)(nx@15.8.7)(prettier@2.8.4)(ts-node@10.9.1)(typescript@5.1.3): + /@nrwl/nest@15.8.5(@babel/core@7.20.5)(@swc-node/register@1.6.2)(@swc/core@1.3.37)(@types/node@18.15.11)(esbuild@0.17.14)(eslint@8.36.0)(nx@15.8.7)(prettier@2.8.4)(ts-node@10.9.1)(typescript@5.2.2): resolution: {integrity: sha512-xTN64T3Se7w39hLnyyDOaqxwpXUgDbJRk5VBAw1sIn+xGGopN5ajz0UNl2AthTb/1YUDItkewu82KQWOlL75Gw==} dependencies: - '@nestjs/schematics': 9.0.4(typescript@5.1.3) - '@nrwl/devkit': 15.8.5(nx@15.8.7)(typescript@5.1.3) - '@nrwl/js': 15.8.5(@swc-node/register@1.6.2)(@swc/core@1.3.37)(eslint@8.36.0)(nx@15.8.7)(prettier@2.8.4)(typescript@5.1.3) - '@nrwl/linter': 15.8.5(@swc-node/register@1.6.2)(@swc/core@1.3.37)(eslint@8.36.0)(nx@15.8.7)(prettier@2.8.4)(typescript@5.1.3) - '@nrwl/node': 15.8.5(@babel/core@7.20.5)(@swc-node/register@1.6.2)(@swc/core@1.3.37)(@types/node@18.15.11)(esbuild@0.17.14)(eslint@8.36.0)(nx@15.8.7)(prettier@2.8.4)(ts-node@10.9.1)(typescript@5.1.3) + '@nestjs/schematics': 9.0.4(typescript@5.2.2) + '@nrwl/devkit': 15.8.5(nx@15.8.7)(typescript@5.2.2) + '@nrwl/js': 15.8.5(@swc-node/register@1.6.2)(@swc/core@1.3.37)(eslint@8.36.0)(nx@15.8.7)(prettier@2.8.4)(typescript@5.2.2) + '@nrwl/linter': 15.8.5(@swc-node/register@1.6.2)(@swc/core@1.3.37)(eslint@8.36.0)(nx@15.8.7)(prettier@2.8.4)(typescript@5.2.2) + '@nrwl/node': 15.8.5(@babel/core@7.20.5)(@swc-node/register@1.6.2)(@swc/core@1.3.37)(@types/node@18.15.11)(esbuild@0.17.14)(eslint@8.36.0)(nx@15.8.7)(prettier@2.8.4)(ts-node@10.9.1)(typescript@5.2.2) enquirer: 2.3.6 transitivePeerDependencies: - '@babel/core' @@ -4498,20 +4498,20 @@ packages: - webpack-cli dev: true - /@nrwl/next@15.8.5(@babel/core@7.20.5)(@swc-node/register@1.6.2)(@swc/core@1.3.37)(@types/node@18.15.11)(cypress@12.8.1)(esbuild@0.17.14)(eslint@8.36.0)(next@13.2.4)(nx@15.8.7)(prettier@2.8.4)(typescript@5.1.3)(webpack@5.86.0): + /@nrwl/next@15.8.5(@babel/core@7.20.5)(@swc-node/register@1.6.2)(@swc/core@1.3.37)(@types/node@18.15.11)(cypress@12.8.1)(esbuild@0.17.14)(eslint@8.36.0)(next@13.2.4)(nx@15.8.7)(prettier@2.8.4)(typescript@5.2.2)(webpack@5.86.0): resolution: {integrity: sha512-Ch9gHgQfZTloC/gPqkMPmBW6Ec486Ux6IU3bt7RzsN0I+y6WUzmDOVJLg44GQP01R3xBrUyR++Y0+w6HPrx3DQ==} peerDependencies: next: ^13.0.0 dependencies: '@babel/plugin-proposal-decorators': 7.21.0(@babel/core@7.20.5) - '@nrwl/cypress': 15.8.5(@swc-node/register@1.6.2)(@swc/core@1.3.37)(cypress@12.8.1)(eslint@8.36.0)(nx@15.8.7)(prettier@2.8.4)(typescript@5.1.3) - '@nrwl/devkit': 15.8.5(nx@15.8.7)(typescript@5.1.3) - '@nrwl/jest': 15.8.5(@swc-node/register@1.6.2)(@swc/core@1.3.37)(@types/node@18.15.11)(eslint@8.36.0)(nx@15.8.7)(prettier@2.8.4)(ts-node@10.9.1)(typescript@5.1.3) - '@nrwl/js': 15.8.5(@swc-node/register@1.6.2)(@swc/core@1.3.37)(eslint@8.36.0)(nx@15.8.7)(prettier@2.8.4)(typescript@5.1.3) - '@nrwl/linter': 15.8.5(@swc-node/register@1.6.2)(@swc/core@1.3.37)(eslint@8.36.0)(nx@15.8.7)(prettier@2.8.4)(typescript@5.1.3) - '@nrwl/react': 15.8.5(@swc-node/register@1.6.2)(@swc/core@1.3.37)(eslint@8.36.0)(nx@15.8.7)(prettier@2.8.4)(typescript@5.1.3) - '@nrwl/webpack': 15.8.5(@babel/core@7.20.5)(@swc-node/register@1.6.2)(@swc/core@1.3.37)(@types/node@18.15.11)(esbuild@0.17.14)(eslint@8.36.0)(nx@15.8.7)(prettier@2.8.4)(typescript@5.1.3) - '@nrwl/workspace': 15.8.5(@swc-node/register@1.6.2)(@swc/core@1.3.37)(eslint@8.36.0)(prettier@2.8.4)(typescript@5.1.3) + '@nrwl/cypress': 15.8.5(@swc-node/register@1.6.2)(@swc/core@1.3.37)(cypress@12.8.1)(eslint@8.36.0)(nx@15.8.7)(prettier@2.8.4)(typescript@5.2.2) + '@nrwl/devkit': 15.8.5(nx@15.8.7)(typescript@5.2.2) + '@nrwl/jest': 15.8.5(@swc-node/register@1.6.2)(@swc/core@1.3.37)(@types/node@18.15.11)(eslint@8.36.0)(nx@15.8.7)(prettier@2.8.4)(ts-node@10.9.1)(typescript@5.2.2) + '@nrwl/js': 15.8.5(@swc-node/register@1.6.2)(@swc/core@1.3.37)(eslint@8.36.0)(nx@15.8.7)(prettier@2.8.4)(typescript@5.2.2) + '@nrwl/linter': 15.8.5(@swc-node/register@1.6.2)(@swc/core@1.3.37)(eslint@8.36.0)(nx@15.8.7)(prettier@2.8.4)(typescript@5.2.2) + '@nrwl/react': 15.8.5(@swc-node/register@1.6.2)(@swc/core@1.3.37)(eslint@8.36.0)(nx@15.8.7)(prettier@2.8.4)(typescript@5.2.2) + '@nrwl/webpack': 15.8.5(@babel/core@7.20.5)(@swc-node/register@1.6.2)(@swc/core@1.3.37)(@types/node@18.15.11)(esbuild@0.17.14)(eslint@8.36.0)(nx@15.8.7)(prettier@2.8.4)(typescript@5.2.2) + '@nrwl/workspace': 15.8.5(@swc-node/register@1.6.2)(@swc/core@1.3.37)(eslint@8.36.0)(prettier@2.8.4)(typescript@5.2.2) '@svgr/webpack': 6.5.1 chalk: 4.1.2 dotenv: 10.0.0 @@ -4519,7 +4519,7 @@ packages: ignore: 5.2.4 next: 13.2.4(@babel/core@7.20.5)(react-dom@18.2.0)(react@18.2.0) semver: 7.3.4 - ts-node: 10.9.1(@swc/core@1.3.37)(@types/node@18.15.11)(typescript@5.1.3) + ts-node: 10.9.1(@swc/core@1.3.37)(@types/node@18.15.11)(typescript@5.2.2) tsconfig-paths: 4.1.2 url-loader: 4.1.1(webpack@5.86.0) webpack-merge: 5.8.0 @@ -4555,15 +4555,15 @@ packages: - webpack-cli dev: false - /@nrwl/node@15.8.5(@babel/core@7.20.5)(@swc-node/register@1.6.2)(@swc/core@1.3.37)(@types/node@18.15.11)(esbuild@0.17.14)(eslint@8.36.0)(nx@15.8.7)(prettier@2.8.4)(ts-node@10.9.1)(typescript@5.1.3): + /@nrwl/node@15.8.5(@babel/core@7.20.5)(@swc-node/register@1.6.2)(@swc/core@1.3.37)(@types/node@18.15.11)(esbuild@0.17.14)(eslint@8.36.0)(nx@15.8.7)(prettier@2.8.4)(ts-node@10.9.1)(typescript@5.2.2): resolution: {integrity: sha512-d3SsuplX3/GS6oXnwc1u9aR3n4A9CXglqHCtRVppYATVTHvYS6NODjjwXonu7m/rnyXpirqueWQ9BbGvEej6tw==} dependencies: - '@nrwl/devkit': 15.8.5(nx@15.8.7)(typescript@5.1.3) - '@nrwl/jest': 15.8.5(@swc-node/register@1.6.2)(@swc/core@1.3.37)(@types/node@18.15.11)(eslint@8.36.0)(nx@15.8.7)(prettier@2.8.4)(ts-node@10.9.1)(typescript@5.1.3) - '@nrwl/js': 15.8.5(@swc-node/register@1.6.2)(@swc/core@1.3.37)(eslint@8.36.0)(nx@15.8.7)(prettier@2.8.4)(typescript@5.1.3) - '@nrwl/linter': 15.8.5(@swc-node/register@1.6.2)(@swc/core@1.3.37)(eslint@8.36.0)(nx@15.8.7)(prettier@2.8.4)(typescript@5.1.3) - '@nrwl/webpack': 15.8.5(@babel/core@7.20.5)(@swc-node/register@1.6.2)(@swc/core@1.3.37)(@types/node@18.15.11)(esbuild@0.17.14)(eslint@8.36.0)(nx@15.8.7)(prettier@2.8.4)(typescript@5.1.3) - '@nrwl/workspace': 15.8.5(@swc-node/register@1.6.2)(@swc/core@1.3.37)(eslint@8.36.0)(prettier@2.8.4)(typescript@5.1.3) + '@nrwl/devkit': 15.8.5(nx@15.8.7)(typescript@5.2.2) + '@nrwl/jest': 15.8.5(@swc-node/register@1.6.2)(@swc/core@1.3.37)(@types/node@18.15.11)(eslint@8.36.0)(nx@15.8.7)(prettier@2.8.4)(ts-node@10.9.1)(typescript@5.2.2) + '@nrwl/js': 15.8.5(@swc-node/register@1.6.2)(@swc/core@1.3.37)(eslint@8.36.0)(nx@15.8.7)(prettier@2.8.4)(typescript@5.2.2) + '@nrwl/linter': 15.8.5(@swc-node/register@1.6.2)(@swc/core@1.3.37)(eslint@8.36.0)(nx@15.8.7)(prettier@2.8.4)(typescript@5.2.2) + '@nrwl/webpack': 15.8.5(@babel/core@7.20.5)(@swc-node/register@1.6.2)(@swc/core@1.3.37)(@types/node@18.15.11)(esbuild@0.17.14)(eslint@8.36.0)(nx@15.8.7)(prettier@2.8.4)(typescript@5.2.2) + '@nrwl/workspace': 15.8.5(@swc-node/register@1.6.2)(@swc/core@1.3.37)(eslint@8.36.0)(prettier@2.8.4)(typescript@5.2.2) tslib: 2.5.0 transitivePeerDependencies: - '@babel/core' @@ -4770,13 +4770,13 @@ packages: dev: true optional: true - /@nrwl/nx-plugin@15.8.5(@swc-node/register@1.6.2)(@swc/core@1.3.37)(@types/node@18.15.11)(eslint@8.36.0)(nx@15.8.7)(prettier@2.8.4)(ts-node@10.9.1)(typescript@5.1.3): + /@nrwl/nx-plugin@15.8.5(@swc-node/register@1.6.2)(@swc/core@1.3.37)(@types/node@18.15.11)(eslint@8.36.0)(nx@15.8.7)(prettier@2.8.4)(ts-node@10.9.1)(typescript@5.2.2): resolution: {integrity: sha512-sZZz6fDTAgVEcNAtWkapBisDGG5PTGgTxcCt3y/J48J5OQSlowyNGwLLT4dgOT2gWdsBQxKFZqZkrYRC9vBSUw==} dependencies: - '@nrwl/devkit': 15.8.5(nx@15.8.7)(typescript@5.1.3) - '@nrwl/jest': 15.8.5(@swc-node/register@1.6.2)(@swc/core@1.3.37)(@types/node@18.15.11)(eslint@8.36.0)(nx@15.8.7)(prettier@2.8.4)(ts-node@10.9.1)(typescript@5.1.3) - '@nrwl/js': 15.8.5(@swc-node/register@1.6.2)(@swc/core@1.3.37)(eslint@8.36.0)(nx@15.8.7)(prettier@2.8.4)(typescript@5.1.3) - '@nrwl/linter': 15.8.5(@swc-node/register@1.6.2)(@swc/core@1.3.37)(eslint@8.36.0)(nx@15.8.7)(prettier@2.8.4)(typescript@5.1.3) + '@nrwl/devkit': 15.8.5(nx@15.8.7)(typescript@5.2.2) + '@nrwl/jest': 15.8.5(@swc-node/register@1.6.2)(@swc/core@1.3.37)(@types/node@18.15.11)(eslint@8.36.0)(nx@15.8.7)(prettier@2.8.4)(ts-node@10.9.1)(typescript@5.2.2) + '@nrwl/js': 15.8.5(@swc-node/register@1.6.2)(@swc/core@1.3.37)(eslint@8.36.0)(nx@15.8.7)(prettier@2.8.4)(typescript@5.2.2) + '@nrwl/linter': 15.8.5(@swc-node/register@1.6.2)(@swc/core@1.3.37)(eslint@8.36.0)(nx@15.8.7)(prettier@2.8.4)(typescript@5.2.2) dotenv: 10.0.0 fs-extra: 11.1.1 tslib: 2.5.0 @@ -4845,14 +4845,14 @@ packages: dev: true optional: true - /@nrwl/react@15.8.5(@swc-node/register@1.6.2)(@swc/core@1.3.37)(eslint@8.36.0)(nx@15.8.7)(prettier@2.8.4)(typescript@5.1.3): + /@nrwl/react@15.8.5(@swc-node/register@1.6.2)(@swc/core@1.3.37)(eslint@8.36.0)(nx@15.8.7)(prettier@2.8.4)(typescript@5.2.2): resolution: {integrity: sha512-D/veRYJ4dZ1JQtJ8GnZ2tkVNVuox4bbRAQm6MH+xor1Z8kcIq6SZtFp03T5IPgcVNXAJjjh1tMhnMcHe5hZkmg==} dependencies: - '@nrwl/devkit': 15.8.5(nx@15.8.7)(typescript@5.1.3) - '@nrwl/js': 15.8.5(@swc-node/register@1.6.2)(@swc/core@1.3.37)(eslint@8.36.0)(nx@15.8.7)(prettier@2.8.4)(typescript@5.1.3) - '@nrwl/linter': 15.8.5(@swc-node/register@1.6.2)(@swc/core@1.3.37)(eslint@8.36.0)(nx@15.8.7)(prettier@2.8.4)(typescript@5.1.3) - '@nrwl/workspace': 15.8.5(@swc-node/register@1.6.2)(@swc/core@1.3.37)(eslint@8.36.0)(prettier@2.8.4)(typescript@5.1.3) - '@phenomnomnominal/tsquery': 4.1.1(typescript@5.1.3) + '@nrwl/devkit': 15.8.5(nx@15.8.7)(typescript@5.2.2) + '@nrwl/js': 15.8.5(@swc-node/register@1.6.2)(@swc/core@1.3.37)(eslint@8.36.0)(nx@15.8.7)(prettier@2.8.4)(typescript@5.2.2) + '@nrwl/linter': 15.8.5(@swc-node/register@1.6.2)(@swc/core@1.3.37)(eslint@8.36.0)(nx@15.8.7)(prettier@2.8.4)(typescript@5.2.2) + '@nrwl/workspace': 15.8.5(@swc-node/register@1.6.2)(@swc/core@1.3.37)(eslint@8.36.0)(prettier@2.8.4)(typescript@5.2.2) + '@phenomnomnominal/tsquery': 4.1.1(typescript@5.2.2) chalk: 4.1.2 minimatch: 3.0.5 transitivePeerDependencies: @@ -4866,12 +4866,12 @@ packages: - supports-color - typescript - /@nrwl/rollup@15.8.5(@babel/core@7.20.5)(@swc-node/register@1.6.2)(@swc/core@1.3.37)(eslint@8.36.0)(nx@15.8.7)(prettier@2.8.4)(ts-node@10.9.1)(typescript@5.1.3): + /@nrwl/rollup@15.8.5(@babel/core@7.20.5)(@swc-node/register@1.6.2)(@swc/core@1.3.37)(eslint@8.36.0)(nx@15.8.7)(prettier@2.8.4)(ts-node@10.9.1)(typescript@5.2.2): resolution: {integrity: sha512-eDcRorjCFwyFTzVil2RptoOa1peo3m/+LAA1BL8U7awWTdDrmtpQ5pcPBu8IQO9ZYOk4kaUQP63lIptg1cqX+g==} dependencies: - '@nrwl/devkit': 15.8.5(nx@15.8.7)(typescript@5.1.3) - '@nrwl/js': 15.8.5(@swc-node/register@1.6.2)(@swc/core@1.3.37)(eslint@8.36.0)(nx@15.8.7)(prettier@2.8.4)(typescript@5.1.3) - '@nrwl/workspace': 15.8.5(@swc-node/register@1.6.2)(@swc/core@1.3.37)(eslint@8.36.0)(prettier@2.8.4)(typescript@5.1.3) + '@nrwl/devkit': 15.8.5(nx@15.8.7)(typescript@5.2.2) + '@nrwl/js': 15.8.5(@swc-node/register@1.6.2)(@swc/core@1.3.37)(eslint@8.36.0)(nx@15.8.7)(prettier@2.8.4)(typescript@5.2.2) + '@nrwl/workspace': 15.8.5(@swc-node/register@1.6.2)(@swc/core@1.3.37)(eslint@8.36.0)(prettier@2.8.4)(typescript@5.2.2) '@rollup/plugin-babel': 5.3.1(@babel/core@7.20.5)(rollup@2.79.1) '@rollup/plugin-commonjs': 20.0.0(rollup@2.79.1) '@rollup/plugin-image': 2.1.1(rollup@2.79.1) @@ -4886,7 +4886,7 @@ packages: rollup-plugin-copy: 3.4.0 rollup-plugin-peer-deps-external: 2.2.4(rollup@2.79.1) rollup-plugin-postcss: 4.0.2(postcss@8.4.19)(ts-node@10.9.1) - rollup-plugin-typescript2: 0.34.1(rollup@2.79.1)(typescript@5.1.3) + rollup-plugin-typescript2: 0.34.1(rollup@2.79.1)(typescript@5.2.2) rxjs: 6.6.7 tslib: 2.5.0 transitivePeerDependencies: @@ -4935,16 +4935,16 @@ packages: - debug dev: true - /@nrwl/vite@15.8.8(@swc-node/register@1.6.2)(@swc/core@1.3.37)(eslint@8.36.0)(nx@15.8.7)(prettier@2.8.4)(typescript@5.1.3)(vite@4.2.1)(vitest@0.29.8): + /@nrwl/vite@15.8.8(@swc-node/register@1.6.2)(@swc/core@1.3.37)(eslint@8.36.0)(nx@15.8.7)(prettier@2.8.4)(typescript@5.2.2)(vite@4.2.1)(vitest@0.29.8): resolution: {integrity: sha512-WFKdv5jyx2Zu1cHmuOewhM0URR1gwGrc1zOGM3eGCSN28EFvIWh9V1ygA3swoPiZCHdjhxGlaZGxEyhT4SYXdQ==} peerDependencies: vite: ^4.0.1 vitest: '>=0.25.8 <1.0.0' dependencies: - '@nrwl/devkit': 15.8.8(nx@15.8.7)(typescript@5.1.3) - '@nrwl/js': 15.8.8(@swc-node/register@1.6.2)(@swc/core@1.3.37)(eslint@8.36.0)(nx@15.8.7)(prettier@2.8.4)(typescript@5.1.3) - '@nrwl/workspace': 15.8.8(@swc-node/register@1.6.2)(@swc/core@1.3.37)(eslint@8.36.0)(prettier@2.8.4)(typescript@5.1.3) - '@phenomnomnominal/tsquery': 4.1.1(typescript@5.1.3) + '@nrwl/devkit': 15.8.8(nx@15.8.7)(typescript@5.2.2) + '@nrwl/js': 15.8.8(@swc-node/register@1.6.2)(@swc/core@1.3.37)(eslint@8.36.0)(nx@15.8.7)(prettier@2.8.4)(typescript@5.2.2) + '@nrwl/workspace': 15.8.8(@swc-node/register@1.6.2)(@swc/core@1.3.37)(eslint@8.36.0)(prettier@2.8.4)(typescript@5.2.2) + '@phenomnomnominal/tsquery': 4.1.1(typescript@5.2.2) '@swc/helpers': 0.4.14 dotenv: 10.0.0 enquirer: 2.3.6 @@ -4962,16 +4962,16 @@ packages: - typescript dev: true - /@nrwl/web@15.8.5(@babel/core@7.20.5)(@swc-node/register@1.6.2)(@swc/core@1.3.37)(@types/node@18.15.11)(cypress@12.8.1)(eslint@8.36.0)(nx@15.8.7)(prettier@2.8.4)(ts-node@10.9.1)(typescript@5.1.3): + /@nrwl/web@15.8.5(@babel/core@7.20.5)(@swc-node/register@1.6.2)(@swc/core@1.3.37)(@types/node@18.15.11)(cypress@12.8.1)(eslint@8.36.0)(nx@15.8.7)(prettier@2.8.4)(ts-node@10.9.1)(typescript@5.2.2): resolution: {integrity: sha512-bhmxVeQNELr2oNZ3A76sGUR+QM+4OVk/nd2vRavOMLqBnNRPa6CNdfyo5cfhn1/bGbZZipR4tneHL/F/HI3RPg==} dependencies: - '@nrwl/cypress': 15.8.5(@swc-node/register@1.6.2)(@swc/core@1.3.37)(cypress@12.8.1)(eslint@8.36.0)(nx@15.8.7)(prettier@2.8.4)(typescript@5.1.3) - '@nrwl/devkit': 15.8.5(nx@15.8.7)(typescript@5.1.3) - '@nrwl/jest': 15.8.5(@swc-node/register@1.6.2)(@swc/core@1.3.37)(@types/node@18.15.11)(eslint@8.36.0)(nx@15.8.7)(prettier@2.8.4)(ts-node@10.9.1)(typescript@5.1.3) - '@nrwl/js': 15.8.5(@swc-node/register@1.6.2)(@swc/core@1.3.37)(eslint@8.36.0)(nx@15.8.7)(prettier@2.8.4)(typescript@5.1.3) - '@nrwl/linter': 15.8.5(@swc-node/register@1.6.2)(@swc/core@1.3.37)(eslint@8.36.0)(nx@15.8.7)(prettier@2.8.4)(typescript@5.1.3) - '@nrwl/rollup': 15.8.5(@babel/core@7.20.5)(@swc-node/register@1.6.2)(@swc/core@1.3.37)(eslint@8.36.0)(nx@15.8.7)(prettier@2.8.4)(ts-node@10.9.1)(typescript@5.1.3) - '@nrwl/workspace': 15.8.5(@swc-node/register@1.6.2)(@swc/core@1.3.37)(eslint@8.36.0)(prettier@2.8.4)(typescript@5.1.3) + '@nrwl/cypress': 15.8.5(@swc-node/register@1.6.2)(@swc/core@1.3.37)(cypress@12.8.1)(eslint@8.36.0)(nx@15.8.7)(prettier@2.8.4)(typescript@5.2.2) + '@nrwl/devkit': 15.8.5(nx@15.8.7)(typescript@5.2.2) + '@nrwl/jest': 15.8.5(@swc-node/register@1.6.2)(@swc/core@1.3.37)(@types/node@18.15.11)(eslint@8.36.0)(nx@15.8.7)(prettier@2.8.4)(ts-node@10.9.1)(typescript@5.2.2) + '@nrwl/js': 15.8.5(@swc-node/register@1.6.2)(@swc/core@1.3.37)(eslint@8.36.0)(nx@15.8.7)(prettier@2.8.4)(typescript@5.2.2) + '@nrwl/linter': 15.8.5(@swc-node/register@1.6.2)(@swc/core@1.3.37)(eslint@8.36.0)(nx@15.8.7)(prettier@2.8.4)(typescript@5.2.2) + '@nrwl/rollup': 15.8.5(@babel/core@7.20.5)(@swc-node/register@1.6.2)(@swc/core@1.3.37)(eslint@8.36.0)(nx@15.8.7)(prettier@2.8.4)(ts-node@10.9.1)(typescript@5.2.2) + '@nrwl/workspace': 15.8.5(@swc-node/register@1.6.2)(@swc/core@1.3.37)(eslint@8.36.0)(prettier@2.8.4)(typescript@5.2.2) chalk: 4.1.2 chokidar: 3.5.3 http-server: 14.1.1 @@ -4995,12 +4995,12 @@ packages: - typescript dev: true - /@nrwl/webpack@15.8.5(@babel/core@7.20.5)(@swc-node/register@1.6.2)(@swc/core@1.3.37)(@types/node@18.15.11)(esbuild@0.17.14)(eslint@8.36.0)(nx@15.8.7)(prettier@2.8.4)(typescript@5.1.3): + /@nrwl/webpack@15.8.5(@babel/core@7.20.5)(@swc-node/register@1.6.2)(@swc/core@1.3.37)(@types/node@18.15.11)(esbuild@0.17.14)(eslint@8.36.0)(nx@15.8.7)(prettier@2.8.4)(typescript@5.2.2): resolution: {integrity: sha512-oN0ZCK6Bak8w5YOpyBxQRNxGwNbq31XneRvKPb9gSs71eJZtqLr5wwANfOOHe4m43CgDayp+nVOCQMNhsdxNFg==} dependencies: - '@nrwl/devkit': 15.8.5(nx@15.8.7)(typescript@5.1.3) - '@nrwl/js': 15.8.5(@swc-node/register@1.6.2)(@swc/core@1.3.37)(eslint@8.36.0)(nx@15.8.7)(prettier@2.8.4)(typescript@5.1.3) - '@nrwl/workspace': 15.8.5(@swc-node/register@1.6.2)(@swc/core@1.3.37)(eslint@8.36.0)(prettier@2.8.4)(typescript@5.1.3) + '@nrwl/devkit': 15.8.5(nx@15.8.7)(typescript@5.2.2) + '@nrwl/js': 15.8.5(@swc-node/register@1.6.2)(@swc/core@1.3.37)(eslint@8.36.0)(nx@15.8.7)(prettier@2.8.4)(typescript@5.2.2) + '@nrwl/workspace': 15.8.5(@swc-node/register@1.6.2)(@swc/core@1.3.37)(eslint@8.36.0)(prettier@2.8.4)(typescript@5.2.2) autoprefixer: 10.4.13(postcss@8.4.19) babel-loader: 9.1.2(@babel/core@7.20.5)(webpack@5.75.0) chalk: 4.1.2 @@ -5010,7 +5010,7 @@ packages: css-minimizer-webpack-plugin: 3.4.1(esbuild@0.17.14)(webpack@5.75.0) dotenv: 10.0.0 file-loader: 6.2.0(webpack@5.75.0) - fork-ts-checker-webpack-plugin: 7.2.13(typescript@5.1.3)(webpack@5.75.0) + fork-ts-checker-webpack-plugin: 7.2.13(typescript@5.2.2)(webpack@5.75.0) ignore: 5.2.4 less: 4.1.3 less-loader: 11.1.0(less@4.1.3)(webpack@5.75.0) @@ -5029,8 +5029,8 @@ packages: stylus: 0.55.0 stylus-loader: 7.1.0(stylus@0.55.0)(webpack@5.75.0) terser-webpack-plugin: 5.3.6(@swc/core@1.3.37)(esbuild@0.17.14)(webpack@5.75.0) - ts-loader: 9.4.2(typescript@5.1.3)(webpack@5.75.0) - ts-node: 10.9.1(@swc/core@1.3.37)(@types/node@18.15.11)(typescript@5.1.3) + ts-loader: 9.4.2(typescript@5.2.2)(webpack@5.75.0) + ts-node: 10.9.1(@swc/core@1.3.37)(@types/node@18.15.11)(typescript@5.2.2) tsconfig-paths: 4.1.2 tsconfig-paths-webpack-plugin: 4.0.0 tslib: 2.5.0 @@ -5065,7 +5065,7 @@ packages: - vue-template-compiler - webpack-cli - /@nrwl/workspace@15.8.5(@swc-node/register@1.6.2)(@swc/core@1.3.37)(eslint@8.36.0)(prettier@2.8.4)(typescript@5.1.3): + /@nrwl/workspace@15.8.5(@swc-node/register@1.6.2)(@swc/core@1.3.37)(eslint@8.36.0)(prettier@2.8.4)(typescript@5.2.2): resolution: {integrity: sha512-+BGJDbATbwpk+3FkdBzdIziN/XKku55SEGg3uyH+JnK0sjmHvvS7mvPiYLRy91tOyF4QXnnWL6PuT+Z9KK8POQ==} peerDependencies: prettier: ^2.6.2 @@ -5073,8 +5073,8 @@ packages: prettier: optional: true dependencies: - '@nrwl/devkit': 15.8.5(nx@15.8.5)(typescript@5.1.3) - '@nrwl/linter': 15.8.5(eslint@8.36.0)(nx@15.8.5)(typescript@5.1.3) + '@nrwl/devkit': 15.8.5(nx@15.8.5)(typescript@5.2.2) + '@nrwl/linter': 15.8.5(eslint@8.36.0)(nx@15.8.5)(typescript@5.2.2) '@parcel/watcher': 2.0.4 chalk: 4.1.2 chokidar: 3.5.3 @@ -5105,7 +5105,7 @@ packages: - supports-color - typescript - /@nrwl/workspace@15.8.8(@swc-node/register@1.6.2)(@swc/core@1.3.37)(eslint@8.36.0)(prettier@2.8.4)(typescript@5.1.3): + /@nrwl/workspace@15.8.8(@swc-node/register@1.6.2)(@swc/core@1.3.37)(eslint@8.36.0)(prettier@2.8.4)(typescript@5.2.2): resolution: {integrity: sha512-KZeDG7mR36KUqu2GC4IECxZKF8d8+1HX7rgxNDTwPhVVyqRP2fUh90oiKfuWz5KpGHU5EB08Y7taV5t4qcGD6g==} peerDependencies: prettier: ^2.6.2 @@ -5113,8 +5113,8 @@ packages: prettier: optional: true dependencies: - '@nrwl/devkit': 15.8.8(nx@15.8.8)(typescript@5.1.3) - '@nrwl/linter': 15.8.8(eslint@8.36.0)(nx@15.8.8)(typescript@5.1.3) + '@nrwl/devkit': 15.8.8(nx@15.8.8)(typescript@5.2.2) + '@nrwl/linter': 15.8.8(eslint@8.36.0)(nx@15.8.8)(typescript@5.2.2) '@parcel/watcher': 2.0.4 chalk: 4.1.2 chokidar: 3.5.3 @@ -5157,10 +5157,10 @@ packages: transitivePeerDependencies: - encoding - /@nxext/sveltekit@14.0.0-next.2(nx@15.8.7)(typescript@5.1.3): + /@nxext/sveltekit@14.0.0-next.2(nx@15.8.7)(typescript@5.2.2): resolution: {integrity: sha512-6+5RCKrN6j8EA4ozh7vt5BnHPynJF/vqX4+BpLpAqzDmCSo/hcTmfUzygnTaPFYwhbdBBgizFkzg1KyPtH2J5Q==} dependencies: - '@nrwl/devkit': 14.7.17(nx@15.8.7)(typescript@5.1.3) + '@nrwl/devkit': 14.7.17(nx@15.8.7)(typescript@5.2.2) transitivePeerDependencies: - nx - typescript @@ -5178,13 +5178,13 @@ packages: node-addon-api: 3.2.1 node-gyp-build: 4.6.0 - /@phenomnomnominal/tsquery@4.1.1(typescript@5.1.3): + /@phenomnomnominal/tsquery@4.1.1(typescript@5.2.2): resolution: {integrity: sha512-jjMmK1tnZbm1Jq5a7fBliM4gQwjxMU7TFoRNwIyzwlO+eHPRCFv/Nv+H/Gi1jc3WR7QURG8D5d0Tn12YGrUqBQ==} peerDependencies: typescript: ^3 || ^4 dependencies: esquery: 1.5.0 - typescript: 5.1.3 + typescript: 5.2.2 /@pkgr/utils@2.3.1: resolution: {integrity: sha512-wfzX8kc1PMyUILA+1Z/EqoE4UCXGy0iRGMhPwdfae1+f0OXlLqCk+By+aMzgJBzR9AzS4CDizioG6Ss1gvAFJw==} @@ -5897,7 +5897,7 @@ packages: dependencies: '@swc/core': 1.3.37 - /@swc-node/register@1.6.2(@swc/core@1.3.37)(typescript@5.1.3): + /@swc-node/register@1.6.2(@swc/core@1.3.37)(typescript@5.2.2): resolution: {integrity: sha512-7kzUOrw5RhSW23VU9RtEOlH71MQZ4cfUPgu245f3tKjYIu1CkxNJVX48FAiGJ6+3QgJMXLr1anT9FeeCmX12xw==} peerDependencies: '@swc/core': '>= 1.3' @@ -5910,7 +5910,7 @@ packages: debug: 4.3.4(supports-color@8.1.1) pirates: 4.0.5 tslib: 2.5.0 - typescript: 5.1.3 + typescript: 5.2.2 transitivePeerDependencies: - supports-color @@ -6145,7 +6145,7 @@ packages: peerDependencies: '@nrwl/workspace': '>=13.0.0' dependencies: - '@nrwl/workspace': 15.8.5(@swc-node/register@1.6.2)(@swc/core@1.3.37)(eslint@8.36.0)(prettier@2.8.4)(typescript@5.1.3) + '@nrwl/workspace': 15.8.5(@swc-node/register@1.6.2)(@swc/core@1.3.37)(eslint@8.36.0)(prettier@2.8.4)(typescript@5.2.2) dev: true /@tryfabric/martian@1.2.4: @@ -6706,7 +6706,7 @@ packages: resolution: {integrity: sha512-RRHc1+8Hc5mf/2lZKnom6kCnqcNS07s8keahniWTOva0KELF6RgDJmaEcvGEKUUJgN4UgessmEsWuidaOycIOw==} dev: false - /@typescript-eslint/eslint-plugin@5.30.6(@typescript-eslint/parser@5.30.6)(eslint@8.36.0)(typescript@5.1.3): + /@typescript-eslint/eslint-plugin@5.30.6(@typescript-eslint/parser@6.5.0)(eslint@8.36.0)(typescript@5.2.2): resolution: {integrity: sha512-J4zYMIhgrx4MgnZrSDD7sEnQp7FmhKNOaqaOpaoQ/SfdMfRB/0yvK74hTnvH+VQxndZynqs5/Hn4t+2/j9bADg==} engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0} peerDependencies: @@ -6717,24 +6717,24 @@ packages: typescript: optional: true dependencies: - '@typescript-eslint/parser': 5.30.6(eslint@8.36.0)(typescript@5.1.3) + '@typescript-eslint/parser': 6.5.0(eslint@8.36.0)(typescript@5.2.2) '@typescript-eslint/scope-manager': 5.30.6 - '@typescript-eslint/type-utils': 5.30.6(eslint@8.36.0)(typescript@5.1.3) - '@typescript-eslint/utils': 5.30.6(eslint@8.36.0)(typescript@5.1.3) + '@typescript-eslint/type-utils': 5.30.6(eslint@8.36.0)(typescript@5.2.2) + '@typescript-eslint/utils': 5.30.6(eslint@8.36.0)(typescript@5.2.2) debug: 4.3.4(supports-color@8.1.1) eslint: 8.36.0 functional-red-black-tree: 1.0.1 ignore: 5.2.0 regexpp: 3.2.0 semver: 7.3.8 - tsutils: 3.21.0(typescript@5.1.3) - typescript: 5.1.3 + tsutils: 3.21.0(typescript@5.2.2) + typescript: 5.2.2 transitivePeerDependencies: - supports-color dev: true - /@typescript-eslint/parser@5.30.6(eslint@8.36.0)(typescript@5.1.3): - resolution: {integrity: sha512-gfF9lZjT0p2ZSdxO70Xbw8w9sPPJGfAdjK7WikEjB3fcUI/yr9maUVEdqigBjKincUYNKOmf7QBMiTf719kbrA==} + /@typescript-eslint/parser@5.56.0(eslint@8.36.0)(typescript@5.2.2): + resolution: {integrity: sha512-sn1OZmBxUsgxMmR8a8U5QM/Wl+tyqlH//jTqCg8daTAmhAk26L2PFhcqPLlYBhYUJMZJK276qLXlHN3a83o2cg==} engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0} peerDependencies: eslint: ^6.0.0 || ^7.0.0 || ^8.0.0 @@ -6743,32 +6743,33 @@ packages: typescript: optional: true dependencies: - '@typescript-eslint/scope-manager': 5.30.6 - '@typescript-eslint/types': 5.30.6 - '@typescript-eslint/typescript-estree': 5.30.6(typescript@5.1.3) + '@typescript-eslint/scope-manager': 5.56.0 + '@typescript-eslint/types': 5.56.0 + '@typescript-eslint/typescript-estree': 5.56.0(typescript@5.2.2) debug: 4.3.4(supports-color@8.1.1) eslint: 8.36.0 - typescript: 5.1.3 + typescript: 5.2.2 transitivePeerDependencies: - supports-color dev: true - /@typescript-eslint/parser@5.56.0(eslint@8.36.0)(typescript@5.1.3): - resolution: {integrity: sha512-sn1OZmBxUsgxMmR8a8U5QM/Wl+tyqlH//jTqCg8daTAmhAk26L2PFhcqPLlYBhYUJMZJK276qLXlHN3a83o2cg==} - engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0} + /@typescript-eslint/parser@6.5.0(eslint@8.36.0)(typescript@5.2.2): + resolution: {integrity: sha512-LMAVtR5GN8nY0G0BadkG0XIe4AcNMeyEy3DyhKGAh9k4pLSMBO7rF29JvDBpZGCmp5Pgz5RLHP6eCpSYZJQDuQ==} + engines: {node: ^16.0.0 || >=18.0.0} peerDependencies: - eslint: ^6.0.0 || ^7.0.0 || ^8.0.0 + eslint: ^7.0.0 || ^8.0.0 typescript: '*' peerDependenciesMeta: typescript: optional: true dependencies: - '@typescript-eslint/scope-manager': 5.56.0 - '@typescript-eslint/types': 5.56.0 - '@typescript-eslint/typescript-estree': 5.56.0(typescript@5.1.3) + '@typescript-eslint/scope-manager': 6.5.0 + '@typescript-eslint/types': 6.5.0 + '@typescript-eslint/typescript-estree': 6.5.0(typescript@5.2.2) + '@typescript-eslint/visitor-keys': 6.5.0 debug: 4.3.4(supports-color@8.1.1) eslint: 8.36.0 - typescript: 5.1.3 + typescript: 5.2.2 transitivePeerDependencies: - supports-color dev: true @@ -6797,7 +6798,15 @@ packages: '@typescript-eslint/visitor-keys': 5.56.0 dev: true - /@typescript-eslint/type-utils@5.30.6(eslint@8.36.0)(typescript@5.1.3): + /@typescript-eslint/scope-manager@6.5.0: + resolution: {integrity: sha512-A8hZ7OlxURricpycp5kdPTH3XnjG85UpJS6Fn4VzeoH4T388gQJ/PGP4ole5NfKt4WDVhmLaQ/dBLNDC4Xl/Kw==} + engines: {node: ^16.0.0 || >=18.0.0} + dependencies: + '@typescript-eslint/types': 6.5.0 + '@typescript-eslint/visitor-keys': 6.5.0 + dev: true + + /@typescript-eslint/type-utils@5.30.6(eslint@8.36.0)(typescript@5.2.2): resolution: {integrity: sha512-GFVVzs2j0QPpM+NTDMXtNmJKlF842lkZKDSanIxf+ArJsGeZUIaeT4jGg+gAgHt7AcQSFwW7htzF/rbAh2jaVA==} engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0} peerDependencies: @@ -6807,11 +6816,11 @@ packages: typescript: optional: true dependencies: - '@typescript-eslint/utils': 5.30.6(eslint@8.36.0)(typescript@5.1.3) + '@typescript-eslint/utils': 5.30.6(eslint@8.36.0)(typescript@5.2.2) debug: 4.3.4(supports-color@8.1.1) eslint: 8.36.0 - tsutils: 3.21.0(typescript@5.1.3) - typescript: 5.1.3 + tsutils: 3.21.0(typescript@5.2.2) + typescript: 5.2.2 transitivePeerDependencies: - supports-color dev: true @@ -6831,7 +6840,12 @@ packages: engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0} dev: true - /@typescript-eslint/typescript-estree@5.30.6(typescript@5.1.3): + /@typescript-eslint/types@6.5.0: + resolution: {integrity: sha512-eqLLOEF5/lU8jW3Bw+8auf4lZSbbljHR2saKnYqON12G/WsJrGeeDHWuQePoEf9ro22+JkbPfWQwKEC5WwLQ3w==} + engines: {node: ^16.0.0 || >=18.0.0} + dev: true + + /@typescript-eslint/typescript-estree@5.30.6(typescript@5.2.2): resolution: {integrity: sha512-Z7TgPoeYUm06smfEfYF0RBkpF8csMyVnqQbLYiGgmUSTaSXTP57bt8f0UFXstbGxKIreTwQCujtaH0LY9w9B+A==} engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0} peerDependencies: @@ -6846,13 +6860,13 @@ packages: globby: 11.1.0 is-glob: 4.0.3 semver: 7.3.8 - tsutils: 3.21.0(typescript@5.1.3) - typescript: 5.1.3 + tsutils: 3.21.0(typescript@5.2.2) + typescript: 5.2.2 transitivePeerDependencies: - supports-color dev: true - /@typescript-eslint/typescript-estree@5.54.0(typescript@5.1.3): + /@typescript-eslint/typescript-estree@5.54.0(typescript@5.2.2): resolution: {integrity: sha512-X2rJG97Wj/VRo5YxJ8Qx26Zqf0RRKsVHd4sav8NElhbZzhpBI8jU54i6hfo9eheumj4oO4dcRN1B/zIVEqR/MQ==} engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0} peerDependencies: @@ -6867,13 +6881,13 @@ packages: globby: 11.1.0 is-glob: 4.0.3 semver: 7.3.8 - tsutils: 3.21.0(typescript@5.1.3) - typescript: 5.1.3 + tsutils: 3.21.0(typescript@5.2.2) + typescript: 5.2.2 transitivePeerDependencies: - supports-color dev: true - /@typescript-eslint/typescript-estree@5.56.0(typescript@5.1.3): + /@typescript-eslint/typescript-estree@5.56.0(typescript@5.2.2): resolution: {integrity: sha512-41CH/GncsLXOJi0jb74SnC7jVPWeVJ0pxQj8bOjH1h2O26jXN3YHKDT1ejkVz5YeTEQPeLCCRY0U2r68tfNOcg==} engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0} peerDependencies: @@ -6888,13 +6902,34 @@ packages: globby: 11.1.0 is-glob: 4.0.3 semver: 7.3.8 - tsutils: 3.21.0(typescript@5.1.3) - typescript: 5.1.3 + tsutils: 3.21.0(typescript@5.2.2) + typescript: 5.2.2 transitivePeerDependencies: - supports-color dev: true - /@typescript-eslint/utils@5.30.6(eslint@8.36.0)(typescript@5.1.3): + /@typescript-eslint/typescript-estree@6.5.0(typescript@5.2.2): + resolution: {integrity: sha512-q0rGwSe9e5Kk/XzliB9h2LBc9tmXX25G0833r7kffbl5437FPWb2tbpIV9wAATebC/018pGa9fwPDuvGN+LxWQ==} + engines: {node: ^16.0.0 || >=18.0.0} + peerDependencies: + typescript: '*' + peerDependenciesMeta: + typescript: + optional: true + dependencies: + '@typescript-eslint/types': 6.5.0 + '@typescript-eslint/visitor-keys': 6.5.0 + debug: 4.3.4(supports-color@8.1.1) + globby: 11.1.0 + is-glob: 4.0.3 + semver: 7.5.4 + ts-api-utils: 1.0.2(typescript@5.2.2) + typescript: 5.2.2 + transitivePeerDependencies: + - supports-color + dev: true + + /@typescript-eslint/utils@5.30.6(eslint@8.36.0)(typescript@5.2.2): resolution: {integrity: sha512-xFBLc/esUbLOJLk9jKv0E9gD/OH966M40aY9jJ8GiqpSkP2xOV908cokJqqhVd85WoIvHVHYXxSFE4cCSDzVvA==} engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0} peerDependencies: @@ -6903,7 +6938,7 @@ packages: '@types/json-schema': 7.0.11 '@typescript-eslint/scope-manager': 5.30.6 '@typescript-eslint/types': 5.30.6 - '@typescript-eslint/typescript-estree': 5.30.6(typescript@5.1.3) + '@typescript-eslint/typescript-estree': 5.30.6(typescript@5.2.2) eslint: 8.36.0 eslint-scope: 5.1.1 eslint-utils: 3.0.0(eslint@8.36.0) @@ -6912,7 +6947,7 @@ packages: - typescript dev: true - /@typescript-eslint/utils@5.54.0(eslint@8.36.0)(typescript@5.1.3): + /@typescript-eslint/utils@5.54.0(eslint@8.36.0)(typescript@5.2.2): resolution: {integrity: sha512-cuwm8D/Z/7AuyAeJ+T0r4WZmlnlxQ8wt7C7fLpFlKMR+dY6QO79Cq1WpJhvZbMA4ZeZGHiRWnht7ZJ8qkdAunw==} engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0} peerDependencies: @@ -6922,7 +6957,7 @@ packages: '@types/semver': 7.3.13 '@typescript-eslint/scope-manager': 5.54.0 '@typescript-eslint/types': 5.54.0 - '@typescript-eslint/typescript-estree': 5.54.0(typescript@5.1.3) + '@typescript-eslint/typescript-estree': 5.54.0(typescript@5.2.2) eslint: 8.36.0 eslint-scope: 5.1.1 eslint-utils: 3.0.0(eslint@8.36.0) @@ -6956,6 +6991,14 @@ packages: eslint-visitor-keys: 3.3.0 dev: true + /@typescript-eslint/visitor-keys@6.5.0: + resolution: {integrity: sha512-yCB/2wkbv3hPsh02ZS8dFQnij9VVQXJMN/gbQsaaY+zxALkZnxa/wagvLEFsAWMPv7d7lxQmNsIzGU1w/T/WyA==} + engines: {node: ^16.0.0 || >=18.0.0} + dependencies: + '@typescript-eslint/types': 6.5.0 + eslint-visitor-keys: 3.4.3 + dev: true + /@typescript/analyze-trace@0.9.1: resolution: {integrity: sha512-HIWrYxz106aoJJauaCb08fK2XjH17KpuELEfWlgq72hYucEo3Hwtr0bCKE6EM2t2uUNEBvPG1tuYRU2yiF/qlg==} hasBin: true @@ -7014,6 +7057,7 @@ packages: /@unified-latex/unified-latex-types@1.3.1: resolution: {integrity: sha512-697Wc68b6HC4pG9+Gpt9hvZYJUeKQzNGY3ONTVERN3Sqfngd64i2p1Yh1dcqMxspckXaXwIn72XHRBSofITxSw==} + dev: false /@unified-latex/unified-latex-util-align@1.3.1: resolution: {integrity: sha512-Ym3Xhf7sNkIqLlETkEqC5eFotvkTyXB+Ee9Y7bo1O11qZ+AhwpkyG7E2Crcjw0oToURe3xDQzjMvkNTbFL/OOQ==} @@ -7804,6 +7848,7 @@ packages: /amdefine@1.0.1: resolution: {integrity: sha512-S2Hw0TtNkMJhIabBwIojKL9YHO5T0n5eNqWJ7Lrlel/zDbftQpxpapi8tZs3X1HWa+u+QeydGmzzNU0m09+Rcg==} engines: {node: '>=0.4.2'} + requiresBuild: true dev: false optional: true @@ -9609,7 +9654,7 @@ packages: engines: {node: '>= 0.4.0'} dev: true - /cosmiconfig-typescript-loader@4.3.0(@types/node@18.15.11)(cosmiconfig@8.1.3)(ts-node@10.9.1)(typescript@5.1.3): + /cosmiconfig-typescript-loader@4.3.0(@types/node@18.15.11)(cosmiconfig@8.1.3)(ts-node@10.9.1)(typescript@5.2.2): resolution: {integrity: sha512-NTxV1MFfZDLPiBMjxbHRwSh5LaLcPMwNdCutmnHJCKoVnlvldPWlllonKwrsRJ5pYZBIBGRWWU2tfvzxgeSW5Q==} engines: {node: '>=12', npm: '>=6'} peerDependencies: @@ -9620,8 +9665,8 @@ packages: dependencies: '@types/node': 18.15.11 cosmiconfig: 8.1.3 - ts-node: 10.9.1(@swc/core@1.3.37)(@types/node@18.15.11)(typescript@5.1.3) - typescript: 5.1.3 + ts-node: 10.9.1(@swc/core@1.3.37)(@types/node@18.15.11)(typescript@5.2.2) + typescript: 5.2.2 dev: true /cosmiconfig@6.0.0: @@ -10966,7 +11011,7 @@ packages: source-map: 0.6.1 dev: true - /eslint-config-next@13.2.4(eslint@8.36.0)(typescript@5.1.3): + /eslint-config-next@13.2.4(eslint@8.36.0)(typescript@5.2.2): resolution: {integrity: sha512-lunIBhsoeqw6/Lfkd6zPt25w1bn0znLA/JCL+au1HoEpSb4/PpsOYsYtgV/q+YPsoKIOzFyU5xnb04iZnXjUvg==} peerDependencies: eslint: ^7.23.0 || ^8.0.0 @@ -10977,7 +11022,7 @@ packages: dependencies: '@next/eslint-plugin-next': 13.2.4 '@rushstack/eslint-patch': 1.2.0 - '@typescript-eslint/parser': 5.56.0(eslint@8.36.0)(typescript@5.1.3) + '@typescript-eslint/parser': 5.56.0(eslint@8.36.0)(typescript@5.2.2) eslint: 8.36.0 eslint-import-resolver-node: 0.3.7 eslint-import-resolver-typescript: 3.5.3(eslint-plugin-import@2.27.5)(eslint@8.36.0) @@ -10985,7 +11030,7 @@ packages: eslint-plugin-jsx-a11y: 6.7.1(eslint@8.36.0) eslint-plugin-react: 7.32.2(eslint@8.36.0) eslint-plugin-react-hooks: 4.6.0(eslint@8.36.0) - typescript: 5.1.3 + typescript: 5.2.2 transitivePeerDependencies: - eslint-import-resolver-webpack - supports-color @@ -11030,7 +11075,7 @@ packages: - supports-color dev: true - /eslint-module-utils@2.7.4(@typescript-eslint/parser@5.30.6)(eslint-import-resolver-node@0.3.7)(eslint@8.36.0): + /eslint-module-utils@2.7.4(@typescript-eslint/parser@5.56.0)(eslint-import-resolver-node@0.3.7)(eslint-import-resolver-typescript@3.5.3)(eslint@8.36.0): resolution: {integrity: sha512-j4GT+rqzCoRKHwURX7pddtIPGySnX9Si/cgMI5ztrcqOPtk5dDEeZ34CQVPphnqkJytlc97Vuk05Um2mJ3gEQA==} engines: {node: '>=4'} peerDependencies: @@ -11051,15 +11096,16 @@ packages: eslint-import-resolver-webpack: optional: true dependencies: - '@typescript-eslint/parser': 5.30.6(eslint@8.36.0)(typescript@5.1.3) + '@typescript-eslint/parser': 5.56.0(eslint@8.36.0)(typescript@5.2.2) debug: 3.2.7(supports-color@8.1.1) eslint: 8.36.0 eslint-import-resolver-node: 0.3.7 + eslint-import-resolver-typescript: 3.5.3(eslint-plugin-import@2.27.5)(eslint@8.36.0) transitivePeerDependencies: - supports-color dev: true - /eslint-module-utils@2.7.4(@typescript-eslint/parser@5.56.0)(eslint-import-resolver-node@0.3.7)(eslint-import-resolver-typescript@3.5.3)(eslint@8.36.0): + /eslint-module-utils@2.7.4(@typescript-eslint/parser@6.5.0)(eslint-import-resolver-node@0.3.7)(eslint@8.36.0): resolution: {integrity: sha512-j4GT+rqzCoRKHwURX7pddtIPGySnX9Si/cgMI5ztrcqOPtk5dDEeZ34CQVPphnqkJytlc97Vuk05Um2mJ3gEQA==} engines: {node: '>=4'} peerDependencies: @@ -11080,11 +11126,10 @@ packages: eslint-import-resolver-webpack: optional: true dependencies: - '@typescript-eslint/parser': 5.56.0(eslint@8.36.0)(typescript@5.1.3) + '@typescript-eslint/parser': 6.5.0(eslint@8.36.0)(typescript@5.2.2) debug: 3.2.7(supports-color@8.1.1) eslint: 8.36.0 eslint-import-resolver-node: 0.3.7 - eslint-import-resolver-typescript: 3.5.3(eslint-plugin-import@2.27.5)(eslint@8.36.0) transitivePeerDependencies: - supports-color dev: true @@ -11098,7 +11143,7 @@ packages: globals: 11.12.0 dev: true - /eslint-plugin-import@2.27.5(@typescript-eslint/parser@5.30.6)(eslint@8.36.0): + /eslint-plugin-import@2.27.5(@typescript-eslint/parser@5.56.0)(eslint-import-resolver-typescript@3.5.3)(eslint@8.36.0): resolution: {integrity: sha512-LmEt3GVofgiGuiE+ORpnvP+kAm3h6MLZJ4Q5HCyHADofsb4VzXFsRiWj3c0OFiV+3DWFh0qg3v9gcPlfc3zRow==} engines: {node: '>=4'} peerDependencies: @@ -11108,7 +11153,7 @@ packages: '@typescript-eslint/parser': optional: true dependencies: - '@typescript-eslint/parser': 5.30.6(eslint@8.36.0)(typescript@5.1.3) + '@typescript-eslint/parser': 5.56.0(eslint@8.36.0)(typescript@5.2.2) array-includes: 3.1.6 array.prototype.flat: 1.3.1 array.prototype.flatmap: 1.3.1 @@ -11116,7 +11161,7 @@ packages: doctrine: 2.1.0 eslint: 8.36.0 eslint-import-resolver-node: 0.3.7 - eslint-module-utils: 2.7.4(@typescript-eslint/parser@5.30.6)(eslint-import-resolver-node@0.3.7)(eslint@8.36.0) + eslint-module-utils: 2.7.4(@typescript-eslint/parser@5.56.0)(eslint-import-resolver-node@0.3.7)(eslint-import-resolver-typescript@3.5.3)(eslint@8.36.0) has: 1.0.3 is-core-module: 2.11.0 is-glob: 4.0.3 @@ -11131,7 +11176,7 @@ packages: - supports-color dev: true - /eslint-plugin-import@2.27.5(@typescript-eslint/parser@5.56.0)(eslint-import-resolver-typescript@3.5.3)(eslint@8.36.0): + /eslint-plugin-import@2.27.5(@typescript-eslint/parser@6.5.0)(eslint@8.36.0): resolution: {integrity: sha512-LmEt3GVofgiGuiE+ORpnvP+kAm3h6MLZJ4Q5HCyHADofsb4VzXFsRiWj3c0OFiV+3DWFh0qg3v9gcPlfc3zRow==} engines: {node: '>=4'} peerDependencies: @@ -11141,7 +11186,7 @@ packages: '@typescript-eslint/parser': optional: true dependencies: - '@typescript-eslint/parser': 5.56.0(eslint@8.36.0)(typescript@5.1.3) + '@typescript-eslint/parser': 6.5.0(eslint@8.36.0)(typescript@5.2.2) array-includes: 3.1.6 array.prototype.flat: 1.3.1 array.prototype.flatmap: 1.3.1 @@ -11149,7 +11194,7 @@ packages: doctrine: 2.1.0 eslint: 8.36.0 eslint-import-resolver-node: 0.3.7 - eslint-module-utils: 2.7.4(@typescript-eslint/parser@5.56.0)(eslint-import-resolver-node@0.3.7)(eslint-import-resolver-typescript@3.5.3)(eslint@8.36.0) + eslint-module-utils: 2.7.4(@typescript-eslint/parser@6.5.0)(eslint-import-resolver-node@0.3.7)(eslint@8.36.0) has: 1.0.3 is-core-module: 2.11.0 is-glob: 4.0.3 @@ -11306,6 +11351,11 @@ packages: resolution: {integrity: sha512-mQ+suqKJVyeuwGYHAdjMFqjCyfl8+Ldnxuyp3ldiMBFKkvytrXUZWaiPCEav8qDHKty44bD+qV1IP4T+w+xXRA==} engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0} + /eslint-visitor-keys@3.4.3: + resolution: {integrity: sha512-wpc+LXeiyiisxPlEkUzU6svyS1frIO3Mgxj1fdy7Pm8Ygzguax2N3Fa/D/ag1WqbOprdI+uY6wMUl8/a2G+iag==} + engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0} + dev: true + /eslint@8.36.0: resolution: {integrity: sha512-Y956lmS7vDqomxlaaQAHVmeb4tNMp2FWIvU/RnU5BD3IKMD/MJPr76xdyr68P8tV1iNMvN2mRK0yy3c+UjL+bw==} engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0} @@ -12002,7 +12052,7 @@ packages: /forever-agent@0.6.1: resolution: {integrity: sha512-j0KLYPhm6zeac4lz3oJ3o65qvgQCcPubiyotZrXqEaG4hNagNYO8qdlUrX5vwqv9ohqeT/Z3j6+yW067yWWdUw==} - /fork-ts-checker-webpack-plugin@7.2.13(typescript@5.1.3)(webpack@5.75.0): + /fork-ts-checker-webpack-plugin@7.2.13(typescript@5.2.2)(webpack@5.75.0): resolution: {integrity: sha512-fR3WRkOb4bQdWB/y7ssDUlVdrclvwtyCUIHCfivAoYxq9dF7XfrDKbMdZIfwJ7hxIAqkYSGeU7lLJE6xrxIBdg==} engines: {node: '>=12.13.0', yarn: '>=1.0.0'} peerDependencies: @@ -12025,7 +12075,7 @@ packages: schema-utils: 3.1.1 semver: 7.3.8 tapable: 2.2.1 - typescript: 5.1.3 + typescript: 5.2.2 webpack: 5.75.0(@swc/core@1.3.37)(esbuild@0.17.14) /form-data@2.3.3: @@ -13804,7 +13854,7 @@ packages: pretty-format: 28.1.3 slash: 3.0.0 strip-json-comments: 3.1.1 - ts-node: 10.9.1(@swc/core@1.3.37)(@types/node@18.15.11)(typescript@5.1.3) + ts-node: 10.9.1(@swc/core@1.3.37)(@types/node@18.15.11)(typescript@5.2.2) transitivePeerDependencies: - supports-color @@ -13843,7 +13893,7 @@ packages: pretty-format: 29.5.0 slash: 3.0.0 strip-json-comments: 3.1.1 - ts-node: 10.9.1(@swc/core@1.3.37)(@types/node@18.15.11)(typescript@5.1.3) + ts-node: 10.9.1(@swc/core@1.3.37)(@types/node@18.15.11)(typescript@5.2.2) transitivePeerDependencies: - supports-color dev: true @@ -16333,8 +16383,8 @@ packages: '@nrwl/workspace': ^14.0.0 || ^15.0.0 nx: ^14.0.0 || ^15.0.0 dependencies: - '@nrwl/devkit': 15.8.5(nx@15.8.7)(typescript@5.1.3) - '@nrwl/workspace': 15.8.5(@swc-node/register@1.6.2)(@swc/core@1.3.37)(eslint@8.36.0)(prettier@2.8.4)(typescript@5.1.3) + '@nrwl/devkit': 15.8.5(nx@15.8.7)(typescript@5.2.2) + '@nrwl/workspace': 15.8.5(@swc-node/register@1.6.2)(@swc/core@1.3.37)(eslint@8.36.0)(prettier@2.8.4)(typescript@5.2.2) nx: 15.8.7(@swc-node/register@1.6.2)(@swc/core@1.3.37) dev: false @@ -16506,7 +16556,7 @@ packages: peerDependencies: '@nrwl/workspace': '>=9.2.2' dependencies: - '@nrwl/workspace': 15.8.5(@swc-node/register@1.6.2)(@swc/core@1.3.37)(eslint@8.36.0)(prettier@2.8.4)(typescript@5.1.3) + '@nrwl/workspace': 15.8.5(@swc-node/register@1.6.2)(@swc/core@1.3.37)(eslint@8.36.0)(prettier@2.8.4)(typescript@5.2.2) chalk: 4.1.2 dotenv: 8.6.0 tar: 6.1.11 @@ -16528,7 +16578,7 @@ packages: '@nrwl/cli': 15.8.5(@swc-node/register@1.6.2)(@swc/core@1.3.37) '@nrwl/tao': 15.8.5(@swc-node/register@1.6.2)(@swc/core@1.3.37) '@parcel/watcher': 2.0.4 - '@swc-node/register': 1.6.2(@swc/core@1.3.37)(typescript@5.1.3) + '@swc-node/register': 1.6.2(@swc/core@1.3.37)(typescript@5.2.2) '@swc/core': 1.3.37 '@yarnpkg/lockfile': 1.1.0 '@yarnpkg/parsers': 3.0.0-rc.40 @@ -16591,7 +16641,7 @@ packages: '@nrwl/cli': 15.8.7(@swc-node/register@1.6.2)(@swc/core@1.3.37) '@nrwl/tao': 15.8.7(@swc-node/register@1.6.2)(@swc/core@1.3.37) '@parcel/watcher': 2.0.4 - '@swc-node/register': 1.6.2(@swc/core@1.3.37)(typescript@5.1.3) + '@swc-node/register': 1.6.2(@swc/core@1.3.37)(typescript@5.2.2) '@swc/core': 1.3.37 '@yarnpkg/lockfile': 1.1.0 '@yarnpkg/parsers': 3.0.0-rc.40 @@ -16654,7 +16704,7 @@ packages: '@nrwl/cli': 15.8.8(@swc-node/register@1.6.2)(@swc/core@1.3.37) '@nrwl/tao': 15.8.8(@swc-node/register@1.6.2)(@swc/core@1.3.37) '@parcel/watcher': 2.0.4 - '@swc-node/register': 1.6.2(@swc/core@1.3.37)(typescript@5.1.3) + '@swc-node/register': 1.6.2(@swc/core@1.3.37)(typescript@5.2.2) '@swc/core': 1.3.37 '@yarnpkg/lockfile': 1.1.0 '@yarnpkg/parsers': 3.0.0-rc.40 @@ -17239,6 +17289,7 @@ packages: /pify@4.0.1: resolution: {integrity: sha512-uB80kBFb/tfd68bVleG9T5GGsGPjJrLAUpR5PZIrhBnIaRTQRjqdJSsIKkOP6OAIFbj7GOrcudc5pNjZ+geV2g==} engines: {node: '>=6'} + requiresBuild: true optional: true /pify@5.0.0: @@ -17383,7 +17434,7 @@ packages: dependencies: lilconfig: 2.1.0 postcss: 8.4.19 - ts-node: 10.9.1(@swc/core@1.3.37)(@types/node@18.15.11)(typescript@5.1.3) + ts-node: 10.9.1(@swc/core@1.3.37)(@types/node@18.15.11)(typescript@5.2.2) yaml: 1.10.2 dev: true @@ -17927,6 +17978,7 @@ packages: /prr@1.0.1: resolution: {integrity: sha512-yPw4Sng1gWghHQWj0B3ZggWUm4qVbPwPFcRG8KyxiU7J2OHFSoEHKS+EZ3fv5l1t9CyCiop6l/ZYeWbrgoQejw==} + requiresBuild: true optional: true /pseudomap@1.0.2: @@ -18775,7 +18827,7 @@ packages: - ts-node dev: true - /rollup-plugin-typescript2@0.34.1(rollup@2.79.1)(typescript@5.1.3): + /rollup-plugin-typescript2@0.34.1(rollup@2.79.1)(typescript@5.2.2): resolution: {integrity: sha512-P4cHLtGikESmqi1CA+tdMDUv8WbQV48mzPYt77TSTOPJpERyZ9TXdDgjSDix8Fkqce6soYz3+fa4lrC93IEkcw==} peerDependencies: rollup: '>=1.26.3' @@ -18787,7 +18839,7 @@ packages: rollup: 2.79.1 semver: 7.3.8 tslib: 2.5.0 - typescript: 5.1.3 + typescript: 5.2.2 dev: true /rollup-pluginutils@2.8.2: @@ -19057,6 +19109,14 @@ packages: dependencies: lru-cache: 6.0.0 + /semver@7.5.4: + resolution: {integrity: sha512-1bCSESV6Pv+i21Hvpxp3Dx+pSD8lIPt8uVjRrxAUt/nbswYc+tK6Y2btiULjd4+fnq15PX+nqQDC7Oft7WkwcA==} + engines: {node: '>=10'} + hasBin: true + dependencies: + lru-cache: 6.0.0 + dev: true + /send@0.18.0: resolution: {integrity: sha512-qqWzuOjSFOuqPjFe4NOsMLafToQQwBSOEpS+FwEt3A2V3vKubTquT3vmLTQpFgMXp8AlFWFuP1qKaJZOtPpVXg==} engines: {node: '>= 0.8.0'} @@ -19898,7 +19958,7 @@ packages: typescript: 4.9.5 dev: true - /svelte-preprocess@5.0.3(@babel/core@7.20.5)(less@4.1.3)(postcss@8.4.19)(stylus@0.55.0)(svelte@3.57.0)(typescript@5.1.3): + /svelte-preprocess@5.0.3(@babel/core@7.20.5)(less@4.1.3)(postcss@8.4.19)(stylus@0.55.0)(svelte@3.57.0)(typescript@5.2.2): resolution: {integrity: sha512-GrHF1rusdJVbOZOwgPWtpqmaexkydznKzy5qIC2FabgpFyKN57bjMUUUqPRfbBXK5igiEWn1uO/DXsa2vJ5VHA==} engines: {node: '>= 14.10.0'} requiresBuild: true @@ -19946,7 +20006,7 @@ packages: strip-indent: 3.0.0 stylus: 0.55.0 svelte: 3.57.0 - typescript: 5.1.3 + typescript: 5.2.2 dev: true /svelte@3.57.0: @@ -20366,7 +20426,16 @@ packages: /trough@2.1.0: resolution: {integrity: sha512-AqTiAOLcj85xS7vQ8QkAV41hPDIJ71XJB4RCUrzo/1GM2CQwhkJGaf9Hgr7BOugMRpgGUrqRg/DrBDl4H40+8g==} - /ts-jest@29.0.5(@babel/core@7.20.5)(babel-jest@29.4.3)(esbuild@0.17.14)(jest@29.4.3)(typescript@5.1.3): + /ts-api-utils@1.0.2(typescript@5.2.2): + resolution: {integrity: sha512-Cbu4nIqnEdd+THNEsBdkolnOXhg0I8XteoHaEKgvsxpsbWda4IsUut2c187HxywQCvveojow0Dgw/amxtSKVkQ==} + engines: {node: '>=16.13.0'} + peerDependencies: + typescript: '>=4.2.0' + dependencies: + typescript: 5.2.2 + dev: true + + /ts-jest@29.0.5(@babel/core@7.20.5)(babel-jest@29.4.3)(esbuild@0.17.14)(jest@29.4.3)(typescript@5.2.2): resolution: {integrity: sha512-PL3UciSgIpQ7f6XjVOmbi96vmDHUqAyqDr8YxzopDqX3kfgYtX1cuNeBjP+L9sFXi6nzsGGA6R3fP3DDDJyrxA==} engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} hasBin: true @@ -20398,11 +20467,11 @@ packages: lodash.memoize: 4.1.2 make-error: 1.3.6 semver: 7.3.8 - typescript: 5.1.3 + typescript: 5.2.2 yargs-parser: 21.1.1 dev: true - /ts-loader@9.4.2(typescript@5.1.3)(webpack@5.75.0): + /ts-loader@9.4.2(typescript@5.2.2)(webpack@5.75.0): resolution: {integrity: sha512-OmlC4WVmFv5I0PpaxYb+qGeGOdm5giHU7HwDDUjw59emP2UYMHy9fFSDcYgSNoH8sXcj4hGCSEhlDZ9ULeDraA==} engines: {node: '>=12.0.0'} peerDependencies: @@ -20413,7 +20482,7 @@ packages: enhanced-resolve: 5.12.0 micromatch: 4.0.5 semver: 7.3.8 - typescript: 5.1.3 + typescript: 5.2.2 webpack: 5.75.0(@swc/core@1.3.37)(esbuild@0.17.14) /ts-morph@12.0.0: @@ -20423,7 +20492,7 @@ packages: code-block-writer: 10.1.1 dev: true - /ts-node@10.9.1(@swc/core@1.3.37)(@types/node@18.15.11)(typescript@5.1.3): + /ts-node@10.9.1(@swc/core@1.3.37)(@types/node@18.15.11)(typescript@5.2.2): resolution: {integrity: sha512-NtVysVPkxxrwFGUUxGYhfux8k78pQB3JqYBXlLRZgdGUqTO5wU/UyHop5p70iEbGhB7q5KmiZiU0Y3KlJrScEw==} hasBin: true peerDependencies: @@ -20450,7 +20519,7 @@ packages: create-require: 1.1.1 diff: 4.0.2 make-error: 1.3.6 - typescript: 5.1.3 + typescript: 5.2.2 v8-compile-cache-lib: 3.0.1 yn: 3.1.1 @@ -20473,7 +20542,7 @@ packages: resolution: {integrity: sha512-FZIXf1ksVyLcfr7M317jbB67XFJhOO1YqdTcuGaq9q5jLUoTikukZ+98TPjKiP2jC5CgmYdWWYs0s2nLSU0/1A==} dev: true - /tsconfck@2.1.1(typescript@5.1.3): + /tsconfck@2.1.1(typescript@5.2.2): resolution: {integrity: sha512-ZPCkJBKASZBmBUNqGHmRhdhM8pJYDdOXp4nRgj/O0JwUwsMq50lCDRQP/M5GBNAA0elPrq4gAeu4dkaVCuKWww==} engines: {node: ^14.13.1 || ^16 || >=18} hasBin: true @@ -20483,7 +20552,7 @@ packages: typescript: optional: true dependencies: - typescript: 5.1.3 + typescript: 5.2.2 dev: true /tsconfig-paths-webpack-plugin@4.0.0: @@ -20520,14 +20589,14 @@ packages: /tslib@2.5.0: resolution: {integrity: sha512-336iVw3rtn2BUK7ORdIAHTyxHGRIHVReokCR3XjbckJMK7ms8FysBfhLR8IXnAgy7T0PTPNBWKiH514FOW/WSg==} - /tsutils@3.21.0(typescript@5.1.3): + /tsutils@3.21.0(typescript@5.2.2): resolution: {integrity: sha512-mHKK3iUXL+3UF6xL5k0PEhKRUBKPBCv/+RkEOpjRWxxx27KKRBmmA60A9pgOUvMi8GKhRMPEmjBRPzs2W7O1OA==} engines: {node: '>= 6'} peerDependencies: typescript: '>=2.8.0 || >= 3.2.0-dev || >= 3.3.0-dev || >= 3.4.0-dev || >= 3.5.0-dev || >= 3.6.0-dev || >= 3.6.0-beta || >= 3.7.0-dev || >= 3.7.0-beta' dependencies: tslib: 1.14.1 - typescript: 5.1.3 + typescript: 5.2.2 dev: true /tsx@3.12.6: @@ -20620,7 +20689,7 @@ packages: peerDependencies: typedoc: '>=0.23.0' dependencies: - typedoc: 0.23.28(typescript@5.1.3) + typedoc: 0.23.28(typescript@5.2.2) dev: true /typedoc-plugin-rename-defaults@0.6.5(typedoc@0.23.28): @@ -20628,7 +20697,7 @@ packages: peerDependencies: typedoc: 0.22.x || 0.23.x || 0.24.x dependencies: - typedoc: 0.23.28(typescript@5.1.3) + typedoc: 0.23.28(typescript@5.2.2) dev: false /typedoc-theme-hierarchy@3.2.0(typedoc@0.23.28): @@ -20637,10 +20706,10 @@ packages: typedoc: ^0.23.6 || ^0.24.0 dependencies: fs-extra: 10.1.0 - typedoc: 0.23.28(typescript@5.1.3) + typedoc: 0.23.28(typescript@5.2.2) dev: false - /typedoc@0.23.28(typescript@5.1.3): + /typedoc@0.23.28(typescript@5.2.2): resolution: {integrity: sha512-9x1+hZWTHEQcGoP7qFmlo4unUoVJLB0H/8vfO/7wqTnZxg4kPuji9y3uRzEu0ZKez63OJAUmiGhUrtukC6Uj3w==} engines: {node: '>= 14.14'} hasBin: true @@ -20651,7 +20720,7 @@ packages: marked: 4.3.0 minimatch: 7.4.3 shiki: 0.14.1 - typescript: 5.1.3 + typescript: 5.2.2 /typescript@4.3.4: resolution: {integrity: sha512-uauPG7XZn9F/mo+7MrsRjyvbxFpzemRjKEZXS4AK83oP2KKOJPvb+9cO/gmnv8arWZvhnjVOXz7B49m1l0e9Ew==} @@ -20665,8 +20734,8 @@ packages: hasBin: true dev: true - /typescript@5.1.3: - resolution: {integrity: sha512-XH627E9vkeqhlZFQuL+UsyAXEnibT0kWR2FWONlr4sTjvxyJYnyefgrkyECLzM5NenmKzRAy2rR/OlYLA1HkZw==} + /typescript@5.2.2: + resolution: {integrity: sha512-mI4WrpHsbCIcwT9cF4FZvr80QUeKvsUsUvKDoR+X/7XHQH98xYD8YHZg7ANtz2GtZt/CBq2QJ0thkGJMHfqc1w==} engines: {node: '>=14.17'} hasBin: true @@ -21317,7 +21386,7 @@ packages: vite: 4.2.1(@types/node@18.15.11)(less@4.1.3)(stylus@0.55.0) dev: true - /vite-tsconfig-paths@4.0.7(typescript@5.1.3)(vite@4.2.1): + /vite-tsconfig-paths@4.0.7(typescript@5.2.2)(vite@4.2.1): resolution: {integrity: sha512-MwIYaby6kcbQGZqMH+gAK6h0UYQGOkjsuAgw4q6bP/5vWkn8VKvnmLuCQHA2+IzHAJHnE8OFTO4lnJLFMf9+7Q==} peerDependencies: vite: '*' @@ -21327,7 +21396,7 @@ packages: dependencies: debug: 4.3.4(supports-color@8.1.1) globrex: 0.1.2 - tsconfck: 2.1.1(typescript@5.1.3) + tsconfck: 2.1.1(typescript@5.2.2) vite: 4.2.1(@types/node@18.15.11)(less@4.1.3)(stylus@0.55.0) transitivePeerDependencies: - supports-color diff --git a/scripts/generateGlobalTOC.ts b/scripts/generateGlobalTOC.ts index 09ee3e10..178e0322 100644 --- a/scripts/generateGlobalTOC.ts +++ b/scripts/generateGlobalTOC.ts @@ -6,8 +6,8 @@ import { readdirSync, readFileSync, writeFileSync, lstatSync } from 'fs' import { readFile, writeFile } from 'fs/promises' import { join, relative, resolve } from 'path' -import { tryCatchPromise } from '../libs/utils/misc/src' -// import { generateTOC } from './generateTOC'; +import { tryCatchPromise } from '../libs/utils/misc/src.js' +// import { generateTOC } from './generateTOC.js'; const __dirname = new URL('.', import.meta.url).pathname @@ -15,12 +15,8 @@ const root = resolve(__dirname, '..') const apps = join(root, 'apps') const libs = join(root, 'libs') -const appsDirs = readdirSync(apps).filter( - (dir) => dir && lstatSync(join(apps, dir))?.isDirectory() -) -const libsDirs = readdirSync(libs).filter( - (dir) => dir && lstatSync(join(libs, dir))?.isDirectory() -) +const appsDirs = readdirSync(apps).filter((dir) => dir && lstatSync(join(apps, dir))?.isDirectory()) +const libsDirs = readdirSync(libs).filter((dir) => dir && lstatSync(join(libs, dir))?.isDirectory()) const makeTOC = async (root: string, mainDir: string[], prefix: string) => await Promise.all( @@ -31,12 +27,9 @@ const makeTOC = async (root: string, mainDir: string[], prefix: string) => const relativePath = join(prefix, dir) const readmePath = join(dirPath, 'README.md') - const [readme, readmeError] = await tryCatchPromise( - readFile(readmePath, 'utf8') - ) + const [readme, readmeError] = await tryCatchPromise(readFile(readmePath, 'utf8')) - const firstNonHeader = - readme?.match(/(?<=(^|\n))\w.+?(?=#|$)/gims)?.[0] || '' + const firstNonHeader = readme?.match(/(?<=(^|\n))\w.+?(?=#|$)/gims)?.[0] || '' // check if decription is in package.json // if not, use the first non-header line of the readme @@ -50,15 +43,11 @@ const makeTOC = async (root: string, mainDir: string[], prefix: string) => .replace(/\n/g, '') const packagePath = join(dirPath, 'package.json') const [packageJSONRaw, packageJSONError] = await tryCatchPromise( - readFile(packagePath, 'utf8') + readFile(packagePath, 'utf8'), ) - const packageJSON = packageJSONRaw - ? JSON.parse(packageJSONRaw) - : undefined + const packageJSON = packageJSONRaw ? JSON.parse(packageJSONRaw) : undefined - const packageDescription = packageJSON - ? packageJSON.description - : undefined + const packageDescription = packageJSON ? packageJSON.description : undefined if (packageJSONError && readmeDescription) { // write the package.json file with the description @@ -82,10 +71,10 @@ const makeTOC = async (root: string, mainDir: string[], prefix: string) => await writeFile(packagePath, JSON.stringify(packageJSON, null, 2)) } - return `#### [\`${dir}\`](${ - readme ? join(relativePath, 'README.md') : relativePath - })${firstNonHeader ? `\n\n${firstNonHeader}\n` : '\n'}` - }) + return `#### [\`${dir}\`](${readme ? join(relativePath, 'README.md') : relativePath})${ + firstNonHeader ? `\n\n${firstNonHeader}\n` : '\n' + }` + }), ) const appToc = await makeTOC(apps, appsDirs, 'apps') @@ -93,12 +82,12 @@ const appToc = await makeTOC(apps, appsDirs, 'apps') const libToc = await Promise.all( libsDirs.map(async (dir) => { const liblibDirs = readdirSync(join(libs, dir)).filter((dirr) => - lstatSync(join(libs, dir, dirr)).isDirectory() + lstatSync(join(libs, dir, dirr)).isDirectory(), ) const libToc = await makeTOC(join(libs, dir), liblibDirs, `libs/${dir}`) return `\n### [${dir}](${join('libs', dir)})\n\n${libToc.join('\n\n')}` - }) + }), ) const toc = `# Overview diff --git a/scripts/readmeAction.ts b/scripts/readmeAction.ts index 9582a0f1..78fbea38 100644 --- a/scripts/readmeAction.ts +++ b/scripts/readmeAction.ts @@ -1,4 +1,4 @@ -import { loopOverDirs } from './loopOverDirs' +import { loopOverDirs } from './loopOverDirs.js' import { remark } from 'remark' import remarkLicense from 'remark-license' import remarkToc, { Root } from 'remark-toc' diff --git a/tools/generators/node-lib/files/lib/src/lib/__fileName__.spec.ts__tmpl__ b/tools/generators/node-lib/files/lib/src/lib/__fileName__.spec.ts__tmpl__ index 35b0948b..650a173a 100644 --- a/tools/generators/node-lib/files/lib/src/lib/__fileName__.spec.ts__tmpl__ +++ b/tools/generators/node-lib/files/lib/src/lib/__fileName__.spec.ts__tmpl__ @@ -1,7 +1,7 @@ -import { <%= propertyName %> } from './<%= fileName %>'; +import { <%= propertyName %> } from './<%= fileName %>.js'; describe('<%= propertyName %>', () => { it('should work', () => { expect(<%= propertyName %>()).toEqual('<%= name %>'); }) -}) \ No newline at end of file +}) diff --git a/tools/generators/node-lib/files/lib/tsconfig.lib.json__tmpl__ b/tools/generators/node-lib/files/lib/tsconfig.lib.json__tmpl__ index 17236a9a..83fd704a 100755 --- a/tools/generators/node-lib/files/lib/tsconfig.lib.json__tmpl__ +++ b/tools/generators/node-lib/files/lib/tsconfig.lib.json__tmpl__ @@ -6,5 +6,5 @@ "types": ["node"] }, "exclude": ["**/*.spec.ts", "**/*.test.ts", "jest.config.ts", "vite.config.ts"], - "include": ["src/**/*.ts"] + "include": ["**/*.ts"] } diff --git a/tools/generators/node-lib/index.ts b/tools/generators/node-lib/index.ts index 6cf49415..fac5256d 100755 --- a/tools/generators/node-lib/index.ts +++ b/tools/generators/node-lib/index.ts @@ -22,7 +22,7 @@ import { ExecutorOptions } from '@nrwl/js/src/utils/schema' import { VersionBuilderSchema } from '@jscutlery/semver/src/executors/version/schema' import { GithubExecutorSchema } from '@jscutlery/semver/src/executors/github/schema' -import { Schema } from './schema' +import { Schema } from './schema.js' import { join } from 'path' import { nxVersion } from '@nrwl/workspace/src/utils/versions' import { addLint } from '@nrwl/workspace/src/generators/library/library' diff --git a/tsconfig.base.json b/tsconfig.base.json index 178ae961..dd4195f2 100755 --- a/tsconfig.base.json +++ b/tsconfig.base.json @@ -50,7 +50,6 @@ "jast-util-to-texast": ["libs/jast/jast-util-to-texast/src/index.ts"], "jastscript": ["libs/rejour/jastscript/src/index.ts"], "misc": ["libs/utils/misc/src/index.ts"], - "ojs-client": ["libs/ojs/ojs-client/src/index.ts"], "ojs-relatex": ["libs/ojs/ojs-relatex/src/index.ts"], "ojs-types": ["libs/citations/ojs-types/src/index.ts"], "ooxast": ["libs/ooxast/ooxast/src/index.ts"], @@ -90,7 +89,6 @@ "reoff-rejour": ["libs/reoff/reoff-rejour/src/index.ts"], "reoff-remark": ["libs/reoff/reoff-remark/src/index.ts"], "reoff-unified-latex": ["libs/reoff/reoff-unified-latex/src/index.ts"], - "test": ["libs/test/src/index.ts"], "texast": ["libs/texast/texast/src/index.ts"], "texast-util-add-preamble": ["libs/texast/texast-util-add-preamble/src/index.ts"], "texast-util-to-latex": ["libs/texast/texast-util-to-latex/src/index.ts"],