Skip to content

Commit bdc2f98

Browse files
committed
Merge branch 'master' into release
2 parents bdd18a6 + 40c40e6 commit bdc2f98

File tree

72 files changed

+6969
-4085
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

72 files changed

+6969
-4085
lines changed

.env

+2
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
NX_ISOLATE_PLUGINS=true
2+
NX_NATIVE_COMMAND_RUNNER=false

.eslintrc.json

+7-2
Original file line numberDiff line numberDiff line change
@@ -52,13 +52,18 @@
5252
"argsIgnorePattern": "^_$"
5353
}
5454
],
55-
"@typescript-eslint/no-explicit-any": "off"
55+
"@typescript-eslint/no-explicit-any": "off",
56+
"@typescript-eslint/no-extra-semi": "error",
57+
"no-extra-semi": "off"
5658
}
5759
},
5860
{
5961
"files": ["*.js", "*.jsx"],
6062
"extends": ["plugin:@nx/javascript"],
61-
"rules": {}
63+
"rules": {
64+
"@typescript-eslint/no-extra-semi": "error",
65+
"no-extra-semi": "off"
66+
}
6267
},
6368
{
6469
"files": ["*.html"],

.github/workflows/ci_checks.yml

+6-4
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,9 @@ jobs:
4343
env:
4444
NX_CLOUD_DISTRIBUTED_EXECUTION: false
4545
- run: npx nx affected --targets=lint,test,build --configuration=ci --exclude=nx-console --parallel=1
46-
- run: npx nx affected --targets=e2e,e2e-local --configuration=ci --exclude=nx-console --parallel=1
46+
- run: npx nx affected --targets=e2e-ci --exclude=nx-console --parallel=1
47+
timeout-minutes: 45
48+
4749
main-windows:
4850
name: Main Windows
4951
runs-on: windows-latest
@@ -81,7 +83,7 @@ jobs:
8183
java-version: 17
8284
cache: gradle
8385
# there's no need to check formatting & linting again on windows, sometimes there's a timing issue with intellij:build so run it up front
84-
- run: npx nx run intellij:build --info
86+
- run: npx nx run intellij:build --info --verbose
8587
- run: npx nx affected --targets="build,test" --configuration=ci --exclude=nx-console --parallel=1
86-
- run: npx nx affected --targets="e2e,e2e-local" --configuration=ci --exclude=nx-console --parallel=1
87-
timeout-minutes: 60
88+
- run: npx nx affected --targets="e2e-ci" --exclude=nx-console --parallel=1
89+
timeout-minutes: 45

.gitignore

+4-2
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ testem.log
5353
Thumbs.db
5454

5555
#Environment
56-
.env
56+
.env.local
5757

5858
# Intellij
5959
.gradle
@@ -68,4 +68,6 @@ apps/vscode-e2e/.screenshots
6868
.angular
6969

7070
.nx/cache
71-
**/cypress/downloads
71+
.nx/workspace-data
72+
**/cypress/downloads
73+
migrations.json

.prettierignore

+2-1
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,5 @@ CHANGELOG.md
22
apps/intellij/*
33
!apps/intellij/project.json
44

5-
/.nx/cache
5+
/.nx/cache
6+
/.nx/workspace-data

apps/intellij/build.gradle.kts

+8-26
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,6 @@ tasks {
103103
runInspections { mount("${rootDir}/gradle.properties", "/data/project/gradle.properties") }
104104

105105
prepareSandbox() {
106-
dependsOn("buildNxls")
107106
from(nxlsRoot) {
108107
include("**/*.js")
109108
include("**/package.json")
@@ -115,7 +114,14 @@ tasks {
115114
exec {
116115
logger.warn("rootproject ${rootProject.name}")
117116
logger.warn("Working dir: $workingDir")
118-
commandLine = buildCommands() + "npx nx run intellij:install-nxls-deps"
117+
logger.warn("Working dir: $destinationDir")
118+
119+
workingDir =
120+
File(
121+
destinationDir,
122+
rootProject.name + "/nxls",
123+
)
124+
commandLine = buildCommands() + "npm install --force"
119125
}
120126
}
121127
}
@@ -203,37 +209,13 @@ tasks {
203209
}
204210
}
205211

