@nam088/zca-js 1.0.1 → 3.0.0

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.
@@ -17,11 +17,5 @@ export default defineConfig([
17
17
  "no-extra-boolean-cast": "off",
18
18
  },
19
19
  },
20
- {
21
- files: ["rollup.config.js"],
22
- rules: {
23
- "@typescript-eslint/no-require-imports": "off",
24
- },
25
- },
26
20
  globalIgnores(["dist/*"]),
27
21
  ]);
package/package.json CHANGED
@@ -1,27 +1,21 @@
1
1
  {
2
2
  "name": "@nam088/zca-js",
3
- "version": "1.0.1",
3
+ "version": "3.0.0",
4
4
  "description": "Unofficial Zalo API for JavaScript",
5
- "type": "module",
6
- "main": "./dist/index.cjs",
7
- "module": "./dist/index.js",
8
- "types": "./dist/index.d.ts",
5
+ "main": "dist/index.cjs",
6
+ "module": "dist/index.js",
7
+ "types": "dist/index.d.ts",
8
+ "type": "module",
9
9
  "exports": {
10
10
  ".": {
11
- "import": {
12
- "development": "./dist/index.js",
13
- "default": "./dist/index.min.js"
14
- },
15
- "require": {
16
- "development": "./dist/index.cjs",
17
- "default": "./dist/index.min.cjs"
18
- }
11
+ "types": "./dist/index.d.ts",
12
+ "require": "./dist/index.cjs",
13
+ "import": "./dist/index.js"
19
14
  }
20
15
  },
21
16
  "scripts": {
22
- "build:clean": "rimraf dist",
23
- "build": "npm run build:clean && tsup",
24
- "test:feat": "node --loader ts-node/esm test/feat.ts",
17
+ "build": "tsup",
18
+ "test:feat": "bun run test/feat.ts",
25
19
  "prettier": "prettier --write .",
26
20
  "lint": "eslint .",
27
21
  "lint:fix": "eslint . --fix",
@@ -29,11 +23,11 @@
29
23
  },
30
24
  "repository": {
31
25
  "type": "git",
32
- "url": "git+https://github.com/Nam088/zca-js.git"
26
+ "url": "git+https://github.com/RFS-ADRENO/zca-js.git"
33
27
  },
34
- "homepage": "https://github.com/Nam088/zca-js",
28
+ "homepage": "https://github.com/RFS-ADRENO/zca-js",
35
29
  "bugs": {
36
- "url": "https://github.com/Nam088/zca-js/issues"
30
+ "url": "https://github.com/RFS-ADRENO/zca-js/issues"
37
31
  },
38
32
  "engines": {
39
33
  "node": ">=18.0.0"
@@ -43,9 +37,10 @@
43
37
  "zalo",
44
38
  "api"
45
39
  ],
46
- "author": "Nam088",
40
+ "author": "RFS-ADRENO, truong9c2208, JustKemForFun",
47
41
  "license": "MIT",
48
42
  "dependencies": {
43
+ "@nam088/zca-js": "^1.0.1",
49
44
  "crypto-js": "^4.2.0",
50
45
  "form-data": "^4.0.4",
51
46
  "json-bigint": "^1.0.0",
@@ -57,9 +52,9 @@
57
52
  },
58
53
  "devDependencies": {
59
54
  "@eslint/js": "^9.34.0",
55
+ "@types/bun": "^1.1.14",
60
56
  "@types/crypto-js": "^4.2.2",
61
57
  "@types/json-bigint": "^1.0.4",
62
- "@types/lodash": "^4.17.20",
63
58
  "@types/node": "^20.14.10",
64
59
  "@types/pako": "^2.0.3",
65
60
  "@types/semver": "^7.5.8",
@@ -69,16 +64,13 @@
69
64
  "globals": "^16.3.0",
70
65
  "husky": "^9.1.7",
71
66
  "lint-staged": "^16.1.5",
72
- "lodash": "^4.17.21",
73
67
  "prettier": "^3.3.3",
74
68
  "rimraf": "^5.0.10",
75
- "ts-node": "^10.9.2",
76
69
  "tsup": "^8.5.0",
77
- "tsx": "^4.20.6",
78
70
  "typescript": "^5.5.3",
79
71
  "typescript-eslint": "^8.41.0"
80
72
  },
81
73
  "lint-staged": {
82
- "*.{js,ts}": "npx eslint"
74
+ "*.{js,ts}": "bunx eslint"
83
75
  }
84
76
  }
package/tsup.config.ts CHANGED
@@ -1,49 +1,17 @@
1
- import { defineConfig, type Options, type Format } from "tsup";
1
+ import { defineConfig } from "tsup";
2
2
 
3
- const formats: Format[] = ["esm", "cjs"];
4
-
5
- const common: Options = {
3
+ export default defineConfig({
6
4
  entry: ["src/index.ts"],
7
- format: formats,
8
- sourcemap: true,
5
+ format: ["cjs", "esm"],
6
+ dts: true,
9
7
  splitting: false,
10
- target: "es2017",
8
+ sourcemap: false,
9
+ clean: true,
11
10
  outDir: "dist",
12
- skipNodeModulesBundle: true,
13
- platform: "node" as const,
14
- treeshake: true,
15
- external: [
16
- // Node built-ins (all)
17
- "node:*",
18
- // Runtime deps (match package.json)
19
- "crypto-js",
20
- "form-data",
21
- "json-bigint",
22
- "pako",
23
- "semver",
24
- "spark-md5",
25
- "tough-cookie",
26
- "ws",
27
- // lodash and all subpath imports
28
- "lodash",
29
- "lodash/*",
30
- ],
31
- };
32
-
33
- export default defineConfig([
34
- {
35
- ...common,
36
- dts: true,
37
- clean: true,
38
- minify: false,
39
- outExtension: ({ format }) => ({ js: format === "cjs" ? ".cjs" : ".js" }),
40
- },
41
- {
42
- ...common,
43
- dts: false,
44
- clean: false,
45
- minify: true,
46
- outExtension: ({ format }) => ({ js: format === "cjs" ? ".min.cjs" : ".min.js" }),
11
+ outExtension({ format }) {
12
+ return {
13
+ js: format === "cjs" ? ".cjs" : ".js",
14
+ };
47
15
  },
48
- ]);
16
+ });
49
17