@teambit/preview 1.0.133 → 1.0.135
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/artifacts/__bit_junit.xml +2 -2
- package/artifacts/preview/teambit_preview_preview-preview.js +1 -1
- package/dist/pre-bundle.d.ts +1 -1
- package/dist/pre-bundle.js +12 -2
- package/dist/pre-bundle.js.map +1 -1
- package/dist/{preview-1705029264950.js → preview-1705202058555.js} +2 -2
- package/dist/strategies/component-strategy.js +1 -1
- package/dist/strategies/component-strategy.js.map +1 -1
- package/package.json +18 -18
- package/strategies/component-strategy.ts +1 -1
@@ -1,6 +1,6 @@
|
|
1
1
|
<?xml version="1.0" encoding="UTF-8"?>
|
2
2
|
<testsuites>
|
3
|
-
<testsuite name="teambit.preview/preview@1.0.
|
4
|
-
<testcase classname="create-peer-link.spec.js" name="should output snapshot" time="0.
|
3
|
+
<testsuite name="teambit.preview/preview@1.0.135" timestamp="2024-01-14T03:36:13.513Z" tests="1" failures="0" errors="0" skipped="0">
|
4
|
+
<testcase classname="create-peer-link.spec.js" name="should output snapshot" time="0.199"/>
|
5
5
|
</testsuite>
|
6
6
|
</testsuites>
|
@@ -1 +1 @@
|
|
1
|
-
!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define([],t):"object"==typeof exports?exports["teambit.preview/preview-preview"]=t():e["teambit.preview/preview-preview"]=t()}(self,(()=>(()=>{"use strict";var e={71966:(e,t,n)=>{Object.defineProperty(t,"M",{enumerable:!0,get:function(){return o.default}});var o=r(n(37796));function r(e){return e&&e.__esModule?e:{default:e}}r.__bit_component={id:"teambit.preview/aspect-docs/preview@0.0.167",homepage:"https://bit.cloud/teambit/preview/aspect-docs/preview",exported:!0}},37796:(e,t,n)=>{var o={id:"teambit.preview/aspect-docs/preview@0.0.167",homepage:"https://bit.cloud/teambit/preview/aspect-docs/preview",exported:!0};Object.defineProperty(t,"__esModule",{value:!0}),t.default=m,a(n(87363));var r=n(40040),i=["components"];function a(e){return e&&e.__esModule?e:{default:e}}function s(){return s=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var o in n)Object.prototype.hasOwnProperty.call(n,o)&&(e[o]=n[o])}return e},s.apply(this,arguments)}function p(e,t){if(null==e)return{};var n,o,r=d(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(o=0;o<i.length;o++)n=i[o],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}function d(e,t){if(null==e)return{};var n,o,r={},i=Object.keys(e);for(o=0;o<i.length;o++)n=i[o],t.indexOf(n)>=0||(r[n]=e[n]);return r}a.__bit_component=o,s.__bit_component=o,p.__bit_component=o,d.__bit_component=o;var l={},c="wrapper";function m(e){var t=e.components,n=p(e,i);return(0,r.mdx)(c,s({},l,n,{components:t,mdxType:"MDXLayout"}),(0,r.mdx)("p",null,"The Preview aspect handles the bundling and rendering of component compositions and documentation, for the Workspace UI and Scope UI."),(0,r.mdx)("p",null,"Preview is used to display components in development (on ",(0,r.mdx)("inlineCode",{parentName:"p"},"bit start"),") as well as in their released versions (assets for the release version are generated as part of the build process)."),(0,r.mdx)("p",null,"The Preview aspect handles each component according to the configurations set by the environment that is used by that component. That means both the documentation and the component compositions will be bundled and displayed differently for different environments."),(0,r.mdx)("h2",null,"Rational"),(0,r.mdx)("p",null,"In a standard web application, UI components ",(0,r.mdx)("em",{parentName:"p"},"serving the same application")," are bundled together to produce the necessary assets to make them renderable by the browser."),(0,r.mdx)("p",null,"Components in a Bit workspace are not all in the service of the same application. Each component is authored, tagged and exported as an independent component.\nThat means a few things:"),(0,r.mdx)("ol",null,(0,r.mdx)("li",{parentName:"ol"},(0,r.mdx)("p",{parentName:"li"},"Components in a Bit workspace are not consumed ,directly or indirectly, by a single entry file (e.g, the app's ",(0,r.mdx)("inlineCode",{parentName:"p"},"index.js"),"). That makes it impossible for the bundler to follow the files needed to be bundled.")),(0,r.mdx)("li",{parentName:"ol"},(0,r.mdx)("p",{parentName:"li"},"Different components in a single workspace may be implemented using different technologies and bundled using different configurations or even different bundlers."))),(0,r.mdx)("p",null,"Preview solves the above challenges by creating a temporary entry file for each group of components using the same environment.\nIt then serves this file to the Bundler, to be bundled according to the environment and the purpose of bundling. That is, to display components in development or to display the components' release versions (for a \"production-level\" exhibition of the component's documentation and compositions)."),(0,r.mdx)("h2",null,"Usage"),(0,r.mdx)("h3",null,"Extending the Preview aspect"),(0,r.mdx)("p",null,"The preview aspect can be extended to generate other renderable artifacts , either when running Bit's development server or as part of the build pipeline (for a component's tagged version).\nThese artifacts can present additional information that assists in inspecting a component (for example, showing the results of accessibility tests)."))}m.__bit_component=o,m.isMDXComponent=!0},
|
1
|
+
!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define([],t):"object"==typeof exports?exports["teambit.preview/preview-preview"]=t():e["teambit.preview/preview-preview"]=t()}(self,(()=>(()=>{"use strict";var e={71966:(e,t,n)=>{Object.defineProperty(t,"M",{enumerable:!0,get:function(){return o.default}});var o=r(n(37796));function r(e){return e&&e.__esModule?e:{default:e}}r.__bit_component={id:"teambit.preview/aspect-docs/preview@0.0.167",homepage:"https://bit.cloud/teambit/preview/aspect-docs/preview",exported:!0}},37796:(e,t,n)=>{var o={id:"teambit.preview/aspect-docs/preview@0.0.167",homepage:"https://bit.cloud/teambit/preview/aspect-docs/preview",exported:!0};Object.defineProperty(t,"__esModule",{value:!0}),t.default=m,a(n(87363));var r=n(40040),i=["components"];function a(e){return e&&e.__esModule?e:{default:e}}function s(){return s=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var o in n)Object.prototype.hasOwnProperty.call(n,o)&&(e[o]=n[o])}return e},s.apply(this,arguments)}function p(e,t){if(null==e)return{};var n,o,r=d(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(o=0;o<i.length;o++)n=i[o],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}function d(e,t){if(null==e)return{};var n,o,r={},i=Object.keys(e);for(o=0;o<i.length;o++)n=i[o],t.indexOf(n)>=0||(r[n]=e[n]);return r}a.__bit_component=o,s.__bit_component=o,p.__bit_component=o,d.__bit_component=o;var l={},c="wrapper";function m(e){var t=e.components,n=p(e,i);return(0,r.mdx)(c,s({},l,n,{components:t,mdxType:"MDXLayout"}),(0,r.mdx)("p",null,"The Preview aspect handles the bundling and rendering of component compositions and documentation, for the Workspace UI and Scope UI."),(0,r.mdx)("p",null,"Preview is used to display components in development (on ",(0,r.mdx)("inlineCode",{parentName:"p"},"bit start"),") as well as in their released versions (assets for the release version are generated as part of the build process)."),(0,r.mdx)("p",null,"The Preview aspect handles each component according to the configurations set by the environment that is used by that component. That means both the documentation and the component compositions will be bundled and displayed differently for different environments."),(0,r.mdx)("h2",null,"Rational"),(0,r.mdx)("p",null,"In a standard web application, UI components ",(0,r.mdx)("em",{parentName:"p"},"serving the same application")," are bundled together to produce the necessary assets to make them renderable by the browser."),(0,r.mdx)("p",null,"Components in a Bit workspace are not all in the service of the same application. Each component is authored, tagged and exported as an independent component.\nThat means a few things:"),(0,r.mdx)("ol",null,(0,r.mdx)("li",{parentName:"ol"},(0,r.mdx)("p",{parentName:"li"},"Components in a Bit workspace are not consumed ,directly or indirectly, by a single entry file (e.g, the app's ",(0,r.mdx)("inlineCode",{parentName:"p"},"index.js"),"). That makes it impossible for the bundler to follow the files needed to be bundled.")),(0,r.mdx)("li",{parentName:"ol"},(0,r.mdx)("p",{parentName:"li"},"Different components in a single workspace may be implemented using different technologies and bundled using different configurations or even different bundlers."))),(0,r.mdx)("p",null,"Preview solves the above challenges by creating a temporary entry file for each group of components using the same environment.\nIt then serves this file to the Bundler, to be bundled according to the environment and the purpose of bundling. That is, to display components in development or to display the components' release versions (for a \"production-level\" exhibition of the component's documentation and compositions)."),(0,r.mdx)("h2",null,"Usage"),(0,r.mdx)("h3",null,"Extending the Preview aspect"),(0,r.mdx)("p",null,"The preview aspect can be extended to generate other renderable artifacts , either when running Bit's development server or as part of the build pipeline (for a component's tagged version).\nThese artifacts can present additional information that assists in inspecting a component (for example, showing the results of accessibility tests)."))}m.__bit_component=o,m.isMDXComponent=!0},225:(e,t,n)=>{var o={id:"teambit.preview/preview@1.0.135",homepage:"https://bit.cloud/teambit/preview/preview",exported:!0};function r(){const e=i(n(87363));return r=function(){return e},e}function i(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0}),t.Logo=void 0,r.__bit_component=o,i.__bit_component=o;const a=()=>r().default.createElement("div",{style:{height:"100%",display:"flex",justifyContent:"center"}},r().default.createElement("img",{style:{width:70},src:"https://static.bit.dev/extensions-icons/preview.svg"}));a.__bit_component=o,t.Logo=a},40040:e=>{e.exports=MdxJsReact},87363:e=>{e.exports=React}},t={};function n(o){var r=t[o];if(void 0!==r)return r.exports;var i=t[o]={exports:{}};return e[o](i,i.exports,n),i.exports}n.d=(e,t)=>{for(var o in t)n.o(t,o)&&!n.o(e,o)&&Object.defineProperty(e,o,{enumerable:!0,get:t[o]})},n.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),n.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})};var o={};return(()=>{n.r(o),n.d(o,{compositions:()=>m,compositions_metadata:()=>f,overview:()=>u});var e={};n.r(e),n.d(e,{default:()=>c});var t=n(225),r=(n(87363),n(40040));const i=TeambitMdxUiMdxScopeContext;var a=n(71966),s=["components"];function p(){return p=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var o in n)Object.prototype.hasOwnProperty.call(n,o)&&(e[o]=n[o])}return e},p.apply(this,arguments)}var d={},l="wrapper";function c(e){var t=e.components,n=function(e,t){if(null==e)return{};var n,o,r=function(e,t){if(null==e)return{};var n,o,r={},i=Object.keys(e);for(o=0;o<i.length;o++)n=i[o],t.indexOf(n)>=0||(r[n]=e[n]);return r}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(o=0;o<i.length;o++)n=i[o],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}(e,s);return(0,r.mdx)(l,p({},d,n,{components:t,mdxType:"MDXLayout"}),(0,r.mdx)(i.MDXScopeProvider,{components:{Preview:a.M},mdxType:"MDXScopeProvider"},(0,r.mdx)(a.M,{mdxType:"Preview"})))}c.isMDXComponent=!0;const m=[t],u=[e],f={compositions:[{displayName:"Logo",identifier:"Logo"}]}})(),o})()));
|
package/dist/pre-bundle.d.ts
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
import { AspectDefinition } from '@teambit/aspect-loader';
|
2
2
|
export declare const RUNTIME_NAME = "preview";
|
3
|
-
export declare const PUBLIC_DIR
|
3
|
+
export declare const PUBLIC_DIR: string;
|
4
4
|
export declare const UIROOT_ASPECT_ID = "teambit.workspace/workspace";
|
5
5
|
export declare const generatePreBundlePreviewEntry: (aspectDefs: AspectDefinition[], rootExtensionName: string, runtimeName: string, rootAspectId: string, dir: string) => string;
|
6
6
|
export declare function buildPreBundlePreview(resolvedAspects: AspectDefinition[], customOutputDir?: string): Promise<any>;
|
package/dist/pre-bundle.js
CHANGED
@@ -35,6 +35,13 @@ function _utils() {
|
|
35
35
|
};
|
36
36
|
return data;
|
37
37
|
}
|
38
|
+
function _toolboxPath() {
|
39
|
+
const data = require("@teambit/toolbox.path.to-windows-compatible-path");
|
40
|
+
_toolboxPath = function () {
|
41
|
+
return data;
|
42
|
+
};
|
43
|
+
return data;
|
44
|
+
}
|
38
45
|
function _webpack() {
|
39
46
|
const data = _interopRequireDefault(require("webpack"));
|
40
47
|
_webpack = function () {
|
@@ -74,7 +81,7 @@ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { de
|
|
74
81
|
function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function (e) { return e ? t : r; })(e); }
|
75
82
|
function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && Object.prototype.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
|
76
83
|
const RUNTIME_NAME = exports.RUNTIME_NAME = 'preview';
|
77
|
-
const PUBLIC_DIR = exports.PUBLIC_DIR = 'public
|
84
|
+
const PUBLIC_DIR = exports.PUBLIC_DIR = (0, _path().join)('public', 'bit-preview');
|
78
85
|
const UIROOT_ASPECT_ID = exports.UIROOT_ASPECT_ID = 'teambit.workspace/workspace';
|
79
86
|
const ENTRY_CONTENT_TEMPLATE = `__IMPORTS__
|
80
87
|
|
@@ -158,7 +165,10 @@ async function buildPreBundlePreview(resolvedAspects, customOutputDir) {
|
|
158
165
|
async function generateBundlePreviewEntry(rootAspectId, previewPreBundlePath, config) {
|
159
166
|
const manifestPath = (0, _path().join)(previewPreBundlePath, 'asset-manifest.json');
|
160
167
|
const manifest = (0, _fsExtra().readJsonSync)(manifestPath);
|
161
|
-
const imports = manifest.entrypoints.map(entry =>
|
168
|
+
const imports = manifest.entrypoints.map(entry => {
|
169
|
+
const entryPath = (0, _toolboxPath().toWindowsCompatiblePath)((0, _path().join)(previewPreBundlePath, entry));
|
170
|
+
return entry.endsWith('.js') ? `import { run } from '${entryPath}';` : `import '${entryPath}';`;
|
171
|
+
}).join('\n');
|
162
172
|
config['teambit.harmony/bit'] = rootAspectId;
|
163
173
|
const contents = [imports, `run(${JSON.stringify(config, null, 2)});`].join('\n');
|
164
174
|
const previewRuntime = (0, _path().resolve)((0, _path().join)(__dirname, `preview.entry.${(0, _utils().sha1)(contents)}.js`));
|
package/dist/pre-bundle.js.map
CHANGED
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"names":["_path","data","require","_fsExtra","_interopRequireWildcard","_harmonyModules","_utils","_webpack","_interopRequireDefault","_util","_preview","_webpack2","_preBundleUtils","obj","__esModule","default","_getRequireWildcardCache","e","WeakMap","r","t","has","get","n","__proto__","a","Object","defineProperty","getOwnPropertyDescriptor","u","prototype","hasOwnProperty","call","i","set","RUNTIME_NAME","exports","PUBLIC_DIR","UIROOT_ASPECT_ID","ENTRY_CONTENT_TEMPLATE","generatePreBundlePreviewEntry","aspectDefs","rootExtensionName","runtimeName","rootAspectId","dir","harmonyImport","createHarmonyImports","imports","createImports","identifiers","getIdentifiers","idSetters","getIdSetters","contents","replace","join","replaceAll","JSON","stringify","entryPath","resolve","sha1","fs","existsSync","outputFileSync","buildPreBundlePreview","resolvedAspects","customOutputDir","outputDir","mainEntry","PreviewAspect","id","__dirname","config","createWebpackConfig","compiler","webpack","compilerRun","promisify","run","bind","results","Error","hasErrors","clearConsole","toString","generateBundlePreviewEntry","previewPreBundlePath","manifestPath","manifest","readJsonSync","entrypoints","map","entry","endsWith","previewRuntime"],"sources":["pre-bundle.ts"],"sourcesContent":["import { join, resolve } from 'path';\nimport fs, { existsSync, outputFileSync, readJsonSync } from 'fs-extra';\nimport { AspectDefinition } from '@teambit/aspect-loader';\nimport {\n createHarmonyImports,\n createImports,\n getIdSetters,\n getIdentifiers,\n} from '@teambit/harmony.modules.harmony-root-generator';\nimport { sha1 } from '@teambit/legacy/dist/utils';\nimport webpack from 'webpack';\nimport { promisify } from 'util';\nimport { PreviewAspect } from './preview.aspect';\nimport { createWebpackConfig } from './webpack/webpack.config';\nimport { clearConsole } from './pre-bundle-utils';\n\nexport const RUNTIME_NAME = 'preview';\nexport const PUBLIC_DIR = 'public/bit-preview';\nexport const UIROOT_ASPECT_ID = 'teambit.workspace/workspace';\n\nconst ENTRY_CONTENT_TEMPLATE = `__IMPORTS__\n\nexport const run = (config, customAspects = []) => {\n const isBrowser = typeof window !== \"undefined\";\n const windowConfig = isBrowser ? window.harmonyAppConfig : undefined;\n const mergedConfig = { ...config, ...windowConfig };\n __ID_SETTERS__\n function render(...props) {\n return Harmony.load(\n [\n ...customAspects,\n __IDENTIFIERS__,\n ],\n __RUNTIME_NAME__,\n mergedConfig\n ).then((harmony) => {\n return harmony\n .run()\n .then(() => harmony.get(__ROOT_ASPECT__))\n .then((rootExtension) => {\n const ssrSetup = !isBrowser && rootExtension.setupSsr;\n const setup = rootExtension.setup;\n const setupFunc = (ssrSetup || setup || function noop() {}).bind(\n rootExtension\n );\n return Promise.resolve(setupFunc()).then(\n () => {\n return rootExtension\n }\n );\n })\n .then((rootExtension) => {\n if (isBrowser) {\n return rootExtension.render(\n __ROOT_EXTENSION_NAME__,\n ...props\n );\n } else {\n return rootExtension.renderSsr(\n __ROOT_EXTENSION_NAME__,\n ...props\n );\n }\n })\n .catch((err) => {\n throw err;\n });\n });\n }\n if (isBrowser || __RUNTIME_NAME__ === \"main\") render();\n};\n`;\n\nexport const generatePreBundlePreviewEntry = (\n aspectDefs: AspectDefinition[],\n rootExtensionName: string,\n runtimeName: string,\n rootAspectId: string,\n dir: string\n) => {\n const harmonyImport = createHarmonyImports();\n const imports = createImports(aspectDefs);\n const identifiers = getIdentifiers(aspectDefs, 'Aspect');\n const idSetters = getIdSetters(aspectDefs, 'Aspect');\n const contents = ENTRY_CONTENT_TEMPLATE.replace('__IMPORTS__', [harmonyImport, imports].join('\\n'))\n .replace('__IDENTIFIERS__', identifiers.join(', '))\n .replace('__ID_SETTERS__', idSetters.join('\\n'))\n .replaceAll('__RUNTIME_NAME__', JSON.stringify(runtimeName))\n .replaceAll('__ROOT_ASPECT__', JSON.stringify(rootAspectId))\n .replaceAll('__ROOT_EXTENSION_NAME__', JSON.stringify(rootExtensionName));\n const entryPath = resolve(join(dir, `ui-bundle-entry.${sha1(contents)}.js`));\n if (!fs.existsSync(entryPath)) {\n fs.outputFileSync(entryPath, contents);\n }\n return entryPath;\n};\n\nexport async function buildPreBundlePreview(resolvedAspects: AspectDefinition[], customOutputDir?: string) {\n const outputDir = customOutputDir || resolve(PUBLIC_DIR);\n const mainEntry = generatePreBundlePreviewEntry(\n resolvedAspects,\n UIROOT_ASPECT_ID,\n RUNTIME_NAME,\n PreviewAspect.id,\n __dirname\n );\n const config = createWebpackConfig(outputDir, mainEntry);\n const compiler = webpack(config);\n const compilerRun = promisify(compiler.run.bind(compiler));\n const results = await compilerRun();\n if (!results) throw new Error();\n if (results?.hasErrors()) {\n clearConsole();\n throw new Error(results?.toString());\n }\n return results;\n}\n\nexport async function generateBundlePreviewEntry(rootAspectId: string, previewPreBundlePath: string, config: object) {\n const manifestPath = join(previewPreBundlePath, 'asset-manifest.json');\n const manifest = readJsonSync(manifestPath);\n const imports = manifest.entrypoints\n .map((entry: string) =>\n entry.endsWith('.js')\n ? `import { run } from '${previewPreBundlePath}/${entry}';`\n : `import '${previewPreBundlePath}/${entry}';`\n )\n .join('\\n');\n config['teambit.harmony/bit'] = rootAspectId;\n\n const contents = [imports, `run(${JSON.stringify(config, null, 2)});`].join('\\n');\n const previewRuntime = resolve(join(__dirname, `preview.entry.${sha1(contents)}.js`));\n\n if (!existsSync(previewRuntime)) {\n outputFileSync(previewRuntime, contents);\n }\n\n return previewRuntime;\n}\n"],"mappings":";;;;;;;;;AAAA,SAAAA,MAAA;EAAA,MAAAC,IAAA,GAAAC,OAAA;EAAAF,KAAA,YAAAA,CAAA;IAAA,OAAAC,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AACA,SAAAE,SAAA;EAAA,MAAAF,IAAA,GAAAG,uBAAA,CAAAF,OAAA;EAAAC,QAAA,YAAAA,CAAA;IAAA,OAAAF,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA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K,CAAC,GAChB,wBAAuBP,oBAAqB,IAAGM,KAAM,IAAG,GACxD,WAAUN,oBAAqB,IAAGM,KAAM,IAC/C,CAAC,CACAtC,IAAI,CAAC,IAAI,CAAC;EACbkB,MAAM,CAAC,qBAAqB,CAAC,GAAG9B,YAAY;EAE5C,MAAMU,QAAQ,GAAG,CAACN,OAAO,EAAG,OAAMU,IAAI,CAACC,SAAS,CAACe,MAAM,EAAE,IAAI,EAAE,CAAC,CAAE,IAAG,CAAC,CAAClB,IAAI,CAAC,IAAI,CAAC;EACjF,MAAMwC,cAAc,GAAG,IAAAnC,eAAO,EAAC,IAAAL,YAAI,EAACiB,SAAS,EAAG,iBAAgB,IAAAX,aAAI,EAACR,QAAQ,CAAE,KAAI,CAAC,CAAC;EAErF,IAAI,CAAC,IAAAU,qBAAU,EAACgC,cAAc,CAAC,EAAE;IAC/B,IAAA/B,yBAAc,EAAC+B,cAAc,EAAE1C,QAAQ,CAAC;EAC1C;EAEA,OAAO0C,cAAc;AACvB"}
|
1
|
+
{"version":3,"names":["_path","data","require","_fsExtra","_interopRequireWildcard","_harmonyModules","_utils","_toolboxPath","_webpack","_interopRequireDefault","_util","_preview","_webpack2","_preBundleUtils","obj","__esModule","default","_getRequireWildcardCache","e","WeakMap","r","t","has","get","n","__proto__","a","Object","defineProperty","getOwnPropertyDescriptor","u","prototype","hasOwnProperty","call","i","set","RUNTIME_NAME","exports","PUBLIC_DIR","join","UIROOT_ASPECT_ID","ENTRY_CONTENT_TEMPLATE","generatePreBundlePreviewEntry","aspectDefs","rootExtensionName","runtimeName","rootAspectId","dir","harmonyImport","createHarmonyImports","imports","createImports","identifiers","getIdentifiers","idSetters","getIdSetters","contents","replace","replaceAll","JSON","stringify","entryPath","resolve","sha1","fs","existsSync","outputFileSync","buildPreBundlePreview","resolvedAspects","customOutputDir","outputDir","mainEntry","PreviewAspect","id","__dirname","config","createWebpackConfig","compiler","webpack","compilerRun","promisify","run","bind","results","Error","hasErrors","clearConsole","toString","generateBundlePreviewEntry","previewPreBundlePath","manifestPath","manifest","readJsonSync","entrypoints","map","entry","toWindowsCompatiblePath","endsWith","previewRuntime"],"sources":["pre-bundle.ts"],"sourcesContent":["import { join, resolve } from 'path';\nimport fs, { existsSync, outputFileSync, readJsonSync } from 'fs-extra';\nimport { AspectDefinition } from '@teambit/aspect-loader';\nimport {\n createHarmonyImports,\n createImports,\n getIdSetters,\n getIdentifiers,\n} from '@teambit/harmony.modules.harmony-root-generator';\nimport { sha1 } from '@teambit/legacy/dist/utils';\nimport { toWindowsCompatiblePath } from '@teambit/toolbox.path.to-windows-compatible-path';\nimport webpack from 'webpack';\nimport { promisify } from 'util';\nimport { PreviewAspect } from './preview.aspect';\nimport { createWebpackConfig } from './webpack/webpack.config';\nimport { clearConsole } from './pre-bundle-utils';\n\nexport const RUNTIME_NAME = 'preview';\nexport const PUBLIC_DIR = join('public', 'bit-preview');\nexport const UIROOT_ASPECT_ID = 'teambit.workspace/workspace';\n\nconst ENTRY_CONTENT_TEMPLATE = `__IMPORTS__\n\nexport const run = (config, customAspects = []) => {\n const isBrowser = typeof window !== \"undefined\";\n const windowConfig = isBrowser ? window.harmonyAppConfig : undefined;\n const mergedConfig = { ...config, ...windowConfig };\n __ID_SETTERS__\n function render(...props) {\n return Harmony.load(\n [\n ...customAspects,\n __IDENTIFIERS__,\n ],\n __RUNTIME_NAME__,\n mergedConfig\n ).then((harmony) => {\n return harmony\n .run()\n .then(() => harmony.get(__ROOT_ASPECT__))\n .then((rootExtension) => {\n const ssrSetup = !isBrowser && rootExtension.setupSsr;\n const setup = rootExtension.setup;\n const setupFunc = (ssrSetup || setup || function noop() {}).bind(\n rootExtension\n );\n return Promise.resolve(setupFunc()).then(\n () => {\n return rootExtension\n }\n );\n })\n .then((rootExtension) => {\n if (isBrowser) {\n return rootExtension.render(\n __ROOT_EXTENSION_NAME__,\n ...props\n );\n } else {\n return rootExtension.renderSsr(\n __ROOT_EXTENSION_NAME__,\n ...props\n );\n }\n })\n .catch((err) => {\n throw err;\n });\n });\n }\n if (isBrowser || __RUNTIME_NAME__ === \"main\") render();\n};\n`;\n\nexport const generatePreBundlePreviewEntry = (\n aspectDefs: AspectDefinition[],\n rootExtensionName: string,\n runtimeName: string,\n rootAspectId: string,\n dir: string\n) => {\n const harmonyImport = createHarmonyImports();\n const imports = createImports(aspectDefs);\n const identifiers = getIdentifiers(aspectDefs, 'Aspect');\n const idSetters = getIdSetters(aspectDefs, 'Aspect');\n const contents = ENTRY_CONTENT_TEMPLATE.replace('__IMPORTS__', [harmonyImport, imports].join('\\n'))\n .replace('__IDENTIFIERS__', identifiers.join(', '))\n .replace('__ID_SETTERS__', idSetters.join('\\n'))\n .replaceAll('__RUNTIME_NAME__', JSON.stringify(runtimeName))\n .replaceAll('__ROOT_ASPECT__', JSON.stringify(rootAspectId))\n .replaceAll('__ROOT_EXTENSION_NAME__', JSON.stringify(rootExtensionName));\n const entryPath = resolve(join(dir, `ui-bundle-entry.${sha1(contents)}.js`));\n if (!fs.existsSync(entryPath)) {\n fs.outputFileSync(entryPath, contents);\n }\n return entryPath;\n};\n\nexport async function buildPreBundlePreview(resolvedAspects: AspectDefinition[], customOutputDir?: string) {\n const outputDir = customOutputDir || resolve(PUBLIC_DIR);\n const mainEntry = generatePreBundlePreviewEntry(\n resolvedAspects,\n UIROOT_ASPECT_ID,\n RUNTIME_NAME,\n PreviewAspect.id,\n __dirname\n );\n const config = createWebpackConfig(outputDir, mainEntry);\n const compiler = webpack(config);\n const compilerRun = promisify(compiler.run.bind(compiler));\n const results = await compilerRun();\n if (!results) throw new Error();\n if (results?.hasErrors()) {\n clearConsole();\n throw new Error(results?.toString());\n }\n return results;\n}\n\nexport async function generateBundlePreviewEntry(rootAspectId: string, previewPreBundlePath: string, config: object) {\n const manifestPath = join(previewPreBundlePath, 'asset-manifest.json');\n const manifest = readJsonSync(manifestPath);\n const imports = manifest.entrypoints\n .map((entry: string) => {\n const entryPath = toWindowsCompatiblePath(join(previewPreBundlePath, entry));\n return entry.endsWith('.js') ? `import { run } from '${entryPath}';` : `import '${entryPath}';`;\n })\n .join('\\n');\n config['teambit.harmony/bit'] = rootAspectId;\n\n const contents = [imports, `run(${JSON.stringify(config, null, 2)});`].join('\\n');\n const previewRuntime = resolve(join(__dirname, `preview.entry.${sha1(contents)}.js`));\n\n if (!existsSync(previewRuntime)) {\n outputFileSync(previewRuntime, contents);\n }\n\n return previewRuntime;\n}\n"],"mappings":";;;;;;;;;AAAA,SAAAA,MAAA;EAAA,MAAAC,IAAA,GAAAC,OAAA;EAAAF,KAAA,YAAAA,CAAA;IAAA,OAAAC,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AACA,SAAAE,SAAA;EAAA,MAAAF,IAAA,GAAAG,uBAAA,CAAAF,OAAA;EAAAC,QAAA,YAAAA,CAAA;IAAA,OAAAF,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AAEA,SAAAI,gBAAA;EAAA,MAAAJ,IAAA,GAAAC,OAAA;EAAAG,eAAA,YAAAA,CAAA;IAAA,OAAAJ,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AAMA,SAAAK,OAAA;EAAA,MAAAL,IAAA,GAAAC,OAAA;EAAAI,MAAA,YAAAA,CAAA;IAAA,OAAAL,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AACA,SAAAM,aAAA;EAAA,MAAAN,IAAA,GAAAC,OAAA;EAAAK,YAAA,YAAAA,CAAA;IAAA,OAAAN,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AACA,SAAAO,SAAA;EAAA,MAAAP,IAAA,GAAAQ,sBAAA,CAAAP,OAAA;EAAAM,QAAA,YAAAA,CAAA;IAAA,OAAAP,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AACA,SAAAS,MAAA;EAAA,MAAAT,IAAA,GAAAC,OAAA;EAAAQ,KAAA,YAAAA,CAAA;IAAA,OAAAT,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AACA,SAAAU,SAAA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EAAG,iBAAgB,IAAAX,aAAI,EAACP,QAAQ,CAAE,KAAI,CAAC,CAAC;EAErF,IAAI,CAAC,IAAAS,qBAAU,EAACiC,cAAc,CAAC,EAAE;IAC/B,IAAAhC,yBAAc,EAACgC,cAAc,EAAE1C,QAAQ,CAAC;EAC1C;EAEA,OAAO0C,cAAc;AACvB"}
|
@@ -1,5 +1,5 @@
|
|
1
|
-
import * as compositions_0 from '/home/circleci/Library/Caches/Bit/capsules/8891be5ad3d35bfc38b9cd90c0e05b598a5a55af/teambit.preview_preview@1.0.
|
2
|
-
import * as overview_0 from '/home/circleci/Library/Caches/Bit/capsules/8891be5ad3d35bfc38b9cd90c0e05b598a5a55af/teambit.preview_preview@1.0.
|
1
|
+
import * as compositions_0 from '/home/circleci/Library/Caches/Bit/capsules/8891be5ad3d35bfc38b9cd90c0e05b598a5a55af/teambit.preview_preview@1.0.135/dist/preview.composition.js';
|
2
|
+
import * as overview_0 from '/home/circleci/Library/Caches/Bit/capsules/8891be5ad3d35bfc38b9cd90c0e05b598a5a55af/teambit.preview_preview@1.0.135/dist/preview.docs.mdx';
|
3
3
|
|
4
4
|
export const compositions = [compositions_0];
|
5
5
|
export const overview = [overview_0];
|
@@ -115,7 +115,7 @@ class ComponentBundlingStrategy {
|
|
115
115
|
// }, {});
|
116
116
|
|
117
117
|
// const modules = await Promise.all(entriesArr.map(async (entry) => {
|
118
|
-
// const dependencies =
|
118
|
+
// const dependencies = this.dependencyResolver.getDependencies(entry.component);
|
119
119
|
// const manifest = dependencies.toDependenciesManifest();
|
120
120
|
// const peer = Object.entries(manifest.peerDependencies || {}).reduce((acc, [packageName, version]) => {
|
121
121
|
// acc[packageName] = {
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"names":["_path","data","require","_fsExtra","_lodash","_builder","_bitError","_generateComponentLink","_exceptions","_defineProperty","obj","key","value","_toPropertyKey","Object","defineProperty","enumerable","configurable","writable","t","i","_toPrimitive","String","r","e","Symbol","toPrimitive","call","TypeError","Number","PREVIEW_CHUNK_SUFFIX","exports","COMPONENT_CHUNK_SUFFIX","PREVIEW_CHUNK_FILENAME_SUFFIX","COMPONENT_CHUNK_FILENAME_SUFFIX","COMPONENT_STRATEGY_SIZE_KEY_NAME","COMPONENT_STRATEGY_ARTIFACT_NAME","ComponentBundlingStrategy","constructor","preview","pkg","dependencyResolver","computeTargets","context","previewDefs","outputPath","getOutputPath","existsSync","mkdirpSync","origComponents","capsuleNetwork","originalSeedersCapsules","map","capsule","component","entriesArr","Promise","all","computeComponentEntry","chunkSize","config","maxChunkSize","chunks","chunk","peers","getPreviewHostDependenciesFromEnv","envDefinition","env","targets","currentChunk","entries","components","forEach","entry","assign","push","hostRootDir","envRuntime","envAspectDefinition","aspectPath","hostDependencies","aliasHostDependencies","externalizeHostDependencies","componentPreviewPath","computePaths","componentPath","getPaths","mainFile","componentPreview","getComponentChunkId","id","splitComponentBundle","toStringWithoutVersion","undefined","filename","getComponentChunkFileName","toString","fsCompatible","ignoreVersion","import","dependOn","library","name","type","componentId","idstr","suffix","getAssetAbsolutePath","asset","path","join","getAssetFilename","split","copyAssetsToCapsules","result","graphCapsules","getCapsule","files","findAssetsForComponent","assets","entriesAssetsMap","artifactDirFullPath","getArtifactDirectory","filePath","PreviewOutputFileNotFound","destFilePath","dirname","fs","copyFileSync","componentEntryId","componentPreviewEntryId","componentFiles","componentAuxiliaryFiles","auxiliaryAssets","componentPreviewFiles","componentPreviewAuxiliaryFiles","concat","CAPSULE_ARTIFACTS_DIR","computeComponentMetadata","file","basename","size","compressedSize","filesTotalSize","assetsSize","compressedTotalFiles","compressedAssetsSize","assetsTotalSize","auxiliaryAssetsSize","compressedTotalAssets","compressedAuxiliaryAssetsSize","totalSize","compressedTotal","metadata","totalFiles","totalAssets","total","computeResults","results","componentsResults","flatten","computeTargetResult","artifacts","getArtifactDef","isEmpty","errors","err","message","warning","warnings","startTime","endTime","globPatterns","rootDir","getDirName","envName","replace","resolve","capsulesRootDir","compiler","getCompiler","getDistPathBySrcPath","relative","getComponentOutputPath","capsulePath","distDir","getDistDir","defs","BitError","moduleMapsPromise","previewDef","moduleMap","getModuleMap","getMetadata","maybeFiles","get","prefix","paths","compiledPaths","moduleMaps","contents","generateComponentLink","targetDir","writeLinkContents"],"sources":["component-strategy.ts"],"sourcesContent":["import { join, resolve, basename, dirname } from 'path';\nimport { existsSync, mkdirpSync } from 'fs-extra';\nimport { Component } from '@teambit/component';\nimport { ComponentID } from '@teambit/component-id';\nimport { flatten, isEmpty, chunk } from 'lodash';\nimport { Compiler } from '@teambit/compiler';\nimport type { AbstractVinyl } from '@teambit/legacy/dist/consumer/component/sources';\nimport type { Capsule } from '@teambit/isolator';\nimport { CAPSULE_ARTIFACTS_DIR, ComponentResult } from '@teambit/builder';\nimport type { PkgMain } from '@teambit/pkg';\nimport { BitError } from '@teambit/bit-error';\nimport type { DependencyResolverMain } from '@teambit/dependency-resolver';\nimport type { BundlerResult, BundlerContext, Asset, BundlerEntryMap, EntriesAssetsMap, Target } from '@teambit/bundler';\nimport { BundlingStrategy, ComputeTargetsContext } from '../bundling-strategy';\nimport type { PreviewDefinition } from '../preview-definition';\nimport type { ComponentPreviewMetaData, PreviewMain } from '../preview.main.runtime';\nimport { generateComponentLink } from './generate-component-link';\nimport { PreviewOutputFileNotFound } from '../exceptions';\n\nexport const PREVIEW_CHUNK_SUFFIX = 'preview';\nexport const COMPONENT_CHUNK_SUFFIX = 'component';\nexport const PREVIEW_CHUNK_FILENAME_SUFFIX = `${PREVIEW_CHUNK_SUFFIX}.js`;\nexport const COMPONENT_CHUNK_FILENAME_SUFFIX = `${COMPONENT_CHUNK_SUFFIX}.js`;\n\nexport const COMPONENT_STRATEGY_SIZE_KEY_NAME = 'size';\nexport const COMPONENT_STRATEGY_ARTIFACT_NAME = 'preview-component';\n\ntype ComponentEntry = {\n component: Component;\n entries: Object;\n};\n/**\n * bundles all components in a given env into the same bundle.\n */\nexport class ComponentBundlingStrategy implements BundlingStrategy {\n name = 'component';\n\n constructor(private preview: PreviewMain, private pkg: PkgMain, private dependencyResolver: DependencyResolverMain) {}\n\n async computeTargets(context: ComputeTargetsContext, previewDefs: PreviewDefinition[]): Promise<Target[]> {\n const outputPath = this.getOutputPath(context);\n if (!existsSync(outputPath)) mkdirpSync(outputPath);\n\n // const entriesArr = flatten(\n // await Promise.all(\n // context.capsuleNetwork.seedersCapsules.map((capsule) => {\n // return this.computeComponentEntry(previewDefs, capsule.component, context);\n // }, {})\n // )\n // );\n\n const origComponents = context.capsuleNetwork.originalSeedersCapsules.map((capsule) => capsule.component);\n\n const entriesArr = await Promise.all(\n origComponents.map((component) => {\n return this.computeComponentEntry(previewDefs, component, context);\n }, {})\n );\n\n const chunkSize = this.preview.config.maxChunkSize;\n\n const chunks = chunkSize ? chunk(entriesArr, chunkSize) : [entriesArr];\n\n const peers = await this.dependencyResolver.getPreviewHostDependenciesFromEnv(context.envDefinition.env);\n\n const targets = chunks.map((currentChunk) => {\n const entries: BundlerEntryMap = {};\n const components: Component[] = [];\n currentChunk.forEach((entry) => {\n Object.assign(entries, entry.entries);\n components.push(entry.component);\n });\n\n return {\n entries,\n components,\n outputPath,\n hostRootDir: context.envRuntime.envAspectDefinition.aspectPath,\n hostDependencies: peers,\n aliasHostDependencies: true,\n externalizeHostDependencies: true,\n };\n });\n\n return targets;\n // const entries = entriesArr.reduce((entriesMap, entry) => {\n // entriesMap[entry.library.name] = entry;\n // return entriesMap;\n // }, {});\n\n // const modules = await Promise.all(entriesArr.map(async (entry) => {\n // const dependencies = await this.dependencyResolver.getDependencies(entry.component);\n // const manifest = dependencies.toDependenciesManifest();\n // const peer = Object.entries(manifest.peerDependencies || {}).reduce((acc, [packageName, version]) => {\n // acc[packageName] = {\n // singleton: true,\n // requiredVersion: version\n // };\n\n // return acc;\n // }, {});\n // // console.log(entry);\n // return {\n // name: entry.library.name,\n // exposes: {\n // '.': entry.import || ''\n // },\n // shared: {\n // ...manifest.dependencies,\n // ...peer\n // },\n // };\n // }));\n }\n\n async computeComponentEntry(\n previewDefs: PreviewDefinition[],\n component: Component,\n context: ComputeTargetsContext\n ): Promise<ComponentEntry> {\n const componentPreviewPath = await this.computePaths(previewDefs, context, component);\n const [componentPath] = this.getPaths(context, component, [component.mainFile]);\n\n const chunks = {\n componentPreview: this.getComponentChunkId(component.id, 'preview'),\n component: context.splitComponentBundle ? component.id.toStringWithoutVersion() : undefined,\n };\n\n const entries = {\n [chunks.componentPreview]: {\n filename: this.getComponentChunkFileName(\n component.id.toString({\n fsCompatible: true,\n ignoreVersion: true,\n }),\n 'preview'\n ),\n import: componentPreviewPath,\n dependOn: chunks.component,\n library: { name: chunks.componentPreview, type: 'umd' },\n },\n };\n\n if (chunks.component) {\n entries[chunks.component] = {\n filename: this.getComponentChunkFileName(\n component.id.toString({\n fsCompatible: true,\n ignoreVersion: true,\n }),\n 'component'\n ),\n dependOn: undefined,\n import: componentPath,\n library: { name: chunks.component, type: 'umd' },\n };\n }\n\n return { component, entries };\n }\n\n private getComponentChunkId(componentId: ComponentID, type: 'component' | 'preview') {\n const id =\n type === 'component'\n ? componentId.toStringWithoutVersion()\n : `${componentId.toStringWithoutVersion()}-${PREVIEW_CHUNK_SUFFIX}`;\n return id;\n }\n\n private getComponentChunkFileName(idstr: string, type: 'component' | 'preview') {\n const suffix = type === 'component' ? COMPONENT_CHUNK_FILENAME_SUFFIX : PREVIEW_CHUNK_FILENAME_SUFFIX;\n return `${idstr}-${suffix}`;\n }\n\n private getAssetAbsolutePath(context: BundlerContext, asset: Asset): string {\n const path = this.getOutputPath(context);\n return join(path, 'public', this.getAssetFilename(asset));\n }\n\n private getAssetFilename(asset: Asset): string {\n // handle cases where the asset name is something like my-image.svg?hash (while the filename in the fs is just my-image.svg)\n const [name] = asset.name.split('?');\n return name;\n }\n\n copyAssetsToCapsules(context: BundlerContext, result: BundlerResult) {\n context.components.forEach((component) => {\n const capsule = context.capsuleNetwork.graphCapsules.getCapsule(component.id);\n if (!capsule) return;\n const files = this.findAssetsForComponent(component, result.assets, result.entriesAssetsMap || {});\n if (!files) return;\n const artifactDirFullPath = join(capsule.path, this.getArtifactDirectory());\n // We don't use the mkdirSync as it uses the capsule fs which uses memfs, which doesn't know to handle nested none existing folders\n mkdirpSync(artifactDirFullPath);\n\n files.forEach((asset) => {\n const filePath = this.getAssetAbsolutePath(context, asset);\n if (!existsSync(filePath)) {\n throw new PreviewOutputFileNotFound(component.id, filePath);\n }\n const destFilePath = join(artifactDirFullPath, this.getAssetFilename(asset));\n mkdirpSync(dirname(destFilePath));\n capsule.fs.copyFileSync(filePath, destFilePath);\n });\n });\n }\n\n // private getCssFileName(componentId: ComponentID): string {\n // return `${componentId.toString({ ignoreVersion: true, fsCompatible: true })}.css`;\n // }\n\n private findAssetsForComponent(\n component: Component,\n assets: Asset[],\n entriesAssetsMap: EntriesAssetsMap\n ): Asset[] | undefined {\n if (!assets) return undefined;\n\n const componentEntryId = component.id.toStringWithoutVersion();\n const componentPreviewEntryId = this.getComponentChunkId(component.id, 'preview');\n const componentFiles = entriesAssetsMap[componentEntryId]?.assets || [];\n const componentAuxiliaryFiles = entriesAssetsMap[componentEntryId]?.auxiliaryAssets || [];\n const componentPreviewFiles = entriesAssetsMap[componentPreviewEntryId]?.assets || [];\n const componentPreviewAuxiliaryFiles = entriesAssetsMap[componentPreviewEntryId]?.auxiliaryAssets || [];\n\n const files = componentFiles\n .concat(componentAuxiliaryFiles)\n .concat(componentPreviewFiles)\n .concat(componentPreviewAuxiliaryFiles);\n return files;\n }\n\n private getArtifactDirectory() {\n return join(CAPSULE_ARTIFACTS_DIR, 'preview');\n }\n\n private computeComponentMetadata(\n context: BundlerContext,\n result: BundlerResult,\n component: Component\n ): ComponentPreviewMetaData {\n const componentEntryId = component.id.toStringWithoutVersion();\n if (!result?.entriesAssetsMap || !result?.entriesAssetsMap[componentEntryId]) {\n return {};\n }\n const files = (result.entriesAssetsMap[componentEntryId]?.assets || []).map((file) => {\n return {\n name: basename(file.name),\n size: file.size,\n compressedSize: file.compressedSize,\n };\n });\n const filesTotalSize = result.entriesAssetsMap[componentEntryId]?.assetsSize || 0;\n const compressedTotalFiles = result.entriesAssetsMap[componentEntryId]?.compressedAssetsSize || 0;\n const assets = (result.entriesAssetsMap[componentEntryId]?.auxiliaryAssets || []).map((file) => {\n return {\n name: basename(file.name),\n size: file.size,\n compressedSize: file.compressedSize,\n };\n });\n const assetsTotalSize = result.entriesAssetsMap[componentEntryId]?.auxiliaryAssetsSize || 0;\n const compressedTotalAssets = result.entriesAssetsMap[componentEntryId]?.compressedAuxiliaryAssetsSize || 0;\n const totalSize = filesTotalSize + assetsTotalSize;\n const compressedTotal = compressedTotalFiles + compressedTotalAssets;\n\n const metadata = {\n [COMPONENT_STRATEGY_SIZE_KEY_NAME]: {\n files,\n assets,\n totalFiles: filesTotalSize,\n totalAssets: assetsTotalSize,\n total: totalSize,\n compressedTotalFiles,\n compressedTotalAssets,\n compressedTotal,\n },\n };\n\n return metadata;\n }\n\n async computeResults(context: BundlerContext, results: BundlerResult[]) {\n const componentsResults = flatten(\n await Promise.all(results.map((result) => this.computeTargetResult(context, result)))\n );\n\n const artifacts = this.getArtifactDef();\n\n return {\n componentsResults,\n artifacts,\n };\n }\n\n async computeTargetResult(context: BundlerContext, result: BundlerResult) {\n if (isEmpty(result.errors)) {\n // In case there are errors files will not be emitted so trying to copy them will fail anyway\n this.copyAssetsToCapsules(context, result);\n }\n\n const componentsResults: ComponentResult[] = result.components.map((component) => {\n const metadata = this.computeComponentMetadata(context, result, component);\n return {\n component,\n metadata,\n errors: result.errors.map((err) => (typeof err === 'string' ? err : err.message)),\n warning: result.warnings,\n startTime: result.startTime,\n endTime: result.endTime,\n };\n });\n\n return componentsResults;\n }\n\n private getArtifactDef() {\n // eslint-disable-next-line @typescript-eslint/prefer-as-const\n // const env: 'env' = 'env';\n // const rootDir = this.getDirName(context);\n\n return [\n {\n name: COMPONENT_STRATEGY_ARTIFACT_NAME,\n globPatterns: ['**'],\n rootDir: this.getArtifactDirectory(),\n // context: env,\n },\n ];\n }\n\n getDirName(context: ComputeTargetsContext) {\n const envName = context.id.replace('/', '__');\n return `${envName}-preview`;\n }\n\n private getOutputPath(context: ComputeTargetsContext) {\n return resolve(`${context.capsuleNetwork.capsulesRootDir}/${this.getDirName(context)}`);\n }\n\n private getPaths(context: ComputeTargetsContext, component: Component, files: AbstractVinyl[]) {\n const capsule = context.capsuleNetwork.graphCapsules.getCapsule(component.id);\n if (!capsule) return [];\n const compiler: Compiler = context.env.getCompiler();\n return files.map((file) => join(capsule.path, compiler.getDistPathBySrcPath(file.relative)));\n }\n\n private getComponentOutputPath(capsule: Capsule, context: ComputeTargetsContext) {\n const capsulePath = resolve(`${capsule.path}`);\n const compiler: Compiler = context.env.getCompiler();\n const distDir = compiler.getDistDir?.() || 'dist';\n return join(capsulePath, distDir);\n }\n\n private async computePaths(\n defs: PreviewDefinition[],\n context: ComputeTargetsContext,\n component: Component\n ): Promise<string> {\n // const previewMain = await this.preview.writePreviewRuntime(context);\n const capsule = context.capsuleNetwork.graphCapsules.getCapsule(component.id);\n // if (!capsule) return undefined;\n if (!capsule)\n throw new BitError(\n `could not find capsule for component ${component.id.toString()} during compute paths to bundle`\n );\n const moduleMapsPromise = defs.map(async (previewDef) => {\n const moduleMap = await previewDef.getModuleMap([component]);\n const metadata = previewDef.getMetadata ? await previewDef.getMetadata(component) : undefined;\n const maybeFiles = moduleMap.get(component);\n if (!maybeFiles || !capsule) return { prefix: previewDef.prefix, paths: [] };\n\n const [, files] = maybeFiles;\n const compiledPaths = this.getPaths(context, component, files);\n\n return {\n prefix: previewDef.prefix,\n paths: compiledPaths,\n metadata,\n };\n });\n\n const moduleMaps = await Promise.all(moduleMapsPromise);\n\n const contents = generateComponentLink(moduleMaps);\n const targetDir = this.getComponentOutputPath(capsule, context);\n\n return this.preview.writeLinkContents(contents, targetDir, 'preview');\n }\n}\n"],"mappings":";;;;;;AAAA,SAAAA,MAAA;EAAA,MAAAC,IAAA,GAAAC,OAAA;EAAAF,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A,yBAAA"}
|
1
|
+
{"version":3,"names":["_path","data","require","_fsExtra","_lodash","_builder","_bitError","_generateComponentLink","_exceptions","_defineProperty","obj","key","value","_toPropertyKey","Object","defineProperty","enumerable","configurable","writable","t","i","_toPrimitive","String","r","e","Symbol","toPrimitive","call","TypeError","Number","PREVIEW_CHUNK_SUFFIX","exports","COMPONENT_CHUNK_SUFFIX","PREVIEW_CHUNK_FILENAME_SUFFIX","COMPONENT_CHUNK_FILENAME_SUFFIX","COMPONENT_STRATEGY_SIZE_KEY_NAME","COMPONENT_STRATEGY_ARTIFACT_NAME","ComponentBundlingStrategy","constructor","preview","pkg","dependencyResolver","computeTargets","context","previewDefs","outputPath","getOutputPath","existsSync","mkdirpSync","origComponents","capsuleNetwork","originalSeedersCapsules","map","capsule","component","entriesArr","Promise","all","computeComponentEntry","chunkSize","config","maxChunkSize","chunks","chunk","peers","getPreviewHostDependenciesFromEnv","envDefinition","env","targets","currentChunk","entries","components","forEach","entry","assign","push","hostRootDir","envRuntime","envAspectDefinition","aspectPath","hostDependencies","aliasHostDependencies","externalizeHostDependencies","componentPreviewPath","computePaths","componentPath","getPaths","mainFile","componentPreview","getComponentChunkId","id","splitComponentBundle","toStringWithoutVersion","undefined","filename","getComponentChunkFileName","toString","fsCompatible","ignoreVersion","import","dependOn","library","name","type","componentId","idstr","suffix","getAssetAbsolutePath","asset","path","join","getAssetFilename","split","copyAssetsToCapsules","result","graphCapsules","getCapsule","files","findAssetsForComponent","assets","entriesAssetsMap","artifactDirFullPath","getArtifactDirectory","filePath","PreviewOutputFileNotFound","destFilePath","dirname","fs","copyFileSync","componentEntryId","componentPreviewEntryId","componentFiles","componentAuxiliaryFiles","auxiliaryAssets","componentPreviewFiles","componentPreviewAuxiliaryFiles","concat","CAPSULE_ARTIFACTS_DIR","computeComponentMetadata","file","basename","size","compressedSize","filesTotalSize","assetsSize","compressedTotalFiles","compressedAssetsSize","assetsTotalSize","auxiliaryAssetsSize","compressedTotalAssets","compressedAuxiliaryAssetsSize","totalSize","compressedTotal","metadata","totalFiles","totalAssets","total","computeResults","results","componentsResults","flatten","computeTargetResult","artifacts","getArtifactDef","isEmpty","errors","err","message","warning","warnings","startTime","endTime","globPatterns","rootDir","getDirName","envName","replace","resolve","capsulesRootDir","compiler","getCompiler","getDistPathBySrcPath","relative","getComponentOutputPath","capsulePath","distDir","getDistDir","defs","BitError","moduleMapsPromise","previewDef","moduleMap","getModuleMap","getMetadata","maybeFiles","get","prefix","paths","compiledPaths","moduleMaps","contents","generateComponentLink","targetDir","writeLinkContents"],"sources":["component-strategy.ts"],"sourcesContent":["import { join, resolve, basename, dirname } from 'path';\nimport { existsSync, mkdirpSync } from 'fs-extra';\nimport { Component } from '@teambit/component';\nimport { ComponentID } from '@teambit/component-id';\nimport { flatten, isEmpty, chunk } from 'lodash';\nimport { Compiler } from '@teambit/compiler';\nimport type { AbstractVinyl } from '@teambit/legacy/dist/consumer/component/sources';\nimport type { Capsule } from '@teambit/isolator';\nimport { CAPSULE_ARTIFACTS_DIR, ComponentResult } from '@teambit/builder';\nimport type { PkgMain } from '@teambit/pkg';\nimport { BitError } from '@teambit/bit-error';\nimport type { DependencyResolverMain } from '@teambit/dependency-resolver';\nimport type { BundlerResult, BundlerContext, Asset, BundlerEntryMap, EntriesAssetsMap, Target } from '@teambit/bundler';\nimport { BundlingStrategy, ComputeTargetsContext } from '../bundling-strategy';\nimport type { PreviewDefinition } from '../preview-definition';\nimport type { ComponentPreviewMetaData, PreviewMain } from '../preview.main.runtime';\nimport { generateComponentLink } from './generate-component-link';\nimport { PreviewOutputFileNotFound } from '../exceptions';\n\nexport const PREVIEW_CHUNK_SUFFIX = 'preview';\nexport const COMPONENT_CHUNK_SUFFIX = 'component';\nexport const PREVIEW_CHUNK_FILENAME_SUFFIX = `${PREVIEW_CHUNK_SUFFIX}.js`;\nexport const COMPONENT_CHUNK_FILENAME_SUFFIX = `${COMPONENT_CHUNK_SUFFIX}.js`;\n\nexport const COMPONENT_STRATEGY_SIZE_KEY_NAME = 'size';\nexport const COMPONENT_STRATEGY_ARTIFACT_NAME = 'preview-component';\n\ntype ComponentEntry = {\n component: Component;\n entries: Object;\n};\n/**\n * bundles all components in a given env into the same bundle.\n */\nexport class ComponentBundlingStrategy implements BundlingStrategy {\n name = 'component';\n\n constructor(private preview: PreviewMain, private pkg: PkgMain, private dependencyResolver: DependencyResolverMain) {}\n\n async computeTargets(context: ComputeTargetsContext, previewDefs: PreviewDefinition[]): Promise<Target[]> {\n const outputPath = this.getOutputPath(context);\n if (!existsSync(outputPath)) mkdirpSync(outputPath);\n\n // const entriesArr = flatten(\n // await Promise.all(\n // context.capsuleNetwork.seedersCapsules.map((capsule) => {\n // return this.computeComponentEntry(previewDefs, capsule.component, context);\n // }, {})\n // )\n // );\n\n const origComponents = context.capsuleNetwork.originalSeedersCapsules.map((capsule) => capsule.component);\n\n const entriesArr = await Promise.all(\n origComponents.map((component) => {\n return this.computeComponentEntry(previewDefs, component, context);\n }, {})\n );\n\n const chunkSize = this.preview.config.maxChunkSize;\n\n const chunks = chunkSize ? chunk(entriesArr, chunkSize) : [entriesArr];\n\n const peers = await this.dependencyResolver.getPreviewHostDependenciesFromEnv(context.envDefinition.env);\n\n const targets = chunks.map((currentChunk) => {\n const entries: BundlerEntryMap = {};\n const components: Component[] = [];\n currentChunk.forEach((entry) => {\n Object.assign(entries, entry.entries);\n components.push(entry.component);\n });\n\n return {\n entries,\n components,\n outputPath,\n hostRootDir: context.envRuntime.envAspectDefinition.aspectPath,\n hostDependencies: peers,\n aliasHostDependencies: true,\n externalizeHostDependencies: true,\n };\n });\n\n return targets;\n // const entries = entriesArr.reduce((entriesMap, entry) => {\n // entriesMap[entry.library.name] = entry;\n // return entriesMap;\n // }, {});\n\n // const modules = await Promise.all(entriesArr.map(async (entry) => {\n // const dependencies = this.dependencyResolver.getDependencies(entry.component);\n // const manifest = dependencies.toDependenciesManifest();\n // const peer = Object.entries(manifest.peerDependencies || {}).reduce((acc, [packageName, version]) => {\n // acc[packageName] = {\n // singleton: true,\n // requiredVersion: version\n // };\n\n // return acc;\n // }, {});\n // // console.log(entry);\n // return {\n // name: entry.library.name,\n // exposes: {\n // '.': entry.import || ''\n // },\n // shared: {\n // ...manifest.dependencies,\n // ...peer\n // },\n // };\n // }));\n }\n\n async computeComponentEntry(\n previewDefs: PreviewDefinition[],\n component: Component,\n context: ComputeTargetsContext\n ): Promise<ComponentEntry> {\n const componentPreviewPath = await this.computePaths(previewDefs, context, component);\n const [componentPath] = this.getPaths(context, component, [component.mainFile]);\n\n const chunks = {\n componentPreview: this.getComponentChunkId(component.id, 'preview'),\n component: context.splitComponentBundle ? component.id.toStringWithoutVersion() : undefined,\n };\n\n const entries = {\n [chunks.componentPreview]: {\n filename: this.getComponentChunkFileName(\n component.id.toString({\n fsCompatible: true,\n ignoreVersion: true,\n }),\n 'preview'\n ),\n import: componentPreviewPath,\n dependOn: chunks.component,\n library: { name: chunks.componentPreview, type: 'umd' },\n },\n };\n\n if (chunks.component) {\n entries[chunks.component] = {\n filename: this.getComponentChunkFileName(\n component.id.toString({\n fsCompatible: true,\n ignoreVersion: true,\n }),\n 'component'\n ),\n dependOn: undefined,\n import: componentPath,\n library: { name: chunks.component, type: 'umd' },\n };\n }\n\n return { component, entries };\n }\n\n private getComponentChunkId(componentId: ComponentID, type: 'component' | 'preview') {\n const id =\n type === 'component'\n ? componentId.toStringWithoutVersion()\n : `${componentId.toStringWithoutVersion()}-${PREVIEW_CHUNK_SUFFIX}`;\n return id;\n }\n\n private getComponentChunkFileName(idstr: string, type: 'component' | 'preview') {\n const suffix = type === 'component' ? COMPONENT_CHUNK_FILENAME_SUFFIX : PREVIEW_CHUNK_FILENAME_SUFFIX;\n return `${idstr}-${suffix}`;\n }\n\n private getAssetAbsolutePath(context: BundlerContext, asset: Asset): string {\n const path = this.getOutputPath(context);\n return join(path, 'public', this.getAssetFilename(asset));\n }\n\n private getAssetFilename(asset: Asset): string {\n // handle cases where the asset name is something like my-image.svg?hash (while the filename in the fs is just my-image.svg)\n const [name] = asset.name.split('?');\n return name;\n }\n\n copyAssetsToCapsules(context: BundlerContext, result: BundlerResult) {\n context.components.forEach((component) => {\n const capsule = context.capsuleNetwork.graphCapsules.getCapsule(component.id);\n if (!capsule) return;\n const files = this.findAssetsForComponent(component, result.assets, result.entriesAssetsMap || {});\n if (!files) return;\n const artifactDirFullPath = join(capsule.path, this.getArtifactDirectory());\n // We don't use the mkdirSync as it uses the capsule fs which uses memfs, which doesn't know to handle nested none existing folders\n mkdirpSync(artifactDirFullPath);\n\n files.forEach((asset) => {\n const filePath = this.getAssetAbsolutePath(context, asset);\n if (!existsSync(filePath)) {\n throw new PreviewOutputFileNotFound(component.id, filePath);\n }\n const destFilePath = join(artifactDirFullPath, this.getAssetFilename(asset));\n mkdirpSync(dirname(destFilePath));\n capsule.fs.copyFileSync(filePath, destFilePath);\n });\n });\n }\n\n // private getCssFileName(componentId: ComponentID): string {\n // return `${componentId.toString({ ignoreVersion: true, fsCompatible: true })}.css`;\n // }\n\n private findAssetsForComponent(\n component: Component,\n assets: Asset[],\n entriesAssetsMap: EntriesAssetsMap\n ): Asset[] | undefined {\n if (!assets) return undefined;\n\n const componentEntryId = component.id.toStringWithoutVersion();\n const componentPreviewEntryId = this.getComponentChunkId(component.id, 'preview');\n const componentFiles = entriesAssetsMap[componentEntryId]?.assets || [];\n const componentAuxiliaryFiles = entriesAssetsMap[componentEntryId]?.auxiliaryAssets || [];\n const componentPreviewFiles = entriesAssetsMap[componentPreviewEntryId]?.assets || [];\n const componentPreviewAuxiliaryFiles = entriesAssetsMap[componentPreviewEntryId]?.auxiliaryAssets || [];\n\n const files = componentFiles\n .concat(componentAuxiliaryFiles)\n .concat(componentPreviewFiles)\n .concat(componentPreviewAuxiliaryFiles);\n return files;\n }\n\n private getArtifactDirectory() {\n return join(CAPSULE_ARTIFACTS_DIR, 'preview');\n }\n\n private computeComponentMetadata(\n context: BundlerContext,\n result: BundlerResult,\n component: Component\n ): ComponentPreviewMetaData {\n const componentEntryId = component.id.toStringWithoutVersion();\n if (!result?.entriesAssetsMap || !result?.entriesAssetsMap[componentEntryId]) {\n return {};\n }\n const files = (result.entriesAssetsMap[componentEntryId]?.assets || []).map((file) => {\n return {\n name: basename(file.name),\n size: file.size,\n compressedSize: file.compressedSize,\n };\n });\n const filesTotalSize = result.entriesAssetsMap[componentEntryId]?.assetsSize || 0;\n const compressedTotalFiles = result.entriesAssetsMap[componentEntryId]?.compressedAssetsSize || 0;\n const assets = (result.entriesAssetsMap[componentEntryId]?.auxiliaryAssets || []).map((file) => {\n return {\n name: basename(file.name),\n size: file.size,\n compressedSize: file.compressedSize,\n };\n });\n const assetsTotalSize = result.entriesAssetsMap[componentEntryId]?.auxiliaryAssetsSize || 0;\n const compressedTotalAssets = result.entriesAssetsMap[componentEntryId]?.compressedAuxiliaryAssetsSize || 0;\n const totalSize = filesTotalSize + assetsTotalSize;\n const compressedTotal = compressedTotalFiles + compressedTotalAssets;\n\n const metadata = {\n [COMPONENT_STRATEGY_SIZE_KEY_NAME]: {\n files,\n assets,\n totalFiles: filesTotalSize,\n totalAssets: assetsTotalSize,\n total: totalSize,\n compressedTotalFiles,\n compressedTotalAssets,\n compressedTotal,\n },\n };\n\n return metadata;\n }\n\n async computeResults(context: BundlerContext, results: BundlerResult[]) {\n const componentsResults = flatten(\n await Promise.all(results.map((result) => this.computeTargetResult(context, result)))\n );\n\n const artifacts = this.getArtifactDef();\n\n return {\n componentsResults,\n artifacts,\n };\n }\n\n async computeTargetResult(context: BundlerContext, result: BundlerResult) {\n if (isEmpty(result.errors)) {\n // In case there are errors files will not be emitted so trying to copy them will fail anyway\n this.copyAssetsToCapsules(context, result);\n }\n\n const componentsResults: ComponentResult[] = result.components.map((component) => {\n const metadata = this.computeComponentMetadata(context, result, component);\n return {\n component,\n metadata,\n errors: result.errors.map((err) => (typeof err === 'string' ? err : err.message)),\n warning: result.warnings,\n startTime: result.startTime,\n endTime: result.endTime,\n };\n });\n\n return componentsResults;\n }\n\n private getArtifactDef() {\n // eslint-disable-next-line @typescript-eslint/prefer-as-const\n // const env: 'env' = 'env';\n // const rootDir = this.getDirName(context);\n\n return [\n {\n name: COMPONENT_STRATEGY_ARTIFACT_NAME,\n globPatterns: ['**'],\n rootDir: this.getArtifactDirectory(),\n // context: env,\n },\n ];\n }\n\n getDirName(context: ComputeTargetsContext) {\n const envName = context.id.replace('/', '__');\n return `${envName}-preview`;\n }\n\n private getOutputPath(context: ComputeTargetsContext) {\n return resolve(`${context.capsuleNetwork.capsulesRootDir}/${this.getDirName(context)}`);\n }\n\n private getPaths(context: ComputeTargetsContext, component: Component, files: AbstractVinyl[]) {\n const capsule = context.capsuleNetwork.graphCapsules.getCapsule(component.id);\n if (!capsule) return [];\n const compiler: Compiler = context.env.getCompiler();\n return files.map((file) => join(capsule.path, compiler.getDistPathBySrcPath(file.relative)));\n }\n\n private getComponentOutputPath(capsule: Capsule, context: ComputeTargetsContext) {\n const capsulePath = resolve(`${capsule.path}`);\n const compiler: Compiler = context.env.getCompiler();\n const distDir = compiler.getDistDir?.() || 'dist';\n return join(capsulePath, distDir);\n }\n\n private async computePaths(\n defs: PreviewDefinition[],\n context: ComputeTargetsContext,\n component: Component\n ): Promise<string> {\n // const previewMain = await this.preview.writePreviewRuntime(context);\n const capsule = context.capsuleNetwork.graphCapsules.getCapsule(component.id);\n // if (!capsule) return undefined;\n if (!capsule)\n throw new BitError(\n `could not find capsule for component ${component.id.toString()} during compute paths to bundle`\n );\n const moduleMapsPromise = defs.map(async (previewDef) => {\n const moduleMap = await previewDef.getModuleMap([component]);\n const metadata = previewDef.getMetadata ? await previewDef.getMetadata(component) : undefined;\n const maybeFiles = moduleMap.get(component);\n if (!maybeFiles || !capsule) return { prefix: previewDef.prefix, paths: [] };\n\n const [, files] = maybeFiles;\n const compiledPaths = this.getPaths(context, component, files);\n\n return {\n prefix: previewDef.prefix,\n paths: compiledPaths,\n metadata,\n };\n });\n\n const moduleMaps = await Promise.all(moduleMapsPromise);\n\n const contents = generateComponentLink(moduleMaps);\n const targetDir = this.getComponentOutputPath(capsule, context);\n\n return this.preview.writeLinkContents(contents, targetDir, 'preview');\n }\n}\n"],"mappings":";;;;;;AAAA,SAAAA,MAAA;EAAA,MAAAC,IAAA,GAAAC,OAAA;EAAAF,KAAA,YAAAA,CAAA;IAAA,OAAAC,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AACA,SAAAE,SAAA;EAAA,MAAAF,IAAA,GAAAC,OAAA;EAAAC,QAAA,YAAAA,CAAA;IAAA,OAAAF,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AAGA,SAAAG,QAAA;EAAA,MAAAH,IAAA,GAAAC,OAAA;EAAAE,OAAA,YAAAA,CAAA;IAAA,OAAAH,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AAIA,SAAAI,SAAA;EAAA,MAAAJ,IAAA,GAAAC,OAAA;EAAAG,QAAA,YAAAA,CAAA;IAAA,OAAAJ,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AAEA,SAAAK,UAAA;EAAA,MAAAL,IAAA,GAAAC,OAAA;EAAAI,SAAA,YAAAA,CAAA;IAAA,OAAAL,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AAMA,SAAAM,uBAAA;EAAA,MAAAN,IAAA,GAAAC,OAAA;EAAAK,sBAAA,YAAAA,CAAA;IAAA,OAAAN,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AACA,SAAAO,YAAA;EAAA,MAAAP,IAAA,GAAAC,OAAA;EAAAM,WAAA,YAAAA,CAAA;IAAA,OAAAP,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AAA0D,SAAAQ,gBAAAC,GAAA,EAAAC,GAAA,EAAAC,KAAA,IAAAD,GAAA,GAAAE,cAAA,CAAAF,GAAA,OAAAA,GAAA,IAAAD,GAAA,IAAAI,MAAA,CAAAC,cAAA,CAAAL,GAAA,EAAAC,GAAA,IAAAC,KAAA,EAAAA,KAAA,EAA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nB,sBAAsB,CAAClI,OAAO,EAAEV,OAAO,CAAC;IAE/D,OAAO,IAAI,CAACJ,OAAO,CAACoK,iBAAiB,CAACH,QAAQ,EAAEE,SAAS,EAAE,SAAS,CAAC;EACvE;AACF;AAAC3K,OAAA,CAAAM,yBAAA,GAAAA,yBAAA"}
|
package/package.json
CHANGED
@@ -1,12 +1,12 @@
|
|
1
1
|
{
|
2
2
|
"name": "@teambit/preview",
|
3
|
-
"version": "1.0.
|
3
|
+
"version": "1.0.135",
|
4
4
|
"homepage": "https://bit.cloud/teambit/preview/preview",
|
5
5
|
"main": "dist/index.js",
|
6
6
|
"componentId": {
|
7
7
|
"scope": "teambit.preview",
|
8
8
|
"name": "preview",
|
9
|
-
"version": "1.0.
|
9
|
+
"version": "1.0.135"
|
10
10
|
},
|
11
11
|
"dependencies": {
|
12
12
|
"mime": "2.5.2",
|
@@ -29,29 +29,29 @@
|
|
29
29
|
"@teambit/react.webpack.react-webpack": "1.0.23",
|
30
30
|
"@teambit/express": "0.0.947",
|
31
31
|
"@teambit/logger": "0.0.941",
|
32
|
-
"@teambit/builder": "1.0.
|
33
|
-
"@teambit/bundler": "1.0.
|
34
|
-
"@teambit/component": "1.0.
|
32
|
+
"@teambit/builder": "1.0.135",
|
33
|
+
"@teambit/bundler": "1.0.135",
|
34
|
+
"@teambit/component": "1.0.135",
|
35
35
|
"@teambit/preview.ui.component-preview": "1.0.5",
|
36
|
-
"@teambit/aspect-loader": "1.0.
|
36
|
+
"@teambit/aspect-loader": "1.0.135",
|
37
37
|
"@teambit/cli": "0.0.848",
|
38
|
-
"@teambit/dependency-resolver": "1.0.
|
39
|
-
"@teambit/envs": "1.0.
|
38
|
+
"@teambit/dependency-resolver": "1.0.135",
|
39
|
+
"@teambit/envs": "1.0.135",
|
40
40
|
"@teambit/toolbox.path.to-windows-compatible-path": "0.0.496",
|
41
|
-
"@teambit/ui": "1.0.
|
42
|
-
"@teambit/isolator": "1.0.
|
41
|
+
"@teambit/ui": "1.0.135",
|
42
|
+
"@teambit/isolator": "1.0.135",
|
43
43
|
"@teambit/harmony.modules.harmony-root-generator": "0.0.1",
|
44
44
|
"@teambit/cache": "0.0.941",
|
45
|
-
"@teambit/graphql": "1.0.
|
46
|
-
"@teambit/pkg": "1.0.
|
47
|
-
"@teambit/pubsub": "1.0.
|
48
|
-
"@teambit/scope": "1.0.
|
49
|
-
"@teambit/watcher": "1.0.
|
50
|
-
"@teambit/workspace": "1.0.
|
51
|
-
"@teambit/compiler": "1.0.
|
45
|
+
"@teambit/graphql": "1.0.135",
|
46
|
+
"@teambit/pkg": "1.0.135",
|
47
|
+
"@teambit/pubsub": "1.0.135",
|
48
|
+
"@teambit/scope": "1.0.135",
|
49
|
+
"@teambit/watcher": "1.0.135",
|
50
|
+
"@teambit/workspace": "1.0.135",
|
51
|
+
"@teambit/compiler": "1.0.135",
|
52
52
|
"@teambit/preview.cli.preview-server-status": "0.0.506",
|
53
53
|
"@teambit/preview.cli.webpack-events-listener": "0.0.174",
|
54
|
-
"@teambit/webpack": "1.0.
|
54
|
+
"@teambit/webpack": "1.0.135"
|
55
55
|
},
|
56
56
|
"devDependencies": {
|
57
57
|
"@types/mime": "2.0.3",
|
@@ -89,7 +89,7 @@ export class ComponentBundlingStrategy implements BundlingStrategy {
|
|
89
89
|
// }, {});
|
90
90
|
|
91
91
|
// const modules = await Promise.all(entriesArr.map(async (entry) => {
|
92
|
-
// const dependencies =
|
92
|
+
// const dependencies = this.dependencyResolver.getDependencies(entry.component);
|
93
93
|
// const manifest = dependencies.toDependenciesManifest();
|
94
94
|
// const peer = Object.entries(manifest.peerDependencies || {}).reduce((acc, [packageName, version]) => {
|
95
95
|
// acc[packageName] = {
|