206-
tasks.register<Exec>("buildNxls") {
207-
commandLine =
208-
if (System.getenv("IDEA_DEBUG") == "true") {
209-
buildCommands() + "npx nx run nxls:build:debug"
210-
} else {
211-
buildCommands() + "npx nx run nxls:build"
212-
}
213-
workingDir = rootDir
214-
}
215-
216-
tasks.register<Exec>("buildGenerateUi") {
217-
commandLine = buildCommands() + "npx nx run generate-ui:build:production-intellij"
218-
workingDir = rootDir
219-
}
220-
221-
tasks.register<Exec>("buildGenerateUiV2") {
222-
commandLine = buildCommands() + "npx nx run generate-ui-v2:build"
223-
workingDir = rootDir
224-
}
225-
226212
tasks.register<Copy>("copyGenerateUiArtifacts") {
227-
dependsOn("buildGenerateUi")
228-
229213
from("${rootDir}/dist/apps/generate-ui")
230214
include("*.js", "*.css")
231215
into("${buildDir}/resources/main/generate_ui")
232216
}
233217

234218
tasks.register<Copy>("copyGenerateUiV2Artifacts") {
235-
dependsOn("buildGenerateUiV2")
236-
237219
from("${rootDir}/dist/apps/generate-ui-v2")
238220
include("*.js", "*.css")
239221
into("${buildDir}/resources/main/generate_ui_v2")

apps/intellij/project.json

+9-19
Original file line numberDiff line numberDiff line change
@@ -3,24 +3,20 @@
33
"$schema": "../../node_modules/nx/schemas/project-schema.json",
44
"projectType": "application",
55
"targets": {
6-
"runIde": {
7-
"executor": "nx:run-commands",
8-
"options": {
9-
"command": "node ./apps/intellij/run-gradle.js :apps:intellij:runIde"
10-
}
11-
},
126
"build": {
13-
"inputs": ["kotlin"],
14-
"outputs": ["{workspaceRoot}/dist/apps/intellij/distributions"],
15-
"executor": "nx:run-commands",
16-
"options": {
17-
"command": "node ./apps/intellij/run-gradle.js :apps:intellij:buildPlugin"
18-
},
7+
"command": "yarn nx run intellij:buildPlugin",
198
"configurations": {
209
"production-intellij": {}
2110
},
2211
"dependsOn": ["^build"]
2312
},
13+
"runIde": {
14+
"command": "yarn nx run intellij:runIde",
15+
"dependsOn": ["^build"]
16+
},
17+
"test": {
18+
"command": "yarn nx run intellij:check"
19+
},
2420
"lint": {
2521
"executor": "nx:noop"
2622
},
@@ -31,12 +27,6 @@
3127
"command": "node ./apps/intellij/run-gradle.js :apps:intellij:runInspections"
3228
}
3329
},
34-
"install-nxls-deps": {
35-
"command": "node ./tools/scripts/install-nxls-deps-intellij.js",
36-
"outputs": [
37-
"{workspaceRoot}/dist/apps/intellij/idea-sandbox/plugins/nx-console/nxls"
38-
]
39-
},
4030
"semantic-release": {
4131
"executor": "@theunderscorer/nx-semantic-release:semantic-release",
4232
"options": {
@@ -52,5 +42,5 @@
5242
}
5343
},
5444
"tags": ["type:intellij"],
55-
"implicitDependencies": ["generate-ui", "nxls"]
45+
"implicitDependencies": ["generate-ui", "nxls", "generate-ui-v2"]
5646
}

apps/intellij/run-gradle.js

-20
This file was deleted.

apps/intellij/src/main/kotlin/dev/nx/console/ProjectPostStartup.kt

+7-3
Original file line numberDiff line numberDiff line change
@@ -3,12 +3,13 @@ package dev.nx.console
33
import com.intellij.openapi.diagnostic.logger
44
import com.intellij.openapi.project.Project
55
import com.intellij.openapi.startup.ProjectActivity
6+
import dev.nx.console.ide.ProjectGraphErrorProblemProvider
67
import dev.nx.console.nxls.NxlsService
78
import dev.nx.console.settings.NxConsoleSettingsProvider
89
import dev.nx.console.telemetry.TelemetryService
910
import dev.nx.console.utils.Notifier
10-
import dev.nx.console.utils.NxProjectJsonToProjectMap
1111
import dev.nx.console.utils.nxBasePath
12+
import dev.nx.console.utils.sync_services.NxProjectJsonToProjectMap
1213
import java.io.File
1314

