@tramvai/cli 2.110.0 → 2.111.1

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 (41) hide show
  1. package/lib/builder/webpack/tokens.d.ts +3 -0
  2. package/lib/commands/update/dependantLibs.d.ts +0 -1
  3. package/lib/commands/update/dependantLibs.js +3 -24
  4. package/lib/commands/update/dependantLibs.js.map +1 -1
  5. package/lib/commands/update/updatePackageJson.js +3 -5
  6. package/lib/commands/update/updatePackageJson.js.map +1 -1
  7. package/lib/di/tokens/config.d.ts +1 -0
  8. package/lib/library/webpack/application/client/common.js +7 -1
  9. package/lib/library/webpack/application/client/common.js.map +1 -1
  10. package/lib/library/webpack/application/server/prod.js +24 -0
  11. package/lib/library/webpack/application/server/prod.js.map +1 -1
  12. package/lib/library/webpack/blocks/optimize.js +4 -0
  13. package/lib/library/webpack/blocks/optimize.js.map +1 -1
  14. package/lib/library/webpack/child-app/client/common.js +7 -1
  15. package/lib/library/webpack/child-app/client/common.js.map +1 -1
  16. package/lib/library/webpack/child-app/moduleFederationShared.js +4 -4
  17. package/lib/library/webpack/plugins/ModuleFederationFixRange.d.ts +23 -0
  18. package/lib/library/webpack/plugins/ModuleFederationFixRange.js +125 -0
  19. package/lib/library/webpack/plugins/ModuleFederationFixRange.js.map +1 -0
  20. package/lib/schema/autogeneratedSchema.json +21 -3
  21. package/lib/typings/configEntry/cli.d.ts +7 -1
  22. package/lib/utils/tramvaiVersions.d.ts +3 -0
  23. package/lib/utils/tramvaiVersions.js +30 -0
  24. package/lib/utils/tramvaiVersions.js.map +1 -0
  25. package/package.json +8 -8
  26. package/schema.json +21 -3
  27. package/src/commands/update/dependantLibs.ts +1 -23
  28. package/src/commands/update/updatePackageJson.ts +2 -5
  29. package/src/library/swc/__integration__/__snapshots__/swc.build.test.ts.snap +149 -196
  30. package/src/library/swc/__integration__/__snapshots__/swc.start.test.ts.snap +30 -20
  31. package/src/library/webpack/application/client/common.ts +9 -1
  32. package/src/library/webpack/application/server/prod.ts +25 -0
  33. package/src/library/webpack/blocks/optimize.ts +4 -0
  34. package/src/library/webpack/child-app/client/common.ts +9 -1
  35. package/src/library/webpack/child-app/moduleFederationShared.ts +4 -4
  36. package/src/library/webpack/plugins/ModuleFederationFixRange.ts +174 -0
  37. package/src/models/config.spec.ts +4 -0
  38. package/src/schema/autogeneratedSchema.json +21 -3
  39. package/src/schema/tramvai.spec.ts +2 -0
  40. package/src/typings/configEntry/cli.ts +7 -1
  41. package/src/utils/tramvaiVersions.ts +26 -0
