create-lik-app 1.4.1 → 1.4.2

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.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "create-lik-app",
3
- "version": "1.4.1",
3
+ "version": "1.4.2",
4
4
  "type": "module",
5
5
  "license": "MIT",
6
6
  "author": "licheung228 <licheung228@163.com>",
@@ -1,2 +1 @@
1
- */node_modules
2
- template-bun/logs
1
+ */node_modules
@@ -1,15 +1,3 @@
1
- # Elysia with Bun runtime
2
-
3
- ## Getting Started
4
- To get started with this template, simply paste this command into your terminal:
5
- ```bash
6
- bun create elysia ./elysia-example
7
- ```
8
-
9
- ## Development
10
- To start the development server run:
11
- ```bash
12
- bun run dev
13
- ```
14
-
15
- Open http://localhost:3000/ with your browser to see the result.
1
+ ```sh
2
+ bun run dev:local
3
+ ```
@@ -0,0 +1,3 @@
1
+ node_modules
2
+ logs
3
+ public/*
Binary file
@@ -20,7 +20,8 @@
20
20
  "mongoose": "^8.3.5"
21
21
  },
22
22
  "devDependencies": {
23
- "bun-types": "latest"
23
+ "bun-types": "latest",
24
+ "prettier": "^3.5.2"
24
25
  },
25
26
  "module": "src/index.js"
26
27
  }
@@ -9,8 +9,8 @@ const ExampleController = new Elysia({
9
9
  }) as unknown as AppContext;
10
10
 
11
11
  // get methond
12
- ExampleController.get('/', ({ params, resCreator }) => {
13
- return resCreator('hello world' + params, true);
12
+ ExampleController.get('/:params', ({ params, resCreator }) => {
13
+ return resCreator('hello world' + params.params, true);
14
14
  });
15
15
 
16
16
  // post methond
@@ -1 +1,2 @@
1
1
  export * from './example';
2
+ export * from './ws';
@@ -3,10 +3,12 @@ import Elysia from 'elysia';
3
3
  const WsController = new Elysia({ name: 'WsController' });
4
4
 
5
5
  WsController.ws('/ws', {
6
- message(ws, message) {},
6
+ message(ws, message) {
7
+ ws.send(message);
8
+ },
7
9
  open(ws) {
8
- console.log('open');
10
+ ws.send('open success');
9
11
  },
10
12
  });
11
13
 
12
- export default WsController;
14
+ export { WsController };
@@ -1,7 +1,9 @@
1
1
  import Elysia from 'elysia';
2
- import { ExampleController } from '../controllers';
2
+ import { ExampleController, WsController } from '../controllers';
3
3
 
4
- const router = new Elysia().use(ExampleController);
4
+ const router = new Elysia()
5
+ .use(ExampleController)
6
+ .use(WsController);
5
7
 
6
8
  router.onError(({ logger, path, error, resCreator }) => {
7
9
  const log = logger.getLogger('error');
@@ -1,10 +1,7 @@
1
1
  BG_COLOR='\e[42m' # 背景色
2
2
  RESET='\e[0m' # 重置所有格式
3
3
 
4
- npx tsc
5
-
4
+ npm run type-check
6
5
  printf "\n${BG_COLOR}${FG_COLOR} >>>>>> TS Check Success <<<<<< ${RESET}\r\n\n"
7
-
8
- pnpm run lint
9
-
6
+ npm run lint
10
7
  printf "\n${BG_COLOR}${FG_COLOR} >>>>>> Code Lint Success <<<<<< ${RESET}\r\n\n"
@@ -5,11 +5,12 @@
5
5
  "type": "module",
6
6
  "scripts": {
7
7
  "dev": "vite",
8
- "build": "tsc -b && vite build",
8
+ "build": "type-check && vite build",
9
9
  "lint": "eslint .",
10
10
  "preview": "vite preview",
11
11
  "preinstall": "npx only-allow pnpm",
12
- "prepare": "husky"
12
+ "prepare": "husky",
13
+ "type-check": "tsc -b"
13
14
  },
14
15
  "dependencies": {
15
16
  "@gsap/react": "^2.1.1",
@@ -41,6 +42,7 @@
41
42
  "husky": "^9.1.7",
42
43
  "lint-staged": "^15.2.10",
43
44
  "only-allow": "^1.2.1",
45
+ "prettier": "^3.5.2",
44
46
  "typescript": "~5.6.2",
45
47
  "typescript-eslint": "^8.13.0",
46
48
  "unocss": "^0.64.0",
@@ -1,10 +1,7 @@
1
1
  BG_COLOR='\e[42m' # 背景色
2
2
  RESET='\e[0m' # 重置所有格式
3
3
 
4
- npx tsc
5
-
4
+ npm run type-check
6
5
  printf "\n${BG_COLOR}${FG_COLOR} >>>>>> TS Check Success <<<<<< ${RESET}\r\n\n"
7
-
8
- pnpm run lint
9
-
6
+ npm run lint
10
7
  printf "\n${BG_COLOR}${FG_COLOR} >>>>>> Code Lint Success <<<<<< ${RESET}\r\n\n"
@@ -6,11 +6,12 @@
6
6
  "scripts": {
7
7
  "dev": "vite",
8
8
  "dev:test": "vite --mode test",
9
- "build": "tsc -b && vite build",
9
+ "build": "type-check && vite build",
10
10
  "preview": "vite preview",
11
11
  "lint": "eslint .",
12
12
  "preinstall": "npx only-allow pnpm",
13
- "prepare": "husky"
13
+ "prepare": "husky",
14
+ "type-check": "tsc -b"
14
15
  },
15
16
  "dependencies": {
16
17
  "@gsap/react": "^2.1.1",
@@ -43,6 +44,7 @@
43
44
  "husky": "^9.1.7",
44
45
  "lint-staged": "^15.2.10",
45
46
  "only-allow": "^1.2.1",
47
+ "prettier": "^3.5.2",
46
48
  "typescript": "~5.6.2",
47
49
  "typescript-eslint": "^8.13.0",
48
50
  "unocss": "^0.65.3",
@@ -1,10 +1,7 @@
1
1
  BG_COLOR='\e[42m' # 背景色
2
2
  RESET='\e[0m' # 重置所有格式
3
3
 
4
- npx tsc
5
-
4
+ npm run type-check
6
5
  printf "\n${BG_COLOR}${FG_COLOR} >>>>>> TS Check Success <<<<<< ${RESET}\r\n\n"
7
-
8
- pnpm run lint
9
-
6
+ npm run lint
10
7
  printf "\n${BG_COLOR}${FG_COLOR} >>>>>> Code Lint Success <<<<<< ${RESET}\r\n\n"
@@ -6,11 +6,12 @@
6
6
  "scripts": {
7
7
  "dev": "vite",
8
8
  "dev:test": "vite --mode test",
9
- "build": "tsc -b && vite build",
9
+ "build": "type-check && vite build",
10
10
  "preview": "vite preview",
11
11
  "lint": "eslint .",
12
12
  "preinstall": "npx only-allow pnpm",
13
- "prepare": "husky"
13
+ "prepare": "husky",
14
+ "type-check": "tsc -b"
14
15
  },
15
16
  "dependencies": {
16
17
  "@tanstack/react-router": "^1.92.6",
@@ -41,6 +42,7 @@
41
42
  "husky": "^9.1.7",
42
43
  "lint-staged": "^15.2.10",
43
44
  "only-allow": "^1.2.1",
45
+ "prettier": "^3.5.2",
44
46
  "tailwindcss": "^3.4.17",
45
47
  "typescript": "~5.6.2",
46
48
  "typescript-eslint": "^8.13.0",
@@ -1,10 +1,7 @@
1
1
  BG_COLOR='\e[42m' # 背景色
2
2
  RESET='\e[0m' # 重置所有格式
3
3
 
4
- npx tsc
5
-
4
+ npm run type-check
6
5
  printf "\n${BG_COLOR}${FG_COLOR} >>>>>> TS Check Success <<<<<< ${RESET}\r\n\n"
7
-
8
- pnpm run lint
9
-
6
+ npm run lint
10
7
  printf "\n${BG_COLOR}${FG_COLOR} >>>>>> Code Lint Success <<<<<< ${RESET}\r\n\n"
@@ -6,11 +6,12 @@
6
6
  "scripts": {
7
7
  "dev": "vite",
8
8
  "dev:test": "vite --mode test",
9
- "build": "tsc -b && vite build",
9
+ "build": "type-check && vite build",
10
10
  "preview": "vite preview",
11
11
  "lint": "eslint .",
12
12
  "preinstall": "npx only-allow pnpm",
13
- "prepare": "husky"
13
+ "prepare": "husky",
14
+ "type-check": "tsc -b"
14
15
  },
15
16
  "dependencies": {
16
17
  "@tanstack/react-router": "^1.92.3",
@@ -41,6 +42,7 @@
41
42
  "husky": "^9.1.7",
42
43
  "lint-staged": "^15.2.10",
43
44
  "only-allow": "^1.2.1",
45
+ "prettier": "^3.5.2",
44
46
  "tailwindcss": "^3.4.17",
45
47
  "typescript": "~5.6.2",
46
48
  "typescript-eslint": "^8.13.0",
@@ -1,10 +1,5 @@
1
1
  BG_COLOR='\e[42m' # 背景色
2
2
  RESET='\e[0m' # 重置所有格式
3
3
 
4
- npx tsc
5
-
6
- printf "\n${BG_COLOR}${FG_COLOR} >>>>>> TS Check Success <<<<<< ${RESET}\r\n\n"
7
-
8
- pnpm run lint
9
-
4
+ npm run lint
10
5
  printf "\n${BG_COLOR}${FG_COLOR} >>>>>> Code Lint Success <<<<<< ${RESET}\r\n\n"
@@ -5,10 +5,8 @@
5
5
  "type": "module",
6
6
  "scripts": {
7
7
  "dev": "vite",
8
- "build": "run-p type-check \"build-only {@}\" --",
9
8
  "preview": "vite preview",
10
- "build-only": "vite build",
11
- "type-check": "vue-tsc --build",
9
+ "build": "vite build",
12
10
  "lint": "lint-staged -c ./.husky/lintstagedrc.cjs",
13
11
  "prepare": "husky install"
14
12
  },