@teambit/typescript 1.0.750 → 1.0.751
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/cmds/check-types.cmd.ts +4 -1
- package/dist/cmds/check-types.cmd.d.ts +2 -1
- package/dist/cmds/check-types.cmd.js +4 -1
- package/dist/cmds/check-types.cmd.js.map +1 -1
- package/dist/{preview-1757437404844.js → preview-1757523924602.js} +2 -2
- package/dist/transformers/index-signature.d.ts +1 -1
- package/package.json +21 -21
package/cmds/check-types.cmd.ts
CHANGED
@@ -8,7 +8,10 @@ import type { TypescriptMain } from '../typescript.main.runtime';
|
|
8
8
|
|
9
9
|
export class CheckTypesCmd implements Command {
|
10
10
|
name = 'check-types [component-pattern]';
|
11
|
-
description = '
|
11
|
+
description = 'validate TypeScript type correctness';
|
12
|
+
extendedDescription = `checks for TypeScript type errors in component files, similar to running tsc.
|
13
|
+
by default only checks new and modified components. use --all to check all components.
|
14
|
+
useful for catching type issues before tagging, snapping or building components.`;
|
12
15
|
arguments = [{ name: 'component-pattern', description: COMPONENT_PATTERN_HELP }];
|
13
16
|
alias = '';
|
14
17
|
group = 'testing';
|
@@ -8,6 +8,7 @@ export declare class CheckTypesCmd implements Command {
|
|
8
8
|
private logger;
|
9
9
|
name: string;
|
10
10
|
description: string;
|
11
|
+
extendedDescription: string;
|
11
12
|
arguments: {
|
12
13
|
name: string;
|
13
14
|
description: string;
|
@@ -28,7 +29,7 @@ export declare class CheckTypesCmd implements Command {
|
|
28
29
|
strict: boolean;
|
29
30
|
}): Promise<{
|
30
31
|
code: number;
|
31
|
-
data: import("@teambit/ts-server/
|
32
|
+
data: import("@teambit/ts-server/ts-server-client").DiagnosticData[];
|
32
33
|
}>;
|
33
34
|
private runDiagnosticOnTsServer;
|
34
35
|
}
|
@@ -35,7 +35,10 @@ class CheckTypesCmd {
|
|
35
35
|
this.workspace = workspace;
|
36
36
|
this.logger = logger;
|
37
37
|
_defineProperty(this, "name", 'check-types [component-pattern]');
|
38
|
-
_defineProperty(this, "description", '
|
38
|
+
_defineProperty(this, "description", 'validate TypeScript type correctness');
|
39
|
+
_defineProperty(this, "extendedDescription", `checks for TypeScript type errors in component files, similar to running tsc.
|
40
|
+
by default only checks new and modified components. use --all to check all components.
|
41
|
+
useful for catching type issues before tagging, snapping or building components.`);
|
39
42
|
_defineProperty(this, "arguments", [{
|
40
43
|
name: 'component-pattern',
|
41
44
|
description: _legacy().COMPONENT_PATTERN_HELP
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"names":["_workspace","data","require","_chalk","_interopRequireDefault","_legacy","e","__esModule","default","_defineProperty","r","t","_toPropertyKey","Object","defineProperty","value","enumerable","configurable","writable","i","_toPrimitive","Symbol","toPrimitive","call","TypeError","String","Number","CheckTypesCmd","constructor","typescript","workspace","logger","name","description","COMPONENT_PATTERN_HELP","report","pattern","all","strict","start","Date","now","tsserver","runDiagnosticOnTsServer","end","msg","killTsServer","lastDiagnostics","length","code","chalk","red","green","json","diagData","diagnosticData","isJson","OutsideWorkspaceError","components","getComponentsByUserInput","files","getSupportedFilesForTsserver","initTsserverClientFromWorkspace","aggregateDiagnosticData","printTypeErrors","getTsserverClient","Error","getDiagnostic","exports"],"sources":["check-types.cmd.ts"],"sourcesContent":["import type { Command, CommandOptions } from '@teambit/cli';\nimport type { Logger } from '@teambit/logger';\nimport type { Workspace } from '@teambit/workspace';\nimport { OutsideWorkspaceError } from '@teambit/workspace';\nimport chalk from 'chalk';\nimport { COMPONENT_PATTERN_HELP } from '@teambit/legacy.constants';\nimport type { TypescriptMain } from '../typescript.main.runtime';\n\nexport class CheckTypesCmd implements Command {\n name = 'check-types [component-pattern]';\n description = '
|
1
|
+
{"version":3,"names":["_workspace","data","require","_chalk","_interopRequireDefault","_legacy","e","__esModule","default","_defineProperty","r","t","_toPropertyKey","Object","defineProperty","value","enumerable","configurable","writable","i","_toPrimitive","Symbol","toPrimitive","call","TypeError","String","Number","CheckTypesCmd","constructor","typescript","workspace","logger","name","description","COMPONENT_PATTERN_HELP","report","pattern","all","strict","start","Date","now","tsserver","runDiagnosticOnTsServer","end","msg","killTsServer","lastDiagnostics","length","code","chalk","red","green","json","diagData","diagnosticData","isJson","OutsideWorkspaceError","components","getComponentsByUserInput","files","getSupportedFilesForTsserver","initTsserverClientFromWorkspace","aggregateDiagnosticData","printTypeErrors","getTsserverClient","Error","getDiagnostic","exports"],"sources":["check-types.cmd.ts"],"sourcesContent":["import type { Command, CommandOptions } from '@teambit/cli';\nimport type { Logger } from '@teambit/logger';\nimport type { Workspace } from '@teambit/workspace';\nimport { OutsideWorkspaceError } from '@teambit/workspace';\nimport chalk from 'chalk';\nimport { COMPONENT_PATTERN_HELP } from '@teambit/legacy.constants';\nimport type { TypescriptMain } from '../typescript.main.runtime';\n\nexport class CheckTypesCmd implements Command {\n name = 'check-types [component-pattern]';\n description = 'validate TypeScript type correctness';\n extendedDescription = `checks for TypeScript type errors in component files, similar to running tsc.\nby default only checks new and modified components. use --all to check all components.\nuseful for catching type issues before tagging, snapping or building components.`;\n arguments = [{ name: 'component-pattern', description: COMPONENT_PATTERN_HELP }];\n alias = '';\n group = 'testing';\n options = [\n ['a', 'all', 'check-types for all components, not only modified and new'],\n ['', 'strict', 'in case issues found, exit with code 1'],\n ['j', 'json', 'return the output in json format'],\n ] as CommandOptions;\n\n constructor(\n private typescript: TypescriptMain,\n private workspace: Workspace,\n private logger: Logger\n ) {}\n\n async report([pattern]: [string], { all = false, strict = false }: { all: boolean; strict: boolean }) {\n const start = Date.now();\n const tsserver = await this.runDiagnosticOnTsServer(false, pattern, all);\n const end = Date.now() - start;\n const msg = `completed type checking (${end / 1000} sec)`;\n tsserver.killTsServer();\n if (tsserver.lastDiagnostics.length) {\n return {\n code: strict ? 1 : 0,\n data: chalk.red(`${msg}. found errors in ${tsserver.lastDiagnostics.length} files.`),\n };\n }\n return {\n code: 0,\n data: chalk.green(`${msg}. no errors were found.`),\n };\n }\n\n async json([pattern]: [string], { all = false, strict = false }: { all: boolean; strict: boolean }) {\n const tsserver = await this.runDiagnosticOnTsServer(true, pattern, all);\n const diagData = tsserver.diagnosticData;\n tsserver.killTsServer();\n if (tsserver.lastDiagnostics.length) {\n return {\n code: strict ? 1 : 0,\n data: diagData,\n };\n }\n return {\n code: 0,\n data: diagData,\n };\n }\n\n private async runDiagnosticOnTsServer(isJson: boolean, pattern: string, all: boolean) {\n if (!this.workspace) throw new OutsideWorkspaceError();\n // If pattern is provided, don't pass the all flag - the pattern should take precedence\n const components = await this.workspace.getComponentsByUserInput(pattern ? false : all, pattern);\n const files = this.typescript.getSupportedFilesForTsserver(components);\n await this.typescript.initTsserverClientFromWorkspace(\n {\n aggregateDiagnosticData: isJson,\n printTypeErrors: !isJson,\n },\n files\n );\n const tsserver = this.typescript.getTsserverClient();\n if (!tsserver) throw new Error(`unable to start tsserver`);\n await tsserver.getDiagnostic(files);\n return tsserver;\n }\n}\n"],"mappings":";;;;;;AAGA,SAAAA,WAAA;EAAA,MAAAC,IAAA,GAAAC,OAAA;EAAAF,UAAA,YAAAA,CAAA;IAAA,OAAAC,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AACA,SAAAE,OAAA;EAAA,MAAAF,IAAA,GAAAG,sBAAA,CAAAF,OAAA;EAAAC,MAAA,YAAAA,CAAA;IAAA,OAAAF,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AACA,SAAAI,QAAA;EAAA,MAAAJ,IAAA,GAAAC,OAAA;EAAAG,OAAA,YAAAA,CAAA;IAAA,OAAAJ,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AAAmE,SAAAG,uBAAAE,CAAA,WAAAA,CAAA,IAAAA,CAAA,CAAAC,UAAA,GAAAD,CAAA,KAAAE,OAAA,EAAAF,CAAA;AAAA,SAAAG,gBAAAH,CAAA,EAAAI,CAAA,EAAAC,CAAA,YAAAD,CAAA,GAAAE,cAAA,CAAAF,CAAA,MAAAJ,CAAA,GAAAO,MAAA,CAAAC,cAAA,CA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,IAAI,EAAE,CAAC;MACPhD,IAAI,EAAEqD;IACR,CAAC;EACH;EAEA,MAAcX,uBAAuBA,CAACa,MAAe,EAAEpB,OAAe,EAAEC,GAAY,EAAE;IACpF,IAAI,CAAC,IAAI,CAACP,SAAS,EAAE,MAAM,KAAI2B,kCAAqB,EAAC,CAAC;IACtD;IACA,MAAMC,UAAU,GAAG,MAAM,IAAI,CAAC5B,SAAS,CAAC6B,wBAAwB,CAACvB,OAAO,GAAG,KAAK,GAAGC,GAAG,EAAED,OAAO,CAAC;IAChG,MAAMwB,KAAK,GAAG,IAAI,CAAC/B,UAAU,CAACgC,4BAA4B,CAACH,UAAU,CAAC;IACtE,MAAM,IAAI,CAAC7B,UAAU,CAACiC,+BAA+B,CACnD;MACEC,uBAAuB,EAAEP,MAAM;MAC/BQ,eAAe,EAAE,CAACR;IACpB,CAAC,EACDI,KACF,CAAC;IACD,MAAMlB,QAAQ,GAAG,IAAI,CAACb,UAAU,CAACoC,iBAAiB,CAAC,CAAC;IACpD,IAAI,CAACvB,QAAQ,EAAE,MAAM,IAAIwB,KAAK,CAAC,0BAA0B,CAAC;IAC1D,MAAMxB,QAAQ,CAACyB,aAAa,CAACP,KAAK,CAAC;IACnC,OAAOlB,QAAQ;EACjB;AACF;AAAC0B,OAAA,CAAAzC,aAAA,GAAAA,aAAA","ignoreList":[]}
|
@@ -1,5 +1,5 @@
|
|
1
|
-
import * as compositions_0 from '/home/circleci/Library/Caches/Bit/capsules/8891be5ad/teambit.typescript_typescript@1.0.
|
2
|
-
import * as overview_0 from '/home/circleci/Library/Caches/Bit/capsules/8891be5ad/teambit.typescript_typescript@1.0.
|
1
|
+
import * as compositions_0 from '/home/circleci/Library/Caches/Bit/capsules/8891be5ad/teambit.typescript_typescript@1.0.751/dist/typescript.composition.js';
|
2
|
+
import * as overview_0 from '/home/circleci/Library/Caches/Bit/capsules/8891be5ad/teambit.typescript_typescript@1.0.751/dist/typescript.docs.mdx';
|
3
3
|
|
4
4
|
export const compositions = [compositions_0];
|
5
5
|
export const overview = [overview_0];
|
@@ -6,5 +6,5 @@ import type { Identifier } from '../identifier';
|
|
6
6
|
export declare class IndexSignatureTransformer implements SchemaTransformer {
|
7
7
|
predicate(node: Node): boolean;
|
8
8
|
getIdentifiers(): Promise<Identifier[]>;
|
9
|
-
transform(node: IndexSignatureDeclaration, context: SchemaExtractorContext): Promise<
|
9
|
+
transform(node: IndexSignatureDeclaration, context: SchemaExtractorContext): Promise<IndexSignatureSchema | UnresolvedSchema>;
|
10
10
|
}
|
package/package.json
CHANGED
@@ -1,12 +1,12 @@
|
|
1
1
|
{
|
2
2
|
"name": "@teambit/typescript",
|
3
|
-
"version": "1.0.
|
3
|
+
"version": "1.0.751",
|
4
4
|
"homepage": "https://bit.cloud/teambit/typescript/typescript",
|
5
5
|
"main": "dist/index.js",
|
6
6
|
"componentId": {
|
7
7
|
"scope": "teambit.typescript",
|
8
8
|
"name": "typescript",
|
9
|
-
"version": "1.0.
|
9
|
+
"version": "1.0.751"
|
10
10
|
},
|
11
11
|
"dependencies": {
|
12
12
|
"lodash": "4.17.21",
|
@@ -18,26 +18,26 @@
|
|
18
18
|
"chalk": "4.1.2",
|
19
19
|
"@teambit/typescript.modules.ts-config-mutator": "0.0.86",
|
20
20
|
"@teambit/typescript.typescript-compiler": "2.0.63",
|
21
|
-
"@teambit/component.sources": "0.0.125",
|
22
|
-
"@teambit/legacy.utils": "0.0.26",
|
23
|
-
"@teambit/semantics.entities.semantic-schema": "0.0.92",
|
24
|
-
"@teambit/ts-server": "0.0.68",
|
25
21
|
"@teambit/harmony": "0.4.7",
|
26
|
-
"@teambit/
|
27
|
-
"@teambit/
|
28
|
-
"@teambit/
|
29
|
-
"@teambit/
|
30
|
-
"@teambit/
|
31
|
-
"@teambit/
|
32
|
-
"@teambit/
|
33
|
-
"@teambit/
|
34
|
-
"@teambit/
|
35
|
-
"@teambit/
|
36
|
-
"@teambit/
|
37
|
-
"@teambit/
|
38
|
-
"@teambit/
|
39
|
-
"@teambit/
|
40
|
-
"@teambit/
|
22
|
+
"@teambit/compiler": "1.0.751",
|
23
|
+
"@teambit/builder": "1.0.751",
|
24
|
+
"@teambit/component.sources": "0.0.126",
|
25
|
+
"@teambit/component": "1.0.751",
|
26
|
+
"@teambit/dependency-resolver": "1.0.751",
|
27
|
+
"@teambit/formatter": "1.0.751",
|
28
|
+
"@teambit/legacy.utils": "0.0.27",
|
29
|
+
"@teambit/semantics.entities.semantic-schema": "0.0.93",
|
30
|
+
"@teambit/ts-server": "0.0.69",
|
31
|
+
"@teambit/aspect-loader": "1.0.751",
|
32
|
+
"@teambit/envs": "1.0.751",
|
33
|
+
"@teambit/logger": "0.0.1366",
|
34
|
+
"@teambit/schema": "1.0.751",
|
35
|
+
"@teambit/scope": "1.0.751",
|
36
|
+
"@teambit/workspace": "1.0.751",
|
37
|
+
"@teambit/cli": "0.0.1273",
|
38
|
+
"@teambit/pkg": "1.0.751",
|
39
|
+
"@teambit/watcher": "1.0.751",
|
40
|
+
"@teambit/legacy.constants": "0.0.18"
|
41
41
|
},
|
42
42
|
"devDependencies": {
|
43
43
|
"@types/lodash": "4.14.165",
|