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: drop Node.js < 16 support #82

Merged
merged 6 commits into from
Nov 25, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
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
30 changes: 0 additions & 30 deletions .autod.conf.js

This file was deleted.

76 changes: 0 additions & 76 deletions .github/workflows/codeql.yml

This file was deleted.

50 changes: 10 additions & 40 deletions .github/workflows/nodejs.yml
Original file line number Diff line number Diff line change
@@ -1,46 +1,16 @@
# 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: [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 && 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'
version: '16, 18, 20'
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 }}
File renamed without changes.
63 changes: 31 additions & 32 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,10 +1,8 @@
egg-init
=======
# egg-init

[![NPM version][npm-image]][npm-url]
[![Node.js CI](https://github.com/eggjs/egg-init/actions/workflows/nodejs.yml/badge.svg)](https://github.com/eggjs/egg-init/actions/workflows/nodejs.yml)
[![Test coverage][codecov-image]][codecov-url]
[![David deps][david-image]][david-url]
[![Known Vulnerabilities][snyk-image]][snyk-url]
[![npm download][download-image]][download-url]

Expand All @@ -22,14 +20,14 @@ Init egg app helper tools.
## Install

```bash
$ npm i egg-init -g
$ egg-init -h
npm i egg-init -g
egg-init -h
```

## Create a `simple` type application

```bash
$ egg-init --type simple [dest]
egg-init --type simple [dest]
```

## Or select a boilerplate by yourself
Expand All @@ -43,7 +41,7 @@ $ egg-init dest

## Command

```
```bash
Usage: egg-init [dir] --type=simple

Options:
Expand All @@ -67,29 +65,30 @@ We use npm package to manager boilerplate, you can follow this steps:
- Use `egg-init --template=PATH` to check
- `index.js` can define variables which can be useed on template, like `{{name}}`, but `\{{name}}` will ignore.

```js
module.exports = {
name: {
desc: 'package-name',
},
pluginName: {
desc: 'plugin-name',
default(vars) {
return vars.name;
},
filter(v) {
return 'egg-' + v;
},
},
description: {
desc: 'my best plugin',
},
author: {
desc: 'author',
default: 'eggjs team'
},
};
```
```js
module.exports = {
name: {
desc: 'package-name',
},
pluginName: {
desc: 'plugin-name',
default(vars) {
return vars.name;
},
filter(v) {
return 'egg-' + v;
},
},
description: {
desc: 'my best plugin',
},
author: {
desc: 'author',
default: 'eggjs team'
},
};
```

- Write unit test, see `npm scripts` at [egg-boilerplate-simple](https://github.com/eggjs/egg-boilerplate-simple/blob/master/package.json#L5)
- Add your package name to [egg-init-config](https://github.com/eggjs/egg-init-config)'s package.json `config.boilerplate` property
- Publish your package to npm
Expand All @@ -105,8 +104,8 @@ We use npm package to manager boilerplate, you can follow this steps:
|[<img src="https://avatars.githubusercontent.com/u/227713?v=4" width="100px;"/><br/><sub><b>atian25</b></sub>](https://github.com/atian25)<br/>|[<img src="https://avatars.githubusercontent.com/u/156269?v=4" width="100px;"/><br/><sub><b>fengmk2</b></sub>](https://github.com/fengmk2)<br/>|[<img src="https://avatars.githubusercontent.com/u/958063?v=4" width="100px;"/><br/><sub><b>thonatos</b></sub>](https://github.com/thonatos)<br/>|[<img src="https://avatars.githubusercontent.com/u/985607?v=4" width="100px;"/><br/><sub><b>dead-horse</b></sub>](https://github.com/dead-horse)<br/>|[<img src="https://avatars.githubusercontent.com/u/360661?v=4" width="100px;"/><br/><sub><b>popomore</b></sub>](https://github.com/popomore)<br/>|[<img src="https://avatars.githubusercontent.com/u/6897780?v=4" width="100px;"/><br/><sub><b>killagu</b></sub>](https://github.com/killagu)<br/>|
| :---: | :---: | :---: | :---: | :---: | :---: |
|[<img src="https://avatars.githubusercontent.com/u/5856440?v=4" width="100px;"/><br/><sub><b>whxaxes</b></sub>](https://github.com/whxaxes)<br/>|[<img src="https://avatars.githubusercontent.com/u/893152?v=4" width="100px;"/><br/><sub><b>jtyjty99999</b></sub>](https://github.com/jtyjty99999)<br/>|[<img src="https://avatars.githubusercontent.com/u/238841?v=4" width="100px;"/><br/><sub><b>edokeh</b></sub>](https://github.com/edokeh)<br/>|[<img src="https://avatars.githubusercontent.com/u/8369212?v=4" width="100px;"/><br/><sub><b>DanielWLam</b></sub>](https://github.com/DanielWLam)<br/>|[<img src="https://avatars.githubusercontent.com/u/36876080?v=4" width="100px;"/><br/><sub><b>Janlaywss</b></sub>](https://github.com/Janlaywss)<br/>|[<img src="https://avatars.githubusercontent.com/u/1078011?v=4" width="100px;"/><br/><sub><b>Runrioter</b></sub>](https://github.com/Runrioter)<br/>|
[<img src="https://avatars.githubusercontent.com/u/19733683?v=4" width="100px;"/><br/><sub><b>snyk-bot</b></sub>](https://github.com/snyk-bot)<br/>|[<img src="https://avatars.githubusercontent.com/u/13726797?v=4" width="100px;"/><br/><sub><b>WinjayYu</b></sub>](https://github.com/WinjayYu)<br/>|[<img src="https://avatars.githubusercontent.com/u/17093811?v=4" width="100px;"/><br/><sub><b>ShirasawaSama</b></sub>](https://github.com/ShirasawaSama)<br/>|[<img src="https://avatars.githubusercontent.com/u/26317926?v=4" width="100px;"/><br/><sub><b>supperchong</b></sub>](https://github.com/supperchong)<br/>
[<img src="https://avatars.githubusercontent.com/u/19733683?v=4" width="100px;"/><br/><sub><b>snyk-bot</b></sub>](https://github.com/snyk-bot)<br/>|[<img src="https://avatars.githubusercontent.com/u/13726797?v=4" width="100px;"/><br/><sub><b>WinjayYu</b></sub>](https://github.com/WinjayYu)<br/>|[<img src="https://avatars.githubusercontent.com/u/17093811?v=4" width="100px;"/><br/><sub><b>ShirasawaSama</b></sub>](https://github.com/ShirasawaSama)<br/>|[<img src="https://avatars.githubusercontent.com/u/26317926?v=4" width="100px;"/><br/><sub><b>supperchong</b></sub>](https://github.com/supperchong)<br/>|[<img src="https://avatars.githubusercontent.com/u/19908330?v=4" width="100px;"/><br/><sub><b>hyj1991</b></sub>](https://github.com/hyj1991)<br/>

This project follows the git-contributor [spec](https://github.com/xudafeng/git-contributor), auto updated at `Wed Nov 10 2021 08:41:48 GMT+0800`.
This project follows the git-contributor [spec](https://github.com/xudafeng/git-contributor), auto updated at `Sat Nov 25 2023 23:06:04 GMT+0800`.

<!-- GITCONTRIBUTOR_END -->
23 changes: 17 additions & 6 deletions README.zh-CN.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
egg-init
=======
# egg-init

[![NPM version][npm-image]][npm-url]
[![Node.js CI](https://github.com/eggjs/egg-init/actions/workflows/nodejs.yml/badge.svg)](https://github.com/eggjs/egg-init/actions/workflows/nodejs.yml)
Expand All @@ -21,14 +20,14 @@ Egg 应用初始化工具,所有 Egg 应用开发必须安装。
## Install

```bash
$ npm i egg-init -g
$ egg-init -h
npm i egg-init -g
egg-init -h
```

## 创建 `simple` 类型的应用

```bash
$ egg-init --type simple [dest]
egg-init --type simple [dest]
```

## 不输入类型可以选择
Expand All @@ -42,7 +41,7 @@ $ egg-init dest

## 支持的参数

```
```bash
Usage: egg-init [dir] --type=simple

Options:
Expand Down Expand Up @@ -86,3 +85,15 @@ module.exports = {
## License

[MIT](LICENSE)
<!-- GITCONTRIBUTOR_START -->

## Contributors

|[<img src="https://avatars.githubusercontent.com/u/227713?v=4" width="100px;"/><br/><sub><b>atian25</b></sub>](https://github.com/atian25)<br/>|[<img src="https://avatars.githubusercontent.com/u/156269?v=4" width="100px;"/><br/><sub><b>fengmk2</b></sub>](https://github.com/fengmk2)<br/>|[<img src="https://avatars.githubusercontent.com/u/958063?v=4" width="100px;"/><br/><sub><b>thonatos</b></sub>](https://github.com/thonatos)<br/>|[<img src="https://avatars.githubusercontent.com/u/985607?v=4" width="100px;"/><br/><sub><b>dead-horse</b></sub>](https://github.com/dead-horse)<br/>|[<img src="https://avatars.githubusercontent.com/u/360661?v=4" width="100px;"/><br/><sub><b>popomore</b></sub>](https://github.com/popomore)<br/>|[<img src="https://avatars.githubusercontent.com/u/6897780?v=4" width="100px;"/><br/><sub><b>killagu</b></sub>](https://github.com/killagu)<br/>|
| :---: | :---: | :---: | :---: | :---: | :---: |
|[<img src="https://avatars.githubusercontent.com/u/5856440?v=4" width="100px;"/><br/><sub><b>whxaxes</b></sub>](https://github.com/whxaxes)<br/>|[<img src="https://avatars.githubusercontent.com/u/893152?v=4" width="100px;"/><br/><sub><b>jtyjty99999</b></sub>](https://github.com/jtyjty99999)<br/>|[<img src="https://avatars.githubusercontent.com/u/238841?v=4" width="100px;"/><br/><sub><b>edokeh</b></sub>](https://github.com/edokeh)<br/>|[<img src="https://avatars.githubusercontent.com/u/8369212?v=4" width="100px;"/><br/><sub><b>DanielWLam</b></sub>](https://github.com/DanielWLam)<br/>|[<img src="https://avatars.githubusercontent.com/u/36876080?v=4" width="100px;"/><br/><sub><b>Janlaywss</b></sub>](https://github.com/Janlaywss)<br/>|[<img src="https://avatars.githubusercontent.com/u/1078011?v=4" width="100px;"/><br/><sub><b>Runrioter</b></sub>](https://github.com/Runrioter)<br/>|
[<img src="https://avatars.githubusercontent.com/u/19733683?v=4" width="100px;"/><br/><sub><b>snyk-bot</b></sub>](https://github.com/snyk-bot)<br/>|[<img src="https://avatars.githubusercontent.com/u/13726797?v=4" width="100px;"/><br/><sub><b>WinjayYu</b></sub>](https://github.com/WinjayYu)<br/>|[<img src="https://avatars.githubusercontent.com/u/17093811?v=4" width="100px;"/><br/><sub><b>ShirasawaSama</b></sub>](https://github.com/ShirasawaSama)<br/>|[<img src="https://avatars.githubusercontent.com/u/26317926?v=4" width="100px;"/><br/><sub><b>supperchong</b></sub>](https://github.com/supperchong)<br/>|[<img src="https://avatars.githubusercontent.com/u/19908330?v=4" width="100px;"/><br/><sub><b>hyj1991</b></sub>](https://github.com/hyj1991)<br/>

This project follows the git-contributor [spec](https://github.com/xudafeng/git-contributor), auto updated at `Sat Nov 25 2023 23:06:04 GMT+0800`.

<!-- GITCONTRIBUTOR_END -->
9 changes: 3 additions & 6 deletions bin/egg-init.js
Original file line number Diff line number Diff line change
@@ -1,13 +1,10 @@
#!/usr/bin/env node

'use strict';

const co = require('co');
const Command = require('..');

co(function* () {
yield new Command().run(process.cwd(), process.argv.slice(2));
}).catch(err => {
(async () => {
await new Command().run(process.cwd(), process.argv.slice(2));
})().catch(err => {
console.error(err.stack);
process.exit(1);
});
Loading