-
Notifications
You must be signed in to change notification settings - Fork 16
/
Copy pathnormalize-package-data.node.txt
52 lines (49 loc) · 3.91 KB
/
normalize-package-data.node.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
┏━━━━━━━━━━━━━━━━━━━━━━━━━━━━┓
┃ NORMALIZE-PACKAGE-DATA ┃
┗━━━━━━━━━━━━━━━━━━━━━━━━━━━━┛
VERSION ==> #7.0.0
NORMALIZE(PACKAGE[, FUNC][,BOOL2])#Normalize package.json data.
#Modifies PACKAGE in-place.
#FUNC('STR'):
# - fired on warnings
# - always noop when PACKAGE.private true
# - def: none
#If BOOL2 true (def: false), strict mode.
#Normalizations:
# - remove incorrect fields from warnings (see below)
# - PACKAGE._id '{PACKAGE.name}@{PACKAGE.version}'
# - PACKAGE.gypfile true if PACKGE.scripts.install 'node-gyp rebuild'
# - PACKAGE.repositories[0] -> PACKAGE.repository
# - PACKAGE.repository STR -> { type: 'git', url STR }
# - PACKAGE.bin STR -> { [PACKAGE.name]: STR }
# - PACKAGE.man STR -> [STR]
# - PACKAGE.dependencies undefined -> {}
# - PACKAGE.optionalDependencies not in PACKAGE.dependencies -> added
# - PACKAGE.keywords 'STR,...' -> STR_ARR
# - PACKAGE.version undefined -> ""
# - PACKAGE.version normalized (using SEMVER, in strict mode if BOOL2 true)
# - PACKAGE.author|maintainers|contributors STR -> OBJ (mail -> email, web -> url)
# - PACKAGE.name undefined -> "" (unless strict mode)
# - PACKAGE.name trimmed (unless strict mode)
# - PACKAGE.bugs|homepage missing -> guessed from PACKAGE.repository.url
# - PACKAGE.bugs STR -> { email|url }
# - PACKAGE.homepage misses protocol -> adds http:
#Warnings:
# - PACKAGE.repositories defined
# - PACKAGE.repository undefined
# - broken PACKAGE.repository URL
# - typos in PACKAGE.*dependencies|repository|preferGlobal|homepage|author|contributors|publishConfig|scripts[.start|test]|bugs.url
# - PACKAGE.scripts not { VAR: STR, ... }
# - PACKAGE.files not STR_ARR
# - PACKAGE.bundleDependencies not STR_ARR
# - PACKAGE.bundleDependencies missing in PACKAGE.dependencies (added with "*" version)
# - PACKAGE.*dependencies STR_ARR (replace it to OBJ)
# - PACKAGE.*dependencies 'VERSION' not STR, or wrong URL (fixed)
# - PACKAGE.modules defined
# - PACKAGE.keywords not STR_ARR
# - PACKAGE.version invalid (using SEMVER, in strict mode if BOOL2 true)
# - PACKAGE.name not STR, or not valid, or core Node.js module
# - PACKAGE.description undefined or not STR
# - PACKAGE.bugs invalid
# - PACKAGE.homepage STR
# - PACKAGE.license undefined or invalid