diff --git a/.eslintrc.js b/.eslintrc.js index 8a8a66b..ee17b72 100644 --- a/.eslintrc.js +++ b/.eslintrc.js @@ -16,5 +16,13 @@ module.exports = { ecmaVersion: 2020, }, - ignorePatterns: ['build/', 'coverage/', 'coverage-local/', 'dist/', 'lib-dist/', 'node_modules/'], + ignorePatterns: [ + 'build/', + 'coverage/', + 'coverage-local/', + 'dist/', + 'legacy-types/', + 'lib-dist/', + 'node_modules/', + ], }; diff --git a/README.md b/README.md index 6d68163..eefb062 100644 --- a/README.md +++ b/README.md @@ -14,7 +14,7 @@ Selectors with parameters and dynamic dependencies. [![gzip size](https://img.badgesize.io/https://unpkg.com/@dynamic-selectors/core@latest/dist/core.cjs.production.min.js?compression=gzip)](https://bundlephobia.com/result?p=@dynamic-selectors/core@latest) Core functionality for dynamic selectors, independent of any other library.
-**This is the main package: [main docs are here](./packages/core/).** +**This is the main package: [main docs are here](./packages/core/#readme).** #### [@dynamic-selectors/with-reselect](./packages/with-reselect/) diff --git a/package.json b/package.json index beb33f5..3900190 100644 --- a/package.json +++ b/package.json @@ -62,6 +62,7 @@ "@tsconfig/recommended": "1.0.1", "@types/react-dom": "17.0.5", "cross-env": "7.0.3", + "downlevel-dts": "0.7.0", "eslint-plugin-prettier": "3.4.0", "gh-pages": "3.2.0", "husky": "6.0.0", @@ -71,9 +72,13 @@ "rimraf": "3.0.2", "standard-version": "9.3.0", "tsdx": "0.14.1", - "typescript": "3.9.7", + "typescript": "4.3.2", "yarn-or-npm": "3.0.1" }, + "resolutions": { + "**/@typescript-eslint/eslint-plugin": "^4.25.0", + "**/@typescript-eslint/parser": "^4.25.0" + }, "lint-staged": { "**/*.{css,html,js,jsx,json,less,md,scss,ts,tsx}": [ "prettier --write" diff --git a/packages/core/package.json b/packages/core/package.json index 235ceba..8505b01 100644 --- a/packages/core/package.json +++ b/packages/core/package.json @@ -36,8 +36,8 @@ ], "source": "src/index.ts", "main": "dist/index.js", - "module": "dist/dynamic-selectors-core.esm.js", - "jsnext:main": "dist/dynamic-selectors-core.esm.js", + "module": "dist/core.esm.js", + "jsnext:main": "dist/core.esm.js", "types": "dist/index.d.ts", "sideEffects": false, "scripts": { @@ -54,8 +54,11 @@ "all": "yarn run clean && yarn run dev && yarn run test:coverage && yarn run build", "all:readonly": "yarn run dev:readonly && yarn run test:coverage", "____ INDIVIDUAL COMMANDS ___________________________________________": "", - "build": "tsdx build", - "build:clean": "rimraf ./dist", + "build": "tsdx build && yon run build:types", + "build:clean": "rimraf ./dist ./legacy-types", + "build:types": "yon run build:types:3.x && yon run build:types:4.x", + "build:types:3.x": "downlevel-dts ./dist ./legacy-types/ts3.x/dist --to=3.0", + "build:types:4.x": "downlevel-dts ./dist ./dist --to=4.0", "build:watch": "tsdx watch", "format": "prettier --write .", "format:verify": "prettier --list-different .", @@ -76,5 +79,12 @@ "devDependencies": { "@types/lodash": "4.14.170", "@types/shallowequal": "1.1.1" + }, + "typesVersions": { + "<4": { + "*": [ + "legacy-types/ts3.x/*" + ] + } } } diff --git a/packages/with-reselect/package.json b/packages/with-reselect/package.json index fd84f4f..2776923 100644 --- a/packages/with-reselect/package.json +++ b/packages/with-reselect/package.json @@ -36,8 +36,8 @@ ], "source": "src/index.ts", "main": "dist/index.js", - "module": "dist/dynamic-selectors-with-reselect.esm.js", - "jsnext:main": "dist/dynamic-selectors-with-reselect.esm.js", + "module": "dist/with-reselect.esm.js", + "jsnext:main": "dist/with-reselect.esm.js", "types": "dist/index.d.ts", "sideEffects": false, "scripts": { @@ -54,8 +54,11 @@ "all": "yarn run clean && yarn run dev && yarn run test:coverage && yarn run build", "all:readonly": "yarn run dev:readonly && yarn run test:coverage", "____ INDIVIDUAL COMMANDS ___________________________________________": "", - "build": "tsdx build", - "build:clean": "rimraf ./dist", + "build": "tsdx build && yon run build:types", + "build:clean": "rimraf ./dist ./legacy-types", + "build:types": "yon run build:types:3.x && yon run build:types:4.x", + "build:types:3.x": "downlevel-dts ./dist ./legacy-types/ts3.x/dist --to=3.0", + "build:types:4.x": "downlevel-dts ./dist ./dist --to=4.0", "build:watch": "tsdx watch", "format": "prettier --write .", "format:verify": "prettier --list-different .", @@ -76,5 +79,12 @@ "devDependencies": { "@dynamic-selectors/core": "^0.2.3", "reselect": "4.0.0" + }, + "typesVersions": { + "<4": { + "*": [ + "legacy-types/ts3.x/*" + ] + } } } diff --git a/yarn.lock b/yarn.lock index 84c2685..505edc0 100644 --- a/yarn.lock +++ b/yarn.lock @@ -2116,11 +2116,6 @@ dependencies: "@babel/types" "^7.3.0" -"@types/eslint-visitor-keys@^1.0.0": - version "1.0.0" - resolved "https://registry.yarnpkg.com/@types/eslint-visitor-keys/-/eslint-visitor-keys-1.0.0.tgz#1ee30d79544ca84d68d4b3cdb0af4f205663dd2d" - integrity sha512-OCutwjDZ4aFS6PB1UZ988C4YgwlBHJd6wCeQqaLdmadZ/7e+w79+hbMUFC1QXDNCmdyoRfAFdm0RypzwR+Qpag== - "@types/estree@*": version "0.0.47" resolved "https://registry.yarnpkg.com/@types/estree/-/estree-0.0.47.tgz#d7a51db20f0650efec24cd04994f523d93172ed4" @@ -2288,49 +2283,76 @@ dependencies: "@types/yargs-parser" "*" -"@typescript-eslint/eslint-plugin@^2.12.0": - version "2.34.0" - resolved "https://registry.yarnpkg.com/@typescript-eslint/eslint-plugin/-/eslint-plugin-2.34.0.tgz#6f8ce8a46c7dea4a6f1d171d2bb8fbae6dac2be9" - integrity sha512-4zY3Z88rEE99+CNvTbXSyovv2z9PNOVffTWD2W8QF5s2prBQtwN2zadqERcrHpcR7O/+KMI3fcTAmUUhK/iQcQ== +"@typescript-eslint/eslint-plugin@^2.12.0", "@typescript-eslint/eslint-plugin@^4.25.0": + version "4.25.0" + resolved "https://registry.yarnpkg.com/@typescript-eslint/eslint-plugin/-/eslint-plugin-4.25.0.tgz#d82657b6ab4caa4c3f888ff923175fadc2f31f2a" + integrity sha512-Qfs3dWkTMKkKwt78xp2O/KZQB8MPS1UQ5D3YW2s6LQWBE1074BE+Rym+b1pXZIX3M3fSvPUDaCvZLKV2ylVYYQ== dependencies: - "@typescript-eslint/experimental-utils" "2.34.0" + "@typescript-eslint/experimental-utils" "4.25.0" + "@typescript-eslint/scope-manager" "4.25.0" + debug "^4.1.1" functional-red-black-tree "^1.0.1" + lodash "^4.17.15" regexpp "^3.0.0" + semver "^7.3.2" tsutils "^3.17.1" -"@typescript-eslint/experimental-utils@2.34.0": - version "2.34.0" - resolved "https://registry.yarnpkg.com/@typescript-eslint/experimental-utils/-/experimental-utils-2.34.0.tgz#d3524b644cdb40eebceca67f8cf3e4cc9c8f980f" - integrity sha512-eS6FTkq+wuMJ+sgtuNTtcqavWXqsflWcfBnlYhg/nS4aZ1leewkXGbvBhaapn1q6qf4M71bsR1tez5JTRMuqwA== +"@typescript-eslint/experimental-utils@4.25.0": + version "4.25.0" + resolved "https://registry.yarnpkg.com/@typescript-eslint/experimental-utils/-/experimental-utils-4.25.0.tgz#b2febcfa715d2c1806fd5f0335193a6cd270df54" + integrity sha512-f0doRE76vq7NEEU0tw+ajv6CrmPelw5wLoaghEHkA2dNLFb3T/zJQqGPQ0OYt5XlZaS13MtnN+GTPCuUVg338w== dependencies: "@types/json-schema" "^7.0.3" - "@typescript-eslint/typescript-estree" "2.34.0" + "@typescript-eslint/scope-manager" "4.25.0" + "@typescript-eslint/types" "4.25.0" + "@typescript-eslint/typescript-estree" "4.25.0" eslint-scope "^5.0.0" eslint-utils "^2.0.0" -"@typescript-eslint/parser@^2.12.0": - version "2.34.0" - resolved "https://registry.yarnpkg.com/@typescript-eslint/parser/-/parser-2.34.0.tgz#50252630ca319685420e9a39ca05fe185a256bc8" - integrity sha512-03ilO0ucSD0EPTw2X4PntSIRFtDPWjrVq7C3/Z3VQHRC7+13YB55rcJI3Jt+YgeHbjUdJPcPa7b23rXCBokuyA== +"@typescript-eslint/parser@^2.12.0", "@typescript-eslint/parser@^4.25.0": + version "4.25.0" + resolved "https://registry.yarnpkg.com/@typescript-eslint/parser/-/parser-4.25.0.tgz#6b2cb6285aa3d55bfb263c650739091b0f19aceb" + integrity sha512-OZFa1SKyEJpAhDx8FcbWyX+vLwh7OEtzoo2iQaeWwxucyfbi0mT4DijbOSsTgPKzGHr6GrF2V5p/CEpUH/VBxg== dependencies: - "@types/eslint-visitor-keys" "^1.0.0" - "@typescript-eslint/experimental-utils" "2.34.0" - "@typescript-eslint/typescript-estree" "2.34.0" - eslint-visitor-keys "^1.1.0" + "@typescript-eslint/scope-manager" "4.25.0" + "@typescript-eslint/types" "4.25.0" + "@typescript-eslint/typescript-estree" "4.25.0" + debug "^4.1.1" -"@typescript-eslint/typescript-estree@2.34.0": - version "2.34.0" - resolved "https://registry.yarnpkg.com/@typescript-eslint/typescript-estree/-/typescript-estree-2.34.0.tgz#14aeb6353b39ef0732cc7f1b8285294937cf37d5" - integrity sha512-OMAr+nJWKdlVM9LOqCqh3pQQPwxHAN7Du8DR6dmwCrAmxtiXQnhHJ6tBNtf+cggqfo51SG/FCwnKhXCIM7hnVg== +"@typescript-eslint/scope-manager@4.25.0": + version "4.25.0" + resolved "https://registry.yarnpkg.com/@typescript-eslint/scope-manager/-/scope-manager-4.25.0.tgz#9d86a5bcc46ef40acd03d85ad4e908e5aab8d4ca" + integrity sha512-2NElKxMb/0rya+NJG1U71BuNnp1TBd1JgzYsldsdA83h/20Tvnf/HrwhiSlNmuq6Vqa0EzidsvkTArwoq+tH6w== dependencies: + "@typescript-eslint/types" "4.25.0" + "@typescript-eslint/visitor-keys" "4.25.0" + +"@typescript-eslint/types@4.25.0": + version "4.25.0" + resolved "https://registry.yarnpkg.com/@typescript-eslint/types/-/types-4.25.0.tgz#0e444a5c5e3c22d7ffa5e16e0e60510b3de5af87" + integrity sha512-+CNINNvl00OkW6wEsi32wU5MhHti2J25TJsJJqgQmJu3B3dYDBcmOxcE5w9cgoM13TrdE/5ND2HoEnBohasxRQ== + +"@typescript-eslint/typescript-estree@4.25.0": + version "4.25.0" + resolved "https://registry.yarnpkg.com/@typescript-eslint/typescript-estree/-/typescript-estree-4.25.0.tgz#942e4e25888736bff5b360d9b0b61e013d0cfa25" + integrity sha512-1B8U07TGNAFMxZbSpF6jqiDs1cVGO0izVkf18Q/SPcUAc9LhHxzvSowXDTvkHMWUVuPpagupaW63gB6ahTXVlg== + dependencies: + "@typescript-eslint/types" "4.25.0" + "@typescript-eslint/visitor-keys" "4.25.0" debug "^4.1.1" - eslint-visitor-keys "^1.1.0" - glob "^7.1.6" + globby "^11.0.1" is-glob "^4.0.1" - lodash "^4.17.15" semver "^7.3.2" tsutils "^3.17.1" +"@typescript-eslint/visitor-keys@4.25.0": + version "4.25.0" + resolved "https://registry.yarnpkg.com/@typescript-eslint/visitor-keys/-/visitor-keys-4.25.0.tgz#863e7ed23da4287c5b469b13223255d0fde6aaa7" + integrity sha512-AmkqV9dDJVKP/TcZrbf6s6i1zYXt5Hl8qOLrRDTFfRNae4+LB8A4N3i+FLZPW85zIxRy39BgeWOfMS3HoH5ngg== + dependencies: + "@typescript-eslint/types" "4.25.0" + eslint-visitor-keys "^2.0.0" + JSONStream@^1.0.4: version "1.3.5" resolved "https://registry.yarnpkg.com/JSONStream/-/JSONStream-1.3.5.tgz#3208c1f08d3a4d99261ab64f92302bc15e111ca0" @@ -3505,17 +3527,17 @@ copy-descriptor@^0.1.0: integrity sha1-Z29us8OZl8LuGsOpJP1hJHSPV40= core-js-compat@^3.9.0, core-js-compat@^3.9.1: - version "3.13.0" - resolved "https://registry.yarnpkg.com/core-js-compat/-/core-js-compat-3.13.0.tgz#a88f5fa81d8e9b15d7f98abc4447a4dfca2a358f" - integrity sha512-jhbI2zpVskgfDC9mGRaDo1gagd0E0i/kYW0+WvibL/rafEHKAHO653hEXIxJHqRlRLITluXtRH3AGTL5qJmifQ== + version "3.13.1" + resolved "https://registry.yarnpkg.com/core-js-compat/-/core-js-compat-3.13.1.tgz#05444caa8f153be0c67db03cf8adb8ec0964e58e" + integrity sha512-mdrcxc0WznfRd8ZicEZh1qVeJ2mu6bwQFh8YVUK48friy/FOwFV5EJj9/dlh+nMQ74YusdVfBFDuomKgUspxWQ== dependencies: browserslist "^4.16.6" semver "7.0.0" core-js-pure@^3.0.0: - version "3.13.0" - resolved "https://registry.yarnpkg.com/core-js-pure/-/core-js-pure-3.13.0.tgz#9d267fb47d1d7046cfbc05e7b67bb235b6735355" - integrity sha512-7VTvXbsMxROvzPAVczLgfizR8CyYnvWPrb1eGrtlZAJfjQWEHLofVfCKljLHdpazTfpaziRORwUH/kfGDKvpdA== + version "3.13.1" + resolved "https://registry.yarnpkg.com/core-js-pure/-/core-js-pure-3.13.1.tgz#5d139d346780f015f67225f45ee2362a6bed6ba1" + integrity sha512-wVlh0IAi2t1iOEh16y4u1TRk6ubd4KvLE8dlMi+3QUI6SfKphQUh7tAwihGGSQ8affxEXpVIPpOdf9kjR4v4Pw== core-util-is@1.0.2, core-util-is@~1.0.0: version "1.0.2" @@ -3848,6 +3870,15 @@ dotgitignore@^2.1.0: find-up "^3.0.0" minimatch "^3.0.4" +downlevel-dts@0.7.0: + version "0.7.0" + resolved "https://registry.yarnpkg.com/downlevel-dts/-/downlevel-dts-0.7.0.tgz#155c24310dad8a4820ad077e64b15a8c461aa932" + integrity sha512-tcjGqElN0/oad/LJBlaxmZ3zOYEQOBbGuirKzif8s1jeRiWBdNX9H6OBFlRjOQkosXgV+qSjs4osuGCivyZ4Jw== + dependencies: + semver "^7.3.2" + shelljs "^0.8.3" + typescript "^4.1.0-dev.20201026" + duplexer@^0.1.1: version "0.1.2" resolved "https://registry.yarnpkg.com/duplexer/-/duplexer-0.1.2.tgz#3abe43aef3835f8ae077d136ddce0f276b0400e6" @@ -4119,6 +4150,11 @@ eslint-visitor-keys@^1.0.0, eslint-visitor-keys@^1.1.0: resolved "https://registry.yarnpkg.com/eslint-visitor-keys/-/eslint-visitor-keys-1.3.0.tgz#30ebd1ef7c2fdff01c3a4f151044af25fab0523e" integrity sha512-6J72N8UNa462wa/KFODt/PJ3IU60SDpC3QXC1Hjc1BXXpfL2C9R5+AU7jhe0F6GREqVMh4Juu+NY7xn+6dipUQ== +eslint-visitor-keys@^2.0.0: + version "2.1.0" + resolved "https://registry.yarnpkg.com/eslint-visitor-keys/-/eslint-visitor-keys-2.1.0.tgz#f65328259305927392c938ed44eb0a5c9b2bd303" + integrity sha512-0rSmRBzXgDzIsD6mGdJgevzgezI534Cer5L/vyMX0kHzT/jiB43jRhd9YUlMGYLQy2zprNmoT8qasCGtY+QaKw== + eslint@^6.1.0: version "6.8.0" resolved "https://registry.yarnpkg.com/eslint/-/eslint-6.8.0.tgz#62262d6729739f9275723824302fb227c8c93ffb" @@ -4816,7 +4852,7 @@ globalyzer@0.1.0: resolved "https://registry.yarnpkg.com/globalyzer/-/globalyzer-0.1.0.tgz#cb76da79555669a1519d5a8edf093afaa0bf1465" integrity sha512-40oNTM9UfG6aBmuKxk/giHn5nQ8RVz/SS4Ir6zgzOv9/qC3kKZ9v4etGTcJbEl/NyVQH7FGU7d+X1egr57Md2Q== -globby@^11.0.2: +globby@^11.0.1, globby@^11.0.2: version "11.0.3" resolved "https://registry.yarnpkg.com/globby/-/globby-11.0.3.tgz#9b1f0cb523e171dd1ad8c7b2a9fb4b644b9593cb" integrity sha512-ffdmosjA807y7+lA1NM0jELARVmYul/715xiILEjo3hBLPTcirgQNnXECn5g3mtR8TOLCVbkfua1Hpen25/Xcg== @@ -9345,10 +9381,10 @@ typedarray@^0.0.6: resolved "https://registry.yarnpkg.com/typedarray/-/typedarray-0.0.6.tgz#867ac74e3864187b1d3d47d996a78ec5c8830777" integrity sha1-hnrHTjhkGHsdPUfZlqeOxciDB3c= -typescript@3.9.7: - version "3.9.7" - resolved "https://registry.yarnpkg.com/typescript/-/typescript-3.9.7.tgz#98d600a5ebdc38f40cb277522f12dc800e9e25fa" - integrity sha512-BLbiRkiBzAwsjut4x/dsibSTB6yWpwT5qWmC2OfuCg3GgVQCSgMs4vEctYPhsaGtd0AeuuHMkjZ2h2WG8MSzRw== +typescript@4.3.2, typescript@^4.1.0-dev.20201026: + version "4.3.2" + resolved "https://registry.yarnpkg.com/typescript/-/typescript-4.3.2.tgz#399ab18aac45802d6f2498de5054fcbbe716a805" + integrity sha512-zZ4hShnmnoVnAHpVHWpTcxdv7dWP60S2FsydQLV8V5PbS3FifjWFFRiHSWpDJahly88PRyV5teTSLoq4eG7mKw== typescript@^3.7.3: version "3.9.9"