Skip to content

Commit 50ec41c

Browse files
committed
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
1 parent 0f4e16a commit 50ec41c

32 files changed

+493
-485
lines changed

.autod.conf.js

-23
This file was deleted.

.eslintignore

+2
Original file line numberDiff line numberDiff line change
@@ -1 +1,3 @@
1+
test/fixtures
12
coverage
3+
__snapshots__

.eslintrc

+6
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
{
2+
"extends": [
3+
"eslint-config-egg/typescript",
4+
"eslint-config-egg/lib/rules/enforce-node-prefix"
5+
]
6+
}

.eslintrc.js

-8
This file was deleted.

.github/PULL_REQUEST_TEMPLATE.md

-24
This file was deleted.

.github/workflows/nodejs.yml

+11-40
Original file line numberDiff line numberDiff line change
@@ -1,46 +1,17 @@
1-
# This workflow will do a clean install of node dependencies, build the source code and run tests across different versions of node
2-
# For more information see: https://help.github.com/actions/language-and-framework-guides/using-nodejs-with-github-actions
3-
4-
name: Node.js CI
1+
name: CI
52

63
on:
74
push:
8-
branches:
9-
- main
10-
- master
5+
branches: [ master ]
116
pull_request:
12-
branches:
13-
- main
14-
- master
15-
schedule:
16-
- cron: '0 2 * * *'
7+
branches: [ master ]
178

189
jobs:
19-
build:
20-
runs-on: ${{ matrix.os }}
21-
22-
strategy:
23-
fail-fast: false
24-
matrix:
25-
node-version: [8, 10, 12, 14, 16]
26-
os: [ubuntu-latest, windows-latest, macos-latest]
27-
28-
steps:
29-
- name: Checkout Git Source
30-
uses: actions/checkout@v2
31-
32-
- name: Use Node.js ${{ matrix.node-version }}
33-
uses: actions/setup-node@v1
34-
with:
35-
node-version: ${{ matrix.node-version }}
36-
37-
- name: Install Dependencies
38-
run: npm i -g npminstall@5 && npminstall
39-
40-
- name: Continuous Integration
41-
run: npm run ci
42-
43-
- name: Code Coverage
44-
uses: codecov/codecov-action@v1
45-
with:
46-
token: ${{ secrets.CODECOV_TOKEN }}
10+
Job:
11+
name: Node.js
12+
uses: node-modules/github-actions/.github/workflows/node-test.yml@master
13+
with:
14+
os: 'ubuntu-latest, windows-latest, macos-latest'
15+
version: '18, 20, 22'
16+
secrets:
17+
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}

.github/workflows/release.yml

+12
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
name: Release
2+
on:
3+
push:
4+
branches: [ master ]
5+
6+
jobs:
7+
release:
8+
name: Node.js
9+
uses: eggjs/github-actions/.github/workflows/node-release.yml@master
10+
secrets:
11+
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
12+
GIT_TOKEN: ${{ secrets.GIT_TOKEN }}

.gitignore

+3
Original file line numberDiff line numberDiff line change
@@ -11,3 +11,6 @@ test/fixtures/apps/ts/**/*.js
1111
*-lock.yaml
1212
test/fixtures/ts/**/*.js
1313
test/fixtures/ts/**/*.d.ts
14+
.tshy*
15+
.eslintcache
16+
dist

History.md CHANGELOG.md

File renamed without changes.

README.md

