From fd4ea1a54456cf0416fb9a15932715b5beb1ba0e Mon Sep 17 00:00:00 2001
From: Jovi De Croock <decroockjovi@gmail.com>
Date: Tue, 19 Jul 2022 23:47:02 +0200
Subject: [PATCH] Cleanup repository (#976)

* remove bors, appveyor and replace sizereport with our own

* remove install from size

* Update .github/workflows/nodejs.yml

Co-authored-by: Ryan Christian <33403762+rschristian@users.noreply.github.com>

Co-authored-by: Ryan Christian <33403762+rschristian@users.noreply.github.com>
---
 .github/workflows/nodejs.yml |  41 +++++--------
 .github/workflows/size.yml   |  25 ++++++++
 appveyor.yml                 |  16 -----
 bors.toml                    |   5 --
 package-lock.json            | 112 +----------------------------------
 package.json                 |  34 +++++------
 sizereport.config.js         |   5 --
 7 files changed, 55 insertions(+), 183 deletions(-)
 create mode 100644 .github/workflows/size.yml
 delete mode 100644 appveyor.yml
 delete mode 100644 bors.toml
 delete mode 100644 sizereport.config.js

diff --git a/.github/workflows/nodejs.yml b/.github/workflows/nodejs.yml
index a7e707f9..51f60d6f 100644
--- a/.github/workflows/nodejs.yml
+++ b/.github/workflows/nodejs.yml
@@ -21,29 +21,18 @@ jobs:
         uses: actions/setup-node@v1
         with:
           node-version: ${{ matrix.node-version }}
-      - name: install npm@latest
-        run: npm i -g npm@latest --registry=https://registry.npmjs.org
-      - name: npm install, build, and test
-        run: |
-          npm install
-          npm test
-      - name: sizereport
-        run: ./node_modules/.bin/sizereport --config
-
-# Could add this for canary versions
-#  publish-gpr:
-#    needs: build
-#    runs-on: ubuntu-latest
-#    steps:
-#      - uses: actions/checkout@v1
-#      - uses: actions/setup-node@v1
-#        with:
-#          node-version: 12
-#          registry-url: https://npm.pkg.github.com/
-#          scope: '@preact'
-#      - run: |
-#          npm install
-#          npm config set registry https://npm.pkg.github.com/
-#          npm publish
-#        env:
-#          NODE_AUTH_TOKEN: ${{secrets.GITHUB_TOKEN}}
+      - name: Cache node modules
+        uses: actions/cache@v1
+        env:
+          cache-name: cache-node-modules
+        with:
+          path: ~/.npm
+          # This uses the same name as the build-action so we can share the caches.
+          key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('**/package-lock.json') }}
+          restore-keys: |
+            ${{ runner.os }}-build-${{ env.cache-name }}-
+            ${{ runner.os }}-build-
+            ${{ runner.os }}-
+      - run: npm ci --ignore-scripts
+      - name: npm build and test
+        run: npm test
diff --git a/.github/workflows/size.yml b/.github/workflows/size.yml
new file mode 100644
index 00000000..0e541a0d
--- /dev/null
+++ b/.github/workflows/size.yml
@@ -0,0 +1,25 @@
+name: compressed-size
+on:
+  pull_request:
+    branches:
+      - master
+
+jobs:
+  build:
+    runs-on: ubuntu-latest
+    steps:
+      - uses: actions/checkout@v2
+
+      - name: compressed-size-action
+        uses: preactjs/compressed-size-action@v2
+        with:
+          pattern: 'dist/!(*.js.map)'
+          build-script: build
+          repo-token: '${{ secrets.GITHUB_TOKEN }}'
+
+      - name: compressed-size-action
+        uses: preactjs/compressed-size-action@v2
+        with:
+          pattern: 'test/fixtures/**/dist/!(*.map)'
+          build-script: 'test'
+          repo-token: '${{ secrets.GITHUB_TOKEN }}'
diff --git a/appveyor.yml b/appveyor.yml
deleted file mode 100644
index d0190667..00000000
--- a/appveyor.yml
+++ /dev/null
@@ -1,16 +0,0 @@
-environment:
-  nodejs_version: "10"
-
-install:
-  - ps: Install-Product node $env:nodejs_version
-  - npm install
-
-test_script:
-  - node --version
-  - npm --version
-  - npm test
-
-build: false
-
-cache:
-  - node_modules
diff --git a/bors.toml b/bors.toml
deleted file mode 100644
index 7209cc0e..00000000
--- a/bors.toml
+++ /dev/null
@@ -1,5 +0,0 @@
-status = [
-  "continuous-integration/travis-ci/push",
-]
-delete_merged_branches = true
-use_squash_merge = true
diff --git a/package-lock.json b/package-lock.json
index dd2a8bce..adec7f6b 100644
--- a/package-lock.json
+++ b/package-lock.json
@@ -78,8 +78,7 @@
 				"regenerator-runtime": "^0.13.7",
 				"rimraf": "^3.0.2",
 				"shell-quote": "^1.7.2",
