@embroider/shared-internals
Advanced tools
Comparing version 2.2.1-unstable.f4b7a14 to 2.2.1
{ | ||
"name": "@embroider/shared-internals", | ||
"version": "2.2.1-unstable.f4b7a14", | ||
"version": "2.2.1", | ||
"private": false, | ||
@@ -27,5 +27,2 @@ "description": "Utilities shared among the other embroider packages", | ||
], | ||
"scripts": { | ||
"test": "jest" | ||
}, | ||
"dependencies": { | ||
@@ -43,3 +40,2 @@ "babel-import-util": "^1.1.0", | ||
"broccoli-node-api": "^1.7.0", | ||
"@embroider/test-support": "workspace:*", | ||
"@types/babel__core": "^7.1.14", | ||
@@ -54,3 +50,4 @@ "@types/babel__traverse": "^7.18.5", | ||
"tmp": "^0.1.0", | ||
"typescript": "^4.9.0" | ||
"typescript": "^4.9.0", | ||
"@embroider/test-support": "0.36.0" | ||
}, | ||
@@ -62,3 +59,6 @@ "engines": { | ||
"extends": "../../package.json" | ||
}, | ||
"scripts": { | ||
"test": "jest" | ||
} | ||
} | ||
} |
@@ -40,2 +40,6 @@ "use strict"; | ||
exports.emberVirtualPackages.add('@ember/owner'); | ||
// these are not public API but they're included in ember-source, so for | ||
// correctness we still want to understand that they come from there. | ||
exports.emberVirtualPackages.add('@glimmer/validator'); | ||
exports.emberVirtualPackages.add('@glimmer/manager'); | ||
// These are the known names that people use to import template precomiplation | ||
@@ -42,0 +46,0 @@ // macros from. |
@@ -11,3 +11,3 @@ "use strict"; | ||
let optsSource = ''; | ||
if (options === null || options === void 0 ? void 0 : options.filename) { | ||
if (options?.filename) { | ||
let filename = options.filename; | ||
@@ -14,0 +14,0 @@ let { compatModuleNaming: renaming } = options; |
@@ -123,3 +123,2 @@ "use strict"; | ||
.map((path) => { | ||
var _a; | ||
// ember-cli gives a warning if the path specifies an invalid, malformed or missing addon. the logic for invalidating an addon is: | ||
@@ -135,3 +134,3 @@ // https://github.com/ember-cli/ember-cli/blob/627934f91b2aa0e19b041fdb1b547873c1855793/lib/models/package-info-cache/index.js#L427 | ||
pkg = this.packageCache.get((0, path_1.join)(this.root, path)); | ||
main = ((_a = pkg.packageJSON['ember-addon']) === null || _a === void 0 ? void 0 : _a.main) || pkg.packageJSON['main']; | ||
main = pkg.packageJSON['ember-addon']?.main || pkg.packageJSON['main']; | ||
} | ||
@@ -138,0 +137,0 @@ catch (err) { |
@@ -105,6 +105,17 @@ "use strict"; | ||
} | ||
// this directory is a bit special because RewrittenPackageCache needs to | ||
// exist before this dir has been produced. But the dir appears preemptively | ||
// in our index, and we don't want that to blow up during the realpath | ||
// below. | ||
(0, fs_extra_1.ensureDirSync)((0, path_1.resolve)(addonsDir, '..', 'rewritten-app')); | ||
let { packages, extraResolutions } = (0, fs_extra_1.readJSONSync)(indexFile); | ||
return { | ||
oldToNew: new Map(Object.entries(packages).map(([oldRoot, newRoot]) => [(0, path_1.resolve)(addonsDir, oldRoot), (0, path_1.resolve)(addonsDir, newRoot)])), | ||
newToOld: new Map(Object.entries(packages).map(([oldRoot, newRoot]) => [(0, path_1.resolve)(addonsDir, newRoot), (0, path_1.resolve)(addonsDir, oldRoot)])), | ||
oldToNew: new Map(Object.entries(packages).map(([oldRoot, newRoot]) => [ | ||
(0, fs_extra_1.realpathSync)((0, path_1.resolve)(addonsDir, oldRoot)), | ||
(0, fs_extra_1.realpathSync)((0, path_1.resolve)(addonsDir, newRoot)), | ||
])), | ||
newToOld: new Map(Object.entries(packages).map(([oldRoot, newRoot]) => [ | ||
(0, fs_extra_1.realpathSync)((0, path_1.resolve)(addonsDir, newRoot)), | ||
(0, fs_extra_1.realpathSync)((0, path_1.resolve)(addonsDir, oldRoot)), | ||
])), | ||
extraResolutions: new Map(Object.entries(extraResolutions).map(([fromRoot, toRoots]) => [ | ||
@@ -111,0 +122,0 @@ (0, path_1.resolve)(addonsDir, fromRoot), |
@@ -18,3 +18,2 @@ "use strict"; | ||
enter(path, state) { | ||
var _a; | ||
state.adder = new babel_import_util_1.ImportUtil(t, path); | ||
@@ -28,3 +27,3 @@ let filename = path.hub.file.opts.filename; | ||
} | ||
let extensions = (_a = state.opts.templateExtensions) !== null && _a !== void 0 ? _a : ['.hbs']; | ||
let extensions = state.opts.templateExtensions ?? ['.hbs']; | ||
for (let ext of extensions) { | ||
@@ -47,3 +46,2 @@ let hbsFilename = filename.replace(/\.\w{1,3}$/, '') + ext; | ||
ExportDefaultDeclaration(path, state) { | ||
var _a; | ||
let template = getTemplate(path, state); | ||
@@ -61,3 +59,3 @@ if (!template) { | ||
template, | ||
t.classExpression(null, declaration.superClass, declaration.body, (_a = declaration.decorators) !== null && _a !== void 0 ? _a : []), | ||
t.classExpression(null, declaration.superClass, declaration.body, declaration.decorators ?? []), | ||
]); | ||
@@ -64,0 +62,0 @@ } |
@@ -10,3 +10,2 @@ "use strict"; | ||
function locateEmbroiderWorkingDir(appRoot) { | ||
var _a; | ||
if (cache.has(appRoot)) { | ||
@@ -27,3 +26,3 @@ return cache.get(appRoot); | ||
let pkg = (0, fs_extra_1.readJSONSync)((0, path_1.resolve)(appRoot, '..', '..', 'package.json')); | ||
if ((_a = pkg.keywords) === null || _a === void 0 ? void 0 : _a.includes('ember-addon')) { | ||
if (pkg.keywords?.includes('ember-addon')) { | ||
let path = (0, path_1.resolve)(appRoot, '..', '..', 'node_modules', '.embroider'); | ||
@@ -30,0 +29,0 @@ cache.set(appRoot, path); |
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
134032
56
1370
1