Skip to content

Commit

Permalink
Vite node 18 (#4190)
Browse files Browse the repository at this point in the history
* add: switch to node 18

* fix: webpack node 18 ssl

* fix: remove node ossl

* add: yarn 3

* add: update actions to node 18

* fix: depracated set-output

* fix: node 18 resolve localhost

* fix: snapshot

* fix: claim snapshot

* fix: claim snapshot

* wip: try node 20

* wip: vercel doesnt support node 20

* add: memory fix

* fix: snapshot

* fix: actions yaml

* fix: blockchainsetup yarn3

* add: update goodprotocol

* wip: yarn v3

* wip: goodprotocol yarn3

* wip: verify node-jq exists

* wip: nodejq

* wip: nodejq

* wip: nodejq

* wip: nodejq

* wip: nodejq

* fix: nodejq

* fix: failing test snapshot

* wip: blockchian setup

* wip: no cache?

* fix: missing node_modules

* wip: yarn node 18

* fix: yarn lock

* fix: snapshots

* fix: snapshot

* fix: snapshot with node 18.18

* add: update yarn

* wip: vite - renamed to jsx

* wip: vite - project dev compile fixes

* wip: vite animations and wave pattern

* wip: vite keyboard aware

* add: working vite dev and build

* add: working react native

* refactor: prettier

* fix: lingui

* fix: remove ignored

* fix: ignore mjs catalog

* fix: lingui mjs imports

* fix: gql loader

* add: copy fv resources

* fix: posthog optional react-navigation native

* - remove facetec patch, replace with new fixed version, small adjustments over the project

* fix: posthog optional

* wip: jest

* fix: snapshots to jsx

* wip: initial jest

* fix: jest svg and css

* fix: snapshots

* fix: jest uint8array

* fix: useconnection

* fix: unit tests

* fix: .env.test usage for jest

* fix: include jsx unit tests

* fix: snapshots with .env.test

* Merge branch 'master' into vite-node-18

* add: service worker. upgrade posthog

* add: vite sentry

* fix: lottie issue

* fix: sourcemaps oom

* fix: close svg

* wip: temp disable sourcemaps

* wip: test remove sentry

* wip: without sentry

* add: optimize imports

* wip: retry sentry

* wip: vercel build with sentry

* wip: sentry vite fixes

* wip: vercel vite sentry

* wip: sentry vercel vite

* fix: restore posthog-rn vite fixes

* fix: gql for native

* add: metro 0.8

* increase heap_size, use legacyPlugin for globalThis, lint fixes

* add: build-12

* fix: make ceramic and orbis compile on native

* fix: vite broken svgs

* chore: add .env local, fix: close button dialog

* fix: jest ceramic imports

* fix: yarn.lock

* fix: failing tests

* wip: exclude problematic snapshot for now

* fix: vercel oom

* wip: fix claim snapshot mismatch and vite oom

* wip: vercel oom

* fix: sourcemaps oom

* fix: vercel oom

* wip: vercel oom

* wip: vercel oom

* wip: vercel oom

* fix: method definition order

* fix: facetec sdk import for vite

* fix: facetecsdk for unit tests

* fix: regex

* Dynamic import facetecsdk vite (#4219)

* add: dynamic import

* refactor: use once instead of let

* add: bump ceramic

* fix: jest ceramic import

---------

Co-authored-by: John Smith <[email protected]>
Co-authored-by: LewisB <[email protected]>
  • Loading branch information
3 people authored Mar 5, 2024
1 parent aae7b90 commit 4636624
Show file tree
Hide file tree
Showing 607 changed files with 13,227 additions and 7,776 deletions.
71 changes: 45 additions & 26 deletions .eslintrc
Original file line number Diff line number Diff line change
Expand Up @@ -6,24 +6,43 @@
"plugin:import/recommended",
"plugin:prettier/recommended",
"plugin:react/recommended",
"prettier"
"prettier",
],
"parserOptions": {
"ecmaFeatures": {
"jsx": true,
},
},
"overrides": [
{
"files": ["*.jsx", "*.js"],
},
],
"plugins": ["flowtype", "import", "prettier", "react", "react-hooks"],
"settings": {
"react": {
"pragma": "React",
"version": "detect",
"flowVersion": "0.89"
"flowVersion": "0.89",
},
"import/resolver": {
"node": {
"paths": ["src"],
"extensions": [".js", ".android.js", ".ios.js", ".web.js", ".native.js"]
}
"extensions": [
".jsx",
".web.jsx",
".js",
".android.js",
".ios.js",
".web.js",
".native.js",
".svg",
".native.jsx",
".json",
],
},
},
"import/ignore": [
"node_modules/react-native/index\\.js$"
]
"import/ignore": ["node_modules/react-native/index\\.js$"],
},
"rules": {
"prettier/prettier": "warn",
Expand All @@ -33,29 +52,29 @@
"react-hooks/exhaustive-deps": "off",
"import/no-cycle": "warn",
"import/named": "warn",
"import/no-unresolved": "warn",
"import/no-unresolved": ["warn", { "ignore": ["\\.svg", "data$", "\\.gql"] }],
"import/first": "warn",
"import/no-duplicates": "warn",
"import/no-anonymous-default-export": "off",
"import/no-named-as-default-member": "off",
"import/order": [
"warn",
{
"groups": ["builtin", "external", "internal", "parent", "sibling", "index"]
}
"groups": ["builtin", "external", "internal", "parent", "sibling", "index"],
},
],
"sort-imports": [
"warn",
{
"ignoreCase": true,
"ignoreDeclarationSort": true
}
"ignoreDeclarationSort": true,
},
],
"no-console": [
"warn",
{
"allow": ["info"]
}
"allow": ["info"],
},
],
"no-await-in-loop": "warn",
"curly": "warn",
Expand All @@ -64,32 +83,32 @@
"no-implicit-coercion": [
"warn",
{
"boolean": false
}
"boolean": false,
},
],
"no-return-await": "warn",
"no-useless-catch": "warn",
"require-await": "warn",
"array-bracket-newline": [
"warn",
{
"multiline": true
}
"multiline": true,
},
],
"block-spacing": "warn",
"brace-style": [
"warn",
"1tbs",
{
"allowSingleLine": true
}
"allowSingleLine": true,
},
],
"camelcase": [
"warn",
{
"ignoreDestructuring": true,
"properties": "never"
}
"properties": "never",
},
],
"comma-dangle": ["warn", "only-multiline"],
"comma-spacing": "warn",
Expand All @@ -109,11 +128,11 @@
"allowBlockEnd": false,
"allowObjectEnd": false,
"allowArrayEnd": false,
"allowClassEnd": false
}
"allowClassEnd": false,
},
],
"no-negated-condition": "off",
"space-before-function-paren": "off",
"require-atomic-updates": "off"
}
"require-atomic-updates": "off",
},
}
4 changes: 2 additions & 2 deletions .github/workflows/android.yml
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ jobs:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
node-version: 16
node-version: 18
cache: 'yarn'
- uses: actions/setup-python@v4
with:
Expand Down Expand Up @@ -126,7 +126,7 @@ jobs:
ref: ${{ env.TARGET_BRANCH }}
- uses: actions/setup-node@v3
with:
node-version: 16
node-version: 18
cache: 'yarn'
- uses: actions/setup-python@v4
with:
Expand Down
48 changes: 31 additions & 17 deletions .github/workflows/webtests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,8 @@ jobs:
steps:
- uses: actions/setup-node@v3
with:
node-version: 16
- uses: actions/checkout@v2
node-version: 18
- uses: actions/checkout@v3
with:
persist-credentials: false
fetch-depth: 0
Expand Down Expand Up @@ -67,15 +67,15 @@ jobs:
wallet-chunk-id: ${{ steps['set-test-chunk-ids'].outputs['wallet-chunk-id'] }}

steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v3
- id: set-test-chunks
name: Set Chunks
run: echo "::set-output name=test-chunks::$(find ./src -path \*/__tests__/*.js | sort | jq -R -s -c 'split("\n")[:-1] | map(select(contains("__util") == false))' | jq -cM '[_nwise(length / 10 | floor)]')"
run: echo "test-chunks=$(find ./src -path \*/__tests__/*.js* | sort | jq -R -s -c 'split("\n")[:-1] | map(select(contains("__util") == false))' | jq -cM '[_nwise(length / 10 | floor)]')" >> $GITHUB_OUTPUT
- id: set-test-chunk-ids
name: Set Chunk IDs
run: |
echo "::set-output name=test-chunk-ids::$(echo $CHUNKS | jq -cM 'to_entries | map(.key)')"
echo "::set-output name=wallet-chunk-id::$(echo $CHUNKS | jq -cM 'to_entries | map(select(.value | .[] | index("GoodWallet"))) | unique | first | .key')"
echo "test-chunk-ids=$(echo $CHUNKS | jq -cM 'to_entries | map(.key)')" >> $GITHUB_OUTPUT
echo "wallet-chunk-id=$(echo $CHUNKS | jq -cM 'to_entries | map(select(.value | .[] | index("GoodWallet"))) | unique | first | .key')" >> $GITHUB_OUTPUT
env:
CHUNKS: ${{ steps['set-test-chunks'].outputs['test-chunks'] }}

