create-alemonjs 0.0.6 → 0.0.8

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.6",
3
+ "version": "0.0.8",
4
4
  "description": "alemonjs dev template",
5
5
  "author": "ningmengchongshui",
6
6
  "main": "bin/index.js",
@@ -1,18 +1,27 @@
1
1
  import { defineConfig } from 'lvyjs';
2
- import { fileURLToPath } from 'url';
3
2
  import { dirname, join } from 'path';
3
+ import { fileURLToPath } from 'url';
4
4
  const __dirname = dirname(fileURLToPath(import.meta.url));
5
- const includes = (value: string) => process.argv.includes(value);
6
- const alemonjs = () => import('alemonjs').then(res => res.start('src/index.ts'));
7
- const jsxp = () => import('jsxp').then(res => res.createServer());
8
5
  export default defineConfig({
9
- plugins: [
10
- () => {
11
- if (includes('--view')) return jsxp;
12
- return alemonjs;
13
- }
6
+ watch: [
7
+ 'src/**/*.{ts,tsx,js,jsx,json,html}'
14
8
  ],
15
9
  alias: {
16
10
  entries: [{ find: '@src', replacement: join(__dirname, 'src') }]
11
+ },
12
+ assets: {
13
+ // 支持图片、字体、文本等静态资源
14
+ filter: /\.(png|jpg|jpeg|gif|svg|webp|ico|yaml|txt|ttf|md)$/
15
+ },
16
+ build: {
17
+ typescript: {
18
+ // 仅打包src目
19
+ include: ['src/**/*.ts', 'src/**/*.tsx'],
20
+ // 输出目录
21
+ outDir: 'lib',
22
+ removeComments: true,
23
+ // 生成声明文件
24
+ declaration: true
25
+ }
17
26
  }
18
27
  });
@@ -36,4 +36,4 @@
36
36
  "registry": "https://registry.npmjs.org",
37
37
  "access": "public"
38
38
  }
39
- }
39
+ }
@@ -3,18 +3,17 @@ const yaml = require('yaml');
3
3
 
4
4
  let pm2 = null;
5
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);
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
+ } catch (error) {
11
+ console.error('Error parsing YAML configuration:', error);
13
12
  }
14
13
 
15
14
  /**
16
15
  * @type {{ apps: import("pm2").StartOptions[] }}
17
16
  */
18
17
  module.exports = pm2 || {
19
- apps: []
20
- }
18
+ apps: []
19
+ };
@@ -16,7 +16,7 @@ export default async e => {
16
16
  const userRes = await mention.findOne();
17
17
  if (!userRes.count || !userRes.data) {
18
18
  // 没有找到用户
19
-
19
+ logger.warn('没有找到@用户');
20
20
  return;
21
21
  }
22
22
  const user = userRes.data;