Skip to content

Commit 56b1817

Browse files
committed
Merge branch '1.0'
2 parents bd44965 + 0c0d374 commit 56b1817

File tree

7 files changed

+149
-520
lines changed

7 files changed

+149
-520
lines changed

Diff for: .github/workflows/ci.yml

+15-141
Original file line numberDiff line numberDiff line change
@@ -1,174 +1,48 @@
11
name: ci
22

33
on:
4-
- pull_request
5-
- push
4+
push:
5+
branches:
6+
- master
7+
- '1.0'
8+
paths-ignore:
9+
- '*.md'
10+
pull_request:
11+
paths-ignore:
12+
- '*.md'
613

714
jobs:
815
test:
916
runs-on: ubuntu-latest
1017
strategy:
1118
matrix:
1219
name:
13-
- Node.js 0.8
14-
- Node.js 0.10
15-
- Node.js 0.12
16-
- io.js 1.x
17-
- io.js 2.x
18-
- io.js 3.x
19-
- Node.js 4.x
20-
- Node.js 5.x
21-
- Node.js 6.x
22-
- Node.js 7.x
23-
- Node.js 8.x
24-
- Node.js 9.x
25-
- Node.js 10.x
26-
- Node.js 11.x
27-
- Node.js 12.x
28-
- Node.js 13.x
29-
- Node.js 14.x
30-
- Node.js 15.x
31-
- Node.js 16.x
32-
- Node.js 17.x
3320
- Node.js 18.x
34-
- Node.js 19.x
3521
- Node.js 20.x
36-
- Node.js 21.x
3722
- Node.js 22.x
38-
39-
include:
40-
- name: Node.js 0.8
41-
node-version: "0.8"
42-
43-
npm-rm: nyc
44-
45-
- name: Node.js 0.10
46-
node-version: "0.10"
47-
48-
49-
- name: Node.js 0.12
50-
node-version: "0.12"
51-
52-
53-
- name: io.js 1.x
54-
node-version: "1.8"
55-
56-
57-
- name: io.js 2.x
58-
node-version: "2.5"
59-
60-
61-
- name: io.js 3.x
62-
node-version: "3.3"
63-
64-
65-
- name: Node.js 4.x
66-
node-version: "4.9"
67-
68-
69-
- name: Node.js 5.x
70-
node-version: "5.12"
71-
72-
73-
- name: Node.js 6.x
74-
node-version: "6.17"
75-
76-
77-
- name: Node.js 7.x
78-
node-version: "7.10"
79-
80-
81-
- name: Node.js 8.x
82-
node-version: "8.16"
83-
84-
85-
- name: Node.js 9.x
86-
node-version: "9.11"
87-
88-
89-
- name: Node.js 10.x
90-
node-version: "10.24"
91-
92-
93-
- name: Node.js 11.x
94-
node-version: "11.15"
95-
96-
97-
- name: Node.js 12.x
98-
node-version: "12.22"
99-
100-
- name: Node.js 13.x
101-
node-version: "13.14"
102-
103-
- name: Node.js 14.x
104-
node-version: "14.19"
105-
106-
- name: Node.js 15.x
107-
node-version: "15.14"
108-
109-
- name: Node.js 16.x
110-
node-version: "16.14"
111-
112-
- name: Node.js 17.x
113-
node-version: "17.7"
11423

24+
include:
11525
- name: Node.js 18.x
116-
node-version: "18.14"
117-
118-
- name: Node.js 19.x
119-
node-version: "19.6"
26+
node-version: "18"
12027

12128
- name: Node.js 20.x
122-
node-version: "20.12"
29+
node-version: "20"
12330

124-
- name: Node.js 21.x
125-
node-version: "21.7"
126-
12731
- name: Node.js 22.x
128-
node-version: "22.0"
129-
32+
node-version: "22"
33+
13034
steps:
13135
- uses: actions/checkout@v4
13236

