Skip to content

Commit

Permalink
handle npm latest tags (#142)
Browse files Browse the repository at this point in the history
  • Loading branch information
guybedford authored Jul 13, 2022
1 parent 4c71009 commit db526d5
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 1 deletion.
2 changes: 1 addition & 1 deletion src/providers/jspm.ts
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ export async function resolveLatestTarget (this: Resolver, target: LatestPackage
tags: Object.create(null)
};

if (range.isWildcard) {
if (range.isWildcard || range.isExact && range.version.tag === 'latest') {
let lookup = await (cache.latest || (cache.latest = lookupRange.call(this, registry, name, '', unstable, parentUrl)));
// Deno wat?
if (lookup instanceof Promise)
Expand Down
12 changes: 12 additions & 0 deletions test/api/npmdep.test.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
import { Generator } from '@jspm/generator';
import assert from 'assert';

const generator = new Generator({
mapUrl: import.meta.url,
defaultProvider: 'jspm',
env: ['production', 'browser']
});

await generator.install('@lit-async/ssr-client@1.0.0-rc.1/directives/server-until.js');
const json = generator.getMap();
assert.strictEqual(json.imports['@lit-async/ssr-client/directives/server-until.js'], 'https://ga.jspm.io/npm:@lit-async/ssr-client@1.0.0-rc.1/directives/server-until.js');

0 comments on commit db526d5

Please sign in to comment.