@@ -153166,6 +153166,119 @@ function version(uuid) {
153166
153166
var _default = version;
153167
153167
exports["default"] = _default;
153168
153168
153169
+ /***/ }),
153170
+
153171
+ /***/ 84006:
153172
+ /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
153173
+
153174
+ "use strict";
153175
+
153176
+ const { builtinModules: builtins } = __nccwpck_require__(98188)
153177
+
153178
+ var scopedPackagePattern = new RegExp('^(?:@([^/]+?)[/])?([^/]+?)$')
153179
+ var blacklist = [
153180
+ 'node_modules',
153181
+ 'favicon.ico',
153182
+ ]
153183
+
153184
+ function validate (name) {
153185
+ var warnings = []
153186
+ var errors = []
153187
+
153188
+ if (name === null) {
153189
+ errors.push('name cannot be null')
153190
+ return done(warnings, errors)
153191
+ }
153192
+
153193
+ if (name === undefined) {
153194
+ errors.push('name cannot be undefined')
153195
+ return done(warnings, errors)
153196
+ }
153197
+
153198
+ if (typeof name !== 'string') {
153199
+ errors.push('name must be a string')
153200
+ return done(warnings, errors)
153201
+ }
153202
+
153203
+ if (!name.length) {
153204
+ errors.push('name length must be greater than zero')
153205
+ }
153206
+
153207
+ if (name.match(/^\./)) {
153208
+ errors.push('name cannot start with a period')
153209
+ }
153210
+
153211
+ if (name.match(/^_/)) {
153212
+ errors.push('name cannot start with an underscore')
153213
+ }
153214
+
153215
+ if (name.trim() !== name) {
153216
+ errors.push('name cannot contain leading or trailing spaces')
153217
+ }
153218
+
153219
+ // No funny business
153220
+ blacklist.forEach(function (blacklistedName) {
153221
+ if (name.toLowerCase() === blacklistedName) {
153222
+ errors.push(blacklistedName + ' is a blacklisted name')
153223
+ }
153224
+ })
153225
+
153226
+ // Generate warnings for stuff that used to be allowed
153227
+
153228
+ // core module names like http, events, util, etc
153229
+ if (builtins.includes(name.toLowerCase())) {
153230
+ warnings.push(name + ' is a core module name')
153231
+ }
153232
+
153233
+ if (name.length > 214) {
153234
+ warnings.push('name can no longer contain more than 214 characters')
153235
+ }
153236
+
153237
+ // mIxeD CaSe nAMEs
153238
+ if (name.toLowerCase() !== name) {
153239
+ warnings.push('name can no longer contain capital letters')
153240
+ }
153241
+
153242
+ if (/[~'!()*]/.test(name.split('/').slice(-1)[0])) {
153243
+ warnings.push('name can no longer contain special characters ("~\'!()*")')
153244
+ }
153245
+
153246
+ if (encodeURIComponent(name) !== name) {
153247
+ // Maybe it's a scoped package name, like @user/package
153248
+ var nameMatch = name.match(scopedPackagePattern)
153249
+ if (nameMatch) {
153250
+ var user = nameMatch[1]
153251
+ var pkg = nameMatch[2]
153252
+ if (encodeURIComponent(user) === user && encodeURIComponent(pkg) === pkg) {
153253
+ return done(warnings, errors)
153254
+ }
153255
+ }
153256
+
153257
+ errors.push('name can only contain URL-friendly characters')
153258
+ }
153259
+
153260
+ return done(warnings, errors)
153261
+ }
153262
+
153263
+ var done = function (warnings, errors) {
153264
+ var result = {
153265
+ validForNewPackages: errors.length === 0 && warnings.length === 0,
153266
+ validForOldPackages: errors.length === 0,
153267
+ warnings: warnings,
153268
+ errors: errors,
153269
+ }
153270
+ if (!result.warnings.length) {
153271
+ delete result.warnings
153272
+ }
153273
+ if (!result.errors.length) {
153274
+ delete result.errors
153275
+ }
153276
+ return result
153277
+ }
153278
+
153279
+ module.exports = validate
153280
+
153281
+
153169
153282
/***/ }),
153170
153283
153171
153284
/***/ 54886:
@@ -160498,6 +160611,14 @@ module.exports = require("https");
160498
160611
160499
160612
/***/ }),
160500
160613
160614
+ /***/ 98188:
160615
+ /***/ ((module) => {
160616
+
160617
+ "use strict";
160618
+ module.exports = require("module");
160619
+
160620
+ /***/ }),
160621
+
160501
160622
/***/ 41808:
160502
160623
/***/ ((module) => {
160503
160624
@@ -180240,6 +180361,9 @@ const extract_ = (opt) => new Unpack(opt);
180240
180361
180241
180362
180242
180363
//# sourceMappingURL=index.js.map
180364
+ // EXTERNAL MODULE: ./node_modules/validate-npm-package-name/lib/index.js
180365
+ var lib = __nccwpck_require__(84006);
180366
+ var lib_default = /*#__PURE__*/__nccwpck_require__.n(lib);
180243
180367
;// CONCATENATED MODULE: ./index.ts
180244
180368
var __awaiter = (undefined && undefined.__awaiter) || function (thisArg, _arguments, P, generator) {
180245
180369
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
@@ -180262,6 +180386,7 @@ var __awaiter = (undefined && undefined.__awaiter) || function (thisArg, _argume
180262
180386
180263
180387
180264
180388
180389
+
180265
180390
const esyPrefix = core.getInput("esy-prefix");
180266
180391
const cacheKey = core.getInput("cache-key");
180267
180392
const sourceCacheKey = core.getInput("source-cache-key");
@@ -180284,10 +180409,20 @@ function run(name, command, args) {
180284
180409
}
180285
180410
let cachedEsyNPMInfo;
180286
180411
function getLatestEsyNPMInfo(alternativeEsyNPMPackage) {
180287
- const esyPackage = (alternativeEsyNPMPackage !== "" &&
180288
- !!alternativeEsyNPMPackage &&
180289
- alternativeEsyNPMPackage) ||
180290
- "esy";
180412
+ let esyPackage;
180413
+ if (!alternativeEsyNPMPackage || alternativeEsyNPMPackage === "") {
180414
+ // No alternative was provided. So, fallback to default
180415
+ esyPackage = "esy";
180416
+ }
180417
+ else {
180418
+ const { validForOldPackages, validForNewPackages, errors = [], } = lib_default()(alternativeEsyNPMPackage);
180419
+ if (!validForNewPackages || !validForOldPackages) {
180420
+ throw new Error(`Invalid alternative NPM package name provided: ${alternativeEsyNPMPackage}
180421
+ Errors:
180422
+ ${errors.join("\n")}`);
180423
+ }
180424
+ esyPackage = alternativeEsyNPMPackage;
180425
+ }
180291
180426
try {
180292
180427
if (!cachedEsyNPMInfo) {
180293
180428
cachedEsyNPMInfo = JSON.parse(external_child_process_.execSync(`npm info ${esyPackage} --json`).toString().trim());
0 commit comments