@embroider/shared-internals
Advanced tools
Comparing version 2.6.3-unstable.c2dff54 to 2.6.3-unstable.ce8f3cf
{ | ||
"name": "@embroider/shared-internals", | ||
"version": "2.6.3-unstable.c2dff54", | ||
"version": "2.6.3-unstable.ce8f3cf", | ||
"private": false, | ||
@@ -37,2 +37,3 @@ "description": "Utilities shared among the other embroider packages", | ||
"minimatch": "^3.0.4", | ||
"resolve.exports": "^2.0.2", | ||
"semver": "^7.3.5" | ||
@@ -39,0 +40,0 @@ }, |
import type PackageCache from './package-cache'; | ||
export declare function syntheticJStoHBS(source: string): string | null; | ||
export declare function needsSyntheticComponentJS(requestedSpecifier: string, foundFile: string, packageCache: Pick<PackageCache, 'ownerOfFile'>): string | null; | ||
export declare function isInComponents(id: string, packageCache: Pick<PackageCache, 'ownerOfFile'>): boolean; | ||
export declare function templateOnlyComponentSource(): string; |
@@ -5,2 +5,3 @@ "use strict"; | ||
exports.needsSyntheticComponentJS = needsSyntheticComponentJS; | ||
exports.isInComponents = isInComponents; | ||
exports.templateOnlyComponentSource = templateOnlyComponentSource; | ||
@@ -10,2 +11,3 @@ const fs_extra_1 = require("fs-extra"); | ||
const path_1 = require("path"); | ||
const resolve_exports_1 = require("resolve.exports"); | ||
function syntheticJStoHBS(source) { | ||
@@ -38,4 +40,13 @@ // explicit js is the only case we care about here. Synthetic template JS is | ||
function isInComponents(id, packageCache) { | ||
var _a; | ||
const pkg = packageCache.ownerOfFile(id); | ||
return (pkg === null || pkg === void 0 ? void 0 : pkg.isV2App()) && id.slice(pkg === null || pkg === void 0 ? void 0 : pkg.root.length).split(path_1.sep).join('/').startsWith('/components'); | ||
if (!(pkg === null || pkg === void 0 ? void 0 : pkg.isV2App())) { | ||
return false; | ||
} | ||
let tryResolve = (0, resolve_exports_1.resolve)(pkg.packageJSON, './components', { | ||
browser: true, | ||
conditions: ['default', 'imports'], | ||
}); | ||
let componentsDir = (_a = tryResolve === null || tryResolve === void 0 ? void 0 : tryResolve[0]) !== null && _a !== void 0 ? _a : './components'; | ||
return ('.' + id.slice(pkg === null || pkg === void 0 ? void 0 : pkg.root.length).split(path_1.sep).join('/')).startsWith(componentsDir); | ||
} | ||
@@ -42,0 +53,0 @@ function templateOnlyComponentSource() { |
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
165494
1639
11
+ Addedresolve.exports@^2.0.2
+ Addedresolve.exports@2.0.3(transitive)