diff --git a/.gitignore b/.gitignore index 30f8bf2b1..9ffe50e13 100644 --- a/.gitignore +++ b/.gitignore @@ -52,6 +52,7 @@ npm-debug.log /Demo/package-lock.json /coverage/ test.html +/lib # Foundry diff --git a/babel.config.js b/babel.config.js index f842b77fc..5ae49c32b 100644 --- a/babel.config.js +++ b/babel.config.js @@ -1,3 +1,3 @@ module.exports = { - presets: ['module:metro-react-native-babel-preset'], + presets: ["module:metro-react-native-babel-preset"], }; diff --git a/package.json b/package.json index 2dde9701e..50f55f11e 100644 --- a/package.json +++ b/package.json @@ -6,13 +6,15 @@ "repository": "https://github.com/archriss/react-native-render-html", "description": "React Native component that renders HTML as native views", "types": "types/react-native-render-html/index.d.ts", - "main": "src/index.js", + "main": "lib/index.js", "scripts": { - "test": "npm run test:js && npm run test:ts && npm run test:lint", + "test": "yarn test:js && yarn test:ts && yarn test:lint", "test:ts": "dtslint types/react-native-render-html", "test:js": "jest", "test:lint": "eslint src/", - "fixlint": "prettier --write src/" + "fixlint": "prettier --write src/", + "build": "babel src --out-dir lib", + "prepack": "yarn build" }, "keywords": [ "react-native", @@ -30,6 +32,7 @@ "react-native": "*" }, "devDependencies": { + "@babel/cli": "^7.12.8", "@babel/core": "^7.12.9", "@babel/runtime": "^7.12.5", "@react-native-community/eslint-config": "^2.0.0", diff --git a/yarn.lock b/yarn.lock index 8032696f4..bcebadf42 100644 --- a/yarn.lock +++ b/yarn.lock @@ -5,6 +5,34 @@ __metadata: version: 4 cacheKey: 7 +"@babel/cli@npm:^7.12.8": + version: 7.12.8 + resolution: "@babel/cli@npm:7.12.8" + dependencies: + "@nicolo-ribaudo/chokidar-2": 2.1.8-no-fsevents + chokidar: ^3.4.0 + commander: ^4.0.1 + convert-source-map: ^1.1.0 + fs-readdir-recursive: ^1.1.0 + glob: ^7.0.0 + lodash: ^4.17.19 + make-dir: ^2.1.0 + slash: ^2.0.0 + source-map: ^0.5.0 + peerDependencies: + "@babel/core": ^7.0.0-0 + dependenciesMeta: + "@nicolo-ribaudo/chokidar-2": + optional: true + chokidar: + optional: true + bin: + babel: ./bin/babel.js + babel-external-helpers: ./bin/babel-external-helpers.js + checksum: 88f0a2e2a30cc5ba3cb8165f1dfcea31495116632bbfe9a4f327d893c358c5b3c4d7f9486760c3cae7710a02e3d232d193478d573bd39db75b3350ee6f967bad + languageName: node + linkType: hard + "@babel/code-frame@npm:^7.0.0, @babel/code-frame@npm:^7.10.4": version: 7.10.4 resolution: "@babel/code-frame@npm:7.10.4" @@ -1346,6 +1374,25 @@ __metadata: languageName: node linkType: hard +"@nicolo-ribaudo/chokidar-2@npm:2.1.8-no-fsevents": + version: 2.1.8-no-fsevents + resolution: "@nicolo-ribaudo/chokidar-2@npm:2.1.8-no-fsevents" + dependencies: + anymatch: ^2.0.0 + async-each: ^1.0.1 + braces: ^2.3.2 + glob-parent: ^3.1.0 + inherits: ^2.0.3 + is-binary-path: ^1.0.0 + is-glob: ^4.0.0 + normalize-path: ^3.0.0 + path-is-absolute: ^1.0.0 + readdirp: ^2.2.1 + upath: ^1.1.1 + checksum: 0efeea3b7d9e3c07dc3ded371ba65351a7c30314763f6e2d34849bf58809655f0f9bd71fcd505ab72624cd17e80e738a0bd41aac0d7d8606664817f3fe85cfba + languageName: node + linkType: hard + "@react-native-community/cli-debugger-ui@npm:^4.13.1": version: 4.13.1 resolution: "@react-native-community/cli-debugger-ui@npm:4.13.1" @@ -2041,7 +2088,7 @@ __metadata: languageName: node linkType: hard -"anymatch@npm:^3.0.3": +"anymatch@npm:^3.0.3, anymatch@npm:~3.1.1": version: 3.1.1 resolution: "anymatch@npm:3.1.1" dependencies: @@ -2219,6 +2266,13 @@ __metadata: languageName: node linkType: hard +"async-each@npm:^1.0.1": + version: 1.0.3 + resolution: "async-each@npm:1.0.3" + checksum: 0cf01982ae42db5ce591aab153e45e77aa7c813c4fb282f1e7cac2259f90949f82542e82a33f73ef308e0126c9a8bc702ee117a87614549fe88840cf5a44aec4 + languageName: node + linkType: hard + "async@npm:^2.4.0": version: 2.6.3 resolution: "async@npm:2.6.3" @@ -2458,6 +2512,20 @@ __metadata: languageName: node linkType: hard +"binary-extensions@npm:^1.0.0": + version: 1.13.1 + resolution: "binary-extensions@npm:1.13.1" + checksum: 7cdacc6dadaffb6a4d250c39ca51e1fd7ba0fd846348e2813465dfaa7fce1e59a3465c1555578e7e4e7959023b47824cc387b37780e2160f52fface775cc0133 + languageName: node + linkType: hard + +"binary-extensions@npm:^2.0.0": + version: 2.1.0 + resolution: "binary-extensions@npm:2.1.0" + checksum: 12bee2817930b211b88f6de5da2edb64f924ffde79e01516fcb17005a39e75374fae1ce1a9c58b52557a4d81eb6eb7a804cbe7170ea3a553919a7ce0053e2e4f + languageName: node + linkType: hard + "bindings@npm:^1.5.0": version: 1.5.0 resolution: "bindings@npm:1.5.0" @@ -2495,7 +2563,7 @@ __metadata: languageName: node linkType: hard -"braces@npm:^2.3.1": +"braces@npm:^2.3.1, braces@npm:^2.3.2": version: 2.3.2 resolution: "braces@npm:2.3.2" dependencies: @@ -2513,7 +2581,7 @@ __metadata: languageName: node linkType: hard -"braces@npm:^3.0.1": +"braces@npm:^3.0.1, braces@npm:~3.0.2": version: 3.0.2 resolution: "braces@npm:3.0.2" dependencies: @@ -2708,6 +2776,25 @@ __metadata: languageName: node linkType: hard +"chokidar@npm:^3.4.0": + version: 3.4.3 + resolution: "chokidar@npm:3.4.3" + dependencies: + anymatch: ~3.1.1 + braces: ~3.0.2 + fsevents: ~2.1.2 + glob-parent: ~5.1.0 + is-binary-path: ~2.1.0 + is-glob: ~4.0.1 + normalize-path: ~3.0.0 + readdirp: ~3.5.0 + dependenciesMeta: + fsevents: + optional: true + checksum: b5a566b31267b1a71c2e7544fbf8c21f597883515d9bfc0356719be6c3b34ee51b0329f3ee5f5d98060ce2930be68f8c33b53f8b3659dc101fd51be265831deb + languageName: node + linkType: hard + "chownr@npm:^2.0.0": version: 2.0.0 resolution: "chownr@npm:2.0.0" @@ -2899,6 +2986,13 @@ __metadata: languageName: node linkType: hard +"commander@npm:^4.0.1": + version: 4.1.1 + resolution: "commander@npm:4.1.1" + checksum: 448585071bf8fb4c0bf9dd52abaee43dea086f801334caec2c8e8c9f456f8abc224c1614ccbbdbf7da5ac2524d230f13cf1fc86c233cf8a041ebecea7df106e9 + languageName: node + linkType: hard + "commander@npm:~2.14.1": version: 2.14.1 resolution: "commander@npm:2.14.1" @@ -2989,7 +3083,7 @@ __metadata: languageName: node linkType: hard -"convert-source-map@npm:^1.4.0, convert-source-map@npm:^1.6.0, convert-source-map@npm:^1.7.0": +"convert-source-map@npm:^1.1.0, convert-source-map@npm:^1.4.0, convert-source-map@npm:^1.6.0, convert-source-map@npm:^1.7.0": version: 1.7.0 resolution: "convert-source-map@npm:1.7.0" dependencies: @@ -4292,6 +4386,13 @@ __metadata: languageName: node linkType: hard +"fs-readdir-recursive@npm:^1.1.0": + version: 1.1.0 + resolution: "fs-readdir-recursive@npm:1.1.0" + checksum: dec853d7418a9a2c1295d0dbf602505655bebed76474d656d68ed3e06bc84db651325b795509221f186955791965ec0add261919d464cae76dd3b8564f462054 + languageName: node + linkType: hard + "fs.realpath@npm:^1.0.0": version: 1.0.0 resolution: "fs.realpath@npm:1.0.0" @@ -4337,6 +4438,24 @@ fsevents@^2.1.2: languageName: node linkType: hard +"fsevents@patch:fsevents@~2.1.2#builtin": + version: 2.1.3 + resolution: "fsevents@patch:fsevents@npm%3A2.1.3#builtin::version=2.1.3&hash=11e9ea" + dependencies: + node-gyp: latest + checksum: e2b8c379340e21a786d32c653854c8876f94eb1202dd5be378fd42c062bc123aab5051c32bf0011865257c85982c41ded203f9fe8c9f9c8f8c84dc4672abc0e0 + languageName: node + linkType: hard + +fsevents@~2.1.2: + version: 2.1.3 + resolution: "fsevents@npm:2.1.3" + dependencies: + node-gyp: latest + checksum: 8977781884d06c5bcb97b5f909efdce9683c925f2a0ce7e098d2cdffe2e0a0a50b1868547bb94dca75428c06535a4a70517a7bb3bb5a974d93bf9ffc067291eb + languageName: node + linkType: hard + "function-bind@npm:^1.1.1": version: 1.1.1 resolution: "function-bind@npm:1.1.1" @@ -4447,7 +4566,17 @@ fsevents@^2.1.2: languageName: node linkType: hard -"glob-parent@npm:^5.0.0": +"glob-parent@npm:^3.1.0": + version: 3.1.0 + resolution: "glob-parent@npm:3.1.0" + dependencies: + is-glob: ^3.1.0 + path-dirname: ^1.0.0 + checksum: 2827ec4405295b660d5ec3e400d84d548a22fc38c3de8fb4586258248bb24afc4515f377935fd80b8397debeb56ffe0d2f4e91233e3a1377fe0d1ddbceb605fc + languageName: node + linkType: hard + +"glob-parent@npm:^5.0.0, glob-parent@npm:~5.1.0": version: 5.1.1 resolution: "glob-parent@npm:5.1.1" dependencies: @@ -4456,7 +4585,7 @@ fsevents@^2.1.2: languageName: node linkType: hard -"glob@npm:^7.1.1, glob@npm:^7.1.2, glob@npm:^7.1.3, glob@npm:^7.1.4, glob@npm:^7.1.6": +"glob@npm:^7.0.0, glob@npm:^7.1.1, glob@npm:^7.1.2, glob@npm:^7.1.3, glob@npm:^7.1.4, glob@npm:^7.1.6": version: 7.1.6 resolution: "glob@npm:7.1.6" dependencies: @@ -4869,6 +4998,24 @@ fsevents@^2.1.2: languageName: node linkType: hard +"is-binary-path@npm:^1.0.0": + version: 1.0.1 + resolution: "is-binary-path@npm:1.0.1" + dependencies: + binary-extensions: ^1.0.0 + checksum: 25a2cda1e504403a179d1daf2773d6ea47ce383e912bc695bb9e923b5d5468447e239499be5c2212c7508be7777196810f8307e1d1f0e83a6191425eb22c2887 + languageName: node + linkType: hard + +"is-binary-path@npm:~2.1.0": + version: 2.1.0 + resolution: "is-binary-path@npm:2.1.0" + dependencies: + binary-extensions: ^2.0.0 + checksum: 49a1446a3cf3719e91a061f0e52add18fd065325c652c277519a2ad333440dc8b449076a893277a46940ef16f05a908716667ca8f986b28c677b9acb11e10a36 + languageName: node + linkType: hard + "is-buffer@npm:^1.1.5": version: 1.1.6 resolution: "is-buffer@npm:1.1.6" @@ -4982,7 +5129,7 @@ fsevents@^2.1.2: languageName: node linkType: hard -"is-extglob@npm:^2.1.1": +"is-extglob@npm:^2.1.0, is-extglob@npm:^2.1.1": version: 2.1.1 resolution: "is-extglob@npm:2.1.1" checksum: ca623e2c56c893714a237aff645ec7caa8fea4d78868682af8d6803d7f0780323f8d566311e0dc6f942c886e81cbfa517597e48fcada7f3bf78a4d099eeecdd3 @@ -5019,7 +5166,16 @@ fsevents@^2.1.2: languageName: node linkType: hard -"is-glob@npm:^4.0.0, is-glob@npm:^4.0.1": +"is-glob@npm:^3.1.0": + version: 3.1.0 + resolution: "is-glob@npm:3.1.0" + dependencies: + is-extglob: ^2.1.0 + checksum: 9911e04e28285c50bfd5ff79950c6cf712ed9d959ef640acba2daeca8a17a921494b78b3143d5d1749c4dc3bbeb296b8955064a4f17d014112f0c63a239322d6 + languageName: node + linkType: hard + +"is-glob@npm:^4.0.0, is-glob@npm:^4.0.1, is-glob@npm:~4.0.1": version: 4.0.1 resolution: "is-glob@npm:4.0.1" dependencies: @@ -7041,7 +7197,7 @@ fsevents@^2.1.2: languageName: node linkType: hard -"normalize-path@npm:^3.0.0": +"normalize-path@npm:^3.0.0, normalize-path@npm:~3.0.0": version: 3.0.0 resolution: "normalize-path@npm:3.0.0" checksum: 215a701b471948884193628f3e38910353abf445306b519c42c2a30144b8beb8ca0a684da97bfc2ee11eb168c35c776d484274da4bd8f213d2b22f70579380ee @@ -7472,6 +7628,13 @@ fsevents@^2.1.2: languageName: node linkType: hard +"path-dirname@npm:^1.0.0": + version: 1.0.2 + resolution: "path-dirname@npm:1.0.2" + checksum: 4af73745fd97680c95b356b88450cd4c21d6825d0580620331382a6c910b76b3ced4aa2c4ddc2953d938bd758906b3d3aa2f56a2f601ec52763ed2cbbfc0106b + languageName: node + linkType: hard + "path-exists@npm:^3.0.0": version: 3.0.0 resolution: "path-exists@npm:3.0.0" @@ -7521,7 +7684,7 @@ fsevents@^2.1.2: languageName: node linkType: hard -"picomatch@npm:^2.0.4, picomatch@npm:^2.0.5": +"picomatch@npm:^2.0.4, picomatch@npm:^2.0.5, picomatch@npm:^2.2.1": version: 2.2.2 resolution: "picomatch@npm:2.2.2" checksum: 20fa75e0a58b39d83425b3db68744d5f6f361fd4fd66ec7745d884036d502abba0d553a637703af79939b844164b13e60eea339ccb043d7fbd74c3da2592b864 @@ -7794,6 +7957,7 @@ fsevents@^2.1.2: version: 0.0.0-use.local resolution: "react-native-render-html@workspace:." dependencies: + "@babel/cli": ^7.12.8 "@babel/core": ^7.12.9 "@babel/runtime": ^7.12.5 "@react-native-community/eslint-config": ^2.0.0 @@ -7820,7 +7984,6 @@ fsevents@^2.1.2: peerDependencies: react: "*" react-native: "*" - react-native-webview: "*" languageName: unknown linkType: soft @@ -7942,7 +8105,7 @@ fsevents@^2.1.2: languageName: node linkType: hard -"readable-stream@npm:^2.0.1, readable-stream@npm:^2.0.6, readable-stream@npm:^2.2.2, readable-stream@npm:~2.3.6": +"readable-stream@npm:^2.0.1, readable-stream@npm:^2.0.2, readable-stream@npm:^2.0.6, readable-stream@npm:^2.2.2, readable-stream@npm:~2.3.6": version: 2.3.7 resolution: "readable-stream@npm:2.3.7" dependencies: @@ -7957,6 +8120,26 @@ fsevents@^2.1.2: languageName: node linkType: hard +"readdirp@npm:^2.2.1": + version: 2.2.1 + resolution: "readdirp@npm:2.2.1" + dependencies: + graceful-fs: ^4.1.11 + micromatch: ^3.1.10 + readable-stream: ^2.0.2 + checksum: 00b5209ee5278ba6faa2fbcabb817e8f64a498ff7fee8cfd30634a04140e673375582812c67c59e25ee3ee9979687b1c832f33e1bbacd8ac3340bab0645b8374 + languageName: node + linkType: hard + +"readdirp@npm:~3.5.0": + version: 3.5.0 + resolution: "readdirp@npm:3.5.0" + dependencies: + picomatch: ^2.2.1 + checksum: a64fe5606937d9655252230003362d95da05dbfd3baecedb4bb8c1bc0df497d051a192f9b75345c944e58a0b362c68349be602d6dbf05d03770e510b35a9f80f + languageName: node + linkType: hard + "realpath-native@npm:^2.0.0": version: 2.0.0 resolution: "realpath-native@npm:2.0.0" @@ -9512,6 +9695,13 @@ resolve@1.1.7: languageName: node linkType: hard +"upath@npm:^1.1.1": + version: 1.2.0 + resolution: "upath@npm:1.2.0" + checksum: ecb08ff3e7e3b152e03bceb7089e6f0077bf3494764397a301eb99a7a5cd4c593ea4d0b13a7714195ad8a3ddca9d7a5964037a1c0bc712e1ba7b67a79165a0be + languageName: node + linkType: hard + "uri-js@npm:^4.2.2": version: 4.4.0 resolution: "uri-js@npm:4.4.0"