create-aomex 0.0.37 → 0.0.38

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-aomex",
3
- "version": "0.0.37",
3
+ "version": "0.0.38",
4
4
  "repository": "git@github.com:aomex/create-aomex.git",
5
5
  "license": "MIT",
6
6
  "type": "module",
@@ -0,0 +1,14 @@
1
+ import { readdirSync, readFileSync, writeFileSync } from 'node:fs';
2
+ import path from 'node:path';
3
+
4
+ const baseDir = path.resolve('./src');
5
+ const files = readdirSync(baseDir, { encoding: 'utf8', recursive: true });
6
+
7
+ for (const file of files) {
8
+ if (file.endsWith('.js.map')) {
9
+ const fullPath = path.join(baseDir, file);
10
+ const content = JSON.parse(readFileSync(fullPath, 'utf8'));
11
+ content.sources = content.sources.map((sourceFile) => path.basename(sourceFile));
12
+ writeFileSync(fullPath, JSON.stringify(content));
13
+ }
14
+ }
@@ -9,6 +9,7 @@ pnpm exec tsc
9
9
  pnpm exec tsc-alias --resolve-full-paths
10
10
  rm -rf src
11
11
  mv build/src .
12
+ node ./scripts/build-fix-source-map.mjs
12
13
  pnpm install --prod
13
14
  pnpm store prune
14
15
  rm -rf node_modules/@types node_modules/*/*.d.ts
@@ -1,14 +1,14 @@
1
1
  import { commanders, ConsoleApp } from '@aomex/console';
2
2
  import { crons } from '@aomex/cron';
3
3
  import { traceMiddleware } from '@aomex/async-trace';
4
- import { cache } from './services/cache.service';
4
+ import { services } from '@services';
5
5
 
6
6
  const app = new ConsoleApp({
7
7
  language: 'zh_CN',
8
8
  mount: [
9
9
  crons({
10
10
  commanders: './src/commanders',
11
- cache: cache,
11
+ cache: services.cache.instance,
12
12
  }),
13
13
  traceMiddleware('生命周期', async (_record) => {
14
14
  // 根据 record.delta 上报慢日志