Skip to content

Commit f93c1b4

Browse files
committed
Merge branch 'esm'
2 parents 75db0bb + 9ad64d8 commit f93c1b4

8 files changed

Lines changed: 2803 additions & 1376 deletions

File tree

CHANGELOG.md

Lines changed: 27 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -4,23 +4,35 @@ All notable changes to this project will be documented in this file.
44

55
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
66

7+
## [3.0.0] - 2021-03-09
8+
9+
__Breaking change:__ ESM version. Includes Auto Encrypt 3.0.0 and Auto Encrypt Localhost 7.0.2.
10+
11+
## Changed
12+
13+
- Uses ECMAScript Modules (ESM; es6 modules).
14+
- Upgraded Auto Encrypt to version 3.0.0 (ESM + includes the latest Let’s Encrypt staging certificate authority root certificate for testing).
15+
- Upgraded Auto Encrypt Localhost to version 7.0.2 (the mkcert binaries are no longer bundled).
16+
- Testing and coverage: migrate from using nyc, tap-spec, and tap-nyc to c8 and tap-monkey.
17+
- Reduce npm package size by specifying files whitelist.
18+
719
## [2.1.1] - 2021-02-16
820

921
## Changed
1022

11-
- Upgrade auto-encrypt to version 2.0.6. Fixes assignment to constant that would result in a crash when a Retry-After header was received from Let’s Encrypt.
23+
- Upgrade Auto Encrypt to version 2.0.6. Fixes assignment to constant that would result in a crash when a Retry-After header was received from Let’s Encrypt.
1224

1325
## [2.1.0] - 2020-11-04
1426

1527
### Changed
1628

17-
- Upgrade auto-encrypt-localhost to version 6.1.0. (This upgrades mkcert to 1.4.2 and includes the new separate mkcert arm64 binary.)
29+
- Upgrade Auto Encrypt Localhost to version 6.1.0. (This upgrades mkcert to 1.4.2 and includes the new separate mkcert arm64 binary.)
1830

1931
## [2.0.0] - 2020-11-03
2032

2133
### Changed
2234

23-
- __Breaking change:__ Update to auto-encrypt-localhost version 6.0.0.
35+
- __Breaking change:__ Update to Auto Encrypt Localhost version 6.0.0.
2436

2537
Running multiple local servers at different HTTPS ports no longer results in an error due to port 80 being unavailable for the HTTP Server. However, know that only the first server will get the HTTP Server at port 80 that redirects HTTP calls to HTTPS and also serves your local root certificate authority public key.
2638

@@ -34,55 +46,55 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
3446

3547
### Added
3648

37-
- Update auto-encrypt-localhost to 5.4.0 to add arm64 support on Linux.
49+
- Update Auto Encrypt Localhost to 5.4.0 to add arm64 support on Linux.
3850

3951
## [1.5.1] - 2020-07-10
4052

4153
### Fixed
4254

43-
- Update auto-encrypt to 2.0.4 to fix HTTP → HTTPS redirects on global servers. They now work (the HTTP server was not being started previously due to a typo in the monkey-patched method name).
55+
- Update Auto Encrypt to 2.0.4 to fix HTTP → HTTPS redirects on global servers. They now work (the HTTP server was not being started previously due to a typo in the monkey-patched method name).
4456

4557
## [1.5.0] - 2020-07-07
4658

4759
### Changed
4860

49-
- Update auto-encrypt-localhost to version 5.3.0 (now serves the local root certificate authority’s public key at route /.ca).
61+
- Update Auto Encrypt Localhost to version 5.3.0 (now serves the local root certificate authority’s public key at route /.ca).
5062

5163
## [1.4.0] - 2020-07-06
5264

5365
### Changed
5466

55-
- Update auto-encrypt-localhost to version 5.2.2 (you can now access local servers from any device on your local network via its IPv4 address).
67+
- Update Auto Encrypt Localhost to version 5.2.2 (you can now access local servers from any device on your local network via its IPv4 address).
5668

5769
## [1.3.1] - 2020-07-03
5870

5971
### Changed
6072

61-
- Update to auto-encrypt version 2.0.1 (HTTP to HTTPS forwarding is now logged).
73+
- Update to Auto Encrypt version 2.0.1 (HTTP to HTTPS forwarding is now logged).
6274

6375
## [1.3.0] - 2020-07-03
6476

6577
### Changed
6678

