almighty-tool 0.0.113 → 0.0.115

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 (61) hide show
  1. package/.babelrc +17 -17
  2. package/.editorconfig +13 -13
  3. package/.eslintignore +7 -7
  4. package/.eslintrc.js +5 -5
  5. package/.nvmrc +1 -1
  6. package/.opencode/agents/code-reviewer.md +57 -57
  7. package/.opencode/agents/docs-specialist.md +49 -49
  8. package/.opencode/agents/test-runner.md +45 -45
  9. package/.opencode/commands/review.md +25 -25
  10. package/.opencode/commands/test.md +27 -27
  11. package/.opencode/skills/cryptography-dev.md +108 -108
  12. package/.opencode/skills/typescript-library-dev.md +94 -94
  13. package/.prettierrc.js +1 -1
  14. package/.yarnrc +11 -11
  15. package/AGENTS.md +69 -69
  16. package/CHANGELOG.md +7 -7
  17. package/README.md +11 -11
  18. package/bun.lock +2836 -2836
  19. package/bunfig.toml +7 -7
  20. package/jest.config.js +1 -1
  21. package/lib/utils/basic.util.d.ts +5 -0
  22. package/lib/utils/basic.util.js +64 -0
  23. package/lib/utils/basic.util.js.map +1 -1
  24. package/lib/utils/string.util.d.ts +51 -0
  25. package/lib/utils/string.util.js +98 -0
  26. package/lib/utils/string.util.js.map +1 -1
  27. package/lib/utils/validate.util.d.ts +6 -0
  28. package/lib/utils/validate.util.js +70 -0
  29. package/lib/utils/validate.util.js.map +1 -1
  30. package/opencode.json +60 -60
  31. package/package.json +122 -122
  32. package/scripts/code.util.ts +135 -135
  33. package/templates/eslints/eggjs.project.js +15 -15
  34. package/templates/eslints/element-ui.project.js +4 -4
  35. package/templates/eslints/recommended.js +26 -26
  36. package/templates/eslints/rules/recommended.js +26 -26
  37. package/templates/eslints/rules/vue.js +12 -12
  38. package/templates/eslints/server.project.js +18 -18
  39. package/templates/eslints/uni-app-v8.project.js +43 -43
  40. package/templates/eslints/uni-app.project.js +45 -45
  41. package/templates/eslints/vue.project.js +39 -39
  42. package/templates/jest/element-ui.project.js +1 -1
  43. package/templates/jest/recommended.js +22 -22
  44. package/templates/jest/vue.project.js +44 -44
  45. package/templates/postcss/recommended.js +4 -4
  46. package/templates/postcss/uni-app.js +11 -11
  47. package/templates/prettiers/recommended.js +26 -26
  48. package/templates/stylelint/recommended.js +42 -42
  49. package/templates/stylelint/rules/recommended.js +22 -22
  50. package/templates/stylelint/uni-app.project.js +11 -11
  51. package/templates/tsconfigs/eggjs.json +31 -31
  52. package/templates/tsconfigs/element-ui.json +3 -3
  53. package/templates/tsconfigs/lib.json +15 -15
  54. package/templates/tsconfigs/quasar.json +25 -25
  55. package/templates/tsconfigs/recommended.json +23 -23
  56. package/templates/tsconfigs/server.json +23 -23
  57. package/templates/tsconfigs/uni-app.json +39 -39
  58. package/templates/tsconfigs/vue.json +45 -45
  59. package/templates/tslints/recommended.json +13 -13
  60. package/test-duration.js +33 -33
  61. package/tsconfig.json +9 -9
