@modern-js/utils 1.1.0 → 1.1.4-rc.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (39) hide show
  1. package/CHANGELOG.md +27 -66
  2. package/dist/js/modern/alias.js +10 -10
  3. package/dist/js/modern/compatRequire.js +11 -0
  4. package/dist/js/modern/constants.js +51 -3
  5. package/dist/js/modern/getEntryOptions.js +15 -6
  6. package/dist/js/modern/is/type.js +3 -0
  7. package/dist/js/modern/logger.js +2 -2
  8. package/dist/js/modern/monorepo.js +2 -2
  9. package/dist/js/modern/runtimeExports.js +5 -2
  10. package/dist/js/node/alias.js +10 -10
  11. package/dist/js/node/compatRequire.js +16 -2
  12. package/dist/js/node/constants.js +58 -6
  13. package/dist/js/node/getEntryOptions.js +16 -6
  14. package/dist/js/node/is/type.js +5 -0
  15. package/dist/js/node/logger.js +2 -2
  16. package/dist/js/node/monorepo.js +2 -2
  17. package/dist/js/node/runtimeExports.js +8 -2
  18. package/dist/js/treeshaking/alias.js +9 -9
  19. package/dist/js/treeshaking/compatRequire.js +14 -0
  20. package/dist/js/treeshaking/constants.js +51 -3
  21. package/dist/js/treeshaking/formatWebpackMessages.js +1 -1
  22. package/dist/js/treeshaking/getEntryOptions.js +16 -5
  23. package/dist/js/treeshaking/is/type.js +4 -1
  24. package/dist/js/treeshaking/logger.js +3 -3
  25. package/dist/js/treeshaking/monorepo.js +2 -2
  26. package/dist/js/treeshaking/runtimeExports.js +8 -2
  27. package/dist/types/compatRequire.d.ts +2 -1
  28. package/dist/types/constants.d.ts +22 -2
  29. package/dist/types/getEntryOptions.d.ts +1 -1
  30. package/dist/types/is/type.d.ts +2 -1
  31. package/dist/types/runtimeExports.d.ts +1 -1
  32. package/package.json +5 -4
  33. package/src/alias.ts +7 -7
  34. package/src/compatRequire.ts +15 -0
  35. package/src/constants.ts +39 -2
  36. package/src/getEntryOptions.ts +23 -4
  37. package/src/is/type.ts +4 -0
  38. package/src/runtimeExports.ts +12 -1
  39. package/tests/getEntryOptions.test.ts +11 -0
@@ -15,6 +15,17 @@ describe('get entry options', () => {
15
15
  ).toEqual('a');
16
16
  });
17
17
 
18
+ test(`should compatible with main entry using packageName as key`, () => {
19
+ expect(
20
+ getEntryOptions(
21
+ 'main',
22
+ 'default value',
23
+ { 'package-name': 'a' },
24
+ 'package-name',
25
+ ),
26
+ ).toEqual('a');
27
+ });
28
+
18
29
  expect(
19
30
  getEntryOptions(
20
31
  'page-a',