@teambit/config 0.0.0-008fb8bd3f5c90e08cf881be00887d589a090f23

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.
Files changed (39) hide show
  1. package/dist/config.aspect.d.ts +3 -0
  2. package/dist/config.aspect.js +21 -0
  3. package/dist/config.aspect.js.map +1 -0
  4. package/dist/config.main.runtime.d.ts +43 -0
  5. package/dist/config.main.runtime.js +169 -0
  6. package/dist/config.main.runtime.js.map +1 -0
  7. package/dist/esm.mjs +12 -0
  8. package/dist/exceptions/extension-already-configured.d.ts +5 -0
  9. package/dist/exceptions/extension-already-configured.js +22 -0
  10. package/dist/exceptions/extension-already-configured.js.map +1 -0
  11. package/dist/exceptions/index.d.ts +1 -0
  12. package/dist/exceptions/index.js +20 -0
  13. package/dist/exceptions/index.js.map +1 -0
  14. package/dist/exceptions/invalid-config-file.d.ts +6 -0
  15. package/dist/exceptions/invalid-config-file.js +36 -0
  16. package/dist/exceptions/invalid-config-file.js.map +1 -0
  17. package/dist/index.d.ts +4 -0
  18. package/dist/index.js +64 -0
  19. package/dist/index.js.map +1 -0
  20. package/dist/preview-1753277474239.js +7 -0
  21. package/dist/readme.md +3 -0
  22. package/dist/schema.json +156 -0
  23. package/dist/types.d.ts +21 -0
  24. package/dist/types.js +3 -0
  25. package/dist/types.js.map +1 -0
  26. package/dist/workspace-config.d.ts +129 -0
  27. package/dist/workspace-config.js +464 -0
  28. package/dist/workspace-config.js.map +1 -0
  29. package/dist/workspace-template.jsonc +71 -0
  30. package/esm.mjs +12 -0
  31. package/exceptions/extension-already-configured.ts +7 -0
  32. package/exceptions/index.ts +1 -0
  33. package/exceptions/invalid-config-file.ts +11 -0
  34. package/package.json +70 -0
  35. package/readme.md +3 -0
  36. package/schema.json +156 -0
  37. package/types/asset.d.ts +41 -0
  38. package/types/style.d.ts +42 -0
  39. package/workspace-template.jsonc +71 -0
