@tramvai/cli 2.34.0 → 2.36.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.
- package/lib/api/analyze/index.d.ts +2 -1
- package/lib/api/analyze/index.js.map +1 -1
- package/lib/api/benchmark/index.d.ts +2 -1
- package/lib/api/benchmark/index.js.map +1 -1
- package/lib/api/build/index.d.ts +2 -1
- package/lib/api/build/index.js.map +1 -1
- package/lib/api/start/index.d.ts +2 -1
- package/lib/api/start/index.js.map +1 -1
- package/lib/api/start-prod/index.d.ts +2 -1
- package/lib/api/start-prod/index.js.map +1 -1
- package/lib/library/babel/plugins/create-token-pure.js +3 -0
- package/lib/library/babel/plugins/create-token-pure.js.map +1 -1
- package/lib/schema/autogeneratedSchema.json +2 -2
- package/lib/typings/configEntry/application.d.ts +2 -2
- package/package.json +2 -2
- package/schema.json +2 -2
- package/src/api/analyze/index.ts +2 -1
- package/src/api/benchmark/index.ts +3 -1
- package/src/api/build/index.ts +2 -1
- package/src/api/start/index.ts +2 -1
- package/src/api/start-prod/index.ts +2 -1
- package/src/library/babel/plugins/__fixtures__/create-token-pure/many-imports.ts +9 -0
- package/src/library/babel/plugins/__snapshots__/create-token-pure.spec.ts.snap +26 -0
- package/src/library/babel/plugins/create-token-pure.spec.ts +4 -0
- package/src/library/babel/plugins/create-token-pure.ts +4 -0
- package/src/schema/autogeneratedSchema.json +2 -2
- package/src/schema/tramvai.spec.ts +2 -2
- package/src/typings/configEntry/application.ts +2 -2
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import type { Provider } from '@tinkoff/dippy';
|
|
1
2
|
export interface Params {
|
|
2
3
|
target: string;
|
|
3
4
|
plugin?: 'bundle' | 'whybundled' | 'statoscope';
|
|
@@ -5,6 +6,6 @@ export interface Params {
|
|
|
5
6
|
showConfig?: boolean;
|
|
6
7
|
fileCache?: boolean;
|
|
7
8
|
}
|
|
8
|
-
export declare type AnalyzeCommand = (params: Params) => Promise<void>;
|
|
9
|
+
export declare type AnalyzeCommand = (params: Params, providers?: Provider[]) => Promise<void>;
|
|
9
10
|
declare const _default: import("../../typings/commands").Command;
|
|
10
11
|
export default _default;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/api/analyze/index.ts"],"names":[],"mappings":";;;
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/api/analyze/index.ts"],"names":[],"mappings":";;;AACA,gEAA6D;AAC7D,4CAA2F;AAC3F,uCAAmD;AACnD,+CAAqD;AAYrD,kBAAe,IAAA,6BAAa,EAAC;IAC3B,IAAI,EAAE,SAAS;IACf,OAAO,EAAE,CAAO,EAAE,EAAiB,EAAE;QACnC,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,GAAG,EAAE,CAAC,GAAG,CAAC,iCAAwB,CAAW,CAAC;QAEtE,IAAA,sBAAiB,EAAC,EAAE,EAAE,wBAAe,CAAC,CAAC;QAEvC,MAAM,cAAc,GAAG,EAAE,CAAC,GAAG,CAAC,uCAA8B,CAAC,CAAC;QAC9D,MAAM,OAAO,GAAG,MAAM,cAAc,CAAC,aAAa,CAAC,SAAS,EAAE;YAC5D,OAAO,EAAE;gBACP,iBAAiB,EAAE,IAAI;gBACvB,iBAAiB,EAAE,KAAK;aACzB;SACF,CAAC,CAAC;QAEH,MAAM,OAAO,CAAC,OAAO,CAAC,EAAE,MAAM,EAAE,MAAM,EAAE,CAAC,CAAC;IAC5C,CAAC,CAAA;CACF,CAAC,CAAC"}
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import type { Provider } from '@tinkoff/dippy';
|
|
1
2
|
import type { BuildParams, BuildResult } from './build';
|
|
2
3
|
import type { StartParams, StartResult } from './start';
|
|
3
4
|
import type { RunStats } from './types';
|
|
@@ -9,6 +10,6 @@ export interface Params {
|
|
|
9
10
|
export interface Result {
|
|
10
11
|
[key: string]: RunStats;
|
|
11
12
|
}
|
|
12
|
-
export declare type BenchmarkCommand = (params: StartParams | BuildParams) => Promise<StartResult | BuildResult>;
|
|
13
|
+
export declare type BenchmarkCommand = (params: StartParams | BuildParams, providers?: Provider[]) => Promise<StartResult | BuildResult>;
|
|
13
14
|
declare const _default: import("../../typings/commands").Command;
|
|
14
15
|
export default _default;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/api/benchmark/index.ts"],"names":[],"mappings":";;
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/api/benchmark/index.ts"],"names":[],"mappings":";;AACA,0CAAyC;AACzC,gEAA6D;AAC7D,4CAA+E;AAE/E,mCAAyC;AAEzC,mCAAyC;AAkBzC,kBAAe,IAAA,6BAAa,EAAC;IAC3B,IAAI,EAAE,WAAW;IACjB,OAAO,EAAE,CAAC,EAAE,EAAmB,EAAE;QAC/B,MAAM,EAAE,OAAO,EAAE,GAAG,EAAE,CAAC,GAAG,CAAC,iCAAwB,CAAW,CAAC;QAE/D,QAAQ,OAAO,EAAE;YACf,KAAK,OAAO;gBACV,OAAO,IAAA,sBAAc,EAAC,EAAE,CAAC,CAAC;YAC5B,KAAK,OAAO;gBACV,OAAO,IAAA,sBAAc,EAAC,EAAE,CAAC,CAAC;SAC7B;IACH,CAAC;IACD,SAAS,EAAE;QACT,IAAA,eAAO,EAAC;YACN,OAAO,EAAE,2BAAkB;YAC3B,8EAA8E;YAC9E,QAAQ,EAAE,KAAK;SAChB,CAAC;KACH;CACF,CAAC,CAAC"}
|
package/lib/api/build/index.d.ts
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import type { PromiseType } from 'utility-types';
|
|
2
|
+
import type { Provider } from '@tinkoff/dippy';
|
|
2
3
|
import type { WithConfig } from '../shared/types/withConfig';
|
|
3
4
|
import type { Builder } from '../../typings/build/Builder';
|
|
4
5
|
export declare type Params = WithConfig<{
|
|
@@ -18,6 +19,6 @@ export declare type Params = WithConfig<{
|
|
|
18
19
|
export declare type Result<T extends string = any> = Promise<PromiseType<ReturnType<Builder<T>['build']>> & {
|
|
19
20
|
builder?: Builder<T>;
|
|
20
21
|
}>;
|
|
21
|
-
export declare type BuildCommand = (params: Params) => Result;
|
|
22
|
+
export declare type BuildCommand = (params: Params, providers?: Provider[]) => Result;
|
|
22
23
|
declare const _default: import("../../typings/commands").Command;
|
|
23
24
|
export default _default;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/api/build/index.ts"],"names":[],"mappings":";;
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/api/build/index.ts"],"names":[],"mappings":";;AAEA,gEAA6D;AAE7D,+CAAiD;AACjD,qCAAuC;AACvC,4CAAqD;AACrD,uCAAyC;AACzC,2CAA4C;AA4B5C,kBAAe,IAAA,6BAAa,EAAC;IAC3B,IAAI,EAAE,OAAO;IACb,OAAO,EAAE,CAAC,EAAE,EAAU,EAAE;QACtB,MAAM,WAAW,GAAG,EAAE,CAAC,GAAG,CAAC,2BAAkB,CAAC,CAAC;QAE/C,QAAQ,WAAW,CAAC,IAAI,EAAE;YACxB,KAAK,aAAa;gBAChB,OAAO,IAAA,8BAAgB,EAAC,EAAE,CAAC,CAAC;YAC9B,KAAK,QAAQ;gBACX,OAAO,IAAA,oBAAW,EAAC,EAAE,CAAC,CAAC;YACzB,KAAK,WAAW;gBACd,OAAO,IAAA,yBAAa,EAAC,EAAE,CAAC,CAAC;YAC3B,KAAK,SAAS;gBACZ,OAAO,IAAA,sBAAY,EAAC,EAAE,CAAC,CAAC;SAC3B;IACH,CAAC;CACF,CAAC,CAAC"}
|
package/lib/api/start/index.d.ts
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
/// <reference types="node" />
|
|
2
2
|
import type { Server } from 'http';
|
|
3
3
|
import type { PromiseType } from 'utility-types';
|
|
4
|
+
import type { Provider } from '@tinkoff/dippy';
|
|
4
5
|
import type { WithConfig } from '../shared/types/withConfig';
|
|
5
6
|
import type { Builder } from '../../typings/build/Builder';
|
|
6
7
|
export declare type Params = WithConfig<{
|
|
@@ -29,6 +30,6 @@ export declare type Result<T extends string = any> = Promise<PromiseType<ReturnT
|
|
|
29
30
|
server?: Server;
|
|
30
31
|
builder: Builder<T>;
|
|
31
32
|
}>;
|
|
32
|
-
export declare type StartCommand = (params: Params) => Result;
|
|
33
|
+
export declare type StartCommand = (params: Params, providers?: Provider[]) => Result;
|
|
33
34
|
declare const _default: import("../../typings/commands").Command;
|
|
34
35
|
export default _default;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/api/start/index.ts"],"names":[],"mappings":";;
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/api/start/index.ts"],"names":[],"mappings":";;AAGA,gEAA6D;AAE7D,+CAAiD;AACjD,qCAAuC;AACvC,4CAAqD;AACrD,2CAA4C;AAmC5C,kBAAe,IAAA,6BAAa,EAAC;IAC3B,IAAI,EAAE,OAAO;IACb,OAAO,EAAE,CAAC,EAAE,EAAU,EAAE;QACtB,MAAM,WAAW,GAAG,EAAE,CAAC,GAAG,CAAC,2BAAkB,CAAC,CAAC;QAE/C,QAAQ,WAAW,CAAC,IAAI,EAAE;YACxB,KAAK,aAAa;gBAChB,OAAO,IAAA,8BAAgB,EAAC,EAAE,CAAC,CAAC;YAC9B,KAAK,QAAQ;gBACX,OAAO,IAAA,oBAAW,EAAC,EAAE,CAAC,CAAC;YACzB,KAAK,WAAW;gBACd,OAAO,IAAA,yBAAa,EAAC,EAAE,CAAC,CAAC;SAC5B;IACH,CAAC;CACF,CAAC,CAAC"}
|
|
@@ -3,6 +3,7 @@
|
|
|
3
3
|
import type { Server } from 'http';
|
|
4
4
|
import type { PromiseType } from 'utility-types';
|
|
5
5
|
import type { ChildProcess } from 'child_process';
|
|
6
|
+
import type { Provider } from '@tinkoff/dippy';
|
|
6
7
|
import type { WithConfig } from '../shared/types/withConfig';
|
|
7
8
|
import type { Builder } from '../../typings/build/Builder';
|
|
8
9
|
export declare type Params = WithConfig<{
|
|
@@ -24,6 +25,6 @@ export declare type Result<T extends string = any> = Promise<PromiseType<ReturnT
|
|
|
24
25
|
serverProcess?: ChildProcess;
|
|
25
26
|
builder: Builder<T>;
|
|
26
27
|
}>;
|
|
27
|
-
export declare type StartProdCommand = (params: Params) => Result;
|
|
28
|
+
export declare type StartProdCommand = (params: Params, providers?: Provider[]) => Result;
|
|
28
29
|
declare const _default: import("../../typings/commands").Command;
|
|
29
30
|
export default _default;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/api/start-prod/index.ts"],"names":[],"mappings":";;
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/api/start-prod/index.ts"],"names":[],"mappings":";;AAIA,gEAA6D;AAE7D,4CAAqD;AAErD,+CAAqD;AACrD,2CAAgD;AA2BhD,kBAAe,IAAA,6BAAa,EAAC;IAC3B,IAAI,EAAE,YAAY;IAClB,OAAO,EAAE,CAAC,EAAE,EAAU,EAAE;QACtB,MAAM,WAAW,GAAG,EAAE,CAAC,GAAG,CAAC,2BAAkB,CAAC,CAAC;QAE/C,QAAQ,WAAW,CAAC,IAAI,EAAE;YACxB,KAAK,aAAa;gBAChB,OAAO,IAAA,kCAAoB,EAAC,EAAE,CAAC,CAAC;YAClC,KAAK,QAAQ,CAAC;YACd,KAAK,WAAW;gBACd,OAAO,IAAA,6BAAiB,EAAC,EAAE,CAAC,CAAC;SAChC;IACH,CAAC;CACF,CAAC,CAAC"}
|
|
@@ -10,6 +10,9 @@ const createTokenPurePlugin = ({ types: t }) => {
|
|
|
10
10
|
},
|
|
11
11
|
visitor: {
|
|
12
12
|
ImportDeclaration(path) {
|
|
13
|
+
if (this.hasCreateToken) {
|
|
14
|
+
return;
|
|
15
|
+
}
|
|
13
16
|
const { node } = path;
|
|
14
17
|
const sourceValue = node.source.value;
|
|
15
18
|
if (sourceValue === '@tramvai/core' || sourceValue === '@tinkoff/dippy') {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"create-token-pure.js","sourceRoot":"","sources":["../../../../src/library/babel/plugins/create-token-pure.ts"],"names":[],"mappings":";;;;AAAA,qGAA4D;AAOrD,MAAM,qBAAqB,GAAuB,CAAC,EAAE,KAAK,EAAE,CAAC,EAAE,EAAE,EAAE;IACxE,OAAO;QACL,GAAG;YACD,IAAI,CAAC,cAAc,GAAG,KAAK,CAAC;QAC9B,CAAC;QACD,OAAO,EAAE;YACP,iBAAiB,CAAC,IAAI;gBACpB,MAAM,EAAE,IAAI,EAAE,GAAG,IAAI,CAAC;gBACtB,MAAM,WAAW,GAAG,IAAI,CAAC,MAAM,CAAC,KAAK,CAAC;gBAEtC,IAAI,WAAW,KAAK,eAAe,IAAI,WAAW,KAAK,gBAAgB,EAAE;oBACvE,IAAI,CAAC,cAAc,GAAG,IAAI,CAAC,UAAU,CAAC,IAAI,CACxC,CAAC,CAAC,EAAE,EAAE,WAAC,OAAA,CAAC,CAAC,IAAI,KAAK,iBAAiB,IAAI,CAAA,MAAA,CAAC,CAAC,KAAK,0CAAE,IAAI,MAAK,aAAa,CAAA,EAAA,CACvE,CAAC;iBACH;YACH,CAAC;YACD,cAAc,CAAC,IAAI;gBACjB,MAAM,EAAE,IAAI,EAAE,GAAG,IAAI,CAAC;gBAEtB,IAAI,CAAC,IAAI,CAAC,cAAc,EAAE;oBACxB,OAAO;iBACR;gBAED,MAAM,EAAE,MAAM,EAAE,GAAG,IAAI,CAAC;gBAExB,IAAI,CAAA,MAAM,aAAN,MAAM,uBAAN,MAAM,CAAE,IAAI,MAAK,YAAY,EAAE;oBACjC,IAAI,CAAA,MAAM,aAAN,MAAM,uBAAN,MAAM,CAAE,IAAI,MAAK,aAAa,EAAE;wBAClC,IAAA,iCAAc,EAAC,IAAI,CAAC,CAAC;qBACtB;iBACF;YACH,CAAC;SACF;KACF,CAAC;AACJ,CAAC,CAAC;
|
|
1
|
+
{"version":3,"file":"create-token-pure.js","sourceRoot":"","sources":["../../../../src/library/babel/plugins/create-token-pure.ts"],"names":[],"mappings":";;;;AAAA,qGAA4D;AAOrD,MAAM,qBAAqB,GAAuB,CAAC,EAAE,KAAK,EAAE,CAAC,EAAE,EAAE,EAAE;IACxE,OAAO;QACL,GAAG;YACD,IAAI,CAAC,cAAc,GAAG,KAAK,CAAC;QAC9B,CAAC;QACD,OAAO,EAAE;YACP,iBAAiB,CAAC,IAAI;gBACpB,IAAI,IAAI,CAAC,cAAc,EAAE;oBACvB,OAAO;iBACR;gBAED,MAAM,EAAE,IAAI,EAAE,GAAG,IAAI,CAAC;gBACtB,MAAM,WAAW,GAAG,IAAI,CAAC,MAAM,CAAC,KAAK,CAAC;gBAEtC,IAAI,WAAW,KAAK,eAAe,IAAI,WAAW,KAAK,gBAAgB,EAAE;oBACvE,IAAI,CAAC,cAAc,GAAG,IAAI,CAAC,UAAU,CAAC,IAAI,CACxC,CAAC,CAAC,EAAE,EAAE,WAAC,OAAA,CAAC,CAAC,IAAI,KAAK,iBAAiB,IAAI,CAAA,MAAA,CAAC,CAAC,KAAK,0CAAE,IAAI,MAAK,aAAa,CAAA,EAAA,CACvE,CAAC;iBACH;YACH,CAAC;YACD,cAAc,CAAC,IAAI;gBACjB,MAAM,EAAE,IAAI,EAAE,GAAG,IAAI,CAAC;gBAEtB,IAAI,CAAC,IAAI,CAAC,cAAc,EAAE;oBACxB,OAAO;iBACR;gBAED,MAAM,EAAE,MAAM,EAAE,GAAG,IAAI,CAAC;gBAExB,IAAI,CAAA,MAAM,aAAN,MAAM,uBAAN,MAAM,CAAE,IAAI,MAAK,YAAY,EAAE;oBACjC,IAAI,CAAA,MAAM,aAAN,MAAM,uBAAN,MAAM,CAAE,IAAI,MAAK,aAAa,EAAE;wBAClC,IAAA,iCAAc,EAAC,IAAI,CAAC,CAAC;qBACtB;iBACF;YACH,CAAC;SACF;KACF,CAAC;AACJ,CAAC,CAAC;AArCW,QAAA,qBAAqB,yBAqChC;AAEF,kBAAe,6BAAqB,CAAC"}
|
|
@@ -366,7 +366,7 @@
|
|
|
366
366
|
},
|
|
367
367
|
"granularChunks": {
|
|
368
368
|
"title": "Separate one common chunk to many small dynamic chunks",
|
|
369
|
-
"default":
|
|
369
|
+
"default": true,
|
|
370
370
|
"type": "boolean"
|
|
371
371
|
},
|
|
372
372
|
"granularChunksSplitNumber": {
|
|
@@ -381,7 +381,7 @@
|
|
|
381
381
|
},
|
|
382
382
|
"commonChunk": {
|
|
383
383
|
"title": "Enable auto chunk splitting (`granularChunks` option alternative)",
|
|
384
|
-
"default":
|
|
384
|
+
"default": false,
|
|
385
385
|
"type": "boolean"
|
|
386
386
|
},
|
|
387
387
|
"commonChunkSplitNumber": {
|
|
@@ -47,7 +47,7 @@ export interface ApplicationBuild {
|
|
|
47
47
|
configurations?: ConfigEntry['commands']['build']['configurations'] & {
|
|
48
48
|
/**
|
|
49
49
|
* @title Separate one common chunk to many small dynamic chunks
|
|
50
|
-
* @default
|
|
50
|
+
* @default true
|
|
51
51
|
*/
|
|
52
52
|
granularChunks?: boolean;
|
|
53
53
|
/**
|
|
@@ -62,7 +62,7 @@ export interface ApplicationBuild {
|
|
|
62
62
|
granularChunksMinSize?: number;
|
|
63
63
|
/**
|
|
64
64
|
* @title Enable auto chunk splitting (`granularChunks` option alternative)
|
|
65
|
-
* @default
|
|
65
|
+
* @default false
|
|
66
66
|
*/
|
|
67
67
|
commonChunk?: boolean;
|
|
68
68
|
/**
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@tramvai/cli",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.36.0",
|
|
4
4
|
"description": "Cli инструмент для сборки и запуска приложений",
|
|
5
5
|
"files": [
|
|
6
6
|
"src",
|
|
@@ -69,7 +69,7 @@
|
|
|
69
69
|
"@tinkoff/request-plugin-protocol-http": "^0.11.6",
|
|
70
70
|
"@tinkoff/utils": "^2.1.3",
|
|
71
71
|
"@tramvai/build": "3.0.6",
|
|
72
|
-
"@tramvai/react": "2.
|
|
72
|
+
"@tramvai/react": "2.36.0",
|
|
73
73
|
"@tramvai/tools-check-versions": "0.4.5",
|
|
74
74
|
"@tramvai/tools-migrate": "0.6.6",
|
|
75
75
|
"ajv": "^6.12.6",
|
package/schema.json
CHANGED
|
@@ -387,7 +387,7 @@
|
|
|
387
387
|
},
|
|
388
388
|
"granularChunks": {
|
|
389
389
|
"title": "Separate one common chunk to many small dynamic chunks",
|
|
390
|
-
"default":
|
|
390
|
+
"default": true,
|
|
391
391
|
"type": "boolean"
|
|
392
392
|
},
|
|
393
393
|
"granularChunksSplitNumber": {
|
|
@@ -402,7 +402,7 @@
|
|
|
402
402
|
},
|
|
403
403
|
"commonChunk": {
|
|
404
404
|
"title": "Enable auto chunk splitting (`granularChunks` option alternative)",
|
|
405
|
-
"default":
|
|
405
|
+
"default": false,
|
|
406
406
|
"type": "boolean"
|
|
407
407
|
},
|
|
408
408
|
"commonChunkSplitNumber": {
|
package/src/api/analyze/index.ts
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import type { Provider } from '@tinkoff/dippy';
|
|
1
2
|
import { createCommand } from '../../commands/createCommand';
|
|
2
3
|
import { ABSTRACT_BUILDER_FACTORY_TOKEN, COMMAND_PARAMETERS_TOKEN } from '../../di/tokens';
|
|
3
4
|
import { registerProviders } from '../../utils/di';
|
|
@@ -11,7 +12,7 @@ export interface Params {
|
|
|
11
12
|
fileCache?: boolean;
|
|
12
13
|
}
|
|
13
14
|
|
|
14
|
-
export type AnalyzeCommand = (params: Params) => Promise<void>;
|
|
15
|
+
export type AnalyzeCommand = (params: Params, providers?: Provider[]) => Promise<void>;
|
|
15
16
|
|
|
16
17
|
export default createCommand({
|
|
17
18
|
name: 'analyze',
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import type { Provider } from '@tinkoff/dippy';
|
|
1
2
|
import { provide } from '@tinkoff/dippy';
|
|
2
3
|
import { createCommand } from '../../commands/createCommand';
|
|
3
4
|
import { COMMAND_PARAMETERS_TOKEN, UI_OS_NOTIFY_TOKEN } from '../../di/tokens';
|
|
@@ -18,7 +19,8 @@ export interface Result {
|
|
|
18
19
|
}
|
|
19
20
|
|
|
20
21
|
export type BenchmarkCommand = (
|
|
21
|
-
params: StartParams | BuildParams
|
|
22
|
+
params: StartParams | BuildParams,
|
|
23
|
+
providers?: Provider[]
|
|
22
24
|
) => Promise<StartResult | BuildResult>;
|
|
23
25
|
|
|
24
26
|
export default createCommand({
|
package/src/api/build/index.ts
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import type { PromiseType } from 'utility-types';
|
|
2
|
+
import type { Provider } from '@tinkoff/dippy';
|
|
2
3
|
import { createCommand } from '../../commands/createCommand';
|
|
3
4
|
import type { WithConfig } from '../shared/types/withConfig';
|
|
4
5
|
import { buildApplication } from './application';
|
|
@@ -31,7 +32,7 @@ export type Result<T extends string = any> = Promise<
|
|
|
31
32
|
}
|
|
32
33
|
>;
|
|
33
34
|
|
|
34
|
-
export type BuildCommand = (params: Params) => Result;
|
|
35
|
+
export type BuildCommand = (params: Params, providers?: Provider[]) => Result;
|
|
35
36
|
|
|
36
37
|
export default createCommand({
|
|
37
38
|
name: 'build',
|
package/src/api/start/index.ts
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import type { Server } from 'http';
|
|
2
2
|
import type { PromiseType } from 'utility-types';
|
|
3
|
+
import type { Provider } from '@tinkoff/dippy';
|
|
3
4
|
import { createCommand } from '../../commands/createCommand';
|
|
4
5
|
import type { WithConfig } from '../shared/types/withConfig';
|
|
5
6
|
import { startApplication } from './application';
|
|
@@ -38,7 +39,7 @@ export type Result<T extends string = any> = Promise<
|
|
|
38
39
|
}
|
|
39
40
|
>;
|
|
40
41
|
|
|
41
|
-
export type StartCommand = (params: Params) => Result;
|
|
42
|
+
export type StartCommand = (params: Params, providers?: Provider[]) => Result;
|
|
42
43
|
|
|
43
44
|
export default createCommand({
|
|
44
45
|
name: 'start',
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import type { Server } from 'http';
|
|
2
2
|
import type { PromiseType } from 'utility-types';
|
|
3
3
|
import type { ChildProcess } from 'child_process';
|
|
4
|
+
import type { Provider } from '@tinkoff/dippy';
|
|
4
5
|
import { createCommand } from '../../commands/createCommand';
|
|
5
6
|
import type { WithConfig } from '../shared/types/withConfig';
|
|
6
7
|
import { CONFIG_ENTRY_TOKEN } from '../../di/tokens';
|
|
@@ -31,7 +32,7 @@ export type Result<T extends string = any> = Promise<
|
|
|
31
32
|
}
|
|
32
33
|
>;
|
|
33
34
|
|
|
34
|
-
export type StartProdCommand = (params: Params) => Result;
|
|
35
|
+
export type StartProdCommand = (params: Params, providers?: Provider[]) => Result;
|
|
35
36
|
|
|
36
37
|
export default createCommand({
|
|
37
38
|
name: 'start-prod',
|
|
@@ -52,6 +52,32 @@ import { createToken } from '@tinkoff/dippy';
|
|
|
52
52
|
export var TOKEN = /* #__PURE__*/ createToken('token');
|
|
53
53
|
|
|
54
54
|
|
|
55
|
+
`;
|
|
56
|
+
|
|
57
|
+
exports[`create-token-pure do not miss createToken on many imports: do not miss createToken on many imports 1`] = `
|
|
58
|
+
|
|
59
|
+
// @ts-ignore
|
|
60
|
+
// eslint-disable-next-line import/no-unresolved
|
|
61
|
+
import { createToken } from '@tinkoff/dippy';
|
|
62
|
+
import { Module } from '@tramvai/core'
|
|
63
|
+
|
|
64
|
+
export const TOKEN = createToken('token');
|
|
65
|
+
const module = Module({
|
|
66
|
+
providers: []
|
|
67
|
+
});
|
|
68
|
+
|
|
69
|
+
↓ ↓ ↓ ↓ ↓ ↓
|
|
70
|
+
|
|
71
|
+
// @ts-ignore
|
|
72
|
+
// eslint-disable-next-line import/no-unresolved
|
|
73
|
+
import { createToken } from '@tinkoff/dippy';
|
|
74
|
+
import { Module } from '@tramvai/core';
|
|
75
|
+
export var TOKEN = /*#__PURE__*/ createToken('token');
|
|
76
|
+
var module = Module({
|
|
77
|
+
providers: [],
|
|
78
|
+
});
|
|
79
|
+
|
|
80
|
+
|
|
55
81
|
`;
|
|
56
82
|
|
|
57
83
|
exports[`create-token-pure do nothing: do nothing 1`] = `
|
|
@@ -366,7 +366,7 @@
|
|
|
366
366
|
},
|
|
367
367
|
"granularChunks": {
|
|
368
368
|
"title": "Separate one common chunk to many small dynamic chunks",
|
|
369
|
-
"default":
|
|
369
|
+
"default": true,
|
|
370
370
|
"type": "boolean"
|
|
371
371
|
},
|
|
372
372
|
"granularChunksSplitNumber": {
|
|
@@ -381,7 +381,7 @@
|
|
|
381
381
|
},
|
|
382
382
|
"commonChunk": {
|
|
383
383
|
"title": "Enable auto chunk splitting (`granularChunks` option alternative)",
|
|
384
|
-
"default":
|
|
384
|
+
"default": false,
|
|
385
385
|
"type": "boolean"
|
|
386
386
|
},
|
|
387
387
|
"commonChunkSplitNumber": {
|
|
@@ -95,7 +95,7 @@ describe('JSON schema для tramvai.json', () => {
|
|
|
95
95
|
"build": {
|
|
96
96
|
"configurations": {
|
|
97
97
|
"checkAsyncTs": false,
|
|
98
|
-
"commonChunk":
|
|
98
|
+
"commonChunk": false,
|
|
99
99
|
"commonChunkSplitNumber": 3,
|
|
100
100
|
"dedupe": "equality",
|
|
101
101
|
"definePlugin": {
|
|
@@ -122,7 +122,7 @@ describe('JSON schema для tramvai.json', () => {
|
|
|
122
122
|
"routesDir": "routes",
|
|
123
123
|
},
|
|
124
124
|
"generateDataQaTag": false,
|
|
125
|
-
"granularChunks":
|
|
125
|
+
"granularChunks": true,
|
|
126
126
|
"granularChunksMinSize": 20000,
|
|
127
127
|
"granularChunksSplitNumber": 2,
|
|
128
128
|
"modern": true,
|
|
@@ -48,7 +48,7 @@ export interface ApplicationBuild {
|
|
|
48
48
|
configurations?: ConfigEntry['commands']['build']['configurations'] & {
|
|
49
49
|
/**
|
|
50
50
|
* @title Separate one common chunk to many small dynamic chunks
|
|
51
|
-
* @default
|
|
51
|
+
* @default true
|
|
52
52
|
*/
|
|
53
53
|
granularChunks?: boolean;
|
|
54
54
|
/**
|
|
@@ -63,7 +63,7 @@ export interface ApplicationBuild {
|
|
|
63
63
|
granularChunksMinSize?: number;
|
|
64
64
|
/**
|
|
65
65
|
* @title Enable auto chunk splitting (`granularChunks` option alternative)
|
|
66
|
-
* @default
|
|
66
|
+
* @default false
|
|
67
67
|
*/
|
|
68
68
|
commonChunk?: boolean;
|
|
69
69
|
/**
|