Skip to content

Commit a42cff8

Browse files
committed
feat: add deprecation warnings to access commands
npm/statusboard#500
1 parent 1e84102 commit a42cff8

File tree

379 files changed

+26729
-15
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

379 files changed

+26729
-15
lines changed

docs/content/commands/npm-access.md

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -35,29 +35,28 @@ For all of the subcommands, `npm access` will perform actions on the packages
3535
in the current working directory if no package name is passed to the
3636
subcommand.
3737
38-
* public / restricted:
38+
* public / restricted (deprecated):
3939
Set a package to be either publicly accessible or restricted.
4040
41-
* grant / revoke:
41+
* grant / revoke (deprecated):
4242
Add or remove the ability of users and teams to have read-only or read-write
4343
access to a package.
4444
45-
* 2fa-required / 2fa-not-required:
45+
* 2fa-required / 2fa-not-required (deprecated):
4646
Configure whether a package requires that anyone publishing it have two-factor
4747
authentication enabled on their account.
4848
49-
* ls-packages:
49+
* ls-packages (deprecated):
5050
Show all of the packages a user or a team is able to access, along with the
5151
access level, except for read-only public packages (it won't print the whole
5252
registry listing)
5353
54-
* ls-collaborators:
54+
* ls-collaborators (deprecated):
5555
Show all of the access privileges for a package. Will only show permissions
5656
for packages to which you have at least read access. If `<user>` is passed in,
5757
the list is filtered only to teams _that_ user happens to belong to.
5858
59-
* edit:
60-
Set the access privileges for a package at once using `$EDITOR`.
59+
* edit (not implemented)
6160
6261
### Details
6362

lib/commands/access.js

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ const readPackageJson = require('read-package-json-fast')
55

66
const otplease = require('../utils/otplease.js')
77
const getIdentity = require('../utils/get-identity.js')
8+
const log = require('../utils/log-shim.js')
89
const BaseCommand = require('../base-command.js')
910

