add .js to relative imports
This commit is contained in:
@@ -1,7 +1,7 @@
|
||||
import { hasDefaultExport } from './has-default-export.function';
|
||||
import { isManifestClassConstructorType } from './type-guards';
|
||||
import { loadExtension } from './load-extension.function';
|
||||
import type { ManifestClass, ClassConstructor } from './types';
|
||||
import { hasDefaultExport } from './has-default-export.function.js';
|
||||
import { isManifestClassConstructorType } from './type-guards/index.js';
|
||||
import { loadExtension } from './load-extension.function.js';
|
||||
import type { ManifestClass, ClassConstructor } from './types.js';
|
||||
|
||||
//TODO: Write tests for this method:
|
||||
export async function createExtensionClass<T = unknown>(
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import { createExtensionElement } from './create-extension-element.function';
|
||||
import { isManifestElementableType } from './type-guards';
|
||||
import { createExtensionElement } from './create-extension-element.function.js';
|
||||
import { isManifestElementableType } from './type-guards/index.js';
|
||||
|
||||
export async function createExtensionElementOrFallback(
|
||||
manifest: any,
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import { hasDefaultExport } from './has-default-export.function';
|
||||
import { isManifestElementNameType } from './type-guards';
|
||||
import { loadExtension } from './load-extension.function';
|
||||
import type { HTMLElementConstructor, ManifestElement } from './types';
|
||||
import { hasDefaultExport } from './has-default-export.function.js';
|
||||
import { isManifestElementNameType } from './type-guards/index.js';
|
||||
import { loadExtension } from './load-extension.function.js';
|
||||
import type { HTMLElementConstructor, ManifestElement } from './types.js';
|
||||
|
||||
export async function createExtensionElement<ElementType extends HTMLElement>(
|
||||
manifest: ManifestElement<ElementType>
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import type { ManifestEntryPoint } from './types';
|
||||
import { hasInitExport } from './has-init-export.function';
|
||||
import { loadExtension } from './load-extension.function';
|
||||
import { UmbExtensionRegistry } from './registry/extension.registry';
|
||||
import type { ManifestEntryPoint } from './types.js';
|
||||
import { hasInitExport } from './has-init-export.function.js';
|
||||
import { loadExtension } from './load-extension.function.js';
|
||||
import { UmbExtensionRegistry } from './registry/extension.registry.js';
|
||||
import { UmbControllerHostElement } from '@umbraco-cms/backoffice/controller-api';
|
||||
|
||||
export class UmbEntryPointExtensionInitializer {
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import type { UmbEntryPointModule } from './umb-lifecycle.interface';
|
||||
import type { UmbEntryPointModule } from './umb-lifecycle.interface.js';
|
||||
|
||||
/**
|
||||
* Validate if an ESModule exports a known init function called 'onInit'
|
||||
|
||||
@@ -1,11 +1,11 @@
|
||||
export * from './registry/extension.registry';
|
||||
export * from './type-guards';
|
||||
export * from './create-extension-element.function';
|
||||
export * from './has-default-export.function';
|
||||
export * from './has-init-export.function';
|
||||
export * from './load-extension.function';
|
||||
export * from './create-extension-element-or-fallback.function';
|
||||
export * from './create-extension-class.function';
|
||||
export * from './umb-lifecycle.interface';
|
||||
export * from './entry-point-extension-initializer';
|
||||
export * from './types';
|
||||
export * from './registry/extension.registry.js';
|
||||
export * from './type-guards/index.js';
|
||||
export * from './create-extension-element.function.js';
|
||||
export * from './has-default-export.function.js';
|
||||
export * from './has-init-export.function.js';
|
||||
export * from './load-extension.function.js';
|
||||
export * from './create-extension-element-or-fallback.function.js';
|
||||
export * from './create-extension-class.function.js';
|
||||
export * from './umb-lifecycle.interface.js';
|
||||
export * from './entry-point-extension-initializer.js';
|
||||
export * from './types.js';
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import { isManifestJSType, isManifestLoaderType } from './type-guards';
|
||||
import type { ManifestWithLoader } from './types';
|
||||
import { isManifestJSType, isManifestLoaderType } from './type-guards/index.js';
|
||||
import type { ManifestWithLoader } from './types.js';
|
||||
|
||||
export async function loadExtension<T = unknown>(manifest: ManifestWithLoader<T>): Promise<T | null> {
|
||||
try {
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import { expect } from '@open-wc/testing';
|
||||
import type { ManifestElementWithElementName, ManifestKind, ManifestWithMeta } from '../types';
|
||||
import { UmbExtensionRegistry } from './extension.registry';
|
||||
import type { ManifestElementWithElementName, ManifestKind, ManifestWithMeta } from '../types.js';
|
||||
import { UmbExtensionRegistry } from './extension.registry.js';
|
||||
|
||||
describe('UmbExtensionRegistry', () => {
|
||||
let extensionRegistry: UmbExtensionRegistry<ManifestWithMeta>;
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import { BehaviorSubject, map, Observable, distinctUntilChanged, combineLatest } from 'rxjs';
|
||||
import type { ManifestTypeMap, ManifestBase, SpecificManifestTypeOrManifestBase, ManifestKind } from '../types';
|
||||
import type { ManifestTypeMap, ManifestBase, SpecificManifestTypeOrManifestBase, ManifestKind } from '../types.js';
|
||||
|
||||
function extensionArrayMemoization<T extends { alias: string }>(
|
||||
previousValue: Array<T>,
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
export * from './is-manifest-class-instance-type.function';
|
||||
export * from './is-manifest-classable-type.function';
|
||||
export * from './is-manifest-element-name-type.function';
|
||||
export * from './is-manifest-elementable-type.function';
|
||||
export * from './is-manifest-js-type.function';
|
||||
export * from './is-manifest-loader-type.function';
|
||||
export * from './is-manifest-class-instance-type.function.js';
|
||||
export * from './is-manifest-classable-type.function.js';
|
||||
export * from './is-manifest-element-name-type.function.js';
|
||||
export * from './is-manifest-elementable-type.function.js';
|
||||
export * from './is-manifest-js-type.function.js';
|
||||
export * from './is-manifest-loader-type.function.js';
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import type { ManifestClass, ManifestClassWithClassConstructor } from '../types';
|
||||
import type { ManifestClass, ManifestClassWithClassConstructor } from '../types.js';
|
||||
|
||||
export function isManifestClassConstructorType(manifest: unknown): manifest is ManifestClassWithClassConstructor {
|
||||
return typeof manifest === 'object' && manifest !== null && (manifest as ManifestClass).class !== undefined;
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import type { ManifestBase, ManifestClass } from '../types';
|
||||
import { isManifestJSType } from './is-manifest-js-type.function';
|
||||
import { isManifestLoaderType } from './is-manifest-loader-type.function';
|
||||
import { isManifestClassConstructorType } from './is-manifest-class-instance-type.function';
|
||||
import type { ManifestBase, ManifestClass } from '../types.js';
|
||||
import { isManifestJSType } from './is-manifest-js-type.function.js';
|
||||
import { isManifestLoaderType } from './is-manifest-loader-type.function.js';
|
||||
import { isManifestClassConstructorType } from './is-manifest-class-instance-type.function.js';
|
||||
|
||||
export function isManifestClassableType(manifest: ManifestBase): manifest is ManifestClass {
|
||||
return (
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import type { ManifestElement, ManifestElementWithElementName } from '../types';
|
||||
import type { ManifestElement, ManifestElementWithElementName } from '../types.js';
|
||||
|
||||
export function isManifestElementNameType(manifest: unknown): manifest is ManifestElementWithElementName {
|
||||
return typeof manifest === 'object' && manifest !== null && (manifest as ManifestElement).elementName !== undefined;
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import type { ManifestElement, ManifestBase } from '../types';
|
||||
import { isManifestElementNameType } from './is-manifest-element-name-type.function';
|
||||
import { isManifestJSType } from './is-manifest-js-type.function';
|
||||
import { isManifestLoaderType } from './is-manifest-loader-type.function';
|
||||
import type { ManifestElement, ManifestBase } from '../types.js';
|
||||
import { isManifestElementNameType } from './is-manifest-element-name-type.function.js';
|
||||
import { isManifestJSType } from './is-manifest-js-type.function.js';
|
||||
import { isManifestLoaderType } from './is-manifest-loader-type.function.js';
|
||||
|
||||
export function isManifestElementableType<ElementType extends HTMLElement = HTMLElement>(
|
||||
manifest: ManifestBase
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import type { ManifestBase, ManifestWithLoader } from '../types';
|
||||
import type { ManifestBase, ManifestWithLoader } from '../types.js';
|
||||
|
||||
export type ManifestJSType<T> = ManifestWithLoader<T> & { js: string };
|
||||
export function isManifestJSType<T>(manifest: ManifestBase | unknown): manifest is ManifestJSType<T> {
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import type { ManifestBase, ManifestWithLoader } from '../types';
|
||||
import type { ManifestBase, ManifestWithLoader } from '../types.js';
|
||||
|
||||
export type ManifestLoaderType<T> = ManifestWithLoader<T> & {
|
||||
loader: () => Promise<T>;
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import type { UmbExtensionRegistry } from './registry/extension.registry';
|
||||
import { ManifestBase } from './types';
|
||||
import type { UmbExtensionRegistry } from './registry/extension.registry.js';
|
||||
import { ManifestBase } from './types.js';
|
||||
import type { UmbControllerHostElement } from '@umbraco-cms/backoffice/controller-api';
|
||||
|
||||
export type UmbEntryPointOnInit = (
|
||||
|
||||
Reference in New Issue
Block a user