Skip to content

Commit

Permalink
Merge pull request #951 from 3YOURMIND/explicit-file-imports-from-nod…
Browse files Browse the repository at this point in the history
…e-modules

fix(all): comply to esm standard by providing full path for file imports
  • Loading branch information
FlorianWendelborn authored Jun 20, 2024
2 parents aeaff40 + c1adbc3 commit 49936e6
Show file tree
Hide file tree
Showing 40 changed files with 56 additions and 56 deletions.
2 changes: 1 addition & 1 deletion eslint.config.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ const config = tseslint.config(
'error',
{
message:
"Avoid direct imports from lodash; e.g. import foo from 'lodash/foo' instead of import { foo } from 'lodash'",
"Avoid direct imports from lodash; e.g. import foo from 'lodash/foo.js' instead of import { foo } from 'lodash'",
name: 'lodash',
},
],
Expand Down
4 changes: 2 additions & 2 deletions packages/documentation/components/ComponentInfo.vue
Original file line number Diff line number Diff line change
Expand Up @@ -148,8 +148,8 @@
import { KtHeading, Kotti } from '@3yourmind/kotti-ui'
import { Yoco } from '@3yourmind/yoco'
import { Dashes } from '@metatypes/typography'
import castArray from 'lodash/castArray'
import kebabCase from 'lodash/kebabCase'
import castArray from 'lodash/castArray.js'
import kebabCase from 'lodash/kebabCase.js'
import type { PropType } from 'vue'
import { computed, defineComponent, ref } from 'vue'
Expand Down
4 changes: 2 additions & 2 deletions packages/documentation/data/menu.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,8 @@ import {
KtValueLabel,
} from '@3yourmind/kotti-ui'
import { Yoco } from '@3yourmind/yoco'
import kebabCase from 'lodash/kebabCase'
import startCase from 'lodash/startCase'
import kebabCase from 'lodash/kebabCase.js'
import startCase from 'lodash/startCase.js'

