@zeniai/client-epic-state 4.16.6 → 4.16.7-beta0NN

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 (2) hide show
  1. package/README.md +78 -0
  2. package/package.json +7 -5
package/README.md CHANGED
@@ -13,8 +13,86 @@ Common module for Web, Mobile & Server Side Rendering repos containing requi
13
13
  - If any tests fail, the build process will be terminated
14
14
  - Test files are automatically excluded from the final build output
15
15
 
16
+ ### Test & Typecheck Commands
17
+
18
+ - **Run all tests and typecheck test files:**
19
+
20
+ ```sh
21
+ pnpm test
22
+ ```
23
+
24
+ This will typecheck all `.vitest.ts` files and their dependencies, then run the full test suite. The build will fail if there are any TypeScript errors in test files.
25
+
26
+ - **Typecheck only test files:**
27
+
28
+ ```sh
29
+ pnpm test:typecheck
30
+ ```
31
+
32
+ This will only typecheck `.vitest.ts` files and their dependencies, and print the time taken.
33
+
34
+ - **Typecheck and run a single test file:**
35
+ ```sh
36
+ pnpm run test:file <filename-or-unique-substring>
37
+ ```
38
+ Example:
39
+ ```sh
40
+ pnpm run test:file testTransactionsViewReducer
41
+ ```
42
+ This will search for a file in `src/` whose name contains the given string (case-insensitive), typecheck it, and run only its tests.
43
+ - If multiple files match, you'll see a list and must be more specific.
44
+ - If no files match, you'll get an error.
45
+
46
+ #### Note on Typechecking
47
+
48
+ Testing types with `tsc` and Vitest is an experimental feature. Breaking changes might not follow SemVer, so please pin Vitest's version when using it. See [Vitest docs](https://vitest.dev/guide/testing-types.html) for more info.
49
+
16
50
  ### Vitest
17
51
 
18
52
  - Fast framework for running unit, integration, and component tests in modern TypeScript/JavaScript projects.
19
53
  - Provides instant feedback with watch mode, built-in coverage, and Jest-compatible APIs.
20
54
  - Recommended for new tests and as a drop-in replacement for legacy Jest/Chai setups.
55
+
56
+ ---
57
+
58
+ ## Available NPM Scripts
59
+
60
+ ### Test & Typecheck
61
+
62
+ - `pnpm test` — Typechecks all `.vitest.ts` files and runs the full test suite.
63
+ - `pnpm test:typecheck` — Typechecks only `.vitest.ts` files and their dependencies, prints time taken.
64
+ - `pnpm run test:file <file>` — Typechecks and runs tests for a single file.
65
+
66
+ ### Build & Clean
67
+
68
+ - `pnpm build` — Runs ESLint, typechecks, tests, and then cleans up mocks/test helpers.
69
+ - `pnpm only-build` — Runs ESLint and typechecks, then cleans up mocks/test helpers.
70
+ - `pnpm clean` — Removes the `lib` directory.
71
+
72
+ ### Lint & Format
73
+
74
+ - `pnpm lint` — Runs ESLint with auto-fix on all JS/TS files.
75
+ - `pnpm format` — Formats all source files with Prettier.
76
+ - `pnpm format-watch` — Formats only changed/added TS/TSX files with Prettier.
77
+
78
+ ### Code Quality & Analysis
79
+
80
+ - `pnpm find-dead-code` — Finds unused code using ts-prune.
81
+ - `pnpm find-unused-exports` — Finds unused exports using ts-unused-exports.
82
+ - `pnpm circular-dependency` — Detects circular dependencies using madge.
83
+
84
+ ### Release & Versioning
85
+
86
+ - `pnpm prepublishOnly` — Runs branch validation, updates Slack topic, checks version, cleans, and builds before publishing.
87
+ - `pnpm version` — Stages all changes in `src` for versioning.
88
+ - `pnpm postversion` — Pushes commits and tags after version bump.
89
+ - `pnpm check-version` — Checks the current version using a custom script.
90
+ - `pnpm check-dependencies` — Checks dependencies using a custom script.
91
+ - `pnpm clean-resolutions` — Cleans up resolutions using a custom script.
92
+ - `pnpm create-release-branch` — Runs the release branch creation script.
93
+ - `pnpm bump-update-web-app-cockpit-beta` — Runs the cockpit beta update script.
94
+ - `pnpm send-release-notes` — Sends release notes using a custom script.
95
+ - `pnpm update-slack-group-topic` — Updates the Slack group topic using a custom script.
96
+ - `pnpm build-beta-and-copy` — Runs the beta build and copy script.
97
+ - `pnpm pr-approvals-update` — Updates PR approvals using a custom script.
98
+ - `pnpm raise-pr-automation` — Runs the PR automation script.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@zeniai/client-epic-state",
3
- "version": "4.16.6",
3
+ "version": "4.16.7-beta0NN",
4
4
  "description": "Shared module between Web & Mobile containing required abstractions for state management, async network communication. ",
