Skip to content

Commit

Permalink
Use addon-dev declarations plugin for d.ts output
Browse files Browse the repository at this point in the history
  • Loading branch information
simonihmig committed Dec 9, 2024
1 parent be1077b commit f5bac2c
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 11 deletions.
14 changes: 4 additions & 10 deletions files/__addonLocation__/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,22 +13,16 @@
"declarations",
"dist"
],
"scripts": {<% if (typescript) { %>
"build": "concurrently \"<%= packageManager %>:build:*\"",
"build:js": "rollup --config",
"build:types": "glint --declaration",<% } else { %>
"build": "rollup --config",<% } %>
"scripts": {
"build": "rollup --config",
"lint": "concurrently \"<%= packageManager %>:lint:*(!fix)\" --names \"lint:\"",
"lint:fix": "concurrently \"<%= packageManager %>:lint:*:fix\" --names \"fix:\"",
"lint:hbs": "ember-template-lint . --no-error-on-unmatched-pattern",
"lint:js": "eslint . --cache",
"lint:hbs:fix": "ember-template-lint . --fix --no-error-on-unmatched-pattern",
"lint:js:fix": "eslint . --fix",<% if (typescript) { %>
"lint:types": "glint",
"start": "concurrently \"<%= packageManager %>:start:*\"",
"start:js": "rollup --config --watch --no-watch.clearScreen",
"start:types": "glint --declaration --watch",<% } else { %>
"start": "rollup --config --watch",<% } %>
"lint:types": "glint",<% } %>
"start": "rollup --config --watch",
"test": "echo 'A v2 addon does not have tests, run tests in test-app'",
"prepack": <% if (typescript) { %>"concurrently '<%= packageManager %>:build:*'"<% } else { %>"rollup --config"<% } %>
},
Expand Down
5 changes: 4 additions & 1 deletion files/__addonLocation__/rollup.config.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,10 @@ export default {
addon.hbs(),

// Ensure that .gjs files are properly integrated as Javascript
addon.gjs(),
addon.gjs(),<% if (typescript) { %>

// Emit .d.ts declaration files
addon.declarations('declarations'),<% } %>

// addons are allowed to contain imports of .css files, which we want rollup
// to leave alone and keep in the published output.
Expand Down

0 comments on commit f5bac2c

Please sign in to comment.