Expand All @@ -102,10 +102,10 @@ jobs:
steps:
- run: echo "wallet chunk id $WALLET_CHUNK chunk ${{ matrix.chunk }}"
- run: corepack enable
- uses: actions/checkout@v2
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
node-version: 16
node-version: 18
cache: 'yarn'
- uses: actions/setup-python@v4
with:
Expand All @@ -114,17 +114,19 @@ jobs:
- name: Install dependencies
run: yarn --immutable

- uses: actions/cache@v2
id: contractsCache
if: matrix.chunk == env.WALLET_CHUNK
name: cache goodcontracts
with:
path: /tmp/goodprotocol
key: ${{ hashFiles('node_modules/@gooddollar/goodprotocol/yarn.lock') }}
# - uses: actions/cache@v3
# id: contractsCache
# if: matrix.chunk == env.WALLET_CHUNK
# name: cache goodcontracts
# with:
# path: /tmp/goodprotocol
# key: ${{ hashFiles('node_modules/@gooddollar/goodprotocol/yarn.lock') }}

- name: install goodcontracts
if: matrix.chunk == env.WALLET_CHUNK
run: ./scripts/blockchainTestSetup.sh
run: |
npm i -g yarn
yarn test:setup
- name: run local node so providers dont crash in tests
if: matrix.chunk != env.WALLET_CHUNK
Expand All @@ -134,7 +136,7 @@ jobs:
env:
NODE_OPTIONS: '--max-old-space-size=8192'
run: |
cat node_modules/@gooddollar/goodcontracts/releases/deployment.json
echo $CHUNKS | jq '.[${{ matrix.chunk }}] | .[] | @text'
echo $CHUNKS | jq '.[${{ matrix.chunk }}] | .[] | @text' | xargs yarn coverage
- name: Coveralls
Expand All @@ -153,3 +155,15 @@ jobs:
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
parallel-finished: true

# This allows us to have a branch protection rule for tests and deploys with matrix
deploy-status:
needs: test
runs-on: ubuntu-latest
steps:
- name: Successful deploy
if: ${{ !(contains(needs.*.result, 'failure')) }}
run: exit 0
- name: Failing deploy
if: ${{ contains(needs.*.result, 'failure') }}
run: exit 1
4 changes: 3 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
# Xcode
#
build/
dist/
*.pbxuser
!default.pbxuser
*.mode1v3
Expand Down Expand Up @@ -86,7 +87,7 @@ account.data.txt
# Localization build files
src/language/locales/index.js
src/language/locales/*/*.js

src/language/locales/*/*.mjs
# Bundle artifact
*.jsbundle

