chore: move submodules to root

This commit is contained in:
mroz
2022-03-29 16:07:34 +02:00
committed by Szymon Lesisz
parent e3e84d2b8e
commit cd474f1858
12 changed files with 45 additions and 10 deletions

6
.gitmodules vendored
View File

@@ -1,3 +1,3 @@
[submodule "packages/transport/trezor-common"]
path = packages/transport/trezor-common
url = https://github.com/trezor/trezor-common.git
[submodule "submodules/trezor-common"]
path = submodules/trezor-common
url = https://github.com/trezor/trezor-common

View File

@@ -1,6 +1,6 @@
### custom prettier ignore config ###
packages/transport/trezor-common
submodules
### copy paste of .gitignore ###

View File

@@ -46,6 +46,8 @@
"msg-system-sign-config": "yarn workspace @trezor/suite-data msg-system-sign-config",
"format": "yarn prettier --write \"**/*.{js,ts,tsx,mdx,md,html,json}\"",
"format:verify": "yarn prettier --check \"**/*.{js,ts,tsx,mdx,md,html,json}\"",
"update-submodules": "./scripts/update-submodules.sh",
"update-coins": "./scripts/update-coins.sh",
"_______ Aliases _______": "Aliases for longer commands which we often have to run manually. Names don't have to be pretty or make total sense.",
"refs": "yarn update-project-references",
"types": "yarn type-check",

View File

@@ -21,8 +21,7 @@
"scripts/protobuf-build.sh",
"scripts/protobuf-patches",
"scripts/protobuf-types.js",
"messages.json",
"protobuf.d.ts"
"messages.json"
],
"scripts": {
"lint": "eslint '**/*.{ts,tsx,js}'",
@@ -31,7 +30,6 @@
"publish:lib": "./scripts/publish-lib.sh",
"test:unit": "jest",
"example:bridge": "jest --verbose -c jest.config.e2e.js --testPathPattern bridge.integration",
"update:submodules": "./scripts/update-submodules.sh",
"update:protobuf": "./scripts/protobuf-build.sh"
},
"devDependencies": {

View File

@@ -6,7 +6,7 @@ echo $#
PARENT_PATH=$( cd "$(dirname "${BASH_SOURCE[0]}")" ; pwd -P )
SRC="trezor-common/protob"
SRC="../../submodules/trezor-common/protob"
DIST="."
LANG="typescript"

View File

@@ -253,7 +253,7 @@ export type TypedCall = <T: MessageKey, R: MessageKey>(
// save to file
const filePath = isTypescript
? path.join(__dirname, '../protobuf.d.ts')
? path.join(__dirname, '../src/types/messages.ts')
: path.join(__dirname, '../protobuf.js');
fs.writeFile(filePath, lines.join('\n'), err => {
if (err) return console.log(err);

View File

@@ -19,6 +19,7 @@ export type {
AcquireInput,
TrezorDeviceInfoWithSession,
MessageFromTrezor,
Messages,
} from './types';
export default {

View File

@@ -1,3 +1,5 @@
export * as Messages from './messages';
// does not have session
export type TrezorDeviceInfo = {
path: string;

31
scripts/update-coins.sh Executable file
View File

@@ -0,0 +1,31 @@
#!/usr/bin/env bash
set -euxo pipefail
SRC='./submodules/trezor-common/tools'
DIST='./packages/connect-common/files'
# todo:
# if [ $# -ge 1 ] && [ "$1" == "local" ]
# then
# SRC='../trezor-firmware/common/tools'
# fi
# BUID coins.json using tezor-common cointool
# exlude unused fields
$SRC/cointool.py dump -p -d connect -o $DIST/coins.json \
-e blockbook \
-e icon \
-e cooldown \
-e github \
-e key \
-e maintainer \
-e uri_prefix \
-e version_group_id \
-e website \
-e links \
-e duplicate \
-e wallet \
-e bitcore \
-e confidential_assets \
-e negative_fee \

View File

@@ -4,9 +4,10 @@ set -euxo pipefail
PARENT_PATH=$( cd "$(dirname "${BASH_SOURCE[0]}")" ; pwd -P )
cd "$PARENT_PATH"
cd ../trezor-common
cd ../submodules/trezor-common
commit=$(git rev-parse --short HEAD)
echo $commit
git pull origin master
cd ../
git add .
git commit -m "chore: update trezor-common ($commit)"