Skip to content

Commit

Permalink
fix: 修复错误的build,优化了部分逻辑
Browse files Browse the repository at this point in the history
  • Loading branch information
feilongproject committed Nov 22, 2022
1 parent 65af1ae commit ee797ed
Show file tree
Hide file tree
Showing 8 changed files with 28 additions and 35 deletions.
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
node_modules
lib
dist
example/package-lock.json
2 changes: 0 additions & 2 deletions .npmignore

This file was deleted.

2 changes: 1 addition & 1 deletion nodemon.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,6 @@
"ts": "tsc"
},
"watch": ["src/"],
"exec": "ts-node test/index.ts",
"exec": "ts-node test/index.ts --files",
"ext": "ts"
}
16 changes: 13 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,11 +1,21 @@
{
"name": "qq-guild-bot-sdk",
"version": "1.0.0",
"version": "0.1.0",
"description": "QQ频道机器人nodeSDK",
"main": "lib/index.js",
"main": "dist/index.js",
"files": [
"package.json",
"dist",
"LICENSE",
"README.md"
],
"directories": {
"lib": "./dist",
"example": "./example"
},
"scripts": {
"dev": "clear && nodemon",
"build": "./node_modules/.bin/tsc -p ./tsconfig.build.json"
"build": "tsc -p ./tsconfig.build.json"
},
"repository": {
"type": "git",
Expand Down
4 changes: 0 additions & 4 deletions src/index.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,3 @@
import { GetWsParam } from './types/index';
import { WebsocketClient } from './ws';


export * from "./types";
export * from "./utils";
export * from "./ws";
3 changes: 1 addition & 2 deletions src/utils/index.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import fetch from "node-fetch";
import { GetWsParam } from "../types";
import { version } from "../../package.json";


export function delayTime(ms: number) {
Expand All @@ -12,7 +11,7 @@ export function delayTime(ms: number) {
export function buildFetch(config: GetWsParam, path = '', isSandbox?: boolean) {
return fetch(`${isSandbox ? 'https://sandbox.api.sgroup.qq.com' : 'https://api.sgroup.qq.com'}${path}`, {
headers: {
'User-Agent': `QQGuildNodeSDK/v${version}`,
'User-Agent': `QQGuildNodeSDK/feilongproject`,
'Authorization': `Bot ${config.appID}.${config.token}`,
}
});
Expand Down
16 changes: 7 additions & 9 deletions tsconfig.build.json
Original file line number Diff line number Diff line change
@@ -1,16 +1,14 @@
{
"compilerOptions": {
"outDir": "./lib",
"declaration": true,
"outDir": "./dist",
"module": "commonjs",
"target": "esnext",
"lib": ["esnext"],
"target": "es6",
"moduleResolution": "node",
"alwaysStrict": true,
"strict": true,
"preserveConstEnums": true,
"moduleResolution": "node",
"esModuleInterop": true,
"resolveJsonModule": true
"resolveJsonModule": true,
"declaration": true
},
"include": ["src"],
"exclude": ["node_modules", "dist", "test"]
"exclude": ["./test"]
}
17 changes: 4 additions & 13 deletions tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,23 +1,14 @@
{
"compilerOptions": {
"outDir": "./lib",
"outDir": "./dist",
"module": "commonjs",
"target": "es2021",
"lib": ["es2021", "es2016", "es2015"],
"target": "es6",
"moduleResolution": "node",
"alwaysStrict": true,
//"allowJs": true,
"strict": true,
"preserveConstEnums": true,
"sourceMap": true,
"esModuleInterop": true,
"resolveJsonModule": true,
"types": []
"declaration": true
},
"include": ["src/**/*"],
"typeRoots": ["./src/types"],
"ts-node": {
"files": true
},
"exclude": ["node_modules", "dist", "test"]
"exclude": ["./test"]
}

0 comments on commit ee797ed

Please sign in to comment.