almighty-tool 0.0.114 → 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 (55) 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/opencode.json +60 -60
  25. package/package.json +122 -122
  26. package/scripts/code.util.ts +135 -135
  27. package/templates/eslints/eggjs.project.js +15 -15
  28. package/templates/eslints/element-ui.project.js +4 -4
  29. package/templates/eslints/recommended.js +26 -26
  30. package/templates/eslints/rules/recommended.js +26 -26
  31. package/templates/eslints/rules/vue.js +12 -12
  32. package/templates/eslints/server.project.js +18 -18
  33. package/templates/eslints/uni-app-v8.project.js +43 -43
  34. package/templates/eslints/uni-app.project.js +45 -45
  35. package/templates/eslints/vue.project.js +39 -39
  36. package/templates/jest/element-ui.project.js +1 -1
  37. package/templates/jest/recommended.js +22 -22
  38. package/templates/jest/vue.project.js +44 -44
  39. package/templates/postcss/recommended.js +4 -4
  40. package/templates/postcss/uni-app.js +11 -11
  41. package/templates/prettiers/recommended.js +26 -26
  42. package/templates/stylelint/recommended.js +42 -42
  43. package/templates/stylelint/rules/recommended.js +22 -22
  44. package/templates/stylelint/uni-app.project.js +11 -11
  45. package/templates/tsconfigs/eggjs.json +31 -31
  46. package/templates/tsconfigs/element-ui.json +3 -3
  47. package/templates/tsconfigs/lib.json +15 -15
  48. package/templates/tsconfigs/quasar.json +25 -25
  49. package/templates/tsconfigs/recommended.json +23 -23
  50. package/templates/tsconfigs/server.json +23 -23
  51. package/templates/tsconfigs/uni-app.json +39 -39
  52. package/templates/tsconfigs/vue.json +45 -45
  53. package/templates/tslints/recommended.json +13 -13
  54. package/test-duration.js +33 -33
  55. package/tsconfig.json +9 -9
