From 4643bb1c00412201095354077590909e9e778a95 Mon Sep 17 00:00:00 2001 From: Emerson Bottero Date: Fri, 7 Apr 2023 23:38:05 -0300 Subject: [PATCH 1/2] fix: really import esm version of dayjs --- packages/mermaid/src/diagrams/gantt/ganttDb.js | 8 ++++---- packages/mermaid/src/diagrams/gantt/ganttDb.spec.ts | 2 +- packages/mermaid/src/diagrams/gantt/ganttRenderer.js | 2 +- packages/mermaid/src/logger.ts | 2 +- 4 files changed, 7 insertions(+), 7 deletions(-) diff --git a/packages/mermaid/src/diagrams/gantt/ganttDb.js b/packages/mermaid/src/diagrams/gantt/ganttDb.js index fa872027d..006d4e7a6 100644 --- a/packages/mermaid/src/diagrams/gantt/ganttDb.js +++ b/packages/mermaid/src/diagrams/gantt/ganttDb.js @@ -1,8 +1,8 @@ import { sanitizeUrl } from '@braintree/sanitize-url'; -import dayjs from 'dayjs'; -import dayjsIsoWeek from 'dayjs/plugin/isoWeek.js'; -import dayjsCustomParseFormat from 'dayjs/plugin/customParseFormat.js'; -import dayjsAdvancedFormat from 'dayjs/plugin/advancedFormat.js'; +import dayjs from 'dayjs/esm'; +import dayjsIsoWeek from 'dayjs/esm/plugin/isoWeek'; +import dayjsCustomParseFormat from 'dayjs/esm/plugin/customParseFormat'; +import dayjsAdvancedFormat from 'dayjs/esm/plugin/advancedFormat'; import { log } from '../../logger'; import * as configApi from '../../config'; import utils from '../../utils'; diff --git a/packages/mermaid/src/diagrams/gantt/ganttDb.spec.ts b/packages/mermaid/src/diagrams/gantt/ganttDb.spec.ts index 812cfd9b8..42eee3034 100644 --- a/packages/mermaid/src/diagrams/gantt/ganttDb.spec.ts +++ b/packages/mermaid/src/diagrams/gantt/ganttDb.spec.ts @@ -1,5 +1,5 @@ // @ts-nocheck TODO: Fix TS -import dayjs from 'dayjs'; +import dayjs from 'dayjs/esm'; import ganttDb from './ganttDb'; import { convert } from '../../tests/util'; diff --git a/packages/mermaid/src/diagrams/gantt/ganttRenderer.js b/packages/mermaid/src/diagrams/gantt/ganttRenderer.js index 78bf2fcea..3252194ca 100644 --- a/packages/mermaid/src/diagrams/gantt/ganttRenderer.js +++ b/packages/mermaid/src/diagrams/gantt/ganttRenderer.js @@ -1,4 +1,4 @@ -import dayjs from 'dayjs'; +import dayjs from 'dayjs/esm'; import { log } from '../../logger'; import { select, diff --git a/packages/mermaid/src/logger.ts b/packages/mermaid/src/logger.ts index 44b98315c..b45a5bcba 100644 --- a/packages/mermaid/src/logger.ts +++ b/packages/mermaid/src/logger.ts @@ -2,7 +2,7 @@ /* eslint-disable @typescript-eslint/no-unused-vars */ /* eslint-disable @typescript-eslint/no-empty-function */ /* eslint-disable no-console */ -import dayjs from 'dayjs'; +import dayjs from 'dayjs/esm'; export type LogLevel = 'trace' | 'debug' | 'info' | 'warn' | 'error' | 'fatal'; From 37eb100bb21be4263f416d8fbeba56f435b38021 Mon Sep 17 00:00:00 2001 From: Emerson Bottero Date: Sat, 8 Apr 2023 23:50:10 -0300 Subject: [PATCH 2/2] chore: add files to imports --- packages/mermaid/src/diagrams/gantt/ganttDb.js | 8 ++++---- packages/mermaid/src/diagrams/gantt/ganttDb.spec.ts | 2 +- packages/mermaid/src/diagrams/gantt/ganttRenderer.js | 2 +- packages/mermaid/src/logger.ts | 2 +- 4 files changed, 7 insertions(+), 7 deletions(-) diff --git a/packages/mermaid/src/diagrams/gantt/ganttDb.js b/packages/mermaid/src/diagrams/gantt/ganttDb.js index 006d4e7a6..6ce5336fd 100644 --- a/packages/mermaid/src/diagrams/gantt/ganttDb.js +++ b/packages/mermaid/src/diagrams/gantt/ganttDb.js @@ -1,8 +1,8 @@ import { sanitizeUrl } from '@braintree/sanitize-url'; -import dayjs from 'dayjs/esm'; -import dayjsIsoWeek from 'dayjs/esm/plugin/isoWeek'; -import dayjsCustomParseFormat from 'dayjs/esm/plugin/customParseFormat'; -import dayjsAdvancedFormat from 'dayjs/esm/plugin/advancedFormat'; +import dayjs from 'dayjs/esm/index.js'; +import dayjsIsoWeek from 'dayjs/esm/plugin/isoWeek/index.js'; +import dayjsCustomParseFormat from 'dayjs/esm/plugin/customParseFormat/index.js'; +import dayjsAdvancedFormat from 'dayjs/esm/plugin/advancedFormat/index.js'; import { log } from '../../logger'; import * as configApi from '../../config'; import utils from '../../utils'; diff --git a/packages/mermaid/src/diagrams/gantt/ganttDb.spec.ts b/packages/mermaid/src/diagrams/gantt/ganttDb.spec.ts index 42eee3034..7dc2e2a59 100644 --- a/packages/mermaid/src/diagrams/gantt/ganttDb.spec.ts +++ b/packages/mermaid/src/diagrams/gantt/ganttDb.spec.ts @@ -1,5 +1,5 @@ // @ts-nocheck TODO: Fix TS -import dayjs from 'dayjs/esm'; +import dayjs from 'dayjs/esm/index.js'; import ganttDb from './ganttDb'; import { convert } from '../../tests/util'; diff --git a/packages/mermaid/src/diagrams/gantt/ganttRenderer.js b/packages/mermaid/src/diagrams/gantt/ganttRenderer.js index 3252194ca..fb692828f 100644 --- a/packages/mermaid/src/diagrams/gantt/ganttRenderer.js +++ b/packages/mermaid/src/diagrams/gantt/ganttRenderer.js @@ -1,4 +1,4 @@ -import dayjs from 'dayjs/esm'; +import dayjs from 'dayjs/esm/index.js'; import { log } from '../../logger'; import { select, diff --git a/packages/mermaid/src/logger.ts b/packages/mermaid/src/logger.ts index b45a5bcba..da5e8a221 100644 --- a/packages/mermaid/src/logger.ts +++ b/packages/mermaid/src/logger.ts @@ -2,7 +2,7 @@ /* eslint-disable @typescript-eslint/no-unused-vars */ /* eslint-disable @typescript-eslint/no-empty-function */ /* eslint-disable no-console */ -import dayjs from 'dayjs/esm'; +import dayjs from 'dayjs/esm/index.js'; export type LogLevel = 'trace' | 'debug' | 'info' | 'warn' | 'error' | 'fatal';