@modern-js/module-tools 1.1.5 → 1.3.2

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 (74) hide show
  1. package/.eslintrc.js +4 -1
  2. package/CHANGELOG.md +85 -0
  3. package/dist/js/modern/cli/build.js +1 -1
  4. package/dist/js/modern/cli/dev.js +2 -2
  5. package/dist/js/modern/commands/dev.js +13 -1
  6. package/dist/js/modern/features/dev/index.js +11 -0
  7. package/dist/js/node/cli/build.js +1 -1
  8. package/dist/js/node/cli/dev.js +2 -2
  9. package/dist/js/node/commands/dev.js +12 -1
  10. package/dist/js/node/features/dev/index.js +16 -2
  11. package/dist/types/commands/build.d.ts +1 -1
  12. package/dist/types/commands/dev.d.ts +1 -1
  13. package/dist/types/features/dev/index.d.ts +2 -1
  14. package/dist/types/index.d.ts +3 -1
  15. package/jest.config.js +8 -0
  16. package/lib/types.d.ts +0 -11
  17. package/package.json +30 -22
  18. package/tests/dev-cli.test.ts +25 -0
  19. package/tests/dev-command.test.ts +44 -0
  20. package/tests/dev-feature.test.ts +30 -0
  21. package/tests/fixtures/tspaths/a.ts +1 -0
  22. package/tests/fixtures/tspaths/b.ts +1 -0
  23. package/tests/index.test.ts +7 -0
  24. package/tests/tsconfig.json +11 -0
  25. package/tests/tspaths-transform.test.ts +21 -0
  26. package/tsconfig.json +2 -3
  27. package/src/.eslintrc.json +0 -5
  28. package/src/cli/build.ts +0 -39
  29. package/src/cli/dev.ts +0 -24
  30. package/src/cli/index.ts +0 -3
  31. package/src/cli/new.ts +0 -32
  32. package/src/commands/build.ts +0 -74
  33. package/src/commands/dev.ts +0 -43
  34. package/src/commands/index.ts +0 -2
  35. package/src/features/build/build-platform.ts +0 -83
  36. package/src/features/build/build-watch.ts +0 -99
  37. package/src/features/build/build.ts +0 -111
  38. package/src/features/build/constants.ts +0 -52
  39. package/src/features/build/index.ts +0 -54
  40. package/src/features/build/logger/index.ts +0 -2
  41. package/src/features/build/logger/logText.ts +0 -80
  42. package/src/features/build/logger/loggerManager.ts +0 -132
  43. package/src/features/build/utils.ts +0 -235
  44. package/src/features/dev/index.ts +0 -62
  45. package/src/index.ts +0 -55
  46. package/src/locale/en.ts +0 -21
  47. package/src/locale/index.ts +0 -15
  48. package/src/locale/zh.ts +0 -21
  49. package/src/schema/index.ts +0 -4
  50. package/src/schema/output.ts +0 -41
  51. package/src/schema/schema.d.ts +0 -13
  52. package/src/schema/source.ts +0 -16
  53. package/src/tasks/build-source-code.ts +0 -234
  54. package/src/tasks/build-style.ts +0 -194
  55. package/src/tasks/build-watch-source-code.ts +0 -186
  56. package/src/tasks/build-watch-style.ts +0 -271
  57. package/src/tasks/constants.ts +0 -1
  58. package/src/tasks/copy-assets.ts +0 -123
  59. package/src/tasks/generator-dts.ts +0 -277
  60. package/src/type.d.ts +0 -1
  61. package/src/types.ts +0 -65
  62. package/src/utils/babel.ts +0 -104
  63. package/src/utils/color.ts +0 -3
  64. package/src/utils/copy.ts +0 -71
  65. package/src/utils/init-env.ts +0 -31
  66. package/src/utils/json.ts +0 -13
  67. package/src/utils/language.ts +0 -9
  68. package/src/utils/logger.ts +0 -141
  69. package/src/utils/readline.ts +0 -28
  70. package/src/utils/tsconfig.ts +0 -37
  71. package/src/utils/tspaths-transform/constants.ts +0 -19
  72. package/src/utils/tspaths-transform/index.ts +0 -139
  73. package/src/utils/tspaths-transform/utils.ts +0 -25
  74. package/src/utils/valide.ts +0 -37
@@ -1,37 +0,0 @@
1
- import { validAlias } from '@modern-js/utils';
2
- import type { NormalizedConfig } from '@modern-js/core';
3
-
4
- export interface IValideOption {
5
- modernConfig: NormalizedConfig;
6
- tsconfigPath: string;
7
- }
8
-
9
- export const valideBeforeTask = ({
10
- modernConfig,
11
- tsconfigPath,
12
- }: IValideOption) => {
13
- const modernConfigValidResult = modernConfigValid(modernConfig, {
14
- tsconfigPath,
15
- });
16
- if (modernConfigValidResult) {
17
- console.error(modernConfigValidResult);
18
- // eslint-disable-next-line no-process-exit
19
- process.exit(0);
20
- }
21
- };
22
-
23
- export const modernConfigValid = (
24
- modernConfig: NormalizedConfig,
25
- option: { tsconfigPath: string },
26
- ) => {
27
- const valids = [validAlias];
28
-
29
- for (const validFn of valids) {
30
- const result = validFn(modernConfig, option);
31
- if (result) {
32
- return result;
33
- }
34
- }
35
-
36
- return null;
37
- };