13337
- name: Install Node.js ${{ matrix.node-version }}
13438
shell: bash -eo pipefail -l {0}
13539
run: |
13640
nvm install --default ${{ matrix.node-version }}
137-
if [[ "${{ matrix.node-version }}" == 0.* && "$(cut -d. -f2 <<< "${{ matrix.node-version }}")" -lt 10 ]]; then
138-
nvm install --alias=npm 0.10
139-
nvm use ${{ matrix.node-version }}
140-
sed -i '1s;^.*$;'"$(printf '#!%q' "$(nvm which npm)")"';' "$(readlink -f "$(which npm)")"
141-
npm config set strict-ssl false
142-
fi
14341
dirname "$(nvm which ${{ matrix.node-version }})" >> "$GITHUB_PATH"
14442
14543
- name: Configure npm
14644
run: |
147-
if [[ "$(npm config get package-lock)" == "true" ]]; then
148-
npm config set package-lock false
149-
else
150-
npm config set shrinkwrap false
151-
fi
152-
153-
- name: Remove npm module(s) ${{ matrix.npm-rm }}
154-
run: npm rm --silent --save-dev ${{ matrix.npm-rm }}
155-
if: matrix.npm-rm != ''
156-
157-
- name: Install npm module(s) ${{ matrix.npm-i }}
158-
run: npm install --save-dev ${{ matrix.npm-i }}
159-
if: matrix.npm-i != ''
160-
161-
- name: Setup Node.js version-specific dependencies
162-
shell: bash
163-
run: |
164-
# eslint for linting
165-
# - remove on Node.js < 8
166-
if [[ "$(cut -d. -f1 <<< "${{ matrix.node-version }}")" -lt 10 ]]; then
167-
node -pe 'Object.keys(require("./package").devDependencies).join("\n")' | \
168-
grep -E '^eslint(-|$)' | \
169-
sort -r | \
170-
xargs -n1 npm rm --silent --save-dev
171-
fi
45+
npm config set package-lock false
17246
17347
- name: Install Node.js dependencies
17448
run: npm install

Diff for: HISTORY.md

+23
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,26 @@
1+
1.0.0-beta.2 / 2024-03-04
2+
=========================
3+
4+
* Changes from 0.18.0
5+
6+
1.0.0-beta.1 / 2022-02-04
7+
=========================
8+
9+
* Drop support for Node.js 0.8
10+
* Remove `hidden` option -- use `dotfiles` option
11+
* Remove `from` alias to `root` -- use `root` directly
12+
* Remove `send.etag()` -- use `etag` in `options`
13+
* Remove `send.index()` -- use `index` in `options`
14+
* Remove `send.maxage()` -- use `maxAge` in `options`
15+
* Remove `send.root()` -- use `root` in `options`
16+
* Use `mime-types` for file to content type mapping -- removed `send.mime`
17+
18+
- Add `DEBUG_HIDE_DATE` environment variable
19+
- Change timer to per-namespace instead of global
20+
- Change non-TTY date format
21+
- Remove `DEBUG_FD` environment variable support
22+
- Support 256 namespace colors
23+
124
0.18.0 / 2022-03-23
225
===================
326

Diff for: README.md

+10-17
Original file line numberDiff line numberDiff line change
@@ -133,15 +133,6 @@ The `SendStream` is an event emitter and will emit the following events:
133133
The `pipe` method is used to pipe the response into the Node.js HTTP response
134134
object, typically `send(req, path, options).pipe(res)`.
135135

136-
### .mime
137-
138-
The `mime` export is the global instance of the
139-
[`mime` npm module](https://www.npmjs.com/package/mime).
140-
141-
This is used to configure the MIME types that are associated with file extensions
142-
as well as other options for how to resolve the MIME type of a file (like the
143-
default type to use for an unknown file extension).
144-
145136
## Error-handling
146137

147138
By default when no `error` listeners are present an automatic response will be
@@ -210,20 +201,22 @@ server.listen(3000)
210201
### Custom file types
211202

212203
```js
204+
var extname = require('path').extname
213205
var http = require('http')
214206
var parseUrl = require('parseurl')
215207
var send = require('send')
216208

217-
// Default unknown types to text/plain
218-
send.mime.default_type = 'text/plain'
219-
220-
// Add a custom type
221-
send.mime.define({
222-
'application/x-my-type': ['x-mt', 'x-mtt']
223-
})
224-
225209
var server = http.createServer(function onRequest (req, res) {
226210
send(req, parseUrl(req).pathname, { root: '/www/public' })
211+
.on('headers', function (res, path) {
212+
switch (extname(path)) {
213+
case '.x-mt':
214+
case '.x-mtt':
215+
// custom type for these extensions
216+
res.setHeader('Content-Type', 'application/x-my-type')
217+
break
218+
}
219+
})
227220
.pipe(res)
228221
})
229222

0 commit comments

Comments
 (0)