neex 0.7.41 → 0.7.43

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.
@@ -1 +1 @@
1
- {"version":3,"file":"cli.d.ts","sourceRoot":"","sources":["../../src/cli.ts"],"names":[],"mappings":"AAeA,MAAM,CAAC,OAAO,UAAU,GAAG,IAAI,IAAI,CA4ElC"}
1
+ {"version":3,"file":"cli.d.ts","sourceRoot":"","sources":["../../src/cli.ts"],"names":[],"mappings":"AAgBA,MAAM,CAAC,OAAO,UAAU,GAAG,IAAI,IAAI,CAoFlC"}
package/dist/src/cli.js CHANGED
@@ -26,6 +26,13 @@ function cli() {
26
26
  .name('neex')
27
27
  .description('Professional script runner with nodemon and PM2 functionality')
28
28
  .version(version);
29
+ // Add plugin command
30
+ program
31
+ .command('add <plugin>')
32
+ .description('Add a plugin to the project')
33
+ .action(async (plugin) => {
34
+ await (0, index_js_1.addPlugin)(plugin);
35
+ });
29
36
  // Add all other command groups
30
37
  (0, index_js_1.addRunCommands)(program);
31
38
  (0, index_js_1.addServerCommands)(program);
@@ -0,0 +1,4 @@
1
+ export declare function addPlugin(pluginName: string, options?: {
2
+ cwd?: string;
3
+ }): Promise<void>;
4
+ //# sourceMappingURL=add-commands.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"add-commands.d.ts","sourceRoot":"","sources":["../../../src/commands/add-commands.ts"],"names":[],"mappings":"AAKA,wBAAsB,SAAS,CAAC,UAAU,EAAE,MAAM,EAAE,OAAO,GAAE;IAAE,GAAG,CAAC,EAAE,MAAM,CAAA;CAAO,iBAgEjF"}
@@ -0,0 +1,71 @@
1
+ "use strict";
2
+ var __importDefault = (this && this.__importDefault) || function (mod) {
3
+ return (mod && mod.__esModule) ? mod : { "default": mod };
4
+ };
5
+ Object.defineProperty(exports, "__esModule", { value: true });
6
+ exports.addPlugin = addPlugin;
7
+ const child_process_1 = require("child_process");
8
+ const chalk_1 = __importDefault(require("chalk"));
9
+ const path_1 = __importDefault(require("path"));
10
+ const fs_1 = __importDefault(require("fs"));
11
+ async function addPlugin(pluginName, options = {}) {
12
+ const projectPath = options.cwd || process.cwd();
13
+ console.log(chalk_1.default.blue(`📦 Installing ${pluginName}...`));
14
+ try {
15
+ // Check if package.json exists
16
+ const packageJsonPath = path_1.default.join(projectPath, 'package.json');
17
+ if (!fs_1.default.existsSync(packageJsonPath)) {
18
+ throw new Error('package.json not found. Make sure you are in a valid project directory.');
19
+ }
20
+ // Install the plugin with better error handling
21
+ (0, child_process_1.execSync)(`npm install ${pluginName}`, {
22
+ stdio: 'pipe',
23
+ cwd: projectPath,
24
+ encoding: 'utf8'
25
+ });
26
+ // Handle specific plugins
27
+ if (pluginName === 'neex-admin') {
28
+ console.log(chalk_1.default.blue('🔧 Initializing admin panel...'));
29
+ try {
30
+ // Import and run the admin init function
31
+ const adminModule = require('neex-admin');
32
+ if (adminModule.initAdmin) {
33
+ await adminModule.initAdmin(projectPath);
34
+ }
35
+ console.log(chalk_1.default.green('✅ Admin panel added successfully!'));
36
+ console.log(chalk_1.default.yellow('💡 Run "npm run admin:dev" to start the admin panel'));
37
+ }
38
+ catch (error) {
39
+ console.log(chalk_1.default.yellow('⚠️ Admin plugin installed, manual setup required'));
40
+ }
41
+ }
42
+ else {
43
+ // Try to find and run plugin's init function
44
+ try {
45
+ const pluginPath = path_1.default.join(projectPath, 'node_modules', pluginName);
46
+ const plugin = require(pluginPath);
47
+ if (plugin.init && typeof plugin.init === 'function') {
48
+ await plugin.init(projectPath);
49
+ console.log(chalk_1.default.green(`✅ ${pluginName} initialized successfully!`));
50
+ }
51
+ else {
52
+ console.log(chalk_1.default.green(`✅ ${pluginName} installed successfully!`));
53
+ }
54
+ }
55
+ catch (error) {
56
+ console.log(chalk_1.default.green(`✅ ${pluginName} installed successfully!`));
57
+ console.log(chalk_1.default.yellow('⚠️ No initialization function found'));
58
+ }
59
+ }
60
+ }
61
+ catch (error) {
62
+ console.error(chalk_1.default.red(`❌ Failed to install ${pluginName}`));
63
+ if (error instanceof Error) {
64
+ console.error(chalk_1.default.red(error.message));
65
+ }
66
+ // Try manual installation suggestion
67
+ console.log(chalk_1.default.yellow('💡 Try manual installation:'));
68
+ console.log(chalk_1.default.dim(` npm install ${pluginName}`));
69
+ process.exit(1);
70
+ }
71
+ }
@@ -4,4 +4,5 @@ export * from './server-commands.js';
4
4
  export * from './start-commands.js';
5
5
  export * from './build-commands.js';
6
6
  export { runInit } from './init-commands.js';
7
+ export { addPlugin } from './add-commands.js';
7
8
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/commands/index.ts"],"names":[],"mappings":"AACA,cAAc,mBAAmB,CAAC;AAClC,cAAc,mBAAmB,CAAC;AAClC,cAAc,sBAAsB,CAAC;AACrC,cAAc,qBAAqB,CAAC;AACpC,cAAc,qBAAqB,CAAC;AACpC,OAAO,EAAE,OAAO,EAAE,MAAM,oBAAoB,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/commands/index.ts"],"names":[],"mappings":"AACA,cAAc,mBAAmB,CAAC;AAClC,cAAc,mBAAmB,CAAC;AAClC,cAAc,sBAAsB,CAAC;AACrC,cAAc,qBAAqB,CAAC;AACpC,cAAc,qBAAqB,CAAC;AACpC,OAAO,EAAE,OAAO,EAAE,MAAM,oBAAoB,CAAC;AAC7C,OAAO,EAAE,SAAS,EAAE,MAAM,mBAAmB,CAAC"}
@@ -14,7 +14,7 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
14
  for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
15
  };
