diff --git a/examples/async_await/dfx.json b/examples/async_await/dfx.json index 425a4963bf..9d0e506da5 100644 --- a/examples/async_await/dfx.json +++ b/examples/async_await/dfx.json @@ -2,9 +2,8 @@ "canisters": { "async_await": { "type": "custom", + "main": "src/async_await.ts", "build": "npx azle async_await", - "root": "src", - "ts": "src/async_await.ts", "candid": "src/async_await.did", "wasm": ".azle/async_await/async_await.wasm", "gzip": true, diff --git a/examples/audio_recorder/dfx.json b/examples/audio_recorder/dfx.json index 65df40b322..dd517f04ff 100644 --- a/examples/audio_recorder/dfx.json +++ b/examples/audio_recorder/dfx.json @@ -2,9 +2,8 @@ "canisters": { "audio_recorder": { "type": "custom", + "main": "src/index.ts", "build": "npx azle audio_recorder", - "root": "src", - "ts": "src/index.ts", "candid": "src/index.did", "wasm": ".azle/audio_recorder/audio_recorder.wasm", "gzip": true, diff --git a/examples/basic_bitcoin/dfx.json b/examples/basic_bitcoin/dfx.json index 923ca7922e..93bff9912b 100644 --- a/examples/basic_bitcoin/dfx.json +++ b/examples/basic_bitcoin/dfx.json @@ -2,9 +2,8 @@ "canisters": { "basic_bitcoin": { "type": "custom", + "main": "src/index.ts", "build": "npx azle basic_bitcoin", - "root": "src", - "ts": "src/index.ts", "candid": "src/index.did", "wasm": ".azle/basic_bitcoin/basic_bitcoin.wasm.gz", "declarations": { diff --git a/examples/bitcoin/dfx.json b/examples/bitcoin/dfx.json index 3942f82d05..61d2e6794b 100644 --- a/examples/bitcoin/dfx.json +++ b/examples/bitcoin/dfx.json @@ -2,9 +2,8 @@ "canisters": { "bitcoin": { "type": "custom", + "main": "src/index.ts", "build": "npx azle bitcoin", - "root": "src", - "ts": "src/index.ts", "candid": "src/index.did", "wasm": ".azle/bitcoin/bitcoin.wasm", "gzip": true, diff --git a/examples/blob_array/dfx.json b/examples/blob_array/dfx.json index 744bb07531..e71434b346 100644 --- a/examples/blob_array/dfx.json +++ b/examples/blob_array/dfx.json @@ -2,9 +2,8 @@ "canisters": { "blob_array": { "type": "custom", + "main": "src/index.ts", "build": "npx azle blob_array", - "root": "src", - "ts": "src/index.ts", "candid": "src/index.did", "wasm": ".azle/blob_array/blob_array.wasm", "gzip": true, diff --git a/examples/bytes/dfx.json b/examples/bytes/dfx.json index cfde62ab53..ed1c407ca3 100644 --- a/examples/bytes/dfx.json +++ b/examples/bytes/dfx.json @@ -2,9 +2,8 @@ "canisters": { "bytes_canister": { "type": "custom", + "main": "src/index.ts", "build": "npx azle bytes_canister", - "root": "src", - "ts": "src/index.ts", "candid": "src/index.did", "wasm": ".azle/bytes_canister/bytes_canister.wasm", "gzip": true, diff --git a/examples/call_raw/dfx.json b/examples/call_raw/dfx.json index 8d08c8f79c..313cfd92e6 100644 --- a/examples/call_raw/dfx.json +++ b/examples/call_raw/dfx.json @@ -2,9 +2,8 @@ "canisters": { "call_raw": { "type": "custom", + "main": "src/call_raw.ts", "build": "npx azle call_raw", - "root": "src", - "ts": "src/call_raw.ts", "candid": "src/call_raw.did", "wasm": ".azle/call_raw/call_raw.wasm", "gzip": true, diff --git a/examples/candid_encoding/dfx.json b/examples/candid_encoding/dfx.json index 77185fa6c5..4f2f178ba7 100644 --- a/examples/candid_encoding/dfx.json +++ b/examples/candid_encoding/dfx.json @@ -2,9 +2,8 @@ "canisters": { "candid_encoding": { "type": "custom", + "main": "src/index.ts", "build": "npx azle candid_encoding", - "root": "src", - "ts": "src/index.ts", "candid": "src/index.did", "wasm": ".azle/candid_encoding/candid_encoding.wasm", "gzip": true, diff --git a/examples/canister/dfx.json b/examples/canister/dfx.json index ead5507fec..038155b656 100644 --- a/examples/canister/dfx.json +++ b/examples/canister/dfx.json @@ -2,9 +2,8 @@ "canisters": { "canister": { "type": "custom", + "main": "src/index.ts", "build": "npx azle canister", - "root": "src", - "ts": "src/index.ts", "candid": "src/index.did", "wasm": ".azle/canister/canister.wasm", "gzip": true, @@ -16,9 +15,8 @@ }, "some_canister": { "type": "custom", + "main": "src/some_canister.ts", "build": "npx azle some_canister", - "root": "src", - "ts": "src/some_canister.ts", "candid": "src/some_canister.did", "wasm": ".azle/some_canister/some_canister.wasm", "gzip": true, diff --git a/examples/ckbtc/dfx.json b/examples/ckbtc/dfx.json index cf5ec18eff..cf6b60c079 100644 --- a/examples/ckbtc/dfx.json +++ b/examples/ckbtc/dfx.json @@ -22,9 +22,8 @@ }, "wallet_backend": { "type": "custom", + "main": "wallet/backend/index.ts", "build": "npx azle wallet_backend", - "root": "wallet/backend", - "ts": "wallet/backend/index.ts", "candid": "wallet/backend/index.did", "wasm": ".azle/wallet_backend/wallet_backend.wasm.gz", "declarations": { diff --git a/examples/complex_init/dfx.json b/examples/complex_init/dfx.json index 7728afb2ad..4e133518fa 100644 --- a/examples/complex_init/dfx.json +++ b/examples/complex_init/dfx.json @@ -2,9 +2,8 @@ "canisters": { "complex_init": { "type": "custom", + "main": "src/index.ts", "build": "npx azle complex_init", - "root": "src", - "ts": "src/index.ts", "candid": "src/index.did", "wasm": ".azle/complex_init/complex_init.wasm", "gzip": true, diff --git a/examples/complex_types/dfx.json b/examples/complex_types/dfx.json index 5b4282346a..ac87899737 100644 --- a/examples/complex_types/dfx.json +++ b/examples/complex_types/dfx.json @@ -2,9 +2,8 @@ "canisters": { "complex_types": { "type": "custom", + "main": "src/index.ts", "build": "npx azle complex_types", - "root": "src", - "ts": "src/index.ts", "candid": "src/index.did", "wasm": ".azle/complex_types/complex_types.wasm.gz", "declarations": { diff --git a/examples/composite_queries/dfx.json b/examples/composite_queries/dfx.json index 9c23f56237..1dc789c437 100644 --- a/examples/composite_queries/dfx.json +++ b/examples/composite_queries/dfx.json @@ -2,9 +2,8 @@ "canisters": { "canister1": { "type": "custom", + "main": "src/canister1/index.ts", "build": "npx azle canister1", - "root": "src/canister1", - "ts": "src/canister1/index.ts", "candid": "src/canister1/index.did", "wasm": ".azle/canister1/canister1.wasm", "gzip": true, @@ -20,9 +19,8 @@ }, "canister2": { "type": "custom", + "main": "src/canister2/index.ts", "build": "npx azle canister2", - "root": "src/canister2", - "ts": "src/canister2/index.ts", "candid": "src/canister2/index.did", "wasm": ".azle/canister2/canister2.wasm", "gzip": true, @@ -34,9 +32,8 @@ }, "canister3": { "type": "custom", + "main": "src/canister3/index.ts", "build": "npx azle canister3", - "root": "src/canister3", - "ts": "src/canister3/index.ts", "candid": "src/canister3/index.did", "wasm": ".azle/canister3/canister3.wasm", "gzip": true, diff --git a/examples/counter/dfx.json b/examples/counter/dfx.json index 4514887657..0566991110 100644 --- a/examples/counter/dfx.json +++ b/examples/counter/dfx.json @@ -2,9 +2,8 @@ "canisters": { "counter": { "type": "custom", + "main": "src/index.ts", "build": "npx azle counter", - "root": "src", - "ts": "src/index.ts", "candid": "src/index.did", "wasm": ".azle/counter/counter.wasm", "gzip": true, diff --git a/examples/cycles/dfx.json b/examples/cycles/dfx.json index aa4139c43f..54ac92674d 100644 --- a/examples/cycles/dfx.json +++ b/examples/cycles/dfx.json @@ -2,9 +2,8 @@ "canisters": { "cycles": { "type": "custom", + "main": "src/cycles/index.ts", "build": "npx azle cycles", - "root": "src/cycles", - "ts": "src/cycles/index.ts", "candid": "src/cycles/index.did", "wasm": ".azle/cycles/cycles.wasm", "gzip": true, @@ -15,9 +14,8 @@ }, "intermediary": { "type": "custom", + "main": "src/intermediary/index.ts", "build": "npx azle intermediary", - "root": "src/intermediary", - "ts": "src/intermediary/index.ts", "candid": "src/intermediary/index.did", "wasm": ".azle/intermediary/intermediary.wasm", "gzip": true, diff --git a/examples/date/dfx.json b/examples/date/dfx.json index 717c735c2f..d862cfcb6a 100644 --- a/examples/date/dfx.json +++ b/examples/date/dfx.json @@ -2,9 +2,8 @@ "canisters": { "date": { "type": "custom", + "main": "src/index.ts", "build": "npx azle date", - "root": "src", - "ts": "src/index.ts", "candid": "src/index.did", "wasm": ".azle/date/date.wasm", "gzip": true, diff --git a/examples/ethereum_json_rpc/dfx.json b/examples/ethereum_json_rpc/dfx.json index 2537240369..233cee5bc2 100644 --- a/examples/ethereum_json_rpc/dfx.json +++ b/examples/ethereum_json_rpc/dfx.json @@ -2,9 +2,8 @@ "canisters": { "ethereum_json_rpc": { "type": "custom", + "main": "src/index.ts", "build": "npx azle ethereum_json_rpc", - "root": "src", - "ts": "src/index.ts", "candid": "src/index.did", "wasm": ".azle/ethereum_json_rpc/ethereum_json_rpc.wasm", "gzip": true, diff --git a/examples/func_types/dfx.json b/examples/func_types/dfx.json index ed806a8ba6..ea939ee18b 100644 --- a/examples/func_types/dfx.json +++ b/examples/func_types/dfx.json @@ -2,9 +2,8 @@ "canisters": { "func_types": { "type": "custom", + "main": "canisters/func_types/index.ts", "build": "npx azle func_types", - "root": "src", - "ts": "canisters/func_types/index.ts", "candid": "canisters/func_types/index.did", "wasm": ".azle/func_types/func_types.wasm.gz", "declarations": { @@ -15,9 +14,8 @@ }, "notifiers": { "type": "custom", + "main": "canisters/notifiers/index.ts", "build": "npx azle notifiers", - "root": "src", - "ts": "canisters/notifiers/index.ts", "candid": "canisters/notifiers/index.did", "wasm": ".azle/notifiers/notifiers.wasm.gz", "declarations": { diff --git a/examples/generics/dfx.json b/examples/generics/dfx.json index 7c2f1facf7..a98afec6c9 100644 --- a/examples/generics/dfx.json +++ b/examples/generics/dfx.json @@ -2,9 +2,8 @@ "canisters": { "generics": { "type": "custom", + "main": "src/index.ts", "build": "npx azle generics", - "root": "src", - "ts": "src/index.ts", "candid": "src/index.did", "wasm": ".azle/generics/generics.wasm.gz", "declarations": { diff --git a/examples/guard_functions/dfx.json b/examples/guard_functions/dfx.json index 4e8af29a65..42ca6052c7 100644 --- a/examples/guard_functions/dfx.json +++ b/examples/guard_functions/dfx.json @@ -2,9 +2,8 @@ "canisters": { "guard_functions": { "type": "custom", + "main": "src/index.ts", "build": "npx azle guard_functions", - "root": "src", - "ts": "src/index.ts", "candid": "src/index.did", "wasm": ".azle/guard_functions/guard_functions.wasm", "gzip": true, diff --git a/examples/heartbeat/dfx.json b/examples/heartbeat/dfx.json index a8fdaab0b3..562dd6eacd 100644 --- a/examples/heartbeat/dfx.json +++ b/examples/heartbeat/dfx.json @@ -2,9 +2,8 @@ "canisters": { "heartbeat_async": { "type": "custom", + "main": "src/heartbeat_async/index.ts", "build": "npx azle heartbeat_async", - "root": "src", - "ts": "src/heartbeat_async/index.ts", "candid": "src/heartbeat_async/index.did", "wasm": ".azle/heartbeat_async/heartbeat_async.wasm", "gzip": true, @@ -15,9 +14,8 @@ }, "heartbeat_sync": { "type": "custom", + "main": "src/heartbeat_sync/index.ts", "build": "npx azle heartbeat_sync", - "root": "src", - "ts": "src/heartbeat_sync/index.ts", "candid": "src/heartbeat_sync/index.did", "wasm": ".azle/heartbeat_sync/heartbeat_sync.wasm", "gzip": true, diff --git a/examples/ic_api/dfx.json b/examples/ic_api/dfx.json index b8da010ce2..8455f72278 100644 --- a/examples/ic_api/dfx.json +++ b/examples/ic_api/dfx.json @@ -2,9 +2,8 @@ "canisters": { "ic_api": { "type": "custom", + "main": "src/index.ts", "build": "npx azle ic_api", - "root": "src", - "ts": "src/index.ts", "candid": "src/index.did", "wasm": ".azle/ic_api/ic_api.wasm", "gzip": true, diff --git a/examples/icrc/dfx.json b/examples/icrc/dfx.json index 2c81585ca8..5afbaa85ed 100644 --- a/examples/icrc/dfx.json +++ b/examples/icrc/dfx.json @@ -2,9 +2,8 @@ "canisters": { "proxy": { "type": "custom", + "main": "canisters/proxy/index.ts", "build": "npx azle proxy", - "root": "canisters/proxy", - "ts": "canisters/proxy/index.ts", "candid": "canisters/proxy/index.did", "wasm": ".azle/proxy/proxy.wasm.gz", "declarations": { diff --git a/examples/imports/dfx.json b/examples/imports/dfx.json index 68fa6ee9c0..c8e3239791 100644 --- a/examples/imports/dfx.json +++ b/examples/imports/dfx.json @@ -2,9 +2,8 @@ "canisters": { "imports": { "type": "custom", + "main": "src/index.ts", "build": "npx azle imports", - "root": "src", - "ts": "src/index.ts", "candid": "src/index.did", "wasm": ".azle/imports/imports.wasm", "gzip": true, diff --git a/examples/init/dfx.json b/examples/init/dfx.json index c598ca5008..47a12f1662 100644 --- a/examples/init/dfx.json +++ b/examples/init/dfx.json @@ -2,9 +2,8 @@ "canisters": { "init": { "type": "custom", + "main": "src/index.ts", "build": "npx azle init", - "root": "src", - "ts": "src/index.ts", "candid": "src/index.did", "wasm": ".azle/init/init.wasm", "gzip": true, diff --git a/examples/inspect_message/dfx.json b/examples/inspect_message/dfx.json index 07d15ea21f..3f777117c0 100644 --- a/examples/inspect_message/dfx.json +++ b/examples/inspect_message/dfx.json @@ -2,9 +2,8 @@ "canisters": { "inspect_message": { "type": "custom", + "main": "src/index.ts", "build": "npx azle inspect_message", - "root": "src", - "ts": "src/index.ts", "candid": "src/index.did", "wasm": ".azle/inspect_message/inspect_message.wasm", "gzip": true, diff --git a/examples/key_value_store/dfx.json b/examples/key_value_store/dfx.json index dc9c70a18c..b5819fe555 100644 --- a/examples/key_value_store/dfx.json +++ b/examples/key_value_store/dfx.json @@ -2,9 +2,8 @@ "canisters": { "key_value_store": { "type": "custom", + "main": "src/index.ts", "build": "npx azle key_value_store", - "root": "azle", - "ts": "src/index.ts", "candid": "src/index.did", "wasm": ".azle/key_value_store/key_value_store.wasm", "gzip": true, diff --git a/examples/ledger_canister/dfx.json b/examples/ledger_canister/dfx.json index 8e8269ee4c..5178600136 100644 --- a/examples/ledger_canister/dfx.json +++ b/examples/ledger_canister/dfx.json @@ -2,9 +2,8 @@ "canisters": { "ledger_canister": { "type": "custom", + "main": "src/ledger_canister/index.ts", "build": "npx azle ledger_canister", - "root": "src/ledger_canister", - "ts": "src/ledger_canister/index.ts", "candid": "src/ledger_canister/index.did", "wasm": ".azle/ledger_canister/ledger_canister.wasm", "gzip": true, diff --git a/examples/list_of_lists/dfx.json b/examples/list_of_lists/dfx.json index 2b5185954b..8fc2b6ed56 100644 --- a/examples/list_of_lists/dfx.json +++ b/examples/list_of_lists/dfx.json @@ -2,9 +2,8 @@ "canisters": { "list_of_lists": { "type": "custom", + "main": "src/index.ts", "build": "npx azle list_of_lists", - "root": "src", - "ts": "src/index.ts", "candid": "src/index.did", "wasm": ".azle/list_of_lists/list_of_lists.wasm", "gzip": true, diff --git a/examples/management_canister/dfx.json b/examples/management_canister/dfx.json index a3dc7dfe25..918f866542 100644 --- a/examples/management_canister/dfx.json +++ b/examples/management_canister/dfx.json @@ -2,9 +2,8 @@ "canisters": { "management_canister": { "type": "custom", + "main": "src/index.ts", "build": "npx azle management_canister", - "root": "src", - "ts": "src/index.ts", "candid": "src/index.did", "wasm": ".azle/management_canister/management_canister.wasm", "gzip": true, diff --git a/examples/manual_reply/dfx.json b/examples/manual_reply/dfx.json index 4e5a1672ce..ec8208eb6a 100644 --- a/examples/manual_reply/dfx.json +++ b/examples/manual_reply/dfx.json @@ -2,9 +2,8 @@ "canisters": { "manual_reply": { "type": "custom", + "main": "src/index.ts", "build": "npx azle manual_reply", - "root": "src", - "ts": "src/index.ts", "candid": "src/index.did", "wasm": ".azle/manual_reply/manual_reply.wasm", "gzip": true, diff --git a/examples/motoko_examples/calc/dfx.json b/examples/motoko_examples/calc/dfx.json index ac4642ebf7..b1b6f6b81c 100644 --- a/examples/motoko_examples/calc/dfx.json +++ b/examples/motoko_examples/calc/dfx.json @@ -2,9 +2,8 @@ "canisters": { "calc": { "type": "custom", + "main": "src/index.ts", "build": "npx azle calc", - "root": "src", - "ts": "src/index.ts", "candid": "src/index.did", "wasm": ".azle/calc/calc.wasm", "gzip": true, diff --git a/examples/motoko_examples/counter/dfx.json b/examples/motoko_examples/counter/dfx.json index 4514887657..0566991110 100644 --- a/examples/motoko_examples/counter/dfx.json +++ b/examples/motoko_examples/counter/dfx.json @@ -2,9 +2,8 @@ "canisters": { "counter": { "type": "custom", + "main": "src/index.ts", "build": "npx azle counter", - "root": "src", - "ts": "src/index.ts", "candid": "src/index.did", "wasm": ".azle/counter/counter.wasm", "gzip": true, diff --git a/examples/motoko_examples/echo/dfx.json b/examples/motoko_examples/echo/dfx.json index f659f00952..27f22d0140 100644 --- a/examples/motoko_examples/echo/dfx.json +++ b/examples/motoko_examples/echo/dfx.json @@ -2,9 +2,8 @@ "canisters": { "echo": { "type": "custom", + "main": "src/index.ts", "build": "npx azle echo", - "root": "src", - "ts": "src/index.ts", "candid": "src/index.did", "wasm": ".azle/echo/echo.wasm", "gzip": true, diff --git a/examples/motoko_examples/factorial/dfx.json b/examples/motoko_examples/factorial/dfx.json index f71f8f8b71..f2fe2ce58e 100644 --- a/examples/motoko_examples/factorial/dfx.json +++ b/examples/motoko_examples/factorial/dfx.json @@ -2,9 +2,8 @@ "canisters": { "factorial": { "type": "custom", + "main": "src/index.ts", "build": "npx azle factorial", - "root": "src", - "ts": "src/index.ts", "candid": "src/index.did", "wasm": ".azle/factorial/factorial.wasm", "gzip": true, diff --git a/examples/motoko_examples/hello-world/dfx.json b/examples/motoko_examples/hello-world/dfx.json index 8cb2a10660..38e0895413 100644 --- a/examples/motoko_examples/hello-world/dfx.json +++ b/examples/motoko_examples/hello-world/dfx.json @@ -2,9 +2,8 @@ "canisters": { "hello_world": { "type": "custom", + "main": "src/index.ts", "build": "npx azle hello_world", - "root": "src", - "ts": "src/index.ts", "candid": "src/index.did", "wasm": ".azle/hello_world/hello_world.wasm", "gzip": true, diff --git a/examples/motoko_examples/hello/dfx.json b/examples/motoko_examples/hello/dfx.json index a1c8e27781..cf1d6b7e10 100644 --- a/examples/motoko_examples/hello/dfx.json +++ b/examples/motoko_examples/hello/dfx.json @@ -2,9 +2,8 @@ "canisters": { "hello": { "type": "custom", + "main": "src/hello/index.ts", "build": "npx azle hello", - "root": "src/hello", - "ts": "src/hello/index.ts", "candid": "src/hello/index.did", "wasm": ".azle/hello/hello.wasm", "gzip": true, @@ -14,12 +13,12 @@ } }, "hello_assets": { + "type": "assets", "dependencies": ["hello"], "frontend": { "entrypoint": "src/hello_assets/src/index.html" }, - "source": ["src/hello_assets/assets", "dist/hello_assets/"], - "type": "assets" + "source": ["src/hello_assets/assets", "dist/hello_assets/"] } }, "defaults": { diff --git a/examples/motoko_examples/http_counter/dfx.json b/examples/motoko_examples/http_counter/dfx.json index 4b9549efb1..900a871136 100644 --- a/examples/motoko_examples/http_counter/dfx.json +++ b/examples/motoko_examples/http_counter/dfx.json @@ -2,9 +2,8 @@ "canisters": { "http_counter": { "type": "custom", + "main": "src/index.ts", "build": "npx azle http_counter", - "root": "src", - "ts": "src/index.ts", "candid": "src/index.did", "wasm": ".azle/http_counter/http_counter.wasm", "gzip": true, diff --git a/examples/motoko_examples/minimal-counter-dapp/dfx.json b/examples/motoko_examples/minimal-counter-dapp/dfx.json index b5cc224386..b1d450af10 100644 --- a/examples/motoko_examples/minimal-counter-dapp/dfx.json +++ b/examples/motoko_examples/minimal-counter-dapp/dfx.json @@ -2,9 +2,8 @@ "canisters": { "minimal_dapp": { "type": "custom", + "main": "src/minimal_dapp/index.ts", "build": "npx azle minimal_dapp", - "root": "src/minimal_dapp", - "ts": "src/minimal_dapp/index.ts", "candid": "src/minimal_dapp/index.did", "wasm": ".azle/minimal_dapp/minimal_dapp.wasm", "gzip": true, @@ -14,14 +13,14 @@ } }, "minimal_dapp_assets": { + "type": "assets", "frontend": { "entrypoint": "src/minimal_dapp_assets/src/index.html" }, "source": [ "src/minimal_dapp_assets/assets", "dist/minimal_dapp_assets/" - ], - "type": "assets" + ] } } } diff --git a/examples/motoko_examples/persistent-storage/dfx.json b/examples/motoko_examples/persistent-storage/dfx.json index 9e2ae41a76..a4f163a8c0 100644 --- a/examples/motoko_examples/persistent-storage/dfx.json +++ b/examples/motoko_examples/persistent-storage/dfx.json @@ -2,9 +2,8 @@ "canisters": { "persistent_storage": { "type": "custom", + "main": "src/index.ts", "build": "npx azle persistent_storage", - "root": "src", - "ts": "src/index.ts", "candid": "src/index.did", "wasm": ".azle/persistent_storage/persistent_storage.wasm", "gzip": true, diff --git a/examples/motoko_examples/phone-book/dfx.json b/examples/motoko_examples/phone-book/dfx.json index e9c47f29b0..adea0381f3 100644 --- a/examples/motoko_examples/phone-book/dfx.json +++ b/examples/motoko_examples/phone-book/dfx.json @@ -2,9 +2,8 @@ "canisters": { "phone_book": { "type": "custom", + "main": "src/phone_book/index.ts", "build": "npx azle phone_book", - "root": "src/phone_book", - "ts": "src/phone_book/index.ts", "candid": "src/phone_book/index.did", "wasm": ".azle/phone_book/phone_book.wasm", "gzip": true, @@ -14,11 +13,11 @@ } }, "www": { + "type": "assets", "frontend": { "entrypoint": "src/www/public/index.html" }, - "source": ["src/www/assets", "dist/www/"], - "type": "assets" + "source": ["src/www/assets", "dist/www/"] } } } diff --git a/examples/motoko_examples/quicksort/dfx.json b/examples/motoko_examples/quicksort/dfx.json index e1090908d4..355de7433e 100644 --- a/examples/motoko_examples/quicksort/dfx.json +++ b/examples/motoko_examples/quicksort/dfx.json @@ -2,9 +2,8 @@ "canisters": { "quicksort": { "type": "custom", + "main": "src/index.ts", "build": "npx azle quicksort", - "root": "src", - "ts": "src/index.ts", "candid": "src/index.did", "wasm": ".azle/quicksort/quicksort.wasm", "gzip": true, diff --git a/examples/motoko_examples/simple-to-do/dfx.json b/examples/motoko_examples/simple-to-do/dfx.json index e35631e56f..35fde99a3c 100644 --- a/examples/motoko_examples/simple-to-do/dfx.json +++ b/examples/motoko_examples/simple-to-do/dfx.json @@ -2,9 +2,8 @@ "canisters": { "simple_to_do": { "type": "custom", + "main": "src/index.ts", "build": "npx azle simple_to_do", - "root": "src", - "ts": "src/index.ts", "candid": "src/index.did", "wasm": ".azle/simple_to_do/simple_to_do.wasm", "gzip": true, diff --git a/examples/motoko_examples/superheroes/dfx.json b/examples/motoko_examples/superheroes/dfx.json index 4272d1e0c7..da566b1e72 100644 --- a/examples/motoko_examples/superheroes/dfx.json +++ b/examples/motoko_examples/superheroes/dfx.json @@ -2,9 +2,8 @@ "canisters": { "superheroes": { "type": "custom", + "main": "src/superheroes/index.ts", "build": "npx azle superheroes", - "root": "src/superheroes", - "ts": "src/superheroes/index.ts", "candid": "src/superheroes/index.did", "wasm": ".azle/superheroes/superheroes.wasm", "gzip": true, @@ -14,11 +13,11 @@ } }, "www": { + "type": "assets", "frontend": { "entrypoint": "src/www/index.html" }, - "source": ["src/www/components", "dist/www/"], - "type": "assets" + "source": ["src/www/components", "dist/www/"] } } } diff --git a/examples/motoko_examples/threshold_ecdsa/dfx.json b/examples/motoko_examples/threshold_ecdsa/dfx.json index cc3d7a5fdf..8a314161e9 100644 --- a/examples/motoko_examples/threshold_ecdsa/dfx.json +++ b/examples/motoko_examples/threshold_ecdsa/dfx.json @@ -2,9 +2,8 @@ "canisters": { "threshold_ecdsa": { "type": "custom", + "main": "src/index.ts", "build": "npx azle threshold_ecdsa", - "root": "src", - "ts": "src/index.ts", "candid": "src/index.did", "wasm": ".azle/threshold_ecdsa/threshold_ecdsa.wasm", "gzip": true, diff --git a/examples/motoko_examples/whoami/dfx.json b/examples/motoko_examples/whoami/dfx.json index b171a6069f..2fbf46c806 100644 --- a/examples/motoko_examples/whoami/dfx.json +++ b/examples/motoko_examples/whoami/dfx.json @@ -2,9 +2,8 @@ "canisters": { "whoami": { "type": "custom", + "main": "src/index.ts", "build": "npx azle whoami", - "root": "src", - "ts": "src/index.ts", "candid": "src/index.did", "wasm": ".azle/whoami/whoami.wasm", "gzip": true, diff --git a/examples/notify_raw/dfx.json b/examples/notify_raw/dfx.json index 6d313adbf0..8a42446480 100644 --- a/examples/notify_raw/dfx.json +++ b/examples/notify_raw/dfx.json @@ -2,9 +2,8 @@ "canisters": { "canister1": { "type": "custom", + "main": "src/canister1/index.ts", "build": "npx azle canister1", - "root": "src/canister1", - "ts": "src/canister1/index.ts", "candid": "src/canister1/index.did", "wasm": ".azle/canister1/canister1.wasm", "gzip": true, @@ -16,9 +15,8 @@ }, "canister2": { "type": "custom", + "main": "src/canister2/index.ts", "build": "npx azle canister2", - "root": "src/canister2", - "ts": "src/canister2/index.ts", "candid": "src/canister2/index.did", "wasm": ".azle/canister2/canister2.wasm", "gzip": true, diff --git a/examples/null_example/dfx.json b/examples/null_example/dfx.json index a9a23efef3..37239c828c 100644 --- a/examples/null_example/dfx.json +++ b/examples/null_example/dfx.json @@ -2,9 +2,8 @@ "canisters": { "null_example": { "type": "custom", + "main": "src/index.ts", "build": "npx azle null_example", - "root": "src", - "ts": "src/index.ts", "candid": "src/index.did", "wasm": ".azle/null_example/null_example.wasm", "gzip": true, diff --git a/examples/optional_types/dfx.json b/examples/optional_types/dfx.json index 172f936b5c..8fc4b54ada 100644 --- a/examples/optional_types/dfx.json +++ b/examples/optional_types/dfx.json @@ -2,9 +2,8 @@ "canisters": { "optional_types": { "type": "custom", + "main": "src/index.ts", "build": "npx azle optional_types", - "root": "src", - "ts": "src/index.ts", "candid": "src/index.did", "wasm": ".azle/optional_types/optional_types.wasm", "gzip": true, diff --git a/examples/outgoing_http_requests/dfx.json b/examples/outgoing_http_requests/dfx.json index 1f2b061611..a19410420c 100644 --- a/examples/outgoing_http_requests/dfx.json +++ b/examples/outgoing_http_requests/dfx.json @@ -2,9 +2,8 @@ "canisters": { "outgoing_http_requests": { "type": "custom", + "main": "src/index.ts", "build": "npx azle outgoing_http_requests", - "root": "src", - "ts": "src/index.ts", "candid": "src/index.did", "wasm": ".azle/outgoing_http_requests/outgoing_http_requests.wasm", "gzip": true, diff --git a/examples/plugins/dfx.json b/examples/plugins/dfx.json index c57e1fa2c7..72e591f0db 100644 --- a/examples/plugins/dfx.json +++ b/examples/plugins/dfx.json @@ -2,9 +2,8 @@ "canisters": { "plugins": { "type": "custom", + "main": "src/index.ts", "build": "npx azle plugins", - "root": "src", - "ts": "src/index.ts", "candid": "src/index.did", "wasm": ".azle/plugins/plugins.wasm.gz", "declarations": { diff --git a/examples/pre_and_post_upgrade/dfx.json b/examples/pre_and_post_upgrade/dfx.json index e7f3535153..7ffb06c163 100644 --- a/examples/pre_and_post_upgrade/dfx.json +++ b/examples/pre_and_post_upgrade/dfx.json @@ -2,9 +2,8 @@ "canisters": { "pre_and_post_upgrade": { "type": "custom", + "main": "src/index.ts", "build": "npx azle pre_and_post_upgrade", - "root": "src", - "ts": "src/index.ts", "candid": "src/index.did", "wasm": ".azle/pre_and_post_upgrade/pre_and_post_upgrade.wasm", "gzip": true, diff --git a/examples/primitive_ops/dfx.json b/examples/primitive_ops/dfx.json index 4a4e1328be..6b1d07dda8 100644 --- a/examples/primitive_ops/dfx.json +++ b/examples/primitive_ops/dfx.json @@ -2,9 +2,8 @@ "canisters": { "azle": { "type": "custom", + "main": "canisters/azle/index.ts", "build": "npx azle azle", - "root": "canisters/azle", - "ts": "canisters/azle/index.ts", "candid": "canisters/azle/index.did", "wasm": ".azle/azle/azle.wasm.gz", "declarations": { diff --git a/examples/primitive_types/dfx.json b/examples/primitive_types/dfx.json index 162540cf0f..bc56f230d4 100644 --- a/examples/primitive_types/dfx.json +++ b/examples/primitive_types/dfx.json @@ -2,9 +2,8 @@ "canisters": { "primitive_types": { "type": "custom", + "main": "src/index.ts", "build": "npx azle primitive_types", - "root": "src", - "ts": "src/index.ts", "candid": "src/index.did", "wasm": ".azle/primitive_types/primitive_types.wasm", "gzip": true, diff --git a/examples/principal/dfx.json b/examples/principal/dfx.json index 4f97785c99..325b4dd077 100644 --- a/examples/principal/dfx.json +++ b/examples/principal/dfx.json @@ -2,9 +2,8 @@ "canisters": { "principal": { "type": "custom", + "main": "src/index.ts", "build": "npx azle principal", - "root": "src", - "ts": "src/index.ts", "candid": "src/index.did", "wasm": ".azle/principal/principal.wasm", "gzip": true, diff --git a/examples/query/dfx.json b/examples/query/dfx.json index 25b41e31d5..600e5f0df8 100644 --- a/examples/query/dfx.json +++ b/examples/query/dfx.json @@ -2,9 +2,8 @@ "canisters": { "query": { "type": "custom", + "main": "src/index.ts", "build": "npx azle query", - "root": "src", - "ts": "src/index.ts", "candid": "src/index.did", "wasm": ".azle/query/query.wasm", "gzip": true, diff --git a/examples/randomness/dfx.json b/examples/randomness/dfx.json index 2191430113..47c7729933 100644 --- a/examples/randomness/dfx.json +++ b/examples/randomness/dfx.json @@ -2,9 +2,8 @@ "canisters": { "randomness": { "type": "custom", + "main": "src/index.ts", "build": "npx azle randomness", - "root": "src", - "ts": "src/index.ts", "candid": "src/index.did", "wasm": ".azle/randomness/randomness.wasm", "gzip": true, diff --git a/examples/recursion/dfx.json b/examples/recursion/dfx.json index 1c67f8741a..abc071e77c 100644 --- a/examples/recursion/dfx.json +++ b/examples/recursion/dfx.json @@ -2,9 +2,8 @@ "canisters": { "recursion": { "type": "custom", + "main": "src/index.ts", "build": "npx azle recursion", - "root": "src", - "ts": "src/index.ts", "candid": "src/index.did", "wasm": ".azle/recursion/recursion.wasm.gz", "declarations": { diff --git a/examples/rejections/dfx.json b/examples/rejections/dfx.json index 69ffdb934d..2646c46490 100644 --- a/examples/rejections/dfx.json +++ b/examples/rejections/dfx.json @@ -2,9 +2,8 @@ "canisters": { "rejections": { "type": "custom", + "main": "src/rejections/index.ts", "build": "npx azle rejections", - "root": "src/rejections", - "ts": "src/rejections/index.ts", "candid": "src/rejections/index.did", "wasm": ".azle/rejections/rejections.wasm", "gzip": true, @@ -16,9 +15,8 @@ }, "some_canister": { "type": "custom", + "main": "src/some_canister/index.ts", "build": "npx azle some_canister", - "root": "src/some_canister", - "ts": "src/some_canister/index.ts", "candid": "src/some_canister/index.did", "wasm": ".azle/some_canister/some_canister.wasm", "gzip": true, diff --git a/examples/robust_imports/dfx.json b/examples/robust_imports/dfx.json index 80c639f3ec..610150d7d0 100644 --- a/examples/robust_imports/dfx.json +++ b/examples/robust_imports/dfx.json @@ -2,9 +2,8 @@ "canisters": { "robust_imports": { "type": "custom", + "main": "src/index.ts", "build": "npx azle robust_imports", - "root": "src", - "ts": "src/index.ts", "candid": "src/index.did", "wasm": ".azle/robust_imports/robust_imports.wasm", "gzip": true, diff --git a/examples/run_time_errors/dfx.json b/examples/run_time_errors/dfx.json index a2da290bf4..95a80cda18 100644 --- a/examples/run_time_errors/dfx.json +++ b/examples/run_time_errors/dfx.json @@ -2,9 +2,8 @@ "canisters": { "run_time_errors": { "type": "custom", + "main": "src/index.ts", "build": "npx azle run_time_errors", - "root": "src", - "ts": "src/index.ts", "candid": "src/index.did", "wasm": ".azle/run_time_errors/run_time_errors.wasm.gz", "declarations": { diff --git a/examples/simple_erc20/dfx.json b/examples/simple_erc20/dfx.json index 7d8616d35a..450f19aa58 100644 --- a/examples/simple_erc20/dfx.json +++ b/examples/simple_erc20/dfx.json @@ -2,9 +2,8 @@ "canisters": { "simple_erc20": { "type": "custom", + "main": "src/index.ts", "build": "npx azle simple_erc20", - "root": "src", - "ts": "src/index.ts", "candid": "src/index.did", "wasm": ".azle/simple_erc20/simple_erc20.wasm", "gzip": true, diff --git a/examples/simple_user_accounts/dfx.json b/examples/simple_user_accounts/dfx.json index cefa047694..35e7ac16f1 100644 --- a/examples/simple_user_accounts/dfx.json +++ b/examples/simple_user_accounts/dfx.json @@ -2,9 +2,8 @@ "canisters": { "simple_user_accounts": { "type": "custom", + "main": "src/index.ts", "build": "npx azle simple_user_accounts", - "root": "src", - "ts": "src/index.ts", "candid": "src/index.did", "wasm": ".azle/simple_user_accounts/simple_user_accounts.wasm", "gzip": true, diff --git a/examples/stable_memory/dfx.json b/examples/stable_memory/dfx.json index e2104e781c..41c54dd64a 100644 --- a/examples/stable_memory/dfx.json +++ b/examples/stable_memory/dfx.json @@ -2,9 +2,8 @@ "canisters": { "stable_memory": { "type": "custom", + "main": "src/index.ts", "build": "npx azle stable_memory", - "root": "src", - "ts": "src/index.ts", "candid": "src/index.did", "wasm": ".azle/stable_memory/stable_memory.wasm", "gzip": true, diff --git a/examples/stable_structures/dfx.json b/examples/stable_structures/dfx.json index 5bd83d7cc1..f913de2402 100644 --- a/examples/stable_structures/dfx.json +++ b/examples/stable_structures/dfx.json @@ -2,9 +2,8 @@ "canisters": { "canister1": { "type": "custom", + "main": "src/canister1/index.ts", "build": "npx azle canister1", - "root": "src", - "ts": "src/canister1/index.ts", "candid": "src/canister1/index.did", "wasm": ".azle/canister1/canister1.wasm", "gzip": true, @@ -15,9 +14,8 @@ }, "canister2": { "type": "custom", + "main": "src/canister2/index.ts", "build": "npx azle canister2", - "root": "src", - "ts": "src/canister2/index.ts", "candid": "src/canister2/index.did", "wasm": ".azle/canister2/canister2.wasm", "gzip": true, @@ -28,9 +26,8 @@ }, "canister3": { "type": "custom", + "main": "src/canister3/index.ts", "build": "npx azle canister3", - "root": "src", - "ts": "src/canister3/index.ts", "candid": "src/canister3/index.did", "wasm": ".azle/canister3/canister3.wasm", "gzip": true, diff --git a/examples/timers/dfx.json b/examples/timers/dfx.json index 10aa97b218..eaa6faf9e0 100644 --- a/examples/timers/dfx.json +++ b/examples/timers/dfx.json @@ -2,9 +2,8 @@ "canisters": { "timers": { "type": "custom", + "main": "src/timers.ts", "build": "npx azle timers", - "root": "src", - "ts": "src/timers.ts", "candid": "src/timers.did", "wasm": ".azle/timers/timers.wasm", "gzip": true, diff --git a/examples/tuple_types/dfx.json b/examples/tuple_types/dfx.json index 243cc7d144..be52556ed9 100644 --- a/examples/tuple_types/dfx.json +++ b/examples/tuple_types/dfx.json @@ -2,9 +2,8 @@ "canisters": { "tuple_types": { "type": "custom", + "main": "src/tuple_types.ts", "build": "npx azle tuple_types", - "root": "src", - "ts": "src/tuple_types.ts", "candid": "src/tuple_types.did", "wasm": ".azle/tuple_types/tuple_types.wasm.gz", "declarations": { diff --git a/examples/update/dfx.json b/examples/update/dfx.json index 9722137f5c..67e16dacc7 100644 --- a/examples/update/dfx.json +++ b/examples/update/dfx.json @@ -2,9 +2,8 @@ "canisters": { "update": { "type": "custom", + "main": "src/index.ts", "build": "npx azle update", - "root": "src", - "ts": "src/index.ts", "candid": "src/index.did", "wasm": ".azle/update/update.wasm", "gzip": true, diff --git a/scripts/update_dfx_json_main.js b/scripts/update_dfx_json_main.js new file mode 100644 index 0000000000..b8980df57b --- /dev/null +++ b/scripts/update_dfx_json_main.js @@ -0,0 +1,65 @@ +const fs = require('fs'); +const path = require('path'); + +// Helper function to update the canister definition +function updateCanister(canister) { + if (canister.root && canister.ts) { + canister.main = canister.ts; + delete canister.root; + delete canister.ts; + } + // Put 'main' right below 'type' + const { type, main, ...rest } = canister; + return { type, main, ...rest }; +} + +// Path to the examples directory +const examplesDir = path.join(process.cwd(), 'examples'); + +// Read all directories under examples/ +fs.readdir(examplesDir, { withFileTypes: true }, (err, entries) => { + if (err) { + console.error(`Error reading directory: ${err}`); + return; + } + + // Filter to keep only directories + const directories = entries.filter((entry) => entry.isDirectory()); + + directories.forEach((dir) => { + const exampleName = dir.name; + const dfxFilePath = path.join(examplesDir, exampleName, 'dfx.json'); + + // Read dfx.json file + fs.readFile(dfxFilePath, 'utf8', (err, data) => { + if (err) { + console.error(`Error reading dfx.json: ${err}`); + return; + } + + // Parse JSON + const json = JSON.parse(data); + + // Update canisters + for (const canisterName in json.canisters) { + json.canisters[canisterName] = updateCanister( + json.canisters[canisterName] + ); + } + + // Write updated dfx.json back to file + fs.writeFile( + dfxFilePath, + JSON.stringify(json, null, 2), + 'utf8', + (err) => { + if (err) { + console.error(`Error writing updated dfx.json: ${err}`); + return; + } + console.log(`Successfully updated ${dfxFilePath}`); + } + ); + }); + }); +});