Skip to content

Commit

Permalink
0.9.1
Browse files Browse the repository at this point in the history
- Fix wrong tsconfig being resolved when having typescript to false with Svelte (fixes #62)
- Upgrade Gradle and dependencies
- Re-disable plugin verifier
WarningImHack3r committed Sep 14, 2024
1 parent c81c6c4 commit 16bef6c
Showing 6 changed files with 21 additions and 15 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -202,9 +202,9 @@ jobs:

# Run Verify Plugin task and IntelliJ Plugin Verifier tool
- name: Run Plugin Verification tasks
# run: exit 0
run: exit 0
# Disabled until it works again for a lot of IDEs (https://github.com/JetBrains/intellij-platform-plugin-template/issues/462)
run: ./gradlew verifyPlugin -Dplugin.verifier.home.dir=${{ needs.build.outputs.pluginVerifierHomeDir }}
# run: ./gradlew verifyPlugin -Dplugin.verifier.home.dir=${{ needs.build.outputs.pluginVerifierHomeDir }}

# Collect Plugin Verifier Result
- name: Collect Plugin Verifier Result
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -12,6 +12,10 @@

## [Unreleased]

### Fixed

- Fix a crash when not using TypeScript in a Svelte project (#62)

## [0.9.0] - 2024-08-01

### Added
4 changes: 2 additions & 2 deletions gradle.properties
Original file line number Diff line number Diff line change
@@ -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.0
pluginVersion = 0.9.1

# Supported build number ranges and IntelliJ Platform versions -> https://plugins.jetbrains.com/docs/intellij/build-number-ranges.html
pluginSinceBuild = 223
@@ -21,7 +21,7 @@ platformPlugins = dev.blachut.svelte.lang:223.7571.203, org.jetbrains.plugins.vu
platformBundledPlugins = JavaScript, intellij.webpack

# Gradle Releases -> https://github.com/gradle/gradle/releases
gradleVersion = 8.9
gradleVersion = 8.10

# Opt-out flag for bundling Kotlin standard library -> https://jb.gg/intellij-platform-kotlin-stdlib
kotlin.stdlib.default.dependency = false
4 changes: 2 additions & 2 deletions gradle/libs.versions.toml
Original file line number Diff line number Diff line change
@@ -5,10 +5,10 @@ junit = "4.13.2"
# plugins
changelog = "2.2.1"
intellijPlatform = "2.0.1"
kotlin = "2.0.10"
kotlin = "2.0.20"
kover = "0.8.3"
qodana = "2024.1.9"
serialization = "1.7.1"
serialization = "1.7.2"

[libraries]
junit = { group = "junit", name = "junit", version.ref = "junit" }
Binary file modified gradle/wrapper/gradle-wrapper.jar
Binary file not shown.
Original file line number Diff line number Diff line change
@@ -36,25 +36,27 @@ open class SvelteSource(project: Project) : Source<SvelteConfig>(project, Svelte
log.warn("Alias $alias does not start with $, @ or ~, returning it as-is")
return alias
}
val usesKit = DependencyManager.getInstance(project).isDependencyInstalled("@sveltejs/kit")
val tsConfigName = if (getLocalConfig().typescript) "tsconfig.json" else "jsconfig.json"
val configFile = if (usesKit) ".svelte-kit/$tsConfigName" else tsConfigName
val fileManager = FileManager.getInstance(project)
var tsConfig = fileManager.getFileContentsAtPath(configFile)
val usesKit = DependencyManager.getInstance(project).isDependencyInstalled("@sveltejs/kit")
val configFileName = if (usesKit) {
".svelte-kit/tsconfig.json"
} else if (getLocalConfig().typescript) "tsconfig.json" else "jsconfig.json"
var tsConfig = fileManager.getFileContentsAtPath(configFileName)
if (tsConfig == null) {
if (!usesKit) throw NoSuchFileException("Cannot get $configFile")
if (!usesKit) throw NoSuchFileException("Cannot get $configFileName")
val res = ShellRunner.getInstance(project).execute(arrayOf("npx", "svelte-kit", "sync"))
if (res == null) {
NotificationManager(project).sendNotification(
"Failed to generate $configFile",
"Failed to generate $configFileName",
"Please run <code>npx svelte-kit sync</code> in your project directory to generate the file and try again.",
NotificationType.ERROR
)
throw NoSuchFileException("Cannot get or generate $configFile")
throw NoSuchFileException("Cannot get or generate $configFileName")
}
Thread.sleep(250) // wait for the sync to create the files
Thread.sleep(500) // wait for the sync to create the files
tsConfig =
fileManager.getFileContentsAtPath(configFile) ?: throw NoSuchFileException("Cannot get $configFile")
fileManager.getFileContentsAtPath(configFileName)
?: throw NoSuchFileException("Cannot get $configFileName after sync")
}
val aliasPath = parseTsConfig(tsConfig)
.jsonObject["compilerOptions"]

0 comments on commit 16bef6c

Please sign in to comment.