@@ -0,0 +1,3 @@
1
+ import { Aspect, RuntimeDefinition } from '@teambit/harmony';
2
+ export declare const ConfigRuntime: RuntimeDefinition;
3
+ export declare const ConfigAspect: Aspect;
@@ -0,0 +1,21 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.ConfigRuntime = exports.ConfigAspect = void 0;
7
+ function _harmony() {
8
+ const data = require("@teambit/harmony");
9
+ _harmony = function () {
10
+ return data;
11
+ };
12
+ return data;
13
+ }
14
+ const ConfigRuntime = exports.ConfigRuntime = new (_harmony().RuntimeDefinition)('main');
15
+ const ConfigAspect = exports.ConfigAspect = _harmony().Aspect.create({
16
+ id: 'teambit.harmony/config',
17
+ dependencies: [],
18
+ declareRuntime: ConfigRuntime
19
+ });
20
+
21
+ //# sourceMappingURL=config.aspect.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["_harmony","data","require","ConfigRuntime","exports","RuntimeDefinition","ConfigAspect","Aspect","create","id","dependencies","declareRuntime"],"sources":["config.aspect.ts"],"sourcesContent":["import { Aspect, RuntimeDefinition } from '@teambit/harmony';\n\nexport const ConfigRuntime = new RuntimeDefinition('main');\n\nexport const ConfigAspect = Aspect.create({\n id: 'teambit.harmony/config',\n dependencies: [],\n declareRuntime: ConfigRuntime,\n});\n"],"mappings":";;;;;;AAAA,SAAAA,SAAA;EAAA,MAAAC,IAAA,GAAAC,OAAA;EAAAF,QAAA,YAAAA,CAAA;IAAA,OAAAC,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AAEO,MAAME,aAAa,GAAAC,OAAA,CAAAD,aAAA,GAAG,KAAIE,4BAAiB,EAAC,MAAM,CAAC;AAEnD,MAAMC,YAAY,GAAAF,OAAA,CAAAE,YAAA,GAAGC,iBAAM,CAACC,MAAM,CAAC;EACxCC,EAAE,EAAE,wBAAwB;EAC5BC,YAAY,EAAE,EAAE;EAChBC,cAAc,EAAER;AAClB,CAAC,CAAC","ignoreList":[]}
@@ -0,0 +1,43 @@
1
+ import { ExtensionDataEntry, ExtensionDataList } from '@teambit/legacy.extension-data';
2
+ import { ILegacyWorkspaceConfig } from '@teambit/legacy.consumer-config';
3
+ import { PathOsBased, PathOsBasedAbsolute } from '@teambit/legacy.utils';
4
+ import { GlobalConfig, Harmony } from '@teambit/harmony';
5
+ import { WorkspaceConfig, WorkspaceConfigFileProps, WorkspaceExtensionProps } from './workspace-config';
6
+ import { ConfigType, HostConfig } from './types';
7
+ export type SetExtensionOptions = {
8
+ overrideExisting?: boolean;
9
+ ignoreVersion: boolean;
10
+ mergeIntoExisting?: boolean;
11
+ };
12
+ export type ConfigDeps = [];
13
+ export type ConfigConfig = {};
14
+ export declare class ConfigMain {
15
+ workspaceConfig?: WorkspaceConfig | undefined;
16
+ scopeConfig?: WorkspaceConfig | undefined;
17
+ constructor(workspaceConfig?: WorkspaceConfig | undefined, scopeConfig?: WorkspaceConfig | undefined);
18
+ get type(): ConfigType;
19
+ get path(): PathOsBased | undefined;
20
+ get config(): HostConfig | undefined;
21
+ reloadWorkspaceConfig(cwd: string): Promise<void>;
22
+ /**
23
+ * Ensure the given directory has a workspace config
24
+ * Load if existing and create new if not
25
+ *
26
+ * @static
27
+ * @param {PathOsBasedAbsolute} workspacePath
28
+ * @param {WorkspaceConfigFileProps} [workspaceConfigProps={} as any]
29
+ * @returns {Promise<WorkspaceConfig>}
30
+ * @memberof WorkspaceConfig
31
+ */
32
+ static ensureWorkspace(workspacePath: PathOsBasedAbsolute, scopePath: PathOsBasedAbsolute, workspaceConfigProps?: WorkspaceConfigFileProps, generator?: string): Promise<ConfigMain>;
33
+ get extensions(): ExtensionDataList | undefined;
34
+ extension(extensionId: string, ignoreVersion: boolean): ExtensionDataEntry | undefined;
35
+ setExtension(extensionId: string, config: Record<string, any>, options: SetExtensionOptions): void;
36
+ getHarmonyConfigObject(): GlobalConfig;
37
+ static workspaceEnsureLegacy(workspacePath: string, scopePath: string, workspaceExtensionProps?: WorkspaceExtensionProps, generator?: string): Promise<ILegacyWorkspaceConfig>;
38
+ static runtime: import("@teambit/harmony").RuntimeDefinition;
39
+ static slots: never[];
40
+ static dependencies: never[];
41
+ static config: {};
42
+ static provider(_deps: any, _config: any, _slots: any, harmony: Harmony): Promise<any>;
43
+ }
@@ -0,0 +1,169 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.ConfigMain = void 0;
7
+ function _workspaceModules() {
8
+ const data = require("@teambit/workspace.modules.workspace-locator");
9
+ _workspaceModules = function () {
10
+ return data;
11
+ };
12
+ return data;
13
+ }
14
+ function _legacy() {
15
+ const data = require("@teambit/legacy.consumer-config");
16
+ _legacy = function () {
17
+ return data;
18
+ };
19
+ return data;
20
+ }
21
+ function _scopeModules() {
22
+ const data = require("@teambit/scope.modules.find-scope-path");
23
+ _scopeModules = function () {
24
+ return data;
25
+ };
26
+ return data;
27
+ }
28
+ function _cli() {
29
+ const data = require("@teambit/cli");
30
+ _cli = function () {
31
+ return data;
32
+ };
33
+ return data;
34
+ }
35
+ function _path() {
36
+ const data = _interopRequireDefault(require("path"));
37
+ _path = function () {
38
+ return data;
39
+ };
40
+ return data;
41
+ }
42
+ function _workspaceConfig() {
43
+ const data = require("./workspace-config");
44
+ _workspaceConfig = function () {
45
+ return data;
46
+ };
47
+ return data;
48
+ }
49
+ function _config2() {
50
+ const data = require("./config.aspect");
51
+ _config2 = function () {
52
+ return data;
53
+ };
54
+ return data;
55
+ }
56
+ function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
57
+ function _defineProperty(e, r, t) { return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : e[r] = t, e; }
58
+ function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == typeof i ? i : i + ""; }
59
+ function _toPrimitive(t, r) { if ("object" != typeof t || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != typeof i) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
60
+ class ConfigMain {
61
+ constructor(workspaceConfig, scopeConfig) {
62
+ this.workspaceConfig = workspaceConfig;
63
+ this.scopeConfig = scopeConfig;
64
+ }
65
+ get type() {
66
+ if (this.workspaceConfig) {
67
+ return 'workspace';
68
+ }
69
+ return 'scope';
70
+ }
71
+ get path() {
72
+ return this.config?.path;
73
+ }
74
+ get config() {
75
+ if (this.workspaceConfig) {
76
+ return this.workspaceConfig;
77
+ }
78
+ return this.scopeConfig;
79
+ }
80
+ async reloadWorkspaceConfig(cwd) {
81
+ const workspaceConfig = await loadWorkspaceConfigIfExist(cwd);
82
+ if (workspaceConfig) this.workspaceConfig = workspaceConfig;
83
+ }
84
+
85
+ /**
86
+ * Ensure the given directory has a workspace config
87
+ * Load if existing and create new if not
88
+ *
89
+ * @static
90
+ * @param {PathOsBasedAbsolute} workspacePath
91
+ * @param {WorkspaceConfigFileProps} [workspaceConfigProps={} as any]
92
+ * @returns {Promise<WorkspaceConfig>}
93
+ * @memberof WorkspaceConfig
94
+ */
95
+ static async ensureWorkspace(workspacePath, scopePath, workspaceConfigProps = {}, generator) {
96
+ const workspaceConfig = await _workspaceConfig().WorkspaceConfig.ensure(workspacePath, scopePath, workspaceConfigProps, generator);
97
+ return new ConfigMain(workspaceConfig);
98
+ }
99
+ get extensions() {
100
+ return this.config?.extensions;
101
+ }
102
+ extension(extensionId, ignoreVersion) {
103
+ return this.config?.extension(extensionId, ignoreVersion);
104
+ }
105
+ setExtension(extensionId, config, options) {
106
+ this.config?.setExtension(extensionId, config, options);
107
+ }
108
+ getHarmonyConfigObject() {
109
+ const config = {};
110
+ if (!this.extensions) return config;
111
+ this.extensions.forEach(extension => {
112
+ config[extension.stringId] = extension.config;
113
+ });
114
+ return config;
115
+ }
116
+ static async workspaceEnsureLegacy(workspacePath, scopePath, workspaceExtensionProps, generator) {
117
+ let workspaceConfigProps;
118
+ if (workspaceExtensionProps) {
119
+ workspaceConfigProps = {
120
+ 'teambit.workspace/workspace': workspaceExtensionProps
121
+ };
122
+ }
123
+ const config = await ConfigMain.ensureWorkspace(workspacePath, scopePath, workspaceConfigProps, generator);
124
+ const workspaceConfig = config.config;
125
+ return workspaceConfig.toLegacy();
126
+ }
127
+ static async provider(_deps, _config, _slots, harmony) {
128
+ // LegacyWorkspaceConfig.registerOnWorkspaceConfigEnsuring(onLegacyWorkspaceEnsure());
129
+
130
+ let configMain;
131
+ const bitConfig = harmony.config.raw.get('teambit.harmony/bit');
132
+ const workspaceConfig = await loadWorkspaceConfigIfExist(bitConfig?.cwd);
133
+ if (workspaceConfig) {
134
+ configMain = new ConfigMain(workspaceConfig, undefined);
135
+ } else {
136
+ // TODO: try load scope config here
137
+ configMain = {};
138
+ }
139
+ _legacy().LegacyWorkspaceConfig.registerOnWorkspaceConfigLoading(onLegacyWorkspaceLoad(configMain));
140
+ return configMain;
141
+ }
142
+ }
143
+ exports.ConfigMain = ConfigMain;
144
+ _defineProperty(ConfigMain, "runtime", _cli().MainRuntime);
145
+ _defineProperty(ConfigMain, "slots", []);
146
+ _defineProperty(ConfigMain, "dependencies", []);
147
+ _defineProperty(ConfigMain, "config", {});
148
+ _config2().ConfigAspect.addRuntime(ConfigMain);
149
+ async function loadWorkspaceConfigIfExist(cwd = process.cwd()) {
150
+ const consumerInfo = await (0, _workspaceModules().getWorkspaceInfo)(cwd);
151
+ const configDirPath = consumerInfo?.path || cwd;
152
+ const scopePath = (0, _scopeModules().findScopePath)(configDirPath);
153
+ const workspaceConfig = await _workspaceConfig().WorkspaceConfig.loadIfExist(configDirPath, scopePath);
154
+ return workspaceConfig;
155
+ }
156
+ function onLegacyWorkspaceLoad(config) {
157
+ return async (dirPath, scopePath) => {
158
+ if (config?.workspaceConfig && config.path && _path().default.normalize(dirPath) === _path().default.dirname(config.path)) {
159
+ return config.config.toLegacy();
160
+ }
161
+ const newConfig = await _workspaceConfig().WorkspaceConfig.loadIfExist(dirPath, scopePath);
162
+ if (newConfig) {
163
+ return newConfig.toLegacy();
164
+ }
165
+ return undefined;
166
+ };
167
+ }
168
+
169
+ //# sourceMappingURL=config.main.runtime.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["_workspaceModules","data","require","_legacy","_scopeModules","_cli","_path","_interopRequireDefault","_workspaceConfig","_config2","e","__esModule","default","_defineProperty","r","t","_toPropertyKey","Object","defineProperty","value","enumerable","configurable","writable","i","_toPrimitive","Symbol","toPrimitive","call","TypeError","String","Number","ConfigMain","constructor","workspaceConfig","scopeConfig","type","path","config","reloadWorkspaceConfig","cwd","loadWorkspaceConfigIfExist","ensureWorkspace","workspacePath","scopePath","workspaceConfigProps","generator","WorkspaceConfig","ensure","extensions","extension","extensionId","ignoreVersion","setExtension","options","getHarmonyConfigObject","forEach","stringId","workspaceEnsureLegacy","workspaceExtensionProps","toLegacy","provider","_deps","_config","_slots","harmony","configMain","bitConfig","raw","get","undefined","LegacyWorkspaceConfig","registerOnWorkspaceConfigLoading","onLegacyWorkspaceLoad","exports","MainRuntime","ConfigAspect","addRuntime","process","consumerInfo","getWorkspaceInfo","configDirPath","findScopePath","loadIfExist","dirPath","normalize","dirname","newConfig"],"sources":["config.main.runtime.ts"],"sourcesContent":["import { getWorkspaceInfo } from '@teambit/workspace.modules.workspace-locator';\nimport { ExtensionDataEntry, ExtensionDataList } from '@teambit/legacy.extension-data';\nimport {\n ILegacyWorkspaceConfig,\n LegacyWorkspaceConfig,\n WorkspaceConfigLoadFunction,\n} from '@teambit/legacy.consumer-config';\nimport { PathOsBased, PathOsBasedAbsolute } from '@teambit/legacy.utils';\nimport { findScopePath } from '@teambit/scope.modules.find-scope-path';\nimport { MainRuntime } from '@teambit/cli';\nimport { GlobalConfig, Harmony } from '@teambit/harmony';\nimport path from 'path';\nimport { WorkspaceConfig, WorkspaceConfigFileProps, WorkspaceExtensionProps } from './workspace-config';\nimport { ConfigType, HostConfig } from './types';\nimport { ConfigAspect } from './config.aspect';\n\nexport type SetExtensionOptions = {\n overrideExisting?: boolean;\n ignoreVersion: boolean;\n mergeIntoExisting?: boolean;\n};\n\nexport type ConfigDeps = [];\n\nexport type ConfigConfig = {};\n\nexport class ConfigMain {\n constructor(\n public workspaceConfig?: WorkspaceConfig,\n public scopeConfig?: WorkspaceConfig\n ) {}\n\n get type(): ConfigType {\n if (this.workspaceConfig) {\n return 'workspace';\n }\n return 'scope';\n }\n\n get path(): PathOsBased | undefined {\n return this.config?.path;\n }\n\n get config(): HostConfig | undefined {\n if (this.workspaceConfig) {\n return this.workspaceConfig;\n }\n return this.scopeConfig;\n }\n\n async reloadWorkspaceConfig(cwd: string) {\n const workspaceConfig = await loadWorkspaceConfigIfExist(cwd);\n if (workspaceConfig) this.workspaceConfig = workspaceConfig;\n }\n\n /**\n * Ensure the given directory has a workspace config\n * Load if existing and create new if not\n *\n * @static\n * @param {PathOsBasedAbsolute} workspacePath\n * @param {WorkspaceConfigFileProps} [workspaceConfigProps={} as any]\n * @returns {Promise<WorkspaceConfig>}\n * @memberof WorkspaceConfig\n */\n static async ensureWorkspace(\n workspacePath: PathOsBasedAbsolute,\n scopePath: PathOsBasedAbsolute,\n workspaceConfigProps: WorkspaceConfigFileProps = {} as any,\n generator?: string\n ): Promise<ConfigMain> {\n const workspaceConfig = await WorkspaceConfig.ensure(workspacePath, scopePath, workspaceConfigProps, generator);\n return new ConfigMain(workspaceConfig);\n }\n\n get extensions(): ExtensionDataList | undefined {\n return this.config?.extensions;\n }\n\n extension(extensionId: string, ignoreVersion: boolean): ExtensionDataEntry | undefined {\n return this.config?.extension(extensionId, ignoreVersion);\n }\n\n setExtension(extensionId: string, config: Record<string, any>, options: SetExtensionOptions) {\n this.config?.setExtension(extensionId, config, options);\n }\n\n getHarmonyConfigObject(): GlobalConfig {\n const config = {};\n if (!this.extensions) return config;\n this.extensions.forEach((extension) => {\n config[extension.stringId] = extension.config;\n });\n return config;\n }\n\n static async workspaceEnsureLegacy(\n workspacePath: string,\n scopePath: string,\n workspaceExtensionProps?: WorkspaceExtensionProps,\n generator?: string\n ) {\n let workspaceConfigProps;\n if (workspaceExtensionProps) {\n workspaceConfigProps = { 'teambit.workspace/workspace': workspaceExtensionProps };\n }\n const config = await ConfigMain.ensureWorkspace(workspacePath, scopePath, workspaceConfigProps, generator);\n const workspaceConfig = config.config;\n return (workspaceConfig as WorkspaceConfig).toLegacy();\n }\n\n static runtime = MainRuntime;\n static slots = [];\n static dependencies = [];\n static config = {};\n static async provider(_deps, _config, _slots, harmony: Harmony) {\n // LegacyWorkspaceConfig.registerOnWorkspaceConfigEnsuring(onLegacyWorkspaceEnsure());\n\n let configMain: ConfigMain | any;\n const bitConfig = harmony.config.raw.get('teambit.harmony/bit') as any;\n const workspaceConfig = await loadWorkspaceConfigIfExist(bitConfig?.cwd);\n if (workspaceConfig) {\n configMain = new ConfigMain(workspaceConfig, undefined);\n } else {\n // TODO: try load scope config here\n configMain = {};\n }\n LegacyWorkspaceConfig.registerOnWorkspaceConfigLoading(onLegacyWorkspaceLoad(configMain));\n return configMain;\n }\n}\n\nConfigAspect.addRuntime(ConfigMain);\n\nasync function loadWorkspaceConfigIfExist(cwd = process.cwd()): Promise<WorkspaceConfig | undefined> {\n const consumerInfo = await getWorkspaceInfo(cwd);\n const configDirPath = consumerInfo?.path || cwd;\n const scopePath = findScopePath(configDirPath);\n const workspaceConfig = await WorkspaceConfig.loadIfExist(configDirPath, scopePath);\n return workspaceConfig;\n}\n\nfunction onLegacyWorkspaceLoad(config?: ConfigMain): WorkspaceConfigLoadFunction {\n return async (dirPath: PathOsBased, scopePath: PathOsBasedAbsolute): Promise<ILegacyWorkspaceConfig | undefined> => {\n if (config?.workspaceConfig && config.path && path.normalize(dirPath) === path.dirname(config.path)) {\n return (config.config as WorkspaceConfig).toLegacy();\n }\n const newConfig = await WorkspaceConfig.loadIfExist(dirPath, scopePath);\n if (newConfig) {\n return newConfig.toLegacy();\n }\n return undefined;\n };\n}\n"],"mappings":";;;;;;AAAA,SAAAA,kBAAA;EAAA,MAAAC,IA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OAAOV,eAAe;AACxB;AAEA,SAASuC,qBAAqBA,CAACnC,MAAmB,EAA+B;EAC/E,OAAO,OAAO8C,OAAoB,EAAExC,SAA8B,KAAkD;IAClH,IAAIN,MAAM,EAAEJ,eAAe,IAAII,MAAM,CAACD,IAAI,IAAIA,eAAI,CAACgD,SAAS,CAACD,OAAO,CAAC,KAAK/C,eAAI,CAACiD,OAAO,CAAChD,MAAM,CAACD,IAAI,CAAC,EAAE;MACnG,OAAQC,MAAM,CAACA,MAAM,CAAqBsB,QAAQ,CAAC,CAAC;IACtD;IACA,MAAM2B,SAAS,GAAG,MAAMxC,kCAAe,CAACoC,WAAW,CAACC,OAAO,EAAExC,SAAS,CAAC;IACvE,IAAI2C,SAAS,EAAE;MACb,OAAOA,SAAS,CAAC3B,QAAQ,CAAC,CAAC;IAC7B;IACA,OAAOU,SAAS;EAClB,CAAC;AACH","ignoreList":[]}
package/dist/esm.mjs ADDED
@@ -0,0 +1,12 @@
1
+ // eslint-disable-next-line import/no-unresolved
2
+ import cjsModule from './index.js';
3
+
4
+ export const ConfigAspect = cjsModule.ConfigAspect;
5
+ export const ConfigRuntime = cjsModule.ConfigRuntime;
6
+ export const ConfigMain = cjsModule.ConfigMain;
7
+ export const getWorkspaceConfigTemplateParsed = cjsModule.getWorkspaceConfigTemplateParsed;
8
+ export const stringifyWorkspaceConfig = cjsModule.stringifyWorkspaceConfig;
9
+ export const getConfigAspect = cjsModule.getConfigAspect;
10
+ export const WorkspaceConfig = cjsModule.WorkspaceConfig;
11
+
12
+ export default cjsModule;
@@ -0,0 +1,5 @@
1
+ import { BitError } from '@teambit/bit-error';
2
+ export declare class ExtensionAlreadyConfigured extends BitError {
3
+ readonly extensionId: string;
4
+ constructor(extensionId: string);
5
+ }
@@ -0,0 +1,22 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.ExtensionAlreadyConfigured = void 0;
7
+ function _bitError() {
8
+ const data = require("@teambit/bit-error");
9
+ _bitError = function () {
10
+ return data;
11
+ };
12
+ return data;
13
+ }
14
+ class ExtensionAlreadyConfigured extends _bitError().BitError {
15
+ constructor(extensionId) {
16
+ super(`error: the extension ${extensionId} is already configured in the config file`);
17
+ this.extensionId = extensionId;
18
+ }
19
+ }
20
+ exports.ExtensionAlreadyConfigured = ExtensionAlreadyConfigured;
21
+
22
+ //# sourceMappingURL=extension-already-configured.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["_bitError","data","require","ExtensionAlreadyConfigured","BitError","constructor","extensionId","exports"],"sources":["extension-already-configured.ts"],"sourcesContent":["import { BitError } from '@teambit/bit-error';\n\nexport class ExtensionAlreadyConfigured extends BitError {\n constructor(readonly extensionId: string) {\n super(`error: the extension ${extensionId} is already configured in the config file`);\n }\n}\n"],"mappings":";;;;;;AAAA,SAAAA,UAAA;EAAA,MAAAC,IAAA,GAAAC,OAAA;EAAAF,SAAA,YAAAA,CAAA;IAAA,OAAAC,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AAEO,MAAME,0BAA0B,SAASC,oBAAQ,CAAC;EACvDC,WAAWA,CAAUC,WAAmB,EAAE;IACxC,KAAK,CAAC,wBAAwBA,WAAW,2CAA2C,CAAC;IAAC,KADnEA,WAAmB,GAAnBA,WAAmB;EAExC;AACF;AAACC,OAAA,CAAAJ,0BAAA,GAAAA,0BAAA","ignoreList":[]}
@@ -0,0 +1 @@
1
+ export { ExtensionAlreadyConfigured } from './extension-already-configured';
@@ -0,0 +1,20 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ Object.defineProperty(exports, "ExtensionAlreadyConfigured", {
7
+ enumerable: true,
8
+ get: function () {
9
+ return _extensionAlreadyConfigured().ExtensionAlreadyConfigured;
10
+ }
11
+ });
12
+ function _extensionAlreadyConfigured() {
13
+ const data = require("./extension-already-configured");
14
+ _extensionAlreadyConfigured = function () {
15
+ return data;
16
+ };
17
+ return data;
18
+ }
19
+
20
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["_extensionAlreadyConfigured","data","require"],"sources":["index.ts"],"sourcesContent":["export { ExtensionAlreadyConfigured } from './extension-already-configured';\n"],"mappings":";;;;;;;;;;;AAAA,SAAAA,4BAAA;EAAA,MAAAC,IAAA,GAAAC,OAAA;EAAAF,2BAAA,YAAAA,CAAA;IAAA,OAAAC,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA","ignoreList":[]}
@@ -0,0 +1,6 @@
1
+ import { BitError } from '@teambit/bit-error';
2
+ export default class InvalidConfigFile extends BitError {
3
+ readonly path: string;
4
+ showDoctorMessage: boolean;
5
+ constructor(path: string);
6
+ }
@@ -0,0 +1,36 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.default = void 0;
7
+ function _bitError() {
8
+ const data = require("@teambit/bit-error");
9
+ _bitError = function () {
10
+ return data;
11
+ };
12
+ return data;
13
+ }
14
+ function _chalk() {
15
+ const data = _interopRequireDefault(require("chalk"));
16
+ _chalk = function () {
17
+ return data;
18
+ };
19
+ return data;
20
+ }
21
+ function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
22
+ function _defineProperty(e, r, t) { return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : e[r] = t, e; }
23
+ function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == typeof i ? i : i + ""; }
24
+ function _toPrimitive(t, r) { if ("object" != typeof t || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != typeof i) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
25
+ class InvalidConfigFile extends _bitError().BitError {
26
+ constructor(path) {
27
+ super(`error: invalid workspace.jsonc: ${_chalk().default.bold(path)} is not a valid JSON file.
28
+ consider running ${_chalk().default.bold('bit init --reset')} to recreate the file`);
29
+ this.path = path;
30
+ _defineProperty(this, "showDoctorMessage", void 0);
31
+ this.showDoctorMessage = true;
32
+ }
33
+ }
34
+ exports.default = InvalidConfigFile;
35
+
36
+ //# sourceMappingURL=invalid-config-file.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["_bitError","data","require","_chalk","_interopRequireDefault","e","__esModule","default","_defineProperty","r","t","_toPropertyKey","Object","defineProperty","value","enumerable","configurable","writable","i","_toPrimitive","Symbol","toPrimitive","call","TypeError","String","Number","InvalidConfigFile","BitError","constructor","path","chalk","bold","showDoctorMessage","exports"],"sources":["invalid-config-file.ts"],"sourcesContent":["import { BitError } from '@teambit/bit-error';\nimport chalk from 'chalk';\n\nexport default class InvalidConfigFile extends BitError {\n showDoctorMessage: boolean;\n constructor(readonly path: string) {\n super(`error: invalid workspace.jsonc: ${chalk.bold(path)} is not a valid JSON file.\nconsider running ${chalk.bold('bit init --reset')} to recreate the file`);\n this.showDoctorMessage = true;\n }\n}\n"],"mappings":";;;;;;AAAA,SAAAA,UAAA;EAAA,MAAAC,IAAA,GAAAC,OAAA;EAAAF,SAAA,YAAAA,CAAA;IAAA,OAAAC,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AACA,SAAAE,OAAA;EAAA,MAAAF,IAAA,GAAAG,sBAAA,CAAAF,OAAA;EAAAC,MAAA,YAAAA,CAAA;IAAA,OAAAF,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AAA0B,SAAAG,uBAAAC,CAAA,WAAAA,CAAA,IAAAA,CAAA,CAAAC,UAAA,GAAAD,CAAA,KAAAE,OAAA,EAAAF,CAAA;AAAA,SAAAG,gBAAAH,CAAA,EAAAI,CAAA,EAAAC,CAAA,YAAAD,CAAA,GAAAE,cAAA,CAAAF,CAAA,MAAAJ,CAAA,GAAAO,MAAA,CAAAC,cAAA,CAAAR,CAAA,EAAAI,CAAA,IAAAK,KAAA,EAAAJ,CAAA,EAAAK,UAAA,MAAAC,YAAA,MAAAC,QAAA,UAAAZ,CAAA,CAAAI,CAAA,IAAAC,CAAA,EAAAL,CAAA;AAAA,SAAAM,eAAAD,CAAA,QAAAQ,CAAA,GAAAC,YAAA,CAAAT,CAAA,uCAAAQ,CAAA,GAAAA,CAAA,GAAAA,CAAA;AAAA,SAAAC,aAAAT,CAAA,EAAAD,CAAA,2BAAAC,CAAA,KAAAA,CAAA,SAAAA,CAAA,MAAAL,CAAA,GAAAK,CAAA,CAAAU,MAAA,CAAAC,WAAA,kBAAAhB,CAAA,QAAAa,CAAA,GAAAb,CAAA,CAAAiB,IAAA,CAAAZ,CAAA,EAAAD,CAAA,uCAAAS,CAAA,SAAAA,CAAA,YAAAK,SAAA,yEAAAd,CAAA,GAAAe,MAAA,GAAAC,MAAA,EAAAf,CAAA;AAEX,MAAMgB,iBAAiB,SAASC,oBAAQ,CAAC;EAEtDC,WAAWA,CAAUC,IAAY,EAAE;IACjC,KAAK,CAAC,mCAAmCC,gBAAK,CAACC,IAAI,CAACF,IAAI,CAAC;AAC7D,mBAAmBC,gBAAK,CAACC,IAAI,CAAC,kBAAkB,CAAC,uBAAuB,CAAC;IAAC,KAFnDF,IAAY,GAAZA,IAAY;IAAArB,eAAA;IAG/B,IAAI,CAACwB,iBAAiB,GAAG,IAAI;EAC/B;AACF;AAACC,OAAA,CAAA1B,OAAA,GAAAmB,iBAAA","ignoreList":[]}
@@ -0,0 +1,4 @@
1
+ export { ConfigMain } from './config.main.runtime';
2
+ export { ConfigAspect, ConfigRuntime } from './config.aspect';
3
+ export type { ComponentScopeDirMap, WorkspaceExtensionProps, WorkspaceConfigFileProps } from './workspace-config';
4
+ export { getWorkspaceConfigTemplateParsed, stringifyWorkspaceConfig, WorkspaceConfig } from './workspace-config';
package/dist/index.js ADDED
@@ -0,0 +1,64 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ Object.defineProperty(exports, "ConfigAspect", {
7
+ enumerable: true,
8
+ get: function () {
9
+ return _config().ConfigAspect;
10
+ }
11
+ });
12
+ Object.defineProperty(exports, "ConfigMain", {
13
+ enumerable: true,
14
+ get: function () {
15
+ return _configMain().ConfigMain;
16
+ }
17
+ });
18
+ Object.defineProperty(exports, "ConfigRuntime", {
19
+ enumerable: true,
20
+ get: function () {
21
+ return _config().ConfigRuntime;
22
+ }
23
+ });
24
+ Object.defineProperty(exports, "WorkspaceConfig", {
25
+ enumerable: true,
26
+ get: function () {
27
+ return _workspaceConfig().WorkspaceConfig;
28
+ }
29
+ });
30
+ Object.defineProperty(exports, "getWorkspaceConfigTemplateParsed", {
31
+ enumerable: true,
32
+ get: function () {
33
+ return _workspaceConfig().getWorkspaceConfigTemplateParsed;
34
+ }
35
+ });
36
+ Object.defineProperty(exports, "stringifyWorkspaceConfig", {
37
+ enumerable: true,
38
+ get: function () {
39
+ return _workspaceConfig().stringifyWorkspaceConfig;
40
+ }
41
+ });
42
+ function _configMain() {
43
+ const data = require("./config.main.runtime");
44
+ _configMain = function () {
45
+ return data;
46
+ };
47
+ return data;
48
+ }
49
+ function _config() {
50
+ const data = require("./config.aspect");
51
+ _config = function () {
52
+ return data;
53
+ };
54
+ return data;
55
+ }
56
+ function _workspaceConfig() {
57
+ const data = require("./workspace-config");
58
+ _workspaceConfig = function () {
59
+ return data;
60
+ };
61
+ return data;
62
+ }
63
+
64
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["_configMain","data","require","_config","_workspaceConfig"],"sources":["index.ts"],"sourcesContent":["export { ConfigMain } from './config.main.runtime';\nexport { ConfigAspect, ConfigRuntime } from './config.aspect';\nexport type { ComponentScopeDirMap, WorkspaceExtensionProps, WorkspaceConfigFileProps } from './workspace-config';\nexport { getWorkspaceConfigTemplateParsed, stringifyWorkspaceConfig, WorkspaceConfig } from './workspace-config';\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,SAAAA,YAAA;EAAA,MAAAC,IAAA,GAAAC,OAAA;EAAAF,WAAA,YAAAA,CAAA;IAAA,OAAAC,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AACA,SAAAE,QAAA;EAAA,MAAAF,IAAA,GAAAC,OAAA;EAAAC,OAAA,YAAAA,CAAA;IAAA,OAAAF,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AAEA,SAAAG,iBAAA;EAAA,MAAAH,IAAA,GAAAC,OAAA;EAAAE,gBAAA,YAAAA,CAAA;IAAA,OAAAH,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA","ignoreList":[]}
@@ -0,0 +1,7 @@
1
+ ;
2
+ ;
3
+
4
+ export const compositions = [];
5
+ export const overview = [];
6
+
7
+ export const compositions_metadata = {"compositions":[]};
package/dist/readme.md ADDED
@@ -0,0 +1,3 @@
1
+ WIP
2
+ this was cherry picked from another branch, so it doesn't contain all the logic.
3
+ please do not touch:)
@@ -0,0 +1,156 @@
1
+ {
2
+ "$schema": "http://json-schema.org/draft-07/schema#",
3
+ "title": "Configuration file of the Bit workspace.",
4
+ "description": "This is the main configuration file of your bit workspace. for full documentation, please see: https://bit.dev/docs/configuration",
5
+ "type": "object",
6
+ "properties": {
7
+ "teambit.workspace/workspace": {
8
+ "description": "Main configuration of the Bit workspace.",
9
+ "type": "object",
10
+ "properties": {
11
+ "name": {
12
+ "description": "the name of the component workspace. used for development purposes.",
13
+ "type": "string"
14
+ },
15
+ "icon": {
16
+ "description": "set the icon url to be shown on the Bit server.",
17
+ "type": "string"
18
+ },
19
+ "defaultOwner": {
20
+ "description": "applies only on bit.dev. configure the main owner of your workspace.",
21
+ "type": "string"
22
+ },
23
+ "defaultScope": {
24
+ "description": "set the default scope when there is no matching for the component in the components array.",
25
+ "type": "string"
26
+ },
27
+ "defaultDirectory": {
28
+ "description": "set the default directory when there is no matching for the component in the components array.",
29
+ "type": "string"
30
+ },
31
+ "vendorDirectory": {
32
+ "description": "",
33
+ "type": "string"
34
+ }
35
+ },
36
+ "required": ["defaultScope"]
37
+ },
38
+ "teambit.dependencies/dependency-resolver": {
39
+ "description": "Main configuration for component dependency resolution.",
40
+ "type": "object",
41
+ "properties": {
42
+ "packageManager": {
43
+ "description": "main configuration for bit's component dependency resolution.",
44
+ "type": "string",
45
+ "examples": ["teambit.dependencies/pnpm"]
46
+ },
47
+ "strictPeerDependencies": {
48
+ "description": "If true, then Bit will add the '--strict-peer-dependencies' option when invoking package managers. This causes 'bit install' to fail if there are unsatisfied peer dependencies, which is an invalid state that can cause build failures or incompatible dependency versions. (For historical reasons, JavaScript package managers generally do not treat this invalid state as an error.) The default value is false to avoid legacy compatibility issues. It is strongly recommended to set strictPeerDependencies=true.",
49
+ "type": "boolean",
50
+ "default": false
51
+ },
52
+ "extraArgs": {
53
+ "description": "map of extra arguments to pass to the configured package manager upon the installation of dependencies.",
54
+ "type": "array"
55
+ },
56
+ "policy": {
57
+ "description": "Dependency type is defined by the file that import it. For example, library will be devDependency when the file that imports it is a test file.",
58
+ "type": "object",
59
+ "properties": {
60
+ "dependencies": {
61
+ "type": "object"
62
+ },
63
+ "devDependencies": {
64
+ "type": "object"
65
+ },
66
+ "peerDependencies": {
67
+ "type": "object"
68
+ }
69
+ }
70
+ }
71
+ },
72
+ "required": ["packageManager"]
73
+ },
74
+ "teambit.react/react": {
75
+ "description": "apply the react environment on components.",
76
+ "type": "object",
77
+ "properties": {
78
+ "reactVersion": {
79
+ "description": "sets react version.",
80
+ "type": "string",
81
+ "default": ">=16.0.0",
82
+ "examples": [">=16.0.0", ">=15.0.0"]
83
+ }
84
+ }
85
+ },
86
+ "teambit.workspace/variants": {
87
+ "description": "Workspace variants allow to set different subsets of configuration for components in your workspace. This is extremely useful for upgrading, aligning and building components with a new set of dependencies.",
88
+ "type": "object",
89
+ "properties": {
90
+ "*": {
91
+ "description": "Any directory of components",
92
+ "type": "object",
93
+ "properties": {
94
+ "propagate": {
95
+ "description": "",
96
+ "type": "boolean"
97
+ },
98
+ "teambit.react/react": {
99
+ "description": "apply the react environment on components.",
100
+ "type": "object",
101
+ "properties": {
102
+ "typescript": {
103
+ "description": "turn on typescript compiler.",
104
+ "type": "boolean"
105
+ },
106
+ "root": {
107
+ "description": "root component is the one to be deployed and served.",
108
+ "type": "string"
109
+ },
110
+ "version": {
111
+ "description": "sets react version. This will add react and @types/react (in case typescript is turned on) as peer dependencies with this SemVer.",
112
+ "type": "string",
113
+ "default": ">=16.0.0",
114
+ "examples": [">=16.0.0", ">=15.0.0"]
115
+ },
116
+ "defaultScope": {
117
+ "description": "set the collection of these components",
118
+ "type": "string"
119
+ }
120
+ }
121
+ },
122
+ "teambit.harmony/node": {
123
+ "description": "apply the node environment on components.",
124
+ "type": "object",
125
+ "properties": {
126
+ "defaultScope": {
127
+ "description": "set the collection of these components",
128
+ "type": "string"
129
+ }
130
+ }
131
+ },
132
+ "teambit.pkg/pkg": {
133
+ "description": "",
134
+ "type": "object",
135
+ "properties": {
136
+ "packageJson": {
137
+ "description": "",
138
+ "type": "object",
139
+ "properties": {
140
+ "name": {
141
+ "description": "",
142
+ "type": "string"
143
+ }
144
+ }
145
+ }
146
+ }
147
+ }
148
+ }
149
+ }
150
+ },
151
+ "additionalProperties": true,
152
+ "required": []
153
+ }
154
+ },
155
+ "required": ["teambit.workspace/workspace", "teambit.dependencies/dependency-resolver"]
156
+ }