Skip to content

Commit

Permalink
Switch away from using npm for metro (#2212)
Browse files Browse the repository at this point in the history
* dont use npm for metro

* action

* action
  • Loading branch information
anthonyshull authored Nov 5, 2024
1 parent c11b6cf commit a1f2c3a
Show file tree
Hide file tree
Showing 7 changed files with 30 additions and 185 deletions.
2 changes: 2 additions & 0 deletions .github/actions/setup-all/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -58,4 +58,6 @@ runs:
shell: bash
run: |
git config --global url."https://github.com/".insteadOf ssh://[email protected]/
npm install -g husky@latest
npm install --prefix assets --package-lock-only
npm run install:ci
1 change: 1 addition & 0 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,7 @@ jobs:
priv
react_renderer/dist/app.js
key: ci-application-cache-${{ github.sha }}
- run: npm install --prefix assets -S -install-links deps/mbta_metro/priv/
- run: npm --prefix assets run webpack:build
- run: npm --prefix assets run webpack:build:react
- run: mix compile --all-warnings
Expand Down
200 changes: 18 additions & 182 deletions assets/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion assets/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
"leaflet": "^1.4.0",
"leaflet-rotatedmarker": "^0.2.0",
"lodash": "^4.17.21",
"mbta_metro": "^0.0.51",
"mbta_metro": "file:../deps/mbta_metro/priv",
"mobile-detect": "^1.4.5",
"phoenix": "file:../deps/phoenix",
"phoenix_html": "file:../deps/phoenix_html",
Expand Down
6 changes: 6 additions & 0 deletions deploy/dotcom/prod/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,14 @@ COPY --from=elixir-builder /root/deps /root/deps
ADD ./priv/static /root/priv/static
ADD ./assets /root/assets

RUN npm i -g husky@latest

WORKDIR /root/assets

RUN npm install --package-lock-only
RUN npm ci --ignore-scripts
RUN npm install -S -install-links ../deps/mbta_metro/priv/

# required so that Tailwind styles used in Elixir templates are built
COPY ./lib/dotcom_web/ /root/lib/dotcom_web
# Compile JS/CSS to priv/static
Expand Down
2 changes: 1 addition & 1 deletion mix.exs
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ defmodule DotCom.Mixfile do
{:jason, "1.4.4", override: true},
{:logster, "1.1.1"},
{:mail, "0.4.1"},
{:mbta_metro, "0.0.51"},
{:mbta_metro, "0.0.54"},
{:mock, "0.3.8", [only: :test]},
{:mox, "1.2.0", [only: :test]},
{:nebulex, "2.6.4"},
Expand Down
2 changes: 1 addition & 1 deletion mix.lock
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@
"makeup_elixir": {:hex, :makeup_elixir, "0.16.2", "627e84b8e8bf22e60a2579dad15067c755531fea049ae26ef1020cad58fe9578", [:mix], [{:makeup, "~> 1.0", [hex: :makeup, repo: "hexpm", optional: false]}, {:nimble_parsec, "~> 1.2.3 or ~> 1.3", [hex: :nimble_parsec, repo: "hexpm", optional: false]}], "hexpm", "41193978704763f6bbe6cc2758b84909e62984c7752b3784bd3c218bb341706b"},
"makeup_erlang": {:hex, :makeup_erlang, "1.0.1", "c7f58c120b2b5aa5fd80d540a89fdf866ed42f1f3994e4fe189abebeab610839", [:mix], [{:makeup, "~> 1.0", [hex: :makeup, repo: "hexpm", optional: false]}], "hexpm", "8a89a1eeccc2d798d6ea15496a6e4870b75e014d1af514b1b71fa33134f57814"},
"makeup_html": {:hex, :makeup_html, "0.1.1", "c3d4abd39d5f7e925faca72ada6e9cc5c6f5fa7cd5bc0158315832656cf14d7f", [:mix], [{:makeup, "~> 1.0", [hex: :makeup, repo: "hexpm", optional: false]}], "hexpm", "44f2a61bc5243645dd7fafeaa6cc28793cd22f3c76b861e066168f9a5b2c26a4"},
"mbta_metro": {:hex, :mbta_metro, "0.0.51", "039732742f3ad2c4747d310462958f944f8531608c74e634ef409ea8231f093f", [:mix], [{:heroicons, "0.5.6", [hex: :heroicons, repo: "hexpm", optional: true]}, {:jason, "1.4.4", [hex: :jason, repo: "hexpm", optional: false]}, {:phoenix, "1.7.14", [hex: :phoenix, repo: "hexpm", optional: false]}, {:phoenix_live_view, "1.0.0-rc.6", [hex: :phoenix_live_view, repo: "hexpm", optional: false]}, {:phoenix_storybook, "0.6.4", [hex: :phoenix_storybook, repo: "hexpm", optional: false]}, {:timex, "3.7.11", [hex: :timex, repo: "hexpm", optional: false]}], "hexpm", "75d3533e0844eb0030d50faa30d21d9b904c5ebecbce957f4f0cd1c8b6878b12"},
"mbta_metro": {:hex, :mbta_metro, "0.0.54", "6a125fa4fce4873b0e9e6a2930b1ea2cd7bb5cf621a3ae369dbcce1f5d5fdac6", [:mix], [{:heroicons, "0.5.6", [hex: :heroicons, repo: "hexpm", optional: true]}, {:jason, "1.4.4", [hex: :jason, repo: "hexpm", optional: false]}, {:phoenix, "1.7.14", [hex: :phoenix, repo: "hexpm", optional: false]}, {:phoenix_live_view, "1.0.0-rc.6", [hex: :phoenix_live_view, repo: "hexpm", optional: false]}, {:phoenix_storybook, "0.6.4", [hex: :phoenix_storybook, repo: "hexpm", optional: false]}, {:timex, "3.7.11", [hex: :timex, repo: "hexpm", optional: false]}], "hexpm", "6e18c010c0e504d20fff4890a89ca9221ceee2b65409f007199aa76188491ab7"},
"meck": {:hex, :meck, "0.9.2", "85ccbab053f1db86c7ca240e9fc718170ee5bda03810a6292b5306bf31bae5f5", [:rebar3], [], "hexpm", "81344f561357dc40a8344afa53767c32669153355b626ea9fcbc8da6b3045826"},
"metrics": {:hex, :metrics, "1.0.1", "25f094dea2cda98213cecc3aeff09e940299d950904393b2a29d191c346a8486", [:rebar3], [], "hexpm", "69b09adddc4f74a40716ae54d140f93beb0fb8978d8636eaded0c31b6f099f16"},
"mime": {:hex, :mime, "2.0.6", "8f18486773d9b15f95f4f4f1e39b710045fa1de891fada4516559967276e4dc2", [:mix], [], "hexpm", "c9945363a6b26d747389aac3643f8e0e09d30499a138ad64fe8fd1d13d9b153e"},
Expand Down

0 comments on commit a1f2c3a

Please sign in to comment.