@teambit/schema 1.0.926 → 1.0.928
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/dist/index.d.ts +1 -1
- package/dist/index.js.map +1 -1
- package/dist/mock/button-diff.json +139 -0
- package/dist/mock/button-v2/button.composition.d.ts +10 -0
- package/dist/mock/button-v2/button.composition.js +59 -0
- package/dist/mock/button-v2/button.composition.js.map +1 -0
- package/dist/mock/button-v2/button.d.ts +25 -0
- package/dist/mock/button-v2/button.js +55 -0
- package/dist/mock/button-v2/button.js.map +1 -0
- package/dist/mock/button-v2/index.d.ts +127 -0
- package/dist/mock/button-v2/index.js +238 -0
- package/dist/mock/button-v2/index.js.map +1 -0
- package/dist/mock/button-v2/tsconfig.json +19 -0
- package/dist/preview-1775143204644.js +9 -0
- package/dist/schema-diff.cmd.d.ts +30 -0
- package/dist/schema-diff.cmd.js +252 -0
- package/dist/schema-diff.cmd.js.map +1 -0
- package/dist/schema.cmd.d.ts +1 -0
- package/dist/schema.cmd.js +1 -0
- package/dist/schema.cmd.js.map +1 -1
- package/dist/schema.graphql.js +47 -0
- package/dist/schema.graphql.js.map +1 -1
- package/dist/schema.main.runtime.d.ts +29 -3
- package/dist/schema.main.runtime.js +60 -5
- package/dist/schema.main.runtime.js.map +1 -1
- package/dist/schema.spec.js +108 -0
- package/dist/schema.spec.js.map +1 -1
- package/mock/button-diff.json +139 -0
- package/mock/button-v2/button.composition.tsx +33 -0
- package/mock/button-v2/button.tsx +58 -0
- package/mock/button-v2/index.ts +214 -0
- package/mock/button-v2/tsconfig.json +19 -0
- package/package.json +17 -15
- package/dist/preview-1774991821432.js +0 -8
package/dist/index.d.ts
CHANGED
|
@@ -4,6 +4,6 @@ export type { SchemaExtractor } from './schema-extractor';
|
|
|
4
4
|
export type { SchemaExtractorOptions } from './schema-extractor';
|
|
5
5
|
export { SchemaTask, SCHEMA_ARTIFACT_NAME, SCHEMA_TASK_NAME, getSchemaArtifactDef, getSchemaArtifactPath, } from './schema.task';
|
|
6
6
|
export type { SchemaEnv } from './schema-env';
|
|
7
|
-
export type { SchemaMain } from './schema.main.runtime';
|
|
7
|
+
export type { SchemaMain, ImpactRuleSlot } from './schema.main.runtime';
|
|
8
8
|
export default SchemaAspect;
|
|
9
9
|
export { SchemaAspect };
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_schema","data","require","_schema2","_default","exports","default","SchemaAspect"],"sources":["index.ts"],"sourcesContent":["import { SchemaAspect } from './schema.aspect';\n\nexport type { Parser } from './parser';\nexport type { SchemaExtractor } from './schema-extractor';\nexport type { SchemaExtractorOptions } from './schema-extractor';\nexport {\n SchemaTask,\n SCHEMA_ARTIFACT_NAME,\n SCHEMA_TASK_NAME,\n getSchemaArtifactDef,\n getSchemaArtifactPath,\n} from './schema.task';\nexport type { SchemaEnv } from './schema-env';\nexport type { SchemaMain } from './schema.main.runtime';\nexport default SchemaAspect;\nexport { SchemaAspect };\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,SAAAA,QAAA;EAAA,MAAAC,IAAA,GAAAC,OAAA;EAAAF,OAAA,YAAAA,CAAA;IAAA,OAAAC,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AAKA,SAAAE,SAAA;EAAA,MAAAF,IAAA,GAAAC,OAAA;EAAAC,QAAA,YAAAA,CAAA;IAAA,OAAAF,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AAMuB,IAAAG,QAAA,GAAAC,OAAA,CAAAC,OAAA,GAGRC,sBAAY","ignoreList":[]}
|
|
1
|
+
{"version":3,"names":["_schema","data","require","_schema2","_default","exports","default","SchemaAspect"],"sources":["index.ts"],"sourcesContent":["import { SchemaAspect } from './schema.aspect';\n\nexport type { Parser } from './parser';\nexport type { SchemaExtractor } from './schema-extractor';\nexport type { SchemaExtractorOptions } from './schema-extractor';\nexport {\n SchemaTask,\n SCHEMA_ARTIFACT_NAME,\n SCHEMA_TASK_NAME,\n getSchemaArtifactDef,\n getSchemaArtifactPath,\n} from './schema.task';\nexport type { SchemaEnv } from './schema-env';\nexport type { SchemaMain, ImpactRuleSlot } from './schema.main.runtime';\nexport default SchemaAspect;\nexport { SchemaAspect };\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,SAAAA,QAAA;EAAA,MAAAC,IAAA,GAAAC,OAAA;EAAAF,OAAA,YAAAA,CAAA;IAAA,OAAAC,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AAKA,SAAAE,SAAA;EAAA,MAAAF,IAAA,GAAAC,OAAA;EAAAC,QAAA,YAAAA,CAAA;IAAA,OAAAF,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AAMuB,IAAAG,QAAA,GAAAC,OAAA,CAAAC,OAAA,GAGRC,sBAAY","ignoreList":[]}
|
|
@@ -0,0 +1,139 @@
|
|
|
1
|
+
{
|
|
2
|
+
"hasChanges": true,
|
|
3
|
+
"impact": "NON_BREAKING",
|
|
4
|
+
"added": 1,
|
|
5
|
+
"removed": 0,
|
|
6
|
+
"modified": 7,
|
|
7
|
+
"breaking": 0,
|
|
8
|
+
"nonBreaking": 6,
|
|
9
|
+
"patch": 2,
|
|
10
|
+
"publicChanges": [
|
|
11
|
+
{
|
|
12
|
+
"status": "MODIFIED",
|
|
13
|
+
"visibility": "public",
|
|
14
|
+
"impact": "NON_BREAKING",
|
|
15
|
+
"exportName": "myFunc",
|
|
16
|
+
"schemaType": "Function",
|
|
17
|
+
"baseSignature": "function myFunc(a?: number, b?: number): number",
|
|
18
|
+
"compareSignature": "function myFunc(a?: number, b?: number, c?: number): number",
|
|
19
|
+
"details": [
|
|
20
|
+
{
|
|
21
|
+
"changeKind": "parameter-added",
|
|
22
|
+
"description": "parameter 'c: number' added (optional)",
|
|
23
|
+
"impact": "NON_BREAKING",
|
|
24
|
+
"to": "c?: number"
|
|
25
|
+
},
|
|
26
|
+
{
|
|
27
|
+
"changeKind": "documentation-changed",
|
|
28
|
+
"description": "documentation description and tags changed",
|
|
29
|
+
"impact": "PATCH",
|
|
30
|
+
"from": "General comment of the myFunc",
|
|
31
|
+
"to": "Updated comment for myFunc"
|
|
32
|
+
}
|
|
33
|
+
]
|
|
34
|
+
},
|
|
35
|
+
{
|
|
36
|
+
"status": "MODIFIED",
|
|
37
|
+
"visibility": "public",
|
|
38
|
+
"impact": "PATCH",
|
|
39
|
+
"exportName": "ButtonElementType",
|
|
40
|
+
"schemaType": "Type Alias",
|
|
41
|
+
"baseSignature": "type ButtonElementType = \"a\" | \"button\"",
|
|
42
|
+
"compareSignature": "type ButtonElementType = \"a\" | \"button\" | \"div\"",
|
|
43
|
+
"details": [
|
|
44
|
+
{
|
|
45
|
+
"changeKind": "type-definition-changed",
|
|
46
|
+
"description": "type definition changed",
|
|
47
|
+
"impact": "PATCH",
|
|
48
|
+
"from": "type ButtonElementType = \"a\" | \"button\"",
|
|
49
|
+
"to": "type ButtonElementType = \"a\" | \"button\" | \"div\""
|
|
50
|
+
}
|
|
51
|
+
]
|
|
52
|
+
},
|
|
53
|
+
{
|
|
54
|
+
"status": "MODIFIED",
|
|
55
|
+
"visibility": "public",
|
|
56
|
+
"impact": "PATCH",
|
|
57
|
+
"exportName": "ButtonProps",
|
|
58
|
+
"schemaType": "Type Alias",
|
|
59
|
+
"details": [
|
|
60
|
+
{
|
|
61
|
+
"changeKind": "type-definition-changed",
|
|
62
|
+
"description": "type definition changed",
|
|
63
|
+
"impact": "PATCH",
|
|
64
|
+
"from": "type ButtonProps = any",
|
|
65
|
+
"to": "type ButtonProps = any"
|
|
66
|
+
}
|
|
67
|
+
]
|
|
68
|
+
},
|
|
69
|
+
{
|
|
70
|
+
"status": "MODIFIED",
|
|
71
|
+
"visibility": "public",
|
|
72
|
+
"impact": "NON_BREAKING",
|
|
73
|
+
"exportName": "Bar",
|
|
74
|
+
"schemaType": "Class",
|
|
75
|
+
"details": [
|
|
76
|
+
{
|
|
77
|
+
"changeKind": "member-added",
|
|
78
|
+
"description": "Function 'bar' added: (method) Bar.bar(): void",
|
|
79
|
+
"impact": "NON_BREAKING",
|
|
80
|
+
"to": "(method) Bar.bar(): void"
|
|
81
|
+
}
|
|
82
|
+
]
|
|
83
|
+
},
|
|
84
|
+
{
|
|
85
|
+
"status": "MODIFIED",
|
|
86
|
+
"visibility": "public",
|
|
87
|
+
"impact": "NON_BREAKING",
|
|
88
|
+
"exportName": "ClassSomething",
|
|
89
|
+
"schemaType": "Class",
|
|
90
|
+
"details": [
|
|
91
|
+
{
|
|
92
|
+
"changeKind": "member-added",
|
|
93
|
+
"description": "Function 'newMethod' added: (method) ClassSomething.newMethod(): string",
|
|
94
|
+
"impact": "NON_BREAKING",
|
|
95
|
+
"to": "(method) ClassSomething.newMethod(): string"
|
|
96
|
+
}
|
|
97
|
+
]
|
|
98
|
+
},
|
|
99
|
+
{
|
|
100
|
+
"status": "MODIFIED",
|
|
101
|
+
"visibility": "public",
|
|
102
|
+
"impact": "NON_BREAKING",
|
|
103
|
+
"exportName": "Hello",
|
|
104
|
+
"schemaType": "Interface",
|
|
105
|
+
"details": [
|
|
106
|
+
{
|
|
107
|
+
"changeKind": "member-added",
|
|
108
|
+
"description": "Variable 'newProp' added (optional): (property) Hello.newProp?: number | undefined",
|
|
109
|
+
"impact": "NON_BREAKING",
|
|
110
|
+
"to": "(property) Hello.newProp?: number | undefined"
|
|
111
|
+
}
|
|
112
|
+
]
|
|
113
|
+
},
|
|
114
|
+
{
|
|
115
|
+
"status": "MODIFIED",
|
|
116
|
+
"visibility": "public",
|
|
117
|
+
"impact": "NON_BREAKING",
|
|
118
|
+
"exportName": "Food",
|
|
119
|
+
"schemaType": "Enum",
|
|
120
|
+
"details": [
|
|
121
|
+
{
|
|
122
|
+
"changeKind": "enum-member-added",
|
|
123
|
+
"description": "enum member 'Shawarma' added",
|
|
124
|
+
"impact": "NON_BREAKING",
|
|
125
|
+
"to": "(enum member) Food.Shawarma = 3"
|
|
126
|
+
}
|
|
127
|
+
]
|
|
128
|
+
},
|
|
129
|
+
{
|
|
130
|
+
"status": "ADDED",
|
|
131
|
+
"visibility": "public",
|
|
132
|
+
"impact": "NON_BREAKING",
|
|
133
|
+
"exportName": "newUtility",
|
|
134
|
+
"schemaType": "Function",
|
|
135
|
+
"compareSignature": "function newUtility(x: number): number"
|
|
136
|
+
}
|
|
137
|
+
],
|
|
138
|
+
"internalChanges": []
|
|
139
|
+
}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
export declare const BasicButton: () => import("react/jsx-runtime").JSX.Element;
|
|
2
|
+
/**
|
|
3
|
+
* example of passing a JSX Element as a parameter
|
|
4
|
+
*/
|
|
5
|
+
export declare function Footer({ children }: {
|
|
6
|
+
children?: import("react/jsx-runtime").JSX.Element | undefined;
|
|
7
|
+
}): import("react/jsx-runtime").JSX.Element;
|
|
8
|
+
export declare const ButtonWithCustomStyles: () => import("react/jsx-runtime").JSX.Element;
|
|
9
|
+
export declare const ButtonWithIcon: () => import("react/jsx-runtime").JSX.Element;
|
|
10
|
+
export declare const ButtonAsALink: () => import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.ButtonWithIcon = exports.ButtonWithCustomStyles = exports.ButtonAsALink = exports.BasicButton = void 0;
|
|
7
|
+
exports.Footer = Footer;
|
|
8
|
+
function _react() {
|
|
9
|
+
const data = _interopRequireDefault(require("react"));
|
|
10
|
+
_react = function () {
|
|
11
|
+
return data;
|
|
12
|
+
};
|
|
13
|
+
return data;
|
|
14
|
+
}
|
|
15
|
+
function _button() {
|
|
16
|
+
const data = require("./button");
|
|
17
|
+
_button = function () {
|
|
18
|
+
return data;
|
|
19
|
+
};
|
|
20
|
+
return data;
|
|
21
|
+
}
|
|
22
|
+
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
23
|
+
/* eslint-disable no-alert */
|
|
24
|
+
/* eslint-disable @typescript-eslint/no-unused-vars */
|
|
25
|
+
|
|
26
|
+
const BasicButton = () => {
|
|
27
|
+
return /*#__PURE__*/_react().default.createElement(_button().Button, null, "click me");
|
|
28
|
+
};
|
|
29
|
+
|
|
30
|
+
/**
|
|
31
|
+
* example of passing a JSX Element as a parameter
|
|
32
|
+
*/
|
|
33
|
+
// eslint-disable-next-line react/prop-types
|
|
34
|
+
exports.BasicButton = BasicButton;
|
|
35
|
+
function Footer({
|
|
36
|
+
children = /*#__PURE__*/_react().default.createElement(BasicButton, null)
|
|
37
|
+
}) {
|
|
38
|
+
return /*#__PURE__*/_react().default.createElement(_button().Button, null, children);
|
|
39
|
+
}
|
|
40
|
+
const ButtonWithCustomStyles = () => {
|
|
41
|
+
return /*#__PURE__*/_react().default.createElement(_button().Button, {
|
|
42
|
+
style: {
|
|
43
|
+
background: 'red'
|
|
44
|
+
}
|
|
45
|
+
}, "click me");
|
|
46
|
+
};
|
|
47
|
+
exports.ButtonWithCustomStyles = ButtonWithCustomStyles;
|
|
48
|
+
const ButtonWithIcon = () => {
|
|
49
|
+
return /*#__PURE__*/_react().default.createElement(_button().Button, null, "click me");
|
|
50
|
+
};
|
|
51
|
+
exports.ButtonWithIcon = ButtonWithIcon;
|
|
52
|
+
const ButtonAsALink = () => {
|
|
53
|
+
return /*#__PURE__*/_react().default.createElement(_button().Button, {
|
|
54
|
+
href: "https://bit.dev"
|
|
55
|
+
}, "Bit");
|
|
56
|
+
};
|
|
57
|
+
exports.ButtonAsALink = ButtonAsALink;
|
|
58
|
+
|
|
59
|
+
//# sourceMappingURL=button.composition.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["_react","data","_interopRequireDefault","require","_button","e","__esModule","default","BasicButton","createElement","Button","exports","Footer","children","ButtonWithCustomStyles","style","background","ButtonWithIcon","ButtonAsALink","href"],"sources":["button.composition.tsx"],"sourcesContent":["/* eslint-disable no-alert */\n/* eslint-disable @typescript-eslint/no-unused-vars */\nimport React from 'react';\nimport { Button } from './button';\n\nexport const BasicButton = () => {\n return <Button>click me</Button>;\n};\n\n/**\n * example of passing a JSX Element as a parameter\n */\n// eslint-disable-next-line react/prop-types\nexport function Footer({ children = <BasicButton /> }) {\n return <Button>{children}</Button>;\n}\n\nexport const ButtonWithCustomStyles = () => {\n return <Button style={{ background: 'red' }}>click me</Button>;\n};\n\nexport const ButtonWithIcon = () => {\n return (\n <Button>\n {/* <Image src=\"https://static.bit.dev/bit-logo.svg\" /> */}\n click me\n </Button>\n );\n};\n\nexport const ButtonAsALink = () => {\n return <Button href=\"https://bit.dev\">Bit</Button>;\n};\n"],"mappings":";;;;;;;AAEA,SAAAA,OAAA;EAAA,MAAAC,IAAA,GAAAC,sBAAA,CAAAC,OAAA;EAAAH,MAAA,YAAAA,CAAA;IAAA,OAAAC,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AACA,SAAAG,QAAA;EAAA,MAAAH,IAAA,GAAAE,OAAA;EAAAC,OAAA,YAAAA,CAAA;IAAA,OAAAH,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AAAkC,SAAAC,uBAAAG,CAAA,WAAAA,CAAA,IAAAA,CAAA,CAAAC,UAAA,GAAAD,CAAA,KAAAE,OAAA,EAAAF,CAAA;AAHlC;AACA;;AAIO,MAAMG,WAAW,GAAGA,CAAA,KAAM;EAC/B,oBAAOR,MAAA,GAAAO,OAAA,CAAAE,aAAA,CAACL,OAAA,GAAAM,MAAM,QAAC,UAAgB,CAAC;AAClC,CAAC;;AAED;AACA;AACA;AACA;AAAAC,OAAA,CAAAH,WAAA,GAAAA,WAAA;AACO,SAASI,MAAMA,CAAC;EAAEC,QAAQ,gBAAGb,MAAA,GAAAO,OAAA,CAAAE,aAAA,CAACD,WAAW,MAAE;AAAE,CAAC,EAAE;EACrD,oBAAOR,MAAA,GAAAO,OAAA,CAAAE,aAAA,CAACL,OAAA,GAAAM,MAAM,QAAEG,QAAiB,CAAC;AACpC;AAEO,MAAMC,sBAAsB,GAAGA,CAAA,KAAM;EAC1C,oBAAOd,MAAA,GAAAO,OAAA,CAAAE,aAAA,CAACL,OAAA,GAAAM,MAAM;IAACK,KAAK,EAAE;MAAEC,UAAU,EAAE;IAAM;EAAE,GAAC,UAAgB,CAAC;AAChE,CAAC;AAACL,OAAA,CAAAG,sBAAA,GAAAA,sBAAA;AAEK,MAAMG,cAAc,GAAGA,CAAA,KAAM;EAClC,oBACEjB,MAAA,GAAAO,OAAA,CAAAE,aAAA,CAACL,OAAA,GAAAM,MAAM,QACsD,UAErD,CAAC;AAEb,CAAC;AAACC,OAAA,CAAAM,cAAA,GAAAA,cAAA;AAEK,MAAMC,aAAa,GAAGA,CAAA,KAAM;EACjC,oBAAOlB,MAAA,GAAAO,OAAA,CAAAE,aAAA,CAACL,OAAA,GAAAM,MAAM;IAACS,IAAI,EAAC;EAAiB,GAAC,KAAW,CAAC;AACpD,CAAC;AAACR,OAAA,CAAAO,aAAA,GAAAA,aAAA","ignoreList":[]}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import React, { ReactNode } from 'react';
|
|
2
|
+
export type ButtonElementType = 'a' | 'button' | 'div';
|
|
3
|
+
export type ButtonProps = {
|
|
4
|
+
/**
|
|
5
|
+
* children of the Button.
|
|
6
|
+
*/
|
|
7
|
+
children: ReactNode;
|
|
8
|
+
/**
|
|
9
|
+
* link to target page. once href is used, Button is considered an A tag.
|
|
10
|
+
*/
|
|
11
|
+
href?: string;
|
|
12
|
+
/**
|
|
13
|
+
* class names to inject.
|
|
14
|
+
*/
|
|
15
|
+
className?: string;
|
|
16
|
+
/**
|
|
17
|
+
* whether the button is disabled.
|
|
18
|
+
*/
|
|
19
|
+
disabled?: boolean;
|
|
20
|
+
} & React.ButtonHTMLAttributes<HTMLButtonElement>;
|
|
21
|
+
export declare function Button(props: ButtonProps): import("react/jsx-runtime").JSX.Element;
|
|
22
|
+
export declare class Bar {
|
|
23
|
+
foo(): void;
|
|
24
|
+
bar(): void;
|
|
25
|
+
}
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.Bar = void 0;
|
|
7
|
+
exports.Button = Button;
|
|
8
|
+
function _react() {
|
|
9
|
+
const data = _interopRequireWildcard(require("react"));
|
|
10
|
+
_react = function () {
|
|
11
|
+
return data;
|
|
12
|
+
};
|
|
13
|
+
return data;
|
|
14
|
+
}
|
|
15
|
+
function _baseReactNavigation() {
|
|
16
|
+
const data = require("@teambit/base-react.navigation.link");
|
|
17
|
+
_baseReactNavigation = function () {
|
|
18
|
+
return data;
|
|
19
|
+
};
|
|
20
|
+
return data;
|
|
21
|
+
}
|
|
22
|
+
function _interopRequireWildcard(e, t) { if ("function" == typeof WeakMap) var r = new WeakMap(), n = new WeakMap(); return (_interopRequireWildcard = function (e, t) { if (!t && e && e.__esModule) return e; var o, i, f = { __proto__: null, default: e }; if (null === e || "object" != typeof e && "function" != typeof e) return f; if (o = t ? n : r) { if (o.has(e)) return o.get(e); o.set(e, f); } for (const t in e) "default" !== t && {}.hasOwnProperty.call(e, t) && ((i = (o = Object.defineProperty) && Object.getOwnPropertyDescriptor(e, t)) && (i.get || i.set) ? o(f, t, i) : f[t] = e[t]); return f; })(e, t); }
|
|
23
|
+
function _extends() { return _extends = Object.assign ? Object.assign.bind() : function (n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); } return n; }, _extends.apply(null, arguments); }
|
|
24
|
+
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
25
|
+
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
26
|
+
function _defineProperty(e, r, t) { return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : e[r] = t, e; }
|
|
27
|
+
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == typeof i ? i : i + ""; }
|
|
28
|
+
function _toPrimitive(t, r) { if ("object" != typeof t || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != typeof i) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); } // @ts-ignore
|
|
29
|
+
// import { useButton } from '@react-aria/button';
|
|
30
|
+
function Button(props) {
|
|
31
|
+
const ref = (0, _react().useRef)();
|
|
32
|
+
const allProps = _objectSpread({}, props);
|
|
33
|
+
const external = props.href?.startsWith('http:') || props.href?.startsWith('https:');
|
|
34
|
+
return /*#__PURE__*/_react().default.createElement(_react().default.Fragment, null, !props.href ?
|
|
35
|
+
/*#__PURE__*/
|
|
36
|
+
// @ts-ignore
|
|
37
|
+
_react().default.createElement("button", _extends({
|
|
38
|
+
className: props.className,
|
|
39
|
+
ref: ref
|
|
40
|
+
}, allProps), props.children) :
|
|
41
|
+
/*#__PURE__*/
|
|
42
|
+
// @ts-ignore
|
|
43
|
+
_react().default.createElement(_baseReactNavigation().Link, _extends({
|
|
44
|
+
external: external,
|
|
45
|
+
ref: ref,
|
|
46
|
+
className: props.className
|
|
47
|
+
}, allProps), props.children));
|
|
48
|
+
}
|
|
49
|
+
class Bar {
|
|
50
|
+
foo() {}
|
|
51
|
+
bar() {}
|
|
52
|
+
}
|
|
53
|
+
exports.Bar = Bar;
|
|
54
|
+
|
|
55
|
+
//# sourceMappingURL=button.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["_react","data","_interopRequireWildcard","require","_baseReactNavigation","e","t","WeakMap","r","n","__esModule","o","i","f","__proto__","default","has","get","set","hasOwnProperty","call","Object","defineProperty","getOwnPropertyDescriptor","_extends","assign","bind","arguments","length","apply","ownKeys","keys","getOwnPropertySymbols","filter","enumerable","push","_objectSpread","forEach","_defineProperty","getOwnPropertyDescriptors","defineProperties","_toPropertyKey","value","configurable","writable","_toPrimitive","Symbol","toPrimitive","TypeError","String","Number","Button","props","ref","useRef","allProps","external","href","startsWith","createElement","Fragment","className","children","Link","Bar","foo","bar","exports"],"sources":["button.tsx"],"sourcesContent":["import React, { ReactNode, useRef } from 'react';\n// @ts-ignore\n// import { useButton } from '@react-aria/button';\nimport { Link } from '@teambit/base-react.navigation.link';\n\nexport type ButtonElementType = 'a' | 'button' | 'div';\n\nexport type ButtonProps = {\n /**\n * children of the Button.\n */\n children: ReactNode;\n\n /**\n * link to target page. once href is used, Button is considered an A tag.\n */\n href?: string;\n\n /**\n * class names to inject.\n */\n className?: string;\n\n /**\n * whether the button is disabled.\n */\n disabled?: boolean;\n} & React.ButtonHTMLAttributes<HTMLButtonElement>;\n\nexport function Button(props: ButtonProps) {\n const ref = useRef();\n\n const allProps = {\n ...props,\n };\n const external = props.href?.startsWith('http:') || props.href?.startsWith('https:');\n\n return (\n <>\n {!props.href ? (\n // @ts-ignore\n <button className={props.className} ref={ref} {...allProps}>\n {props.children}\n </button>\n ) : (\n // @ts-ignore\n <Link external={external} ref={ref} className={props.className} {...allProps}>\n {props.children}\n </Link>\n )}\n </>\n );\n}\n\nexport class Bar {\n foo() {}\n bar() {}\n}\n"],"mappings":";;;;;;;AAAA,SAAAA,OAAA;EAAA,MAAAC,IAAA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AAA3D,MAAA,GAAAe,OAAA,CAAA6C,QAAA,QACG,CAACR,KAAK,CAACK,IAAI;EAAA;EACV;EACAzD,MAAA,GAAAe,OAAA,CAAA4C,aAAA,WAAAnC,QAAA;IAAQqC,SAAS,EAAET,KAAK,CAACS,SAAU;IAACR,GAAG,EAAEA;EAAI,GAAKE,QAAQ,GACvDH,KAAK,CAACU,QACD,CAAC;EAAA;EAET;EACA9D,MAAA,GAAAe,OAAA,CAAA4C,aAAA,CAACvD,oBAAA,GAAA2D,IAAI,EAAAvC,QAAA;IAACgC,QAAQ,EAAEA,QAAS;IAACH,GAAG,EAAEA,GAAI;IAACQ,SAAS,EAAET,KAAK,CAACS;EAAU,GAAKN,QAAQ,GACzEH,KAAK,CAACU,QACH,CAER,CAAC;AAEP;AAEO,MAAME,GAAG,CAAC;EACfC,GAAGA,CAAA,EAAG,CAAC;EACPC,GAAGA,CAAA,EAAG,CAAC;AACT;AAACC,OAAA,CAAAH,GAAA,GAAAA,GAAA","ignoreList":[]}
|
|
@@ -0,0 +1,127 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Updated comment for myFunc
|
|
3
|
+
* @param a { number } this is A
|
|
4
|
+
* @param b this is B
|
|
5
|
+
* @param c this is C
|
|
6
|
+
* @returns { number } results of adding a, b and c
|
|
7
|
+
*/
|
|
8
|
+
export declare function myFunc(a?: number, b?: number, c?: number): number;
|
|
9
|
+
export * from './button';
|
|
10
|
+
export declare function Hi(): void;
|
|
11
|
+
export declare const a = 4, b: 5;
|
|
12
|
+
export * as Compositions from './button.composition';
|
|
13
|
+
export declare const HiThere = "HiThere";
|
|
14
|
+
export declare const Function: () => void;
|
|
15
|
+
export declare const Array: string[];
|
|
16
|
+
declare class Foo {
|
|
17
|
+
}
|
|
18
|
+
declare class ClassSomething {
|
|
19
|
+
readonly da: 'dsa';
|
|
20
|
+
app: string;
|
|
21
|
+
constructor(da: 'dsa');
|
|
22
|
+
a(): Foo;
|
|
23
|
+
get getter(): string;
|
|
24
|
+
set setter(a: boolean);
|
|
25
|
+
newMethod(): string;
|
|
26
|
+
}
|
|
27
|
+
export { ClassSomething };
|
|
28
|
+
export type IndexSig = {
|
|
29
|
+
[key: string]: boolean;
|
|
30
|
+
};
|
|
31
|
+
export interface Hello {
|
|
32
|
+
propertySig: () => void;
|
|
33
|
+
methodSig(): string;
|
|
34
|
+
newProp?: number;
|
|
35
|
+
}
|
|
36
|
+
declare const obj: {
|
|
37
|
+
a: number;
|
|
38
|
+
b: number;
|
|
39
|
+
};
|
|
40
|
+
export declare const a1: typeof obj;
|
|
41
|
+
export type TypeOperator = keyof typeof obj;
|
|
42
|
+
declare class Bar {
|
|
43
|
+
foo(): void;
|
|
44
|
+
}
|
|
45
|
+
export declare const getBar: (bar: Bar) => Bar;
|
|
46
|
+
export declare const tuple: ([a, b, c]: [string, Function, Record<string, any>]) => void;
|
|
47
|
+
export declare enum Food {
|
|
48
|
+
Falafel = 0,
|
|
49
|
+
Hummus = 1,
|
|
50
|
+
Tahini = 2,
|
|
51
|
+
Shawarma = 3
|
|
52
|
+
}
|
|
53
|
+
export declare function getPromise(): Promise<string>;
|
|
54
|
+
declare class T1 {
|
|
55
|
+
}
|
|
56
|
+
declare class T2 {
|
|
57
|
+
}
|
|
58
|
+
declare class T3<T, K> {
|
|
59
|
+
}
|
|
60
|
+
export type TypeRefWithArgs = T3<T1, T2>;
|
|
61
|
+
export type ParenthesizedType = (T1 | T2)[];
|
|
62
|
+
export declare function typePredicateFn(str: any): str is string;
|
|
63
|
+
export declare function typePredicateNoTypeFn(condition: any, msg?: string): asserts condition;
|
|
64
|
+
export declare function objectBindingElements({ prop }: {
|
|
65
|
+
prop?: number | undefined;
|
|
66
|
+
}): Promise<number>;
|
|
67
|
+
export declare function arrayBindingElements([prop]: [string]): Promise<string>;
|
|
68
|
+
interface config {
|
|
69
|
+
someField: {
|
|
70
|
+
a: string;
|
|
71
|
+
b: boolean;
|
|
72
|
+
};
|
|
73
|
+
}
|
|
74
|
+
export type IndexedAccessType = config['someField'];
|
|
75
|
+
declare const computedName = "str";
|
|
76
|
+
export interface ComputedNameWithType {
|
|
77
|
+
[computedName]: boolean;
|
|
78
|
+
}
|
|
79
|
+
export interface ComputedNameNoType {
|
|
80
|
+
[computedName]: any;
|
|
81
|
+
}
|
|
82
|
+
type World1 = 'world1-a' | 'world1-b';
|
|
83
|
+
type World2 = 'world2';
|
|
84
|
+
export type templateLiteralType = `hello ${World1} hi ${World2}`;
|
|
85
|
+
export interface CallSignatureWithTypeParams {
|
|
86
|
+
<T>(a: string): T;
|
|
87
|
+
}
|
|
88
|
+
/**
|
|
89
|
+
* Conditional Generic Type
|
|
90
|
+
*/
|
|
91
|
+
export type If<T, U, Y, N> = T extends U ? Y : N;
|
|
92
|
+
export declare function genericFunction<T>(a: T): <T_1>(a: T_1) => void;
|
|
93
|
+
export declare const gfnc2: <T>(a: T) => void;
|
|
94
|
+
export declare function LogMethod(message: string): (target: any, propertyKey: string, descriptor: PropertyDescriptor) => void;
|
|
95
|
+
export declare function CustomClassDecorator(config: {
|
|
96
|
+
name: string;
|
|
97
|
+
description: string;
|
|
98
|
+
fn?: () => string;
|
|
99
|
+
class?: ClassSomething;
|
|
100
|
+
arr?: [
|
|
101
|
+
string,
|
|
102
|
+
number,
|
|
103
|
+
boolean,
|
|
104
|
+
boolean,
|
|
105
|
+
number | undefined,
|
|
106
|
+
(a: string) => void,
|
|
107
|
+
{
|
|
108
|
+
a: string;
|
|
109
|
+
b: number;
|
|
110
|
+
},
|
|
111
|
+
ClassSomething
|
|
112
|
+
];
|
|
113
|
+
}): (target: any) => void;
|
|
114
|
+
export declare class ExampleDecoratorOne {
|
|
115
|
+
exampleMethod(): void;
|
|
116
|
+
}
|
|
117
|
+
export declare function ValidateArgs(config: {
|
|
118
|
+
type: string;
|
|
119
|
+
required: boolean;
|
|
120
|
+
}): (target: any, propertyKey: string, descriptor: PropertyDescriptor) => void;
|
|
121
|
+
export declare class ExampleDecoratorTwo {
|
|
122
|
+
exampleMethod(input: string): void;
|
|
123
|
+
}
|
|
124
|
+
/**
|
|
125
|
+
* A new utility function added in v2
|
|
126
|
+
*/
|
|
127
|
+
export declare function newUtility(x: number): number;
|