Skip to content

Commit

Permalink
feat: add deprecation warnings to access commands
Browse files Browse the repository at this point in the history
  • Loading branch information
wraithgar committed Aug 25, 2022
1 parent 1e84102 commit a42cff8
Show file tree
Hide file tree
Showing 379 changed files with 26,729 additions and 15 deletions.
13 changes: 6 additions & 7 deletions docs/content/commands/npm-access.md
Expand Up @@ -35,29 +35,28 @@ For all of the subcommands, `npm access` will perform actions on the packages
in the current working directory if no package name is passed to the
subcommand.
* public / restricted:
* public / restricted (deprecated):
Set a package to be either publicly accessible or restricted.
* grant / revoke:
* grant / revoke (deprecated):
Add or remove the ability of users and teams to have read-only or read-write
access to a package.
* 2fa-required / 2fa-not-required:
* 2fa-required / 2fa-not-required (deprecated):
Configure whether a package requires that anyone publishing it have two-factor
authentication enabled on their account.
* ls-packages:
* ls-packages (deprecated):
Show all of the packages a user or a team is able to access, along with the
access level, except for read-only public packages (it won't print the whole
registry listing)
* ls-collaborators:
* ls-collaborators (deprecated):
Show all of the access privileges for a package. Will only show permissions
for packages to which you have at least read access. If `<user>` is passed in,
the list is filtered only to teams _that_ user happens to belong to.
* edit:
Set the access privileges for a package at once using `$EDITOR`.
* edit (not implemented)
### Details
Expand Down
16 changes: 15 additions & 1 deletion lib/commands/access.js
Expand Up @@ -5,6 +5,7 @@ const readPackageJson = require('read-package-json-fast')

const otplease = require('../utils/otplease.js')
const getIdentity = require('../utils/get-identity.js')
const log = require('../utils/log-shim.js')
const BaseCommand = require('../base-command.js')