1415
private val logger = logger<ProjectPostStartup>()
@@ -17,13 +18,16 @@ class ProjectPostStartup : ProjectActivity {
1718
override suspend fun execute(project: Project) {
1819

1920
var currentDir = File(project.nxBasePath)
20-
val filesToScanFor = listOf("nx.json", "workspace.json", "angular.json", "lerna.json")
21+
val filesToScanFor = listOf("nx.json", "workspace.json", "lerna.json")
2122

2223
while (true) {
2324
if (filesToScanFor.any { currentDir.resolve(it).exists() }) {
2425
val service = NxlsService.getInstance(project)
2526
service.start()
26-
service.runAfterStarted { NxProjectJsonToProjectMap.getInstance(project).init() }
27+
service.runAfterStarted {
28+
NxProjectJsonToProjectMap.getInstance(project).init()
29+
ProjectGraphErrorProblemProvider.getInstance(project).init()
30+
}
2731
break
2832
}
2933
if (currentDir.parentFile == null) {

apps/intellij/src/main/kotlin/dev/nx/console/generate/ui/NxGeneratorListCellRenderer.kt

+1-1
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ class NxGeneratorListCellRenderer(
3333
SimpleTextAttributes.REGULAR_ATTRIBUTES,
3434
true
3535
)
36-
if (value.data.description != null) {
36+
if (value.data.description != null && value.name.length < 80) {
3737
append(
3838
" " +
3939
StringUtil.shortenTextWithEllipsis(

apps/intellij/src/main/kotlin/dev/nx/console/graph/NxGraphBrowserBase.kt

+5-5
Original file line numberDiff line numberDiff line change
@@ -287,9 +287,10 @@ abstract class NxGraphBrowserBase(protected val project: Project) : Disposable {
287287
return true
288288
}
289289
"run-help" -> {
290-
event.payload?.let { (projectName, _, _, _, _, helpCommand) ->
290+
event.payload?.let { (projectName, _, _, _, _, helpCommand, helpCwd) ->
291291
if (projectName != null && helpCommand != null) {
292-
NxHelpCommandService.getInstance(project).execute(projectName, helpCommand)
292+
NxHelpCommandService.getInstance(project)
293+
.execute(projectName, helpCommand, helpCwd)
293294
}
294295
}
295296
return true
@@ -422,9 +423,7 @@ abstract class NxGraphBrowserBase(protected val project: Project) : Disposable {
422423
if (response.error != null) {
423424
thisLogger()
424425
.debug("Error handling graph request: ${response.error}")
425-
setErrorsAndRefresh(
426-
arrayOf(NxError(response.error, null, null, null))
427-
)
426+
setErrorsAndRefresh(arrayOf(NxError(response.error)))
428427
return@launch
429428
}
430429
try {
@@ -467,6 +466,7 @@ data class NxGraphInteractionPayload(
467466
val taskId: String? = null,
468467
val targetConfigString: String? = null,
469468
val helpCommand: String? = null,
469+
val helpCwd: String? = null,
470470
)
471471

472472
@Serializable

apps/intellij/src/main/kotlin/dev/nx/console/graph/actions/NxGraphFocusTaskGroupAction.kt

+7-7
Original file line numberDiff line numberDiff line change
@@ -20,13 +20,13 @@ class NxGraphFocusTaskGroupAction : DumbAwareAction() {
2020

2121
override fun update(e: AnActionEvent) {
2222
useKeyMapShortcutSetOrDefault()
23-
val targetGroup: NxSimpleNode.TargetGroup? =
24-
e.getData(NxTreeNodeKey).let { it as? NxSimpleNode.TargetGroup }
23+
val targetsList: NxSimpleNode.TargetsList? =
24+
e.getData(NxTreeNodeKey).let { it as? NxSimpleNode.TargetsList }
2525

26-
if (targetGroup == null) {
26+
if (targetsList == null) {
2727
e.presentation.isEnabledAndVisible = false
2828
} else {
29-
e.presentation.text = "Nx Graph: Focus ${targetGroup.name} targets"
29+
e.presentation.text = "Nx Graph: Focus ${targetsList.name} targets"
3030
e.presentation.icon = NxIcons.Action
3131
}
3232
}
@@ -36,12 +36,12 @@ class NxGraphFocusTaskGroupAction : DumbAwareAction() {
3636
override fun actionPerformed(e: AnActionEvent) {
3737
val project = e.project ?: return
3838
TelemetryService.getInstance(project).featureUsed("Nx Graph Focus Task Group")
39-
val targetGroup: NxSimpleNode.TargetGroup =
40-
e.getData(NxTreeNodeKey).let { it as? NxSimpleNode.TargetGroup } ?: return
39+
val targetsList: NxSimpleNode.TargetsList =
40+
e.getData(NxTreeNodeKey).let { it as? NxSimpleNode.TargetsList } ?: return
4141

4242
ProjectLevelCoroutineHolderService.getInstance(project).cs.launch {
4343
val nxGraphService = getNxGraphService(project) ?: return@launch
44-
withContext(Dispatchers.EDT) { nxGraphService.focusTaskGroup(targetGroup.name) }
44+
withContext(Dispatchers.EDT) { nxGraphService.focusTaskGroup(targetsList.name) }
4545
}
4646
}
4747

0 commit comments

Comments
 (0)