@teambit/preview 1.0.124 → 1.0.125

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.
@@ -1,6 +1,6 @@
1
1
  <?xml version="1.0" encoding="UTF-8"?>
2
2
  <testsuites>
3
- <testsuite name="teambit.preview/preview@1.0.124" timestamp="2024-01-04T09:13:19.387Z" tests="1" failures="0" errors="0" skipped="0">
4
- <testcase classname="create-peer-link.spec.js" name="should output snapshot" time="0.272"/>
3
+ <testsuite name="teambit.preview/preview@1.0.125" timestamp="2024-01-05T03:50:40.431Z" tests="1" failures="0" errors="0" skipped="0">
4
+ <testcase classname="create-peer-link.spec.js" name="should output snapshot" time="0.208"/>
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={99042:(e,t,n)=>{var o={id:"teambit.preview/preview@1.0.124",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},51496:(e,t,n)=>{Object.defineProperty(t,"M",{enumerable:!0,get:function(){return o.default}});var o=r(n(74544));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}},74544:(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},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(99042),r=(n(87363),n(40040));const i=TeambitMdxUiMdxScopeContext;var a=n(51496),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})()));
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={51945:(e,t,n)=>{var o={id:"teambit.preview/preview@1.0.125",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},25013:(e,t,n)=>{Object.defineProperty(t,"M",{enumerable:!0,get:function(){return o.default}});var o=r(n(72345));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}},72345:(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},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(51945),r=(n(87363),n(40040));const i=TeambitMdxUiMdxScopeContext;var a=n(25013),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})()));
@@ -1 +1 @@
1
- b072b8af71f6af41f3162b092f2eabff065b19bf
1
+ 058a76faa70b7ac96289e01a85aa8f34aa31726a
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "files": {
3
- "main.css": "autostatic/css/main.ab38f42e.css",
4
- "main.js": "autostatic/js/main.ffac5ebe.js"
3
+ "main.css": "/static/css/main.ab38f42e.css",
4
+ "main.js": "/static/js/main.ffac5ebe.js"
5
5
  },
