From 85b1165d3454791d8454ac6b74cbcb993c77bfc6 Mon Sep 17 00:00:00 2001 From: Takayuki Sato Date: Sun, 26 Sep 2021 05:31:09 +0900 Subject: [PATCH] chore!: Normalize repository, dropping node <10.13 support (#8) --- .editorconfig | 13 ++++++ .gitattributes | 1 + .github/workflows/dev.yml | 75 +++++++++++++++++++++++++++++++++++ .github/workflows/release.yml | 17 ++++++++ .gitignore | 55 +++++++++++++++++++++++-- .pretterignore | 3 ++ .travis.yml | 32 --------------- README.md | 37 +++++++++++------ appveyor.yml | 33 --------------- package.json | 32 ++++++++++----- web/copy-props.min.js | 2 +- web/copy-props.min.js.map | 2 +- 12 files changed, 209 insertions(+), 93 deletions(-) create mode 100644 .editorconfig create mode 100644 .gitattributes create mode 100644 .github/workflows/dev.yml create mode 100644 .github/workflows/release.yml create mode 100644 .pretterignore delete mode 100644 .travis.yml delete mode 100644 appveyor.yml diff --git a/.editorconfig b/.editorconfig new file mode 100644 index 0000000..e000b0c --- /dev/null +++ b/.editorconfig @@ -0,0 +1,13 @@ +# http://editorconfig.org +root = true + +[*] +indent_style = space +indent_size = 2 +charset = utf-8 +trim_trailing_whitespace = true +insert_final_newline = true +end_of_line = lf + +[*.md] +trim_trailing_whitespace = false diff --git a/.gitattributes b/.gitattributes new file mode 100644 index 0000000..fcadb2c --- /dev/null +++ b/.gitattributes @@ -0,0 +1 @@ +* text eol=lf diff --git a/.github/workflows/dev.yml b/.github/workflows/dev.yml new file mode 100644 index 0000000..31627b0 --- /dev/null +++ b/.github/workflows/dev.yml @@ -0,0 +1,75 @@ +name: dev +on: + pull_request: + push: + branches: + - master + - main +env: + CI: true + +jobs: + prettier: + name: Format code + runs-on: ubuntu-latest + if: ${{ github.event_name == 'push' }} + + steps: + - name: Checkout + uses: actions/checkout@v2 + + - name: Prettier + uses: gulpjs/prettier_action@v3.0 + with: + commit_message: 'chore: Run prettier' + prettier_options: '--write .' + + test: + name: Tests for Node ${{ matrix.node }} on ${{ matrix.os }} + runs-on: ${{ matrix.os }} + + strategy: + fail-fast: false + matrix: + node: [10, 12, 14, 16] + os: [ubuntu-latest, windows-latest, macos-latest] + + steps: + - name: Clone repository + uses: actions/checkout@v2 + + - name: Set Node.js version + uses: actions/setup-node@v2 + with: + node-version: ${{ matrix.node }} + + - run: node --version + - run: npm --version + + - name: Install npm dependencies + run: npm install + + - name: Run lint + run: npm run lint + + - name: Run tests + run: npm test + + - name: Coveralls + uses: coverallsapp/github-action@v1.1.2 + with: + github-token: ${{ secrets.GITHUB_TOKEN }} + flag-name: ${{ matrix.os }}-node-${{ matrix.node }} + parallel: true + + coveralls: + needs: test + name: Finish up + + runs-on: ubuntu-latest + steps: + - name: Coveralls Finished + uses: coverallsapp/github-action@v1.1.2 + with: + github-token: ${{ secrets.GITHUB_TOKEN }} + parallel-finished: true diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml new file mode 100644 index 0000000..8a10ce3 --- /dev/null +++ b/.github/workflows/release.yml @@ -0,0 +1,17 @@ +name: release +on: + push: + branches: + - master + - main + +jobs: + release-please: + runs-on: ubuntu-latest + steps: + - uses: GoogleCloudPlatform/release-please-action@v2 + with: + token: ${{ secrets.GITHUB_TOKEN }} + release-type: node + package-name: release-please-action + bump-minor-pre-major: true diff --git a/.gitignore b/.gitignore index dda9df2..58a757a 100644 --- a/.gitignore +++ b/.gitignore @@ -2,17 +2,66 @@ logs *.log npm-debug.log* +yarn-debug.log* +yarn-error.log* + +# Runtime data +pids +*.pid +*.seed +*.pid.lock + +# Directory for instrumented libs generated by jscoverage/JSCover +lib-cov # Coverage directory used by tools like istanbul coverage + +# nyc test coverage .nyc_output -.coveralls.yml + +# Grunt intermediate storage (http://gruntjs.com/creating-plugins#storing-task-files) +.grunt + +# Bower dependency directory (https://bower.io/) +bower_components + +# node-waf configuration +.lock-wscript + +# Compiled binary addons (https://nodejs.org/api/addons.html) +build/Release # Dependency directories -node_modules +node_modules/ +jspm_packages/ + +# TypeScript v1 declaration files +typings/ # Optional npm cache directory .npm -# Files generated by platform. +# Optional eslint cache +.eslintcache + +# Optional REPL history +.node_repl_history + +# Output of 'npm pack' +*.tgz + +# Yarn Integrity file +.yarn-integrity + +# dotenv environment variables file +.env + +# next.js build output +.next + +# Garbage files .DS_Store + +# Test results +test.xunit diff --git a/.pretterignore b/.pretterignore new file mode 100644 index 0000000..c96ebe0 --- /dev/null +++ b/.pretterignore @@ -0,0 +1,3 @@ +coverage/ +.nyc_output/ +CHANGELOG.md diff --git a/.travis.yml b/.travis.yml deleted file mode 100644 index d2ba1bd..0000000 --- a/.travis.yml +++ /dev/null @@ -1,32 +0,0 @@ -sudo: false - -language: node_js - -node_js: - - '14' - - '13' - - '12' - - '11' - - '10' - - '9' - - '8' - - '7' - - '6' - - '5' - - '4' - - '0.12' - - '0.10' - -before_install: - - if [ $(echo "${TRAVIS_NODE_VERSION}" | cut -d'.' -f1) -eq 5 ]; then - npm i -g npm@4; - fi - -after_success: - - if [ $(echo "${TRAVIS_NODE_VERSION}" | cut -d'.' -f1) -ge 6 ]; then - npm run coveralls; - fi - -os: - - linux - - osx diff --git a/README.md b/README.md index b38f2b1..9ba4d3e 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,12 @@ -# [copy-props][repo-url] [![NPM][npm-img]][npm-url] [![MIT License][mit-img]][mit-url] [![Build Status][travis-img]][travis-url] [![Build Status][appveyor-img]][appveyor-url] [![Coverage Status][coverage-img]][coverage-url] +

+ + + +

+ +# copy-props + +[![NPM version][npm-image]][npm-url] [![Downloads][downloads-image]][npm-url] [![Build Status][ci-image]][ci-url] [![Coveralls Status][coveralls-image]][coveralls-url] Copy properties between two objects deeply. @@ -214,14 +222,19 @@ Copyright (C) 2016-2021 Gulp Team. This program is free software under [MIT][mit-url] License. See the file LICENSE in this distribution for more details. -[repo-url]: https://github.com/gulpjs/copy-props/ -[npm-img]: https://img.shields.io/badge/npm-v2.0.5-blue.svg -[npm-url]: https://www.npmjs.org/package/copy-props/ -[mit-img]: https://img.shields.io/badge/license-MIT-green.svg -[mit-url]: https://opensource.org/licenses.MIT -[travis-img]: https://travis-ci.org/gulpjs/copy-props.svg?branch=master -[travis-url]: https://travis-ci.org/gulpjs/copy-props -[appveyor-img]: https://ci.appveyor.com/api/projects/status/github/gulpjs/copy-props?branch=master&svg=true -[appveyor-url]: https://ci.appveyor.com/project/gulpjs/copy-props -[coverage-img]: https://coveralls.io/repos/github/gulpjs/copy-props/badge.svg?branch=master -[coverage-url]: https://coveralls.io/github/gulpjs/copy-props?branch=master + + +[downloads-image]: https://img.shields.io/npm/dm/copy-props.svg?style=flat-square +[npm-url]: https://www.npmjs.org/package/copy-props +[npm-image]: https://img.shields.io/npm/v/copy-props.svg?style=flat-square + +[ci-url]: https://github.com/gulpjs/copy-props/actions?query=workflow:dev +[ci-image]: https://img.shields.io/github/workflow/status/gulpjs/copy-props/dev?style=flat-square + +[coveralls-url]: https://coveralls.io/r/gulpjs/copy-props +[coveralls-image]: https://img.shields.io/coveralls/gulpjs/copy-props/master.svg + + + +[mit-url]: https://opensource.org/licenses/MIT + diff --git a/appveyor.yml b/appveyor.yml deleted file mode 100644 index 95737c3..0000000 --- a/appveyor.yml +++ /dev/null @@ -1,33 +0,0 @@ -# http://www.appveyor.com/docs/appveyor-yml -# http://www.appveyor.com/docs/lang/nodejs-iojs - -environment: - matrix: - # node.js - - nodejs_version: "14" - - nodejs_version: "13" - - nodejs_version: "12" - - nodejs_version: "11" - - nodejs_version: "10" - - nodejs_version: "9" - - nodejs_version: "8" - - nodejs_version: "7" - - nodejs_version: "6" - - nodejs_version: "5" - - nodejs_version: "4" - - nodejs_version: "0.12" - - nodejs_version: "0.10" - -install: - - ps: Install-Product node $env:nodejs_version - - ps: if ($env:nodejs_version -eq '5') { npm i -g npm@4 } - - cmd: npm install - -test_script: - - node --version - - npm --version - - cmd: npm test - -build: off - -version: "{build}" diff --git a/package.json b/package.json index 6b2a51e..67dc975 100644 --- a/package.json +++ b/package.json @@ -2,19 +2,19 @@ "name": "copy-props", "version": "2.0.5", "description": "Copy properties deeply between two objects.", + "author": "Gulp Team (https://gulpjs.com/)", "main": "index.js", "files": [ "index.js" ], "scripts": { "lint": "eslint .", - "test": "mocha", - "coverage": "nyc --reporter=lcov --reporter=text-summary npm test", - "coveralls": "nyc --reporter=text-lcov npm test | coveralls", + "pretest": "npm run lint", + "test": "nyc mocha", "web:build": "browserify index.js --standalone copyProps -o web/copy-props.js && cd web && uglifyjs copy-props.js --compress --mangle -o copy-props.min.js --source-map url=copy-props.min.js.map", "chrome:install": "npm i --no-save mocha-chrome", "chrome:test": "mocha-chrome test/web/browser-test.html", - "build": "npm run lint && npm run coverage && npm run web:build && node test/web/make.js" + "build": "npm run lint && npm run test && npm run web:build && node test/web/make.js" }, "repository": { "type": "git", @@ -28,24 +28,34 @@ "map", "convert" ], - "author": "Gulp Team (https://gulpjs.com/)", "license": "MIT", + "engines": { + "node": ">= 10.13.0" + }, "bugs": { "url": "https://github.com/gulpjs/copy-props/issues" }, "homepage": "https://github.com/gulpjs/copy-props#readme", + "nyc": { + "reporter": [ + "lcov", + "text-summary" + ] + }, + "prettier": { + "singleQuote": true + }, "dependencies": { "each-props": "^1.3.2", "is-plain-object": "^5.0.0" }, "devDependencies": { - "browserify": "^16.5.2", - "chai": "^3.5.0", - "coveralls": "^3.1.0", - "eslint": "^7.9.0", + "browserify": "^17.0.0", + "chai": "^4.3.4", + "eslint": "^7.32.0", "eslint-config-gulp": "^5.0.1", - "mocha": "^3.5.3", + "mocha": "^8.4.0", "nyc": "^15.1.0", - "uglify-js": "^3.10.4" + "uglify-js": "^3.14.2" } } diff --git a/web/copy-props.min.js b/web/copy-props.min.js index bd809c7..183cf27 100644 --- a/web/copy-props.min.js +++ b/web/copy-props.min.js @@ -1,2 +1,2 @@ -!function(t){"object"==typeof exports&&"undefined"!=typeof module?module.exports=t():"function"==typeof define&&define.amd?define([],t):("undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:this).copyProps=t()}(function(){return function e(o,i,u){function c(r,t){if(!i[r]){if(!o[r]){var n="function"==typeof require&&require;if(!t&&n)return n(r,!0);if(f)return f(r,!0);throw(n=new Error("Cannot find module '"+r+"'")).code="MODULE_NOT_FOUND",n}n=i[r]={exports:{}},o[r][0].call(n.exports,function(t){return c(o[r][1][t]||t)},n,n.exports,e,o,i,u)}return i[r].exports}for(var f="function"==typeof require&&require,t=0;t