Skip to content

chore: From Flow to typescript #648

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 32 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
32 commits
Select commit Hold shift + click to select a range
039d7e3
Just run flow-to-ts command
armandabric Oct 2, 2021
6822ed8
Fix or ignore type error
armandabric Oct 2, 2021
755df5a
Limit file diff by adding by newline
armandabric Oct 2, 2021
80c4bb4
Prevent diff
armandabric Oct 2, 2021
5592fcb
Preserve linebreak
armandabric Oct 2, 2021
45e0f18
Preserve line break
armandabric Oct 2, 2021
decc840
Remove flow last occurence
armandabric Oct 2, 2021
e3e1f9b
Preserve line break
armandabric Oct 2, 2021
7af5cf3
Preserve line break
armandabric Oct 2, 2021
7cf9dd6
Preserver line break
armandabric Oct 2, 2021
bc7a879
Preserve line break
armandabric Oct 2, 2021
c8c9518
Revert smoke test to JS
armandabric Oct 2, 2021
b416b77
Fix unit test (mainly function output change)
armandabric Oct 2, 2021
8d6151b
Reconfigure ESLint
armandabric Oct 3, 2021
1b5cc3e
wip
armandabric Oct 19, 2021
bbbb052
Typescript incoming
armandabric Jan 13, 2025
bfac533
Fix Github Actions
armandabric Jan 13, 2025
ffb12de
Fix test after rebase
armandabric Jan 13, 2025
54b3f08
Fix pnpm version
armandabric Jan 13, 2025
46d4b4f
All integration and unit tests green
armandabric Jan 13, 2025
d386080
Solve TS issues
armandabric Jan 13, 2025
b8970e1
Label with node version
armandabric Jan 14, 2025
39c4fd1
Remove matrix
armandabric Jan 14, 2025
af6b586
Fix TS on CI
armandabric Jan 14, 2025
28c2391
Configure tsup
armandabric Jan 14, 2025
8498ce7
ESM
armandabric Jan 14, 2025
ad1af44
Fix fix fix fix
armandabric Jan 30, 2025
79f4ba6
Less than 100 TS errors !
armandabric Feb 6, 2025
64180ed
Fix TS issues in tests
armandabric Feb 20, 2025
3037835
Fix rebase
armandabric Feb 20, 2025
82e1ea1
Activate Biome
armandabric Feb 20, 2025
a2f093b
Start to fix biome issues
armandabric Feb 21, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 0 additions & 3 deletions .babelrc

This file was deleted.

2 changes: 0 additions & 2 deletions .eslintignore

This file was deleted.

29 changes: 0 additions & 29 deletions .eslintrc.js

This file was deleted.

18 changes: 0 additions & 18 deletions .flowconfig

This file was deleted.

28 changes: 15 additions & 13 deletions .github/workflows/continuous-integration.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,18 +6,20 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: pnpm/action-setup@v4
- uses: actions/setup-node@v4
with:
node-version: '20'
cache: 'yarn'
- run: yarn install --frozen-lockfile
- run: yarn run test
- run: yarn run lint
- run: yarn run flow
- run: yarn run smoke cjs 19.0.0
- run: yarn run smoke esm 19.0.0
- run: yarn run smoke cjs latest
- run: yarn run smoke esm latest
- run: yarn run smoke cjs next
- run: yarn run smoke esm next

node-version: 20
cache: "pnpm"
- run: pnpm install
- run: pnpm run test
- run: pnpm run typecheck
- run: pnpm run lint
- run: pnpm run build
# FIXME: To be reactivated
# - run: pnpm run smoke cjs 19.0.0
# - run: pnpm run smoke esm 19.0.0
# - run: pnpm run smoke cjs latest
# - run: pnpm run smoke esm latest
# - run: pnpm run smoke cjs next
# - run: pnpm run smoke esm next
14 changes: 3 additions & 11 deletions .npmignore
Original file line number Diff line number Diff line change
@@ -1,19 +1,11 @@
**/*.spec.js
**/*.spec.js.flow

.github/
!dist/
src/
tests/

