Skip to content

Commit 133ed20

Browse files
committed
fix for latest phx.new
1 parent e8e66a1 commit 133ed20

File tree

4 files changed

+11
-6
lines changed

4 files changed

+11
-6
lines changed

lib/mix/tasks/phx.sync.tanstack_db.ex

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -277,8 +277,7 @@ if Code.ensure_loaded?(Igniter) do
277277
end
278278

279279
defp configure_package_manager(igniter) do
280-
if System.find_executable("pnpm") |> dbg &&
281-
Keyword.get(igniter.args.options, :sync_pnpm, true) do
280+
if System.find_executable("pnpm") && Keyword.get(igniter.args.options, :sync_pnpm, true) do
282281
igniter
283282
|> Igniter.add_notice("Using pnpm as package manager")
284283
|> Igniter.assign(:package_manager, :pnpm)
@@ -308,7 +307,7 @@ if Code.ensure_loaded?(Igniter) do
308307
|> create_new_file("assets/vite.config.ts")
309308
|> create_new_file("assets/tsconfig.node.json")
310309
|> create_new_file("assets/tsconfig.app.json")
311-
|> create_new_file("assets/tsconfig.json")
310+
|> create_or_replace_file("assets/tsconfig.json")
312311
|> create_or_replace_file("assets/tailwind.config.js")
313312
|> create_new_file("assets/js/db/auth.ts")
314313
|> create_new_file("assets/js/db/collections.ts")

priv/igniter/phx.sync.tanstack_db/assets/tsconfig.app.json.eex

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,9 @@
2121
"noUnusedParameters": true,
2222
"noFallthroughCasesInSwitch": true,
2323
"noUncheckedSideEffectImports": true
24+
"paths": {
25+
"*": ["../deps/*"]
26+
},
2427
},
2528
"include": ["js"]
2629
}

priv/igniter/phx.sync.tanstack_db/assets/tsconfig.node.json.eex

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,9 @@
1919
"noUnusedParameters": true,
2020
"noFallthroughCasesInSwitch": true,
2121
"noUncheckedSideEffectImports": true
22+
"paths": {
23+
"*": ["../deps/*"]
24+
},
2225
},
2326
"include": ["vite.config.ts"]
2427
}

test/mix/tasks/phx.sync.tanstack_db_test.exs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -55,13 +55,13 @@ defmodule Mix.Tasks.Phx.Sync.TanstackDbTest do
5555
|> Igniter.compose_task("phx.sync.tanstack_db", ["--sync-pnpm"])
5656

5757
assert_has_patch(igniter, "mix.exs", """
58-
- | {:esbuild, "~> 0.8", runtime: Mix.env() == :dev},
59-
- | {:tailwind, "~> 0.2", runtime: Mix.env() == :dev},
58+
- | {:esbuild, "~> 0.10", runtime: Mix.env() == :dev},
59+
- | {:tailwind, "~> 0.3", runtime: Mix.env() == :dev},
6060
""")
6161

6262
assert_has_patch(igniter, "mix.exs", """
6363
- | "assets.setup": ["tailwind.install --if-missing", "esbuild.install --if-missing"],
64-
- | "assets.build": ["tailwind test", "esbuild test"],
64+
- | "assets.build": ["compile", "tailwind test", "esbuild test"],
6565
+ | "assets.setup": ["cmd --cd assets pnpm install --ignore-workspace"],
6666
+ | "assets.build": [
6767
+ | "cmd --cd assets pnpm vite build --config vite.config.js --mode development"

0 commit comments

Comments
 (0)