@embroider/shared-internals
Advanced tools
Comparing version 2.6.2-unstable.ee5e024 to 2.6.2
{ | ||
"name": "@embroider/shared-internals", | ||
"version": "2.6.2-unstable.ee5e024", | ||
"version": "2.6.2", | ||
"private": false, | ||
@@ -27,5 +27,2 @@ "description": "Utilities shared among the other embroider packages", | ||
], | ||
"scripts": { | ||
"test": "jest" | ||
}, | ||
"dependencies": { | ||
@@ -45,3 +42,2 @@ "babel-import-util": "^2.0.0", | ||
"broccoli-node-api": "^1.7.0", | ||
"@embroider/test-support": "workspace:*", | ||
"@types/babel__core": "^7.1.14", | ||
@@ -58,7 +54,11 @@ "@types/babel__traverse": "^7.18.5", | ||
"tmp": "^0.1.0", | ||
"typescript": "^5.4.5" | ||
"typescript": "^5.1.6", | ||
"@embroider/test-support": "0.36.0" | ||
}, | ||
"engines": { | ||
"node": "12.* || 14.* || >= 16" | ||
}, | ||
"scripts": { | ||
"test": "jest" | ||
} | ||
} | ||
} |
@@ -6,2 +6,3 @@ "use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.default = babelFilter; | ||
const package_cache_1 = __importDefault(require("./package-cache")); | ||
@@ -19,3 +20,3 @@ const semver_1 = __importDefault(require("semver")); | ||
if (owner.name === pkg && (semverRange == null || semver_1.default.satisfies(owner.version, semverRange))) { | ||
if (owner.isEmberAddon()) { | ||
if (owner.isEmberPackage()) { | ||
throw new Error(`You can't use skipBabel to disable transpilation of Ember addons, it only works for non-Ember third-party packages`); | ||
@@ -30,3 +31,2 @@ } | ||
} | ||
exports.default = babelFilter; | ||
function babelCanHandle(filename) { | ||
@@ -33,0 +33,0 @@ // we can handle .mjs, .js and .ts files with babel. If typescript is enabled, |
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.version = exports.pluginPath = void 0; | ||
exports.default = makePlugin; | ||
const fs_extra_1 = require("fs-extra"); | ||
@@ -16,5 +17,4 @@ function makePlugin() { | ||
} | ||
exports.default = makePlugin; | ||
exports.pluginPath = __filename; | ||
exports.version = (0, fs_extra_1.readJSONSync)(`${__dirname}/../package.json`); | ||
//# sourceMappingURL=babel-plugin-cache-busting.js.map |
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.summarizePeerDepViolations = exports.validatePeerDependencies = exports.crawlDeps = void 0; | ||
exports.crawlDeps = crawlDeps; | ||
exports.validatePeerDependencies = validatePeerDependencies; | ||
exports.summarizePeerDepViolations = summarizePeerDepViolations; | ||
// For each package in the graph, discover all the paths to reach that package. | ||
@@ -34,3 +36,2 @@ // That is, we're identifying all its consumers. | ||
} | ||
exports.crawlDeps = crawlDeps; | ||
function validatePeerDependencies(appPackage) { | ||
@@ -45,3 +46,3 @@ let violations = []; | ||
let ancestorsDep = ancestor.dependencies.find(d => d.name === dep.name); | ||
if (ancestorsDep !== dep && dep.isEmberAddon()) { | ||
if (ancestorsDep !== dep && dep.isEmberPackage()) { | ||
violations.push({ pkg, dep, ancestors, ancestor, ancestorsDep }); | ||
@@ -58,3 +59,2 @@ } | ||
} | ||
exports.validatePeerDependencies = validatePeerDependencies; | ||
function summarizePeerDepViolations(violations) { | ||
@@ -79,3 +79,2 @@ let message = []; | ||
} | ||
exports.summarizePeerDepViolations = summarizePeerDepViolations; | ||
function displayConnection(left, right) { | ||
@@ -82,0 +81,0 @@ var _a, _b, _c; |
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.findTopmostAddon = exports.isDeepAddonInstance = void 0; | ||
exports.isDeepAddonInstance = isDeepAddonInstance; | ||
exports.findTopmostAddon = findTopmostAddon; | ||
function isDeepAddonInstance(addon) { | ||
return addon.parent !== addon.project; | ||
} | ||
exports.isDeepAddonInstance = isDeepAddonInstance; | ||
function findTopmostAddon(addon) { | ||
@@ -16,3 +16,2 @@ if (isDeepAddonInstance(addon)) { | ||
} | ||
exports.findTopmostAddon = findTopmostAddon; | ||
//# sourceMappingURL=ember-cli-models.js.map |
@@ -51,4 +51,2 @@ "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 | ||
@@ -55,0 +53,0 @@ // macros from. |
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.getOrCreate = void 0; | ||
exports.getOrCreate = getOrCreate; | ||
function getOrCreate(map, key, construct) { | ||
@@ -12,3 +12,2 @@ let result = map.get(key); | ||
} | ||
exports.getOrCreate = getOrCreate; | ||
//# sourceMappingURL=get-or-create.js.map |
@@ -6,3 +6,3 @@ "use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.hbsToJS = void 0; | ||
exports.hbsToJS = hbsToJS; | ||
const js_string_escape_1 = __importDefault(require("js-string-escape")); | ||
@@ -30,3 +30,2 @@ const path_1 = require("path"); | ||
} | ||
exports.hbsToJS = hbsToJS; | ||
//# sourceMappingURL=hbs-to-js.js.map |
export { AppMeta, AddonMeta, PackageInfo } from './metadata'; | ||
export { explicitRelative, extensionsPattern, unrelativize, cleanUrl, getUrlQueryParams, correspondingTemplate, } from './paths'; | ||
export { explicitRelative, extensionsPattern, unrelativize, cleanUrl, 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.getUrlQueryParams = 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.cleanUrl = exports.unrelativize = exports.extensionsPattern = exports.explicitRelative = void 0; | ||
var paths_1 = require("./paths"); | ||
@@ -27,3 +27,2 @@ 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; } }); | ||
@@ -30,0 +29,0 @@ var get_or_create_1 = require("./get-or-create"); |
@@ -67,6 +67,2 @@ "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 | ||
@@ -73,0 +69,0 @@ // at or above the file. |
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.default = absolutePackageName; | ||
const path_1 = require("path"); | ||
@@ -24,3 +25,2 @@ function absolutePackageName(specifier) { | ||
} | ||
exports.default = absolutePackageName; | ||
//# sourceMappingURL=package-name.js.map |
@@ -14,3 +14,3 @@ import type { AddonMeta, AppMeta, PackageInfo } from './metadata'; | ||
get meta(): AddonMeta | AppMeta | undefined; | ||
isEmberAddon(): boolean; | ||
isEmberPackage(): boolean; | ||
isEngine(): boolean; | ||
@@ -17,0 +17,0 @@ isLazyEngine(): boolean; |
@@ -56,3 +56,3 @@ "use strict"; | ||
} | ||
isEmberAddon() { | ||
isEmberPackage() { | ||
let keywords = this.packageJSON.keywords; | ||
@@ -73,4 +73,3 @@ return Boolean(keywords && keywords.includes('ember-addon')); | ||
isV2Ember() { | ||
return ((0, get_1.default)(this.packageJSON, 'ember-addon.version') === 2 && | ||
((0, get_1.default)(this.packageJSON, 'ember-addon.type') === 'app' || this.isEmberAddon())); | ||
return this.isEmberPackage() && (0, get_1.default)(this.packageJSON, 'ember-addon.version') === 2; | ||
} | ||
@@ -77,0 +76,0 @@ isV2App() { |
@@ -5,4 +5,3 @@ 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 correspondingTemplate(filename: string): string; |
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.correspondingTemplate = exports.getUrlQueryParams = exports.cleanUrl = exports.unrelativize = exports.extensionsPattern = exports.explicitRelative = void 0; | ||
exports.explicitRelative = explicitRelative; | ||
exports.extensionsPattern = extensionsPattern; | ||
exports.unrelativize = unrelativize; | ||
exports.cleanUrl = cleanUrl; | ||
exports.correspondingTemplate = correspondingTemplate; | ||
const path_1 = require("path"); | ||
@@ -27,3 +31,2 @@ // by "explicit", I mean that we want "./local/thing" instead of "local/thing" | ||
} | ||
exports.explicitRelative = explicitRelative; | ||
// given a list like ['.js', '.ts'], return a regular expression for files ending | ||
@@ -34,3 +37,2 @@ // in those extensions. | ||
} | ||
exports.extensionsPattern = extensionsPattern; | ||
function unrelativize(pkg, specifier, fromFile) { | ||
@@ -46,24 +48,8 @@ if (pkg.packageJSON.exports) { | ||
} | ||
exports.unrelativize = unrelativize; | ||
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; | ||
return url.replace(regexp, ''); | ||
function cleanUrl(url) { | ||
return url.replace(postfixRE, ''); | ||
} | ||
exports.cleanUrl = cleanUrl; | ||
// 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 : ''; | ||
} | ||
exports.getUrlQueryParams = getUrlQueryParams; | ||
// given a filename, returns it with the hbs extension | ||
@@ -75,3 +61,2 @@ // for instance, passing filename.js returns filename.hbs | ||
} | ||
exports.correspondingTemplate = correspondingTemplate; | ||
//# sourceMappingURL=paths.js.map |
@@ -172,4 +172,4 @@ "use strict"; | ||
} | ||
isEmberAddon() { | ||
return this.plainPkg.isEmberAddon(); | ||
isEmberPackage() { | ||
return this.plainPkg.isEmberPackage(); | ||
} | ||
@@ -176,0 +176,0 @@ isEngine() { |
@@ -7,2 +7,3 @@ "use strict"; | ||
exports.pluginPath = void 0; | ||
exports.default = main; | ||
const fs_1 = require("fs"); | ||
@@ -133,3 +134,2 @@ const path_1 = require("path"); | ||
} | ||
exports.default = main; | ||
function getTemplate(target, state) { | ||
@@ -136,0 +136,0 @@ if (state.colocatedTemplate) { |
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.locateEmbroiderWorkingDir = void 0; | ||
exports.locateEmbroiderWorkingDir = locateEmbroiderWorkingDir; | ||
const path_1 = require("path"); | ||
@@ -35,3 +35,2 @@ const fs_1 = require("fs"); | ||
} | ||
exports.locateEmbroiderWorkingDir = locateEmbroiderWorkingDir; | ||
//# sourceMappingURL=working-dir.js.map |
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
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
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
59
1
155256
1554