Quasar CLI - NX #8860
Replies: 6 comments
-
hello, wanted to check if there is a NX plugin for Quasar CLI on the roadmap ? |
Beta Was this translation helpful? Give feedback.
-
Plus one for this. |
Beta Was this translation helpful? Give feedback.
-
Here is my poor-man's implementation // executor.ts
import { ExecutorContext, logger } from '@nx/devkit';
import { exec } from 'child_process';
import { QuasarExecutorSchema } from './schema';
function execPromise(cmd: string, options: any): Promise<string> {
return new Promise((resolve, reject) => {
const response = exec(cmd, options, (err, data: any) => {
if (err) {
reject(err);
return;
}
resolve(data);
});
response.stdout.on('data', (data) => {
logger.log(data);
});
response.stderr.on('data', (data) => {
logger.error(data);
});
});
}
export default async function runExecutor(options: QuasarExecutorSchema, context: ExecutorContext) {
const projectDir = context.workspace.projects[context.projectName].root;
await execPromise(`quasar ${options.command} ${(options.args ?? []).join(' ')}`, { cwd: projectDir });
return {
success: true,
};
} // executor.json
{
"executors": {
"quasar": {
"implementation": "./src/executors/quasar/executor",
"schema": "./src/executors/quasar/schema.json",
"description": "Executor for Quasar CLI commands"
}
}
} // schema.d.ts
type Command =
| 'upgrade'
| 'info'
| 'dev'
| 'build'
| 'clean'
| 'new'
| 'mode'
| 'describe'
| 'inspect'
| 'ext'
| 'serve';
export interface QuasarExecutorSchema {
command: Command;
args: string[];
} // schema.json
{
"$schema": "http://json-schema.org/schema",
"version": 2,
"title": "Quasar CLI executor",
"description": "",
"type": "object",
"properties": {
"command": {
"type": "string",
"description": "Command"
},
"args": {
"type": "array",
"description": "Arguments",
"additionalProperties": {
"type": "string"
}
}
},
"required": ["command"]
} example target : "quasar:dev": {
"executor": "quasar-plugin:quasar",
"options": {
"command": "dev"
}
} |
Beta Was this translation helpful? Give feedback.
-
Hello! I am very interested in having official Nx support for Quasar. Currently, I have implemented a custom executor based on the discussion here, but having an official plugin would greatly streamline the process and ensure better integration and support. This feature would be invaluable for developers using Quasar within Nx monorepos. Thank you for considering this! |
Beta Was this translation helpful? Give feedback.
-
Just chiming in here that you can create your own local plugin to integrate with Quasar. This tutorial covers this use case: https://nx.dev/extending-nx/tutorials/tooling-plugin We will not be looking into official Quasar integration at this moment, but if you are interested, continue to comment here and upvote this discussion topic. |
Beta Was this translation helpful? Give feedback.
-
Hi, anyone with a working example using https://nx.dev/extending-nx/tutorials/tooling-plugin |
Beta Was this translation helpful? Give feedback.
-
Good day!
Is there a Quasar CLI plugin planned for NX?
It would be great!
Thanks!
Beta Was this translation helpful? Give feedback.
All reactions