Skip to content

Commit d1e548e

Browse files
authored
Merge pull request #315 from embroider-build/rollup-declarations-plugin
Use addon-dev declarations plugin for d.ts output
2 parents 11d9163 + 3f12e8a commit d1e548e

2 files changed

Lines changed: 9 additions & 12 deletions

File tree

files/__addonLocation__/package.json

Lines changed: 5 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -13,22 +13,16 @@
1313
"declarations",
1414
"dist"
1515
],
16-
"scripts": {<% if (typescript) { %>
17-
"build": "concurrently \"<%= packageManager %>:build:*\"",
18-
"build:js": "rollup --config",
19-
"build:types": "glint --declaration",<% } else { %>
20-
"build": "rollup --config",<% } %>
16+
"scripts": {
17+
"build": "rollup --config",
2118
"lint": "concurrently \"<%= packageManager %>:lint:*(!fix)\" --names \"lint:\"",
2219
"lint:fix": "concurrently \"<%= packageManager %>:lint:*:fix\" --names \"fix:\"",
2320
"lint:hbs": "ember-template-lint . --no-error-on-unmatched-pattern",
2421
"lint:js": "eslint . --cache",
2522
"lint:hbs:fix": "ember-template-lint . --fix --no-error-on-unmatched-pattern",
2623
"lint:js:fix": "eslint . --fix",<% if (typescript) { %>
27-
"lint:types": "glint",
28-
"start": "concurrently \"<%= packageManager %>:start:*\"",
29-
"start:js": "rollup --config --watch --no-watch.clearScreen",
30-
"start:types": "glint --declaration --watch",<% } else { %>
31-
"start": "rollup --config --watch",<% } %>
24+
"lint:types": "glint",<% } %>
25+
"start": "rollup --config --watch",
3226
"test": "echo 'A v2 addon does not have tests, run tests in test-app'",
3327
"prepack": <% if (typescript) { %>"concurrently '<%= packageManager %>:build:*'"<% } else { %>"rollup --config"<% } %>
3428
},
@@ -43,7 +37,7 @@
4337
"@babel/core": "^7.25.2",
4438
<% if (typescript) { %>"@babel/plugin-transform-typescript": "^7.25.2"<% } else { %>"@babel/eslint-parser": "^7.25.1"<% } %>,
4539
"@babel/runtime": "^7.25.6",
46-
"@embroider/addon-dev": "^6.0.1",<% if (typescript) { %>
40+
"@embroider/addon-dev": "^7.1.0",<% if (typescript) { %>
4741
"@glint/core": "^1.4.0",
4842
"@glint/environment-ember-loose": "^1.4.0",
4943
"@glint/environment-ember-template-imports": "^1.4.0",

files/__addonLocation__/rollup.config.mjs

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,10 @@ export default {
5252
addon.hbs(),
5353

5454
// Ensure that .gjs files are properly integrated as Javascript
55-
addon.gjs(),
55+
addon.gjs(),<% if (typescript) { %>
56+
57+
// Emit .d.ts declaration files
58+
addon.declarations('declarations'),<% } %>
5659

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

0 commit comments

Comments
 (0)