Skip to content

Commit

Permalink
add @glint/typescript-plugin
Browse files Browse the repository at this point in the history
  • Loading branch information
machty committed Jul 11, 2024
1 parent 4f3aa17 commit fa21c2e
Show file tree
Hide file tree
Showing 7 changed files with 49 additions and 4 deletions.
2 changes: 1 addition & 1 deletion packages/core/__tests__/tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"extends": "../tsconfig.json",
"include": ["../src", "**/*.ts"],
"include": ["../src", "**/*.ts", "../../typescript-plugin/src/typescript-server-plugin.ts"],
"compilerOptions": {
"rootDir": ".."
}
Expand Down
2 changes: 1 addition & 1 deletion packages/core/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,5 @@
"rootDir": "src",
"outDir": "lib"
},
"include": ["src", "types"]
"include": ["src", "types", "../typescript-plugin/src/typescript-server-plugin.ts"]
}
2 changes: 2 additions & 0 deletions packages/typescript-plugin/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
*.tsbuildinfo
bin
5 changes: 5 additions & 0 deletions packages/typescript-plugin/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# @glint/typescript-plugin

The TypeScript server plugin that performs type-checking.

Old Glint used the LanguageServer to perform type-checking; Glint 2 uses a TypeScript server plugin to follow suit with Volar.
29 changes: 29 additions & 0 deletions packages/typescript-plugin/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
{
"name": "@glint/typescript-plugin",
"version": "1.4.0",
"type": "module",
"repository": "typed-ember/glint",
"description": "TypeScript Server Plugin for Glint",
"license": "MIT",
"authors": [
"Alex Matchneer (https://github.com/machty)"
],
"files": [
"README.md",
"lib"
],
"scripts": {
"test": "vitest run",
"test:typecheck": "echo 'no standalone typecheck within this project'",
"test:tsc": "echo 'no standalone typecheck within this project'",
"build": "tsc --build",
"prepack": "yarn build"
},
"dependencies": {
"@glint/core": "^1.4.0",
"@volar/typescript": "2.4.0-alpha.14"
},
"publishConfig": {
"access": "public"
}
}
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { createLanguageServicePlugin } from '@volar/typescript/lib/quickstart/createLanguageServicePlugin.js';
import { findConfig } from '../config/index.js';
import { createEmberLanguagePlugin } from './ember-language-plugin.js';
import { findConfig } from '../../core/src/config/index.js';
import { createEmberLanguagePlugin } from '../../core/src/volar/ember-language-plugin.js';

const plugin = createLanguageServicePlugin((ts, info) => {
const cwd = info.languageServiceHost.getCurrentDirectory();
Expand Down
9 changes: 9 additions & 0 deletions packages/typescript-plugin/tsconfig.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
{
"extends": "../../tsconfig.compileroptions.json",
"compilerOptions": {
"rootDir": "src",
"outDir": "bin"
},
"include": ["src"],
"references": [{ "path": "../core" }]
}

0 comments on commit fa21c2e

Please sign in to comment.