Skip to content

Commit 75e4b3d

Browse files
committed
Add glint to the docs app
1 parent 2ef21dc commit 75e4b3d

10 files changed

Lines changed: 90 additions & 158 deletions

File tree

addon/package.json

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,12 @@
2727
"types": "./declarations/test-support/index.d.ts",
2828
"default": "./dist/test-support/index.js"
2929
},
30+
"./template-registry": {
31+
"types": "./declarations/template-registry.d.ts"
32+
},
33+
"./service-registry": {
34+
"types": "./declarations/service-registry.d.ts"
35+
},
3036
"./addon-main.js": "./addon-main.js"
3137
},
3238
"files": [
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
import templateOnly from '@ember/component/template-only';
2+
import type { ComponentLike } from '@glint/template';
3+
4+
const PageTitlePane = templateOnly<{
5+
Element: HTMLDivElement;
6+
Args: {
7+
title: string;
8+
};
9+
Blocks: {
10+
default: [
11+
components: {
12+
template: ComponentLike<{ Blocks: { default: [] } }>;
13+
},
14+
];
15+
};
16+
}>();
17+
18+
export default PageTitlePane;
19+
20+
declare module '@glint/environment-ember-loose/registry' {
21+
export default interface Registry {
22+
PageTitlePane: typeof PageTitlePane;
23+
}
24+
}
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
import templateOnly from '@ember/component/template-only';
2+
3+
const NestedTemplate = templateOnly<{
4+
Blocks: {
5+
default: [];
6+
};
7+
}>();
8+
9+
export default NestedTemplate;
10+
11+
declare module '@glint/environment-ember-loose/registry' {
12+
export default interface Registry {
13+
'PageTitlePane::NestedTemplate': typeof NestedTemplate;
14+
'page-title-pane/nested-template': typeof NestedTemplate;
15+
}
16+
}

docs/app/components/window-pane.hbs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,6 @@
66
{{@title}}
77
</header>
88
<div>
9-
{{yield this}}
9+
{{yield}}
1010
</div>
1111
</div>

docs/app/components/window-pane.ts

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
import templateOnly from '@ember/component/template-only';
2+
3+
const WindowPane = templateOnly<{
4+
Args: {
5+
title: string;
6+
};
7+
Blocks: {
8+
default: [];
9+
};
10+
}>();
11+
12+
export default WindowPane;
13+
14+
declare module '@glint/environment-ember-loose/registry' {
15+
export default interface Registry {
16+
WindowPane: typeof WindowPane;
17+
}
18+
}

docs/package.json

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,11 +21,14 @@
2121
"lint:hbs:fix": "ember-template-lint . --fix",
2222
"lint:js": "eslint . --cache",
2323
"lint:js:fix": "eslint . --fix",
24+
"lint:types": "glint",
2425
"release": "standard-version",
2526
"start": "ember serve",
2627
"test": "npm-run-all lint test:*",
27-
"test:ember": "ember test",
28-
"lint:types": "glint"
28+
"test:ember": "ember test"
29+
},
30+
"dependencies": {
31+
"ember-page-title": "workspace:*"
2932
},
3033
"devDependencies": {
3134
"@babel/eslint-parser": "^7.23.3",
@@ -59,7 +62,6 @@
5962
"ember-inline-svg": "^1.0.0",
6063
"ember-load-initializers": "^2.1.2",
6164
"ember-maybe-import-regenerator": "^1.0.0",
62-
"ember-page-title": "8.1.0",
6365
"ember-qunit": "^8.0.2",
6466
"ember-resolver": "^11.0.1",
6567
"ember-source": "~5.5.0",

docs/tsconfig.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
// layout, which is not resolvable with the Node resolution algorithm, to
66
// work with TypeScript.
77
"baseUrl": ".",
8+
"allowJs": true,
89
"paths": {
910
"docs/tests/*": ["tests/*"],
1011
"docs/*": ["app/*"],
@@ -14,4 +15,4 @@
1415
"glint": {
1516
"environment": ["ember-loose", "ember-template-imports"]
1617
}
17-
}
18+
}

docs/types/glint.d.ts

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,13 @@
22
import '@glint/environment-ember-loose';
33
import '@glint/environment-ember-template-imports';
44

5+
import type PageTitle from 'ember-page-title/template-registry';
6+
57
declare module '@glint/environment-ember-loose/registry' {
68
// Remove this once entries have been added! 👇
79
// eslint-disable-next-line @typescript-eslint/no-empty-interface
8-
export default interface Registry {
10+
export default interface Registry extends PageTitle {
911
// Add any registry entries from other addons here that your addon itself uses (in non-strict mode templates)
1012
// See https://typed-ember.gitbook.io/glint/using-glint/ember/using-addons
1113
}
12-
}
14+
}

0 commit comments

Comments
 (0)