Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@embroider/shared-internals

Package Overview
Dependencies
Maintainers
9
Versions
403
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@embroider/shared-internals - npm Package Compare versions

Comparing version 2.6.4-unstable.a691d39 to 2.6.4-unstable.aa52b09

5

package.json
{
"name": "@embroider/shared-internals",
"version": "2.6.4-unstable.a691d39",
"version": "2.6.4-unstable.aa52b09",
"private": false,

@@ -16,4 +16,3 @@ "description": "Utilities shared among the other embroider packages",

},
"./src/babel-plugin-cache-busting.js": "./src/babel-plugin-cache-busting.js",
"./src/template-colocation-plugin": "./src/template-colocation-plugin.js"
"./src/*": "./src/*.js"
},

@@ -20,0 +19,0 @@ "license": "MIT",

4

src/colocation.d.ts
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 needsSyntheticComponentJS(requestedSpecifier: string, foundFile: string): string | null;
export declare function isInComponents(url: string, packageCache: Pick<PackageCache, 'ownerOfFile'>): boolean;
export declare function templateOnlyComponentSource(): string;

@@ -20,3 +20,3 @@ "use strict";

}
function needsSyntheticComponentJS(requestedSpecifier, foundFile, packageCache) {
function needsSyntheticComponentJS(requestedSpecifier, foundFile) {
requestedSpecifier = (0, paths_1.cleanUrl)(requestedSpecifier);

@@ -26,4 +26,3 @@ foundFile = (0, paths_1.cleanUrl)(foundFile);

!foundFile.split(path_1.sep).join('/').endsWith('/template.hbs') &&
!correspondingJSExists(foundFile) &&
isInComponents(foundFile, packageCache)) {
!correspondingJSExists(foundFile)) {
return foundFile.slice(0, -3) + 'js';

@@ -39,4 +38,5 @@ }

}
function isInComponents(id, packageCache) {
function isInComponents(url, packageCache) {
var _a;
const id = (0, paths_1.cleanUrl)(url);
const pkg = packageCache.ownerOfFile(id);

@@ -43,0 +43,0 @@ if (!(pkg === null || pkg === void 0 ? void 0 : pkg.isV2App())) {

@@ -8,3 +8,2 @@ export { AppMeta, AddonMeta, PackageInfo } from './metadata';

export { RewrittenPackageCache } from './rewritten-package-cache';
export { default as babelFilter } from './babel-filter';
export { default as packageName } from './package-name';

@@ -11,0 +10,0 @@ export { default as tmpdir } from './tmpdir';

@@ -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.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");

@@ -37,4 +37,2 @@ Object.defineProperty(exports, "explicitRelative", { enumerable: true, get: function () { return paths_1.explicitRelative; } });

Object.defineProperty(exports, "RewrittenPackageCache", { enumerable: true, get: function () { return rewritten_package_cache_1.RewrittenPackageCache; } });
var babel_filter_1 = require("./babel-filter");
Object.defineProperty(exports, "babelFilter", { enumerable: true, get: function () { return __importDefault(babel_filter_1).default; } });
var package_name_1 = require("./package-name");

@@ -41,0 +39,0 @@ Object.defineProperty(exports, "packageName", { enumerable: true, get: function () { return __importDefault(package_name_1).default; } });

@@ -8,8 +8,2 @@ type Filename = string;

assets: Filename[];
babel: {
filename: string;
isParallelSafe: boolean;
majorVersion: 7;
fileFilter: string;
};
'root-url': string;

@@ -16,0 +10,0 @@ version: 2;

@@ -17,2 +17,30 @@ "use strict";

const flatMap_1 = __importDefault(require("lodash/flatMap"));
// This is controllable via env var because there are many different contexts
// (babel/rollup/vite/webpack/handlebars plugins) that can all depend on
// `@embroider/shared-internals` to help understand the structure of packages,
// and we want one clear way to signal to all of those whether this feature is
// configured.
//
// The initial motivating use case for this is that new-enough ember-source can
// function as a v2 addon despite not declaring itself to be a v2 addon, because
// that would be potentially-breaking for people who still consume it via AMD
// and/or depend on the specific timng of the classic vendor.js file. We don't
// want to break people but we also want people on the bleeding edge to be able
// to take advantage of the capability.
const forcedV2Packages = (() => {
let cached;
return () => {
if (!cached) {
if (typeof process !== undefined &&
typeof process.env !== undefined &&
process.env.EMBROIDER_FORCED_V2_PACKAGES) {
cached = process.env.EMBROIDER_FORCED_V2_PACKAGES.split(',');
}
else {
cached = [];
}
}
return cached;
};
})();
class Package {

@@ -46,2 +74,20 @@ constructor(root, packageCache, isApp) {

}
if (forcedV2Packages().includes(json.name)) {
let defaults;
if (this.isApp) {
defaults = {
version: 2,
type: 'app',
assets: [],
'root-url': '/',
};
}
else {
defaults = {
version: 2,
type: 'addon',
};
}
json['ember-addon'] = Object.assign(defaults, json['ember-addon']);
}
return json;

@@ -48,0 +94,0 @@ }

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

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc