@teambit/aspect-loader 0.0.607 → 0.0.615
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.js
CHANGED
|
@@ -38,15 +38,10 @@ function _path() {
|
|
|
38
38
|
function getAspectDir(id) {
|
|
39
39
|
const aspectName = getCoreAspectName(id);
|
|
40
40
|
const packageName = getCoreAspectPackageName(id);
|
|
41
|
-
let dirPath;
|
|
42
|
-
// otherwise, use the `__dirname` for the location of the core-aspects file.
|
|
43
|
-
|
|
44
|
-
const pathsToResolveAspects = [process.cwd(), __dirname];
|
|
41
|
+
let dirPath;
|
|
45
42
|
|
|
46
43
|
try {
|
|
47
|
-
const moduleDirectory = require.resolve(packageName
|
|
48
|
-
paths: pathsToResolveAspects
|
|
49
|
-
});
|
|
44
|
+
const moduleDirectory = require.resolve(packageName);
|
|
50
45
|
|
|
51
46
|
dirPath = (0, _path().join)(moduleDirectory, '../..'); // to remove the "index.js" at the end
|
|
52
47
|
} catch (err) {
|
package/dist/core-aspects.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["core-aspects.ts"],"names":["getAspectDir","id","aspectName","getCoreAspectName","packageName","getCoreAspectPackageName","dirPath","
|
|
1
|
+
{"version":3,"sources":["core-aspects.ts"],"names":["getAspectDir","id","aspectName","getCoreAspectName","packageName","getCoreAspectPackageName","dirPath","moduleDirectory","require","resolve","err","__dirname","Error","getAspectDistDir","name","split","join","getAspectDef","runtime","files","runtimeFile","find","file","includes","aspectPath","runtimePath"],"mappings":";;;;;;;;;;;;;;;;;AAAA;AAAA;;AAAA;AAAA;AAAA;;AAAA;AAAA;;AACA;AAAA;;AAAA;AAAA;AAAA;;AAAA;AAAA;;AAEO,SAASA,YAAT,CAAsBC,EAAtB,EAA0C;AAC/C,QAAMC,UAAU,GAAGC,iBAAiB,CAACF,EAAD,CAApC;AACA,QAAMG,WAAW,GAAGC,wBAAwB,CAACJ,EAA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AAQ,aAA1B,CAArB,KAAiE,IAA/E;AACD;;AAED,SAAO;AACLjB,IAAAA,EAAE,EAAEC,UADC;AAELsB,IAAAA,UAAU,EAAE,kBAAKlB,OAAL,EAAc,IAAd,CAFP;AAGLmB,IAAAA,WAAW,EAAEL,WAAW,GAAG,qBAAS,GAAEd,OAAQ,IAAGc,WAAY,EAAlC,CAAH,GAA0C;AAH7D,GAAP;AAKD","sourcesContent":["import { existsSync, readdir } from 'fs-extra';\nimport { join, resolve } from 'path';\n\nexport function getAspectDir(id: string): string {\n const aspectName = getCoreAspectName(id);\n const packageName = getCoreAspectPackageName(id);\n let dirPath: string;\n try {\n const moduleDirectory = require.resolve(packageName);\n dirPath = join(moduleDirectory, '../..'); // to remove the \"index.js\" at the end\n } catch (err: any) {\n dirPath = resolve(__dirname, '../..', aspectName, 'dist');\n }\n if (!existsSync(dirPath)) {\n throw new Error(`unable to find ${aspectName} in ${dirPath}`);\n }\n return dirPath;\n}\n\nexport function getAspectDistDir(id: string) {\n return resolve(`${getAspectDir(id)}/dist`);\n}\n\nexport function getCoreAspectName(id: string): string {\n const [, ...name] = id.split('/');\n const aspectName = name.join('.');\n return aspectName;\n}\n\nexport function getCoreAspectPackageName(id: string): string {\n const aspectName = getCoreAspectName(id);\n return `@teambit/${aspectName}`;\n}\n\nexport async function getAspectDef(aspectName: string, runtime?: string) {\n const dirPath = getAspectDistDir(aspectName);\n\n const files = await readdir(dirPath);\n let runtimeFile;\n if (runtime) {\n runtimeFile = files.find((file) => file.includes(`.${runtime}.runtime.js`)) || null;\n }\n\n return {\n id: aspectName,\n aspectPath: join(dirPath, '..'),\n runtimePath: runtimeFile ? resolve(`${dirPath}/${runtimeFile}`) : null,\n };\n}\n"]}
|
|
Binary file
|
package/package.json
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@teambit/aspect-loader",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.615",
|
|
4
4
|
"homepage": "https://bit.dev/teambit/harmony/aspect-loader",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"componentId": {
|
|
7
7
|
"scope": "teambit.harmony",
|
|
8
8
|
"name": "aspect-loader",
|
|
9
|
-
"version": "0.0.
|
|
9
|
+
"version": "0.0.615"
|
|
10
10
|
},
|
|
11
11
|
"dependencies": {
|
|
12
12
|
"@teambit/harmony": "0.2.11",
|
|
@@ -15,14 +15,14 @@
|
|
|
15
15
|
"fs-extra": "10.0.0",
|
|
16
16
|
"@babel/runtime": "7.12.18",
|
|
17
17
|
"core-js": "^3.0.0",
|
|
18
|
-
"@teambit/component": "0.0.
|
|
19
|
-
"@teambit/bit": "0.0.
|
|
20
|
-
"@teambit/cli": "0.0.
|
|
21
|
-
"@teambit/envs": "0.0.
|
|
18
|
+
"@teambit/component": "0.0.615",
|
|
19
|
+
"@teambit/bit": "0.0.617",
|
|
20
|
+
"@teambit/cli": "0.0.423",
|
|
21
|
+
"@teambit/envs": "0.0.615",
|
|
22
22
|
"@teambit/harmony.modules.requireable-component": "0.0.483",
|
|
23
23
|
"@teambit/legacy-bit-id": "0.0.397",
|
|
24
|
-
"@teambit/logger": "0.0.
|
|
25
|
-
"@teambit/scope": "0.0.
|
|
24
|
+
"@teambit/logger": "0.0.512",
|
|
25
|
+
"@teambit/scope": "0.0.615",
|
|
26
26
|
"@teambit/bit-error": "0.0.394"
|
|
27
27
|
},
|
|
28
28
|
"devDependencies": {
|
|
@@ -36,7 +36,7 @@
|
|
|
36
36
|
"@types/node": "12.20.4"
|
|
37
37
|
},
|
|
38
38
|
"peerDependencies": {
|
|
39
|
-
"@teambit/legacy": "1.0.
|
|
39
|
+
"@teambit/legacy": "1.0.204",
|
|
40
40
|
"react-dom": "^16.8.0 || ^17.0.0",
|
|
41
41
|
"react": "^16.8.0 || ^17.0.0"
|
|
42
42
|
},
|
|
@@ -64,7 +64,7 @@
|
|
|
64
64
|
"react": "-"
|
|
65
65
|
},
|
|
66
66
|
"peerDependencies": {
|
|
67
|
-
"@teambit/legacy": "1.0.
|
|
67
|
+
"@teambit/legacy": "1.0.204",
|
|
68
68
|
"react-dom": "^16.8.0 || ^17.0.0",
|
|
69
69
|
"react": "^16.8.0 || ^17.0.0"
|
|
70
70
|
}
|
|
Binary file
|