Hey guys, I was surprised to see ember-cli-typescript encourages folks to publish Typescript.
My expectation was:
- published
.d.ts and .js files, but not .ts files
What i see:
- published '.d.ts' and '.ts'
Why is I believe this a problem:
- I believe, but do correct me if I am wrong, but publishing the TS itself isn't the TS recommendation
- publishing TS, and having the consuming app process creates both a build time and dependency liability penalty on the consuming app.
- for example,
@ember/string today cannot simply install @ember/test-helpers without crashing due to unexpected TS syntax, without updating/fixing its own dependencies.
- for example, functioning apps now have excessive dependencies which could be "precompiled" away.
My current thoughts on solving (early, but evolving, would love input):
Publish only .js + .d.ts, and have all TS related build dependencies as dev dependencies.
Local add-on development, including linking, would be handled as:
tsc -p tsconfig.json --noEmit is used for linting by editor + yarn lint
- the ember build pipeline would simply strip
ts via @babel/preset-typescript (maybe under the hood via https://github.com/stefanpenner/broccoli-babel-preset-typescript)
- prepublish would produce: (1) babel stripped
.js files (2) typescript produced d.ts files
.npmignore and .gitignore would be use to ensure only the right files are published and committed.
Hey guys, I was surprised to see ember-cli-typescript encourages folks to publish Typescript.
My expectation was:
.d.tsand.jsfiles, but not.tsfilesWhat i see:
Why is I believe this a problem:
@ember/stringtoday cannot simply install@ember/test-helperswithout crashing due to unexpected TS syntax, without updating/fixing its own dependencies.My current thoughts on solving (early, but evolving, would love input):
Publish only
.js+.d.ts, and have all TS related build dependencies as dev dependencies.Local add-on development, including linking, would be handled as:
tsc -p tsconfig.json --noEmitis used for linting by editor +yarn linttsvia@babel/preset-typescript(maybe under the hood via https://github.com/stefanpenner/broccoli-babel-preset-typescript).jsfiles (2) typescript producedd.tsfiles.npmignoreand.gitignorewould be use to ensure only the right files are published and committed.