@embroider/shared-internals
Advanced tools
Comparing version 2.0.0-unstable.73213f2a to 2.0.0-unstable.936fd63
{ | ||
"name": "@embroider/shared-internals", | ||
"version": "2.0.0-unstable.73213f2a", | ||
"version": "2.0.0-unstable.936fd63", | ||
"private": false, | ||
@@ -5,0 +5,0 @@ "description": "Utilities shared among the other embroider packages", |
export { AppMeta, AddonMeta, PackageInfo } from './metadata'; | ||
export { explicitRelative, extensionsPattern } from './paths'; | ||
export { explicitRelative, extensionsPattern, unrelativize } 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'; |
@@ -16,6 +16,7 @@ "use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.templateColocationPlugin = exports.hbsToJS = exports.tmpdir = exports.packageName = exports.babelFilter = exports.PackageCache = exports.Package = exports.getOrCreate = exports.extensionsPattern = exports.explicitRelative = void 0; | ||
exports.templateColocationPlugin = exports.hbsToJS = exports.tmpdir = exports.packageName = exports.babelFilter = exports.PackageCache = exports.Package = exports.getOrCreate = exports.unrelativize = exports.extensionsPattern = exports.explicitRelative = void 0; | ||
var paths_1 = require("./paths"); | ||
Object.defineProperty(exports, "explicitRelative", { enumerable: true, get: function () { return paths_1.explicitRelative; } }); | ||
Object.defineProperty(exports, "extensionsPattern", { enumerable: true, get: function () { return paths_1.extensionsPattern; } }); | ||
Object.defineProperty(exports, "unrelativize", { enumerable: true, get: function () { return paths_1.unrelativize; } }); | ||
var get_or_create_1 = require("./get-or-create"); | ||
@@ -22,0 +23,0 @@ Object.defineProperty(exports, "getOrCreate", { enumerable: true, get: function () { return get_or_create_1.getOrCreate; } }); |
@@ -0,2 +1,4 @@ | ||
import type Package from './package'; | ||
export declare function explicitRelative(fromDir: string, toFile: string): string; | ||
export declare function extensionsPattern(extensions: string[]): RegExp; | ||
export declare function unrelativize(pkg: Package, specifier: string, fromFile: string): string; |
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.extensionsPattern = exports.explicitRelative = void 0; | ||
exports.unrelativize = exports.extensionsPattern = exports.explicitRelative = void 0; | ||
const path_1 = require("path"); | ||
@@ -34,2 +34,13 @@ // by "explicit", I mean that we want "./local/thing" instead of "local/thing" | ||
exports.extensionsPattern = extensionsPattern; | ||
function unrelativize(pkg, specifier, fromFile) { | ||
if (pkg.packageJSON.exports) { | ||
throw new Error(`unsupported: engines cannot use package.json exports`); | ||
} | ||
let result = (0, path_1.resolve)((0, path_1.dirname)(fromFile), specifier).replace(pkg.root, pkg.name); | ||
if (path_1.sep !== '/') { | ||
result = result.split(path_1.sep).join('/'); | ||
} | ||
return result; | ||
} | ||
exports.unrelativize = unrelativize; | ||
//# sourceMappingURL=paths.js.map |
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
95794
1008