5
5
  "main": "lib/index.js",
6
6
  "types": "lib/index.d.ts",
@@ -84,13 +84,14 @@
84
84
  },
85
85
  "scripts": {
86
86
  "clean": "rimraf lib",
87
- "test": "vitest run",
87
+ "test:typecheck": "echo 'Typechecking test files...' && time tsc -p tsconfig.typecheck.json",
88
+ "test": "pnpm test:typecheck && vitest run --typecheck",
88
89
  "lint": "eslint . --ext .js,.jsx,.ts,.tsx --fix",
89
90
  "find-dead-code": "ts-prune | grep -v '(used in module)'",
90
91
  "find-unused-exports": "ts-unused-exports ./tsconfig.json",
91
92
  "circular-dependency": "npx madge --circular --extensions ts ./src",
92
- "build": "concurrently --kill-others-on-fail --handle-input \"eslint . --ext .js,.jsx,.ts,.tsx\" \"tsc\" \"vitest run\" && rimraf \"lib/**/__mocks__\" \"lib/**/__testHelpers__\"",
93
- "only-build": "concurrently --kill-others-on-fail --handle-input \"eslint . --ext .js,.jsx,.ts,.tsx\" \"tsc\" && rimraf \"lib/**/__mocks__\" \"lib/**/__testHelpers__\"",
93
+ "build": "concurrently --kill-others-on-fail --handle-input \"echo 'Running ESLint...' && eslint . --ext .js,.jsx,.ts,.tsx\" \"echo 'TypeScript build in progress...' && time tsc\" \"echo 'Running tests and typecheck...' && pnpm test\" && rimraf \"lib/**/__mocks__\" \"lib/**/__testHelpers__\"",
94
+ "only-build": "concurrently --kill-others-on-fail --handle-input \"echo 'Running ESLint...' && eslint . --ext .js,.jsx,.ts,.tsx\" \"echo 'TypeScript build in progress...' && time tsc\" && rimraf \"lib/**/__mocks__\" \"lib/**/__testHelpers__\"",
94
95
  "format": "prettier --write --ignore-unknown \"src/**/*\"",
95
96
  "format-watch": "(git diff --name-only --diff-filter=ACM && git ls-files --others --exclude-standard) | grep -E '\\.(ts|tsx)$' | xargs prettier --write",
96
97
  "check-version": "node ./scripts/check_version.js",
@@ -104,6 +105,7 @@
104
105
  "update-slack-group-topic": "chmod +x ./scripts/update-slack-group-topic.sh && ./scripts/update-slack-group-topic.sh",
105
106
  "build-beta-and-copy": "chmod +x ./scripts/build_and_copy.sh && ./scripts/build_and_copy.sh",
106
107
  "pr-approvals-update": "chmod +x ./scripts/pr_approvals.sh && ./scripts/pr_approvals.sh",
107
- "raise-pr-automation": "chmod +x ./scripts/raise_pr_automation.sh && ./scripts/raise_pr_automation.sh"
108
+ "raise-pr-automation": "chmod +x ./scripts/raise_pr_automation.sh && ./scripts/raise_pr_automation.sh",
109
+ "test:file": "scripts/test-file.sh"
108
110
  }
109
111
  }