@teambit/compilation.aspect-docs.multi-compiler 0.0.0-3552b0d562ec49c97ade8b46b3dc3dca71b3cc59
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 -0
- package/dist/index.js +9 -0
- package/dist/index.js.map +1 -0
- package/dist/multi-compiler.composition.d.ts +2 -0
- package/dist/multi-compiler.composition.js +15 -0
- package/dist/multi-compiler.composition.js.map +1 -0
- package/dist/multi-compiler.docs.mdx +34 -0
- package/dist/multi-compiler.mdx.js +58 -0
- package/dist/multi-compiler.mdx.js.map +1 -0
- package/dist/preview-1781082109931.js +7 -0
- package/index.ts +1 -0
- package/multi-compiler.composition.tsx +12 -0
- package/multi-compiler.docs.mdx +34 -0
- package/multi-compiler.mdx +12 -0
- package/package.json +52 -0
- package/types/asset.d.ts +29 -0
- package/types/style.d.ts +42 -0
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default as MultiCompiler } from './multi-compiler.mdx';
|
package/dist/index.js
ADDED
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.MultiCompiler = void 0;
|
|
7
|
+
var multi_compiler_mdx_1 = require("./multi-compiler.mdx");
|
|
8
|
+
Object.defineProperty(exports, "MultiCompiler", { enumerable: true, get: function () { return __importDefault(multi_compiler_mdx_1).default; } });
|
|
9
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../index.ts"],"names":[],"mappings":";;;;;;AAAA,2DAAgE;AAAvD,oIAAA,OAAO,OAAiB"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.MultiCompilerDocs = void 0;
|
|
7
|
+
const react_1 = __importDefault(require("react"));
|
|
8
|
+
const documenter_theme_theme_compositions_1 = require("@teambit/documenter.theme.theme-compositions");
|
|
9
|
+
const mdx_ui_mdx_layout_1 = require("@teambit/mdx.ui.mdx-layout");
|
|
10
|
+
const index_1 = require("./index");
|
|
11
|
+
const MultiCompilerDocs = () => (react_1.default.createElement(documenter_theme_theme_compositions_1.ThemeCompositions, null,
|
|
12
|
+
react_1.default.createElement(mdx_ui_mdx_layout_1.MDXLayout, null,
|
|
13
|
+
react_1.default.createElement(index_1.MultiCompiler, null))));
|
|
14
|
+
exports.MultiCompilerDocs = MultiCompilerDocs;
|
|
15
|
+
//# sourceMappingURL=multi-compiler.composition.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"multi-compiler.composition.js","sourceRoot":"","sources":["../multi-compiler.composition.tsx"],"names":[],"mappings":";;;;;;AAAA,kDAA0B;AAC1B,sGAAiF;AACjF,kEAAuD;AACvD,mCAAwC;AAEjC,MAAM,iBAAiB,GAAG,GAAG,EAAE,CAAC,CACrC,8BAAC,uDAAiB;IAChB,8BAAC,6BAAS;QACR,8BAAC,qBAAa,OAAG,CACP,CACM,CACrB,CAAC;AANW,QAAA,iBAAiB,qBAM5B"}
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
---
|
|
2
|
+
description: 'Docs for MultiCompiler aspect'
|
|
3
|
+
labels: ['docs', 'aspect', 'extensions']
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
import { MultiCompiler } from './index';
|
|
7
|
+
|
|
8
|
+
## Static Content Page in MDX
|
|
9
|
+
|
|
10
|
+
Docs for MultiCompiler aspect
|
|
11
|
+
|
|
12
|
+
### Component usage
|
|
13
|
+
|
|
14
|
+
Use your component in any mdx file:
|
|
15
|
+
|
|
16
|
+
```js
|
|
17
|
+
import { MultiCompiler } from '@teambit/aspect-docs.multi-compiler';
|
|
18
|
+
|
|
19
|
+
<MultiCompiler />;
|
|
20
|
+
```
|
|
21
|
+
|
|
22
|
+
### Render with theme and MDX providers
|
|
23
|
+
|
|
24
|
+
```js
|
|
25
|
+
import { ThemeCompositions } from '@teambit/documenter.theme.theme-compositions';
|
|
26
|
+
import { MDXLayout } from '@teambit/ui.mdx-layout';
|
|
27
|
+
import { MultiCompiler } from '@teambit/aspect-docs.multi-compiler';
|
|
28
|
+
|
|
29
|
+
<ThemeCompositions>
|
|
30
|
+
<MDXLayout>
|
|
31
|
+
<MultiCompiler />
|
|
32
|
+
</MDXLayout>
|
|
33
|
+
</ThemeCompositions>;
|
|
34
|
+
```
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports["default"] = MDXContent;
|
|
7
|
+
var _jsxRuntime = require("react/jsx-runtime");
|
|
8
|
+
var _react = require("@mdx-js/react");
|
|
9
|
+
function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
|
|
10
|
+
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; }
|
|
11
|
+
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; }
|
|
12
|
+
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; }
|
|
13
|
+
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : i + ""; }
|
|
14
|
+
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); }
|
|
15
|
+
MDXContent.isMDXComponent = true;
|
|
16
|
+
function _createMdxContent(props) {
|
|
17
|
+
var _components = _objectSpread(_objectSpread({
|
|
18
|
+
code: "code",
|
|
19
|
+
li: "li",
|
|
20
|
+
p: "p",
|
|
21
|
+
pre: "pre",
|
|
22
|
+
ul: "ul"
|
|
23
|
+
}, (0, _react.useMDXComponents)()), props.components);
|
|
24
|
+
return (0, _jsxRuntime.jsxs)(_jsxRuntime.Fragment, {
|
|
25
|
+
children: [(0, _jsxRuntime.jsxs)(_components.p, {
|
|
26
|
+
children: ["The multi-compiler aspect allows the configuration of multiple compilers on a component. This determines which compiler to apply on a component file using the ", (0, _jsxRuntime.jsx)(_components.code, {
|
|
27
|
+
children: "isFileSupported()"
|
|
28
|
+
}), " compiler API."]
|
|
29
|
+
}), "\n", (0, _jsxRuntime.jsxs)(_components.ul, {
|
|
30
|
+
children: ["\n", (0, _jsxRuntime.jsxs)(_components.li, {
|
|
31
|
+
children: [(0, _jsxRuntime.jsx)(_components.code, {
|
|
32
|
+
children: "createCompiler(compilers: Compiler[], options: CompilerOptions)"
|
|
33
|
+
}), " API to support the creation a Multi-compiler instance which can be used in the Env API (the ", (0, _jsxRuntime.jsx)(_components.code, {
|
|
34
|
+
children: "overrideCompiler"
|
|
35
|
+
}), " and ", (0, _jsxRuntime.jsx)(_components.code, {
|
|
36
|
+
children: "getCompiler"
|
|
37
|
+
}), " APIs)."]
|
|
38
|
+
}), "\n", (0, _jsxRuntime.jsx)(_components.li, {
|
|
39
|
+
children: "Supports the creation of a multi-compiler build tasks."
|
|
40
|
+
}), "\n"]
|
|
41
|
+
}), "\n", (0, _jsxRuntime.jsx)(_components.pre, {
|
|
42
|
+
children: (0, _jsxRuntime.jsx)(_components.code, {
|
|
43
|
+
className: "language-ts",
|
|
44
|
+
children: "// create a multi compiler instance.\nconst compiler = multiCompiler.createCompiler([createBabelCompiler(), createTsCompiler()]);\n\n// create a multi-compiler build task.\ncompiler.createTask('MultiCompiler', compiler);\n"
|
|
45
|
+
})
|
|
46
|
+
})]
|
|
47
|
+
});
|
|
48
|
+
}
|
|
49
|
+
function MDXContent() {
|
|
50
|
+
var props = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
|
51
|
+
var _provideComponents$pr = _objectSpread(_objectSpread({}, (0, _react.useMDXComponents)()), props.components),
|
|
52
|
+
MDXLayout = _provideComponents$pr.wrapper;
|
|
53
|
+
return MDXLayout ? (0, _jsxRuntime.jsx)(MDXLayout, _objectSpread(_objectSpread({}, props), {}, {
|
|
54
|
+
children: (0, _jsxRuntime.jsx)(_createMdxContent, _objectSpread({}, props))
|
|
55
|
+
})) : _createMdxContent(props);
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
//# sourceMappingURL=multi-compiler.mdx.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["_jsxRuntime","require","_react","_typeof","o","Symbol","iterator","constructor","prototype","ownKeys","e","r","t","Object","keys","getOwnPropertySymbols","filter","getOwnPropertyDescriptor","enumerable","push","apply","_objectSpread","arguments","length","forEach","_defineProperty","getOwnPropertyDescriptors","defineProperties","defineProperty","_toPropertyKey","value","configurable","writable","i","_toPrimitive","toPrimitive","call","TypeError","String","Number","MDXContent","isMDXComponent","_createMdxContent","props","_components","code","li","p","pre","ul","_provideComponents","components","_jsxs","_Fragment","children","_jsx","className","undefined","_provideComponents$pr","MDXLayout","wrapper"],"sourceRoot":"/home/circleci/Library/Caches/Bit/capsules/8891be5ad/teambit.compilation_aspect-docs_multi-compiler@3552b0d562ec49c97ade8b46b3dc3dca71b3cc59","sources":["multi-compiler.mdx.js"],"sourcesContent":["MDXContent.isMDXComponent = true;\nimport {Fragment as _Fragment, jsx as _jsx, jsxs as _jsxs} from \"react/jsx-runtime\";\nimport {useMDXComponents as _provideComponents} from \"@mdx-js/react\";\nfunction _createMdxContent(props) {\n const _components = {\n code: \"code\",\n li: \"li\",\n p: \"p\",\n pre: \"pre\",\n ul: \"ul\",\n ..._provideComponents(),\n ...props.components\n };\n return _jsxs(_Fragment, {\n children: [_jsxs(_components.p, {\n children: [\"The multi-compiler aspect allows the configuration of multiple compilers on a component. This determines which compiler to apply on a component file using the \", _jsx(_components.code, {\n children: \"isFileSupported()\"\n }), \" compiler API.\"]\n }), \"\\n\", _jsxs(_components.ul, {\n children: [\"\\n\", _jsxs(_components.li, {\n children: [_jsx(_components.code, {\n children: \"createCompiler(compilers: Compiler[], options: CompilerOptions)\"\n }), \" API to support the creation a Multi-compiler instance which can be used in the Env API (the \", _jsx(_components.code, {\n children: \"overrideCompiler\"\n }), \" and \", _jsx(_components.code, {\n children: \"getCompiler\"\n }), \" APIs).\"]\n }), \"\\n\", _jsx(_components.li, {\n children: \"Supports the creation of a multi-compiler build tasks.\"\n }), \"\\n\"]\n }), \"\\n\", _jsx(_components.pre, {\n children: _jsx(_components.code, {\n className: \"language-ts\",\n children: \"// create a multi compiler instance.\\nconst compiler = multiCompiler.createCompiler([createBabelCompiler(), createTsCompiler()]);\\n\\n// create a multi-compiler build task.\\ncompiler.createTask('MultiCompiler', compiler);\\n\"\n })\n })]\n });\n}\nexport default function MDXContent(props = {}) {\n const {wrapper: MDXLayout} = {\n ..._provideComponents(),\n ...props.components\n };\n return MDXLayout ? _jsx(MDXLayout, {\n ...props,\n children: _jsx(_createMdxContent, {\n ...props\n })\n }) : _createMdxContent(props);\n}\n"],"mappings":";;;;;;AACA,IAAAA,WAAA,GAAAC,OAAA;AACA,IAAAC,MAAA,GAAAD,OAAA;AAAqE,SAAAE,QAAAC,CAAA,sCAAAD,OAAA,wBAAAE,MAAA,uBAAAA,MAAA,CAAAC,QAAA,aAAAF,CAAA,kBAAAA,CAAA,gBAAAA,CAAA,WAAAA,CAAA,yBAAAC,MAAA,IAAAD,CAAA,CAAAG,WAAA,KAAAF,MAAA,IAAAD,CAAA,KAAAC,MAAA,CAAAG,SAAA,qBAAAJ,CAAA,KAAAD,OAAA,CAAAC,CAAA;AAAA,SAAAK,QAAAC,CAAA,EAAAC,CAAA,QAAAC,CAAA,GAAAC,MAAA,CAAAC,IAAA,CAAAJ,CAAA,OAAAG,MAAA,CAAAE,qBAAA,QAAAX,CAAA,GAAAS,MAAA,CAAAE,qBAAA,CAAAL,CAAA,GAAAC,CAAA,KAAAP,CAAA,GAAAA,CAAA,CAAAY,MAAA,WAAAL,CAAA,WAAAE,MAAA,CAAAI,wBAAA,CAAAP,CAAA,EAAAC,CAAA,EAAAO,UAAA,OAAAN,CAAA,CAAAO,IAAA,CAAAC,KAAA,CAAAR,CAAA,EAAAR,CAAA,YAAAQ,CAAA;AAAA,SAAAS,cAAAX,CAAA,aAAAC,CAAA,MAAAA,CAAA,GAAAW,SAAA,CAAAC,MAAA,EAAAZ,CAAA,UAAAC,CAAA,WAAAU,SAAA,CAAAX,CAAA,IAAAW,SAAA,CAAAX,CAAA,QAAAA,CAAA,OAAAF,OAAA,CAAAI,MAAA,CAAAD,CAAA,OAAAY,OAAA,WAAAb,CAAA,IAAAc,eAAA,CAAAf,CAAA,EAAAC,CAAA,EAAAC,CAAA,CAAAD,CAAA,SAAAE,MAAA,CAAAa,yBAAA,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;AACe,SAASd,UAAUA,CAAA,EAAa;EAAA,IAAZG,KAAK,GAAArB,SAAA,CAAAC,MAAA,QAAAD,SAAA,QAAAmC,SAAA,GAAAnC,SAAA,MAAG,CAAC,CAAC;EAC3C,IAAAoC,qBAAA,GAAArC,aAAA,CAAAA,aAAA,KACK,IAAA6B,uBAAkB,EAAC,CAAC,GACpBP,KAAK,CAACQ,UAAU;IAFLQ,SAAS,GAAAD,qBAAA,CAAlBE,OAAO;EAId,OAAOD,SAAS,GAAG,IAAAJ,eAAI,EAACI,SAAS,EAAAtC,aAAA,CAAAA,aAAA,KAC5BsB,KAAK;IACRW,QAAQ,EAAE,IAAAC,eAAI,EAACb,iBAAiB,EAAArB,aAAA,KAC3BsB,KAAK,CACT;EAAC,EACH,CAAC,GAAGD,iBAAiB,CAACC,KAAK,CAAC;AAC/B","ignoreList":[]}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import * as compositions_0 from '/home/circleci/Library/Caches/Bit/capsules/8891be5ad/teambit.compilation_aspect-docs_multi-compiler@3552b0d562ec49c97ade8b46b3dc3dca71b3cc59/dist/multi-compiler.composition.js';
|
|
2
|
+
import * as overview_0 from '/home/circleci/Library/Caches/Bit/capsules/8891be5ad/teambit.compilation_aspect-docs_multi-compiler@3552b0d562ec49c97ade8b46b3dc3dca71b3cc59/dist/multi-compiler.docs.mdx';
|
|
3
|
+
|
|
4
|
+
export const compositions = [compositions_0];
|
|
5
|
+
export const overview = [overview_0];
|
|
6
|
+
|
|
7
|
+
export const compositions_metadata = {"compositions":[{"displayName":"Multi compiler docs","identifier":"MultiCompilerDocs"}]};
|
package/index.ts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default as MultiCompiler } from './multi-compiler.mdx';
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { ThemeCompositions } from '@teambit/documenter.theme.theme-compositions';
|
|
3
|
+
import { MDXLayout } from '@teambit/mdx.ui.mdx-layout';
|
|
4
|
+
import { MultiCompiler } from './index';
|
|
5
|
+
|
|
6
|
+
export const MultiCompilerDocs = () => (
|
|
7
|
+
<ThemeCompositions>
|
|
8
|
+
<MDXLayout>
|
|
9
|
+
<MultiCompiler />
|
|
10
|
+
</MDXLayout>
|
|
11
|
+
</ThemeCompositions>
|
|
12
|
+
);
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
---
|
|
2
|
+
description: 'Docs for MultiCompiler aspect'
|
|
3
|
+
labels: ['docs', 'aspect', 'extensions']
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
import { MultiCompiler } from './index';
|
|
7
|
+
|
|
8
|
+
## Static Content Page in MDX
|
|
9
|
+
|
|
10
|
+
Docs for MultiCompiler aspect
|
|
11
|
+
|
|
12
|
+
### Component usage
|
|
13
|
+
|
|
14
|
+
Use your component in any mdx file:
|
|
15
|
+
|
|
16
|
+
```js
|
|
17
|
+
import { MultiCompiler } from '@teambit/aspect-docs.multi-compiler';
|
|
18
|
+
|
|
19
|
+
<MultiCompiler />;
|
|
20
|
+
```
|
|
21
|
+
|
|
22
|
+
### Render with theme and MDX providers
|
|
23
|
+
|
|
24
|
+
```js
|
|
25
|
+
import { ThemeCompositions } from '@teambit/documenter.theme.theme-compositions';
|
|
26
|
+
import { MDXLayout } from '@teambit/ui.mdx-layout';
|
|
27
|
+
import { MultiCompiler } from '@teambit/aspect-docs.multi-compiler';
|
|
28
|
+
|
|
29
|
+
<ThemeCompositions>
|
|
30
|
+
<MDXLayout>
|
|
31
|
+
<MultiCompiler />
|
|
32
|
+
</MDXLayout>
|
|
33
|
+
</ThemeCompositions>;
|
|
34
|
+
```
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
The multi-compiler aspect allows the configuration of multiple compilers on a component. This determines which compiler to apply on a component file using the `isFileSupported()` compiler API.
|
|
2
|
+
|
|
3
|
+
- `createCompiler(compilers: Compiler[], options: CompilerOptions)` API to support the creation a Multi-compiler instance which can be used in the Env API (the `overrideCompiler` and `getCompiler` APIs).
|
|
4
|
+
- Supports the creation of a multi-compiler build tasks.
|
|
5
|
+
|
|
6
|
+
```ts
|
|
7
|
+
// create a multi compiler instance.
|
|
8
|
+
const compiler = multiCompiler.createCompiler([createBabelCompiler(), createTsCompiler()]);
|
|
9
|
+
|
|
10
|
+
// create a multi-compiler build task.
|
|
11
|
+
compiler.createTask('MultiCompiler', compiler);
|
|
12
|
+
```
|
package/package.json
ADDED
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@teambit/compilation.aspect-docs.multi-compiler",
|
|
3
|
+
"version": "0.0.0-3552b0d562ec49c97ade8b46b3dc3dca71b3cc59",
|
|
4
|
+
"homepage": "https://bit.cloud/teambit/compilation/aspect-docs/multi-compiler",
|
|
5
|
+
"main": "dist/index.js",
|
|
6
|
+
"componentId": {
|
|
7
|
+
"scope": "teambit.compilation",
|
|
8
|
+
"name": "aspect-docs/multi-compiler",
|
|
9
|
+
"version": "3552b0d562ec49c97ade8b46b3dc3dca71b3cc59"
|
|
10
|
+
},
|
|
11
|
+
"dependencies": {
|
|
12
|
+
"core-js": "^3.0.0",
|
|
13
|
+
"@mdx-js/react": "^3.1.1",
|
|
14
|
+
"@teambit/mdx.ui.mdx-scope-context": "1.0.0"
|
|
15
|
+
},
|
|
16
|
+
"devDependencies": {
|
|
17
|
+
"@types/react": "^19.0.0",
|
|
18
|
+
"@types/mocha": "9.1.0",
|
|
19
|
+
"@types/node": "12.20.4",
|
|
20
|
+
"@types/react-dom": "^19.0.0",
|
|
21
|
+
"@types/jest": "^26.0.0",
|
|
22
|
+
"@babel/runtime": "7.20.0",
|
|
23
|
+
"@types/testing-library__jest-dom": "5.9.5",
|
|
24
|
+
"@teambit/documenter.theme.theme-compositions": "4.1.5",
|
|
25
|
+
"@teambit/mdx.ui.mdx-layout": "1.0.12"
|
|
26
|
+
},
|
|
27
|
+
"peerDependencies": {
|
|
28
|
+
"react": "^17.0.0 || ^18.0.0 || ^19.0.0",
|
|
29
|
+
"react-dom": "^17.0.0 || ^18.0.0 || ^19.0.0"
|
|
30
|
+
},
|
|
31
|
+
"license": "Apache-2.0",
|
|
32
|
+
"optionalDependencies": {},
|
|
33
|
+
"peerDependenciesMeta": {},
|
|
34
|
+
"private": false,
|
|
35
|
+
"engines": {
|
|
36
|
+
"node": ">=12.22.0"
|
|
37
|
+
},
|
|
38
|
+
"repository": {
|
|
39
|
+
"type": "git",
|
|
40
|
+
"url": "https://github.com/teambit/bit"
|
|
41
|
+
},
|
|
42
|
+
"keywords": [
|
|
43
|
+
"bit",
|
|
44
|
+
"components",
|
|
45
|
+
"collaboration",
|
|
46
|
+
"web",
|
|
47
|
+
"react",
|
|
48
|
+
"react-components",
|
|
49
|
+
"angular",
|
|
50
|
+
"angular-components"
|
|
51
|
+
]
|
|
52
|
+
}
|
package/types/asset.d.ts
ADDED
|
@@ -0,0 +1,29 @@
|
|
|
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<SVGProps<SVGSVGElement> & { title?: string }>;
|
|
9
|
+
const src: string;
|
|
10
|
+
export default src;
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
// @TODO Gilad
|
|
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
|
+
}
|
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
|
+
}
|