-
Notifications
You must be signed in to change notification settings - Fork 36
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: support cjs and esm both by tshy
BREAKING CHANGE: drop Node.js < 18.19.0 support part of eggjs/egg#3644 eggjs/egg#5257
- Loading branch information
Showing
22 changed files
with
503 additions
and
376 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,3 @@ | ||
test/fixtures | ||
node_modules | ||
coverage | ||
__snapshots__ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,6 @@ | ||
{ | ||
"extends": "eslint-config-egg" | ||
"extends": [ | ||
"eslint-config-egg/typescript", | ||
"eslint-config-egg/lib/rules/enforce-node-prefix" | ||
] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
import type { EggCore, ILifecycleBoot } from '@eggjs/core'; | ||
import { normalizeOptions } from './lib/utils.js'; | ||
|
||
export default class AppBootHook implements ILifecycleBoot { | ||
constructor(private app: EggCore) {} | ||
|
||
configWillLoad() { | ||
this.app.config.multipart = normalizeOptions(this.app.config.multipart); | ||
const options = this.app.config.multipart; | ||
|
||
this.app.coreLogger.info('[@eggjs/multipart] %s mode enable', options.mode); | ||
if (options.mode === 'file' || options.fileModeMatch) { | ||
this.app.coreLogger.info('[@eggjs/multipart] will save temporary files to %j, cleanup job cron: %j', | ||
options.tmpdir, options.cleanSchedule.cron); | ||
// enable multipart middleware | ||
this.app.config.coreMiddleware.push('multipart'); | ||
} | ||
} | ||
} | ||
|
Oops, something went wrong.