Skip to content
Draft
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
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export const CLDFoo = <template>{{yield 2}}</template>;
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
import type { ComponentLike } from '@glint/template';

export declare const CLDFoo: ComponentLike<{
Blocks: {
default: [two: number];
};
}>;
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
import { CLDFoo } from './foo.gjs';

export const Usage = <template>
<CLDFoo as |two|>
{{two}}
</CLDFoo>
</template>;
2 changes: 2 additions & 0 deletions test-packages/v2-ts-ember-addon/src/index.ts
Original file line number Diff line number Diff line change
@@ -1 +1,3 @@
export { Foo } from './foo.gts';
export { Usage } from './co-located-declarations/usage.gts';
export { CLDFoo } from './co-located-declarations/foo.gjs';
13 changes: 10 additions & 3 deletions test-packages/v2-ts-ember-addon/test-build.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -19,15 +19,20 @@ assertReady();

for await (const entry of glob('{dist,declarations}/**/*.{js,d.ts}')) {
console.log(`Checking ${entry}`);
let buffer = readFile(entry);
let buffer = await readFile(entry);
let content = buffer.toString();

let hasForbiddenExtensions = content.match(/\.gts/);
let hasGts = content.match(/\.gts/g);
let hasGjs = content.match(/\.gjs/g);

check(
!hasForbiddenExtensions,
!hasGts,
`Expected ${entry} to not have the .gts extension anywhere in the file`,
);
check(
!hasGjs,
`Expected ${entry} to not have the .gjs extension anywhere in the file`,
);
}

assertDone();
Expand Down Expand Up @@ -59,6 +64,8 @@ function assertReady() {
}

function assertDone() {
console.log('\n\n');

assertReady();

console.info(`No issues were found.`);
Expand Down
1 change: 1 addition & 0 deletions test-packages/v2-ts-ember-addon/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
"extends": "@ember/app-tsconfig",
"include": ["src/**/*", "tests/**/*", "unpublished-development-types/**/*"],
"compilerOptions": {
"allowArbitraryExtensions": true,
"rootDir": ".",
"types": [
"ember-source/types",
Expand Down
Loading