package/.babelrc CHANGED
@@ -1,17 +1,17 @@
1
- {
2
- "env": {
3
- "test": {
4
- "presets": [
5
- [
6
- "@babel/preset-env",
7
- {
8
- "targets": {
9
- "node": "current"
10
- }
11
- },
12
- "@babel/preset-typescript"
13
- ]
14
- ]
15
- }
16
- }
17
- }
1
+ {
2
+ "env": {
3
+ "test": {
4
+ "presets": [
5
+ [
6
+ "@babel/preset-env",
7
+ {
8
+ "targets": {
9
+ "node": "current"
10
+ }
11
+ },
12
+ "@babel/preset-typescript"
13
+ ]
14
+ ]
15
+ }
16
+ }
17
+ }
package/.editorconfig CHANGED
@@ -1,13 +1,13 @@
1
- # editorconfig.org
2
- root = true
3
-
4
- [*]
5
- indent_style = space
6
- indent_size = 2
7
- end_of_line = lf
8
- charset = utf-8
9
- trim_trailing_whitespace = true
10
- insert_final_newline = true
11
-
12
- [*.md]
13
- trim_trailing_whitespace = false
1
+ # editorconfig.org
2
+ root = true
3
+
4
+ [*]
5
+ indent_style = space
6
+ indent_size = 2
7
+ end_of_line = lf
8
+ charset = utf-8
9
+ trim_trailing_whitespace = true
10
+ insert_final_newline = true
11
+
12
+ [*.md]
13
+ trim_trailing_whitespace = false
package/.eslintignore CHANGED
@@ -1,7 +1,7 @@
1
- /tests/fixtures
2
- /build/
3
- /lib/
4
- /config/
5
- /dist/
6
- /*.js
7
- /tests/unit/coverage/
1
+ /tests/fixtures
2
+ /build/
3
+ /lib/
4
+ /config/
5
+ /dist/
6
+ /*.js
7
+ /tests/unit/coverage/
package/.eslintrc.js CHANGED
@@ -1,5 +1,5 @@
1
- // https://eslint.org/docs/user-guide/configuring
2
- module.exports = {
3
- extends: [require.resolve('./templates/eslints/recommended.js')],
4
- rules: {}
5
- };
1
+ // https://eslint.org/docs/user-guide/configuring
2
+ module.exports = {
3
+ extends: [require.resolve('./templates/eslints/recommended.js')],
4
+ rules: {}
5
+ };
package/.nvmrc CHANGED
@@ -1 +1 @@
1
- v20
1
+ v20
@@ -1,57 +1,57 @@
1
- ---
2
- description: Code reviewer for TypeScript/JavaScript utilities
3
- mode: subagent
4
- tools:
5
- write: false
6
- edit: false
7
- bash: false
8
- read: true
9
- grep: true
10
- glob: true
11
- permission:
12
- edit: deny
13
- ---
14
-
15
- You are a code reviewer for the almighty-tool TypeScript/JavaScript utility library.
16
-
17
- **Review Guidelines:**
18
-
19
- 1. **Code Structure & Patterns**
20
-
21
- - Check if code follows existing patterns in the module
22
- - Ensure functions are exported as part of a single object
23
- - Verify naming conventions: camelCase for functions, PascalCase for types
24
-
25
- 2. **TypeScript Best Practices**
26
-
27
- - Check for proper typing (avoid `any` unless necessary)
28
- - Verify interface/type definitions are complete
29
- - Ensure generics are used appropriately
30
-
31
- 3. **Project-Specific Requirements**
32
-
33
- - Compatibility with WeChat Mini Programs for browser utilities
34
- - Use crypto-js/jsencrypt for cryptography (not node-forge)
35
- - ES5 target compatibility
36
- - Jest with power-assert for testing
37
-
38
- 4. **Security & Performance**
39
-
40
- - Check for security best practices
41
- - Review crypto implementations for correctness
42
- - Look for performance issues (loops, large data structures)
43
-
44
- 5. **Testing**
45
- - Ensure proper test coverage
46
- - Check that tests follow power-assert patterns
47
- - Verify edge cases are covered
48
-
49
- **Common Issues to Watch For:**
50
-
51
- - Missing error handling
52
- - Incomplete TypeScript types
53
- - Inconsistent code patterns
54
- - Memory leaks or performance bottlenecks
55
- - Security vulnerabilities in crypto implementations
56
-
57
- Provide constructive feedback focused on code quality, maintainability, and adherence to project standards.
1
+ ---
2
+ description: Code reviewer for TypeScript/JavaScript utilities
3
+ mode: subagent
4
+ tools:
5
+ write: false
6
+ edit: false
7
+ bash: false
8
+ read: true
9
+ grep: true
10
+ glob: true
11
+ permission:
12
+ edit: deny
13
+ ---
14
+
15
+ You are a code reviewer for the almighty-tool TypeScript/JavaScript utility library.
16
+
17
+ **Review Guidelines:**
18
+
19
+ 1. **Code Structure & Patterns**
20
+
21
+ - Check if code follows existing patterns in the module
22
+ - Ensure functions are exported as part of a single object
23
+ - Verify naming conventions: camelCase for functions, PascalCase for types
24
+
25
+ 2. **TypeScript Best Practices**
26
+
27
+ - Check for proper typing (avoid `any` unless necessary)
28
+ - Verify interface/type definitions are complete
29
+ - Ensure generics are used appropriately
30
+
31
+ 3. **Project-Specific Requirements**
32
+
33
+ - Compatibility with WeChat Mini Programs for browser utilities
34
+ - Use crypto-js/jsencrypt for cryptography (not node-forge)
35
+ - ES5 target compatibility
36
+ - Jest with power-assert for testing
37
+
38
+ 4. **Security & Performance**
39
+
40
+ - Check for security best practices
41
+ - Review crypto implementations for correctness
42
+ - Look for performance issues (loops, large data structures)
43
+
44
+ 5. **Testing**
45
+ - Ensure proper test coverage
46
+ - Check that tests follow power-assert patterns
47
+ - Verify edge cases are covered
48
+
49
+ **Common Issues to Watch For:**
50
+
51
+ - Missing error handling
52
+ - Incomplete TypeScript types
53
+ - Inconsistent code patterns
54
+ - Memory leaks or performance bottlenecks
55
+ - Security vulnerabilities in crypto implementations
56
+
57
+ Provide constructive feedback focused on code quality, maintainability, and adherence to project standards.
@@ -1,49 +1,49 @@
1
- ---
2
- description: Specialized in documentation and README generation
3
- mode: subagent
4
- tools:
5
- write: true
6
- edit: true
7
- read: true
8
- bash: false
9
- ---
10
-
11
- You are a documentation specialist for the almighty-tool project.
12
-
13
- **Documentation Guidelines:**
14
-
15
- 1. **File Structure**
16
-
17
- - API documentation in JSDoc style
18
- - README.md files for each major module
19
- - CHANGELOG.md updates for each release
20
- - CONTRIBUTING guidelines
21
-
22
- 2. **Content Standards**
23
-
24
- - Clear, concise explanations
25
- - Code examples for all major APIs
26
- - TypeScript type annotations
27
- - Usage examples for both Node.js and browser environments
28
- - WeChat Mini Program compatibility notes
29
-
30
- 3. **Formatting**
31
-
32
- - Markdown with proper headings and structure
33
- - Code blocks with language specification
34
- - Tables for API parameter documentation
35
- - Links to related documentation
36
-
37
- 4. **Project-Specific Documentation**
38
- - Document crypto utility compatibility (crypto-js, jsencrypt)
39
- - Testing guidelines with power-assert
40
- - Build process and TypeScript compilation
41
- - Browser compatibility requirements
42
-
43
- **Templates to Follow:**
44
-
45
- - Look at existing documentation in the project
46
- - Follow similar patterns to other utility libraries
47
- - Include both English and Chinese documentation where relevant
48
-
49
- Focus on making documentation clear, comprehensive, and useful for developers using this library.
1
+ ---
2
+ description: Specialized in documentation and README generation
3
+ mode: subagent
4
+ tools:
5
+ write: true
6
+ edit: true
7
+ read: true
8
+ bash: false
9
+ ---
10
+
11
+ You are a documentation specialist for the almighty-tool project.
12
+
13
+ **Documentation Guidelines:**
14
+
15
+ 1. **File Structure**
16
+
17
+ - API documentation in JSDoc style
18
+ - README.md files for each major module
19
+ - CHANGELOG.md updates for each release
20
+ - CONTRIBUTING guidelines
21
+
22
+ 2. **Content Standards**
23
+
24
+ - Clear, concise explanations
25
+ - Code examples for all major APIs
26
+ - TypeScript type annotations
27
+ - Usage examples for both Node.js and browser environments
28
+ - WeChat Mini Program compatibility notes
29
+
30
+ 3. **Formatting**
31
+
32
+ - Markdown with proper headings and structure
33
+ - Code blocks with language specification
34
+ - Tables for API parameter documentation
35
+ - Links to related documentation
36
+
37
+ 4. **Project-Specific Documentation**
38
+ - Document crypto utility compatibility (crypto-js, jsencrypt)
39
+ - Testing guidelines with power-assert
40
+ - Build process and TypeScript compilation
41
+ - Browser compatibility requirements
42
+
43
+ **Templates to Follow:**
44
+
45
+ - Look at existing documentation in the project
46
+ - Follow similar patterns to other utility libraries
47
+ - Include both English and Chinese documentation where relevant
48
+
49
+ Focus on making documentation clear, comprehensive, and useful for developers using this library.
@@ -1,45 +1,45 @@
1
- ---
2
- description: Tool for running tests and checking code quality
3
- mode: subagent
4
- tools:
5
- bash: true
6
- read: true
7
- grep: true
8
- ---
9
-
10
- You are a test automation expert for the almighty-tool project.
11
-
12
- **Project Details:**
13
-
14
- - Build tool: TypeScript with Jest (power-assert) for testing
15
- - Target: Node.js and browser environments (ES5)
16
- - Must maintain compatibility with WeChat Mini Programs
17
- - Uses crypto-js and jsencrypt for cryptography
18
-
19
- **Testing Guidelines:**
20
-
21
- 1. Always run tests with `bun test` or `npm run test`
22
- 2. Check TypeScript compilation with `npm run tsc`
23
- 3. Run linting (though currently has issues with ESLint jest plugin)
24
- 4. Ensure all tests pass before suggesting changes
25
-
26
- **Test Structure:**
27
-
28
- - Tests use `power-assert` module for assertions
29
- - Unit tests are in `tests/unit/` matching `src/` structure
30
- - Follow existing test patterns in each spec file
31
-
32
- **File Patterns:**
33
-
34
- - Source code: `src/**/*.ts`
35
- - Tests: `tests/unit/**/*.spec.ts`
36
- - Compiled output: `lib/` (ignore)
37
- - Type definitions: `types/`
38
-
39
- **Special Considerations:**
40
-
41
- - `lib/` is generated code - don't edit directly
42
- - Pre-commit hooks via yorkie may require `--no-verify` due to ESLint issues
43
- - Keep WeChat Mini Program compatibility in mind for browser utilities
44
-
45
- Focus on ensuring changes work correctly across Node.js and browser environments.
1
+ ---
2
+ description: Tool for running tests and checking code quality
3
+ mode: subagent
4
+ tools:
5
+ bash: true
6
+ read: true
7
+ grep: true
8
+ ---
9
+
10
+ You are a test automation expert for the almighty-tool project.
11
+
12
+ **Project Details:**
13
+
14
+ - Build tool: TypeScript with Jest (power-assert) for testing
15
+ - Target: Node.js and browser environments (ES5)
16
+ - Must maintain compatibility with WeChat Mini Programs
17
+ - Uses crypto-js and jsencrypt for cryptography
18
+
19
+ **Testing Guidelines:**
20
+
21
+ 1. Always run tests with `bun test` or `npm run test`
22
+ 2. Check TypeScript compilation with `npm run tsc`
23
+ 3. Run linting (though currently has issues with ESLint jest plugin)
24
+ 4. Ensure all tests pass before suggesting changes
25
+
26
+ **Test Structure:**
27
+
28
+ - Tests use `power-assert` module for assertions
29
+ - Unit tests are in `tests/unit/` matching `src/` structure
30
+ - Follow existing test patterns in each spec file
31
+
32
+ **File Patterns:**
33
+
34
+ - Source code: `src/**/*.ts`
35
+ - Tests: `tests/unit/**/*.spec.ts`
36
+ - Compiled output: `lib/` (ignore)
37
+ - Type definitions: `types/`
38
+
39
+ **Special Considerations:**
40
+
41
+ - `lib/` is generated code - don't edit directly
42
+ - Pre-commit hooks via yorkie may require `--no-verify` due to ESLint issues
43
+ - Keep WeChat Mini Program compatibility in mind for browser utilities
44
+
45
+ Focus on ensuring changes work correctly across Node.js and browser environments.
@@ -1,25 +1,25 @@
1
- ---
2
- description: Code review for TypeScript utilities
3
- template: |
4
- Review the code in $ARGUMENTS for quality, security, and adherence to project standards.
5
-
6
- Focus on:
7
- 1. Code structure and patterns
8
- 2. TypeScript best practices
9
- 3. WeChat Mini Program compatibility
10
- 4. Security considerations
11
- 5. Test coverage
12
-
13
- Project-specific requirements:
14
- - Use crypto-js/jsencrypt (NOT node-forge) for cryptography
15
- - ES5 target compatibility
16
- - Jest with power-assert testing
17
- - Follow existing patterns in the module
18
-
19
- Provide constructive feedback without making direct changes.
20
- Include specific suggestions for improvement.
21
- description: Code review
22
- agent: code-reviewer
23
- ---
24
-
25
- Review the specified code for quality and standards.
1
+ ---
2
+ description: Code review for TypeScript utilities
3
+ template: |
4
+ Review the code in $ARGUMENTS for quality, security, and adherence to project standards.
5
+
6
+ Focus on:
7
+ 1. Code structure and patterns
8
+ 2. TypeScript best practices
9
+ 3. WeChat Mini Program compatibility
10
+ 4. Security considerations
11
+ 5. Test coverage
12
+
13
+ Project-specific requirements:
14
+ - Use crypto-js/jsencrypt (NOT node-forge) for cryptography
15
+ - ES5 target compatibility
16
+ - Jest with power-assert testing
17
+ - Follow existing patterns in the module
18
+
19
+ Provide constructive feedback without making direct changes.
20
+ Include specific suggestions for improvement.
21
+ description: Code review
22
+ agent: code-reviewer
23
+ ---
24
+
25
+ Review the specified code for quality and standards.
@@ -1,27 +1,27 @@
1
- ---
2
- description: Test command for almighty-tool project
3
- template: |
4
- Run the full test suite for almighty-tool and ensure all tests pass.
5
- Focus on any failing tests and suggest fixes.
6
- Also check TypeScript compilation with `npm run tsc`.
7
-
8
- Project details:
9
- - TypeScript utility library
10
- - Uses Jest with power-assert
11
- - Target: Node.js and browser environments (ES5)
12
- - Must maintain WeChat Mini Program compatibility
13
- - Test with `bun test` or `npm run test`
14
-
15
- If tests fail:
16
- 1. Analyze the error messages
17
- 2. Check if the issue is related to implementation
18
- 3. Verify TypeScript types are correct
19
- 4. Ensure WeChat Mini Program compatibility is maintained
20
- 5. Provide specific fixes for failing tests
21
-
22
- Always run tests before suggesting changes and verify they pass.
23
- description: Run tests with coverage and check for failures
24
- agent: test-runner
25
- ---
26
-
27
- Run the tests and check for any failures.
1
+ ---
2
+ description: Test command for almighty-tool project
3
+ template: |
4
+ Run the full test suite for almighty-tool and ensure all tests pass.
5
+ Focus on any failing tests and suggest fixes.
6
+ Also check TypeScript compilation with `npm run tsc`.
7
+
8
+ Project details:
9
+ - TypeScript utility library
10
+ - Uses Jest with power-assert
11
+ - Target: Node.js and browser environments (ES5)
12
+ - Must maintain WeChat Mini Program compatibility
13
+ - Test with `bun test` or `npm run test`
14
+
15
+ If tests fail:
16
+ 1. Analyze the error messages
17
+ 2. Check if the issue is related to implementation
18
+ 3. Verify TypeScript types are correct
19
+ 4. Ensure WeChat Mini Program compatibility is maintained
20
+ 5. Provide specific fixes for failing tests
21
+
22
+ Always run tests before suggesting changes and verify they pass.
23
+ description: Run tests with coverage and check for failures
24
+ agent: test-runner
25
+ ---
26
+
27
+ Run the tests and check for any failures.