xenopomp-essentials 0.3.1 → 0.3.3

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 (143) hide show
  1. package/.config/.lintstagedrc.json +3 -0
  2. package/.config/build.config.ts +41 -0
  3. package/.config/testing-exclusions/index.ts +2 -0
  4. package/.config/testing-exclusions/istanbul-exclusions.ts +1 -0
  5. package/.config/testing-exclusions/vitest-exclusions.ts +8 -0
  6. package/.config/ts/tsconfig.lint.json +10 -0
  7. package/.config/vitest.config.ts +18 -0
  8. package/.gitattributes +25 -0
  9. package/.github/workflows/ci.yml +54 -0
  10. package/.github/workflows/npm-publish.yml +27 -0
  11. package/.husky/pre-commit +1 -0
  12. package/.idea/codeStyles/Project.xml +59 -0
  13. package/.idea/codeStyles/codeStyleConfig.xml +5 -0
  14. package/.idea/inspectionProfiles/Project_Default.xml +6 -0
  15. package/.idea/modules.xml +8 -0
  16. package/.idea/prettier.xml +7 -0
  17. package/.idea/runConfigurations/_template__of_Vitest.xml +9 -0
  18. package/.idea/runConfigurations/build.xml +13 -0
  19. package/.idea/runConfigurations/coverage.xml +12 -0
  20. package/.idea/runConfigurations/lint.xml +13 -0
  21. package/.idea/runConfigurations/lint_code.xml +13 -0
  22. package/.idea/vcs.xml +6 -0
  23. package/.idea/xenopomp-essentials-js.iml +14 -0
  24. package/.prettierrc +20 -0
  25. package/.yarnrc +2 -0
  26. package/README.md +0 -0
  27. package/__tests__/assets/assertions/expect-deep-equal.ts +14 -0
  28. package/__tests__/assets/assertions/expect-to-render.ts +26 -0
  29. package/__tests__/assets/assertions/index.ts +3 -0
  30. package/__tests__/assets/assertions/not-throwing.ts +6 -0
  31. package/__tests__/assets/index.ts +1 -0
  32. package/__tests__/data/index.ts +1 -0
  33. package/__tests__/data/parseVersion.data.ts +52 -0
  34. package/__tests__/unit/cli/path-builder.test.ts +39 -0
  35. package/__tests__/unit/components/hoc/jsx-dot-notation/component.test-source.tsx +24 -0
  36. package/__tests__/unit/components/hoc/jsx-dot-notation/hoc.test.tsx +11 -0
  37. package/__tests__/unit/components/metrika.test.tsx +14 -0
  38. package/__tests__/unit/components/react-scan.test.tsx +10 -0
  39. package/__tests__/unit/eslint/config.test.tsx +41 -0
  40. package/__tests__/unit/utils/capitalize.test.ts +17 -0
  41. package/__tests__/unit/utils/minmax.test.ts +21 -0
  42. package/__tests__/unit/utils/parseVersion.test.ts +22 -0
  43. package/__tests__/unit/utils/pipe.test.ts +23 -0
  44. package/__tests__/unit/utils/transliterate.test.ts +17 -0
  45. package/_templates/generator/help/index.ejs.t +5 -0
  46. package/_templates/generator/new/hello.ejs.t +18 -0
  47. package/_templates/generator/with-prompt/hello.ejs.t +18 -0
  48. package/_templates/generator/with-prompt/prompt.ejs.t +14 -0
  49. package/_templates/init/repo/new-repo.ejs.t +4 -0
  50. package/_templates/type/new/module.ejs.t +7 -0
  51. package/_templates/type/new/type.ejs.t +7 -0
  52. package/_templates/util/new/func.ejs.t +7 -0
  53. package/_templates/util/new/module.ejs.t +7 -0
  54. package/_templates/util/new/test.ejs.t +13 -0
  55. package/eslint.config.ts +17 -0
  56. package/package.json +4 -3
  57. package/src/cli-tools/changeFile.ts +1 -0
  58. package/src/cli-tools/index.ts +2 -0
  59. package/src/cli-tools/pathBuilder.ts +89 -0
  60. package/src/eslint/config.ts +145 -0
  61. package/src/eslint/configs/all.ts +74 -0
  62. package/src/eslint/configs/deprecation.ts +33 -0
  63. package/src/eslint/configs/index.ts +7 -0
  64. package/src/eslint/configs/markdown.ts +30 -0
  65. package/src/eslint/configs/next.ts +40 -0
  66. package/src/eslint/configs/old.ts +67 -0
  67. package/src/eslint/configs/prettier.ts +6 -0
  68. package/src/eslint/configs/react.ts +18 -0
  69. package/src/eslint/index.ts +7 -0
  70. package/src/eslint/prefixes/author.ts +2 -0
  71. package/src/eslint/prefixes/index.ts +1 -0
  72. package/src/eslint/types/configs.ts +4 -0
  73. package/src/eslint/types/custom-config.ts +4 -0
  74. package/src/eslint/types/index.ts +2 -0
  75. package/src/index.ts +3 -0
  76. package/src/next/Metrika/Metrika.props.ts +11 -0
  77. package/src/next/Metrika/Metrika.tsx +56 -0
  78. package/src/next/ReactScan/ReactScan.tsx +33 -0
  79. package/src/next/index.ts +2 -0
  80. package/src/react/hoc/index.ts +1 -0
  81. package/src/react/hoc/jsxDotNotation.tsx +38 -0
  82. package/src/react/index.ts +1 -0
  83. package/src/repo-eslint-rules/deep-type-naming.rule.ts +49 -0
  84. package/src/repo-eslint-rules/index.ts +9 -0
  85. package/src/schemas/import-meta.schema.ts +12 -0
  86. package/src/schemas/index.ts +1 -0
  87. package/src/types/aliases/AnyObject.ts +5 -0
  88. package/src/types/aliases/EmptyObject.ts +8 -0
  89. package/src/types/aliases/Fn.ts +12 -0
  90. package/src/types/aliases/index.ts +3 -0
  91. package/src/types/index.ts +4 -0
  92. package/src/types/next/NextParams.ts +26 -0
  93. package/src/types/next/index.ts +1 -0
  94. package/src/types/react/AnyFc.ts +6 -0
  95. package/src/types/react/AsyncFC.ts +16 -0
  96. package/src/types/react/DataAttributes.ts +21 -0
  97. package/src/types/react/FCProps.ts +19 -0
  98. package/src/types/react/FunctionalChildren.ts +13 -0
  99. package/src/types/react/SetState.ts +11 -0
  100. package/src/types/react/VariableFC.ts +48 -0
  101. package/src/types/react/VariableProps.ts +9 -0
  102. package/src/types/react/index.ts +8 -0
  103. package/src/types/utilities/ArrayType.ts +12 -0
  104. package/src/types/utilities/AsyncReturnType.ts +14 -0
  105. package/src/types/utilities/DeepInject.ts +22 -0
  106. package/src/types/utilities/Defined.ts +5 -0
  107. package/src/types/utilities/Jsonish.ts +11 -0
  108. package/src/types/utilities/LenientAutocomplete.ts +24 -0
  109. package/src/types/utilities/MatchType.ts +26 -0
  110. package/src/types/utilities/MergeTypes.ts +12 -0
  111. package/src/types/utilities/Modify.ts +10 -0
  112. package/src/types/utilities/Nullable.ts +5 -0
  113. package/src/types/utilities/OneOf.ts +42 -0
  114. package/src/types/utilities/Prettify.ts +15 -0
  115. package/src/types/utilities/RecordKey.ts +9 -0
  116. package/src/types/utilities/RecordValue.ts +9 -0
  117. package/src/types/utilities/ReplaceReturnType.ts +10 -0
  118. package/src/types/utilities/SelectivePartial.ts +17 -0
  119. package/src/types/utilities/StrictOmit.ts +19 -0
  120. package/src/types/utilities/Synchronous.ts +18 -0
  121. package/src/types/utilities/Undefinable.ts +5 -0
  122. package/src/types/utilities/WeakOmit.ts +17 -0
  123. package/src/types/utilities/Writeable.ts +18 -0
  124. package/src/types/utilities/index.ts +24 -0
  125. package/src/utils/capitalize.ts +15 -0
  126. package/src/utils/index.ts +7 -0
  127. package/src/utils/minmax.ts +35 -0
  128. package/src/utils/parseVersion.ts +42 -0
  129. package/src/utils/pipe.ts +29 -0
  130. package/src/utils/transliterate.ts +8 -0
  131. package/tsconfig.json +43 -0
  132. package/cli-tools/index.d.mts +0 -60
  133. package/cli-tools/index.d.ts +0 -60
  134. package/cli-tools/index.mjs +0 -1
  135. package/eslint/index.d.mts +0 -39
  136. package/eslint/index.d.ts +0 -39
  137. package/eslint/index.mjs +0 -3
  138. package/index.d.mts +0 -611
  139. package/index.d.ts +0 -611
  140. package/index.mjs +0 -1
  141. package/next/index.d.mts +0 -67
  142. package/next/index.d.ts +0 -67
  143. package/next/index.mjs +0 -11
