@teambit/component-sizer 1.0.108 → 1.0.110
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/preview/teambit_component_component_sizer-preview.js +1 -0
- package/dist/{preview-1703647408454.js → preview-1703733956734.js} +2 -2
- package/package.json +17 -13
- package/component-sizer.aspect.ts +0 -7
- package/component-sizer.graphql.ts +0 -46
- package/component-sizer.main.runtime.ts +0 -30
- package/index.ts +0 -5
|
@@ -0,0 +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.component/component-sizer-preview"]=t():e["teambit.component/component-sizer-preview"]=t()}(self,(()=>(()=>{"use strict";var e={16325:(e,t,o)=>{var n={id:"teambit.component/component-sizer@1.0.110",homepage:"https://bit.cloud/teambit/component/component-sizer",exported:!0};function r(){const e=i(o(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=n,i.__bit_component=n;const p=()=>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/component-sizer.svg"}));p.__bit_component=n,t.Logo=p},87363:e=>{e.exports=React}},t={};function o(n){var r=t[n];if(void 0!==r)return r.exports;var i=t[n]={exports:{}};return e[n](i,i.exports,o),i.exports}o.d=(e,t)=>{for(var n in t)o.o(t,n)&&!o.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:t[n]})},o.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),o.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})};var n={};return(()=>{o.r(n),o.d(n,{compositions:()=>m,compositions_metadata:()=>l,overview:()=>u});var e={};o.r(e),o.d(e,{default:()=>d});var t=o(16325);o(87363);const r=MdxJsReact,i=TeambitMdxUiMdxScopeContext;var p=["components"];function c(){return c=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var o=arguments[t];for(var n in o)Object.prototype.hasOwnProperty.call(o,n)&&(e[n]=o[n])}return e},c.apply(this,arguments)}var s={},a="wrapper";function d(e){var t=e.components,o=function(e,t){if(null==e)return{};var o,n,r=function(e,t){if(null==e)return{};var o,n,r={},i=Object.keys(e);for(n=0;n<i.length;n++)o=i[n],t.indexOf(o)>=0||(r[o]=e[o]);return r}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(n=0;n<i.length;n++)o=i[n],t.indexOf(o)>=0||Object.prototype.propertyIsEnumerable.call(e,o)&&(r[o]=e[o])}return r}(e,p);return(0,r.mdx)(a,c({},s,o,{components:t,mdxType:"MDXLayout"}),(0,r.mdx)(i.MDXScopeProvider,{components:{},mdxType:"MDXScopeProvider"},(0,r.mdx)("p",null,"Adds the component's minified and Gzipped bundle size to the component docs (in the badges section).")))}d.isMDXComponent=!0;const m=[t],u=[e],l={compositions:[{displayName:"Logo",identifier:"Logo"}]}})(),n})()));
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import * as compositions_0 from '/home/circleci/Library/Caches/Bit/capsules/8891be5ad3d35bfc38b9cd90c0e05b598a5a55af/teambit.component_component-sizer@1.0.
|
|
2
|
-
import * as overview_0 from '/home/circleci/Library/Caches/Bit/capsules/8891be5ad3d35bfc38b9cd90c0e05b598a5a55af/teambit.component_component-sizer@1.0.
|
|
1
|
+
import * as compositions_0 from '/home/circleci/Library/Caches/Bit/capsules/8891be5ad3d35bfc38b9cd90c0e05b598a5a55af/teambit.component_component-sizer@1.0.110/dist/component-sizer.composition.js';
|
|
2
|
+
import * as overview_0 from '/home/circleci/Library/Caches/Bit/capsules/8891be5ad3d35bfc38b9cd90c0e05b598a5a55af/teambit.component_component-sizer@1.0.110/dist/component-sizer.docs.mdx';
|
|
3
3
|
|
|
4
4
|
export const compositions = [compositions_0];
|
|
5
5
|
export const overview = [overview_0];
|
package/package.json
CHANGED
|
@@ -1,29 +1,29 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@teambit/component-sizer",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.110",
|
|
4
4
|
"homepage": "https://bit.cloud/teambit/component/component-sizer",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"componentId": {
|
|
7
7
|
"scope": "teambit.component",
|
|
8
8
|
"name": "component-sizer",
|
|
9
|
-
"version": "1.0.
|
|
9
|
+
"version": "1.0.110"
|
|
10
10
|
},
|
|
11
11
|
"dependencies": {
|
|
12
12
|
"graphql-tag": "2.12.1",
|
|
13
13
|
"@teambit/harmony": "0.4.6",
|
|
14
14
|
"@teambit/component.ui.component-size": "0.0.76",
|
|
15
|
-
"@teambit/component": "1.0.
|
|
16
|
-
"@teambit/graphql": "1.0.
|
|
17
|
-
"@teambit/cli": "0.0.
|
|
18
|
-
"@teambit/preview": "1.0.
|
|
19
|
-
"@teambit/docs": "1.0.
|
|
20
|
-
"@teambit/ui": "1.0.
|
|
15
|
+
"@teambit/component": "1.0.110",
|
|
16
|
+
"@teambit/graphql": "1.0.110",
|
|
17
|
+
"@teambit/cli": "0.0.842",
|
|
18
|
+
"@teambit/preview": "1.0.110",
|
|
19
|
+
"@teambit/docs": "1.0.110",
|
|
20
|
+
"@teambit/ui": "1.0.110"
|
|
21
21
|
},
|
|
22
22
|
"devDependencies": {
|
|
23
23
|
"@types/mocha": "9.1.0",
|
|
24
24
|
"@types/jest": "^29.2.2",
|
|
25
25
|
"@types/testing-library__jest-dom": "^5.9.5",
|
|
26
|
-
"@teambit/harmony.envs.core-aspect-env": "0.0.
|
|
26
|
+
"@teambit/harmony.envs.core-aspect-env": "0.0.15"
|
|
27
27
|
},
|
|
28
28
|
"peerDependencies": {
|
|
29
29
|
"react": "^17.0.0 || ^18.0.0",
|
|
@@ -34,11 +34,15 @@
|
|
|
34
34
|
"optionalDependencies": {},
|
|
35
35
|
"peerDependenciesMeta": {},
|
|
36
36
|
"exports": {
|
|
37
|
-
"
|
|
38
|
-
"
|
|
39
|
-
|
|
37
|
+
".": {
|
|
38
|
+
"node": {
|
|
39
|
+
"require": "./dist/index.js",
|
|
40
|
+
"import": "./dist/esm.mjs"
|
|
41
|
+
},
|
|
42
|
+
"default": "./dist/index.js"
|
|
40
43
|
},
|
|
41
|
-
"
|
|
44
|
+
"./dist/*": "./dist/*",
|
|
45
|
+
"./artifacts/*": "./artifacts/*"
|
|
42
46
|
},
|
|
43
47
|
"private": false,
|
|
44
48
|
"engines": {
|
|
@@ -1,46 +0,0 @@
|
|
|
1
|
-
import { Component } from '@teambit/component';
|
|
2
|
-
import { Schema } from '@teambit/graphql';
|
|
3
|
-
import gql from 'graphql-tag';
|
|
4
|
-
|
|
5
|
-
import { ComponentSizerMain } from './component-sizer.main.runtime';
|
|
6
|
-
|
|
7
|
-
export function componentSizerSchema(componentSizerMain: ComponentSizerMain): Schema {
|
|
8
|
-
return {
|
|
9
|
-
typeDefs: gql`
|
|
10
|
-
type ComponentSizedFile {
|
|
11
|
-
name: String
|
|
12
|
-
size: Int
|
|
13
|
-
compressedSize: Int
|
|
14
|
-
}
|
|
15
|
-
|
|
16
|
-
type ComponentSize {
|
|
17
|
-
# breakdown for the component files sizes
|
|
18
|
-
files: [ComponentSizedFile]
|
|
19
|
-
# breakdown for the component assets sizes
|
|
20
|
-
assets: [ComponentSizedFile]
|
|
21
|
-
# total size of the component files (like js and css) (without assets)
|
|
22
|
-
totalFiles: Int
|
|
23
|
-
# total size of the component assets (like pngs) (without files)
|
|
24
|
-
totalAssets: Int
|
|
25
|
-
# total size of the component files and assets
|
|
26
|
-
total: Int
|
|
27
|
-
|
|
28
|
-
compressedTotalFiles: Int
|
|
29
|
-
compressedTotalAssets: Int
|
|
30
|
-
compressedTotal: Int
|
|
31
|
-
}
|
|
32
|
-
|
|
33
|
-
extend type Component {
|
|
34
|
-
# size of the component bundle
|
|
35
|
-
size: ComponentSize
|
|
36
|
-
}
|
|
37
|
-
`,
|
|
38
|
-
resolvers: {
|
|
39
|
-
Component: {
|
|
40
|
-
size: (component: Component) => {
|
|
41
|
-
return componentSizerMain.getComponentSize(component);
|
|
42
|
-
},
|
|
43
|
-
},
|
|
44
|
-
},
|
|
45
|
-
};
|
|
46
|
-
}
|
|
@@ -1,30 +0,0 @@
|
|
|
1
|
-
import { MainRuntime } from '@teambit/cli';
|
|
2
|
-
import ComponentAspect, { Component } from '@teambit/component';
|
|
3
|
-
import GraphqlAspect, { GraphqlMain } from '@teambit/graphql';
|
|
4
|
-
import PreviewAspect, { ComponentPreviewSize, PreviewMain } from '@teambit/preview';
|
|
5
|
-
import { ComponentSizerAspect } from './component-sizer.aspect';
|
|
6
|
-
import { componentSizerSchema } from './component-sizer.graphql';
|
|
7
|
-
|
|
8
|
-
export class ComponentSizerMain {
|
|
9
|
-
constructor(
|
|
10
|
-
/**
|
|
11
|
-
* preview aspect.
|
|
12
|
-
*/
|
|
13
|
-
private preview: PreviewMain
|
|
14
|
-
) {}
|
|
15
|
-
|
|
16
|
-
getComponentSize(component: Component): ComponentPreviewSize | undefined {
|
|
17
|
-
return this.preview.getComponentBundleSize(component);
|
|
18
|
-
}
|
|
19
|
-
|
|
20
|
-
static slots = [];
|
|
21
|
-
static dependencies = [PreviewAspect, GraphqlAspect, ComponentAspect];
|
|
22
|
-
static runtime = MainRuntime;
|
|
23
|
-
static async provider([preview, graphql]: [PreviewMain, GraphqlMain]) {
|
|
24
|
-
const componentSizer = new ComponentSizerMain(preview);
|
|
25
|
-
graphql.register(componentSizerSchema(componentSizer));
|
|
26
|
-
return componentSizer;
|
|
27
|
-
}
|
|
28
|
-
}
|
|
29
|
-
|
|
30
|
-
ComponentSizerAspect.addRuntime(ComponentSizerMain);
|