From d365e7f699fe12c71640af8f6dfa572f86d2e14b Mon Sep 17 00:00:00 2001 From: Bart Veneman <1536852+bartveneman@users.noreply.github.com> Date: Tue, 10 Mar 2020 12:40:03 +0100 Subject: [PATCH 1/6] =?UTF-8?q?=F0=9F=90=9B=20await=20response.text()=20(#?= =?UTF-8?q?28)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/index.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/index.js b/src/index.js index 546f9cd..137a372 100644 --- a/src/index.js +++ b/src/index.js @@ -41,7 +41,8 @@ module.exports = async (url, {waitUntil = 'networkidle0'} = {}) => { const headers = response.headers() if (headers['content-type'].includes('text/css')) { - return Promise.resolve(response.text()) + const css = await response.text() + return Promise.resolve(css) } const coverage = await page.coverage.stopCSSCoverage() From e89ac6ec407868a42b657c9c5cfff9c2b4ebe84b Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Sat, 14 Mar 2020 09:27:47 +0100 Subject: [PATCH 2/6] Bump acorn from 7.1.0 to 7.1.1 (#29) Bumps [acorn](https://github.com/acornjs/acorn) from 7.1.0 to 7.1.1. - [Release notes](https://github.com/acornjs/acorn/releases) - [Commits](https://github.com/acornjs/acorn/compare/7.1.0...7.1.1) Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- package-lock.json | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/package-lock.json b/package-lock.json index 007f029..b31bff4 100644 --- a/package-lock.json +++ b/package-lock.json @@ -463,9 +463,9 @@ } }, "acorn": { - "version": "7.1.0", - "resolved": "https://registry.npmjs.org/acorn/-/acorn-7.1.0.tgz", - "integrity": "sha512-kL5CuoXA/dgxlBbVrflsflzQ3PAas7RYZB52NOm/6839iVYJgKMJ3cQJD+t2i5+qFa8h3MDpEOJiS64E8JLnSQ==", + "version": "7.1.1", + "resolved": "https://registry.npmjs.org/acorn/-/acorn-7.1.1.tgz", + "integrity": "sha512-add7dgA5ppRPxCFJoAGfMDi7PIBXq1RtGo7BhbLaxwrXPOmw8gq48Y9ozT01hUKy9byMjlR20EJhu5zlkErEkg==", "dev": true }, "acorn-jsx": { From afadea662233a4d865bc728cc0327c38d8aa1c63 Mon Sep 17 00:00:00 2001 From: Bart Veneman <1536852+bartveneman@users.noreply.github.com> Date: Sun, 15 Mar 2020 21:37:23 +0100 Subject: [PATCH 3/6] Fix comment --- src/index.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/index.js b/src/index.js index 137a372..47b4bf4 100644 --- a/src/index.js +++ b/src/index.js @@ -52,7 +52,8 @@ module.exports = async (url, {waitUntil = 'networkidle0'} = {}) => { // See: https://developer.mozilla.org/en-US/docs/Web/API/CSSRule/cssText const styleSheetsApiCss = await page.evaluate(() => { return [...document.styleSheets] - // Only take the stylesheets without href (BUT WHY) + // Only take the stylesheets without href, because those with href are + // tags, and we already tackled those with the Coverage API .filter(stylesheet => stylesheet.href === null) .map(stylesheet => { return { From e3043f338b8699536c845b0848054e7333d68c98 Mon Sep 17 00:00:00 2001 From: Bart Veneman <1536852+bartveneman@users.noreply.github.com> Date: Sun, 22 Mar 2020 16:46:20 +0100 Subject: [PATCH 4/6] update deps (#30) Co-authored-by: Bart Veneman --- package-lock.json | 35 +++++++++++++++++++++-------------- 1 file changed, 21 insertions(+), 14 deletions(-) diff --git a/package-lock.json b/package-lock.json index b31bff4..ee62c74 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1996,6 +1996,19 @@ "ms": "2.0.0" } }, + "minimist": { + "version": "0.0.8", + "resolved": "https://registry.npmjs.org/minimist/-/minimist-0.0.8.tgz", + "integrity": "sha1-hX/Kv8M5fSYluCKCYuhqp6ARsF0=" + }, + "mkdirp": { + "version": "0.5.1", + "resolved": "https://registry.npmjs.org/mkdirp/-/mkdirp-0.5.1.tgz", + "integrity": "sha1-MAV0OOrGz3+MR2fzhkjWaX11yQM=", + "requires": { + "minimist": "0.0.8" + } + }, "ms": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz", @@ -3086,9 +3099,9 @@ } }, "minimist": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/minimist/-/minimist-1.2.0.tgz", - "integrity": "sha1-o1AIsg9BOD7sH7kU9M1d95omQoQ=", + "version": "1.2.5", + "resolved": "https://registry.npmjs.org/minimist/-/minimist-1.2.5.tgz", + "integrity": "sha512-FM9nNUYrRBAELZQT3xeZQ7fmMOBg6nWNmJKTcgsJeaLstP/UODVpGsr5OhXhhXg6f+qtJ8uiZ+PUxkDWcgIXLw==", "dev": true }, "minimist-options": { @@ -3110,18 +3123,12 @@ } }, "mkdirp": { - "version": "0.5.1", - "resolved": "https://registry.npmjs.org/mkdirp/-/mkdirp-0.5.1.tgz", - "integrity": "sha1-MAV0OOrGz3+MR2fzhkjWaX11yQM=", + "version": "0.5.3", + "resolved": "https://registry.npmjs.org/mkdirp/-/mkdirp-0.5.3.tgz", + "integrity": "sha512-P+2gwrFqx8lhew375MQHHeTlY8AuOJSrGf0R5ddkEndUkmwpgUob/vQuBD1V22/Cw1/lJr4x+EjllSezBThzBg==", + "dev": true, "requires": { - "minimist": "0.0.8" - }, - "dependencies": { - "minimist": { - "version": "0.0.8", - "resolved": "https://registry.npmjs.org/minimist/-/minimist-0.0.8.tgz", - "integrity": "sha1-hX/Kv8M5fSYluCKCYuhqp6ARsF0=" - } + "minimist": "^1.2.5" } }, "ms": { From 0480857b4a7ad615f265426ba008e1c756903c56 Mon Sep 17 00:00:00 2001 From: Bart Veneman <1536852+bartveneman@users.noreply.github.com> Date: Sun, 22 Mar 2020 16:53:02 +0100 Subject: [PATCH 5/6] replace travis with github actions (#31) * replace travis with github actions * auto-create labels action Co-authored-by: Bart Veneman --- .github/labels.json | 11 +++++++++++ .github/workflows/labels.yml | 17 +++++++++++++++++ .github/workflows/publish.yml | 33 +++++++++++++++++++++++++++++++++ .github/workflows/test.yml | 29 +++++++++++++++++++++++++++++ .travis.yml | 5 ----- readme.md | 2 +- 6 files changed, 91 insertions(+), 6 deletions(-) create mode 100644 .github/labels.json create mode 100644 .github/workflows/labels.yml create mode 100644 .github/workflows/publish.yml create mode 100644 .github/workflows/test.yml delete mode 100644 .travis.yml diff --git a/.github/labels.json b/.github/labels.json new file mode 100644 index 0000000..54f2a18 --- /dev/null +++ b/.github/labels.json @@ -0,0 +1,11 @@ +[ + { "name": "🐛 defect", "color": "b62020", "description": "Something isn't working as expected" }, + { "name": "🚨 breaking change", "color": "b62020", "description": "changes that require a major version bump" }, + { "name": "📚 dependencies", "color": "0854c4", "description": "pull requests that update a dependency file" }, + { "name": "👯‍♂️ duplicate", "color": "9eacb3", "description": "this issue or pull request already exists" }, + { "name": "✨ enhancement", "color": "29c87d", "description": "New feature or request" }, + { "name": "🚸 help wanted", "color": "0854c4", "description": "issue needs help" }, + { "name": "🗣 feedback wanted", "color": "0854c4", "description": "community feedback wanted" }, + { "name": "⚠️ tests", "color": "f10e69", "description": "issues regarding test suite" }, + { "name": "🛑 wontfix", "color": "f8f8f8", "description": "not in scope of this package or can be achieved otherwise" } +] diff --git a/.github/workflows/labels.yml b/.github/workflows/labels.yml new file mode 100644 index 0000000..4bb9911 --- /dev/null +++ b/.github/workflows/labels.yml @@ -0,0 +1,17 @@ +name: Create Default Labels + +on: + issues: + type: [ opened ] + +jobs: + labels: + name: Create Default Labels + + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@1.0.0 + - uses: lannonbr/issue-label-manager-action@2.0.0 + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} \ No newline at end of file diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml new file mode 100644 index 0000000..dc3ddfb --- /dev/null +++ b/.github/workflows/publish.yml @@ -0,0 +1,33 @@ +# This workflow will run tests using node and then publish a package to GitHub Packages when a release is created +# For more information see: https://help.github.com/actions/language-and-framework-guides/publishing-nodejs-packages + +name: NPM Publish + +on: + release: + types: [created] + +jobs: + build: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + - uses: actions/setup-node@v1 + with: + node-version: 12 + - run: npm ci + - run: npm test + + publish-npm: + needs: build + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + - uses: actions/setup-node@v1 + with: + node-version: 12 + registry-url: https://registry.npmjs.org/ + - run: npm ci + - run: npm publish + env: + NODE_AUTH_TOKEN: ${{secrets.NPM_TOKEN}} diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml new file mode 100644 index 0000000..3c7cd70 --- /dev/null +++ b/.github/workflows/test.yml @@ -0,0 +1,29 @@ +# This workflow will do a clean install of node dependencies, build the source code and run tests across different versions of node +# For more information see: https://help.github.com/actions/language-and-framework-guides/using-nodejs-with-github-actions + +name: Node.js CI + +on: + push: + branches: [master] + pull_request: + branches: [master] + +jobs: + build: + runs-on: ubuntu-latest + + strategy: + matrix: + node-version: [8.x, 10.x, 12.x] + + steps: + - uses: actions/checkout@v2 + - name: Use Node.js ${{ matrix.node-version }} + uses: actions/setup-node@v1 + with: + node-version: ${{ matrix.node-version }} + - run: npm ci + - run: npm test + env: + CI: true diff --git a/.travis.yml b/.travis.yml deleted file mode 100644 index 519370c..0000000 --- a/.travis.yml +++ /dev/null @@ -1,5 +0,0 @@ -language: node_js -node_js: - - '8' - - '10' - - '12' diff --git a/readme.md b/readme.md index ef0ab41..7613b43 100644 --- a/readme.md +++ b/readme.md @@ -5,7 +5,7 @@ [![NPM Version](https://img.shields.io/npm/v/extract-css-core.svg)](https://www.npmjs.com/package/extract-css-core) [![Weekly downloads](https://img.shields.io/npm/dw/extract-css-core.svg)](https://www.npmjs.com/package/extract-css-core) -[![Build Status](https://travis-ci.org/bartveneman/extract-css-core.svg?branch=master)](https://travis-ci.org/bartveneman/extract-css-core) +![Node.js CI](https://github.com/bartveneman/extract-css-core/workflows/Node.js%20CI/badge.svg) [![Known Vulnerabilities](https://snyk.io/test/github/bartveneman/extract-css-core/badge.svg)](https://snyk.io/test/github/bartveneman/extract-css-core) ![Dependencies Status](https://img.shields.io/david/bartveneman/extract-css-core.svg) ![Dependencies Status](https://img.shields.io/david/dev/bartveneman/extract-css-core.svg) From cbd4bc81d84dce1dd82b3aff9164f04d20c014d2 Mon Sep 17 00:00:00 2001 From: Bart Veneman Date: Sun, 22 Mar 2020 16:58:24 +0100 Subject: [PATCH 6/6] 2.2.0 --- package-lock.json | 2 +- package.json | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/package-lock.json b/package-lock.json index ee62c74..0e65eae 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,6 +1,6 @@ { "name": "extract-css-core", - "version": "2.1.0", + "version": "2.2.0", "lockfileVersion": 1, "requires": true, "dependencies": { diff --git a/package.json b/package.json index 4e42985..b623576 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "extract-css-core", "description": "Extract all CSS from a given url, both server side and client side rendered.", - "version": "2.1.0", + "version": "2.2.0", "homepage": "https://www.projectwallace.com/oss", "repository": "https://github.com/bartveneman/extract-css-core", "issues": "https://github.com/bartveneman/extract-css-core/issues",