Skip to content

Commit

Permalink
Merge branch 'main' into shadcn-2.0
Browse files Browse the repository at this point in the history
  • Loading branch information
WarningImHack3r authored Oct 23, 2024
2 parents af253f2 + 7b616be commit c4f0d7d
Show file tree
Hide file tree
Showing 6 changed files with 56 additions and 6 deletions.
38 changes: 38 additions & 0 deletions .github/TROUBLESHOOTING.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
# Troubleshooting

## Enable and extract logs

You can enable the plugin's debug logs to help diagnose your issue. Here's how you can do it:

1. Enable the plugin's debug logs by setting the line below in <kbd>Help</kbd> > <kbd>Diagnostic Tools</kbd> > <kbd>Debug Log Settings…</kbd>:
```
#com.github.warningimhack3r.intellijshadcnplugin
```

2. Restart your IDE, wait for your problem to occur or trigger it, and open the directory containing the `idea.log` file by going to <kbd>Help</kbd> > <kbd>Show Log in Finder</kbd>/<kbd>Show Log in Explorer</kbd>.

3. In there, you have 3 options to copy the logs:
- Open the `idea.log` file with a text editor or a log viewer and copy the parts related to the plugin, i.e., the lines containing `intellijshadcnplugin`. You can for example use tools like `grep` to filter the logs.
- Open the `idea.log` file with a text editor or a log viewer and copy the last 50–100 lines.
- If you're comfortable with it, you can share the whole `idea.log` file.

4. To share it, you have a few options:
- Share them in the issue using [Markdown code blocks](https://docs.github.com/en/get-started/writing-on-github/working-with-advanced-formatting/creating-and-highlighting-code-blocks#fenced-code-blocks)
- Paste them in a text file you can drag and drop in the issue (or directly drag and drop the `idea.log` file)
- Use a service like [GitHub Gist](https://gist.github.com/) or [Pastebin](https://pastebin.com/) and send the link

5. It is highly recommended to **disable the debug logs after you're done**: debug logs can slow down your IDE and take up a lot of disk space. The <kbd>Debug Log Settings…</kbd> process also enables internal plugin features that are not meant for regular use.

## Share your `components.json`/`ui.config.json`/`tsconfig.json` files

Theses files are read by the plugin to get most of the information it needs to work.
In most cases of crashes or unexpected behavior, I'll ask you to share some of these files so I can reproduce the issue on my side.

If you don't want to share it, you're free to do so, but it may be harder for me to help you.

When you share the file(s), please do not omit any information from them, as it may be crucial to diagnosing the issue.

You can either:
- Copy the content of the file(s) and paste it/them in the issue using [Markdown code blocks](https://docs.github.com/en/get-started/writing-on-github/working-with-advanced-formatting/creating-and-highlighting-code-blocks#fenced-code-blocks)
- Paste the content in a text file you can drag and drop in the issue, or directly drag and drop the file(s)
- Use a service like [GitHub Gist](https://gist.github.com/) or [Pastebin](https://pastebin.com/) and send the link
13 changes: 12 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,16 @@

## [Unreleased]

## [0.9.3] - 2024-10-23

### Changed

- No longer try to remove `/* */` comments from the `tsconfig.json`/`jsconfig.json` files as they can break parsing (#66)

### Fixed

- [Vue] Fix parsing of `tsconfig.app.json` files (#66)

## [0.9.2] - 2024-09-24

### Added
Expand Down Expand Up @@ -150,7 +160,8 @@

- Initial release

[Unreleased]: https://github.com/WarningImHack3r/intellij-shadcn-plugin/compare/v0.9.2...HEAD
[Unreleased]: https://github.com/WarningImHack3r/intellij-shadcn-plugin/compare/v0.9.3...HEAD
[0.9.3]: https://github.com/WarningImHack3r/intellij-shadcn-plugin/compare/v0.9.2...v0.9.3
[0.9.2]: https://github.com/WarningImHack3r/intellij-shadcn-plugin/compare/v0.9.1...v0.9.2
[0.9.1]: https://github.com/WarningImHack3r/intellij-shadcn-plugin/compare/v0.9.0...v0.9.1
[0.9.0]: https://github.com/WarningImHack3r/intellij-shadcn-plugin/compare/v0.8.5...v0.9.0
Expand Down
2 changes: 1 addition & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ pluginGroup = com.github.warningimhack3r.intellijshadcnplugin
pluginName = intellij-shadcn-plugin
pluginRepositoryUrl = https://github.com/WarningImHack3r/intellij-shadcn-plugin
# SemVer format -> https://semver.org
pluginVersion = 0.9.2
pluginVersion = 0.9.3

# Supported build number ranges and IntelliJ Platform versions -> https://plugins.jetbrains.com/docs/intellij/build-number-ranges.html
pluginSinceBuild = 223
Expand Down
2 changes: 1 addition & 1 deletion gradle/libs.versions.toml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ serialization = "1.7.3"
# plugins
changelog = "2.2.1"
intellijPlatform = "2.1.0"
kotlin = "2.0.20"
kotlin = "2.0.21"
kover = "0.8.3"
qodana = "2024.2.3"

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -108,8 +108,6 @@ abstract class Source<C : Config>(val project: Project, private val serializer:
protected fun parseTsConfig(config: String, fileName: String = "tsconfig.json"): JsonElement {
// Temporary workaround until kotlinx.serialization is upgraded
val cleanConfig = config
// Remove /* */ comments
.replace(Regex("/\\*.*?\\*/", RegexOption.DOT_MATCHES_ALL), "")
.split("\n").joinToString("\n") { line ->
// Remove // comments
line.substringBefore("//").trim()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,10 @@ open class VueSource(project: Project) : Source<VueConfig>(project, VueConfig.se
val tsConfig = FileManager.getInstance(project).getFileContentsAtPath(tsConfigLocation)
?: throw NoSuchFileException("$tsConfigLocation not found")
val aliasPath = (resolvePath(tsConfig, tsConfigLocation) ?: if (config.typescript) {
resolvePath("tsconfig.app.json", "tsconfig.app.json")
val tsConfigAppLocation = "tsconfig.app.json"
val tsConfigApp = FileManager.getInstance(project).getFileContentsAtPath(tsConfigAppLocation)
?: throw NoSuchFileException("$tsConfigAppLocation not found")
resolvePath(tsConfigApp, tsConfigAppLocation)
} else null) ?: throw Exception("Cannot find alias $alias in $tsConfig")
return aliasPath.replace(Regex("^\\.+/"), "")
.replace(Regex("\\*$"), alias.substringAfter("/")).also {
Expand Down

0 comments on commit c4f0d7d

Please sign in to comment.