create-alemonjs 0.0.4 → 0.0.6

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.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "create-alemonjs",
3
- "version": "0.0.4",
3
+ "version": "0.0.6",
4
4
  "description": "alemonjs dev template",
5
5
  "author": "ningmengchongshui",
6
6
  "main": "bin/index.js",
@@ -16,4 +16,4 @@ https://github.com/lemonade-lab/alemongo
16
16
 
17
17
  ```yaml
18
18
  port: 17117 # 开启协议端口,默认不开启(生产模式)
19
- ```
19
+ ```
@@ -5,7 +5,7 @@
5
5
  # 具体见 pm2.config.cjs
6
6
  pm2:
7
7
  apps:
8
- - name: 'gui'
9
- script: 'node index.js --login gui'
8
+ - name: 'qq-bot'
9
+ script: 'node index.js --login qq-bot'
10
10
  env:
11
11
  NODE_ENV: 'production'
@@ -22,10 +22,10 @@
22
22
  "@types/node": "^22",
23
23
  "@alemonjs/db": "^0.0.13",
24
24
  "@alemonjs/bubble": "^2.1.4",
25
- "@alemonjs/discord": "^2.1.4",
25
+ "@alemonjs/discord": "^2.1.7",
26
26
  "@alemonjs/onebot": "^2.1.4",
27
27
  "@alemonjs/qq-bot": "^2.1.4",
28
- "alemonjs": "2.1.37",
28
+ "alemonjs": "2.1.42",
29
29
  "jsxp": "1.2.4",
30
30
  "tailwindcss": "3",
31
31
  "cssnano": "^7",
@@ -1,14 +1,20 @@
1
1
  const fs = require('fs');
2
2
  const yaml = require('yaml');
3
3
 
4
- // Read and parse the YAML configuration file
5
- const data = fs.readFileSync('./alemon.config.yaml', 'utf8');
6
- const config = yaml.parse(data);
7
-
8
- // Extracting PM2 configuration
9
- const pm2 = config?.pm2 ?? {};
4
+ let pm2 = null;
5
+ try {
6
+ // Read and parse the YAML configuration file
7
+ const data = fs.readFileSync('./alemon.config.yaml', 'utf8');
8
+ const config = yaml.parse(data);
9
+ pm2 = config?.pm2 ?? {};
10
+ }
11
+ catch (error) {
12
+ console.error('Error parsing YAML configuration:', error);
13
+ }
10
14
 
11
15
  /**
12
16
  * @type {{ apps: import("pm2").StartOptions[] }}
13
17
  */
14
- module.exports = pm2;
18
+ module.exports = pm2 || {
19
+ apps: []
20
+ }