@embroider/shared-internals
Advanced tools
Comparing version 2.6.3-unstable.4aacaee to 2.6.3-unstable.c2dff54
{ | ||
"name": "@embroider/shared-internals", | ||
"version": "2.6.3-unstable.4aacaee", | ||
"version": "2.6.3-unstable.c2dff54", | ||
"private": false, | ||
@@ -5,0 +5,0 @@ "description": "Utilities shared among the other embroider packages", |
@@ -18,1 +18,2 @@ export { AppMeta, AddonMeta, PackageInfo } from './metadata'; | ||
export * from './dep-validation'; | ||
export * from './colocation'; |
@@ -56,2 +56,3 @@ "use strict"; | ||
__exportStar(require("./dep-validation"), exports); | ||
__exportStar(require("./colocation"), exports); | ||
//# sourceMappingURL=index.js.map |
@@ -19,2 +19,3 @@ import type { AddonMeta, AppMeta, PackageInfo } from './metadata'; | ||
isV2App(): this is V2AppPackage; | ||
needsLooseResolving(): boolean; | ||
isV2Addon(): this is V2AddonPackage; | ||
@@ -21,0 +22,0 @@ findDescendants(filter?: (pkg: Package) => boolean): Package[]; |
@@ -78,2 +78,6 @@ "use strict"; | ||
} | ||
needsLooseResolving() { | ||
var _a; | ||
return this.isV2App() || ((_a = (this.isV2Addon() && this.meta['auto-upgraded'])) !== null && _a !== void 0 ? _a : false); | ||
} | ||
isV2Addon() { | ||
@@ -80,0 +84,0 @@ return this.isV2Ember() && this.packageJSON['ember-addon'].type === 'addon'; |
@@ -5,4 +5,4 @@ import type Package from './package'; | ||
export declare function unrelativize(pkg: Package, specifier: string, fromFile: string): string; | ||
export declare function cleanUrl(url: string, includeHashSign?: boolean): string; | ||
export declare function getUrlQueryParams(url: string, includeHashSign?: boolean): string; | ||
export declare function cleanUrl(url: string): string; | ||
export declare function getUrlQueryParams(url: string): string; | ||
export declare function correspondingTemplate(filename: string): string; |
@@ -21,3 +21,3 @@ "use strict"; | ||
} | ||
if ((0, path_1.isAbsolute)(toFile) && result.endsWith(toFile)) { | ||
if ((0, path_1.isAbsolute)(toFile) && result.split(path_1.sep).join('/').endsWith(toFile)) { | ||
// this prevents silly "relative" paths like | ||
@@ -49,18 +49,13 @@ // "../../../../../Users/you/projects/your/stuff" when we could have just | ||
const postfixRE = /[?#].*$/s; | ||
// this pattern includes URL query params (ex: ?direct) | ||
// but excludes specifiers starting with # (ex: #embroider_compats/components/fancy) | ||
// so when using this pattern, #embroider_compat/fancy would be consider a pathname | ||
// without any params. | ||
const postfixREQueryParams = /[?].*$/s; | ||
// this is the same implementation Vite uses internally to keep its | ||
// cache-busting query params from leaking where they shouldn't. | ||
// includeHashSign true means #my-specifier is considered part of the pathname | ||
function cleanUrl(url, includeHashSign = false) { | ||
const regexp = includeHashSign ? postfixREQueryParams : postfixRE; | ||
function cleanUrl(url) { | ||
const regexp = postfixRE; | ||
return url.replace(regexp, ''); | ||
} | ||
// includeHashSign true means #my-specifier is considered part of the pathname | ||
function getUrlQueryParams(url, includeHashSign = false) { | ||
function getUrlQueryParams(url) { | ||
var _a, _b; | ||
const regexp = includeHashSign ? postfixREQueryParams : postfixRE; | ||
const regexp = postfixRE; | ||
return (_b = (_a = url.match(regexp)) === null || _a === void 0 ? void 0 : _a[0]) !== null && _b !== void 0 ? _b : ''; | ||
@@ -67,0 +62,0 @@ } |
@@ -190,2 +190,5 @@ "use strict"; | ||
} | ||
needsLooseResolving() { | ||
return this.plainPkg.needsLooseResolving(); | ||
} | ||
// it's important that we're calling this.dependencies here at this level, not | ||
@@ -192,0 +195,0 @@ // plainPkg.dependencies, which wouldn't be correct |
@@ -31,3 +31,3 @@ "use strict"; | ||
let owningPackage = _1.PackageCache.shared('embroider', state.opts.appRoot).ownerOfFile(filename); | ||
if (!owningPackage || !owningPackage.isV2Ember() || !owningPackage.meta['auto-upgraded']) { | ||
if (!owningPackage || !owningPackage.needsLooseResolving()) { | ||
debug('not handling colocation for %s', filename); | ||
@@ -34,0 +34,0 @@ return; |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
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
164252
62
1627
16
156
12
20
2