mirror of https://github.com/waku-org/js-waku.git
feat: add react-native polyfills (#1915)
* make publishing from any branch * feat: add @waku/pollyills package * add package tracking * up lock * add peer dependencies and other improvements * up lock * up lock * use es module syntax, remove usage of rollup * rename to react-native-polyfills * up command * up lock
This commit is contained in:
parent
bf42c8f53a
commit
9be942fc23
|
@ -5,7 +5,7 @@ jobs:
|
||||||
pre-release:
|
pre-release:
|
||||||
name: pre-release
|
name: pre-release
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
if: github.event_name == 'workflow_dispatch' && github.ref == 'refs/heads/master'
|
if: github.event_name == 'workflow_dispatch'
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v3
|
- uses: actions/checkout@v3
|
||||||
with:
|
with:
|
||||||
|
|
File diff suppressed because it is too large
Load Diff
|
@ -15,7 +15,8 @@
|
||||||
"packages/sdk",
|
"packages/sdk",
|
||||||
"packages/tests",
|
"packages/tests",
|
||||||
"packages/browser-tests",
|
"packages/browser-tests",
|
||||||
"packages/build-utils"
|
"packages/build-utils",
|
||||||
|
"packages/react-native-polyfills"
|
||||||
],
|
],
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"prepare": "husky install",
|
"prepare": "husky install",
|
||||||
|
|
|
@ -0,0 +1,6 @@
|
||||||
|
module.exports = {
|
||||||
|
parserOptions: {
|
||||||
|
tsconfigRootDir: __dirname,
|
||||||
|
project: "./tsconfig.dev.json"
|
||||||
|
}
|
||||||
|
};
|
|
@ -0,0 +1 @@
|
||||||
|
# Changelog
|
|
@ -0,0 +1,60 @@
|
||||||
|
{
|
||||||
|
"name": "@waku/react-native-polyfills",
|
||||||
|
"version": "0.0.1",
|
||||||
|
"description": "Set of polyfills for Waku for React Native environment",
|
||||||
|
"module": "./dist/index.js",
|
||||||
|
"exports": {
|
||||||
|
".": "./dist/index.js",
|
||||||
|
"./metro": "./dist/metro.js"
|
||||||
|
},
|
||||||
|
"type": "module",
|
||||||
|
"homepage": "https://github.com/waku-org/js-waku/tree/master/packages/react-native-polyfills#readme",
|
||||||
|
"repository": {
|
||||||
|
"type": "git",
|
||||||
|
"url": "https://github.com/waku-org/js-waku.git"
|
||||||
|
},
|
||||||
|
"bugs": {
|
||||||
|
"url": "https://github.com/waku-org/js-waku/issues"
|
||||||
|
},
|
||||||
|
"license": "MIT OR Apache-2.0",
|
||||||
|
"keywords": [
|
||||||
|
"waku",
|
||||||
|
"decentralised",
|
||||||
|
"communication",
|
||||||
|
"web3",
|
||||||
|
"ethereum",
|
||||||
|
"dapps"
|
||||||
|
],
|
||||||
|
"scripts": {
|
||||||
|
"build": "run-s build:**",
|
||||||
|
"build:esm": "tsc",
|
||||||
|
"check": "run-s check:*",
|
||||||
|
"check:tsc": "tsc -p tsconfig.dev.json",
|
||||||
|
"check:spelling": "cspell \"{README.md,src/**/*.ts}\"",
|
||||||
|
"prepublish": "npm run build"
|
||||||
|
},
|
||||||
|
"engines": {
|
||||||
|
"node": ">=18"
|
||||||
|
},
|
||||||
|
"dependencies": {
|
||||||
|
"event-target-polyfill": "^0.0.4",
|
||||||
|
"react-native-url-polyfill": "^2.0.0",
|
||||||
|
"text-encoding-polyfill": "^0.6.7"
|
||||||
|
},
|
||||||
|
"devDependencies": {
|
||||||
|
"expo": "~50.0.13"
|
||||||
|
},
|
||||||
|
"peerDependencies": {
|
||||||
|
"expo": "~50.0.13",
|
||||||
|
"react-native": "0.73.6"
|
||||||
|
},
|
||||||
|
"files": [
|
||||||
|
"dist",
|
||||||
|
"bundle",
|
||||||
|
"src/**/*.ts",
|
||||||
|
"!**/*.json",
|
||||||
|
"CHANGELOG.md",
|
||||||
|
"LICENSE",
|
||||||
|
"README.md"
|
||||||
|
]
|
||||||
|
}
|
|
@ -0,0 +1,3 @@
|
||||||
|
import "event-target-polyfill";
|
||||||
|
import "text-encoding-polyfill";
|
||||||
|
import "react-native-url-polyfill/auto";
|
|
@ -0,0 +1,15 @@
|
||||||
|
import path, { dirname } from "path";
|
||||||
|
import { fileURLToPath } from "url";
|
||||||
|
|
||||||
|
import type { MetroConfig } from "expo/metro-config";
|
||||||
|
|
||||||
|
const __dirname = dirname(fileURLToPath(import.meta.url));
|
||||||
|
|
||||||
|
type Writeable<T> = { -readonly [P in keyof T]: Writeable<T[P]> };
|
||||||
|
|
||||||
|
export function setupWakuMetroConfig(config: Writeable<MetroConfig>): void {
|
||||||
|
config.resolver.unstable_enablePackageExports = true;
|
||||||
|
config.resolver.extraNodeModules = {
|
||||||
|
url: path.resolve(__dirname, "node_modules", "react-native-url-polyfill")
|
||||||
|
};
|
||||||
|
}
|
|
@ -0,0 +1,3 @@
|
||||||
|
{
|
||||||
|
"extends": "../../tsconfig.dev"
|
||||||
|
}
|
|
@ -0,0 +1,10 @@
|
||||||
|
{
|
||||||
|
"extends": "../../tsconfig",
|
||||||
|
"compilerOptions": {
|
||||||
|
"outDir": "dist/",
|
||||||
|
"rootDir": "src",
|
||||||
|
"tsBuildInfoFile": "dist/.tsbuildinfo"
|
||||||
|
},
|
||||||
|
"include": ["src"],
|
||||||
|
"exclude": ["src/**/*.spec.ts", "src/test_utils"]
|
||||||
|
}
|
|
@ -15,6 +15,7 @@
|
||||||
"packages/message-encryption": {},
|
"packages/message-encryption": {},
|
||||||
"packages/sdk": {},
|
"packages/sdk": {},
|
||||||
"packages/relay": {},
|
"packages/relay": {},
|
||||||
"packages/discovery": {}
|
"packages/discovery": {},
|
||||||
|
"packages/react-native-polyfills": {}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue