@tramvai/cli 2.70.0 → 2.72.0

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.
@@ -0,0 +1,149 @@
1
+ 'use strict';
2
+
3
+ var tslib = require('tslib');
4
+ var mapObj = require('@tinkoff/utils/object/map');
5
+ var filterObj = require('@tinkoff/utils/object/filter');
6
+ var allObj = require('@tinkoff/utils/object/all');
7
+ var isEmpty = require('@tinkoff/utils/is/empty');
8
+ var isObject = require('@tinkoff/utils/is/object');
9
+
10
+ function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
11
+
12
+ var mapObj__default = /*#__PURE__*/_interopDefaultLegacy(mapObj);
13
+ var filterObj__default = /*#__PURE__*/_interopDefaultLegacy(filterObj);
14
+ var allObj__default = /*#__PURE__*/_interopDefaultLegacy(allObj);
15
+ var isEmpty__default = /*#__PURE__*/_interopDefaultLegacy(isEmpty);
16
+ var isObject__default = /*#__PURE__*/_interopDefaultLegacy(isObject);
17
+
18
+ var migrateCommands = function (configWithCommands) {
19
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x, _y, _z, _0, _1, _2, _3, _4, _5, _6, _7, _8, _9, _10, _11, _12, _13, _14, _15, _16, _17, _18, _19, _20, _21, _22, _23, _24, _25, _26, _27, _28, _29, _30, _31, _32, _33, _34, _35, _36, _37, _38, _39, _40, _41, _42, _43, _44, _45, _46, _47, _48, _49, _50, _51, _52, _53, _54, _55, _56, _57, _58, _59, _60, _61, _62, _63, _64, _65;
20
+ var type = configWithCommands.type, _66 = configWithCommands.commands, _67 = _66 === void 0 ? {} : _66, _68 = _67.build, build = _68 === void 0 ? {} : _68, _69 = _67.serve, serve = _69 === void 0 ? {} : _69;
21
+ if (!('commands' in configWithCommands)) {
22
+ return configWithCommands;
23
+ }
24
+ var newConfig = {
25
+ polyfill: (_a = build.options) === null || _a === void 0 ? void 0 : _a.polyfill,
26
+ serverApiDir: (_b = build.options) === null || _b === void 0 ? void 0 : _b.serverApiDir,
27
+ output: type === 'child-app' || type === 'module'
28
+ ? (_c = build.options) === null || _c === void 0 ? void 0 : _c.output
29
+ : {
30
+ server: (_d = build.options) === null || _d === void 0 ? void 0 : _d.outputServer,
31
+ client: (_e = build.options) === null || _e === void 0 ? void 0 : _e.outputClient,
32
+ static: (_f = build.options) === null || _f === void 0 ? void 0 : _f.outputStatic,
33
+ },
34
+ modern: (_g = build.configurations) === null || _g === void 0 ? void 0 : _g.modern,
35
+ fileSystemPages: ((_h = build.configurations) === null || _h === void 0 ? void 0 : _h.fileSystemPages)
36
+ ? {
37
+ enabled: (_k = (_j = build.configurations) === null || _j === void 0 ? void 0 : _j.fileSystemPages) === null || _k === void 0 ? void 0 : _k.enable,
38
+ routesDir: (_m = (_l = build.configurations) === null || _l === void 0 ? void 0 : _l.fileSystemPages) === null || _m === void 0 ? void 0 : _m.routesDir,
39
+ pagesDir: (_p = (_o = build.configurations) === null || _o === void 0 ? void 0 : _o.fileSystemPages) === null || _p === void 0 ? void 0 : _p.pagesDir,
40
+ }
41
+ : undefined,
42
+ splitChunks: ((_q = build.configurations) === null || _q === void 0 ? void 0 : _q.granularChunks) || ((_r = build.configurations) === null || _r === void 0 ? void 0 : _r.commonChunk)
43
+ ? {
44
+ mode: ((_s = build.configurations) === null || _s === void 0 ? void 0 : _s.granularChunks) ? 'granularChunks' : 'commonChunk',
45
+ granularChunksSplitNumber: (_t = build.configurations) === null || _t === void 0 ? void 0 : _t.granularChunksSplitNumber,
46
+ granularChunksMinSize: (_u = build.configurations) === null || _u === void 0 ? void 0 : _u.granularChunksMinSize,
47
+ commonChunkSplitNumber: (_v = build.configurations) === null || _v === void 0 ? void 0 : _v.commonChunkSplitNumber,
48
+ }
49
+ : undefined,
50
+ checkAsyncTs: (_w = build.configurations) === null || _w === void 0 ? void 0 : _w.checkAsyncTs,
51
+ externals: ((_x = build.configurations) === null || _x === void 0 ? void 0 : _x.externals) || ((_y = serve.configurations) === null || _y === void 0 ? void 0 : _y.externals)
52
+ ? {
53
+ production: (_z = build.configurations) === null || _z === void 0 ? void 0 : _z.externals,
54
+ development: [].concat(
55
+ // @ts-ignore
56
+ (_1 = (_0 = build.configurations) === null || _0 === void 0 ? void 0 : _0.externals) !== null && _1 !== void 0 ? _1 : [], (_3 = (_2 = serve.configurations) === null || _2 === void 0 ? void 0 : _2.externals) !== null && _3 !== void 0 ? _3 : []),
57
+ }
58
+ : undefined,
59
+ experiments: ((_4 = build.configurations) === null || _4 === void 0 ? void 0 : _4.experiments) || ((_5 = serve.configurations) === null || _5 === void 0 ? void 0 : _5.experiments)
60
+ ? {
61
+ serverRunner: (_7 = (_6 = serve.configurations) === null || _6 === void 0 ? void 0 : _6.experiments) === null || _7 === void 0 ? void 0 : _7.serverRunner,
62
+ webpack: (_10 = (_9 = (_8 = build.configurations) === null || _8 === void 0 ? void 0 : _8.experiments) === null || _9 === void 0 ? void 0 : _9.webpack) !== null && _10 !== void 0 ? _10 : (_12 = (_11 = serve.configurations) === null || _11 === void 0 ? void 0 : _11.experiments) === null || _12 === void 0 ? void 0 : _12.webpack,
63
+ minicss: {
64
+ useImportModule: {
65
+ production: (_15 = (_14 = (_13 = build.configurations) === null || _13 === void 0 ? void 0 : _13.experiments) === null || _14 === void 0 ? void 0 : _14.minicss) === null || _15 === void 0 ? void 0 : _15.useImportModule,
66
+ development: (_18 = (_17 = (_16 = serve.configurations) === null || _16 === void 0 ? void 0 : _16.experiments) === null || _17 === void 0 ? void 0 : _17.minicss) === null || _18 === void 0 ? void 0 : _18.useImportModule,
67
+ },
68
+ },
69
+ transpilation: {
70
+ loader: {
71
+ production: (_21 = (_20 = (_19 = build.configurations) === null || _19 === void 0 ? void 0 : _19.experiments) === null || _20 === void 0 ? void 0 : _20.transpilation) === null || _21 === void 0 ? void 0 : _21.loader,
72
+ development: (_24 = (_23 = (_22 = serve.configurations) === null || _22 === void 0 ? void 0 : _22.experiments) === null || _23 === void 0 ? void 0 : _23.transpilation) === null || _24 === void 0 ? void 0 : _24.loader,
73
+ },
74
+ },
75
+ }
76
+ : undefined,
77
+ sourceMap: typeof ((_25 = serve.configurations) === null || _25 === void 0 ? void 0 : _25.sourceMap) === 'undefined'
78
+ ? (_26 = build.configurations) === null || _26 === void 0 ? void 0 : _26.sourceMap
79
+ : {
80
+ production: (_27 = build.configurations) === null || _27 === void 0 ? void 0 : _27.sourceMap,
81
+ development: (_28 = serve.configurations) === null || _28 === void 0 ? void 0 : _28.sourceMap,
82
+ },
83
+ excludesPresetEnv: (_29 = build.configurations) === null || _29 === void 0 ? void 0 : _29.excludesPresetEnv,
84
+ threadLoader: (_30 = build.configurations) === null || _30 === void 0 ? void 0 : _30.threadLoader,
85
+ define: ((_31 = build.configurations) === null || _31 === void 0 ? void 0 : _31.definePlugin)
86
+ ? {
87
+ development: (_33 = (_32 = build.configurations) === null || _32 === void 0 ? void 0 : _32.definePlugin) === null || _33 === void 0 ? void 0 : _33.dev,
88
+ production: (_35 = (_34 = build.configurations) === null || _34 === void 0 ? void 0 : _34.definePlugin) === null || _35 === void 0 ? void 0 : _35.prod,
89
+ }
90
+ : undefined,
91
+ generateDataQaTag: (_36 = build.configurations) === null || _36 === void 0 ? void 0 : _36.generateDataQaTag,
92
+ enableFillActionNamePlugin: (_37 = build.configurations) === null || _37 === void 0 ? void 0 : _37.enableFillActionNamePlugin,
93
+ postcss: ((_38 = build.configurations) === null || _38 === void 0 ? void 0 : _38.postcss)
94
+ ? {
95
+ config: (_40 = (_39 = build.configurations) === null || _39 === void 0 ? void 0 : _39.postcss) === null || _40 === void 0 ? void 0 : _40.config,
96
+ cssLocalIdentName: (_43 = (_42 = (_41 = build.configurations) === null || _41 === void 0 ? void 0 : _41.postcss) === null || _42 === void 0 ? void 0 : _42.cssLocalIdentName) !== null && _43 !== void 0 ? _43 : {
97
+ development: (_45 = (_44 = build.configurations) === null || _44 === void 0 ? void 0 : _44.postcss) === null || _45 === void 0 ? void 0 : _45.cssLocalIdentNameDev,
98
+ production: (_47 = (_46 = build.configurations) === null || _46 === void 0 ? void 0 : _46.postcss) === null || _47 === void 0 ? void 0 : _47.cssLocalIdentNameProd,
99
+ },
100
+ assetsConfig: (_49 = (_48 = build.configurations) === null || _48 === void 0 ? void 0 : _48.postcss) === null || _49 === void 0 ? void 0 : _49.assetsConfig,
101
+ cssModulePattern: (_51 = (_50 = build.configurations) === null || _50 === void 0 ? void 0 : _50.postcss) === null || _51 === void 0 ? void 0 : _51.cssModulePattern,
102
+ }
103
+ : undefined,
104
+ alias: (_52 = build.configurations) === null || _52 === void 0 ? void 0 : _52.alias,
105
+ svgo: (_53 = build.configurations) === null || _53 === void 0 ? void 0 : _53.svgo,
106
+ imageOptimization: (_54 = build.configurations) === null || _54 === void 0 ? void 0 : _54.imageOptimization,
107
+ transpileOnlyModernLibs: (_55 = build.configurations) === null || _55 === void 0 ? void 0 : _55.transpileOnlyModernLibs,
108
+ webpack: {
109
+ resolveAlias: (_56 = build.configurations) === null || _56 === void 0 ? void 0 : _56.webpackResolveAlias,
110
+ provide: (_57 = build.configurations) === null || _57 === void 0 ? void 0 : _57.webpackProvide,
111
+ },
112
+ dedupe: {
113
+ // @ts-ignore
114
+ enabled: ((_58 = build.configurations) === null || _58 === void 0 ? void 0 : _58.dedupe) === false ? false : undefined,
115
+ // @ts-ignore
116
+ strategy: ((_59 = build.configurations) === null || _59 === void 0 ? void 0 : _59.dedupe) === 'semver' ? 'semver' : undefined,
117
+ ignore: (_60 = build.configurations) === null || _60 === void 0 ? void 0 : _60.dedupeIgnore,
118
+ },
119
+ terser: ((_61 = build.configurations) === null || _61 === void 0 ? void 0 : _61.terserParallel)
120
+ ? {
121
+ parallel: (_62 = build.configurations) === null || _62 === void 0 ? void 0 : _62.terserParallel,
122
+ }
123
+ : undefined,
124
+ cssMinimize: (_63 = build.configurations) === null || _63 === void 0 ? void 0 : _63.cssMinimize,
125
+ hotRefresh: {
126
+ enabled: (_64 = serve.configurations) === null || _64 === void 0 ? void 0 : _64.hotRefresh,
127
+ options: (_65 = serve.configurations) === null || _65 === void 0 ? void 0 : _65.hotRefreshOptions,
128
+ },
129
+ notifications: serve.notifications,
130
+ };
131
+ return filterObj__default["default"](function (val) {
132
+ return isObject__default["default"](val) ? !allObj__default["default"](function (v) { return isEmpty__default["default"](v); }, val) : !isEmpty__default["default"](val);
133
+ }, tslib.__assign(tslib.__assign(tslib.__assign({}, configWithCommands), newConfig), { commands: undefined }));
134
+ };
135
+ var d20230201bTramvaiConfigRefactoring = (function (api) { return tslib.__awaiter(void 0, void 0, void 0, function () {
136
+ var config;
137
+ return tslib.__generator(this, function (_a) {
138
+ config = api.tramvaiJSON.source;
139
+ if (typeof config.projectsConfig === 'object') {
140
+ config.projectsConfig = migrateCommands(config.projectsConfig);
141
+ }
142
+ config.projects = mapObj__default["default"](function (value) {
143
+ return migrateCommands(value);
144
+ }, config.projects);
145
+ return [2 /*return*/];
146
+ });
147
+ }); });
148
+
149
+ module.exports = d20230201bTramvaiConfigRefactoring;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tramvai/cli",
3
- "version": "2.70.0",
3
+ "version": "2.72.0",
4
4
  "description": "Cli инструмент для сборки и запуска приложений",
5
5
  "files": [
6
6
  "src",
@@ -16,8 +16,7 @@
16
16
  "tramvai-debug": "bin/platform-debug.js"
17
17
  },
18
18
  "scripts": {
19
- "build": "npm run generate-schema && tsc",
20
- "build-publish": "npm run generate-schema && tramvai-build --only migrations --cp false && tsc",
19
+ "build": "npm run generate-schema && tramvai-build --only migrations --cp false && tsc",
21
20
  "watch": "npm run generate-schema && tsc -w",
22
21
  "generate-schema": "generate-schema"
23
22
  },
@@ -61,19 +60,19 @@
61
60
  "@sentry/node": "^6.2.5",
62
61
  "@svgr/webpack": "^6.4.0",
63
62
  "@tinkoff/browserslist-config": "0.2.4",
64
- "@tinkoff/dippy": "0.8.12",
63
+ "@tinkoff/dippy": "0.8.13",
65
64
  "@tinkoff/is-modern-lib": "2.0.6",
66
- "@tinkoff/logger": "0.10.57",
65
+ "@tinkoff/logger": "0.10.58",
67
66
  "@tinkoff/minicss-class-generator": "0.2.5",
68
- "@tinkoff/package-manager-wrapper": "0.1.5",
67
+ "@tinkoff/package-manager-wrapper": "0.1.6",
69
68
  "@tinkoff/request-core": "^0.9.2",
70
69
  "@tinkoff/request-plugin-protocol-http": "^0.11.6",
71
70
  "@tinkoff/utils": "^2.1.3",
72
- "@tinkoff/webpack-dedupe-plugin": "1.0.1",
73
- "@tramvai/build": "3.1.1",
74
- "@tramvai/react": "2.70.0",
75
- "@tramvai/tools-check-versions": "0.4.8",
76
- "@tramvai/tools-migrate": "0.6.10",
71
+ "@tinkoff/webpack-dedupe-plugin": "1.0.2",
72
+ "@tramvai/build": "3.1.2",
73
+ "@tramvai/react": "2.72.0",
74
+ "@tramvai/tools-check-versions": "0.4.9",
75
+ "@tramvai/tools-migrate": "0.6.11",
77
76
  "ajv": "^6.12.6",
78
77
  "ansi-escapes": "^4.3.2",
79
78
  "autoprefixer": "^10.4.8",