ember-cli / ember-cli/ember-cli-htmlbars

app's TS files do not properly overwrite an addon's JS files

オープン
#774 コメント 2 件 リアクション 0 件 担当者 0 名 GitHub で見る
主要言語
JavaScript
スター
77
フォーク
65
PR マージ指標
30日以内にマージされた PR はありません

説明

I have the following example component in my addon:

**my-addon/addon/components/example/index.ts**
```
import templateOnly from '@ember/component/template-only';
export default templateOnly();
```hbs
**my-addon/addon/components/example/index.hbs**
```

Whatever

```
**my-addon/app/components/example/index.js**
```js
export { default } from 'my-addon/components/loading';
```

Then in my app I completely replace it with a new template AND "backing class" with some Glint because why not:
**my-app/app/components/index.ts**
```ts
import templateOnlyComponent from '@ember/component/template-only';

interface LoadingSignature {
Element: HTMLElement; //
}

const LoadingComponent = templateOnlyComponent();
export default LoadingComponent;

declare module '@glint/environment-ember-loose/registry' {
export default interface Registry {
Loading: typeof LoadingComponent;
}
}
```
**my-app/app/components/index.hbs**
```hbs

Whatever

```

This does not work and throws the following error:
![image](https://github.com/ember-cli/ember-cli-htmlbars/assets/55881713/6736d645-e1ca-4d43-be86-d45984359dda)

It does work when using a JS file to overwrite the component:
**my-app/app/components/index.js**
```ts
// I have lost all my Glint stuff, because it's a JS file :'(
import templateOnlyComponent from '@ember/component/template-only';
const LoadingComponent = templateOnlyComponent();
export default LoadingComponent;
```
**my-app/app/components/index.hbs**
```hbs

Whatever

```

コントリビューションガイド

このリポジトリのコントリビューションガイドは索引されていません

評価

この issue はまだ評価されていません。

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。