@embroider/shared-internals
Advanced tools
Comparing version 2.6.2 to 2.6.3-unstable.5063729
{ | ||
"name": "@embroider/shared-internals", | ||
"version": "2.6.2", | ||
"version": "2.6.3-unstable.5063729", | ||
"private": false, | ||
@@ -52,3 +52,3 @@ "description": "Utilities shared among the other embroider packages", | ||
"tmp": "^0.1.0", | ||
"typescript": "^5.1.6", | ||
"typescript": "^5.4.5", | ||
"@embroider/test-support": "0.36.0" | ||
@@ -55,0 +55,0 @@ }, |
@@ -19,3 +19,3 @@ "use strict"; | ||
if (owner.name === pkg && (semverRange == null || semver_1.default.satisfies(owner.version, semverRange))) { | ||
if (owner.isEmberPackage()) { | ||
if (owner.isEmberAddon()) { | ||
throw new Error(`You can't use skipBabel to disable transpilation of Ember addons, it only works for non-Ember third-party packages`); | ||
@@ -22,0 +22,0 @@ } |
@@ -45,3 +45,3 @@ "use strict"; | ||
let ancestorsDep = ancestor.dependencies.find(d => d.name === dep.name); | ||
if (ancestorsDep !== dep && dep.isEmberPackage()) { | ||
if (ancestorsDep !== dep && dep.isEmberAddon()) { | ||
violations.push({ pkg, dep, ancestors, ancestor, ancestorsDep }); | ||
@@ -48,0 +48,0 @@ } |
@@ -51,2 +51,4 @@ "use strict"; | ||
exports.emberVirtualPackages.add('@glimmer/manager'); | ||
// ember-data pre 4.12 failed to declare this as a peer dependency of @ember-data/debug | ||
exports.emberVirtualPeerDeps.add('@ember-data/store'); | ||
// These are the known names that people use to import template precomiplation | ||
@@ -53,0 +55,0 @@ // macros from. |
export { AppMeta, AddonMeta, PackageInfo } from './metadata'; | ||
export { explicitRelative, extensionsPattern, unrelativize, cleanUrl, correspondingTemplate } from './paths'; | ||
export { explicitRelative, extensionsPattern, unrelativize, cleanUrl, getUrlQueryParams, correspondingTemplate, } from './paths'; | ||
export { getOrCreate } from './get-or-create'; | ||
@@ -4,0 +4,0 @@ export { default as Package, V2AddonPackage as AddonPackage, V2AppPackage as AppPackage, V2Package } from './package'; |
@@ -20,3 +20,3 @@ "use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.locateEmbroiderWorkingDir = exports.cacheBustingPluginVersion = exports.cacheBustingPluginPath = exports.cacheBustingPlugin = exports.templateColocationPluginPath = exports.templateColocationPlugin = exports.hbsToJS = exports.tmpdir = exports.packageName = exports.babelFilter = exports.RewrittenPackageCache = exports.PackageCache = exports.Package = exports.getOrCreate = exports.correspondingTemplate = exports.cleanUrl = exports.unrelativize = exports.extensionsPattern = exports.explicitRelative = void 0; | ||
exports.locateEmbroiderWorkingDir = exports.cacheBustingPluginVersion = exports.cacheBustingPluginPath = exports.cacheBustingPlugin = exports.templateColocationPluginPath = exports.templateColocationPlugin = exports.hbsToJS = exports.tmpdir = exports.packageName = exports.babelFilter = exports.RewrittenPackageCache = exports.PackageCache = exports.Package = exports.getOrCreate = exports.correspondingTemplate = exports.getUrlQueryParams = exports.cleanUrl = exports.unrelativize = exports.extensionsPattern = exports.explicitRelative = void 0; | ||
var paths_1 = require("./paths"); | ||
@@ -27,2 +27,3 @@ Object.defineProperty(exports, "explicitRelative", { enumerable: true, get: function () { return paths_1.explicitRelative; } }); | ||
Object.defineProperty(exports, "cleanUrl", { enumerable: true, get: function () { return paths_1.cleanUrl; } }); | ||
Object.defineProperty(exports, "getUrlQueryParams", { enumerable: true, get: function () { return paths_1.getUrlQueryParams; } }); | ||
Object.defineProperty(exports, "correspondingTemplate", { enumerable: true, get: function () { return paths_1.correspondingTemplate; } }); | ||
@@ -29,0 +30,0 @@ var get_or_create_1 = require("./get-or-create"); |
@@ -67,2 +67,6 @@ "use strict"; | ||
let candidate = filename; | ||
const virtualPrefix = 'embroider_virtual:'; | ||
if (candidate.includes(virtualPrefix)) { | ||
candidate = candidate.replace(/^.*embroider_virtual:/, ''); | ||
} | ||
// first we look through our cached packages for any that are rooted right | ||
@@ -69,0 +73,0 @@ // at or above the file. |
@@ -14,3 +14,3 @@ import type { AddonMeta, AppMeta, PackageInfo } from './metadata'; | ||
get meta(): AddonMeta | AppMeta | undefined; | ||
isEmberPackage(): boolean; | ||
isEmberAddon(): boolean; | ||
isEngine(): boolean; | ||
@@ -17,0 +17,0 @@ isLazyEngine(): boolean; |
@@ -56,3 +56,3 @@ "use strict"; | ||
} | ||
isEmberPackage() { | ||
isEmberAddon() { | ||
let keywords = this.packageJSON.keywords; | ||
@@ -73,3 +73,4 @@ return Boolean(keywords && keywords.includes('ember-addon')); | ||
isV2Ember() { | ||
return this.isEmberPackage() && (0, get_1.default)(this.packageJSON, 'ember-addon.version') === 2; | ||
return ((0, get_1.default)(this.packageJSON, 'ember-addon.version') === 2 && | ||
((0, get_1.default)(this.packageJSON, 'ember-addon.type') === 'app' || this.isEmberAddon())); | ||
} | ||
@@ -76,0 +77,0 @@ isV2App() { |
@@ -5,3 +5,4 @@ import type Package from './package'; | ||
export declare function unrelativize(pkg: Package, specifier: string, fromFile: string): string; | ||
export declare function cleanUrl(url: string): string; | ||
export declare function cleanUrl(url: string, includeHashSign?: boolean): string; | ||
export declare function getUrlQueryParams(url: string, includeHashSign?: boolean): string; | ||
export declare function correspondingTemplate(filename: string): string; |
@@ -7,2 +7,3 @@ "use strict"; | ||
exports.cleanUrl = cleanUrl; | ||
exports.getUrlQueryParams = getUrlQueryParams; | ||
exports.correspondingTemplate = correspondingTemplate; | ||
@@ -48,7 +49,20 @@ const path_1 = require("path"); | ||
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. | ||
function cleanUrl(url) { | ||
return url.replace(postfixRE, ''); | ||
// includeHashSign true means #my-specifier is considered part of the pathname | ||
function cleanUrl(url, includeHashSign = false) { | ||
const regexp = includeHashSign ? postfixREQueryParams : postfixRE; | ||
return url.replace(regexp, ''); | ||
} | ||
// includeHashSign true means #my-specifier is considered part of the pathname | ||
function getUrlQueryParams(url, includeHashSign = false) { | ||
var _a, _b; | ||
const regexp = includeHashSign ? postfixREQueryParams : postfixRE; | ||
return (_b = (_a = url.match(regexp)) === null || _a === void 0 ? void 0 : _a[0]) !== null && _b !== void 0 ? _b : ''; | ||
} | ||
// given a filename, returns it with the hbs extension | ||
@@ -55,0 +69,0 @@ // for instance, passing filename.js returns filename.hbs |
@@ -172,4 +172,4 @@ "use strict"; | ||
} | ||
isEmberPackage() { | ||
return this.plainPkg.isEmberPackage(); | ||
isEmberAddon() { | ||
return this.plainPkg.isEmberAddon(); | ||
} | ||
@@ -176,0 +176,0 @@ isEngine() { |
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
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
No v1
QualityPackage is not semver >=1. This means it is not stable and does not support ^ ranges.
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
158741
1577
2