@teambit/host-initializer 0.0.31 → 0.0.33
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/host-initializer.main.runtime.js +7 -7
- package/dist/host-initializer.main.runtime.js.map +1 -1
- package/dist/index.d.ts +1 -0
- package/dist/index.js +13 -0
- package/dist/index.js.map +1 -1
- 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/host-initializer.main.runtime.ts +1 -1
- package/index.ts +1 -0
- package/objects-without-consumer.ts +13 -0
- package/package.json +5 -5
- /package/dist/{preview-1719544843434.js → preview-1719717687832.js} +0 -0
|
@@ -46,16 +46,16 @@ function _utils() {
|
|
|
46
46
|
};
|
|
47
47
|
return data;
|
|
48
48
|
}
|
|
49
|
-
function
|
|
50
|
-
const data =
|
|
51
|
-
|
|
49
|
+
function _cli() {
|
|
50
|
+
const data = require("@teambit/cli");
|
|
51
|
+
_cli = function () {
|
|
52
52
|
return data;
|
|
53
53
|
};
|
|
54
54
|
return data;
|
|
55
55
|
}
|
|
56
|
-
function
|
|
57
|
-
const data = require("
|
|
58
|
-
|
|
56
|
+
function _objectsWithoutConsumer() {
|
|
57
|
+
const data = require("./objects-without-consumer");
|
|
58
|
+
_objectsWithoutConsumer = function () {
|
|
59
59
|
return data;
|
|
60
60
|
};
|
|
61
61
|
return data;
|
|
@@ -151,7 +151,7 @@ async function throwForOutOfSyncScope(consumer) {
|
|
|
151
151
|
if (!dirExist) return;
|
|
152
152
|
const hasObjects = !(await (0, _utils().isDirEmpty)(objectsPath));
|
|
153
153
|
if (hasObjects) {
|
|
154
|
-
throw new (_objectsWithoutConsumer().
|
|
154
|
+
throw new (_objectsWithoutConsumer().ObjectsWithoutConsumer)(scopePath);
|
|
155
155
|
}
|
|
156
156
|
}
|
|
157
157
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_fsExtra","data","_interopRequireDefault","require","_scopeModules","_consumer","_scope","_objects","_utils","
|
|
1
|
+
{"version":3,"names":["_fsExtra","data","_interopRequireDefault","require","_scopeModules","_consumer","_scope","_objects","_utils","_cli","_objectsWithoutConsumer","_hostInitializer","_initCmd","_createConsumer","e","__esModule","default","_defineProperty","r","t","_toPropertyKey","Object","defineProperty","value","enumerable","configurable","writable","i","_toPrimitive","Symbol","toPrimitive","call","TypeError","String","Number","HostInitializerMain","init","absPath","noGit","noPackageJson","reset","resetNew","resetLaneNew","resetHard","resetScope","force","workspaceConfigProps","generator","consumerInfo","getConsumerInfo","process","cwd","path","Error","consumerPath","resetConsumer","consumer","createConsumer","err","scopePath","findScopePath","Scope","throwForOutOfSyncScope","write","provider","cli","hostInitializerMain","initCmd","InitCmd","register","exports","CLIAspect","MainRuntime","HostInitializerAspect","addRuntime","_default","bitMap","isEmpty","scope","getPath","objectsPath","Repository","getPathByScopePath","dirExist","fs","pathExists","hasObjects","isDirEmpty","ObjectsWithoutConsumer"],"sources":["host-initializer.main.runtime.ts"],"sourcesContent":["import fs from 'fs-extra';\nimport { findScopePath } from '@teambit/scope.modules.find-scope-path';\nimport { Consumer, getConsumerInfo } from '@teambit/legacy/dist/consumer';\nimport { Scope } from '@teambit/legacy/dist/scope';\nimport { Repository } from '@teambit/legacy/dist/scope/objects';\nimport { isDirEmpty } from '@teambit/legacy/dist/utils';\nimport { WorkspaceExtensionProps } from '@teambit/config';\nimport { CLIAspect, CLIMain, MainRuntime } from '@teambit/cli';\nimport { ObjectsWithoutConsumer } from './objects-without-consumer';\nimport { HostInitializerAspect } from './host-initializer.aspect';\nimport { InitCmd } from './init-cmd';\nimport { createConsumer, resetConsumer } from './create-consumer';\n\nexport class HostInitializerMain {\n static async init(\n absPath?: string,\n noGit = false,\n noPackageJson = false,\n reset = false,\n resetNew = false,\n resetLaneNew = false,\n resetHard = false,\n resetScope = false,\n force = false,\n workspaceConfigProps: WorkspaceExtensionProps = {},\n generator?: string\n ): Promise<Consumer> {\n const consumerInfo = await getConsumerInfo(absPath || process.cwd());\n // if \"bit init\" was running without any flags, the user is probably trying to init a new workspace but wasn't aware\n // that he's already in a workspace.\n if (\n !absPath &&\n consumerInfo?.path &&\n consumerInfo.path !== process.cwd() &&\n !reset &&\n !resetHard &&\n !resetScope &&\n !resetNew &&\n !resetLaneNew\n ) {\n throw new Error(\n `error: unable to init a new workspace in an inner directory of an existing workspace at \"${consumerInfo.path}\"`\n );\n }\n const consumerPath = consumerInfo?.path || absPath || process.cwd();\n\n if (reset || resetHard) {\n await resetConsumer(consumerPath, resetHard, noGit);\n }\n let consumer: Consumer | undefined;\n try {\n consumer = await createConsumer(consumerPath, noGit, noPackageJson, workspaceConfigProps, generator);\n } catch (err) {\n // it's possible that at this stage the consumer fails to load due to scope issues.\n // still we want to load it to include its instance of \"scope.json\", so then later when \"consumer.write()\", we\n // don't lose some scope metadata\n }\n if (resetScope) {\n const scopePath = findScopePath(consumerPath);\n if (!scopePath) throw new Error(`fatal: scope not found in the path: ${consumerPath}`);\n await Scope.reset(scopePath, true);\n }\n if (!consumer) consumer = await createConsumer(consumerPath, noGit, noPackageJson, workspaceConfigProps);\n if (!force && !resetScope) {\n await throwForOutOfSyncScope(consumer);\n }\n if (resetNew) {\n await consumer.resetNew();\n }\n if (resetLaneNew) {\n await consumer.resetLaneNew();\n }\n return consumer.write();\n }\n\n static slots = [];\n static dependencies = [CLIAspect];\n static runtime = MainRuntime;\n static async provider([cli]: [CLIMain]) {\n const hostInitializerMain = new HostInitializerMain();\n const initCmd = new InitCmd(hostInitializerMain);\n cli.register(initCmd);\n return hostInitializerMain;\n }\n}\n\nHostInitializerAspect.addRuntime(HostInitializerMain);\n\nexport default HostInitializerMain;\n\n/**\n * throw an error when .bitmap is empty but a scope has objects.\n * a user may got into this state for reasons such as:\n * 1. deleting manually .bitmap hoping to re-start Bit from scratch. (probably unaware of `--reset-hard` flag).\n * 2. switching to a branch where Bit wasn't initialized\n * in which case, it's better to stop and show an error describing what needs to be done.\n * it can always be ignored by entering `--force` flag.\n */\nasync function throwForOutOfSyncScope(consumer: Consumer): Promise<void> {\n if (!consumer.bitMap.isEmpty()) return;\n const scopePath = consumer.scope.getPath();\n const objectsPath = Repository.getPathByScopePath(scopePath);\n const dirExist = await fs.pathExists(objectsPath);\n if (!dirExist) return;\n const hasObjects = !(await isDirEmpty(objectsPath));\n if (hasObjects) {\n throw new ObjectsWithoutConsumer(scopePath);\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,cAAA;EAAA,MAAAH,IAAA,GAAAE,OAAA;EAAAC,aAAA,YAAAA,CAAA;IAAA,OAAAH,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AACA,SAAAI,UAAA;EAAA,MAAAJ,IAAA,GAAAE,OAAA;EAAAE,SAAA,YAAAA,CAAA;IAAA,OAAAJ,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AACA,SAAAK,OAAA;EAAA,MAAAL,IAAA,GAAAE,OAAA;EAAAG,MAAA,YAAAA,CAAA;IAAA,OAAAL,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AACA,SAAAM,SAAA;EAAA,MAAAN,IAAA,GAAAE,OAAA;EAAAI,QAAA,YAAAA,CAAA;IAAA,OAAAN,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AACA,SAAAO,OAAA;EAAA,MAAAP,IAAA,GAAAE,OAAA;EAAAK,MAAA,YAAAA,CAAA;IAAA,OAAAP,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AAEA,SAAAQ,KAAA;EAAA,MAAAR,IAAA,GAAAE,OAAA;EAAAM,IAAA,YAAAA,CAAA;IAAA,OAAAR,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AACA,SAAAS,wBAAA;EA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AAA,GAEvCmB,mBAAmB;AAElC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe2B,sBAAsBA,CAACN,QAAkB,EAAiB;EACvE,IAAI,CAACA,QAAQ,CAACoB,MAAM,CAACC,OAAO,CAAC,CAAC,EAAE;EAChC,MAAMlB,SAAS,GAAGH,QAAQ,CAACsB,KAAK,CAACC,OAAO,CAAC,CAAC;EAC1C,MAAMC,WAAW,GAAGC,qBAAU,CAACC,kBAAkB,CAACvB,SAAS,CAAC;EAC5D,MAAMwB,QAAQ,GAAG,MAAMC,kBAAE,CAACC,UAAU,CAACL,WAAW,CAAC;EACjD,IAAI,CAACG,QAAQ,EAAE;EACf,MAAMG,UAAU,GAAG,EAAE,MAAM,IAAAC,mBAAU,EAACP,WAAW,CAAC,CAAC;EACnD,IAAIM,UAAU,EAAE;IACd,MAAM,KAAIE,gDAAsB,EAAC7B,SAAS,CAAC;EAC7C;AACF","ignoreList":[]}
|
package/dist/index.d.ts
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { HostInitializerAspect } from './host-initializer.aspect';
|
|
2
2
|
export { HostInitializerMain } from './host-initializer.main.runtime';
|
|
3
|
+
export { ObjectsWithoutConsumer } from './objects-without-consumer';
|
|
3
4
|
export default HostInitializerAspect;
|
|
4
5
|
export { HostInitializerAspect };
|
package/dist/index.js
CHANGED
|
@@ -15,6 +15,12 @@ Object.defineProperty(exports, "HostInitializerMain", {
|
|
|
15
15
|
return _hostInitializerMain().HostInitializerMain;
|
|
16
16
|
}
|
|
17
17
|
});
|
|
18
|
+
Object.defineProperty(exports, "ObjectsWithoutConsumer", {
|
|
19
|
+
enumerable: true,
|
|
20
|
+
get: function () {
|
|
21
|
+
return _objectsWithoutConsumer().ObjectsWithoutConsumer;
|
|
22
|
+
}
|
|
23
|
+
});
|
|
18
24
|
exports.default = void 0;
|
|
19
25
|
function _hostInitializer() {
|
|
20
26
|
const data = require("./host-initializer.aspect");
|
|
@@ -30,6 +36,13 @@ function _hostInitializerMain() {
|
|
|
30
36
|
};
|
|
31
37
|
return data;
|
|
32
38
|
}
|
|
39
|
+
function _objectsWithoutConsumer() {
|
|
40
|
+
const data = require("./objects-without-consumer");
|
|
41
|
+
_objectsWithoutConsumer = function () {
|
|
42
|
+
return data;
|
|
43
|
+
};
|
|
44
|
+
return data;
|
|
45
|
+
}
|
|
33
46
|
var _default = exports.default = _hostInitializer().HostInitializerAspect;
|
|
34
47
|
|
|
35
48
|
//# sourceMappingURL=index.js.map
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_hostInitializer","data","require","_hostInitializerMain","_default","exports","default","HostInitializerAspect"],"sources":["index.ts"],"sourcesContent":["import { HostInitializerAspect } from './host-initializer.aspect';\n\nexport { HostInitializerMain } from './host-initializer.main.runtime';\nexport default HostInitializerAspect;\nexport { HostInitializerAspect };\n"],"mappings":"
|
|
1
|
+
{"version":3,"names":["_hostInitializer","data","require","_hostInitializerMain","_objectsWithoutConsumer","_default","exports","default","HostInitializerAspect"],"sources":["index.ts"],"sourcesContent":["import { HostInitializerAspect } from './host-initializer.aspect';\n\nexport { HostInitializerMain } from './host-initializer.main.runtime';\nexport { ObjectsWithoutConsumer } from './objects-without-consumer';\nexport default HostInitializerAspect;\nexport { HostInitializerAspect };\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;AAAA,SAAAA,iBAAA;EAAA,MAAAC,IAAA,GAAAC,OAAA;EAAAF,gBAAA,YAAAA,CAAA;IAAA,OAAAC,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AAEA,SAAAE,qBAAA;EAAA,MAAAF,IAAA,GAAAC,OAAA;EAAAC,oBAAA,YAAAA,CAAA;IAAA,OAAAF,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AACA,SAAAG,wBAAA;EAAA,MAAAH,IAAA,GAAAC,OAAA;EAAAE,uBAAA,YAAAA,CAAA;IAAA,OAAAH,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AAAoE,IAAAI,QAAA,GAAAC,OAAA,CAAAC,OAAA,GACrDC,wCAAqB","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":[]}
|
|
@@ -5,8 +5,8 @@ import { Scope } from '@teambit/legacy/dist/scope';
|
|
|
5
5
|
import { Repository } from '@teambit/legacy/dist/scope/objects';
|
|
6
6
|
import { isDirEmpty } from '@teambit/legacy/dist/utils';
|
|
7
7
|
import { WorkspaceExtensionProps } from '@teambit/config';
|
|
8
|
-
import ObjectsWithoutConsumer from '@teambit/legacy/dist/api/consumer/lib/exceptions/objects-without-consumer';
|
|
9
8
|
import { CLIAspect, CLIMain, MainRuntime } from '@teambit/cli';
|
|
9
|
+
import { ObjectsWithoutConsumer } from './objects-without-consumer';
|
|
10
10
|
import { HostInitializerAspect } from './host-initializer.aspect';
|
|
11
11
|
import { InitCmd } from './init-cmd';
|
|
12
12
|
import { createConsumer, resetConsumer } from './create-consumer';
|
package/index.ts
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { HostInitializerAspect } from './host-initializer.aspect';
|
|
2
2
|
|
|
3
3
|
export { HostInitializerMain } from './host-initializer.main.runtime';
|
|
4
|
+
export { ObjectsWithoutConsumer } from './objects-without-consumer';
|
|
4
5
|
export default HostInitializerAspect;
|
|
5
6
|
export { HostInitializerAspect };
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { BitError } from '@teambit/bit-error';
|
|
2
|
+
import chalk from 'chalk';
|
|
3
|
+
|
|
4
|
+
export class ObjectsWithoutConsumer extends BitError {
|
|
5
|
+
constructor(public scopePath: string) {
|
|
6
|
+
super(`error: unable to initialize a bit workspace. bit has found undeleted local objects at ${chalk.bold(
|
|
7
|
+
scopePath
|
|
8
|
+
)}.
|
|
9
|
+
1. use the ${chalk.bold('--reset-hard')} flag to clear all data and initialize an empty workspace.
|
|
10
|
+
2. if deleted by mistake, please restore .bitmap and workspace.jsonc.
|
|
11
|
+
3. force workspace initialization without clearing data use the ${chalk.bold('--force')} flag.`);
|
|
12
|
+
}
|
|
13
|
+
}
|
package/package.json
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@teambit/host-initializer",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.33",
|
|
4
4
|
"homepage": "https://bit.cloud/teambit/harmony/host-initializer",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"componentId": {
|
|
7
7
|
"scope": "teambit.harmony",
|
|
8
8
|
"name": "host-initializer",
|
|
9
|
-
"version": "0.0.
|
|
9
|
+
"version": "0.0.33"
|
|
10
10
|
},
|
|
11
11
|
"dependencies": {
|
|
12
12
|
"lodash": "4.17.21",
|
|
@@ -17,9 +17,9 @@
|
|
|
17
17
|
"@teambit/harmony": "0.4.6",
|
|
18
18
|
"@teambit/scope.modules.find-scope-path": "0.0.1",
|
|
19
19
|
"@teambit/bit-error": "0.0.404",
|
|
20
|
-
"@teambit/config": "0.0.
|
|
20
|
+
"@teambit/config": "0.0.1071",
|
|
21
21
|
"@teambit/toolbox.string.random": "0.0.1",
|
|
22
|
-
"@teambit/cli": "0.0.
|
|
22
|
+
"@teambit/cli": "0.0.897"
|
|
23
23
|
},
|
|
24
24
|
"devDependencies": {
|
|
25
25
|
"@types/lodash": "4.14.165",
|
|
@@ -31,7 +31,7 @@
|
|
|
31
31
|
"@types/testing-library__jest-dom": "5.9.5"
|
|
32
32
|
},
|
|
33
33
|
"peerDependencies": {
|
|
34
|
-
"@teambit/legacy": "1.0.
|
|
34
|
+
"@teambit/legacy": "1.0.717",
|
|
35
35
|
"react": "^16.8.0 || ^17.0.0",
|
|
36
36
|
"react-dom": "^16.8.0 || ^17.0.0"
|
|
37
37
|
},
|
|
File without changes
|