Skip to content

Commit

Permalink
chore: add file: resolutions in a transitive with transitives to repr…
Browse files Browse the repository at this point in the history
…o issue #268
  • Loading branch information
gregmagolan committed Jul 15, 2022
1 parent b6f647f commit d667576
Show file tree
Hide file tree
Showing 11 changed files with 269 additions and 0 deletions.
1 change: 1 addition & 0 deletions .prettierignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,4 @@ examples/**/*-docs.md
js/private/coverage/coverage.js
js/private/node-patches/fs.js
min/
npm/private/test/vendored/
10 changes: 10 additions & 0 deletions npm/private/test/vendored/is-odd/BUILD.bazel
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
load("@aspect_rules_js//npm:defs.bzl", "npm_package")

npm_package(
name = "is-odd",
srcs = [
"index.js",
"package.json",
],
visibility = ["//visibility:public"],
)
21 changes: 21 additions & 0 deletions npm/private/test/vendored/is-odd/LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
The MIT License (MIT)

Copyright (c) 2015-present, Jon Schlinkert.

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.
25 changes: 25 additions & 0 deletions npm/private/test/vendored/is-odd/index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
/*!
* is-odd <https://github.com/jonschlinkert/is-odd>
*
* Copyright (c) 2015-2017, Jon Schlinkert.
* Released under the MIT License.
*/

'use strict';

const isNumber = require('is-number');

module.exports = function isOdd(value) {
const n = Math.abs(value);
if (!isNumber(n)) {
throw new TypeError('expected a number');
}
if (!Number.isInteger(n)) {
throw new Error('expected an integer');
}
if (!Number.isSafeInteger(n)) {
throw new Error('value exceeds maximum safe integer');
}
return (n % 2) === 1;
};

67 changes: 67 additions & 0 deletions npm/private/test/vendored/is-odd/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
{
"name": "is-odd",
"description": "Returns true if the given number is odd, and is an integer that does not exceed the JavaScript MAXIMUM_SAFE_INTEGER.",
"version": "3.0.1",
"homepage": "https://github.com/jonschlinkert/is-odd",
"author": "Jon Schlinkert (https://github.com/jonschlinkert)",
"contributors": [
"Dmitry Semigradsky (http://brainstorage.me/semigradsky)",
"DYM (https://dym.sh)",
"Jon Schlinkert (http://twitter.com/jonschlinkert)",
"Rouven Weßling (www.rouvenwessling.de)"
],
"repository": "jonschlinkert/is-odd",
"bugs": {
"url": "https://github.com/jonschlinkert/is-odd/issues"
},
"license": "MIT",
"files": [
"index.js"
],
"main": "index.js",
"engines": {
"node": ">=4"
},
"scripts": {
"test": "mocha"
},
"dependencies": {
"is-number": "^6.0.0"
},
"devDependencies": {
"gulp-format-md": "^1.0.0",
"mocha": "^3.5.3"
},
"keywords": [
"array",
"count",
"even",
"filter",
"integer",
"is",
"math",
"numeric",
"odd",
"string"
],
"verb": {
"toc": false,
"layout": "default",
"tasks": [
"readme"
],
"plugins": [
"gulp-format-md"
],
"related": {
"list": [
"exponential-moving-average",
"is-even",
"sma"
]
},
"lint": {
"reflinks": true
}
}
}
10 changes: 10 additions & 0 deletions npm/private/test/vendored/semver-max/BUILD.bazel
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
load("@aspect_rules_js//npm:defs.bzl", "npm_package")

npm_package(
name = "semver-max",
srcs = [
"index.js",
"package.json",
],
visibility = ["//visibility:public"],
)
21 changes: 21 additions & 0 deletions npm/private/test/vendored/semver-max/LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
The MIT License (MIT)

Copyright (c) 2015 Eugene Sharygin

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
34 changes: 34 additions & 0 deletions npm/private/test/vendored/semver-max/index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
'use strict'

var semver = require('semver')

var makeMax2 = function (op) {
return function (v1, v2) {
return semver[op](v2.clean, v1.clean) ? v2 : v1
}
}

var makeMax = function (op) {
return function () {
return [].filter
.call(arguments, function (version) {
return semver.valid(version, true)
})
.map(function (version) {
return {
original: version,
clean: semver.clean(version),
}
})
.reduce(makeMax2(op)).original
}
}

module.exports = (function (max) {
max.gt = max
;['gte', 'lt', 'lte'].forEach(function (op) {
max[op] = makeMax(op)
})

return max
})(makeMax('gt'))
38 changes: 38 additions & 0 deletions npm/private/test/vendored/semver-max/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
{
"name": "semver-max",
"version": "1.0.0",
"description": "Find maximum (or minimum) version according to semver",
"author": "Eugene Sharygin <eush77@gmail.com>",
"license": "MIT",
"scripts": {
"test": "tape test/*.js"
},
"files": [
"index.js"
],
"homepage": "https://github.com/eush77/semver-max",
"repository": "eush77/semver-max",
"bugs": {
"url": "https://github.com/eush77/semver-max/issues"
},
"keywords": [
"semver",
"version",
"maximum",
"minimum",
"max",
"min",
"gt",
"gte",
"lt",
"lte",
"reduce"
],
"dependencies": {
"semver": "^5.0.1",
"is-odd": "3.0.1"
},
"devDependencies": {
"tape": "^4.0.1"
}
}
5 changes: 5 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,5 +13,10 @@
}
}
}
},
"// resolutions.semver-max&is-odd": "// these are for the npm/private/test/package.json but pnpm has a bug where resolutions need to be specified in the root package.json but the paths are still relative to the package.json where the resolution applies",
"resolutions": {
"semver-max": "file:../../../npm/private/test/vendored/semver-max",
"is-odd": "file:../../../../../npm/private/test/vendored/is-odd"
}
}
37 changes: 37 additions & 0 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit d667576

Please sign in to comment.