From 9fea2301e820b7fe3ff194143e0ebe7315f67c73 Mon Sep 17 00:00:00 2001 From: Luke Edwards Date: Mon, 28 Oct 2019 22:54:22 -0700 Subject: [PATCH] chore: drop "mjs" source extensions --- .github/workflows/ci.yml | 4 ++-- .gitignore | 2 +- package.json | 6 +++--- packages/cluster/{index.mjs => index.js} | 0 packages/cluster/package.json | 7 +++---- packages/compat/package.json | 4 +++- packages/parse/{index.mjs => index.js} | 0 packages/parse/package.json | 7 +++---- packages/polka/{index.mjs => index.js} | 0 packages/polka/package.json | 7 +++---- packages/polka/test/index.js | 2 +- packages/redirect/{index.mjs => index.js} | 0 packages/redirect/package.json | 7 +++---- packages/redirect/test/index.js | 2 +- packages/send/{index.mjs => index.js} | 0 packages/send/package.json | 7 +++---- packages/send/test/index.js | 2 +- packages/sendfile/package.json | 4 +++- packages/url/bench/index.js | 2 +- packages/url/{index.mjs => index.js} | 0 packages/url/package.json | 7 +++---- packages/url/test/index.js | 2 +- packages/uws/package.json | 4 +++- 23 files changed, 38 insertions(+), 38 deletions(-) rename packages/cluster/{index.mjs => index.js} (100%) rename packages/parse/{index.mjs => index.js} (100%) rename packages/polka/{index.mjs => index.js} (100%) rename packages/redirect/{index.mjs => index.js} (100%) rename packages/send/{index.mjs => index.js} (100%) rename packages/url/{index.mjs => index.js} (100%) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 4436243..40cd62d 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -19,10 +19,10 @@ jobs: - name: Install run: | npm install - npm install -g nyc@13 codecov + npm install -g nyc codecov - name: Bootstrap, Lint, and Test - run: nyc --extension=.mjs npm test + run: nyc --include=packages/*/index.js npm test - name: Report if: matrix.nodejs == 12 diff --git a/.gitignore b/.gitignore index d68e895..f4d55fd 100644 --- a/.gitignore +++ b/.gitignore @@ -6,4 +6,4 @@ coverage *.lock *.log -packages/*/index.js +packages/*/build.* diff --git a/package.json b/package.json index 0b1bbe4..9a643c8 100644 --- a/package.json +++ b/package.json @@ -6,7 +6,7 @@ "url": "https://lukeed.com" }, "scripts": { - "build": "lerna exec bundt index.mjs", + "build": "lerna exec bundt index.js", "bootstrap": "lerna bootstrap --hoist", "lint": "eslint packages --env node,es6", "pretest": "npm run lint && npm run bootstrap", @@ -15,11 +15,11 @@ "devDependencies": { "bundt": "0.4.0", "eslint": "5.15.0", - "esm": "3.2.22", + "esm": "3.2.25", "httpie": "1.1.0", "lerna": "3.13.4", "tap-spec": "5.0.0", - "tape": "4.10.1" + "tape": "4.11.0" }, "eslintConfig": { "extends": "eslint:recommended", diff --git a/packages/cluster/index.mjs b/packages/cluster/index.js similarity index 100% rename from packages/cluster/index.mjs rename to packages/cluster/index.js diff --git a/packages/cluster/package.json b/packages/cluster/package.json index 34baac0..80654a9 100644 --- a/packages/cluster/package.json +++ b/packages/cluster/package.json @@ -3,12 +3,11 @@ "name": "@polka/cluster", "repository": "lukeed/polka", "description": "Intialize and run a HTTP cluster", - "module": "index.mjs", - "main": "index.js", + "module": "build.mjs", + "main": "build.js", "license": "MIT", "files": [ - "*.js", - "*.mjs" + "build.*" ], "author": { "name": "Luke Edwards", diff --git a/packages/compat/package.json b/packages/compat/package.json index b9d9b54..abe1af8 100644 --- a/packages/compat/package.json +++ b/packages/compat/package.json @@ -4,9 +4,11 @@ "name": "@polka/compat", "repository": "lukeed/polka", "description": "WIP", + "module": "build.mjs", + "main": "build.js", "license": "MIT", "files": [ - "*.js" + "build.*" ], "author": { "name": "Luke Edwards", diff --git a/packages/parse/index.mjs b/packages/parse/index.js similarity index 100% rename from packages/parse/index.mjs rename to packages/parse/index.js diff --git a/packages/parse/package.json b/packages/parse/package.json index 8609fd2..f519a78 100644 --- a/packages/parse/package.json +++ b/packages/parse/package.json @@ -3,12 +3,11 @@ "name": "@polka/parse", "repository": "lukeed/polka", "description": "WIP", - "module": "index.mjs", - "main": "index.js", + "module": "build.mjs", + "main": "build.js", "license": "MIT", "files": [ - "*.js", - "*.mjs" + "build.*" ], "author": { "name": "Luke Edwards", diff --git a/packages/polka/index.mjs b/packages/polka/index.js similarity index 100% rename from packages/polka/index.mjs rename to packages/polka/index.js diff --git a/packages/polka/package.json b/packages/polka/package.json index 0542578..f8cfb23 100644 --- a/packages/polka/package.json +++ b/packages/polka/package.json @@ -3,12 +3,11 @@ "version": "1.0.0-next.6", "repository": "lukeed/polka", "description": "A micro web server so fast, it'll make you dance! :dancers:", - "module": "index.mjs", - "main": "index.js", + "module": "build.mjs", + "main": "build.js", "license": "MIT", "files": [ - "*.js", - "*.mjs" + "build.*" ], "author": { "name": "Luke Edwards", diff --git a/packages/polka/test/index.js b/packages/polka/test/index.js index 856aba4..7f7dfe8 100644 --- a/packages/polka/test/index.js +++ b/packages/polka/test/index.js @@ -2,7 +2,7 @@ import http from 'http'; import { get, send, post } from 'httpie'; import { test, listen } from './util'; -import polka from '../index.mjs'; +import polka from '../index'; const hasNamedGroups = 'groups' in /x/.exec('x'); const sleep = ms => new Promise(r => setTimeout(r, ms)); diff --git a/packages/redirect/index.mjs b/packages/redirect/index.js similarity index 100% rename from packages/redirect/index.mjs rename to packages/redirect/index.js diff --git a/packages/redirect/package.json b/packages/redirect/package.json index 8f0b639..8fdc0b0 100644 --- a/packages/redirect/package.json +++ b/packages/redirect/package.json @@ -3,12 +3,11 @@ "name": "@polka/redirect", "repository": "lukeed/polka", "description": "A response helper for URL redirects", - "module": "index.mjs", - "main": "index.js", + "module": "build.mjs", + "main": "build.js", "license": "MIT", "files": [ - "*.js", - "*.mjs" + "build.*" ], "author": { "name": "Luke Edwards", diff --git a/packages/redirect/test/index.js b/packages/redirect/test/index.js index 071eca9..dcd9373 100644 --- a/packages/redirect/test/index.js +++ b/packages/redirect/test/index.js @@ -1,5 +1,5 @@ import test from 'tape'; -import fn from '../index.mjs'; +import fn from '../index'; test.Test.prototype.isRedirect = function (arr, code=302) { let [starting, next, result] = arr; diff --git a/packages/send/index.mjs b/packages/send/index.js similarity index 100% rename from packages/send/index.mjs rename to packages/send/index.js diff --git a/packages/send/package.json b/packages/send/package.json index a210afe..046f2a6 100644 --- a/packages/send/package.json +++ b/packages/send/package.json @@ -3,12 +3,11 @@ "name": "@polka/send", "repository": "lukeed/polka", "description": "A response helper that detects & handles Content-Types", - "module": "index.mjs", - "main": "index.js", + "module": "build.mjs", + "main": "build.js", "license": "MIT", "files": [ - "*.js", - "*.mjs" + "build.*" ], "author": { "name": "Luke Edwards", diff --git a/packages/send/test/index.js b/packages/send/test/index.js index 3adb3a0..b6107f0 100644 --- a/packages/send/test/index.js +++ b/packages/send/test/index.js @@ -2,7 +2,7 @@ import fs from 'fs'; import test from 'tape'; import { join } from 'path'; import { Response, toStatusText } from './util'; -import send from '../index.mjs'; +import send from '../index'; const TYPE = 'Content-Type'; const LENGTH = 'Content-Length'; diff --git a/packages/sendfile/package.json b/packages/sendfile/package.json index 455109e..d78af39 100644 --- a/packages/sendfile/package.json +++ b/packages/sendfile/package.json @@ -4,9 +4,11 @@ "name": "@polka/sendfile", "repository": "lukeed/polka", "description": "WIP", + "module": "build.mjs", + "main": "build.js", "license": "MIT", "files": [ - "*.js" + "build.*" ], "author": { "name": "Luke Edwards", diff --git a/packages/url/bench/index.js b/packages/url/bench/index.js index 8c92929..f90fe1d 100644 --- a/packages/url/bench/index.js +++ b/packages/url/bench/index.js @@ -3,7 +3,7 @@ global.native = require('url'); const { Suite } = require('benchmark'); global.querystring = require('querystring'); global.parseurl = require('parseurl'); -global.parse = require('../'); +global.parse = require('../build'); global.nativeDecode = function (url) { let obj = global.native.parse(url, true); diff --git a/packages/url/index.mjs b/packages/url/index.js similarity index 100% rename from packages/url/index.mjs rename to packages/url/index.js diff --git a/packages/url/package.json b/packages/url/package.json index f0c2955..9e8befd 100644 --- a/packages/url/package.json +++ b/packages/url/package.json @@ -3,12 +3,11 @@ "name": "@polka/url", "repository": "lukeed/polka", "description": "Super fast, memoized `req.url` parser", - "module": "index.mjs", - "main": "index.js", + "module": "build.mjs", + "main": "build.js", "license": "MIT", "files": [ - "*.js", - "*.mjs" + "build.*" ], "author": { "name": "Luke Edwards", diff --git a/packages/url/test/index.js b/packages/url/test/index.js index c21be19..dedc33b 100644 --- a/packages/url/test/index.js +++ b/packages/url/test/index.js @@ -1,6 +1,6 @@ import test from 'tape'; import { parse } from 'url'; -import fn from '../index.mjs'; +import fn from '../index'; const keys = ['protocol', 'slashes', 'auth', 'host', 'port', 'hostname', 'hash']; diff --git a/packages/uws/package.json b/packages/uws/package.json index d30d226..4b48c94 100644 --- a/packages/uws/package.json +++ b/packages/uws/package.json @@ -4,9 +4,11 @@ "name": "@polka/uws", "repository": "lukeed/polka", "description": "WIP", + "module": "build.mjs", + "main": "build.js", "license": "MIT", "files": [ - "*.js" + "build.*" ], "author": { "name": "Luke Edwards",