@@ -1,60 +0,0 @@
1
- /**
2
- * Fluent interface for creating paths of application.
3
- *
4
- * @since 0.0.1
5
- *
6
- * @example
7
- * import { PathBuilder } from 'xenopomp-essentials/cli-tools';
8
- *
9
- * const builder = new PathBuilder();
10
- *
11
- * const res = builder
12
- * .appSource()
13
- * .cd('./dist/src')
14
- * .file('.prettierrc')
15
- * .build();
16
- *
17
- * console.log(res); //? C:/Projects/example/node_modules/xenopomp-essentials/dist/src/.prettierrc
18
- */
19
- declare class PathBuilder {
20
- private paths;
21
- private pushPaths;
22
- /**
23
- * Pushes any custom paths to builder.
24
- * @since 0.0.1
25
- * @param paths
26
- */
27
- cd(...paths: string[]): PathBuilder;
28
- /**
29
- * Pushes filename to paths.
30
- * @since 0.0.1
31
- * @param fileName
32
- */
33
- file<T extends `${string}.${string}`>(fileName: T): PathBuilder;
34
- /**
35
- * Pushes path to compiled app directory.
36
- * Is useful for cli tools that have to access files inside their bundles.
37
- *
38
- * It probably may take no effect (if import.meta is not available in a scope).
39
- * If it is, will push cwd.
40
- *
41
- * @since 0.0.1
42
- */
43
- appSource(): PathBuilder;
44
- /**
45
- * Gets path of directory where script is running. In cli tools it access
46
- * path, where cli tool was started.
47
- * @since 0.0.1
48
- */
49
- cwd(): PathBuilder;
50
- /**
51
- * @since 0.0.1
52
- */
53
- clear(): PathBuilder;
54
- /**
55
- * @since 0.0.1
56
- */
57
- build(): string;
58
- }
59
-
60
- export { PathBuilder };
@@ -1 +0,0 @@
1
- import s from"node:path";import{z as r}from"zod";const i=r.object({dirname:r.string().optional()}),h=i.parse(import.meta);class a{paths=[];pushPaths(...t){return this.paths.push(...t),this}cd(...t){return this.pushPaths(...t)}file(t){return this.pushPaths(`./${t}`)}appSource(){return h.dirname?this.pushPaths(s.join(s.dirname(h.dirname),"../")):this.cwd()}cwd(){return this.pushPaths(process.cwd())}clear(){return this.paths=[],this}build(){return s.join(...this.paths)}}export{a as PathBuilder};
@@ -1,39 +0,0 @@
1
- import { antfu, OptionsConfig, TypedFlatConfigItem } from '@antfu/eslint-config';
2
- import { Linter } from 'eslint';
3
-
4
- interface CustomConfig {
5
- all?: boolean;
6
- next?: boolean;
7
- }
8
-
9
- type UserConfigItem = Parameters<typeof antfu>[1];
10
- type Configs = ReturnType<typeof antfu>;
11
-
12
- interface CustomOptions {
13
- deprecation?: Linter.RuleEntry;
14
- tsconfigPath?: string;
15
- }
16
- type Options = OptionsConfig & CustomConfig & TypedFlatConfigItem & CustomOptions;
17
- /**
18
- * XenoPOMP`s default ESLint config. Uses @antfu/eslint-config under the hood.
19
- *
20
- * @param options
21
- * @param userConfigs
22
- *
23
- * @example
24
- * export default xenopomp(
25
- * // Setup antfu config
26
- * {
27
- * react: true,
28
- * next: false,
29
- * },
30
- * // User configs
31
- * {
32
- * name: 'My custom config',
33
- * rules: { ... }
34
- * },
35
- * );
36
- */
37
- declare function xenopomp(options?: Options, ...userConfigs: UserConfigItem[]): Configs;
38
-
39
- export { type Configs, type CustomConfig, type Options, type UserConfigItem, xenopomp as default };
package/eslint/index.d.ts DELETED
@@ -1,39 +0,0 @@
1
- import { antfu, OptionsConfig, TypedFlatConfigItem } from '@antfu/eslint-config';
2
- import { Linter } from 'eslint';
3
-
4
- interface CustomConfig {
5
- all?: boolean;
6
- next?: boolean;
7
- }
8
-
9
- type UserConfigItem = Parameters<typeof antfu>[1];
10
- type Configs = ReturnType<typeof antfu>;
11
-
12
- interface CustomOptions {
13
- deprecation?: Linter.RuleEntry;
14
- tsconfigPath?: string;
15
- }
16
- type Options = OptionsConfig & CustomConfig & TypedFlatConfigItem & CustomOptions;
17
- /**
18
- * XenoPOMP`s default ESLint config. Uses @antfu/eslint-config under the hood.
19
- *
20
- * @param options
21
- * @param userConfigs
22
- *
23
- * @example
24
- * export default xenopomp(
25
- * // Setup antfu config
26
- * {
27
- * react: true,
28
- * next: false,
29
- * },
30
- * // User configs
31
- * {
32
- * name: 'My custom config',
33
- * rules: { ... }
34
- * },
35
- * );
36
- */
37
- declare function xenopomp(options?: Options, ...userConfigs: UserConfigItem[]): Configs;
38
-
39
- export { type Configs, type CustomConfig, type Options, type UserConfigItem, xenopomp as default };