├── .babelrc ├── .eslintignore ├── .eslintrc ├── .gitattributes ├── .github ├── dependabot.yml └── workflows │ └── build.yml ├── .gitignore ├── .npmignore ├── .npmrc ├── .nvmrc ├── CHANGELOG.md ├── LICENSE ├── README.md ├── gulpfile.js ├── package.json ├── scripts ├── build │ └── index.js ├── changelog │ └── index.js ├── clean │ └── index.js ├── config.js ├── lint │ └── index.js ├── log │ └── index.js ├── release │ └── index.js └── test │ └── index.js ├── src └── index.js └── test ├── .eslintrc ├── fixtures ├── .appcache ├── js-bin.js ├── test.appcache ├── test.css ├── test.js ├── test.svg ├── test.txt └── test.xml ├── index.spec.js ├── it.spec.js └── utils ├── buffer.js ├── eol.js └── join-lines.js /.babelrc: -------------------------------------------------------------------------------- 1 | { 2 | "presets": [ 3 | [ 4 | "@babel/preset-env", { 5 | "modules": "cjs", 6 | "targets": { 7 | "node": "6" 8 | } 9 | } 10 | ] 11 | ] 12 | } 13 | -------------------------------------------------------------------------------- /.eslintignore: -------------------------------------------------------------------------------- 1 | ## 2 | # The MIT License (MIT) 3 | # 4 | # Copyright (c) 2017-2020 Mickael Jeanroy 5 | # 6 | # Permission is hereby granted, free of charge, to any person obtaining a copy 7 | # of this software and associated documentation files (the "Software"), to deal 8 | # in the Software without restriction, including without limitation the rights 9 | # to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 10 | # copies of the Software, and to permit persons to whom the Software is 11 | # furnished to do so, subject to the following conditions: 12 | # 13 | # The above copyright notice and this permission notice shall be included in 14 | # all copies or substantial portions of the Software. 15 | # 16 | # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | # IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 18 | # FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 19 | # AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 20 | # LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 21 | # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 22 | # THE SOFTWARE. 23 | ## 24 | 25 | /dist 26 | -------------------------------------------------------------------------------- /.eslintrc: -------------------------------------------------------------------------------- 1 | { 2 | "extends": [ 3 | "eslint:recommended", 4 | "airbnb-base" 5 | ], 6 | "env": { 7 | "node": true, 8 | "es6": true 9 | }, 10 | "rules": { 11 | "max-len": [2, 200, 2], 12 | 13 | "import/no-extraneous-dependencies": ["error", { 14 | "devDependencies": [ 15 | "scripts/**/*.js", 16 | "test/**/*.js", 17 | "gulpfile.js" 18 | ] 19 | }], 20 | 21 | "operator-linebreak": "off", 22 | "quote-props": ["error", "consistent-as-needed"], 23 | "no-plusplus": "off", 24 | "no-use-before-define": ["error", { 25 | "functions": false, 26 | "classes": true, 27 | "variables": true, 28 | "allowNamedExports": false 29 | }] 30 | } 31 | } 32 | -------------------------------------------------------------------------------- /.gitattributes: -------------------------------------------------------------------------------- 1 | ## 2 | # The MIT License (MIT) 3 | # 4 | # Copyright (c) 2017-2020 Mickael Jeanroy 5 | # 6 | # Permission is hereby granted, free of charge, to any person obtaining a copy 7 | # of this software and associated documentation files (the "Software"), to deal 8 | # in the Software without restriction, including without limitation the rights 9 | # to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 10 | # copies of the Software, and to permit persons to whom the Software is 11 | # furnished to do so, subject to the following conditions: 12 | # 13 | # The above copyright notice and this permission notice shall be included in 14 | # all copies or substantial portions of the Software. 15 | # 16 | # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | # IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 18 | # FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 19 | # AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 20 | # LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 21 | # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 22 | # THE SOFTWARE. 23 | ## 24 | 25 | *.js text eol=lf 26 | *.css text eol=lf 27 | *.xml text eol=lf 28 | *.svg text eol=lf 29 | *.txt text eol=lf 30 | -------------------------------------------------------------------------------- /.github/dependabot.yml: -------------------------------------------------------------------------------- 1 | ## 2 | # The MIT License (MIT) 3 | # 4 | # Copyright (c) 2017-2020 Mickael Jeanroy 5 | # 6 | # Permission is hereby granted, free of charge, to any person obtaining a copy 7 | # of this software and associated documentation files (the "Software"), to deal 8 | # in the Software without restriction, including without limitation the rights 9 | # to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 10 | # copies of the Software, and to permit persons to whom the Software is 11 | # furnished to do so, subject to the following conditions: 12 | # 13 | # The above copyright notice and this permission notice shall be included in 14 | # all copies or substantial portions of the Software. 15 | # 16 | # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | # IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 18 | # FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 19 | # AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 20 | # LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 21 | # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 22 | # THE SOFTWARE. 23 | ## 24 | 25 | # See: https://docs.github.com/en/code-security/supply-chain-security/configuration-options-for-dependency-updates 26 | 27 | version: 2 28 | updates: 29 | - package-ecosystem: npm 30 | directory: "/" 31 | schedule: 32 | interval: daily 33 | open-pull-requests-limit: 10 34 | groups: 35 | babel: 36 | patterns: 37 | - "@babel/*" 38 | -------------------------------------------------------------------------------- /.github/workflows/build.yml: -------------------------------------------------------------------------------- 1 | ## 2 | # The MIT License (MIT) 3 | # 4 | # Copyright (c) 2017-2020 Mickael Jeanroy 5 | # 6 | # Permission is hereby granted, free of charge, to any person obtaining a copy 7 | # of this software and associated documentation files (the "Software"), to deal 8 | # in the Software without restriction, including without limitation the rights 9 | # to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 10 | # copies of the Software, and to permit persons to whom the Software is 11 | # furnished to do so, subject to the following conditions: 12 | # 13 | # The above copyright notice and this permission notice shall be included in 14 | # all copies or substantial portions of the Software. 15 | # 16 | # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | # IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 18 | # FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 19 | # AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 20 | # LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 21 | # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 22 | # THE SOFTWARE. 23 | ## 24 | 25 | name: CI 26 | on: [push] 27 | jobs: 28 | build: 29 | runs-on: ${{ matrix.os }} 30 | strategy: 31 | matrix: 32 | # macos-latest runs on arm64 and do not support node < 18 33 | os: [ windows-latest, ubuntu-latest, macos-13 ] 34 | node: [ 14, 16, 18, 19, 20, 21 ] 35 | steps: 36 | - uses: actions/checkout@v4.1.2 37 | - uses: actions/setup-node@v4.0.2 38 | name: Set up NodeJS 39 | with: 40 | node-version: ${{ matrix.node }} 41 | - name: Install 42 | run: npm install 43 | - name: Test 44 | run: npm test -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | ## 2 | # The MIT License (MIT) 3 | # 4 | # Copyright (c) 2017-2020 Mickael Jeanroy 5 | # 6 | # Permission is hereby granted, free of charge, to any person obtaining a copy 7 | # of this software and associated documentation files (the "Software"), to deal 8 | # in the Software without restriction, including without limitation the rights 9 | # to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 10 | # copies of the Software, and to permit persons to whom the Software is 11 | # furnished to do so, subject to the following conditions: 12 | # 13 | # The above copyright notice and this permission notice shall be included in 14 | # all copies or substantial portions of the Software. 15 | # 16 | # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | # IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 18 | # FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 19 | # AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 20 | # LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 21 | # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 22 | # THE SOFTWARE. 23 | ## 24 | 25 | # IDE 26 | /.idea 27 | /.vscode 28 | *.iml 29 | 30 | # Build files 31 | /dist 32 | 33 | # Node / NPM 34 | /node_modules 35 | /npm-debug.log 36 | /package-lock.json 37 | 38 | # Logs 39 | *.log 40 | 41 | # OS 42 | .DS_Store 43 | -------------------------------------------------------------------------------- /.npmignore: -------------------------------------------------------------------------------- 1 | ## 2 | # The MIT License (MIT) 3 | # 4 | # Copyright (c) 2017-2020 Mickael Jeanroy 5 | # 6 | # Permission is hereby granted, free of charge, to any person obtaining a copy 7 | # of this software and associated documentation files (the "Software"), to deal 8 | # in the Software without restriction, including without limitation the rights 9 | # to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 10 | # copies of the Software, and to permit persons to whom the Software is 11 | # furnished to do so, subject to the following conditions: 12 | # 13 | # The above copyright notice and this permission notice shall be included in 14 | # all copies or substantial portions of the Software. 15 | # 16 | # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | # IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 18 | # FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 19 | # AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 20 | # LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 21 | # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 22 | # THE SOFTWARE. 23 | ## 24 | 25 | # NPM modules 26 | /node_modules 27 | 28 | # Dev files. 29 | /src 30 | /test 31 | /scripts 32 | /.babelrc 33 | /.eslintrc 34 | /.eslintignore 35 | /.gitattributes 36 | /.github 37 | /.idea 38 | /.npmrc 39 | /.nvmrc 40 | /.travis.yml 41 | /.vscode 42 | /gulpfile.js 43 | /*.iml 44 | 45 | # Logs 46 | *.log 47 | -------------------------------------------------------------------------------- /.npmrc: -------------------------------------------------------------------------------- 1 | ## 2 | # The MIT License (MIT) 3 | # 4 | # Copyright (c) 2017-2020 Mickael Jeanroy 5 | # 6 | # Permission is hereby granted, free of charge, to any person obtaining a copy 7 | # of this software and associated documentation files (the "Software"), to deal 8 | # in the Software without restriction, including without limitation the rights 9 | # to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 10 | # copies of the Software, and to permit persons to whom the Software is 11 | # furnished to do so, subject to the following conditions: 12 | # 13 | # The above copyright notice and this permission notice shall be included in 14 | # all copies or substantial portions of the Software. 15 | # 16 | # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | # IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 18 | # FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 19 | # AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 20 | # LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 21 | # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 22 | # THE SOFTWARE. 23 | ## 24 | 25 | package-lock=false 26 | save-exact=true 27 | -------------------------------------------------------------------------------- /.nvmrc: -------------------------------------------------------------------------------- 1 | 20.12.2 -------------------------------------------------------------------------------- /CHANGELOG.md: -------------------------------------------------------------------------------- 1 | ## 0.10.0 (2021-11-15) 2 | 3 | * release: prepare next release ([7125744](https://github.com/mjeanroy/gulp-header-comment/commit/7125744)) 4 | * release: release version ([a44b142](https://github.com/mjeanroy/gulp-header-comment/commit/a44b142)) 5 | * feat: add file name/dir in template args ([7d1850e](https://github.com/mjeanroy/gulp-header-comment/commit/7d1850e)) 6 | * feat: add file.relativePath ([daa18f1](https://github.com/mjeanroy/gulp-header-comment/commit/daa18f1)) 7 | * chore: update gitignore ([d79a658](https://github.com/mjeanroy/gulp-header-comment/commit/d79a658)) 8 | * chore(ci): add node 16 ([f1723ad](https://github.com/mjeanroy/gulp-header-comment/commit/f1723ad)) 9 | * chore(ci): add node 17 ([5413c47](https://github.com/mjeanroy/gulp-header-comment/commit/5413c47)) 10 | * chore(ci): remove node < 8 ([73a2bdd](https://github.com/mjeanroy/gulp-header-comment/commit/73a2bdd)) 11 | * chore(deps-dev): bump @babel/core from 7.12.10 to 7.12.13 ([34f8167](https://github.com/mjeanroy/gulp-header-comment/commit/34f8167)) 12 | * chore(deps-dev): bump @babel/core from 7.12.13 to 7.12.16 ([09d4ab0](https://github.com/mjeanroy/gulp-header-comment/commit/09d4ab0)) 13 | * chore(deps-dev): bump @babel/core from 7.12.16 to 7.12.17 ([be08d1c](https://github.com/mjeanroy/gulp-header-comment/commit/be08d1c)) 14 | * chore(deps-dev): bump @babel/core from 7.12.17 to 7.13.1 ([7ed6c9b](https://github.com/mjeanroy/gulp-header-comment/commit/7ed6c9b)) 15 | * chore(deps-dev): bump @babel/core from 7.13.1 to 7.13.8 ([5f38800](https://github.com/mjeanroy/gulp-header-comment/commit/5f38800)) 16 | * chore(deps-dev): bump @babel/core from 7.13.10 to 7.13.13 ([7cbc27c](https://github.com/mjeanroy/gulp-header-comment/commit/7cbc27c)) 17 | * chore(deps-dev): bump @babel/core from 7.13.13 to 7.13.14 ([5aca1ec](https://github.com/mjeanroy/gulp-header-comment/commit/5aca1ec)) 18 | * chore(deps-dev): bump @babel/core from 7.13.14 to 7.13.15 ([3c6cda4](https://github.com/mjeanroy/gulp-header-comment/commit/3c6cda4)) 19 | * chore(deps-dev): bump @babel/core from 7.13.15 to 7.13.16 ([907ae82](https://github.com/mjeanroy/gulp-header-comment/commit/907ae82)) 20 | * chore(deps-dev): bump @babel/core from 7.13.16 to 7.14.0 ([f316df0](https://github.com/mjeanroy/gulp-header-comment/commit/f316df0)) 21 | * chore(deps-dev): bump @babel/core from 7.13.8 to 7.13.10 ([687f853](https://github.com/mjeanroy/gulp-header-comment/commit/687f853)) 22 | * chore(deps-dev): bump @babel/core from 7.14.0 to 7.14.2 ([70a2edf](https://github.com/mjeanroy/gulp-header-comment/commit/70a2edf)) 23 | * chore(deps-dev): bump @babel/core from 7.14.2 to 7.14.3 ([3ffb15c](https://github.com/mjeanroy/gulp-header-comment/commit/3ffb15c)) 24 | * chore(deps-dev): bump @babel/core from 7.14.3 to 7.14.5 ([7183bf2](https://github.com/mjeanroy/gulp-header-comment/commit/7183bf2)) 25 | * chore(deps-dev): bump @babel/core from 7.14.5 to 7.14.6 ([826d8d2](https://github.com/mjeanroy/gulp-header-comment/commit/826d8d2)) 26 | * chore(deps-dev): bump @babel/core from 7.14.6 to 7.14.8 ([dabe8ee](https://github.com/mjeanroy/gulp-header-comment/commit/dabe8ee)) 27 | * chore(deps-dev): bump @babel/core from 7.14.8 to 7.15.0 ([f91f61c](https://github.com/mjeanroy/gulp-header-comment/commit/f91f61c)) 28 | * chore(deps-dev): bump @babel/core from 7.15.0 to 7.15.4 ([281460c](https://github.com/mjeanroy/gulp-header-comment/commit/281460c)) 29 | * chore(deps-dev): bump @babel/core from 7.15.4 to 7.15.5 ([c9c15a5](https://github.com/mjeanroy/gulp-header-comment/commit/c9c15a5)) 30 | * chore(deps-dev): bump @babel/core from 7.15.5 to 7.15.8 ([1685a0b](https://github.com/mjeanroy/gulp-header-comment/commit/1685a0b)) 31 | * chore(deps-dev): bump @babel/core from 7.15.8 to 7.16.0 ([15b896a](https://github.com/mjeanroy/gulp-header-comment/commit/15b896a)) 32 | * chore(deps-dev): bump @babel/preset-env from 7.12.11 to 7.12.13 ([230952e](https://github.com/mjeanroy/gulp-header-comment/commit/230952e)) 33 | * chore(deps-dev): bump @babel/preset-env from 7.12.13 to 7.12.16 ([f711ee3](https://github.com/mjeanroy/gulp-header-comment/commit/f711ee3)) 34 | * chore(deps-dev): bump @babel/preset-env from 7.12.16 to 7.12.17 ([2d8d28c](https://github.com/mjeanroy/gulp-header-comment/commit/2d8d28c)) 35 | * chore(deps-dev): bump @babel/preset-env from 7.12.17 to 7.13.5 ([0af0a04](https://github.com/mjeanroy/gulp-header-comment/commit/0af0a04)) 36 | * chore(deps-dev): bump @babel/preset-env from 7.13.10 to 7.13.12 ([256b1be](https://github.com/mjeanroy/gulp-header-comment/commit/256b1be)) 37 | * chore(deps-dev): bump @babel/preset-env from 7.13.12 to 7.13.15 ([3c001a0](https://github.com/mjeanroy/gulp-header-comment/commit/3c001a0)) 38 | * chore(deps-dev): bump @babel/preset-env from 7.13.15 to 7.14.0 ([7894d00](https://github.com/mjeanroy/gulp-header-comment/commit/7894d00)) 39 | * chore(deps-dev): bump @babel/preset-env from 7.13.5 to 7.13.9 ([6ae2858](https://github.com/mjeanroy/gulp-header-comment/commit/6ae2858)) 40 | * chore(deps-dev): bump @babel/preset-env from 7.13.9 to 7.13.10 ([f94030b](https://github.com/mjeanroy/gulp-header-comment/commit/f94030b)) 41 | * chore(deps-dev): bump @babel/preset-env from 7.14.0 to 7.14.1 ([b02c40f](https://github.com/mjeanroy/gulp-header-comment/commit/b02c40f)) 42 | * chore(deps-dev): bump @babel/preset-env from 7.14.1 to 7.14.2 ([55e0dc1](https://github.com/mjeanroy/gulp-header-comment/commit/55e0dc1)) 43 | * chore(deps-dev): bump @babel/preset-env from 7.14.2 to 7.14.4 ([943e169](https://github.com/mjeanroy/gulp-header-comment/commit/943e169)) 44 | * chore(deps-dev): bump @babel/preset-env from 7.14.4 to 7.14.5 ([5faffff](https://github.com/mjeanroy/gulp-header-comment/commit/5faffff)) 45 | * chore(deps-dev): bump @babel/preset-env from 7.14.5 to 7.14.7 ([996ca56](https://github.com/mjeanroy/gulp-header-comment/commit/996ca56)) 46 | * chore(deps-dev): bump @babel/preset-env from 7.14.7 to 7.14.8 ([196154f](https://github.com/mjeanroy/gulp-header-comment/commit/196154f)) 47 | * chore(deps-dev): bump @babel/preset-env from 7.14.8 to 7.15.0 ([32d20b2](https://github.com/mjeanroy/gulp-header-comment/commit/32d20b2)) 48 | * chore(deps-dev): bump @babel/preset-env from 7.15.0 to 7.15.4 ([239cc3b](https://github.com/mjeanroy/gulp-header-comment/commit/239cc3b)) 49 | * chore(deps-dev): bump @babel/preset-env from 7.15.4 to 7.15.6 ([7345824](https://github.com/mjeanroy/gulp-header-comment/commit/7345824)) 50 | * chore(deps-dev): bump @babel/preset-env from 7.15.6 to 7.15.8 ([8d26ed9](https://github.com/mjeanroy/gulp-header-comment/commit/8d26ed9)) 51 | * chore(deps-dev): bump @babel/preset-env from 7.15.8 to 7.16.0 ([3e5d022](https://github.com/mjeanroy/gulp-header-comment/commit/3e5d022)) 52 | * chore(deps-dev): bump @babel/register from 7.12.10 to 7.12.13 ([1d9751c](https://github.com/mjeanroy/gulp-header-comment/commit/1d9751c)) 53 | * chore(deps-dev): bump @babel/register from 7.12.13 to 7.13.0 ([83b04d6](https://github.com/mjeanroy/gulp-header-comment/commit/83b04d6)) 54 | * chore(deps-dev): bump @babel/register from 7.13.0 to 7.13.8 ([0bdbe2f](https://github.com/mjeanroy/gulp-header-comment/commit/0bdbe2f)) 55 | * chore(deps-dev): bump @babel/register from 7.13.14 to 7.13.16 ([47d118e](https://github.com/mjeanroy/gulp-header-comment/commit/47d118e)) 56 | * chore(deps-dev): bump @babel/register from 7.13.16 to 7.14.5 ([a8089c7](https://github.com/mjeanroy/gulp-header-comment/commit/a8089c7)) 57 | * chore(deps-dev): bump @babel/register from 7.13.8 to 7.13.14 ([0be4750](https://github.com/mjeanroy/gulp-header-comment/commit/0be4750)) 58 | * chore(deps-dev): bump @babel/register from 7.14.5 to 7.15.3 ([f281245](https://github.com/mjeanroy/gulp-header-comment/commit/f281245)) 59 | * chore(deps-dev): bump @babel/register from 7.15.3 to 7.16.0 ([e30641c](https://github.com/mjeanroy/gulp-header-comment/commit/e30641c)) 60 | * chore(deps-dev): bump eslint from 7.16.0 to 7.17.0 ([f4ef692](https://github.com/mjeanroy/gulp-header-comment/commit/f4ef692)) 61 | * chore(deps-dev): bump eslint from 7.17.0 to 7.18.0 ([52c9e83](https://github.com/mjeanroy/gulp-header-comment/commit/52c9e83)) 62 | * chore(deps-dev): bump eslint from 7.18.0 to 7.19.0 ([006e4d4](https://github.com/mjeanroy/gulp-header-comment/commit/006e4d4)) 63 | * chore(deps-dev): bump eslint from 7.19.0 to 7.20.0 ([db85276](https://github.com/mjeanroy/gulp-header-comment/commit/db85276)) 64 | * chore(deps-dev): bump eslint from 7.20.0 to 7.21.0 ([466dcd3](https://github.com/mjeanroy/gulp-header-comment/commit/466dcd3)) 65 | * chore(deps-dev): bump eslint from 7.21.0 to 7.22.0 ([5c05e56](https://github.com/mjeanroy/gulp-header-comment/commit/5c05e56)) 66 | * chore(deps-dev): bump eslint from 7.22.0 to 7.23.0 ([333c3dd](https://github.com/mjeanroy/gulp-header-comment/commit/333c3dd)) 67 | * chore(deps-dev): bump eslint from 7.23.0 to 7.24.0 ([ef79074](https://github.com/mjeanroy/gulp-header-comment/commit/ef79074)) 68 | * chore(deps-dev): bump eslint from 7.24.0 to 7.25.0 ([304d064](https://github.com/mjeanroy/gulp-header-comment/commit/304d064)) 69 | * chore(deps-dev): bump eslint from 7.25.0 to 7.26.0 ([9e2d0e6](https://github.com/mjeanroy/gulp-header-comment/commit/9e2d0e6)) 70 | * chore(deps-dev): bump eslint from 7.26.0 to 7.27.0 ([de9741b](https://github.com/mjeanroy/gulp-header-comment/commit/de9741b)) 71 | * chore(deps-dev): bump eslint from 7.27.0 to 7.28.0 ([39bedd3](https://github.com/mjeanroy/gulp-header-comment/commit/39bedd3)) 72 | * chore(deps-dev): bump eslint from 7.28.0 to 7.29.0 ([fae0032](https://github.com/mjeanroy/gulp-header-comment/commit/fae0032)) 73 | * chore(deps-dev): bump eslint from 7.29.0 to 7.30.0 ([b056950](https://github.com/mjeanroy/gulp-header-comment/commit/b056950)) 74 | * chore(deps-dev): bump eslint from 7.30.0 to 7.31.0 ([49824d8](https://github.com/mjeanroy/gulp-header-comment/commit/49824d8)) 75 | * chore(deps-dev): bump eslint from 7.31.0 to 7.32.0 ([8f3af29](https://github.com/mjeanroy/gulp-header-comment/commit/8f3af29)) 76 | * chore(deps-dev): bump eslint from 7.32.0 to 8.0.0 ([f269da2](https://github.com/mjeanroy/gulp-header-comment/commit/f269da2)) 77 | * chore(deps-dev): bump eslint from 8.0.0 to 8.0.1 ([f085ea2](https://github.com/mjeanroy/gulp-header-comment/commit/f085ea2)) 78 | * chore(deps-dev): bump eslint from 8.0.1 to 8.1.0 ([0ae18e8](https://github.com/mjeanroy/gulp-header-comment/commit/0ae18e8)) 79 | * chore(deps-dev): bump eslint from 8.1.0 to 8.2.0 ([be04488](https://github.com/mjeanroy/gulp-header-comment/commit/be04488)) 80 | * chore(deps-dev): bump jasmine-core from 3.10.0 to 3.10.1 ([ebf0f9c](https://github.com/mjeanroy/gulp-header-comment/commit/ebf0f9c)) 81 | * chore(deps-dev): bump jasmine-core from 3.6.0 to 3.7.0 ([d4c5f04](https://github.com/mjeanroy/gulp-header-comment/commit/d4c5f04)) 82 | * chore(deps-dev): bump jasmine-core from 3.7.0 to 3.7.1 ([16c37dd](https://github.com/mjeanroy/gulp-header-comment/commit/16c37dd)) 83 | * chore(deps-dev): bump jasmine-core from 3.7.1 to 3.8.0 ([7f55d87](https://github.com/mjeanroy/gulp-header-comment/commit/7f55d87)) 84 | * chore(deps-dev): bump jasmine-core from 3.8.0 to 3.9.0 ([7a84653](https://github.com/mjeanroy/gulp-header-comment/commit/7a84653)) 85 | * chore(deps-dev): bump jasmine-core from 3.9.0 to 3.10.0 ([8e64ef9](https://github.com/mjeanroy/gulp-header-comment/commit/8e64ef9)) 86 | * chore(deps): bump lodash from 4.17.20 to 4.17.21 ([a99443a](https://github.com/mjeanroy/gulp-header-comment/commit/a99443a)) 87 | * tests: remove deprecated call to new Buffer ([40c0e14](https://github.com/mjeanroy/gulp-header-comment/commit/40c0e14)) 88 | * fix: fix default encoding, use what is provided by through2 pkg ([9782c00](https://github.com/mjeanroy/gulp-header-comment/commit/9782c00)) 89 | * Upgrade to GitHub-native Dependabot ([7455366](https://github.com/mjeanroy/gulp-header-comment/commit/7455366)) 90 | 91 | 92 | 93 | ## 0.9.0 (2020-12-28) 94 | 95 | * release: prepare next release ([39d0b35](https://github.com/mjeanroy/gulp-header-comment/commit/39d0b35)) 96 | * release: release version ([54545c6](https://github.com/mjeanroy/gulp-header-comment/commit/54545c6)) 97 | * Add test for js file file with hashbang ([ff970ad](https://github.com/mjeanroy/gulp-header-comment/commit/ff970ad)) 98 | * Delete .DS_Store ([6f4b826](https://github.com/mjeanroy/gulp-header-comment/commit/6f4b826)) 99 | * feat: Update prologCheckers js ([678a82e](https://github.com/mjeanroy/gulp-header-comment/commit/678a82e)) 100 | * chore: fix jasmine to version 3.6.1 ([2025cdf](https://github.com/mjeanroy/gulp-header-comment/commit/2025cdf)) 101 | * chore(ci): add node 15 ([2e24ee1](https://github.com/mjeanroy/gulp-header-comment/commit/2e24ee1)) 102 | * chore(ci): fix typo ([ea94e22](https://github.com/mjeanroy/gulp-header-comment/commit/ea94e22)) 103 | * chore(deps-dev): bump @babel/core from 7.10.2 to 7.10.3 ([86ee669](https://github.com/mjeanroy/gulp-header-comment/commit/86ee669)) 104 | * chore(deps-dev): bump @babel/core from 7.10.3 to 7.10.4 ([197a574](https://github.com/mjeanroy/gulp-header-comment/commit/197a574)) 105 | * chore(deps-dev): bump @babel/core from 7.10.4 to 7.10.5 ([b43b17d](https://github.com/mjeanroy/gulp-header-comment/commit/b43b17d)) 106 | * chore(deps-dev): bump @babel/core from 7.10.5 to 7.11.0 ([998d661](https://github.com/mjeanroy/gulp-header-comment/commit/998d661)) 107 | * chore(deps-dev): bump @babel/core from 7.11.0 to 7.11.1 ([6406d57](https://github.com/mjeanroy/gulp-header-comment/commit/6406d57)) 108 | * chore(deps-dev): bump @babel/core from 7.11.1 to 7.11.4 ([c1a2f5a](https://github.com/mjeanroy/gulp-header-comment/commit/c1a2f5a)) 109 | * chore(deps-dev): bump @babel/core from 7.11.4 to 7.11.5 ([f2eab4d](https://github.com/mjeanroy/gulp-header-comment/commit/f2eab4d)) 110 | * chore(deps-dev): bump @babel/core from 7.11.5 to 7.11.6 ([3437662](https://github.com/mjeanroy/gulp-header-comment/commit/3437662)) 111 | * chore(deps-dev): bump @babel/core from 7.11.6 to 7.12.0 ([b365a36](https://github.com/mjeanroy/gulp-header-comment/commit/b365a36)) 112 | * chore(deps-dev): bump @babel/core from 7.12.0 to 7.12.3 ([eaf1572](https://github.com/mjeanroy/gulp-header-comment/commit/eaf1572)) 113 | * chore(deps-dev): bump @babel/core from 7.12.3 to 7.12.9 ([aa71fe8](https://github.com/mjeanroy/gulp-header-comment/commit/aa71fe8)) 114 | * chore(deps-dev): bump @babel/core from 7.12.9 to 7.12.10 ([8d82846](https://github.com/mjeanroy/gulp-header-comment/commit/8d82846)) 115 | * chore(deps-dev): bump @babel/preset-env from 7.10.2 to 7.10.3 ([c20d91c](https://github.com/mjeanroy/gulp-header-comment/commit/c20d91c)) 116 | * chore(deps-dev): bump @babel/preset-env from 7.10.3 to 7.10.4 ([1894ecb](https://github.com/mjeanroy/gulp-header-comment/commit/1894ecb)) 117 | * chore(deps-dev): bump @babel/preset-env from 7.10.4 to 7.11.0 ([e90e0c8](https://github.com/mjeanroy/gulp-header-comment/commit/e90e0c8)) 118 | * chore(deps-dev): bump @babel/preset-env from 7.11.0 to 7.11.5 ([e4486f6](https://github.com/mjeanroy/gulp-header-comment/commit/e4486f6)) 119 | * chore(deps-dev): bump @babel/preset-env from 7.11.5 to 7.12.0 ([924fd54](https://github.com/mjeanroy/gulp-header-comment/commit/924fd54)) 120 | * chore(deps-dev): bump @babel/preset-env from 7.12.0 to 7.12.1 ([2c78520](https://github.com/mjeanroy/gulp-header-comment/commit/2c78520)) 121 | * chore(deps-dev): bump @babel/preset-env from 7.12.1 to 7.12.7 ([c9e68bd](https://github.com/mjeanroy/gulp-header-comment/commit/c9e68bd)) 122 | * chore(deps-dev): bump @babel/preset-env from 7.12.10 to 7.12.11 ([82274f9](https://github.com/mjeanroy/gulp-header-comment/commit/82274f9)) 123 | * chore(deps-dev): bump @babel/preset-env from 7.12.7 to 7.12.10 ([8a1982a](https://github.com/mjeanroy/gulp-header-comment/commit/8a1982a)) 124 | * chore(deps-dev): bump @babel/register from 7.10.1 to 7.10.3 ([9398006](https://github.com/mjeanroy/gulp-header-comment/commit/9398006)) 125 | * chore(deps-dev): bump @babel/register from 7.10.3 to 7.10.4 ([d688c30](https://github.com/mjeanroy/gulp-header-comment/commit/d688c30)) 126 | * chore(deps-dev): bump @babel/register from 7.10.4 to 7.10.5 ([fd4049a](https://github.com/mjeanroy/gulp-header-comment/commit/fd4049a)) 127 | * chore(deps-dev): bump @babel/register from 7.10.5 to 7.11.5 ([892d86c](https://github.com/mjeanroy/gulp-header-comment/commit/892d86c)) 128 | * chore(deps-dev): bump @babel/register from 7.11.5 to 7.12.1 ([7fcae74](https://github.com/mjeanroy/gulp-header-comment/commit/7fcae74)) 129 | * chore(deps-dev): bump @babel/register from 7.12.1 to 7.12.10 ([2ce3821](https://github.com/mjeanroy/gulp-header-comment/commit/2ce3821)) 130 | * chore(deps-dev): bump eslint from 6.8.0 to 7.1.0 ([98f5bb7](https://github.com/mjeanroy/gulp-header-comment/commit/98f5bb7)) 131 | * chore(deps-dev): bump eslint from 7.1.0 to 7.2.0 ([d064f28](https://github.com/mjeanroy/gulp-header-comment/commit/d064f28)) 132 | * chore(deps-dev): bump eslint from 7.10.0 to 7.11.0 ([73697c5](https://github.com/mjeanroy/gulp-header-comment/commit/73697c5)) 133 | * chore(deps-dev): bump eslint from 7.11.0 to 7.12.0 ([6fb9be6](https://github.com/mjeanroy/gulp-header-comment/commit/6fb9be6)) 134 | * chore(deps-dev): bump eslint from 7.12.0 to 7.12.1 ([4e04f74](https://github.com/mjeanroy/gulp-header-comment/commit/4e04f74)) 135 | * chore(deps-dev): bump eslint from 7.12.1 to 7.13.0 ([f28c9f4](https://github.com/mjeanroy/gulp-header-comment/commit/f28c9f4)) 136 | * chore(deps-dev): bump eslint from 7.13.0 to 7.14.0 ([033a92b](https://github.com/mjeanroy/gulp-header-comment/commit/033a92b)) 137 | * chore(deps-dev): bump eslint from 7.14.0 to 7.15.0 ([bffc5ad](https://github.com/mjeanroy/gulp-header-comment/commit/bffc5ad)) 138 | * chore(deps-dev): bump eslint from 7.15.0 to 7.16.0 ([f7540ad](https://github.com/mjeanroy/gulp-header-comment/commit/f7540ad)) 139 | * chore(deps-dev): bump eslint from 7.2.0 to 7.3.1 ([5a56d23](https://github.com/mjeanroy/gulp-header-comment/commit/5a56d23)) 140 | * chore(deps-dev): bump eslint from 7.3.1 to 7.4.0 ([6c0c7f1](https://github.com/mjeanroy/gulp-header-comment/commit/6c0c7f1)) 141 | * chore(deps-dev): bump eslint from 7.4.0 to 7.5.0 ([b9f9437](https://github.com/mjeanroy/gulp-header-comment/commit/b9f9437)) 142 | * chore(deps-dev): bump eslint from 7.5.0 to 7.6.0 ([da957ed](https://github.com/mjeanroy/gulp-header-comment/commit/da957ed)) 143 | * chore(deps-dev): bump eslint from 7.6.0 to 7.7.0 ([854209a](https://github.com/mjeanroy/gulp-header-comment/commit/854209a)) 144 | * chore(deps-dev): bump eslint from 7.7.0 to 7.8.1 ([42c6ed3](https://github.com/mjeanroy/gulp-header-comment/commit/42c6ed3)) 145 | * chore(deps-dev): bump eslint from 7.8.1 to 7.9.0 ([9da5494](https://github.com/mjeanroy/gulp-header-comment/commit/9da5494)) 146 | * chore(deps-dev): bump eslint from 7.9.0 to 7.10.0 ([9cbc7ea](https://github.com/mjeanroy/gulp-header-comment/commit/9cbc7ea)) 147 | * chore(deps-dev): bump gulp-bump from 3.1.3 to 3.2.0 ([a51e5e7](https://github.com/mjeanroy/gulp-header-comment/commit/a51e5e7)) 148 | * chore(deps-dev): bump gulp-conventional-changelog from 2.0.32 to 2.0.35 ([033dd00](https://github.com/mjeanroy/gulp-header-comment/commit/033dd00)) 149 | * chore(deps-dev): bump gulp-sourcemaps from 2.6.5 to 3.0.0 ([83ba35b](https://github.com/mjeanroy/gulp-header-comment/commit/83ba35b)) 150 | * chore(deps-dev): bump jasmine-core from 3.5.0 to 3.6.0 ([f24d967](https://github.com/mjeanroy/gulp-header-comment/commit/f24d967)) 151 | * chore(deps-dev): bump vinyl from 2.2.0 to 2.2.1 ([b3ea989](https://github.com/mjeanroy/gulp-header-comment/commit/b3ea989)) 152 | * chore(deps): bump lodash from 4.17.15 to 4.17.19 ([c43a7ce](https://github.com/mjeanroy/gulp-header-comment/commit/c43a7ce)) 153 | * chore(deps): bump lodash from 4.17.19 to 4.17.20 ([fe111c3](https://github.com/mjeanroy/gulp-header-comment/commit/fe111c3)) 154 | * chore(deps): bump moment from 2.25.1 to 2.26.0 ([f70fce9](https://github.com/mjeanroy/gulp-header-comment/commit/f70fce9)) 155 | * chore(deps): bump moment from 2.26.0 to 2.27.0 ([a6a6d2b](https://github.com/mjeanroy/gulp-header-comment/commit/a6a6d2b)) 156 | * chore(deps): bump moment from 2.27.0 to 2.28.0 ([e9356c7](https://github.com/mjeanroy/gulp-header-comment/commit/e9356c7)) 157 | * chore(deps): bump moment from 2.28.0 to 2.29.0 ([e39fe71](https://github.com/mjeanroy/gulp-header-comment/commit/e39fe71)) 158 | * chore(deps): bump moment from 2.29.0 to 2.29.1 ([9229fb7](https://github.com/mjeanroy/gulp-header-comment/commit/9229fb7)) 159 | * chore(deps): bump through2 from 3.0.1 to 3.0.2 ([2db44a4](https://github.com/mjeanroy/gulp-header-comment/commit/2db44a4)) 160 | * chore(deps): bump through2 from 3.0.2 to 4.0.2 ([1854184](https://github.com/mjeanroy/gulp-header-comment/commit/1854184)) 161 | * chore(package): update @babel/core to version 7.10.2 ([92799fe](https://github.com/mjeanroy/gulp-header-comment/commit/92799fe)) 162 | * chore(package): update @babel/preset-env to version 7.10.2 ([954aa73](https://github.com/mjeanroy/gulp-header-comment/commit/954aa73)) 163 | * chore(package): update @babel/register to version 7.10.1 ([1eedefc](https://github.com/mjeanroy/gulp-header-comment/commit/1eedefc)), closes [#226](https://github.com/mjeanroy/gulp-header-comment/issues/226) 164 | * docs: update changelog ([31b56d9](https://github.com/mjeanroy/gulp-header-comment/commit/31b56d9)) 165 | * docs: update README ([230aec0](https://github.com/mjeanroy/gulp-header-comment/commit/230aec0)) 166 | 167 | 168 | 169 | ## 0.8.0 (2020-05-17) 170 | 171 | * release: prepare next release ([e38fa5c](https://github.com/mjeanroy/gulp-header-comment/commit/e38fa5c)) 172 | * release: release version ([b15d7df](https://github.com/mjeanroy/gulp-header-comment/commit/b15d7df)) 173 | * refactor: replace new Buffer with Buffer.from ([4133980](https://github.com/mjeanroy/gulp-header-comment/commit/4133980)) 174 | * feat: handle gulp-sourcemaps ([82b7342](https://github.com/mjeanroy/gulp-header-comment/commit/82b7342)), closes [#225](https://github.com/mjeanroy/gulp-header-comment/issues/225) 175 | * chore: support only node >= 6 ([70602f1](https://github.com/mjeanroy/gulp-header-comment/commit/70602f1)) 176 | * chore(package): update gulp-conventional-changelog to version 2.0.32 ([01e08af](https://github.com/mjeanroy/gulp-header-comment/commit/01e08af)) 177 | 178 | 179 | 180 | ## 0.7.0 (2020-05-03) 181 | 182 | * release: prepare next release ([f51118f](https://github.com/mjeanroy/gulp-header-comment/commit/f51118f)) 183 | * release: release version ([682e2d6](https://github.com/mjeanroy/gulp-header-comment/commit/682e2d6)) 184 | * docs: update copyright header ([2924986](https://github.com/mjeanroy/gulp-header-comment/commit/2924986)) 185 | * test: add integration test ([fafbbd7](https://github.com/mjeanroy/gulp-header-comment/commit/fafbbd7)) 186 | * test: remove unused variable ([5ed5a5b](https://github.com/mjeanroy/gulp-header-comment/commit/5ed5a5b)) 187 | * chore: add changelogs ([511a146](https://github.com/mjeanroy/gulp-header-comment/commit/511a146)) 188 | * chore: add gitattributes ([6f03dfc](https://github.com/mjeanroy/gulp-header-comment/commit/6f03dfc)) 189 | * chore: add node 13 to the travis matrix ([c0237f7](https://github.com/mjeanroy/gulp-header-comment/commit/c0237f7)) 190 | * chore: remove babel target ([a3fdda0](https://github.com/mjeanroy/gulp-header-comment/commit/a3fdda0)) 191 | * chore: remove outdated node version ([72c26e3](https://github.com/mjeanroy/gulp-header-comment/commit/72c26e3)) 192 | * chore: remove useless dev dependencies ([980a9f2](https://github.com/mjeanroy/gulp-header-comment/commit/980a9f2)) 193 | * chore: support node >= 6 ([5772a08](https://github.com/mjeanroy/gulp-header-comment/commit/5772a08)) 194 | * chore: update moment to version 2.25.1 ([d9fde69](https://github.com/mjeanroy/gulp-header-comment/commit/d9fde69)) 195 | * chore: update npmignore ([fd329bd](https://github.com/mjeanroy/gulp-header-comment/commit/fd329bd)) 196 | * chore(build): use @babel/register ([4ce7b3b](https://github.com/mjeanroy/gulp-header-comment/commit/4ce7b3b)) 197 | * chore(package): remove fs-extra dependency ([b4608d0](https://github.com/mjeanroy/gulp-header-comment/commit/b4608d0)) 198 | * chore(package): update @babel/core to version 7.5.0 ([d1110b6](https://github.com/mjeanroy/gulp-header-comment/commit/d1110b6)) 199 | * chore(package): update @babel/core to version 7.5.4 ([18120af](https://github.com/mjeanroy/gulp-header-comment/commit/18120af)), closes [#175](https://github.com/mjeanroy/gulp-header-comment/issues/175) 200 | * chore(package): update @babel/core to version 7.5.5 ([abb6657](https://github.com/mjeanroy/gulp-header-comment/commit/abb6657)), closes [#179](https://github.com/mjeanroy/gulp-header-comment/issues/179) 201 | * chore(package): update @babel/core to version 7.6.0 ([122f680](https://github.com/mjeanroy/gulp-header-comment/commit/122f680)), closes [#189](https://github.com/mjeanroy/gulp-header-comment/issues/189) 202 | * chore(package): update @babel/core to version 7.6.2 ([72b592c](https://github.com/mjeanroy/gulp-header-comment/commit/72b592c)), closes [#193](https://github.com/mjeanroy/gulp-header-comment/issues/193) 203 | * chore(package): update @babel/core to version 7.6.4 ([eb81b08](https://github.com/mjeanroy/gulp-header-comment/commit/eb81b08)), closes [#197](https://github.com/mjeanroy/gulp-header-comment/issues/197) 204 | * chore(package): update @babel/core to version 7.7.2 ([6156f5b](https://github.com/mjeanroy/gulp-header-comment/commit/6156f5b)), closes [#200](https://github.com/mjeanroy/gulp-header-comment/issues/200) 205 | * chore(package): update @babel/core to version 7.7.4 ([df6e3d5](https://github.com/mjeanroy/gulp-header-comment/commit/df6e3d5)) 206 | * chore(package): update @babel/core to version 7.7.5 ([02407a5](https://github.com/mjeanroy/gulp-header-comment/commit/02407a5)) 207 | * chore(package): update @babel/core to version 7.7.7 ([f24465b](https://github.com/mjeanroy/gulp-header-comment/commit/f24465b)) 208 | * chore(package): update @babel/core to version 7.8.0 ([6e0f7fa](https://github.com/mjeanroy/gulp-header-comment/commit/6e0f7fa)) 209 | * chore(package): update @babel/core to version 7.8.4 ([42223c0](https://github.com/mjeanroy/gulp-header-comment/commit/42223c0)) 210 | * chore(package): update @babel/core to version 7.8.6 ([2489850](https://github.com/mjeanroy/gulp-header-comment/commit/2489850)), closes [#215](https://github.com/mjeanroy/gulp-header-comment/issues/215) 211 | * chore(package): update @babel/core to version 7.8.7 ([22590e4](https://github.com/mjeanroy/gulp-header-comment/commit/22590e4)) 212 | * chore(package): update @babel/core to version 7.9.0 ([127d2cc](https://github.com/mjeanroy/gulp-header-comment/commit/127d2cc)), closes [#219](https://github.com/mjeanroy/gulp-header-comment/issues/219) 213 | * chore(package): update @babel/core to version 7.9.6 ([f75234d](https://github.com/mjeanroy/gulp-header-comment/commit/f75234d)) 214 | * chore(package): update @babel/preset-env to version 7.5.0 ([7c1c6ba](https://github.com/mjeanroy/gulp-header-comment/commit/7c1c6ba)), closes [#172](https://github.com/mjeanroy/gulp-header-comment/issues/172) 215 | * chore(package): update @babel/preset-env to version 7.5.4 ([e20a095](https://github.com/mjeanroy/gulp-header-comment/commit/e20a095)), closes [#175](https://github.com/mjeanroy/gulp-header-comment/issues/175) 216 | * chore(package): update @babel/preset-env to version 7.5.5 ([456ea1c](https://github.com/mjeanroy/gulp-header-comment/commit/456ea1c)), closes [#179](https://github.com/mjeanroy/gulp-header-comment/issues/179) 217 | * chore(package): update @babel/preset-env to version 7.6.0 ([b174ce6](https://github.com/mjeanroy/gulp-header-comment/commit/b174ce6)), closes [#189](https://github.com/mjeanroy/gulp-header-comment/issues/189) 218 | * chore(package): update @babel/preset-env to version 7.6.2 ([ca8827c](https://github.com/mjeanroy/gulp-header-comment/commit/ca8827c)), closes [#193](https://github.com/mjeanroy/gulp-header-comment/issues/193) 219 | * chore(package): update @babel/preset-env to version 7.6.3 ([a795c53](https://github.com/mjeanroy/gulp-header-comment/commit/a795c53)), closes [#197](https://github.com/mjeanroy/gulp-header-comment/issues/197) 220 | * chore(package): update @babel/preset-env to version 7.7.1 ([d234ce5](https://github.com/mjeanroy/gulp-header-comment/commit/d234ce5)) 221 | * chore(package): update @babel/preset-env to version 7.7.4 ([86421a9](https://github.com/mjeanroy/gulp-header-comment/commit/86421a9)) 222 | * chore(package): update @babel/preset-env to version 7.7.5 ([f91c52f](https://github.com/mjeanroy/gulp-header-comment/commit/f91c52f)) 223 | * chore(package): update @babel/preset-env to version 7.7.6 ([c306262](https://github.com/mjeanroy/gulp-header-comment/commit/c306262)) 224 | * chore(package): update @babel/preset-env to version 7.7.7 ([1e69bc4](https://github.com/mjeanroy/gulp-header-comment/commit/1e69bc4)) 225 | * chore(package): update @babel/preset-env to version 7.8.0 ([269c873](https://github.com/mjeanroy/gulp-header-comment/commit/269c873)) 226 | * chore(package): update @babel/preset-env to version 7.8.2 ([36ae788](https://github.com/mjeanroy/gulp-header-comment/commit/36ae788)), closes [#212](https://github.com/mjeanroy/gulp-header-comment/issues/212) 227 | * chore(package): update @babel/preset-env to version 7.8.4 ([2345a96](https://github.com/mjeanroy/gulp-header-comment/commit/2345a96)) 228 | * chore(package): update @babel/preset-env to version 7.8.6 ([c4ed54e](https://github.com/mjeanroy/gulp-header-comment/commit/c4ed54e)) 229 | * chore(package): update @babel/preset-env to version 7.8.7 ([80c43b3](https://github.com/mjeanroy/gulp-header-comment/commit/80c43b3)) 230 | * chore(package): update @babel/preset-env to version 7.9.0 ([e8ae2dd](https://github.com/mjeanroy/gulp-header-comment/commit/e8ae2dd)), closes [#219](https://github.com/mjeanroy/gulp-header-comment/issues/219) 231 | * chore(package): update @babel/preset-env to version 7.9.5 ([cf8b793](https://github.com/mjeanroy/gulp-header-comment/commit/cf8b793)) 232 | * chore(package): update @babel/preset-env to version 7.9.6 ([c2a5027](https://github.com/mjeanroy/gulp-header-comment/commit/c2a5027)) 233 | * chore(package): update del to version 5.0.0 ([7fea0f5](https://github.com/mjeanroy/gulp-header-comment/commit/7fea0f5)) 234 | * chore(package): update del to version 5.1.0 ([5cb8c1f](https://github.com/mjeanroy/gulp-header-comment/commit/5cb8c1f)) 235 | * chore(package): update eslint to version 6.0.0 ([1f78e23](https://github.com/mjeanroy/gulp-header-comment/commit/1f78e23)) 236 | * chore(package): update eslint to version 6.0.1 ([6f11622](https://github.com/mjeanroy/gulp-header-comment/commit/6f11622)) 237 | * chore(package): update eslint to version 6.1.0 ([72719e7](https://github.com/mjeanroy/gulp-header-comment/commit/72719e7)) 238 | * chore(package): update eslint to version 6.2.0 ([2165321](https://github.com/mjeanroy/gulp-header-comment/commit/2165321)) 239 | * chore(package): update eslint to version 6.2.1 ([ee60748](https://github.com/mjeanroy/gulp-header-comment/commit/ee60748)) 240 | * chore(package): update eslint to version 6.2.2 ([228f6fd](https://github.com/mjeanroy/gulp-header-comment/commit/228f6fd)) 241 | * chore(package): update eslint to version 6.3.0 ([6e2513a](https://github.com/mjeanroy/gulp-header-comment/commit/6e2513a)) 242 | * chore(package): update eslint to version 6.4.0 ([8e9ea63](https://github.com/mjeanroy/gulp-header-comment/commit/8e9ea63)) 243 | * chore(package): update eslint to version 6.5.0 ([ea2d68a](https://github.com/mjeanroy/gulp-header-comment/commit/ea2d68a)) 244 | * chore(package): update eslint to version 6.5.1 ([9fb6fad](https://github.com/mjeanroy/gulp-header-comment/commit/9fb6fad)) 245 | * chore(package): update eslint to version 6.6.0 ([ddd988c](https://github.com/mjeanroy/gulp-header-comment/commit/ddd988c)) 246 | * chore(package): update eslint to version 6.7.0 ([fece11c](https://github.com/mjeanroy/gulp-header-comment/commit/fece11c)) 247 | * chore(package): update eslint to version 6.7.1 ([0c08d07](https://github.com/mjeanroy/gulp-header-comment/commit/0c08d07)) 248 | * chore(package): update eslint to version 6.7.2 ([d9b6487](https://github.com/mjeanroy/gulp-header-comment/commit/d9b6487)) 249 | * chore(package): update eslint to version 6.8.0 ([721b434](https://github.com/mjeanroy/gulp-header-comment/commit/721b434)) 250 | * chore(package): update eslint-config-google to version 0.14.0 ([7226905](https://github.com/mjeanroy/gulp-header-comment/commit/7226905)) 251 | * chore(package): update gulp-eslint to version 6.0.0 ([574d3a1](https://github.com/mjeanroy/gulp-header-comment/commit/574d3a1)) 252 | * chore(package): update gulp-git to version 2.10.0 ([7963124](https://github.com/mjeanroy/gulp-header-comment/commit/7963124)) 253 | * chore(package): update gulp-git to version 2.10.1 ([b3756f7](https://github.com/mjeanroy/gulp-header-comment/commit/b3756f7)) 254 | * chore(package): update jasmine-core to version 3.5.0 ([2c9c981](https://github.com/mjeanroy/gulp-header-comment/commit/2c9c981)) 255 | * ci: add github actions ([59ddf52](https://github.com/mjeanroy/gulp-header-comment/commit/59ddf52)) 256 | * ci: add node 14 ([1aeb447](https://github.com/mjeanroy/gulp-header-comment/commit/1aeb447)) 257 | * ci: add node 6 and node 7 ([571acfa](https://github.com/mjeanroy/gulp-header-comment/commit/571acfa)) 258 | * fix: fix unit tests on windows ([ed037d6](https://github.com/mjeanroy/gulp-header-comment/commit/ed037d6)) 259 | * fix(package): update ansi-colors to version 4.1.0 ([f6fa56f](https://github.com/mjeanroy/gulp-header-comment/commit/f6fa56f)) 260 | * fix(package): update ansi-colors to version 4.1.1 ([a415e03](https://github.com/mjeanroy/gulp-header-comment/commit/a415e03)), closes [#170](https://github.com/mjeanroy/gulp-header-comment/issues/170) 261 | * fix(package): update lodash to version 4.17.13 ([9800791](https://github.com/mjeanroy/gulp-header-comment/commit/9800791)), closes [#176](https://github.com/mjeanroy/gulp-header-comment/issues/176) 262 | * fix(package): update lodash to version 4.17.15 ([edbaa40](https://github.com/mjeanroy/gulp-header-comment/commit/edbaa40)) 263 | 264 | 265 | 266 | ## 0.6.1 (2019-06-04) 267 | 268 | * release: prepare next release ([771a534](https://github.com/mjeanroy/gulp-header-comment/commit/771a534)) 269 | * release: release version ([4b0b1e2](https://github.com/mjeanroy/gulp-header-comment/commit/4b0b1e2)) 270 | * fix: fix first line turned to lowercase ([cbd464d](https://github.com/mjeanroy/gulp-header-comment/commit/cbd464d)) 271 | 272 | 273 | 274 | ## 0.6.0 (2019-06-04) 275 | 276 | * release: prepare next release ([9ad23af](https://github.com/mjeanroy/gulp-header-comment/commit/9ad23af)) 277 | * release: release version ([38f1bf6](https://github.com/mjeanroy/gulp-header-comment/commit/38f1bf6)) 278 | * fix: support XML files comment ([42d3e73](https://github.com/mjeanroy/gulp-header-comment/commit/42d3e73)) 279 | * fix(package): update commenting to version 1.1.0 ([81bbe6d](https://github.com/mjeanroy/gulp-header-comment/commit/81bbe6d)) 280 | * chore: update npmignore list ([2be6321](https://github.com/mjeanroy/gulp-header-comment/commit/2be6321)) 281 | 282 | 283 | 284 | ## 0.5.0 (2019-05-31) 285 | 286 | * release: prepare next release ([305f120](https://github.com/mjeanroy/gulp-header-comment/commit/305f120)) 287 | * release: release version ([8322b4a](https://github.com/mjeanroy/gulp-header-comment/commit/8322b4a)) 288 | * chore: add node 10 to the travis matrix ([fbce679](https://github.com/mjeanroy/gulp-header-comment/commit/fbce679)) 289 | * chore: add node 12 to the travis matrix ([e5406e3](https://github.com/mjeanroy/gulp-header-comment/commit/e5406e3)) 290 | * chore: add tdd task ([b32f82a](https://github.com/mjeanroy/gulp-header-comment/commit/b32f82a)) 291 | * chore: fix lint issues after eslint-config-google upgrade ([8e64b22](https://github.com/mjeanroy/gulp-header-comment/commit/8e64b22)) 292 | * chore: fix release task ([e19490c](https://github.com/mjeanroy/gulp-header-comment/commit/e19490c)) 293 | * chore: fix release task, handle error ([72dc844](https://github.com/mjeanroy/gulp-header-comment/commit/72dc844)) 294 | * chore: improve eslint config ([70b05d7](https://github.com/mjeanroy/gulp-header-comment/commit/70b05d7)) 295 | * chore: migrate fancy-log ([1212579](https://github.com/mjeanroy/gulp-header-comment/commit/1212579)) 296 | * chore: migrate to gulp 4 ([336b129](https://github.com/mjeanroy/gulp-header-comment/commit/336b129)) 297 | * chore: update eslint to version 5.5.0 ([cbb1c3b](https://github.com/mjeanroy/gulp-header-comment/commit/cbb1c3b)) 298 | * chore: update gitignore ([7d0d11b](https://github.com/mjeanroy/gulp-header-comment/commit/7d0d11b)) 299 | * chore: update gulp-eslint to version 5.0.0 ([6d24349](https://github.com/mjeanroy/gulp-header-comment/commit/6d24349)) 300 | * chore: update license header ([583c658](https://github.com/mjeanroy/gulp-header-comment/commit/583c658)) 301 | * chore: update license headers ([5cecd2a](https://github.com/mjeanroy/gulp-header-comment/commit/5cecd2a)) 302 | * chore: update lodash to version 4.17.10 ([e2d2395](https://github.com/mjeanroy/gulp-header-comment/commit/e2d2395)) 303 | * chore: update nvmrc ([24a12f1](https://github.com/mjeanroy/gulp-header-comment/commit/24a12f1)) 304 | * chore: upgrade to babel 7 ([f19e829](https://github.com/mjeanroy/gulp-header-comment/commit/f19e829)) 305 | * chore(package): update @babel/core to version 7.0.1 ([b167dee](https://github.com/mjeanroy/gulp-header-comment/commit/b167dee)) 306 | * chore(package): update @babel/core to version 7.1.0 ([793a6b5](https://github.com/mjeanroy/gulp-header-comment/commit/793a6b5)) 307 | * chore(package): update @babel/core to version 7.1.2 ([f7d25a8](https://github.com/mjeanroy/gulp-header-comment/commit/f7d25a8)), closes [#118](https://github.com/mjeanroy/gulp-header-comment/issues/118) 308 | * chore(package): update @babel/core to version 7.1.5 ([4f679ce](https://github.com/mjeanroy/gulp-header-comment/commit/4f679ce)) 309 | * chore(package): update @babel/core to version 7.1.6 ([e6cac0d](https://github.com/mjeanroy/gulp-header-comment/commit/e6cac0d)) 310 | * chore(package): update @babel/core to version 7.2.2 ([692cbbc](https://github.com/mjeanroy/gulp-header-comment/commit/692cbbc)) 311 | * chore(package): update @babel/core to version 7.3.3 ([61ec128](https://github.com/mjeanroy/gulp-header-comment/commit/61ec128)), closes [#139](https://github.com/mjeanroy/gulp-header-comment/issues/139) 312 | * chore(package): update @babel/core to version 7.3.4 ([2b30d9a](https://github.com/mjeanroy/gulp-header-comment/commit/2b30d9a)) 313 | * chore(package): update @babel/core to version 7.4.0 ([b936376](https://github.com/mjeanroy/gulp-header-comment/commit/b936376)), closes [#152](https://github.com/mjeanroy/gulp-header-comment/issues/152) 314 | * chore(package): update @babel/core to version 7.4.3 ([e509539](https://github.com/mjeanroy/gulp-header-comment/commit/e509539)) 315 | * chore(package): update @babel/core to version 7.4.4 ([51f7a10](https://github.com/mjeanroy/gulp-header-comment/commit/51f7a10)) 316 | * chore(package): update @babel/core to version 7.4.5 ([6288a0c](https://github.com/mjeanroy/gulp-header-comment/commit/6288a0c)) 317 | * chore(package): update @babel/preset-env to version 7.1.0 ([4f65019](https://github.com/mjeanroy/gulp-header-comment/commit/4f65019)) 318 | * chore(package): update @babel/preset-env to version 7.1.5 ([5658ec8](https://github.com/mjeanroy/gulp-header-comment/commit/5658ec8)) 319 | * chore(package): update @babel/preset-env to version 7.1.6 ([5197fbb](https://github.com/mjeanroy/gulp-header-comment/commit/5197fbb)) 320 | * chore(package): update @babel/preset-env to version 7.2.0 ([0a151f1](https://github.com/mjeanroy/gulp-header-comment/commit/0a151f1)) 321 | * chore(package): update @babel/preset-env to version 7.2.3 ([2d3616e](https://github.com/mjeanroy/gulp-header-comment/commit/2d3616e)), closes [#133](https://github.com/mjeanroy/gulp-header-comment/issues/133) 322 | * chore(package): update @babel/preset-env to version 7.2.3 ([83f2722](https://github.com/mjeanroy/gulp-header-comment/commit/83f2722)), closes [#133](https://github.com/mjeanroy/gulp-header-comment/issues/133) 323 | * chore(package): update @babel/preset-env to version 7.3.1 ([c69aa02](https://github.com/mjeanroy/gulp-header-comment/commit/c69aa02)), closes [#139](https://github.com/mjeanroy/gulp-header-comment/issues/139) 324 | * chore(package): update @babel/preset-env to version 7.3.4 ([27e208e](https://github.com/mjeanroy/gulp-header-comment/commit/27e208e)) 325 | * chore(package): update @babel/preset-env to version 7.4.1 ([9799ec8](https://github.com/mjeanroy/gulp-header-comment/commit/9799ec8)), closes [#152](https://github.com/mjeanroy/gulp-header-comment/issues/152) 326 | * chore(package): update @babel/preset-env to version 7.4.3 ([a8cab7a](https://github.com/mjeanroy/gulp-header-comment/commit/a8cab7a)) 327 | * chore(package): update @babel/preset-env to version 7.4.4 ([fa63ded](https://github.com/mjeanroy/gulp-header-comment/commit/fa63ded)) 328 | * chore(package): update @babel/preset-env to version 7.4.5 ([a125709](https://github.com/mjeanroy/gulp-header-comment/commit/a125709)) 329 | * chore(package): update del to version 4.0.0 ([f986bdd](https://github.com/mjeanroy/gulp-header-comment/commit/f986bdd)) 330 | * chore(package): update del to version 4.1.0 ([484fced](https://github.com/mjeanroy/gulp-header-comment/commit/484fced)) 331 | * chore(package): update del to version 4.1.1 ([eb44813](https://github.com/mjeanroy/gulp-header-comment/commit/eb44813)) 332 | * chore(package): update eslint to version 4.19.0 ([2858bd9](https://github.com/mjeanroy/gulp-header-comment/commit/2858bd9)) 333 | * chore(package): update eslint to version 4.19.1 ([9f0ce40](https://github.com/mjeanroy/gulp-header-comment/commit/9f0ce40)) 334 | * chore(package): update eslint to version 5.0.0 ([a5028cd](https://github.com/mjeanroy/gulp-header-comment/commit/a5028cd)) 335 | * chore(package): update eslint to version 5.0.1 ([185f165](https://github.com/mjeanroy/gulp-header-comment/commit/185f165)) 336 | * chore(package): update eslint to version 5.11.0 ([f031fd6](https://github.com/mjeanroy/gulp-header-comment/commit/f031fd6)) 337 | * chore(package): update eslint to version 5.14.0 ([9ee48b6](https://github.com/mjeanroy/gulp-header-comment/commit/9ee48b6)) 338 | * chore(package): update eslint to version 5.14.1 ([1287435](https://github.com/mjeanroy/gulp-header-comment/commit/1287435)) 339 | * chore(package): update eslint to version 5.15.0 ([9efd5ed](https://github.com/mjeanroy/gulp-header-comment/commit/9efd5ed)) 340 | * chore(package): update eslint to version 5.15.1 ([d7f10bd](https://github.com/mjeanroy/gulp-header-comment/commit/d7f10bd)) 341 | * chore(package): update eslint to version 5.15.2 ([2b58a71](https://github.com/mjeanroy/gulp-header-comment/commit/2b58a71)) 342 | * chore(package): update eslint to version 5.15.3 ([083f8ab](https://github.com/mjeanroy/gulp-header-comment/commit/083f8ab)) 343 | * chore(package): update eslint to version 5.16.0 ([77d77a8](https://github.com/mjeanroy/gulp-header-comment/commit/77d77a8)) 344 | * chore(package): update eslint-config-google to version 0.10.0 ([155bc3b](https://github.com/mjeanroy/gulp-header-comment/commit/155bc3b)) 345 | * chore(package): update eslint-config-google to version 0.11.0 ([2391082](https://github.com/mjeanroy/gulp-header-comment/commit/2391082)) 346 | * chore(package): update eslint-config-google to version 0.12.0 ([0d49f02](https://github.com/mjeanroy/gulp-header-comment/commit/0d49f02)) 347 | * chore(package): update eslint-config-google to version 0.13.0 ([148fb57](https://github.com/mjeanroy/gulp-header-comment/commit/148fb57)) 348 | * chore(package): update gulp to version 4.0.0 ([e00b166](https://github.com/mjeanroy/gulp-header-comment/commit/e00b166)) 349 | * chore(package): update gulp to version 4.0.1 ([18256f3](https://github.com/mjeanroy/gulp-header-comment/commit/18256f3)) 350 | * chore(package): update gulp to version 4.0.2 ([72d1dfa](https://github.com/mjeanroy/gulp-header-comment/commit/72d1dfa)) 351 | * chore(package): update gulp-bump to version 3.1.1 ([2d2c2cb](https://github.com/mjeanroy/gulp-header-comment/commit/2d2c2cb)) 352 | * chore(package): update gulp-bump to version 3.1.3 ([66d160e](https://github.com/mjeanroy/gulp-header-comment/commit/66d160e)), closes [#137](https://github.com/mjeanroy/gulp-header-comment/issues/137) 353 | * chore(package): update gulp-git to version 2.6.0 ([0815d27](https://github.com/mjeanroy/gulp-header-comment/commit/0815d27)) 354 | * chore(package): update gulp-git to version 2.7.0 ([cd8a92f](https://github.com/mjeanroy/gulp-header-comment/commit/cd8a92f)) 355 | * chore(package): update gulp-git to version 2.8.0 ([ce0b116](https://github.com/mjeanroy/gulp-header-comment/commit/ce0b116)) 356 | * chore(package): update gulp-git to version 2.8.1 ([5af1540](https://github.com/mjeanroy/gulp-header-comment/commit/5af1540)) 357 | * chore(package): update gulp-git to version 2.9.0 ([10bcb79](https://github.com/mjeanroy/gulp-header-comment/commit/10bcb79)) 358 | * chore(package): update gulp-jasmine to version 4.0.0 ([b5f007b](https://github.com/mjeanroy/gulp-header-comment/commit/b5f007b)) 359 | * chore(package): update jasmine-core to version 3.2.0 ([5121c42](https://github.com/mjeanroy/gulp-header-comment/commit/5121c42)) 360 | * chore(package): update jasmine-core to version 3.2.1 ([d9f8ae1](https://github.com/mjeanroy/gulp-header-comment/commit/d9f8ae1)) 361 | * chore(package): update jasmine-core to version 3.3.0 ([15b691f](https://github.com/mjeanroy/gulp-header-comment/commit/15b691f)) 362 | * chore(package): update jasmine-core to version 3.4.0 ([c5f218e](https://github.com/mjeanroy/gulp-header-comment/commit/c5f218e)) 363 | * chore(package): update moment to version 2.23.0 ([a0fd240](https://github.com/mjeanroy/gulp-header-comment/commit/a0fd240)) 364 | * chore(package): update moment to version 2.24.0 ([5db356c](https://github.com/mjeanroy/gulp-header-comment/commit/5db356c)) 365 | * chore(package): update vinyl to version 2.2.0 ([7afffdf](https://github.com/mjeanroy/gulp-header-comment/commit/7afffdf)) 366 | * chore(travis): add node 11 to the travis matrix ([7ef8720](https://github.com/mjeanroy/gulp-header-comment/commit/7ef8720)) 367 | * fix: fix svg/xml/html header comment when prolog line need to be skipped ([4e07544](https://github.com/mjeanroy/gulp-header-comment/commit/4e07544)) 368 | * fix: handle svg stream ([bfc4152](https://github.com/mjeanroy/gulp-header-comment/commit/bfc4152)) 369 | * fix(package): update ansi-colors to version 3.0.6 ([31dff8a](https://github.com/mjeanroy/gulp-header-comment/commit/31dff8a)) 370 | * fix(package): update ansi-colors to version 3.1.0 ([791b9b3](https://github.com/mjeanroy/gulp-header-comment/commit/791b9b3)) 371 | * fix(package): update ansi-colors to version 3.2.1 ([259e3b2](https://github.com/mjeanroy/gulp-header-comment/commit/259e3b2)) 372 | * fix(package): update ansi-colors to version 3.2.2 ([8d31693](https://github.com/mjeanroy/gulp-header-comment/commit/8d31693)) 373 | * fix(package): update ansi-colors to version 3.2.3 ([b9841e8](https://github.com/mjeanroy/gulp-header-comment/commit/b9841e8)) 374 | * fix(package): update ansi-colors to version 3.2.4 ([7694498](https://github.com/mjeanroy/gulp-header-comment/commit/7694498)) 375 | * fix(package): update fancy-log to version 1.3.3 ([628be40](https://github.com/mjeanroy/gulp-header-comment/commit/628be40)) 376 | * fix(package): update lodash to version 4.17.11 ([8ade46b](https://github.com/mjeanroy/gulp-header-comment/commit/8ade46b)) 377 | * fix(package): update lodash to version 4.17.9 ([12d4529](https://github.com/mjeanroy/gulp-header-comment/commit/12d4529)) 378 | * fix(package): update moment to version 2.22.0 ([c289c8d](https://github.com/mjeanroy/gulp-header-comment/commit/c289c8d)) 379 | * fix(package): update moment to version 2.22.1 ([5869727](https://github.com/mjeanroy/gulp-header-comment/commit/5869727)) 380 | * fix(package): update moment to version 2.22.2 ([ac64d61](https://github.com/mjeanroy/gulp-header-comment/commit/ac64d61)) 381 | * fix(package): update through2 to version 2.0.4 ([bf39817](https://github.com/mjeanroy/gulp-header-comment/commit/bf39817)) 382 | * fix(package): update through2 to version 3.0.0 ([d57fb68](https://github.com/mjeanroy/gulp-header-comment/commit/d57fb68)), closes [#124](https://github.com/mjeanroy/gulp-header-comment/issues/124) 383 | * fix(package): update through2 to version 3.0.1 ([7885f7c](https://github.com/mjeanroy/gulp-header-comment/commit/7885f7c)) 384 | * Update .nvmrc ([58d1233](https://github.com/mjeanroy/gulp-header-comment/commit/58d1233)) 385 | 386 | 387 | 388 | ## 0.4.0 (2018-03-06) 389 | 390 | * release: prepare next release ([3292c9b](https://github.com/mjeanroy/gulp-header-comment/commit/3292c9b)) 391 | * release: release version ([43fc9fb](https://github.com/mjeanroy/gulp-header-comment/commit/43fc9fb)) 392 | * chore: ignore package-lock.json ([16735e6](https://github.com/mjeanroy/gulp-header-comment/commit/16735e6)) 393 | * chore(package): update eslint to version 4.15.0 ([50cb877](https://github.com/mjeanroy/gulp-header-comment/commit/50cb877)) 394 | * chore(package): update eslint to version 4.16.0 ([caaa8d6](https://github.com/mjeanroy/gulp-header-comment/commit/caaa8d6)) 395 | * chore(package): update eslint to version 4.17.0 ([8c55fa0](https://github.com/mjeanroy/gulp-header-comment/commit/8c55fa0)) 396 | * chore(package): update eslint to version 4.18.0 ([6e5e4f8](https://github.com/mjeanroy/gulp-header-comment/commit/6e5e4f8)) 397 | * chore(package): update eslint to version 4.18.1 ([f3a3599](https://github.com/mjeanroy/gulp-header-comment/commit/f3a3599)) 398 | * chore(package): update eslint to version 4.18.2 ([644401e](https://github.com/mjeanroy/gulp-header-comment/commit/644401e)) 399 | * chore(package): update gulp-babel to version 7.0.1 ([acec284](https://github.com/mjeanroy/gulp-header-comment/commit/acec284)) 400 | * chore(package): update gulp-bump to version 3.0.0 ([8448446](https://github.com/mjeanroy/gulp-header-comment/commit/8448446)) 401 | * chore(package): update gulp-bump to version 3.1.0 ([02fee18](https://github.com/mjeanroy/gulp-header-comment/commit/02fee18)) 402 | * chore(package): update gulp-eslint to version 4.0.1 ([b9926a2](https://github.com/mjeanroy/gulp-header-comment/commit/b9926a2)) 403 | * chore(package): update gulp-eslint to version 4.0.2 ([cb0c6db](https://github.com/mjeanroy/gulp-header-comment/commit/cb0c6db)) 404 | * chore(package): update gulp-git to version 2.5.0 ([e03d8fc](https://github.com/mjeanroy/gulp-header-comment/commit/e03d8fc)) 405 | * chore(package): update gulp-git to version 2.5.1 ([172d5c1](https://github.com/mjeanroy/gulp-header-comment/commit/172d5c1)) 406 | * chore(package): update gulp-git to version 2.5.2 ([241549f](https://github.com/mjeanroy/gulp-header-comment/commit/241549f)) 407 | * chore(package): update gulp-jasmine to version 3.0.0 ([ee3d511](https://github.com/mjeanroy/gulp-header-comment/commit/ee3d511)) 408 | * chore(package): update jasmine-core to version 2.9.1 ([61a22ce](https://github.com/mjeanroy/gulp-header-comment/commit/61a22ce)), closes [#66](https://github.com/mjeanroy/gulp-header-comment/issues/66) 409 | * chore(package): update jasmine-core to version 3.0.0 ([f1f0c12](https://github.com/mjeanroy/gulp-header-comment/commit/f1f0c12)), closes [#74](https://github.com/mjeanroy/gulp-header-comment/issues/74) 410 | * chore(package): update jasmine-core to version 3.1.0 ([6b76a9f](https://github.com/mjeanroy/gulp-header-comment/commit/6b76a9f)) 411 | * chore(package): update run-sequence to version 2.2.1 ([ef15728](https://github.com/mjeanroy/gulp-header-comment/commit/ef15728)) 412 | * fix(package): update ansi-colors to version 1.1.0 ([fc1d651](https://github.com/mjeanroy/gulp-header-comment/commit/fc1d651)) 413 | * fix(package): update commenting to version 1.0.5 ([32fb111](https://github.com/mjeanroy/gulp-header-comment/commit/32fb111)) 414 | * fix(package): update lodash to version 4.17.5 ([f556ac1](https://github.com/mjeanroy/gulp-header-comment/commit/f556ac1)) 415 | * fix(package): update moment to version 2.21.0 ([ea13ee5](https://github.com/mjeanroy/gulp-header-comment/commit/ea13ee5)) 416 | * fix(package): update plugin-error to version 1.0.0 ([5148fa6](https://github.com/mjeanroy/gulp-header-comment/commit/5148fa6)) 417 | * fix(package): update plugin-error to version 1.0.1 ([92f10c2](https://github.com/mjeanroy/gulp-header-comment/commit/92f10c2)) 418 | 419 | 420 | 421 | ## 0.3.0 (2017-12-25) 422 | 423 | * release: prepare next release ([2683a17](https://github.com/mjeanroy/gulp-header-comment/commit/2683a17)) 424 | * release: release version ([7c2c705](https://github.com/mjeanroy/gulp-header-comment/commit/7c2c705)) 425 | * core: add node 9 to the travis matrix ([f59d180](https://github.com/mjeanroy/gulp-header-comment/commit/f59d180)) 426 | * core: remove deprecated gulp-util dependency ([b5e864d](https://github.com/mjeanroy/gulp-header-comment/commit/b5e864d)) 427 | * core: replace babel-preset-es2015 with babel-preset-env ([e62d839](https://github.com/mjeanroy/gulp-header-comment/commit/e62d839)) 428 | * chore(package): update babel-core to version 6.26.0 ([6052d7a](https://github.com/mjeanroy/gulp-header-comment/commit/6052d7a)) 429 | * chore(package): update eslint to version 4.10.0 ([4b550bd](https://github.com/mjeanroy/gulp-header-comment/commit/4b550bd)) 430 | * chore(package): update eslint to version 4.11.0 ([2189ba9](https://github.com/mjeanroy/gulp-header-comment/commit/2189ba9)) 431 | * chore(package): update eslint to version 4.12.0 ([8e87242](https://github.com/mjeanroy/gulp-header-comment/commit/8e87242)) 432 | * chore(package): update eslint to version 4.12.1 ([88a4277](https://github.com/mjeanroy/gulp-header-comment/commit/88a4277)) 433 | * chore(package): update eslint to version 4.13.0 ([361aac2](https://github.com/mjeanroy/gulp-header-comment/commit/361aac2)) 434 | * chore(package): update eslint to version 4.13.1 ([869da5e](https://github.com/mjeanroy/gulp-header-comment/commit/869da5e)) 435 | * chore(package): update eslint to version 4.14.0 ([e94afdd](https://github.com/mjeanroy/gulp-header-comment/commit/e94afdd)) 436 | * chore(package): update eslint to version 4.2.0 ([9b7f340](https://github.com/mjeanroy/gulp-header-comment/commit/9b7f340)) 437 | * chore(package): update eslint to version 4.3.0 ([94c8126](https://github.com/mjeanroy/gulp-header-comment/commit/94c8126)) 438 | * chore(package): update eslint to version 4.4.0 ([5bfa435](https://github.com/mjeanroy/gulp-header-comment/commit/5bfa435)) 439 | * chore(package): update eslint to version 4.4.1 ([c0bd9d8](https://github.com/mjeanroy/gulp-header-comment/commit/c0bd9d8)) 440 | * chore(package): update eslint to version 4.5.0 ([75f956d](https://github.com/mjeanroy/gulp-header-comment/commit/75f956d)) 441 | * chore(package): update eslint to version 4.6.0 ([fb8e1b1](https://github.com/mjeanroy/gulp-header-comment/commit/fb8e1b1)) 442 | * chore(package): update eslint to version 4.6.1 ([cabf578](https://github.com/mjeanroy/gulp-header-comment/commit/cabf578)) 443 | * chore(package): update eslint to version 4.7.0 ([e63204b](https://github.com/mjeanroy/gulp-header-comment/commit/e63204b)) 444 | * chore(package): update eslint to version 4.7.1 ([e63b5b9](https://github.com/mjeanroy/gulp-header-comment/commit/e63b5b9)) 445 | * chore(package): update eslint to version 4.7.2 ([3eb4e11](https://github.com/mjeanroy/gulp-header-comment/commit/3eb4e11)) 446 | * chore(package): update eslint to version 4.8.0 ([8a24942](https://github.com/mjeanroy/gulp-header-comment/commit/8a24942)) 447 | * chore(package): update eslint to version 4.9.0 ([f7bb31a](https://github.com/mjeanroy/gulp-header-comment/commit/f7bb31a)) 448 | * chore(package): update eslint-config-google to version 0.9.1 ([a7d9834](https://github.com/mjeanroy/gulp-header-comment/commit/a7d9834)), closes [#19](https://github.com/mjeanroy/gulp-header-comment/issues/19) 449 | * chore(package): update gulp-babel to version 7.0.0 ([e134309](https://github.com/mjeanroy/gulp-header-comment/commit/e134309)) 450 | * chore(package): update gulp-bump to version 2.8.0 ([5f9b645](https://github.com/mjeanroy/gulp-header-comment/commit/5f9b645)) 451 | * chore(package): update gulp-bump to version 2.9.0 ([082b3ca](https://github.com/mjeanroy/gulp-header-comment/commit/082b3ca)) 452 | * chore(package): update gulp-git to version 2.4.2 ([c8e591f](https://github.com/mjeanroy/gulp-header-comment/commit/c8e591f)) 453 | * chore(package): update jasmine-core to version 2.7.0 ([f48f489](https://github.com/mjeanroy/gulp-header-comment/commit/f48f489)) 454 | * chore(package): update jasmine-core to version 2.8.0 ([5a2f7e7](https://github.com/mjeanroy/gulp-header-comment/commit/5a2f7e7)) 455 | * chore(package): update run-sequence to version 2.1.0 ([f936f47](https://github.com/mjeanroy/gulp-header-comment/commit/f936f47)) 456 | * chore(package): update run-sequence to version 2.2.0 ([951b83d](https://github.com/mjeanroy/gulp-header-comment/commit/951b83d)) 457 | * fix(package): update moment to version 2.19.0 ([d657a3c](https://github.com/mjeanroy/gulp-header-comment/commit/d657a3c)) 458 | * fix(package): update moment to version 2.19.1 ([806f990](https://github.com/mjeanroy/gulp-header-comment/commit/806f990)) 459 | * fix(package): update moment to version 2.19.2 ([2313ed6](https://github.com/mjeanroy/gulp-header-comment/commit/2313ed6)) 460 | * fix(package): update moment to version 2.19.3 ([ed499ec](https://github.com/mjeanroy/gulp-header-comment/commit/ed499ec)) 461 | * fix(package): update moment to version 2.19.4 ([0e535c5](https://github.com/mjeanroy/gulp-header-comment/commit/0e535c5)) 462 | * fix(package): update moment to version 2.20.0 ([b6916c6](https://github.com/mjeanroy/gulp-header-comment/commit/b6916c6)) 463 | * fix(package): update moment to version 2.20.1 ([158fa28](https://github.com/mjeanroy/gulp-header-comment/commit/158fa28)) 464 | * fix(package): update q to version 1.5.1 ([b0efc58](https://github.com/mjeanroy/gulp-header-comment/commit/b0efc58)) 465 | 466 | 467 | 468 | ## 0.2.1 (2017-07-03) 469 | 470 | * release: prepare next release ([d481296](https://github.com/mjeanroy/gulp-header-comment/commit/d481296)) 471 | * release: release version ([25a2dbc](https://github.com/mjeanroy/gulp-header-comment/commit/25a2dbc)) 472 | * test: add unit test with .appcache file ([9e565a5](https://github.com/mjeanroy/gulp-header-comment/commit/9e565a5)) 473 | * fix(package): update commenting to version 1.0.4 ([fe4cdc5](https://github.com/mjeanroy/gulp-header-comment/commit/fe4cdc5)) 474 | * chore(package): update babel-core to version 6.25.0 ([5b32ba1](https://github.com/mjeanroy/gulp-header-comment/commit/5b32ba1)) 475 | * chore(package): update del to version 3.0.0 ([07d4fbf](https://github.com/mjeanroy/gulp-header-comment/commit/07d4fbf)) 476 | * chore(package): update eslint to version 4.0.0 ([0321063](https://github.com/mjeanroy/gulp-header-comment/commit/0321063)) 477 | * chore(package): update eslint to version 4.1.0 ([7aff954](https://github.com/mjeanroy/gulp-header-comment/commit/7aff954)) 478 | * chore(package): update eslint to version 4.1.1 ([f475bd9](https://github.com/mjeanroy/gulp-header-comment/commit/f475bd9)) 479 | * chore(package): update eslint-config-google to version 0.8.0 ([c006518](https://github.com/mjeanroy/gulp-header-comment/commit/c006518)) 480 | * chore(package): update gulp-eslint to version 4.0.0 ([ed520d1](https://github.com/mjeanroy/gulp-header-comment/commit/ed520d1)) 481 | * chore(package): update gulp-git to version 2.3.0 ([9c90703](https://github.com/mjeanroy/gulp-header-comment/commit/9c90703)) 482 | * chore(package): update gulp-git to version 2.3.1 ([f925aee](https://github.com/mjeanroy/gulp-header-comment/commit/f925aee)) 483 | * chore(package): update gulp-git to version 2.3.1 ([48f25e7](https://github.com/mjeanroy/gulp-header-comment/commit/48f25e7)) 484 | * chore(package): update gulp-git to version 2.4.1 ([b7f48ba](https://github.com/mjeanroy/gulp-header-comment/commit/b7f48ba)) 485 | * chore(package): update jasmine-core to version 2.6.2 ([bdb3d23](https://github.com/mjeanroy/gulp-header-comment/commit/bdb3d23)) 486 | * chore(package): update jasmine-core to version 2.6.3 ([fdd9e65](https://github.com/mjeanroy/gulp-header-comment/commit/fdd9e65)) 487 | * chore(package): update jasmine-core to version 2.6.4 ([e37a5f2](https://github.com/mjeanroy/gulp-header-comment/commit/e37a5f2)) 488 | * chore(package): update run-sequence to version 2.0.0 (#16) ([d75913b](https://github.com/mjeanroy/gulp-header-comment/commit/d75913b)), closes [#16](https://github.com/mjeanroy/gulp-header-comment/issues/16) 489 | * chore(package): update vinyl to version 2.1.0 ([9bfbff3](https://github.com/mjeanroy/gulp-header-comment/commit/9bfbff3)) 490 | * core: add node 8 to the travis matrix ([82e5c13](https://github.com/mjeanroy/gulp-header-comment/commit/82e5c13)) 491 | 492 | 493 | 494 | ## 0.2.0 (2017-05-11) 495 | 496 | * release: prepare next release ([d199099](https://github.com/mjeanroy/gulp-header-comment/commit/d199099)) 497 | * release: release version ([de07606](https://github.com/mjeanroy/gulp-header-comment/commit/de07606)) 498 | * core: fix babel dependency ([e9bd122](https://github.com/mjeanroy/gulp-header-comment/commit/e9bd122)) 499 | * core: update npm ignore list ([db7ae9b](https://github.com/mjeanroy/gulp-header-comment/commit/db7ae9b)) 500 | * docs: update README ([3eb6126](https://github.com/mjeanroy/gulp-header-comment/commit/3eb6126)) 501 | * docs(readme): add Greenkeeper badge ([48d9a64](https://github.com/mjeanroy/gulp-header-comment/commit/48d9a64)) 502 | * Update README.md ([3767ce9](https://github.com/mjeanroy/gulp-header-comment/commit/3767ce9)) 503 | * chore(package): update dependencies ([d9a196d](https://github.com/mjeanroy/gulp-header-comment/commit/d9a196d)) 504 | 505 | 506 | 507 | ## 0.1.0 (2017-02-23) 508 | 509 | * release: release version ([ab9b5f4](https://github.com/mjeanroy/gulp-header-comment/commit/ab9b5f4)) 510 | * core: add babel for old node version ([b3cb862](https://github.com/mjeanroy/gulp-header-comment/commit/b3cb862)) 511 | * core: add del task ([d822c66](https://github.com/mjeanroy/gulp-header-comment/commit/d822c66)) 512 | * core: add gulp as a dev dependency ([e2b12fb](https://github.com/mjeanroy/gulp-header-comment/commit/e2b12fb)) 513 | * core: add lint task before build ([038a509](https://github.com/mjeanroy/gulp-header-comment/commit/038a509)) 514 | * core: add missing unit tests ([3940617](https://github.com/mjeanroy/gulp-header-comment/commit/3940617)) 515 | * core: add npmignore file ([9aee8ab](https://github.com/mjeanroy/gulp-header-comment/commit/9aee8ab)) 516 | * core: add nvmrc file ([f958a29](https://github.com/mjeanroy/gulp-header-comment/commit/f958a29)) 517 | * core: add release tasks ([97177af](https://github.com/mjeanroy/gulp-header-comment/commit/97177af)) 518 | * core: add travis configuration ([948e422](https://github.com/mjeanroy/gulp-header-comment/commit/948e422)) 519 | * core: add use-strict statements ([6790d13](https://github.com/mjeanroy/gulp-header-comment/commit/6790d13)) 520 | * core: fix lodash template data ([1956ae3](https://github.com/mjeanroy/gulp-header-comment/commit/1956ae3)) 521 | * core: fix release task ([a5fdb01](https://github.com/mjeanroy/gulp-header-comment/commit/a5fdb01)) 522 | * core: init project with lint task ([b2825ed](https://github.com/mjeanroy/gulp-header-comment/commit/b2825ed)) 523 | * core: log errors when something bad happen ([b80aca7](https://github.com/mjeanroy/gulp-header-comment/commit/b80aca7)) 524 | * core: update npm keywords ([00a1565](https://github.com/mjeanroy/gulp-header-comment/commit/00a1565)) 525 | * core: update npmignore list ([f672d21](https://github.com/mjeanroy/gulp-header-comment/commit/f672d21)) 526 | * core: update package.json fields ([6a515a1](https://github.com/mjeanroy/gulp-header-comment/commit/6a515a1)) 527 | * docs: add badges to the README ([2941e41](https://github.com/mjeanroy/gulp-header-comment/commit/2941e41)) 528 | * docs: add README ([1aca841](https://github.com/mjeanroy/gulp-header-comment/commit/1aca841)) 529 | * tests: add test case for error when template file does not exist ([81dabf3](https://github.com/mjeanroy/gulp-header-comment/commit/81dabf3)) 530 | * tests: use toBeTruthy instead of not.toEqual('') ([fdba6c6](https://github.com/mjeanroy/gulp-header-comment/commit/fdba6c6)) 531 | 532 | 533 | 534 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | 3 | Copyright (c) 2017-2020 Mickael Jeanroy 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 all 13 | 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 THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # gulp-header-comment 2 | 3 | [![Greenkeeper badge](https://badges.greenkeeper.io/mjeanroy/gulp-header-comment.svg)](https://greenkeeper.io/) 4 | [![Build Status](https://travis-ci.org/mjeanroy/gulp-header-comment.svg?branch=master)](https://travis-ci.org/mjeanroy/gulp-header-comment) 5 | [![Npm version](https://badge.fury.io/js/gulp-header-comment.svg)](https://badge.fury.io/js/gulp-header-comment) 6 | 7 | gulp-header-comment is a [Gulp](https://github.com/gulpjs/gulp) extension to add comments to file(s) in the pipeline. 8 | 9 | ## Install 10 | 11 | `npm install --save-dev gulp-header-comment` 12 | 13 | ## Usage 14 | 15 | ```javascript 16 | const headerComment = require('gulp-header-comment'); 17 | 18 | gulp.src('**/*.js') 19 | .pipe(headerComment('License MIT')) 20 | .pipe(gulp.dest('./dist/')) 21 | ``` 22 | 23 | The generated comment will use: 24 | - Block comment for JS, LESS, CSS and SASS files (i.e starts with `/**` and ends with `*/`). 25 | - HTML comments for HTML files (i.e starts with ``). 26 | - Hash comments for `appcache` and hidden files (i.e starts with `#`). 27 | - The default is the block comment otherwise. 28 | 29 | See [https://github.com/3rd-Eden/commenting](commenting), as this package is used to generate comments according to file extensions. 30 | 31 | ## Templating 32 | 33 | Header strings can use `lodash`, `moment` and data from `package.json`: 34 | 35 | ```javascript 36 | const headerComment = require('gulp-header-comment'); 37 | 38 | gulp.src('**/*.js') 39 | .pipe(headerComment(` 40 | License: <%= pkg.license %> 41 | Generated on <%= moment().format('YYYY') %> 42 | Author: <%= _.capitalize(pkg.author) %> 43 | `)) 44 | .pipe(gulp.dest('./dist/')) 45 | ``` 46 | 47 | You can also point to a file on disk: 48 | 49 | ```javascript 50 | const headerComment = require('gulp-header-comment'); 51 | 52 | gulp.src('**/*.js') 53 | .pipe(headerComment({ 54 | file: path.join(__dirname, 'header.txt'), 55 | encoding: 'utf-8', // Default is UTF-8 56 | })) 57 | .pipe(gulp.dest('./dist/')) 58 | ``` 59 | 60 | ## ChangeLogs 61 | 62 | See [here](https://github.com/mjeanroy/gulp-header-comment/blob/master/CHANGELOG.md). 63 | 64 | ## License 65 | 66 | MIT License (MIT) 67 | 68 | ## Contributing 69 | 70 | If you find a bug or think about enhancement, feel free to contribute and submit an issue or a pull request. 71 | -------------------------------------------------------------------------------- /gulpfile.js: -------------------------------------------------------------------------------- 1 | /** 2 | * The MIT License (MIT) 3 | * 4 | * Copyright (c) 2017-2020 Mickael Jeanroy 5 | * 6 | * Permission is hereby granted, free of charge, to any person obtaining a copy 7 | * of this software and associated documentation files (the "Software"), to deal 8 | * in the Software without restriction, including without limitation the rights 9 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 10 | * copies of the Software, and to permit persons to whom the Software is 11 | * furnished to do so, subject to the following conditions: 12 | * 13 | * The above copyright notice and this permission notice shall be included in all 14 | * copies or substantial portions of the Software. 15 | * 16 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 18 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 19 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 20 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 21 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 22 | * SOFTWARE. 23 | */ 24 | 25 | require('@babel/register')({ 26 | ignore: [ 27 | /node_modules/, 28 | ], 29 | }); 30 | 31 | const gulp = require('gulp'); 32 | const clean = require('./scripts/clean'); 33 | const lint = require('./scripts/lint'); 34 | const build = require('./scripts/build'); 35 | const test = require('./scripts/test'); 36 | const release = require('./scripts/release'); 37 | const changelog = require('./scripts/changelog'); 38 | 39 | const prebuild = gulp.series(clean, lint); 40 | const pretest = gulp.series(prebuild, build); 41 | const prerelease = gulp.series(pretest, test.test); 42 | 43 | module.exports = { 44 | 'clean': clean, 45 | 'lint': lint, 46 | 'build': gulp.series(prebuild, build), 47 | 'tdd': gulp.series(pretest, test.tdd), 48 | 'test': gulp.series(pretest, test.test), 49 | 'release:patch': gulp.series(prerelease, release.patch), 50 | 'release:minor': gulp.series(prerelease, release.minor), 51 | 'release:major': gulp.series(prerelease, release.major), 52 | 'changelog': changelog, 53 | }; 54 | -------------------------------------------------------------------------------- /package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "gulp-header-comment", 3 | "version": "0.10.0", 4 | "description": "Gulp plugin to add header comments to files", 5 | "main": "dist/index.js", 6 | "scripts": { 7 | "clean": "gulp clean", 8 | "lint": "gulp lint", 9 | "build": "gulp build", 10 | "test": "gulp test", 11 | "tdd": "gulp tdd", 12 | "release": "gulp release:minor", 13 | "release:patch": "gulp release:patch", 14 | "release:minor": "gulp release:minor", 15 | "release:major": "gulp release:major", 16 | "changelog": "gulp changelog" 17 | }, 18 | "keywords": [ 19 | "gulpplugin", 20 | "gulp" 21 | ], 22 | "author": "Mickael Jeanroy", 23 | "license": "MIT", 24 | "bugs": "https://github.com/mjeanroy/gulp-header-comment/issues", 25 | "homepage": "https://github.com/mjeanroy/gulp-header-comment", 26 | "repository": { 27 | "type": "git", 28 | "url": "git://github.com/mjeanroy/gulp-header-comment.git" 29 | }, 30 | "dependencies": { 31 | "ansi-colors": "4.1.3", 32 | "commenting": "1.1.0", 33 | "fancy-log": "1.3.3", 34 | "lodash": "4.17.21", 35 | "magic-string": "0.30.17", 36 | "moment": "2.30.1", 37 | "plugin-error": "2.0.1", 38 | "q": "1.5.1", 39 | "through2": "4.0.2", 40 | "vinyl-sourcemaps-apply": "0.2.1" 41 | }, 42 | "devDependencies": { 43 | "@babel/core": "7.27.4", 44 | "@babel/preset-env": "7.27.2", 45 | "@babel/register": "7.27.1", 46 | "eslint": "8.57.0", 47 | "eslint-config-airbnb-base": "15.0.0", 48 | "eslint-plugin-import": "2.31.0", 49 | "gulp": "5.0.1", 50 | "gulp-babel": "8.0.0", 51 | "gulp-conventional-changelog": "5.0.0", 52 | "gulp-jasmine": "4.0.0", 53 | "gulp-sourcemaps": "3.0.0", 54 | "jasmine": "3.6.1", 55 | "jasmine-core": "3.10.1", 56 | "rimraf": "6.0.1", 57 | "tmp": "0.2.3", 58 | "vinyl": "3.0.1" 59 | } 60 | } 61 | -------------------------------------------------------------------------------- /scripts/build/index.js: -------------------------------------------------------------------------------- 1 | /** 2 | * The MIT License (MIT) 3 | * 4 | * Copyright (c) 2017-2020 Mickael Jeanroy 5 | * 6 | * Permission is hereby granted, free of charge, to any person obtaining a copy 7 | * of this software and associated documentation files (the "Software"), to deal 8 | * in the Software without restriction, including without limitation the rights 9 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 10 | * copies of the Software, and to permit persons to whom the Software is 11 | * furnished to do so, subject to the following conditions: 12 | * 13 | * The above copyright notice and this permission notice shall be included in all 14 | * copies or substantial portions of the Software. 15 | * 16 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 18 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 19 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 20 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 21 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 22 | * SOFTWARE. 23 | */ 24 | 25 | const path = require('node:path'); 26 | const gulp = require('gulp'); 27 | const babel = require('gulp-babel'); 28 | const config = require('../config'); 29 | 30 | module.exports = function build() { 31 | return gulp.src(path.join(config.src, '**', '*.js')) 32 | .pipe(babel()) 33 | .pipe(gulp.dest(config.dist)); 34 | }; 35 | -------------------------------------------------------------------------------- /scripts/changelog/index.js: -------------------------------------------------------------------------------- 1 | /** 2 | * The MIT License (MIT) 3 | * 4 | * Copyright (c) 2017-2020 Mickael Jeanroy 5 | * 6 | * Permission is hereby granted, free of charge, to any person obtaining a copy 7 | * of this software and associated documentation files (the "Software"), to deal 8 | * in the Software without restriction, including without limitation the rights 9 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 10 | * copies of the Software, and to permit persons to whom the Software is 11 | * furnished to do so, subject to the following conditions: 12 | * 13 | * The above copyright notice and this permission notice shall be included in all 14 | * copies or substantial portions of the Software. 15 | * 16 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 18 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 19 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 20 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 21 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 22 | * SOFTWARE. 23 | */ 24 | 25 | const path = require('node:path'); 26 | const gulp = require('gulp'); 27 | const conventionalChangelog = require('gulp-conventional-changelog'); 28 | const config = require('../config'); 29 | 30 | module.exports = function changelog() { 31 | const changelogFile = path.join(config.root, 'CHANGELOG.md'); 32 | return gulp.src(changelogFile, { buffer: false }) 33 | .pipe(conventionalChangelog({ releaseCount: 0 })) 34 | .pipe(gulp.dest(config.root)); 35 | }; 36 | -------------------------------------------------------------------------------- /scripts/clean/index.js: -------------------------------------------------------------------------------- 1 | /** 2 | * The MIT License (MIT) 3 | * 4 | * Copyright (c) 2017-2020 Mickael Jeanroy 5 | * 6 | * Permission is hereby granted, free of charge, to any person obtaining a copy 7 | * of this software and associated documentation files (the "Software"), to deal 8 | * in the Software without restriction, including without limitation the rights 9 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 10 | * copies of the Software, and to permit persons to whom the Software is 11 | * furnished to do so, subject to the following conditions: 12 | * 13 | * The above copyright notice and this permission notice shall be included in all 14 | * copies or substantial portions of the Software. 15 | * 16 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 18 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 19 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 20 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 21 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 22 | * SOFTWARE. 23 | */ 24 | 25 | const { rimraf } = require('rimraf'); 26 | const config = require('../config'); 27 | 28 | module.exports = function clean() { 29 | return rimraf(config.dist); 30 | }; 31 | -------------------------------------------------------------------------------- /scripts/config.js: -------------------------------------------------------------------------------- 1 | /** 2 | * The MIT License (MIT) 3 | * 4 | * Copyright (c) 2017-2020 Mickael Jeanroy 5 | * 6 | * Permission is hereby granted, free of charge, to any person obtaining a copy 7 | * of this software and associated documentation files (the "Software"), to deal 8 | * in the Software without restriction, including without limitation the rights 9 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 10 | * copies of the Software, and to permit persons to whom the Software is 11 | * furnished to do so, subject to the following conditions: 12 | * 13 | * The above copyright notice and this permission notice shall be included in all 14 | * copies or substantial portions of the Software. 15 | * 16 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 18 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 19 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 20 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 21 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 22 | * SOFTWARE. 23 | */ 24 | 25 | const path = require('node:path'); 26 | 27 | const ROOT = path.join(__dirname, '..'); 28 | 29 | module.exports = { 30 | root: ROOT, 31 | src: path.join(ROOT, 'src'), 32 | test: path.join(ROOT, 'test'), 33 | scripts: path.join(ROOT, 'scripts'), 34 | dist: path.join(ROOT, 'dist'), 35 | pkg: path.join(ROOT, 'package.json'), 36 | }; 37 | -------------------------------------------------------------------------------- /scripts/lint/index.js: -------------------------------------------------------------------------------- 1 | /** 2 | * The MIT License (MIT) 3 | * 4 | * Copyright (c) 2017-2020 Mickael Jeanroy 5 | * 6 | * Permission is hereby granted, free of charge, to any person obtaining a copy 7 | * of this software and associated documentation files (the "Software"), to deal 8 | * in the Software without restriction, including without limitation the rights 9 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 10 | * copies of the Software, and to permit persons to whom the Software is 11 | * furnished to do so, subject to the following conditions: 12 | * 13 | * The above copyright notice and this permission notice shall be included in all 14 | * copies or substantial portions of the Software. 15 | * 16 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 18 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 19 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 20 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 21 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 22 | * SOFTWARE. 23 | */ 24 | 25 | const path = require('node:path'); 26 | const log = require('../log'); 27 | const config = require('../config'); 28 | 29 | module.exports = function lint() { 30 | const nodeVersion = process.versions.node; 31 | const major = Number(nodeVersion.split('.')[0]); 32 | if (major < 8) { 33 | log.debug(`Skipping ESLint because of node version compatibility (currenly in used: ${nodeVersion})`); 34 | return Promise.resolve(); 35 | } 36 | 37 | const inputs = [ 38 | path.join(config.root, '*.js'), 39 | path.join(config.src, '**', '*.js'), 40 | path.join(config.test, '**', '*.js'), 41 | path.join(config.scripts, '**', '*.js'), 42 | ]; 43 | 44 | // eslint-disable-next-line global-require 45 | const { ESLint } = require('eslint'); 46 | 47 | // eslint-disable-next-line global-require 48 | const fancyLog = require('fancy-log'); 49 | 50 | const eslint = new ESLint({ 51 | errorOnUnmatchedPattern: false, 52 | }); 53 | 54 | const lintFiles = eslint.lintFiles(inputs); 55 | const loadFormatter = eslint.loadFormatter('stylish'); 56 | 57 | return Promise.all([lintFiles, loadFormatter]).then(([results, formatter]) => { 58 | for (let i = 0; i < results.length; ++i) { 59 | const lintResult = results[i]; 60 | if (lintResult.warningCount > 0 || lintResult.errorCount > 0 || lintResult.fatalErrorCount > 0) { 61 | fancyLog(formatter.format(results)); 62 | throw new Error('ESLintError'); 63 | } 64 | } 65 | }); 66 | }; 67 | -------------------------------------------------------------------------------- /scripts/log/index.js: -------------------------------------------------------------------------------- 1 | /** 2 | * The MIT License (MIT) 3 | * 4 | * Copyright (c) 2017-2020 Mickael Jeanroy 5 | * 6 | * Permission is hereby granted, free of charge, to any person obtaining a copy 7 | * of this software and associated documentation files (the "Software"), to deal 8 | * in the Software without restriction, including without limitation the rights 9 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 10 | * copies of the Software, and to permit persons to whom the Software is 11 | * furnished to do so, subject to the following conditions: 12 | * 13 | * The above copyright notice and this permission notice shall be included in all 14 | * copies or substantial portions of the Software. 15 | * 16 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 18 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 19 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 20 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 21 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 22 | * SOFTWARE. 23 | */ 24 | 25 | const log = require('fancy-log'); 26 | const colors = require('ansi-colors'); 27 | 28 | /** 29 | * Log message to output using `DEBUG` level. 30 | * 31 | * @param {string} msg Message to log. 32 | * @return {void} 33 | */ 34 | function debug(msg) { 35 | log(colors.grey(msg)); 36 | } 37 | 38 | /** 39 | * Log message to output using `ERROR` level. 40 | * 41 | * @param {string} msg Message to log. 42 | * @return {void} 43 | */ 44 | function error(msg) { 45 | log(colors.red(msg)); 46 | } 47 | 48 | module.exports = { 49 | debug, 50 | error, 51 | }; 52 | -------------------------------------------------------------------------------- /scripts/release/index.js: -------------------------------------------------------------------------------- 1 | /** 2 | * The MIT License (MIT) 3 | * 4 | * Copyright (c) 2017-2020 Mickael Jeanroy 5 | * 6 | * Permission is hereby granted, free of charge, to any person obtaining a copy 7 | * of this software and associated documentation files (the "Software"), to deal 8 | * in the Software without restriction, including without limitation the rights 9 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 10 | * copies of the Software, and to permit persons to whom the Software is 11 | * furnished to do so, subject to the following conditions: 12 | * 13 | * The above copyright notice and this permission notice shall be included in all 14 | * copies or substantial portions of the Software. 15 | * 16 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 18 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 19 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 20 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 21 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 22 | * SOFTWARE. 23 | */ 24 | 25 | const util = require('node:util'); 26 | const exec = util.promisify(require('node:child_process').exec); 27 | const gulp = require('gulp'); 28 | const config = require('../config'); 29 | const log = require('../log'); 30 | 31 | /** 32 | * Run command with a pre-configured `cwd` (current working directory) 33 | * and an encoding set to `utf-8'. 34 | * 35 | * @param {string} cmd Command to run. 36 | * @return {Promise} A promise resolved when the command has been executed. 37 | */ 38 | function run(cmd) { 39 | log.debug(` ${cmd}...`); 40 | return exec(cmd, { 41 | cwd: config.root, 42 | encoding: 'utf-8', 43 | }); 44 | } 45 | 46 | /** 47 | * Update version in number in `package.json` file. 48 | * 49 | * @param {'major'|'minor'|'patch'} type The semver level identifier (`major`, `minor` or `patch`). 50 | * @return {Promise} A promise resolved when the version bumped has been executed. 51 | */ 52 | function bumpVersion(type) { 53 | return run(`git add -f "${config.dist}"`).then(() => ( 54 | run(`npm version "${type}" -f -m 'release: release version'`) 55 | )); 56 | } 57 | 58 | /** 59 | * Prepare the next release cycle: 60 | * - Remove the `dist` directory containing bundle tagged on given version. 61 | * - Create a new commit preparing the next release. 62 | * 63 | * @return {Promise} A promise resolved when the task has been executed. 64 | */ 65 | function prepareNextRelease() { 66 | return run(`git rm -r "${config.dist}"`).then(() => ( 67 | run("git commit -m 'release: prepare next release'") 68 | )); 69 | } 70 | 71 | /** 72 | * Create the release task. 73 | * 74 | * @param {'major'|'minor'|'patch'} level The version level upgrade. 75 | * @return {function} The release task function. 76 | */ 77 | function createReleaseTask(level) { 78 | /** 79 | * Prepare the release: upgrade version number according to 80 | * the specified level. 81 | * 82 | * @return {Promise} A promise resolved when the release is done. 83 | */ 84 | function doRelease() { 85 | return bumpVersion(level); 86 | } 87 | 88 | return gulp.series( 89 | doRelease, 90 | prepareNextRelease, 91 | ); 92 | } 93 | 94 | module.exports = { 95 | patch: createReleaseTask('patch'), 96 | minor: createReleaseTask('minor'), 97 | major: createReleaseTask('major'), 98 | }; 99 | -------------------------------------------------------------------------------- /scripts/test/index.js: -------------------------------------------------------------------------------- 1 | /** 2 | * The MIT License (MIT) 3 | * 4 | * Copyright (c) 2017-2020 Mickael Jeanroy 5 | * 6 | * Permission is hereby granted, free of charge, to any person obtaining a copy 7 | * of this software and associated documentation files (the "Software"), to deal 8 | * in the Software without restriction, including without limitation the rights 9 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 10 | * copies of the Software, and to permit persons to whom the Software is 11 | * furnished to do so, subject to the following conditions: 12 | * 13 | * The above copyright notice and this permission notice shall be included in all 14 | * copies or substantial portions of the Software. 15 | * 16 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 18 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 19 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 20 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 21 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 22 | * SOFTWARE. 23 | */ 24 | 25 | const path = require('node:path'); 26 | const gulp = require('gulp'); 27 | const jasmine = require('gulp-jasmine'); 28 | const build = require('../build'); 29 | const config = require('../config'); 30 | 31 | /** 32 | * Run unit test suite and exit. 33 | * 34 | * @return {Stream} Gulp stream. 35 | */ 36 | function test() { 37 | const specs = path.join(config.test, '**', '*.spec.js'); 38 | return gulp.src(specs).pipe(jasmine()); 39 | } 40 | 41 | /** 42 | * Watch for changes, and run unit test suite on every change. 43 | * 44 | * @param {function} done The `done` callback. 45 | * @return {void} 46 | */ 47 | function tdd(done) { 48 | gulp.watch(path.join(config.dist, '**', '*.js'), test); 49 | gulp.watch(path.join(config.src, '**', '*.js'), build); 50 | gulp.watch(path.join(config.test, '**', '*.js'), test); 51 | done(); 52 | } 53 | 54 | module.exports = { 55 | tdd, 56 | test, 57 | }; 58 | -------------------------------------------------------------------------------- /src/index.js: -------------------------------------------------------------------------------- 1 | /** 2 | * The MIT License (MIT) 3 | * 4 | * Copyright (c) 2017-2020 Mickael Jeanroy 5 | * 6 | * Permission is hereby granted, free of charge, to any person obtaining a copy 7 | * of this software and associated documentation files (the "Software"), to deal 8 | * in the Software without restriction, including without limitation the rights 9 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 10 | * copies of the Software, and to permit persons to whom the Software is 11 | * furnished to do so, subject to the following conditions: 12 | * 13 | * The above copyright notice and this permission notice shall be included in 14 | * all copies or substantial portions of the Software. 15 | * 16 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 18 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 19 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 20 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 21 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 22 | * THE SOFTWARE. 23 | */ 24 | 25 | const fs = require('fs'); 26 | const path = require('path'); 27 | const stringDecoder = require('string_decoder'); 28 | const log = require('fancy-log'); 29 | const colors = require('ansi-colors'); 30 | const PluginError = require('plugin-error'); 31 | const _ = require('lodash'); 32 | const moment = require('moment'); 33 | const commenting = require('commenting'); 34 | const through = require('through2'); 35 | const applySourceMap = require('vinyl-sourcemaps-apply'); 36 | const MagicString = require('magic-string'); 37 | const Q = require('q'); 38 | 39 | module.exports = function gulpHeaderComment(options = {}) { 40 | const separator = _.isObject(options) && _.isString(options.separator) ? options.separator : '\n'; 41 | const cwd = options.cwd || process.cwd(); 42 | const pkgPath = path.join(cwd, 'package.json'); 43 | 44 | // eslint-disable-next-line global-require,import/no-dynamic-require 45 | const pkg = fs.existsSync(pkgPath) ? require(pkgPath) : {}; 46 | 47 | return through.obj((file, encoding, cb) => { 48 | if (file.isNull() || file.isDirectory()) { 49 | cb(null, file); 50 | return; 51 | } 52 | 53 | const filePath = file.path; 54 | 55 | read(options, encoding) 56 | .then((content) => { 57 | const extension = getExtension(file); 58 | const type = extension.slice(1); 59 | const header = generateHeader(content, extension, pkg, createFileObject(cwd, filePath)); 60 | 61 | if (file.isBuffer()) { 62 | updateFileContent(file, type, header, separator); 63 | } else if (file.isStream()) { 64 | pipeFileContent(file, type, header, separator); 65 | } 66 | 67 | cb(null, file); 68 | }) 69 | .catch((err) => { 70 | // Log error. 71 | log.error(colors.red(`gulp-header-comment: ${err}`)); 72 | 73 | // Wrap error. 74 | cb(new PluginError('gulp-header-comment', err)); 75 | }); 76 | }); 77 | }; 78 | 79 | /** 80 | * Add header to given file content. 81 | * 82 | * @param {Object} file Original file. 83 | * @param {string} type File type. 84 | * @param {string} header Header to add to given file. 85 | * @param {string} separator The separator to use between header and file content. 86 | * @return {void} 87 | */ 88 | function updateFileContent(file, type, header, separator) { 89 | const input = file.contents.toString(); 90 | const fname = file.relative; 91 | const result = transform(fname, input, type, header, separator); 92 | 93 | // eslint-disable-next-line no-param-reassign 94 | file.contents = toBuffer(result.code); 95 | 96 | if (file.sourceMap && result.map) { 97 | applySourceMap(file, result.map); 98 | } 99 | } 100 | 101 | /** 102 | * Create file descriptor object. 103 | * 104 | * @param {string} cwd Working directory. 105 | * @param {string} filePath File absolute path. 106 | * @return {Object} An object containing file information. 107 | */ 108 | function createFileObject(cwd, filePath) { 109 | if (!filePath) { 110 | return null; 111 | } 112 | 113 | const normalizedCwd = path.normalize(cwd); 114 | const normalizedPath = path.normalize(filePath); 115 | 116 | const filename = path.basename(normalizedPath); 117 | const dirname = path.dirname(normalizedPath); 118 | 119 | return { 120 | name: filename, 121 | dir: dirname, 122 | path: normalizedPath, 123 | relativePath: path.normalize(path.relative(normalizedCwd, normalizedPath)), 124 | relativeDir: path.normalize(path.relative(normalizedCwd, dirname)), 125 | }; 126 | } 127 | 128 | /** 129 | * Stream new file content. 130 | * 131 | * @param {File} file Given input file. 132 | * @param {string} type The file type. 133 | * @param {string} header Header to add to given file. 134 | * @param {string} separator Separator between header and file content. 135 | * @return {void} 136 | */ 137 | function pipeFileContent(file, type, header, separator) { 138 | return maySkipFirstLine(type) ? 139 | transformFileStreamContent(file, type, header, separator) : 140 | prependPipeStream(file, header, separator); 141 | } 142 | 143 | /** 144 | * A very simple function that prepend header to file stream input. 145 | * 146 | * @param {File} file The original file stream. 147 | * @param {string} header The header to prepend to original file stream. 148 | * @param {string} separator The separator to use between header and file content. 149 | * @return {void} 150 | */ 151 | function prependPipeStream(file, header, separator) { 152 | const stream = through(); 153 | stream.write(toBuffer(header + separator)); 154 | 155 | // eslint-disable-next-line no-param-reassign 156 | file.contents = file.contents.pipe(stream); 157 | } 158 | 159 | /** 160 | * A very simple function that prepend header to file stream input. 161 | * 162 | * @param {File} file The original file stream. 163 | * @param {string} type File type. 164 | * @param {string} header The header to prepend to original file stream. 165 | * @param {string} separator The separator to use between header and file content. 166 | * @return {void} 167 | */ 168 | function transformFileStreamContent(file, type, header, separator) { 169 | // eslint-disable-next-line no-param-reassign 170 | file.contents = file.contents.pipe(through(function transformFunction(chunk, enc, cb) { 171 | const decoder = new stringDecoder.StringDecoder(); 172 | const rawChunk = decoder.end(chunk); 173 | const fname = file.relative; 174 | const result = transform(fname, rawChunk, type, header, separator); 175 | const newContent = result.code; 176 | 177 | if (file.sourceMap && result.map) { 178 | applySourceMap(file, result.map); 179 | } 180 | 181 | // eslint-disable-next-line no-invalid-this 182 | this.push(newContent); 183 | 184 | cb(); 185 | })); 186 | } 187 | 188 | /** 189 | * Get extension for given file. 190 | * 191 | * @param {Object} file The file. 192 | * @return {string} File extension. 193 | */ 194 | function getExtension(file) { 195 | const ext = path.extname(file.path); 196 | return ext ? ext.toLowerCase() : ext; 197 | } 198 | 199 | /** 200 | * Generate header from given template. 201 | * 202 | * @param {string} content Template of header. 203 | * @param {string} extension Target file extension. 204 | * @param {Object} pkg The `package.json` descriptor that will be injected when template will be evaluated. 205 | * @param {Object} file The `file` being processed (contains `path`, `name` and `dir` entries). 206 | * @return {string} Interpolated header. 207 | */ 208 | function generateHeader(content, extension, pkg, file) { 209 | const templateFn = _.template(content); 210 | const template = templateFn({ 211 | _, 212 | moment, 213 | pkg, 214 | file, 215 | }); 216 | 217 | return commenting(template.trim(), { extension }); 218 | } 219 | 220 | /** 221 | * Add header to given file content. 222 | * 223 | * @param {string} fname File name. 224 | * @param {string} content Original file content. 225 | * @param {string} type Original file type. 226 | * @param {string} header The header to add. 227 | * @param {string} separator The separator to use between original file content and separator. 228 | * @return {string} The resulting file content. 229 | */ 230 | function transform(fname, content, type, header, separator) { 231 | const magicStr = new MagicString(content); 232 | 233 | if (!maySkipFirstLine(type)) { 234 | prependHeader(magicStr, header, separator); 235 | } else { 236 | const lineSeparator = '\n'; 237 | const lines = content.split(lineSeparator); 238 | const firstLine = lines[0].toLowerCase(); 239 | const trimmedFirstLine = _.trim(firstLine); 240 | 241 | if (!shouldSkipFirstLine(type, trimmedFirstLine)) { 242 | prependHeader(magicStr, header, separator); 243 | } else { 244 | magicStr.appendRight(lines[0].length, separator + separator + header); 245 | } 246 | } 247 | 248 | return { 249 | code: magicStr.toString(), 250 | map: magicStr.generateMap({ 251 | file: `${fname}.map`, 252 | source: fname, 253 | includeContent: true, 254 | hires: true, 255 | }), 256 | }; 257 | } 258 | 259 | /** 260 | * Prepend header to given file content. 261 | * 262 | * @param {MagicString} magicStr Original file content. 263 | * @param {string} header Header to prepend. 264 | * @param {string} separator The separator between header and file content. 265 | */ 266 | function prependHeader(magicStr, header, separator) { 267 | magicStr.prepend( 268 | header + separator, 269 | ); 270 | } 271 | 272 | // Set of checker function for each file type that may start with a prolog ling. 273 | const prologCheckers = { 274 | /** 275 | * Check that given line is the `DOCTYPE` line. 276 | * 277 | * @param {string} line The line to check. 278 | * @return {boolean} `true` if given is an HTML `DOCTYPE`, `false` otherwise. 279 | */ 280 | htm(line) { 281 | return this.html(line); 282 | }, 283 | 284 | /** 285 | * Check that given line is the `DOCTYPE` line. 286 | * 287 | * @param {string} line The line to check. 288 | * @return {boolean} `true` if given is an HTML `DOCTYPE`, `false` otherwise. 289 | */ 290 | html(line) { 291 | return _.startsWith(line, '` and this 328 | * prolog must always be the first line (before anything else, including comments). 329 | * 330 | * @param {string} type File type. 331 | * @return {boolean} `true` if given file type may start with a prolog, `false` otherwise. 332 | */ 333 | function maySkipFirstLine(type) { 334 | return _.has(prologCheckers, type); 335 | } 336 | 337 | /** 338 | * Check if given line should be skipped before adding header content. 339 | * 340 | * @param {string} type File type. 341 | * @param {string} line The first line of given file. 342 | * @return {boolean} `true` if given line should be skipped, `false` otherwise. 343 | */ 344 | function shouldSkipFirstLine(type, line) { 345 | return prologCheckers[type](line); 346 | } 347 | 348 | /** 349 | * Read file specified by given options. 350 | * 351 | * @param {Object} options Read options. 352 | * @param {string} defaultEncoding The default encoding to use. 353 | * @return {Promise} A promise resolved with file content. 354 | */ 355 | function read(options, defaultEncoding) { 356 | if (_.isString(options)) { 357 | return Q.when(options); 358 | } 359 | 360 | const { file } = options; 361 | const encoding = options.encoding || defaultEncoding || 'utf-8'; 362 | const deferred = Q.defer(); 363 | 364 | fs.readFile(file, { encoding }, (err, data) => ( 365 | err ? deferred.reject(err) : deferred.resolve(data) 366 | )); 367 | 368 | return deferred.promise; 369 | } 370 | 371 | /** 372 | * Creates a new Buffer containing string. 373 | * 374 | * @param {string} rawString The string content. 375 | * @return {Buffer} Node Buffer. 376 | */ 377 | function toBuffer(rawString) { 378 | // eslint-disable-next-line no-buffer-constructor 379 | return Buffer.from ? Buffer.from(rawString) : new Buffer(rawString); 380 | } 381 | -------------------------------------------------------------------------------- /test/.eslintrc: -------------------------------------------------------------------------------- 1 | { 2 | "env": { 3 | "jasmine": true 4 | } 5 | } 6 | -------------------------------------------------------------------------------- /test/fixtures/.appcache: -------------------------------------------------------------------------------- 1 | CACHE MANIFEST 2 | -------------------------------------------------------------------------------- /test/fixtures/js-bin.js: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env node 2 | 3 | /* eslint-disable */ 4 | 5 | console.log('test'); 6 | -------------------------------------------------------------------------------- /test/fixtures/test.appcache: -------------------------------------------------------------------------------- 1 | CACHE MANIFEST 2 | -------------------------------------------------------------------------------- /test/fixtures/test.css: -------------------------------------------------------------------------------- 1 | body { 2 | color: red; 3 | } 4 | -------------------------------------------------------------------------------- /test/fixtures/test.js: -------------------------------------------------------------------------------- 1 | /* eslint-disable */ 2 | 3 | 'use strict'; 4 | 5 | function sayHello() { 6 | console.log('Hello World'); 7 | } 8 | -------------------------------------------------------------------------------- /test/fixtures/test.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | -------------------------------------------------------------------------------- /test/fixtures/test.txt: -------------------------------------------------------------------------------- 1 | Hello World 2 | -------------------------------------------------------------------------------- /test/fixtures/test.xml: -------------------------------------------------------------------------------- 1 | 2 | Hello World 3 | -------------------------------------------------------------------------------- /test/index.spec.js: -------------------------------------------------------------------------------- 1 | /** 2 | * The MIT License (MIT) 3 | * 4 | * Copyright (c) 2017-2020 Mickael Jeanroy 5 | * 6 | * Permission is hereby granted, free of charge, to any person obtaining a copy 7 | * of this software and associated documentation files (the "Software"), to deal 8 | * in the Software without restriction, including without limitation the rights 9 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 10 | * copies of the Software, and to permit persons to whom the Software is 11 | * furnished to do so, subject to the following conditions: 12 | * 13 | * The above copyright notice and this permission notice shall be included in 14 | * all copies or substantial portions of the Software. 15 | * 16 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 18 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 19 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 20 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 21 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 22 | * THE SOFTWARE. 23 | */ 24 | 25 | const fs = require('fs'); 26 | const path = require('path'); 27 | const Vinyl = require('vinyl'); 28 | const Stream = require('stream'); 29 | const moment = require('moment'); 30 | const gulpHeaderComment = require('../src/index'); 31 | const newBuffer = require('./utils/buffer'); 32 | const joinLines = require('./utils/join-lines'); 33 | const EOL = require('./utils/eol'); 34 | 35 | describe('gulp-header-comment', () => { 36 | let cwd; 37 | let base; 38 | 39 | beforeEach(() => { 40 | cwd = __dirname; 41 | base = path.join(cwd, 'fixtures'); 42 | }); 43 | 44 | it('should not prepend header with null file', (done) => { 45 | const filePath = path.join(base, 'test.js'); 46 | const contents = null; 47 | const vinyl = new Vinyl({ 48 | cwd, 49 | base, 50 | contents, 51 | path: filePath, 52 | }); 53 | 54 | const stream = gulpHeaderComment({ 55 | file: path.join(base, 'test.txt'), 56 | }); 57 | 58 | stream.on('data', (newFile) => { 59 | expect(newFile).toBeDefined(); 60 | expect(newFile.cwd).toEqual(cwd); 61 | expect(newFile.base).toEqual(base); 62 | expect(newFile.path).toEqual(filePath); 63 | expect(newFile.contents).toBeNull(); 64 | }); 65 | 66 | stream.once('error', (err) => { 67 | done.fail(err); 68 | }); 69 | 70 | stream.once('end', () => { 71 | done(); 72 | }); 73 | 74 | stream.write(vinyl); 75 | stream.end(); 76 | }); 77 | 78 | it('should prepend header with buffer content', (done) => { 79 | const filePath = path.join(base, 'test.js'); 80 | const code = fs.readFileSync(filePath, 'utf-8'); 81 | expect(code).toBeTruthy(); 82 | 83 | const contents = newBuffer(code); 84 | const vinyl = new Vinyl({ 85 | cwd, 86 | base, 87 | contents, 88 | path: filePath, 89 | }); 90 | 91 | const headerFile = path.join(base, 'test.txt'); 92 | const expectedHeader = joinLines([ 93 | '/**', 94 | ' * Hello World', 95 | ' */', 96 | '', 97 | ]); 98 | 99 | const stream = gulpHeaderComment({ 100 | file: headerFile, 101 | }); 102 | 103 | stream.on('data', (newFile) => { 104 | expect(newFile).toBeDefined(); 105 | expect(newFile.cwd).toEqual(cwd); 106 | expect(newFile.base).toEqual(base); 107 | expect(newFile.path).toEqual(filePath); 108 | expect(newFile.contents).not.toBeNull(); 109 | expect(newFile.contents.toString()).toEqual(joinLines([ 110 | expectedHeader, 111 | code, 112 | ])); 113 | }); 114 | 115 | stream.once('error', (err) => { 116 | done.fail(err); 117 | }); 118 | 119 | stream.once('end', () => { 120 | done(); 121 | }); 122 | 123 | stream.write(vinyl); 124 | stream.end(); 125 | }); 126 | 127 | it('should prepend header with stream content', (done) => { 128 | const filePath = path.join(base, 'test.js'); 129 | const code = fs.readFileSync(filePath, 'utf-8'); 130 | expect(code).toBeTruthy(); 131 | 132 | const contents = new Stream.Readable(); 133 | contents.push(code); 134 | contents.push(null); 135 | 136 | const vinyl = new Vinyl({ 137 | cwd, 138 | base, 139 | contents, 140 | path: filePath, 141 | }); 142 | 143 | const headerFile = path.join(base, 'test.txt'); 144 | const expectedHeader = joinLines([ 145 | '/**', 146 | ' * Hello World', 147 | ' */', 148 | '', 149 | ]); 150 | 151 | const stream = gulpHeaderComment({ 152 | file: headerFile, 153 | }); 154 | 155 | stream.on('data', (newFile) => { 156 | expect(newFile).toBeDefined(); 157 | expect(newFile.cwd).toEqual(cwd); 158 | expect(newFile.base).toEqual(base); 159 | expect(newFile.path).toEqual(filePath); 160 | expect(newFile.contents).not.toBeNull(); 161 | 162 | let newContent = ''; 163 | 164 | newFile.contents.on('data', (chunk) => { 165 | newContent += chunk; 166 | }); 167 | 168 | newFile.contents.once('end', () => { 169 | expect(newContent).toEqual(joinLines([ 170 | expectedHeader, 171 | code, 172 | ])); 173 | 174 | done(); 175 | }); 176 | }); 177 | 178 | stream.once('error', (err) => { 179 | done.fail(err); 180 | }); 181 | 182 | stream.write(vinyl); 183 | stream.end(); 184 | }); 185 | 186 | it('should prepend header with CSS content', (done) => { 187 | const filePath = path.join(base, 'test.css'); 188 | const code = fs.readFileSync(filePath); 189 | expect(code).toBeTruthy(); 190 | 191 | const contents = newBuffer(code); 192 | const vinyl = new Vinyl({ 193 | cwd, 194 | base, 195 | contents, 196 | path: filePath, 197 | }); 198 | 199 | const headerFile = path.join(base, 'test.txt'); 200 | const expectedHeader = joinLines([ 201 | '/**', 202 | ' * Hello World', 203 | ' */', 204 | '', 205 | ]); 206 | 207 | const stream = gulpHeaderComment({ 208 | file: headerFile, 209 | }); 210 | 211 | stream.on('data', (newFile) => { 212 | expect(newFile).toBeDefined(); 213 | expect(newFile.cwd).toEqual(cwd); 214 | expect(newFile.base).toEqual(base); 215 | expect(newFile.path).toEqual(filePath); 216 | expect(newFile.contents).not.toBeNull(); 217 | expect(newFile.contents.toString()).toEqual(joinLines([ 218 | expectedHeader, 219 | code, 220 | ])); 221 | }); 222 | 223 | stream.once('error', (err) => { 224 | done.fail(err); 225 | }); 226 | 227 | stream.once('end', () => { 228 | done(); 229 | }); 230 | 231 | stream.write(vinyl); 232 | stream.end(); 233 | }); 234 | 235 | it('should prepend header from a simple string', (done) => { 236 | const filePath = path.join(base, 'test.js'); 237 | const code = fs.readFileSync(filePath); 238 | expect(code).toBeTruthy(); 239 | 240 | const contents = newBuffer(code); 241 | const vinyl = new Vinyl({ 242 | cwd, 243 | base, 244 | contents, 245 | path: filePath, 246 | }); 247 | 248 | const header = 'Hello World'; 249 | const expectedHeader = joinLines([ 250 | '/**', 251 | ` * ${header}`, 252 | ' */', 253 | '', 254 | ]); 255 | 256 | const stream = gulpHeaderComment(header); 257 | 258 | stream.on('data', (newFile) => { 259 | expect(newFile).toBeDefined(); 260 | expect(newFile.cwd).toEqual(cwd); 261 | expect(newFile.base).toEqual(base); 262 | expect(newFile.path).toEqual(filePath); 263 | expect(newFile.contents).not.toBeNull(); 264 | expect(newFile.contents.toString()).toEqual(joinLines([ 265 | expectedHeader, 266 | code, 267 | ])); 268 | }); 269 | 270 | stream.once('error', (err) => { 271 | done.fail(err); 272 | }); 273 | 274 | stream.once('end', () => { 275 | done(); 276 | }); 277 | 278 | stream.write(vinyl); 279 | stream.end(); 280 | }); 281 | 282 | it('should prepend header with custom separator', (done) => { 283 | const filePath = path.join(base, 'test.js'); 284 | const code = fs.readFileSync(filePath, 'utf-8'); 285 | expect(code).toBeTruthy(); 286 | 287 | const contents = newBuffer(code); 288 | const vinyl = new Vinyl({ 289 | cwd, 290 | base, 291 | contents, 292 | path: filePath, 293 | }); 294 | 295 | const headerFile = path.join(base, 'test.txt'); 296 | const expectedHeader = joinLines([ 297 | '/**', 298 | ' * Hello World', 299 | ' */', 300 | '', 301 | ]); 302 | 303 | const separator = `//${EOL}`; 304 | 305 | const stream = gulpHeaderComment({ 306 | file: headerFile, 307 | separator, 308 | }); 309 | 310 | stream.on('data', (newFile) => { 311 | expect(newFile).toBeDefined(); 312 | expect(newFile.cwd).toEqual(cwd); 313 | expect(newFile.base).toEqual(base); 314 | expect(newFile.path).toEqual(filePath); 315 | expect(newFile.contents).not.toBeNull(); 316 | expect(newFile.contents.toString()).toEqual(expectedHeader + separator + code); 317 | }); 318 | 319 | stream.once('error', (err) => { 320 | done.fail(err); 321 | }); 322 | 323 | stream.once('end', () => { 324 | done(); 325 | }); 326 | 327 | stream.write(vinyl); 328 | stream.end(); 329 | }); 330 | 331 | it('should prepend header with custom encoding', (done) => { 332 | const filePath = path.join(base, 'test.js'); 333 | const code = fs.readFileSync(filePath, 'utf-8'); 334 | expect(code).toBeTruthy(); 335 | 336 | const contents = newBuffer(code); 337 | const vinyl = new Vinyl({ 338 | cwd, 339 | base, 340 | contents, 341 | path: filePath, 342 | }); 343 | 344 | const headerFile = path.join(base, 'test.txt'); 345 | const encoding = 'ascii'; 346 | 347 | const stream = gulpHeaderComment({ 348 | file: headerFile, 349 | encoding, 350 | }); 351 | 352 | spyOn(fs, 'readFile').and.callThrough(); 353 | 354 | stream.on('data', () => { 355 | expect(fs.readFile).toHaveBeenCalledWith(jasmine.any(String), { encoding }, jasmine.any(Function)); 356 | }); 357 | 358 | stream.once('error', (err) => { 359 | done.fail(err); 360 | }); 361 | 362 | stream.once('end', () => { 363 | done(); 364 | }); 365 | 366 | stream.write(vinyl); 367 | stream.end(); 368 | }); 369 | 370 | it('should prepend header with interpolated template', (done) => { 371 | const filePath = path.join(base, 'test.js'); 372 | const code = fs.readFileSync(filePath, 'utf-8'); 373 | expect(code).toBeTruthy(); 374 | 375 | const contents = newBuffer(code); 376 | const vinyl = new Vinyl({ 377 | cwd, 378 | base, 379 | contents, 380 | path: filePath, 381 | }); 382 | 383 | const header = "Generated on <%= moment().format('YYYY') %>"; 384 | const expectedHeader = joinLines([ 385 | '/**', 386 | ` * Generated on ${moment().format('YYYY')}`, 387 | ' */', 388 | '', 389 | ]); 390 | 391 | const stream = gulpHeaderComment(header); 392 | 393 | stream.on('data', (newFile) => { 394 | expect(newFile.contents.toString()).toEqual(joinLines([ 395 | expectedHeader, 396 | code, 397 | ])); 398 | }); 399 | 400 | stream.once('error', (err) => { 401 | done.fail(err); 402 | }); 403 | 404 | stream.once('end', () => { 405 | done(); 406 | }); 407 | 408 | stream.write(vinyl); 409 | stream.end(); 410 | }); 411 | 412 | it('should prepend header with data from package.json file', (done) => { 413 | const filePath = path.join(base, 'test.js'); 414 | const code = fs.readFileSync(filePath, 'utf-8'); 415 | expect(code).toBeTruthy(); 416 | 417 | const contents = newBuffer(code); 418 | const vinyl = new Vinyl({ 419 | cwd, 420 | base, 421 | contents, 422 | path: filePath, 423 | }); 424 | 425 | const header = 'Lib: <%= pkg.name %>'; 426 | const expectedHeader = joinLines([ 427 | '/**', 428 | ' * Lib: gulp-header-comment', 429 | ' */', 430 | '', 431 | ]); 432 | 433 | const stream = gulpHeaderComment(header); 434 | 435 | stream.on('data', (newFile) => { 436 | expect(newFile.contents.toString()).toEqual(joinLines([ 437 | expectedHeader, 438 | code, 439 | ])); 440 | }); 441 | 442 | stream.once('error', (err) => { 443 | done.fail(err); 444 | }); 445 | 446 | stream.once('end', () => { 447 | done(); 448 | }); 449 | 450 | stream.write(vinyl); 451 | stream.end(); 452 | }); 453 | 454 | it('should fail if template file does not exist', (done) => { 455 | const filePath = path.join(base, 'test.js'); 456 | const code = fs.readFileSync(filePath, 'utf-8'); 457 | expect(code).toBeTruthy(); 458 | 459 | const contents = newBuffer(code); 460 | const vinyl = new Vinyl({ 461 | cwd, 462 | base, 463 | contents, 464 | path: filePath, 465 | }); 466 | 467 | const stream = gulpHeaderComment({ 468 | file: 'fake-file-that-does-not-exist', 469 | }); 470 | 471 | stream.once('error', (err) => { 472 | expect(err).toBeDefined(); 473 | done(); 474 | }); 475 | 476 | stream.once('end', () => { 477 | done.fail('Error should have been triggered'); 478 | }); 479 | 480 | stream.write(vinyl); 481 | stream.end(); 482 | }); 483 | 484 | it('should prepend header with configuration file such as .appacache', (done) => { 485 | const filePath = path.join(base, '.appcache'); 486 | const code = fs.readFileSync(filePath); 487 | expect(code).toBeTruthy(); 488 | 489 | const contents = newBuffer(code); 490 | const vinyl = new Vinyl({ 491 | cwd, 492 | base, 493 | contents, 494 | path: filePath, 495 | }); 496 | 497 | const headerFile = path.join(base, 'test.txt'); 498 | 499 | const expectedHeader = joinLines([ 500 | '#', 501 | '# Hello World', 502 | '#', 503 | '', 504 | ]); 505 | 506 | const stream = gulpHeaderComment({ 507 | file: headerFile, 508 | }); 509 | 510 | stream.on('data', (newFile) => { 511 | expect(newFile).toBeDefined(); 512 | expect(newFile.cwd).toEqual(cwd); 513 | expect(newFile.base).toEqual(base); 514 | expect(newFile.path).toEqual(filePath); 515 | expect(newFile.contents).not.toBeNull(); 516 | expect(newFile.contents.toString()).toEqual(joinLines([ 517 | expectedHeader, 518 | code, 519 | ])); 520 | }); 521 | 522 | stream.once('error', (err) => { 523 | done.fail(err); 524 | }); 525 | 526 | stream.once('end', () => { 527 | done(); 528 | }); 529 | 530 | stream.write(vinyl); 531 | stream.end(); 532 | }); 533 | 534 | it('should prepend header with an unknown extension', (done) => { 535 | const filePath = path.join(base, 'test.appcache'); 536 | const code = fs.readFileSync(filePath); 537 | expect(code).toBeTruthy(); 538 | 539 | const contents = newBuffer(code); 540 | const vinyl = new Vinyl({ 541 | cwd, 542 | base, 543 | contents, 544 | path: filePath, 545 | }); 546 | 547 | const headerFile = path.join(base, 'test.txt'); 548 | 549 | const expectedHeader = joinLines([ 550 | '#', 551 | '# Hello World', 552 | '#', 553 | '', 554 | ]); 555 | 556 | const stream = gulpHeaderComment({ 557 | file: headerFile, 558 | }); 559 | 560 | stream.on('data', (newFile) => { 561 | expect(newFile).toBeDefined(); 562 | expect(newFile.cwd).toEqual(cwd); 563 | expect(newFile.base).toEqual(base); 564 | expect(newFile.path).toEqual(filePath); 565 | expect(newFile.contents).not.toBeNull(); 566 | expect(newFile.contents.toString()).toEqual(joinLines([ 567 | expectedHeader, 568 | code, 569 | ])); 570 | }); 571 | 572 | stream.once('error', (err) => { 573 | done.fail(err); 574 | }); 575 | 576 | stream.once('end', () => { 577 | done(); 578 | }); 579 | 580 | stream.write(vinyl); 581 | stream.end(); 582 | }); 583 | 584 | it('should prepend header not at first line with files such as XML file', (done) => { 585 | const filePath = path.join(base, 'test.xml'); 586 | const code = fs.readFileSync(filePath); 587 | expect(code).toBeTruthy(); 588 | 589 | const contents = newBuffer(code); 590 | const vinyl = new Vinyl({ 591 | cwd, 592 | base, 593 | contents, 594 | path: filePath, 595 | }); 596 | 597 | const headerFile = path.join(base, 'test.txt'); 598 | 599 | const stream = gulpHeaderComment({ 600 | file: headerFile, 601 | }); 602 | 603 | stream.on('data', (newFile) => { 604 | expect(newFile).toBeDefined(); 605 | expect(newFile.cwd).toEqual(cwd); 606 | expect(newFile.base).toEqual(base); 607 | expect(newFile.path).toEqual(filePath); 608 | expect(newFile.contents).not.toBeNull(); 609 | expect(newFile.contents.toString()).toEqual(joinLines([ 610 | '', 611 | '', 612 | '', 615 | '', 616 | 'Hello World', 617 | '', 618 | ])); 619 | }); 620 | 621 | stream.once('error', (err) => { 622 | done.fail(err); 623 | }); 624 | 625 | stream.once('end', () => { 626 | done(); 627 | }); 628 | 629 | stream.write(vinyl); 630 | stream.end(); 631 | }); 632 | 633 | it('should prepend header not at first line with files such as SVG file', (done) => { 634 | const filePath = path.join(base, 'test.svg'); 635 | const code = fs.readFileSync(filePath); 636 | expect(code).toBeTruthy(); 637 | 638 | const contents = newBuffer(code); 639 | const vinyl = new Vinyl({ 640 | cwd, 641 | base, 642 | contents, 643 | path: filePath, 644 | }); 645 | 646 | const headerFile = path.join(base, 'test.txt'); 647 | 648 | const stream = gulpHeaderComment({ 649 | file: headerFile, 650 | }); 651 | 652 | stream.on('data', (newFile) => { 653 | expect(newFile).toBeDefined(); 654 | expect(newFile.cwd).toEqual(cwd); 655 | expect(newFile.base).toEqual(base); 656 | expect(newFile.path).toEqual(filePath); 657 | expect(newFile.contents).not.toBeNull(); 658 | expect(newFile.contents.toString()).toEqual(joinLines([ 659 | '', 660 | '', 661 | '', 664 | '', 665 | '', 666 | '', 667 | ])); 668 | }); 669 | 670 | stream.once('error', (err) => { 671 | done.fail(err); 672 | }); 673 | 674 | stream.once('end', () => { 675 | done(); 676 | }); 677 | 678 | stream.write(vinyl); 679 | stream.end(); 680 | }); 681 | 682 | it('should prepend header not at first line with files such as js file with node hashbang', (done) => { 683 | const filePath = path.join(base, 'js-bin.js'); 684 | const code = fs.readFileSync(filePath); 685 | expect(code).toBeTruthy(); 686 | 687 | const contents = newBuffer(code); 688 | const vinyl = new Vinyl({ 689 | cwd, 690 | base, 691 | contents, 692 | path: filePath, 693 | }); 694 | 695 | const headerFile = path.join(base, 'test.txt'); 696 | 697 | const stream = gulpHeaderComment({ 698 | file: headerFile, 699 | }); 700 | 701 | stream.on('data', (newFile) => { 702 | expect(newFile).toBeDefined(); 703 | expect(newFile.cwd).toEqual(cwd); 704 | expect(newFile.base).toEqual(base); 705 | expect(newFile.path).toEqual(filePath); 706 | expect(newFile.contents).not.toBeNull(); 707 | expect(newFile.contents.toString()).toEqual(joinLines([ 708 | '#!/usr/bin/env node', 709 | '', 710 | '/**', 711 | ' * Hello World', 712 | ' */', 713 | '', 714 | '', 715 | '/* eslint-disable */', 716 | '', 717 | "console.log('test');", 718 | '', 719 | ])); 720 | }); 721 | 722 | stream.once('error', (err) => { 723 | done.fail(err); 724 | }); 725 | 726 | stream.once('end', () => { 727 | done(); 728 | }); 729 | 730 | stream.write(vinyl); 731 | stream.end(); 732 | }); 733 | 734 | it('should add header after first in case of SVG file with stream content', (done) => { 735 | const filePath = path.join(base, 'test.svg'); 736 | const code = fs.readFileSync(filePath, 'utf-8'); 737 | expect(code).toBeTruthy(); 738 | 739 | const contents = new Stream.Readable(); 740 | contents.push(code); 741 | contents.push(null); 742 | 743 | const vinyl = new Vinyl({ 744 | cwd, 745 | base, 746 | contents, 747 | path: filePath, 748 | }); 749 | 750 | const headerFile = path.join(base, 'test.txt'); 751 | const stream = gulpHeaderComment({ 752 | file: headerFile, 753 | }); 754 | 755 | stream.on('data', (newFile) => { 756 | expect(newFile).toBeDefined(); 757 | expect(newFile.cwd).toEqual(cwd); 758 | expect(newFile.base).toEqual(base); 759 | expect(newFile.path).toEqual(filePath); 760 | expect(newFile.contents).not.toBeNull(); 761 | 762 | let newContent = ''; 763 | 764 | newFile.contents.on('data', (chunk) => { 765 | newContent += chunk; 766 | }); 767 | 768 | newFile.contents.once('end', () => { 769 | expect(newContent.toString()).toEqual(joinLines([ 770 | '', 771 | '', 772 | '', 775 | '', 776 | '', 777 | '', 778 | ])); 779 | 780 | done(); 781 | }); 782 | }); 783 | 784 | stream.once('error', (err) => { 785 | done.fail(err); 786 | }); 787 | 788 | stream.write(vinyl); 789 | stream.end(); 790 | }); 791 | }); 792 | -------------------------------------------------------------------------------- /test/it.spec.js: -------------------------------------------------------------------------------- 1 | /** 2 | * The MIT License (MIT) 3 | * 4 | * Copyright (c) 2017-2020 Mickael Jeanroy 5 | * 6 | * Permission is hereby granted, free of charge, to any person obtaining a copy 7 | * of this software and associated documentation files (the "Software"), to deal 8 | * in the Software without restriction, including without limitation the rights 9 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 10 | * copies of the Software, and to permit persons to whom the Software is 11 | * furnished to do so, subject to the following conditions: 12 | * 13 | * The above copyright notice and this permission notice shall be included in 14 | * all copies or substantial portions of the Software. 15 | * 16 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 18 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 19 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 20 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 21 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 22 | * THE SOFTWARE. 23 | */ 24 | 25 | const path = require('path'); 26 | const fs = require('fs'); 27 | const gulp = require('gulp'); 28 | const tmp = require('tmp'); 29 | const sourcemaps = require('gulp-sourcemaps'); 30 | const headerComment = require('../src/index'); 31 | const joinLines = require('./utils/join-lines'); 32 | 33 | describe('[IT] gulp-header-comment', () => { 34 | let tmpDir; 35 | 36 | beforeEach(() => { 37 | tmpDir = tmp.dirSync({ 38 | unsafeCleanup: true, 39 | }); 40 | }); 41 | 42 | afterEach(() => { 43 | tmpDir.removeCallback(); 44 | }); 45 | 46 | it('should prepend header', (done) => { 47 | const fName = 'test.txt'; 48 | const src = path.join(__dirname, 'fixtures', fName); 49 | const dest = path.join(tmpDir.name); 50 | 51 | gulp.src(src) 52 | .pipe(headerComment('License MIT')) 53 | .pipe(gulp.dest(dest)) 54 | .on('error', (err) => done.fail(err)) 55 | .on('end', () => { 56 | fs.readFile(path.join(dest, fName), 'utf8', (err, data) => { 57 | if (err) { 58 | done.fail(err); 59 | return; 60 | } 61 | 62 | expect(data).toEqual(joinLines([ 63 | '/**', 64 | ' * License MIT', 65 | ' */', 66 | '', 67 | 'Hello World', 68 | '', 69 | ])); 70 | 71 | done(); 72 | }); 73 | }); 74 | }); 75 | 76 | it('should prepend header and apply sourcemap', (done) => { 77 | const fname = 'test.js'; 78 | const src = path.join(__dirname, 'fixtures', fname); 79 | const dest = path.join(tmpDir.name); 80 | 81 | gulp.src(src) 82 | .pipe(sourcemaps.init()) 83 | .pipe(headerComment('License MIT')) 84 | .pipe(sourcemaps.write('.')) 85 | .pipe(gulp.dest(dest)) 86 | .on('error', (err) => done.fail(err)) 87 | .on('end', () => { 88 | fs.readFile(path.join(dest, `${fname}.map`), 'utf8', (err, data) => { 89 | if (err) { 90 | done.fail(err); 91 | return; 92 | } 93 | 94 | const sourcemap = JSON.parse(data); 95 | 96 | expect(sourcemap.version).toBe(3); 97 | expect(sourcemap.file).toBe(fname); 98 | expect(sourcemap.sources).toEqual([fname]); 99 | expect(sourcemap.mappings).toBeDefined(); 100 | expect(sourcemap.mappings.length).toBeGreaterThan(0); 101 | expect(sourcemap.sourcesContent.toString()).toEqual(joinLines([ 102 | '/* eslint-disable */', 103 | '', 104 | "'use strict';", 105 | '', 106 | 'function sayHello() {', 107 | " console.log('Hello World');", 108 | '}', 109 | '', 110 | ])); 111 | 112 | done(); 113 | }); 114 | }); 115 | }); 116 | 117 | it('should prepend header with file name', (done) => { 118 | const fname = 'test.js'; 119 | const src = path.join(__dirname, 'fixtures', fname); 120 | const dest = path.join(tmpDir.name); 121 | 122 | const template = joinLines([ 123 | 'File path: <%= file.path %>', 124 | 'File relative path: <%= file.relativePath %>', 125 | 'File relative dir: <%= file.relativeDir %>', 126 | 'File name: <%= file.name %>', 127 | 'File dir: <%= file.dir %>', 128 | ]); 129 | 130 | gulp.src(src) 131 | .pipe(headerComment(template)) 132 | .pipe(gulp.dest(dest)) 133 | .on('error', (err) => done.fail(err)) 134 | .on('end', () => { 135 | fs.readFile(path.join(dest, fname), 'utf8', (err, data) => { 136 | if (err) { 137 | done.fail(err); 138 | return; 139 | } 140 | 141 | expect(data).toEqual(joinLines([ 142 | '/**', 143 | ` * File path: ${path.normalize(src)}`, 144 | ` * File relative path: ${path.normalize('test/fixtures/test.js')}`, 145 | ` * File relative dir: ${path.normalize('test/fixtures')}`, 146 | ' * File name: test.js', 147 | ` * File dir: ${path.normalize(path.dirname(src))}`, 148 | ' */', 149 | '', 150 | '/* eslint-disable */', 151 | '', 152 | "'use strict';", 153 | '', 154 | 'function sayHello() {', 155 | " console.log('Hello World');", 156 | '}', 157 | '', 158 | ])); 159 | 160 | done(); 161 | }); 162 | }); 163 | }); 164 | }); 165 | -------------------------------------------------------------------------------- /test/utils/buffer.js: -------------------------------------------------------------------------------- 1 | /** 2 | * The MIT License (MIT) 3 | * 4 | * Copyright (c) 2017-2020 Mickael Jeanroy 5 | * 6 | * Permission is hereby granted, free of charge, to any person obtaining a copy 7 | * of this software and associated documentation files (the "Software"), to deal 8 | * in the Software without restriction, including without limitation the rights 9 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 10 | * copies of the Software, and to permit persons to whom the Software is 11 | * furnished to do so, subject to the following conditions: 12 | * 13 | * The above copyright notice and this permission notice shall be included in 14 | * all copies or substantial portions of the Software. 15 | * 16 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 18 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 19 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 20 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 21 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 22 | * THE SOFTWARE. 23 | */ 24 | 25 | /** 26 | * Create buffer using `Buffer.from` if available, fallback to `new Buffer` otherwise. 27 | * 28 | * @param {string} content Buffer content. 29 | * @return {Buffer} The buffer object. 30 | */ 31 | module.exports = function newBuffer(content) { 32 | // eslint-disable-next-line no-buffer-constructor 33 | return Buffer.from ? Buffer.from(content) : new Buffer(content); 34 | }; 35 | -------------------------------------------------------------------------------- /test/utils/eol.js: -------------------------------------------------------------------------------- 1 | /** 2 | * The MIT License (MIT) 3 | * 4 | * Copyright (c) 2017-2020 Mickael Jeanroy 5 | * 6 | * Permission is hereby granted, free of charge, to any person obtaining a copy 7 | * of this software and associated documentation files (the "Software"), to deal 8 | * in the Software without restriction, including without limitation the rights 9 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 10 | * copies of the Software, and to permit persons to whom the Software is 11 | * furnished to do so, subject to the following conditions: 12 | * 13 | * The above copyright notice and this permission notice shall be included in 14 | * all copies or substantial portions of the Software. 15 | * 16 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 18 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 19 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 20 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 21 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 22 | * THE SOFTWARE. 23 | */ 24 | 25 | module.exports = '\n'; 26 | -------------------------------------------------------------------------------- /test/utils/join-lines.js: -------------------------------------------------------------------------------- 1 | /** 2 | * The MIT License (MIT) 3 | * 4 | * Copyright (c) 2017-2020 Mickael Jeanroy 5 | * 6 | * Permission is hereby granted, free of charge, to any person obtaining a copy 7 | * of this software and associated documentation files (the "Software"), to deal 8 | * in the Software without restriction, including without limitation the rights 9 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 10 | * copies of the Software, and to permit persons to whom the Software is 11 | * furnished to do so, subject to the following conditions: 12 | * 13 | * The above copyright notice and this permission notice shall be included in 14 | * all copies or substantial portions of the Software. 15 | * 16 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 18 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 19 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 20 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 21 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 22 | * THE SOFTWARE. 23 | */ 24 | 25 | const EOL = require('./eol'); 26 | 27 | /** 28 | * Join given strings with the EOL character. 29 | * @param {Array} lines Given lines to join. 30 | * @param {string} joiner The character to use to join lines. 31 | * @return {string} Joined lines. 32 | */ 33 | module.exports = function joinLines(lines, joiner = EOL) { 34 | return lines.join(joiner); 35 | }; 36 | --------------------------------------------------------------------------------