From 8e3da6f34a8eeeb861cc4a49921379c8a266344e Mon Sep 17 00:00:00 2001 From: Jordan Last Date: Wed, 4 Oct 2023 17:42:32 -0500 Subject: [PATCH 1/2] change the ordering of candid keys --- examples/async_await/dfx.json | 2 +- examples/audio_recorder/dfx.json | 2 +- examples/basic_bitcoin/dfx.json | 2 +- examples/bitcoin/dfx.json | 2 +- examples/blob_array/dfx.json | 2 +- examples/bytes/dfx.json | 2 +- examples/call_raw/dfx.json | 2 +- examples/candid_encoding/dfx.json | 2 +- examples/candid_keywords/dfx.json | 2 +- examples/canister/dfx.json | 4 ++-- examples/ckbtc/dfx.json | 2 +- examples/complex_init/dfx.json | 4 ++-- examples/complex_types/dfx.json | 2 +- examples/composite_queries/dfx.json | 6 +++--- examples/counter/dfx.json | 2 +- examples/cross_canister_calls/dfx.json | 4 ++-- examples/cycles/dfx.json | 4 ++-- examples/date/dfx.json | 2 +- examples/ethereum_json_rpc/dfx.json | 2 +- examples/func_types/dfx.json | 4 ++-- examples/generics/dfx.json | 2 +- examples/guard_functions/dfx.json | 2 +- examples/heartbeat/dfx.json | 4 ++-- examples/ic_api/dfx.json | 2 +- examples/icrc/dfx.json | 2 +- examples/imports/dfx.json | 2 +- examples/init/dfx.json | 2 +- examples/inspect_message/dfx.json | 2 +- examples/key_value_store/dfx.json | 2 +- examples/ledger_canister/dfx.json | 2 +- examples/list_of_lists/dfx.json | 2 +- examples/management_canister/dfx.json | 2 +- examples/manual_reply/dfx.json | 2 +- examples/motoko_examples/calc/dfx.json | 2 +- examples/motoko_examples/counter/dfx.json | 2 +- examples/motoko_examples/echo/dfx.json | 2 +- examples/motoko_examples/factorial/dfx.json | 2 +- examples/motoko_examples/hello-world/dfx.json | 2 +- examples/motoko_examples/hello/dfx.json | 2 +- examples/motoko_examples/http_counter/dfx.json | 2 +- examples/motoko_examples/minimal-counter-dapp/dfx.json | 2 +- examples/motoko_examples/persistent-storage/dfx.json | 2 +- examples/motoko_examples/phone-book/dfx.json | 2 +- examples/motoko_examples/quicksort/dfx.json | 2 +- examples/motoko_examples/simple-to-do/dfx.json | 2 +- examples/motoko_examples/superheroes/dfx.json | 2 +- examples/motoko_examples/threshold_ecdsa/dfx.json | 2 +- examples/motoko_examples/whoami/dfx.json | 2 +- examples/notify_raw/dfx.json | 4 ++-- examples/null_example/dfx.json | 2 +- examples/optional_types/dfx.json | 2 +- examples/outgoing_http_requests/dfx.json | 2 +- examples/plugins/dfx.json | 2 +- examples/pre_and_post_upgrade/dfx.json | 2 +- examples/primitive_ops/dfx.json | 6 +++--- examples/primitive_types/dfx.json | 2 +- examples/principal/dfx.json | 2 +- examples/query/dfx.json | 2 +- examples/randomness/dfx.json | 2 +- examples/recursion/dfx.json | 4 ++-- examples/rejections/dfx.json | 4 ++-- examples/robust_imports/dfx.json | 2 +- examples/run_time_errors/dfx.json | 2 +- examples/simple_erc20/dfx.json | 2 +- examples/simple_user_accounts/dfx.json | 2 +- examples/stable_memory/dfx.json | 2 +- examples/stable_structures/dfx.json | 6 +++--- examples/timers/dfx.json | 2 +- examples/tuple_types/dfx.json | 2 +- examples/update/dfx.json | 2 +- examples/vanilla_js/dfx.json | 2 +- 71 files changed, 86 insertions(+), 86 deletions(-) diff --git a/examples/async_await/dfx.json b/examples/async_await/dfx.json index 9d0e506da5..746935f939 100644 --- a/examples/async_await/dfx.json +++ b/examples/async_await/dfx.json @@ -3,8 +3,8 @@ "async_await": { "type": "custom", "main": "src/async_await.ts", - "build": "npx azle async_await", "candid": "src/async_await.did", + "build": "npx azle async_await", "wasm": ".azle/async_await/async_await.wasm", "gzip": true, "declarations": { diff --git a/examples/audio_recorder/dfx.json b/examples/audio_recorder/dfx.json index dd517f04ff..914ff13815 100644 --- a/examples/audio_recorder/dfx.json +++ b/examples/audio_recorder/dfx.json @@ -3,8 +3,8 @@ "audio_recorder": { "type": "custom", "main": "src/index.ts", - "build": "npx azle audio_recorder", "candid": "src/index.did", + "build": "npx azle audio_recorder", "wasm": ".azle/audio_recorder/audio_recorder.wasm", "gzip": true, "declarations": { diff --git a/examples/basic_bitcoin/dfx.json b/examples/basic_bitcoin/dfx.json index 93bff9912b..3acdb38c55 100644 --- a/examples/basic_bitcoin/dfx.json +++ b/examples/basic_bitcoin/dfx.json @@ -3,8 +3,8 @@ "basic_bitcoin": { "type": "custom", "main": "src/index.ts", - "build": "npx azle basic_bitcoin", "candid": "src/index.did", + "build": "npx azle basic_bitcoin", "wasm": ".azle/basic_bitcoin/basic_bitcoin.wasm.gz", "declarations": { "output": "test/dfx_generated/basic_bitcoin", diff --git a/examples/bitcoin/dfx.json b/examples/bitcoin/dfx.json index 61d2e6794b..b866a35758 100644 --- a/examples/bitcoin/dfx.json +++ b/examples/bitcoin/dfx.json @@ -3,8 +3,8 @@ "bitcoin": { "type": "custom", "main": "src/index.ts", - "build": "npx azle bitcoin", "candid": "src/index.did", + "build": "npx azle bitcoin", "wasm": ".azle/bitcoin/bitcoin.wasm", "gzip": true, "declarations": { diff --git a/examples/blob_array/dfx.json b/examples/blob_array/dfx.json index e71434b346..7ec70eed6c 100644 --- a/examples/blob_array/dfx.json +++ b/examples/blob_array/dfx.json @@ -3,8 +3,8 @@ "blob_array": { "type": "custom", "main": "src/index.ts", - "build": "npx azle blob_array", "candid": "src/index.did", + "build": "npx azle blob_array", "wasm": ".azle/blob_array/blob_array.wasm", "gzip": true, "declarations": { diff --git a/examples/bytes/dfx.json b/examples/bytes/dfx.json index ed1c407ca3..0b51231fc9 100644 --- a/examples/bytes/dfx.json +++ b/examples/bytes/dfx.json @@ -3,8 +3,8 @@ "bytes_canister": { "type": "custom", "main": "src/index.ts", - "build": "npx azle bytes_canister", "candid": "src/index.did", + "build": "npx azle bytes_canister", "wasm": ".azle/bytes_canister/bytes_canister.wasm", "gzip": true, "declarations": { diff --git a/examples/call_raw/dfx.json b/examples/call_raw/dfx.json index 313cfd92e6..010976366d 100644 --- a/examples/call_raw/dfx.json +++ b/examples/call_raw/dfx.json @@ -3,8 +3,8 @@ "call_raw": { "type": "custom", "main": "src/call_raw.ts", - "build": "npx azle call_raw", "candid": "src/call_raw.did", + "build": "npx azle call_raw", "wasm": ".azle/call_raw/call_raw.wasm", "gzip": true, "declarations": { diff --git a/examples/candid_encoding/dfx.json b/examples/candid_encoding/dfx.json index 4f2f178ba7..f73a43ddb2 100644 --- a/examples/candid_encoding/dfx.json +++ b/examples/candid_encoding/dfx.json @@ -3,8 +3,8 @@ "candid_encoding": { "type": "custom", "main": "src/index.ts", - "build": "npx azle candid_encoding", "candid": "src/index.did", + "build": "npx azle candid_encoding", "wasm": ".azle/candid_encoding/candid_encoding.wasm", "gzip": true, "declarations": { diff --git a/examples/candid_keywords/dfx.json b/examples/candid_keywords/dfx.json index 9f595804fe..bcfd32c17b 100644 --- a/examples/candid_keywords/dfx.json +++ b/examples/candid_keywords/dfx.json @@ -3,8 +3,8 @@ "candid_keywords": { "type": "custom", "main": "src/index.ts", - "build": "npx azle candid_keywords", "candid": "src/index.did", + "build": "npx azle candid_keywords", "wasm": ".azle/candid_keywords/candid_keywords.wasm", "gzip": true, "declarations": { diff --git a/examples/canister/dfx.json b/examples/canister/dfx.json index 038155b656..aca1128233 100644 --- a/examples/canister/dfx.json +++ b/examples/canister/dfx.json @@ -3,8 +3,8 @@ "canister": { "type": "custom", "main": "src/index.ts", - "build": "npx azle canister", "candid": "src/index.did", + "build": "npx azle canister", "wasm": ".azle/canister/canister.wasm", "gzip": true, "declarations": { @@ -16,8 +16,8 @@ "some_canister": { "type": "custom", "main": "src/some_canister.ts", - "build": "npx azle some_canister", "candid": "src/some_canister.did", + "build": "npx azle some_canister", "wasm": ".azle/some_canister/some_canister.wasm", "gzip": true, "declarations": { diff --git a/examples/ckbtc/dfx.json b/examples/ckbtc/dfx.json index 30f10ba557..8186afbf4a 100644 --- a/examples/ckbtc/dfx.json +++ b/examples/ckbtc/dfx.json @@ -23,8 +23,8 @@ "wallet_backend": { "type": "custom", "main": "wallet/backend/index.ts", - "build": "npx azle wallet_backend", "candid": "wallet/backend/index.did", + "build": "npx azle wallet_backend", "wasm": ".azle/wallet_backend/wallet_backend.wasm", "gzip": true, "declarations": { diff --git a/examples/complex_init/dfx.json b/examples/complex_init/dfx.json index d0d1e9bb68..46b5f975ee 100644 --- a/examples/complex_init/dfx.json +++ b/examples/complex_init/dfx.json @@ -3,8 +3,8 @@ "complex_init": { "type": "custom", "main": "src/complex_init/index.ts", - "build": "npx azle complex_init", "candid": "src/complex_init/index.did", + "build": "npx azle complex_init", "wasm": ".azle/complex_init/complex_init.wasm", "gzip": true, "declarations": { @@ -15,8 +15,8 @@ "rec_init": { "type": "custom", "main": "src/rec_init/index.ts", - "build": "npx azle rec_init", "candid": "src/rec_init/index.did", + "build": "npx azle rec_init", "wasm": ".azle/rec_init/rec_init.wasm", "gzip": true, "declarations": { diff --git a/examples/complex_types/dfx.json b/examples/complex_types/dfx.json index e572d2a5cb..dfc726a56a 100644 --- a/examples/complex_types/dfx.json +++ b/examples/complex_types/dfx.json @@ -3,8 +3,8 @@ "complex_types": { "type": "custom", "main": "src/index.ts", - "build": "npx azle complex_types", "candid": "src/index.did", + "build": "npx azle complex_types", "wasm": ".azle/complex_types/complex_types.wasm", "gzip": true, "declarations": { diff --git a/examples/composite_queries/dfx.json b/examples/composite_queries/dfx.json index 1dc789c437..34c7bb0975 100644 --- a/examples/composite_queries/dfx.json +++ b/examples/composite_queries/dfx.json @@ -3,8 +3,8 @@ "canister1": { "type": "custom", "main": "src/canister1/index.ts", - "build": "npx azle canister1", "candid": "src/canister1/index.did", + "build": "npx azle canister1", "wasm": ".azle/canister1/canister1.wasm", "gzip": true, "declarations": { @@ -20,8 +20,8 @@ "canister2": { "type": "custom", "main": "src/canister2/index.ts", - "build": "npx azle canister2", "candid": "src/canister2/index.did", + "build": "npx azle canister2", "wasm": ".azle/canister2/canister2.wasm", "gzip": true, "declarations": { @@ -33,8 +33,8 @@ "canister3": { "type": "custom", "main": "src/canister3/index.ts", - "build": "npx azle canister3", "candid": "src/canister3/index.did", + "build": "npx azle canister3", "wasm": ".azle/canister3/canister3.wasm", "gzip": true, "declarations": { diff --git a/examples/counter/dfx.json b/examples/counter/dfx.json index 0566991110..b7e1f6b41b 100644 --- a/examples/counter/dfx.json +++ b/examples/counter/dfx.json @@ -3,8 +3,8 @@ "counter": { "type": "custom", "main": "src/index.ts", - "build": "npx azle counter", "candid": "src/index.did", + "build": "npx azle counter", "wasm": ".azle/counter/counter.wasm", "gzip": true, "declarations": { diff --git a/examples/cross_canister_calls/dfx.json b/examples/cross_canister_calls/dfx.json index 8a42446480..b82cf1614f 100644 --- a/examples/cross_canister_calls/dfx.json +++ b/examples/cross_canister_calls/dfx.json @@ -3,8 +3,8 @@ "canister1": { "type": "custom", "main": "src/canister1/index.ts", - "build": "npx azle canister1", "candid": "src/canister1/index.did", + "build": "npx azle canister1", "wasm": ".azle/canister1/canister1.wasm", "gzip": true, "declarations": { @@ -16,8 +16,8 @@ "canister2": { "type": "custom", "main": "src/canister2/index.ts", - "build": "npx azle canister2", "candid": "src/canister2/index.did", + "build": "npx azle canister2", "wasm": ".azle/canister2/canister2.wasm", "gzip": true, "declarations": { diff --git a/examples/cycles/dfx.json b/examples/cycles/dfx.json index 54ac92674d..c0653ea7bd 100644 --- a/examples/cycles/dfx.json +++ b/examples/cycles/dfx.json @@ -3,8 +3,8 @@ "cycles": { "type": "custom", "main": "src/cycles/index.ts", - "build": "npx azle cycles", "candid": "src/cycles/index.did", + "build": "npx azle cycles", "wasm": ".azle/cycles/cycles.wasm", "gzip": true, "declarations": { @@ -15,8 +15,8 @@ "intermediary": { "type": "custom", "main": "src/intermediary/index.ts", - "build": "npx azle intermediary", "candid": "src/intermediary/index.did", + "build": "npx azle intermediary", "wasm": ".azle/intermediary/intermediary.wasm", "gzip": true, "declarations": { diff --git a/examples/date/dfx.json b/examples/date/dfx.json index d862cfcb6a..96067fbe8a 100644 --- a/examples/date/dfx.json +++ b/examples/date/dfx.json @@ -3,8 +3,8 @@ "date": { "type": "custom", "main": "src/index.ts", - "build": "npx azle date", "candid": "src/index.did", + "build": "npx azle date", "wasm": ".azle/date/date.wasm", "gzip": true, "declarations": { diff --git a/examples/ethereum_json_rpc/dfx.json b/examples/ethereum_json_rpc/dfx.json index 233cee5bc2..1b59330442 100644 --- a/examples/ethereum_json_rpc/dfx.json +++ b/examples/ethereum_json_rpc/dfx.json @@ -3,8 +3,8 @@ "ethereum_json_rpc": { "type": "custom", "main": "src/index.ts", - "build": "npx azle ethereum_json_rpc", "candid": "src/index.did", + "build": "npx azle ethereum_json_rpc", "wasm": ".azle/ethereum_json_rpc/ethereum_json_rpc.wasm", "gzip": true, "declarations": { diff --git a/examples/func_types/dfx.json b/examples/func_types/dfx.json index dcaaa7abbe..f7b822efc7 100644 --- a/examples/func_types/dfx.json +++ b/examples/func_types/dfx.json @@ -3,8 +3,8 @@ "func_types": { "type": "custom", "main": "canisters/func_types/index.ts", - "build": "npx azle func_types", "candid": "canisters/func_types/index.did", + "build": "npx azle func_types", "wasm": ".azle/func_types/func_types.wasm", "gzip": true, "declarations": { @@ -16,8 +16,8 @@ "notifiers": { "type": "custom", "main": "canisters/notifiers/index.ts", - "build": "npx azle notifiers", "candid": "canisters/notifiers/index.did", + "build": "npx azle notifiers", "wasm": ".azle/notifiers/notifiers.wasm", "gzip": true, "declarations": { diff --git a/examples/generics/dfx.json b/examples/generics/dfx.json index a98afec6c9..2218848311 100644 --- a/examples/generics/dfx.json +++ b/examples/generics/dfx.json @@ -3,8 +3,8 @@ "generics": { "type": "custom", "main": "src/index.ts", - "build": "npx azle generics", "candid": "src/index.did", + "build": "npx azle generics", "wasm": ".azle/generics/generics.wasm.gz", "declarations": { "output": "test/dfx_generated/generics", diff --git a/examples/guard_functions/dfx.json b/examples/guard_functions/dfx.json index 42ca6052c7..c2113ddf71 100644 --- a/examples/guard_functions/dfx.json +++ b/examples/guard_functions/dfx.json @@ -3,8 +3,8 @@ "guard_functions": { "type": "custom", "main": "src/index.ts", - "build": "npx azle guard_functions", "candid": "src/index.did", + "build": "npx azle guard_functions", "wasm": ".azle/guard_functions/guard_functions.wasm", "gzip": true, "declarations": { diff --git a/examples/heartbeat/dfx.json b/examples/heartbeat/dfx.json index 562dd6eacd..36ae4ff4dd 100644 --- a/examples/heartbeat/dfx.json +++ b/examples/heartbeat/dfx.json @@ -3,8 +3,8 @@ "heartbeat_async": { "type": "custom", "main": "src/heartbeat_async/index.ts", - "build": "npx azle heartbeat_async", "candid": "src/heartbeat_async/index.did", + "build": "npx azle heartbeat_async", "wasm": ".azle/heartbeat_async/heartbeat_async.wasm", "gzip": true, "declarations": { @@ -15,8 +15,8 @@ "heartbeat_sync": { "type": "custom", "main": "src/heartbeat_sync/index.ts", - "build": "npx azle heartbeat_sync", "candid": "src/heartbeat_sync/index.did", + "build": "npx azle heartbeat_sync", "wasm": ".azle/heartbeat_sync/heartbeat_sync.wasm", "gzip": true, "declarations": { diff --git a/examples/ic_api/dfx.json b/examples/ic_api/dfx.json index 8455f72278..3c0b4998de 100644 --- a/examples/ic_api/dfx.json +++ b/examples/ic_api/dfx.json @@ -3,8 +3,8 @@ "ic_api": { "type": "custom", "main": "src/index.ts", - "build": "npx azle ic_api", "candid": "src/index.did", + "build": "npx azle ic_api", "wasm": ".azle/ic_api/ic_api.wasm", "gzip": true, "declarations": { diff --git a/examples/icrc/dfx.json b/examples/icrc/dfx.json index 3362b38976..681cb4d3ec 100644 --- a/examples/icrc/dfx.json +++ b/examples/icrc/dfx.json @@ -3,8 +3,8 @@ "proxy": { "type": "custom", "main": "canisters/proxy/index.ts", - "build": "npx azle proxy", "candid": "canisters/proxy/index.did", + "build": "npx azle proxy", "wasm": ".azle/proxy/proxy.wasm", "gzip": true, "declarations": { diff --git a/examples/imports/dfx.json b/examples/imports/dfx.json index c8e3239791..f37331f2ba 100644 --- a/examples/imports/dfx.json +++ b/examples/imports/dfx.json @@ -3,8 +3,8 @@ "imports": { "type": "custom", "main": "src/index.ts", - "build": "npx azle imports", "candid": "src/index.did", + "build": "npx azle imports", "wasm": ".azle/imports/imports.wasm", "gzip": true, "declarations": { diff --git a/examples/init/dfx.json b/examples/init/dfx.json index 47a12f1662..a26a858c63 100644 --- a/examples/init/dfx.json +++ b/examples/init/dfx.json @@ -3,8 +3,8 @@ "init": { "type": "custom", "main": "src/index.ts", - "build": "npx azle init", "candid": "src/index.did", + "build": "npx azle init", "wasm": ".azle/init/init.wasm", "gzip": true, "declarations": { diff --git a/examples/inspect_message/dfx.json b/examples/inspect_message/dfx.json index 3f777117c0..17f259ae14 100644 --- a/examples/inspect_message/dfx.json +++ b/examples/inspect_message/dfx.json @@ -3,8 +3,8 @@ "inspect_message": { "type": "custom", "main": "src/index.ts", - "build": "npx azle inspect_message", "candid": "src/index.did", + "build": "npx azle inspect_message", "wasm": ".azle/inspect_message/inspect_message.wasm", "gzip": true, "declarations": { diff --git a/examples/key_value_store/dfx.json b/examples/key_value_store/dfx.json index b5819fe555..48733b637c 100644 --- a/examples/key_value_store/dfx.json +++ b/examples/key_value_store/dfx.json @@ -3,8 +3,8 @@ "key_value_store": { "type": "custom", "main": "src/index.ts", - "build": "npx azle key_value_store", "candid": "src/index.did", + "build": "npx azle key_value_store", "wasm": ".azle/key_value_store/key_value_store.wasm", "gzip": true, "declarations": { diff --git a/examples/ledger_canister/dfx.json b/examples/ledger_canister/dfx.json index 5178600136..330d5f7a34 100644 --- a/examples/ledger_canister/dfx.json +++ b/examples/ledger_canister/dfx.json @@ -3,8 +3,8 @@ "ledger_canister": { "type": "custom", "main": "src/ledger_canister/index.ts", - "build": "npx azle ledger_canister", "candid": "src/ledger_canister/index.did", + "build": "npx azle ledger_canister", "wasm": ".azle/ledger_canister/ledger_canister.wasm", "gzip": true, "declarations": { diff --git a/examples/list_of_lists/dfx.json b/examples/list_of_lists/dfx.json index 8fc2b6ed56..967c310da6 100644 --- a/examples/list_of_lists/dfx.json +++ b/examples/list_of_lists/dfx.json @@ -3,8 +3,8 @@ "list_of_lists": { "type": "custom", "main": "src/index.ts", - "build": "npx azle list_of_lists", "candid": "src/index.did", + "build": "npx azle list_of_lists", "wasm": ".azle/list_of_lists/list_of_lists.wasm", "gzip": true, "declarations": { diff --git a/examples/management_canister/dfx.json b/examples/management_canister/dfx.json index 918f866542..062d518f67 100644 --- a/examples/management_canister/dfx.json +++ b/examples/management_canister/dfx.json @@ -3,8 +3,8 @@ "management_canister": { "type": "custom", "main": "src/index.ts", - "build": "npx azle management_canister", "candid": "src/index.did", + "build": "npx azle management_canister", "wasm": ".azle/management_canister/management_canister.wasm", "gzip": true, "declarations": { diff --git a/examples/manual_reply/dfx.json b/examples/manual_reply/dfx.json index ec8208eb6a..504225cf1c 100644 --- a/examples/manual_reply/dfx.json +++ b/examples/manual_reply/dfx.json @@ -3,8 +3,8 @@ "manual_reply": { "type": "custom", "main": "src/index.ts", - "build": "npx azle manual_reply", "candid": "src/index.did", + "build": "npx azle manual_reply", "wasm": ".azle/manual_reply/manual_reply.wasm", "gzip": true, "declarations": { diff --git a/examples/motoko_examples/calc/dfx.json b/examples/motoko_examples/calc/dfx.json index b1b6f6b81c..3952f300bc 100644 --- a/examples/motoko_examples/calc/dfx.json +++ b/examples/motoko_examples/calc/dfx.json @@ -3,8 +3,8 @@ "calc": { "type": "custom", "main": "src/index.ts", - "build": "npx azle calc", "candid": "src/index.did", + "build": "npx azle calc", "wasm": ".azle/calc/calc.wasm", "gzip": true, "declarations": { diff --git a/examples/motoko_examples/counter/dfx.json b/examples/motoko_examples/counter/dfx.json index 0566991110..b7e1f6b41b 100644 --- a/examples/motoko_examples/counter/dfx.json +++ b/examples/motoko_examples/counter/dfx.json @@ -3,8 +3,8 @@ "counter": { "type": "custom", "main": "src/index.ts", - "build": "npx azle counter", "candid": "src/index.did", + "build": "npx azle counter", "wasm": ".azle/counter/counter.wasm", "gzip": true, "declarations": { diff --git a/examples/motoko_examples/echo/dfx.json b/examples/motoko_examples/echo/dfx.json index 27f22d0140..694a4417d6 100644 --- a/examples/motoko_examples/echo/dfx.json +++ b/examples/motoko_examples/echo/dfx.json @@ -3,8 +3,8 @@ "echo": { "type": "custom", "main": "src/index.ts", - "build": "npx azle echo", "candid": "src/index.did", + "build": "npx azle echo", "wasm": ".azle/echo/echo.wasm", "gzip": true, "declarations": { diff --git a/examples/motoko_examples/factorial/dfx.json b/examples/motoko_examples/factorial/dfx.json index f2fe2ce58e..52d7281330 100644 --- a/examples/motoko_examples/factorial/dfx.json +++ b/examples/motoko_examples/factorial/dfx.json @@ -3,8 +3,8 @@ "factorial": { "type": "custom", "main": "src/index.ts", - "build": "npx azle factorial", "candid": "src/index.did", + "build": "npx azle factorial", "wasm": ".azle/factorial/factorial.wasm", "gzip": true, "declarations": { diff --git a/examples/motoko_examples/hello-world/dfx.json b/examples/motoko_examples/hello-world/dfx.json index 38e0895413..e4ae1260d7 100644 --- a/examples/motoko_examples/hello-world/dfx.json +++ b/examples/motoko_examples/hello-world/dfx.json @@ -3,8 +3,8 @@ "hello_world": { "type": "custom", "main": "src/index.ts", - "build": "npx azle hello_world", "candid": "src/index.did", + "build": "npx azle hello_world", "wasm": ".azle/hello_world/hello_world.wasm", "gzip": true, "declarations": { diff --git a/examples/motoko_examples/hello/dfx.json b/examples/motoko_examples/hello/dfx.json index cf1d6b7e10..897058bd68 100644 --- a/examples/motoko_examples/hello/dfx.json +++ b/examples/motoko_examples/hello/dfx.json @@ -3,8 +3,8 @@ "hello": { "type": "custom", "main": "src/hello/index.ts", - "build": "npx azle hello", "candid": "src/hello/index.did", + "build": "npx azle hello", "wasm": ".azle/hello/hello.wasm", "gzip": true, "declarations": { diff --git a/examples/motoko_examples/http_counter/dfx.json b/examples/motoko_examples/http_counter/dfx.json index 900a871136..37660059eb 100644 --- a/examples/motoko_examples/http_counter/dfx.json +++ b/examples/motoko_examples/http_counter/dfx.json @@ -3,8 +3,8 @@ "http_counter": { "type": "custom", "main": "src/index.ts", - "build": "npx azle http_counter", "candid": "src/index.did", + "build": "npx azle http_counter", "wasm": ".azle/http_counter/http_counter.wasm", "gzip": true, "declarations": { diff --git a/examples/motoko_examples/minimal-counter-dapp/dfx.json b/examples/motoko_examples/minimal-counter-dapp/dfx.json index b1d450af10..b52fcae980 100644 --- a/examples/motoko_examples/minimal-counter-dapp/dfx.json +++ b/examples/motoko_examples/minimal-counter-dapp/dfx.json @@ -3,8 +3,8 @@ "minimal_dapp": { "type": "custom", "main": "src/minimal_dapp/index.ts", - "build": "npx azle minimal_dapp", "candid": "src/minimal_dapp/index.did", + "build": "npx azle minimal_dapp", "wasm": ".azle/minimal_dapp/minimal_dapp.wasm", "gzip": true, "declarations": { diff --git a/examples/motoko_examples/persistent-storage/dfx.json b/examples/motoko_examples/persistent-storage/dfx.json index a4f163a8c0..b67b99e64a 100644 --- a/examples/motoko_examples/persistent-storage/dfx.json +++ b/examples/motoko_examples/persistent-storage/dfx.json @@ -3,8 +3,8 @@ "persistent_storage": { "type": "custom", "main": "src/index.ts", - "build": "npx azle persistent_storage", "candid": "src/index.did", + "build": "npx azle persistent_storage", "wasm": ".azle/persistent_storage/persistent_storage.wasm", "gzip": true, "declarations": { diff --git a/examples/motoko_examples/phone-book/dfx.json b/examples/motoko_examples/phone-book/dfx.json index adea0381f3..0a9fae76ae 100644 --- a/examples/motoko_examples/phone-book/dfx.json +++ b/examples/motoko_examples/phone-book/dfx.json @@ -3,8 +3,8 @@ "phone_book": { "type": "custom", "main": "src/phone_book/index.ts", - "build": "npx azle phone_book", "candid": "src/phone_book/index.did", + "build": "npx azle phone_book", "wasm": ".azle/phone_book/phone_book.wasm", "gzip": true, "declarations": { diff --git a/examples/motoko_examples/quicksort/dfx.json b/examples/motoko_examples/quicksort/dfx.json index 355de7433e..82e0b8c31a 100644 --- a/examples/motoko_examples/quicksort/dfx.json +++ b/examples/motoko_examples/quicksort/dfx.json @@ -3,8 +3,8 @@ "quicksort": { "type": "custom", "main": "src/index.ts", - "build": "npx azle quicksort", "candid": "src/index.did", + "build": "npx azle quicksort", "wasm": ".azle/quicksort/quicksort.wasm", "gzip": true, "declarations": { diff --git a/examples/motoko_examples/simple-to-do/dfx.json b/examples/motoko_examples/simple-to-do/dfx.json index 35fde99a3c..46bbb8fe49 100644 --- a/examples/motoko_examples/simple-to-do/dfx.json +++ b/examples/motoko_examples/simple-to-do/dfx.json @@ -3,8 +3,8 @@ "simple_to_do": { "type": "custom", "main": "src/index.ts", - "build": "npx azle simple_to_do", "candid": "src/index.did", + "build": "npx azle simple_to_do", "wasm": ".azle/simple_to_do/simple_to_do.wasm", "gzip": true, "declarations": { diff --git a/examples/motoko_examples/superheroes/dfx.json b/examples/motoko_examples/superheroes/dfx.json index da566b1e72..facee5c0a7 100644 --- a/examples/motoko_examples/superheroes/dfx.json +++ b/examples/motoko_examples/superheroes/dfx.json @@ -3,8 +3,8 @@ "superheroes": { "type": "custom", "main": "src/superheroes/index.ts", - "build": "npx azle superheroes", "candid": "src/superheroes/index.did", + "build": "npx azle superheroes", "wasm": ".azle/superheroes/superheroes.wasm", "gzip": true, "declarations": { diff --git a/examples/motoko_examples/threshold_ecdsa/dfx.json b/examples/motoko_examples/threshold_ecdsa/dfx.json index 8a314161e9..0e7bffcd43 100644 --- a/examples/motoko_examples/threshold_ecdsa/dfx.json +++ b/examples/motoko_examples/threshold_ecdsa/dfx.json @@ -3,8 +3,8 @@ "threshold_ecdsa": { "type": "custom", "main": "src/index.ts", - "build": "npx azle threshold_ecdsa", "candid": "src/index.did", + "build": "npx azle threshold_ecdsa", "wasm": ".azle/threshold_ecdsa/threshold_ecdsa.wasm", "gzip": true, "declarations": { diff --git a/examples/motoko_examples/whoami/dfx.json b/examples/motoko_examples/whoami/dfx.json index 2fbf46c806..a9b52fbf88 100644 --- a/examples/motoko_examples/whoami/dfx.json +++ b/examples/motoko_examples/whoami/dfx.json @@ -3,8 +3,8 @@ "whoami": { "type": "custom", "main": "src/index.ts", - "build": "npx azle whoami", "candid": "src/index.did", + "build": "npx azle whoami", "wasm": ".azle/whoami/whoami.wasm", "gzip": true, "declarations": { diff --git a/examples/notify_raw/dfx.json b/examples/notify_raw/dfx.json index 8a42446480..b82cf1614f 100644 --- a/examples/notify_raw/dfx.json +++ b/examples/notify_raw/dfx.json @@ -3,8 +3,8 @@ "canister1": { "type": "custom", "main": "src/canister1/index.ts", - "build": "npx azle canister1", "candid": "src/canister1/index.did", + "build": "npx azle canister1", "wasm": ".azle/canister1/canister1.wasm", "gzip": true, "declarations": { @@ -16,8 +16,8 @@ "canister2": { "type": "custom", "main": "src/canister2/index.ts", - "build": "npx azle canister2", "candid": "src/canister2/index.did", + "build": "npx azle canister2", "wasm": ".azle/canister2/canister2.wasm", "gzip": true, "declarations": { diff --git a/examples/null_example/dfx.json b/examples/null_example/dfx.json index 37239c828c..8fd483915a 100644 --- a/examples/null_example/dfx.json +++ b/examples/null_example/dfx.json @@ -3,8 +3,8 @@ "null_example": { "type": "custom", "main": "src/index.ts", - "build": "npx azle null_example", "candid": "src/index.did", + "build": "npx azle null_example", "wasm": ".azle/null_example/null_example.wasm", "gzip": true, "declarations": { diff --git a/examples/optional_types/dfx.json b/examples/optional_types/dfx.json index 8fc4b54ada..e217bebe08 100644 --- a/examples/optional_types/dfx.json +++ b/examples/optional_types/dfx.json @@ -3,8 +3,8 @@ "optional_types": { "type": "custom", "main": "src/index.ts", - "build": "npx azle optional_types", "candid": "src/index.did", + "build": "npx azle optional_types", "wasm": ".azle/optional_types/optional_types.wasm", "gzip": true, "declarations": { diff --git a/examples/outgoing_http_requests/dfx.json b/examples/outgoing_http_requests/dfx.json index a19410420c..77c6a0144e 100644 --- a/examples/outgoing_http_requests/dfx.json +++ b/examples/outgoing_http_requests/dfx.json @@ -3,8 +3,8 @@ "outgoing_http_requests": { "type": "custom", "main": "src/index.ts", - "build": "npx azle outgoing_http_requests", "candid": "src/index.did", + "build": "npx azle outgoing_http_requests", "wasm": ".azle/outgoing_http_requests/outgoing_http_requests.wasm", "gzip": true, "declarations": { diff --git a/examples/plugins/dfx.json b/examples/plugins/dfx.json index 72e591f0db..1c4aa3207f 100644 --- a/examples/plugins/dfx.json +++ b/examples/plugins/dfx.json @@ -3,8 +3,8 @@ "plugins": { "type": "custom", "main": "src/index.ts", - "build": "npx azle plugins", "candid": "src/index.did", + "build": "npx azle plugins", "wasm": ".azle/plugins/plugins.wasm.gz", "declarations": { "output": "test/dfx_generated/plugins", diff --git a/examples/pre_and_post_upgrade/dfx.json b/examples/pre_and_post_upgrade/dfx.json index 7ffb06c163..858800c4c0 100644 --- a/examples/pre_and_post_upgrade/dfx.json +++ b/examples/pre_and_post_upgrade/dfx.json @@ -3,8 +3,8 @@ "pre_and_post_upgrade": { "type": "custom", "main": "src/index.ts", - "build": "npx azle pre_and_post_upgrade", "candid": "src/index.did", + "build": "npx azle pre_and_post_upgrade", "wasm": ".azle/pre_and_post_upgrade/pre_and_post_upgrade.wasm", "gzip": true, "declarations": { diff --git a/examples/primitive_ops/dfx.json b/examples/primitive_ops/dfx.json index 2398660e18..eeb82cb97a 100644 --- a/examples/primitive_ops/dfx.json +++ b/examples/primitive_ops/dfx.json @@ -3,8 +3,8 @@ "azle": { "type": "custom", "main": "canisters/azle/index.ts", - "build": "npx azle azle", "candid": "canisters/azle/index.did", + "build": "npx azle azle", "wasm": ".azle/azle/azle.wasm", "gzip": true, "declarations": { @@ -20,11 +20,11 @@ }, "rust": { "type": "rust", - "package": "rust", "candid": "canisters/rust/src/lib.did", "declarations": { "output": "dfx_generated/rust" - } + }, + "package": "rust" } } } diff --git a/examples/primitive_types/dfx.json b/examples/primitive_types/dfx.json index bc56f230d4..a5e89487ad 100644 --- a/examples/primitive_types/dfx.json +++ b/examples/primitive_types/dfx.json @@ -3,8 +3,8 @@ "primitive_types": { "type": "custom", "main": "src/index.ts", - "build": "npx azle primitive_types", "candid": "src/index.did", + "build": "npx azle primitive_types", "wasm": ".azle/primitive_types/primitive_types.wasm", "gzip": true, "declarations": { diff --git a/examples/principal/dfx.json b/examples/principal/dfx.json index 325b4dd077..65bab57214 100644 --- a/examples/principal/dfx.json +++ b/examples/principal/dfx.json @@ -3,8 +3,8 @@ "principal": { "type": "custom", "main": "src/index.ts", - "build": "npx azle principal", "candid": "src/index.did", + "build": "npx azle principal", "wasm": ".azle/principal/principal.wasm", "gzip": true, "declarations": { diff --git a/examples/query/dfx.json b/examples/query/dfx.json index 600e5f0df8..1ad6554535 100644 --- a/examples/query/dfx.json +++ b/examples/query/dfx.json @@ -3,8 +3,8 @@ "query": { "type": "custom", "main": "src/index.ts", - "build": "npx azle query", "candid": "src/index.did", + "build": "npx azle query", "wasm": ".azle/query/query.wasm", "gzip": true, "declarations": { diff --git a/examples/randomness/dfx.json b/examples/randomness/dfx.json index 47c7729933..02b1b6da23 100644 --- a/examples/randomness/dfx.json +++ b/examples/randomness/dfx.json @@ -3,8 +3,8 @@ "randomness": { "type": "custom", "main": "src/index.ts", - "build": "npx azle randomness", "candid": "src/index.did", + "build": "npx azle randomness", "wasm": ".azle/randomness/randomness.wasm", "gzip": true, "declarations": { diff --git a/examples/recursion/dfx.json b/examples/recursion/dfx.json index 05f3c8b1e0..ad00847428 100644 --- a/examples/recursion/dfx.json +++ b/examples/recursion/dfx.json @@ -3,8 +3,8 @@ "recursion": { "type": "custom", "main": "src/recursion/index.ts", - "build": "npx azle recursion", "candid": "src/recursion/index.did", + "build": "npx azle recursion", "wasm": ".azle/recursion/recursion.wasm", "gzip": true, "declarations": { @@ -16,8 +16,8 @@ "recursive_canister": { "type": "custom", "main": "src/recursive_canister/index.ts", - "build": "npx azle recursive_canister", "candid": "src/recursive_canister/index.did", + "build": "npx azle recursive_canister", "wasm": ".azle/recursive_canister/recursive_canister.wasm", "gzip": true, "declarations": { diff --git a/examples/rejections/dfx.json b/examples/rejections/dfx.json index 2646c46490..ea4ccaebd7 100644 --- a/examples/rejections/dfx.json +++ b/examples/rejections/dfx.json @@ -3,8 +3,8 @@ "rejections": { "type": "custom", "main": "src/rejections/index.ts", - "build": "npx azle rejections", "candid": "src/rejections/index.did", + "build": "npx azle rejections", "wasm": ".azle/rejections/rejections.wasm", "gzip": true, "declarations": { @@ -16,8 +16,8 @@ "some_canister": { "type": "custom", "main": "src/some_canister/index.ts", - "build": "npx azle some_canister", "candid": "src/some_canister/index.did", + "build": "npx azle some_canister", "wasm": ".azle/some_canister/some_canister.wasm", "gzip": true, "declarations": { diff --git a/examples/robust_imports/dfx.json b/examples/robust_imports/dfx.json index 610150d7d0..50438a99c6 100644 --- a/examples/robust_imports/dfx.json +++ b/examples/robust_imports/dfx.json @@ -3,8 +3,8 @@ "robust_imports": { "type": "custom", "main": "src/index.ts", - "build": "npx azle robust_imports", "candid": "src/index.did", + "build": "npx azle robust_imports", "wasm": ".azle/robust_imports/robust_imports.wasm", "gzip": true, "declarations": { diff --git a/examples/run_time_errors/dfx.json b/examples/run_time_errors/dfx.json index 95a80cda18..d40f8d4ec5 100644 --- a/examples/run_time_errors/dfx.json +++ b/examples/run_time_errors/dfx.json @@ -3,8 +3,8 @@ "run_time_errors": { "type": "custom", "main": "src/index.ts", - "build": "npx azle run_time_errors", "candid": "src/index.did", + "build": "npx azle run_time_errors", "wasm": ".azle/run_time_errors/run_time_errors.wasm.gz", "declarations": { "output": "test/dfx_generated/run_time_errors", diff --git a/examples/simple_erc20/dfx.json b/examples/simple_erc20/dfx.json index 450f19aa58..29a586a9e3 100644 --- a/examples/simple_erc20/dfx.json +++ b/examples/simple_erc20/dfx.json @@ -3,8 +3,8 @@ "simple_erc20": { "type": "custom", "main": "src/index.ts", - "build": "npx azle simple_erc20", "candid": "src/index.did", + "build": "npx azle simple_erc20", "wasm": ".azle/simple_erc20/simple_erc20.wasm", "gzip": true, "declarations": { diff --git a/examples/simple_user_accounts/dfx.json b/examples/simple_user_accounts/dfx.json index 35e7ac16f1..fc75af3de7 100644 --- a/examples/simple_user_accounts/dfx.json +++ b/examples/simple_user_accounts/dfx.json @@ -3,8 +3,8 @@ "simple_user_accounts": { "type": "custom", "main": "src/index.ts", - "build": "npx azle simple_user_accounts", "candid": "src/index.did", + "build": "npx azle simple_user_accounts", "wasm": ".azle/simple_user_accounts/simple_user_accounts.wasm", "gzip": true, "declarations": { diff --git a/examples/stable_memory/dfx.json b/examples/stable_memory/dfx.json index 41c54dd64a..1da9016a34 100644 --- a/examples/stable_memory/dfx.json +++ b/examples/stable_memory/dfx.json @@ -3,8 +3,8 @@ "stable_memory": { "type": "custom", "main": "src/index.ts", - "build": "npx azle stable_memory", "candid": "src/index.did", + "build": "npx azle stable_memory", "wasm": ".azle/stable_memory/stable_memory.wasm", "gzip": true, "declarations": { diff --git a/examples/stable_structures/dfx.json b/examples/stable_structures/dfx.json index f913de2402..ef40234d87 100644 --- a/examples/stable_structures/dfx.json +++ b/examples/stable_structures/dfx.json @@ -3,8 +3,8 @@ "canister1": { "type": "custom", "main": "src/canister1/index.ts", - "build": "npx azle canister1", "candid": "src/canister1/index.did", + "build": "npx azle canister1", "wasm": ".azle/canister1/canister1.wasm", "gzip": true, "declarations": { @@ -15,8 +15,8 @@ "canister2": { "type": "custom", "main": "src/canister2/index.ts", - "build": "npx azle canister2", "candid": "src/canister2/index.did", + "build": "npx azle canister2", "wasm": ".azle/canister2/canister2.wasm", "gzip": true, "declarations": { @@ -27,8 +27,8 @@ "canister3": { "type": "custom", "main": "src/canister3/index.ts", - "build": "npx azle canister3", "candid": "src/canister3/index.did", + "build": "npx azle canister3", "wasm": ".azle/canister3/canister3.wasm", "gzip": true, "declarations": { diff --git a/examples/timers/dfx.json b/examples/timers/dfx.json index eaa6faf9e0..5431faa442 100644 --- a/examples/timers/dfx.json +++ b/examples/timers/dfx.json @@ -3,8 +3,8 @@ "timers": { "type": "custom", "main": "src/timers.ts", - "build": "npx azle timers", "candid": "src/timers.did", + "build": "npx azle timers", "wasm": ".azle/timers/timers.wasm", "gzip": true, "declarations": { diff --git a/examples/tuple_types/dfx.json b/examples/tuple_types/dfx.json index a05d8d80cc..7b7826d04c 100644 --- a/examples/tuple_types/dfx.json +++ b/examples/tuple_types/dfx.json @@ -3,8 +3,8 @@ "tuple_types": { "type": "custom", "main": "src/index.ts", - "build": "npx azle tuple_types", "candid": "src/index.did", + "build": "npx azle tuple_types", "wasm": ".azle/tuple_types/tuple_types.wasm", "gzip": true, "declarations": { diff --git a/examples/update/dfx.json b/examples/update/dfx.json index 67e16dacc7..5f726fc32d 100644 --- a/examples/update/dfx.json +++ b/examples/update/dfx.json @@ -3,8 +3,8 @@ "update": { "type": "custom", "main": "src/index.ts", - "build": "npx azle update", "candid": "src/index.did", + "build": "npx azle update", "wasm": ".azle/update/update.wasm", "gzip": true, "declarations": { diff --git a/examples/vanilla_js/dfx.json b/examples/vanilla_js/dfx.json index e9564738e0..79d1ace234 100644 --- a/examples/vanilla_js/dfx.json +++ b/examples/vanilla_js/dfx.json @@ -3,8 +3,8 @@ "vanilla_js": { "type": "custom", "main": "src/index.js", - "build": "npx azle vanilla_js", "candid": "src/index.did", + "build": "npx azle vanilla_js", "wasm": ".azle/vanilla_js/vanilla_js.wasm", "gzip": true, "declarations": { From dbccfcc738c351beb9b889d3a43b67c71d1ef9c6 Mon Sep 17 00:00:00 2001 From: Jordan Last Date: Wed, 4 Oct 2023 17:42:51 -0500 Subject: [PATCH 2/2] add script --- scripts/reorder_dfx_json.js | 66 +++++++++++++++++++++++++++++++++++++ 1 file changed, 66 insertions(+) create mode 100644 scripts/reorder_dfx_json.js diff --git a/scripts/reorder_dfx_json.js b/scripts/reorder_dfx_json.js new file mode 100644 index 0000000000..f8646b376b --- /dev/null +++ b/scripts/reorder_dfx_json.js @@ -0,0 +1,66 @@ +const fs = require('fs-extra'); +const path = require('path'); + +// Helper function to reorder keys in an object. +const reorderKeys = (obj, order) => { + return Object.keys(obj) + .sort((a, b) => { + const indexA = order.indexOf(a); + const indexB = order.indexOf(b); + if (indexA === -1 && indexB === -1) return 0; // both keys are not in order array, no sorting + if (indexA === -1) return 1; // a is not in order array, sort it at the end + if (indexB === -1) return -1; // b is not in order array, sort it at the end + return indexA - indexB; // both are in order array, sort them based on the array + }) + .reduce((result, key) => { + result[key] = obj[key]; + return result; + }, {}); +}; + +// Read directory. +const dirPath = './examples/motoko_examples'; // Replace with the path to the directory containing folders with dfx.json files +fs.readdir(dirPath, (err, folders) => { + if (err) { + console.error('Could not list the directory.', err); + return; + } + + folders.forEach((folder) => { + const dfxJsonPath = path.join(dirPath, folder, 'dfx.json'); + if (fs.existsSync(dfxJsonPath)) { + fs.readJson(dfxJsonPath) + .then((dfxConfig) => { + for (const canister in dfxConfig.canisters) { + if (dfxConfig.canisters.hasOwnProperty(canister)) { + dfxConfig.canisters[canister] = reorderKeys( + dfxConfig.canisters[canister], + [ + 'type', + 'main', + 'candid', + 'build', + 'wasm', + 'gzip', + 'declarations', + 'env' + ] + ); + } + } + return fs.writeJson(dfxJsonPath, dfxConfig, { spaces: 4 }); + }) + .then(() => { + console.log( + `Successfully reordered keys in ${dfxJsonPath}` + ); + }) + .catch((err) => { + console.error( + `Error reading or writing dfx.json in ${folder}`, + err + ); + }); + } + }); +});