Skip to content

Commit

Permalink
refactor: moved to microbundle
Browse files Browse the repository at this point in the history
  • Loading branch information
DuCanhGH committed Aug 4, 2022
1 parent 1dd63de commit 968d2b9
Show file tree
Hide file tree
Showing 9 changed files with 3,962 additions and 7,285 deletions.
52 changes: 51 additions & 1 deletion .eslintrc.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,55 @@
module.exports = {
parser: "@typescript-eslint/parser",
env: {
browser: true,
node: true,
},
extends: [
"eslint:recommended",
"plugin:import/errors",
"plugin:import/warnings",
"plugin:import/typescript",
"plugin:react/recommended",
"plugin:jsx-a11y/recommended",
"plugin:prettier/recommended",
"prettier",
],
parserOptions: {
ecmaFeatures: {
jsx: true,
},
ecmaVersion: 2020,
sourceType: "module",
},
plugins: ["react", "react-hooks", "@typescript-eslint"],
settings: {
react: {
version: "detect",
},
},
rules: {
"prettier/prettier": "off",
"react/prefer-stateless-function": "off",
"react/prop-types": 0,
"react/react-in-jsx-scope": "off",
"react-hooks/exhaustive-deps": "warn",
"prettier/prettier": [
"error",
{
endOfLine: "crlf",
},
],
"no-irregular-whitespace": "off",
indent: ["error", 2, { SwitchCase: 1 }],
"linebreak-style": "off",
semi: ["error", "always"],
"eol-last": ["error", "always"],
quotes: ["error", "double"],
"prefer-const": [
"error",
{
destructuring: "any",
ignoreReadBeforeAssign: false,
},
],
},
};
9 changes: 0 additions & 9 deletions .npmignore

This file was deleted.

5 changes: 1 addition & 4 deletions .prettierignore
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,7 @@ package-lock.json
*.pem

# debug
npm-debug.log*
yarn-debug.log*
yarn-error.log*
.pnpm-debug.log*
*.log

# env files
.env*
3 changes: 2 additions & 1 deletion .prettierrc.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,6 @@
"useTabs": false,
"singleQuote": false,
"semi": true,
"trailingComma": "es5"
"trailingComma": "es5",
"endOfLine": "crlf"
}
7 changes: 7 additions & 0 deletions jest.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
module.exports = {
roots: ["<rootDir>/test"],
transform: {
"^.+\\.tsx?$": "ts-jest",
},
moduleFileExtensions: ["ts", "tsx", "js", "jsx", "json"],
};
88 changes: 53 additions & 35 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,36 +4,28 @@
"description": "A simple and easy to use react component for playing an hls live stream",
"version": "3.1.2",
"license": "MIT",
"main": "dist/index.js",
"typings": "dist/index.d.ts",
"source": "./src/index.tsx",
"files": [
"dist"
],
"engines": {
"node": ">=14.6"
"exports": {
"require": "./dist/index.js",
"default": "./dist/index.modern.mjs"
},
"main": "./dist/index.js",
"module": "./dist/index.module.js",
"unpkg": "./dist/index.umd.js",
"types": "./dist/index.d.ts",
"scripts": {
"start": "tsdx watch",
"build": "tsdx build",
"test": "tsdx test --passWithNoTests",
"lint": "tsdx lint src test",
"prepare": "tsdx build",
"build": "microbundle",
"dev": "microbundle watch",
"size": "size-limit",
"analyze": "size-limit --why",
"lint": "eslint --cache --cache-location ./node_modules/.cache/eslint .",
"test": "jest --env=jsdom",
"prepare": "npm run build",
"format": "prettier --write ."
},
"peerDependencies": {
"react": ">=16"
},
"husky": {
"hooks": {
"pre-commit": "tsdx lint"
}
},
"repository": {
"type": "git",
"url": "git+https://github.com/DuCanhGH/react-hls.git"
},
"keywords": [
"hls",
"rtmp",
Expand All @@ -44,17 +36,13 @@
"url": "https://github.com/DuCanhGH/react-hls/issues"
},
"homepage": "https://github.com/DuCanhGH/react-hls#README",
"module": "dist/react-hls-player.esm.js",
"size-limit": [
{
"path": "dist/react-hls-player.cjs.production.min.js",
"limit": "244 KB"
},
{
"path": "dist/react-hls-player.esm.js",
"limit": "244 KB"
}
],
"repository": {
"type": "git",
"url": "git+https://github.com/DuCanhGH/react-hls.git"
},
"peerDependencies": {
"react": ">=16"
},
"devDependencies": {
"@size-limit/preset-big-lib": "8.0.0",
"@size-limit/webpack": "8.0.0",
Expand All @@ -63,17 +51,47 @@
"@types/jest": "28.1.6",
"@types/react": "18.0.15",
"@types/react-dom": "18.0.6",
"husky": "8.0.1",
"@typescript-eslint/eslint-plugin": "5.32.0",
"@typescript-eslint/parser": "5.32.0",
"eslint": "8.21.0",
"eslint-config-prettier": "8.5.0",
"eslint-plugin-import": "2.26.0",
"eslint-plugin-jsx": "0.1.0",
"eslint-plugin-jsx-a11y": "6.6.1",
"eslint-plugin-prettier": "4.2.1",
"eslint-plugin-react": "7.30.1",
"eslint-plugin-react-hooks": "4.6.0",
"jest": "28.1.3",
"jest-environment-jsdom": "28.1.3",
"microbundle": "0.15.0",
"prettier": "2.7.1",
"react": "18.2.0",
"react-dom": "18.2.0",
"size-limit": "8.0.0",
"tsdx": "0.14.1",
"ts-jest": "28.0.7",
"tslib": "2.4.0",
"typescript": "4.7.4",
"webpack": "5.74.0"
},
"dependencies": {
"hls.js": "1.2.0"
}
},
"size-limit": [
{
"path": "dist/index.js",
"limit": "144 KB"
},
{
"path": "dist/index.modern.mjs",
"limit": "144 KB"
},
{
"path": "dist/index.module.js",
"limit": "144 KB"
},
{
"path": "dist/index.umd.js",
"limit": "144 KB"
}
]
}

0 comments on commit 968d2b9

Please sign in to comment.