Expand All @@ -111,3 +112,4 @@ service-worker.js
.env_old
.env_lewis
.env.development
.env.development.local
4 changes: 2 additions & 2 deletions .prettierrc
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,5 @@
"printWidth": 120,
"trailingComma": "all",
"arrowParens": "avoid",
"bracketSpacing":true
}
"bracketSpacing": true
}
12 changes: 12 additions & 0 deletions .yarn/patches/jest-environment-jsdom-npm-29.7.0-0b72dd0e0b.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
diff --git a/build/index.js b/build/index.js
index 2e6c16c33c2f588cf8d6a5717ac776bb8908bd0d..da8511efd5d72bbffdb359aea87cc8dee00ecc14 100644
--- a/build/index.js
+++ b/build/index.js
@@ -95,6 +95,7 @@ class JSDOMEnvironment {

// TODO: remove this ASAP, but it currently causes tests to run really slow
global.Buffer = Buffer;
+ global.Uint8Array = Uint8Array;

// Report uncaught errors.
this.errorEventListener = event => {
13 changes: 13 additions & 0 deletions .yarn/patches/react-native-card-flip-npm-1.0.7-64320a3ab5.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
diff --git a/CardFlip.js b/CardFlip.js
index 70f268322bdda93b660aa32ddd65d31cc0edf1c0..8b12a1117f8f8ed3e4d443f76d7fcc6a3b81d118 100644
--- a/CardFlip.js
+++ b/CardFlip.js
@@ -4,7 +4,7 @@ import { polyfill } from 'react-lifecycles-compat';

import { Platform, StyleSheet, Animated } from "react-native";

-class CardFlip extends Component<Props> {
+class CardFlip extends Component {
constructor(props) {
super(props);
this.state = {
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
diff --git a/index.js b/index.js
index 2246cb1b6bdf8e3d3368b3d2dfa0b1924c799635..b711e03f55e747b2a0bb3a9cc8627b565aa1a523 100644
--- a/index.js
+++ b/index.js
@@ -4,4 +4,3 @@

import ModalDropdown from './components/ModalDropdown';
export default ModalDropdown;
-module.exports = ModalDropdown;
14 changes: 14 additions & 0 deletions .yarn/patches/react-native-switch-npm-1.5.1-b88f08d2f6.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
diff --git a/lib/Switch.js b/lib/Switch.js
index e11575f2fc2f2ddea793bbcfd8d44c0a91c652af..6b552f8bc88447cbb0171ed52ade017a3b08d38e 100644
--- a/lib/Switch.js
+++ b/lib/Switch.js
@@ -5,8 +5,7 @@ import {
StyleSheet,
Animated,
PanResponder,
- TouchableWithoutFeedback,
- ViewPropTypes
+ TouchableWithoutFeedback
} from "react-native";
import PropTypes from "prop-types";

19 changes: 19 additions & 0 deletions .yarn/patches/vite-plugin-svgr-npm-4.2.0-e0c6a7a1f0.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
diff --git a/dist/index.js b/dist/index.js
index b5cbcb44b3bdd60b2b91cb705450f0dfdc758615..b5acfbaf6dced81232d6a8a0654ee5408a5560d5 100644
--- a/dist/index.js
+++ b/dist/index.js
@@ -11,12 +11,13 @@ export default function vitePluginSvgr({ svgrOptions, esbuildOptions, include =
if (filter(id)) {
const { transform } = await import("@svgr/core");
const { default: jsx } = await import("@svgr/plugin-jsx");
+ const { default: svgo } = await import("@svgr/plugin-svgo");
const filePath = id.replace(postfixRE, "");
const svgCode = await fs.promises.readFile(filePath, "utf8");
const componentCode = await transform(svgCode, svgrOptions, {
filePath,
caller: {
- defaultPlugins: [jsx],
+ defaultPlugins: [svgo.default, jsx],
},
});
const res = await transformWithEsbuild(componentCode, id, {
Loading

0 comments on commit 4636624

Please sign in to comment.