@teambit/harmony.testing.load-aspect 0.0.3 → 0.0.6
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 +4 -0
- package/dist/load-aspect.js +6 -1
- package/dist/load-aspect.js.map +1 -1
- package/load-aspect.ts +6 -2
- package/package-tar/teambit-harmony.testing.load-aspect-0.0.6.tgz +0 -0
- package/package.json +3 -3
- package/{__preview-1645365357220.js → preview-1650468178717.js} +0 -0
- package/tsconfig.json +1 -1
- package/package-tar/teambit-harmony.testing.load-aspect-0.0.3.tgz +0 -0
package/dist/load-aspect.d.ts
CHANGED
|
@@ -1,4 +1,8 @@
|
|
|
1
1
|
import { Aspect } from '@teambit/harmony';
|
|
2
2
|
import { Config } from '@teambit/harmony/dist/harmony-config';
|
|
3
|
+
/**
|
|
4
|
+
* to make this work, export the main also as default (e.g. `export default LanesMain;`).
|
|
5
|
+
* otherwise, it'll show an error "TypeError: Cannot read property 'runtime' of undefined".
|
|
6
|
+
*/
|
|
3
7
|
export declare function loadAspect<T>(targetAspect: Aspect, cwd?: string, runtime?: string): Promise<T>;
|
|
4
8
|
export declare function getConfig(cwd?: string): Promise<Config>;
|
package/dist/load-aspect.js
CHANGED
|
@@ -18,8 +18,9 @@ const consumer_1 = require("@teambit/legacy/dist/consumer");
|
|
|
18
18
|
const utils_1 = require("@teambit/legacy/dist/utils");
|
|
19
19
|
const fs_1 = require("fs");
|
|
20
20
|
const harmony_1 = require("@teambit/harmony");
|
|
21
|
-
|
|
21
|
+
// TODO: expose this types from harmony (once we have a way to expose it only for node)
|
|
22
22
|
const harmony_config_1 = require("@teambit/harmony/dist/harmony-config");
|
|
23
|
+
const component_1 = require("@teambit/component");
|
|
23
24
|
const cli_1 = require("@teambit/cli");
|
|
24
25
|
const node_1 = require("@teambit/node");
|
|
25
26
|
const component_loader_1 = __importDefault(require("@teambit/legacy/dist/consumer/component/component-loader"));
|
|
@@ -35,6 +36,10 @@ function getPackageName(aspect, id) {
|
|
|
35
36
|
// const [owner, name] = aspect.id.split('.');
|
|
36
37
|
// return `@${owner}/${replaceAll(name, '/', '.')}`;
|
|
37
38
|
}
|
|
39
|
+
/**
|
|
40
|
+
* to make this work, export the main also as default (e.g. `export default LanesMain;`).
|
|
41
|
+
* otherwise, it'll show an error "TypeError: Cannot read property 'runtime' of undefined".
|
|
42
|
+
*/
|
|
38
43
|
function loadAspect(targetAspect, cwd = process.cwd(), runtime = 'main') {
|
|
39
44
|
return __awaiter(this, void 0, void 0, function* () {
|
|
40
45
|
clearGlobalsIfNeeded();
|
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,sDAA8E;AAC9E,2BAAiC;
|
|
1
|
+
{"version":3,"file":"load-aspect.js","sourceRoot":"","sources":["../load-aspect.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;AAAA,+BAAqC;AACrC,4DAA8E;AAC9E,sDAA8E;AAC9E,2BAAiC;AACjC,8CAAmD;AACnD,uFAAuF;AACvF,yEAA6E;AAC7E,kDAAiD;AACjD,sCAAyC;AACzC,wCAA2C;AAC3C,gHAAuF;AACvF,6GAAoF;AACpF,mHAA0F;AAC1F,+GAA0G;AAC1G,gIAAsG;AACtG,iEAAyE;AACzE,6GAAoF;AACpF,kHAA8G;AAE9G,SAAS,cAAc,CAAC,MAAW,EAAE,EAAe;IAClD,OAAO,YAAY,EAAE,CAAC,IAAI,EAAE,CAAC;IAC7B,8CAA8C;IAC9C,oDAAoD;AACtD,CAAC;AAED;;;GAGG;AACH,SAAsB,UAAU,CAAI,YAAoB,EAAE,GAAG,GAAG,OAAO,CAAC,GAAG,EAAE,EAAE,OAAO,GAAG,MAAM;;QAC7F,oBAAoB,EAAE,CAAC;QACvB,MAAM,MAAM,GAA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GAAG,EAAE,CAAC;IAC1D,0BAAe,CAAC,8BAA8B,GAAG,EAAE,CAAC;IACpD,iDAAsB,CAAC,+BAA+B,GAAG,EAAE,CAAC;IAC5D,aAAa;IACb,wCAAkB,CAAC,kBAAkB,GAAG,SAAS,CAAC;IAClD,aAAa;IACb,gCAAoB,CAAC,iBAAiB,GAAG,EAAE,CAAC;IAC5C,0BAAiB,CAAC,mBAAmB,GAAG,IAAI,GAAG,EAAE,CAAC;IAClD,aAAa;IACb,0BAAe,CAAC,+BAA+B,GAAG,SAAS,CAAC;IAC5D,aAAa;IACb,0BAAe,CAAC,8BAA8B,GAAG,SAAS,CAAC;IAC3D,aAAa;IACb,0BAAe,CAAC,8BAA8B,GAAG,SAAS,CAAC;AAC7D,CAAC"}
|
package/load-aspect.ts
CHANGED
|
@@ -2,10 +2,10 @@ import { resolve, join } from 'path';
|
|
|
2
2
|
import { getConsumerInfo, loadConsumer } from '@teambit/legacy/dist/consumer';
|
|
3
3
|
import { propogateUntil as propagateUntil } from '@teambit/legacy/dist/utils';
|
|
4
4
|
import { readdirSync } from 'fs';
|
|
5
|
-
import { ConfigOptions } from '@teambit/harmony/dist/harmony-config/harmony-config';
|
|
6
5
|
import { Harmony, Aspect } from '@teambit/harmony';
|
|
6
|
+
// TODO: expose this types from harmony (once we have a way to expose it only for node)
|
|
7
|
+
import { Config, ConfigOptions } from '@teambit/harmony/dist/harmony-config';
|
|
7
8
|
import { ComponentID } from '@teambit/component';
|
|
8
|
-
import { Config } from '@teambit/harmony/dist/harmony-config';
|
|
9
9
|
import { CLIAspect } from '@teambit/cli';
|
|
10
10
|
import { NodeAspect } from '@teambit/node';
|
|
11
11
|
import ComponentLoader from '@teambit/legacy/dist/consumer/component/component-loader';
|
|
@@ -23,6 +23,10 @@ function getPackageName(aspect: any, id: ComponentID) {
|
|
|
23
23
|
// return `@${owner}/${replaceAll(name, '/', '.')}`;
|
|
24
24
|
}
|
|
25
25
|
|
|
26
|
+
/**
|
|
27
|
+
* to make this work, export the main also as default (e.g. `export default LanesMain;`).
|
|
28
|
+
* otherwise, it'll show an error "TypeError: Cannot read property 'runtime' of undefined".
|
|
29
|
+
*/
|
|
26
30
|
export async function loadAspect<T>(targetAspect: Aspect, cwd = process.cwd(), runtime = 'main'): Promise<T> {
|
|
27
31
|
clearGlobalsIfNeeded();
|
|
28
32
|
const config = await getConfig(cwd);
|
|
Binary file
|
package/package.json
CHANGED
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@teambit/harmony.testing.load-aspect",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.6",
|
|
4
4
|
"homepage": "https://bit.dev/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.6"
|
|
10
10
|
},
|
|
11
11
|
"dependencies": {
|
|
12
|
-
"@teambit/harmony": "0.
|
|
12
|
+
"@teambit/harmony": "0.3.3"
|
|
13
13
|
},
|
|
14
14
|
"devDependencies": {
|
|
15
15
|
"@types/mocha": "9.1.0",
|
|
File without changes
|
package/tsconfig.json
CHANGED
|
Binary file
|