@teambit/config 0.0.391 → 0.0.397
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/dist/config.aspect.js +1 -1
- package/dist/config.d.ts +10 -0
- package/dist/index.js +6 -6
- package/dist/types.d.ts +7 -0
- package/dist/workspace-config.d.ts +61 -0
- package/dist/workspace-config.js +2 -2
- package/package-tar/teambit-config-0.0.397.tgz +0 -0
- package/package.json +6 -6
- package/tsconfig.json +0 -1
- package/package-tar/teambit-config-0.0.391.tgz +0 -0
package/dist/config.aspect.js
CHANGED
package/dist/config.d.ts
CHANGED
|
@@ -15,6 +15,16 @@ export declare class Config {
|
|
|
15
15
|
get path(): PathOsBased | undefined;
|
|
16
16
|
get config(): HostConfig | undefined;
|
|
17
17
|
static loadIfExist(dirPath: PathOsBased): Promise<Config | undefined | any>;
|
|
18
|
+
/**
|
|
19
|
+
* Ensure the given directory has a workspace config
|
|
20
|
+
* Load if existing and create new if not
|
|
21
|
+
*
|
|
22
|
+
* @static
|
|
23
|
+
* @param {PathOsBasedAbsolute} dirPath
|
|
24
|
+
* @param {WorkspaceConfigFileProps} [workspaceConfigProps={} as any]
|
|
25
|
+
* @returns {Promise<WorkspaceConfig>}
|
|
26
|
+
* @memberof WorkspaceConfig
|
|
27
|
+
*/
|
|
18
28
|
static ensureWorkspace(dirPath: PathOsBasedAbsolute, workspaceConfigProps?: WorkspaceConfigFileProps, legacyInitProps?: LegacyInitProps): Promise<Config>;
|
|
19
29
|
get extensions(): ExtensionDataList | undefined;
|
|
20
30
|
extension(extensionId: string, ignoreVersion: boolean): ExtensionDataEntry | undefined;
|
package/dist/index.js
CHANGED
|
@@ -3,6 +3,12 @@
|
|
|
3
3
|
Object.defineProperty(exports, "__esModule", {
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
|
+
Object.defineProperty(exports, "ComponentScopeDirMap", {
|
|
7
|
+
enumerable: true,
|
|
8
|
+
get: function () {
|
|
9
|
+
return _workspaceConfig().ComponentScopeDirMap;
|
|
10
|
+
}
|
|
11
|
+
});
|
|
6
12
|
Object.defineProperty(exports, "Config", {
|
|
7
13
|
enumerable: true,
|
|
8
14
|
get: function () {
|
|
@@ -21,12 +27,6 @@ Object.defineProperty(exports, "ConfigRuntime", {
|
|
|
21
27
|
return _config2().ConfigRuntime;
|
|
22
28
|
}
|
|
23
29
|
});
|
|
24
|
-
Object.defineProperty(exports, "ComponentScopeDirMap", {
|
|
25
|
-
enumerable: true,
|
|
26
|
-
get: function () {
|
|
27
|
-
return _workspaceConfig().ComponentScopeDirMap;
|
|
28
|
-
}
|
|
29
|
-
});
|
|
30
30
|
Object.defineProperty(exports, "getWorkspaceConfigTemplateParsed", {
|
|
31
31
|
enumerable: true,
|
|
32
32
|
get: function () {
|
package/dist/types.d.ts
CHANGED
|
@@ -4,7 +4,14 @@ import { SetExtensionOptions } from './config';
|
|
|
4
4
|
export declare type WriteOptions = {
|
|
5
5
|
dir?: PathOsBasedAbsolute;
|
|
6
6
|
};
|
|
7
|
+
/**
|
|
8
|
+
* An interface implemented by component host (workspace / scope) config file
|
|
9
|
+
* This used to be able to abstract the workspace/scope config.
|
|
10
|
+
*/
|
|
7
11
|
export interface HostConfig {
|
|
12
|
+
/**
|
|
13
|
+
* Path to the actual file
|
|
14
|
+
*/
|
|
8
15
|
path: PathOsBased;
|
|
9
16
|
extensions: ExtensionDataList;
|
|
10
17
|
extension: (extensionId: string, ignoreVersion: boolean) => ExtensionDataEntry;
|
|
@@ -61,15 +61,76 @@ export declare class WorkspaceConfig implements HostConfig {
|
|
|
61
61
|
private loadExtensions;
|
|
62
62
|
extension(extensionId: string, ignoreVersion: boolean): any;
|
|
63
63
|
setExtension(extensionId: string, config: Record<string, any>, options: SetExtensionOptions): any;
|
|
64
|
+
/**
|
|
65
|
+
* Create an instance of the WorkspaceConfig by an instance of the legacy config
|
|
66
|
+
*
|
|
67
|
+
* @static
|
|
68
|
+
* @param {*} legacyConfig
|
|
69
|
+
* @returns
|
|
70
|
+
* @memberof WorkspaceConfig
|
|
71
|
+
*/
|
|
64
72
|
static fromLegacyConfig(legacyConfig: any): WorkspaceConfig;
|
|
73
|
+
/**
|
|
74
|
+
* Create an instance of the WorkspaceConfig by data
|
|
75
|
+
*
|
|
76
|
+
* @static
|
|
77
|
+
* @param {WorkspaceConfigFileProps} data
|
|
78
|
+
* @returns
|
|
79
|
+
* @memberof WorkspaceConfig
|
|
80
|
+
*/
|
|
65
81
|
static fromObject(data: WorkspaceConfigFileProps): WorkspaceConfig;
|
|
82
|
+
/**
|
|
83
|
+
* Create an instance of the WorkspaceConfig by the workspace config template and override values
|
|
84
|
+
*
|
|
85
|
+
* @static
|
|
86
|
+
* @param {WorkspaceConfigFileProps} data values to override in the default template
|
|
87
|
+
* @returns
|
|
88
|
+
* @memberof WorkspaceConfig
|
|
89
|
+
*/
|
|
66
90
|
static create(props: WorkspaceConfigFileProps, dirPath?: PathOsBasedAbsolute, legacyInitProps?: LegacyInitProps): Promise<WorkspaceConfig>;
|
|
91
|
+
/**
|
|
92
|
+
* Ensure the given directory has a workspace config
|
|
93
|
+
* Load if existing and create new if not
|
|
94
|
+
*
|
|
95
|
+
* @static
|
|
96
|
+
* @param {PathOsBasedAbsolute} dirPath
|
|
97
|
+
* @param {WorkspaceConfigFileProps} [workspaceConfigProps={} as any]
|
|
98
|
+
* @returns {Promise<WorkspaceConfig>}
|
|
99
|
+
* @memberof WorkspaceConfig
|
|
100
|
+
*/
|
|
67
101
|
static ensure(dirPath: PathOsBasedAbsolute, workspaceConfigProps?: WorkspaceConfigFileProps, legacyInitProps?: LegacyInitProps): Promise<WorkspaceConfig>;
|
|
102
|
+
/**
|
|
103
|
+
* A function that register to the legacy ensure function in order to transform old props structure
|
|
104
|
+
* to the new one
|
|
105
|
+
* @param dirPath
|
|
106
|
+
* @param standAlone
|
|
107
|
+
* @param legacyWorkspaceConfigProps
|
|
108
|
+
*/
|
|
68
109
|
static onLegacyEnsure(dirPath: PathOsBasedAbsolute, standAlone: boolean, legacyWorkspaceConfigProps?: LegacyWorkspaceConfigProps): Promise<WorkspaceConfig>;
|
|
69
110
|
static reset(dirPath: PathOsBasedAbsolute, resetHard: boolean): Promise<void>;
|
|
111
|
+
/**
|
|
112
|
+
* Get the path of the bit.jsonc file by a containing folder
|
|
113
|
+
*
|
|
114
|
+
* @static
|
|
115
|
+
* @param {PathOsBased} dirPath containing dir of the bit.jsonc file
|
|
116
|
+
* @returns {PathOsBased}
|
|
117
|
+
* @memberof WorkspaceConfig
|
|
118
|
+
*/
|
|
70
119
|
static composeWorkspaceJsoncPath(dirPath: PathOsBased): PathOsBased;
|
|
71
120
|
static pathHasWorkspaceJsonc(dirPath: PathOsBased): Promise<boolean>;
|
|
121
|
+
/**
|
|
122
|
+
* Check if the given dir has workspace config (new or legacy)
|
|
123
|
+
* @param dirPath
|
|
124
|
+
*/
|
|
72
125
|
static isExist(dirPath: PathOsBased): Promise<boolean | undefined>;
|
|
126
|
+
/**
|
|
127
|
+
* Load the workspace configuration if it's exist
|
|
128
|
+
*
|
|
129
|
+
* @static
|
|
130
|
+
* @param {PathOsBased} dirPath
|
|
131
|
+
* @returns {(Promise<WorkspaceConfig | undefined>)}
|
|
132
|
+
* @memberof WorkspaceConfig
|
|
133
|
+
*/
|
|
73
134
|
static loadIfExist(dirPath: PathOsBased): Promise<WorkspaceConfig | undefined>;
|
|
74
135
|
static _loadFromWorkspaceJsonc(workspaceJsoncPath: PathOsBased): Promise<WorkspaceConfig>;
|
|
75
136
|
write({ dir }: {
|
package/dist/workspace-config.js
CHANGED
|
@@ -7,10 +7,10 @@ require("core-js/modules/es.promise.js");
|
|
|
7
7
|
Object.defineProperty(exports, "__esModule", {
|
|
8
8
|
value: true
|
|
9
9
|
});
|
|
10
|
-
exports.
|
|
10
|
+
exports.WorkspaceConfig = void 0;
|
|
11
11
|
exports.getWorkspaceConfigTemplateParsed = getWorkspaceConfigTemplateParsed;
|
|
12
12
|
exports.stringifyWorkspaceConfig = stringifyWorkspaceConfig;
|
|
13
|
-
exports.
|
|
13
|
+
exports.transformLegacyPropsToExtensions = transformLegacyPropsToExtensions;
|
|
14
14
|
|
|
15
15
|
function _defineProperty2() {
|
|
16
16
|
const data = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
|
|
Binary file
|
package/package.json
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@teambit/config",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.397",
|
|
4
4
|
"homepage": "https://bit.dev/teambit/harmony/config",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"componentId": {
|
|
7
7
|
"scope": "teambit.harmony",
|
|
8
8
|
"name": "config",
|
|
9
|
-
"version": "0.0.
|
|
9
|
+
"version": "0.0.397"
|
|
10
10
|
},
|
|
11
11
|
"dependencies": {
|
|
12
12
|
"@teambit/harmony": "0.2.11",
|
|
@@ -16,8 +16,8 @@
|
|
|
16
16
|
"chalk": "2.4.2",
|
|
17
17
|
"@babel/runtime": "7.12.18",
|
|
18
18
|
"core-js": "^3.0.0",
|
|
19
|
-
"@teambit/cli": "0.0.
|
|
20
|
-
"@teambit/bit-error": "0.0.
|
|
19
|
+
"@teambit/cli": "0.0.386",
|
|
20
|
+
"@teambit/bit-error": "0.0.372"
|
|
21
21
|
},
|
|
22
22
|
"devDependencies": {
|
|
23
23
|
"@types/fs-extra": "9.0.7",
|
|
@@ -30,7 +30,7 @@
|
|
|
30
30
|
"@types/node": "12.20.4"
|
|
31
31
|
},
|
|
32
32
|
"peerDependencies": {
|
|
33
|
-
"@teambit/legacy": "1.0.
|
|
33
|
+
"@teambit/legacy": "1.0.172",
|
|
34
34
|
"react-dom": "^16.8.0 || ^17.0.0",
|
|
35
35
|
"react": "^16.8.0 || ^17.0.0"
|
|
36
36
|
},
|
|
@@ -58,7 +58,7 @@
|
|
|
58
58
|
"react": "-"
|
|
59
59
|
},
|
|
60
60
|
"peerDependencies": {
|
|
61
|
-
"@teambit/legacy": "1.0.
|
|
61
|
+
"@teambit/legacy": "1.0.172",
|
|
62
62
|
"react-dom": "^16.8.0 || ^17.0.0",
|
|
63
63
|
"react": "^16.8.0 || ^17.0.0"
|
|
64
64
|
}
|
package/tsconfig.json
CHANGED
|
Binary file
|