@modern-js/app-tools 3.1.3 → 3.1.5

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 (33) hide show
  1. package/dist/cjs/commands/dev.js +1 -2
  2. package/dist/cjs/esm/register-esm.js +3 -8
  3. package/dist/cjs/esm/register-esm.mjs +3 -8
  4. package/dist/cjs/esm/ts-node-loader.js +6 -9
  5. package/dist/cjs/esm/ts-node-loader.mjs +6 -9
  6. package/dist/cjs/esm/ts-paths-loader.js +14 -36
  7. package/dist/cjs/esm/ts-paths-loader.mjs +14 -36
  8. package/dist/cjs/plugins/analyze/utils.js +25 -8
  9. package/dist/cjs/plugins/deploy/utils/generator.js +1 -1
  10. package/dist/cjs/utils/register.js +62 -29
  11. package/dist/esm/commands/dev.mjs +1 -2
  12. package/dist/esm/esm/register-esm.mjs +3 -8
  13. package/dist/esm/esm/ts-node-loader.mjs +6 -9
  14. package/dist/esm/esm/ts-paths-loader.mjs +14 -36
  15. package/dist/esm/plugins/analyze/utils.mjs +24 -7
  16. package/dist/esm/plugins/deploy/utils/generator.mjs +1 -1
  17. package/dist/esm/utils/register.mjs +63 -30
  18. package/dist/esm-node/commands/dev.mjs +1 -2
  19. package/dist/esm-node/esm/register-esm.mjs +3 -8
  20. package/dist/esm-node/esm/ts-node-loader.mjs +6 -9
  21. package/dist/esm-node/esm/ts-paths-loader.mjs +14 -36
  22. package/dist/esm-node/plugins/analyze/utils.mjs +24 -7
  23. package/dist/esm-node/plugins/deploy/utils/generator.mjs +1 -1
  24. package/dist/esm-node/utils/register.mjs +63 -30
  25. package/dist/types/esm/register-esm.d.mts +3 -2
  26. package/dist/types/esm/ts-node-loader.d.mts +3 -4
  27. package/dist/types/utils/register.d.ts +0 -1
  28. package/package.json +15 -16
  29. package/dist/cjs/esm/utils.js +0 -69
  30. package/dist/cjs/esm/utils.mjs +0 -31
  31. package/dist/esm/esm/utils.mjs +0 -32
  32. package/dist/esm-node/esm/utils.mjs +0 -33
  33. package/dist/types/esm/utils.d.mts +0 -5
@@ -1,32 +0,0 @@
1
- import { createRequire } from "module";
2
- import path from "path";
3
- import { getAliasConfig } from "@modern-js/utils";
4
- import { createMatchPath } from "@modern-js/utils/tsconfig-paths";
5
- const utils_require = createRequire(import.meta.url);
6
- function utils_createMatchPath({ alias, appDir, tsconfigPath }) {
7
- const aliasConfig = getAliasConfig(alias, {
8
- appDirectory: appDir,
9
- tsconfigPath
10
- });
11
- const { paths = {}, absoluteBaseUrl = './' } = aliasConfig;
12
- const tsPaths = Object.keys(paths).reduce((o, key)=>{
13
- let tsPath = paths[key];
14
- if ('string' == typeof tsPath && key.startsWith('@') && tsPath.startsWith('@')) try {
15
- tsPath = utils_require.resolve(tsPath, {
16
- paths: [
17
- appDir
18
- ]
19
- });
20
- } catch {}
21
- if ('string' == typeof tsPath && path.isAbsolute(tsPath)) tsPath = path.relative(absoluteBaseUrl, tsPath);
22
- if ('string' == typeof tsPath) tsPath = [
23
- tsPath
24
- ];
25
- return {
26
- ...o,
27
- [`${key}`]: tsPath
28
- };
29
- }, {});
30
- return createMatchPath(absoluteBaseUrl, tsPaths);
31
- }
32
- export { utils_createMatchPath as createMatchPath };
@@ -1,33 +0,0 @@
1
- import "node:module";
2
- import { createRequire } from "module";
3
- import path from "path";
4
- import { getAliasConfig } from "@modern-js/utils";
5
- import { createMatchPath } from "@modern-js/utils/tsconfig-paths";
6
- const utils_require = createRequire(import.meta.url);
7
- function utils_createMatchPath({ alias, appDir, tsconfigPath }) {
8
- const aliasConfig = getAliasConfig(alias, {
9
- appDirectory: appDir,
10
- tsconfigPath
11
- });
12
- const { paths = {}, absoluteBaseUrl = './' } = aliasConfig;
13
- const tsPaths = Object.keys(paths).reduce((o, key)=>{
14
- let tsPath = paths[key];
15
- if ('string' == typeof tsPath && key.startsWith('@') && tsPath.startsWith('@')) try {
16
- tsPath = utils_require.resolve(tsPath, {
17
- paths: [
18
- appDir
19
- ]
20
- });
21
- } catch {}
22
- if ('string' == typeof tsPath && path.isAbsolute(tsPath)) tsPath = path.relative(absoluteBaseUrl, tsPath);
23
- if ('string' == typeof tsPath) tsPath = [
24
- tsPath
25
- ];
26
- return {
27
- ...o,
28
- [`${key}`]: tsPath
29
- };
30
- }, {});
31
- return createMatchPath(absoluteBaseUrl, tsPaths);
32
- }
33
- export { utils_createMatchPath as createMatchPath };
@@ -1,5 +0,0 @@
1
- export function createMatchPath({ alias, appDir, tsconfigPath }: {
2
- alias: any;
3
- appDir: any;
4
- tsconfigPath: any;
5
- }): import("@modern-js/utils/tsconfig-paths").MatchPath;