@@ -1,108 +1,108 @@
1
- ---
2
- description: Cryptography and security implementation for WeChat Mini Programs
3
- mode: skill
4
- ---
5
-
6
- **Skill Name**: Cryptography Implementation with WeChat Mini Program Support
7
-
8
- **Expertise**: Cryptography, security, WeChat Mini Program compatibility, JavaScript/TypeScript
9
-
10
- **Technology Stack**:
11
-
12
- - **Primary Libraries**: crypto-js, jsencrypt
13
- - **Prohibited**: node-forge (not compatible with WeChat Mini Programs)
14
- - **Hash Algorithms**: MD5, SHA1, SHA256, SHA384, SHA512
15
- - **Encryption**: AES (CBC, CTR, GCM, ECB modes)
16
- - **Asymmetric**: RSA with jsencrypt
17
-
18
- **Implementation Guidelines**:
19
-
20
- 1. **Library Selection**:
21
-
22
- - ✅ Use `crypto-js` for symmetric encryption and hashing
23
- - ✅ Use `jsencrypt` for RSA operations
24
- - ❌ Never use `node-forge` (incompatible with WeChat Mini Programs)
25
-
26
- 2. **WeChat Mini Program Compatibility**:
27
-
28
- - All cryptography must work in browser environment
29
- - No Node.js-specific APIs or dependencies
30
- - Test in simulated WeChat Mini Program environment
31
-
32
- 3. **Best Practices**:
33
-
34
- - Use appropriate key sizes (AES-256, RSA-2048+)
35
- - Implement proper IV/nonce generation
36
- - Use secure random number generation
37
- - Avoid hardcoded keys and secrets
38
-
39
- 4. **Common Use Cases**:
40
- - Password hashing (with salt)
41
- - Data encryption at rest
42
- - Secure data transmission
43
- - Digital signatures
44
- - Key generation and management
45
-
46
- **Code Patterns for almighty-tool**:
47
-
48
- 1. **Hash Functions**:
49
-
50
- ```typescript
51
- // crypto-js pattern
52
- import CryptoJS from 'crypto-js';
53
- const hash = CryptoJS.SHA256('data').toString(CryptoJS.enc.Hex);
54
- ```
55
-
56
- 2. **AES Encryption**:
57
-
58
- ```typescript
59
- const encrypted = CryptoJS.AES.encrypt(data, key, {
60
- iv: iv,
61
- mode: CryptoJS.mode.CBC,
62
- padding: CryptoJS.pad.Pkcs7,
63
- });
64
- ```
65
-
66
- 3. **RSA Operations**:
67
- ```typescript
68
- import JSEncrypt from 'jsencrypt';
69
- const jsEncrypt = new JSEncrypt();
70
- jsEncrypt.setPublicKey(publicKey);
71
- const encrypted = jsEncrypt.encrypt(data);
72
- ```
73
-
74
- **Testing Requirements**:
75
-
76
- - All crypto operations must be tested with `bun test`
77
- - Verify compatibility with existing test cases
78
- - Test edge cases (empty strings, null values, large data)
79
- - Ensure deterministic output for same inputs
80
-
81
- **Security Considerations**:
82
-
83
- - Never log sensitive data (keys, passwords, plaintext)
84
- - Use proper error handling for crypto failures
85
- - Validate input data before crypto operations
86
- - Follow cryptographic best practices
87
-
88
- **File Locations in Project**:
89
-
90
- - Main crypto utility: `src/utils/crypto.util.ts`
91
- - Test file: `tests/unit/utils/crypto.util.spec.ts`
92
- - Dependencies: `package.json` (crypto-js, jsencrypt)
93
-
94
- **Common Issues to Avoid**:
95
-
96
- - Using deprecated algorithms (MD5 for passwords)
97
- - Weak key sizes (AES-128, RSA-1024)
98
- - Hardcoded keys or passwords
99
- - Incorrect IV/nonce usage
100
- - Missing error handling
101
-
102
- **Success Criteria**:
103
-
104
- - Crypto utility works correctly in browser environment
105
- - All tests pass for crypto operations
106
- - No Node.js-specific dependencies
107
- - Proper error handling and validation
108
- - Follows existing code patterns in crypto.util.ts
1
+ ---
2
+ description: Cryptography and security implementation for WeChat Mini Programs
3
+ mode: skill
4
+ ---
5
+
6
+ **Skill Name**: Cryptography Implementation with WeChat Mini Program Support
7
+
8
+ **Expertise**: Cryptography, security, WeChat Mini Program compatibility, JavaScript/TypeScript
9
+
10
+ **Technology Stack**:
11
+
12
+ - **Primary Libraries**: crypto-js, jsencrypt
13
+ - **Prohibited**: node-forge (not compatible with WeChat Mini Programs)
14
+ - **Hash Algorithms**: MD5, SHA1, SHA256, SHA384, SHA512
15
+ - **Encryption**: AES (CBC, CTR, GCM, ECB modes)
16
+ - **Asymmetric**: RSA with jsencrypt
17
+
18
+ **Implementation Guidelines**:
19
+
20
+ 1. **Library Selection**:
21
+
22
+ - ✅ Use `crypto-js` for symmetric encryption and hashing
23
+ - ✅ Use `jsencrypt` for RSA operations
24
+ - ❌ Never use `node-forge` (incompatible with WeChat Mini Programs)
25
+
26
+ 2. **WeChat Mini Program Compatibility**:
27
+
28
+ - All cryptography must work in browser environment
29
+ - No Node.js-specific APIs or dependencies
30
+ - Test in simulated WeChat Mini Program environment
31
+
32
+ 3. **Best Practices**:
33
+
34
+ - Use appropriate key sizes (AES-256, RSA-2048+)
35
+ - Implement proper IV/nonce generation
36
+ - Use secure random number generation
37
+ - Avoid hardcoded keys and secrets
38
+
39
+ 4. **Common Use Cases**:
40
+ - Password hashing (with salt)
41
+ - Data encryption at rest
42
+ - Secure data transmission
43
+ - Digital signatures
44
+ - Key generation and management
45
+
46
+ **Code Patterns for almighty-tool**:
47
+
48
+ 1. **Hash Functions**:
49
+
50
+ ```typescript
51
+ // crypto-js pattern
52
+ import CryptoJS from 'crypto-js';
53
+ const hash = CryptoJS.SHA256('data').toString(CryptoJS.enc.Hex);
54
+ ```
55
+
56
+ 2. **AES Encryption**:
57
+
58
+ ```typescript
59
+ const encrypted = CryptoJS.AES.encrypt(data, key, {
60
+ iv: iv,
61
+ mode: CryptoJS.mode.CBC,
62
+ padding: CryptoJS.pad.Pkcs7,
63
+ });
64
+ ```
65
+
66
+ 3. **RSA Operations**:
67
+ ```typescript
68
+ import JSEncrypt from 'jsencrypt';
69
+ const jsEncrypt = new JSEncrypt();
70
+ jsEncrypt.setPublicKey(publicKey);
71
+ const encrypted = jsEncrypt.encrypt(data);
72
+ ```
73
+
74
+ **Testing Requirements**:
75
+
76
+ - All crypto operations must be tested with `bun test`
77
+ - Verify compatibility with existing test cases
78
+ - Test edge cases (empty strings, null values, large data)
79
+ - Ensure deterministic output for same inputs
80
+
81
+ **Security Considerations**:
82
+
83
+ - Never log sensitive data (keys, passwords, plaintext)
84
+ - Use proper error handling for crypto failures
85
+ - Validate input data before crypto operations
86
+ - Follow cryptographic best practices
87
+
88
+ **File Locations in Project**:
89
+
90
+ - Main crypto utility: `src/utils/crypto.util.ts`
91
+ - Test file: `tests/unit/utils/crypto.util.spec.ts`
92
+ - Dependencies: `package.json` (crypto-js, jsencrypt)
93
+
94
+ **Common Issues to Avoid**:
95
+
96
+ - Using deprecated algorithms (MD5 for passwords)
97
+ - Weak key sizes (AES-128, RSA-1024)
98
+ - Hardcoded keys or passwords
99
+ - Incorrect IV/nonce usage
100
+ - Missing error handling
101
+
102
+ **Success Criteria**:
103
+
104
+ - Crypto utility works correctly in browser environment
105
+ - All tests pass for crypto operations
106
+ - No Node.js-specific dependencies
107
+ - Proper error handling and validation
108
+ - Follows existing code patterns in crypto.util.ts
@@ -1,94 +1,94 @@
1
- ---
2
- description: TypeScript/JavaScript library development with WeChat Mini Program compatibility
3
- mode: skill
4
- ---
5
-
6
- **Skill Name**: TypeScript Library Development with WeChat Mini Program Compatibility
7
-
8
- **Expertise**: TypeScript, JavaScript, Jest testing, browser compatibility, WeChat Mini Programs
9
-
10
- **Key Responsibilities**:
11
-
12
- 1. Develop and maintain utility libraries in TypeScript
13
- 2. Ensure compatibility with Node.js and browser environments
14
- 3. Maintain WeChat Mini Program compatibility
15
- 4. Write comprehensive unit tests
16
- 5. Follow established code patterns and conventions
17
-
18
- **Technology Stack**:
19
-
20
- - **Primary Language**: TypeScript (target ES5)
21
- - **Testing**: Jest with power-assert
22
- - **Browser Compatibility**: WeChat Mini Program, modern browsers
23
- - **Cryptography**: crypto-js, jsencrypt (NOT node-forge)
24
- - **Build Tools**: TypeScript compiler, Prettier, ESLint
25
-
26
- **Project Structure Familiarity**:
27
-
28
- 1. **Source Code**: `src/` directory with common utilities
29
-
30
- - `common/`: Common utilities and constants
31
- - `formats/`: Formatting utilities
32
- - `i18n/`: Internationalization
33
- - `locales/`: Locale data
34
- - `utils/`: Utility functions with .util.ts suffix
35
-
36
- 2. **Testing**: `tests/unit/` matching source structure
37
-
38
- - Tests use `power-assert` for assertions
39
- - Follow naming pattern: `*.spec.ts`
40
- - Tests should cover all edge cases
41
-
42
- 3. **Build Output**: `lib/` directory
43
- - Generated by TypeScript compilation
44
- - Never edit directly
45
- - ES5 target for maximum compatibility
46
-
47
- **Development Guidelines**:
48
-
49
- 1. **Code Organization**:
50
-
51
- - Each module exports a single object with methods
52
- - Use camelCase for functions/variables, PascalCase for classes/interfaces
53
- - Keep files focused and single-purpose
54
-
55
- 2. **WeChat Mini Program Compatibility**:
56
-
57
- - Avoid Node.js-specific APIs in browser utilities
58
- - Use browser-compatible cryptography (crypto-js, jsencrypt)
59
- - Test in simulated browser environments
60
-
61
- 3. **Testing Requirements**:
62
-
63
- - Always run tests with `bun test` or `npm run test`
64
- - Ensure 100% test coverage for new features
65
- - Follow existing test patterns in each spec file
66
- - Use power-assert for readable assertion messages
67
-
68
- 4. **Quality Assurance**:
69
-
70
- - Run TypeScript compilation with `npm run tsc`
71
- - Check for linting issues (despite current ESLint problems)
72
- - Use Prettier for code formatting
73
- - Verify browser compatibility
74
-
75
- 5. **Git Workflow**:
76
- - Use descriptive commit messages
77
- - Pre-commit hooks may require `--no-verify` due to ESLint configuration issues
78
- - Keep `lib/` directory out of Git (already ignored)
79
-
80
- **Common Pitfalls to Avoid**:
81
-
82
- - Using Node.js-specific APIs in browser utilities
83
- - Forgetting WeChat Mini Program compatibility
84
- - Breaking existing test cases
85
- - Not following established code patterns
86
- - Missing TypeScript type annotations
87
-
88
- **Success Criteria**:
89
-
90
- - All tests pass (bun test tests/unit/utils/crypto.util.spec.ts)
91
- - TypeScript compilation succeeds (npm run tsc)
92
- - Code follows established patterns and conventions
93
- - WeChat Mini Program compatibility maintained
94
- - Proper cryptographic libraries used (crypto-js, jsencrypt)
1
+ ---
2
+ description: TypeScript/JavaScript library development with WeChat Mini Program compatibility
3
+ mode: skill
4
+ ---
5
+
6
+ **Skill Name**: TypeScript Library Development with WeChat Mini Program Compatibility
7
+
8
+ **Expertise**: TypeScript, JavaScript, Jest testing, browser compatibility, WeChat Mini Programs
9
+
10
+ **Key Responsibilities**:
11
+
12
+ 1. Develop and maintain utility libraries in TypeScript
13
+ 2. Ensure compatibility with Node.js and browser environments
14
+ 3. Maintain WeChat Mini Program compatibility
15
+ 4. Write comprehensive unit tests
16
+ 5. Follow established code patterns and conventions
17
+
18
+ **Technology Stack**:
19
+
20
+ - **Primary Language**: TypeScript (target ES5)
21
+ - **Testing**: Jest with power-assert
22
+ - **Browser Compatibility**: WeChat Mini Program, modern browsers
23
+ - **Cryptography**: crypto-js, jsencrypt (NOT node-forge)
24
+ - **Build Tools**: TypeScript compiler, Prettier, ESLint
25
+
26
+ **Project Structure Familiarity**:
27
+
28
+ 1. **Source Code**: `src/` directory with common utilities
29
+
30
+ - `common/`: Common utilities and constants
31
+ - `formats/`: Formatting utilities
32
+ - `i18n/`: Internationalization
33
+ - `locales/`: Locale data
34
+ - `utils/`: Utility functions with .util.ts suffix
35
+
36
+ 2. **Testing**: `tests/unit/` matching source structure
37
+
38
+ - Tests use `power-assert` for assertions
39
+ - Follow naming pattern: `*.spec.ts`
40
+ - Tests should cover all edge cases
41
+
42
+ 3. **Build Output**: `lib/` directory
43
+ - Generated by TypeScript compilation
44
+ - Never edit directly
45
+ - ES5 target for maximum compatibility
46
+
47
+ **Development Guidelines**:
48
+
49
+ 1. **Code Organization**:
50
+
51
+ - Each module exports a single object with methods
52
+ - Use camelCase for functions/variables, PascalCase for classes/interfaces
53
+ - Keep files focused and single-purpose
54
+
55
+ 2. **WeChat Mini Program Compatibility**:
56
+
57
+ - Avoid Node.js-specific APIs in browser utilities
58
+ - Use browser-compatible cryptography (crypto-js, jsencrypt)
59
+ - Test in simulated browser environments
60
+
61
+ 3. **Testing Requirements**:
62
+
63
+ - Always run tests with `bun test` or `npm run test`
64
+ - Ensure 100% test coverage for new features
65
+ - Follow existing test patterns in each spec file
66
+ - Use power-assert for readable assertion messages
67
+
68
+ 4. **Quality Assurance**:
69
+
70
+ - Run TypeScript compilation with `npm run tsc`
71
+ - Check for linting issues (despite current ESLint problems)
72
+ - Use Prettier for code formatting
73
+ - Verify browser compatibility
74
+
75
+ 5. **Git Workflow**:
76
+ - Use descriptive commit messages
77
+ - Pre-commit hooks may require `--no-verify` due to ESLint configuration issues
78
+ - Keep `lib/` directory out of Git (already ignored)
79
+
80
+ **Common Pitfalls to Avoid**:
81
+
82
+ - Using Node.js-specific APIs in browser utilities
83
+ - Forgetting WeChat Mini Program compatibility
84
+ - Breaking existing test cases
85
+ - Not following established code patterns
86
+ - Missing TypeScript type annotations
87
+
88
+ **Success Criteria**:
89
+
90
+ - All tests pass (bun test tests/unit/utils/crypto.util.spec.ts)
91
+ - TypeScript compilation succeeds (npm run tsc)
92
+ - Code follows established patterns and conventions
93
+ - WeChat Mini Program compatibility maintained
94
+ - Proper cryptographic libraries used (crypto-js, jsencrypt)
package/.prettierrc.js CHANGED
@@ -1 +1 @@
1
- module.exports = require('./templates/prettiers/recommended.js');
1
+ module.exports = require('./templates/prettiers/recommended.js');
package/.yarnrc CHANGED
@@ -1,12 +1,12 @@
1
- network-concurrency 1
2
- registry "https://registry.npmmirror.com"
3
- canvas_binary_host_mirror "https://npmmirror.com/mirrors/canvas"
4
- sass_binary_site "https://npmmirror.com/mirrors/node-sass"
5
- phantomjs_cdnurl "https://npmmirror.com/mirrors/phantomjs"
6
- electron_mirror "https://npmmirror.com/mirrors/electron"
7
- sqlite3_binary_host_mirror "http://npmmirror.com/mirrors/sqlite3"
8
- profiler_binary_host_mirror "http://npmmirror.com/mirrors/node-inspector"
9
- chromedriver_cdnurl "https://npmmirror.com/mirrors/chromedriver"
10
- operadriver_cdnurl "https://npmmirror.com/mirrors/operadriver"
11
- sentrycli_cdnurl "https://npmmirror.com/mirrors/sentry-cli"
1
+ network-concurrency 1
2
+ registry "https://registry.npmmirror.com"
3
+ canvas_binary_host_mirror "https://npmmirror.com/mirrors/canvas"
4
+ sass_binary_site "https://npmmirror.com/mirrors/node-sass"
5
+ phantomjs_cdnurl "https://npmmirror.com/mirrors/phantomjs"
6
+ electron_mirror "https://npmmirror.com/mirrors/electron"
7
+ sqlite3_binary_host_mirror "http://npmmirror.com/mirrors/sqlite3"
8
+ profiler_binary_host_mirror "http://npmmirror.com/mirrors/node-inspector"
9
+ chromedriver_cdnurl "https://npmmirror.com/mirrors/chromedriver"
10
+ operadriver_cdnurl "https://npmmirror.com/mirrors/operadriver"
11
+ sentrycli_cdnurl "https://npmmirror.com/mirrors/sentry-cli"
12
12
  fse_binary_host_mirror "https://npmmirror.com/mirrors/fsevents"
