diff --git a/packages/core/__tests__/tsconfig.json b/packages/core/__tests__/tsconfig.json index cb4f8923..7c12a1e2 100644 --- a/packages/core/__tests__/tsconfig.json +++ b/packages/core/__tests__/tsconfig.json @@ -1,6 +1,6 @@ { "extends": "../tsconfig.json", - "include": ["../src", "**/*.ts"], + "include": ["../src", "**/*.ts", "../../typescript-plugin/src/typescript-server-plugin.ts"], "compilerOptions": { "rootDir": ".." } diff --git a/packages/core/tsconfig.json b/packages/core/tsconfig.json index c761568a..1b680148 100644 --- a/packages/core/tsconfig.json +++ b/packages/core/tsconfig.json @@ -4,5 +4,5 @@ "rootDir": "src", "outDir": "lib" }, - "include": ["src", "types"] + "include": ["src", "types", "../typescript-plugin/src/typescript-server-plugin.ts"] } diff --git a/packages/typescript-plugin/.gitignore b/packages/typescript-plugin/.gitignore new file mode 100644 index 00000000..98634fb2 --- /dev/null +++ b/packages/typescript-plugin/.gitignore @@ -0,0 +1,2 @@ +*.tsbuildinfo +bin \ No newline at end of file diff --git a/packages/typescript-plugin/README.md b/packages/typescript-plugin/README.md new file mode 100644 index 00000000..69ea12fe --- /dev/null +++ b/packages/typescript-plugin/README.md @@ -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. diff --git a/packages/typescript-plugin/package.json b/packages/typescript-plugin/package.json new file mode 100644 index 00000000..1eb97611 --- /dev/null +++ b/packages/typescript-plugin/package.json @@ -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" + } +} diff --git a/packages/core/src/volar/typescript-server-plugin.ts b/packages/typescript-plugin/src/typescript-server-plugin.ts similarity index 84% rename from packages/core/src/volar/typescript-server-plugin.ts rename to packages/typescript-plugin/src/typescript-server-plugin.ts index 1a050645..9e6ac847 100644 --- a/packages/core/src/volar/typescript-server-plugin.ts +++ b/packages/typescript-plugin/src/typescript-server-plugin.ts @@ -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(); diff --git a/packages/typescript-plugin/tsconfig.json b/packages/typescript-plugin/tsconfig.json new file mode 100644 index 00000000..ed2573bb --- /dev/null +++ b/packages/typescript-plugin/tsconfig.json @@ -0,0 +1,9 @@ +{ + "extends": "../../tsconfig.compileroptions.json", + "compilerOptions": { + "rootDir": "src", + "outDir": "bin" + }, + "include": ["src"], + "references": [{ "path": "../core" }] +}