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

feat(core): added the ability to split command property into an array in nx:run-commands executor #20201

Merged
merged 1 commit into from
Jun 27, 2024

Conversation

gearonixx
Copy link
Contributor

Current Behavior

In projects, you can often find teams that are too long. Example here:

 "run:dev": {
    "executor": "nx:run-commands",
    "options": {
      "command": "docker compose -f .docker/compose/docker-compose.services.yml -f .docker/compose/docker-compose.dev.yml --project-directory . up -d"
    },
    "dependsOn": ["update:dev"]
  }

Expected Behavior

Implemented splitting of the 'command' parameter, added the ability to pass it as an array to avoid such huge strings:

"run:dev": {
    "executor": "nx:run-commands",
    "options": {
      "command": [
	"docker compose -f",
        ".docker/compose/docker-compose.services.yml -f",
	".docker/compose/docker-compose.dev.yml",
	"--project-directory . up -d"
      ]
    },
    "dependsOn": ["update:dev"]
  },

Added a couple of tests and changed schema.json to 'run-commands' executor.

@gearonixx gearonixx requested review from a team as code owners November 11, 2023 23:33
Copy link

vercel bot commented Nov 11, 2023

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Updated (UTC)
nx-dev ✅ Ready (Inspect) Visit Preview Jun 27, 2024 3:55pm

@xiongemi
Copy link
Collaborator

i am wondering whether this can be done something like:

"run:dev": {
    "executor": "nx:run-commands",
    "options": {
      "commands": [
	{"command": "docker compose -f"},
        {"command": ".docker/compose/docker-compose.services.yml -f"},
	{"command": ".docker/compose/docker-compose.dev.yml --project-directory . up -d"},
      ]
    },
    "dependsOn": ["update:dev"]
  },

@gearonixx
Copy link
Contributor Author

gearonixx commented May 25, 2024

i am wondering whether this can be done something like:

"run:dev": {
    "executor": "nx:run-commands",
    "options": {
      "commands": [
	{"command": "docker compose -f"},
        {"command": ".docker/compose/docker-compose.services.yml -f"},
	{"command": ".docker/compose/docker-compose.dev.yml --project-directory . up -d"},
      ]
    },
    "dependsOn": ["update:dev"]
  },

this is ONE command, not several commands. like "\" in bash

@gearonixx
Copy link
Contributor Author

https://github.com/gearonix/sorry-nx I did this thing because I was tired of waiting. btw @FrozenPandaz, I already know this project quite well and am interested in working on nx. We can talk!

@xiongemi xiongemi force-pushed the feat/splitted-project-json-command branch from 6e103b7 to 5ef6b82 Compare June 27, 2024 15:55
@xiongemi xiongemi merged commit df83dd4 into nrwl:master Jun 27, 2024
7 checks passed
Copy link

github-actions bot commented Jul 6, 2024

This pull request has already been merged/closed. If you experience issues related to these changes, please open a new issue referencing this pull request.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Jul 6, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants