@tixyel/cli 2.3.2 β†’ 2.4.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/dist/index.js +60 -0
  2. package/package.json +1 -1
package/dist/index.js CHANGED
@@ -25,6 +25,66 @@ program
25
25
  const { workspace_config } = await import('./templates/workspace.js');
26
26
  const root = process.cwd();
27
27
  const config = resolve(root, 'tixyel.config.ts');
28
+ // Pergunta se o usuΓ‘rio quer instalar pacotes npm
29
+ const inquirer = (await import('inquirer')).default;
30
+ const { exec } = await import('child_process');
31
+ const util = await import('util');
32
+ const execPromise = util.promisify(exec);
33
+ const { installPackages } = await inquirer.prompt([
34
+ {
35
+ type: 'confirm',
36
+ name: 'installPackages',
37
+ message: 'You want to install essential npm/bun packages?',
38
+ default: true,
39
+ },
40
+ ]);
41
+ if (installPackages) {
42
+ const { packageManager } = await inquirer.prompt([
43
+ {
44
+ type: 'select',
45
+ name: 'packageManager',
46
+ message: 'Select your package manager:',
47
+ choices: ['npm', 'yarn', 'pnpm', 'bun'],
48
+ default: 'npm',
49
+ },
50
+ ]);
51
+ console.log(`πŸ“¦ Installing packages using ${packageManager} ...`);
52
+ let installCommand = '';
53
+ const packages = ['@tixyel/cli', '@tixyel/streamelements', 'comfy.js', 'motion', 'typescript', '@types/node', '@types/jquery', 'lottie-web'];
54
+ switch (packageManager) {
55
+ case 'npm': {
56
+ installCommand = `npm install ${packages.join(' ')}`;
57
+ break;
58
+ }
59
+ case 'yarn': {
60
+ installCommand = `yarn add ${packages.join(' ')}`;
61
+ break;
62
+ }
63
+ case 'pnpm': {
64
+ installCommand = `pnpm add ${packages.join(' ')}`;
65
+ break;
66
+ }
67
+ case 'bun': {
68
+ installCommand = `bun add ${packages.join(' ')}`;
69
+ break;
70
+ }
71
+ }
72
+ if (!installCommand) {
73
+ console.error('❌ Invalid package manager selected.');
74
+ return;
75
+ }
76
+ try {
77
+ const { stdout, stderr } = await execPromise(installCommand, { cwd: root });
78
+ if (stdout)
79
+ process.stdout.write(stdout);
80
+ if (stderr)
81
+ process.stderr.write(stderr);
82
+ console.log('βœ… Packages installed successfully.');
83
+ }
84
+ catch (error) {
85
+ console.error('❌ Error installing packages:', error);
86
+ }
87
+ }
28
88
  console.log('πŸš€ Initializing new workspace...');
29
89
  console.log(`πŸ“ Workspace root: ${root}`);
30
90
  const content = workspace_config;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tixyel/cli",
3
- "version": "2.3.2",
3
+ "version": "2.4.0",
4
4
  "description": "CLI tool for streamelements widgets",
5
5
  "keywords": [
6
6
  "cli",