16
16
  Object.defineProperty(exports, "__esModule", { value: true });
17
- exports.runInit = void 0;
17
+ exports.addPlugin = exports.runInit = void 0;
18
18
  // src/commands/index.ts - Export all commands
19
19
  __exportStar(require("./run-commands.js"), exports);
20
20
  __exportStar(require("./dev-commands.js"), exports);
@@ -23,3 +23,5 @@ __exportStar(require("./start-commands.js"), exports);
23
23
  __exportStar(require("./build-commands.js"), exports);
24
24
  var init_commands_js_1 = require("./init-commands.js");
25
25
  Object.defineProperty(exports, "runInit", { enumerable: true, get: function () { return init_commands_js_1.runInit; } });
26
+ var add_commands_js_1 = require("./add-commands.js");
27
+ Object.defineProperty(exports, "addPlugin", { enumerable: true, get: function () { return add_commands_js_1.addPlugin; } });
@@ -1 +1 @@
1
- {"version":3,"file":"logger.d.ts","sourceRoot":"","sources":["../../src/logger.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,aAAa,EAAE,SAAS,EAAE,MAAM,SAAS,CAAC;AAGnD,cAAM,MAAM;IACV,OAAO,CAAC,MAAM,CAAC,QAAQ,CAAS;IAChC,OAAO,CAAC,YAAY,CAAK;IACzB,OAAO,CAAC,YAAY,CAA2C;IAC/D,OAAO,CAAC,aAAa,CAAuC;IAC5D,OAAO,CAAC,UAAU,CAAgC;IAClD,OAAO,CAAC,aAAa,CAAsD;IAC3E,OAAO,CAAC,YAAY,CAAK;IACzB,OAAO,CAAC,gBAAgB,CAA0C;IAClE,OAAO,CAAC,eAAe,CAAS;IAEhC,OAAO;IAEP,MAAM,CAAC,WAAW,IAAI,MAAM;IAO5B,OAAO,CAAC,eAAe;IAMvB,OAAO,CAAC,UAAU;IAMlB,WAAW,CAAC,QAAQ,EAAE,MAAM,EAAE,GAAG,IAAI;IAyBrC,OAAO,CAAC,aAAa;IAyBrB,YAAY,CAAC,OAAO,EAAE,MAAM,GAAG,MAAM;IAMrC,YAAY,CAAC,MAAM,EAAE,aAAa,GAAG,IAAI;IAMzC,WAAW,CAAC,OAAO,EAAE,MAAM,GAAG,IAAI;IAyClC,WAAW,CAAC,OAAO,EAAE,MAAM,GAAG,IAAI;IAIlC,SAAS,CAAC,OAAO,EAAE,MAAM,EAAE,KAAK,GAAE,MAAM,GAAG,OAAO,GAAG,MAAe,GAAG,IAAI;IAU3E,UAAU,CAAC,OAAO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lC,SAAS,CAAC,OAAO,EAAE,MAAM,EAAE,KAAK,GAAE,MAAM,GAAG,OAAO,GAAG,MAAe,GAAG,IAAI;IAU3E,UAAU,CAAC,OAAO,EAAE,MAAM,GAAG,IAAI;IAuBjC,YAAY,CAAC,OAAO,EAAE,MAAM,GAAG,IAAI;IAoBnC,WAAW,CAAC,OAAO,EAAE,MAAM,GAAG,IAAI;IAelC,eAAe,IAAI,IAAI;IAevB,YAAY,CAAC,MAAM,EAAE,SAAS,GAAG,IAAI;IAerC,UAAU,CAAC,MAAM,EAAE,SAAS,GAAG,IAAI;IAmBnC,QAAQ,CAAC,MAAM,EAAE,SAAS,EAAE,aAAa,EAAE,OAAO,GAAG,IAAI;IAqCzD,YAAY,CAAC,OAAO,EAAE,SAAS,EAAE,GAAG,IAAI;CAyDzC;;AAED,wBAAoC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "neex",
3
- "version": "0.7.41",
3
+ "version": "0.7.43",
4
4
  "description": "Neex - Modern Fullstack Framework Built on Express and Next.js. Fast to Start, Easy to Build, Ready to Deploy",
5
5
  "main": "dist/src/index.js",
6
6
  "types": "dist/src/index.d.ts",