Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion ember-primitives/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,8 @@
"publint": "^0.3.17",
"rollup": "^4.57.1",
"rollup-plugin-copy": "^3.5.0",
"typescript": "^6.0.2"
"typescript": "^6.0.2",
"unplugin-isolated-decl": "^0.16.0"
},
"publishConfig": {
"registry": "https://registry.npmjs.org"
Expand Down
18 changes: 14 additions & 4 deletions ember-primitives/rollup.config.mjs
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import { Addon } from "@embroider/addon-dev/rollup";

import UnpluginIsolatedDecl from "unplugin-isolated-decl/rollup";
import { babel } from "@rollup/plugin-babel";
import copy from "rollup-plugin-copy";

Expand Down Expand Up @@ -35,10 +36,19 @@ export default {
babel({ extensions, babelHelpers: "inline" }),
addon.gjs(),
addon.keepAssets(["**/*.css"]),
addon.declarations(
"declarations",
"pnpm ember-tsc --declaration --declarationDir declarations",
),
UnpluginIsolatedDecl({
include: ["**/*.{ts,gts}"],
transformer: "oxc",
extraOutDir: "declarations",
transformOptions: {
stripInternal: true,
sourcemap: true,
},
}),
// addon.declarations(
// "declarations",
// "pnpm ember-tsc --declaration --declarationDir declarations",
// ),
addon.clean(),
copy({
targets: [
Expand Down
4 changes: 0 additions & 4 deletions ember-primitives/src/-private.ts

This file was deleted.

2 changes: 1 addition & 1 deletion ember-primitives/src/head.gts
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ export interface Signature {
};
}

function getHead() {
function getHead(): HTMLHeadElement {
return document.head;
}

Expand Down
2 changes: 1 addition & 1 deletion ember-primitives/src/helpers/body-class.ts
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ function queueUpdate() {
*
* Folks can set classes in their html and we don't want to mess with those
*/
function updateBodyClass() {
function updateBodyClass(): void {
const toAdd = classNames();

for (const name of previousRegistrations) {
Expand Down
4 changes: 2 additions & 2 deletions ember-primitives/src/iframe.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
* </template>
* ```
*/
export const inIframe = () => window.self !== window.top;
export const inIframe: () => boolean = () => window.self !== window.top;

/**
* Returns true if the current frame is not within an iframe.
Expand All @@ -28,4 +28,4 @@ export const inIframe = () => window.self !== window.top;
* </template>
* ```
*/
export const notInIframe = () => !inIframe();
export const notInIframe: () => boolean = () => !inIframe();
4 changes: 2 additions & 2 deletions ember-primitives/src/on-resize.ts
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ class OnResize extends Modifier<Signature> {
#callback: ((entry: ResizeObserverEntry) => void) | null = null;
#element: Element | null = null;

#resizeObserver = resizeObserver(this);
#resizeObserver: ReturnType<typeof resizeObserver> = resizeObserver(this);

constructor(owner: Owner, args: ArgsFor<Signature>) {
super(owner, args);
Expand All @@ -44,7 +44,7 @@ class OnResize extends Modifier<Signature> {
});
}

modify(element: Element, [callback]: [callback: (entry: ResizeObserverEntry) => void]) {
modify(element: Element, [callback]: [callback: (entry: ResizeObserverEntry) => void]): void {
assert(
`{{onResize}}: callback must be a function, but was ${callback as unknown as string}`,
typeof callback === 'function'
Expand Down
2 changes: 2 additions & 0 deletions ember-primitives/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@
"extends": "@ember/library-tsconfig",
"include": ["src/**/*", "unpublished-development-types/**/*"],
"compilerOptions": {
"isolatedDeclarations": true,
"erasableSyntaxOnly": true,
"rootDir": "./src",
"types": ["ember-source/types", "@glint/ember-tsc/types"]
}
Expand Down
Loading
Loading