mirror of
https://github.com/pulsar-edit/pulsar.git
synced 2024-09-11 19:17:09 +03:00
Removed private isDeprecated API
This commit is contained in:
parent
f6f4069523
commit
03d748d088
@ -180,29 +180,6 @@ describe('PackageManager', () => {
|
||||
expect(console.warn.argsForCall[0][0]).toContain('Could not resolve');
|
||||
});
|
||||
|
||||
describe('when the package is deprecated', () => {
|
||||
it('returns null', () => {
|
||||
spyOn(console, 'warn');
|
||||
expect(
|
||||
atom.packages.loadPackage(
|
||||
path.join(__dirname, 'fixtures', 'packages', 'wordcount')
|
||||
)
|
||||
).toBeNull();
|
||||
expect(atom.packages.isDeprecatedPackage('wordcount', '2.1.9')).toBe(
|
||||
true
|
||||
);
|
||||
expect(atom.packages.isDeprecatedPackage('wordcount', '2.2.0')).toBe(
|
||||
true
|
||||
);
|
||||
expect(atom.packages.isDeprecatedPackage('wordcount', '2.2.1')).toBe(
|
||||
false
|
||||
);
|
||||
expect(
|
||||
atom.packages.getDeprecatedPackageMetadata('wordcount').version
|
||||
).toBe('<=2.2.0');
|
||||
});
|
||||
});
|
||||
|
||||
it('invokes ::onDidLoadPackage listeners with the loaded package', () => {
|
||||
let loadedPackage = null;
|
||||
|
||||
|
@ -52,8 +52,6 @@ module.exports = class PackageManager {
|
||||
packageJSON.packageDependencies != null
|
||||
? packageJSON.packageDependencies
|
||||
: {};
|
||||
this.deprecatedPackages = packageJSON._deprecatedPackages || {};
|
||||
this.deprecatedPackageRanges = {};
|
||||
this.initialPackagesLoaded = false;
|
||||
this.initialPackagesActivated = false;
|
||||
this.preloadedPackages = {};
|
||||
@ -256,29 +254,6 @@ module.exports = class PackageManager {
|
||||
return this.getPackageDependencies().hasOwnProperty(name);
|
||||
}
|
||||
|
||||
isDeprecatedPackage(name, version) {
|
||||
const metadata = this.deprecatedPackages[name];
|
||||
if (!metadata) return false;
|
||||
if (!metadata.version) return true;
|
||||
|
||||
let range = this.deprecatedPackageRanges[metadata.version];
|
||||
if (!range) {
|
||||
try {
|
||||
range = new ModuleCache.Range(metadata.version);
|
||||
} catch (error) {
|
||||
range = NullVersionRange;
|
||||
}
|
||||
this.deprecatedPackageRanges[metadata.version] = range;
|
||||
}
|
||||
return range.test(version);
|
||||
}
|
||||
|
||||
getDeprecatedPackageMetadata(name) {
|
||||
const metadata = this.deprecatedPackages[name];
|
||||
if (metadata) Object.freeze(metadata);
|
||||
return metadata;
|
||||
}
|
||||
|
||||
/*
|
||||
Section: Enabling and disabling packages
|
||||
*/
|
||||
@ -700,18 +675,6 @@ module.exports = class PackageManager {
|
||||
return null;
|
||||
}
|
||||
|
||||
if (
|
||||
!availablePackage.isBundled &&
|
||||
this.isDeprecatedPackage(metadata.name, metadata.version)
|
||||
) {
|
||||
console.warn(
|
||||
`Could not load ${metadata.name}@${
|
||||
metadata.version
|
||||
} because it uses deprecated APIs that have been removed.`
|
||||
);
|
||||
return null;
|
||||
}
|
||||
|
||||
const options = {
|
||||
path: availablePackage.path,
|
||||
name: availablePackage.name,
|
||||
|
Loading…
Reference in New Issue
Block a user