create-egg 4.1.0-beta.33 → 4.1.0-beta.35

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (30) hide show
  1. package/dist/cli.js +1 -1
  2. package/dist/index.js +1 -1
  3. package/dist/{src-BgL2uwim.js → src-C5hWB9Dq.js} +1 -1
  4. package/dist/templates/egg3-simple-ts/test/app/controller/home.test.ts +1 -0
  5. package/dist/templates/egg3-simple-ts/test/app/service/Test.test.ts +1 -0
  6. package/dist/templates/egg3-simple-ts/tsconfig.json +1 -1
  7. package/dist/templates/egg3-tegg/app/module/bar/controller/home.ts +1 -1
  8. package/dist/templates/egg3-tegg/app/module/bar/controller/user.ts +1 -1
  9. package/dist/templates/egg3-tegg/app/module/foo/service/HelloService.ts +1 -1
  10. package/dist/templates/egg3-tegg/package.json +1 -1
  11. package/dist/templates/egg3-tegg/test/app/module/foo/service/HelloService.test.ts +1 -2
  12. package/dist/templates/egg3-tegg/tsconfig.json +2 -3
  13. package/dist/templates/simple-ts/package.json +1 -1
  14. package/dist/templates/simple-ts/test/app/controller/home.test.ts +1 -2
  15. package/dist/templates/simple-ts/test/app/service/Test.test.ts +1 -2
  16. package/dist/templates/simple-ts/tsconfig.json +1 -2
  17. package/dist/templates/tegg/README.md +2 -4
  18. package/dist/templates/tegg/app/module/bar/controller/home.ts +1 -1
  19. package/dist/templates/tegg/app/module/bar/controller/user.ts +1 -0
  20. package/dist/templates/tegg/app/module/foo/service/HelloService.ts +1 -1
  21. package/dist/templates/tegg/config/config.local.ts +3 -3
  22. package/dist/templates/tegg/config/config.prod.ts +3 -3
  23. package/dist/templates/tegg/config/config.unittest.ts +3 -3
  24. package/dist/templates/tegg/config/plugin.ts +4 -8
  25. package/dist/templates/tegg/package.json +5 -7
  26. package/dist/templates/tegg/test/app/module/bar/controller/home.test.ts +1 -1
  27. package/dist/templates/tegg/test/app/module/bar/controller/user.test.ts +1 -1
  28. package/dist/templates/tegg/test/app/module/foo/service/HelloService.test.skip.ts +1 -1
  29. package/dist/templates/tegg/tsconfig.json +1 -2
  30. package/package.json +3 -3
package/dist/cli.js CHANGED
@@ -1,5 +1,5 @@
1
1
  #!/usr/bin/env node
2
- import { t as init } from "./src-BgL2uwim.js";
2
+ import { t as init } from "./src-C5hWB9Dq.js";
3
3
 
4
4
  //#region src/cli.ts
