jspm 2.0.0-beta.6 → 3.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +1 -1
- package/README.md +20 -26
- package/dist/cli.js +1391 -0
- package/jspm.js +10 -0
- package/package.json +23 -50
- package/CHANGELOG.md +0 -21
- package/bin/jspm +0 -46
- package/lib/api.d.ts +0 -10
- package/lib/api.js +0 -71
- package/lib/api.js.map +0 -1
- package/lib/build/index.d.ts +0 -24
- package/lib/build/index.js +0 -163
- package/lib/build/index.js.map +0 -1
- package/lib/cli.d.ts +0 -1
- package/lib/cli.js +0 -701
- package/lib/cli.js.map +0 -1
- package/lib/compile/cjs-convert.d.ts +0 -7
- package/lib/compile/cjs-convert.js +0 -375
- package/lib/compile/cjs-convert.js.map +0 -1
- package/lib/compile/dew-resolve.d.ts +0 -9
- package/lib/compile/dew-resolve.js +0 -117
- package/lib/compile/dew-resolve.js.map +0 -1
- package/lib/compile/dew-worker.d.ts +0 -1
- package/lib/compile/dew-worker.js +0 -302
- package/lib/compile/dew-worker.js.map +0 -1
- package/lib/config/config-file.d.ts +0 -67
- package/lib/config/config-file.js +0 -591
- package/lib/config/config-file.js.map +0 -1
- package/lib/config/global-config-file.d.ts +0 -8
- package/lib/config/global-config-file.js +0 -89
- package/lib/config/global-config-file.js.map +0 -1
- package/lib/config/index.d.ts +0 -15
- package/lib/config/index.js +0 -59
- package/lib/config/index.js.map +0 -1
- package/lib/config/jspm-file.d.ts +0 -8
- package/lib/config/jspm-file.js +0 -84
- package/lib/config/jspm-file.js.map +0 -1
- package/lib/config/package-json-file.d.ts +0 -49
- package/lib/config/package-json-file.js +0 -332
- package/lib/config/package-json-file.js.map +0 -1
- package/lib/exec/index.d.ts +0 -12
- package/lib/exec/index.js +0 -117
- package/lib/exec/index.js.map +0 -1
- package/lib/install/bin.d.ts +0 -2
- package/lib/install/bin.js +0 -86
- package/lib/install/bin.js.map +0 -1
- package/lib/install/binary-build.d.ts +0 -2
- package/lib/install/binary-build.js +0 -89
- package/lib/install/binary-build.js.map +0 -1
- package/lib/install/fetch.d.ts +0 -53
- package/lib/install/fetch.js +0 -270
- package/lib/install/fetch.js.map +0 -1
- package/lib/install/index.d.ts +0 -66
- package/lib/install/index.js +0 -1164
- package/lib/install/index.js.map +0 -1
- package/lib/install/package.d.ts +0 -142
- package/lib/install/package.js +0 -625
- package/lib/install/package.js.map +0 -1
- package/lib/install/publish.d.ts +0 -14
- package/lib/install/publish.js +0 -186
- package/lib/install/publish.js.map +0 -1
- package/lib/install/registry-manager.d.ts +0 -134
- package/lib/install/registry-manager.js +0 -521
- package/lib/install/registry-manager.js.map +0 -1
- package/lib/install/source.d.ts +0 -10
- package/lib/install/source.js +0 -378
- package/lib/install/source.js.map +0 -1
- package/lib/map/common.d.ts +0 -13
- package/lib/map/common.js +0 -180
- package/lib/map/common.js.map +0 -1
- package/lib/map/esm-lexer.d.ts +0 -17
- package/lib/map/esm-lexer.js +0 -506
- package/lib/map/esm-lexer.js.map +0 -1
- package/lib/map/index.d.ts +0 -15
- package/lib/map/index.js +0 -356
- package/lib/map/index.js.map +0 -1
- package/lib/map/utils.d.ts +0 -10
- package/lib/map/utils.js +0 -181
- package/lib/map/utils.js.map +0 -1
- package/lib/overrides.d.ts +0 -3
- package/lib/overrides.js +0 -29
- package/lib/overrides.js.map +0 -1
- package/lib/project.d.ts +0 -71
- package/lib/project.js +0 -434
- package/lib/project.js.map +0 -1
- package/lib/utils/cache.d.ts +0 -11
- package/lib/utils/cache.js +0 -121
- package/lib/utils/cache.js.map +0 -1
- package/lib/utils/common.d.ts +0 -55
- package/lib/utils/common.js +0 -267
- package/lib/utils/common.js.map +0 -1
- package/lib/utils/opts.d.ts +0 -6
- package/lib/utils/opts.js +0 -200
- package/lib/utils/opts.js.map +0 -1
- package/lib/utils/run-cmd.d.ts +0 -4
- package/lib/utils/run-cmd.js +0 -39
- package/lib/utils/run-cmd.js.map +0 -1
- package/lib/utils/ui.d.ts +0 -38
- package/lib/utils/ui.js +0 -496
- package/lib/utils/ui.js.map +0 -1
package/lib/install/source.js
DELETED
|
@@ -1,378 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
const url_1 = require("url");
|
|
4
|
-
const crypto = require("crypto");
|
|
5
|
-
const common_1 = require("../utils/common");
|
|
6
|
-
const zlib = require("zlib");
|
|
7
|
-
const peek = require("buffer-peek-stream");
|
|
8
|
-
const fs = require("graceful-fs");
|
|
9
|
-
const tar = require("tar-fs");
|
|
10
|
-
const execGit = require("@jspm/github/exec-git");
|
|
11
|
-
const rimraf = require("rimraf");
|
|
12
|
-
const path = require("path");
|
|
13
|
-
const gitProtocol = {
|
|
14
|
-
resolve: gitResolve,
|
|
15
|
-
download: gitCheckout
|
|
16
|
-
};
|
|
17
|
-
exports.sourceProtocols = {
|
|
18
|
-
'git': gitProtocol,
|
|
19
|
-
'git+file': gitProtocol,
|
|
20
|
-
'git+ssh': gitProtocol,
|
|
21
|
-
'git+http': gitProtocol,
|
|
22
|
-
'git+https': gitProtocol,
|
|
23
|
-
'https': {
|
|
24
|
-
download: fetchRemoteTarball
|
|
25
|
-
},
|
|
26
|
-
'http': {
|
|
27
|
-
download: fetchRemoteTarball
|
|
28
|
-
},
|
|
29
|
-
'file': {
|
|
30
|
-
download: extractLocalTarball
|
|
31
|
-
},
|
|
32
|
-
'link': {}
|
|
33
|
-
};
|
|
34
|
-
function getProtocolHandler(source) {
|
|
35
|
-
const protocolIndex = source.indexOf(':');
|
|
36
|
-
const protocol = source.substr(0, protocolIndex);
|
|
37
|
-
const protocolHandler = exports.sourceProtocols[protocol];
|
|
38
|
-
if (!protocolHandler)
|
|
39
|
-
throw new common_1.JspmUserError(`No handler available for source protocol ${common_1.bold(protocol)} processing ${source}.`);
|
|
40
|
-
return protocolHandler;
|
|
41
|
-
}
|
|
42
|
-
async function resolveSource(log, fetch, source, timeout) {
|
|
43
|
-
const protocolHandler = getProtocolHandler(source);
|
|
44
|
-
if (!protocolHandler.resolve)
|
|
45
|
-
return source;
|
|
46
|
-
return protocolHandler.resolve(log, fetch, source, timeout);
|
|
47
|
-
}
|
|
48
|
-
exports.resolveSource = resolveSource;
|
|
49
|
-
function downloadSource(log, fetch, source, outDir, timeout) {
|
|
50
|
-
const protocolHandler = getProtocolHandler(source);
|
|
51
|
-
if (!protocolHandler.download)
|
|
52
|
-
throw new common_1.JspmError(`Invalid attempt to download source ${source}`);
|
|
53
|
-
return protocolHandler.download(log, fetch, source, outDir, timeout);
|
|
54
|
-
}
|
|
55
|
-
exports.downloadSource = downloadSource;
|
|
56
|
-
async function gitResolve(log, fetch, source, timeout) {
|
|
57
|
-
let url = source.startsWith('git:') ? source : source.substr(4);
|
|
58
|
-
const gitRefIndex = url.lastIndexOf('#');
|
|
59
|
-
let gitRef = '';
|
|
60
|
-
if (gitRefIndex !== -1) {
|
|
61
|
-
gitRef = url.substr(gitRefIndex + 1);
|
|
62
|
-
url = url.substr(0, gitRefIndex);
|
|
63
|
-
}
|
|
64
|
-
const logEnd = log.taskStart(`Resolving git source ${common_1.highlight(source)}`);
|
|
65
|
-
try {
|
|
66
|
-
const execOpts = { timeout, killSignal: 'SIGKILL', maxBuffer: 100 * 1024 * 1024 };
|
|
67
|
-
let credentials = await fetch.getCredentials(url);
|
|
68
|
-
if (credentials.basicAuth) {
|
|
69
|
-
let urlObj = new url_1.URL(url);
|
|
70
|
-
({ username: urlObj.username, password: urlObj.password } = credentials.basicAuth);
|
|
71
|
-
url = urlObj.href;
|
|
72
|
-
}
|
|
73
|
-
try {
|
|
74
|
-
log.debug(`ls-remote ${url}${credentials.basicAuth ? ' (with basic auth)' : ''}`);
|
|
75
|
-
var stdout = await execGit(`ls-remote ${url} HEAD refs/tags/* refs/heads/*`, execOpts);
|
|
76
|
-
}
|
|
77
|
-
catch (err) {
|
|
78
|
-
const str = err.toString();
|
|
79
|
-
// not found
|
|
80
|
-
if (str.indexOf('not found') !== -1)
|
|
81
|
-
throw new common_1.JspmUserError(`Git source ${common_1.highlight(source)} not found.`);
|
|
82
|
-
// invalid credentials
|
|
83
|
-
if (str.indexOf('Invalid username or password') !== -1 || str.indexOf('fatal: could not read Username') !== -1)
|
|
84
|
-
throw new common_1.JspmUserError(`git authentication failed resolving ${common_1.highlight(source)}.
|
|
85
|
-
Make sure that git is locally configured with the correct permissions.`);
|
|
86
|
-
throw err;
|
|
87
|
-
}
|
|
88
|
-
let refs = stdout.split('\n');
|
|
89
|
-
let hashMatch;
|
|
90
|
-
for (let ref of refs) {
|
|
91
|
-
if (!ref)
|
|
92
|
-
continue;
|
|
93
|
-
let hash = ref.substr(0, ref.indexOf('\t'));
|
|
94
|
-
let refName = ref.substr(hash.length + 1);
|
|
95
|
-
if (!gitRef && refName === 'HEAD') {
|
|
96
|
-
hashMatch = hash;
|
|
97
|
-
break;
|
|
98
|
-
}
|
|
99
|
-
else if (refName.substr(0, 11) === 'refs/heads/') {
|
|
100
|
-
if (gitRef === refName.substr(11)) {
|
|
101
|
-
hashMatch = hash;
|
|
102
|
-
break;
|
|
103
|
-
}
|
|
104
|
-
}
|
|
105
|
-
else if (refName.substr(0, 10) === 'refs/tags/') {
|
|
106
|
-
if (refName.substr(refName.length - 3, 3) === '^{}') {
|
|
107
|
-
if (gitRef === refName.substr(10, refName.length - 13)) {
|
|
108
|
-
hashMatch = hash;
|
|
109
|
-
break;
|
|
110
|
-
}
|
|
111
|
-
}
|
|
112
|
-
else if (gitRef === refName.substr(10)) {
|
|
113
|
-
hashMatch = hash;
|
|
114
|
-
break;
|
|
115
|
-
}
|
|
116
|
-
}
|
|
117
|
-
}
|
|
118
|
-
if (!hashMatch)
|
|
119
|
-
throw new common_1.JspmUserError(`Unable to resolve the ${common_1.highlight(gitRef || 'head')} git reference for ${source}.`);
|
|
120
|
-
url += '#' + hashMatch;
|
|
121
|
-
if (!source.startsWith('git:'))
|
|
122
|
-
return 'git+' + url;
|
|
123
|
-
else
|
|
124
|
-
return url;
|
|
125
|
-
}
|
|
126
|
-
finally {
|
|
127
|
-
logEnd();
|
|
128
|
-
}
|
|
129
|
-
}
|
|
130
|
-
const gitRefRegEx = /^[a-f0-9]{6,}$/;
|
|
131
|
-
async function gitCheckout(log, _fetch, source, outDir, timeout) {
|
|
132
|
-
const execOpts = {
|
|
133
|
-
cwd: outDir,
|
|
134
|
-
timeout,
|
|
135
|
-
killSignal: 'SIGKILL',
|
|
136
|
-
maxBuffer: 100 * 1024 * 1024
|
|
137
|
-
};
|
|
138
|
-
let gitSource = source.startsWith('git:') ? source : source.substr(4);
|
|
139
|
-
let gitRefIndex = gitSource.lastIndexOf('#');
|
|
140
|
-
if (gitRefIndex === -1)
|
|
141
|
-
throw new common_1.JspmUserError(`Invalid source ${source}. Git sources must have an exact trailing # ref.`);
|
|
142
|
-
let gitRef = gitSource.substr(gitRefIndex + 1);
|
|
143
|
-
gitSource = gitSource.substr(0, gitRefIndex);
|
|
144
|
-
if (!gitRef.match(gitRefRegEx))
|
|
145
|
-
throw new common_1.JspmUserError(`Invalid source ${source}. Git source reference ${gitRef} must be a hash reference.`);
|
|
146
|
-
const local = source.startsWith('file:') ? '-l ' : '';
|
|
147
|
-
// this will work for tags and branches, but we want to encourage commit references for uniqueness so dont want to reward this use case unfortunately
|
|
148
|
-
// await execGit(`clone ${local}--depth=1 ${source.replace(/(['"()])/g, '\\\$1')} --branch ${ref.replace(/(['"()])/g, '\\\$1')} ${outDir}`, execOpts);
|
|
149
|
-
// TODO: better sanitize against source injections here
|
|
150
|
-
// do a full clone for the commit reference case
|
|
151
|
-
// credentials used by git will be standard git credential manager which should be relied on
|
|
152
|
-
const logEnd = log.taskStart('Cloning ' + common_1.highlight(source));
|
|
153
|
-
try {
|
|
154
|
-
await execGit(`clone ${gitRef ? '-n ' : ''}${local}${gitSource.replace(/(['"()])/g, '\\\$1')} ${outDir}`, execOpts);
|
|
155
|
-
if (gitRef)
|
|
156
|
-
await execGit(`checkout ${gitRef.replace(/(['"()])/g, '\\\$1')}`, execOpts);
|
|
157
|
-
}
|
|
158
|
-
catch (err) {
|
|
159
|
-
if (err.toString().indexOf('Repository not found') !== -1)
|
|
160
|
-
throw new common_1.JspmUserError(`Unable to find repo ${common_1.highlight(source)}. It may not exist, or authorization may be required.`);
|
|
161
|
-
throw err;
|
|
162
|
-
}
|
|
163
|
-
finally {
|
|
164
|
-
logEnd();
|
|
165
|
-
}
|
|
166
|
-
// once clone is successful, then we can remove the git directory
|
|
167
|
-
await new Promise((resolve, reject) => rimraf(path.join(outDir, '.git'), err => err ? reject(err) : resolve()));
|
|
168
|
-
}
|
|
169
|
-
async function fetchRemoteTarball(log, fetch, source, outDir) {
|
|
170
|
-
const { url, hashType, hash } = readSource(log, source);
|
|
171
|
-
const fetchOptions = {
|
|
172
|
-
headers: {
|
|
173
|
-
accept: 'application/octet-stream'
|
|
174
|
-
}
|
|
175
|
-
};
|
|
176
|
-
const href = url.href;
|
|
177
|
-
const logEnd = log.taskStart('Fetching ' + common_1.highlight(href));
|
|
178
|
-
try {
|
|
179
|
-
var res = await fetch.fetch(href, fetchOptions);
|
|
180
|
-
}
|
|
181
|
-
catch (err) {
|
|
182
|
-
switch (err.code) {
|
|
183
|
-
case 'ENOTFOUND':
|
|
184
|
-
if (err.toString().indexOf('getaddrinfo') === -1)
|
|
185
|
-
break;
|
|
186
|
-
case 'ECONNRESET':
|
|
187
|
-
case 'ETIMEDOUT':
|
|
188
|
-
case 'ESOCKETTIMEDOUT':
|
|
189
|
-
err.retriable = true;
|
|
190
|
-
err.hideStack = true;
|
|
191
|
-
}
|
|
192
|
-
throw err;
|
|
193
|
-
}
|
|
194
|
-
finally {
|
|
195
|
-
logEnd();
|
|
196
|
-
}
|
|
197
|
-
if (res.status !== 200)
|
|
198
|
-
throw new Error(`Bad download response code ${res.status} for ${source}`);
|
|
199
|
-
let validationPromise;
|
|
200
|
-
if (!hashType) {
|
|
201
|
-
validationPromise = Promise.resolve();
|
|
202
|
-
}
|
|
203
|
-
else {
|
|
204
|
-
const verifyHash = crypto.createHash(hashType);
|
|
205
|
-
// Validate downloaded hash
|
|
206
|
-
validationPromise = new Promise((resolve, reject) => {
|
|
207
|
-
res.body.pipe(verifyHash)
|
|
208
|
-
.pause()
|
|
209
|
-
.on('finish', () => {
|
|
210
|
-
let computedHash = verifyHash.read();
|
|
211
|
-
if (!computedHash.equals(hash)) {
|
|
212
|
-
let err = new Error(`Hash integrity compromised downloading ${href}.`);
|
|
213
|
-
err.hideStack = true;
|
|
214
|
-
reject(err);
|
|
215
|
-
}
|
|
216
|
-
resolve();
|
|
217
|
-
})
|
|
218
|
-
.on('error', reject);
|
|
219
|
-
});
|
|
220
|
-
}
|
|
221
|
-
let stream = await new Promise((resolve, reject) => {
|
|
222
|
-
// pipe through gunzip if a gzipped stream
|
|
223
|
-
peek(res.body, 3, (err, bytes, stream) => {
|
|
224
|
-
if (err)
|
|
225
|
-
reject(err);
|
|
226
|
-
else if (bytes[0] === 0x1f && bytes[1] === 0x8b && bytes[2] === 0x08)
|
|
227
|
-
resolve(stream.pipe(zlib.createGunzip()).pause());
|
|
228
|
-
else
|
|
229
|
-
resolve(stream.pause());
|
|
230
|
-
});
|
|
231
|
-
});
|
|
232
|
-
await Promise.all([
|
|
233
|
-
validationPromise,
|
|
234
|
-
// Unpack contents as a tar archive and save to targetDir
|
|
235
|
-
new Promise((resolve, reject) => {
|
|
236
|
-
stream.pipe(tar.extract(outDir, {
|
|
237
|
-
// all dirs and files should be readable and writeable
|
|
238
|
-
dmode: 0o555,
|
|
239
|
-
fmode: 0o666,
|
|
240
|
-
strip: 1,
|
|
241
|
-
filter: function (_, header) {
|
|
242
|
-
return header.type !== 'file' && header.type !== 'directory';
|
|
243
|
-
}
|
|
244
|
-
}))
|
|
245
|
-
.on('finish', resolve)
|
|
246
|
-
.on('error', reject);
|
|
247
|
-
})
|
|
248
|
-
]);
|
|
249
|
-
}
|
|
250
|
-
async function extractLocalTarball(log, _fetch, source, outDir) {
|
|
251
|
-
const { url, hashType, hash } = readSource(log, source);
|
|
252
|
-
let stream = fs.createReadStream(url);
|
|
253
|
-
let validationPromise;
|
|
254
|
-
if (!hashType) {
|
|
255
|
-
validationPromise = Promise.resolve();
|
|
256
|
-
}
|
|
257
|
-
else {
|
|
258
|
-
const verifyHash = crypto.createHash(hashType);
|
|
259
|
-
// Validate downloaded hash
|
|
260
|
-
validationPromise = new Promise((resolve, reject) => {
|
|
261
|
-
stream.pipe(verifyHash)
|
|
262
|
-
.pause()
|
|
263
|
-
.on('finish', () => {
|
|
264
|
-
let computedHash = verifyHash.digest();
|
|
265
|
-
if (!computedHash.equals(hash)) {
|
|
266
|
-
let err = new Error(`Hash integrity compromised downloading ${url.href}.`);
|
|
267
|
-
err.hideStack = true;
|
|
268
|
-
reject(err);
|
|
269
|
-
}
|
|
270
|
-
resolve();
|
|
271
|
-
})
|
|
272
|
-
.on('error', reject);
|
|
273
|
-
});
|
|
274
|
-
}
|
|
275
|
-
let extractStream = await new Promise((resolve, reject) => {
|
|
276
|
-
// pipe through gunzip if a gzipped stream
|
|
277
|
-
peek(stream, 3, (err, bytes, stream) => {
|
|
278
|
-
if (err)
|
|
279
|
-
reject(err);
|
|
280
|
-
else if (bytes[0] === 0x1f && bytes[1] === 0x8b && bytes[2] === 0x08)
|
|
281
|
-
resolve(stream.pipe(zlib.createGunzip()).pause());
|
|
282
|
-
else
|
|
283
|
-
resolve(stream.pause());
|
|
284
|
-
});
|
|
285
|
-
});
|
|
286
|
-
await Promise.all([
|
|
287
|
-
validationPromise,
|
|
288
|
-
// Unpack contents as a tar archive and save to targetDir
|
|
289
|
-
new Promise((resolve, reject) => {
|
|
290
|
-
extractStream.pipe(tar.extract(outDir, {
|
|
291
|
-
// all dirs and files should be readable
|
|
292
|
-
dmode: 0o555,
|
|
293
|
-
fmode: 0o666,
|
|
294
|
-
strip: 1,
|
|
295
|
-
filter: function (_, header) {
|
|
296
|
-
return header.type !== 'file' && header.type !== 'directory';
|
|
297
|
-
}
|
|
298
|
-
}))
|
|
299
|
-
.on('finish', resolve)
|
|
300
|
-
.on('error', reject);
|
|
301
|
-
})
|
|
302
|
-
]);
|
|
303
|
-
}
|
|
304
|
-
const base64RegEx = /[a-z0-9+/]*={0,2}$/i;
|
|
305
|
-
const hexRegEx = /[a-f0-9]*$/g;
|
|
306
|
-
const hashTypes = [
|
|
307
|
-
{
|
|
308
|
-
hashType: 'sha1',
|
|
309
|
-
len: 20
|
|
310
|
-
},
|
|
311
|
-
{
|
|
312
|
-
hashType: 'sha224',
|
|
313
|
-
len: 28
|
|
314
|
-
},
|
|
315
|
-
{
|
|
316
|
-
hashType: 'sha256',
|
|
317
|
-
len: 32
|
|
318
|
-
},
|
|
319
|
-
{
|
|
320
|
-
hashType: 'sha384',
|
|
321
|
-
len: 48
|
|
322
|
-
},
|
|
323
|
-
{
|
|
324
|
-
hashType: 'sha512',
|
|
325
|
-
len: 64
|
|
326
|
-
}
|
|
327
|
-
];
|
|
328
|
-
;
|
|
329
|
-
function readSource(log, source) {
|
|
330
|
-
const hashIndex = source.lastIndexOf('#');
|
|
331
|
-
if (hashIndex === -1) {
|
|
332
|
-
const url = new url_1.URL(source);
|
|
333
|
-
return { url };
|
|
334
|
-
}
|
|
335
|
-
const url = new url_1.URL(source.substr(0, hashIndex));
|
|
336
|
-
const hashTypeIndex = source.indexOf('-', hashIndex + 1);
|
|
337
|
-
// direct hexadecimal hash for sha
|
|
338
|
-
if (hashTypeIndex === -1) {
|
|
339
|
-
const hashLen = source.length - hashIndex - 1;
|
|
340
|
-
hexRegEx.lastIndex = hashIndex + 1;
|
|
341
|
-
if (hexRegEx.exec(source)[0].length !== hashLen) {
|
|
342
|
-
log.warn(`Source ${source} does not have a valid hexadecimal hash so is being ignored.`);
|
|
343
|
-
return { url };
|
|
344
|
-
}
|
|
345
|
-
const halfHashLen = hashLen / 2;
|
|
346
|
-
let hashMatch = hashTypes.find(({ len }) => len === halfHashLen);
|
|
347
|
-
if (!hashMatch || hashLen % 2 !== 0) {
|
|
348
|
-
log.warn(`Source ${source} has a hexadecimal hash of invalid length for any sha hash so is being ignored.`);
|
|
349
|
-
return { url };
|
|
350
|
-
}
|
|
351
|
-
const hashType = hashMatch.hashType;
|
|
352
|
-
const hash = Buffer.from(source.substr(hashIndex + 1), 'hex');
|
|
353
|
-
return { url, hash, hashType };
|
|
354
|
-
}
|
|
355
|
-
// base64 integrity-style hash
|
|
356
|
-
else {
|
|
357
|
-
const hashType = source.substring(hashIndex + 1, hashTypeIndex);
|
|
358
|
-
const hashLen = source.length - hashTypeIndex - 1;
|
|
359
|
-
base64RegEx.lastIndex = hashTypeIndex + 1;
|
|
360
|
-
if (base64RegEx.exec(source)[0].length !== hashLen) {
|
|
361
|
-
log.warn(`Source ${source} does not have a valid base64 hash string so is being ignored.`);
|
|
362
|
-
return { url };
|
|
363
|
-
}
|
|
364
|
-
const hashMatch = hashTypes.find(({ hashType: type }) => hashType === type);
|
|
365
|
-
if (!hashMatch) {
|
|
366
|
-
log.warn(`Source ${source} is using an unsupported hash algorithm so is being ignored.`);
|
|
367
|
-
return { url };
|
|
368
|
-
}
|
|
369
|
-
const hash = Buffer.from(source.substr(hashTypeIndex + 1), 'base64');
|
|
370
|
-
if (hashMatch.len !== hash.length) {
|
|
371
|
-
log.warn(`Source ${source} does not have a valid length ${hashType} base64 hash so it is being ignored.`);
|
|
372
|
-
;
|
|
373
|
-
return { url };
|
|
374
|
-
}
|
|
375
|
-
return { url, hash, hashType };
|
|
376
|
-
}
|
|
377
|
-
}
|
|
378
|
-
//# sourceMappingURL=source.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"source.js","sourceRoot":"","sources":["../../src/install/source.ts"],"names":[],"mappings":";;AAiBA,6BAA0B;AAC1B,iCAAkC;AAClC,4CAA4E;AAC5E,6BAA8B;AAC9B,2CAA4C;AAC5C,kCAAmC;AACnC,8BAA+B;AAE/B,iDAAkD;AAClD,iCAAkC;AAClC,6BAA8B;A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C,GAAG,CAAC,IAAI,CAAC,UAAU,MAAM,iCAAiC,QAAQ,sCAAsC,CAAC,CAAC;YAAA,CAAC;YAC3G,OAAO,EAAE,GAAG,EAAE,CAAC;SAChB;QACD,OAAO,EAAE,GAAG,EAAE,IAAI,EAAE,QAAQ,EAAE,CAAC;KAChC;AACH,CAAC"}
|
package/lib/map/common.d.ts
DELETED
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
/// <reference types="node" />
|
|
2
|
-
export declare const hasSelf: boolean;
|
|
3
|
-
declare const envGlobal: Window | NodeJS.Global;
|
|
4
|
-
export { envGlobal as global };
|
|
5
|
-
export declare let baseUrl: any;
|
|
6
|
-
export declare function resolveIfNotPlainOrUrl(relUrl: any, parentUrl: any): any;
|
|
7
|
-
export declare function parseImportMap(json: any, baseUrl: any): {
|
|
8
|
-
imports: {};
|
|
9
|
-
scopes: {};
|
|
10
|
-
baseUrl: any;
|
|
11
|
-
};
|
|
12
|
-
export declare function resolveImportMap(id: any, parentUrl: any, importMap: any): any;
|
|
13
|
-
export declare function throwBare(id: any, parentUrl: any): void;
|
package/lib/map/common.js
DELETED
|
@@ -1,180 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
/*
|
|
4
|
-
* Copyright 2014-2019 Guy Bedford (http://guybedford.com)
|
|
5
|
-
*
|
|
6
|
-
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
7
|
-
* you may not use this file except in compliance with the License.
|
|
8
|
-
* You may obtain a copy of the License at
|
|
9
|
-
*
|
|
10
|
-
* http://www.apache.org/licenses/LICENSE-2.0
|
|
11
|
-
*
|
|
12
|
-
* Unless required by applicable law or agreed to in writing, software
|
|
13
|
-
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
14
|
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
15
|
-
* See the License for the specific language governing permissions and
|
|
16
|
-
* limitations under the License.
|
|
17
|
-
*/
|
|
18
|
-
exports.hasSelf = typeof self !== 'undefined';
|
|
19
|
-
const envGlobal = exports.hasSelf ? self : global;
|
|
20
|
-
exports.global = envGlobal;
|
|
21
|
-
if (typeof location !== 'undefined') {
|
|
22
|
-
exports.baseUrl = location.href.split('#')[0].split('?')[0];
|
|
23
|
-
const lastSepIndex = exports.baseUrl.lastIndexOf('/');
|
|
24
|
-
if (lastSepIndex !== -1)
|
|
25
|
-
exports.baseUrl = exports.baseUrl.slice(0, lastSepIndex + 1);
|
|
26
|
-
}
|
|
27
|
-
const backslashRegEx = /\\/g;
|
|
28
|
-
function resolveIfNotPlainOrUrl(relUrl, parentUrl) {
|
|
29
|
-
if (relUrl.indexOf('\\') !== -1)
|
|
30
|
-
relUrl = relUrl.replace(backslashRegEx, '/');
|
|
31
|
-
// protocol-relative
|
|
32
|
-
if (relUrl[0] === '/' && relUrl[1] === '/') {
|
|
33
|
-
return parentUrl.slice(0, parentUrl.indexOf(':') + 1) + relUrl;
|
|
34
|
-
}
|
|
35
|
-
// relative-url
|
|
36
|
-
else if (relUrl[0] === '.' && (relUrl[1] === '/' || relUrl[1] === '.' && (relUrl[2] === '/' || relUrl.length === 2 && (relUrl += '/')) ||
|
|
37
|
-
relUrl.length === 1 && (relUrl += '/')) ||
|
|
38
|
-
relUrl[0] === '/') {
|
|
39
|
-
const parentProtocol = parentUrl.slice(0, parentUrl.indexOf(':') + 1);
|
|
40
|
-
// Disabled, but these cases will give inconsistent results for deep backtracking
|
|
41
|
-
//if (parentUrl[parentProtocol.length] !== '/')
|
|
42
|
-
// throw new Error('Cannot resolve');
|
|
43
|
-
// read pathname from parent URL
|
|
44
|
-
// pathname taken to be part after leading "/"
|
|
45
|
-
let pathname;
|
|
46
|
-
if (parentUrl[parentProtocol.length + 1] === '/') {
|
|
47
|
-
// resolving to a :// so we need to read out the auth and host
|
|
48
|
-
if (parentProtocol !== 'file:') {
|
|
49
|
-
pathname = parentUrl.slice(parentProtocol.length + 2);
|
|
50
|
-
pathname = pathname.slice(pathname.indexOf('/') + 1);
|
|
51
|
-
}
|
|
52
|
-
else {
|
|
53
|
-
pathname = parentUrl.slice(8);
|
|
54
|
-
}
|
|
55
|
-
}
|
|
56
|
-
else {
|
|
57
|
-
// resolving to :/ so pathname is the /... part
|
|
58
|
-
pathname = parentUrl.slice(parentProtocol.length + 1);
|
|
59
|
-
}
|
|
60
|
-
if (relUrl[0] === '/')
|
|
61
|
-
return parentUrl.slice(0, parentUrl.length - pathname.length - 1) + relUrl;
|
|
62
|
-
// join together and split for removal of .. and . segments
|
|
63
|
-
// looping the string instead of anything fancy for perf reasons
|
|
64
|
-
// '../../../../../z' resolved to 'x/y' is just 'z'
|
|
65
|
-
const segmented = pathname.slice(0, pathname.lastIndexOf('/') + 1) + relUrl;
|
|
66
|
-
const output = [];
|
|
67
|
-
let segmentIndex = -1;
|
|
68
|
-
for (let i = 0; i < segmented.length; i++) {
|
|
69
|
-
// busy reading a segment - only terminate on '/'
|
|
70
|
-
if (segmentIndex !== -1) {
|
|
71
|
-
if (segmented[i] === '/') {
|
|
72
|
-
output.push(segmented.slice(segmentIndex, i + 1));
|
|
73
|
-
segmentIndex = -1;
|
|
74
|
-
}
|
|
75
|
-
}
|
|
76
|
-
// new segment - check if it is relative
|
|
77
|
-
else if (segmented[i] === '.') {
|
|
78
|
-
// ../ segment
|
|
79
|
-
if (segmented[i + 1] === '.' && (segmented[i + 2] === '/' || i + 2 === segmented.length)) {
|
|
80
|
-
output.pop();
|
|
81
|
-
i += 2;
|
|
82
|
-
}
|
|
83
|
-
// ./ segment
|
|
84
|
-
else if (segmented[i + 1] === '/' || i + 1 === segmented.length) {
|
|
85
|
-
i += 1;
|
|
86
|
-
}
|
|
87
|
-
else {
|
|
88
|
-
// the start of a new segment as below
|
|
89
|
-
segmentIndex = i;
|
|
90
|
-
}
|
|
91
|
-
}
|
|
92
|
-
// it is the start of a new segment
|
|
93
|
-
else {
|
|
94
|
-
segmentIndex = i;
|
|
95
|
-
}
|
|
96
|
-
}
|
|
97
|
-
// finish reading out the last segment
|
|
98
|
-
if (segmentIndex !== -1)
|
|
99
|
-
output.push(segmented.slice(segmentIndex));
|
|
100
|
-
return parentUrl.slice(0, parentUrl.length - pathname.length) + output.join('');
|
|
101
|
-
}
|
|
102
|
-
}
|
|
103
|
-
exports.resolveIfNotPlainOrUrl = resolveIfNotPlainOrUrl;
|
|
104
|
-
/*
|
|
105
|
-
* Import maps implementation
|
|
106
|
-
*
|
|
107
|
-
* To make lookups fast we pre-resolve the entire import map
|
|
108
|
-
* and then match based on backtracked hash lookups
|
|
109
|
-
*
|
|
110
|
-
*/
|
|
111
|
-
function resolveUrl(relUrl, parentUrl) {
|
|
112
|
-
return resolveIfNotPlainOrUrl(relUrl, parentUrl) ||
|
|
113
|
-
relUrl.indexOf(':') !== -1 && relUrl ||
|
|
114
|
-
resolveIfNotPlainOrUrl('./' + relUrl, parentUrl);
|
|
115
|
-
}
|
|
116
|
-
function resolvePackages(pkgs, baseUrl) {
|
|
117
|
-
var outPkgs = {};
|
|
118
|
-
for (var p in pkgs) {
|
|
119
|
-
var value = pkgs[p];
|
|
120
|
-
// TODO package fallback support
|
|
121
|
-
if (typeof value !== 'string')
|
|
122
|
-
continue;
|
|
123
|
-
outPkgs[resolveIfNotPlainOrUrl(p, baseUrl) || p] = value;
|
|
124
|
-
}
|
|
125
|
-
return outPkgs;
|
|
126
|
-
}
|
|
127
|
-
function parseImportMap(json, baseUrl) {
|
|
128
|
-
const imports = resolvePackages(json.imports, baseUrl) || {};
|
|
129
|
-
const scopes = {};
|
|
130
|
-
if (json.scopes) {
|
|
131
|
-
for (let scopeName in json.scopes) {
|
|
132
|
-
const scope = json.scopes[scopeName];
|
|
133
|
-
let resolvedScopeName = resolveUrl(scopeName, baseUrl);
|
|
134
|
-
if (resolvedScopeName[resolvedScopeName.length - 1] !== '/')
|
|
135
|
-
resolvedScopeName += '/';
|
|
136
|
-
scopes[resolvedScopeName] = resolvePackages(scope, resolvedScopeName) || {};
|
|
137
|
-
}
|
|
138
|
-
}
|
|
139
|
-
return { imports: imports, scopes: scopes, baseUrl: baseUrl };
|
|
140
|
-
}
|
|
141
|
-
exports.parseImportMap = parseImportMap;
|
|
142
|
-
function getMatch(path, matchObj) {
|
|
143
|
-
if (matchObj[path])
|
|
144
|
-
return path;
|
|
145
|
-
let sepIndex = path.length;
|
|
146
|
-
do {
|
|
147
|
-
const segment = path.slice(0, sepIndex + 1);
|
|
148
|
-
if (segment in matchObj)
|
|
149
|
-
return segment;
|
|
150
|
-
} while ((sepIndex = path.lastIndexOf('/', sepIndex - 1)) !== -1);
|
|
151
|
-
}
|
|
152
|
-
function applyPackages(id, packages, baseUrl) {
|
|
153
|
-
const pkgName = getMatch(id, packages);
|
|
154
|
-
if (pkgName) {
|
|
155
|
-
const pkg = packages[pkgName];
|
|
156
|
-
if (pkg === null)
|
|
157
|
-
if (id.length > pkgName.length && pkg[pkg.length - 1] !== '/')
|
|
158
|
-
console.warn("Invalid package target " + pkg + " for '" + pkgName + "' should have a trailing '/'.");
|
|
159
|
-
return resolveUrl(pkg + id.slice(pkgName.length), baseUrl);
|
|
160
|
-
}
|
|
161
|
-
}
|
|
162
|
-
function resolveImportMap(id, parentUrl, importMap) {
|
|
163
|
-
const urlResolved = resolveIfNotPlainOrUrl(id, parentUrl);
|
|
164
|
-
if (urlResolved)
|
|
165
|
-
id = urlResolved;
|
|
166
|
-
const scopeName = getMatch(parentUrl, importMap.scopes);
|
|
167
|
-
if (scopeName) {
|
|
168
|
-
const scopePackages = importMap.scopes[scopeName];
|
|
169
|
-
const packageResolution = applyPackages(id, scopePackages, scopeName);
|
|
170
|
-
if (packageResolution)
|
|
171
|
-
return packageResolution;
|
|
172
|
-
}
|
|
173
|
-
return applyPackages(id, importMap.imports, importMap.baseUrl) || urlResolved || throwBare(id, parentUrl);
|
|
174
|
-
}
|
|
175
|
-
exports.resolveImportMap = resolveImportMap;
|
|
176
|
-
function throwBare(id, parentUrl) {
|
|
177
|
-
throw new Error('Unable to resolve bare specifier "' + id + (parentUrl ? '" from ' + parentUrl : '"'));
|
|
178
|
-
}
|
|
179
|
-
exports.throwBare = throwBare;
|
|
180
|
-
//# sourceMappingURL=common.js.map
|
package/lib/map/common.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"common.js","sourceRoot":"","sources":["../../src/map/common.ts"],"names":[],"mappings":";;AAAA;;;;;;;;;;;;;;GAcG;AACU,QAAA,OAAO,GAAG,OAAO,IAAI,KAAK,WAAW,CAAC;AAEnD,MAAM,SAAS,GAAG,eAAO,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,MAAM,CAAC;AACpB,2BAAM;AAG5B,IAAI,OAAO,QAAQ,KAAK,WAAW,EAAE;IACnC,eAAO,GAAG,QAAQ,CAAC,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC;IACpD,MAAM,YAAY,GAAG,eAAO,CAAC,WAAW,CAAC,GAAG,CAAC,CAAC;IAC9C,IAAI,YAAY,KAAK,CAAC,CAAC;QACrB,eAAO,GAAG,eAAO,CAAC,KAAK,CAAC,CAAC,EAAE,YAAY,GAAG,CAAC,CAAC,CAAC;CAChD;AAED,MAAM,cAAc,GAAG,KAAK,CAAC;AAC7B,SAAgB,sBAAsB,CAAE,MAAM,EAAE,SAAS;IACvD,IAAI,MAAM,CAAC,OAAO,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;QAC7B,MAAM,GAAG,MAAM,CAAC,OAAO,CAAC,cAAc,EAAE,GAAG,CAAC,CAAC;IAC/C,oBAAoB;IACpB,IAAI,MAAM,CAAC,CAAC,CAAC,KAAK,GAAG,IAAI,MAAM,CAAC,CAAC,CAAC,KAAK,GAAG,EAAE;QAC1C,OAAO,SAAS,CAAC,KAAK,CAAC,CAAC,EAAE,SAAS,CAAC,OAAO,CAAC,GAAG,CAAC,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AFD,8BAEC"}
|
package/lib/map/esm-lexer.d.ts
DELETED
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
export declare function analyzeModuleSyntax(_str: any): any[];
|
|
2
|
-
export declare function isWs(): boolean;
|
|
3
|
-
export declare function isBr(): boolean;
|
|
4
|
-
export declare function isBrOrWs(charCode: any): boolean;
|
|
5
|
-
export declare function blockComment(): void;
|
|
6
|
-
export declare function lineComment(): void;
|
|
7
|
-
export declare function singleQuoteString(): void;
|
|
8
|
-
export declare function doubleQuoteString(): void;
|
|
9
|
-
export declare function regexCharacterClass(): void;
|
|
10
|
-
export declare function regularExpression(): void;
|
|
11
|
-
export declare function readPrecedingKeyword(endIndex: any): any;
|
|
12
|
-
export declare function readToWsOrPunctuator(startIndex: any): any;
|
|
13
|
-
export declare function isExpressionKeyword(lastTokenIndex: any): any;
|
|
14
|
-
export declare function isParenKeyword(lastTokenIndex: any): boolean;
|
|
15
|
-
export declare function isExpressionPunctuator(charCode: any): boolean;
|
|
16
|
-
export declare function isExpressionTerminator(lastTokenIndex: any): boolean;
|
|
17
|
-
export declare function syntaxError(): void;
|