@teambit/internalize 0.0.0-4941bbafb71a74ae697ddcec007ee776cf6a8626
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/esm.mjs +6 -0
- package/dist/index.d.ts +2 -0
- package/dist/index.js +26 -0
- package/dist/index.js.map +1 -0
- package/dist/internalize-cmd.d.ts +24 -0
- package/dist/internalize-cmd.js +88 -0
- package/dist/internalize-cmd.js.map +1 -0
- package/dist/internalize.aspect.d.ts +3 -0
- package/dist/internalize.aspect.js +21 -0
- package/dist/internalize.aspect.js.map +1 -0
- package/dist/internalize.fragment.d.ts +16 -0
- package/dist/internalize.fragment.js +34 -0
- package/dist/internalize.fragment.js.map +1 -0
- package/dist/internalize.graphql.d.ts +3 -0
- package/dist/internalize.graphql.js +35 -0
- package/dist/internalize.graphql.js.map +1 -0
- package/dist/internalize.main.runtime.d.ts +53 -0
- package/dist/internalize.main.runtime.js +161 -0
- package/dist/internalize.main.runtime.js.map +1 -0
- package/dist/preview-1779896326409.js +7 -0
- package/esm.mjs +6 -0
- package/package.json +59 -0
- package/types/asset.d.ts +41 -0
- package/types/style.d.ts +42 -0
package/dist/esm.mjs
ADDED
package/dist/index.d.ts
ADDED
package/dist/index.js
ADDED
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
Object.defineProperty(exports, "InternalizeAspect", {
|
|
7
|
+
enumerable: true,
|
|
8
|
+
get: function () {
|
|
9
|
+
return _internalize().InternalizeAspect;
|
|
10
|
+
}
|
|
11
|
+
});
|
|
12
|
+
Object.defineProperty(exports, "default", {
|
|
13
|
+
enumerable: true,
|
|
14
|
+
get: function () {
|
|
15
|
+
return _internalize().InternalizeAspect;
|
|
16
|
+
}
|
|
17
|
+
});
|
|
18
|
+
function _internalize() {
|
|
19
|
+
const data = require("./internalize.aspect");
|
|
20
|
+
_internalize = function () {
|
|
21
|
+
return data;
|
|
22
|
+
};
|
|
23
|
+
return data;
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["_internalize","data","require"],"sources":["index.ts"],"sourcesContent":["export type { InternalizeMain, InternalInfo, InternalizeMetadata } from './internalize.main.runtime';\nexport { InternalizeAspect, InternalizeAspect as default } from './internalize.aspect';\n"],"mappings":";;;;;;;;;;;;;;;;;AACA,SAAAA,aAAA;EAAA,MAAAC,IAAA,GAAAC,OAAA;EAAAF,YAAA,YAAAA,CAAA;IAAA,OAAAC,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA","ignoreList":[]}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import type { Command, CommandOptions } from '@teambit/cli';
|
|
2
|
+
import type { InternalizeMain } from './internalize.main.runtime';
|
|
3
|
+
export type InternalizeFlags = {
|
|
4
|
+
revert?: boolean;
|
|
5
|
+
list?: boolean;
|
|
6
|
+
};
|
|
7
|
+
export declare class InternalizeCmd implements Command {
|
|
8
|
+
private internalize;
|
|
9
|
+
name: string;
|
|
10
|
+
arguments: {
|
|
11
|
+
name: string;
|
|
12
|
+
description: string;
|
|
13
|
+
}[];
|
|
14
|
+
description: string;
|
|
15
|
+
extendedDescription: string;
|
|
16
|
+
group: string;
|
|
17
|
+
skipWorkspace: boolean;
|
|
18
|
+
options: CommandOptions;
|
|
19
|
+
loader: boolean;
|
|
20
|
+
remoteOp: boolean;
|
|
21
|
+
constructor(internalize: InternalizeMain);
|
|
22
|
+
report([pattern]: [string], { revert, list }: InternalizeFlags): Promise<string>;
|
|
23
|
+
json([pattern]: [string], { revert, list }: InternalizeFlags): Promise<string[]>;
|
|
24
|
+
}
|
|
@@ -0,0 +1,88 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.InternalizeCmd = void 0;
|
|
7
|
+
function _cli() {
|
|
8
|
+
const data = require("@teambit/cli");
|
|
9
|
+
_cli = function () {
|
|
10
|
+
return data;
|
|
11
|
+
};
|
|
12
|
+
return data;
|
|
13
|
+
}
|
|
14
|
+
function _bitError() {
|
|
15
|
+
const data = require("@teambit/bit-error");
|
|
16
|
+
_bitError = function () {
|
|
17
|
+
return data;
|
|
18
|
+
};
|
|
19
|
+
return data;
|
|
20
|
+
}
|
|
21
|
+
function _legacy() {
|
|
22
|
+
const data = require("@teambit/legacy.constants");
|
|
23
|
+
_legacy = function () {
|
|
24
|
+
return data;
|
|
25
|
+
};
|
|
26
|
+
return data;
|
|
27
|
+
}
|
|
28
|
+
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; }
|
|
29
|
+
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == typeof i ? i : i + ""; }
|
|
30
|
+
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); }
|
|
31
|
+
class InternalizeCmd {
|
|
32
|
+
constructor(internalize) {
|
|
33
|
+
this.internalize = internalize;
|
|
34
|
+
_defineProperty(this, "name", 'internalize [component-pattern]');
|
|
35
|
+
_defineProperty(this, "arguments", [{
|
|
36
|
+
name: 'component-pattern',
|
|
37
|
+
description: _legacy().COMPONENT_PATTERN_HELP
|
|
38
|
+
}]);
|
|
39
|
+
_defineProperty(this, "description", 'mark components as internal to hide them by default in the UI');
|
|
40
|
+
_defineProperty(this, "extendedDescription", `marks components as internal locally, then after snap/tag and export they become internal in the remote scope.
|
|
41
|
+
unlike "bit local-only", internal components are still versioned and exported - they are only hidden by default in the UI (workspace, scope and Bit Cloud).
|
|
42
|
+
use --revert to remove the internal mark, or --list to show the components currently marked as internal.`);
|
|
43
|
+
_defineProperty(this, "group", 'collaborate');
|
|
44
|
+
_defineProperty(this, "skipWorkspace", true);
|
|
45
|
+
_defineProperty(this, "options", [['r', 'revert', 'remove the internal mark from the matching components'], ['l', 'list', 'list the components currently marked as internal'], ['j', 'json', 'return the list of internal components in json format (use with --list)']]);
|
|
46
|
+
_defineProperty(this, "loader", true);
|
|
47
|
+
_defineProperty(this, "remoteOp", true);
|
|
48
|
+
}
|
|
49
|
+
async report([pattern], {
|
|
50
|
+
revert,
|
|
51
|
+
list
|
|
52
|
+
}) {
|
|
53
|
+
if (list) {
|
|
54
|
+
const ids = await this.internalize.listInternal();
|
|
55
|
+
if (!ids.length) return (0, _cli().formatHint)('no internal components found in the workspace');
|
|
56
|
+
const items = ids.map(id => (0, _cli().formatItem)(id.toString()));
|
|
57
|
+
return (0, _cli().formatSection)('internal components', '', items);
|
|
58
|
+
}
|
|
59
|
+
if (!pattern) {
|
|
60
|
+
throw new (_bitError().BitError)('please specify a component-pattern, or use --list to show the internal components');
|
|
61
|
+
}
|
|
62
|
+
const changed = await this.internalize.setByPattern(pattern, revert);
|
|
63
|
+
if (!changed.length) {
|
|
64
|
+
return (0, _cli().formatHint)(revert ? `no matching components are currently internal. no changes have been made` : `the matching components are already internal. no changes have been made`);
|
|
65
|
+
}
|
|
66
|
+
const verb = revert ? 'uninternalized' : 'internalized';
|
|
67
|
+
const summary = (0, _cli().formatSuccessSummary)(`${changed.length} component(s) have been ${verb} successfully`);
|
|
68
|
+
const items = changed.map(id => (0, _cli().formatItem)(id.toString()));
|
|
69
|
+
return (0, _cli().joinSections)([summary, items.join('\n')]);
|
|
70
|
+
}
|
|
71
|
+
async json([pattern], {
|
|
72
|
+
revert,
|
|
73
|
+
list
|
|
74
|
+
}) {
|
|
75
|
+
if (list) {
|
|
76
|
+
const ids = await this.internalize.listInternal();
|
|
77
|
+
return ids.map(id => id.toString());
|
|
78
|
+
}
|
|
79
|
+
if (!pattern) {
|
|
80
|
+
throw new (_bitError().BitError)('please specify a component-pattern, or use --list to show the internal components');
|
|
81
|
+
}
|
|
82
|
+
const changed = await this.internalize.setByPattern(pattern, revert);
|
|
83
|
+
return changed.map(id => id.toString());
|
|
84
|
+
}
|
|
85
|
+
}
|
|
86
|
+
exports.InternalizeCmd = InternalizeCmd;
|
|
87
|
+
|
|
88
|
+
//# sourceMappingURL=internalize-cmd.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["_cli","data","require","_bitError","_legacy","_defineProperty","e","r","t","_toPropertyKey","Object","defineProperty","value","enumerable","configurable","writable","i","_toPrimitive","Symbol","toPrimitive","call","TypeError","String","Number","InternalizeCmd","constructor","internalize","name","description","COMPONENT_PATTERN_HELP","report","pattern","revert","list","ids","listInternal","length","formatHint","items","map","id","formatItem","toString","formatSection","BitError","changed","setByPattern","verb","summary","formatSuccessSummary","joinSections","join","json","exports"],"sources":["internalize-cmd.ts"],"sourcesContent":["import type { Command, CommandOptions } from '@teambit/cli';\nimport { formatItem, formatSection, formatSuccessSummary, formatHint, joinSections } from '@teambit/cli';\nimport { BitError } from '@teambit/bit-error';\nimport { COMPONENT_PATTERN_HELP } from '@teambit/legacy.constants';\nimport type { InternalizeMain } from './internalize.main.runtime';\n\nexport type InternalizeFlags = {\n revert?: boolean;\n list?: boolean;\n};\n\nexport class InternalizeCmd implements Command {\n name = 'internalize [component-pattern]';\n arguments = [{ name: 'component-pattern', description: COMPONENT_PATTERN_HELP }];\n description = 'mark components as internal to hide them by default in the UI';\n extendedDescription = `marks components as internal locally, then after snap/tag and export they become internal in the remote scope.\nunlike \"bit local-only\", internal components are still versioned and exported - they are only hidden by default in the UI (workspace, scope and Bit Cloud).\nuse --revert to remove the internal mark, or --list to show the components currently marked as internal.`;\n group = 'collaborate';\n skipWorkspace = true;\n options = [\n ['r', 'revert', 'remove the internal mark from the matching components'],\n ['l', 'list', 'list the components currently marked as internal'],\n ['j', 'json', 'return the list of internal components in json format (use with --list)'],\n ] as CommandOptions;\n loader = true;\n remoteOp = true;\n\n constructor(private internalize: InternalizeMain) {}\n\n async report([pattern]: [string], { revert, list }: InternalizeFlags): Promise<string> {\n if (list) {\n const ids = await this.internalize.listInternal();\n if (!ids.length) return formatHint('no internal components found in the workspace');\n const items = ids.map((id) => formatItem(id.toString()));\n return formatSection('internal components', '', items);\n }\n if (!pattern) {\n throw new BitError('please specify a component-pattern, or use --list to show the internal components');\n }\n const changed = await this.internalize.setByPattern(pattern, revert);\n if (!changed.length) {\n return formatHint(\n revert\n ? `no matching components are currently internal. no changes have been made`\n : `the matching components are already internal. no changes have been made`\n );\n }\n const verb = revert ? 'uninternalized' : 'internalized';\n const summary = formatSuccessSummary(`${changed.length} component(s) have been ${verb} successfully`);\n const items = changed.map((id) => formatItem(id.toString()));\n return joinSections([summary, items.join('\\n')]);\n }\n\n async json([pattern]: [string], { revert, list }: InternalizeFlags) {\n if (list) {\n const ids = await this.internalize.listInternal();\n return ids.map((id) => id.toString());\n }\n if (!pattern) {\n throw new BitError('please specify a component-pattern, or use --list to show the internal components');\n }\n const changed = await this.internalize.setByPattern(pattern, revert);\n return changed.map((id) => id.toString());\n }\n}\n"],"mappings":";;;;;;AACA,SAAAA,KAAA;EAAA,MAAAC,IAAA,GAAAC,OAAA;EAAAF,IAAA,YAAAA,CAAA;IAAA,OAAAC,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AACA,SAAAE,UAAA;EAAA,MAAAF,IAAA,GAAAC,OAAA;EAAAC,SAAA,YAAAA,CAAA;IAAA,OAAAF,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AACA,SAAAG,QAAA;EAAA,MAAAH,IAAA,GAAAC,OAAA;EAAAE,OAAA,YAAAA,CAAA;IAAA,OAAAH,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AAAmE,SAAAI,gBAAAC,CAAA,EAAAC,CAA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AW,EAAE;IAAEC,MAAM;IAAEC;EAAuB,CAAC,EAAE;IAClE,IAAIA,IAAI,EAAE;MACR,MAAMC,GAAG,GAAG,MAAM,IAAI,CAACR,WAAW,CAACS,YAAY,CAAC,CAAC;MACjD,OAAOD,GAAG,CAACK,GAAG,CAAEC,EAAE,IAAKA,EAAE,CAACE,QAAQ,CAAC,CAAC,CAAC;IACvC;IACA,IAAI,CAACX,OAAO,EAAE;MACZ,MAAM,KAAIa,oBAAQ,EAAC,mFAAmF,CAAC;IACzG;IACA,MAAMC,OAAO,GAAG,MAAM,IAAI,CAACnB,WAAW,CAACoB,YAAY,CAACf,OAAO,EAAEC,MAAM,CAAC;IACpE,OAAOa,OAAO,CAACN,GAAG,CAAEC,EAAE,IAAKA,EAAE,CAACE,QAAQ,CAAC,CAAC,CAAC;EAC3C;AACF;AAACW,OAAA,CAAA7B,cAAA,GAAAA,cAAA","ignoreList":[]}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.default = exports.InternalizeAspect = void 0;
|
|
7
|
+
function _harmony() {
|
|
8
|
+
const data = require("@teambit/harmony");
|
|
9
|
+
_harmony = function () {
|
|
10
|
+
return data;
|
|
11
|
+
};
|
|
12
|
+
return data;
|
|
13
|
+
}
|
|
14
|
+
const InternalizeAspect = exports.InternalizeAspect = _harmony().Aspect.create({
|
|
15
|
+
id: 'teambit.component/internalize',
|
|
16
|
+
dependencies: [],
|
|
17
|
+
defaultConfig: {}
|
|
18
|
+
});
|
|
19
|
+
var _default = exports.default = InternalizeAspect;
|
|
20
|
+
|
|
21
|
+
//# sourceMappingURL=internalize.aspect.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["_harmony","data","require","InternalizeAspect","exports","Aspect","create","id","dependencies","defaultConfig","_default","default"],"sources":["internalize.aspect.ts"],"sourcesContent":["import { Aspect } from '@teambit/harmony';\n\nexport const InternalizeAspect = Aspect.create({\n id: 'teambit.component/internalize',\n dependencies: [],\n defaultConfig: {},\n});\n\nexport default InternalizeAspect;\n"],"mappings":";;;;;;AAAA,SAAAA,SAAA;EAAA,MAAAC,IAAA,GAAAC,OAAA;EAAAF,QAAA,YAAAA,CAAA;IAAA,OAAAC,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AAEO,MAAME,iBAAiB,GAAAC,OAAA,CAAAD,iBAAA,GAAGE,iBAAM,CAACC,MAAM,CAAC;EAC7CC,EAAE,EAAE,+BAA+B;EACnCC,YAAY,EAAE,EAAE;EAChBC,aAAa,EAAE,CAAC;AAClB,CAAC,CAAC;AAAC,IAAAC,QAAA,GAAAN,OAAA,CAAAO,OAAA,GAEYR,iBAAiB","ignoreList":[]}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import type { Component, ShowFragment } from '@teambit/component';
|
|
2
|
+
import type { InternalizeMain } from './internalize.main.runtime';
|
|
3
|
+
export declare class InternalizeFragment implements ShowFragment {
|
|
4
|
+
private internalize;
|
|
5
|
+
constructor(internalize: InternalizeMain);
|
|
6
|
+
title: string;
|
|
7
|
+
renderRow(component: Component): Promise<{
|
|
8
|
+
title: string;
|
|
9
|
+
content: string;
|
|
10
|
+
}>;
|
|
11
|
+
json(component: Component): Promise<{
|
|
12
|
+
title: string;
|
|
13
|
+
json: import("./internalize.main.runtime").InternalInfo;
|
|
14
|
+
}>;
|
|
15
|
+
weight: number;
|
|
16
|
+
}
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.InternalizeFragment = void 0;
|
|
7
|
+
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; }
|
|
8
|
+
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == typeof i ? i : i + ""; }
|
|
9
|
+
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); }
|
|
10
|
+
class InternalizeFragment {
|
|
11
|
+
constructor(internalize) {
|
|
12
|
+
this.internalize = internalize;
|
|
13
|
+
_defineProperty(this, "title", 'internal');
|
|
14
|
+
_defineProperty(this, "weight", 3);
|
|
15
|
+
}
|
|
16
|
+
async renderRow(component) {
|
|
17
|
+
const {
|
|
18
|
+
isInternal
|
|
19
|
+
} = await this.internalize.getInternalInfo(component);
|
|
20
|
+
return {
|
|
21
|
+
title: this.title,
|
|
22
|
+
content: isInternal.toString()
|
|
23
|
+
};
|
|
24
|
+
}
|
|
25
|
+
async json(component) {
|
|
26
|
+
return {
|
|
27
|
+
title: this.title,
|
|
28
|
+
json: await this.internalize.getInternalInfo(component)
|
|
29
|
+
};
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
exports.InternalizeFragment = InternalizeFragment;
|
|
33
|
+
|
|
34
|
+
//# sourceMappingURL=internalize.fragment.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["InternalizeFragment","constructor","internalize","_defineProperty","renderRow","component","isInternal","getInternalInfo","title","content","toString","json","exports"],"sources":["internalize.fragment.ts"],"sourcesContent":["import type { Component, ShowFragment } from '@teambit/component';\nimport type { InternalizeMain } from './internalize.main.runtime';\n\nexport class InternalizeFragment implements ShowFragment {\n constructor(private internalize: InternalizeMain) {}\n\n title = 'internal';\n\n async renderRow(component: Component) {\n const { isInternal } = await this.internalize.getInternalInfo(component);\n return {\n title: this.title,\n content: isInternal.toString(),\n };\n }\n\n async json(component: Component) {\n return {\n title: this.title,\n json: await this.internalize.getInternalInfo(component),\n };\n }\n\n weight = 3;\n}\n"],"mappings":";;;;;;;;;AAGO,MAAMA,mBAAmB,CAAyB;EACvDC,WAAWA,CAASC,WAA4B,EAAE;IAAA,KAA9BA,WAA4B,GAA5BA,WAA4B;IAAAC,eAAA,gBAExC,UAAU;IAAAA,eAAA,iBAiBT,CAAC;EAnByC;EAInD,MAAMC,SAASA,CAACC,SAAoB,EAAE;IACpC,MAAM;MAAEC;IAAW,CAAC,GAAG,MAAM,IAAI,CAACJ,WAAW,CAACK,eAAe,CAACF,SAAS,CAAC;IACxE,OAAO;MACLG,KAAK,EAAE,IAAI,CAACA,KAAK;MACjBC,OAAO,EAAEH,UAAU,CAACI,QAAQ,CAAC;IAC/B,CAAC;EACH;EAEA,MAAMC,IAAIA,CAACN,SAAoB,EAAE;IAC/B,OAAO;MACLG,KAAK,EAAE,IAAI,CAACA,KAAK;MACjBG,IAAI,EAAE,MAAM,IAAI,CAACT,WAAW,CAACK,eAAe,CAACF,SAAS;IACxD,CAAC;EACH;AAGF;AAACO,OAAA,CAAAZ,mBAAA,GAAAA,mBAAA","ignoreList":[]}
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.internalizeSchema = internalizeSchema;
|
|
7
|
+
function _graphqlTag() {
|
|
8
|
+
const data = require("graphql-tag");
|
|
9
|
+
_graphqlTag = function () {
|
|
10
|
+
return data;
|
|
11
|
+
};
|
|
12
|
+
return data;
|
|
13
|
+
}
|
|
14
|
+
function internalizeSchema(internalize) {
|
|
15
|
+
return {
|
|
16
|
+
typeDefs: (0, _graphqlTag().gql)`
|
|
17
|
+
extend type Component {
|
|
18
|
+
internal: InternalInfo
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
type InternalInfo {
|
|
22
|
+
isInternal: Boolean
|
|
23
|
+
}
|
|
24
|
+
`,
|
|
25
|
+
resolvers: {
|
|
26
|
+
Component: {
|
|
27
|
+
internal: component => {
|
|
28
|
+
return internalize.getInternalInfo(component);
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
};
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
//# sourceMappingURL=internalize.graphql.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["_graphqlTag","data","require","internalizeSchema","internalize","typeDefs","gql","resolvers","Component","internal","component","getInternalInfo"],"sources":["internalize.graphql.ts"],"sourcesContent":["import type { Component } from '@teambit/component';\nimport type { Schema } from '@teambit/graphql';\nimport { gql } from 'graphql-tag';\n\nimport type { InternalizeMain } from './internalize.main.runtime';\n\nexport function internalizeSchema(internalize: InternalizeMain): Schema {\n return {\n typeDefs: gql`\n extend type Component {\n internal: InternalInfo\n }\n\n type InternalInfo {\n isInternal: Boolean\n }\n `,\n resolvers: {\n Component: {\n internal: (component: Component) => {\n return internalize.getInternalInfo(component);\n },\n },\n },\n };\n}\n"],"mappings":";;;;;;AAEA,SAAAA,YAAA;EAAA,MAAAC,IAAA,GAAAC,OAAA;EAAAF,WAAA,YAAAA,CAAA;IAAA,OAAAC,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AAIO,SAASE,iBAAiBA,CAACC,WAA4B,EAAU;EACtE,OAAO;IACLC,QAAQ,EAAE,IAAAC,iBAAG;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;IACDC,SAAS,EAAE;MACTC,SAAS,EAAE;QACTC,QAAQ,EAAGC,SAAoB,IAAK;UAClC,OAAON,WAAW,CAACO,eAAe,CAACD,SAAS,CAAC;QAC/C;MACF;IACF;EACF,CAAC;AACH","ignoreList":[]}
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
import type { CLIMain } from '@teambit/cli';
|
|
2
|
+
import type { ComponentMain, Component } from '@teambit/component';
|
|
3
|
+
import type { ScopeMain } from '@teambit/scope';
|
|
4
|
+
import type { Workspace } from '@teambit/workspace';
|
|
5
|
+
import type { GraphqlMain } from '@teambit/graphql';
|
|
6
|
+
import type { ComponentID } from '@teambit/component-id';
|
|
7
|
+
export type InternalInfo = {
|
|
8
|
+
isInternal: boolean;
|
|
9
|
+
};
|
|
10
|
+
export type InternalizeMetadata = {
|
|
11
|
+
/**
|
|
12
|
+
* whether the head is marked as internal.
|
|
13
|
+
*/
|
|
14
|
+
internal?: boolean;
|
|
15
|
+
};
|
|
16
|
+
export declare class InternalizeMain {
|
|
17
|
+
private scope;
|
|
18
|
+
private workspace;
|
|
19
|
+
constructor(scope: ScopeMain, workspace: Workspace);
|
|
20
|
+
getInternalInfo(component: Component): Promise<InternalInfo>;
|
|
21
|
+
private getHeadComponent;
|
|
22
|
+
/**
|
|
23
|
+
* mark components as internal. after this change, the components will be modified.
|
|
24
|
+
* tag/snap and export them to have them internal on the remote.
|
|
25
|
+
* internal components are still versioned and exported, but hidden by default in the UI.
|
|
26
|
+
*
|
|
27
|
+
* @returns the component-ids that have been changed.
|
|
28
|
+
*/
|
|
29
|
+
internalize(componentIds: ComponentID[]): Promise<ComponentID[]>;
|
|
30
|
+
/**
|
|
31
|
+
* remove the internal mark from components.
|
|
32
|
+
* @returns the component-ids that have been changed.
|
|
33
|
+
*/
|
|
34
|
+
uninternalize(componentIds: ComponentID[]): Promise<ComponentID[]>;
|
|
35
|
+
/**
|
|
36
|
+
* mark/unmark components matching the given pattern as internal.
|
|
37
|
+
*/
|
|
38
|
+
setByPattern(pattern: string, revert?: boolean): Promise<ComponentID[]>;
|
|
39
|
+
/**
|
|
40
|
+
* list the workspace components that are currently marked as internal.
|
|
41
|
+
*/
|
|
42
|
+
listInternal(): Promise<ComponentID[]>;
|
|
43
|
+
private setInternalConfig;
|
|
44
|
+
static runtime: import("@teambit/harmony").RuntimeDefinition;
|
|
45
|
+
static dependencies: import("@teambit/harmony").Aspect[];
|
|
46
|
+
static provider([graphql, scope, componentAspect, workspace, cli]: [
|
|
47
|
+
GraphqlMain,
|
|
48
|
+
ScopeMain,
|
|
49
|
+
ComponentMain,
|
|
50
|
+
Workspace,
|
|
51
|
+
CLIMain
|
|
52
|
+
]): Promise<InternalizeMain>;
|
|
53
|
+
}
|
|
@@ -0,0 +1,161 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.InternalizeMain = void 0;
|
|
7
|
+
function _cli() {
|
|
8
|
+
const data = require("@teambit/cli");
|
|
9
|
+
_cli = function () {
|
|
10
|
+
return data;
|
|
11
|
+
};
|
|
12
|
+
return data;
|
|
13
|
+
}
|
|
14
|
+
function _component() {
|
|
15
|
+
const data = require("@teambit/component");
|
|
16
|
+
_component = function () {
|
|
17
|
+
return data;
|
|
18
|
+
};
|
|
19
|
+
return data;
|
|
20
|
+
}
|
|
21
|
+
function _scope() {
|
|
22
|
+
const data = require("@teambit/scope");
|
|
23
|
+
_scope = function () {
|
|
24
|
+
return data;
|
|
25
|
+
};
|
|
26
|
+
return data;
|
|
27
|
+
}
|
|
28
|
+
function _workspace() {
|
|
29
|
+
const data = require("@teambit/workspace");
|
|
30
|
+
_workspace = function () {
|
|
31
|
+
return data;
|
|
32
|
+
};
|
|
33
|
+
return data;
|
|
34
|
+
}
|
|
35
|
+
function _graphql() {
|
|
36
|
+
const data = require("@teambit/graphql");
|
|
37
|
+
_graphql = function () {
|
|
38
|
+
return data;
|
|
39
|
+
};
|
|
40
|
+
return data;
|
|
41
|
+
}
|
|
42
|
+
function _lodash() {
|
|
43
|
+
const data = require("lodash");
|
|
44
|
+
_lodash = function () {
|
|
45
|
+
return data;
|
|
46
|
+
};
|
|
47
|
+
return data;
|
|
48
|
+
}
|
|
49
|
+
function _internalize() {
|
|
50
|
+
const data = require("./internalize.aspect");
|
|
51
|
+
_internalize = function () {
|
|
52
|
+
return data;
|
|
53
|
+
};
|
|
54
|
+
return data;
|
|
55
|
+
}
|
|
56
|
+
function _internalize2() {
|
|
57
|
+
const data = require("./internalize.graphql");
|
|
58
|
+
_internalize2 = function () {
|
|
59
|
+
return data;
|
|
60
|
+
};
|
|
61
|
+
return data;
|
|
62
|
+
}
|
|
63
|
+
function _internalize3() {
|
|
64
|
+
const data = require("./internalize.fragment");
|
|
65
|
+
_internalize3 = function () {
|
|
66
|
+
return data;
|
|
67
|
+
};
|
|
68
|
+
return data;
|
|
69
|
+
}
|
|
70
|
+
function _internalizeCmd() {
|
|
71
|
+
const data = require("./internalize-cmd");
|
|
72
|
+
_internalizeCmd = function () {
|
|
73
|
+
return data;
|
|
74
|
+
};
|
|
75
|
+
return data;
|
|
76
|
+
}
|
|
77
|
+
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; }
|
|
78
|
+
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == typeof i ? i : i + ""; }
|
|
79
|
+
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); }
|
|
80
|
+
class InternalizeMain {
|
|
81
|
+
constructor(scope, workspace) {
|
|
82
|
+
this.scope = scope;
|
|
83
|
+
this.workspace = workspace;
|
|
84
|
+
}
|
|
85
|
+
async getInternalInfo(component) {
|
|
86
|
+
const headComponent = await this.getHeadComponent(component);
|
|
87
|
+
const data = headComponent.config.extensions.findExtension(_internalize().InternalizeAspect.id)?.config;
|
|
88
|
+
return {
|
|
89
|
+
isInternal: Boolean(data?.internal)
|
|
90
|
+
};
|
|
91
|
+
}
|
|
92
|
+
async getHeadComponent(component) {
|
|
93
|
+
if (component.id.version && component.head && component.id.version !== component.head?.hash && component.id.version !== component.headTag?.version.version) {
|
|
94
|
+
const headComp = this.workspace // if workspace exists, prefer using the workspace as it may be modified
|
|
95
|
+
? await this.workspace.get(component.id.changeVersion(undefined)) : await this.scope.get(component.id.changeVersion(component.head.hash));
|
|
96
|
+
if (!headComp) throw new Error(`unable to get the head of ${component.id.toString()}`);
|
|
97
|
+
return headComp;
|
|
98
|
+
}
|
|
99
|
+
return component;
|
|
100
|
+
}
|
|
101
|
+
|
|
102
|
+
/**
|
|
103
|
+
* mark components as internal. after this change, the components will be modified.
|
|
104
|
+
* tag/snap and export them to have them internal on the remote.
|
|
105
|
+
* internal components are still versioned and exported, but hidden by default in the UI.
|
|
106
|
+
*
|
|
107
|
+
* @returns the component-ids that have been changed.
|
|
108
|
+
*/
|
|
109
|
+
async internalize(componentIds) {
|
|
110
|
+
return this.setInternalConfig(componentIds, true);
|
|
111
|
+
}
|
|
112
|
+
|
|
113
|
+
/**
|
|
114
|
+
* remove the internal mark from components.
|
|
115
|
+
* @returns the component-ids that have been changed.
|
|
116
|
+
*/
|
|
117
|
+
async uninternalize(componentIds) {
|
|
118
|
+
return this.setInternalConfig(componentIds, false);
|
|
119
|
+
}
|
|
120
|
+
|
|
121
|
+
/**
|
|
122
|
+
* mark/unmark components matching the given pattern as internal.
|
|
123
|
+
*/
|
|
124
|
+
async setByPattern(pattern, revert = false) {
|
|
125
|
+
const componentIds = await this.workspace.idsByPattern(pattern);
|
|
126
|
+
return revert ? this.uninternalize(componentIds) : this.internalize(componentIds);
|
|
127
|
+
}
|
|
128
|
+
|
|
129
|
+
/**
|
|
130
|
+
* list the workspace components that are currently marked as internal.
|
|
131
|
+
*/
|
|
132
|
+
async listInternal() {
|
|
133
|
+
const ids = this.workspace.listIds();
|
|
134
|
+
const comps = await this.workspace.getMany(ids);
|
|
135
|
+
const results = await Promise.all(comps.map(async comp => (await this.getInternalInfo(comp)).isInternal ? comp.id : undefined));
|
|
136
|
+
return (0, _lodash().compact)(results);
|
|
137
|
+
}
|
|
138
|
+
async setInternalConfig(componentIds, internal) {
|
|
139
|
+
const changed = componentIds.filter(id => this.workspace.bitMap.addComponentConfig(id, _internalize().InternalizeAspect.id, {
|
|
140
|
+
internal
|
|
141
|
+
}));
|
|
142
|
+
if (changed.length) {
|
|
143
|
+
const action = internal ? 'internalize' : 'uninternalize';
|
|
144
|
+
await this.workspace.bitMap.write(`${action} ${changed.map(id => id.toString()).join(', ')}`);
|
|
145
|
+
}
|
|
146
|
+
return changed;
|
|
147
|
+
}
|
|
148
|
+
static async provider([graphql, scope, componentAspect, workspace, cli]) {
|
|
149
|
+
const internalize = new InternalizeMain(scope, workspace);
|
|
150
|
+
cli.register(new (_internalizeCmd().InternalizeCmd)(internalize));
|
|
151
|
+
componentAspect.registerShowFragments([new (_internalize3().InternalizeFragment)(internalize)]);
|
|
152
|
+
graphql.register(() => (0, _internalize2().internalizeSchema)(internalize));
|
|
153
|
+
return internalize;
|
|
154
|
+
}
|
|
155
|
+
}
|
|
156
|
+
exports.InternalizeMain = InternalizeMain;
|
|
157
|
+
_defineProperty(InternalizeMain, "runtime", _cli().MainRuntime);
|
|
158
|
+
_defineProperty(InternalizeMain, "dependencies", [_graphql().GraphqlAspect, _scope().ScopeAspect, _component().ComponentAspect, _workspace().WorkspaceAspect, _cli().CLIAspect]);
|
|
159
|
+
_internalize().InternalizeAspect.addRuntime(InternalizeMain);
|
|
160
|
+
|
|
161
|
+
//# sourceMappingURL=internalize.main.runtime.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["_cli","data","require","_component","_scope","_workspace","_graphql","_lodash","_internalize","_internalize2","_internalize3","_internalizeCmd","_defineProperty","e","r","t","_toPropertyKey","Object","defineProperty","value","enumerable","configurable","writable","i","_toPrimitive","Symbol","toPrimitive","call","TypeError","String","Number","InternalizeMain","constructor","scope","workspace","getInternalInfo","component","headComponent","getHeadComponent","config","extensions","findExtension","InternalizeAspect","id","isInternal","Boolean","internal","version","head","hash","headTag","headComp","get","changeVersion","undefined","Error","toString","internalize","componentIds","setInternalConfig","uninternalize","setByPattern","pattern","revert","idsByPattern","listInternal","ids","listIds","comps","getMany","results","Promise","all","map","comp","compact","changed","filter","bitMap","addComponentConfig","length","action","write","join","provider","graphql","componentAspect","cli","register","InternalizeCmd","registerShowFragments","InternalizeFragment","internalizeSchema","exports","MainRuntime","GraphqlAspect","ScopeAspect","ComponentAspect","WorkspaceAspect","CLIAspect","addRuntime"],"sources":["internalize.main.runtime.ts"],"sourcesContent":["import type { CLIMain } from '@teambit/cli';\nimport { CLIAspect, MainRuntime } from '@teambit/cli';\nimport type { ComponentMain, Component } from '@teambit/component';\nimport { ComponentAspect } from '@teambit/component';\nimport type { ScopeMain } from '@teambit/scope';\nimport { ScopeAspect } from '@teambit/scope';\nimport type { Workspace } from '@teambit/workspace';\nimport { WorkspaceAspect } from '@teambit/workspace';\nimport type { GraphqlMain } from '@teambit/graphql';\nimport { GraphqlAspect } from '@teambit/graphql';\nimport type { ComponentID } from '@teambit/component-id';\nimport { compact } from 'lodash';\nimport { InternalizeAspect } from './internalize.aspect';\nimport { internalizeSchema } from './internalize.graphql';\nimport { InternalizeFragment } from './internalize.fragment';\nimport { InternalizeCmd } from './internalize-cmd';\n\nexport type InternalInfo = {\n isInternal: boolean;\n};\n\nexport type InternalizeMetadata = {\n /**\n * whether the head is marked as internal.\n */\n internal?: boolean;\n};\n\nexport class InternalizeMain {\n constructor(\n private scope: ScopeMain,\n private workspace: Workspace\n ) {}\n\n async getInternalInfo(component: Component): Promise<InternalInfo> {\n const headComponent = await this.getHeadComponent(component);\n const data = headComponent.config.extensions.findExtension(InternalizeAspect.id)?.config as\n | InternalizeMetadata\n | undefined;\n return {\n isInternal: Boolean(data?.internal),\n };\n }\n\n private async getHeadComponent(component: Component): Promise<Component> {\n if (\n component.id.version &&\n component.head &&\n component.id.version !== component.head?.hash &&\n component.id.version !== component.headTag?.version.version\n ) {\n const headComp = this.workspace // if workspace exists, prefer using the workspace as it may be modified\n ? await this.workspace.get(component.id.changeVersion(undefined))\n : await this.scope.get(component.id.changeVersion(component.head.hash));\n if (!headComp) throw new Error(`unable to get the head of ${component.id.toString()}`);\n return headComp;\n }\n return component;\n }\n\n /**\n * mark components as internal. after this change, the components will be modified.\n * tag/snap and export them to have them internal on the remote.\n * internal components are still versioned and exported, but hidden by default in the UI.\n *\n * @returns the component-ids that have been changed.\n */\n async internalize(componentIds: ComponentID[]): Promise<ComponentID[]> {\n return this.setInternalConfig(componentIds, true);\n }\n\n /**\n * remove the internal mark from components.\n * @returns the component-ids that have been changed.\n */\n async uninternalize(componentIds: ComponentID[]): Promise<ComponentID[]> {\n return this.setInternalConfig(componentIds, false);\n }\n\n /**\n * mark/unmark components matching the given pattern as internal.\n */\n async setByPattern(pattern: string, revert = false): Promise<ComponentID[]> {\n const componentIds = await this.workspace.idsByPattern(pattern);\n return revert ? this.uninternalize(componentIds) : this.internalize(componentIds);\n }\n\n /**\n * list the workspace components that are currently marked as internal.\n */\n async listInternal(): Promise<ComponentID[]> {\n const ids = this.workspace.listIds();\n const comps = await this.workspace.getMany(ids);\n const results = await Promise.all(\n comps.map(async (comp) => ((await this.getInternalInfo(comp)).isInternal ? comp.id : undefined))\n );\n return compact(results);\n }\n\n private async setInternalConfig(componentIds: ComponentID[], internal: boolean): Promise<ComponentID[]> {\n const changed = componentIds.filter((id) =>\n this.workspace.bitMap.addComponentConfig(id, InternalizeAspect.id, { internal })\n );\n if (changed.length) {\n const action = internal ? 'internalize' : 'uninternalize';\n await this.workspace.bitMap.write(`${action} ${changed.map((id) => id.toString()).join(', ')}`);\n }\n return changed;\n }\n\n static runtime = MainRuntime;\n static dependencies = [GraphqlAspect, ScopeAspect, ComponentAspect, WorkspaceAspect, CLIAspect];\n static async provider([graphql, scope, componentAspect, workspace, cli]: [\n GraphqlMain,\n ScopeMain,\n ComponentMain,\n Workspace,\n CLIMain,\n ]) {\n const internalize = new InternalizeMain(scope, workspace);\n cli.register(new InternalizeCmd(internalize));\n componentAspect.registerShowFragments([new InternalizeFragment(internalize)]);\n graphql.register(() => internalizeSchema(internal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AAEpD,KAAK,EAAEqD,eAAe,EAAEpD,SAAS,EAAEqD,GAAG,CAMrE,EAAE;IACD,MAAM9B,WAAW,GAAG,IAAI1B,eAAe,CAACE,KAAK,EAAEC,SAAS,CAAC;IACzDqD,GAAG,CAACC,QAAQ,CAAC,KAAIC,gCAAc,EAAChC,WAAW,CAAC,CAAC;IAC7C6B,eAAe,CAACI,qBAAqB,CAAC,CAAC,KAAIC,mCAAmB,EAAClC,WAAW,CAAC,CAAC,CAAC;IAC7E4B,OAAO,CAACG,QAAQ,CAAC,MAAM,IAAAI,iCAAiB,EAACnC,WAAW,CAAC,CAAC;IAEtD,OAAOA,WAAW;EACpB;AACF;AAACoC,OAAA,CAAA9D,eAAA,GAAAA,eAAA;AAAAnB,eAAA,CAlGYmB,eAAe,aAkFT+D,kBAAW;AAAAlF,eAAA,CAlFjBmB,eAAe,kBAmFJ,CAACgE,wBAAa,EAAEC,oBAAW,EAAEC,4BAAe,EAAEC,4BAAe,EAAEC,gBAAS,CAAC;AAiBjGzD,gCAAiB,CAAC0D,UAAU,CAACrE,eAAe,CAAC","ignoreList":[]}
|
package/esm.mjs
ADDED
package/package.json
ADDED
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@teambit/internalize",
|
|
3
|
+
"version": "0.0.0-4941bbafb71a74ae697ddcec007ee776cf6a8626",
|
|
4
|
+
"main": "dist/index.js",
|
|
5
|
+
"componentId": {
|
|
6
|
+
"name": "internalize",
|
|
7
|
+
"version": "4941bbafb71a74ae697ddcec007ee776cf6a8626",
|
|
8
|
+
"scope": "teambit.component"
|
|
9
|
+
},
|
|
10
|
+
"dependencies": {
|
|
11
|
+
"graphql-tag": "2.12.1",
|
|
12
|
+
"lodash": "4.17.21",
|
|
13
|
+
"@teambit/bit-error": "0.0.404",
|
|
14
|
+
"@teambit/harmony": "0.4.7",
|
|
15
|
+
"@teambit/component-id": "1.2.4",
|
|
16
|
+
"@teambit/cli": "0.0.0-d2a3680c6e41d8ed6568460f704872b050ecfa10",
|
|
17
|
+
"@teambit/legacy.constants": "0.0.0-7064f2f4f3b64d581576d5ab2e63caf20f139bef",
|
|
18
|
+
"@teambit/component": "0.0.0-ebe26f5e5461cbe029cebc18e7089130cf1ff8ea",
|
|
19
|
+
"@teambit/graphql": "0.0.0-fa0ac1620508d3f8dafe323eb83d7851b41ea3ba",
|
|
20
|
+
"@teambit/scope": "0.0.0-6bbf48991bfbfe64a39d851d286aeb1a682c7c4c",
|
|
21
|
+
"@teambit/workspace": "0.0.0-be2786cf4f603fcdb9f846a4830dec7ff5c586a2"
|
|
22
|
+
},
|
|
23
|
+
"devDependencies": {
|
|
24
|
+
"@types/lodash": "4.14.165",
|
|
25
|
+
"@teambit/harmony.envs.core-aspect-env": "0.1.5"
|
|
26
|
+
},
|
|
27
|
+
"peerDependencies": {},
|
|
28
|
+
"license": "Apache-2.0",
|
|
29
|
+
"optionalDependencies": {},
|
|
30
|
+
"peerDependenciesMeta": {},
|
|
31
|
+
"exports": {
|
|
32
|
+
".": {
|
|
33
|
+
"node": {
|
|
34
|
+
"require": "./dist/index.js",
|
|
35
|
+
"import": "./dist/esm.mjs"
|
|
36
|
+
},
|
|
37
|
+
"default": "./dist/index.js"
|
|
38
|
+
},
|
|
39
|
+
"./dist/*": "./dist/*",
|
|
40
|
+
"./artifacts/*": "./artifacts/*",
|
|
41
|
+
"./*": "./*.ts"
|
|
42
|
+
},
|
|
43
|
+
"private": false,
|
|
44
|
+
"engines": {
|
|
45
|
+
"node": ">=16.0.0"
|
|
46
|
+
},
|
|
47
|
+
"repository": {
|
|
48
|
+
"type": "git",
|
|
49
|
+
"url": "https://github.com/teambit/bit"
|
|
50
|
+
},
|
|
51
|
+
"keywords": [
|
|
52
|
+
"bit",
|
|
53
|
+
"bit-aspect",
|
|
54
|
+
"bit-core-aspect",
|
|
55
|
+
"components",
|
|
56
|
+
"collaboration",
|
|
57
|
+
"web"
|
|
58
|
+
]
|
|
59
|
+
}
|
package/types/asset.d.ts
ADDED
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
declare module '*.png' {
|
|
2
|
+
const value: any;
|
|
3
|
+
export = value;
|
|
4
|
+
}
|
|
5
|
+
declare module '*.svg' {
|
|
6
|
+
import type { FunctionComponent, SVGProps } from 'react';
|
|
7
|
+
|
|
8
|
+
export const ReactComponent: FunctionComponent<
|
|
9
|
+
SVGProps<SVGSVGElement> & { title?: string }
|
|
10
|
+
>;
|
|
11
|
+
const src: string;
|
|
12
|
+
export default src;
|
|
13
|
+
}
|
|
14
|
+
declare module '*.jpg' {
|
|
15
|
+
const value: any;
|
|
16
|
+
export = value;
|
|
17
|
+
}
|
|
18
|
+
declare module '*.jpeg' {
|
|
19
|
+
const value: any;
|
|
20
|
+
export = value;
|
|
21
|
+
}
|
|
22
|
+
declare module '*.gif' {
|
|
23
|
+
const value: any;
|
|
24
|
+
export = value;
|
|
25
|
+
}
|
|
26
|
+
declare module '*.bmp' {
|
|
27
|
+
const value: any;
|
|
28
|
+
export = value;
|
|
29
|
+
}
|
|
30
|
+
declare module '*.otf' {
|
|
31
|
+
const value: any;
|
|
32
|
+
export = value;
|
|
33
|
+
}
|
|
34
|
+
declare module '*.woff' {
|
|
35
|
+
const value: any;
|
|
36
|
+
export = value;
|
|
37
|
+
}
|
|
38
|
+
declare module '*.woff2' {
|
|
39
|
+
const value: any;
|
|
40
|
+
export = value;
|
|
41
|
+
}
|
package/types/style.d.ts
ADDED
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
declare module '*.module.css' {
|
|
2
|
+
const classes: { readonly [key: string]: string };
|
|
3
|
+
export default classes;
|
|
4
|
+
}
|
|
5
|
+
declare module '*.module.scss' {
|
|
6
|
+
const classes: { readonly [key: string]: string };
|
|
7
|
+
export default classes;
|
|
8
|
+
}
|
|
9
|
+
declare module '*.module.sass' {
|
|
10
|
+
const classes: { readonly [key: string]: string };
|
|
11
|
+
export default classes;
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
declare module '*.module.less' {
|
|
15
|
+
const classes: { readonly [key: string]: string };
|
|
16
|
+
export default classes;
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
declare module '*.less' {
|
|
20
|
+
const classes: { readonly [key: string]: string };
|
|
21
|
+
export default classes;
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
declare module '*.css' {
|
|
25
|
+
const classes: { readonly [key: string]: string };
|
|
26
|
+
export default classes;
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
declare module '*.sass' {
|
|
30
|
+
const classes: { readonly [key: string]: string };
|
|
31
|
+
export default classes;
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
declare module '*.scss' {
|
|
35
|
+
const classes: { readonly [key: string]: string };
|
|
36
|
+
export default classes;
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
declare module '*.mdx' {
|
|
40
|
+
const component: any;
|
|
41
|
+
export default component;
|
|
42
|
+
}
|