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

feat: support cjs and esm both by tshy #19

Merged
merged 2 commits into from
Feb 3, 2025
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
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
23 changes: 0 additions & 23 deletions .autod.conf.js

This file was deleted.

2 changes: 2 additions & 0 deletions .eslintignore
Original file line number Diff line number Diff line change
@@ -1 +1,3 @@
test/fixtures
coverage
__snapshots__
6 changes: 6 additions & 0 deletions .eslintrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"extends": [
"eslint-config-egg/typescript",
"eslint-config-egg/lib/rules/enforce-node-prefix"
]
}
8 changes: 0 additions & 8 deletions .eslintrc.js

This file was deleted.

24 changes: 0 additions & 24 deletions .github/PULL_REQUEST_TEMPLATE.md

This file was deleted.

51 changes: 11 additions & 40 deletions .github/workflows/nodejs.yml
Original file line number Diff line number Diff line change
@@ -1,46 +1,17 @@
# This workflow will do a clean install of node dependencies, build the source code and run tests across different versions of node
# For more information see: https://help.github.com/actions/language-and-framework-guides/using-nodejs-with-github-actions

name: Node.js CI
name: CI

on:
push:
branches:
- main
- master
branches: [ master ]
pull_request:
branches:
- main
- master
schedule:
- cron: '0 2 * * *'
branches: [ master ]

jobs:
build:
runs-on: ${{ matrix.os }}

strategy:
fail-fast: false
matrix:
node-version: [8, 10, 12, 14, 16]
os: [ubuntu-latest, windows-latest, macos-latest]

steps:
- name: Checkout Git Source
uses: actions/checkout@v2

- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v1
with:
node-version: ${{ matrix.node-version }}

- name: Install Dependencies
run: npm i -g npminstall@5 && npminstall

- name: Continuous Integration
run: npm run ci

- name: Code Coverage
uses: codecov/codecov-action@v1
with:
token: ${{ secrets.CODECOV_TOKEN }}
Job:
name: Node.js
uses: node-modules/github-actions/.github/workflows/node-test.yml@master
with:
os: 'ubuntu-latest, windows-latest, macos-latest'
version: '18, 20, 22'
secrets:
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
12 changes: 12 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
name: Release
on:
push:
branches: [ master ]

jobs:
release:
name: Node.js
uses: eggjs/github-actions/.github/workflows/node-release.yml@master
secrets:
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
GIT_TOKEN: ${{ secrets.GIT_TOKEN }}
fengmk2 marked this conversation as resolved.
Show resolved Hide resolved
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -11,3 +11,6 @@ test/fixtures/apps/ts/**/*.js
*-lock.yaml
test/fixtures/ts/**/*.js
test/fixtures/ts/**/*.d.ts
.tshy*
.eslintcache
dist
File renamed without changes.
32 changes: 19 additions & 13 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,12 +1,13 @@
# egg-view

[![NPM version](https://img.shields.io/npm/v/egg-view.svg?style=flat-square)](https://npmjs.org/package/egg-view)
[![NPM quality](http://npm.packagequality.com/shield/egg-view.svg?style=flat-square)](http://packagequality.com/#?package=egg-view)
[![NPM download](https://img.shields.io/npm/dm/egg-view.svg?style=flat-square)](https://npmjs.org/package/egg-view)

[![Continuous Integration](https://github.com/egg/egg-view/actions/workflows/nodejs.yml/badge.svg)](https://github.com/egg/egg-view/actions/workflows/nodejs.yml)
[![Test coverage](https://img.shields.io/codecov/c/github/egg/egg-view.svg?style=flat-square)](https://codecov.io/gh/egg/egg-view)
# @eggjs/view

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

Base view plugin for egg

Expand All @@ -15,7 +16,7 @@ Base view plugin for egg
## Install

```bash
$ npm i egg-view --save
npm i @eggjs/view
```

## Usage
Expand All @@ -24,7 +25,7 @@ $ npm i egg-view --save
// {app_root}/config/plugin.js
exports.view = {
enable: true,
package: 'egg-view',
package: '@eggjs/view',
};
```

Expand Down Expand Up @@ -258,20 +259,25 @@ exports.view = {
};
```

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

## Questions & Suggestions

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

## License

[MIT](https://github.com/eggjs/egg-view/blob/master/LICENSE)
[MIT](LICENSE)

## Contributors

[![Contributors](https://contrib.rocks/image?repo=eggjs/logrotator)](https://github.com/eggjs/logrotator/graphs/contributors)

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

[eggjs]: https://eggjs.org
[ejs]: https://github.com/mde/ejs
[egg-view-ejs]: https://github.com/eggjs/egg-view-ejs
[egg-view]: https://github.com/eggjs/egg-view
[egg-view]: https://github.com/eggjs/view
[nunjucks]: http://mozilla.github.io/nunjucks
[egg-view-nunjucks]: https://github.com/eggjs/egg-view-nunjucks
17 changes: 0 additions & 17 deletions app/extend/application.js

This file was deleted.

49 changes: 0 additions & 49 deletions app/extend/context.js

This file was deleted.

22 changes: 0 additions & 22 deletions config/config.default.js

This file was deleted.

7 changes: 0 additions & 7 deletions config/config.local.js

This file was deleted.

80 changes: 0 additions & 80 deletions index.d.ts

This file was deleted.

Loading