diff --git a/plugins/decorator-transforms/index.ts b/plugins/decorator-transforms/index.ts index 01c48043..14cfab67 100644 --- a/plugins/decorator-transforms/index.ts +++ b/plugins/decorator-transforms/index.ts @@ -3,7 +3,7 @@ import type * as Babel from '@babel/core'; import type { types as t, NodePath } from '@babel/core'; -import { ImportUtil } from 'babel-import-util'; +import * as util from 'babel-import-util'; export const globalId = `dt7948`; // @ts-expect-error import * as decorators from '@babel/plugin-syntax-decorators'; @@ -35,7 +35,7 @@ export default function legacyDecoratorCompat( runtime: 'globals', ...state.opts, }; - let importUtil = new ImportUtil(t, path); + let importUtil = new util.ImportUtil(t, path); state.runtime = (target: NodePath, fnName: string) => { const { runtime } = state.optsWithDefaults; if (runtime === 'globals') { diff --git a/plugins/utils.ts b/plugins/utils.ts index a4e67982..17e6bb25 100644 --- a/plugins/utils.ts +++ b/plugins/utils.ts @@ -71,7 +71,7 @@ export function resolvePath(str: string) { } else if (str === 'helper') { str = SYMBOLS.$_helper; } else if (str === 'modifier') { - str = SYMBOLS.$_modifier; + // str = SYMBOLS.$_modifier; } return toSafeJSPath( toOptionalChaining(str) diff --git a/src/ember-compat/ember-cli-string-helpers__helpers__classify.ts b/src/ember-compat/ember-cli-string-helpers__helpers__classify.ts index 7cf64efc..a97dd497 100644 --- a/src/ember-compat/ember-cli-string-helpers__helpers__classify.ts +++ b/src/ember-compat/ember-cli-string-helpers__helpers__classify.ts @@ -1,4 +1,4 @@ -export default function classify(str) { +export default function classify(str: string) { return str .split('.') .map((part) => part.charAt(0).toUpperCase() + part.slice(1)) diff --git a/src/ember-compat/ember__component.ts b/src/ember-compat/ember__component.ts index fea02c63..b825fe3d 100644 --- a/src/ember-compat/ember__component.ts +++ b/src/ember-compat/ember__component.ts @@ -12,6 +12,7 @@ export function setComponentTemplate(tpl: any, cmp: any) { export default class EmberComponent extends Component { constructor() { + // @ts-expect-error super(...arguments); console.log('EmberComponent', ...arguments); } diff --git a/src/ember-compat/ember__object.ts b/src/ember-compat/ember__object.ts index a93e838e..3f9b40b0 100644 --- a/src/ember-compat/ember__object.ts +++ b/src/ember-compat/ember__object.ts @@ -1,11 +1,14 @@ +// @ts-expect-error unused args export function action(klass, field, descriptor) { // console.log('action', klass, field, descriptor); // if (field === 'hideToolTip') { // debugger; // } + // @ts-expect-error let bindedValue = null; return { get() { + // @ts-expect-error if (!bindedValue) { bindedValue = descriptor.value.bind(this); } diff --git a/src/ember-compat/embroider__macros.ts b/src/ember-compat/embroider__macros.ts index d6cc73b6..c4b256e4 100644 --- a/src/ember-compat/embroider__macros.ts +++ b/src/ember-compat/embroider__macros.ts @@ -1,3 +1,4 @@ +// @ts-expect-error unknown module import * as gt from '@glimmer/tracking'; export function dependencySatisfies() { return true; diff --git a/src/ember-compat/glimmer__tracking.ts b/src/ember-compat/glimmer__tracking.ts index 04d05f74..da0281f8 100644 --- a/src/ember-compat/glimmer__tracking.ts +++ b/src/ember-compat/glimmer__tracking.ts @@ -3,7 +3,9 @@ const symbolEmpty = Symbol('empty'); // let cnt = 0; export function cached( + // @ts-expect-error unused target: any, + // @ts-expect-error unused key: string, descriptor: PropertyDescriptor, ) { diff --git a/src/utils/dom.ts b/src/utils/dom.ts index 3903b3ba..3a704d96 100644 --- a/src/utils/dom.ts +++ b/src/utils/dom.ts @@ -618,12 +618,17 @@ function component( if (IS_DEV_MODE) { let ErrorOverlayClass = customElements.get('vite-error-overlay'); let errorOverlay!: Element; + // @ts-expect-error let msg = e.message; const key = originalLabel.replace('t', ''); + // @ts-expect-error if (globalThis.rawTemplates.has(key)) { + // @ts-expect-error msg = `${globalThis.rawTemplates.get(key)}\n${msg}`; } + // @ts-expect-error if (globalThis.compiledTemplate.has(key)) { + // @ts-expect-error msg = `${globalThis.compiledTemplate.get(key)}\n${msg}`; } // @ts-expect-error message may not exit @@ -658,7 +663,6 @@ function component( } } } else { - // @ts-expect-error uniqSymbol as index const fw = args[$PROPS_SYMBOL] as unknown as FwType; return _component(comp, args, fw, ctx); } @@ -684,7 +688,9 @@ function _component( try { let instance: any; + // @ts-expect-error if (comp.componentType === 'glimmer-component') { + // @ts-expect-error instance = new (comp as unknown as Component)( {}, args, @@ -696,6 +702,7 @@ function _component( } }); } else { + // @ts-expect-error instance = new (comp as unknown as Component)( args, fw, @@ -758,6 +765,7 @@ function _component( return { ctx: null, [$nodes]: [ + // @ts-expect-error e may not have message $_text(`Unable to create ComponentInstance: ${e.message}`, []), ], }; @@ -1114,8 +1122,11 @@ export const $_maybeModifier = ( modifier: any, element: HTMLElement, props: any[], - hashArgs, + hashArgs: Record ) => { + if (modifierManagers.has(modifier)) { + debugger; + } if ('emberModifier' in modifier) { const instance = new modifier(); instance.modify = instance.modify.bind(instance); @@ -1150,6 +1161,7 @@ export const $_maybeModifier = ( enumerable: true, get() { if (typeof args[key] === 'function') { + // @ts-expect-error return args[key](); } else { return args[key];