@teambit/node 0.0.706 → 0.0.709
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/env-template/public/162.js +6 -2
- package/artifacts/env-template/public/{413.js → 624.js} +4 -4
- package/artifacts/env-template/public/793.js +18 -18
- package/artifacts/env-template/public/assets-manifest.json +14 -16
- package/artifacts/env-template/public/compositions.85b7cc71e1e5bde42f83.js +1 -0
- package/artifacts/env-template/public/compositions.html +1 -1
- package/artifacts/env-template/public/{overview.ff1719cb4d0309121203.js → overview.567788979aa2b79c51e8.js} +2 -2
- package/artifacts/env-template/public/overview.html +1 -1
- package/artifacts/env-template/public/{preview-root.cd80fcaec61d81a584f1.js → preview-root.f8526a284a6e4a3e0885.js} +1 -1
- package/artifacts/env-template/public/service-worker.js +1 -1
- package/artifacts/env-template/public/static/css/793.799c4293.css +1 -0
- package/artifacts/env-template/public/static/css/{compositions.cd8be53f.css → compositions.4138c069.css} +1 -1
- package/artifacts/env-template/public/static/css/{previewRoot.a16607da.css → previewRoot.c0db5bec.css} +1 -1
- package/artifacts/preview/teambit_harmony_node-preview.js +2 -2
- package/{compositions-1649647448813.js → compositions-1650243425150.js} +0 -0
- package/dist/templates/node-env/files/aspect.d.ts +2 -0
- package/dist/templates/node-env/files/aspect.js +20 -0
- package/dist/templates/node-env/files/aspect.js.map +1 -0
- package/dist/templates/node-env/files/doc.d.ts +2 -1
- package/dist/templates/node-env/files/doc.js +173 -5
- package/dist/templates/node-env/files/doc.js.map +1 -1
- package/dist/templates/node-env/files/index.js +5 -3
- package/dist/templates/node-env/files/index.js.map +1 -1
- package/dist/templates/node-env/files/jest.config.d.ts +1 -0
- package/dist/templates/node-env/files/jest.config.js +30 -0
- package/dist/templates/node-env/files/jest.config.js.map +1 -0
- package/dist/templates/node-env/files/main.runtime.d.ts +2 -0
- package/dist/templates/node-env/files/main.runtime.js +103 -0
- package/dist/templates/node-env/files/main.runtime.js.map +1 -0
- package/dist/templates/node-env/files/preview.runtime.d.ts +2 -0
- package/dist/templates/node-env/files/preview.runtime.js +38 -0
- package/dist/templates/node-env/files/preview.runtime.js.map +1 -0
- package/dist/templates/node-env/files/typescript/styles.d.ts +1 -0
- package/dist/templates/node-env/files/typescript/styles.js +16 -0
- package/dist/templates/node-env/files/typescript/styles.js.map +1 -0
- package/dist/templates/node-env/files/typescript/ts-transformer.d.ts +1 -0
- package/dist/templates/node-env/files/typescript/ts-transformer.js +59 -0
- package/dist/templates/node-env/files/typescript/ts-transformer.js.map +1 -0
- package/dist/templates/node-env/files/typescript/typescript.config.d.ts +1 -0
- package/dist/templates/node-env/files/typescript/typescript.config.js +30 -0
- package/dist/templates/node-env/files/typescript/typescript.config.js.map +1 -0
- package/dist/templates/node-env/files/webpack.config.d.ts +1 -0
- package/dist/templates/node-env/files/webpack.config.js +57 -0
- package/dist/templates/node-env/files/webpack.config.js.map +1 -0
- package/dist/templates/node-env/index.js +99 -8
- package/dist/templates/node-env/index.js.map +1 -1
- package/{overview-1649647448813.js → overview-1650243425150.js} +0 -0
- package/package-tar/teambit-node-0.0.709.tgz +0 -0
- package/package.json +16 -16
- package/{preview-1649647448813.js → preview-1650243425150.js} +2 -2
- package/templates/node-env/files/aspect.ts +10 -0
- package/templates/node-env/files/doc.ts +172 -5
- package/templates/node-env/files/index.ts +5 -3
- package/templates/node-env/files/jest.config.ts +21 -0
- package/templates/node-env/files/main.runtime.ts +93 -0
- package/templates/node-env/files/preview.runtime.ts +27 -0
- package/templates/node-env/files/typescript/styles.ts +7 -0
- package/templates/node-env/files/typescript/ts-transformer.ts +50 -0
- package/templates/node-env/files/typescript/typescript.config.ts +21 -0
- package/templates/node-env/files/webpack.config.ts +48 -0
- package/templates/node-env/index.ts +41 -6
- package/artifacts/env-template/public/compositions.17295699d92a4f6fbb0f.js +0 -1
- package/artifacts/env-template/public/static/css/793.ebb74038.css +0 -1
- package/artifacts/env-template/public/static/css/overview.7bb7dce6.css +0 -1
- package/dist/templates/node-env/files/extension.d.ts +0 -2
- package/dist/templates/node-env/files/extension.js +0 -34
- package/dist/templates/node-env/files/extension.js.map +0 -1
- package/package-tar/teambit-node-0.0.706.tgz +0 -0
- package/templates/node-env/files/extension.ts +0 -25
|
@@ -1 +1 @@
|
|
|
1
|
-
.card_card__37xow{box-sizing:border-box;padding:20px}.elevations_low__1hVha{box-shadow:var(--bit-shadow-hover-low)}.elevations_medium__3klNF{box-shadow:var(--bit-shadow-hover-medium)}.elevations_high__34Cbm{box-shadow:var(--bit-shadow-hover-high)}.roundness_sharp__HxXUj{border-radius:2px}.roundness_default__2lyQQ{border-radius:5px}.roundness_small__3Cwbi{border-radius:8px}.roundness_medium__rMVHV{border-radius:10px}.roundness_circle__18nMU{border-radius:50%}.background_bedrock__3FKrB{background:var(--bit-bg-bedrock)}.background_base__29SaX,.background_layer__Sl4XN{background:var(--bit-bg-color)}.background_crust__3IFae{background:var(--bit-bg-tooltip)}.background_topping__bd7wA{background:var(--bit-bg-color)}.background_topping__bd7wA:hover{background:var(--bit-bg-heavy)}.background_dent__3lLeg{background:var(--bit-bg-dent)}.accent-color_primary__3frqn{--bit-accent-color:#6c5ce7;--bit-accent-heavy:#5d4aec;--bit-accent-light:#897dec;--bit-accent-text:#6c5ce7;--bit-accent-text-heavy:#5d4aec;--bit-text-on-accent:#fff;--bit-accent-bg:#eceaff;--bit-accent-bg-heavy:#c9c3f6}.accent-color_complementary__2hAqH{--bit-accent-color:#f83d6c;--bit-accent-heavy:#f7174f;--bit-accent-light:#f96389;--bit-accent-text:#f83d6c;--bit-accent-text-heavy:#f7174f;--bit-text-on-accent:#fff;--bit-accent-bg:#ffe2ea;--bit-accent-bg-heavy:#fb9cb4}.accent-color_impulsive__A1-5J{--bit-accent-color:#e62e5c;--bit-accent-heavy:#d31948;--bit-accent-light:#f086a0;--bit-accent-text:#e62e5c;--bit-accent-text-heavy:#d31948;--bit-text-on-accent:#fff;--bit-accent-bg:#fdeff2;--bit-accent-bg-heavy:#f7bac9}.accent-color_hungry__2f4vr{--bit-accent-color:#ffc640;--bit-accent-heavy:#ff991f;--bit-accent-light:#ffe380;--bit-accent-text:#ffc640;--bit-accent-text-heavy:#ff991f;--bit-text-on-accent:#0c0c0c;--bit-accent-bg:#fff5dd;--bit-accent-bg-heavy:#fff0b3}.accent-color_success__bd5oL{--bit-accent-color:#37b26c;--bit-accent-heavy:#2e945a;--bit-accent-light:#94deb4;--bit-accent-text:#37b26c;--bit-accent-text-heavy:#2e945a;--bit-text-on-accent:#fff;--bit-accent-bg:#eefaf3;--bit-accent-bg-heavy:#d0f1de}.accent-color_process__2YrEO{--bit-accent-color:#0984e3;--bit-accent-heavy:#3d5afe;--bit-accent-light:#95ccf5;--bit-accent-text:#0984e3;--bit-accent-text-heavy:#3d5afe;--bit-text-on-accent:#fff;--bit-accent-bg:#f3faff;--bit-accent-bg-heavy:#d2ecfe}.accent-color_emphasized__3yGcN{--bit-accent-color:#2b2b2b;--bit-accent-heavy:#0c0c0c;--bit-accent-light:#414141;--bit-accent-text:#2b2b2b;--bit-accent-text-heavy:#0c0c0c;--bit-text-on-accent:#fff;--bit-accent-bg:#ededed;--bit-accent-bg-heavy:#cccfd4}.accent-color_neutral__gff6l{--bit-accent-color:#414141;--bit-accent-heavy:#2b2b2b;--bit-accent-light:#6c707c;--bit-accent-text:#414141;--bit-accent-text-heavy:#2b2b2b;--bit-text-on-accent:#fff;--bit-accent-bg:#f6f6f6;--bit-accent-bg-heavy:#ededed}.button_vanillaButton__2NQrx{cursor:pointer;font:inherit;transition:all .18s ease-in-out;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}.dots-loader_dotsLoader__3AHki{letter-spacing:.6em;text-indent:.6em}.dots-loader_dotsLoader__3AHki>*{-webkit-animation:1.27s ease-in-out infinite both;animation:1.27s ease-in-out infinite both;-webkit-animation-name:dots-loader_scale-down__3P_ea;animation-name:dots-loader_scale-down__3P_ea;display:inline-block}.dots-loader_dotsLoader__3AHki>:first-child{-webkit-animation-delay:-.37s;animation-delay:-.37s}.dots-loader_dotsLoader__3AHki>:nth-child(2){-webkit-animation-delay:-185ms;animation-delay:-185ms}@-webkit-keyframes dots-loader_scale-down__3P_ea{0%,20%,to{transform:scale(0)}60%{transform:scale(1)}}@keyframes dots-loader_scale-down__3P_ea{0%,20%,to{transform:scale(0)}60%{transform:scale(1)}}.icon-button_iconButton__2YTx9{align-items:center;border-radius:8px;display:flex;padding:7px 16px;transition:background-color .3s ease-in-out}.icon-button_iconButton__2YTx9.icon-button_iconOnly__mU2Gj{padding:6px 8px}.icon-button_iconButton__2YTx9[data-priority=ghost]{background-color:#fff;background-color:var(--bit-bg-color,#fff);border:1px solid #ededed;border:1px solid var(--bit-border-color-lightest,#ededed);color:#2b2b2b;color:var(--bit-text-color-heavy,#2b2b2b)}.icon-button_iconButton__2YTx9[data-priority=ghost].icon-button_active__3NW_G{border-color:#6c5ce7;border-color:var(--bit-accent-color,#6c5ce7);color:#6c5ce7;color:var(--bit-accent-color,#6c5ce7)}.icon-button_iconButton__2YTx9[data-priority=ghost]:hover{background-color:#f6f6f6;background-color:var(--bit-bg-heavy,#f6f6f6)}.icon-button_iconButton__2YTx9[data-priority=ghost]:active{background-color:#ededed;background-color:var(--bit-bg-heaviest,#ededed)}.icon-button_iconButton__2YTx9[data-priority=ghost]:disabled:hover{background-color:#fff;background-color:var(--bit-bg-color,#fff)}.icon-button_iconButton__2YTx9[data-priority=cta]{background-color:#6c5ce7;background-color:var(--bit-accent-color,#6c5ce7);border:1px solid #6c5ce7;border:1px solid var(--bit-accent-color,#6c5ce7);color:#fff;color:var(--bit-bg-color,#fff)}.icon-button_iconButton__2YTx9[data-priority=cta]:hover:not(:disabled){background-color:#5d4aec;background-color:var(--bit-accent-heavy,#5d4aec);border:1px solid #5d4aec;border:1px solid var(--bit-accent-heavy,#5d4aec)}.icon-button_iconButton__2YTx9[data-priority=cta]:disabled{background-color:#f6f6f6;background-color:var(--bit-bg-heavy,#f6f6f6);border-color:#f6f6f6;border-color:var(--bit-bg-heavy,#f6f6f6)}.icon-button_iconButton__2YTx9:disabled{color:#babec9;color:var(--bit-border-color,#babec9);cursor:not-allowed}.icon-button_iconButton__2YTx9:focus{box-shadow:0 0 0 .125em #eceaff;box-shadow:0 0 0 .125em var(--bit-accent-bg,#eceaff);outline:none}.icon-button_icon__24uLr{color:inherit;font-size:16px}.icon-button_margin__tDWIN{margin-right:8px}.sizes_buttonSizes__2RvCY[data-size=m]{font-size:14px;height:32px}.sizes_buttonSizes__2RvCY[data-size=l]{font-size:14px;height:40px}.flex-center_flexCenter__1OE5Q{align-items:center;display:flex;flex-direction:column;justify-content:center}.error-fallback_icon__22fU3{background-color:#fff;background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='512' height='512'%3E%3Cpath fill='%23e62e5c' d='M256 512c141.385 0 256-114.615 256-256S397.385 0 256 0 0 114.615 0 256s114.615 256 256 256zm120.262-340.502-86.038 84.5 86.038 84.511c10.451 10.275 10.183 25.962 0 35.968-10.077 9.891-25.68 10.17-36.038 0l-84.222-82.743-84.235 82.743c-10.345 10.17-25.949 9.891-36.026 0-10.182-10.007-10.461-25.693 0-35.968l86.038-84.511-86.038-84.501c-10.461-10.286-10.182-25.971 0-35.978 10.077-9.891 25.681-10.159 36.026 0l84.235 82.743 84.222-82.743c10.358-10.159 25.962-9.891 36.038 0 10.183 10.007 10.451 25.692 0 35.978z'/%3E%3C/svg%3E");background-size:contain;border-radius:100%;height:24px;margin-bottom:16px;width:24px}.error-fallback_message__7TfMY{color:#e62e5c;color:var(--bit-error-color,#e62e5c);margin-bottom:8px}.error-fallback_errorFallback__3WyiR{-webkit-animation:error-fallback_enter__3s9LR .3s ease-in forwards;animation:error-fallback_enter__3s9LR .3s ease-in forwards;border:4px solid #f086a0;border:4px solid var(--bit-error-light,#f086a0);border-radius:4px;box-sizing:border-box;color:#e62e5c;color:var(--bit-error-color,#e62e5c);font-family:sans-serif;height:100%;padding:8px}.error-fallback_errorFallback__3WyiR>*{flex:none}@-webkit-keyframes error-fallback_enter__3s9LR{0%{opacity:.1}to{opacity:1}}@keyframes error-fallback_enter__3s9LR{0%{opacity:.1}to{opacity:1}}.themed-text_themedText__-5NI1{color:#6c5ce7;color:var(--bit-accent-color,#6c5ce7)}.composition-card_compositionCard__1TGzH{background-color:#fff;background-color:var(--bit-bg-color,#fff);box-shadow:var(--bit-shadow-raised-low);display:flex;flex:none;flex-direction:column;min-height:122px;min-width:199px;padding:0}.composition-card_compositionCard__1TGzH:hover .composition-card_linkToComposition__uWeCP{opacity:1;visibility:visible}.composition-card_compositionContainer__1fvHN{box-sizing:border-box;margin:auto;max-width:100%;overflow:auto;padding:16px;position:relative;transform:translateZ(0)}.composition-card_title__1pxwS{align-items:center;border-top:1px solid #ededed;border-top:1px solid var(--bit-border-color-lightest,#ededed);display:flex;flex:none;font-size:.875em;justify-content:space-between;padding:8px 16px}.composition-card_title__1pxwS>span{margin-right:8px}.composition-card_linkToComposition__uWeCP{color:#2b2b2b;color:var(--bit-text-color-heavy,#2b2b2b);opacity:0;text-decoration:none;transition:opacity .3s,visibility .3s ease-in-out;visibility:hidden}.composition-card_compositionCardError__1YDP3{border-radius:4px 4px 0 0}.compositions-overview_background__3z-mR{background:#f6f6f6;background:var(--bit-bg-dent,#f6f6f6);border:1px solid #ededed;border:1px solid var(--bit-border-color-lightest,#ededed);border-radius:6px;display:flex;max-height:500px;overflow-x:auto;padding:12px}.compositions-overview_background__3z-mR>*{margin-right:16px}.compositions-overview_background__3z-mR>:last-child{margin:0}.frame_overlayBorder__16yQg{border:2px solid #eebcc9;border:2px solid var(--bit-highlighter-color,#eebcc9);border-radius:11px;box-sizing:border-box;padding:4px;pointer-events:none;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}.frame_hidden__2sf70{display:none}.label_othersContainer__1ExfG>*{margin-bottom:8px}.label_othersContainer__1ExfG>:last-child{margin-bottom:unset}.label_othersTooltip__1HBaz{cursor:pointer;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}.label_othersTooltip__1HBaz:before{content:"▾";display:inline-block;transition:transform .3s}.label_othersTooltip__1HBaz.label_active__7E4-a:before{transform:rotate(-180deg)}.label_hidden__3j8Bq{pointer-events:none;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;visibility:hidden}.component-strip_componentStrip__3tWW4{border-radius:.5em;box-shadow:var(--bit-highlighter-shadow);display:flex;width:-webkit-fit-content;width:-moz-fit-content;width:fit-content}.component-strip_componentStrip__3tWW4>*{background:#eebcc9;background:var(--bit-highlighter-color,#eebcc9);line-height:1.5;margin-right:.125em;padding:0 .5em;transform:translateZ(0);transition:filter .3s,background-color .3s}.component-strip_componentStrip__3tWW4>:link,.component-strip_componentStrip__3tWW4>:visited{color:inherit;text-decoration:inherit}.component-strip_componentStrip__3tWW4>:link:hover,.component-strip_componentStrip__3tWW4>:visited:hover{background:#f6dae2;background:var(--bit-highlighter-color-hover,#f6dae2)}.component-strip_componentStrip__3tWW4>:link:active,.component-strip_componentStrip__3tWW4>:visited:active{background:#e79db1;background:var(--bit-highlighter-color-active,#e79db1);color:inherit}.component-strip_componentStrip__3tWW4>:first-child{border-bottom-left-radius:.5em;border-top-left-radius:.5em}.component-strip_componentStrip__3tWW4>:last-child{border-bottom-right-radius:.5em;border-top-right-radius:.5em;margin-right:unset}.element-highlighter_label__zdp2_{padding:8px}.element-highlighter_frame__Ra14a,.element-highlighter_label__zdp2_{z-index:15500}.highlighter-provider_highlighter__124yM{border:solid #ededed;border:0 solid var(--bit-border-color-lightest,#ededed);box-sizing:border-box;height:100%;transition:border .3s}.highlighter-provider_highlighter__124yM.highlighter-provider_active__oBUtA{border-width:8px;overflow:auto}.highlighter-provider_label__rMBbJ{font-family:sans-serif;font-size:12px}
|
|
1
|
+
.card_card__37xow{box-sizing:border-box;padding:20px}.elevations_low__1hVha{box-shadow:var(--bit-shadow-hover-low)}.elevations_medium__3klNF{box-shadow:var(--bit-shadow-hover-medium)}.elevations_high__34Cbm{box-shadow:var(--bit-shadow-hover-high)}.roundness_sharp__HxXUj{border-radius:2px}.roundness_default__2lyQQ{border-radius:5px}.roundness_small__3Cwbi{border-radius:8px}.roundness_medium__rMVHV{border-radius:10px}.roundness_circle__18nMU{border-radius:50%}.background_bedrock__3FKrB{background:var(--bit-bg-bedrock)}.background_base__29SaX,.background_layer__Sl4XN{background:var(--bit-bg-color)}.background_crust__3IFae{background:var(--bit-bg-tooltip)}.background_topping__bd7wA{background:var(--bit-bg-color)}.background_topping__bd7wA:hover{background:var(--bit-bg-heavy)}.background_dent__3lLeg{background:var(--bit-bg-dent)}.accent-color_primary__3frqn{--bit-accent-color:#6c5ce7;--bit-accent-heavy:#5d4aec;--bit-accent-light:#897dec;--bit-accent-text:#6c5ce7;--bit-accent-text-heavy:#5d4aec;--bit-text-on-accent:#fff;--bit-accent-bg:#eceaff;--bit-accent-bg-heavy:#c9c3f6}.accent-color_complementary__2hAqH{--bit-accent-color:#f83d6c;--bit-accent-heavy:#f7174f;--bit-accent-light:#f96389;--bit-accent-text:#f83d6c;--bit-accent-text-heavy:#f7174f;--bit-text-on-accent:#fff;--bit-accent-bg:#ffe2ea;--bit-accent-bg-heavy:#fb9cb4}.accent-color_impulsive__A1-5J{--bit-accent-color:#e62e5c;--bit-accent-heavy:#d31948;--bit-accent-light:#f086a0;--bit-accent-text:#e62e5c;--bit-accent-text-heavy:#d31948;--bit-text-on-accent:#fff;--bit-accent-bg:#fdeff2;--bit-accent-bg-heavy:#f7bac9}.accent-color_hungry__2f4vr{--bit-accent-color:#ffc640;--bit-accent-heavy:#ff991f;--bit-accent-light:#ffe380;--bit-accent-text:#ffc640;--bit-accent-text-heavy:#ff991f;--bit-text-on-accent:#0c0c0c;--bit-accent-bg:#fff5dd;--bit-accent-bg-heavy:#fff0b3}.accent-color_success__bd5oL{--bit-accent-color:#37b26c;--bit-accent-heavy:#2e945a;--bit-accent-light:#94deb4;--bit-accent-text:#37b26c;--bit-accent-text-heavy:#2e945a;--bit-text-on-accent:#fff;--bit-accent-bg:#eefaf3;--bit-accent-bg-heavy:#d0f1de}.accent-color_process__2YrEO{--bit-accent-color:#0984e3;--bit-accent-heavy:#3d5afe;--bit-accent-light:#95ccf5;--bit-accent-text:#0984e3;--bit-accent-text-heavy:#3d5afe;--bit-text-on-accent:#fff;--bit-accent-bg:#f3faff;--bit-accent-bg-heavy:#d2ecfe}.accent-color_emphasized__3yGcN{--bit-accent-color:#2b2b2b;--bit-accent-heavy:#0c0c0c;--bit-accent-light:#414141;--bit-accent-text:#2b2b2b;--bit-accent-text-heavy:#0c0c0c;--bit-text-on-accent:#fff;--bit-accent-bg:#ededed;--bit-accent-bg-heavy:#cccfd4}.accent-color_neutral__gff6l{--bit-accent-color:#414141;--bit-accent-heavy:#2b2b2b;--bit-accent-light:#6c707c;--bit-accent-text:#414141;--bit-accent-text-heavy:#2b2b2b;--bit-text-on-accent:#fff;--bit-accent-bg:#f6f6f6;--bit-accent-bg-heavy:#ededed}.button_vanillaButton__1ij7P{cursor:pointer;font:inherit;transition:all .18s ease-in-out;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}.dots-loader_dotsLoader__3X0DS{letter-spacing:.6em;text-indent:.6em}.dots-loader_dotsLoader__3X0DS>*{-webkit-animation:1.27s ease-in-out infinite both;animation:1.27s ease-in-out infinite both;-webkit-animation-name:dots-loader_scale-down__3btxF;animation-name:dots-loader_scale-down__3btxF;display:inline-block}.dots-loader_dotsLoader__3X0DS>:first-child{-webkit-animation-delay:-.37s;animation-delay:-.37s}.dots-loader_dotsLoader__3X0DS>:nth-child(2){-webkit-animation-delay:-185ms;animation-delay:-185ms}@-webkit-keyframes dots-loader_scale-down__3btxF{0%,20%,to{transform:scale(0)}60%{transform:scale(1)}}@keyframes dots-loader_scale-down__3btxF{0%,20%,to{transform:scale(0)}60%{transform:scale(1)}}.icon-button_iconButton__2YTx9{align-items:center;border-radius:8px;display:flex;padding:7px 16px;transition:background-color .3s ease-in-out}.icon-button_iconButton__2YTx9.icon-button_iconOnly__mU2Gj{padding:6px 8px}.icon-button_iconButton__2YTx9[data-priority=ghost]{background-color:#fff;background-color:var(--bit-bg-color,#fff);border:1px solid #ededed;border:1px solid var(--bit-border-color-lightest,#ededed);color:#2b2b2b;color:var(--bit-text-color-heavy,#2b2b2b)}.icon-button_iconButton__2YTx9[data-priority=ghost].icon-button_active__3NW_G{border-color:#6c5ce7;border-color:var(--bit-accent-color,#6c5ce7);color:#6c5ce7;color:var(--bit-accent-color,#6c5ce7)}.icon-button_iconButton__2YTx9[data-priority=ghost]:hover{background-color:#f6f6f6;background-color:var(--bit-bg-heavy,#f6f6f6)}.icon-button_iconButton__2YTx9[data-priority=ghost]:active{background-color:#ededed;background-color:var(--bit-bg-heaviest,#ededed)}.icon-button_iconButton__2YTx9[data-priority=ghost]:disabled:hover{background-color:#fff;background-color:var(--bit-bg-color,#fff)}.icon-button_iconButton__2YTx9[data-priority=cta]{background-color:#6c5ce7;background-color:var(--bit-accent-color,#6c5ce7);border:1px solid #6c5ce7;border:1px solid var(--bit-accent-color,#6c5ce7);color:#fff;color:var(--bit-bg-color,#fff)}.icon-button_iconButton__2YTx9[data-priority=cta]:hover:not(:disabled){background-color:#5d4aec;background-color:var(--bit-accent-heavy,#5d4aec);border:1px solid #5d4aec;border:1px solid var(--bit-accent-heavy,#5d4aec)}.icon-button_iconButton__2YTx9[data-priority=cta]:disabled{background-color:#f6f6f6;background-color:var(--bit-bg-heavy,#f6f6f6);border-color:#f6f6f6;border-color:var(--bit-bg-heavy,#f6f6f6)}.icon-button_iconButton__2YTx9:disabled{color:#babec9;color:var(--bit-border-color,#babec9);cursor:not-allowed}.icon-button_iconButton__2YTx9:focus{box-shadow:0 0 0 .125em #eceaff;box-shadow:0 0 0 .125em var(--bit-accent-bg,#eceaff);outline:none}.icon-button_icon__24uLr{color:inherit;font-size:16px}.icon-button_margin__tDWIN{margin-right:8px}.sizes_buttonSizes__2RvCY[data-size=m]{font-size:14px;height:32px}.sizes_buttonSizes__2RvCY[data-size=l]{font-size:14px;height:40px}.flex-center_flexCenter__1OE5Q{align-items:center;display:flex;flex-direction:column;justify-content:center}.error-fallback_icon__22fU3{background-color:#fff;background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='512' height='512'%3E%3Cpath fill='%23e62e5c' d='M256 512c141.385 0 256-114.615 256-256S397.385 0 256 0 0 114.615 0 256s114.615 256 256 256zm120.262-340.502-86.038 84.5 86.038 84.511c10.451 10.275 10.183 25.962 0 35.968-10.077 9.891-25.68 10.17-36.038 0l-84.222-82.743-84.235 82.743c-10.345 10.17-25.949 9.891-36.026 0-10.182-10.007-10.461-25.693 0-35.968l86.038-84.511-86.038-84.501c-10.461-10.286-10.182-25.971 0-35.978 10.077-9.891 25.681-10.159 36.026 0l84.235 82.743 84.222-82.743c10.358-10.159 25.962-9.891 36.038 0 10.183 10.007 10.451 25.692 0 35.978z'/%3E%3C/svg%3E");background-size:contain;border-radius:100%;height:24px;margin-bottom:16px;width:24px}.error-fallback_message__7TfMY{color:#e62e5c;color:var(--bit-error-color,#e62e5c);margin-bottom:8px}.error-fallback_errorFallback__3WyiR{-webkit-animation:error-fallback_enter__3s9LR .3s ease-in forwards;animation:error-fallback_enter__3s9LR .3s ease-in forwards;border:4px solid #f086a0;border:4px solid var(--bit-error-light,#f086a0);border-radius:4px;box-sizing:border-box;color:#e62e5c;color:var(--bit-error-color,#e62e5c);font-family:sans-serif;height:100%;padding:8px}.error-fallback_errorFallback__3WyiR>*{flex:none}@-webkit-keyframes error-fallback_enter__3s9LR{0%{opacity:.1}to{opacity:1}}@keyframes error-fallback_enter__3s9LR{0%{opacity:.1}to{opacity:1}}.themed-text_themedText__-5NI1{color:#6c5ce7;color:var(--bit-accent-color,#6c5ce7)}.composition-card_compositionCard__1TGzH{background-color:#fff;background-color:var(--bit-bg-color,#fff);box-shadow:var(--bit-shadow-raised-low);display:flex;flex:none;flex-direction:column;min-height:122px;min-width:199px;padding:0}.composition-card_compositionCard__1TGzH:hover .composition-card_linkToComposition__uWeCP{opacity:1;visibility:visible}.composition-card_compositionContainer__1fvHN{box-sizing:border-box;margin:auto;max-width:100%;overflow:auto;padding:16px;position:relative;transform:translateZ(0)}.composition-card_title__1pxwS{align-items:center;border-top:1px solid #ededed;border-top:1px solid var(--bit-border-color-lightest,#ededed);display:flex;flex:none;font-size:.875em;justify-content:space-between;padding:8px 16px}.composition-card_title__1pxwS>span{margin-right:8px}.composition-card_linkToComposition__uWeCP{color:#2b2b2b;color:var(--bit-text-color-heavy,#2b2b2b);opacity:0;text-decoration:none;transition:opacity .3s,visibility .3s ease-in-out;visibility:hidden}.composition-card_compositionCardError__1YDP3{border-radius:4px 4px 0 0}.compositions-overview_background__3z-mR{background:#f6f6f6;background:var(--bit-bg-dent,#f6f6f6);border:1px solid #ededed;border:1px solid var(--bit-border-color-lightest,#ededed);border-radius:6px;display:flex;max-height:500px;overflow-x:auto;padding:12px}.compositions-overview_background__3z-mR>*{margin-right:16px}.compositions-overview_background__3z-mR>:last-child{margin:0}.frame_overlayBorder__16yQg{border:2px solid #eebcc9;border:2px solid var(--bit-highlighter-color,#eebcc9);border-radius:11px;box-sizing:border-box;padding:4px;pointer-events:none;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}.frame_hidden__2sf70{display:none}.label_othersContainer__1ExfG>*{margin-bottom:8px}.label_othersContainer__1ExfG>:last-child{margin-bottom:unset}.label_othersTooltip__1HBaz{cursor:pointer;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}.label_othersTooltip__1HBaz:before{content:"▾";display:inline-block;transition:transform .3s}.label_othersTooltip__1HBaz.label_active__7E4-a:before{transform:rotate(-180deg)}.label_hidden__3j8Bq{pointer-events:none;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;visibility:hidden}.component-strip_componentStrip__3tWW4{border-radius:.5em;box-shadow:var(--bit-highlighter-shadow);display:flex;width:-webkit-fit-content;width:-moz-fit-content;width:fit-content}.component-strip_componentStrip__3tWW4>*{background:#eebcc9;background:var(--bit-highlighter-color,#eebcc9);line-height:1.5;margin-right:.125em;padding:0 .5em;transform:translateZ(0);transition:filter .3s,background-color .3s}.component-strip_componentStrip__3tWW4>:link,.component-strip_componentStrip__3tWW4>:visited{color:inherit;text-decoration:inherit}.component-strip_componentStrip__3tWW4>:link:hover,.component-strip_componentStrip__3tWW4>:visited:hover{background:#f6dae2;background:var(--bit-highlighter-color-hover,#f6dae2)}.component-strip_componentStrip__3tWW4>:link:active,.component-strip_componentStrip__3tWW4>:visited:active{background:#e79db1;background:var(--bit-highlighter-color-active,#e79db1);color:inherit}.component-strip_componentStrip__3tWW4>:first-child{border-bottom-left-radius:.5em;border-top-left-radius:.5em}.component-strip_componentStrip__3tWW4>:last-child{border-bottom-right-radius:.5em;border-top-right-radius:.5em;margin-right:unset}.element-highlighter_label__zdp2_{padding:8px}.element-highlighter_frame__Ra14a,.element-highlighter_label__zdp2_{z-index:15500}.highlighter-provider_highlighter__124yM{border:solid #ededed;border:0 solid var(--bit-border-color-lightest,#ededed);box-sizing:border-box;height:100%;transition:border .3s}.highlighter-provider_highlighter__124yM.highlighter-provider_active__oBUtA{border-width:8px;overflow:auto}.highlighter-provider_label__rMBbJ{font-family:sans-serif;font-size:12px}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
(function(root,factory){typeof exports=="object"&&typeof module=="object"?module.exports=factory():typeof define=="function"&&define.amd?define([],factory):typeof exports=="object"?exports["teambit.harmony/node-preview"]=factory():root["teambit.harmony/node-preview"]=factory()})(self,function(){return(()=>{var __webpack_modules__={88244:module2=>{function _interopRequireDefault(obj){return obj&&obj.__esModule?obj:{default:obj}}module2.exports=_interopRequireDefault},
|
|
1
|
+
(function(root,factory){typeof exports=="object"&&typeof module=="object"?module.exports=factory():typeof define=="function"&&define.amd?define([],factory):typeof exports=="object"?exports["teambit.harmony/node-preview"]=factory():root["teambit.harmony/node-preview"]=factory()})(self,function(){return(()=>{var __webpack_modules__={88244:module2=>{function _interopRequireDefault(obj){return obj&&obj.__esModule?obj:{default:obj}}module2.exports=_interopRequireDefault},77625:(__unused_webpack_module,__webpack_exports__2,__webpack_require__2)=>{"use strict";__webpack_require__2.r(__webpack_exports__2),__webpack_require__2.d(__webpack_exports__2,{default:()=>MDXContent});var external_React_=__webpack_require__2(63804),external_MdxJsReact_=__webpack_require__2(85057);const external_TeambitMdxUiMdxScopeContext_namespaceObject=TeambitMdxUiMdxScopeContext;var dist=__webpack_require__2(41644),_excluded=["components"];function _extends(){return _extends=Object.assign||function(target){for(var i=1;i<arguments.length;i++){var source=arguments[i];for(var key in source)Object.prototype.hasOwnProperty.call(source,key)&&(target[key]=source[key])}return target},_extends.apply(this,arguments)}function _objectWithoutProperties(source,excluded){if(source==null)return{};var target=_objectWithoutPropertiesLoose(source,excluded),key,i;if(Object.getOwnPropertySymbols){var sourceSymbolKeys=Object.getOwnPropertySymbols(source);for(i=0;i<sourceSymbolKeys.length;i++)key=sourceSymbolKeys[i],!(excluded.indexOf(key)>=0)&&(!Object.prototype.propertyIsEnumerable.call(source,key)||(target[key]=source[key]))}return target}function _objectWithoutPropertiesLoose(source,excluded){if(source==null)return{};var target={},sourceKeys=Object.keys(source),key,i;for(i=0;i<sourceKeys.length;i++)key=sourceKeys[i],!(excluded.indexOf(key)>=0)&&(target[key]=source[key]);return target}var layoutProps={},MDXLayout="wrapper";function MDXContent(_ref){var components=_ref.components,props=_objectWithoutProperties(_ref,_excluded);return(0,external_MdxJsReact_.mdx)(MDXLayout,_extends({},layoutProps,props,{components,mdxType:"MDXLayout"}),(0,external_MdxJsReact_.mdx)(external_TeambitMdxUiMdxScopeContext_namespaceObject.MDXScopeProvider,{components:{Node:dist.N},mdxType:"MDXScopeProvider"},(0,external_MdxJsReact_.mdx)(dist.N,{mdxType:"Node"})))}MDXContent.isMDXComponent=!0},41644:(__unused_webpack_module,exports2,__webpack_require__2)=>{"use strict";var __webpack_unused_export__,__bit_component={id:"teambit.harmony/aspect-docs/node@0.0.136",homepage:"https://bit.dev/teambit/harmony/aspect-docs/node",exported:!0};__webpack_unused_export__={value:!0},Object.defineProperty(exports2,"N",{enumerable:!0,get:function(){return _node.default}});var _node=_interopRequireDefault(__webpack_require__2(69781));function _interopRequireDefault(obj){return obj&&obj.__esModule?obj:{default:obj}}_interopRequireDefault.__bit_component=__bit_component},69781:(__unused_webpack_module,exports2,__webpack_require__2)=>{"use strict";var __bit_component={id:"teambit.harmony/aspect-docs/node@0.0.136",homepage:"https://bit.dev/teambit/harmony/aspect-docs/node",exported:!0};Object.defineProperty(exports2,"__esModule",{value:!0}),exports2.default=MDXContent;var _react=_interopRequireDefault(__webpack_require__2(63804)),_react2=__webpack_require__2(85057),_excluded=["components"];function _interopRequireDefault(obj){return obj&&obj.__esModule?obj:{default:obj}}_interopRequireDefault.__bit_component=__bit_component;function _extends(){return _extends=Object.assign||function(target){for(var i=1;i<arguments.length;i++){var source=arguments[i];for(var key in source)Object.prototype.hasOwnProperty.call(source,key)&&(target[key]=source[key])}return target},_extends.apply(this,arguments)}_extends.__bit_component=__bit_component;function _objectWithoutProperties(source,excluded){if(source==null)return{};var target=_objectWithoutPropertiesLoose(source,excluded),key,i;if(Object.getOwnPropertySymbols){var sourceSymbolKeys=Object.getOwnPropertySymbols(source);for(i=0;i<sourceSymbolKeys.length;i++)key=sourceSymbolKeys[i],!(excluded.indexOf(key)>=0)&&(!Object.prototype.propertyIsEnumerable.call(source,key)||(target[key]=source[key]))}return target}_objectWithoutProperties.__bit_component=__bit_component;function _objectWithoutPropertiesLoose(source,excluded){if(source==null)return{};var target={},sourceKeys=Object.keys(source),key,i;for(i=0;i<sourceKeys.length;i++)key=sourceKeys[i],!(excluded.indexOf(key)>=0)&&(target[key]=source[key]);return target}_objectWithoutPropertiesLoose.__bit_component=__bit_component;var layoutProps={},MDXLayout="wrapper";function MDXContent(_ref){var components=_ref.components,props=_objectWithoutProperties(_ref,_excluded);return(0,_react2.mdx)(MDXLayout,_extends({},layoutProps,props,{components,mdxType:"MDXLayout"}),(0,_react2.mdx)("p",null,"The built-in ",(0,_react2.mdx)("a",{parentName:"p",href:"https://bit.dev/teambit/harmony/node"},"Node Component Development Environment")," is a concrete composition of the ",(0,_react2.mdx)("a",{parentName:"p",href:"https://bit.dev/teambit/envs/envs"},"Env Aspect"),". Use it when getting started with Node components with Bit and later as a base for any future customization of your Node-based workflow."),(0,_react2.mdx)("p",null,"Node environment is composed out of the base ",(0,_react2.mdx)("a",{parentName:"p",href:"https://bit.dev/teambit/react/react"},"React Environment")," with some specific overrides for dependency management."),(0,_react2.mdx)("h2",null,"Use Node environment"),(0,_react2.mdx)("p",null,"To use this environment for your components, add it to any of the ",(0,_react2.mdx)("inlineCode",{parentName:"p"},"variants")," in your ",(0,_react2.mdx)("inlineCode",{parentName:"p"},"workspace.jsonc")," file as follows:"),(0,_react2.mdx)("pre",null,(0,_react2.mdx)("code",{parentName:"pre",className:"language-json",metastring:'title="workspace.jsonc"',title:'"workspace.jsonc"'},`{
|
|
2
2
|
"teambit.workspace/variants": {
|
|
3
3
|
"some/path": {
|
|
4
4
|
"teambit.harmony/node": {}
|
|
@@ -169,4 +169,4 @@ export class CustomNode {
|
|
|
169
169
|
// ...
|
|
170
170
|
}
|
|
171
171
|
}
|
|
172
|
-
`)))}MDXContent.__bit_component=__bit_component,MDXContent.isMDXComponent=!0},
|
|
172
|
+
`)))}MDXContent.__bit_component=__bit_component,MDXContent.isMDXComponent=!0},1745:(__unused_webpack_module,exports2,__webpack_require__2)=>{"use strict";var __bit_component={id:"teambit.harmony/node@0.0.709",homepage:"https://bit.dev/teambit/harmony/node",exported:!0},_interopRequireDefault=__webpack_require__2(88244);Object.defineProperty(exports2,"__esModule",{value:!0}),exports2.Logo=void 0;function _react(){const data=_interopRequireDefault(__webpack_require__2(63804));return _react=function(){return data},data}_react.__bit_component=__bit_component;const Logo=()=>_react().default.createElement("div",{style:{height:"100%",display:"flex",justifyContent:"center"}},_react().default.createElement("img",{style:{width:70},src:"https://static.bit.dev/extensions-icons/node.svg"}));Logo.__bit_component=__bit_component,exports2.Logo=Logo},85057:module2=>{"use strict";module2.exports=MdxJsReact},63804:module2=>{"use strict";module2.exports=React}},__webpack_module_cache__={};function __webpack_require__(moduleId){var cachedModule=__webpack_module_cache__[moduleId];if(cachedModule!==void 0)return cachedModule.exports;var module2=__webpack_module_cache__[moduleId]={exports:{}};return __webpack_modules__[moduleId](module2,module2.exports,__webpack_require__),module2.exports}__webpack_require__.d=(exports2,definition)=>{for(var key in definition)__webpack_require__.o(definition,key)&&!__webpack_require__.o(exports2,key)&&Object.defineProperty(exports2,key,{enumerable:!0,get:definition[key]})},__webpack_require__.o=(obj,prop)=>Object.prototype.hasOwnProperty.call(obj,prop),__webpack_require__.r=exports2=>{typeof Symbol<"u"&&Symbol.toStringTag&&Object.defineProperty(exports2,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(exports2,"__esModule",{value:!0})};var __webpack_exports__={};return(()=>{"use strict";__webpack_require__.r(__webpack_exports__),__webpack_require__.d(__webpack_exports__,{compositions:()=>compositions,overview:()=>overview});const compositions=[__webpack_require__(1745)],overview=[__webpack_require__(77625)]})(),__webpack_exports__})()});
|
|
File without changes
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.aspectFile = aspectFile;
|
|
7
|
+
|
|
8
|
+
function aspectFile({
|
|
9
|
+
namePascalCase: Name,
|
|
10
|
+
componentId
|
|
11
|
+
}) {
|
|
12
|
+
return `import { Aspect } from '@teambit/harmony';
|
|
13
|
+
|
|
14
|
+
export const ${Name}Aspect = Aspect.create({
|
|
15
|
+
id: '${componentId}',
|
|
16
|
+
});
|
|
17
|
+
`;
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
//# sourceMappingURL=aspect.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["aspect.ts"],"names":["aspectFile","namePascalCase","Name","componentId"],"mappings":";;;;;;;AAEO,SAASA,UAAT,CAAoB;AAAEC,EAAAA,cAAc,EAAEC,IAAlB;AAAwBC,EAAAA;AAAxB,CAApB,EAA6E;AAClF,SAAQ;AACV;AACA,eAAeD,IAAK;AACpB,SAASC,WAAY;AACrB;AACA,CALE;AAMD","sourcesContent":["import { ComponentContext } from '@teambit/generator';\n\nexport function aspectFile({ namePascalCase: Name, componentId }: ComponentContext) {\n return `import { Aspect } from '@teambit/harmony';\n\nexport const ${Name}Aspect = Aspect.create({\n id: '${componentId}',\n});\n`;\n}\n"]}
|
|
@@ -1 +1,2 @@
|
|
|
1
|
-
|
|
1
|
+
import { ComponentContext } from '@teambit/generator';
|
|
2
|
+
export declare function docFile({ name, componentId }: ComponentContext): string;
|
|
@@ -5,15 +5,183 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
5
5
|
});
|
|
6
6
|
exports.docFile = docFile;
|
|
7
7
|
|
|
8
|
-
function docFile(
|
|
8
|
+
function docFile({
|
|
9
|
+
name,
|
|
10
|
+
componentId
|
|
11
|
+
}) {
|
|
9
12
|
return `---
|
|
10
|
-
|
|
11
|
-
|
|
13
|
+
description: 'A standard Node component development environment'
|
|
14
|
+
labels: ['node', 'typescript', 'env', 'extension']
|
|
12
15
|
---
|
|
13
16
|
|
|
14
|
-
|
|
17
|
+
## Overview
|
|
15
18
|
|
|
16
|
-
|
|
19
|
+
A customized version which extends the default Node component development environment created by teambit.
|
|
20
|
+
|
|
21
|
+
This environment can be applied to all your components or a set of components via the command \`bit env set <pattern or component_id> ${componentId}\`, or under the variants of your \`workspace.json\` file.
|
|
22
|
+
That means they will use your custom environment instead of the default environment. Environment components are just like any other Bit components in that they can be
|
|
23
|
+
exported and then shared and used in various projects which makes it easier to create standards when working with many teams.
|
|
24
|
+
|
|
25
|
+
### Usage instructions
|
|
26
|
+
|
|
27
|
+
#### Recommended usage:
|
|
28
|
+
|
|
29
|
+
Run the command \`bit env set <"pattern" or component_id> ${componentId}\` where the pattern is a glob pattern to select multiple components. This will put the env
|
|
30
|
+
config in your component's entry in the \`.bitmap\` file.
|
|
31
|
+
|
|
32
|
+
:::Note - this will override any variants policy that tries to set an env for this component in the workspace.jsonc
|
|
33
|
+
:::
|
|
34
|
+
|
|
35
|
+
#### Alternative Usage
|
|
36
|
+
Under the **variant** section of your \`workspace.json\` file choose which components you want to have the custom environment set. You can find the id of the extension in the \`${name}.aspect.ts\` file.
|
|
37
|
+
|
|
38
|
+
\`\`\`json
|
|
39
|
+
{
|
|
40
|
+
"teambit.workspace/variants": {
|
|
41
|
+
"{ui/**}, {pages/**}": {
|
|
42
|
+
"${componentId}": {}
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
\`\`\`
|
|
47
|
+
|
|
48
|
+
This usage may be deprecated in future in favour of the recommended usage above
|
|
49
|
+
|
|
50
|
+
## Runtime Configurations
|
|
51
|
+
|
|
52
|
+
Extend the \`main.runtime\` file when you want to add custom configurations at runtime.
|
|
53
|
+
|
|
54
|
+
### Compilation
|
|
55
|
+
|
|
56
|
+
By default, Component compilation is done with the TypeScript compiler. Target format is \`ES2015\` which
|
|
57
|
+
supports execution from both NodeJS and browser runtimes for server-side rendering. You can modify the \`tsconfig.json\` file to add your own compiler options which will then be merged with the default configs set by teambit.
|
|
58
|
+
|
|
59
|
+
Example:
|
|
60
|
+
|
|
61
|
+
\`\`\`json
|
|
62
|
+
{
|
|
63
|
+
"compilerOptions": {
|
|
64
|
+
"target": "es2017",
|
|
65
|
+
"module": "es2015",
|
|
66
|
+
"moduleResolution": "node",
|
|
67
|
+
"lib": ["es2017", "dom"],
|
|
68
|
+
"experimentalDecorators": true,
|
|
69
|
+
"esModuleInterop": true,
|
|
70
|
+
"outDir": "dist",
|
|
71
|
+
"sourceMap": true,
|
|
72
|
+
"emitDecoratorMetadata": true,
|
|
73
|
+
"allowJs": true,
|
|
74
|
+
"baseUrl": ".",
|
|
75
|
+
"jsx": "react"
|
|
76
|
+
}
|
|
77
|
+
}
|
|
78
|
+
\`\`\`
|
|
79
|
+
|
|
80
|
+
### Testing
|
|
81
|
+
|
|
82
|
+
Component testing is done through [Jest](https://jestjs.io/) with the default \`teambit.react/react\` environment. You can modify the \`jestconfig.js\` file to add your own configurations which will then be merged with the default configs set by teambit.
|
|
83
|
+
|
|
84
|
+
Example:
|
|
85
|
+
|
|
86
|
+
To Override the Jest config to ignore transpiling from specific folders add this to the \`jestconfig.js\` file:
|
|
87
|
+
|
|
88
|
+
\`\`\`js
|
|
89
|
+
const reactJestConfig = require('@teambit/react/jest/jest.config');
|
|
90
|
+
module.exports = {
|
|
91
|
+
...reactJestConfig,
|
|
92
|
+
transformIgnorePatterns: ['/node_modules/(?!(prop-types|@teambit))']
|
|
93
|
+
};
|
|
94
|
+
\`\`\`
|
|
95
|
+
|
|
96
|
+
### Webpack
|
|
97
|
+
|
|
98
|
+
Bit uses webpack 5 to bundle components. You can modify the \`webpack.config.js\` file to add your own configurations which will then be merged with the default configs set by teambit.
|
|
99
|
+
|
|
100
|
+
Example:
|
|
101
|
+
|
|
102
|
+
\`\`\`ts
|
|
103
|
+
module.exports = {
|
|
104
|
+
module: {
|
|
105
|
+
// add your custom rules here
|
|
106
|
+
rules: []
|
|
107
|
+
}
|
|
108
|
+
};
|
|
109
|
+
\`\`\`
|
|
110
|
+
|
|
111
|
+
### ESLint
|
|
112
|
+
|
|
113
|
+
Bit uses ESLint to lint your components. You can add your own rules in the \`${name}.main.runtime\` file.
|
|
114
|
+
|
|
115
|
+
Example:
|
|
116
|
+
|
|
117
|
+
\`\`\`ts
|
|
118
|
+
react.useEslint({
|
|
119
|
+
transformers: [
|
|
120
|
+
(config) => {
|
|
121
|
+
config.setRule('no-console', ['error']);
|
|
122
|
+
// add more rules here
|
|
123
|
+
return config;
|
|
124
|
+
}
|
|
125
|
+
]
|
|
126
|
+
}),
|
|
127
|
+
\`\`\`
|
|
128
|
+
|
|
129
|
+
To use ESLint:
|
|
130
|
+
|
|
131
|
+
\`\`\`bash
|
|
132
|
+
bit lint
|
|
133
|
+
bit lint --fix
|
|
134
|
+
\`\`\`
|
|
135
|
+
|
|
136
|
+
### Formatting
|
|
137
|
+
|
|
138
|
+
Bit uses Prettier to format your components. You can add your own rules in the \`${name}.main.runtime\` file.
|
|
139
|
+
|
|
140
|
+
Example:
|
|
141
|
+
|
|
142
|
+
\`\`\`ts
|
|
143
|
+
react.usePrettier({
|
|
144
|
+
transformers: [
|
|
145
|
+
(config) => {
|
|
146
|
+
config.setKey('tabWidth', 2);
|
|
147
|
+
// add more rules here
|
|
148
|
+
return config;
|
|
149
|
+
}
|
|
150
|
+
]
|
|
151
|
+
}),
|
|
152
|
+
\`\`\`
|
|
153
|
+
|
|
154
|
+
To use Prettier:
|
|
155
|
+
|
|
156
|
+
\`\`\`bash
|
|
157
|
+
bit format --check
|
|
158
|
+
bit format
|
|
159
|
+
\`\`\`
|
|
160
|
+
|
|
161
|
+
### Dependencies
|
|
162
|
+
|
|
163
|
+
Override the default dependencies in the \`${name}.main.runtime\` file to include react types of a different version for example.
|
|
164
|
+
|
|
165
|
+
\`\`\`ts
|
|
166
|
+
react.overrideDependencies({
|
|
167
|
+
devDependencies: {
|
|
168
|
+
'@types/react': '17.0.3'
|
|
169
|
+
}
|
|
170
|
+
});
|
|
171
|
+
\`\`\`
|
|
172
|
+
|
|
173
|
+
## Preview Configurations
|
|
174
|
+
|
|
175
|
+
Extend the \`${name}.preview.runtime\` file when you want to add your own customizations only for previewing in the Bit UI.
|
|
176
|
+
|
|
177
|
+
### Adding a Theme
|
|
178
|
+
|
|
179
|
+
A custom theme has been added to the env which wraps all the composition files with the required theme so they can be developed with the correct themeing rather than the browsers default. This is added only in the preview runtime and not in the main runtime meaning it is only applied to compositions and not when consuming components. Adding a theme when consuming should be done at App level as you component may be consumed in various apps and have different themes applied depending on where it is consumed.
|
|
180
|
+
|
|
181
|
+
Example:
|
|
182
|
+
|
|
183
|
+
\`\`\`ts
|
|
184
|
+
react.registerProvider([ThemeCompositions]);
|
|
17
185
|
`;
|
|
18
186
|
}
|
|
19
187
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["doc.ts"],"names":["docFile"],"mappings":";;;;;;;
|
|
1
|
+
{"version":3,"sources":["doc.ts"],"names":["docFile","name","componentId"],"mappings":";;;;;;;AAEO,SAASA,OAAT,CAAiB;AAAEC,EAAAA,IAAF;AAAQC,EAAAA;AAAR,CAAjB,EAA0D;AAC/D,SAAQ;AACV;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,wIAAwIA,WAAY;AACpJ;AACA;AACA;AACA;AACA;AACA;AACA;AACA,4DAA4DA,WAAY;AACxE;AACA;AACA;AACA;AACA;AACA;AACA,mLAAmLD,IAAK;AACxL;AACA;AACA;AACA;AACA;AACA,SAASC,WAAY;AACrB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,+EAA+ED,IAAK;AACpF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,mFAAmFA,IAAK;AACxF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,6CAA6CA,IAAK;AAClD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAeA,IAAK;AACpB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CA7KE;AA8KD","sourcesContent":["import { ComponentContext } from '@teambit/generator';\n\nexport function docFile({ name, componentId }: ComponentContext) {\n return `---\ndescription: 'A standard Node component development environment'\nlabels: ['node', 'typescript', 'env', 'extension']\n---\n\n## Overview\n\nA customized version which extends the default Node component development environment created by teambit.\n\nThis environment can be applied to all your components or a set of components via the command \\`bit env set <pattern or component_id> ${componentId}\\`, or under the variants of your \\`workspace.json\\` file.\nThat means they will use your custom environment instead of the default environment. Environment components are just like any other Bit components in that they can be\nexported and then shared and used in various projects which makes it easier to create standards when working with many teams.\n\n### Usage instructions\n\n#### Recommended usage:\n\nRun the command \\`bit env set <\"pattern\" or component_id> ${componentId}\\` where the pattern is a glob pattern to select multiple components. This will put the env\nconfig in your component's entry in the \\`.bitmap\\` file.\n\n:::Note - this will override any variants policy that tries to set an env for this component in the workspace.jsonc\n:::\n\n#### Alternative Usage\nUnder the **variant** section of your \\`workspace.json\\` file choose which components you want to have the custom environment set. You can find the id of the extension in the \\`${name}.aspect.ts\\` file.\n\n\\`\\`\\`json\n{\n \"teambit.workspace/variants\": {\n \"{ui/**}, {pages/**}\": {\n \"${componentId}\": {}\n }\n }\n}\n\\`\\`\\`\n\nThis usage may be deprecated in future in favour of the recommended usage above\n\n## Runtime Configurations\n\nExtend the \\`main.runtime\\` file when you want to add custom configurations at runtime.\n\n### Compilation\n\nBy default, Component compilation is done with the TypeScript compiler. Target format is \\`ES2015\\` which\nsupports execution from both NodeJS and browser runtimes for server-side rendering. You can modify the \\`tsconfig.json\\` file to add your own compiler options which will then be merged with the default configs set by teambit.\n\nExample:\n\n\\`\\`\\`json\n{\n \"compilerOptions\": {\n \"target\": \"es2017\",\n \"module\": \"es2015\",\n \"moduleResolution\": \"node\",\n \"lib\": [\"es2017\", \"dom\"],\n \"experimentalDecorators\": true,\n \"esModuleInterop\": true,\n \"outDir\": \"dist\",\n \"sourceMap\": true,\n \"emitDecoratorMetadata\": true,\n \"allowJs\": true,\n \"baseUrl\": \".\",\n \"jsx\": \"react\"\n }\n}\n\\`\\`\\`\n\n### Testing\n\nComponent testing is done through [Jest](https://jestjs.io/) with the default \\`teambit.react/react\\` environment. You can modify the \\`jestconfig.js\\` file to add your own configurations which will then be merged with the default configs set by teambit.\n\nExample:\n\nTo Override the Jest config to ignore transpiling from specific folders add this to the \\`jestconfig.js\\` file:\n\n\\`\\`\\`js\nconst reactJestConfig = require('@teambit/react/jest/jest.config');\nmodule.exports = {\n ...reactJestConfig,\n transformIgnorePatterns: ['/node_modules/(?!(prop-types|@teambit))']\n};\n\\`\\`\\`\n\n### Webpack\n\nBit uses webpack 5 to bundle components. You can modify the \\`webpack.config.js\\` file to add your own configurations which will then be merged with the default configs set by teambit.\n\nExample:\n\n\\`\\`\\`ts\nmodule.exports = {\n module: {\n // add your custom rules here\n rules: []\n }\n};\n\\`\\`\\`\n\n### ESLint\n\nBit uses ESLint to lint your components. You can add your own rules in the \\`${name}.main.runtime\\` file.\n\nExample:\n\n\\`\\`\\`ts\nreact.useEslint({\n transformers: [\n (config) => {\n config.setRule('no-console', ['error']);\n // add more rules here\n return config;\n }\n ]\n}),\n\\`\\`\\`\n\nTo use ESLint:\n\n\\`\\`\\`bash\nbit lint\nbit lint --fix\n\\`\\`\\`\n\n### Formatting\n\nBit uses Prettier to format your components. You can add your own rules in the \\`${name}.main.runtime\\` file.\n\nExample:\n\n\\`\\`\\`ts\nreact.usePrettier({\n transformers: [\n (config) => {\n config.setKey('tabWidth', 2);\n // add more rules here\n return config;\n }\n ]\n}),\n\\`\\`\\`\n\nTo use Prettier:\n\n\\`\\`\\`bash\nbit format --check\nbit format\n\\`\\`\\`\n\n### Dependencies\n\nOverride the default dependencies in the \\`${name}.main.runtime\\` file to include react types of a different version for example.\n\n\\`\\`\\`ts\nreact.overrideDependencies({\n devDependencies: {\n '@types/react': '17.0.3'\n }\n});\n\\`\\`\\`\n\n## Preview Configurations\n\nExtend the \\`${name}.preview.runtime\\` file when you want to add your own customizations only for previewing in the Bit UI.\n\n### Adding a Theme\n\nA custom theme has been added to the env which wraps all the composition files with the required theme so they can be developed with the correct themeing rather than the browsers default. This is added only in the preview runtime and not in the main runtime meaning it is only applied to compositions and not when consuming components. Adding a theme when consuming should be done at App level as you component may be consumed in various apps and have different themes applied depending on where it is consumed.\n\nExample:\n\n\\`\\`\\`ts\nreact.registerProvider([ThemeCompositions]);\n`;\n}\n"]}
|
|
@@ -9,9 +9,11 @@ function indexFile({
|
|
|
9
9
|
namePascalCase: Name,
|
|
10
10
|
name
|
|
11
11
|
}) {
|
|
12
|
-
return `import { ${Name}
|
|
13
|
-
|
|
14
|
-
export
|
|
12
|
+
return `import { ${Name}Aspect } from './${name}.aspect';
|
|
13
|
+
|
|
14
|
+
export type { ${Name}Main } from './${name}.main.runtime';
|
|
15
|
+
export default ${Name}Aspect;
|
|
16
|
+
export { ${Name}Aspect };
|
|
15
17
|
`;
|
|
16
18
|
}
|
|
17
19
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["index.ts"],"names":["indexFile","namePascalCase","Name","name"],"mappings":";;;;;;;AAEO,SAASA,SAAT,CAAmB;AAAEC,EAAAA,cAAc,EAAEC,IAAlB;AAAwBC,EAAAA;AAAxB,CAAnB,EAAqE;AAC1E,SAAQ,YAAWD,IAAK,
|
|
1
|
+
{"version":3,"sources":["index.ts"],"names":["indexFile","namePascalCase","Name","name"],"mappings":";;;;;;;AAEO,SAASA,SAAT,CAAmB;AAAEC,EAAAA,cAAc,EAAEC,IAAlB;AAAwBC,EAAAA;AAAxB,CAAnB,EAAqE;AAC1E,SAAQ,YAAWD,IAAK,oBAAmBC,IAAK;AAClD;AACA,gBAAgBD,IAAK,kBAAiBC,IAAK;AAC3C,iBAAiBD,IAAK;AACtB,WAAWA,IAAK;AAChB,CALE;AAMD","sourcesContent":["import { ComponentContext } from '@teambit/generator';\n\nexport function indexFile({ namePascalCase: Name, name }: ComponentContext) {\n return `import { ${Name}Aspect } from './${name}.aspect';\n\nexport type { ${Name}Main } from './${name}.main.runtime';\nexport default ${Name}Aspect;\nexport { ${Name}Aspect };\n`;\n}\n"]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function jestConfigFile(): string;
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.jestConfigFile = jestConfigFile;
|
|
7
|
+
|
|
8
|
+
function jestConfigFile() {
|
|
9
|
+
return `
|
|
10
|
+
// Override the Jest config to ignore transpiling from specific folders
|
|
11
|
+
// See the base Jest config: https://bit.cloud/teambit/react/react/~code/jest/jest.config.js
|
|
12
|
+
|
|
13
|
+
// const reactJestConfig = require('@teambit/react/jest/jest.config');
|
|
14
|
+
// uncomment the line below and install the package if you want to use this function
|
|
15
|
+
// const {
|
|
16
|
+
// generateNodeModulesPattern,
|
|
17
|
+
// } = require('@teambit/dependencies.modules.packages-excluder');
|
|
18
|
+
// const packagesToExclude = ['@my-org', 'my-package-name'];
|
|
19
|
+
|
|
20
|
+
// module.exports = {
|
|
21
|
+
// ...reactJestConfig,
|
|
22
|
+
// transformIgnorePatterns: [
|
|
23
|
+
// '^.+\\.module\\.(css|sass|scss)$',
|
|
24
|
+
// generateNodeModulesPattern({ packages: packagesToExclude }),
|
|
25
|
+
// ],
|
|
26
|
+
// };
|
|
27
|
+
`;
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
//# sourceMappingURL=jest.config.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["jest.config.ts"],"names":["jestConfigFile"],"mappings":";;;;;;;AAAO,SAASA,cAAT,GAA0B;AAC/B,SAAQ;AACV;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,GAlBE;AAmBD","sourcesContent":["export function jestConfigFile() {\n return `\n // Override the Jest config to ignore transpiling from specific folders\n // See the base Jest config: https://bit.cloud/teambit/react/react/~code/jest/jest.config.js\n\n // const reactJestConfig = require('@teambit/react/jest/jest.config');\n // uncomment the line below and install the package if you want to use this function\n // const {\n // generateNodeModulesPattern,\n // } = require('@teambit/dependencies.modules.packages-excluder');\n // const packagesToExclude = ['@my-org', 'my-package-name'];\n\n // module.exports = {\n // ...reactJestConfig,\n // transformIgnorePatterns: [\n // '^.+\\\\.module\\\\.(css|sass|scss)$',\n // generateNodeModulesPattern({ packages: packagesToExclude }),\n // ],\n // };\n `;\n}\n"]}
|
|
@@ -0,0 +1,103 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.mainRuntimeFile = mainRuntimeFile;
|
|
7
|
+
|
|
8
|
+
function mainRuntimeFile({
|
|
9
|
+
namePascalCase: Name,
|
|
10
|
+
name
|
|
11
|
+
}) {
|
|
12
|
+
return `import { MainRuntime } from '@teambit/cli';
|
|
13
|
+
import { NodeAspect, NodeMain } from '@teambit/node'
|
|
14
|
+
import { EnvsAspect, EnvsMain } from '@teambit/envs';
|
|
15
|
+
import { ${Name}Aspect } from './${name}.aspect';
|
|
16
|
+
//import {
|
|
17
|
+
// previewConfigTransformer,
|
|
18
|
+
// devServerConfigTransformer
|
|
19
|
+
//} from './webpack/webpack-transformers';
|
|
20
|
+
//import {
|
|
21
|
+
// devConfigTransformer,
|
|
22
|
+
// buildConfigTransformer,
|
|
23
|
+
//} from "./typescript/ts-transformers";
|
|
24
|
+
|
|
25
|
+
export class ${Name}Main {
|
|
26
|
+
static slots = [];
|
|
27
|
+
|
|
28
|
+
static dependencies = [NodeAspect, EnvsAspect];
|
|
29
|
+
|
|
30
|
+
static runtime = MainRuntime;
|
|
31
|
+
|
|
32
|
+
//const webpackModifiers: UseWebpackModifiers = {
|
|
33
|
+
// previewConfig: [previewConfigTransformer],
|
|
34
|
+
// devServerConfig: [devServerConfigTransformer],
|
|
35
|
+
//};
|
|
36
|
+
|
|
37
|
+
//const tsModifiers: UseTypescriptModifiers = {
|
|
38
|
+
// devConfig: [devConfigTransformer],
|
|
39
|
+
// buildConfig: [buildConfigTransformer],
|
|
40
|
+
//};
|
|
41
|
+
|
|
42
|
+
static async provider([node, envs]: [NodeMain, EnvsMain]) {
|
|
43
|
+
const ${Name}Env = node.compose([
|
|
44
|
+
/**
|
|
45
|
+
* Uncomment to override the config files for TypeScript, Webpack or Jest
|
|
46
|
+
* Your config gets merged with the defaults
|
|
47
|
+
*/
|
|
48
|
+
|
|
49
|
+
// node.useTypescript(tsModifiers), // note: this cannot be used in conjunction with node.overrideCompiler
|
|
50
|
+
// node.useWebpack(webpackModifiers),
|
|
51
|
+
// node.overrideJestConfig(require.resolve('./jest/jest.config')),
|
|
52
|
+
|
|
53
|
+
/**
|
|
54
|
+
* override the ESLint default config here then check your files for lint errors
|
|
55
|
+
* @example
|
|
56
|
+
* bit lint
|
|
57
|
+
* bit lint --fix
|
|
58
|
+
*/
|
|
59
|
+
node.useEslint({
|
|
60
|
+
transformers: [
|
|
61
|
+
(config) => {
|
|
62
|
+
config.setRule('no-console', ['error']);
|
|
63
|
+
return config;
|
|
64
|
+
}
|
|
65
|
+
]
|
|
66
|
+
}),
|
|
67
|
+
|
|
68
|
+
/**
|
|
69
|
+
* override the Prettier default config here the check your formatting
|
|
70
|
+
* @example
|
|
71
|
+
* bit format --check
|
|
72
|
+
* bit format
|
|
73
|
+
*/
|
|
74
|
+
node.usePrettier({
|
|
75
|
+
transformers: [
|
|
76
|
+
(config) => {
|
|
77
|
+
config.setKey('tabWidth', 2);
|
|
78
|
+
return config;
|
|
79
|
+
}
|
|
80
|
+
]
|
|
81
|
+
}),
|
|
82
|
+
|
|
83
|
+
/**
|
|
84
|
+
* override dependencies here
|
|
85
|
+
* @example
|
|
86
|
+
* Uncomment types to include version 17.0.3 of the types package
|
|
87
|
+
*/
|
|
88
|
+
node.overrideDependencies({
|
|
89
|
+
devDependencies: {
|
|
90
|
+
// '@types/node': '16.11.7'
|
|
91
|
+
}
|
|
92
|
+
})
|
|
93
|
+
]);
|
|
94
|
+
envs.registerEnv(${Name}Env);
|
|
95
|
+
return new ${Name}Main();
|
|
96
|
+
}
|
|
97
|
+
}
|
|
98
|
+
|
|
99
|
+
${Name}Aspect.addRuntime(${Name}Main);
|
|
100
|
+
`;
|
|
101
|
+
}
|
|
102
|
+
|
|
103
|
+
//# sourceMappingURL=main.runtime.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["main.runtime.ts"],"names":["mainRuntimeFile","namePascalCase","Name","name"],"mappings":";;;;;;;AAEO,SAASA,eAAT,CAAyB;AAAEC,EAAAA,cAAc,EAAEC,IAAlB;AAAwBC,EAAAA;AAAxB,CAAzB,EAA2E;AAChF,SAAQ;AACV;AACA;AACA,WAAWD,IAAK,oBAAmBC,IAAK;AACxC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAeD,IAAK;AACpB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,YAAYA,IAAK;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,uBAAuBA,IAAK;AAC5B,iBAAiBA,IAAK;AACtB;AACA;AACA;AACA,EAAEA,IAAK,qBAAoBA,IAAK;AAChC,CAxFE;AAyFD","sourcesContent":["import { ComponentContext } from '@teambit/generator';\n\nexport function mainRuntimeFile({ namePascalCase: Name, name }: ComponentContext) {\n return `import { MainRuntime } from '@teambit/cli';\nimport { NodeAspect, NodeMain } from '@teambit/node'\nimport { EnvsAspect, EnvsMain } from '@teambit/envs';\nimport { ${Name}Aspect } from './${name}.aspect';\n//import {\n// previewConfigTransformer,\n// devServerConfigTransformer\n//} from './webpack/webpack-transformers';\n//import {\n// devConfigTransformer,\n// buildConfigTransformer,\n//} from \"./typescript/ts-transformers\";\n\nexport class ${Name}Main {\n static slots = [];\n\n static dependencies = [NodeAspect, EnvsAspect];\n\n static runtime = MainRuntime;\n\n //const webpackModifiers: UseWebpackModifiers = {\n // previewConfig: [previewConfigTransformer],\n // devServerConfig: [devServerConfigTransformer],\n //};\n\n //const tsModifiers: UseTypescriptModifiers = {\n // devConfig: [devConfigTransformer],\n // buildConfig: [buildConfigTransformer],\n //};\n\n static async provider([node, envs]: [NodeMain, EnvsMain]) {\n const ${Name}Env = node.compose([\n /**\n * Uncomment to override the config files for TypeScript, Webpack or Jest\n * Your config gets merged with the defaults\n */\n\n // node.useTypescript(tsModifiers), // note: this cannot be used in conjunction with node.overrideCompiler\n // node.useWebpack(webpackModifiers),\n // node.overrideJestConfig(require.resolve('./jest/jest.config')),\n\n /**\n * override the ESLint default config here then check your files for lint errors\n * @example\n * bit lint\n * bit lint --fix\n */\n node.useEslint({\n transformers: [\n (config) => {\n config.setRule('no-console', ['error']);\n return config;\n }\n ]\n }),\n\n /**\n * override the Prettier default config here the check your formatting\n * @example\n * bit format --check\n * bit format\n */\n node.usePrettier({\n transformers: [\n (config) => {\n config.setKey('tabWidth', 2);\n return config;\n }\n ]\n }),\n\n /**\n * override dependencies here\n * @example\n * Uncomment types to include version 17.0.3 of the types package\n */\n node.overrideDependencies({\n devDependencies: {\n // '@types/node': '16.11.7'\n }\n })\n ]);\n envs.registerEnv(${Name}Env);\n return new ${Name}Main();\n }\n}\n\n${Name}Aspect.addRuntime(${Name}Main);\n`;\n}\n"]}
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.previewRuntimeFile = previewRuntimeFile;
|
|
7
|
+
|
|
8
|
+
function previewRuntimeFile({
|
|
9
|
+
namePascalCase: Name,
|
|
10
|
+
nameCamelCase: nameCamel,
|
|
11
|
+
name
|
|
12
|
+
}) {
|
|
13
|
+
return `import { PreviewRuntime } from '@teambit/preview';
|
|
14
|
+
import { ReactAspect, ReactPreview } from '@teambit/react'; // the node env uses the react env's preview feature
|
|
15
|
+
// uncomment the line below and install the theme if you want to use our theme or create your own and import it here
|
|
16
|
+
// import { ThemeCompositions } from '@teambit/documenter.theme.theme-compositions';
|
|
17
|
+
|
|
18
|
+
import { ${Name}Aspect } from './${name}.aspect';
|
|
19
|
+
|
|
20
|
+
export class ${Name}PreviewMain {
|
|
21
|
+
static runtime = PreviewRuntime;
|
|
22
|
+
|
|
23
|
+
static dependencies = [ReactAspect];
|
|
24
|
+
|
|
25
|
+
static async provider([react]: [ReactPreview]) {
|
|
26
|
+
const ${nameCamel}PreviewMain = new ${Name}PreviewMain();
|
|
27
|
+
// uncomment the line below to register a new provider to wrap all compositions using this environment with a custom theme.
|
|
28
|
+
// react.registerProvider([ThemeCompositions]);
|
|
29
|
+
|
|
30
|
+
return ${nameCamel}PreviewMain;
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
${Name}Aspect.addRuntime(${Name}PreviewMain);
|
|
35
|
+
`;
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
//# sourceMappingURL=preview.runtime.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["preview.runtime.ts"],"names":["previewRuntimeFile","namePascalCase","Name","nameCamelCase","nameCamel","name"],"mappings":";;;;;;;AAEO,SAASA,kBAAT,CAA4B;AAAEC,EAAAA,cAAc,EAAEC,IAAlB;AAAwBC,EAAAA,aAAa,EAAEC,SAAvC;AAAkDC,EAAAA;AAAlD,CAA5B,EAAwG;AAC7G,SAAQ;AACV;AACA;AACA;AACA;AACA,WAAWH,IAAK,oBAAmBG,IAAK;AACxC;AACA,eAAeH,IAAK;AACpB;AACA;AACA;AACA;AACA;AACA,YAAYE,SAAU,qBAAoBF,IAAK;AAC/C;AACA;AACA;AACA,aAAaE,SAAU;AACvB;AACA;AACA;AACA,EAAEF,IAAK,qBAAoBA,IAAK;AAChC,CAtBE;AAuBD","sourcesContent":["import { ComponentContext } from '@teambit/generator';\n\nexport function previewRuntimeFile({ namePascalCase: Name, nameCamelCase: nameCamel, name }: ComponentContext) {\n return `import { PreviewRuntime } from '@teambit/preview';\nimport { ReactAspect, ReactPreview } from '@teambit/react'; // the node env uses the react env's preview feature\n// uncomment the line below and install the theme if you want to use our theme or create your own and import it here\n// import { ThemeCompositions } from '@teambit/documenter.theme.theme-compositions';\n\nimport { ${Name}Aspect } from './${name}.aspect';\n\nexport class ${Name}PreviewMain {\n static runtime = PreviewRuntime;\n\n static dependencies = [ReactAspect];\n\n static async provider([react]: [ReactPreview]) {\n const ${nameCamel}PreviewMain = new ${Name}PreviewMain();\n // uncomment the line below to register a new provider to wrap all compositions using this environment with a custom theme.\n // react.registerProvider([ThemeCompositions]);\n\n return ${nameCamel}PreviewMain;\n }\n}\n\n${Name}Aspect.addRuntime(${Name}PreviewMain);\n`;\n}\n"]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function globalStylesFile(): string;
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.globalStylesFile = globalStylesFile;
|
|
7
|
+
|
|
8
|
+
function globalStylesFile() {
|
|
9
|
+
return `
|
|
10
|
+
/*
|
|
11
|
+
Add your global styles here to be added for any component using this env
|
|
12
|
+
*/
|
|
13
|
+
`;
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
//# sourceMappingURL=styles.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["styles.ts"],"names":["globalStylesFile"],"mappings":";;;;;;;AAAO,SAASA,gBAAT,GAA4B;AACjC,SAAQ;AACV;AACA;AACA;AACA,GAJE;AAKD","sourcesContent":["export function globalStylesFile() {\n return `\n /*\n Add your global styles here to be added for any component using this env\n */\n `\n}\n"]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function tsTransformerFile(): string;
|