From 511dd6de4db00192bccce841d70b73832d910dcc Mon Sep 17 00:00:00 2001 From: fengmk2 Date: Sun, 29 Dec 2024 15:59:19 +0800 Subject: [PATCH 1/6] feat: hello world for egg v4 part of https://github.com/eggjs/egg/issues/3644 --- helloworld/.eslintrc | 6 +++++ helloworld/.gitignore | 2 ++ helloworld/app/controller/foo.js | 13 ----------- helloworld/app/controller/foo.ts | 11 ++++++++++ helloworld/app/controller/home.js | 13 ----------- helloworld/app/controller/home.ts | 8 +++++++ helloworld/app/{router.js => router.ts} | 4 ++-- helloworld/config/config.default.js | 3 --- helloworld/config/config.default.ts | 3 +++ helloworld/package.json | 23 +++++++++++++++----- helloworld/test/index.test.js | 29 ------------------------- helloworld/test/index.test.ts | 19 ++++++++++++++++ helloworld/tsconfig.json | 14 ++++++++++++ 13 files changed, 83 insertions(+), 65 deletions(-) create mode 100644 helloworld/.eslintrc create mode 100644 helloworld/.gitignore delete mode 100644 helloworld/app/controller/foo.js create mode 100644 helloworld/app/controller/foo.ts delete mode 100644 helloworld/app/controller/home.js create mode 100644 helloworld/app/controller/home.ts rename helloworld/app/{router.js => router.ts} (59%) delete mode 100644 helloworld/config/config.default.js create mode 100644 helloworld/config/config.default.ts delete mode 100644 helloworld/test/index.test.js create mode 100644 helloworld/test/index.test.ts create mode 100644 helloworld/tsconfig.json diff --git a/helloworld/.eslintrc b/helloworld/.eslintrc new file mode 100644 index 00000000..9bcdb468 --- /dev/null +++ b/helloworld/.eslintrc @@ -0,0 +1,6 @@ +{ + "extends": [ + "eslint-config-egg/typescript", + "eslint-config-egg/lib/rules/enforce-node-prefix" + ] +} diff --git a/helloworld/.gitignore b/helloworld/.gitignore new file mode 100644 index 00000000..23a608b6 --- /dev/null +++ b/helloworld/.gitignore @@ -0,0 +1,2 @@ +node_modules +*.js diff --git a/helloworld/app/controller/foo.js b/helloworld/app/controller/foo.js deleted file mode 100644 index 7ed1cb07..00000000 --- a/helloworld/app/controller/foo.js +++ /dev/null @@ -1,13 +0,0 @@ -'use strict'; - -const Controller = require('egg').Controller; - -class FooController extends Controller { - async render() { - const ctx = this.ctx; - - ctx.body = 'Hello foo'; - } -} - -module.exports = FooController; diff --git a/helloworld/app/controller/foo.ts b/helloworld/app/controller/foo.ts new file mode 100644 index 00000000..7ab1f970 --- /dev/null +++ b/helloworld/app/controller/foo.ts @@ -0,0 +1,11 @@ +import { Controller } from 'egg'; + +export default class FooController extends Controller { + async render() { + const ctx = this.ctx; + ctx.status = 400; + ctx.body = { + foo: 'bar', + }; + } +} diff --git a/helloworld/app/controller/home.js b/helloworld/app/controller/home.js deleted file mode 100644 index 45a39944..00000000 --- a/helloworld/app/controller/home.js +++ /dev/null @@ -1,13 +0,0 @@ -'use strict'; - -const Controller = require('egg').Controller; - -class HomeController extends Controller { - async render() { - const ctx = this.ctx; - - ctx.body = 'Hello World'; - } -} - -module.exports = HomeController; diff --git a/helloworld/app/controller/home.ts b/helloworld/app/controller/home.ts new file mode 100644 index 00000000..08a78dad --- /dev/null +++ b/helloworld/app/controller/home.ts @@ -0,0 +1,8 @@ +import { Controller } from 'egg'; + +export default class HomeController extends Controller { + async render() { + const ctx = this.ctx; + ctx.body = 'Hello World'; + } +} diff --git a/helloworld/app/router.js b/helloworld/app/router.ts similarity index 59% rename from helloworld/app/router.js rename to helloworld/app/router.ts index 4b1c79d2..f56b86d5 100644 --- a/helloworld/app/router.js +++ b/helloworld/app/router.ts @@ -1,6 +1,6 @@ -'use strict'; +import { Application } from 'egg'; -module.exports = app => { +export default (app: Application) => { app.router.get('/', app.controller.home.render); app.router.get('/foo', app.controller.foo.render); }; diff --git a/helloworld/config/config.default.js b/helloworld/config/config.default.js deleted file mode 100644 index af619a43..00000000 --- a/helloworld/config/config.default.js +++ /dev/null @@ -1,3 +0,0 @@ -'use strict'; - -exports.keys = 'my secret keys'; diff --git a/helloworld/config/config.default.ts b/helloworld/config/config.default.ts new file mode 100644 index 00000000..4e2424d4 --- /dev/null +++ b/helloworld/config/config.default.ts @@ -0,0 +1,3 @@ +export default { + keys: 'my secret keys', +}; diff --git a/helloworld/package.json b/helloworld/package.json index 800cf2f8..a34aa063 100644 --- a/helloworld/package.json +++ b/helloworld/package.json @@ -1,16 +1,29 @@ { "name": "helloworld", "dependencies": { - "egg": "^1.10.1" + "egg": "beta" }, "devDependencies": { - "egg-bin": "^4.3.5", - "egg-mock": "^3.13.1" + "@eggjs/bin": "7", + "@eggjs/mock": "6", + "@eggjs/tsconfig": "1", + "@types/mocha": "10", + "@types/node": "22", + "eslint": "8", + "eslint-config-egg": "14", + "typescript": "5" }, "scripts": { + "lint": "eslint . --ext .ts", "dev": "egg-bin dev", + "pretest": "npm run lint -- --fix", "test": "egg-bin test", - "cov": "egg-bin cov" + "preci": "npm run lint", + "ci": "egg-bin cov", + "postci": "npm run prepublishOnly && npm run clean", + "clean": "tsc -b --clean", + "prepublishOnly": "npm run clean && tsc" }, - "private": true + "private": true, + "repository": "git@github.com:eggjs/examples.git" } diff --git a/helloworld/test/index.test.js b/helloworld/test/index.test.js deleted file mode 100644 index 9c3bb8e8..00000000 --- a/helloworld/test/index.test.js +++ /dev/null @@ -1,29 +0,0 @@ -'use strict'; - - -const mm = require('egg-mock'); - -describe('example helloworld test', () => { - let app; - - before(() => { - app = mm.app(); - return app.ready(); - }); - - after(() => app.close()); - - it('should GET / 200', () => { - return app.httpRequest() - .get('/') - .expect(200) - .expect('Hello World'); - }); - - it('should GET /foo', () => { - return app.httpRequest() - .get('/foo') - .expect(200) - .expect('Hello foo'); - }); -}); diff --git a/helloworld/test/index.test.ts b/helloworld/test/index.test.ts new file mode 100644 index 00000000..5252564d --- /dev/null +++ b/helloworld/test/index.test.ts @@ -0,0 +1,19 @@ +import { app } from '@eggjs/mock/bootstrap'; + +describe('example helloworld test', () => { + it('should GET / 200', () => { + return app.httpRequest() + .get('/') + .expect(200) + .expect('Hello World'); + }); + + it('should GET /foo', async () => { + await app.httpRequest() + .get('/foo') + .expect(400) + .expect({ + foo: 'bar', + }); + }); +}); diff --git a/helloworld/tsconfig.json b/helloworld/tsconfig.json new file mode 100644 index 00000000..480e95d5 --- /dev/null +++ b/helloworld/tsconfig.json @@ -0,0 +1,14 @@ +{ + "extends": "@eggjs/tsconfig", + "compilerOptions": { + "strict": true, + "noImplicitAny": true, + "target": "ES2022", + "module": "NodeNext", + "moduleResolution": "NodeNext", + "declaration": false + }, + "exclude": [ + "test" + ] +} From 62be764ca4c719f83a140b46702311ddaf86445c Mon Sep 17 00:00:00 2001 From: fengmk2 Date: Sun, 29 Dec 2024 16:28:51 +0800 Subject: [PATCH 2/6] feat: upgrade to egg v4 BREAKING CHANGE: drop Node.js < 18.19.0 support part of https://github.com/eggjs/egg/issues/3644 https://github.com/eggjs/egg/issues/5257 --- .github/PULL_REQUEST_TEMPLATE.md | 24 ------------------------ .github/workflows/ci.yml | 7 ++----- README.md | 18 ++++-------------- package.json | 4 ++-- 4 files changed, 8 insertions(+), 45 deletions(-) delete mode 100644 .github/PULL_REQUEST_TEMPLATE.md diff --git a/.github/PULL_REQUEST_TEMPLATE.md b/.github/PULL_REQUEST_TEMPLATE.md deleted file mode 100644 index 48f9944f..00000000 --- a/.github/PULL_REQUEST_TEMPLATE.md +++ /dev/null @@ -1,24 +0,0 @@ - - -##### Checklist - - -- [ ] `npm test` passes -- [ ] tests and/or benchmarks are included -- [ ] documentation is changed or added -- [ ] commit message follows commit guidelines - -##### Affected core subsystem(s) - - - -##### Description of change - diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 18a0657a..dc5563d8 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -3,16 +3,13 @@ name: CI on: push: branches: [ master ] - pull_request: branches: [ master ] - workflow_dispatch: {} - jobs: Job: name: Node.js - uses: artusjs/github-actions/.github/workflows/node-test.yml@master + uses: node-modules/github-actions/.github/workflows/node-test.yml@master with: os: 'ubuntu-latest' - version: '14, 16, 18' + version: '18, 20, 22' diff --git a/README.md b/README.md index 92bd9832..03f04ab3 100644 --- a/README.md +++ b/README.md @@ -1,16 +1,12 @@ # Examples for [egg](https://github.com/eggjs/egg) ---- - -[![build status][travis-image]][travis-url] +[![CI](https://github.com/eggjs/examples/actions/workflows/ci.yml/badge.svg?branch=master)](https://github.com/eggjs/examples/actions/workflows/ci.yml) [![node version][node-image]][node-url] [![egg version][egg-image]][egg-url] -[travis-image]: https://img.shields.io/travis/eggjs/examples.svg?style=flat-square -[travis-url]: https://travis-ci.org/eggjs/examples -[node-image]: https://img.shields.io/badge/node.js-%3E=_8-green.svg?style=flat-square +[node-image]: https://img.shields.io/badge/node.js-%3E=_18-green.svg?style=flat-square [node-url]: http://nodejs.org/download/ -[egg-image]: https://img.shields.io/badge/egg-%3E=_1-green.svg?style=flat-square +[egg-image]: https://img.shields.io/badge/egg-%3E=_4-green.svg?style=flat-square [egg-url]: https://github.com/eggjs/egg ## Usage @@ -23,7 +19,7 @@ $ npm install $ npm run dev ``` -**Recommend to use Node >= 8** +**Recommend to use Node >= 18** ## List of examples @@ -64,12 +60,6 @@ You can use `--verbose` to show more infomation $ npm test -- --verbose ``` -### Generate dependencies - -```bash -$ npm run autod -``` - ### Show list of examples ```bash diff --git a/package.json b/package.json index aa3954a9..d0767184 100644 --- a/package.json +++ b/package.json @@ -10,7 +10,7 @@ "chalk": "^1.1.3", "common-bin": "^2.7.1", "globby": "^6.1.0", - "npminstall": "^6.6.2", + "npminstall": "7", "runscript": "^1.5.3", "semver": "^5.3.0" }, @@ -30,7 +30,7 @@ "url": "https://github.com/eggjs/egg/issues" }, "engines": { - "node": ">= 14.17.0" + "node": ">= 18.19.0" }, "license": "MIT", "private": true From 8ceb9181054e5eb93882a4dbbbe0d895a3467bf2 Mon Sep 17 00:00:00 2001 From: fengmk2 Date: Sun, 29 Dec 2024 17:02:57 +0800 Subject: [PATCH 3/6] update eggbin --- bin/test.sh | 8 ++++++++ hello-tegg/package.json | 17 ++++++++--------- helloworld/config/config.default.ts | 4 +++- helloworld/package.json | 5 +++-- package.json | 4 ++-- 5 files changed, 24 insertions(+), 14 deletions(-) create mode 100755 bin/test.sh diff --git a/bin/test.sh b/bin/test.sh new file mode 100755 index 00000000..ec4c419f --- /dev/null +++ b/bin/test.sh @@ -0,0 +1,8 @@ +#!/usr/bin/env bash + +cd helloworld +rm -rf node_modules package-lock.json +npm install --registry=https://registry.npmmirror.com +npm run ci +cd helloworld + diff --git a/hello-tegg/package.json b/hello-tegg/package.json index 77890e7b..26180bde 100644 --- a/hello-tegg/package.json +++ b/hello-tegg/package.json @@ -6,7 +6,6 @@ "start": "egg-scripts start", "stop": "egg-scripts stop", "dev": "egg-bin dev", - "debug": "egg-bin debug", "test-local": "egg-bin test", "test": "npm run lint -- --fix && npm run test-local", "cov": "egg-bin cov", @@ -25,17 +24,17 @@ "@eggjs/tegg-plugin": "^3.2.1", "@eggjs/tsconfig": "^1.2.0", "@eggjs/tegg-config": "^3.1.0", - "egg": "^3.9.1", + "egg": "beta", "egg-scripts": "^2.17.0" }, "devDependencies": { - "@types/mocha": "^10.0.1", - "@types/node": "^16.18.10", - "egg-bin": "^6.0.0", - "egg-mock": "^5.4.0", - "eslint": "^8.30.0", - "eslint-config-egg": "^12.1.0", - "typescript": "^4.9.4" + "@types/mocha": "10", + "@types/node": "22", + "@egg/bin": "7", + "@eggjs/mock": "6", + "eslint": "8", + "eslint-config-egg": "14", + "typescript": "5" }, "repository": "git@github.com:eggjs/examples.git" } diff --git a/helloworld/config/config.default.ts b/helloworld/config/config.default.ts index 4e2424d4..b9d2d77a 100644 --- a/helloworld/config/config.default.ts +++ b/helloworld/config/config.default.ts @@ -1,3 +1,5 @@ +import { EggAppConfig } from 'egg'; + export default { keys: 'my secret keys', -}; +} as EggAppConfig; diff --git a/helloworld/package.json b/helloworld/package.json index a34aa063..2682fcf1 100644 --- a/helloworld/package.json +++ b/helloworld/package.json @@ -15,10 +15,11 @@ }, "scripts": { "lint": "eslint . --ext .ts", + "predev": "npm run clean && npm run lint -- --fix", "dev": "egg-bin dev", - "pretest": "npm run lint -- --fix", + "pretest": "npm run clean && npm run lint -- --fix", "test": "egg-bin test", - "preci": "npm run lint", + "preci": "npm run clean && npm run lint", "ci": "egg-bin cov", "postci": "npm run prepublishOnly && npm run clean", "clean": "tsc -b --clean", diff --git a/package.json b/package.json index d0767184..be08d9b8 100644 --- a/package.json +++ b/package.json @@ -16,9 +16,9 @@ }, "scripts": { "lint": "echo 'ignore'", - "test": "./example.js test", + "test": "./bin/test.sh", "test-cn": "./example.js test -c", - "ci": "npm run lint && npm test", + "ci": "npm test", "list": "./example.js list" }, "homepage": "https://github.com/eggjs/examples", From 67321cd46cf08ef015df997cacf2ab84fb6be626 Mon Sep 17 00:00:00 2001 From: fengmk2 Date: Sun, 29 Dec 2024 17:23:59 +0800 Subject: [PATCH 4/6] test on tegg v3 --- bin/test.sh | 16 +++++++++++----- hello-tegg/.gitignore | 1 + hello-tegg/app/middleware/trace_method.ts | 2 +- hello-tegg/config/config.default.ts | 5 +++-- hello-tegg/config/plugin.ts | 5 +++-- hello-tegg/package.json | 10 ++++++---- hello-tegg/test/biz/HelloService.test.ts | 9 +++++---- .../test/controller/HelloController.test.ts | 4 ++-- hello-tegg/tsconfig.json | 13 +++++++++++-- 9 files changed, 43 insertions(+), 22 deletions(-) diff --git a/bin/test.sh b/bin/test.sh index ec4c419f..d14ce22d 100755 --- a/bin/test.sh +++ b/bin/test.sh @@ -1,8 +1,14 @@ #!/usr/bin/env bash -cd helloworld -rm -rf node_modules package-lock.json -npm install --registry=https://registry.npmmirror.com -npm run ci -cd helloworld +test() { + echo "Test $1" + cd $1 + pwd + rm -rf node_modules package-lock.json + npm install --registry=https://registry.npmmirror.com + npm run ci + cd .. +} +test helloworld +test hello-tegg diff --git a/hello-tegg/.gitignore b/hello-tegg/.gitignore index 2ba77726..b2eeab3a 100644 --- a/hello-tegg/.gitignore +++ b/hello-tegg/.gitignore @@ -19,3 +19,4 @@ test/**/*.map config/**/*.map *.d.ts *.tsbuildinfo +.egg/ diff --git a/hello-tegg/app/middleware/trace_method.ts b/hello-tegg/app/middleware/trace_method.ts index 6e49a2c9..b5dd8009 100644 --- a/hello-tegg/app/middleware/trace_method.ts +++ b/hello-tegg/app/middleware/trace_method.ts @@ -2,5 +2,5 @@ import { EggContext, Next } from '@eggjs/tegg'; export async function traceMethod(ctx: EggContext, next: Next) { await next(); - ctx.body.data.message += ` (${ctx.method})`; + (ctx.body as any).data.message += ` (${ctx.method})`; } diff --git a/hello-tegg/config/config.default.ts b/hello-tegg/config/config.default.ts index 208980f9..c9f711d1 100644 --- a/hello-tegg/config/config.default.ts +++ b/hello-tegg/config/config.default.ts @@ -1,7 +1,8 @@ -import { EggAppConfig, PowerPartial } from 'egg'; +import { EggAppConfig } from 'egg'; +// import { EggAppConfig, PowerPartial } from 'egg'; export default (appInfo: EggAppConfig) => { - const config = {} as PowerPartial; + const config = {} as EggAppConfig; // override config from framework / plugin config.keys = appInfo.name + '123456'; diff --git a/hello-tegg/config/plugin.ts b/hello-tegg/config/plugin.ts index f7493ab2..b0aede11 100644 --- a/hello-tegg/config/plugin.ts +++ b/hello-tegg/config/plugin.ts @@ -1,6 +1,7 @@ -import { EggPlugin } from 'egg'; +// import { EggPlugin } from 'egg'; -const plugin: EggPlugin = { +// const plugin: EggPlugin = { +const plugin = { tegg: { enable: true, package: '@eggjs/tegg-plugin', diff --git a/hello-tegg/package.json b/hello-tegg/package.json index 26180bde..2d77b5a7 100644 --- a/hello-tegg/package.json +++ b/hello-tegg/package.json @@ -7,10 +7,12 @@ "stop": "egg-scripts stop", "dev": "egg-bin dev", "test-local": "egg-bin test", - "test": "npm run lint -- --fix && npm run test-local", - "cov": "egg-bin cov", + "pretest": "npm run clean && npm run lint -- --fix", + "test": "egg-bin test", "tsc": "tsc -p tsconfig.json", - "ci": "npm run lint && npm run cov && npm run tsc", + "preci": "npm run lint", + "ci": "egg-bin cov", + "postci": "npm run tsc && npm run clean", "lint": "eslint .", "clean": "tsc -b --clean" }, @@ -30,7 +32,7 @@ "devDependencies": { "@types/mocha": "10", "@types/node": "22", - "@egg/bin": "7", + "@eggjs/bin": "7", "@eggjs/mock": "6", "eslint": "8", "eslint-config-egg": "14", diff --git a/hello-tegg/test/biz/HelloService.test.ts b/hello-tegg/test/biz/HelloService.test.ts index 6d77a419..706bfcef 100644 --- a/hello-tegg/test/biz/HelloService.test.ts +++ b/hello-tegg/test/biz/HelloService.test.ts @@ -1,10 +1,11 @@ -import { Context } from 'egg'; -import assert from 'assert'; -import { app } from 'egg-mock/bootstrap'; +import { strict as assert } from 'node:assert'; +// import { EggContext } from 'egg'; +import { app } from '@eggjs/mock/bootstrap'; import { HelloService } from '../../app/biz/HelloService'; describe('test/biz/HelloService.test.ts', () => { - let ctx: Context; + let ctx: any; + // let ctx: EggContext; let helloService: HelloService; beforeEach(async () => { diff --git a/hello-tegg/test/controller/HelloController.test.ts b/hello-tegg/test/controller/HelloController.test.ts index d627e180..8ea27c79 100644 --- a/hello-tegg/test/controller/HelloController.test.ts +++ b/hello-tegg/test/controller/HelloController.test.ts @@ -1,5 +1,5 @@ -import { app } from 'egg-mock/bootstrap'; -import assert from 'assert'; +import { strict as assert } from 'node:assert'; +import { app } from '@eggjs/mock/bootstrap'; describe('test/controller/HelloController.test.ts', () => { it('should work', async () => { diff --git a/hello-tegg/tsconfig.json b/hello-tegg/tsconfig.json index 65fddc82..865b55a3 100644 --- a/hello-tegg/tsconfig.json +++ b/hello-tegg/tsconfig.json @@ -1,6 +1,15 @@ { "extends": "@eggjs/tsconfig", "compilerOptions": { - "baseUrl": "./" - } + "baseUrl": ".", + "strict": true, + "noImplicitAny": true, + "target": "ES2022", + "module": "NodeNext", + "moduleResolution": "NodeNext", + "declaration": false + }, + "exclude": [ + "test" + ] } From 07ac2b38dae277d248f7e6d5cbb7a5e2deae13a6 Mon Sep 17 00:00:00 2001 From: fengmk2 Date: Mon, 30 Dec 2024 09:15:51 +0800 Subject: [PATCH 5/6] use egg-scripts v3 --- hello-tegg/package.json | 7 ++++--- helloworld/package.json | 5 ++++- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/hello-tegg/package.json b/hello-tegg/package.json index 2d77b5a7..7aab1a81 100644 --- a/hello-tegg/package.json +++ b/hello-tegg/package.json @@ -14,7 +14,8 @@ "ci": "egg-bin cov", "postci": "npm run tsc && npm run clean", "lint": "eslint .", - "clean": "tsc -b --clean" + "clean": "tsc -b --clean", + "prepublishOnly": "npm run clean && tsc" }, "egg": { "typescript": true @@ -22,12 +23,12 @@ "license": "MIT", "dependencies": { "@eggjs/tegg": "^3.2.1", + "@eggjs/tegg-config": "^3.1.0", "@eggjs/tegg-controller-plugin": "^3.2.1", "@eggjs/tegg-plugin": "^3.2.1", "@eggjs/tsconfig": "^1.2.0", - "@eggjs/tegg-config": "^3.1.0", "egg": "beta", - "egg-scripts": "^2.17.0" + "egg-scripts": "^3.1.0" }, "devDependencies": { "@types/mocha": "10", diff --git a/helloworld/package.json b/helloworld/package.json index 2682fcf1..6beaa1e4 100644 --- a/helloworld/package.json +++ b/helloworld/package.json @@ -1,7 +1,8 @@ { "name": "helloworld", "dependencies": { - "egg": "beta" + "egg": "beta", + "egg-scripts": "^3.1.0" }, "devDependencies": { "@eggjs/bin": "7", @@ -14,6 +15,8 @@ "typescript": "5" }, "scripts": { + "start": "egg-scripts start", + "stop": "egg-scripts stop", "lint": "eslint . --ext .ts", "predev": "npm run clean && npm run lint -- --fix", "dev": "egg-bin dev", From 6dac52fdbc44a95c174e91091233d1ea256a6bcb Mon Sep 17 00:00:00 2001 From: fengmk2 Date: Tue, 31 Dec 2024 21:35:50 +0800 Subject: [PATCH 6/6] use @eggjs/scripts v4 --- hello-tegg/package.json | 8 ++++---- helloworld/package.json | 8 ++++---- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/hello-tegg/package.json b/hello-tegg/package.json index 7aab1a81..2fff4e94 100644 --- a/hello-tegg/package.json +++ b/hello-tegg/package.json @@ -3,8 +3,8 @@ "private": true, "description": "tegg application example", "scripts": { - "start": "egg-scripts start", - "stop": "egg-scripts stop", + "start": "eggctl start --daemon", + "stop": "eggctl stop", "dev": "egg-bin dev", "test-local": "egg-bin test", "pretest": "npm run clean && npm run lint -- --fix", @@ -22,13 +22,13 @@ }, "license": "MIT", "dependencies": { + "@eggjs/scripts": "^4.0.0", "@eggjs/tegg": "^3.2.1", "@eggjs/tegg-config": "^3.1.0", "@eggjs/tegg-controller-plugin": "^3.2.1", "@eggjs/tegg-plugin": "^3.2.1", "@eggjs/tsconfig": "^1.2.0", - "egg": "beta", - "egg-scripts": "^3.1.0" + "egg": "beta" }, "devDependencies": { "@types/mocha": "10", diff --git a/helloworld/package.json b/helloworld/package.json index 6beaa1e4..3bb1d097 100644 --- a/helloworld/package.json +++ b/helloworld/package.json @@ -1,8 +1,8 @@ { "name": "helloworld", "dependencies": { - "egg": "beta", - "egg-scripts": "^3.1.0" + "@eggjs/scripts": "^4.0.0", + "egg": "beta" }, "devDependencies": { "@eggjs/bin": "7", @@ -15,8 +15,8 @@ "typescript": "5" }, "scripts": { - "start": "egg-scripts start", - "stop": "egg-scripts stop", + "start": "eggctl start --daemon", + "stop": "eggctl stop", "lint": "eslint . --ext .ts", "predev": "npm run clean && npm run lint -- --fix", "dev": "egg-bin dev",