@teambit/compositions 1.0.102 → 1.0.104
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,4 +1,5 @@
|
|
|
1
1
|
import { AspectData, Component, ComponentMap, IComponent } from '@teambit/component';
|
|
2
|
+
import { ScopeMain } from '@teambit/scope';
|
|
2
3
|
import { DevFilesMain } from '@teambit/dev-files';
|
|
3
4
|
import { EnvsMain } from '@teambit/envs';
|
|
4
5
|
import { GraphqlMain } from '@teambit/graphql';
|
|
@@ -97,12 +98,13 @@ export declare class CompositionsMain {
|
|
|
97
98
|
static defaultConfig: CompositionsConfig;
|
|
98
99
|
static runtime: import("@teambit/harmony").RuntimeDefinition;
|
|
99
100
|
static dependencies: import("@teambit/harmony").Aspect[];
|
|
100
|
-
static provider([preview, graphql, workspace, schema, devFiles, envs]: [
|
|
101
|
+
static provider([preview, graphql, workspace, schema, devFiles, envs, scope]: [
|
|
101
102
|
PreviewMain,
|
|
102
103
|
GraphqlMain,
|
|
103
104
|
Workspace,
|
|
104
105
|
SchemaMain,
|
|
105
106
|
DevFilesMain,
|
|
106
|
-
EnvsMain
|
|
107
|
+
EnvsMain,
|
|
108
|
+
ScopeMain
|
|
107
109
|
], config: CompositionsConfig): Promise<CompositionsMain>;
|
|
108
110
|
}
|
|
@@ -18,6 +18,13 @@ function _component() {
|
|
|
18
18
|
};
|
|
19
19
|
return data;
|
|
20
20
|
}
|
|
21
|
+
function _scope() {
|
|
22
|
+
const data = _interopRequireDefault(require("@teambit/scope"));
|
|
23
|
+
_scope = function () {
|
|
24
|
+
return data;
|
|
25
|
+
};
|
|
26
|
+
return data;
|
|
27
|
+
}
|
|
21
28
|
function _devFiles() {
|
|
22
29
|
const data = require("@teambit/dev-files");
|
|
23
30
|
_devFiles = function () {
|
|
@@ -190,8 +197,9 @@ class CompositionsMain {
|
|
|
190
197
|
return this.compositionFilePattern;
|
|
191
198
|
}
|
|
192
199
|
getComponentDevPatterns(component) {
|
|
200
|
+
var _this$workspace;
|
|
193
201
|
const env = this.envs.calculateEnv(component, {
|
|
194
|
-
skipWarnings: !!this.workspace.inInstallContext
|
|
202
|
+
skipWarnings: !!((_this$workspace = this.workspace) !== null && _this$workspace !== void 0 && _this$workspace.inInstallContext)
|
|
195
203
|
}).env;
|
|
196
204
|
const componentEnvCompositionsDevPatterns = env.getCompositionsDevPatterns ? env.getCompositionsDevPatterns(component) : [];
|
|
197
205
|
const componentPatterns = componentEnvCompositionsDevPatterns.concat(this.getCompositionFilePattern());
|
|
@@ -214,14 +222,15 @@ class CompositionsMain {
|
|
|
214
222
|
// :TODO hacked for a specific file extension now until david will take care in the compiler.
|
|
215
223
|
const pathArray = file.path.split('.');
|
|
216
224
|
pathArray[pathArray.length - 1] = 'js';
|
|
217
|
-
const
|
|
225
|
+
const modulePath = this.workspace ? (0, _path().join)(this.workspace.componentDir(component.id), file.relative) : file.relative;
|
|
226
|
+
const exports = this.schema.parseModule(modulePath, file.contents.toString());
|
|
218
227
|
return exports.map(exportModel => {
|
|
219
228
|
var _exportModel$staticPr;
|
|
220
229
|
const displayName = (_exportModel$staticPr = exportModel.staticProperties) === null || _exportModel$staticPr === void 0 ? void 0 : _exportModel$staticPr.get('compositionName');
|
|
221
230
|
return new (_composition().Composition)(exportModel.identifier, file.relative, typeof displayName === 'string' ? displayName : undefined);
|
|
222
231
|
});
|
|
223
232
|
}
|
|
224
|
-
static async provider([preview, graphql, workspace, schema, devFiles, envs], config) {
|
|
233
|
+
static async provider([preview, graphql, workspace, schema, devFiles, envs, scope], config) {
|
|
225
234
|
const compositions = new CompositionsMain(config.compositionFilePattern, config.compositionPreviewFilePattern, preview, workspace, schema, devFiles, envs);
|
|
226
235
|
|
|
227
236
|
// TODO: use the docs implementation to allow component specific pattern
|
|
@@ -229,7 +238,10 @@ class CompositionsMain {
|
|
|
229
238
|
graphql.register((0, _compositions2().compositionsSchema)(compositions));
|
|
230
239
|
preview.registerDefinition(new (_compositions3().CompositionPreviewDefinition)(compositions));
|
|
231
240
|
if (workspace) {
|
|
232
|
-
workspace.
|
|
241
|
+
workspace.registerOnComponentLoad(compositions.onComponentLoad.bind(compositions));
|
|
242
|
+
}
|
|
243
|
+
if (scope) {
|
|
244
|
+
scope.registerOnCompAspectReCalc(compositions.onComponentLoad.bind(compositions));
|
|
233
245
|
}
|
|
234
246
|
return compositions;
|
|
235
247
|
}
|
|
@@ -240,7 +252,7 @@ _defineProperty(CompositionsMain, "defaultConfig", {
|
|
|
240
252
|
compositionPreviewFilePattern: ['**/*.{t,j}s?(x)']
|
|
241
253
|
});
|
|
242
254
|
_defineProperty(CompositionsMain, "runtime", _cli().MainRuntime);
|
|
243
|
-
_defineProperty(CompositionsMain, "dependencies", [_preview().PreviewAspect, _graphql().GraphqlAspect, _workspace().WorkspaceAspect, _schema().SchemaAspect, _devFiles().DevFilesAspect, _envs().default]);
|
|
255
|
+
_defineProperty(CompositionsMain, "dependencies", [_preview().PreviewAspect, _graphql().GraphqlAspect, _workspace().WorkspaceAspect, _schema().SchemaAspect, _devFiles().DevFilesAspect, _envs().default, _scope().default]);
|
|
244
256
|
_compositions().CompositionsAspect.addRuntime(CompositionsMain);
|
|
245
257
|
|
|
246
258
|
//# sourceMappingURL=compositions.main.runtime.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_cli","data","require","_component","_devFiles","_envs","_interopRequireDefault","_graphql","_preview","_schema","_toolboxPath","_workspace","_path","_composition","_compositions","_compositions2","_compositions3","obj","__esModule","default","_defineProperty","key","value","_toPropertyKey","Object","defineProperty","enumerable","configurable","writable","arg","_toPrimitive","String","input","hint","prim","Symbol","toPrimitive","undefined","res","call","TypeError","Number","CompositionsMain","constructor","compositionFilePattern","previewFilePattern","preview","workspace","schema","devFiles","envs","getPreviewFiles","components","ComponentMap","as","component","compositionFiles","state","filesystem","byGlob","previewFiles","Set","map","file","relative","files","filter","has","isCompositionFile","filePath","includePatterns","excludePatterns","splitPatterns","matchPatterns","getCompositions","entry","get","CompositionsAspect","id","compositions","Composition","fromArray","readCompositions","maybeFiles","byComponent","computeCompositions","flat","getCompositionFilePattern","getComponentDevPatterns","env","calculateEnv","skipWarnings","inInstallContext","componentEnvCompositionsDevPatterns","getCompositionsDevPatterns","componentPatterns","concat","name","pattern","getDevPatternToRegister","bind","onComponentLoad","loadOpts","loadCompositions","composition","toObject","pathArray","path","split","length","exports","parseModule","join","componentDir","exportModel","_exportModel$staticPr","displayName","staticProperties","identifier","provider","graphql","config","compositionPreviewFilePattern","registerDevPattern","register","compositionsSchema","registerDefinition","CompositionPreviewDefinition","MainRuntime","PreviewAspect","GraphqlAspect","WorkspaceAspect","SchemaAspect","DevFilesAspect","EnvsAspect","addRuntime"],"sources":["compositions.main.runtime.ts"],"sourcesContent":["import { MainRuntime } from '@teambit/cli';\nimport { AspectData, Component, ComponentMap, IComponent } from '@teambit/component';\nimport { DevFilesAspect, DevFilesMain } from '@teambit/dev-files';\nimport EnvsAspect, { EnvsMain } from '@teambit/envs';\nimport { GraphqlAspect, GraphqlMain } from '@teambit/graphql';\nimport { ComponentLoadOptions } from '@teambit/legacy/dist/consumer/component/component-loader';\nimport { AbstractVinyl } from '@teambit/legacy/dist/consumer/component/sources';\nimport { PreviewAspect, PreviewMain } from '@teambit/preview';\nimport { SchemaAspect, SchemaMain } from '@teambit/schema';\nimport { matchPatterns, splitPatterns } from '@teambit/toolbox.path.match-patterns';\nimport { Workspace, WorkspaceAspect } from '@teambit/workspace';\nimport { join } from 'path';\nimport { Composition } from './composition';\nimport { CompositionsAspect } from './compositions.aspect';\nimport { compositionsSchema } from './compositions.graphql';\nimport { CompositionPreviewDefinition } from './compositions.preview-definition';\n\nexport type CompositionsConfig = {\n /**\n * glob pattern to detect composition files. This includes all related files, like styles and jsons.\n * @example ['/*.composition?(s).*']\n */\n compositionFilePattern: string[];\n /**\n * glob pattern to select Preview files. this will only include files matched by compositionFilePattern.\n * @example ['*.{t,j}s', '*.{t,j}sx']\n */\n compositionPreviewFilePattern: string[];\n};\n\n/**\n * the component documentation extension.\n */\nexport class CompositionsMain {\n constructor(\n /**\n * Glob pattern to select all composition files\n */\n private compositionFilePattern: string[],\n\n /**\n * Glob pattern to select composition preview files\n */\n private previewFilePattern: string[],\n\n /**\n * envs extension.\n */\n private preview: PreviewMain,\n\n /**\n * workspace extension.\n */\n private workspace: Workspace,\n\n /**\n * schema extension.\n */\n private schema: SchemaMain,\n\n private devFiles: DevFilesMain,\n\n private envs: EnvsMain\n ) {}\n\n /**\n * returns an array of doc file paths for a set of components.\n */\n getPreviewFiles(components: Component[]): ComponentMap<AbstractVinyl[]> {\n return ComponentMap.as<AbstractVinyl[]>(components, (component) => {\n // this includes non executables, like `button.compositions.module.scss` or `presets.compositions.json`\n const compositionFiles = component.state.filesystem.byGlob(this.compositionFilePattern);\n\n // select only relevant preview files (.tsx, etc)\n const previewFiles = new Set(\n component.state.filesystem.byGlob(this.previewFilePattern).map((file) => file.relative)\n );\n const files = compositionFiles.filter((file) => previewFiles.has(file.relative));\n\n return files;\n });\n }\n\n /**\n * checks if a file matches the composition file pattern.\n */\n isCompositionFile(filePath: string): boolean {\n const { includePatterns, excludePatterns } = splitPatterns(this.compositionFilePattern);\n return matchPatterns(filePath, includePatterns, excludePatterns);\n }\n\n /**\n * get component compositions.\n */\n getCompositions(component: IComponent): Composition[] {\n const entry = component.get(CompositionsAspect.id);\n if (!entry) return [];\n const compositions = entry.data.compositions;\n if (!compositions) return [];\n\n return Composition.fromArray(compositions);\n }\n\n /**\n * read composition from the component source code.\n */\n readCompositions(component: Component): Composition[] {\n const maybeFiles = this.getPreviewFiles([component]).byComponent(component);\n\n if (!maybeFiles) return [];\n const [, files] = maybeFiles;\n return files.map((file) => this.computeCompositions(component, file)).flat();\n }\n\n getCompositionFilePattern() {\n return this.compositionFilePattern;\n }\n\n getComponentDevPatterns(component: Component) {\n const env = this.envs.calculateEnv(component, { skipWarnings: !!this.workspace.inInstallContext }).env;\n const componentEnvCompositionsDevPatterns: string[] = env.getCompositionsDevPatterns\n ? env.getCompositionsDevPatterns(component)\n : [];\n const componentPatterns = componentEnvCompositionsDevPatterns.concat(this.getCompositionFilePattern());\n return { name: 'compositions', pattern: componentPatterns };\n }\n\n getDevPatternToRegister() {\n return this.getComponentDevPatterns.bind(this);\n }\n\n async onComponentLoad(component: Component, loadOpts?: ComponentLoadOptions): Promise<AspectData | undefined> {\n if (loadOpts?.loadCompositions === false) return undefined;\n const compositions = this.readCompositions(component);\n return {\n compositions: compositions.map((composition) => composition.toObject()),\n };\n }\n\n private computeCompositions(component: Component, file: AbstractVinyl): Composition[] {\n // :TODO hacked for a specific file extension now until david will take care in the compiler.\n const pathArray = file.path.split('.');\n pathArray[pathArray.length - 1] = 'js';\n\n const exports = this.schema.parseModule(join(this.workspace.componentDir(component.id), file.relative));\n return exports.map((exportModel) => {\n const displayName = exportModel.staticProperties?.get('compositionName');\n\n return new Composition(\n exportModel.identifier,\n file.relative,\n typeof displayName === 'string' ? displayName : undefined\n );\n });\n }\n\n static defaultConfig: CompositionsConfig = {\n compositionFilePattern: ['**/*.composition?(s).*'],\n compositionPreviewFilePattern: ['**/*.{t,j}s?(x)'],\n };\n\n static runtime = MainRuntime;\n static dependencies = [PreviewAspect, GraphqlAspect, WorkspaceAspect, SchemaAspect, DevFilesAspect, EnvsAspect];\n\n static async provider(\n [preview, graphql, workspace, schema, devFiles, envs]: [\n PreviewMain,\n GraphqlMain,\n Workspace,\n SchemaMain,\n DevFilesMain,\n EnvsMain\n ],\n config: CompositionsConfig\n ) {\n const compositions = new CompositionsMain(\n config.compositionFilePattern,\n config.compositionPreviewFilePattern,\n preview,\n workspace,\n schema,\n devFiles,\n envs\n );\n\n // TODO: use the docs implementation to allow component specific pattern\n devFiles.registerDevPattern(compositions.getDevPatternToRegister());\n\n graphql.register(compositionsSchema(compositions));\n preview.registerDefinition(new CompositionPreviewDefinition(compositions));\n\n if (workspace) {\n workspace.onComponentLoad(compositions.onComponentLoad.bind(compositions));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sBAAsB,EAAE,CAAC,wBAAwB,CAAC;EAClD8E,6BAA6B,EAAE,CAAC,iBAAiB;AACnD,CAAC;AAAAtG,eAAA,CA9HUsB,gBAAgB,aAgIVsF,kBAAW;AAAA5G,eAAA,CAhIjBsB,gBAAgB,kBAiIL,CAACuF,wBAAa,EAAEC,wBAAa,EAAEC,4BAAe,EAAEC,sBAAY,EAAEC,0BAAc,EAAEC,eAAU,CAAC;AAqCjHzD,kCAAkB,CAAC0D,UAAU,CAAC7F,gBAAgB,CAAC"}
|
|
1
|
+
{"version":3,"names":["_cli","data","require","_component","_scope","_interopRequireDefault","_devFiles","_envs","_graphql","_preview","_schema","_toolboxPath","_workspace","_path","_composition","_compositions","_compositions2","_compositions3","obj","__esModule","default","_defineProperty","key","value","_toPropertyKey","Object","defineProperty","enumerable","configurable","writable","arg","_toPrimitive","String","input","hint","prim","Symbol","toPrimitive","undefined","res","call","TypeError","Number","CompositionsMain","constructor","compositionFilePattern","previewFilePattern","preview","workspace","schema","devFiles","envs","getPreviewFiles","components","ComponentMap","as","component","compositionFiles","state","filesystem","byGlob","previewFiles","Set","map","file","relative","files","filter","has","isCompositionFile","filePath","includePatterns","excludePatterns","splitPatterns","matchPatterns","getCompositions","entry","get","CompositionsAspect","id","compositions","Composition","fromArray","readCompositions","maybeFiles","byComponent","computeCompositions","flat","getCompositionFilePattern","getComponentDevPatterns","_this$workspace","env","calculateEnv","skipWarnings","inInstallContext","componentEnvCompositionsDevPatterns","getCompositionsDevPatterns","componentPatterns","concat","name","pattern","getDevPatternToRegister","bind","onComponentLoad","loadOpts","loadCompositions","composition","toObject","pathArray","path","split","length","modulePath","join","componentDir","exports","parseModule","contents","toString","exportModel","_exportModel$staticPr","displayName","staticProperties","identifier","provider","graphql","scope","config","compositionPreviewFilePattern","registerDevPattern","register","compositionsSchema","registerDefinition","CompositionPreviewDefinition","registerOnComponentLoad","registerOnCompAspectReCalc","MainRuntime","PreviewAspect","GraphqlAspect","WorkspaceAspect","SchemaAspect","DevFilesAspect","EnvsAspect","ScopeAspect","addRuntime"],"sources":["compositions.main.runtime.ts"],"sourcesContent":["import { MainRuntime } from '@teambit/cli';\nimport { AspectData, Component, ComponentMap, IComponent } from '@teambit/component';\nimport ScopeAspect, { ScopeMain } from '@teambit/scope';\nimport { DevFilesAspect, DevFilesMain } from '@teambit/dev-files';\nimport EnvsAspect, { EnvsMain } from '@teambit/envs';\nimport { GraphqlAspect, GraphqlMain } from '@teambit/graphql';\nimport { ComponentLoadOptions } from '@teambit/legacy/dist/consumer/component/component-loader';\nimport { AbstractVinyl } from '@teambit/legacy/dist/consumer/component/sources';\nimport { PreviewAspect, PreviewMain } from '@teambit/preview';\nimport { SchemaAspect, SchemaMain } from '@teambit/schema';\nimport { matchPatterns, splitPatterns } from '@teambit/toolbox.path.match-patterns';\nimport { Workspace, WorkspaceAspect } from '@teambit/workspace';\nimport { join } from 'path';\nimport { Composition } from './composition';\nimport { CompositionsAspect } from './compositions.aspect';\nimport { compositionsSchema } from './compositions.graphql';\nimport { CompositionPreviewDefinition } from './compositions.preview-definition';\n\nexport type CompositionsConfig = {\n /**\n * glob pattern to detect composition files. This includes all related files, like styles and jsons.\n * @example ['/*.composition?(s).*']\n */\n compositionFilePattern: string[];\n /**\n * glob pattern to select Preview files. this will only include files matched by compositionFilePattern.\n * @example ['*.{t,j}s', '*.{t,j}sx']\n */\n compositionPreviewFilePattern: string[];\n};\n\n/**\n * the component documentation extension.\n */\nexport class CompositionsMain {\n constructor(\n /**\n * Glob pattern to select all composition files\n */\n private compositionFilePattern: string[],\n\n /**\n * Glob pattern to select composition preview files\n */\n private previewFilePattern: string[],\n\n /**\n * envs extension.\n */\n private preview: PreviewMain,\n\n /**\n * workspace extension.\n */\n private workspace: Workspace,\n\n /**\n * schema extension.\n */\n private schema: SchemaMain,\n\n private devFiles: DevFilesMain,\n\n private envs: EnvsMain\n ) {}\n\n /**\n * returns an array of doc file paths for a set of components.\n */\n getPreviewFiles(components: Component[]): ComponentMap<AbstractVinyl[]> {\n return ComponentMap.as<AbstractVinyl[]>(components, (component) => {\n // this includes non executables, like `button.compositions.module.scss` or `presets.compositions.json`\n const compositionFiles = component.state.filesystem.byGlob(this.compositionFilePattern);\n\n // select only relevant preview files (.tsx, etc)\n const previewFiles = new Set(\n component.state.filesystem.byGlob(this.previewFilePattern).map((file) => file.relative)\n );\n const files = compositionFiles.filter((file) => previewFiles.has(file.relative));\n\n return files;\n });\n }\n\n /**\n * checks if a file matches the composition file pattern.\n */\n isCompositionFile(filePath: string): boolean {\n const { includePatterns, excludePatterns } = splitPatterns(this.compositionFilePattern);\n return matchPatterns(filePath, includePatterns, excludePatterns);\n }\n\n /**\n * get component compositions.\n */\n getCompositions(component: IComponent): Composition[] {\n const entry = component.get(CompositionsAspect.id);\n if (!entry) return [];\n const compositions = entry.data.compositions;\n if (!compositions) return [];\n\n return Composition.fromArray(compositions);\n }\n\n /**\n * read composition from the component source code.\n */\n readCompositions(component: Component): Composition[] {\n const maybeFiles = this.getPreviewFiles([component]).byComponent(component);\n\n if (!maybeFiles) return [];\n const [, files] = maybeFiles;\n return files.map((file) => this.computeCompositions(component, file)).flat();\n }\n\n getCompositionFilePattern() {\n return this.compositionFilePattern;\n }\n\n getComponentDevPatterns(component: Component) {\n const env = this.envs.calculateEnv(component, { skipWarnings: !!this.workspace?.inInstallContext }).env;\n const componentEnvCompositionsDevPatterns: string[] = env.getCompositionsDevPatterns\n ? env.getCompositionsDevPatterns(component)\n : [];\n const componentPatterns = componentEnvCompositionsDevPatterns.concat(this.getCompositionFilePattern());\n return { name: 'compositions', pattern: componentPatterns };\n }\n\n getDevPatternToRegister() {\n return this.getComponentDevPatterns.bind(this);\n }\n\n async onComponentLoad(component: Component, loadOpts?: ComponentLoadOptions): Promise<AspectData | undefined> {\n if (loadOpts?.loadCompositions === false) return undefined;\n const compositions = this.readCompositions(component);\n return {\n compositions: compositions.map((composition) => composition.toObject()),\n };\n }\n\n private computeCompositions(component: Component, file: AbstractVinyl): Composition[] {\n // :TODO hacked for a specific file extension now until david will take care in the compiler.\n const pathArray = file.path.split('.');\n pathArray[pathArray.length - 1] = 'js';\n\n const modulePath = this.workspace ? join(this.workspace.componentDir(component.id), file.relative) : file.relative;\n const exports = this.schema.parseModule(modulePath, file.contents.toString());\n return exports.map((exportModel) => {\n const displayName = exportModel.staticProperties?.get('compositionName');\n\n return new Composition(\n exportModel.identifier,\n file.relative,\n typeof displayName === 'string' ? displayName : undefined\n );\n });\n }\n\n static defaultConfig: CompositionsConfig = {\n compositionFilePattern: ['**/*.composition?(s).*'],\n compositionPreviewFilePattern: ['**/*.{t,j}s?(x)'],\n };\n\n static runtime = MainRuntime;\n static dependencies = [\n PreviewAspect,\n GraphqlAspect,\n WorkspaceAspect,\n SchemaAspect,\n DevFilesAspect,\n EnvsAspect,\n ScopeAspect,\n ];\n\n static async provider(\n [preview, graphql, workspace, schema, devFiles, envs, scope]: [\n PreviewMain,\n GraphqlMain,\n Workspace,\n SchemaMain,\n DevFilesMain,\n EnvsMain,\n ScopeMain\n ],\n config: CompositionsConfig\n ) {\n const compositions = new CompositionsMain(\n config.compositionFilePattern,\n config.compositionPreviewFilePattern,\n preview,\n workspace,\n schema,\n devFiles,\n envs\n );\n\n // TODO: use the docs implementation to allow component specific pattern\n devFiles.registerDevPattern(compositions.getDevPatternToRegister());\n\n graphql.register(compositionsSchema(compositions));\n preview.registerDefinition(new CompositionPreviewDefinition(compositions));\n\n if (workspace) {\n workspace.registerOnComponentLoad(compositions.onComponentLoad.bind(compositions));\n }\n if (scope) {\n scope.registerOnCompAspectReCalc(compositions.onComponentLoad.bind(compositions));\n }\n\n return compositions;\n }\n}\n\nCompositionsAspect.addRuntime(CompositionsMain);\n"],"mappings":";;;;;;AAAA,SAAAA,KAAA;EAAA,MAAAC,IAAA,GAAAC,OAAA;EAAAF,IAAA,YAAAA,CAAA;IAAA,OAAAC,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AACA,SAAAE,WAAA;EAAA,MAAAF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AAC;IACpF;IACA,IAAI8C,KAAK,EAAE;MACTA,KAAK,CAACS,0BAA0B,CAACvD,YAAY,CAACuB,eAAe,CAACD,IAAI,CAACtB,YAAY,CAAC,CAAC;IACnF;IAEA,OAAOA,YAAY;EACrB;AACF;AAACmC,OAAA,CAAAxE,gBAAA,GAAAA,gBAAA;AAAAtB,eAAA,CAjLYsB,gBAAgB,mBA4HgB;EACzCE,sBAAsB,EAAE,CAAC,wBAAwB,CAAC;EAClDmF,6BAA6B,EAAE,CAAC,iBAAiB;AACnD,CAAC;AAAA3G,eAAA,CA/HUsB,gBAAgB,aAiIV6F,kBAAW;AAAAnH,eAAA,CAjIjBsB,gBAAgB,kBAkIL,CACpB8F,wBAAa,EACbC,wBAAa,EACbC,4BAAe,EACfC,sBAAY,EACZC,0BAAc,EACdC,eAAU,EACVC,gBAAW,CACZ;AAyCHjE,kCAAkB,CAACkE,UAAU,CAACrG,gBAAgB,CAAC"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import * as compositions_0 from '/home/circleci/Library/Caches/Bit/capsules/8891be5ad3d35bfc38b9cd90c0e05b598a5a55af/teambit.compositions_compositions@1.0.
|
|
2
|
-
import * as overview_0 from '/home/circleci/Library/Caches/Bit/capsules/8891be5ad3d35bfc38b9cd90c0e05b598a5a55af/teambit.compositions_compositions@1.0.
|
|
1
|
+
import * as compositions_0 from '/home/circleci/Library/Caches/Bit/capsules/8891be5ad3d35bfc38b9cd90c0e05b598a5a55af/teambit.compositions_compositions@1.0.104/dist/compositions.composition.js';
|
|
2
|
+
import * as overview_0 from '/home/circleci/Library/Caches/Bit/capsules/8891be5ad3d35bfc38b9cd90c0e05b598a5a55af/teambit.compositions_compositions@1.0.104/dist/compositions.docs.mdx';
|
|
3
3
|
|
|
4
4
|
export const compositions = [compositions_0];
|
|
5
5
|
export const overview = [overview_0];
|
package/package.json
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@teambit/compositions",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.104",
|
|
4
4
|
"homepage": "https://bit.cloud/teambit/compositions/compositions",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"componentId": {
|
|
7
7
|
"scope": "teambit.compositions",
|
|
8
8
|
"name": "compositions",
|
|
9
|
-
"version": "1.0.
|
|
9
|
+
"version": "1.0.104"
|
|
10
10
|
},
|
|
11
11
|
"dependencies": {
|
|
12
12
|
"graphql-tag": "2.12.1",
|
|
@@ -39,21 +39,22 @@
|
|
|
39
39
|
"@teambit/compositions.ui.composition-compare": "0.0.255",
|
|
40
40
|
"@teambit/evangelist.elements.icon": "1.0.2",
|
|
41
41
|
"@teambit/ui-foundation.ui.menu-widget-icon": "0.0.502",
|
|
42
|
-
"@teambit/component": "1.0.
|
|
42
|
+
"@teambit/component": "1.0.104",
|
|
43
43
|
"@teambit/compositions.model.composition-id": "0.0.500",
|
|
44
|
-
"@teambit/graphql": "1.0.
|
|
45
|
-
"@teambit/cli": "0.0.
|
|
46
|
-
"@teambit/dev-files": "1.0.
|
|
47
|
-
"@teambit/envs": "1.0.
|
|
48
|
-
"@teambit/preview": "1.0.
|
|
49
|
-
"@teambit/schema": "1.0.
|
|
44
|
+
"@teambit/graphql": "1.0.104",
|
|
45
|
+
"@teambit/cli": "0.0.838",
|
|
46
|
+
"@teambit/dev-files": "1.0.104",
|
|
47
|
+
"@teambit/envs": "1.0.104",
|
|
48
|
+
"@teambit/preview": "1.0.104",
|
|
49
|
+
"@teambit/schema": "1.0.104",
|
|
50
|
+
"@teambit/scope": "1.0.104",
|
|
50
51
|
"@teambit/toolbox.path.match-patterns": "0.0.13",
|
|
51
|
-
"@teambit/workspace": "1.0.
|
|
52
|
+
"@teambit/workspace": "1.0.104",
|
|
52
53
|
"@teambit/docs.ui.queries.get-docs": "0.0.506",
|
|
53
|
-
"@teambit/panels": "0.0.
|
|
54
|
+
"@teambit/panels": "0.0.839",
|
|
54
55
|
"@teambit/preview.ui.component-preview": "1.0.3",
|
|
55
|
-
"@teambit/component-compare": "1.0.
|
|
56
|
-
"@teambit/ui": "1.0.
|
|
56
|
+
"@teambit/component-compare": "1.0.104",
|
|
57
|
+
"@teambit/ui": "1.0.104"
|
|
57
58
|
},
|
|
58
59
|
"devDependencies": {
|
|
59
60
|
"@types/react": "^17.0.8",
|
|
@@ -69,7 +70,7 @@
|
|
|
69
70
|
},
|
|
70
71
|
"peerDependencies": {
|
|
71
72
|
"react-router-dom": "^6.0.0",
|
|
72
|
-
"@teambit/legacy": "1.0.
|
|
73
|
+
"@teambit/legacy": "1.0.623",
|
|
73
74
|
"react": "^16.8.0 || ^17.0.0",
|
|
74
75
|
"react-dom": "^16.8.0 || ^17.0.0"
|
|
75
76
|
},
|