Skip to content

Fix/clean install issues - #654

Open
wouter-athom wants to merge 9 commits into
developfrom
fix/clean-install-issues
Open

wouter-athom wants to merge 9 commits into
developfrom
fix/clean-install-issues

Conversation

@wouter-athom

@wouter-athom wouter-athom commented Aug 25, 2026

Copy link
Copy Markdown

TypeScript 7 shipped with a new API, breaking tools like ESLint. To prevent this, TypeScript 6 and 7 are installed in tandem. Tools wil use the tsc6 executable instead, so they run with TypeScript v6. Running npx tsc will use TypeScript 7 to benefit from it's increased performance.

For the device.ts template the linter rule no-misused-promises was disabled, since the return types on some of the methods are wrong. They are all awaited in the SDK. Keeping the right types in the template has priority over a linter rule. Once the types are updated and correct, this linter rule should be enabled again.

Also updated the TypeScript app and driver templates to use export default instead of module.exports to prevent linter errors.

ESLint doesn't work with typescript 7. There's a package called
typescript6 that can be installed in tandem with typescript 7. This
allows users to run tsc using typescript 7, and tools like eslint to run
with ts6.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR updates the Homey CLI app generator to address install/tooling breakage caused by the TypeScript 7 API changes, and adjusts the TypeScript app template to reduce linting friction.

Changes:

  • When generating a TypeScript app with ESLint enabled, installs TypeScript 6 and an additional aliased TypeScript package intended for tsc usage.
  • Updates the generated app’s ESLint dev dependency from ESLint v7 to ESLint v8.
  • Changes the TypeScript app template export style from module.exports to export default.

Reviewed changes

Copilot reviewed 3 out of 4 changed files in this pull request and generated 3 comments.

File Description
lib/App.js Adjusts generated devDependencies (TypeScript aliasing + ESLint version) during app creation.
assets/templates/app/app.ts Updates the TS app template to use export default instead of module.exports.

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment thread lib/App.js Outdated
Comment thread lib/App.js
Comment thread assets/templates/app/app.ts
Copilot AI review requested due to automatic review settings August 25, 2026 08:07
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 3 out of 4 changed files in this pull request and generated no new comments.

Suppressed comments (2)

lib/App.js:3618

  • The new explanatory comment is now misleading and contains typos (e.g. “it's”/“lastest”). It also says the ESLint version can't be updated, but this same hunk updates ESLint from v7 to v8, so the rationale should be corrected to avoid confusion for future maintainers.
      // eslint-config-athom currently relies on tooling that isn't compatible with TypeScript 7 yet.
      // As a workaround, install TypeScript 6 under the `typescript` package name for ESLint,
      // and also install the latest TypeScript under an alias for running `tsc`.
      if (answers.eslint) {

assets/templates/app/app.ts:6

  • Switching the TypeScript app entry template from module.exports = to export default will compile to a CommonJS module that exports default (given the generated tsconfig extends @tsconfig/node16 and the generated package.json does not set type: "module"). New apps may fail to load if the Homey runtime expects module.exports (as the JS template and other TS templates do).
import Homey from 'homey';

export default class MyApp extends Homey.App {

Copilot AI review requested due to automatic review settings August 25, 2026 08:11

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 3 out of 4 changed files in this pull request and generated 1 comment.

Suppressed comments (1)

lib/App.js:3622

  • The TypeScript “v6 + v7” workaround doesn’t pin the aliased TypeScript version: @typescript/native@npm:typescript will always resolve to whatever typescript is latest (could become v8+), which contradicts the PR description and risks reintroducing the same tool breakage later. Pin the alias to the intended major (v7) so generated apps remain stable over time.
        await NpmCommands.installDev(
          ['typescript@npm:@typescript/typescript6', '@typescript/native@npm:typescript'],
          { appPath },
        );

Comment thread assets/templates/app/app.ts
…ises rule

The drivers templates were using module.exports instead of export
default. They also didn't have access modifiers.

Since the linter was updated, the no-misuses-promsies rule now fires on
some methods in device.ts that have a wrong type definition. They all
return promises, but some of the types dont' reflect this properly.
Copilot AI review requested due to automatic review settings August 25, 2026 09:12

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 5 out of 6 changed files in this pull request and generated 2 comments.

Suppressed comments (1)

lib/App.js:3622

  • The TypeScript 6/7 workaround doesn’t actually guarantee that npm run build/npx tsc use TypeScript 7. npm run build is set to tsc, and transpileToTypescript() also calls npx tsc, both of which resolve the tsc binary from node_modules/.bin. With typescript installed as @typescript/typescript6, the tsc binary is likely v6 (and the second aliased install also provides a conflicting tsc binary), which makes the effective compiler version ambiguous and contradicts the intent described in the comment/PR description.

Consider making the TypeScript 7 invocation explicit (e.g., by updating the generated build script to run the TS7 binary by path) and ensuring there is no tsc bin collision between the two installed packages.

      // eslint-config-athom currently relies on tooling that isn't compatible with TypeScript 7 yet.
      // As a workaround, install TypeScript 6 under the `typescript` package name for ESLint,
      // and also install the latest TypeScript under an alias for running `tsc`.
      if (answers.eslint) {
        await NpmCommands.installDev(
          ['typescript@npm:@typescript/typescript6', '@typescript/native@npm:typescript'],
          { appPath },
        );

Comment thread assets/templates/app/drivers/device.ts Outdated
Comment thread assets/templates/app/drivers/device.ts
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Copilot AI review requested due to automatic review settings August 25, 2026 09:28

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 5 out of 6 changed files in this pull request and generated no new comments.

Suppressed comments (1)

Previously missed (1) — in code that hasn't changed since the last review.

lib/App.js:3622

  • The TypeScript 7 install is currently unpinned (@typescript/native@npm:typescript), which means a future TypeScript 8+ release could get pulled in and re-break ESLint/tooling compatibility. Pin the alias to the intended major (per PR description: 7.x) and align the comment wording accordingly.
      // eslint-config-athom currently relies on tooling that isn't compatible with TypeScript 7 yet.
      // As a workaround, install TypeScript 6 under the `typescript` package name for ESLint,
      // and also install the latest TypeScript under an alias for running `tsc`.
      if (answers.eslint) {
        await NpmCommands.installDev(

After updating the TS templates to use ESM exports, the package.json
needs `type: 'module'` to run the app.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 Changes recommended

The new widget API templates have small but concrete template-quality issues (statement termination consistency and route/handler consistency) that should be corrected before merging.

Once you've addressed the issues Copilot identified, you can request another Copilot review.

Review details
  • Files reviewed: 8/9 changed files
  • Comments generated: 3
  • Review effort level: Lite

Comment thread assets/templates/app/widgets/api.mjs
Comment thread assets/templates/app/widgets/api.mjs Outdated
Comment thread assets/templates/app/widgets/api.ts
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

2 participants