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
85 changes: 85 additions & 0 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions test-packages/js-template-imports-app/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
tsconfig.tsbuildinfo
36 changes: 36 additions & 0 deletions test-packages/js-template-imports-app/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
{
"name": "js-template-imports-app",
"version": "0.0.0",
"private": true,
"license": "MIT",
"scripts": {
"test": "echo 'no standalone test within this project'",
"test:typecheck": "ember-tsc",
"test:tsc": "echo 'no standalone tsc within this project'"
},
"dependenciesMeta": {
"@glint/template": {
"injected": true
},
"@glint/ember-tsc": {
"injected": true
},
"@glint/tsserver-plugin": {
"injected": true
}
},
"devDependencies": {
"@glimmer/component": "^2.0.0",
"@glint/template": "workspace:*",
"@glint/ember-tsc": "workspace:*",
"@types/rsvp": "^4.0.9",
"@glint/tsserver-plugin": "workspace:*",
"@tsconfig/ember": "^3.0.9",
"ember-modifier": "^4.0.0",
"ember-source": "^6.2.0",
"typescript": ">=5.6.0"
},
"volta": {
"extends": "../../package.json"
}
}
17 changes: 17 additions & 0 deletions test-packages/js-template-imports-app/src/Greeting.gjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
import Component from '@glimmer/component';

export default class Greeting extends Component {
message = 'Hello';

<template>
{{this.message}}, {{@target}}<Bang @times={{3}} />
</template>
}

function repeat(value, times) {
return Array(times).fill(value).join('');
}

const Bang = <template>
{{repeat '!' @times}}
</template>
6 changes: 6 additions & 0 deletions test-packages/js-template-imports-app/src/NoTemplate.gjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
/*NoTemplate*/
import { Other } from './other';

export class Foo {}

export const O = Other;
6 changes: 6 additions & 0 deletions test-packages/js-template-imports-app/src/augmented.gjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
<template>
<p>hi</p>
<style scoped inline>
p { color: red; }
</style>
</template>
6 changes: 6 additions & 0 deletions test-packages/js-template-imports-app/src/empty-fixture.gjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
// This file is intentionally empty.
// It exists as a hack to get around some issues when testing our TS Plugin
// within tsserver harness where, even though many of our tests are only
// updating tsserver's in-memory content for a file, tsserver still needs
// the file to exist in the file system in order for things like References
// and other language features to work properly.
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
// See ./empty-fixture.ts for why this exists.
5 changes: 5 additions & 0 deletions test-packages/js-template-imports-app/src/index.gjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
import Greeting from './Greeting';

export default <template>
<Greeting @target="World" />
</template>
1 change: 1 addition & 0 deletions test-packages/js-template-imports-app/src/other.js
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export class Other {}
11 changes: 11 additions & 0 deletions test-packages/js-template-imports-app/tsconfig.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
{
"extends": "@tsconfig/ember",
"compilerOptions": {
"baseUrl": ".",
"types": ["ember-source/types"]
},
"include": ["src", "types"],
"glint": {
"additionalGlobals": ["t"]
}
}
15 changes: 15 additions & 0 deletions test-packages/js-template-imports-app/types/index.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
import '@glint/ember-tsc/types';

import { HelperLike } from '@glint/template';

declare module '@glint/ember-tsc/globals' {
export default interface Globals {
t: HelperLike<{
Args: {
Positional: string[];
Named: Record<string, unknown>;
};
Return: string;
}>;
}
}
Loading