Skip to content

Commit 898848a

Browse files
committed
chore: patch jspm for trailing slash installs
1 parent c658b80 commit 898848a

File tree

2 files changed

+41
-1
lines changed

2 files changed

+41
-1
lines changed
Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
diff --git a/node_modules/@jspm/generator/dist/generator-c35f6b68.js b/node_modules/@jspm/generator/dist/generator-c35f6b68.js
2+
index 58dba40..c41f755 100644
3+
--- a/node_modules/@jspm/generator/dist/generator-c35f6b68.js
4+
+++ b/node_modules/@jspm/generator/dist/generator-c35f6b68.js
5+
@@ -3154,6 +3154,7 @@ provider) {
6+
// and there's a corresponding import/export map entry in that package,
7+
// then the resolution is standard and we can lock it:
8+
if (exportSubpath) {
9+
+
10+
// Package "imports" resolutions don't constrain versions.
11+
if (key[0] === '#') continue;
12+
// Otherwise we treat top-level package versions as a constraint.
13+
@@ -3174,6 +3175,9 @@ provider) {
14+
}
15+
if (installSubpath !== false) {
16+
setResolution(locks, parsedKey.pkgName, pkgUrl, null, installSubpath);
17+
+ if (key.endsWith('/')) {
18+
+ maps.imports[key] = map.imports[key]
19+
+ }
20+
continue;
21+
}
22+
}
23+
@@ -3690,7 +3694,7 @@ function _define_property$2(obj, key, value) {
24+
return obj;
25+
}
26+
function combineSubpaths(installSubpath, traceSubpath) {
27+
- if (traceSubpath.endsWith('/')) throw new Error('Trailing slash subpaths unsupported');
28+
+ if (traceSubpath.endsWith('/')) return traceSubpath
29+
return installSubpath === null || installSubpath === '.' || traceSubpath === '.' ? installSubpath || traceSubpath : `${installSubpath}${traceSubpath.slice(1)}`;
30+
}
31+
class TraceMap {
32+
@@ -3732,7 +3736,7 @@ class TraceMap {
33+
// very likely that the user has some CommonJS dependencies, but this is
34+
// something that the user has to explicitly enable:
35+
if (isBuiltinScheme(resolved)) return null;
36+
- if (resolved.endsWith('/')) throw new JspmError(`Trailing "/" installs not supported installing ${resolved} for ${parentUrl}`);
37+
+ if (resolved.endsWith('/')) return
38+
try {
39+
var entry = await this.resolver.analyze(resolved);
40+
} catch (e) {

web-dev-server.config.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,8 +26,8 @@ export default pfeDevServerConfig({
2626
},
2727
inputMap: {
2828
imports: {
29+
'@patternfly/icons/': './node_modules/@patternfly/icons/',
2930
'@patternfly/pfe-tools/environment.js': './_site/tools/environment.js',
30-
...await getPatternflyIconNodemodulesImports(import.meta.url),
3131
},
3232
},
3333
},

0 commit comments

Comments
 (0)