@teambit/harmony.testing.load-aspect 0.0.196 → 0.0.198
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/load-aspect.d.ts
CHANGED
|
@@ -9,8 +9,10 @@ import { Config } from '@teambit/harmony/dist/harmony-config';
|
|
|
9
9
|
*/
|
|
10
10
|
export declare function loadAspect<T>(targetAspect: Aspect, cwd?: string, runtime?: string): Promise<T>;
|
|
11
11
|
/**
|
|
12
|
-
* returns an instance of Harmony. with this instance, you can get any aspect you loaded.
|
|
12
|
+
* returns an instance of Harmony. with this instance, you can get any aspect you loaded (or its dependencies).
|
|
13
13
|
* e.g. `const workspace = harmony.get<Workspace>(WorkspaceAspect.id);`
|
|
14
|
+
* when used for tests, specify all aspects you need and call it once. this way, you make sure all of them are in sync
|
|
15
|
+
* and use the same instances of each other.
|
|
14
16
|
*/
|
|
15
17
|
export declare function loadManyAspects(targetAspects: Aspect[], cwd?: string, runtime?: string): Promise<Harmony>;
|
|
16
18
|
export declare function getConfig(cwd?: string): Promise<Config>;
|
package/dist/load-aspect.js
CHANGED
|
@@ -28,7 +28,7 @@ const component_config_1 = __importDefault(require("@teambit/legacy/dist/consume
|
|
|
28
28
|
const component_overrides_1 = __importDefault(require("@teambit/legacy/dist/consumer/config/component-overrides"));
|
|
29
29
|
const workspace_modules_node_modules_linker_1 = require("@teambit/workspace.modules.node-modules-linker");
|
|
30
30
|
const workspace_config_1 = __importDefault(require("@teambit/legacy/dist/consumer/config/workspace-config"));
|
|
31
|
-
const dependencies_1 =
|
|
31
|
+
const dependencies_1 = require("@teambit/dependencies");
|
|
32
32
|
function getPackageName(aspect, id) {
|
|
33
33
|
return `@teambit/${id.name}`;
|
|
34
34
|
// const [owner, name] = aspect.id.split('.');
|
|
@@ -49,8 +49,10 @@ function loadAspect(targetAspect, cwd = process.cwd(), runtime = 'main') {
|
|
|
49
49
|
}
|
|
50
50
|
exports.loadAspect = loadAspect;
|
|
51
51
|
/**
|
|
52
|
-
* returns an instance of Harmony. with this instance, you can get any aspect you loaded.
|
|
52
|
+
* returns an instance of Harmony. with this instance, you can get any aspect you loaded (or its dependencies).
|
|
53
53
|
* e.g. `const workspace = harmony.get<Workspace>(WorkspaceAspect.id);`
|
|
54
|
+
* when used for tests, specify all aspects you need and call it once. this way, you make sure all of them are in sync
|
|
55
|
+
* and use the same instances of each other.
|
|
54
56
|
*/
|
|
55
57
|
function loadManyAspects(targetAspects, cwd = process.cwd(), runtime = 'main') {
|
|
56
58
|
return __awaiter(this, void 0, void 0, function* () {
|
|
@@ -63,7 +65,7 @@ function loadManyAspects(targetAspects, cwd = process.cwd(), runtime = 'main') {
|
|
|
63
65
|
// CLIAspect is needed for register the main runtime. NodeAspect is needed to get the default env if nothing
|
|
64
66
|
// was configured. If it's not loaded here, it'll throw an error later that there is no node-env.
|
|
65
67
|
// DependenciesAspect is needed to make ComponentLoader.loadDeps hook works.
|
|
66
|
-
const harmony = yield harmony_1.Harmony.load([cli_1.CLIAspect, dependencies_1.
|
|
68
|
+
const harmony = yield harmony_1.Harmony.load([cli_1.CLIAspect, dependencies_1.DependenciesAspect, node_1.NodeAspect, ...targetAspects], runtime, configMap);
|
|
67
69
|
yield harmony.run((aspect, runtimeDef) => __awaiter(this, void 0, void 0, function* () {
|
|
68
70
|
const id = component_1.ComponentID.fromString(aspect.id);
|
|
69
71
|
const mainFilePath = getMainFilePath(aspect, id);
|
package/dist/load-aspect.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"load-aspect.js","sourceRoot":"","sources":["../load-aspect.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;AAAA,+BAAqC;AACrC,4DAA8E;AAC9E,0FAAuE;AACvE,2BAAiC;AACjC,8CAAmD;AACnD,uFAAuF;AACvF,yEAA6E;AAC7E,kDAAiD;AACjD,sCAAyC;AACzC,wCAA2C;AAC3C,gHAAuF;AACvF,6GAAoF;AACpF,mHAA0F;AAC1F,0GA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AC,IAAI,CAAC,aAAa,EAAE,UAAU,CAAC,CAAC;QAChD,CAAC;QAED,OAAO,uBAAM,CAAC,UAAU,CAAC,gBAAgB,CAAC,CAAC;IAC7C,CAAC;CAAA;AAtBD,8BAsBC;AAED,SAAS,oBAAoB;IAC3B,IAAI,CAAC,uBAAY,CAAC,KAAK,IAAI,CAAC,8DAAsB,CAAC,+BAA+B,CAAC,MAAM,EAAE,CAAC;QAC1F,OAAO;IACT,CAAC;IACD,OAAO,uBAAY,CAAC,KAAK,CAAC;IAC1B,0BAAe,CAAC,0BAA0B,GAAG,EAAE,CAAC;IAChD,6BAAkB,CAAC,iCAAiC,GAAG,EAAE,CAAC;IAC1D,0BAAe,CAAC,8BAA8B,GAAG,EAAE,CAAC;IACpD,8DAAsB,CAAC,+BAA+B,GAAG,EAAE,CAAC;IAC5D,aAAa;IACb,0BAAe,CAAC,QAAQ,GAAG,SAAS,CAAC;IACrC,8FAA8F;IAC9F,oHAAoH;IACpH,qDAAqD;IACrD,aAAa;IACb,0BAAe,CAAC,+BAA+B,GAAG,SAAS,CAAC;IAC5D,aAAa;IACb,0BAAe,CAAC,8BAA8B,GAAG,SAAS,CAAC;AAC7D,CAAC"}
|
package/load-aspect.ts
CHANGED
|
@@ -13,7 +13,7 @@ import ComponentConfig from '@teambit/legacy/dist/consumer/config/component-conf
|
|
|
13
13
|
import ComponentOverrides from '@teambit/legacy/dist/consumer/config/component-overrides';
|
|
14
14
|
import { PackageJsonTransformer } from '@teambit/workspace.modules.node-modules-linker';
|
|
15
15
|
import WorkspaceConfig from '@teambit/legacy/dist/consumer/config/workspace-config';
|
|
16
|
-
import DependenciesAspect from '@teambit/dependencies';
|
|
16
|
+
import { DependenciesAspect } from '@teambit/dependencies';
|
|
17
17
|
|
|
18
18
|
function getPackageName(aspect: any, id: ComponentID) {
|
|
19
19
|
return `@teambit/${id.name}`;
|
|
@@ -34,8 +34,10 @@ export async function loadAspect<T>(targetAspect: Aspect, cwd = process.cwd(), r
|
|
|
34
34
|
}
|
|
35
35
|
|
|
36
36
|
/**
|
|
37
|
-
* returns an instance of Harmony. with this instance, you can get any aspect you loaded.
|
|
37
|
+
* returns an instance of Harmony. with this instance, you can get any aspect you loaded (or its dependencies).
|
|
38
38
|
* e.g. `const workspace = harmony.get<Workspace>(WorkspaceAspect.id);`
|
|
39
|
+
* when used for tests, specify all aspects you need and call it once. this way, you make sure all of them are in sync
|
|
40
|
+
* and use the same instances of each other.
|
|
39
41
|
*/
|
|
40
42
|
export async function loadManyAspects(
|
|
41
43
|
targetAspects: Aspect[],
|
package/package.json
CHANGED
|
@@ -1,17 +1,17 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@teambit/harmony.testing.load-aspect",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.198",
|
|
4
4
|
"homepage": "https://bit.cloud/teambit/harmony/testing/load-aspect",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"componentId": {
|
|
7
7
|
"scope": "teambit.harmony",
|
|
8
8
|
"name": "testing/load-aspect",
|
|
9
|
-
"version": "0.0.
|
|
9
|
+
"version": "0.0.198"
|
|
10
10
|
},
|
|
11
11
|
"dependencies": {
|
|
12
12
|
"@teambit/harmony": "0.4.6",
|
|
13
13
|
"@teambit/scope.modules.find-scope-path": "0.0.1",
|
|
14
|
-
"@teambit/workspace.modules.node-modules-linker": "0.0.
|
|
14
|
+
"@teambit/workspace.modules.node-modules-linker": "0.0.173"
|
|
15
15
|
},
|
|
16
16
|
"devDependencies": {
|
|
17
17
|
"@types/mocha": "9.1.0",
|
|
File without changes
|