almighty-tool 0.0.114 → 0.0.116

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 (57) 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/validate.util.d.ts +4 -0
  25. package/lib/utils/validate.util.js.map +1 -1
  26. package/opencode.json +60 -60
  27. package/package.json +122 -122
  28. package/scripts/code.util.ts +135 -135
  29. package/templates/eslints/eggjs.project.js +15 -15
  30. package/templates/eslints/element-ui.project.js +4 -4
  31. package/templates/eslints/recommended.js +26 -26
  32. package/templates/eslints/rules/recommended.js +26 -26
  33. package/templates/eslints/rules/vue.js +12 -12
  34. package/templates/eslints/server.project.js +18 -18
  35. package/templates/eslints/uni-app-v8.project.js +43 -43
  36. package/templates/eslints/uni-app.project.js +45 -45
  37. package/templates/eslints/vue.project.js +39 -39
  38. package/templates/jest/element-ui.project.js +1 -1
  39. package/templates/jest/recommended.js +22 -22
  40. package/templates/jest/vue.project.js +44 -44
  41. package/templates/postcss/recommended.js +4 -4
  42. package/templates/postcss/uni-app.js +11 -11
  43. package/templates/prettiers/recommended.js +26 -26
  44. package/templates/stylelint/recommended.js +42 -42
  45. package/templates/stylelint/rules/recommended.js +22 -22
  46. package/templates/stylelint/uni-app.project.js +11 -11
  47. package/templates/tsconfigs/eggjs.json +31 -31
  48. package/templates/tsconfigs/element-ui.json +3 -3
  49. package/templates/tsconfigs/lib.json +15 -15
  50. package/templates/tsconfigs/quasar.json +25 -25
  51. package/templates/tsconfigs/recommended.json +23 -23
  52. package/templates/tsconfigs/server.json +23 -23
  53. package/templates/tsconfigs/uni-app.json +39 -39
  54. package/templates/tsconfigs/vue.json +45 -45
  55. package/templates/tslints/recommended.json +13 -13
  56. package/test-duration.js +33 -33
  57. package/tsconfig.json +9 -9