67-
- Update to auto-encrypt version 2.0.0 with automatic HTTP to HTTPS forwarding for servers at hostname.
79+
- Update to Auto Encrypt version 2.0.0 with automatic HTTP to HTTPS forwarding for servers at hostname.
6880

6981
## [1.2.5] - 2020-06-20
7082

7183
### Changed
7284

73-
- Update to auto-encrypt version 1.0.3 with fix for carriage returns in CSRs causing some certificate provisioning attempts to fail.
85+
- Update to Auto Encrypt version 1.0.3 with fix for carriage returns in CSRs causing some certificate provisioning attempts to fail.
7486

7587
## [1.2.4] - 2020-06-16
7688

7789
### Changed
7890

79-
- Updated auto-encrypt to version 1.0.2 and auto-encrypt localhost to version 5.1.2 (fixes and cosmetic improvements).
91+
- Updated Auto Encrypt to version 1.0.2 and Auto Encrypt localhost to version 5.1.2 (fixes and cosmetic improvements).
8092

8193
## [1.2.3] - 2020-06-16
8294

8395
### Changed
8496

85-
- Updated auto-encrypt to version 1.0.1 and auto-encrypt localhost to version 5.1.1.
97+
- Updated Auto Encrypt to version 1.0.1 and Auto Encrypt localhost to version 5.1.1.
8698
- Log output now conforms to format used by Site.js.
8799

88100
## [1.2.2] - 2020-04-16
@@ -101,7 +113,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
101113

102114
### Changed
103115

104-
- Let’s Encrypt certificates are now managed by [Auto Encrypt](https://source.ind.ie/site.js/lib/auto-encrypt).
116+
- Let’s Encrypt certificates are now managed by [Auto Encrypt](https://source.ind.ie/site.js/lib/Auto Encrypt).
105117
- Entire library is now licensed under AGPL version 3.0 or later.
106118

107119
## [1.1.0] - 2020-02-15
@@ -132,13 +144,13 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
132144

133145
### Fixed
134146

135-
- Update to latest nodecert (version 3.1.4) which fixes regression so Node.js once again recognises local certificates as valid.
147+
- Update to latest Nodecert (version 3.1.4) which fixes regression so Node.js once again recognises local certificates as valid.
136148

137149
## [1.0.5] - 2019-11-26
138150

139151
### Fixed
140152

141-
- Update to latest nodecert (version 3.1.3) which fixes crash when multiple directories are missing in the requested nodecert configuration directory.
153+
- Update to latest Nodecert (version 3.1.3) which fixes crash when multiple directories are missing in the requested Nodecert configuration directory.
142154

143155
## [1.0.4] - 2019-11-26
144156

README.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,8 @@ That’s it.
1212

1313
This is basically a batteries-included version of the standard Node.js `https` module.
1414

15+
___Note:__ This is a standard ECMAScript Modules (ESM; es6 modules) project. If you need to use legacy CommonJS, [please see the 2.x branch](https://github.com/small-tech/https/tree/2.x) which is currently still being maintained._
16+
1517
## Like this? Fund us!
1618

1719
[Small Technology Foundation](https://small-tech.org) is a tiny, independent not-for-profit.

example/index.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
const https = require('..')
1+
import https from '../index.js'
22

33
// Helpers
44
function html(message) {

index.js

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
1-
const fs = require('fs-extra')
2-
const os = require('os')
3-
const path = require('path')
4-
const https = require('https')
5-
const log = require('./lib/util/log')
6-
const AutoEncrypt = require('@small-tech/auto-encrypt')
7-
const AutoEncryptLocalhost = require('@small-tech/auto-encrypt-localhost')
1+
import os from 'os'
2+
import fs from 'fs-extra'
3+
import path from 'path'
4+
import https from 'https'
5+
import AutoEncrypt from '@small-tech/auto-encrypt'
6+
import AutoEncryptLocalhost from '@small-tech/auto-encrypt-localhost'
7+
import log from './lib/util/log.js'
88

99
const AUTO_ENCRYPT_STAGING_SERVER_TYPE = 1
1010

@@ -61,4 +61,4 @@ smallTechHttps.createServer = function (options, listener) {
6161
return server
6262
}
6363

64-
module.exports = smallTechHttps
64+
export default smallTechHttps

lib/util/log.js

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,6 @@
1-
function log(...args) {
1+
export default function log(...args) {
22
if (process.env.QUIET) {
33
return
44
}
55
console.log(...args)
66
}
7-
8-
module.exports = log

0 commit comments

Comments
 (0)