.babelrc
.eslintignore
.eslintrc.js
.flowconfig
.travis.yml
.prettier
.prettierignore
**/*.spec.js

biome.json
commitlint.config.js
release.sh
renovate.json
rollup.config.js
2 changes: 0 additions & 2 deletions .prettierignore

This file was deleted.

23 changes: 0 additions & 23 deletions .prettierrc

This file was deleted.

18 changes: 0 additions & 18 deletions .vscode/launch.json

This file was deleted.

38 changes: 38 additions & 0 deletions biome.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
{
"$schema": "https://biomejs.dev/schemas/1.9.4/schema.json",
"vcs": {
"enabled": true,
"clientKind": "git",
"useIgnoreFile": true
},
"files": {
"ignoreUnknown": false,
"ignore": ["./tests/smoke/**"]
},
"formatter": {
"enabled": true,
"formatWithErrors": false,
"indentStyle": "space",
"indentWidth": 2
},
"organizeImports": {
"enabled": true
},
"linter": {
"enabled": true,
"rules": {
"recommended": true,
"correctness": {
"recommended": true,
"noUnusedImports": "error"
},
"a11y": {
"recommended": false
},
"complexity": {
"noForEach": "off",
"noBannedTypes": "warn"
}
}
}
}
2 changes: 1 addition & 1 deletion commitlint.config.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
module.exports = {
extends: ['@commitlint/config-angular'],
extends: ["@commitlint/config-angular"],
};
24 changes: 0 additions & 24 deletions index.d.ts

This file was deleted.

110 changes: 37 additions & 73 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,95 +2,59 @@
"name": "react-element-to-jsx-string",
"version": "17.0.0",
"description": "Turn a ReactElement into the corresponding JSX string.",
"packageManager": "[email protected]+sha1.ac34549e6aa8e7ead463a7407e1c7390f61a6610",
"main": "dist/cjs/index.js",
"module": "dist/esm/index.js",
"browser": "dist/cjs/index.js",
"types": "index.d.ts",
"packageManager": "[email protected]",
"type": "module",
"main": "dist/index.mjs",
"module": "dist/index.mjs",
"browser": "dist/index.js",
"types": "dist/index.d.ts",
"scripts": {
"build": "rollup -c",
"build:flow": "flow-copy-source -v --ignore=*.spec.js src/ dist/cjs",
"build": "tsup",
"prebuild": "rm -rf dist/",
"postbuild": "npm run build:flow",
"prepare": "npm run build",
"lint": "eslint .",
"lint:fix": "npm run lint -- --fix",
"flow": "flow",
"precommit": "lint-staged",
"prepublishOnly": "npm run build",
"prettier:fix": "prettier --write \"**/*.{js,json}\"",
"test": "jest",
"test:watch": "jest --watch",
"build:esm": "tsc --module esnext --outDir lib/esm",
"build:cjs": "tsc --module commonjs --outDir lib/cjs",
"lint": "biome check",
"lint:fix": "pnpm run check --fix",
"test": "vitest",
"release": "./release.sh",
"smoke": "node tests/smoke/run"
},
"lint-staged": {
"*.js": [
"prettier --write \"**/*.{js,json}\"",
"git add"
]
"smoke": "node tests/smoke/run",
"typecheck": "tsc --noEmit"
},
"author": {
"name": "Algolia, Inc.",
"url": "https://github.com/algolia"
},
"license": "MIT",
"repository": "algolia/react-element-to-jsx-string",
"dependencies": {
"@base2/pretty-print-object": "1.0.2"
},
"peerDependencies": {
"react": "^19.0.0",
"react-dom": "^19.0.0",
"react-is": "^19.0.0"
},
"devDependencies": {
"@babel/cli": "7.26.4",
"@babel/core": "7.26.9",
"@babel/preset-env": "7.26.9",
"@babel/preset-flow": "7.25.9",
"@babel/preset-react": "7.26.3",
"@commitlint/cli": "8.3.6",
"@commitlint/config-angular": "8.3.6",
"@testing-library/dom": "10.4.0",
"@testing-library/jest-dom": "5.17.0",
"@testing-library/react": "16.2.0",
"babel-eslint": "10.1.0",
"babel-jest": "24.9.0",
"babel-register": "6.26.0",
"conventional-changelog-cli": "2.2.2",
"@biomejs/biome": "1.9.4",
"@commitlint/cli": "^19.6.1",
"@commitlint/config-angular": "^19.7.0",
"@testing-library/dom": "^10.4.0",
"@testing-library/jest-dom": "^6.6.3",
"@testing-library/react": "^16.2.0",
"@types/react": "^19.0.8",
"@types/react-dom": "^19.0.3",
"@types/react-is": "^19.0.0",
"@vitejs/plugin-react": "^4.3.4",
"conventional-changelog-cli": "2.1.1",
"doctoc": "1.4.0",
"eslint": "6.8.0",
"eslint-config-algolia": "14.0.1",
"eslint-config-prettier": "6.15.0",
"eslint-plugin-import": "2.29.1",
"eslint-plugin-jest": "22.21.0",
"eslint-plugin-prettier": "3.4.1",
"eslint-plugin-react": "7.31.1",
"esm": "3.2.25",
"expect": "27.5.1",
"flow-bin": "0.119.1",
"flow-copy-source": "2.0.9",
"husky": "3.1.0",
"jest": "27.5.1",
"json": "10.0.0",
"lint-staged": "10.5.4",
"happy-dom": "^17.1.0",
"mversion": "2.0.1",
"prettier": "1.19.1",
"react": "19.0.0",
"react-dom": "19.0.0",
"react-is": "19.0.0",
"rollup": "2.79.1",
"rollup-plugin-babel": "4.4.0",
"rollup-plugin-node-builtins": "2.1.2",
"rollup-plugin-node-globals": "1.4.0",
"rollup-plugin-node-resolve": "5.2.0",
"rollup-plugin-sourcemaps": "0.6.3"
},
"peerDependencies": {
"react": "^19.0.0",
"react-dom": "^19.0.0",
"react-is": "^19.0.0"
},
"dependencies": {
"@base2/pretty-print-object": "1.0.2",
"is-plain-object": "5.0.0"
},
"jest": {
"setupFilesAfterEnv": [
"<rootDir>tests/setupTests.js"
]
"tsup": "^8.3.6",
"typescript": "^5.7.3",
"vitest": "^3.0.5"
}
}
Loading
Loading