+19-13
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,13 @@
1-
# egg-view
2-
3-
[![NPM version](https://img.shields.io/npm/v/egg-view.svg?style=flat-square)](https://npmjs.org/package/egg-view)
4-
[![NPM quality](http://npm.packagequality.com/shield/egg-view.svg?style=flat-square)](http://packagequality.com/#?package=egg-view)
5-
[![NPM download](https://img.shields.io/npm/dm/egg-view.svg?style=flat-square)](https://npmjs.org/package/egg-view)
6-
7-
[![Continuous Integration](https://github.com/egg/egg-view/actions/workflows/nodejs.yml/badge.svg)](https://github.com/egg/egg-view/actions/workflows/nodejs.yml)
8-
[![Test coverage](https://img.shields.io/codecov/c/github/egg/egg-view.svg?style=flat-square)](https://codecov.io/gh/egg/egg-view)
1+
# @eggjs/view
92

3+
[![NPM version](https://img.shields.io/npm/v/@eggjs/view.svg?style=flat-square)](https://npmjs.org/package/@eggjs/view)
4+
[![NPM quality](http://npm.packagequality.com/shield/@eggjs/view.svg?style=flat-square)](http://packagequality.com/#?package=@eggjs/view)
5+
[![NPM download](https://img.shields.io/npm/dm/@eggjs/view.svg?style=flat-square)](https://npmjs.org/package/@eggjs/view)
6+
[![Continuous Integration](https://github.com/eggjs/view/actions/workflows/nodejs.yml/badge.svg)](https://github.com/eggjs/view/actions/workflows/nodejs.yml)
7+
[![Test coverage](https://img.shields.io/codecov/c/github/eggjs/view.svg?style=flat-square)](https://codecov.io/gh/eggjs/view)
8+
[![Node.js Version](https://img.shields.io/node/v/@eggjs/view.svg?style=flat)](https://nodejs.org/en/download/)
9+
[![PRs Welcome](https://img.shields.io/badge/PRs-welcome-brightgreen.svg?style=flat-square)](https://makeapullrequest.com)
10+
![CodeRabbit Pull Request Reviews](https://img.shields.io/coderabbit/prs/github/eggjs/view)
1011

1112
Base view plugin for egg
1213

@@ -15,7 +16,7 @@ Base view plugin for egg
1516
## Install
1617

1718
```bash
18-
$ npm i egg-view --save
19+
npm i @eggjs/view
1920
```
2021

2122
## Usage
@@ -24,7 +25,7 @@ $ npm i egg-view --save
2425
// {app_root}/config/plugin.js
2526
exports.view = {
2627
enable: true,
27-
package: 'egg-view',
28+
package: '@eggjs/view',
2829
};
2930
```
3031

@@ -258,20 +259,25 @@ exports.view = {
258259
};
259260
```
260261

261-
see [config/config.default.js](https://github.com/eggjs/egg-view/blob/master/config/config.default.js) for more detail.
262+
see [config/config.default.ts](https://github.com/eggjs/view/blob/master/src/config/config.default.ts) for more detail.
262263

263264
## Questions & Suggestions
264265

265266
Please open an issue [here](https://github.com/eggjs/egg/issues).
266267

267268
## License
268269

269-
[MIT](https://github.com/eggjs/egg-view/blob/master/LICENSE)
270+
[MIT](LICENSE)
271+
272+
## Contributors
273+
274+
[![Contributors](https://contrib.rocks/image?repo=eggjs/logrotator)](https://github.com/eggjs/logrotator/graphs/contributors)
270275

276+
Made with [contributors-img](https://contrib.rocks).
271277

272278
[eggjs]: https://eggjs.org
273279
[ejs]: https://github.com/mde/ejs
274280
[egg-view-ejs]: https://github.com/eggjs/egg-view-ejs
275-
[egg-view]: https://github.com/eggjs/egg-view
281+
[egg-view]: https://github.com/eggjs/view
276282
[nunjucks]: http://mozilla.github.io/nunjucks
277283
[egg-view-nunjucks]: https://github.com/eggjs/egg-view-nunjucks

app/extend/application.js

-17
This file was deleted.

app/extend/context.js

-49
This file was deleted.

config/config.default.js

-22
This file was deleted.

config/config.local.js

-7
This file was deleted.

index.d.ts

-80
This file was deleted.

0 commit comments

Comments
 (0)