@teambit/host-initializer 0.0.0-00e74b4aacfebbf6a0c35c2e7bbb97a37d46cf0a
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/create-consumer.d.ts +12 -0
- package/dist/create-consumer.js +160 -0
- package/dist/create-consumer.js.map +1 -0
- package/dist/esm.mjs +9 -0
- package/dist/host-initializer.aspect.d.ts +2 -0
- package/dist/host-initializer.aspect.js +18 -0
- package/dist/host-initializer.aspect.js.map +1 -0
- package/dist/host-initializer.main.runtime.d.ts +57 -0
- package/dist/host-initializer.main.runtime.js +470 -0
- package/dist/host-initializer.main.runtime.js.map +1 -0
- package/dist/index.d.ts +5 -0
- package/dist/index.js +48 -0
- package/dist/index.js.map +1 -0
- package/dist/init-cmd.d.ts +19 -0
- package/dist/init-cmd.js +155 -0
- package/dist/init-cmd.js.map +1 -0
- package/dist/objects-without-consumer.d.ts +5 -0
- package/dist/objects-without-consumer.js +33 -0
- package/dist/objects-without-consumer.js.map +1 -0
- package/dist/preview-1764020897641.js +7 -0
- package/esm.mjs +9 -0
- package/package.json +73 -0
- package/types/asset.d.ts +41 -0
- package/types/style.d.ts +42 -0
package/dist/init-cmd.js
ADDED
|
@@ -0,0 +1,155 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.InitCmd = void 0;
|
|
7
|
+
function _chalk() {
|
|
8
|
+
const data = _interopRequireDefault(require("chalk"));
|
|
9
|
+
_chalk = function () {
|
|
10
|
+
return data;
|
|
11
|
+
};
|
|
12
|
+
return data;
|
|
13
|
+
}
|
|
14
|
+
function pathlib() {
|
|
15
|
+
const data = _interopRequireWildcard(require("path"));
|
|
16
|
+
pathlib = function () {
|
|
17
|
+
return data;
|
|
18
|
+
};
|
|
19
|
+
return data;
|
|
20
|
+
}
|
|
21
|
+
function _bitError() {
|
|
22
|
+
const data = require("@teambit/bit-error");
|
|
23
|
+
_bitError = function () {
|
|
24
|
+
return data;
|
|
25
|
+
};
|
|
26
|
+
return data;
|
|
27
|
+
}
|
|
28
|
+
function _configStore() {
|
|
29
|
+
const data = require("@teambit/config-store");
|
|
30
|
+
_configStore = function () {
|
|
31
|
+
return data;
|
|
32
|
+
};
|
|
33
|
+
return data;
|
|
34
|
+
}
|
|
35
|
+
function _legacy() {
|
|
36
|
+
const data = require("@teambit/legacy.scope-api");
|
|
37
|
+
_legacy = function () {
|
|
38
|
+
return data;
|
|
39
|
+
};
|
|
40
|
+
return data;
|
|
41
|
+
}
|
|
42
|
+
function _legacy2() {
|
|
43
|
+
const data = require("@teambit/legacy.constants");
|
|
44
|
+
_legacy2 = function () {
|
|
45
|
+
return data;
|
|
46
|
+
};
|
|
47
|
+
return data;
|
|
48
|
+
}
|
|
49
|
+
function _hostInitializerMain() {
|
|
50
|
+
const data = require("./host-initializer.main.runtime");
|
|
51
|
+
_hostInitializerMain = function () {
|
|
52
|
+
return data;
|
|
53
|
+
};
|
|
54
|
+
return data;
|
|
55
|
+
}
|
|
56
|
+
function _interopRequireWildcard(e, t) { if ("function" == typeof WeakMap) var r = new WeakMap(), n = new WeakMap(); return (_interopRequireWildcard = function (e, t) { if (!t && e && e.__esModule) return e; var o, i, f = { __proto__: null, default: e }; if (null === e || "object" != typeof e && "function" != typeof e) return f; if (o = t ? n : r) { if (o.has(e)) return o.get(e); o.set(e, f); } for (const t in e) "default" !== t && {}.hasOwnProperty.call(e, t) && ((i = (o = Object.defineProperty) && Object.getOwnPropertyDescriptor(e, t)) && (i.get || i.set) ? o(f, t, i) : f[t] = e[t]); return f; })(e, t); }
|
|
57
|
+
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
58
|
+
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; }
|
|
59
|
+
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == typeof i ? i : i + ""; }
|
|
60
|
+
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); }
|
|
61
|
+
class InitCmd {
|
|
62
|
+
constructor(hostInitializer, logger) {
|
|
63
|
+
this.hostInitializer = hostInitializer;
|
|
64
|
+
this.logger = logger;
|
|
65
|
+
_defineProperty(this, "name", 'init [path]');
|
|
66
|
+
_defineProperty(this, "skipWorkspace", true);
|
|
67
|
+
_defineProperty(this, "description", 'initialize a Bit workspace in an existing project');
|
|
68
|
+
_defineProperty(this, "helpUrl", 'reference/workspace/creating-workspaces/?new_existing_project=1');
|
|
69
|
+
_defineProperty(this, "group", 'workspace-setup');
|
|
70
|
+
_defineProperty(this, "extendedDescription", `creates Bit configuration files in an existing project directory to start tracking components.
|
|
71
|
+
if already a workspace, validates and repairs Bit files as needed.
|
|
72
|
+
supports various reset options to recover from corrupted state or restart from scratch.`);
|
|
73
|
+
_defineProperty(this, "alias", '');
|
|
74
|
+
_defineProperty(this, "loadAspects", false);
|
|
75
|
+
_defineProperty(this, "options", [['n', 'name <workspace-name>', 'name of the workspace'], ['', 'generator <env-id>', 'for multiple, separate by a comma. add env-ids into the generators field in the workspace config for future "bit create" templates'], ['T', 'standalone', 'do not nest component store within .git directory and do not write config data inside package.json'], ['', 'no-package-json', 'do not generate package.json'], ['r', 'reset', 'write missing or damaged Bit files'], ['', 'reset-new', 'reset .bitmap file as if the components were newly added and remove all model data (objects)'], ['', 'reset-lane-new', 'same as reset-new, but it only resets components belong to lanes. main components are left intact'], ['', 'reset-hard', 'delete all Bit files and directories, including Bit configuration, tracking and model data. Useful for re-starting workspace from scratch'], ['', 'reset-scope', 'removes local scope (.bit or .git/bit). tags/snaps that have not been exported will be lost. workspace is left intact'], ['d', 'default-directory <default-directory>', 'set the default directory pattern to import/create components into'], ['', 'default-scope <default-scope>', 'set the default scope for components in the workspace'], ['f', 'force', 'force workspace initialization without clearing local objects'], ['b', 'bare [name]', 'initialize an empty bit bare scope'], ['s', 'shared <groupname>', 'add group write permissions to a scope properly'], ['', 'external-package-manager', 'enable external package manager mode (npm/yarn/pnpm)'], ['', 'skip-interactive', 'skip interactive mode for Git repositories']]);
|
|
76
|
+
}
|
|
77
|
+
async handleInteractiveMode(projectPath, flags) {
|
|
78
|
+
const {
|
|
79
|
+
reset,
|
|
80
|
+
resetNew,
|
|
81
|
+
resetLaneNew,
|
|
82
|
+
resetHard,
|
|
83
|
+
resetScope,
|
|
84
|
+
standalone,
|
|
85
|
+
skipInteractive,
|
|
86
|
+
externalPackageManager
|
|
87
|
+
} = flags;
|
|
88
|
+
|
|
89
|
+
// Check if we should run interactive mode
|
|
90
|
+
if (reset || resetNew || resetLaneNew || resetHard || resetScope || standalone || skipInteractive || externalPackageManager || !(await _hostInitializerMain().HostInitializerMain.hasGitDirectory(projectPath)) || (await _hostInitializerMain().HostInitializerMain.hasWorkspaceInitialized(projectPath))) {
|
|
91
|
+
return null;
|
|
92
|
+
}
|
|
93
|
+
this.logger.off();
|
|
94
|
+
this.logger.console(_chalk().default.cyan('🔧 Interactive setup for existing Git repository\n'));
|
|
95
|
+
try {
|
|
96
|
+
const interactiveConfig = await _hostInitializerMain().HostInitializerMain.runInteractiveMode(projectPath);
|
|
97
|
+
|
|
98
|
+
// Set up MCP server if user selected an editor
|
|
99
|
+
if (interactiveConfig.mcpEditor) {
|
|
100
|
+
this.logger.console(_chalk().default.cyan(`\n🔧 Setting up MCP server for ${interactiveConfig.mcpEditor}...`));
|
|
101
|
+
await _hostInitializerMain().HostInitializerMain.setupMcpServer(interactiveConfig.mcpEditor, projectPath);
|
|
102
|
+
this.logger.console(_chalk().default.green(`✅ MCP server configured for ${interactiveConfig.mcpEditor}`));
|
|
103
|
+
}
|
|
104
|
+
return interactiveConfig;
|
|
105
|
+
} catch (error) {
|
|
106
|
+
this.logger.consoleWarning(`Warning: Interactive setup failed: ${error.message}`);
|
|
107
|
+
return null;
|
|
108
|
+
}
|
|
109
|
+
}
|
|
110
|
+
async report([path], flags) {
|
|
111
|
+
const {
|
|
112
|
+
name,
|
|
113
|
+
generator,
|
|
114
|
+
bare,
|
|
115
|
+
shared,
|
|
116
|
+
standalone,
|
|
117
|
+
noPackageJson,
|
|
118
|
+
reset,
|
|
119
|
+
resetNew,
|
|
120
|
+
resetLaneNew,
|
|
121
|
+
resetHard,
|
|
122
|
+
resetScope,
|
|
123
|
+
force,
|
|
124
|
+
defaultDirectory,
|
|
125
|
+
defaultScope,
|
|
126
|
+
externalPackageManager
|
|
127
|
+
} = flags;
|
|
128
|
+
if (path) path = pathlib().resolve(path);
|
|
129
|
+
if (bare) {
|
|
130
|
+
if (reset || resetHard) throw new (_bitError().BitError)('--reset and --reset-hard flags are not available for bare scope');
|
|
131
|
+
// Handle both cases init --bare and init --bare [scopeName]
|
|
132
|
+
const bareVal = bare === true ? '' : bare;
|
|
133
|
+
await (0, _legacy().initScope)(path, bareVal, shared);
|
|
134
|
+
return `${_chalk().default.green('successfully initialized an empty bare bit scope.')}`;
|
|
135
|
+
}
|
|
136
|
+
if (reset && resetHard) {
|
|
137
|
+
throw new (_bitError().BitError)('cannot use both --reset and --reset-hard, please use only one of them');
|
|
138
|
+
}
|
|
139
|
+
const projectPath = path || process.cwd();
|
|
140
|
+
const interactiveConfig = await this.handleInteractiveMode(projectPath, flags);
|
|
141
|
+
const workspaceExtensionProps = {
|
|
142
|
+
defaultDirectory: interactiveConfig?.defaultDirectory || (externalPackageManager ? 'bit-components/{scope}/{name}' : defaultDirectory) || (0, _configStore().getConfig)(_legacy2().CFG_INIT_DEFAULT_DIRECTORY),
|
|
143
|
+
defaultScope: defaultScope || (0, _configStore().getConfig)(_legacy2().CFG_INIT_DEFAULT_SCOPE),
|
|
144
|
+
name,
|
|
145
|
+
externalPackageManager: interactiveConfig?.externalPackageManager || externalPackageManager
|
|
146
|
+
};
|
|
147
|
+
const {
|
|
148
|
+
created
|
|
149
|
+
} = await _hostInitializerMain().HostInitializerMain.init(path, standalone, noPackageJson, reset, resetNew, resetLaneNew, resetHard, resetScope, force, workspaceExtensionProps, interactiveConfig?.generator || generator);
|
|
150
|
+
return _hostInitializerMain().HostInitializerMain.generateInitMessage(created, reset, resetHard, resetScope, interactiveConfig);
|
|
151
|
+
}
|
|
152
|
+
}
|
|
153
|
+
exports.InitCmd = InitCmd;
|
|
154
|
+
|
|
155
|
+
//# sourceMappingURL=init-cmd.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["_chalk","data","_interopRequireDefault","require","pathlib","_interopRequireWildcard","_bitError","_configStore","_legacy","_legacy2","_hostInitializerMain","e","t","WeakMap","r","n","__esModule","o","i","f","__proto__","default","has","get","set","hasOwnProperty","call","Object","defineProperty","getOwnPropertyDescriptor","_defineProperty","_toPropertyKey","value","enumerable","configurable","writable","_toPrimitive","Symbol","toPrimitive","TypeError","String","Number","InitCmd","constructor","hostInitializer","logger","handleInteractiveMode","projectPath","flags","reset","resetNew","resetLaneNew","resetHard","resetScope","standalone","skipInteractive","externalPackageManager","HostInitializerMain","hasGitDirectory","hasWorkspaceInitialized","off","console","chalk","cyan","interactiveConfig","runInteractiveMode","mcpEditor","setupMcpServer","green","error","consoleWarning","message","report","path","name","generator","bare","shared","noPackageJson","force","defaultDirectory","defaultScope","resolve","BitError","bareVal","initScope","process","cwd","workspaceExtensionProps","getConfig","CFG_INIT_DEFAULT_DIRECTORY","CFG_INIT_DEFAULT_SCOPE","created","init","generateInitMessage","exports"],"sources":["init-cmd.ts"],"sourcesContent":["import chalk from 'chalk';\nimport * as pathlib from 'path';\nimport { BitError } from '@teambit/bit-error';\nimport { getConfig } from '@teambit/config-store';\nimport { initScope } from '@teambit/legacy.scope-api';\nimport { CFG_INIT_DEFAULT_SCOPE, CFG_INIT_DEFAULT_DIRECTORY } from '@teambit/legacy.constants';\nimport type { WorkspaceExtensionProps } from '@teambit/config';\nimport type { Command, CommandOptions } from '@teambit/cli';\nimport type { InteractiveConfig } from './host-initializer.main.runtime';\nimport { HostInitializerMain } from './host-initializer.main.runtime';\nimport type { Logger } from '@teambit/logger';\n\nexport class InitCmd implements Command {\n name = 'init [path]';\n skipWorkspace = true;\n description = 'initialize a Bit workspace in an existing project';\n helpUrl = 'reference/workspace/creating-workspaces/?new_existing_project=1';\n group = 'workspace-setup';\n extendedDescription = `creates Bit configuration files in an existing project directory to start tracking components.\nif already a workspace, validates and repairs Bit files as needed.\nsupports various reset options to recover from corrupted state or restart from scratch.`;\n alias = '';\n loadAspects = false;\n options = [\n ['n', 'name <workspace-name>', 'name of the workspace'],\n [\n '',\n 'generator <env-id>',\n 'for multiple, separate by a comma. add env-ids into the generators field in the workspace config for future \"bit create\" templates',\n ],\n [\n 'T',\n 'standalone',\n 'do not nest component store within .git directory and do not write config data inside package.json',\n ],\n ['', 'no-package-json', 'do not generate package.json'],\n ['r', 'reset', 'write missing or damaged Bit files'],\n ['', 'reset-new', 'reset .bitmap file as if the components were newly added and remove all model data (objects)'],\n [\n '',\n 'reset-lane-new',\n 'same as reset-new, but it only resets components belong to lanes. main components are left intact',\n ],\n [\n '',\n 'reset-hard',\n 'delete all Bit files and directories, including Bit configuration, tracking and model data. Useful for re-starting workspace from scratch',\n ],\n [\n '',\n 'reset-scope',\n 'removes local scope (.bit or .git/bit). tags/snaps that have not been exported will be lost. workspace is left intact',\n ],\n [\n 'd',\n 'default-directory <default-directory>',\n 'set the default directory pattern to import/create components into',\n ],\n ['', 'default-scope <default-scope>', 'set the default scope for components in the workspace'],\n ['f', 'force', 'force workspace initialization without clearing local objects'],\n ['b', 'bare [name]', 'initialize an empty bit bare scope'],\n ['s', 'shared <groupname>', 'add group write permissions to a scope properly'],\n ['', 'external-package-manager', 'enable external package manager mode (npm/yarn/pnpm)'],\n ['', 'skip-interactive', 'skip interactive mode for Git repositories'],\n ] as CommandOptions;\n\n constructor(\n private hostInitializer: HostInitializerMain,\n private logger: Logger\n ) {}\n\n private async handleInteractiveMode(\n projectPath: string,\n flags: Record<string, any>\n ): Promise<InteractiveConfig | null> {\n const {\n reset,\n resetNew,\n resetLaneNew,\n resetHard,\n resetScope,\n standalone,\n skipInteractive,\n externalPackageManager,\n } = flags;\n\n // Check if we should run interactive mode\n if (\n reset ||\n resetNew ||\n resetLaneNew ||\n resetHard ||\n resetScope ||\n standalone ||\n skipInteractive ||\n externalPackageManager ||\n !(await HostInitializerMain.hasGitDirectory(projectPath)) ||\n (await HostInitializerMain.hasWorkspaceInitialized(projectPath))\n ) {\n return null;\n }\n\n this.logger.off();\n this.logger.console(chalk.cyan('🔧 Interactive setup for existing Git repository\\n'));\n\n try {\n const interactiveConfig = await HostInitializerMain.runInteractiveMode(projectPath);\n\n // Set up MCP server if user selected an editor\n if (interactiveConfig.mcpEditor) {\n this.logger.console(chalk.cyan(`\\n🔧 Setting up MCP server for ${interactiveConfig.mcpEditor}...`));\n await HostInitializerMain.setupMcpServer(interactiveConfig.mcpEditor, projectPath);\n this.logger.console(chalk.green(`✅ MCP server configured for ${interactiveConfig.mcpEditor}`));\n }\n\n return interactiveConfig;\n } catch (error: any) {\n this.logger.consoleWarning(`Warning: Interactive setup failed: ${error.message}`);\n return null;\n }\n }\n\n async report([path]: [string], flags: Record<string, any>) {\n const {\n name,\n generator,\n bare,\n shared,\n standalone,\n noPackageJson,\n reset,\n resetNew,\n resetLaneNew,\n resetHard,\n resetScope,\n force,\n defaultDirectory,\n defaultScope,\n externalPackageManager,\n } = flags;\n\n if (path) path = pathlib.resolve(path);\n\n if (bare) {\n if (reset || resetHard) throw new BitError('--reset and --reset-hard flags are not available for bare scope');\n // Handle both cases init --bare and init --bare [scopeName]\n const bareVal = bare === true ? '' : bare;\n await initScope(path, bareVal, shared);\n return `${chalk.green('successfully initialized an empty bare bit scope.')}`;\n }\n\n if (reset && resetHard) {\n throw new BitError('cannot use both --reset and --reset-hard, please use only one of them');\n }\n\n const projectPath = path || process.cwd();\n const interactiveConfig = await this.handleInteractiveMode(projectPath, flags);\n\n const workspaceExtensionProps: WorkspaceExtensionProps & { externalPackageManager?: boolean } = {\n defaultDirectory:\n interactiveConfig?.defaultDirectory ||\n (externalPackageManager ? 'bit-components/{scope}/{name}' : defaultDirectory) ||\n getConfig(CFG_INIT_DEFAULT_DIRECTORY),\n defaultScope: defaultScope || getConfig(CFG_INIT_DEFAULT_SCOPE),\n name,\n externalPackageManager: interactiveConfig?.externalPackageManager || externalPackageManager,\n };\n\n const { created } = await HostInitializerMain.init(\n path,\n standalone,\n noPackageJson,\n reset,\n resetNew,\n resetLaneNew,\n resetHard,\n resetScope,\n force,\n workspaceExtensionProps,\n interactiveConfig?.generator || generator\n );\n\n return HostInitializerMain.generateInitMessage(created, reset, resetHard, resetScope, interactiveConfig);\n }\n}\n"],"mappings":";;;;;;AAAA,SAAAA,OAAA;EAAA,MAAAC,IAAA,GAAAC,sBAAA,CAAAC,OAAA;EAAAH,MAAA,YAAAA,CAAA;IAAA,OAAAC,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AACA,SAAAG,QAAA;EAAA,MAAAH,IAAA,GAAAI,uBAAA,CAAAF,OAAA;EAAAC,OAAA,YAAAA,CAAA;IAAA,OAAAH,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AACA,SAAAK,UAAA;EAAA,MAAAL,IAAA,GAAAE,OAAA;EAAAG,SAAA,YAAAA,CAAA;IAAA,OAAAL,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AACA,SAAAM,aAAA;EAAA,MAAAN,IAAA,GAAAE,OAAA;EAAAI,YAAA,YAAAA,CAAA;IAAA,OAAAN,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AACA,SAAAO,QAAA;EAAA,MAAAP,IAAA,GAAAE,OAAA;EAAAK,OAAA,YAAAA,CAAA;IAAA,OAAAP,IAAA;EAAA;EAA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F;AAAC+B,OAAA,CAAArD,OAAA,GAAAA,OAAA","ignoreList":[]}
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.ObjectsWithoutConsumer = 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
|
+
class ObjectsWithoutConsumer extends _bitError().BitError {
|
|
23
|
+
constructor(scopePath) {
|
|
24
|
+
super(`error: unable to initialize a bit workspace. bit has found undeleted local objects at ${_chalk().default.bold(scopePath)}.
|
|
25
|
+
1. use the ${_chalk().default.bold('--reset-hard')} flag to clear all data and initialize an empty workspace.
|
|
26
|
+
2. if deleted by mistake, please restore .bitmap and workspace.jsonc.
|
|
27
|
+
3. force workspace initialization without clearing data use the ${_chalk().default.bold('--force')} flag.`);
|
|
28
|
+
this.scopePath = scopePath;
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
exports.ObjectsWithoutConsumer = ObjectsWithoutConsumer;
|
|
32
|
+
|
|
33
|
+
//# sourceMappingURL=objects-without-consumer.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["_bitError","data","require","_chalk","_interopRequireDefault","e","__esModule","default","ObjectsWithoutConsumer","BitError","constructor","scopePath","chalk","bold","exports"],"sources":["objects-without-consumer.ts"],"sourcesContent":["import { BitError } from '@teambit/bit-error';\nimport chalk from 'chalk';\n\nexport class ObjectsWithoutConsumer extends BitError {\n constructor(public scopePath: string) {\n super(`error: unable to initialize a bit workspace. bit has found undeleted local objects at ${chalk.bold(\n scopePath\n )}.\n1. use the ${chalk.bold('--reset-hard')} flag to clear all data and initialize an empty workspace.\n2. if deleted by mistake, please restore .bitmap and workspace.jsonc.\n3. force workspace initialization without clearing data use the ${chalk.bold('--force')} flag.`);\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;AAEnB,MAAMG,sBAAsB,SAASC,oBAAQ,CAAC;EACnDC,WAAWA,CAAQC,SAAiB,EAAE;IACpC,KAAK,CAAC,yFAAyFC,gBAAK,CAACC,IAAI,CACvGF,SACF,CAAC;AACL,aAAaC,gBAAK,CAACC,IAAI,CAAC,cAAc,CAAC;AACvC;AACA,kEAAkED,gBAAK,CAACC,IAAI,CAAC,SAAS,CAAC,QAAQ,CAAC;IAAC,KAN5EF,SAAiB,GAAjBA,SAAiB;EAOpC;AACF;AAACG,OAAA,CAAAN,sBAAA,GAAAA,sBAAA","ignoreList":[]}
|
package/esm.mjs
ADDED
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
// eslint-disable-next-line import/no-unresolved
|
|
2
|
+
import cjsModule from './index.js';
|
|
3
|
+
|
|
4
|
+
export const HostInitializerAspect = cjsModule.HostInitializerAspect;
|
|
5
|
+
export const HostInitializerMain = cjsModule.HostInitializerMain;
|
|
6
|
+
export const ObjectsWithoutConsumer = cjsModule.ObjectsWithoutConsumer;
|
|
7
|
+
|
|
8
|
+
export default cjsModule;
|
|
9
|
+
|
package/package.json
ADDED
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@teambit/host-initializer",
|
|
3
|
+
"version": "0.0.0-00e74b4aacfebbf6a0c35c2e7bbb97a37d46cf0a",
|
|
4
|
+
"homepage": "https://bit.cloud/teambit/harmony/host-initializer",
|
|
5
|
+
"main": "dist/index.js",
|
|
6
|
+
"componentId": {
|
|
7
|
+
"scope": "teambit.harmony",
|
|
8
|
+
"name": "host-initializer",
|
|
9
|
+
"version": "00e74b4aacfebbf6a0c35c2e7bbb97a37d46cf0a"
|
|
10
|
+
},
|
|
11
|
+
"dependencies": {
|
|
12
|
+
"lodash": "4.17.21",
|
|
13
|
+
"chalk": "4.1.2",
|
|
14
|
+
"enquirer": "2.4.1",
|
|
15
|
+
"fs-extra": "10.0.0",
|
|
16
|
+
"@teambit/component.sources": "0.0.140",
|
|
17
|
+
"@teambit/config": "0.0.1462",
|
|
18
|
+
"@teambit/legacy.bit-map": "0.0.145",
|
|
19
|
+
"@teambit/legacy.consumer": "0.0.88",
|
|
20
|
+
"@teambit/legacy.scope": "0.0.88",
|
|
21
|
+
"@teambit/legacy.utils": "0.0.29",
|
|
22
|
+
"@teambit/toolbox.string.random": "0.0.9",
|
|
23
|
+
"@teambit/harmony": "0.4.7",
|
|
24
|
+
"@teambit/cli": "0.0.1288",
|
|
25
|
+
"@teambit/logger": "0.0.1381",
|
|
26
|
+
"@teambit/mcp.mcp-config-writer": "0.0.8",
|
|
27
|
+
"@teambit/scope.modules.find-scope-path": "0.0.21",
|
|
28
|
+
"@teambit/toolbox.fs.is-dir-empty": "0.0.9",
|
|
29
|
+
"@teambit/workspace.modules.workspace-locator": "0.0.21",
|
|
30
|
+
"@teambit/bit-error": "0.0.404",
|
|
31
|
+
"@teambit/config-store": "0.0.168",
|
|
32
|
+
"@teambit/legacy.constants": "0.0.20",
|
|
33
|
+
"@teambit/legacy.scope-api": "0.0.143",
|
|
34
|
+
"@teambit/objects": "0.0.0-726edf86e239508f2c5d16627449c5ccc40266cb"
|
|
35
|
+
},
|
|
36
|
+
"devDependencies": {
|
|
37
|
+
"@types/lodash": "4.14.165",
|
|
38
|
+
"@types/fs-extra": "9.0.7",
|
|
39
|
+
"@teambit/harmony.envs.core-aspect-env": "0.0.80"
|
|
40
|
+
},
|
|
41
|
+
"peerDependencies": {},
|
|
42
|
+
"license": "Apache-2.0",
|
|
43
|
+
"optionalDependencies": {},
|
|
44
|
+
"peerDependenciesMeta": {},
|
|
45
|
+
"exports": {
|
|
46
|
+
".": {
|
|
47
|
+
"node": {
|
|
48
|
+
"require": "./dist/index.js",
|
|
49
|
+
"import": "./dist/esm.mjs"
|
|
50
|
+
},
|
|
51
|
+
"default": "./dist/index.js"
|
|
52
|
+
},
|
|
53
|
+
"./dist/*": "./dist/*",
|
|
54
|
+
"./artifacts/*": "./artifacts/*",
|
|
55
|
+
"./*": "./*.ts"
|
|
56
|
+
},
|
|
57
|
+
"private": false,
|
|
58
|
+
"engines": {
|
|
59
|
+
"node": ">=16.0.0"
|
|
60
|
+
},
|
|
61
|
+
"repository": {
|
|
62
|
+
"type": "git",
|
|
63
|
+
"url": "https://github.com/teambit/bit"
|
|
64
|
+
},
|
|
65
|
+
"keywords": [
|
|
66
|
+
"bit",
|
|
67
|
+
"bit-aspect",
|
|
68
|
+
"bit-core-aspect",
|
|
69
|
+
"components",
|
|
70
|
+
"collaboration",
|
|
71
|
+
"web"
|
|
72
|
+
]
|
|
73
|
+
}
|
package/types/asset.d.ts
ADDED
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
declare module '*.png' {
|
|
2
|
+
const value: any;
|
|
3
|
+
export = value;
|
|
4
|
+
}
|
|
5
|
+
declare module '*.svg' {
|
|
6
|
+
import type { FunctionComponent, SVGProps } from 'react';
|
|
7
|
+
|
|
8
|
+
export const ReactComponent: FunctionComponent<
|
|
9
|
+
SVGProps<SVGSVGElement> & { title?: string }
|
|
10
|
+
>;
|
|
11
|
+
const src: string;
|
|
12
|
+
export default src;
|
|
13
|
+
}
|
|
14
|
+
declare module '*.jpg' {
|
|
15
|
+
const value: any;
|
|
16
|
+
export = value;
|
|
17
|
+
}
|
|
18
|
+
declare module '*.jpeg' {
|
|
19
|
+
const value: any;
|
|
20
|
+
export = value;
|
|
21
|
+
}
|
|
22
|
+
declare module '*.gif' {
|
|
23
|
+
const value: any;
|
|
24
|
+
export = value;
|
|
25
|
+
}
|
|
26
|
+
declare module '*.bmp' {
|
|
27
|
+
const value: any;
|
|
28
|
+
export = value;
|
|
29
|
+
}
|
|
30
|
+
declare module '*.otf' {
|
|
31
|
+
const value: any;
|
|
32
|
+
export = value;
|
|
33
|
+
}
|
|
34
|
+
declare module '*.woff' {
|
|
35
|
+
const value: any;
|
|
36
|
+
export = value;
|
|
37
|
+
}
|
|
38
|
+
declare module '*.woff2' {
|
|
39
|
+
const value: any;
|
|
40
|
+
export = value;
|
|
41
|
+
}
|
package/types/style.d.ts
ADDED
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
declare module '*.module.css' {
|
|
2
|
+
const classes: { readonly [key: string]: string };
|
|
3
|
+
export default classes;
|
|
4
|
+
}
|
|
5
|
+
declare module '*.module.scss' {
|
|
6
|
+
const classes: { readonly [key: string]: string };
|
|
7
|
+
export default classes;
|
|
8
|
+
}
|
|
9
|
+
declare module '*.module.sass' {
|
|
10
|
+
const classes: { readonly [key: string]: string };
|
|
11
|
+
export default classes;
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
declare module '*.module.less' {
|
|
15
|
+
const classes: { readonly [key: string]: string };
|
|
16
|
+
export default classes;
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
declare module '*.less' {
|
|
20
|
+
const classes: { readonly [key: string]: string };
|
|
21
|
+
export default classes;
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
declare module '*.css' {
|
|
25
|
+
const classes: { readonly [key: string]: string };
|
|
26
|
+
export default classes;
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
declare module '*.sass' {
|
|
30
|
+
const classes: { readonly [key: string]: string };
|
|
31
|
+
export default classes;
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
declare module '*.scss' {
|
|
35
|
+
const classes: { readonly [key: string]: string };
|
|
36
|
+
export default classes;
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
declare module '*.mdx' {
|
|
40
|
+
const component: any;
|
|
41
|
+
export default component;
|
|
42
|
+
}
|