@teambit/aspect-loader 0.0.1068 → 0.0.1070
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
|
@@ -81,6 +81,9 @@ function getAspectDirFromBvm(id, bvmDirOptions) {
|
|
|
81
81
|
version = bvmDirOptions === null || bvmDirOptions === void 0 ? void 0 : bvmDirOptions.version;
|
|
82
82
|
} else {
|
|
83
83
|
const link = (bvmDirOptions === null || bvmDirOptions === void 0 ? void 0 : bvmDirOptions.linkName) || bvmConfig.getDefaultLinkName();
|
|
84
|
+
if (!link) {
|
|
85
|
+
throw new (_bitError().BitError)(`can't find link in bvm config. most likely bvm is not installed`);
|
|
86
|
+
}
|
|
84
87
|
const links = bvmConfig.getLinks();
|
|
85
88
|
version = links[link];
|
|
86
89
|
if (!version) {
|
package/dist/core-aspects.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_bvmConfig","getAspectDirFromPath","id","pathsToResolveAspects","aspectName","getCoreAspectName","packageName","getCoreAspectPackageName","moduleDirectory","length","require","resolve","paths","dirPath","join","existsSync","Error","getAspectDir","err","__dirname","getAspectDirFromBvm","bvmDirOptions","Config","load","bvmConfig","version","link","linkName","getDefaultLinkName","
|
|
1
|
+
{"version":3,"names":["_bvmConfig","getAspectDirFromPath","id","pathsToResolveAspects","aspectName","getCoreAspectName","packageName","getCoreAspectPackageName","moduleDirectory","length","require","resolve","paths","dirPath","join","existsSync","Error","getAspectDir","err","__dirname","getAspectDirFromBvm","bvmDirOptions","Config","load","bvmConfig","version","link","linkName","getDefaultLinkName","BitError","links","getLinks","versionDir","exists","getSpecificVersionDir","getAspectDistDir","name","split","getAspectDef","runtime","files","readdir","runtimeFile","find","file","includes","aspectFile","aspectPath","aspectFilePath","runtimePath"],"sources":["core-aspects.ts"],"sourcesContent":["import { BitError } from '@teambit/bit-error';\nimport { existsSync, readdir } from 'fs-extra';\nimport { join, resolve } from 'path';\nimport { Config } from '@teambit/bvm.config';\n\nlet _bvmConfig;\n\nfunction getAspectDirFromPath(id: string, pathsToResolveAspects?: string[]): string {\n const aspectName = getCoreAspectName(id);\n const packageName = getCoreAspectPackageName(id);\n\n let moduleDirectory;\n if (pathsToResolveAspects && pathsToResolveAspects.length) {\n moduleDirectory = require.resolve(packageName, { paths: pathsToResolveAspects });\n } else {\n moduleDirectory = require.resolve(packageName);\n }\n const dirPath = join(moduleDirectory, '../..'); // to remove the \"index.js\" at the end\n if (!existsSync(dirPath)) {\n throw new Error(`unable to find ${aspectName} in ${dirPath}`);\n }\n return dirPath;\n}\n\nexport function getAspectDir(id: string): string {\n const aspectName = getCoreAspectName(id);\n let dirPath;\n\n try {\n dirPath = getAspectDirFromPath(id);\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\ntype BvmDirOptions = {\n version?: string;\n linkName?: string;\n};\nexport function getAspectDirFromBvm(id: string, bvmDirOptions?: BvmDirOptions): string {\n if (!_bvmConfig) {\n _bvmConfig = Config.load(false, ['env', 'file']);\n }\n\n const bvmConfig = _bvmConfig;\n let version;\n if (bvmDirOptions?.version) {\n version = bvmDirOptions?.version;\n } else {\n const link = bvmDirOptions?.linkName || bvmConfig.getDefaultLinkName();\n if (!link) {\n throw new BitError(`can't find link in bvm config. most likely bvm is not installed`);\n }\n const links = bvmConfig.getLinks();\n version = links[link];\n if (!version) {\n throw new BitError(`can't find link named ${bvmDirOptions?.linkName} in bvm config`);\n }\n }\n const { versionDir, exists } = bvmConfig.getSpecificVersionDir(version, true);\n if (!exists) {\n throw new BitError(`can't find version ${version} in bvm folder`);\n }\n return getAspectDirFromPath(id, [versionDir]);\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 const aspectFile = files.find((file) => file.includes(`.aspect.js`)) || null;\n\n return {\n id: aspectName,\n aspectPath: join(dirPath, '..'),\n aspectFilePath: aspectFile ? resolve(`${dirPath}/${aspectFile}`) : null,\n runtimePath: runtimeFile ? resolve(`${dirPath}/${runtimeFile}`) : null,\n };\n}\n"],"mappings":";;;;;;;;;;;;;;AAAA;EAAA;EAAA;IAAA;EAAA;EAAA;AAAA;AACA;EAAA;EAAA;IAAA;EAAA;EAAA;AAAA;AACA;EAAA;EAAA;IAAA;EAAA;EAAA;AAAA;AACA;EAAA;EAAA;IAAA;EAAA;EAAA;AAAA;AAEA,IAAIA,UAAU;AAEd,SAASC,oBAAoB,CAACC,EAAU,EAAEC,qBAAgC,EAAU;EAClF,MAAMC,UAAU,GAAGC,iBAAiB,CAACH,EAAE,CAAC;EACxC,MAAMI,WAAW,GAAGC,wBAAwB,CAACL,EAAE,CAAC;EAEhD,IAAIM,eAAe;EACnB,IAAIL,qBAAqB,IAAIA,qBAAqB,CAACM,MAAM,EAAE;IACzDD,eAAe,GAAGE,OAAO,CAACC,OAAO,CAACL,WAAW,EAAE;MAAEM,KAAK,EAAET;IAAsB,CAAC,CAAC;EAClF,CAAC,MAAM;IACLK,eAAe,GAAGE,OAAO,CAACC,OAAO,CAACL,WAAW,CAAC;EAChD;EACA,MAAMO,OAAO,GAAG,IAAAC,YAAI,EAACN,eAAe,EAAE,OAAO,CAAC,CAAC,CAAC;EAChD,IAAI,CAAC,IAAAO,qBAAU,EAACF,OAAO,CAAC,EAAE;IACxB,MAAM,IAAIG,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C,IAAI,IAAI;EACrF;EACA,MAAMO,UAAU,GAAGN,KAAK,CAACG,IAAI,CAAEC,IAAI,IAAKA,IAAI,CAACC,QAAQ,CAAE,YAAW,CAAC,CAAC,IAAI,IAAI;EAE5E,OAAO;IACL3C,EAAE,EAAEE,UAAU;IACd2C,UAAU,EAAE,IAAAjC,YAAI,EAACD,OAAO,EAAE,IAAI,CAAC;IAC/BmC,cAAc,EAAEF,UAAU,GAAG,IAAAnC,eAAO,EAAE,GAAEE,OAAQ,IAAGiC,UAAW,EAAC,CAAC,GAAG,IAAI;IACvEG,WAAW,EAAEP,WAAW,GAAG,IAAA/B,eAAO,EAAE,GAAEE,OAAQ,IAAG6B,WAAY,EAAC,CAAC,GAAG;EACpE,CAAC;AACH"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import * as compositions_0 from '/home/circleci/Library/Caches/Bit/capsules/8891be5ad3d35bfc38b9cd90c0e05b598a5a55af/teambit.harmony_aspect-loader@0.0.
|
|
2
|
-
import * as overview_0 from '/home/circleci/Library/Caches/Bit/capsules/8891be5ad3d35bfc38b9cd90c0e05b598a5a55af/teambit.harmony_aspect-loader@0.0.
|
|
1
|
+
import * as compositions_0 from '/home/circleci/Library/Caches/Bit/capsules/8891be5ad3d35bfc38b9cd90c0e05b598a5a55af/teambit.harmony_aspect-loader@0.0.1070/dist/aspect-loader.composition.js';
|
|
2
|
+
import * as overview_0 from '/home/circleci/Library/Caches/Bit/capsules/8891be5ad3d35bfc38b9cd90c0e05b598a5a55af/teambit.harmony_aspect-loader@0.0.1070/dist/aspect-loader.docs.mdx';
|
|
3
3
|
|
|
4
4
|
export const compositions = [compositions_0];
|
|
5
5
|
export const overview = [overview_0];
|
|
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.1070",
|
|
4
4
|
"homepage": "https://bit.cloud/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.1070"
|
|
10
10
|
},
|
|
11
11
|
"dependencies": {
|
|
12
12
|
"lodash": "4.17.21",
|
|
@@ -19,15 +19,15 @@
|
|
|
19
19
|
"@teambit/graph.cleargraph": "0.0.1",
|
|
20
20
|
"@teambit/legacy-bit-id": "0.0.423",
|
|
21
21
|
"@teambit/bvm.config": "0.2.2",
|
|
22
|
-
"@teambit/component": "0.0.
|
|
22
|
+
"@teambit/component": "0.0.1070",
|
|
23
23
|
"@teambit/bit-error": "0.0.402",
|
|
24
|
-
"@teambit/bit": "0.1.
|
|
24
|
+
"@teambit/bit": "0.1.57",
|
|
25
25
|
"@teambit/cli": "0.0.721",
|
|
26
26
|
"@teambit/compilation.modules.babel-compiler": "0.0.133",
|
|
27
|
-
"@teambit/envs": "0.0.
|
|
27
|
+
"@teambit/envs": "0.0.1070",
|
|
28
28
|
"@teambit/harmony.modules.requireable-component": "0.0.491",
|
|
29
29
|
"@teambit/logger": "0.0.814",
|
|
30
|
-
"@teambit/scope": "0.0.
|
|
30
|
+
"@teambit/scope": "0.0.1070"
|
|
31
31
|
},
|
|
32
32
|
"devDependencies": {
|
|
33
33
|
"@types/react": "^17.0.8",
|
|
Binary file
|