@teambit/scope 1.0.60 → 1.0.62
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,5 +1,5 @@
|
|
|
1
|
-
import * as compositions_0 from '/home/circleci/Library/Caches/Bit/capsules/8891be5ad3d35bfc38b9cd90c0e05b598a5a55af/teambit.scope_scope@1.0.
|
|
2
|
-
import * as overview_0 from '/home/circleci/Library/Caches/Bit/capsules/8891be5ad3d35bfc38b9cd90c0e05b598a5a55af/teambit.scope_scope@1.0.
|
|
1
|
+
import * as compositions_0 from '/home/circleci/Library/Caches/Bit/capsules/8891be5ad3d35bfc38b9cd90c0e05b598a5a55af/teambit.scope_scope@1.0.62/dist/scope.composition.js';
|
|
2
|
+
import * as overview_0 from '/home/circleci/Library/Caches/Bit/capsules/8891be5ad3d35bfc38b9cd90c0e05b598a5a55af/teambit.scope_scope@1.0.62/dist/scope.docs.mdx';
|
|
3
3
|
|
|
4
4
|
export const compositions = [compositions_0];
|
|
5
5
|
export const overview = [overview_0];
|
package/dist/staged-config.d.ts
CHANGED
|
@@ -7,7 +7,7 @@ declare type ComponentConfig = {
|
|
|
7
7
|
config: Config;
|
|
8
8
|
};
|
|
9
9
|
export declare class StagedConfig {
|
|
10
|
-
|
|
10
|
+
readonly filePath: string;
|
|
11
11
|
private componentsConfig;
|
|
12
12
|
private logger;
|
|
13
13
|
hasChanged: boolean;
|
|
@@ -20,6 +20,8 @@ export declare class StagedConfig {
|
|
|
20
20
|
write(): Promise<void>;
|
|
21
21
|
getConfigPerId(id: ComponentID): Config;
|
|
22
22
|
getAll(): ComponentConfig[];
|
|
23
|
+
isEmpty(): boolean;
|
|
24
|
+
deleteFile(): Promise<void>;
|
|
23
25
|
addComponentConfig(id: ComponentID, config: Config): void;
|
|
24
26
|
removeComponentConfig(id: ComponentID): void;
|
|
25
27
|
}
|
package/dist/staged-config.js
CHANGED
|
@@ -85,6 +85,14 @@ class StagedConfig {
|
|
|
85
85
|
getAll() {
|
|
86
86
|
return this.componentsConfig;
|
|
87
87
|
}
|
|
88
|
+
isEmpty() {
|
|
89
|
+
return this.componentsConfig.length === 0;
|
|
90
|
+
}
|
|
91
|
+
async deleteFile() {
|
|
92
|
+
this.logger.debug(`staged-config, deleting ${this.filePath}`);
|
|
93
|
+
await _fsExtra().default.remove(this.filePath);
|
|
94
|
+
this.componentsConfig = [];
|
|
95
|
+
}
|
|
88
96
|
addComponentConfig(id, config) {
|
|
89
97
|
const exists = this.componentsConfig.find(c => c.id.isEqual(id, {
|
|
90
98
|
ignoreVersion: true
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_fsExtra","data","_interopRequireDefault","require","_path","_componentId","_laneId","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","STAGED_CONFIG_DIR","StagedConfig","constructor","filePath","componentsConfig","logger","load","scopePath","laneId","lanePath","path","join","scope","name","DEFAULT_LANE","fileContent","fs","readJson","map","item","id","ComponentID","fromObject","config","err","code","toObject","write","hasChanged","outputFile","JSON","stringify","getConfigPerId","_this$componentsConfi","find","c","isEqual","ignoreVersion","getAll","addComponentConfig","exists","push","removeComponentConfig","componentsConfigLengthBefore","
|
|
1
|
+
{"version":3,"names":["_fsExtra","data","_interopRequireDefault","require","_path","_componentId","_laneId","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","STAGED_CONFIG_DIR","StagedConfig","constructor","filePath","componentsConfig","logger","load","scopePath","laneId","lanePath","path","join","scope","name","DEFAULT_LANE","fileContent","fs","readJson","map","item","id","ComponentID","fromObject","config","err","code","toObject","write","hasChanged","outputFile","JSON","stringify","getConfigPerId","_this$componentsConfi","find","c","isEqual","ignoreVersion","getAll","isEmpty","length","deleteFile","debug","remove","addComponentConfig","exists","push","removeComponentConfig","componentsConfigLengthBefore","filter","toString","exports"],"sources":["staged-config.ts"],"sourcesContent":["import fs from 'fs-extra';\nimport path from 'path';\nimport { ComponentID } from '@teambit/component-id';\nimport { DEFAULT_LANE, LaneId } from '@teambit/lane-id';\nimport { Logger } from '@teambit/logger';\n\nconst STAGED_CONFIG_DIR = 'staged-config';\n\ntype Config = Record<string, any> | undefined;\ntype ComponentConfig = { id: ComponentID; config: Config };\n\nexport class StagedConfig {\n hasChanged = false;\n constructor(readonly filePath: string, private componentsConfig: ComponentConfig[], private logger: Logger) {}\n\n static async load(scopePath: string, logger: Logger, laneId?: LaneId): Promise<StagedConfig> {\n const lanePath = laneId ? path.join(laneId.scope, laneId.name) : DEFAULT_LANE;\n const filePath = path.join(scopePath, STAGED_CONFIG_DIR, `${lanePath}.json`);\n let componentsConfig: ComponentConfig[] = [];\n try {\n const fileContent = await fs.readJson(filePath);\n componentsConfig = fileContent.map((item) => ({ id: ComponentID.fromObject(item.id), config: item.config }));\n } catch (err: any) {\n if (err.code === 'ENOENT') {\n componentsConfig = [];\n } else {\n throw err;\n }\n }\n return new StagedConfig(filePath, componentsConfig, logger);\n }\n\n toObject() {\n return this.componentsConfig.map(({ id, config }) => ({ id: id.toObject(), config }));\n }\n\n async write() {\n if (!this.hasChanged) return;\n await fs.outputFile(this.filePath, JSON.stringify(this.toObject(), null, 2));\n }\n\n getConfigPerId(id: ComponentID): Config {\n return this.componentsConfig.find((c) => c.id.isEqual(id, { ignoreVersion: true }))?.config;\n }\n\n getAll() {\n return this.componentsConfig;\n }\n\n isEmpty() {\n return this.componentsConfig.length === 0;\n }\n\n async deleteFile() {\n this.logger.debug(`staged-config, deleting ${this.filePath}`);\n await fs.remove(this.filePath);\n this.componentsConfig = [];\n }\n\n addComponentConfig(id: ComponentID, config: Config) {\n const exists = this.componentsConfig.find((c) => c.id.isEqual(id, { ignoreVersion: true }));\n if (exists) {\n exists.config = config;\n } else {\n this.componentsConfig.push({ id, config });\n }\n this.hasChanged = true;\n }\n\n removeComponentConfig(id: ComponentID) {\n const componentsConfigLengthBefore = this.componentsConfig.length;\n this.componentsConfig = this.componentsConfig.filter((c) => !c.id.isEqual(id, { ignoreVersion: true }));\n if (this.componentsConfig.length === componentsConfigLengthBefore) {\n this.logger.debug(`removeComponentConfig: unable to find ${id.toString()}`);\n } else {\n this.hasChanged = true;\n }\n }\n}\n"],"mappings":";;;;;;AAAA,SAAAA,SAAA;EAAA,MAAAC,IAAA,GAAAC,sBAAA,CAAAC,OAAA;EAAAH,QAAA,YAAAA,CAAA;IAAA,OAAAC,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AACA,SAAAG,MAAA;EAAA,MAAAH,IAAA,GAAAC,sBAAA,CAAAC,OAAA;EAAAC,KAAA,YAAAA,CAAA;IAAA,OAAAH,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AACA,SAAAI,aAAA;EAAA,MAAAJ,IAAA,GAAAE,OAAA;EAAAE,YAAA,YAAAA,CAAA;IAAA,OAAAJ,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AACA,SAAAK,QAAA;EAAA,MAAAL,IAAA,GAAAE,OAAA;EAAAG,OAAA,YAAAA,CAAA;IAAA,OAAAL,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AAAwD,SAAAC,uBAAAK,GAAA,WAAAA,GAAA,IAAAA,GAAA,CAAAC,UAAA,GAAAD,GAAA,KAAAE,OAAA,EAAAF,GAAA;AAAA,SAAAG,gBAAAH,GAAA,EAAAI,GAAA,EAAAC,KAAA,IAAAD,GAAA,GAAAE,cAAA,CAAAF,GAAA,OAAAA,GAAA,IAAAJ,GAAA,IAAAO,MAAA,CAAAC,cAAA,CAAAR,GAAA,EAAAI,GAAA,IAAAC,KAAA,EAAAA,KAAA,EAAAI,UAAA,QAAAC,YAAA,QAAAC,QAAA,oBAAAX,GAAA,CAAAI,GAAA,IAAAC,KAAA,WAAAL,GAAA;AA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uB,OAAA,CAAAlD,YAAA,GAAAA,YAAA"}
|
package/package.json
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@teambit/scope",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.62",
|
|
4
4
|
"homepage": "https://bit.cloud/teambit/scope/scope",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"componentId": {
|
|
7
7
|
"scope": "teambit.scope",
|
|
8
8
|
"name": "scope",
|
|
9
|
-
"version": "1.0.
|
|
9
|
+
"version": "1.0.62"
|
|
10
10
|
},
|
|
11
11
|
"dependencies": {
|
|
12
12
|
"fs-extra": "10.0.0",
|
|
@@ -52,35 +52,35 @@
|
|
|
52
52
|
"@teambit/ui-foundation.ui.full-loader": "0.0.500",
|
|
53
53
|
"@teambit/ui-foundation.ui.hooks.use-is-mobile": "0.0.197",
|
|
54
54
|
"@teambit/ui-foundation.ui.top-bar": "0.0.514",
|
|
55
|
+
"@teambit/ui-foundation.ui.use-box.dropdown": "0.0.141",
|
|
56
|
+
"@teambit/ui-foundation.ui.use-box.scope-menu": "0.0.145",
|
|
55
57
|
"@teambit/explorer.ui.gallery.component-card": "0.0.513",
|
|
56
58
|
"@teambit/explorer.ui.gallery.component-grid": "0.0.496",
|
|
57
59
|
"@teambit/scope.ui.empty-scope": "0.0.509",
|
|
58
60
|
"@teambit/scope.ui.scope-details": "0.0.526",
|
|
59
|
-
"@teambit/ui-foundation.ui.use-box.dropdown": "0.0.141",
|
|
60
|
-
"@teambit/ui-foundation.ui.use-box.scope-menu": "0.0.145",
|
|
61
61
|
"@teambit/component.modules.component-url": "0.0.164",
|
|
62
|
-
"@teambit/scope.models.scope-model": "0.0.
|
|
63
|
-
"@teambit/scope.ui.hooks.scope-context": "0.0.
|
|
64
|
-
"@teambit/aspect-loader": "1.0.
|
|
65
|
-
"@teambit/cli": "0.0.
|
|
66
|
-
"@teambit/compiler": "1.0.
|
|
67
|
-
"@teambit/component": "1.0.
|
|
68
|
-
"@teambit/dependency-resolver": "1.0.
|
|
69
|
-
"@teambit/envs": "1.0.
|
|
70
|
-
"@teambit/global-config": "0.0.
|
|
62
|
+
"@teambit/scope.models.scope-model": "0.0.479",
|
|
63
|
+
"@teambit/scope.ui.hooks.scope-context": "0.0.473",
|
|
64
|
+
"@teambit/aspect-loader": "1.0.62",
|
|
65
|
+
"@teambit/cli": "0.0.822",
|
|
66
|
+
"@teambit/compiler": "1.0.62",
|
|
67
|
+
"@teambit/component": "1.0.62",
|
|
68
|
+
"@teambit/dependency-resolver": "1.0.62",
|
|
69
|
+
"@teambit/envs": "1.0.62",
|
|
70
|
+
"@teambit/global-config": "0.0.824",
|
|
71
71
|
"@teambit/harmony.modules.requireable-component": "0.0.495",
|
|
72
|
-
"@teambit/isolator": "1.0.
|
|
73
|
-
"@teambit/logger": "0.0.
|
|
74
|
-
"@teambit/builder": "1.0.
|
|
75
|
-
"@teambit/express": "0.0.
|
|
76
|
-
"@teambit/graph": "1.0.
|
|
77
|
-
"@teambit/graphql": "1.0.
|
|
78
|
-
"@teambit/ui": "1.0.
|
|
72
|
+
"@teambit/isolator": "1.0.62",
|
|
73
|
+
"@teambit/logger": "0.0.915",
|
|
74
|
+
"@teambit/builder": "1.0.62",
|
|
75
|
+
"@teambit/express": "0.0.921",
|
|
76
|
+
"@teambit/graph": "1.0.62",
|
|
77
|
+
"@teambit/graphql": "1.0.62",
|
|
78
|
+
"@teambit/ui": "1.0.62",
|
|
79
79
|
"@teambit/workspace.modules.match-pattern": "0.0.502",
|
|
80
|
-
"@teambit/component.ui.component-drawer": "0.0.
|
|
81
|
-
"@teambit/command-bar": "1.0.
|
|
82
|
-
"@teambit/component-tree": "1.0.
|
|
83
|
-
"@teambit/sidebar": "1.0.
|
|
80
|
+
"@teambit/component.ui.component-drawer": "0.0.362",
|
|
81
|
+
"@teambit/command-bar": "1.0.62",
|
|
82
|
+
"@teambit/component-tree": "1.0.62",
|
|
83
|
+
"@teambit/sidebar": "1.0.62",
|
|
84
84
|
"@teambit/preview.ui.preview-placeholder": "0.0.504"
|
|
85
85
|
},
|
|
86
86
|
"devDependencies": {
|
|
@@ -98,7 +98,7 @@
|
|
|
98
98
|
},
|
|
99
99
|
"peerDependencies": {
|
|
100
100
|
"react-router-dom": "^6.0.0",
|
|
101
|
-
"@teambit/legacy": "1.0.
|
|
101
|
+
"@teambit/legacy": "1.0.605",
|
|
102
102
|
"react": "^16.8.0 || ^17.0.0",
|
|
103
103
|
"react-dom": "^16.8.0 || ^17.0.0"
|
|
104
104
|
},
|