-				"strip-ansi": "^6.0.0",
-				"travis-size-report": "^1.1.0"
+				"strip-ansi": "^6.0.0"
 			}
 		},
 		"node_modules/@babel/cli": {
@@ -16797,69 +16796,6 @@
 				"node": ">=8"
 			}
 		},
-		"node_modules/travis-size-report": {
-			"version": "1.1.0",
-			"resolved": "https://registry.npmjs.org/travis-size-report/-/travis-size-report-1.1.0.tgz",
-			"integrity": "sha512-mAMeCPZ1TvUEXDvweVCAG/ek6KgPeVsmQYXtv6I85UoIUIFAI/mCXnN7vyvTSCjIa8B0+cYn5slvqNn9Jo0U0g==",
-			"dev": true,
-			"dependencies": {
-				"chalk": "^2.4.2",
-				"escape-string-regexp": "^2.0.0",
-				"glob": "^7.1.3",
-				"gzip-size": "^5.1.0",
-				"minimist": "^1.2.0",
-				"node-fetch": "^2.3.0",
-				"pretty-bytes": "^5.1.0",
-				"typescript": "^3.4.4"
-			},
-			"bin": {
-				"sizereport": "build/bin.js"
-			}
-		},
-		"node_modules/travis-size-report/node_modules/escape-string-regexp": {
-			"version": "2.0.0",
-			"resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-2.0.0.tgz",
-			"integrity": "sha512-UpzcLCXolUWcNu5HtVMHYdXJjArjsF9C0aNnquZYY4uW/Vu0miy5YoWvbV345HauVvcAUnpRuhMMcqTcGOY2+w==",
-			"dev": true,
-			"engines": {
-				"node": ">=8"
-			}
-		},
-		"node_modules/travis-size-report/node_modules/gzip-size": {
-			"version": "5.1.1",
-			"resolved": "https://registry.npmjs.org/gzip-size/-/gzip-size-5.1.1.tgz",
-			"integrity": "sha512-FNHi6mmoHvs1mxZAds4PpdCS6QG8B4C1krxJsMutgxl5t3+GlRTzzI3NEkifXx2pVsOvJdOGSmIgDhQ55FwdPA==",
-			"dev": true,
-			"dependencies": {
-				"duplexer": "^0.1.1",
-				"pify": "^4.0.1"
-			},
-			"engines": {
-				"node": ">=6"
-			}
-		},
-		"node_modules/travis-size-report/node_modules/pify": {
-			"version": "4.0.1",
-			"resolved": "https://registry.npmjs.org/pify/-/pify-4.0.1.tgz",
-			"integrity": "sha512-uB80kBFb/tfd68bVleG9T5GGsGPjJrLAUpR5PZIrhBnIaRTQRjqdJSsIKkOP6OAIFbj7GOrcudc5pNjZ+geV2g==",
-			"dev": true,
-			"engines": {
-				"node": ">=6"
-			}
-		},
-		"node_modules/travis-size-report/node_modules/typescript": {
-			"version": "3.9.7",
-			"resolved": "https://registry.npmjs.org/typescript/-/typescript-3.9.7.tgz",
-			"integrity": "sha512-BLbiRkiBzAwsjut4x/dsibSTB6yWpwT5qWmC2OfuCg3GgVQCSgMs4vEctYPhsaGtd0AeuuHMkjZ2h2WG8MSzRw==",
-			"dev": true,
-			"bin": {
-				"tsc": "bin/tsc",
-				"tsserver": "bin/tsserver"
-			},
-			"engines": {
-				"node": ">=4.2.0"
-			}
-		},
 		"node_modules/trim-newlines": {
 			"version": "3.0.0",
 			"resolved": "https://registry.npmjs.org/trim-newlines/-/trim-newlines-3.0.0.tgz",
@@ -31378,52 +31314,6 @@
 				"punycode": "^2.1.1"
 			}
 		},
