@teambit/harmony.testing.load-aspect 0.0.281 → 0.0.283
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/core-aspects-ids.json +106 -106
- package/dist/index.js +30 -6
- package/dist/index.js.map +1 -1
- package/dist/load-aspect.js +212 -130
- package/dist/load-aspect.js.map +1 -1
- package/package.json +11 -11
- package/types/asset.d.ts +15 -3
- package/dist/preview-1738379875603.js +0 -7
|
@@ -1,107 +1,107 @@
|
|
|
1
1
|
[
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
]
|
|
2
|
+
"teambit.harmony/aspect-loader",
|
|
3
|
+
"teambit.harmony/cli",
|
|
4
|
+
"teambit.component/dev-files",
|
|
5
|
+
"teambit.workspace/workspace",
|
|
6
|
+
"teambit.workspace/workspace-config-files",
|
|
7
|
+
"teambit.workspace/install",
|
|
8
|
+
"teambit.defender/eslint",
|
|
9
|
+
"teambit.defender/prettier",
|
|
10
|
+
"teambit.compilation/compiler",
|
|
11
|
+
"teambit.defender/linter",
|
|
12
|
+
"teambit.defender/formatter",
|
|
13
|
+
"teambit.component/component",
|
|
14
|
+
"teambit.mdx/mdx",
|
|
15
|
+
"teambit.mdx/readme",
|
|
16
|
+
"teambit.preview/preview",
|
|
17
|
+
"teambit.component/component-sizer",
|
|
18
|
+
"teambit.docs/docs",
|
|
19
|
+
"teambit.dependencies/yarn",
|
|
20
|
+
"teambit.compositions/compositions",
|
|
21
|
+
"teambit.harmony/global-config",
|
|
22
|
+
"teambit.harmony/graphql",
|
|
23
|
+
"teambit.dependencies/pnpm",
|
|
24
|
+
"teambit.compilation/multi-compiler",
|
|
25
|
+
"teambit.ui-foundation/ui",
|
|
26
|
+
"teambit.generator/generator",
|
|
27
|
+
"teambit.envs/envs",
|
|
28
|
+
"teambit.envs/env",
|
|
29
|
+
"teambit.component/graph",
|
|
30
|
+
"teambit.harmony/pubsub",
|
|
31
|
+
"teambit.dependencies/dependency-resolver",
|
|
32
|
+
"teambit.explorer/insights",
|
|
33
|
+
"teambit.component/isolator",
|
|
34
|
+
"teambit.harmony/logger",
|
|
35
|
+
"teambit.pkg/pkg",
|
|
36
|
+
"teambit.react/react",
|
|
37
|
+
"teambit.harmony/worker",
|
|
38
|
+
"teambit.scope/scope",
|
|
39
|
+
"teambit.defender/tester",
|
|
40
|
+
"teambit.defender/multi-tester",
|
|
41
|
+
"teambit.pipelines/builder",
|
|
42
|
+
"teambit.workspace/variants",
|
|
43
|
+
"teambit.component/deprecation",
|
|
44
|
+
"teambit.harmony/express",
|
|
45
|
+
"teambit.harmony/aspect",
|
|
46
|
+
"teambit.webpack/webpack",
|
|
47
|
+
"teambit.semantics/schema",
|
|
48
|
+
"teambit.ui-foundation/react-router",
|
|
49
|
+
"teambit.typescript/typescript",
|
|
50
|
+
"teambit.ui-foundation/panels",
|
|
51
|
+
"teambit.compilation/babel",
|
|
52
|
+
"teambit.harmony/node",
|
|
53
|
+
"teambit.ui-foundation/notifications",
|
|
54
|
+
"teambit.compilation/bundler",
|
|
55
|
+
"teambit.defender/jest",
|
|
56
|
+
"teambit.harmony/cache",
|
|
57
|
+
"teambit.component/changelog",
|
|
58
|
+
"teambit.component/code",
|
|
59
|
+
"teambit.explorer/command-bar",
|
|
60
|
+
"teambit.ui-foundation/sidebar",
|
|
61
|
+
"teambit.component/component-tree",
|
|
62
|
+
"teambit.scope/sign",
|
|
63
|
+
"teambit.scope/update-dependencies",
|
|
64
|
+
"teambit.scope/export",
|
|
65
|
+
"teambit.scope/importer",
|
|
66
|
+
"teambit.ui-foundation/harmony-ui-app",
|
|
67
|
+
"teambit.ui-foundation/user-agent",
|
|
68
|
+
"teambit.harmony/application",
|
|
69
|
+
"teambit.workspace/eject",
|
|
70
|
+
"teambit.lanes/lanes",
|
|
71
|
+
"teambit.component/forking",
|
|
72
|
+
"teambit.component/renaming",
|
|
73
|
+
"teambit.component/new-component-helper",
|
|
74
|
+
"teambit.component/component-log",
|
|
75
|
+
"teambit.bit/clear-cache",
|
|
76
|
+
"teambit.defender/mocha",
|
|
77
|
+
"teambit.harmony/diagnostic",
|
|
78
|
+
"teambit.component/status",
|
|
79
|
+
"teambit.community/community",
|
|
80
|
+
"teambit.cloud/cloud",
|
|
81
|
+
"teambit.component/snapping",
|
|
82
|
+
"teambit.component/merging",
|
|
83
|
+
"teambit.component/issues",
|
|
84
|
+
"teambit.component/refactoring",
|
|
85
|
+
"teambit.component/component-compare",
|
|
86
|
+
"teambit.component/lister",
|
|
87
|
+
"teambit.dependencies/dependencies",
|
|
88
|
+
"teambit.component/remove",
|
|
89
|
+
"teambit.lanes/merge-lanes",
|
|
90
|
+
"teambit.component/checkout",
|
|
91
|
+
"teambit.component/component-writer",
|
|
92
|
+
"teambit.api-reference/api-reference",
|
|
93
|
+
"teambit.harmony/api-server",
|
|
94
|
+
"teambit.component/tracker",
|
|
95
|
+
"teambit.component/mover",
|
|
96
|
+
"teambit.workspace/watcher",
|
|
97
|
+
"teambit.component/stash",
|
|
98
|
+
"teambit.git/git",
|
|
99
|
+
"teambit.harmony/ipc-events",
|
|
100
|
+
"teambit.workspace/config-merger",
|
|
101
|
+
"teambit.scope/version-history",
|
|
102
|
+
"teambit.harmony/host-initializer",
|
|
103
|
+
"teambit.harmony/doctor",
|
|
104
|
+
"teambit.scope/objects",
|
|
105
|
+
"teambit.harmony/bit",
|
|
106
|
+
"teambit.harmony/config"
|
|
107
|
+
]
|
package/dist/index.js
CHANGED
|
@@ -1,8 +1,32 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
Object.defineProperty(exports, "
|
|
7
|
-
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
Object.defineProperty(exports, "getConfig", {
|
|
7
|
+
enumerable: true,
|
|
8
|
+
get: function () {
|
|
9
|
+
return _loadAspect().getConfig;
|
|
10
|
+
}
|
|
11
|
+
});
|
|
12
|
+
Object.defineProperty(exports, "loadAspect", {
|
|
13
|
+
enumerable: true,
|
|
14
|
+
get: function () {
|
|
15
|
+
return _loadAspect().loadAspect;
|
|
16
|
+
}
|
|
17
|
+
});
|
|
18
|
+
Object.defineProperty(exports, "loadManyAspects", {
|
|
19
|
+
enumerable: true,
|
|
20
|
+
get: function () {
|
|
21
|
+
return _loadAspect().loadManyAspects;
|
|
22
|
+
}
|
|
23
|
+
});
|
|
24
|
+
function _loadAspect() {
|
|
25
|
+
const data = require("./load-aspect");
|
|
26
|
+
_loadAspect = function () {
|
|
27
|
+
return data;
|
|
28
|
+
};
|
|
29
|
+
return data;
|
|
30
|
+
}
|
|
31
|
+
|
|
8
32
|
//# sourceMappingURL=index.js.map
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"
|
|
1
|
+
{"version":3,"names":["_loadAspect","data","require"],"sources":["index.ts"],"sourcesContent":["export { loadAspect, loadManyAspects, getConfig } from './load-aspect';\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;AAAA,SAAAA,YAAA;EAAA,MAAAC,IAAA,GAAAC,OAAA;EAAAF,WAAA,YAAAA,CAAA;IAAA,OAAAC,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA","ignoreList":[]}
|
package/dist/load-aspect.js
CHANGED
|
@@ -1,47 +1,134 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
8
|
-
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
9
|
-
});
|
|
10
|
-
};
|
|
11
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.getConfig = getConfig;
|
|
12
7
|
exports.loadAspect = loadAspect;
|
|
13
8
|
exports.loadManyAspects = loadManyAspects;
|
|
14
|
-
|
|
15
|
-
const
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
9
|
+
function _path() {
|
|
10
|
+
const data = require("path");
|
|
11
|
+
_path = function () {
|
|
12
|
+
return data;
|
|
13
|
+
};
|
|
14
|
+
return data;
|
|
15
|
+
}
|
|
16
|
+
function _legacy() {
|
|
17
|
+
const data = require("@teambit/legacy.consumer");
|
|
18
|
+
_legacy = function () {
|
|
19
|
+
return data;
|
|
20
|
+
};
|
|
21
|
+
return data;
|
|
22
|
+
}
|
|
23
|
+
function _workspaceModules() {
|
|
24
|
+
const data = require("@teambit/workspace.modules.workspace-locator");
|
|
25
|
+
_workspaceModules = function () {
|
|
26
|
+
return data;
|
|
27
|
+
};
|
|
28
|
+
return data;
|
|
29
|
+
}
|
|
30
|
+
function _scopeModules() {
|
|
31
|
+
const data = require("@teambit/scope.modules.find-scope-path");
|
|
32
|
+
_scopeModules = function () {
|
|
33
|
+
return data;
|
|
34
|
+
};
|
|
35
|
+
return data;
|
|
36
|
+
}
|
|
37
|
+
function _fs() {
|
|
38
|
+
const data = require("fs");
|
|
39
|
+
_fs = function () {
|
|
40
|
+
return data;
|
|
41
|
+
};
|
|
42
|
+
return data;
|
|
43
|
+
}
|
|
44
|
+
function _harmony() {
|
|
45
|
+
const data = require("@teambit/harmony");
|
|
46
|
+
_harmony = function () {
|
|
47
|
+
return data;
|
|
48
|
+
};
|
|
49
|
+
return data;
|
|
50
|
+
}
|
|
51
|
+
function _harmonyConfig() {
|
|
52
|
+
const data = require("@teambit/harmony/dist/harmony-config");
|
|
53
|
+
_harmonyConfig = function () {
|
|
54
|
+
return data;
|
|
55
|
+
};
|
|
56
|
+
return data;
|
|
57
|
+
}
|
|
58
|
+
function _component() {
|
|
59
|
+
const data = require("@teambit/component");
|
|
60
|
+
_component = function () {
|
|
61
|
+
return data;
|
|
62
|
+
};
|
|
63
|
+
return data;
|
|
64
|
+
}
|
|
65
|
+
function _cli() {
|
|
66
|
+
const data = require("@teambit/cli");
|
|
67
|
+
_cli = function () {
|
|
68
|
+
return data;
|
|
69
|
+
};
|
|
70
|
+
return data;
|
|
71
|
+
}
|
|
72
|
+
function _node() {
|
|
73
|
+
const data = require("@teambit/node");
|
|
74
|
+
_node = function () {
|
|
75
|
+
return data;
|
|
76
|
+
};
|
|
77
|
+
return data;
|
|
78
|
+
}
|
|
79
|
+
function _legacy2() {
|
|
80
|
+
const data = require("@teambit/legacy.consumer-component");
|
|
81
|
+
_legacy2 = function () {
|
|
82
|
+
return data;
|
|
83
|
+
};
|
|
84
|
+
return data;
|
|
85
|
+
}
|
|
86
|
+
function _legacy3() {
|
|
87
|
+
const data = require("@teambit/legacy.consumer-config");
|
|
88
|
+
_legacy3 = function () {
|
|
89
|
+
return data;
|
|
90
|
+
};
|
|
91
|
+
return data;
|
|
92
|
+
}
|
|
93
|
+
function _workspaceModules2() {
|
|
94
|
+
const data = require("@teambit/workspace.modules.node-modules-linker");
|
|
95
|
+
_workspaceModules2 = function () {
|
|
96
|
+
return data;
|
|
97
|
+
};
|
|
98
|
+
return data;
|
|
99
|
+
}
|
|
100
|
+
function _dependencies() {
|
|
101
|
+
const data = require("@teambit/dependencies");
|
|
102
|
+
_dependencies = function () {
|
|
103
|
+
return data;
|
|
104
|
+
};
|
|
105
|
+
return data;
|
|
106
|
+
}
|
|
107
|
+
function _legacy4() {
|
|
108
|
+
const data = require("@teambit/legacy.extension-data");
|
|
109
|
+
_legacy4 = function () {
|
|
110
|
+
return data;
|
|
111
|
+
};
|
|
112
|
+
return data;
|
|
113
|
+
}
|
|
21
114
|
// TODO: expose this types from harmony (once we have a way to expose it only for node)
|
|
22
|
-
|
|
23
|
-
const component_1 = require("@teambit/component");
|
|
24
|
-
const cli_1 = require("@teambit/cli");
|
|
25
|
-
const node_1 = require("@teambit/node");
|
|
26
|
-
const legacy_consumer_component_1 = require("@teambit/legacy.consumer-component");
|
|
27
|
-
const legacy_consumer_config_1 = require("@teambit/legacy.consumer-config");
|
|
28
|
-
const workspace_modules_node_modules_linker_1 = require("@teambit/workspace.modules.node-modules-linker");
|
|
29
|
-
const dependencies_1 = require("@teambit/dependencies");
|
|
30
|
-
const legacy_extension_data_1 = require("@teambit/legacy.extension-data");
|
|
115
|
+
|
|
31
116
|
function getPackageName(aspect, id) {
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
117
|
+
return `@teambit/${id.name}`;
|
|
118
|
+
// const [owner, name] = aspect.id.split('.');
|
|
119
|
+
// return `@${owner}/${replaceAll(name, '/', '.')}`;
|
|
35
120
|
}
|
|
121
|
+
|
|
36
122
|
/**
|
|
37
123
|
* we keep a static list of core-aspect-ids here in this component in order to not depend on bit aspect.
|
|
38
124
|
* it gets updated during Circle tag process.
|
|
39
125
|
*/
|
|
40
126
|
function getCoreAspectIds() {
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
127
|
+
const aspectIdsFile = (0, _path().join)(__dirname, 'core-aspects-ids.json');
|
|
128
|
+
const file = (0, _fs().readFileSync)(aspectIdsFile, 'utf8');
|
|
129
|
+
return JSON.parse(file);
|
|
44
130
|
}
|
|
131
|
+
|
|
45
132
|
/**
|
|
46
133
|
* ! important ! prefer using `loadManyAspects` instead of this function. otherwise, you may end up with
|
|
47
134
|
* different instances of "Workspace" aspect for example for each one of the aspects you load.
|
|
@@ -49,118 +136,113 @@ function getCoreAspectIds() {
|
|
|
49
136
|
* to make this work, export the main also as default (e.g. `export default LanesMain;`).
|
|
50
137
|
* otherwise, it'll show an error "TypeError: Cannot read property 'runtime' of undefined".
|
|
51
138
|
*/
|
|
52
|
-
function loadAspect(
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
return harmony.get(targetAspect.id);
|
|
56
|
-
});
|
|
139
|
+
async function loadAspect(targetAspect, cwd = process.cwd(), runtime = 'main') {
|
|
140
|
+
const harmony = await loadManyAspects([targetAspect], cwd, runtime);
|
|
141
|
+
return harmony.get(targetAspect.id);
|
|
57
142
|
}
|
|
143
|
+
|
|
58
144
|
/**
|
|
59
145
|
* returns an instance of Harmony. with this instance, you can get any aspect you loaded (or its dependencies).
|
|
60
146
|
* e.g. `const workspace = harmony.get<Workspace>(WorkspaceAspect.id);`
|
|
61
147
|
* when used for tests, specify all aspects you need and call it once. this way, you make sure all of them are in sync
|
|
62
148
|
* and use the same instances of each other.
|
|
63
149
|
*/
|
|
64
|
-
function loadManyAspects(
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
return harmony;
|
|
97
|
-
});
|
|
150
|
+
async function loadManyAspects(targetAspects, cwd = process.cwd(), runtime = 'main') {
|
|
151
|
+
clearGlobalsIfNeeded();
|
|
152
|
+
const coreAspectIds = getCoreAspectIds();
|
|
153
|
+
// tried alternative to avoid this. however, in some cases, during build, this component is in a capsule, so the list
|
|
154
|
+
// of core-aspects registered during load-bit doesn't apply here.
|
|
155
|
+
_legacy4().ExtensionDataList.registerManyCoreExtensionNames(coreAspectIds);
|
|
156
|
+
const config = await getConfig(cwd);
|
|
157
|
+
const configMap = config.toObject();
|
|
158
|
+
configMap['teambit.harmony/bit'] = {
|
|
159
|
+
cwd
|
|
160
|
+
};
|
|
161
|
+
|
|
162
|
+
// CLIAspect is needed for register the main runtime. NodeAspect is needed to get the default env if nothing
|
|
163
|
+
// was configured. If it's not loaded here, it'll throw an error later that there is no node-env.
|
|
164
|
+
// DependenciesAspect is needed to make ComponentLoader.loadDeps hook works.
|
|
165
|
+
const harmony = await _harmony().Harmony.load([_cli().CLIAspect, _dependencies().DependenciesAspect, _node().NodeAspect, ...targetAspects], runtime, configMap);
|
|
166
|
+
await harmony.run(async (aspect, runtimeDef) => {
|
|
167
|
+
const id = _component().ComponentID.fromString(aspect.id);
|
|
168
|
+
const mainFilePath = getMainFilePath(aspect, id);
|
|
169
|
+
const packagePath = (0, _path().resolve)((0, _path().join)(mainFilePath, '..'));
|
|
170
|
+
const files = (0, _fs().readdirSync)(packagePath);
|
|
171
|
+
const runtimePath = files.find(path => path.includes(`.${runtimeDef.name}.runtime.js`));
|
|
172
|
+
if (!runtimePath) throw new Error(`could not find runtime '${runtimeDef.name}' for aspect ID '${aspect.id}'`);
|
|
173
|
+
// eslint-disable-next-line global-require, import/no-dynamic-require
|
|
174
|
+
const runtimeC = require((0, _path().join)(packagePath, runtimePath));
|
|
175
|
+
if (aspect.manifest._runtimes.length === 0 || targetAspects.includes(aspect.id)) {
|
|
176
|
+
// core-aspects running outside of bit-bin repo end up here. they don't have runtime.
|
|
177
|
+
// this makes sure to load them from the path were they're imported
|
|
178
|
+
addRuntimeIfNeeded(runtimeC, aspect);
|
|
179
|
+
}
|
|
180
|
+
});
|
|
181
|
+
return harmony;
|
|
98
182
|
}
|
|
99
183
|
function addRuntimeIfNeeded(runtimeC, aspect) {
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
184
|
+
if (runtimeC.default) {
|
|
185
|
+
aspect.manifest.addRuntime(runtimeC.default);
|
|
186
|
+
return;
|
|
187
|
+
}
|
|
188
|
+
const methodsOnResult = Object.keys(runtimeC);
|
|
189
|
+
if (methodsOnResult.length === 1) {
|
|
190
|
+
aspect.manifest.addRuntime(runtimeC[methodsOnResult[0]]);
|
|
191
|
+
return;
|
|
192
|
+
}
|
|
193
|
+
const main = methodsOnResult.filter(method => method.endsWith('Main'));
|
|
194
|
+
if (main.length === 1) {
|
|
195
|
+
aspect.manifest.addRuntime(runtimeC[main[0]]);
|
|
196
|
+
return;
|
|
197
|
+
}
|
|
198
|
+
throw new Error(`error: ${aspect.id} does not export its main-runtime as default.
|
|
115
199
|
go to the aspect-main file and add a new line with "export default YourAspectMain"`);
|
|
116
200
|
}
|
|
117
201
|
function getMainFilePath(aspect, id) {
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
}
|
|
202
|
+
let packageName = getPackageName(aspect, id);
|
|
203
|
+
try {
|
|
204
|
+
// try core aspects
|
|
205
|
+
return require.resolve(packageName);
|
|
206
|
+
} catch {
|
|
207
|
+
// fallback to a naive way of converting componentId to pkg-name. (it won't work when the component has special pkg name settings)
|
|
208
|
+
packageName = `@${id.scope.replace('.', '/')}.${id.fullName.replaceAll('/', '.')}`;
|
|
209
|
+
return require.resolve(packageName);
|
|
210
|
+
}
|
|
128
211
|
}
|
|
129
|
-
function getConfig() {
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
return harmony_config_1.Config.loadGlobal(globalConfigOpts);
|
|
149
|
-
});
|
|
212
|
+
async function getConfig(cwd = process.cwd()) {
|
|
213
|
+
const consumerInfo = await (0, _workspaceModules().getWorkspaceInfo)(cwd);
|
|
214
|
+
const scopePath = (0, _scopeModules().findScopePath)(cwd);
|
|
215
|
+
const globalConfigOpts = {
|
|
216
|
+
name: '.bitrc.jsonc'
|
|
217
|
+
};
|
|
218
|
+
const configOpts = {
|
|
219
|
+
global: globalConfigOpts,
|
|
220
|
+
shouldThrow: false,
|
|
221
|
+
cwd: consumerInfo?.path || scopePath
|
|
222
|
+
};
|
|
223
|
+
if (consumerInfo) {
|
|
224
|
+
const config = _harmonyConfig().Config.load('workspace.jsonc', configOpts);
|
|
225
|
+
return config;
|
|
226
|
+
}
|
|
227
|
+
if (scopePath && !consumerInfo) {
|
|
228
|
+
return _harmonyConfig().Config.load('scope.jsonc', configOpts);
|
|
229
|
+
}
|
|
230
|
+
return _harmonyConfig().Config.loadGlobal(globalConfigOpts);
|
|
150
231
|
}
|
|
151
232
|
function clearGlobalsIfNeeded() {
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
233
|
+
if (!_legacy().loadConsumer.cache && !_workspaceModules2().PackageJsonTransformer.packageJsonTransformersRegistry.length) {
|
|
234
|
+
return;
|
|
235
|
+
}
|
|
236
|
+
delete _legacy().loadConsumer.cache;
|
|
237
|
+
_legacy2().ComponentLoader.onComponentLoadSubscribers = [];
|
|
238
|
+
_legacy3().ComponentOverrides.componentOverridesLoadingRegistry = {};
|
|
239
|
+
_legacy3().ComponentConfig.componentConfigLoadingRegistry = {};
|
|
240
|
+
_workspaceModules2().PackageJsonTransformer.packageJsonTransformersRegistry = [];
|
|
241
|
+
// @ts-ignore
|
|
242
|
+
_legacy2().ComponentLoader.loadDeps = undefined;
|
|
243
|
+
_legacy4().ExtensionDataList.coreExtensionsNames = new Map();
|
|
244
|
+
// @ts-ignore
|
|
245
|
+
_legacy3().LegacyWorkspaceConfig.workspaceConfigLoadingRegistry = undefined;
|
|
165
246
|
}
|
|
247
|
+
|
|
166
248
|
//# sourceMappingURL=load-aspect.js.map
|
package/dist/load-aspect.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"load-aspect.js","sourceRoot":"","sources":["../load-aspect.ts"],"names":[],"mappings":";;;;;;;;;;;AAwCA,gCAGC;AAQD,0CAuCC;AAiCD,8BAsBC;AAjJD,+BAAqC;AACrC,8DAAwD;AACxD,sGAAgF;AAChF,0FAAuE;AACvE,2BAA+C;AAC/C,8CAA8D;AAC9D,uFAAuF;AACvF,yEAA6E;AAC7E,kDAAiD;AACjD,sCAAyC;AACzC,wCAA2C;AAC3C,kFAAqE;AACrE,4EAA6G;AAC7G,0GAAwF;AACxF,wDAA2D;AAC3D,0EAAmE;AAEnE,SAAS,cAAc,CAAC,MAAW,EAAE,EAAe;IAClD,OAAO,YAAY,EAAE,CAAC,IAAI,EAAE,CAAC;IAC7B,8CAA8C;IAC9C,oDAAoD;AACtD,CAAC;AAED;;;GAGG;AACH,SAAS,gBAAgB;IACvB,MAAM,aAAa,GAAG,IAAA,WAAI,EAAC,SAAS,EAAE,uBAAuB,CAAC,CAAC;IAC/D,MAAM,IAAI,GAAG,IAAA,iBAAY,EAAC,aAAa,EAAE,MAAM,CAAC,CAAC;IACjD,OAAO,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC;AAC1B,CAAC;AAED;;;;;;GAMG;AACH,SAAsB,UAAU;yDAAI,YAAoB,EAAE,GAAG,GAAG,OAAO,CAAC,GAAG,EAAE,EAAE,OAAO,GAAG,MAAM;QAC7F,MAAM,OAAO,GAAG,MAAM,eAAe,CAAC,CAAC,YAAY,CAAC,EAAE,GAAG,EAAE,OAAO,CAAC,CAAC;QACpE,OAAO,OAAO,CAAC,GAAG,CAAC,YAAY,CAAC,EAAE,CAAC,CAAC;IACtC,CAAC;CAAA;AAED;;;;;GAKG;AACH,SAAsB,eAAe;yDACnC,aAAuB,EACvB,GAAG,GAAG,OAAO,CAAC,GAAG,EAAE,E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AAED,SAAS,oBAAoB;IAC3B,IAAI,CAAC,8BAAY,CAAC,KAAK,IAAI,CAAC,8DAAsB,CAAC,+BAA+B,CAAC,MAAM,EAAE,CAAC;QAC1F,OAAO;IACT,CAAC;IACD,OAAO,8BAAY,CAAC,KAAK,CAAC;IAC1B,2CAAe,CAAC,0BAA0B,GAAG,EAAE,CAAC;IAChD,2CAAkB,CAAC,iCAAiC,GAAG,EAAE,CAAC;IAC1D,wCAAe,CAAC,8BAA8B,GAAG,EAAE,CAAC;IACpD,8DAAsB,CAAC,+BAA+B,GAAG,EAAE,CAAC;IAC5D,aAAa;IACb,2CAAe,CAAC,QAAQ,GAAG,SAAS,CAAC;IACrC,yCAAiB,CAAC,mBAAmB,GAAG,IAAI,GAAG,EAAE,CAAC;IAClD,aAAa;IACb,8CAAqB,CAAC,8BAA8B,GAAG,SAAS,CAAC;AACnE,CAAC"}
|
|
1
|
+
{"version":3,"names":["_path","data","require","_legacy","_workspaceModules","_scopeModules","_fs","_harmony","_harmonyConfig","_component","_cli","_node","_legacy2","_legacy3","_workspaceModules2","_dependencies","_legacy4","getPackageName","aspect","id","name","getCoreAspectIds","aspectIdsFile","join","__dirname","file","readFileSync","JSON","parse","loadAspect","targetAspect","cwd","process","runtime","harmony","loadManyAspects","get","targetAspects","clearGlobalsIfNeeded","coreAspectIds","ExtensionDataList","registerManyCoreExtensionNames","config","getConfig","configMap","toObject","Harmony","load","CLIAspect","DependenciesAspect","NodeAspect","run","runtimeDef","ComponentID","fromString","mainFilePath","getMainFilePath","packagePath","resolve","files","readdirSync","runtimePath","find","path","includes","Error","runtimeC","manifest","_runtimes","length","addRuntimeIfNeeded","default","addRuntime","methodsOnResult","Object","keys","main","filter","method","endsWith","packageName","scope","replace","fullName","replaceAll","consumerInfo","getWorkspaceInfo","scopePath","findScopePath","globalConfigOpts","configOpts","global","shouldThrow","Config","loadGlobal","loadConsumer","cache","PackageJsonTransformer","packageJsonTransformersRegistry","ComponentLoader","onComponentLoadSubscribers","ComponentOverrides","componentOverridesLoadingRegistry","ComponentConfig","componentConfigLoadingRegistry","loadDeps","undefined","coreExtensionsNames","Map","LegacyWorkspaceConfig","workspaceConfigLoadingRegistry"],"sources":["load-aspect.ts"],"sourcesContent":["import { resolve, join } from 'path';\nimport { loadConsumer } from '@teambit/legacy.consumer';\nimport { getWorkspaceInfo } from '@teambit/workspace.modules.workspace-locator';\nimport { findScopePath } from '@teambit/scope.modules.find-scope-path';\nimport { readdirSync, readFileSync } from 'fs';\nimport { Harmony, Aspect, Extension } from '@teambit/harmony';\n// TODO: expose this types from harmony (once we have a way to expose it only for node)\nimport { Config, ConfigOptions } from '@teambit/harmony/dist/harmony-config';\nimport { ComponentID } from '@teambit/component';\nimport { CLIAspect } from '@teambit/cli';\nimport { NodeAspect } from '@teambit/node';\nimport { ComponentLoader } from '@teambit/legacy.consumer-component';\nimport { LegacyWorkspaceConfig, ComponentOverrides, ComponentConfig } from '@teambit/legacy.consumer-config';\nimport { PackageJsonTransformer } from '@teambit/workspace.modules.node-modules-linker';\nimport { DependenciesAspect } from '@teambit/dependencies';\nimport { ExtensionDataList } from '@teambit/legacy.extension-data';\n\nfunction getPackageName(aspect: any, id: ComponentID) {\n return `@teambit/${id.name}`;\n // const [owner, name] = aspect.id.split('.');\n // return `@${owner}/${replaceAll(name, '/', '.')}`;\n}\n\n/**\n * we keep a static list of core-aspect-ids here in this component in order to not depend on bit aspect.\n * it gets updated during Circle tag process.\n */\nfunction getCoreAspectIds() {\n const aspectIdsFile = join(__dirname, 'core-aspects-ids.json');\n const file = readFileSync(aspectIdsFile, 'utf8');\n return JSON.parse(file);\n}\n\n/**\n * ! important ! prefer using `loadManyAspects` instead of this function. otherwise, you may end up with\n * different instances of \"Workspace\" aspect for example for each one of the aspects you load.\n *\n * to make this work, export the main also as default (e.g. `export default LanesMain;`).\n * otherwise, it'll show an error \"TypeError: Cannot read property 'runtime' of undefined\".\n */\nexport async function loadAspect<T>(targetAspect: Aspect, cwd = process.cwd(), runtime = 'main'): Promise<T> {\n const harmony = await loadManyAspects([targetAspect], cwd, runtime);\n return harmony.get(targetAspect.id);\n}\n\n/**\n * returns an instance of Harmony. with this instance, you can get any aspect you loaded (or its dependencies).\n * e.g. `const workspace = harmony.get<Workspace>(WorkspaceAspect.id);`\n * when used for tests, specify all aspects you need and call it once. this way, you make sure all of them are in sync\n * and use the same instances of each other.\n */\nexport async function loadManyAspects(\n targetAspects: Aspect[],\n cwd = process.cwd(),\n runtime = 'main'\n): Promise<Harmony> {\n clearGlobalsIfNeeded();\n const coreAspectIds = getCoreAspectIds();\n // tried alternative to avoid this. however, in some cases, during build, this component is in a capsule, so the list\n // of core-aspects registered during load-bit doesn't apply here.\n ExtensionDataList.registerManyCoreExtensionNames(coreAspectIds);\n\n const config = await getConfig(cwd);\n const configMap = config.toObject();\n configMap['teambit.harmony/bit'] = {\n cwd,\n };\n\n // CLIAspect is needed for register the main runtime. NodeAspect is needed to get the default env if nothing\n // was configured. If it's not loaded here, it'll throw an error later that there is no node-env.\n // DependenciesAspect is needed to make ComponentLoader.loadDeps hook works.\n const harmony = await Harmony.load([CLIAspect, DependenciesAspect, NodeAspect, ...targetAspects], runtime, configMap);\n\n await harmony.run(async (aspect, runtimeDef) => {\n const id = ComponentID.fromString(aspect.id);\n const mainFilePath = getMainFilePath(aspect, id);\n const packagePath = resolve(join(mainFilePath, '..'));\n const files = readdirSync(packagePath);\n const runtimePath = files.find((path) => path.includes(`.${runtimeDef.name}.runtime.js`));\n if (!runtimePath) throw new Error(`could not find runtime '${runtimeDef.name}' for aspect ID '${aspect.id}'`);\n // eslint-disable-next-line global-require, import/no-dynamic-require\n const runtimeC = require(join(packagePath, runtimePath));\n if (aspect.manifest._runtimes.length === 0 || targetAspects.includes(aspect.id)) {\n // core-aspects running outside of bit-bin repo end up here. they don't have runtime.\n // this makes sure to load them from the path were they're imported\n addRuntimeIfNeeded(runtimeC, aspect);\n }\n });\n\n return harmony;\n}\n\nfunction addRuntimeIfNeeded(runtimeC: any, aspect: Extension) {\n if (runtimeC.default) {\n aspect.manifest.addRuntime(runtimeC.default);\n return;\n }\n const methodsOnResult = Object.keys(runtimeC);\n if (methodsOnResult.length === 1) {\n aspect.manifest.addRuntime(runtimeC[methodsOnResult[0]]);\n return;\n }\n const main = methodsOnResult.filter((method) => method.endsWith('Main'));\n if (main.length === 1) {\n aspect.manifest.addRuntime(runtimeC[main[0]]);\n return;\n }\n throw new Error(`error: ${aspect.id} does not export its main-runtime as default.\ngo to the aspect-main file and add a new line with \"export default YourAspectMain\"`);\n}\n\nfunction getMainFilePath(aspect: any, id: ComponentID) {\n let packageName = getPackageName(aspect, id);\n try {\n // try core aspects\n return require.resolve(packageName);\n } catch {\n // fallback to a naive way of converting componentId to pkg-name. (it won't work when the component has special pkg name settings)\n packageName = `@${id.scope.replace('.', '/')}.${id.fullName.replaceAll('/', '.')}`;\n return require.resolve(packageName);\n }\n}\n\nexport async function getConfig(cwd = process.cwd()) {\n const consumerInfo = await getWorkspaceInfo(cwd);\n const scopePath = findScopePath(cwd);\n const globalConfigOpts = {\n name: '.bitrc.jsonc',\n };\n const configOpts: ConfigOptions = {\n global: globalConfigOpts,\n shouldThrow: false,\n cwd: consumerInfo?.path || scopePath,\n };\n\n if (consumerInfo) {\n const config = Config.load('workspace.jsonc', configOpts);\n return config;\n }\n\n if (scopePath && !consumerInfo) {\n return Config.load('scope.jsonc', configOpts);\n }\n\n return Config.loadGlobal(globalConfigOpts);\n}\n\nfunction clearGlobalsIfNeeded() {\n if (!loadConsumer.cache && !PackageJsonTransformer.packageJsonTransformersRegistry.length) {\n return;\n }\n delete loadConsumer.cache;\n ComponentLoader.onComponentLoadSubscribers = [];\n ComponentOverrides.componentOverridesLoadingRegistry = {};\n ComponentConfig.componentConfigLoadingRegistry = {};\n PackageJsonTransformer.packageJsonTransformersRegistry = [];\n // @ts-ignore\n ComponentLoader.loadDeps = undefined;\n ExtensionDataList.coreExtensionsNames = new Map();\n // @ts-ignore\n LegacyWorkspaceCon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G,uBAAM,CAACC,UAAU,CAACL,gBAAgB,CAAC;AAC5C;AAEA,SAASnD,oBAAoBA,CAAA,EAAG;EAC9B,IAAI,CAACyD,sBAAY,CAACC,KAAK,IAAI,CAACC,2CAAsB,CAACC,+BAA+B,CAAC7B,MAAM,EAAE;IACzF;EACF;EACA,OAAO0B,sBAAY,CAACC,KAAK;EACzBG,0BAAe,CAACC,0BAA0B,GAAG,EAAE;EAC/CC,6BAAkB,CAACC,iCAAiC,GAAG,CAAC,CAAC;EACzDC,0BAAe,CAACC,8BAA8B,GAAG,CAAC,CAAC;EACnDP,2CAAsB,CAACC,+BAA+B,GAAG,EAAE;EAC3D;EACAC,0BAAe,CAACM,QAAQ,GAAGC,SAAS;EACpClE,4BAAiB,CAACmE,mBAAmB,GAAG,IAAIC,GAAG,CAAC,CAAC;EACjD;EACAC,gCAAqB,CAACC,8BAA8B,GAAGJ,SAAS;AAClE","ignoreList":[]}
|
package/package.json
CHANGED
|
@@ -1,27 +1,27 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@teambit/harmony.testing.load-aspect",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.283",
|
|
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.283"
|
|
10
10
|
},
|
|
11
11
|
"dependencies": {
|
|
12
12
|
"@teambit/harmony": "0.4.6",
|
|
13
|
-
"@teambit/legacy.consumer-component": "0.0.
|
|
14
|
-
"@teambit/legacy.consumer-config": "0.0.
|
|
15
|
-
"@teambit/legacy.consumer": "0.0.
|
|
16
|
-
"@teambit/legacy.extension-data": "0.0.
|
|
17
|
-
"@teambit/scope.modules.find-scope-path": "0.0.
|
|
18
|
-
"@teambit/workspace.modules.node-modules-linker": "0.0.
|
|
19
|
-
"@teambit/workspace.modules.workspace-locator": "0.0.
|
|
13
|
+
"@teambit/legacy.consumer-component": "0.0.29",
|
|
14
|
+
"@teambit/legacy.consumer-config": "0.0.28",
|
|
15
|
+
"@teambit/legacy.consumer": "0.0.28",
|
|
16
|
+
"@teambit/legacy.extension-data": "0.0.30",
|
|
17
|
+
"@teambit/scope.modules.find-scope-path": "0.0.11",
|
|
18
|
+
"@teambit/workspace.modules.node-modules-linker": "0.0.256",
|
|
19
|
+
"@teambit/workspace.modules.workspace-locator": "0.0.11"
|
|
20
20
|
},
|
|
21
21
|
"devDependencies": {
|
|
22
22
|
"@types/mocha": "9.1.0",
|
|
23
|
-
"
|
|
24
|
-
"@
|
|
23
|
+
"chai": "4.3.0",
|
|
24
|
+
"@teambit/node.envs.node-babel-mocha": "0.1.5"
|
|
25
25
|
},
|
|
26
26
|
"peerDependencies": {},
|
|
27
27
|
"license": "Apache-2.0",
|
package/types/asset.d.ts
CHANGED
|
@@ -5,12 +5,12 @@ declare module '*.png' {
|
|
|
5
5
|
declare module '*.svg' {
|
|
6
6
|
import type { FunctionComponent, SVGProps } from 'react';
|
|
7
7
|
|
|
8
|
-
export const ReactComponent: FunctionComponent<
|
|
8
|
+
export const ReactComponent: FunctionComponent<
|
|
9
|
+
SVGProps<SVGSVGElement> & { title?: string }
|
|
10
|
+
>;
|
|
9
11
|
const src: string;
|
|
10
12
|
export default src;
|
|
11
13
|
}
|
|
12
|
-
|
|
13
|
-
// @TODO Gilad
|
|
14
14
|
declare module '*.jpg' {
|
|
15
15
|
const value: any;
|
|
16
16
|
export = value;
|
|
@@ -27,3 +27,15 @@ declare module '*.bmp' {
|
|
|
27
27
|
const value: any;
|
|
28
28
|
export = value;
|
|
29
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
|
+
}
|