5
5
  init().catch((err) => {
package/dist/index.js CHANGED
@@ -1,3 +1,3 @@
1
- import { t as init } from "./src-BgL2uwim.js";
1
+ import { t as init } from "./src-C5hWB9Dq.js";
2
2
 
3
3
  export { init };
@@ -1,8 +1,8 @@
1
1
  import fs from "node:fs";
2
2
  import path from "node:path";
3
+ import * as prompts from "@clack/prompts";
3
4
  import spawn from "cross-spawn";
4
5
  import mri from "mri";
5
- import * as prompts from "@clack/prompts";
6
6
  import colors from "picocolors";
7
7
 
8
8
  //#region src/index.ts
@@ -1,4 +1,5 @@
1
1
  import assert from 'assert';
2
+
2
3
  import { app } from 'egg-mock/bootstrap';
3
4
 
4
5
  describe('test/app/controller/home.test.ts', () => {
@@ -1,4 +1,5 @@
1
1
  import assert from 'assert';
2
+
2
3
  import { Context } from 'egg';
3
4
  import { app } from 'egg-mock/bootstrap';
4
5
 
@@ -1,4 +1,4 @@
1
1
  {
2
2
  "extends": "@eggjs/tsconfig",
3
- "exclude": ["app/public", "app/views", "node_modules*"]
3
+ "exclude": ["app/public", "app/views", "node_modules"]
4
4
  }
@@ -1,5 +1,5 @@
1
- import { EggLogger } from 'egg';
2
1
  import { Inject, HTTPController, HTTPMethod, HTTPMethodEnum } from '@eggjs/tegg';
2
+ import { EggLogger } from 'egg';
3
3
 
4
4
  @HTTPController({
5
5
  path: '/',
@@ -1,5 +1,5 @@
1
- import { Inject, HTTPController, HTTPMethod, HTTPMethodEnum, HTTPQuery } from '@eggjs/tegg';
2
1
  import { HelloService } from '@/module/foo';
2
+ import { Inject, HTTPController, HTTPMethod, HTTPMethodEnum, HTTPQuery } from '@eggjs/tegg';
3
3
 
4
4
  @HTTPController({
5
5
  path: '/bar',
@@ -1,5 +1,5 @@
1
- import { EggLogger } from 'egg';
2
1
  import { SingletonProto, AccessLevel, Inject } from '@eggjs/tegg';
2
+ import { EggLogger } from 'egg';
3
3
 
4
4
  @SingletonProto({
5
5
  // 如果需要在上层使用,需要把 accessLevel 显示声明为 public
@@ -38,7 +38,7 @@
38
38
  "@types/mocha": "10",
39
39
  "@types/node": "24",
40
40
  "oxlint": "1",
41
- "oxlint-tsgolint": "^0.3.0",
41
+ "oxlint-tsgolint": "^0.8.0",
42
42
  "typescript": "5"
43
43
  },
44
44
  "engines": {
@@ -1,8 +1,7 @@
1
1
  import { strict as assert } from 'node:assert';
2
2
 
3
- import { app } from 'egg-mock/bootstrap';
4
-
5
3
  import { HelloService } from '@/module/foo/service/HelloService';
4
+ import { app } from 'egg-mock/bootstrap';
6
5
 
7
6
  describe('test/app/module/foo/service/HelloService.test.ts', () => {
8
7
  it('should hello() work', async () => {
@@ -6,8 +6,7 @@
6
6
  "moduleResolution": "NodeNext",
7
7
  "declaration": false,
8
8
  "paths": {
9
- "@/module/*": ["app/module/*"]
10
- },
11
- "baseUrl": "."
9
+ "@/module/*": ["./app/module/*"]
10
+ }
12
11
  }
13
12
  }
@@ -32,7 +32,7 @@
32
32
  "@eggjs/tsconfig": "beta",
33
33
  "@types/node": "24",
34
34
  "oxlint": "1",
35
- "oxlint-tsgolint": "^0.3.0",
35
+ "oxlint-tsgolint": "^0.8.0",
36
36
  "typescript": "5",
37
37
  "vitest": "beta"
38
38
  },
@@ -1,6 +1,5 @@
1
- import { test, expect } from 'vitest';
2
-
3
1
  import { app } from '@eggjs/mock/bootstrap';
2
+ import { test, expect } from 'vitest';
4
3
 
5
4
  test('should GET / status 200', async () => {
6
5
  const res = await app.httpRequest().get('/').expect(200);
@@ -1,6 +1,5 @@
1
- import { test, expect } from 'vitest';
2
-
3
1
  import { app } from '@eggjs/mock/bootstrap';
2
+ import { test, expect } from 'vitest';
4
3
 
5
4
  test('sayHi should return hi, egg', async () => {
6
5
  const ctx = app.mockContext();
@@ -4,7 +4,6 @@
4
4
  "target": "ES2022",
5
5
  "module": "NodeNext",
6
6
  "moduleResolution": "NodeNext",
7
- "declaration": false,
8
- "baseUrl": "."
7
+ "declaration": false
9
8
  }
10
9
  }
@@ -1,6 +1,6 @@
1
1
  # tegg app
2
2
 
3
- [Hacker News](https://news.ycombinator.com/) showcase using [tegg](https://github.com/eggjs/tegg)
3
+ [Hacker News](https://news.ycombinator.com/) showcase using [tegg HTTPController](https://eggjs.org/basics/controller)
4
4
 
5
5
  ## QuickStart
6
6
 
@@ -12,12 +12,10 @@ npm run dev
12
12
  open http://localhost:7001/
13
13
  ```
14
14
 
15
- Don't tsc compile at development mode, if you had run `tsc` then you need to `npm run clean` before `npm run dev`.
16
-
17
15
  ### Deploy
18
16
 
19
17
  ```bash
20
- npm run tsc
18
+ npm run build
21
19
  npm start
22
20
  ```
23
21
 
@@ -1,5 +1,5 @@
1
- import type { EggLogger } from 'egg';
2
1
  import { Inject, HTTPController, HTTPMethod, HTTPMethodEnum } from '@eggjs/tegg';
2
+ import type { EggLogger } from 'egg';
3
3
 
4
4
  @HTTPController({
5
5
  path: '/',
@@ -1,4 +1,5 @@
1
1
  import { Inject, HTTPController, HTTPMethod, HTTPMethodEnum, HTTPQuery } from '@eggjs/tegg';
2
+
2
3
  import { HelloService } from '../../foo/index.ts';
3
4
 
4
5
  @HTTPController({
@@ -1,5 +1,5 @@
1
- import type { EggLogger } from 'egg';
2
1
  import { SingletonProto, AccessLevel, Inject } from '@eggjs/tegg';
2
+ import type { EggLogger } from 'egg';
3
3
 
4
4
  @SingletonProto({
5
5
  // 如果需要在上层使用,需要把 accessLevel 显示声明为 public
@@ -1,5 +1,5 @@
1
- import type { PartialEggConfig } from 'egg';
1
+ import { defineConfig } from 'egg';
2
2
 
3
- export default {
3
+ export default defineConfig({
4
4
  // add your config here
5
- } as PartialEggConfig;
5
+ });
@@ -1,5 +1,5 @@
1
- import type { PartialEggConfig } from 'egg';
1
+ import { defineConfig } from 'egg';
2
2
 
3
- export default {
3
+ export default defineConfig({
4
4
  // add your config here
5
- } as PartialEggConfig;
5
+ });
@@ -1,5 +1,5 @@
1
- import type { PartialEggConfig } from 'egg';
1
+ import { defineConfig } from 'egg';
2
2
 
3
- export default {
3
+ export default defineConfig({
4
4
  // add your config here
5
- } as PartialEggConfig;
5
+ });
@@ -1,10 +1,6 @@
1
- import type { EggPlugin } from 'egg';
1
+ import tracerPlugin from '@eggjs/tracer';
2
2
 
3
- const plugin: EggPlugin = {
4
- tracer: {
5
- enable: true,
6
- package: '@eggjs/tracer',
7
- },
3
+ export default {
4
+ // enable tracer plugin
5
+ ...tracerPlugin(),
8
6
  };
9
-
10
- export default plugin;
@@ -3,12 +3,10 @@
3
3
  "description": "Hello Egg.js",
4
4
  "private": true,
5
5
  "type": "module",
6
- "egg": {
7
- "typescript": true
8
- },
9
6
  "scripts": {
10
7
  "start": "eggctl start --daemon --title=egg-server-{{name}}",
11
8
  "stop": "eggctl stop --title=egg-server-{{name}}",
9
+ "predev": "npm run clean",
12
10
  "dev": "egg-bin dev",
13
11
  "test:local": "cross-env NODE_OPTIONS=\"--import @oxc-node/core/register\" vitest run",
14
12
  "pretest": "npm run clean && npm run lint -- --fix",
@@ -18,9 +16,9 @@
18
16
  "postci": "npm run prepublishOnly && npm start && sleep 10 && npm stop && npm run clean",
19
17
  "lint": "oxlint --type-aware",
20
18
  "typecheck": "tsc --noEmit",
21
- "tsc": "tsc",
19
+ "build": "tsc",
22
20
  "clean": "tsc -b --clean",
23
- "prepublishOnly": "npm run clean && npm run tsc"
21
+ "prepublishOnly": "npm run clean && npm run build"
24
22
  },
25
23
  "dependencies": {
26
24
  "@eggjs/scripts": "beta",
@@ -31,11 +29,11 @@
31
29
  "@eggjs/bin": "beta",
32
30
  "@eggjs/mock": "beta",
33
31
  "@eggjs/tsconfig": "beta",
34
- "@oxc-node/core": "^0.0.32",
32
+ "@oxc-node/core": "^0.0.35",
35
33
  "@types/node": "24",
36
34
  "cross-env": "10",
37
35
  "oxlint": "1",
38
- "oxlint-tsgolint": "^0.3.0",
36
+ "oxlint-tsgolint": "^0.8.0",
39
37
  "typescript": "5",
40
38
  "vitest": "4",
41
39
  "@vitest/coverage-v8": "4"
@@ -1,5 +1,5 @@
1
- import { test, expect } from 'vitest';
2
1
  import { app } from '@eggjs/mock/bootstrap';
2
+ import { test, expect } from 'vitest';
3
3
 
4
4
  test('should GET / status 200', async () => {
5
5
  const res = await app.httpRequest().get('/');
@@ -1,5 +1,5 @@
1
- import { test, expect } from 'vitest';
2
1
  import { app } from '@eggjs/mock/bootstrap';
2
+ import { test, expect } from 'vitest';
3
3
 
4
4
  test('should GET /bar/user status 200', async () => {
5
5
  const res = await app.httpRequest().get('/bar/user').query({ userId: '20170901' });
@@ -1,5 +1,5 @@
1
- import { test, expect } from 'vitest';
2
1
  import { app } from '@eggjs/mock/bootstrap';
2
+ import { test, expect } from 'vitest';
3
3
 
4
4
  import { HelloService } from '../../../../../app/module/foo/index.ts';
5
5
 
@@ -4,7 +4,6 @@
4
4
  "target": "ES2022",
5
5
  "module": "NodeNext",
6
6
  "moduleResolution": "NodeNext",
7
- "declaration": false,
8
- "baseUrl": "."
7
+ "declaration": false
9
8
  }
10
9
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "create-egg",
3
- "version": "4.1.0-beta.33",
3
+ "version": "4.1.0-beta.35",
4
4
  "publishConfig": {
5
5
  "access": "public"
6
6
  },
@@ -9,14 +9,14 @@
9
9
  "devDependencies": {
10
10
  "@types/cross-spawn": "^6.0.6",
11
11
  "execa": "^9.6.0",
12
- "tsdown": "0.15.11"
12
+ "tsdown": "^0.17.0"
13
13
  },
14
14
  "engines": {
15
15
  "node": ">=20.19.0"
16
16
  },
17
17
  "repository": {
18
18
  "type": "git",
19
- "url": "git://github.com/eggjs/egg.git",
19
+ "url": "git+https://github.com/eggjs/egg.git",
20
20
  "directory": "tools/create-egg"
21
21
  },
22
22
  "bugs": {