6
6
  "entrypoints": [
7
7
  "static/css/main.ab38f42e.css",
@@ -58,10 +58,8 @@ function readBundleHash(bundleId, bundleDir, aspectDir) {
58
58
  async function createBundleHash(uiRoot, runtime) {
59
59
  const aspects = await uiRoot.resolveAspects(runtime);
60
60
  aspects.sort((a, b) => (a.getId || a.aspectPath) > (b.getId || b.aspectPath) ? 1 : -1);
61
- const aspectPathStrings = aspects.map(aspect => {
62
- return [aspect.aspectPath, aspect.runtimePath].join('');
63
- });
64
- return (0, _utils().sha1)(aspectPathStrings.join(''));
61
+ const aspectIds = aspects.map(aspect => aspect.getId || aspect.aspectPath);
62
+ return (0, _utils().sha1)(aspectIds.join(''));
65
63
  }
66
64
  async function generateBundleHash(uiRoot, runtime, outputPath) {
67
65
  const hash = await createBundleHash(uiRoot, runtime);
@@ -1 +1 @@
1
- {"version":3,"names":["_path","data","require","_fsExtra","_aspectLoader","_utils","BUNDLE_HASH_FILENAME","exports","readBundleHash","bundleId","bundleDir","aspectDir","bundleUiPathFromBvm","getBundlePath","hashFilePath","join","existsSync","readFileSync","toString","createBundleHash","uiRoot","runtime","aspects","resolveAspects","sort","a","b","getId","aspectPath","aspectPathStrings","map","aspect","runtimePath","sha1","generateBundleHash","outputPath","hash","mkdirSync","writeFileSync","getBundleArtifactDirectory","getBundleArtifactDef","rootDir","name","globPatterns","dirFromBvms","getAspectDirFromBvm","bundlePath","undefined","err","clearConsole","process","stdout","write","platform"],"sources":["pre-bundle-utils.ts"],"sourcesContent":["import { join } from 'path';\nimport { existsSync, mkdirSync, readFileSync, writeFileSync } from 'fs-extra';\nimport { UIRoot } from '@teambit/ui';\nimport { getAspectDirFromBvm } from '@teambit/aspect-loader';\nimport { SlotRegistry } from '@teambit/harmony';\nimport { ArtifactDefinition } from '@teambit/builder';\nimport { sha1 } from '@teambit/legacy/dist/utils';\n\n/// utils\n\nexport type UIRootRegistry = SlotRegistry<UIRoot>;\n\n// bundle hash\n\nexport const BUNDLE_HASH_FILENAME = '.hash';\n\nexport function readBundleHash(bundleId: string, bundleDir: string, aspectDir: string): string {\n const bundleUiPathFromBvm = getBundlePath(bundleId, bundleDir, aspectDir);\n if (!bundleUiPathFromBvm) {\n return '';\n }\n const hashFilePath = join(bundleUiPathFromBvm, BUNDLE_HASH_FILENAME);\n if (existsSync(hashFilePath)) {\n return readFileSync(hashFilePath).toString();\n }\n return '';\n}\n\nexport async function createBundleHash(uiRoot: UIRoot, runtime: string): Promise<string> {\n const aspects = await uiRoot.resolveAspects(runtime);\n aspects.sort((a, b) => ((a.getId || a.aspectPath) > (b.getId || b.aspectPath) ? 1 : -1));\n const aspectPathStrings = aspects.map((aspect) => {\n return [aspect.aspectPath, aspect.runtimePath].join('');\n });\n return sha1(aspectPathStrings.join(''));\n}\n\nexport async function generateBundleHash(uiRoot: UIRoot, runtime: string, outputPath: string): Promise<void> {\n const hash = await createBundleHash(uiRoot, runtime);\n if (!existsSync(outputPath)) mkdirSync(outputPath);\n writeFileSync(join(outputPath, BUNDLE_HASH_FILENAME), hash);\n}\n\n// bundle artifact\n\nexport function getBundleArtifactDirectory(bundleDir: string, aspectDir: string) {\n return join('artifacts', bundleDir, aspectDir);\n}\n\nexport function getBundleArtifactDef(bundleDir: string, aspectDir: string): ArtifactDefinition {\n const rootDir = getBundleArtifactDirectory(bundleDir, aspectDir);\n return {\n name: `${bundleDir}${aspectDir ? '-' : ''}${aspectDir}`,\n globPatterns: [`${rootDir}/**`],\n };\n}\n\nexport function getBundlePath(bundleId: string, bundleDir: string, aspectDir: string): string | undefined {\n try {\n const dirFromBvms = getAspectDirFromBvm(bundleId);\n const bundlePath = join(dirFromBvms, getBundleArtifactDirectory(bundleDir, aspectDir));\n if (!existsSync(bundlePath)) {\n return undefined;\n }\n return bundlePath;\n } catch (err) {\n return undefined;\n }\n}\n\n// others\n\nexport function clearConsole() {\n process.stdout.write(process.platform === 'win32' ? '\\x1B[2J\\x1B[0f' : '\\x1B[2J\\x1B[3J\\x1B[H');\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;AAEA,SAAAG,cAAA;EAAA,MAAAH,IAAA,GAAAC,OAAA;EAAAE,aAAA,YAAAA,CAAA;IAAA,OAAAH,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AAGA,SAAAI,OAAA;EAAA,MAAAJ,IAAA,GAAAC,OAAA;EAAAG,MAAA,YAAAA,CAAA;IAAA,OAAAJ,IAAA;EAAA;EAAA,OAAAA,IAAA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;AAChG"}
1
+ {"version":3,"names":["_path","data","require","_fsExtra","_aspectLoader","_utils","BUNDLE_HASH_FILENAME","exports","readBundleHash","bundleId","bundleDir","aspectDir","bundleUiPathFromBvm","getBundlePath","hashFilePath","join","existsSync","readFileSync","toString","createBundleHash","uiRoot","runtime","aspects","resolveAspects","sort","a","b","getId","aspectPath","aspectIds","map","aspect","sha1","generateBundleHash","outputPath","hash","mkdirSync","writeFileSync","getBundleArtifactDirectory","getBundleArtifactDef","rootDir","name","globPatterns","dirFromBvms","getAspectDirFromBvm","bundlePath","undefined","err","clearConsole","process","stdout","write","platform"],"sources":["pre-bundle-utils.ts"],"sourcesContent":["import { join } from 'path';\nimport { existsSync, mkdirSync, readFileSync, writeFileSync } from 'fs-extra';\nimport { UIRoot } from '@teambit/ui';\nimport { getAspectDirFromBvm } from '@teambit/aspect-loader';\nimport { SlotRegistry } from '@teambit/harmony';\nimport { ArtifactDefinition } from '@teambit/builder';\nimport { sha1 } from '@teambit/legacy/dist/utils';\n\n/// utils\n\nexport type UIRootRegistry = SlotRegistry<UIRoot>;\n\n// bundle hash\n\nexport const BUNDLE_HASH_FILENAME = '.hash';\n\nexport function readBundleHash(bundleId: string, bundleDir: string, aspectDir: string): string {\n const bundleUiPathFromBvm = getBundlePath(bundleId, bundleDir, aspectDir);\n if (!bundleUiPathFromBvm) {\n return '';\n }\n const hashFilePath = join(bundleUiPathFromBvm, BUNDLE_HASH_FILENAME);\n if (existsSync(hashFilePath)) {\n return readFileSync(hashFilePath).toString();\n }\n return '';\n}\n\nexport async function createBundleHash(uiRoot: UIRoot, runtime: string): Promise<string> {\n const aspects = await uiRoot.resolveAspects(runtime);\n aspects.sort((a, b) => ((a.getId || a.aspectPath) > (b.getId || b.aspectPath) ? 1 : -1));\n const aspectIds = aspects.map((aspect) => aspect.getId || aspect.aspectPath);\n return sha1(aspectIds.join(''));\n}\n\nexport async function generateBundleHash(uiRoot: UIRoot, runtime: string, outputPath: string): Promise<void> {\n const hash = await createBundleHash(uiRoot, runtime);\n if (!existsSync(outputPath)) mkdirSync(outputPath);\n writeFileSync(join(outputPath, BUNDLE_HASH_FILENAME), hash);\n}\n\n// bundle artifact\n\nexport function getBundleArtifactDirectory(bundleDir: string, aspectDir: string) {\n return join('artifacts', bundleDir, aspectDir);\n}\n\nexport function getBundleArtifactDef(bundleDir: string, aspectDir: string): ArtifactDefinition {\n const rootDir = getBundleArtifactDirectory(bundleDir, aspectDir);\n return {\n name: `${bundleDir}${aspectDir ? '-' : ''}${aspectDir}`,\n globPatterns: [`${rootDir}/**`],\n };\n}\n\nexport function getBundlePath(bundleId: string, bundleDir: string, aspectDir: string): string | undefined {\n try {\n const dirFromBvms = getAspectDirFromBvm(bundleId);\n const bundlePath = join(dirFromBvms, getBundleArtifactDirectory(bundleDir, aspectDir));\n if (!existsSync(bundlePath)) {\n return undefined;\n }\n return bundlePath;\n } catch (err) {\n return undefined;\n }\n}\n\n// others\n\nexport function clearConsole() {\n process.stdout.write(process.platform === 'win32' ? '\\x1B[2J\\x1B[0f' : '\\x1B[2J\\x1B[3J\\x1B[H');\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;AAEA,SAAAG,cAAA;EAAA,MAAAH,IAAA,GAAAC,OAAA;EAAAE,aAAA,YAAAA,CAAA;IAAA,OAAAH,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AAGA,SAAAI,OAAA;EAAA,MAAAJ,IAAA,GAAAC,OAAA;EAAAG,MAAA,YAAAA,CAAA;IAAA,OAAAJ,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AAEA;;AAIA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cd90c0e05b598a5a55af/teambit.preview_preview@1.0.124/dist/preview.composition.js';
2
- import * as overview_0 from '/home/circleci/Library/Caches/Bit/capsules/8891be5ad3d35bfc38b9cd90c0e05b598a5a55af/teambit.preview_preview@1.0.124/dist/preview.docs.mdx';
1
+ import * as compositions_0 from '/home/circleci/Library/Caches/Bit/capsules/8891be5ad3d35bfc38b9cd90c0e05b598a5a55af/teambit.preview_preview@1.0.125/dist/preview.composition.js';
2
+ import * as overview_0 from '/home/circleci/Library/Caches/Bit/capsules/8891be5ad3d35bfc38b9cd90c0e05b598a5a55af/teambit.preview_preview@1.0.125/dist/preview.docs.mdx';
3
3
 
4
4
  export const compositions = [compositions_0];
5
5
  export const overview = [overview_0];
@@ -81,6 +81,7 @@ function createPreBundleConfig(outputDir, entryFile) {
81
81
  },
82
82
  output: {
83
83
  path: outputDir,
84
+ publicPath: '/',
84
85
  chunkFilename: 'static/js/[name].[contenthash:8].chunk.js',
85
86
  filename: 'static/js/[name].[contenthash:8].js',
86
87
  library: {
@@ -1 +1 @@
1
- {"version":3,"names":["_reactWebpack","data","require","_webpack","_webpackMerge","_webpack2","_webpackManifestPlugin","createWebpackConfig","outputDir","entryFile","baseConfig","configBaseFactory","preBundleConfig","createPreBundleConfig","combined","merge","stats","children","errorDetails","mode","entry","main","resolve","alias","react","fallback","module","path","fallbacks","dgram","dns","fs","stream","http2","net","tls","child_process","process","output","chunkFilename","filename","library","type","externalsType","externals","plugins","WebpackManifestPlugin","fileName","generate","seed","files","entrypoints","manifestFiles","reduce","manifest","file","name","entrypointFiles","filter","endsWith","ProvidePlugin","fallbacksProvidePluginConfig"],"sources":["webpack.config.ts"],"sourcesContent":["import { configBaseFactory } from '@teambit/react.webpack.react-webpack';\n\nimport { Configuration, ProvidePlugin } from 'webpack';\nimport { merge } from 'webpack-merge';\nimport { fallbacksProvidePluginConfig, fallbacks } from '@teambit/webpack';\nimport { WebpackManifestPlugin } from 'webpack-manifest-plugin';\n\nexport function createWebpackConfig(outputDir: string, entryFile: string): Configuration {\n const baseConfig = configBaseFactory(true);\n const preBundleConfig = createPreBundleConfig(outputDir, entryFile);\n\n // @ts-ignore that's an issue because of different types/webpack version\n const combined = merge(baseConfig, preBundleConfig);\n\n // @ts-ignore that's an issue because of different types/webpack version\n return combined;\n}\n\nfunction createPreBundleConfig(outputDir: string, entryFile: string) {\n const preBundleConfig: Configuration = {\n stats: {\n children: true,\n errorDetails: true,\n },\n mode: 'production',\n entry: {\n main: entryFile,\n },\n resolve: {\n alias: {\n 'react/jsx-runtime': require.resolve('react/jsx-runtime'),\n react: require.resolve('react'),\n 'react-dom': require.resolve('react-dom'),\n },\n fallback: {\n module: false,\n path: fallbacks.path,\n dgram: false,\n dns: false,\n fs: false,\n stream: false,\n http2: false,\n net: false,\n tls: false,\n child_process: false,\n process: fallbacks.process,\n },\n },\n output: {\n path: outputDir,\n chunkFilename: 'static/js/[name].[contenthash:8].chunk.js',\n filename: 'static/js/[name].[contenthash:8].js',\n library: {\n type: 'commonjs2',\n },\n },\n externalsType: 'commonjs',\n externals: ['react', 'react-dom', '@mdx-js/react', '@teambit/mdx.ui.mdx-scope-context'],\n plugins: [\n // Generate an asset manifest file with the following content:\n // - \"files\" key: Mapping of all asset filenames to their corresponding\n // output file so that tools can pick it up without having to parse\n // `index.html`\n // can be used to reconstruct the HTML if necessary\n new WebpackManifestPlugin({\n fileName: 'asset-manifest.json',\n generate: (seed, files, entrypoints) => {\n const manifestFiles = files.reduce((manifest, file) => {\n manifest[file.name] = file.path;\n return manifest;\n }, seed);\n const entrypointFiles = entrypoints.main.filter((fileName) => !fileName.endsWith('.map'));\n\n // @ts-ignore - https://github.com/shellscape/webpack-manifest-plugin/issues/276\n return {\n files: manifestFiles,\n entrypoints: entrypointFiles,\n } as Record<string, string>;\n },\n }),\n\n new ProvidePlugin({ process: fallbacksProvidePluginConfig.process }),\n ],\n };\n\n return preBundleConfig;\n}\n"],"mappings":";;;;;;AAAA,SAAAA,cAAA;EAAA,MAAAC,I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O;UACLT,KAAK,EAAEE,aAAa;UACpBD,WAAW,EAAEM;QACf,CAAC;MACH;IACF,CAAC,CAAC,EAEF,KAAIG,wBAAa,EAAC;MAAEvB,OAAO,EAAEwB,wCAA4B,CAACxB;IAAQ,CAAC,CAAC;EAExE,CAAC;EAED,OAAOzB,eAAe;AACxB"}
1
+ {"version":3,"names":["_reactWebpack","data","require","_webpack","_webpackMerge","_webpack2","_webpackManifestPlugin","createWebpackConfig","outputDir","entryFile","baseConfig","configBaseFactory","preBundleConfig","createPreBundleConfig","combined","merge","stats","children","errorDetails","mode","entry","main","resolve","alias","react","fallback","module","path","fallbacks","dgram","dns","fs","stream","http2","net","tls","child_process","process","output","publicPath","chunkFilename","filename","library","type","externalsType","externals","plugins","WebpackManifestPlugin","fileName","generate","seed","files","entrypoints","manifestFiles","reduce","manifest","file","name","entrypointFiles","filter","endsWith","ProvidePlugin","fallbacksProvidePluginConfig"],"sources":["webpack.config.ts"],"sourcesContent":["import { configBaseFactory } from '@teambit/react.webpack.react-webpack';\n\nimport { Configuration, ProvidePlugin } from 'webpack';\nimport { merge } from 'webpack-merge';\nimport { fallbacksProvidePluginConfig, fallbacks } from '@teambit/webpack';\nimport { WebpackManifestPlugin } from 'webpack-manifest-plugin';\n\nexport function createWebpackConfig(outputDir: string, entryFile: string): Configuration {\n const baseConfig = configBaseFactory(true);\n const preBundleConfig = createPreBundleConfig(outputDir, entryFile);\n\n // @ts-ignore that's an issue because of different types/webpack version\n const combined = merge(baseConfig, preBundleConfig);\n\n // @ts-ignore that's an issue because of different types/webpack version\n return combined;\n}\n\nfunction createPreBundleConfig(outputDir: string, entryFile: string) {\n const preBundleConfig: Configuration = {\n stats: {\n children: true,\n errorDetails: true,\n },\n mode: 'production',\n entry: {\n main: entryFile,\n },\n resolve: {\n alias: {\n 'react/jsx-runtime': require.resolve('react/jsx-runtime'),\n react: require.resolve('react'),\n 'react-dom': require.resolve('react-dom'),\n },\n fallback: {\n module: false,\n path: fallbacks.path,\n dgram: false,\n dns: false,\n fs: false,\n stream: false,\n http2: false,\n net: false,\n tls: false,\n child_process: false,\n process: fallbacks.process,\n },\n },\n output: {\n path: outputDir,\n publicPath: '/',\n chunkFilename: 'static/js/[name].[contenthash:8].chunk.js',\n filename: 'static/js/[name].[contenthash:8].js',\n library: {\n type: 'commonjs2',\n },\n },\n externalsType: 'commonjs',\n externals: ['react', 'react-dom', '@mdx-js/react', '@teambit/mdx.ui.mdx-scope-context'],\n plugins: [\n // Generate an asset manifest file with the following content:\n // - \"files\" key: Mapping of all asset filenames to their corresponding\n // output file so that tools can pick it up without having to parse\n // `index.html`\n // can be used to reconstruct the HTML if necessary\n new WebpackManifestPlugin({\n fileName: 'asset-manifest.json',\n generate: (seed, files, entrypoints) => {\n const manifestFiles = files.reduce((manifest, file) => {\n manifest[file.name] = file.path;\n return manifest;\n }, seed);\n const entrypointFiles = entrypoints.main.filter((fileName) => !fileName.endsWith('.map'));\n\n // @ts-ignore - https://github.com/shellscape/webpack-manifest-plugin/issues/276\n return {\n files: manifestFiles,\n entrypoints: entrypointFiles,\n } as Record<string, string>;\n },\n }),\n\n new ProvidePlugin({ process: fallbacksProvidePluginConfig.process }),\n ],\n };\n\n return preBundleConfig;\n}\n"],"mappings":";;;;;;AAAA,SAAAA,cAAA;EAAA,MAAAC,IAAA,GAAAC,OAAA;EAAAF,aAAA,YAAAA,CAAA;IAAA,OAAAC,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AAEA,SAAAE,SAAA;EAAA,MAAAF,IAAA,GAAAC,OAAA;EAAAC,QAAA,YAAAA,CAAA;IAAA,OAAAF,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AACA,SAAAG,cAAA;EAAA,MAAAH,IAAA,GAAAC,OAAA;EAAAE,aAAA,YAAAA,CAAA;IAAA,OAAAH,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AACA,SAAAI,UAAA;EAAA,MAAAJ,IAAA,GAAAC,OAAA;EAAAG,SAAA,YAAAA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qBAAS,CAACS;MACrB;IACF,CAAC;IACDC,MAAM,EAAE;MACNX,IAAI,EAAEnB,SAAS;MACf+B,UAAU,EAAE,GAAG;MACfC,aAAa,EAAE,2CAA2C;MAC1DC,QAAQ,EAAE,qCAAqC;MAC/CC,OAAO,EAAE;QACPC,IAAI,EAAE;MACR;IACF,CAAC;IACDC,aAAa,EAAE,UAAU;IACzBC,SAAS,EAAE,CAAC,OAAO,EAAE,WAAW,EAAE,eAAe,EAAE,mCAAmC,CAAC;IACvFC,OAAO,EAAE;IACP;IACA;IACA;IACA;IACA;IACA,KAAIC,8CAAqB,EAAC;MACxBC,QAAQ,EAAE,qBAAqB;MAC/BC,QAAQ,EAAEA,CAACC,IAAI,EAAEC,KAAK,EAAEC,WAAW,KAAK;QACtC,MAAMC,aAAa,GAAGF,KAAK,CAACG,MAAM,CAAC,CAACC,QAAQ,EAAEC,IAAI,KAAK;UACrDD,QAAQ,CAACC,IAAI,CAACC,IAAI,CAAC,GAAGD,IAAI,CAAC7B,IAAI;UAC/B,OAAO4B,QAAQ;QACjB,CAAC,EAAEL,IAAI,CAAC;QACR,MAAMQ,eAAe,GAAGN,WAAW,CAAC/B,IAAI,CAACsC,MAAM,CAAEX,QAAQ,IAAK,CAACA,QAAQ,CAACY,QAAQ,CAAC,MAAM,CAAC,CAAC;;QAEzF;QACA,OAAO;UACLT,KAAK,EAAEE,aAAa;UACpBD,WAAW,EAAEM;QACf,CAAC;MACH;IACF,CAAC,CAAC,EAEF,KAAIG,wBAAa,EAAC;MAAExB,OAAO,EAAEyB,wCAA4B,CAACzB;IAAQ,CAAC,CAAC;EAExE,CAAC;EAED,OAAOzB,eAAe;AACxB"}
package/package.json CHANGED
@@ -1,12 +1,12 @@
1
1
  {
2
2
  "name": "@teambit/preview",
3
- "version": "1.0.124",
3
+ "version": "1.0.125",
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.124"
9
+ "version": "1.0.125"
10
10
  },
11
11
  "dependencies": {
12
12
  "mime": "2.5.2",
@@ -18,9 +18,9 @@
18
18
  "graphql-tag": "2.12.1",
19
19
  "object-hash": "2.1.1",
20
20
  "lodash.compact": "3.0.1",
21
- "graphql-request": "6.1.0",
22
- "webpack-manifest-plugin": "4.0.2",
21
+ "webpack-manifest-plugin": "5.0.0",
23
22
  "webpack-merge": "5.8.0",
23
+ "graphql-request": "6.1.0",
24
24
  "@teambit/ui-foundation.ui.pages.static-error": "0.0.92",
25
25
  "@teambit/harmony": "0.4.6",
26
26
  "@teambit/preview.modules.preview-modules": "1.0.2",
@@ -29,28 +29,28 @@
29
29
  "@teambit/react.webpack.react-webpack": "1.0.23",
30
30
  "@teambit/express": "0.0.944",
31
31
  "@teambit/logger": "0.0.938",
32
- "@teambit/builder": "1.0.124",
33
- "@teambit/bundler": "1.0.124",
34
- "@teambit/component": "1.0.124",
32
+ "@teambit/builder": "1.0.125",
33
+ "@teambit/bundler": "1.0.125",
34
+ "@teambit/component": "1.0.125",
35
35
  "@teambit/preview.ui.component-preview": "1.0.5",
36
- "@teambit/aspect-loader": "1.0.124",
36
+ "@teambit/aspect-loader": "1.0.125",
37
37
  "@teambit/cli": "0.0.845",
38
- "@teambit/dependency-resolver": "1.0.124",
39
- "@teambit/envs": "1.0.124",
38
+ "@teambit/dependency-resolver": "1.0.125",
39
+ "@teambit/envs": "1.0.125",
40
40
  "@teambit/toolbox.path.to-windows-compatible-path": "0.0.496",
41
- "@teambit/ui": "1.0.124",
42
- "@teambit/isolator": "1.0.124",
41
+ "@teambit/ui": "1.0.125",
42
+ "@teambit/isolator": "1.0.125",
43
43
  "@teambit/cache": "0.0.938",
44
- "@teambit/graphql": "1.0.124",
45
- "@teambit/pkg": "1.0.124",
46
- "@teambit/pubsub": "1.0.124",
47
- "@teambit/scope": "1.0.124",
48
- "@teambit/watcher": "1.0.124",
49
- "@teambit/workspace": "1.0.124",
50
- "@teambit/compiler": "1.0.124",
44
+ "@teambit/graphql": "1.0.125",
45
+ "@teambit/pkg": "1.0.125",
46
+ "@teambit/pubsub": "1.0.125",
47
+ "@teambit/scope": "1.0.125",
48
+ "@teambit/watcher": "1.0.125",
49
+ "@teambit/workspace": "1.0.125",
50
+ "@teambit/compiler": "1.0.125",
51
51
  "@teambit/preview.cli.preview-server-status": "0.0.506",
52
52
  "@teambit/preview.cli.webpack-events-listener": "0.0.174",
53
- "@teambit/webpack": "1.0.124"
53
+ "@teambit/webpack": "1.0.125"
54
54
  },
55
55
  "devDependencies": {
56
56
  "@types/mime": "2.0.3",
@@ -48,6 +48,7 @@ function createPreBundleConfig(outputDir: string, entryFile: string) {
48
48
  },
49
49
  output: {
50
50
  path: outputDir,
51
+ publicPath: '/',
51
52
  chunkFilename: 'static/js/[name].[contenthash:8].chunk.js',
52
53
  filename: 'static/js/[name].[contenthash:8].js',
53
54
  library: {