xenopomp-essentials 0.3.3 → 0.3.4-hotfix.0

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/cli-tools/index.d.mts +60 -0
  2. package/cli-tools/index.d.ts +60 -0
  3. package/cli-tools/index.mjs +1 -0
  4. package/eslint/index.d.mts +39 -0
  5. package/eslint/index.d.ts +39 -0
  6. package/eslint/index.mjs +3 -0
  7. package/index.d.mts +613 -0
  8. package/index.d.ts +613 -0
  9. package/index.mjs +1 -0
  10. package/next/index.d.mts +67 -0
  11. package/next/index.d.ts +67 -0
  12. package/next/index.mjs +11 -0
  13. package/package.json +4 -1
  14. package/.config/.lintstagedrc.json +0 -3
  15. package/.config/build.config.ts +0 -41
  16. package/.config/testing-exclusions/index.ts +0 -2
  17. package/.config/testing-exclusions/istanbul-exclusions.ts +0 -1
  18. package/.config/testing-exclusions/vitest-exclusions.ts +0 -8
  19. package/.config/ts/tsconfig.lint.json +0 -10
  20. package/.config/vitest.config.ts +0 -18
  21. package/.gitattributes +0 -25
  22. package/.github/workflows/ci.yml +0 -54
  23. package/.github/workflows/npm-publish.yml +0 -27
  24. package/.husky/pre-commit +0 -1
  25. package/.idea/codeStyles/Project.xml +0 -59
  26. package/.idea/codeStyles/codeStyleConfig.xml +0 -5
  27. package/.idea/inspectionProfiles/Project_Default.xml +0 -6
  28. package/.idea/modules.xml +0 -8
  29. package/.idea/prettier.xml +0 -7
  30. package/.idea/runConfigurations/_template__of_Vitest.xml +0 -9
  31. package/.idea/runConfigurations/build.xml +0 -13
  32. package/.idea/runConfigurations/coverage.xml +0 -12
  33. package/.idea/runConfigurations/lint.xml +0 -13
  34. package/.idea/runConfigurations/lint_code.xml +0 -13
  35. package/.idea/vcs.xml +0 -6
  36. package/.idea/xenopomp-essentials-js.iml +0 -14
  37. package/.prettierrc +0 -20
  38. package/.yarnrc +0 -2
  39. package/README.md +0 -0
  40. package/__tests__/assets/assertions/expect-deep-equal.ts +0 -14
  41. package/__tests__/assets/assertions/expect-to-render.ts +0 -26
  42. package/__tests__/assets/assertions/index.ts +0 -3
  43. package/__tests__/assets/assertions/not-throwing.ts +0 -6
  44. package/__tests__/assets/index.ts +0 -1
  45. package/__tests__/data/index.ts +0 -1
  46. package/__tests__/data/parseVersion.data.ts +0 -52
  47. package/__tests__/unit/cli/path-builder.test.ts +0 -39
  48. package/__tests__/unit/components/hoc/jsx-dot-notation/component.test-source.tsx +0 -24
  49. package/__tests__/unit/components/hoc/jsx-dot-notation/hoc.test.tsx +0 -11
  50. package/__tests__/unit/components/metrika.test.tsx +0 -14
  51. package/__tests__/unit/components/react-scan.test.tsx +0 -10
  52. package/__tests__/unit/eslint/config.test.tsx +0 -41
  53. package/__tests__/unit/utils/capitalize.test.ts +0 -17
  54. package/__tests__/unit/utils/minmax.test.ts +0 -21
  55. package/__tests__/unit/utils/parseVersion.test.ts +0 -22
  56. package/__tests__/unit/utils/pipe.test.ts +0 -23
  57. package/__tests__/unit/utils/transliterate.test.ts +0 -17
  58. package/_templates/generator/help/index.ejs.t +0 -5
  59. package/_templates/generator/new/hello.ejs.t +0 -18
  60. package/_templates/generator/with-prompt/hello.ejs.t +0 -18
  61. package/_templates/generator/with-prompt/prompt.ejs.t +0 -14
  62. package/_templates/init/repo/new-repo.ejs.t +0 -4
  63. package/_templates/type/new/module.ejs.t +0 -7
  64. package/_templates/type/new/type.ejs.t +0 -7
  65. package/_templates/util/new/func.ejs.t +0 -7
  66. package/_templates/util/new/module.ejs.t +0 -7
  67. package/_templates/util/new/test.ejs.t +0 -13
  68. package/eslint.config.ts +0 -17
  69. package/src/cli-tools/changeFile.ts +0 -1
  70. package/src/cli-tools/index.ts +0 -2
  71. package/src/cli-tools/pathBuilder.ts +0 -89
  72. package/src/eslint/config.ts +0 -145
  73. package/src/eslint/configs/all.ts +0 -74
  74. package/src/eslint/configs/deprecation.ts +0 -33
  75. package/src/eslint/configs/index.ts +0 -7
  76. package/src/eslint/configs/markdown.ts +0 -30
  77. package/src/eslint/configs/next.ts +0 -40
  78. package/src/eslint/configs/old.ts +0 -67
  79. package/src/eslint/configs/prettier.ts +0 -6
  80. package/src/eslint/configs/react.ts +0 -18
  81. package/src/eslint/index.ts +0 -7
  82. package/src/eslint/prefixes/author.ts +0 -2
  83. package/src/eslint/prefixes/index.ts +0 -1
  84. package/src/eslint/types/configs.ts +0 -4
  85. package/src/eslint/types/custom-config.ts +0 -4
  86. package/src/eslint/types/index.ts +0 -2
  87. package/src/index.ts +0 -3
  88. package/src/next/Metrika/Metrika.props.ts +0 -11
  89. package/src/next/Metrika/Metrika.tsx +0 -56
  90. package/src/next/ReactScan/ReactScan.tsx +0 -33
  91. package/src/next/index.ts +0 -2
  92. package/src/react/hoc/index.ts +0 -1
  93. package/src/react/hoc/jsxDotNotation.tsx +0 -38
  94. package/src/react/index.ts +0 -1
  95. package/src/repo-eslint-rules/deep-type-naming.rule.ts +0 -49
  96. package/src/repo-eslint-rules/index.ts +0 -9
  97. package/src/schemas/import-meta.schema.ts +0 -12
  98. package/src/schemas/index.ts +0 -1
  99. package/src/types/aliases/AnyObject.ts +0 -5
  100. package/src/types/aliases/EmptyObject.ts +0 -8
  101. package/src/types/aliases/Fn.ts +0 -12
  102. package/src/types/aliases/index.ts +0 -3
  103. package/src/types/index.ts +0 -4
  104. package/src/types/next/NextParams.ts +0 -26
  105. package/src/types/next/index.ts +0 -1
  106. package/src/types/react/AnyFc.ts +0 -6
  107. package/src/types/react/AsyncFC.ts +0 -16
  108. package/src/types/react/DataAttributes.ts +0 -21
  109. package/src/types/react/FCProps.ts +0 -19
  110. package/src/types/react/FunctionalChildren.ts +0 -13
  111. package/src/types/react/SetState.ts +0 -11
  112. package/src/types/react/VariableFC.ts +0 -48
  113. package/src/types/react/VariableProps.ts +0 -9
  114. package/src/types/react/index.ts +0 -8
  115. package/src/types/utilities/ArrayType.ts +0 -12
  116. package/src/types/utilities/AsyncReturnType.ts +0 -14
  117. package/src/types/utilities/DeepInject.ts +0 -22
  118. package/src/types/utilities/Defined.ts +0 -5
  119. package/src/types/utilities/Jsonish.ts +0 -11
  120. package/src/types/utilities/LenientAutocomplete.ts +0 -24
  121. package/src/types/utilities/MatchType.ts +0 -26
  122. package/src/types/utilities/MergeTypes.ts +0 -12
  123. package/src/types/utilities/Modify.ts +0 -10
  124. package/src/types/utilities/Nullable.ts +0 -5
  125. package/src/types/utilities/OneOf.ts +0 -42
  126. package/src/types/utilities/Prettify.ts +0 -15
  127. package/src/types/utilities/RecordKey.ts +0 -9
  128. package/src/types/utilities/RecordValue.ts +0 -9
  129. package/src/types/utilities/ReplaceReturnType.ts +0 -10
  130. package/src/types/utilities/SelectivePartial.ts +0 -17
  131. package/src/types/utilities/StrictOmit.ts +0 -19
  132. package/src/types/utilities/Synchronous.ts +0 -18
  133. package/src/types/utilities/Undefinable.ts +0 -5
  134. package/src/types/utilities/WeakOmit.ts +0 -17
  135. package/src/types/utilities/Writeable.ts +0 -18
  136. package/src/types/utilities/index.ts +0 -24
  137. package/src/utils/capitalize.ts +0 -15
  138. package/src/utils/index.ts +0 -7
  139. package/src/utils/minmax.ts +0 -35
  140. package/src/utils/parseVersion.ts +0 -42
  141. package/src/utils/pipe.ts +0 -29
  142. package/src/utils/transliterate.ts +0 -8
  143. package/tsconfig.json +0 -43
