ziya-utils 1.0.31 → 1.0.32

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.
@@ -0,0 +1,63 @@
1
+ ### 搭建步骤
2
+ ```bash
3
+ # npm init
4
+ npm init -y
5
+
6
+ # typescript 环境
7
+ yarn add typescript -D
8
+
9
+ tsc --init
10
+
11
+ # package.json 修改
12
+ - "main": "index.js",
13
+ + "main": "./dist/index.cjs.js",
14
+ + "module": "./dist/index.esm.js",
15
+ + "types": "./dist/index.d.ts",
16
+ + "files": [
17
+ + "dist"
18
+ + ],
19
+
20
+ # rollup打包环境
21
+ yarn add rollup @rollup/plugin-typescript @rollup/plugin-node-resolve @rollup/plugin-commonjs tslib -D
22
+
23
+ # 配置 rollup.config.js
24
+ import resolve from '@rollup/plugin-node-resolve';
25
+ import typescript from '@rollup/plugin-typescript';
26
+ import commonjs from '@rollup/plugin-commonjs';
27
+
28
+ export default [
29
+ {
30
+ input: './src/index.ts',
31
+ output: {
32
+ dir: 'dist',
33
+ format: 'cjs',
34
+ entryFileNames: '[name].cjs.js',
35
+ },
36
+ plugins: [resolve(), commonjs(), typescript()],
37
+ }, {
38
+ input: './src/index.ts',
39
+ output: {
40
+ dir: 'dist',
41
+ format: 'esm',
42
+ entryFileNames: '[name].esm.js',
43
+ },
44
+ plugins: [resolve(), commonjs(), typescript()],
45
+ }
46
+ ];
47
+
48
+ # 修改 scripts
49
+ "scripts": {
50
+ + "dev": "rollup -w -c",
51
+ + "build": "rollup -c"
52
+ - "test": "echo \"Error: run tests from root\" && exit 1"
53
+ },
54
+
55
+ ```
56
+
57
+
58
+ ### 核心结构
59
+ - 正则表达式
60
+ - 安全工具
61
+ - 日期时间
62
+ - websocket
63
+ - 串口通信
package/README.md CHANGED
@@ -1,63 +1,20 @@
1
- ### 搭建步骤
2
- ```bash
3
- # npm init
4
- npm init -y
5
-
6
- # typescript 环境
7
- yarn add typescript -D
8
-
9
- tsc --init
10
-
11
- # package.json 修改
12
- - "main": "index.js",
13
- + "main": "./dist/index.cjs.js",
14
- + "module": "./dist/index.esm.js",
15
- + "types": "./dist/index.d.ts",
16
- + "files": [
17
- + "dist"
18
- + ],
19
-
20
- # rollup打包环境
21
- yarn add rollup @rollup/plugin-typescript @rollup/plugin-node-resolve @rollup/plugin-commonjs tslib -D
1
+ ### Ziya-Admin
2
+ > 一个 Javascript 常用工具库。
22
3
 
23
- # 配置 rollup.config.js
24
- import resolve from '@rollup/plugin-node-resolve';
25
- import typescript from '@rollup/plugin-typescript';
26
- import commonjs from '@rollup/plugin-commonjs';
27
-
28
- export default [
29
- {
30
- input: './src/index.ts',
31
- output: {
32
- dir: 'dist',
33
- format: 'cjs',
34
- entryFileNames: '[name].cjs.js',
35
- },
36
- plugins: [resolve(), commonjs(), typescript()],
37
- }, {
38
- input: './src/index.ts',
39
- output: {
40
- dir: 'dist',
41
- format: 'esm',
42
- entryFileNames: '[name].esm.js',
43
- },
44
- plugins: [resolve(), commonjs(), typescript()],
45
- }
46
- ];
47
-
48
- # 修改 scripts
49
- "scripts": {
50
- + "dev": "rollup -w -c",
51
- + "build": "rollup -c"
52
- - "test": "echo \"Error: run tests from root\" && exit 1"
53
- },
4
+ ## 安装
54
5
 
6
+ ```bash
7
+ $ npm install --save ziya-utils
8
+ # or
9
+ $ yarn add ziya-utils
10
+ # or
11
+ $ pnpm add ziya-utils
12
+ # or
13
+ $ bun add ziya-utils
55
14
  ```
56
15
 
16
+ ## 使用
17
+ ```js
18
+ import { getUuid } from "ziya-utils";
19
+ ```
57
20
 
58
- ### 核心结构
59
- - 正则表达式
60
- - 安全工具
61
- - 日期时间
62
- - websocket
63
- - 串口通信
package/package.json CHANGED
@@ -1,8 +1,8 @@
1
1
  {
2
2
  "name": "ziya-utils",
3
- "version": "1.0.31",
3
+ "version": "1.0.32",
4
4
  "main": "dist/index.js",
5
- "module": "dist/index.esm.js",
5
+ "module": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
7
7
  "files": [
8
8
  "dist",
package/dist/package.json DELETED
@@ -1,35 +0,0 @@
1
- {
2
- "name": "ziya-utils",
3
- "version": "1.0.31",
4
- "main": "dist/index.js",
5
- "module": "dist/index.esm.js",
6
- "types": "dist/index.d.ts",
7
- "files": [
8
- "dist",
9
- "package.json",
10
- "README.md"
11
- ],
12
- "scripts": {
13
- "dev": "rollup -w -c --bundleConfigAsCjs",
14
- "build": "rollup -c --bundleConfigAsCjs"
15
- },
16
- "keywords": ["utils", "ziya", "tools", "javascript", "typescript"],
17
- "author": "glk",
18
- "license": "ISC",
19
- "description": "ziya-utils",
20
- "devDependencies": {
21
- "@rollup/plugin-commonjs": "^25.0.3",
22
- "@rollup/plugin-node-resolve": "^15.1.0",
23
- "@rollup/plugin-strip": "^3.0.4",
24
- "@rollup/plugin-typescript": "^11.1.2",
25
- "rollup": "^3.26.3",
26
- "rollup-plugin-copy": "^3.5.0",
27
- "rollup-plugin-node-externals": "5",
28
- "tslib": "^2.6.0",
29
- "typescript": "^5.1.6"
30
- },
31
- "dependencies": {},
32
- "engines": {
33
- "node": ">=16"
34
- }
35
- }