package/AGENTS.md CHANGED
@@ -1,69 +1,69 @@
1
- # OpenCode Agents
2
-
3
- This document helps OpenCode understand the project structure and coding patterns used in the almighty-tool project.
4
-
5
- ## Project Overview
6
-
7
- - **Type**: JavaScript/TypeScript tool library
8
- - **Build Tool**: TypeScript, Jest for testing
9
- - **Target Environment**: Node.js and browser environments (ES5 target)
10
-
11
- ## Directory Structure
12
-
13
- ```
14
- almighty-tool/
15
- ├── src/ # Source code
16
- │ ├── common/ # Common utilities and constants
17
- │ ├── formats/ # Formatting utilities
18
- │ ├── i18n/ # Internationalization
19
- │ ├── locales/ # Locale data
20
- │ ├── utils/ # Utility functions
21
- │ │ ├── basic.util.ts # Basic utilities
22
- │ │ ├── color.util.ts # Color manipulation
23
- │ │ ├── crypto.util.ts # Cryptography utilities
24
- │ │ ├── date.util.ts # Date and time utilities
25
- │ │ └── ... (other utilities)
26
- ├── tests/ # Test files
27
- │ └── unit/ # Unit tests matching src structure
28
- ├── lib/ # Compiled output (ignored by Git)
29
- └── types/ # TypeScript type definitions
30
- ```
31
-
32
- ## Development Tools
33
-
34
- - **Testing**: Jest with power-assert
35
- - **Linting**: ESLint with custom rules from templates/eslints/recommended.js
36
- - **Formatting**: Prettier
37
- - **Type Checking**: TypeScript
38
-
39
- ## Code Conventions
40
-
41
- 1. **Naming**: camelCase for functions/variables, PascalCase for classes/interfaces
42
- 2. **File Structure**: Each utility module exports a single object with methods
43
- 3. **Testing**: Tests use `power-assert` module
44
- 4. **Imports**: Relative imports, TypeScript ES modules
45
-
46
- ## Build Commands
47
-
48
- - `npm run test` or `bun test` - Run all tests
49
- - `npm run tsc` - TypeScript compilation
50
- - `npm run lint` - ESLint checking (currently has config issues)
51
- - `npm run check` - Run tests and lint
52
-
53
- ## Project-Specific Guidelines
54
-
55
- - Keep compatibility with WeChat Mini Programs for browser-facing utilities
56
- - Use crypto-js and jsencrypt for cryptography (not node-forge)
57
- - Test all changes with the existing test suite
58
- - Follow the existing code patterns in each module
59
-
60
- ## Git Workflow
61
-
62
- - Pre-commit hooks configured via yorkie (gitHooks in package.json)
63
- - Commit messages should be descriptive and follow conventional commits
64
-
65
- ## Notes
66
-
67
- - `lib/` directory contains compiled output, should not be manually edited
68
- - ESLint configuration has issues with jest plugin (need to fix dependencies)
69
- - Use `git commit --no-verify` temporarily to bypass pre-commit hooks due to ESLint issues
1
+ # OpenCode Agents
2
+
3
+ This document helps OpenCode understand the project structure and coding patterns used in the almighty-tool project.
4
+
5
+ ## Project Overview
6
+
7
+ - **Type**: JavaScript/TypeScript tool library
8
+ - **Build Tool**: TypeScript, Jest for testing
9
+ - **Target Environment**: Node.js and browser environments (ES5 target)
10
+
11
+ ## Directory Structure
12
+
13
+ ```
14
+ almighty-tool/
15
+ ├── src/ # Source code
16
+ │ ├── common/ # Common utilities and constants
17
+ │ ├── formats/ # Formatting utilities
18
+ │ ├── i18n/ # Internationalization
19
+ │ ├── locales/ # Locale data
20
+ │ ├── utils/ # Utility functions
21
+ │ │ ├── basic.util.ts # Basic utilities
22
+ │ │ ├── color.util.ts # Color manipulation
23
+ │ │ ├── crypto.util.ts # Cryptography utilities
24
+ │ │ ├── date.util.ts # Date and time utilities
25
+ │ │ └── ... (other utilities)
26
+ ├── tests/ # Test files
27
+ │ └── unit/ # Unit tests matching src structure
28
+ ├── lib/ # Compiled output (ignored by Git)
29
+ └── types/ # TypeScript type definitions
30
+ ```
31
+
32
+ ## Development Tools
33
+
34
+ - **Testing**: Jest with power-assert
35
+ - **Linting**: ESLint with custom rules from templates/eslints/recommended.js
36
+ - **Formatting**: Prettier
37
+ - **Type Checking**: TypeScript
38
+
39
+ ## Code Conventions
40
+
41
+ 1. **Naming**: camelCase for functions/variables, PascalCase for classes/interfaces
42
+ 2. **File Structure**: Each utility module exports a single object with methods
43
+ 3. **Testing**: Tests use `power-assert` module
44
+ 4. **Imports**: Relative imports, TypeScript ES modules
45
+
46
+ ## Build Commands
47
+
48
+ - `npm run test` or `bun test` - Run all tests
49
+ - `npm run tsc` - TypeScript compilation
50
+ - `npm run lint` - ESLint checking (currently has config issues)
51
+ - `npm run check` - Run tests and lint
52
+
53
+ ## Project-Specific Guidelines
54
+
55
+ - Keep compatibility with WeChat Mini Programs for browser-facing utilities
56
+ - Use crypto-js and jsencrypt for cryptography (not node-forge)
57
+ - Test all changes with the existing test suite
58
+ - Follow the existing code patterns in each module
59
+
60
+ ## Git Workflow
61
+
62
+ - Pre-commit hooks configured via yorkie (gitHooks in package.json)
63
+ - Commit messages should be descriptive and follow conventional commits
64
+
65
+ ## Notes
66
+
67
+ - `lib/` directory contains compiled output, should not be manually edited
68
+ - ESLint configuration has issues with jest plugin (need to fix dependencies)
69
+ - Use `git commit --no-verify` temporarily to bypass pre-commit hooks due to ESLint issues
package/CHANGELOG.md CHANGED
@@ -1,7 +1,7 @@
1
- # CHNAGE LOG
2
-
3
- ## Develop
4
-
5
- ### 2020-09-21 10:40
6
-
7
- - 增加request options的name参数, 已经result增加name参数
1
+ # CHNAGE LOG
2
+
3
+ ## Develop
4
+
5
+ ### 2020-09-21 10:40
6
+
7
+ - 增加request options的name参数, 已经result增加name参数
package/README.md CHANGED
@@ -1,11 +1,11 @@
1
- # almighty-tool
2
-
3
- > almighty common lib
4
-
5
- ## Build Setup
6
-
7
- ``` bash
8
- $ bun install
9
- $ bun run test
10
- $ bun run test --watch
11
- ```
1
+ # almighty-tool
2
+
3
+ > almighty common lib
4
+
5
+ ## Build Setup
6
+
7
+ ``` bash
8
+ $ bun install
9
+ $ bun run test
10
+ $ bun run test --watch
11
+ ```