diff --git a/e2e/tests-dfx/assetscanister.bash b/e2e/tests-dfx/assetscanister.bash index 2a5aaf6083..93e78bab35 100644 --- a/e2e/tests-dfx/assetscanister.bash +++ b/e2e/tests-dfx/assetscanister.bash @@ -5,7 +5,7 @@ load ../utils/_ setup() { standard_setup - dfx_new + dfx_new_assets } teardown() { diff --git a/e2e/tests-dfx/bitcoin.bash b/e2e/tests-dfx/bitcoin.bash index 58dbe31a2d..eeb425e985 100644 --- a/e2e/tests-dfx/bitcoin.bash +++ b/e2e/tests-dfx/bitcoin.bash @@ -37,7 +37,7 @@ set_local_network_bitcoin_enabled() { } @test "dfx restarts replica when ic-btc-adapter restarts" { - dfx_new hello + dfx_new_assets hello dfx_start --enable-bitcoin install_asset greet diff --git a/e2e/tests-dfx/build_granular.bash b/e2e/tests-dfx/build_granular.bash index d60b824b53..caed788922 100644 --- a/e2e/tests-dfx/build_granular.bash +++ b/e2e/tests-dfx/build_granular.bash @@ -5,7 +5,7 @@ load ../utils/_ setup() { standard_setup - dfx_new + dfx_new_assets } teardown() { diff --git a/e2e/tests-dfx/canister_http.bash b/e2e/tests-dfx/canister_http.bash index feb45c7b6b..f7eddcf1cb 100644 --- a/e2e/tests-dfx/canister_http.bash +++ b/e2e/tests-dfx/canister_http.bash @@ -46,7 +46,7 @@ set_shared_local_network_canister_http_empty() { } @test "dfx restarts replica when ic-https-outcalls-adapter restarts" { - dfx_new hello + dfx_new_assets hello dfx_start install_asset greet diff --git a/e2e/tests-dfx/create.bash b/e2e/tests-dfx/create.bash index 63fdb4b34f..c6063325ea 100644 --- a/e2e/tests-dfx/create.bash +++ b/e2e/tests-dfx/create.bash @@ -5,7 +5,7 @@ load ../utils/_ setup() { standard_setup - dfx_new + dfx_new_assets } teardown() { diff --git a/e2e/tests-dfx/deploy.bash b/e2e/tests-dfx/deploy.bash index 87a69c4a32..05b3f7bf6d 100644 --- a/e2e/tests-dfx/deploy.bash +++ b/e2e/tests-dfx/deploy.bash @@ -5,7 +5,7 @@ load ../utils/_ setup() { standard_setup - dfx_new hello + dfx_new_assets hello } teardown() { diff --git a/e2e/tests-dfx/dotenv.bash b/e2e/tests-dfx/dotenv.bash index 2f92e07d0e..c486cc25e4 100644 --- a/e2e/tests-dfx/dotenv.bash +++ b/e2e/tests-dfx/dotenv.bash @@ -5,7 +5,7 @@ load ../utils/_ setup() { standard_setup - dfx_new + dfx_new_assets } teardown() { diff --git a/e2e/tests-dfx/error_diagnosis.bash b/e2e/tests-dfx/error_diagnosis.bash index cf454be310..92f76177f7 100644 --- a/e2e/tests-dfx/error_diagnosis.bash +++ b/e2e/tests-dfx/error_diagnosis.bash @@ -19,7 +19,7 @@ teardown() { assert_command dfx deploy # simulate previous deploy with CopyPlugin step - cp src/hello_frontend/assets/* dist/hello_frontend/ + cp src/hello_frontend/assets/* src/hello_frontend/dist assert_command_fail dfx deploy assert_contains "Remove the CopyPlugin step from webpack.config.js" diff --git a/e2e/tests-dfx/identity.bash b/e2e/tests-dfx/identity.bash index a39681152f..b373f7a403 100644 --- a/e2e/tests-dfx/identity.bash +++ b/e2e/tests-dfx/identity.bash @@ -5,7 +5,7 @@ load ../utils/_ setup() { standard_setup - dfx_new + dfx_new_assets } teardown() { diff --git a/e2e/tests-dfx/install.bash b/e2e/tests-dfx/install.bash index bd4a4f3d02..fc7e74ed24 100644 --- a/e2e/tests-dfx/install.bash +++ b/e2e/tests-dfx/install.bash @@ -5,7 +5,7 @@ load ../utils/_ setup() { standard_setup - dfx_new + dfx_new_assets } teardown() { diff --git a/e2e/tests-dfx/metadata.bash b/e2e/tests-dfx/metadata.bash index 9790de9178..af0d654626 100644 --- a/e2e/tests-dfx/metadata.bash +++ b/e2e/tests-dfx/metadata.bash @@ -182,7 +182,7 @@ teardown() { } @test "asset canister provides candid:service metadata" { - dfx_new hello + dfx_new_assets hello dfx_start assert_command dfx deploy diff --git a/e2e/tests-dfx/mode_reinstall.bash b/e2e/tests-dfx/mode_reinstall.bash index a21e4bdd5d..065c109f2f 100644 --- a/e2e/tests-dfx/mode_reinstall.bash +++ b/e2e/tests-dfx/mode_reinstall.bash @@ -5,7 +5,7 @@ load ../utils/_ setup() { standard_setup - dfx_new hello + dfx_new_assets hello } teardown() { diff --git a/e2e/tests-dfx/playground.bash b/e2e/tests-dfx/playground.bash index c90316adb9..486b8b0761 100644 --- a/e2e/tests-dfx/playground.bash +++ b/e2e/tests-dfx/playground.bash @@ -5,7 +5,7 @@ load ../utils/_ setup() { standard_setup setup_playground - dfx_new hello + dfx_new_assets hello } teardown() { diff --git a/e2e/tests-dfx/start.bash b/e2e/tests-dfx/start.bash index 52a735bda6..dcdbdb192b 100644 --- a/e2e/tests-dfx/start.bash +++ b/e2e/tests-dfx/start.bash @@ -93,7 +93,7 @@ teardown() { } @test "dfx restarts icx-proxy" { - dfx_new hello + dfx_new_assets hello dfx_start install_asset greet @@ -118,7 +118,7 @@ teardown() { } @test "dfx restarts icx-proxy when the replica restarts" { - dfx_new hello + dfx_new_assets hello dfx_start install_asset greet diff --git a/e2e/tests-dfx/wallet.bash b/e2e/tests-dfx/wallet.bash index b2c134f758..65d9edc99e 100644 --- a/e2e/tests-dfx/wallet.bash +++ b/e2e/tests-dfx/wallet.bash @@ -57,7 +57,7 @@ teardown() { } @test "'dfx identity set-wallet --force' bypasses wallet canister verification" { - dfx_new hello + dfx_new_assets hello dfx_start setup_actuallylocal_shared_network @@ -80,7 +80,7 @@ teardown() { } @test "deploy wallet" { - dfx_new hello + dfx_new_assets hello dfx_start setup_actuallylocal_shared_network diff --git a/e2e/tests-replica/deploy.bash b/e2e/tests-replica/deploy.bash index 8ba88f5cf8..b69ac6608e 100644 --- a/e2e/tests-replica/deploy.bash +++ b/e2e/tests-replica/deploy.bash @@ -23,7 +23,7 @@ teardown() { } @test "deploy a canister without dependencies" { - dfx_new hello + dfx_new_assets hello dfx_start install_asset greet assert_command dfx deploy hello_backend @@ -32,7 +32,7 @@ teardown() { } @test "deploy a canister with dependencies" { - dfx_new hello + dfx_new_assets hello dfx_start install_asset greet assert_command dfx deploy hello_frontend diff --git a/e2e/utils/_.bash b/e2e/utils/_.bash index 391305a7ce..651a52dea1 100644 --- a/e2e/utils/_.bash +++ b/e2e/utils/_.bash @@ -54,7 +54,17 @@ standard_teardown() { dfx_new_frontend() { local project_name=${1:-e2e_project} - dfx new "${project_name}" --frontend + dfx new "${project_name}" --frontend vanilla + test -d "${project_name}" + test -f "${project_name}"/dfx.json + cd "${project_name}" + + echo PWD: "$(pwd)" >&2 +} + +dfx_new_assets() { + local project_name=${1:-e2e_project} + dfx new "${project_name}" --frontend plain-assets test -d "${project_name}" test -f "${project_name}"/dfx.json cd "${project_name}" diff --git a/src/dfx/assets/project_templates/vanilla_js/src/__project_name___frontend/src/index.html b/src/dfx/assets/project_templates/vanilla_js/src/__project_name___frontend/index.html similarity index 84% rename from src/dfx/assets/project_templates/vanilla_js/src/__project_name___frontend/src/index.html rename to src/dfx/assets/project_templates/vanilla_js/src/__project_name___frontend/index.html index ae026cddf4..03d5d91e4b 100644 --- a/src/dfx/assets/project_templates/vanilla_js/src/__project_name___frontend/src/index.html +++ b/src/dfx/assets/project_templates/vanilla_js/src/__project_name___frontend/index.html @@ -10,7 +10,7 @@
- + \ No newline at end of file diff --git a/src/dfx/assets/project_templates/vanilla_js/src/__project_name___frontend/vite.config.js b/src/dfx/assets/project_templates/vanilla_js/src/__project_name___frontend/vite.config.js index 740a3202e3..dd683d8654 100644 --- a/src/dfx/assets/project_templates/vanilla_js/src/__project_name___frontend/vite.config.js +++ b/src/dfx/assets/project_templates/vanilla_js/src/__project_name___frontend/vite.config.js @@ -6,9 +6,7 @@ import dotenv from 'dotenv'; dotenv.config({ path: '../../.env' }); export default defineConfig({ - root: 'src', build: { - outDir: '../dist', emptyOutDir: true, }, optimizeDeps: { @@ -26,7 +24,7 @@ export default defineConfig({ }, }, }, - publicDir: '../assets', + publicDir: 'assets', plugins: [ environment('all', { prefix: 'CANISTER_' }), environment('all', { prefix: 'DFX_' }),