Skip to content
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

chore: From Flow to typescript #648

Open
wants to merge 26 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
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 build
# FIXME: To be reactivated
# - run: pnpm run lint
# - 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
5 changes: 0 additions & 5 deletions .npmignore
Original file line number Diff line number Diff line change
@@ -1,19 +1,14 @@
**/*.spec.js
**/*.spec.js.flow

.github/
!dist/
src/
tests/

.babelrc
.eslintignore
.eslintrc.js
.flowconfig
.travis.yml
.prettier
.prettierignore
commitlint.config.js
release.sh
renovate.json
rollup.config.js
21 changes: 1 addition & 20 deletions .prettierrc
Original file line number Diff line number Diff line change
@@ -1,23 +1,4 @@
{
"parser": "flow",
"singleQuote": true,
"trailingComma": "es5",
"overrides": [
{
"files": ".prettierrc",
"options": { "parser": "json" }
},
{
"files": ".babelrc",
"options": { "parser": "json" }
},
{
"files": "*.json",
"options": { "parser": "json" }
},
{
"files": "package.json",
"options": { "printWidth": 999 }
}
]
"trailingComma": "es5"
}
18 changes: 0 additions & 18 deletions .vscode/launch.json

This file was deleted.

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": "16.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": "eslint --ext ts --ext tsx src/",
"lint:fix": "yarn run lint -- --fix",
"prettier:fix": "prettier --write \"**/*.{ts,tsx,js,json}\"",
"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.24.1",
"@babel/core": "7.24.4",
"@babel/preset-env": "7.24.4",
"@babel/preset-flow": "7.24.1",
"@babel/preset-react": "7.24.1",
"@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.1.0",
"babel-eslint": "10.1.0",
"babel-jest": "24.9.0",
"babel-register": "6.26.0",
"conventional-changelog-cli": "2.2.2",
"@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.1.0",
"@types/react": "^19.0.6",
"@types/react-dom": "^19.0.3",
"@types/react-is": "^19.0.0",
"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": "^16.5.3",
"mversion": "2.0.1",
"prettier": "1.19.1",
"prettier": "3.4.2",
"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.5",
"typescript": "^5.7.3",
"vitest": "^2.1.8"
}
}
Loading
Loading