Open fry69 opened 4 months ago
@nullvoxpopuli can you confirm that applying the same solution/codefix from https://github.com/ember-cli/ember-page-title/pull/283 would be the proper course of action here?
Can confirm. These folks have used that solution so far: https://github.com/NullVoxPopuli/fix-bad-declaration-output/network/dependents
Gonna add it to the ts blueprint for v2 addons
Until the fix has landed and file in the node-modules
directory tend to get replaced to their original state, here is a python script to remove those triple-slash lines.
import os
import re
dir_path = './node_modules/ember-concurrency/declarations/helpers'
for file_name in os.listdir(dir_path):
if file_name.endswith('.d.ts'):
file_path = os.path.join(dir_path, file_name)
with open(file_path, 'r') as f:
file_contents = f.read()
file_contents = re.sub('^/// <reference types="[^"]+" />', '', file_contents, flags=re.MULTILINE)
with open(file_path, 'w') as f:
f.write(file_contents)
Was digging in to this yesterday, and it looks like the generated declarations may slightly be wrong? They're not using declare
when exporting a const, and that breaks the ts parser used in fix-bad-declaration-output
Should we be using generated declarations at all? Last I knew ember-concurrency
was still using a hand-rolled index.d.ts
and the bulk of the actual implementation was still in JS, so I wonder if things were unintentionally switched over as part of the v2 migration.
Edit: ah, I was getting trolled by the start:types
script not having the extra copy step cp src/index.d.ts declarations.d.ts
step that the build:types
script has.
In a fresh 5.6.0 install (
ember new app --typescript
) with just ember-concurrency 4.0.0 and most recent Glint (ember install ember-concurrency
and following the basic instructions from https://typed-ember.gitbook.io/glint/environments/ember/installation), I get these errors when I run Glint on the terminal:There are no
preview
types inember-source
for 5.6.0?Looks like
ember-page-title
has had a similar issue with generated triple-slash directives, see https://github.com/ember-cli/ember-page-title/pull/283I can confirm that manually removing these generated
///
lines fixes this issue for me.