Skip to content

Commit

Permalink
fix(intellij): wrong version of @package/app was used
Browse files Browse the repository at this point in the history
  • Loading branch information
fwouts committed Feb 20, 2022
1 parent dbdabfe commit 4b19b1f
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,8 @@ import java.util.*


const val PLUGIN_ID = "com.previewjs.intellij.plugin"
const val PACKAGE_NAME = "@previewjs/app"
const val PACKAGE_VERSION = "1.1.0"

@Service
class PreviewJsSharedService : Disposable {
Expand Down Expand Up @@ -117,8 +119,8 @@ ${e.stackTraceToString()}""",
private fun isInstalled(): Boolean {
val builder = processBuilder("node dist/is-installed.js")
.directory(nodeDirPath.toFile())
builder.environment()["PREVIEWJS_PACKAGE_NAME"] = "@previewjs/app"
builder.environment()["PREVIEWJS_PACKAGE_VERSION"] = "1.1.0"
builder.environment()["PREVIEWJS_PACKAGE_NAME"] = PACKAGE_NAME
builder.environment()["PREVIEWJS_PACKAGE_VERSION"] = PACKAGE_VERSION
val process = builder.start()
if (process.waitFor() != 0) {
throw Error(readInputStream(process.errorStream))
Expand Down Expand Up @@ -153,8 +155,8 @@ ${e.stackTraceToString()}""",
private fun install(project: Project) {
val builder = processBuilder("node dist/install.js")
.directory(nodeDirPath.toFile())
builder.environment()["PREVIEWJS_PACKAGE_NAME"] = "@previewjs/app"
builder.environment()["PREVIEWJS_PACKAGE_VERSION"] = "1.0.3"
builder.environment()["PREVIEWJS_PACKAGE_NAME"] = PACKAGE_NAME
builder.environment()["PREVIEWJS_PACKAGE_VERSION"] = PACKAGE_VERSION
val process = builder.start()
val reader = BufferedReader(InputStreamReader(process.inputStream))
val consoleView = project.service<ProjectService>().consoleView
Expand All @@ -173,8 +175,7 @@ ${e.stackTraceToString()}""",
.directory(nodeDirPath.toFile())
builder.environment()["PORT"] = "$PORT"
builder.environment()["PREVIEWJS_INTELLIJ_VERSION"] = plugin.getVersion()
builder.environment()["PREVIEWJS_PACKAGE_NAME"] = "@previewjs/app"
builder.environment()["PREVIEWJS_PACKAGE_VERSION"] = "1.0.3"
builder.environment()["PREVIEWJS_PACKAGE_NAME"] = PACKAGE_NAME
val process = builder.start()
serverProcess = process
serverOutputReader = BufferedReader(InputStreamReader(process.inputStream))
Expand Down
4 changes: 2 additions & 2 deletions scripts/release.ts
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,8 @@ async function main() {
const version = await updateNodePackage("app");
await replaceInFile(
"integrations/intellij/src/main/kotlin/com/previewjs/intellij/plugin/services/PreviewJsService.kt",
/\["PREVIEWJS_PACKAGE_VERSION"\] = "\d+\.\d+\.\d+"/,
`["PREVIEWJS_PACKAGE_VERSION"] = "${version}"`
/const val PACKAGE_VERSION = "\d+\.\d+\.\d+"/,
`const val PACKAGE_VERSION = "${version}"`
);
await replaceInFile(
"integrations/vscode/webpack.config.js",
Expand Down

0 comments on commit 4b19b1f

Please sign in to comment.