export enum Tag {
CSS = 'css',
Expand Down
2 changes: 1 addition & 1 deletion packages/documentation/pages/changelog.vue
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@
import { Octokit } from '@octokit/rest'
import type { Endpoints } from '@octokit/types'
import dayjs from 'dayjs'
import cloneDeep from 'lodash/cloneDeep'
import cloneDeep from 'lodash/cloneDeep.js'
import { marked } from 'marked'
import naturalSort from 'natural-sort'
import type { Ref } from 'vue'
Expand Down
2 changes: 1 addition & 1 deletion packages/documentation/pages/usage/components/comment.vue
Original file line number Diff line number Diff line change
Expand Up @@ -239,7 +239,7 @@
<script lang="ts">
import type { Kotti } from '@3yourmind/kotti-ui'
import { KtComment } from '@3yourmind/kotti-ui'
import escape from 'lodash/escape'
import escape from 'lodash/escape.js'
import { defineComponent, ref } from 'vue'
import ComponentInfo from '~/components/ComponentInfo.vue'
Expand Down
2 changes: 1 addition & 1 deletion packages/documentation/pages/usage/components/filters.vue
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,7 @@

<script lang="ts">
import { Kotti, KtFilters } from '@3yourmind/kotti-ui'
import cloneDeep from 'lodash/cloneDeep'
import cloneDeep from 'lodash/cloneDeep.js'
import { computed, defineComponent, ref } from 'vue'
import { getLast, today } from '../../../utilities/date'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -751,7 +751,7 @@ import {
} from '@3yourmind/kotti-ui'
import { Yoco } from '@3yourmind/yoco'
import { TimeConversion } from '@metatypes/units'
import cloneDeep from 'lodash/cloneDeep'
import cloneDeep from 'lodash/cloneDeep.js'
import { computed, defineComponent, ref } from 'vue'
import { useRouter } from '../../../hooks/use-router'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,7 @@

<script lang="ts">
import { Kotti, KtValueLabel } from '@3yourmind/kotti-ui'
import cloneDeep from 'lodash/cloneDeep'
import cloneDeep from 'lodash/cloneDeep.js'
import { computed, defineComponent, ref } from 'vue'
import { generateComponentCode } from '../../../utilities/pages'
Expand Down
2 changes: 1 addition & 1 deletion packages/kotti-ui/source/kotti-button/KtSplitButton.vue
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@

<script lang="ts">
import { Yoco } from '@3yourmind/yoco'
import omit from 'lodash/omit'
import omit from 'lodash/omit.js'
import {
computed,
defineComponent,
Expand Down
2 changes: 1 addition & 1 deletion packages/kotti-ui/source/kotti-comment/KtComment.vue
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@
</template>

<script lang="ts">
import omit from 'lodash/omit'
import omit from 'lodash/omit.js'
import { computed, defineComponent, ref } from 'vue'
import { useTranslationNamespace } from '../kotti-i18n/hooks'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@
</template>

<script lang="ts">
import pick from 'lodash/pick'
import pick from 'lodash/pick.js'
import { defineComponent, ref } from 'vue'
import { makeProps } from '../../make-props'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@

<script lang="ts">
import { Yoco } from '@3yourmind/yoco'
import isNil from 'lodash/isNil'
import isNil from 'lodash/isNil.js'
import { computed, defineComponent, onMounted, onUnmounted, ref } from 'vue'
import { KottiButton } from '../../kotti-button/types'
Expand Down
2 changes: 1 addition & 1 deletion packages/kotti-ui/source/kotti-comment/utilities.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import escape from 'lodash/escape'
import escape from 'lodash/escape.js'

export const defaultParser = (message: string): string => escape(message)

Expand Down
4 changes: 2 additions & 2 deletions packages/kotti-ui/source/kotti-field-date/el-locales.d.ts
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
declare module 'element-ui/lib/locale'
declare module 'element-ui/lib/locale/lang/*'
declare module 'element-ui/lib/locale/index.js'
declare module 'element-ui/lib/locale/lang/*.js'
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@

<script lang="ts">
import { Yoco } from '@3yourmind/yoco'
import isError from 'lodash/isError'
import isError from 'lodash/isError.js'
import {
computed,
defineComponent,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@
</template>

<script lang="ts">
import omit from 'lodash/omit'
import omit from 'lodash/omit.js'
import { computed, defineComponent } from 'vue'
import type { InputHTMLAttributes } from 'vue/types/jsx'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@
</template>

<script lang="ts">
import camelCase from 'lodash/camelCase'
import camelCase from 'lodash/camelCase.js'
import {
computed,
defineComponent,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { useTippy } from '@3yourmind/vue-use-tippy'
import castArray from 'lodash/castArray'
import castArray from 'lodash/castArray.js'
import type { Props as TippyProps } from 'tippy.js'
import type { Ref } from 'vue'
import { computed, inject, ref } from 'vue'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@
</template>

<script lang="ts">
import omit from 'lodash/omit'
import omit from 'lodash/omit.js'
import { computed, defineComponent } from 'vue'
import { KtField } from '../kotti-field'
Expand Down
2 changes: 1 addition & 1 deletion packages/kotti-ui/source/kotti-field/KtField.vue
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@

<script lang="ts">
import { Yoco } from '@3yourmind/yoco'
import debounce from 'lodash/debounce'
import debounce from 'lodash/debounce.js'
import type { PropType } from 'vue'
import { computed, defineComponent, ref } from 'vue'
import type { VNode } from 'vue'
Expand Down
2 changes: 1 addition & 1 deletion packages/kotti-ui/source/kotti-field/hooks.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import cloneDeep from 'lodash/cloneDeep'
import cloneDeep from 'lodash/cloneDeep.js'
import type { Ref } from 'vue'
import {
computed,
Expand Down
2 changes: 1 addition & 1 deletion packages/kotti-ui/source/kotti-filters/KtFilters.vue
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@
<script lang="ts">
import { useTippy } from '@3yourmind/vue-use-tippy'
import { Yoco } from '@3yourmind/yoco'
import castArray from 'lodash/castArray'
import castArray from 'lodash/castArray.js'
import type { PropType } from 'vue'
import { computed, defineComponent, ref } from 'vue'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@
</template>

<script lang="ts">
import cloneDeep from 'lodash/cloneDeep'
import cloneDeep from 'lodash/cloneDeep.js'
import { defineComponent, inject, computed } from 'vue'
import { KT_FORM_CONTEXT } from '../kotti-form/constants'
Expand Down
2 changes: 1 addition & 1 deletion packages/kotti-ui/source/kotti-form/KtForm.vue
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
</template>

<script lang="ts">
import cloneDeep from 'lodash/cloneDeep'
import cloneDeep from 'lodash/cloneDeep.js'
import type { PropType } from 'vue'
import { computed, defineComponent, provide, reactive } from 'vue'
Expand Down
12 changes: 6 additions & 6 deletions packages/kotti-ui/source/kotti-i18n/hooks.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
import elementLocale from 'element-ui/lib/locale'
import elementDe from 'element-ui/lib/locale/lang/de'
import elementEn from 'element-ui/lib/locale/lang/en'
import elementEs from 'element-ui/lib/locale/lang/es'
import elementFr from 'element-ui/lib/locale/lang/fr'
import elementJa from 'element-ui/lib/locale/lang/ja'
import elementLocale from 'element-ui/lib/locale/index.js'
import elementDe from 'element-ui/lib/locale/lang/de.js'
import elementEn from 'element-ui/lib/locale/lang/en.js'
import elementEs from 'element-ui/lib/locale/lang/es.js'
import elementFr from 'element-ui/lib/locale/lang/fr.js'
import elementJa from 'element-ui/lib/locale/lang/ja.js'
import type { Ref, UnwrapRef } from 'vue'
import { computed, inject, provide, reactive, watch } from 'vue'

Expand Down
2 changes: 1 addition & 1 deletion packages/kotti-ui/source/kotti-navbar/KtNavbar.vue
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@
<script lang="ts">
import { useTippy } from '@3yourmind/vue-use-tippy'
import { Yoco } from '@3yourmind/yoco'
import castArray from 'lodash/castArray'
import castArray from 'lodash/castArray.js'
import { computed, defineComponent, provide, ref, watch } from 'vue'
import { makeProps } from '../make-props'
Expand Down
2 changes: 1 addition & 1 deletion packages/kotti-ui/source/kotti-popover/KtPopover.vue
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@

<script lang="ts">
import { useTippy } from '@3yourmind/vue-use-tippy'
import castArray from 'lodash/castArray'
import castArray from 'lodash/castArray.js'
import type { Props as TippyProps } from 'tippy.js'
import {
computed,
Expand Down
4 changes: 2 additions & 2 deletions packages/kotti-ui/source/kotti-table/KtTable.vue
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,8 @@
<script lang="ts">
/* eslint-disable @typescript-eslint/explicit-module-boundary-types */
/* eslint-disable @typescript-eslint/no-explicit-any */
import isEqual from 'lodash/isEqual'
import pick from 'lodash/pick'
import isEqual from 'lodash/isEqual.js'
import pick from 'lodash/pick.js'
import { TableBody } from './components/TableBody'
import TableHeader from './components/TableHeader.vue'
Expand Down
2 changes: 1 addition & 1 deletion packages/kotti-ui/source/kotti-table/KtTableColumn.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/* eslint-disable @typescript-eslint/no-explicit-any */
import pick from 'lodash/pick'
import pick from 'lodash/pick.js'

import {
COLUMN_TYPE,
Expand Down
2 changes: 1 addition & 1 deletion packages/kotti-ui/source/kotti-table/KtTableProvider.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/* eslint-disable @typescript-eslint/no-explicit-any */
import pick from 'lodash/pick'
import pick from 'lodash/pick.js'

import { KT_TABLE_STATE_PROVIDER } from './constants'
import KtTable, { INITIAL_TABLE_STORE_PROPS } from './KtTable.vue'
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/* eslint-disable @typescript-eslint/no-explicit-any */
import property from 'lodash/property'
import property from 'lodash/property.js'

import { KT_TABLE, KT_STORE, KT_LAYOUT } from '../constants'
import type { CreateElement } from 'vue'
Expand Down
2 changes: 1 addition & 1 deletion packages/kotti-ui/source/kotti-table/logic/column.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/* eslint-disable @typescript-eslint/no-explicit-any */
/* eslint-disable @typescript-eslint/explicit-module-boundary-types */
import pick from 'lodash/pick'
import pick from 'lodash/pick.js'
import Vue from 'vue'

import { PUBLIC_COLUMN_PROPS } from '../constants'
Expand Down
2 changes: 1 addition & 1 deletion packages/kotti-ui/source/kotti-table/logic/disable.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/* eslint-disable @typescript-eslint/no-explicit-any */
import negate from 'lodash/negate'
import negate from 'lodash/negate.js'
import type { Store } from './types'

export const defaultState: Store.StateComponents.Disable = {
Expand Down
2 changes: 1 addition & 1 deletion packages/kotti-ui/source/kotti-table/logic/expand.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/* eslint-disable @typescript-eslint/no-explicit-any */
import isEqual from 'lodash/isEqual'
import isEqual from 'lodash/isEqual.js'
import type { Store } from './types'

export const defaultState: Store.StateComponents.Expand = {
Expand Down
2 changes: 1 addition & 1 deletion packages/kotti-ui/source/kotti-table/logic/order.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/* eslint-disable @typescript-eslint/explicit-module-boundary-types */
/* eslint-disable @typescript-eslint/no-explicit-any */
import pick from 'lodash/pick'
import pick from 'lodash/pick.js'

import { setColumnsArray, getColumnIndex, getColumnRealIndex } from './column'
import type { Store } from './types'
Expand Down
4 changes: 2 additions & 2 deletions packages/kotti-ui/source/kotti-table/logic/select.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/* eslint-disable @typescript-eslint/explicit-module-boundary-types */
/* eslint-disable @typescript-eslint/no-explicit-any */
import debounce from 'lodash/debounce'
import isEqual from 'lodash/isEqual'
import debounce from 'lodash/debounce.js'
import isEqual from 'lodash/isEqual.js'
import type { Store } from './types'

function toggleRowSelection(state: any, row: any, selected: any) {
Expand Down
4 changes: 2 additions & 2 deletions packages/kotti-ui/source/kotti-table/logic/sort.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@
/* eslint-disable @typescript-eslint/no-explicit-any */
/* eslint-disable no-param-reassign */

import pick from 'lodash/pick'
import property from 'lodash/property'
import pick from 'lodash/pick.js'
import property from 'lodash/property.js'

import { IS_ASC, IS_DSC, PUBLIC_SORT_PROPS } from '../constants'
import { KottiTable } from '../types'
Expand Down
8 changes: 4 additions & 4 deletions packages/kotti-ui/source/kotti-table/logic/store.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
/* eslint-disable @typescript-eslint/explicit-module-boundary-types */
/* eslint-disable @typescript-eslint/no-explicit-any */
import cloneDeep from 'lodash/cloneDeep'
import isUndefined from 'lodash/isUndefined'
import negate from 'lodash/negate'
import pickBy from 'lodash/pickBy'
import cloneDeep from 'lodash/cloneDeep.js'
import isUndefined from 'lodash/isUndefined.js'
import negate from 'lodash/negate.js'
import pickBy from 'lodash/pickBy.js'

import * as column from './column'
import * as disable from './disable'
Expand Down
4 changes: 2 additions & 2 deletions packages/kotti-ui/source/make-props.test.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import castArray from 'lodash/castArray'
import isEqual from 'lodash/isEqual'
import castArray from 'lodash/castArray.js'
import isEqual from 'lodash/isEqual.js'
import { expect, describe, it, beforeAll } from 'vitest'
import type { PropOptions, PropType } from 'vue'
import { z } from 'zod'
Expand Down
4 changes: 2 additions & 2 deletions packages/kotti-ui/source/make-props.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/* eslint-disable @typescript-eslint/no-unnecessary-condition -- disable as only intentionally-set DEBUG flags are being marked */
import cloneDeep from 'lodash/cloneDeep'
import uniq from 'lodash/uniq'
import cloneDeep from 'lodash/cloneDeep.js'
import uniq from 'lodash/uniq.js'
import type { PropOptions, PropType } from 'vue'
import type { Prop } from 'vue/types/options'
import { z } from 'zod'
Expand Down

0 comments on commit 49936e6

Please sign in to comment.