Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix prettier issues #759

Merged
merged 2 commits into from
Oct 22, 2024
Merged
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
16 changes: 14 additions & 2 deletions V2_CHANGELOG.md → GLINT_V2.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,18 @@
# Changes since v2 (Volar-ized Glint)
# Glint V2 (Alpha)

## `glint` CLI binary
Glint V2 is a major refactor of Glint V1 to run atop the [Volar.js language tooling framework], which powers the language tooling for Vue and many others.

## Supported Features

At the time of writing, the only component formats supported by Glint 2 are **.gts/.gjs components**; classic two-file (.ts/.js file + .hbs) components are not yet supported (neither class Ember components or nor Glimmer components), but support for these "classic" components is coming soon.

TODO: link to roadmap here.

[Volar.js language tooling framework]: https://volarjs.dev/

## Changelog

### `glint` CLI binary

- BREAKING CHANGE: closer unification with vanilla `tsc`
- `glint` is now a much more thin wrapper around `tsc` and requires a number of changes to the arguments passed to it to accomplish typical tasks
Expand Down
34 changes: 6 additions & 28 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,41 +2,19 @@

TypeScript-powered tooling for Glimmer templates.

## Overview
## Glint 2 (Alpha)

[Glint] is a set of tools to aid in developing code that uses the Glimmer VM for rendering, such as [Ember.js] v3.24+. Similar to [Vetur] for Vue projects or [Svelte Language Tools], Glint consists of a CLI and a language server to provide feedback and enforce correctness both locally during editing and project-wide in CI.
This branch contains the code for Glint V2, which is currently in an **alpha** state. Glint V2 is a major refactor of Glint V1 to run atop the [Volar.js language tooling framework], which powers the language tooling for Vue and many others.

[glint]: https://typed-ember.gitbook.io/glint
[ember.js]: https://www.emberjs.com
[vetur]: https://github.com/vuejs/vetur
[svelte language tools]: https://github.com/sveltejs/language-tools
See [Glint V2](./GLINT_V2.md) for information on how to try out Glint V2.

## Getting Started
[Volar.js language tooling framework]: https://volarjs.dev/

Glint is broken into several different packages that you may use, depending on the details of your project. Typically you'll add `@glint/core`, `@glint/template` and a Glint environment package that reflects the type of project you're working on, then add a `"glint"` key to your `tsconfig.json` that tells Glint what it should look at.
## Glint 1 Docs

For more specific details on setting up Glint in your project, take a look at [the documentation], in particular the Installation pages [for Ember.js projects].
Please see [the documentation] for how to get set up with Glint V1.

[the documentation]: https://typed-ember.gitbook.io/glint
[for ember.js projects]: https://typed-ember.gitbook.io/glint/environments/ember/installation

## Using Glint

The `@glint/core` package includes two executables: `glint` and `glint-language-server`.

The `glint` CLI can be used to typecheck your project in a similar manner to `tsc`, but with understanding of how values flow through templates.

![glint being run at a terminal and producing a tsc-style type error for a template file](https://user-images.githubusercontent.com/108688/111076577-1d61db00-84ed-11eb-876a-e5b504758d11.png)

You can [use the `glint` executable in CI][using-glint] to ensure you maintain type safety in your templates. You can also use the `glint` command locally with the `--watch` flag to monitor your project as you work!

Similarly, `glint-language-server` can be used by editor integrations to expose that same information inline as you type.

![a TypeScript-style type error being shown inline for a template file](https://user-images.githubusercontent.com/108688/111076679-995c2300-84ed-11eb-934a-3a29f21be89a.png)

The language server can also enable your editor to provide other richer help, such as type information on hover, automated refactoring, and more. See [the VS Code extension README](packages/vscode) for further examples.

[using-glint]: https://typed-ember.gitbook.io/glint/getting-started#using-glint

## Debugging Glint

Expand Down
2 changes: 1 addition & 1 deletion packages/core/src/volar/ember-language-plugin.ts
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ export function createEmberLanguagePlugin<T extends URI | string>(

// See: https://github.com/JetBrains/intellij-plugins/blob/11a9149e20f4d4ba2c1600da9f2b81ff88bd7c97/Angular/src/angular-service/src/index.ts#L31
if (
glintConfig.enableTsPlugin && // Loose mode not supported for classic "takeover" mode, only TS Plugin
glintConfig.enableTsPlugin && // Loose mode not supported for classic "takeover" mode, only TS Plugin
languageId === 'typescript' &&
!scriptIdStr.endsWith('.d.ts') &&
scriptIdStr.indexOf('/node_modules/') < 0
Expand Down
Loading