In #392, we introduced workspaces to ember-welcome-page. This lets us (any contributor who hasn't had to introduce the v2 addon format before) confidently introduce TypeScript by referring to:
Other v2 addons that use workspaces and TypeScript
This pull request completes the minimum requirements for #387. However, before we release a new version (a major version release will be needed due to #388), I'd like to make 2-3 additional pull requests to increase test coverage and ease future maintenance.
For review, please check commits 3 and 5, which form the core of the work.
Testing
In addition to checking that CI passes, I ran yarn build locally at the root directory. This command now creates ember-welcome-page/dist/components/welcome-page.d.ts (and the corresponding .d.ts.map file):
import Component from '@glimmer/component';
declare class WelcomePageComponent extends Component {
get rootURL(): string;
get urlForEmberGuides(): string;
}
export { WelcomePageComponent as default };
//# sourceMappingURL=components/welcome-page.d.ts.map
Another way to test is to run yarn start at the root directory. When you visit http://localhost:4200, you should be able to see the <WelcomePage> component render without an error.
References
In addition to the TypeScript project that embroider-build/addon-blueprint generates, I looked at what Ember blueprint currently generates for a TypeScript project. The latter helps with maintaining files such as .eslintrc.js.
Description
In #392, we introduced workspaces to
ember-welcome-page
. This lets us (any contributor who hasn't had to introduce the v2 addon format before) confidently introduce TypeScript by referring to:embroider-build/addon-blueprint
generates with the--typescript
flagThis pull request completes the minimum requirements for #387. However, before we release a new version (a major version release will be needed due to #388), I'd like to make 2-3 additional pull requests to increase test coverage and ease future maintenance.
For review, please check commits 3 and 5, which form the core of the work.
Testing
In addition to checking that CI passes, I ran
yarn build
locally at the root directory. This command now createsember-welcome-page/dist/components/welcome-page.d.ts
(and the corresponding.d.ts.map
file):Another way to test is to run
yarn start
at the root directory. When you visit http://localhost:4200, you should be able to see the<WelcomePage>
component render without an error.References
In addition to the TypeScript project that
embroider-build/addon-blueprint
generates, I looked at what Ember blueprint currently generates for a TypeScript project. The latter helps with maintaining files such as.eslintrc.js
.https://github.com/ember-cli/ember-cli/blob/v4.9.2/blueprints/app/files/.eslintrc.js