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

@embroider/shared-internals

Package Overview
Dependencies
Maintainers
7
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 1.8.3 to 2.0.0-unstable.21eae41

3

package.json
{
"name": "@embroider/shared-internals",
"version": "1.8.3",
"version": "2.0.0-unstable.21eae41",
"private": false,

@@ -28,3 +28,2 @@ "description": "Utilities shared among the other embroider packages",

"scripts": {
"prepare": "tsc",
"test": "jest"

@@ -31,0 +30,0 @@ },

@@ -19,6 +19,2 @@ "use strict";

// earlier plugins should take care of them.
//
// In embroider builds using ember-source >= 3.28, you won't see *any* of these
// in stage3 because ember-source uses the standard rename-modules feature to
// map them into real modules within ember-source.
exports.emberVirtualPackages = new Set(mappings_json_1.default.map((m) => m.module));

@@ -25,0 +21,0 @@ // these are *real* packages that every ember addon is allowed to resolve *as if

@@ -1,1 +0,8 @@

export declare function hbsToJS(hbsContents: string): string;
export interface Options {
filename?: string;
compatModuleNaming?: {
rootDir: string;
modulePrefix: string;
};
}
export declare function hbsToJS(hbsContents: string, options?: Options): string;

@@ -8,6 +8,24 @@ "use strict";

const js_string_escape_1 = __importDefault(require("js-string-escape"));
function hbsToJS(hbsContents) {
return [`import { hbs } from 'ember-cli-htmlbars';`, `export default hbs("${(0, js_string_escape_1.default)(hbsContents)}")`].join('\n');
const path_1 = require("path");
function hbsToJS(hbsContents, options) {
let optsSource = '';
if (options === null || options === void 0 ? void 0 : options.filename) {
let filename = options.filename;
let { compatModuleNaming: renaming } = options;
if (renaming) {
if (filename.startsWith(renaming.rootDir)) {
filename = renaming.modulePrefix + filename.slice(renaming.rootDir.length);
}
if (path_1.sep !== '/') {
filename = filename.replace(/\\/g, '/');
}
}
optsSource = `,{ moduleName: "${(0, js_string_escape_1.default)(filename)}" }`;
}
return [
`import { precompileTemplate } from "@ember/template-compilation";`,
`export default precompileTemplate("${(0, js_string_escape_1.default)(hbsContents)}"${optsSource})`,
].join('\n');
}
exports.hbsToJS = hbsToJS;
//# sourceMappingURL=hbs-to-js.js.map
"use strict";
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
if (k2 === undefined) k2 = k;
var desc = Object.getOwnPropertyDescriptor(m, k);
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
desc = { enumerable: true, get: function() { return m[k]; } };
}
Object.defineProperty(o, k2, desc);
Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
}) : (function(o, m, k, k2) {

@@ -10,0 +6,0 @@ if (k2 === undefined) k2 = k;

@@ -14,3 +14,2 @@ declare type Filename = string;

};
'resolvable-extensions': string[];
'root-url': string;

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

@@ -77,3 +77,7 @@ "use strict";

static shared(identifier, appRoot) {
return (0, get_or_create_1.getOrCreate)(shared, identifier, () => new PackageCache(appRoot));
let pk = (0, get_or_create_1.getOrCreate)(shared, identifier + appRoot, () => new PackageCache(appRoot));
if (pk.appRoot !== appRoot) {
throw new Error(`bug: PackageCache appRoot disagreement ${appRoot}!=${pk.appRoot}`);
}
return pk;
}

@@ -80,0 +84,0 @@ }

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

isLazyEngine() {
return this.isEngine() && (0, get_1.default)(this.packageJSON, 'ember-addon.lazy-engine');
return this.isEngine() && Boolean((0, get_1.default)(this.packageJSON, 'ember-addon.lazy-engine'));
}

@@ -67,0 +67,0 @@ isV2Ember() {

@@ -23,11 +23,5 @@ "use strict";

}
// windows supports both "./" and ".\", but webpack 5 insists on "./"
if (result.startsWith('.\\')) {
return './' + result.slice(2);
}
// windows supports both "../" and "..\", but webpack 5 insists on "../"
if (result.startsWith('..\\')) {
return '../' + result.slice(3);
}
return result;
// windows supports both kinds of path separators but webpack wants relative
// paths to use forward slashes.
return result.replace(/\\/g, '/');
}

@@ -34,0 +28,0 @@ exports.explicitRelative = explicitRelative;

@@ -8,2 +8,3 @@ import type { NodePath } from '@babel/traverse';

appRoot: string;
templateExtensions?: string[];
}

@@ -10,0 +11,0 @@ interface State {

@@ -16,2 +16,3 @@ "use strict";

enter(path, state) {
var _a;
state.adder = new babel_import_util_1.ImportUtil(t, path);

@@ -25,5 +26,8 @@ let filename = path.hub.file.opts.filename;

}
let hbsFilename = filename.replace(/\.\w{1,3}$/, '') + '.hbs';
if (hbsFilename !== filename && (0, fs_1.existsSync)(hbsFilename)) {
state.colocatedTemplate = hbsFilename;
let extensions = (_a = state.opts.templateExtensions) !== null && _a !== void 0 ? _a : ['.hbs'];
for (let ext of extensions) {
let hbsFilename = filename.replace(/\.\w{1,3}$/, '') + ext;
if (hbsFilename !== filename && (0, fs_1.existsSync)(hbsFilename)) {
state.colocatedTemplate = hbsFilename;
}
}

@@ -30,0 +34,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

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