-		"travis-size-report": {
-			"version": "1.1.0",
-			"resolved": "https://registry.npmjs.org/travis-size-report/-/travis-size-report-1.1.0.tgz",
-			"integrity": "sha512-mAMeCPZ1TvUEXDvweVCAG/ek6KgPeVsmQYXtv6I85UoIUIFAI/mCXnN7vyvTSCjIa8B0+cYn5slvqNn9Jo0U0g==",
-			"dev": true,
-			"requires": {
-				"chalk": "^2.4.2",
-				"escape-string-regexp": "^2.0.0",
-				"glob": "^7.1.3",
-				"gzip-size": "^5.1.0",
-				"minimist": "^1.2.0",
-				"node-fetch": "^2.3.0",
-				"pretty-bytes": "^5.1.0",
-				"typescript": "^3.4.4"
-			},
-			"dependencies": {
-				"escape-string-regexp": {
-					"version": "2.0.0",
-					"resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-2.0.0.tgz",
-					"integrity": "sha512-UpzcLCXolUWcNu5HtVMHYdXJjArjsF9C0aNnquZYY4uW/Vu0miy5YoWvbV345HauVvcAUnpRuhMMcqTcGOY2+w==",
-					"dev": true
-				},
-				"gzip-size": {
-					"version": "5.1.1",
-					"resolved": "https://registry.npmjs.org/gzip-size/-/gzip-size-5.1.1.tgz",
-					"integrity": "sha512-FNHi6mmoHvs1mxZAds4PpdCS6QG8B4C1krxJsMutgxl5t3+GlRTzzI3NEkifXx2pVsOvJdOGSmIgDhQ55FwdPA==",
-					"dev": true,
-					"requires": {
-						"duplexer": "^0.1.1",
-						"pify": "^4.0.1"
-					}
-				},
-				"pify": {
-					"version": "4.0.1",
-					"resolved": "https://registry.npmjs.org/pify/-/pify-4.0.1.tgz",
-					"integrity": "sha512-uB80kBFb/tfd68bVleG9T5GGsGPjJrLAUpR5PZIrhBnIaRTQRjqdJSsIKkOP6OAIFbj7GOrcudc5pNjZ+geV2g==",
-					"dev": true
-				},
-				"typescript": {
-					"version": "3.9.7",
-					"resolved": "https://registry.npmjs.org/typescript/-/typescript-3.9.7.tgz",
-					"integrity": "sha512-BLbiRkiBzAwsjut4x/dsibSTB6yWpwT5qWmC2OfuCg3GgVQCSgMs4vEctYPhsaGtd0AeuuHMkjZ2h2WG8MSzRw==",
-					"dev": true
-				}
-			}
-		},
 		"trim-newlines": {
 			"version": "3.0.0",
 			"resolved": "https://registry.npmjs.org/trim-newlines/-/trim-newlines-3.0.0.tgz",
diff --git a/package.json b/package.json
index e2af9177..7691d265 100644
--- a/package.json
+++ b/package.json
@@ -5,6 +5,19 @@
 	"main": "dist/microbundle.js",
 	"source": "src/index.js",
 	"bin": "dist/cli.js",
+	"repository": "developit/microbundle",
+  "keywords": [
+		"bundle",
+		"rollup",
+		"micro library"
+	],
+	"files": [
+		"src",
+		"dist",
+		"index.d.ts"
+	],
+	"author": "Jason Miller <jason@developit.ca> (http://jasonformat.com)",
+	"license": "MIT",
 	"scripts": {
 		"build": "npm run -s build:babel && npm run -s build:self",
 		"build:babel": "babel-node src/cli.js --target=node --format cjs src/{cli,index}.js",
@@ -18,7 +31,6 @@
 		"changeset": "changeset",
 		"release": "npm run -s prepare && npm test && changeset publish"
 	},
-	"repository": "developit/microbundle",
 	"prettier": {
 		"singleQuote": true,
 		"trailingComma": "all",
@@ -55,23 +67,6 @@
 			"pre-commit": "lint-staged"
 		}
 	},
-	"greenkeeper": {
-		"lockfiles": {
-			"outOfRangeUpdatesOnly": true
-		}
-	},
-	"keywords": [
-		"bundle",
-		"rollup",
-		"micro library"
-	],
-	"files": [
-		"src",
-		"dist",
-		"index.d.ts"
-	],
-	"author": "Jason Miller <jason@developit.ca> (http://jasonformat.com)",
-	"license": "MIT",
 	"dependencies": {
 		"@babel/core": "^7.12.10",
 		"@babel/plugin-proposal-class-properties": "7.12.1",
@@ -139,7 +134,6 @@
 		"regenerator-runtime": "^0.13.7",
 		"rimraf": "^3.0.2",
 		"shell-quote": "^1.7.2",
-		"strip-ansi": "^6.0.0",
-		"travis-size-report": "^1.1.0"
+		"strip-ansi": "^6.0.0"
 	}
 }
diff --git a/sizereport.config.js b/sizereport.config.js
deleted file mode 100644
index 4e188d38..00000000
--- a/sizereport.config.js
+++ /dev/null
@@ -1,5 +0,0 @@
-module.exports = {
-	repo: 'developit/microbundle',
-	path: ['dist/!(*.js.map)', 'test/fixtures/**/dist/!(*.map)'],
-	branch: 'master',
-};