1011
const subcommands = [
@@ -19,6 +20,15 @@ const subcommands = [
1920
'2fa-not-required',
2021
]
2122

23+
const deprecated = [
24+
'2fa-not-required',
25+
'2fa-required',
26+
'ls-collaborators',
27+
'ls-packages',
28+
'public',
29+
'restricted',
30+
]
31+
2232
class Access extends BaseCommand {
2333
static description = 'Set access level on published packages'
2434
static name = 'access'
@@ -78,6 +88,10 @@ class Access extends BaseCommand {
7888
throw this.usageError(`${cmd} is not a recognized subcommand.`)
7989
}
8090

91+
if (deprecated.includes(cmd)) {
92+
log.warn('access', `${cmd} subcommand will be removed in the next version of npm`)
93+
}
94+
8195
return this[cmd](args, {
8296
...this.npm.flatOptions,
8397
})
@@ -175,7 +189,7 @@ class Access extends BaseCommand {
175189
}
176190

177191
async edit () {
178-
throw new Error('edit subcommand is not implemented yet')
192+
throw new Error('edit subcommand is not implemented')
179193
}
180194

181195
modifyPackage (pkg, opts, fn, requireScope = true) {
Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
// Type definitions for JSON5
2+
// Project: http://json5.org/
3+
// Definitions by: Jason Swearingen <https://jasonswearingen.github.io>
4+
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
5+
6+
7+
//commonjs loader
8+
9+
/**
10+
* 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.
11+
12+
Objects
13+
14+
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)
15+
16+
(TODO: Unicode characters and escape sequences aren’t yet supported in this implementation.)
17+
18+
Objects can have trailing commas.
19+
20+
Arrays
21+
22+
Arrays can have trailing commas.
23+
Strings
24+
25+
Strings can be single-quoted.
26+
27+
Strings can be split across multiple lines; just prefix each newline with a backslash. [ES5 §7.8.4]
28+
29+
Numbers
30+
31+
Numbers can be hexadecimal (base 16).
32+
33+
Numbers can begin or end with a (leading or trailing) decimal point.
34+
35+
Numbers can include Infinity, -Infinity, NaN, and -NaN.
36+
37+
Numbers can begin with an explicit plus sign.
38+
39+
Comments
40+
41+
Both inline (single-line) and block (multi-line) comments are allowed.
42+
*/
43+
declare var json5: JSON;
44+
export = json5;
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
{
2+
"name": "@types/json5",
3+
"version": "0.0.29",
4+
"description": "TypeScript definitions for JSON5",
5+
"license": "MIT",
6+
"author": "Jason Swearingen <https://jasonswearingen.github.io>",
7+
"main": "",
8+
"repository": {
9+
"type": "git",
10+
"url": "https://www.github.com/DefinitelyTyped/DefinitelyTyped.git"
11+
},
12+
"scripts": {},
13+
"dependencies": {},
14+
"typings": "index.d.ts",
15+
"typesPublisherContentHash": "1ed77f2bfd59d290798abf89db281c36565f4a78d97d4e9caab25319d54c6331"
16+
}
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
{
2+
"authors": "Jason Swearingen <https://jasonswearingen.github.io>",
3+
"definitionFilename": "index.d.ts",
4+
"libraryDependencies": [],
5+
"moduleDependencies": [],
6+
"libraryMajorVersion": "0",
7+
"libraryMinorVersion": "0",
8+
"libraryName": "JSON5",
9+
"typingsPackageName": "json5",
10+
"projectName": "http://json5.org/",
11+
"sourceRepoURL": "https://www.github.com/DefinitelyTyped/DefinitelyTyped",
12+
"sourceBranch": "types-2.0",
13+
"kind": "ProperModule",
14+
"globals": [
15+
"json5"
16+
],
17+
"declaredModules": [
18+
"json5"
19+
],
20+
"files": [
21+
"index.d.ts"
22+
],
23+
"hasPackageJson": false,
24+
"contentHash": "1ed77f2bfd59d290798abf89db281c36565f4a78d97d4e9caab25319d54c6331"
25+
}
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
The MIT License (MIT)
2+
3+
Copyright (C) 2015 Jordan Harband
4+
5+
Permission is hereby granted, free of charge, to any person obtaining a copy
6+
of this software and associated documentation files (the "Software"), to deal
7+
in the Software without restriction, including without limitation the rights
8+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9+
copies of the Software, and to permit persons to whom the Software is
10+
furnished to do so, subject to the following conditions:
11+
12+
The above copyright notice and this permission notice shall be included in
13+
all copies or substantial portions of the Software.
14+
15+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
21+
THE SOFTWARE.
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
'use strict';
2+
3+
require('./shim')();
Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
'use strict';
2+
3+
var ToIntegerOrInfinity = require('es-abstract/2021/ToIntegerOrInfinity');
4+
var ToLength = require('es-abstract/2021/ToLength');
5+
var ToObject = require('es-abstract/2021/ToObject');
6+
var SameValueZero = require('es-abstract/2021/SameValueZero');
7+
var $isNaN = require('es-abstract/helpers/isNaN');
8+
var $isFinite = require('es-abstract/helpers/isFinite');
9+
var GetIntrinsic = require('get-intrinsic');
10+
var callBound = require('call-bind/callBound');
11+
var isString = require('is-string');
12+
13+
var $charAt = callBound('String.prototype.charAt');
14+
var $indexOf = GetIntrinsic('%Array.prototype.indexOf%'); // TODO: use callBind.apply without breaking IE 8
15+
var $max = GetIntrinsic('%Math.max%');
16+
17+
module.exports = function includes(searchElement) {
18+
var fromIndex = arguments.length > 1 ? ToIntegerOrInfinity(arguments[1]) : 0;
19+
if ($indexOf && !$isNaN(searchElement) && $isFinite(fromIndex) && typeof searchElement !== 'undefined') {
20+
return $indexOf.apply(this, arguments) > -1;
21+
}
22+
23+
var O = ToObject(this);
24+
var length = ToLength(O.length);
25+
if (length === 0) {
26+
return false;
27+
}
28+
var k = fromIndex >= 0 ? fromIndex : $max(0, length + fromIndex);
29+
while (k < length) {
30+
if (SameValueZero(searchElement, isString(O) ? $charAt(O, k) : O[k])) {
31+
return true;
32+
}
33+
k += 1;
34+
}
35+
return false;
36+
};
Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
'use strict';
2+
3+
var define = require('define-properties');
4+
var RequireObjectCoercible = require('es-abstract/2021/RequireObjectCoercible');
5+
var callBind = require('call-bind');
6+
var callBound = require('call-bind/callBound');
7+
8+
var implementation = require('./implementation');
9+
var getPolyfill = require('./polyfill');
10+
var polyfill = callBind.apply(getPolyfill());
11+
var shim = require('./shim');
12+
13+
var $slice = callBound('Array.prototype.slice');
14+
15+
/* eslint-disable no-unused-vars */
16+
var boundShim = function includes(array, searchElement) {
17+
/* eslint-enable no-unused-vars */
18+
RequireObjectCoercible(array);
19+
return polyfill(array, $slice(arguments, 1));
20+
};
21+
define(boundShim, {
22+
getPolyfill: getPolyfill,
23+
implementation: implementation,
24+
shim: shim
25+
});
26+
27+
module.exports = boundShim;
Lines changed: 95 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,95 @@
1+
{
2+
"name": "array-includes",
3+
"version": "3.1.5",
4+
"author": {
5+
"name": "Jordan Harband",
6+
"email": "[email protected]",
7+
"url": "http://ljharb.codes"
8+
},
9+
"funding": {
10+
"url": "https://github.com/sponsors/ljharb"
11+
},
12+
"contributors": [
13+
{
14+
"name": "Jordan Harband",
15+
"email": "[email protected]",
16+
"url": "http://ljharb.codes"
17+
}
18+
],
19+
"description": "An ES7/ES2016 spec-compliant `Array.prototype.includes` shim/polyfill/replacement that works as far down as ES3.",
20+
"license": "MIT",
21+
"main": "index.js",
22+
"scripts": {
23+
"prepublish": "not-in-publish || npm run prepublishOnly",
24+
"prepublishOnly": "safe-publish-latest",
25+
"pretest": "npm run --silent lint",
26+
"test": "npm run --silent tests-only",
27+
"posttest": "aud --production",
28+
"tests-only": "nyc tape 'test/**/*.js'",
29+
"prelint": "evalmd README.md",
30+
"lint": "eslint --ext=js,mjs .",
31+
"postlint": "es-shim-api --bound"
32+
},
33+
"repository": {
34+
"type": "git",
35+
"url": "git://github.com/es-shims/array-includes.git"
36+
},
37+
"keywords": [
38+
"Array.prototype.includes",
39+
"includes",
40+
"array",
41+
"ES7",
42+
"shim",
43+
"polyfill",
44+
"contains",
45+
"Array.prototype.contains",
46+
"es-shim API"
47+
],
48+
"dependencies": {
49+
"call-bind": "^1.0.2",
50+
"define-properties": "^1.1.4",
51+
"es-abstract": "^1.19.5",
52+
"get-intrinsic": "^1.1.1",
53+
"is-string": "^1.0.7"
54+
},
55+
"devDependencies": {
56+
"@es-shims/api": "^2.2.3",
57+
"@ljharb/eslint-config": "^21.0.0",
58+
"aud": "^2.0.0",
59+
"eslint": "=8.8.0",
60+
"evalmd": "^0.0.19",
61+
"foreach": "^2.0.5",
62+
"function-bind": "^1.1.1",
63+
"functions-have-names": "^1.2.3",
64+
"has-strict-mode": "^1.0.1",
65+
"indexof": "^0.0.1",
66+
"nyc": "^10.3.2",
67+
"safe-publish-latest": "^2.0.0",
68+
"tape": "^5.5.3"
69+
},
70+
"testling": {
71+
"files": [
72+
"test/index.js",
73+
"test/implementation.js",
74+
"test/shimmed.js"
75+
],
76+
"browsers": [
77+
"iexplore/6.0..latest",
78+
"firefox/3.0..6.0",
79+
"firefox/15.0..latest",
80+
"firefox/nightly",
81+
"chrome/4.0..10.0",
82+
"chrome/20.0..latest",
83+
"chrome/canary",
84+
"opera/10.0..latest",
85+
"opera/next",
86+
"safari/4.0..latest",
87+
"ipad/6.0..latest",
88+
"iphone/6.0..latest",
89+
"android-browser/4.2"
90+
]
91+
},
92+
"engines": {
93+
"node": ">= 0.4"
94+
}
95+
}

0 commit comments

Comments
 (0)