@@ -1,22 +1,22 @@
1
- module.exports = {
2
- 'unit-no-unknown': null,
3
- 'selector-type-no-unknown': null,
4
- 'font-family-no-missing-generic-family-keyword': null,
5
- 'no-descending-specificity': null,
6
- 'scss/at-import-partial-extension': null,
7
- 'function-url-quotes': null,
8
- 'selector-class-pattern': null,
9
- 'color-function-notation': 'legacy',
10
- 'selector-pseudo-element-no-unknown': null,
11
- 'alpha-value-notation': null,
12
- 'scss/dollar-variable-pattern': null,
13
- 'no-invalid-position-at-import-rule': null,
14
- 'selector-pseudo-class-no-unknown': null,
15
- 'scss/no-global-function-names': null,
16
- 'scss/operator-no-unspaced': null,
17
- 'property-no-unknown': null,
18
- 'selector-pseudo-element-colon-notation': null,
19
- 'at-rule-no-unknown': null,
20
- 'property-case': null,
21
- 'max-line-length': null,
22
- };
1
+ module.exports = {
2
+ 'unit-no-unknown': null,
3
+ 'selector-type-no-unknown': null,
4
+ 'font-family-no-missing-generic-family-keyword': null,
5
+ 'no-descending-specificity': null,
6
+ 'scss/at-import-partial-extension': null,
7
+ 'function-url-quotes': null,
8
+ 'selector-class-pattern': null,
9
+ 'color-function-notation': 'legacy',
10
+ 'selector-pseudo-element-no-unknown': null,
11
+ 'alpha-value-notation': null,
12
+ 'scss/dollar-variable-pattern': null,
13
+ 'no-invalid-position-at-import-rule': null,
14
+ 'selector-pseudo-class-no-unknown': null,
15
+ 'scss/no-global-function-names': null,
16
+ 'scss/operator-no-unspaced': null,
17
+ 'property-no-unknown': null,
18
+ 'selector-pseudo-element-colon-notation': null,
19
+ 'at-rule-no-unknown': null,
20
+ 'property-case': null,
21
+ 'max-line-length': null,
22
+ };
@@ -1,11 +1,11 @@
1
- module.exports = {
2
- extends: ['stylelint-config-standard', 'stylelint-config-standard-scss'],
3
- plugins: ['stylelint-scss'],
4
- overrides: [
5
- {
6
- files: ['**/*.{vue,html}'],
7
- customSyntax: 'postcss-html',
8
- },
9
- ],
10
- rules: require('./rules/recommended'),
11
- };
1
+ module.exports = {
2
+ extends: ['stylelint-config-standard', 'stylelint-config-standard-scss'],
3
+ plugins: ['stylelint-scss'],
4
+ overrides: [
5
+ {
6
+ files: ['**/*.{vue,html}'],
7
+ customSyntax: 'postcss-html',
8
+ },
9
+ ],
10
+ rules: require('./rules/recommended'),
11
+ };
@@ -1,31 +1,31 @@
1
- {
2
- "compileOnSave": true,
3
- "compilerOptions": {
4
- "target": "es2017",
5
- "module": "commonjs",
6
- "strict": true,
7
- "noImplicitAny": false,
8
- "resolveJsonModule": true,
9
- "experimentalDecorators": true,
10
- "emitDecoratorMetadata": true,
11
- "charset": "utf8",
12
- "allowJs": false,
13
- "pretty": true,
14
- "noEmitOnError": false,
15
- "noUnusedLocals": true,
16
- "noUnusedParameters": true,
17
- "allowUnreachableCode": false,
18
- "allowUnusedLabels": false,
19
- "strictPropertyInitialization": false,
20
- "noFallthroughCasesInSwitch": true,
21
- "skipLibCheck": true,
22
- "skipDefaultLibCheck": true,
23
- "inlineSourceMap": true,
24
- "importHelpers": true
25
- },
26
- "exclude": [
27
- "app/public",
28
- "app/views",
29
- "node_modules*"
30
- ]
31
- }
1
+ {
2
+ "compileOnSave": true,
3
+ "compilerOptions": {
4
+ "target": "es2017",
5
+ "module": "commonjs",
6
+ "strict": true,
7
+ "noImplicitAny": false,
8
+ "resolveJsonModule": true,
9
+ "experimentalDecorators": true,
10
+ "emitDecoratorMetadata": true,
11
+ "charset": "utf8",
12
+ "allowJs": false,
13
+ "pretty": true,
14
+ "noEmitOnError": false,
15
+ "noUnusedLocals": true,
16
+ "noUnusedParameters": true,
17
+ "allowUnreachableCode": false,
18
+ "allowUnusedLabels": false,
19
+ "strictPropertyInitialization": false,
20
+ "noFallthroughCasesInSwitch": true,
21
+ "skipLibCheck": true,
22
+ "skipDefaultLibCheck": true,
23
+ "inlineSourceMap": true,
24
+ "importHelpers": true
25
+ },
26
+ "exclude": [
27
+ "app/public",
28
+ "app/views",
29
+ "node_modules*"
30
+ ]
31
+ }
@@ -1,3 +1,3 @@
1
- {
2
- "extends": "./vue.json"
3
- }
1
+ {
2
+ "extends": "./vue.json"
3
+ }
@@ -1,15 +1,15 @@
1
- {
2
- "extends": "./recommended.json",
3
- "compilerOptions": {
4
- "target": "ES5",
5
- "module": "commonjs",
6
- "outDir": "./lib",
7
- "baseUrl": ".",
8
- "strictNullChecks": true,
9
- "declaration": true,
10
- "noImplicitAny": true,
11
- "sourceMap": true
12
- },
13
- "include": ["src"],
14
- "exclude": ["node_modules", "test"]
15
- }
1
+ {
2
+ "extends": "./recommended.json",
3
+ "compilerOptions": {
4
+ "target": "ES5",
5
+ "module": "commonjs",
6
+ "outDir": "./lib",
7
+ "baseUrl": ".",
8
+ "strictNullChecks": true,
9
+ "declaration": true,
10
+ "noImplicitAny": true,
11
+ "sourceMap": true
12
+ },
13
+ "include": ["src"],
14
+ "exclude": ["node_modules", "test"]
15
+ }
@@ -1,25 +1,25 @@
1
- {
2
- "compilerOptions": {
3
- "allowJs": true,
4
- "esModuleInterop": true,
5
- "module": "esnext",
6
- "moduleResolution": "node",
7
- "noEmit": true,
8
- "resolveJsonModule": true,
9
- "experimentalDecorators": true,
10
- "sourceMap": true,
11
- "strict": true,
12
- "target": "es6",
13
- "paths": {
14
- "src/*": ["src/*"],
15
- "app/*": ["*"],
16
- "components/*": ["src/components/*"],
17
- "layouts/*": ["src/layouts/*"],
18
- "pages/*": ["src/pages/*"],
19
- "assets/*": ["src/assets/*"],
20
- "boot/*": ["src/boot/*"]
21
- },
22
- "types": ["quasar"]
23
- },
24
- "exclude": ["/dist", ".quasar", "node_modules"]
25
- }
1
+ {
2
+ "compilerOptions": {
3
+ "allowJs": true,
4
+ "esModuleInterop": true,
5
+ "module": "esnext",
6
+ "moduleResolution": "node",
7
+ "noEmit": true,
8
+ "resolveJsonModule": true,
9
+ "experimentalDecorators": true,
10
+ "sourceMap": true,
11
+ "strict": true,
12
+ "target": "es6",
13
+ "paths": {
14
+ "src/*": ["src/*"],
15
+ "app/*": ["*"],
16
+ "components/*": ["src/components/*"],
17
+ "layouts/*": ["src/layouts/*"],
18
+ "pages/*": ["src/pages/*"],
19
+ "assets/*": ["src/assets/*"],
20
+ "boot/*": ["src/boot/*"]
21
+ },
22
+ "types": ["quasar"]
23
+ },
24
+ "exclude": ["/dist", ".quasar", "node_modules"]
25
+ }
@@ -1,23 +1,23 @@
1
- {
2
- "compilerOptions": {
3
- "target": "es2015",
4
- "module": "esnext",
5
- "strict": true,
6
- "jsx": "preserve",
7
- "noImplicitAny": false,
8
- "importHelpers": true,
9
- "resolveJsonModule": true,
10
- "moduleResolution": "node",
11
- "experimentalDecorators": true,
12
- "esModuleInterop": true,
13
- "allowSyntheticDefaultImports": true,
14
- "sourceMap": true,
15
- "types": ["webpack-env", "node", "jest"],
16
- "paths": {
17
- "@/*": ["./*"]
18
- },
19
- "lib": ["esnext", "dom", "dom.iterable", "scripthost"]
20
- },
21
- "include": ["src/**/*.ts", "src/**/*.tsx", "src/**/*.vue", "tests/**/*.ts", "tests/**/*.tsx", "src/*.ts"],
22
- "exclude": ["node_modules"]
23
- }
1
+ {
2
+ "compilerOptions": {
3
+ "target": "es2015",
4
+ "module": "esnext",
5
+ "strict": true,
6
+ "jsx": "preserve",
7
+ "noImplicitAny": false,
8
+ "importHelpers": true,
9
+ "resolveJsonModule": true,
10
+ "moduleResolution": "node",
11
+ "experimentalDecorators": true,
12
+ "esModuleInterop": true,
13
+ "allowSyntheticDefaultImports": true,
14
+ "sourceMap": true,
15
+ "types": ["webpack-env", "node", "jest"],
16
+ "paths": {
17
+ "@/*": ["./*"]
18
+ },
19
+ "lib": ["esnext", "dom", "dom.iterable", "scripthost"]
20
+ },
21
+ "include": ["src/**/*.ts", "src/**/*.tsx", "src/**/*.vue", "tests/**/*.ts", "tests/**/*.tsx", "src/*.ts"],
22
+ "exclude": ["node_modules"]
23
+ }
@@ -1,23 +1,23 @@
1
- {
2
- "compilerOptions": {
3
- "esModuleInterop": true,
4
- "module": "commonjs",
5
- "declaration": true,
6
- "resolveJsonModule": true,
7
- "removeComments": true,
8
- "emitDecoratorMetadata": true,
9
- "experimentalDecorators": true,
10
- "allowSyntheticDefaultImports": true,
11
- "target": "es2017",
12
- "sourceMap": true,
13
- "outDir": "./dist",
14
- "baseUrl": "./",
15
- "incremental": true,
16
- "skipLibCheck": true,
17
- "strictNullChecks": false,
18
- "noImplicitAny": false,
19
- "strictBindCallApply": false,
20
- "forceConsistentCasingInFileNames": false,
21
- "noFallthroughCasesInSwitch": false
22
- }
23
- }
1
+ {
2
+ "compilerOptions": {
3
+ "esModuleInterop": true,
4
+ "module": "commonjs",
5
+ "declaration": true,
6
+ "resolveJsonModule": true,
7
+ "removeComments": true,
8
+ "emitDecoratorMetadata": true,
9
+ "experimentalDecorators": true,
10
+ "allowSyntheticDefaultImports": true,
11
+ "target": "es2017",
12
+ "sourceMap": true,
13
+ "outDir": "./dist",
14
+ "baseUrl": "./",
15
+ "incremental": true,
16
+ "skipLibCheck": true,
17
+ "strictNullChecks": false,
18
+ "noImplicitAny": false,
19
+ "strictBindCallApply": false,
20
+ "forceConsistentCasingInFileNames": false,
21
+ "noFallthroughCasesInSwitch": false
22
+ }
23
+ }
@@ -1,39 +1,39 @@
1
- {
2
- "compilerOptions": {
3
- "target": "es5",
4
- "module": "esnext",
5
- "strict": true,
6
- "jsx": "preserve",
7
- "importHelpers": true,
8
- "moduleResolution": "node",
9
- "resolveJsonModule": true,
10
- "esModuleInterop": true,
11
- "allowSyntheticDefaultImports": true,
12
- "experimentalDecorators":true,
13
- "sourceMap": true,
14
- "baseUrl": ".",
15
- "types": [
16
- "node",
17
- "webpack-env",
18
- "jest",
19
- "@dcloudio/types/uni-app"
20
- ],
21
- "paths": {
22
- "@/*": [
23
- "./src/*"
24
- ]
25
- },
26
- "lib": [
27
- "esnext",
28
- "dom",
29
- "dom.iterable",
30
- "scripthost"
31
- ]
32
- },
33
- "exclude": [
34
- "vendor",
35
- "node_modules",
36
- "unpackage",
37
- "src/**/*.nvue"
38
- ]
39
- }
1
+ {
2
+ "compilerOptions": {
3
+ "target": "es5",
4
+ "module": "esnext",
5
+ "strict": true,
6
+ "jsx": "preserve",
7
+ "importHelpers": true,
8
+ "moduleResolution": "node",
9
+ "resolveJsonModule": true,
10
+ "esModuleInterop": true,
11
+ "allowSyntheticDefaultImports": true,
12
+ "experimentalDecorators":true,
13
+ "sourceMap": true,
14
+ "baseUrl": ".",
15
+ "types": [
16
+ "node",
17
+ "webpack-env",
18
+ "jest",
19
+ "@dcloudio/types/uni-app"
20
+ ],
21
+ "paths": {
22
+ "@/*": [
23
+ "./src/*"
24
+ ]
25
+ },
26
+ "lib": [
27
+ "esnext",
28
+ "dom",
29
+ "dom.iterable",
30
+ "scripthost"
31
+ ]
32
+ },
33
+ "exclude": [
34
+ "vendor",
35
+ "node_modules",
36
+ "unpackage",
37
+ "src/**/*.nvue"
38
+ ]
39
+ }
@@ -1,45 +1,45 @@
1
- {
2
- "compilerOptions": {
3
- "target": "esnext",
4
- "module": "esnext",
5
- "strict": true,
6
- "jsx": "preserve",
7
- "importHelpers": true,
8
- "skipLibCheck": true,
9
- "noEmitOnError": true,
10
- "moduleResolution": "node",
11
- "resolveJsonModule": true,
12
- "experimentalDecorators": true,
13
- "esModuleInterop": true,
14
- "allowSyntheticDefaultImports": true,
15
- "sourceMap": true,
16
- "baseUrl": ".",
17
- "types": [
18
- "node",
19
- "jest",
20
- "webpack-env"
21
- ],
22
- "paths": {
23
- "@/*": [
24
- "src/*"
25
- ]
26
- },
27
- "lib": [
28
- "esnext",
29
- "dom",
30
- "dom.iterable",
31
- "scripthost"
32
- ]
33
- },
34
- "include": [
35
- "src/**/*.d.ts",
36
- "src/**/*.ts",
37
- "src/**/*.tsx",
38
- "src/**/*.vue",
39
- "tests/**/*.ts",
40
- "tests/**/*.tsx"
41
- ],
42
- "exclude": [
43
- "node_modules"
44
- ]
45
- }
1
+ {
2
+ "compilerOptions": {
3
+ "target": "esnext",
4
+ "module": "esnext",
5
+ "strict": true,
6
+ "jsx": "preserve",
7
+ "importHelpers": true,
8
+ "skipLibCheck": true,
9
+ "noEmitOnError": true,
10
+ "moduleResolution": "node",
11
+ "resolveJsonModule": true,
12
+ "experimentalDecorators": true,
13
+ "esModuleInterop": true,
14
+ "allowSyntheticDefaultImports": true,
15
+ "sourceMap": true,
16
+ "baseUrl": ".",
17
+ "types": [
18
+ "node",
19
+ "jest",
20
+ "webpack-env"
21
+ ],
22
+ "paths": {
23
+ "@/*": [
24
+ "src/*"
25
+ ]
26
+ },
27
+ "lib": [
28
+ "esnext",
29
+ "dom",
30
+ "dom.iterable",
31
+ "scripthost"
32
+ ]
33
+ },
34
+ "include": [
35
+ "src/**/*.d.ts",
36
+ "src/**/*.ts",
37
+ "src/**/*.tsx",
38
+ "src/**/*.vue",
39
+ "tests/**/*.ts",
40
+ "tests/**/*.tsx"
41
+ ],
42
+ "exclude": [
43
+ "node_modules"
44
+ ]
45
+ }
@@ -1,13 +1,13 @@
1
- {
2
- "defaultSeverity": "error",
3
- "extends": ["tslint:recommended"],
4
- "jsRules": {},
5
- "rules": {
6
- "semi": ["error", "always"],
7
- "object-literal-sort-keys": false,
8
- "no-console": false,
9
- "quotemark": [true, "single", "jsx-single"],
10
- "no-unused-variable": false
11
- },
12
- "rulesDirectory": []
13
- }
1
+ {
2
+ "defaultSeverity": "error",
3
+ "extends": ["tslint:recommended"],
4
+ "jsRules": {},
5
+ "rules": {
6
+ "semi": ["error", "always"],
7
+ "object-literal-sort-keys": false,
8
+ "no-console": false,
9
+ "quotemark": [true, "single", "jsx-single"],
10
+ "no-unused-variable": false
11
+ },
12
+ "rulesDirectory": []
13
+ }
package/test-duration.js CHANGED
@@ -1,33 +1,33 @@
1
- const { default: durationFormat } = require('./lib/formats/duration.format');
2
-
3
- console.log('Testing durationFormat...');
4
-
5
- // 测试中文格式
6
- console.log('中文格式测试:');
7
- console.log('0秒:', durationFormat.format(0));
8
- console.log('34秒:', durationFormat.format(34));
9
- console.log('3分0秒:', durationFormat.format(180));
10
- console.log('4小时0分0秒:', durationFormat.format(14400));
11
- console.log('1天12小时0分0秒:', durationFormat.format(129600));
12
- console.log('1年0天2小时3分3秒:', durationFormat.format(31536000 + 7200 + 180 + 3));
13
-
14
- // 测试英文格式
15
- console.log('\n英文格式测试:');
16
- console.log('0s:', durationFormat.format(0, { locale: 'en' }));
17
- console.log('34s:', durationFormat.format(34, { locale: 'en' }));
18
- console.log('3m0s:', durationFormat.format(180, { locale: 'en' }));
19
- console.log('4h0m0s:', durationFormat.format(14400, { locale: 'en' }));
20
- console.log('1d12h0m0s:', durationFormat.format(129600, { locale: 'en' }));
21
- console.log('1y0d2h3m3s:', durationFormat.format(31536000 + 7200 + 180 + 3, { locale: 'en' }));
22
-
23
- // 测试负数情况
24
- console.log('\n负数情况测试:');
25
- console.log('负数:', durationFormat.format(-1));
26
-
27
- // 测试short格式化
28
- console.log('\nshort格式化测试:');
29
- console.log('34s:', durationFormat.format(34, { formatter: 'short' }));
30
- console.log('3m0s:', durationFormat.format(180, { formatter: 'short' }));
31
- console.log('4h0m0s:', durationFormat.format(14400, { formatter: 'short' }));
32
-
33
- console.log('\n测试完成!');
1
+ const { default: durationFormat } = require('./lib/formats/duration.format');
2
+
3
+ console.log('Testing durationFormat...');
4
+
5
+ // 测试中文格式
6
+ console.log('中文格式测试:');
7
+ console.log('0秒:', durationFormat.format(0));
8
+ console.log('34秒:', durationFormat.format(34));
9
+ console.log('3分0秒:', durationFormat.format(180));
10
+ console.log('4小时0分0秒:', durationFormat.format(14400));
11
+ console.log('1天12小时0分0秒:', durationFormat.format(129600));
12
+ console.log('1年0天2小时3分3秒:', durationFormat.format(31536000 + 7200 + 180 + 3));
13
+
14
+ // 测试英文格式
15
+ console.log('\n英文格式测试:');
16
+ console.log('0s:', durationFormat.format(0, { locale: 'en' }));
17
+ console.log('34s:', durationFormat.format(34, { locale: 'en' }));
18
+ console.log('3m0s:', durationFormat.format(180, { locale: 'en' }));
19
+ console.log('4h0m0s:', durationFormat.format(14400, { locale: 'en' }));
20
+ console.log('1d12h0m0s:', durationFormat.format(129600, { locale: 'en' }));
21
+ console.log('1y0d2h3m3s:', durationFormat.format(31536000 + 7200 + 180 + 3, { locale: 'en' }));
22
+
23
+ // 测试负数情况
24
+ console.log('\n负数情况测试:');
25
+ console.log('负数:', durationFormat.format(-1));
26
+
27
+ // 测试short格式化
28
+ console.log('\nshort格式化测试:');
29
+ console.log('34s:', durationFormat.format(34, { formatter: 'short' }));
30
+ console.log('3m0s:', durationFormat.format(180, { formatter: 'short' }));
31
+ console.log('4h0m0s:', durationFormat.format(14400, { formatter: 'short' }));
32
+
33
+ console.log('\n测试完成!');
package/tsconfig.json CHANGED
@@ -1,9 +1,9 @@
1
- {
2
- "extends": "./templates/tsconfigs/lib.json",
3
- "compilerOptions": {
4
- "outDir": "./lib",
5
- "baseUrl": ".",
6
- },
7
- "include": ["src"],
8
- "exclude": ["node_modules", "tests"]
9
- }
1
+ {
2
+ "extends": "./templates/tsconfigs/lib.json",
3
+ "compilerOptions": {
4
+ "outDir": "./lib",
5
+ "baseUrl": ".",
6
+ },
7
+ "include": ["src"],
8
+ "exclude": ["node_modules", "tests"]
9
+ }