Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: npm/normalize-package-data
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: v3.0.2
Choose a base ref
...
head repository: npm/normalize-package-data
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: v3.0.3
Choose a head ref
  • 7 commits
  • 20 files changed
  • 5 contributors

Commits on Aug 18, 2021

  1. Copy the full SHA
    6dd9e13 View commit details
  2. docs(README): fix license link to BDS-2-Clause (#119)

    Fix #118 
    
    Link of License section in README was pointing to MIT License, replaced by proper BDS-2-Clause.
    ghybs authored Aug 18, 2021
    Copy the full SHA
    71e6c4b View commit details
  3. Update LICENSE (#109)

    Conform to SPDX Standard license.
    PabloJomer authored Aug 18, 2021
    Copy the full SHA
    e4f32f3 View commit details
  4. chore(ci): update ci (#123)

    * chore(ci): move to github actions
    
    * chore(tests): update to tap15
    
    * chore(linting): add linting
    wraithgar authored Aug 18, 2021
    Copy the full SHA
    21226d4 View commit details
  5. fix: account for "licence" as spelling variant (#124)

    * fix: account for "licence" as spelling variant
    
    Previously, this package did not account for the package.json field
    being spelled as "licence" as it is spelled everywhere outside of the
    US. The main npm-cli package, however, allows both, so this commit fixes
    this issue so that a warning is not triggered in places where it is
    spelled using the variant.
    
    Fixes #107
    
    * fix(tests): add test for licence
    
    Co-authored-by: Varun Varada <varuncvarada@gmail.com>
    wraithgar and getsnoopy authored Aug 18, 2021
    Copy the full SHA
    ab9342c View commit details
  6. fix(deps) replace resolve with is-core-module (#125)

    Co-authored-by: Federico <me@fregante.com>
    wraithgar and fregante authored Aug 18, 2021
    Copy the full SHA
    2959676 View commit details
  7. 3.0.3

    wraithgar committed Aug 18, 2021
    Copy the full SHA
    4121d78 View commit details
Showing with 6,751 additions and 2,825 deletions.
  1. +22 −0 .github/workflows/ci.yml
  2. +0 −5 .travis.yml
  3. +4 −19 LICENSE
  4. +3 −3 README.md
  5. +12 −4 lib/extract_description.js
  6. +245 −189 lib/fixer.js
  7. +6 −7 lib/make_warning.js
  8. +25 −16 lib/normalize.js
  9. +5 −3 lib/safe_format.js
  10. +6,143 −2,319 package-lock.json
  11. +10 −4 package.json
  12. +22 −20 test/basic.js
  13. +10 −10 test/consistency.js
  14. +20 −21 test/dependencies.js
  15. +17 −17 test/github-urls.js
  16. +105 −91 test/normalize.js
  17. +18 −18 test/scoped.js
  18. +12 −10 test/scripts.js
  19. +17 −15 test/strict.js
  20. +55 −54 test/typo.js
22 changes: 22 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
name: CI
on: [push, pull_request]
jobs:
test:
strategy:
fail-fast: false
matrix:
node-version: ['10.1', 10.x, '12.1', 12.x, '14.1', 14.x]

runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v2
with:
node-version: ${{ matrix.node-version }}
- name: Update npm
run: npm i -g npm
- name: Install dependencies
run: npm ci
- name: Run Tap tests
run: npm test
5 changes: 0 additions & 5 deletions .travis.yml

This file was deleted.

23 changes: 4 additions & 19 deletions LICENSE
Original file line number Diff line number Diff line change
@@ -6,25 +6,10 @@ All rights reserved.

The BSD License

Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions
are met:
Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:

1. Redistributions of source code must retain the above copyright
notice, this list of conditions and the following disclaimer.
1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.

2. Redistributions in binary form must reproduce the above copyright
notice, this list of conditions and the following disclaimer in the
documentation and/or other materials provided with the distribution.
2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.

THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS
BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE
OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN
IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
@@ -96,13 +96,13 @@ If `version` field is given, the value of the version field must be a valid *sem

### Rules for license field

The `license` field should be a valid *SPDX license expression* or one of the special values allowed by [validate-npm-package-license](https://npmjs.com/package/validate-npm-package-license). See [documentation for the license field in package.json](https://docs.npmjs.com/files/package.json#license).
The `license`/`licence` field should be a valid *SPDX license expression* or one of the special values allowed by [validate-npm-package-license](https://npmjs.com/package/validate-npm-package-license). See [documentation for the license field in package.json](https://docs.npmjs.com/files/package.json#license).

## Credits

This package contains code based on read-package-json written by Isaac Z. Schlueter. Used with permisson.

## License

normalize-package-data is released under the [BSD 2-Clause License](http://opensource.org/licenses/MIT).
Copyright (c) 2013 Meryn Stol
normalize-package-data is released under the [BSD 2-Clause License](https://opensource.org/licenses/BSD-2-Clause).
Copyright (c) 2013 Meryn Stol
16 changes: 12 additions & 4 deletions lib/extract_description.js
Original file line number Diff line number Diff line change
@@ -2,13 +2,21 @@ module.exports = extractDescription

// Extracts description from contents of a readme file in markdown format
function extractDescription (d) {
if (!d) return;
if (d === "ERROR: No README data found!") return;
if (!d) {
return
}
if (d === 'ERROR: No README data found!') {
return
}
// the first block of text before the first heading
// that isn't the first line heading
d = d.trim().split('\n')
for (var s = 0; d[s] && d[s].trim().match(/^(#|$)/); s ++);
for (var s = 0; d[s] && d[s].trim().match(/^(#|$)/); s++) {
;
}
var l = d.length
for (var e = s + 1; e < l && d[e].trim(); e ++);
for (var e = s + 1; e < l && d[e].trim(); e++) {
;
}
return d.slice(s, e).join(' ').trim()
}
Loading