package/schema.json CHANGED
@@ -1246,7 +1246,13 @@
1246
1246
  "properties": {
1247
1247
  "defaultTramvaiDependencies": {
1248
1248
  "title": "Should default dependencies list be added to shared list",
1249
- "description": "It includes the list of commonly used dependencies in the child-apps\nBy default, it is enabled in application in case of",
1249
+ "description": "It includes the list of commonly used dependencies in the child-apps\nBy default, it is enabled in application in case of tramvai/module-child-app is specified in package.json\nand for child-apps",
1250
+ "type": "boolean"
1251
+ },
1252
+ "flexibleTramvaiVersions": {
1253
+ "title": "add caret range specifier for tramvai dependencies",
1254
+ "description": "minimal versions are inferred from package.json",
1255
+ "default": true,
1250
1256
  "type": "boolean"
1251
1257
  },
1252
1258
  "deps": {
@@ -1775,7 +1781,13 @@
1775
1781
  "properties": {
1776
1782
  "defaultTramvaiDependencies": {
1777
1783
  "title": "Should default dependencies list be added to shared list",
1778
- "description": "It includes the list of commonly used dependencies in the child-apps\nBy default, it is enabled in application in case of",
1784
+ "description": "It includes the list of commonly used dependencies in the child-apps\nBy default, it is enabled in application in case of tramvai/module-child-app is specified in package.json\nand for child-apps",
1785
+ "type": "boolean"
1786
+ },
1787
+ "flexibleTramvaiVersions": {
1788
+ "title": "add caret range specifier for tramvai dependencies",
1789
+ "description": "minimal versions are inferred from package.json",
1790
+ "default": true,
1779
1791
  "type": "boolean"
1780
1792
  },
1781
1793
  "deps": {
@@ -2304,7 +2316,13 @@
2304
2316
  "properties": {
2305
2317
  "defaultTramvaiDependencies": {
2306
2318
  "title": "Should default dependencies list be added to shared list",
2307
- "description": "It includes the list of commonly used dependencies in the child-apps\nBy default, it is enabled in application in case of",
2319
+ "description": "It includes the list of commonly used dependencies in the child-apps\nBy default, it is enabled in application in case of tramvai/module-child-app is specified in package.json\nand for child-apps",
2320
+ "type": "boolean"
2321
+ },
2322
+ "flexibleTramvaiVersions": {
2323
+ "title": "add caret range specifier for tramvai dependencies",
2324
+ "description": "minimal versions are inferred from package.json",
2325
+ "default": true,
2308
2326
  "type": "boolean"
2309
2327
  },
2310
2328
  "deps": {
@@ -1,28 +1,6 @@
1
1
  import getLatestPackageVersion from 'latest-version';
2
2
  import getPackageInfo from 'package-json';
3
-
4
- // map of packages that is not in unified versioning
5
- // but we still want to update it
6
- // actual version to update will be calculated from the some of the @tramvai/module
7
- const DEPENDANT_LIBS_MAP = new Map([
8
- ['@tinkoff/logger', '@tramvai/module-log'],
9
- ['@tinkoff/dippy', '@tramvai/core'],
10
- ['@tinkoff/router', '@tramvai/module-router'],
11
- ['@tinkoff/url', '@tramvai/module-common'],
12
- ['@tinkoff/errors', '@tramvai/module-common'],
13
- ['@tinkoff/roles', '@tramvai/module-authenticate'],
14
- ['@tinkoff/pubsub', '@tramvai/module-common'],
15
- ['@tinkoff/hook-runner', '@tramvai/module-common'],
16
- ['@tinkoff/htmlpagebuilder', '@tramvai/module-render'],
17
- ['@tinkoff/browser-timings', '@tramvai/module-metrics'],
18
- ['@tinkoff/meta-tags-generate', '@tramvai/module-render'],
19
- ['@tinkoff/pack-polyfills', ''],
20
- ['@tinkoff/browserslist-config', '@tramvai/cli'],
21
- ]);
22
-
23
- export const isDependantLib = (name: string) => {
24
- return DEPENDANT_LIBS_MAP.has(name);
25
- };
3
+ import { DEPENDANT_LIBS_MAP } from '../../utils/tramvaiVersions';
26
4
 
27
5
  export const getLibPackageVersion = async (
28
6
  name: string,
@@ -4,11 +4,8 @@ import pMap from 'p-map';
4
4
  import type { Ora } from 'ora';
5
5
  import ora from 'ora';
6
6
  import { packageHasVersion } from '../../utils/commands/dependencies/packageHasVersion';
7
- import { getLibPackageVersion, isDependantLib } from './dependantLibs';
8
-
9
- const isUnifiedVersion = (name: string) => {
10
- return name.startsWith('@tramvai');
11
- };
7
+ import { getLibPackageVersion } from './dependantLibs';
8
+ import { isDependantLib, isUnifiedVersion } from '../../utils/tramvaiVersions';
12
9
 
13
10
  const getVersionFromDep = (dep?: string) => {
14
11
  if (dep) {