@@ -0,0 +1,67 @@
1
+ import { FC } from 'react';
2
+
3
+ /**
4
+ * Adds react-scan to your Next.js application.
5
+ * @constructor
6
+ * @since 0.0.1
7
+ *
8
+ * @example
9
+ * import { ReactScan } from 'xenopomp-essentials/next';
10
+ *
11
+ * export default function RootLayout({
12
+ * children,
13
+ * }: {
14
+ * children: React.ReactNode
15
+ * }) {
16
+ * return (
17
+ * <html lang="en">
18
+ * <head>
19
+ * <ReactScan />
20
+ * </head>
21
+ * <body>{children}</body>
22
+ * </html>
23
+ * )
24
+ *}
25
+ */
26
+ declare const ReactScan: FC<unknown>;
27
+
28
+ interface MetrikaProps {
29
+ /**
30
+ * ID of your Yandex.Metrika`s counter.
31
+ * Locate at dashboard.
32
+ */
33
+ id: number;
34
+ clickMap?: boolean;
35
+ trackLinks?: boolean;
36
+ accurateTrackBounce?: boolean;
37
+ }
38
+
39
+ /**
40
+ * This component allows you to use Yandex.Metrika
41
+ * in your Next.js projects.
42
+ *
43
+ * @since 0.0.1
44
+ *
45
+ * @example
46
+ * import { Metrika } from 'xenopomp-essentials/next';
47
+ *
48
+ * export default function RootLayout({
49
+ * children,
50
+ * }: {
51
+ * children: React.ReactNode
52
+ * }) {
53
+ * return (
54
+ * <html lang="en">
55
+ * <head>
56
+ * <Metrika id={123456789} />
57
+ * </head>
58
+ * <body>{children}</body>
59
+ * </html>
60
+ * )
61
+ * }
62
+ *
63
+ * @see https://metrika.yandex.ru
64
+ */
65
+ declare const Metrika: FC<MetrikaProps>;
66
+
67
+ export { Metrika, ReactScan };
package/next/index.mjs ADDED
@@ -0,0 +1,11 @@
1
+ import r from"next/script";const n=()=>React.createElement("script",{src:"https://unpkg.com/react-scan/dist/auto.global.js",async:!0}),i=({id:t,clickMap:e=!0,trackLinks:a=!0,accurateTrackBounce:c=!0})=>React.createElement(r,{id:"metrika-counter",strategy:"afterInteractive"},` (function(m,e,t,r,i,k,a){m[i]=m[i]||function(){(m[i].a=m[i].a||[]).push(arguments)};
2
+ m[i].l=1*new Date();
3
+ for (var j = 0; j < document.scripts.length; j++) {if (document.scripts[j].src === r) { return; }}
4
+ k=e.createElement(t),a=e.getElementsByTagName(t)[0],k.async=1,k.src=r,a.parentNode.insertBefore(k,a)})
5
+ (window, document, "script", "https://mc.yandex.ru/metrika/tag.js", "ym");
6
+
7
+ ym(${t}, "init", {
8
+ clickmap:${e},
9
+ trackLinks:${a},
10
+ accurateTrackBounce:${c}
11
+ });`);export{i as Metrika,n as ReactScan};
package/package.json CHANGED
@@ -1,10 +1,13 @@
1
1
  {
2
2
  "name": "xenopomp-essentials",
3
- "version": "0.3.3",
3
+ "version": "0.3.4-hotfix.0",
4
4
  "author": "XenoPOMP <101574433+XenoPOMP@users.noreply.github.com>",
5
5
  "license": "MIT",
6
6
  "type": "module",
7
7
  "private": false,
8
+ "publishConfig": {
9
+ "tag": "hotfix"
10
+ },
8
11
  "repository": {
9
12
  "type": "git",
10
13
  "url": "https://github.com/XenoPOMP/xenopomp-essentials-js.git"
@@ -1,3 +0,0 @@
1
- {
2
- "**/*.{js,ts,jsx,tsx}": "yarn lint:code"
3
- }
@@ -1,41 +0,0 @@
1
- import { copyFile } from 'node:fs/promises';
2
- import path from 'node:path';
3
- import { defineBuildConfig } from 'unbuild';
4
-
5
- export default defineBuildConfig([
6
- {
7
- entries: [
8
- // Main entry
9
- './src/index.ts',
10
-
11
- // Type declarations
12
- {
13
- builder: 'mkdist',
14
- input: './src/declarations',
15
- outDir: './dist/declarations',
16
- },
17
-
18
- // Modules that are not to be exported from main module
19
- './src/next/index.ts',
20
- './src/cli-tools/index.ts',
21
- './src/eslint/index.ts',
22
- ],
23
- outDir: './dist',
24
- failOnWarn: false,
25
- declaration: true,
26
- alias: {
27
- '@': path.resolve(__dirname, '../', './src'),
28
- '@test': path.resolve(__dirname, '../', './__tests__'),
29
- },
30
- rollup: {
31
- esbuild: {
32
- minify: true,
33
- },
34
- },
35
- hooks: {
36
- 'build:done': async () => {
37
- await copyFile('./package.json', './dist/package.json');
38
- },
39
- },
40
- },
41
- ]);
@@ -1,2 +0,0 @@
1
- export * from './vitest-exclusions';
2
- export * from './istanbul-exclusions';
@@ -1 +0,0 @@
1
- export const istanbulExclusions: string[] = [];
@@ -1,8 +0,0 @@
1
- import { configDefaults } from 'vitest/config';
2
-
3
- export const vitestExclusions: string[] = [
4
- ...configDefaults.exclude,
5
- '.config',
6
- '__tests__/{assets,data}',
7
- '__tests__/**/*.test-source.*',
8
- ];
@@ -1,10 +0,0 @@
1
- {
2
- "extends": "../../tsconfig.json",
3
- "include": [
4
- "../../**/*.ts",
5
- "../../**/*.tsx",
6
- "../../**/.config/**/*.ts",
7
- "../../**/__tests__/**/*.ts",
8
- ],
9
- "exclude": ["node_modules"]
10
- }
@@ -1,18 +0,0 @@
1
- import react from '@vitejs/plugin-react';
2
- import tsconfigPathsPlugin from 'vite-tsconfig-paths';
3
- import { defineConfig } from 'vitest/config';
4
-
5
- import { istanbulExclusions, vitestExclusions } from './testing-exclusions';
6
-
7
- export default defineConfig({
8
- plugins: [react(), tsconfigPathsPlugin()],
9
- test: {
10
- environment: 'jsdom',
11
- exclude: vitestExclusions,
12
- coverage: {
13
- provider: 'istanbul',
14
- reporter: ['text', 'json', 'json-summary', 'html'],
15
- exclude: [...vitestExclusions, ...istanbulExclusions],
16
- },
17
- },
18
- });
package/.gitattributes DELETED
@@ -1,25 +0,0 @@
1
- # Auto detect text files and perform LF normalization
2
- * text eol=lf
3
-
4
- .nvmrc text
5
-
6
- # Binary files should be encoded as binary
7
- *.png binary
8
- *.jpg binary
9
- *.jpeg binary
10
- *.gif binary
11
- *.ico binary
12
- *.mov binary
13
- *.mp4 binary
14
- *.mp3 binary
15
- *.flv binary
16
- *.fla binary
17
- *.swf binary
18
- *.gz binary
19
- *.zip binary
20
- *.7z binary
21
- *.ttf binary
22
- *.eot binary
23
- *.woff binary
24
- *.pyc binary
25
- *.pdf binary
@@ -1,54 +0,0 @@
1
- name: 'CI'
2
- on:
3
- push:
4
- branches:
5
- - main
6
- - master
7
-
8
- pull_request:
9
- branches:
10
- - main
11
- - master
12
-
13
- jobs:
14
- # Install Node.js and dependencies
15
- ci:
16
- strategy:
17
- matrix:
18
- NODE_VERSION:
19
- - '20'
20
- - '22'
21
-
22
- runs-on: ubuntu-latest
23
- permissions:
24
- contents: read
25
- pull-requests: write
26
-
27
- steps:
28
- - uses: mstachniuk/ci-skip@v1
29
- with:
30
- commit-filter: '[skip ci]'
31
-
32
- - uses: actions/checkout@v4
33
-
34
- - name: '🧩 Install Node (${{ matrix.NODE_VERSION }})'
35
- uses: actions/setup-node@v4
36
- with:
37
- node-version: '${{ matrix.NODE_VERSION }}'
38
-
39
- - name: '📦 Install dependencies'
40
- run: yarn install --frozen-lockfile
41
-
42
- - name: '📕 Linting'
43
- run: yarn lint
44
-
45
- # Start to run our inline jobs
46
- # Vitest
47
- - name: '🧪 Run coverage'
48
- run: yarn coverage
49
-
50
- - name: '✍️ Report coverage'
51
- if: always() # Also generate the report if tests are failing
52
- uses: davelosert/vitest-coverage-report-action@v2
53
- with:
54
- vite-config-path: .config/vitest.config.ts
@@ -1,27 +0,0 @@
1
- # This workflow will run tests using node and then publish a package to GitHub Packages when a release is created
2
- # For more information see: https://docs.github.com/en/actions/publishing-packages/publishing-nodejs-packages
3
-
4
- name: Node.js Package
5
-
6
- on:
7
- workflow_dispatch:
8
- release:
9
- types: [created]
10
-
11
- jobs:
12
- publish-npm:
13
- name: Publish to NPM registry
14
- runs-on: ubuntu-latest
15
- steps:
16
- - uses: actions/checkout@v4
17
- - name: Build all sources
18
- run: |
19
- yarn install --frozen-lockfile
20
- yarn build
21
-
22
- - name: Publish if version has been updated
23
- uses: JS-DevTools/npm-publish@v2
24
- with:
25
- token: ${{ secrets.npm_token }}
26
- access: public
27
- package: ./dist/package.json
package/.husky/pre-commit DELETED
@@ -1 +0,0 @@
1
- yarn lint-staged -c ./.config/.lintstagedrc.json
@@ -1,59 +0,0 @@
1
- <component name="ProjectCodeStyleConfiguration">
2
- <code_scheme name="Project" version="173">
3
- <HTMLCodeStyleSettings>
4
- <option name="HTML_SPACE_INSIDE_EMPTY_TAG" value="true" />
5
- </HTMLCodeStyleSettings>
6
- <JSCodeStyleSettings version="0">
7
- <option name="FORCE_SEMICOLON_STYLE" value="true" />
8
- <option name="SPACE_BEFORE_FUNCTION_LEFT_PARENTH" value="false" />
9
- <option name="USE_DOUBLE_QUOTES" value="false" />
10
- <option name="FORCE_QUOTE_STYlE" value="true" />
11
- <option name="ENFORCE_TRAILING_COMMA" value="Remove" />
12
- <option name="SPACES_WITHIN_OBJECT_LITERAL_BRACES" value="true" />
13
- <option name="SPACES_WITHIN_IMPORTS" value="true" />
14
- </JSCodeStyleSettings>
15
- <TypeScriptCodeStyleSettings version="0">
16
- <option name="FORCE_SEMICOLON_STYLE" value="true" />
17
- <option name="SPACE_BEFORE_FUNCTION_LEFT_PARENTH" value="false" />
18
- <option name="USE_DOUBLE_QUOTES" value="false" />
19
- <option name="FORCE_QUOTE_STYlE" value="true" />
20
- <option name="ENFORCE_TRAILING_COMMA" value="Remove" />
21
- <option name="SPACES_WITHIN_OBJECT_LITERAL_BRACES" value="true" />
22
- <option name="SPACES_WITHIN_IMPORTS" value="true" />
23
- </TypeScriptCodeStyleSettings>
24
- <VueCodeStyleSettings>
25
- <option name="INTERPOLATION_NEW_LINE_AFTER_START_DELIMITER" value="false" />
26
- <option name="INTERPOLATION_NEW_LINE_BEFORE_END_DELIMITER" value="false" />
27
- </VueCodeStyleSettings>
28
- <codeStyleSettings language="HTML">
29
- <option name="SOFT_MARGINS" value="80" />
30
- <indentOptions>
31
- <option name="INDENT_SIZE" value="2" />
32
- <option name="CONTINUATION_INDENT_SIZE" value="2" />
33
- <option name="TAB_SIZE" value="2" />
34
- </indentOptions>
35
- </codeStyleSettings>
36
- <codeStyleSettings language="JavaScript">
37
- <option name="SOFT_MARGINS" value="80" />
38
- <indentOptions>
39
- <option name="INDENT_SIZE" value="2" />
40
- <option name="CONTINUATION_INDENT_SIZE" value="2" />
41
- <option name="TAB_SIZE" value="2" />
42
- </indentOptions>
43
- </codeStyleSettings>
44
- <codeStyleSettings language="TypeScript">
45
- <option name="SOFT_MARGINS" value="80" />
46
- <indentOptions>
47
- <option name="INDENT_SIZE" value="2" />
48
- <option name="CONTINUATION_INDENT_SIZE" value="2" />
49
- <option name="TAB_SIZE" value="2" />
50
- </indentOptions>
51
- </codeStyleSettings>
52
- <codeStyleSettings language="Vue">
53
- <option name="SOFT_MARGINS" value="80" />
54
- <indentOptions>
55
- <option name="CONTINUATION_INDENT_SIZE" value="2" />
56
- </indentOptions>
57
- </codeStyleSettings>
58
- </code_scheme>
59
- </component>
@@ -1,5 +0,0 @@
1
- <component name="ProjectCodeStyleConfiguration">
2
- <state>
3
- <option name="USE_PER_PROJECT_SETTINGS" value="true" />
4
- </state>
5
- </component>
@@ -1,6 +0,0 @@
1
- <component name="InspectionProjectProfileManager">
2
- <profile version="1.0">
3
- <option name="myName" value="Project Default" />
4
- <inspection_tool class="Eslint" enabled="true" level="WARNING" enabled_by_default="true" />
5
- </profile>
6
- </component>
package/.idea/modules.xml DELETED
@@ -1,8 +0,0 @@
1
- <?xml version="1.0" encoding="UTF-8"?>
2
- <project version="4">
3
- <component name="ProjectModuleManager">
4
- <modules>
5
- <module fileurl="file://$PROJECT_DIR$/.idea/xenopomp-essentials-js.iml" filepath="$PROJECT_DIR$/.idea/xenopomp-essentials-js.iml" />
6
- </modules>
7
- </component>
8
- </project>
@@ -1,7 +0,0 @@
1
- <?xml version="1.0" encoding="UTF-8"?>
2
- <project version="4">
3
- <component name="PrettierConfiguration">
4
- <option name="myConfigurationMode" value="AUTOMATIC" />
5
- <option name="myRunOnSave" value="true" />
6
- </component>
7
- </project>
@@ -1,9 +0,0 @@
1
- <component name="ProjectRunConfigurationManager">
2
- <configuration default="true" type="JavaScriptTestRunnerVitest">
3
- <node-interpreter value="project" />
4
- <vitest-options value="-c ./.config/vitest.config.ts" />
5
- <envs />
6
- <scope-kind value="ALL" />
7
- <method v="2" />
8
- </configuration>
9
- </component>
@@ -1,13 +0,0 @@
1
- <component name="ProjectRunConfigurationManager">
2
- <configuration default="false" name="build" type="js.build_tools.npm" nameIsGenerated="true">
3
- <package-json value="$PROJECT_DIR$/package.json" />
4
- <command value="run" />
5
- <scripts>
6
- <script value="build" />
7
- </scripts>
8
- <node-interpreter value="project" />
9
- <package-manager value="yarn" />
10
- <envs />
11
- <method v="2" />
12
- </configuration>
13
- </component>
@@ -1,12 +0,0 @@
1
- <component name="ProjectRunConfigurationManager">
2
- <configuration default="false" name="coverage" type="js.build_tools.npm" nameIsGenerated="true">
3
- <package-json value="$PROJECT_DIR$/package.json" />
4
- <command value="run" />
5
- <scripts>
6
- <script value="coverage" />
7
- </scripts>
8
- <node-interpreter value="project" />
9
- <envs />
10
- <method v="2" />
11
- </configuration>
12
- </component>
@@ -1,13 +0,0 @@
1
- <component name="ProjectRunConfigurationManager">
2
- <configuration default="false" name="lint" type="js.build_tools.npm" nameIsGenerated="true">
3
- <package-json value="$PROJECT_DIR$/package.json" />
4
- <command value="run" />
5
- <scripts>
6
- <script value="lint" />
7
- </scripts>
8
- <node-interpreter value="project" />
9
- <package-manager value="yarn" />
10
- <envs />
11
- <method v="2" />
12
- </configuration>
13
- </component>
@@ -1,13 +0,0 @@
1
- <component name="ProjectRunConfigurationManager">
2
- <configuration default="false" name="lint:code" type="js.build_tools.npm" nameIsGenerated="true">
3
- <package-json value="$PROJECT_DIR$/package.json" />
4
- <command value="run" />
5
- <scripts>
6
- <script value="lint:code" />
7
- </scripts>
8
- <node-interpreter value="project" />
9
- <package-manager value="yarn" />
10
- <envs />
11
- <method v="2" />
12
- </configuration>
13
- </component>
package/.idea/vcs.xml DELETED
@@ -1,6 +0,0 @@
1
- <?xml version="1.0" encoding="UTF-8"?>
2
- <project version="4">
3
- <component name="VcsDirectoryMappings">
4
- <mapping directory="" vcs="Git" />
5
- </component>
6
- </project>
@@ -1,14 +0,0 @@
1
- <?xml version="1.0" encoding="UTF-8"?>
2
- <module type="WEB_MODULE" version="4">
3
- <component name="NewModuleRootManager">
4
- <content url="file://$MODULE_DIR$">
5
- <sourceFolder url="file://$MODULE_DIR$/__tests__" isTestSource="true" />
6
- <excludeFolder url="file://$MODULE_DIR$/.tmp" />
7
- <excludeFolder url="file://$MODULE_DIR$/temp" />
8
- <excludeFolder url="file://$MODULE_DIR$/tmp" />
9
- <excludeFolder url="file://$MODULE_DIR$/.yarn" />
10
- </content>
11
- <orderEntry type="inheritedJdk" />
12
- <orderEntry type="sourceFolder" forTests="false" />
13
- </component>
14
- </module>
package/.prettierrc DELETED
@@ -1,20 +0,0 @@
1
- {
2
- "parser": "typescript",
3
- "tabWidth": 2,
4
- "singleQuote": true,
5
- "jsxSingleQuote": true,
6
- "semi": true,
7
- "useTabs": false,
8
- "arrowParens": "avoid",
9
- "singleAttributePerLine": true,
10
- "plugins": ["@trivago/prettier-plugin-sort-imports"],
11
- "importOrder": [
12
- "<THIRD_PARTY_MODULES>",
13
- "^@/(.*)$",
14
- "^@test/(.*)$",
15
- "^../(.*)$",
16
- "^./(.*)$"
17
- ],
18
- "importOrderSeparation": true,
19
- "importOrderSortSpecifiers": true
20
- }
package/.yarnrc DELETED
@@ -1,2 +0,0 @@
1
- version-tag-prefix "v"
2
- version-git-message "ℹ️ [skip ci] v%s"
package/README.md DELETED
File without changes
@@ -1,14 +0,0 @@
1
- import { expect } from 'vitest';
2
-
3
- /**
4
- * Deeply checks if two objects are equal.
5
- *
6
- * @param expected
7
- * @param real
8
- */
9
- export const expectToDeepEqual = <Type>(
10
- expected: Type,
11
- real: NoInfer<Type>,
12
- ) => {
13
- expect(expected).to.deep.equal(real);
14
- };
@@ -1,26 +0,0 @@
1
- import { render, renderHook } from '@testing-library/react';
2
-
3
- import { assertNotThrowing } from '@test/assets';
4
-
5
- type RenderArguments = Parameters<typeof render>;
6
- type RenderHookArguments = Parameters<typeof renderHook>;
7
-
8
- type RenderFunc<Args extends unknown[] = RenderArguments> = (
9
- ...args: Args
10
- ) => void;
11
-
12
- /** Renders component and expects that it won't throw error. */
13
- export const expectToRender: RenderFunc = (...props) => {
14
- assertNotThrowing(() => render(...props));
15
- };
16
-
17
- /**
18
- * Renders hook within test React component without having to create that component yourself.
19
- * Expects that it won't throw error.
20
- * @param props
21
- */
22
- export const expectHookToRender: RenderFunc<RenderHookArguments> = (
23
- ...props
24
- ) => {
25
- assertNotThrowing(() => renderHook(...props));
26
- };
@@ -1,3 +0,0 @@
1
- export * from './not-throwing';
2
- export * from './expect-deep-equal';
3
- export * from './expect-to-render';
@@ -1,6 +0,0 @@
1
- import { expect } from 'vitest';
2
-
3
- /** Executes function and expects that it won't throw. */
4
- export const assertNotThrowing = (callable: () => void) => {
5
- expect(() => callable()).not.toThrow();
6
- };
@@ -1 +0,0 @@
1
- export * from './assertions';
@@ -1 +0,0 @@
1
- export * from './parseVersion.data';
@@ -1,52 +0,0 @@
1
- import type { VersionData } from '@/utils';
2
-
3
- export const testCases: Array<VersionData & { input: string }> = [
4
- {
5
- input: 'Random string',
6
- version: null,
7
- preid: undefined,
8
- prerelease: undefined,
9
- },
10
- {
11
- input: '0.0.0',
12
- version: '0.0.0',
13
- prerelease: undefined,
14
- preid: undefined,
15
- },
16
- {
17
- input: '0.0.0-alpha.0',
18
- version: '0.0.0',
19
- preid: 'alpha',
20
- prerelease: '0',
21
- },
22
- {
23
- input: '0.0.0-beta.0',
24
- version: '0.0.0',
25
- preid: 'beta',
26
- prerelease: '0',
27
- },
28
- {
29
- input: '0.0.0-rc.0',
30
- version: '0.0.0',
31
- preid: 'rc',
32
- prerelease: '0',
33
- },
34
- {
35
- input: '0.0.0-rc.1',
36
- version: '0.0.0',
37
- preid: 'rc',
38
- prerelease: '1',
39
- },
40
- {
41
- input: '0.0.0-rc.25',
42
- version: '0.0.0',
43
- preid: 'rc',
44
- prerelease: '25',
45
- },
46
- {
47
- input: '0.0.0-canary.0',
48
- version: '0.0.0',
49
- preid: 'canary',
50
- prerelease: '0',
51
- },
52
- ];