Skip to content

Commit

Permalink
Merge pull request #3302 from Emurgo/release/5.0
Browse files Browse the repository at this point in the history
Release / 5.0
  • Loading branch information
vsubhuman authored Dec 7, 2023
2 parents 4f0a873 + 3e60788 commit d4771b4
Show file tree
Hide file tree
Showing 455 changed files with 22,777 additions and 8,689 deletions.
2 changes: 2 additions & 0 deletions build-release.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@ elif [ $1 = "stable-mv2" ];
then RELEASE_TYPE="stable-mv2"
elif [ $1 = "nightly" ];
then RELEASE_TYPE="nightly"
elif [ $1 = "nightly-mv2" ];
then RELEASE_TYPE="nightly-mv2"
else
echo "First parameter is expected 'stable', 'stable-mv2', or 'nightly'"
return 1
Expand Down
3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,8 @@
"flow": "lerna run flow --stream",
"test": "lerna run test --stream",
"translations:purge": "lerna run translations:purge -- stream",
"dev:all": "concurrently \"npm run dev:stable --prefix packages/yoroi-extension\" \"npm run cardano --prefix packages/yoroi-connector\" \"npm run ergo --prefix packages/yoroi-connector\" "
"dev:all": "concurrently \"npm run dev:stable --prefix packages/yoroi-extension\" \"npm run cardano --prefix packages/yoroi-connector\" ",
"archive:src": "func() { git rev-parse HEAD > COMMIT && git rev-parse --abbrev-ref HEAD > BRANCH && git archive --format zip --add-file COMMIT --add-file BRANCH -o $1 HEAD && rm COMMIT BRANCH; }; func"
},
"husky": {
"hooks": {
Expand Down
6 changes: 3 additions & 3 deletions packages/yoroi-extension/.eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ module.exports = {
'no-plusplus': 0,
'no-bitwise': 0,
'no-underscore-dangle': 0,
'no-console': 1,
'no-console': 0,
'no-mixed-operators': 0,
'no-multi-assign': 0,
'no-undef-init': 0, // need this to improve Flow type inference
Expand All @@ -86,11 +86,11 @@ module.exports = {
'arrow-body-style': 0,
'key-spacing': 1,
'no-empty-function': 1,
'max-len': 1,
'max-len': ['warn', { code: 120 }],
'no-useless-escape': 1,
'prefer-const': 1,
'object-curly-spacing': 1,
'spaced-comment': 1,
'spaced-comment': 0,
quotes: ['error', 'single', { avoidEscape: true, allowTemplateLiterals: true }],
'import/imports-first': 1,
'react/jsx-indent': 1,
Expand Down
2 changes: 1 addition & 1 deletion packages/yoroi-extension/.flowconfig
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ deprecated-utility=error

[options]
types_first=true
include_warnings=true
include_warnings=false
esproposal.decorators=ignore
module.ignore_non_literal_requires=true
module.name_mapper.extension='scss' -> '<PROJECT_ROOT>/flow/mappers/CSSModule.js.flow'
Expand Down
14 changes: 14 additions & 0 deletions packages/yoroi-extension/ampli.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
{
"Zone": "us",
"OrgId": "208651",
"WorkspaceId": "67ef75aa-dab0-42d1-969d-f186d253bda8",
"SourceId": "829bd2d4-930e-40f5-b717-a9ed8e1235e1",
"Runtime": "browser:typescript-ampli-v2",
"Platform": "Browser",
"Language": "TypeScript",
"SDK": "@amplitude/analytics-browser@^1.0",
"Branch": "main",
"Version": "7.0.0",
"VersionId": "a0985241-d0c0-4bda-bc6d-271830af0067",
"Path": "./ampli"
}
38 changes: 38 additions & 0 deletions packages/yoroi-extension/ampli/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
The coerce the TypeScript Amplitude wrapper to work with flow, do these:

```
npm run metrics:pull
```

```
cd ampli
```


```
npx -p typescript tsc index.ts --outDir . -d -m es6
```

```
npx flowgen --interface-records --no-inexact --add-flow-header -o index.js.flow index.d.ts
```

```
sed -i 's/amplitude\.Types\.\w*/any/' index.js.flow
sed -i '/export type BaseEvent/d' index.js.flow
```

Edit `ampli.js.flow` to add the line `class BaseEvent {}`.

Then we have flow-typed ampli library where all event trigger functions are strongly typed.
To use this libray, import like this from source code:
```
import type { LoadOptionsWithEnvironment } from '../../../ampli/index';
```
instead of
```
import type { LoadOptionsWithEnvironment } from '../../../ampli';
```
Due to perhaps a bug in flow, the later short-circuits type checking.

Loading

0 comments on commit d4771b4

Please sign in to comment.