const subcommands = [
Expand All @@ -19,6 +20,15 @@ const subcommands = [
'2fa-not-required',
]

const deprecated = [
'2fa-not-required',
'2fa-required',
'ls-collaborators',
'ls-packages',
'public',
'restricted',
]

class Access extends BaseCommand {
static description = 'Set access level on published packages'
static name = 'access'
Expand Down Expand Up @@ -78,6 +88,10 @@ class Access extends BaseCommand {
throw this.usageError(`${cmd} is not a recognized subcommand.`)
}

if (deprecated.includes(cmd)) {
log.warn('access', `${cmd} subcommand will be removed in the next version of npm`)
}

return this[cmd](args, {
...this.npm.flatOptions,
})
Expand Down Expand Up @@ -175,7 +189,7 @@ class Access extends BaseCommand {
}

async edit () {
throw new Error('edit subcommand is not implemented yet')
throw new Error('edit subcommand is not implemented')
}

modifyPackage (pkg, opts, fn, requireScope = true) {
Expand Down
44 changes: 44 additions & 0 deletions node_modules/@types/json5/index.d.ts
@@ -0,0 +1,44 @@
// Type definitions for JSON5
// Project: http://json5.org/
// Definitions by: Jason Swearingen <https://jasonswearingen.github.io>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped


//commonjs loader

/**
* The following is the exact list of additions to JSON's syntax introduced by JSON5. All of these are optional, and all of these come from ES5.
Objects
Object keys can be unquoted if they're valid identifiers. Yes, even reserved keywords (like default) are valid unquoted keys in ES5 [§11.1.5, §7.6]. (More info)
(TODO: Unicode characters and escape sequences aren’t yet supported in this implementation.)
Objects can have trailing commas.
Arrays
Arrays can have trailing commas.
Strings
Strings can be single-quoted.
Strings can be split across multiple lines; just prefix each newline with a backslash. [ES5 §7.8.4]
Numbers
Numbers can be hexadecimal (base 16).
Numbers can begin or end with a (leading or trailing) decimal point.
Numbers can include Infinity, -Infinity, NaN, and -NaN.
Numbers can begin with an explicit plus sign.
Comments
Both inline (single-line) and block (multi-line) comments are allowed.
*/
declare var json5: JSON;
export = json5;
16 changes: 16 additions & 0 deletions node_modules/@types/json5/package.json
@@ -0,0 +1,16 @@
{
"name": "@types/json5",
"version": "0.0.29",
"description": "TypeScript definitions for JSON5",
"license": "MIT",
"author": "Jason Swearingen <https://jasonswearingen.github.io>",
"main": "",
"repository": {
"type": "git",
"url": "https://www.github.com/DefinitelyTyped/DefinitelyTyped.git"
},
"scripts": {},
"dependencies": {},
"typings": "index.d.ts",
"typesPublisherContentHash": "1ed77f2bfd59d290798abf89db281c36565f4a78d97d4e9caab25319d54c6331"
}
25 changes: 25 additions & 0 deletions node_modules/@types/json5/types-metadata.json
@@ -0,0 +1,25 @@
{
"authors": "Jason Swearingen <https://jasonswearingen.github.io>",
"definitionFilename": "index.d.ts",
"libraryDependencies": [],
"moduleDependencies": [],
"libraryMajorVersion": "0",
"libraryMinorVersion": "0",
"libraryName": "JSON5",
"typingsPackageName": "json5",
"projectName": "http://json5.org/",
"sourceRepoURL": "https://www.github.com/DefinitelyTyped/DefinitelyTyped",
"sourceBranch": "types-2.0",
"kind": "ProperModule",
"globals": [
"json5"
],
"declaredModules": [
"json5"
],
"files": [
"index.d.ts"
],
"hasPackageJson": false,
"contentHash": "1ed77f2bfd59d290798abf89db281c36565f4a78d97d4e9caab25319d54c6331"
}
21 changes: 21 additions & 0 deletions node_modules/array-includes/LICENSE
@@ -0,0 +1,21 @@
The MIT License (MIT)

Copyright (C) 2015 Jordan Harband

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.
3 changes: 3 additions & 0 deletions node_modules/array-includes/auto.js
@@ -0,0 +1,3 @@
'use strict';

require('./shim')();
36 changes: 36 additions & 0 deletions node_modules/array-includes/implementation.js
@@ -0,0 +1,36 @@
'use strict';

var ToIntegerOrInfinity = require('es-abstract/2021/ToIntegerOrInfinity');
var ToLength = require('es-abstract/2021/ToLength');
var ToObject = require('es-abstract/2021/ToObject');
var SameValueZero = require('es-abstract/2021/SameValueZero');
var $isNaN = require('es-abstract/helpers/isNaN');
var $isFinite = require('es-abstract/helpers/isFinite');
var GetIntrinsic = require('get-intrinsic');
var callBound = require('call-bind/callBound');
var isString = require('is-string');

var $charAt = callBound('String.prototype.charAt');
var $indexOf = GetIntrinsic('%Array.prototype.indexOf%'); // TODO: use callBind.apply without breaking IE 8
var $max = GetIntrinsic('%Math.max%');

module.exports = function includes(searchElement) {
var fromIndex = arguments.length > 1 ? ToIntegerOrInfinity(arguments[1]) : 0;
if ($indexOf && !$isNaN(searchElement) && $isFinite(fromIndex) && typeof searchElement !== 'undefined') {
return $indexOf.apply(this, arguments) > -1;
}

var O = ToObject(this);
var length = ToLength(O.length);
if (length === 0) {
return false;
}
var k = fromIndex >= 0 ? fromIndex : $max(0, length + fromIndex);
while (k < length) {
if (SameValueZero(searchElement, isString(O) ? $charAt(O, k) : O[k])) {
return true;
}
k += 1;
}
return false;
};
27 changes: 27 additions & 0 deletions node_modules/array-includes/index.js
@@ -0,0 +1,27 @@
'use strict';

var define = require('define-properties');
var RequireObjectCoercible = require('es-abstract/2021/RequireObjectCoercible');
var callBind = require('call-bind');
var callBound = require('call-bind/callBound');

var implementation = require('./implementation');
var getPolyfill = require('./polyfill');
var polyfill = callBind.apply(getPolyfill());
var shim = require('./shim');

var $slice = callBound('Array.prototype.slice');

/* eslint-disable no-unused-vars */
var boundShim = function includes(array, searchElement) {
/* eslint-enable no-unused-vars */
RequireObjectCoercible(array);
return polyfill(array, $slice(arguments, 1));
};
define(boundShim, {
getPolyfill: getPolyfill,
implementation: implementation,
shim: shim
});

module.exports = boundShim;
95 changes: 95 additions & 0 deletions node_modules/array-includes/package.json
@@ -0,0 +1,95 @@
{
"name": "array-includes",
"version": "3.1.5",
"author": {
"name": "Jordan Harband",
"email": "ljharb@gmail.com",
"url": "http://ljharb.codes"
},
"funding": {
"url": "https://github.com/sponsors/ljharb"
},
"contributors": [
{
"name": "Jordan Harband",
"email": "ljharb@gmail.com",
"url": "http://ljharb.codes"
}
],
"description": "An ES7/ES2016 spec-compliant `Array.prototype.includes` shim/polyfill/replacement that works as far down as ES3.",
"license": "MIT",
"main": "index.js",
"scripts": {
"prepublish": "not-in-publish || npm run prepublishOnly",
"prepublishOnly": "safe-publish-latest",
"pretest": "npm run --silent lint",
"test": "npm run --silent tests-only",
"posttest": "aud --production",
"tests-only": "nyc tape 'test/**/*.js'",
"prelint": "evalmd README.md",
"lint": "eslint --ext=js,mjs .",
"postlint": "es-shim-api --bound"
},
"repository": {
"type": "git",
"url": "git://github.com/es-shims/array-includes.git"
},
"keywords": [
"Array.prototype.includes",
"includes",
"array",
"ES7",
"shim",
"polyfill",
"contains",
"Array.prototype.contains",
"es-shim API"
],
"dependencies": {
"call-bind": "^1.0.2",
"define-properties": "^1.1.4",
"es-abstract": "^1.19.5",
"get-intrinsic": "^1.1.1",
"is-string": "^1.0.7"
},
"devDependencies": {
"@es-shims/api": "^2.2.3",
"@ljharb/eslint-config": "^21.0.0",
"aud": "^2.0.0",
"eslint": "=8.8.0",
"evalmd": "^0.0.19",
"foreach": "^2.0.5",
"function-bind": "^1.1.1",
"functions-have-names": "^1.2.3",
"has-strict-mode": "^1.0.1",
"indexof": "^0.0.1",
"nyc": "^10.3.2",
"safe-publish-latest": "^2.0.0",
"tape": "^5.5.3"
},
"testling": {
"files": [
"test/index.js",
"test/implementation.js",
"test/shimmed.js"
],
"browsers": [
"iexplore/6.0..latest",
"firefox/3.0..6.0",
"firefox/15.0..latest",
"firefox/nightly",
"chrome/4.0..10.0",
"chrome/20.0..latest",
"chrome/canary",
"opera/10.0..latest",
"opera/next",
"safari/4.0..latest",
"ipad/6.0..latest",
"iphone/6.0..latest",
"android-browser/4.2"
]
},
"engines": {
"node": ">= 0.4"
}
}
13 changes: 13 additions & 0 deletions node_modules/array-includes/polyfill.js
@@ -0,0 +1,13 @@
'use strict';

var implementation = require('./implementation');

module.exports = function getPolyfill() {
if (
Array.prototype.includes
&& Array(1).includes(undefined) // https://bugzilla.mozilla.org/show_bug.cgi?id=1767541
) {
return Array.prototype.includes;
}
return implementation;
};
14 changes: 14 additions & 0 deletions node_modules/array-includes/shim.js
@@ -0,0 +1,14 @@
'use strict';

var define = require('define-properties');
var getPolyfill = require('./polyfill');

module.exports = function shimArrayPrototypeIncludes() {
var polyfill = getPolyfill();
define(
Array.prototype,
{ includes: polyfill },
{ includes: function () { return Array.prototype.includes !== polyfill; } }
);
return polyfill;
};

0 comments on commit a42cff8

Please sign in to comment.