Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

v21 is for Kesaria #2084

Merged
merged 87 commits into from
Nov 20, 2024
Merged
Show file tree
Hide file tree
Changes from 84 commits
Commits
Show all changes
87 commits
Select commit Hold shift + click to select a range
42573ae
Changing trigger branches.
RobinTail Oct 8, 2024
b911917
Prohibit vulnerable versions of `express` (#2083)
RobinTail Oct 8, 2024
6c8571e
Merge branch 'master' into make-v21
RobinTail Oct 10, 2024
f200136
Cleaning up migration for v21 (#2087)
RobinTail Oct 10, 2024
fb5a786
21.0.0-beta.0
RobinTail Oct 10, 2024
2dd4567
Activating migration test.
RobinTail Oct 10, 2024
4c54b45
Dedicated to Kesaria Abramidze.
RobinTail Oct 10, 2024
fa2bccf
Making HTTP server optional (#2086)
RobinTail Oct 10, 2024
62be668
Merge branch 'master' into make-v21
RobinTail Oct 10, 2024
99fbd9d
Merge branch 'master' into make-v21
RobinTail Oct 15, 2024
024411f
Return generic array of servers (#2100)
RobinTail Oct 15, 2024
f0c9777
Merge branch 'master' into make-v21
RobinTail Oct 15, 2024
e8acf93
Merge branch 'master' into make-v21
RobinTail Oct 15, 2024
54afdb2
Merge branch 'master' into make-v21
RobinTail Oct 16, 2024
43cb643
Merge branch 'master' into make-v21
RobinTail Oct 16, 2024
5ca76bc
Rev: naming of server const in system test.
RobinTail Oct 16, 2024
83ad924
Merge branch 'master' into make-v21
RobinTail Oct 24, 2024
4066257
Merge branch 'master' into make-v21
RobinTail Oct 26, 2024
29ce100
Drop `serializer` prop (#2122)
RobinTail Oct 26, 2024
f280e76
Merge branch 'master' into make-v21
RobinTail Oct 26, 2024
5cd0c2a
Changelog: 21.0.0 draft.
RobinTail Oct 26, 2024
9bbb117
Changelog: migration advice.
RobinTail Oct 27, 2024
953d1cf
Merge branch 'master' into make-v21
RobinTail Nov 1, 2024
2466375
Merge branch 'master' into make-v21
RobinTail Nov 2, 2024
50165f9
Drop `originalError` property on validation errors (#2139)
RobinTail Nov 2, 2024
5f00dc3
Merge branch 'master' into make-v21
RobinTail Nov 4, 2024
9b67d1d
Drop `getStatusCodeFromError()` (#2148)
RobinTail Nov 4, 2024
2bc29f7
Changelog: note on getStatusCodeFromError
RobinTail Nov 4, 2024
02dc007
Merge branch 'master' into make-v21
RobinTail Nov 4, 2024
fcd43b7
rm todo.
RobinTail Nov 5, 2024
ee2b9ec
Merge branch 'master' into make-v21
RobinTail Nov 5, 2024
6c6cbc9
Merge branch 'master' into make-v21
RobinTail Nov 8, 2024
06a77f9
Merge branch 'master' into make-v21
RobinTail Nov 9, 2024
e2286fa
Merge branch 'master' into make-v21
RobinTail Nov 11, 2024
6e868fa
Making `method` and `methods` optional (#2128)
RobinTail Nov 12, 2024
2c492e7
Merge branch 'master' into make-v21
RobinTail Nov 12, 2024
635f478
Security: planning for december.
RobinTail Nov 12, 2024
0317deb
Deprecating v17 (#2162)
RobinTail Nov 12, 2024
0e0159c
21.0.0-beta.2
RobinTail Nov 12, 2024
cd422c6
Merge branch 'master' into make-v21
RobinTail Nov 13, 2024
bc3db93
Provide universal `getLogger()` to `beforeRouting` (#2167)
RobinTail Nov 14, 2024
a228dce
Merge branch 'master' into make-v21
RobinTail Nov 15, 2024
b8f0906
Merge branch 'master' into make-v21
RobinTail Nov 15, 2024
bc8e9eb
Traverse without recursion (#2168)
RobinTail Nov 15, 2024
9f1e0bf
Performance tuning for `onObject` zts producer (#2171)
RobinTail Nov 15, 2024
6d6e330
Revert "Performance tuning for `onObject` zts producer (#2171)"
RobinTail Nov 15, 2024
dfd9d72
Ref, rev: using Object.entries() in traverse instead of toPairs().
RobinTail Nov 15, 2024
b288b3a
Addressing performance findings (#2172)
RobinTail Nov 15, 2024
6ae145e
21.0.0-beta.3
RobinTail Nov 15, 2024
ea41234
Merge branch 'master' into make-v21
RobinTail Nov 15, 2024
0c3e94f
Merge branch 'master' into make-v21
RobinTail Nov 15, 2024
42f30d1
Changelog: giving a sample of new config and new returns.
RobinTail Nov 16, 2024
af5a7bf
Changelog: minor, arrangement.
RobinTail Nov 16, 2024
914f9d0
Changelog: more details on http prop in example.
RobinTail Nov 16, 2024
a65472f
Generalising server type (#2174)
RobinTail Nov 16, 2024
97b2f5a
Revert "Generalising server type (#2174)"
RobinTail Nov 16, 2024
8310daf
Ref: defining servers union type once.
RobinTail Nov 16, 2024
7cf239f
Merge branch 'master' into make-v21
RobinTail Nov 16, 2024
e1c58d5
rm redundant createConfig() in server unit test.
RobinTail Nov 16, 2024
02d1732
Removing redundant methods array in tests. (#2176)
RobinTail Nov 16, 2024
a08a31a
Merge branch 'master' into make-v21
RobinTail Nov 16, 2024
3f7bf45
Changelog: better structure for describing breaking changes of v21.
RobinTail Nov 17, 2024
8bbb336
Universal properties for arrays (#2175)
RobinTail Nov 17, 2024
9589b61
Merge branch 'master' into make-v21
RobinTail Nov 17, 2024
ce0df21
21.0.0-beta.4
RobinTail Nov 17, 2024
f33c4c8
Ref: extracting esQueries in migration.
RobinTail Nov 17, 2024
38bbbd0
Ease `DocumentationError` constructor (#2185)
RobinTail Nov 17, 2024
f5bc953
Merge branch 'master' into make-v21
RobinTail Nov 18, 2024
43eaf2a
Example: no more requirement on methods when using DependsOnMethod
RobinTail Nov 18, 2024
2ea1f65
Readme: shortening obvious statements. (#2187)
RobinTail Nov 18, 2024
c3cb2db
Merge branch 'master' into make-v21
RobinTail Nov 18, 2024
8efed65
Merge branch 'master' into make-v21
RobinTail Nov 18, 2024
01f3a78
rm redundant method in nesting test
RobinTail Nov 18, 2024
2ef3081
Merge branch 'master' into make-v21
RobinTail Nov 18, 2024
f0a5d81
Fixing the nested route traverse order — FIFO (#2192)
RobinTail Nov 18, 2024
035f0e5
Drop `Endpoint::getMimeTypes()` (#2193)
RobinTail Nov 19, 2024
48cced2
Organize response normalization (#2194)
RobinTail Nov 19, 2024
f9d0c9c
21.0.0-beta.5
RobinTail Nov 19, 2024
8607f99
Merge branch 'master' into make-v21
RobinTail Nov 19, 2024
2f4f1f8
Merge branch 'master' into make-v21
RobinTail Nov 20, 2024
0e8d2fe
Merge branch 'master' into make-v21
RobinTail Nov 20, 2024
92ef130
fix: restore statement in diagnostics.
RobinTail Nov 20, 2024
051d125
Ref: mv access methods into CORS enabled condition.
RobinTail Nov 20, 2024
45c9468
Minor: moving logger into Diagnostic constructor argument.
RobinTail Nov 20, 2024
7f9ce9d
21.0.0-beta.6
RobinTail Nov 20, 2024
07f4925
No more PRs.
RobinTail Nov 20, 2024
219c9f7
Security: releasing earlier.
RobinTail Nov 20, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .github/workflows/codeql-analysis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,10 @@ name: "CodeQL"

on:
push:
branches: [ master, v17, v18, v19 ]
branches: [ master, v18, v19, v20, make-v21 ]
RobinTail marked this conversation as resolved.
Show resolved Hide resolved
pull_request:
# The branches below must be a subset of the branches above
branches: [ master, v17, v18, v19 ]
branches: [ master, v18, v19, v20, make-v21 ]
schedule:
- cron: '26 8 * * 1'

Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/node.js.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@ name: Node.js CI

on:
push:
branches: [ master, v17, v18, v19 ]
branches: [ master, v18, v19, v20, make-v21 ]
pull_request:
branches: [ master, v17, v18, v19 ]
branches: [ master, v18, v19, v20, make-v21 ]

jobs:
build:
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/swagger.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@ name: OpenAPI Validation

on:
push:
branches: [ master, v17, v18, v19 ]
branches: [ master, v18, v19, v20, make-v21 ]
pull_request:
branches: [ master, v17, v18, v19 ]
branches: [ master, v18, v19, v20, make-v21 ]


jobs:
Expand Down
56 changes: 55 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,59 @@
# Changelog

## Version 21

### v21.0.0

- Minimum supported versions of `express`: 4.21.1 and 5.0.1 (fixed vulnerabilities);
- Breaking changes to `createConfig()` argument:
- The `server` property renamed to `http` and made optional — (can now configure HTTPS only);
- These properties moved to the top level: `jsonParser`, `upload`, `compression`, `rawParser` and `beforeRouting`;
- Both `logger` and `getChildLogger` arguments of `beforeRouting` function are replaced with all-purpose `getLogger`.
- Breaking changes to `createServer()` resolved return:
- Both `httpServer` and `httpsServer` are combined into single `servers` property (array, same order).
- Breaking changes to `EndpointsFactory::build()` argument:
- Plural `methods`, `tags` and `scopes` properties replaced with singular `method`, `tag`, `scope` accordingly;
- The `method` property also made optional and can now be derived from `DependsOnMethod` or imply `GET` by default;
- When `method` is assigned with an array, it must be non-empty.
- Breaking changes to `positive` and `negative` propeties of `ResultHandler` constructor argument:
- Plural `statusCodes` and `mimeTypes` props within the values are replaced with singular `statusCode` and `mimeType`.
- Other breaking changes:
- The `serializer` property of `Documentation` and `Integration` constructor argument removed;
- The `originalError` property of `InputValidationError` and `OutputValidationError` removed (use `cause` instead);
- The `getStatusCodeFromError()` method removed (use the `ensureHttpError().statusCode` instead);
- The `testEndpoint()` method can no longer test CORS headers — that function moved to `Routing` traverse;
- For `Endpoint`: `getMethods()` may return `undefined`, `getMimeTypes()` removed, `getSchema()` variants reduced;
- Public properties `pairs`, `firstEndpoint` and `siblingMethods` of `DependsOnMethod` replaced with `entries`.
- Consider the automated migration using the built-in ESLint rule.

```js
// eslint.config.mjs — minimal ESLint 9 config to apply migrations automatically using "eslint --fix"
import parser from "@typescript-eslint/parser";
import migration from "express-zod-api/migration";

export default [
{ languageOptions: { parser }, plugins: { migration } },
{ files: ["**/*.ts"], rules: { "migration/v21": "error" } },
];
```

```ts
// The sample of new structure
const config = createConfig({
http: { listen: 80 }, // became optional
https: { listen: 443, options: {} },
upload: true,
compression: true,
beforeRouting: ({ app, getLogger }) => {
const logger = getLogger();
app.use((req, res, next) => {
const childLogger = getLogger(req);
});
},
});
const { servers } = await createServer(config, {});
```

## Version 20

### v20.22.1
Expand Down Expand Up @@ -1179,7 +1233,7 @@ export const config = createConfig({

- **Breaking changes**:
- `DependsOnMethod::endpoints` removed;
- Refinment methods of `ez.file()` removed;
- Refinement methods of `ez.file()` removed;
- Minimum version of `vitest` supported is 1.0.4.
- How to migrate confidently:
- If you're using refinement methods of `ez.file()`:
Expand Down
Loading