chore: cleanup unused packages and update setup#5012
Open
satya164 wants to merge 1 commit into
Open
Conversation
There was a problem hiding this comment.
Pull request overview
This PR streamlines the repo’s tooling by removing unused packages, migrating several internal scripts from CommonJS/JS to ESM/TypeScript, and updating local + CI workflows to use the new setup (including switching git hooks from Husky to Lefthook).
Changes:
- Remove unused dev dependencies and update
yarn.lockaccordingly; add Lefthook and newer Node typings. - Convert scripts to ESM/TypeScript (
generate-mappings,typescript-output-lint,generate-ts-tests, component docs generator) and update call sites. - Update CI, docs, ESLint config/ignores, and tests to match the new scripts and
reduceMotionusage.
Reviewed changes
Copilot reviewed 16 out of 17 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
| yarn.lock | Dependency graph updated after package cleanup + new tooling deps (e.g., lefthook, @types/node). |
| src/core/tests/PaperProvider.test.tsx | Updates provider setup to explicitly set reduceMotion defaults and adjusts reduce-motion mocking. |
| src/babel/tests/index.js | Updates test helper to execute the new generate-mappings.ts script. |
| scripts/typescript-output-lint.ts | Migrates script to ESM with node: imports and TS typing updates. |
| scripts/package.json | Sets scripts/ folder module type to ESM. |
| scripts/generate-ts-tests.ts | Replaces glob/rimraf-based JS script with a TS implementation using fs APIs. |
| scripts/generate-ts-tests.js | Removes old CommonJS implementation. |
| scripts/generate-mappings.ts | Replaces old CommonJS mapping generator with a typed ESM/TS version. |
| scripts/generate-mappings.js | Removes old CommonJS implementation. |
| scripts/generate-component-docs.ts | Migrates to ESM and hardens runtime type checks for required modules. |
| package.json | Updates scripts (typecheck, generate-mappings), swaps Husky for Lefthook, and cleans devDependencies. |
| lefthook.yml | Adds Lefthook hook definitions for commit-msg and pre-commit checks. |
| CONTRIBUTING.md | Updates contributor instructions to reflect new script names (typecheck) and corrected wording. |
| .github/workflows/ci.yml | Uses new script names, runs TS-based lint script, and adds example build job. |
| .github/pull_request_template.md | Updates wording to reference typecheck instead of typescript. |
| .eslintrc | Disables react-native/no-inline-styles for test files. |
| .eslintignore | Ignores generated __ts-tests__/ and example/dist/. |
Comment on lines
56
to
59
| "@babel/core": "^7.29.0", | ||
| "@babel/plugin-proposal-export-namespace-from": "^7.18.9", | ||
| "@babel/runtime": "^7.29.0", | ||
| "@babel/types": "^7.28.5", | ||
| "@callstack/eslint-config": "^13.0.2", |
Comment on lines
31
to
+35
| Our pre-commit hooks verify that your commit message matches this format when committing. | ||
|
|
||
| ### Linting and tests | ||
|
|
||
| We use `typescript` for type checking, `eslint` with `prettier` for linting and formatting the code, and `jest` for testing. Our pre-commit hooks verify that the linter and tests pass when commiting. You can also run the following commands manually: | ||
| We use `typescript` for type checking, `eslint` with `prettier` for linting and formatting the code, and `jest` for testing. Our pre-commit hooks verify that type checking, linting, and tests pass when committing. You can also run the following commands manually: |
Comment on lines
+7
to
+10
| example/dist/ | ||
| web-build/ | ||
| jest/testSetup.js | ||
| __ts-tests__/ |
2679f67 to
bc5b8ff
Compare
bc5b8ff to
1b3ca87
Compare
Comment on lines
+38
to
+39
| "lint": "eslint ${@:-.}", | ||
| "typecheck": "tsc", |
Comment on lines
+130
to
+152
| { | ||
| files: ['docs/**/*.{js,ts,tsx}'], | ||
| settings: { | ||
| 'import/core-modules': [ | ||
| 'react-native-paper', | ||
| '@docusaurus/BrowserOnly', | ||
| '@docusaurus/Link', | ||
| '@docusaurus/plugin-content-docs/client', | ||
| '@site/component-docs-plugin/useDocs', | ||
| '@theme/Admonition', | ||
| '@theme/CodeBlock', | ||
| '@theme/TabItem', | ||
| '@theme/Tabs', | ||
| ], | ||
| }, | ||
| }, | ||
| { | ||
| files: ['eslint.config.mjs'], | ||
| rules: { | ||
| 'import/no-unresolved': 'off', | ||
| }, | ||
| }, | ||
| ); |
1b3ca87 to
4e521b3
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.