diff --git a/.github/actions/setup-all/action.yml b/.github/actions/setup-all/action.yml index 1de8cff2a8..cdf78866d1 100644 --- a/.github/actions/setup-all/action.yml +++ b/.github/actions/setup-all/action.yml @@ -58,4 +58,6 @@ runs: shell: bash run: | git config --global url."https://github.com/".insteadOf ssh://git@github.com/ + npm install -g husky@latest + npm install --prefix assets --package-lock-only npm run install:ci diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index ef975ec184..0c75301aab 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -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 diff --git a/assets/package-lock.json b/assets/package-lock.json index 4b209cc22c..f9b78ee384 100644 --- a/assets/package-lock.json +++ b/assets/package-lock.json @@ -35,7 +35,11 @@ "leaflet": "^1.4.0", "leaflet-rotatedmarker": "^0.2.0", "lodash": "^4.17.21", +<<<<<<< HEAD "mbta_metro": "^0.0.51", +======= + "mbta_metro": "file:../deps/mbta_metro/priv", +>>>>>>> a4334d71 (dont use npm for metro) "mobile-detect": "^1.4.5", "phoenix": "file:../deps/phoenix", "phoenix_html": "file:../deps/phoenix_html", @@ -159,13 +163,6 @@ "version": "3.3.1", "extraneous": true }, - "../deps/phoenix": { - "version": "1.7.14", - "license": "MIT" - }, - "../deps/phoenix_html": { - "version": "4.1.0" - }, "../mbta_metro/assets": { "extraneous": true }, @@ -4932,9 +4929,9 @@ } }, "node_modules/@maplibre/maplibre-gl-style-spec": { - "version": "20.3.1", - "resolved": "https://registry.npmjs.org/@maplibre/maplibre-gl-style-spec/-/maplibre-gl-style-spec-20.3.1.tgz", - "integrity": "sha512-5ueL4UDitzVtceQ8J4kY+Px3WK+eZTsmGwha3MBKHKqiHvKrjWWwBCIl1K8BuJSc5OFh83uI8IFNoFvQxX2uUw==", + "version": "20.4.0", + "resolved": "https://registry.npmjs.org/@maplibre/maplibre-gl-style-spec/-/maplibre-gl-style-spec-20.4.0.tgz", + "integrity": "sha512-AzBy3095fTFPjDjmWpR2w6HVRAZJ6hQZUCwk5Plz6EyfnfuQW1odeW5i2Ai47Y6TBA2hQnC+azscjBSALpaWgw==", "dependencies": { "@mapbox/jsonlint-lines-primitives": "~2.0.2", "@mapbox/unitbezier": "^0.0.1", @@ -4942,7 +4939,6 @@ "minimist": "^1.2.8", "quickselect": "^2.0.0", "rw": "^1.3.3", - "sort-object": "^3.0.3", "tinyqueue": "^3.0.0" }, "bin": { @@ -6922,14 +6918,6 @@ "deep-equal": "^2.0.5" } }, - "node_modules/arr-union": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/arr-union/-/arr-union-3.1.0.tgz", - "integrity": "sha512-sKpyeERZ02v1FeCZT8lrfJq5u6goHCtpTAzPwJYe7c8SPFOboNjNg1vz2L4VTn9T4PQxEx13TbXLmYUcS6Ug7Q==", - "engines": { - "node": ">=0.10.0" - } - }, "node_modules/array-equal": { "version": "1.0.0", "dev": true, @@ -7064,14 +7052,6 @@ "node": "*" } }, - "node_modules/assign-symbols": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/assign-symbols/-/assign-symbols-1.0.0.tgz", - "integrity": "sha512-Q+JC7Whu8HhmTdBph/Tq59IoRtoy6KAm5zzPv00WdujX82lbAL8K7WVjne7vdCsAmbF4AYaDOPyO3k0kl8qIrw==", - "engines": { - "node": ">=0.10.0" - } - }, "node_modules/ast-types-flow": { "version": "0.0.7", "dev": true, @@ -7875,23 +7855,6 @@ "node": ">= 0.8" } }, - "node_modules/bytewise": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/bytewise/-/bytewise-1.1.0.tgz", - "integrity": "sha512-rHuuseJ9iQ0na6UDhnrRVDh8YnWVlU6xM3VH6q/+yHDeUH2zIhUzP+2/h3LIrhLDBtTqzWpE3p3tP/boefskKQ==", - "dependencies": { - "bytewise-core": "^1.2.2", - "typewise": "^1.0.3" - } - }, - "node_modules/bytewise-core": { - "version": "1.2.3", - "resolved": "https://registry.npmjs.org/bytewise-core/-/bytewise-core-1.2.3.tgz", - "integrity": "sha512-nZD//kc78OOxeYtRlVk8/zXqTB4gf/nlguL1ggWA8FuchMyOxcyHR4QPQZMUmA7czC+YnaBrPUCubqAWe50DaA==", - "dependencies": { - "typewise-core": "^1.2" - } - }, "node_modules/cachedir": { "version": "2.3.0", "dev": true, @@ -11106,17 +11069,6 @@ "dev": true, "license": "MIT" }, - "node_modules/extend-shallow": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/extend-shallow/-/extend-shallow-2.0.1.tgz", - "integrity": "sha512-zCnTtlxNoAiDc3gqY2aYAWFx7XWWiasuF2K8Me5WbN8otHKTUKBwjPtNpRs/rbUZm7KxWAaNj7P1a/p52GbVug==", - "dependencies": { - "is-extendable": "^0.1.0" - }, - "engines": { - "node": ">=0.10.0" - } - }, "node_modules/extract-zip": { "version": "2.0.1", "dev": true, @@ -11699,14 +11651,6 @@ "url": "https://github.com/sponsors/ljharb" } }, - "node_modules/get-value": { - "version": "2.0.6", - "resolved": "https://registry.npmjs.org/get-value/-/get-value-2.0.6.tgz", - "integrity": "sha512-Ln0UQDlxH1BapMu3GPtf7CuYNwRZf2gwCuPqbyG6pB8WfmFpzqcy4xtAaAMUhnNqjMKTiCPZG2oMT3YSx8U2NA==", - "engines": { - "node": ">=0.10.0" - } - }, "node_modules/getos": { "version": "3.2.1", "dev": true, @@ -12763,14 +12707,6 @@ "url": "https://github.com/sponsors/sindresorhus" } }, - "node_modules/is-extendable": { - "version": "0.1.1", - "resolved": "https://registry.npmjs.org/is-extendable/-/is-extendable-0.1.1.tgz", - "integrity": "sha512-5BMULNob1vgFX6EjQw5izWDxrecWK9AM72rugNr0TFldMOi0fj6Jk+zeKIt0xGj4cEfQIJth4w3OKWOJ4f+AFw==", - "engines": { - "node": ">=0.10.0" - } - }, "node_modules/is-extglob": { "version": "2.1.1", "license": "MIT", @@ -12915,6 +12851,7 @@ }, "node_modules/is-plain-object": { "version": "2.0.4", + "dev": true, "license": "MIT", "dependencies": { "isobject": "^3.0.1" @@ -13104,6 +13041,7 @@ }, "node_modules/isobject": { "version": "3.0.1", + "dev": true, "license": "MIT", "engines": { "node": ">=0.10.0" @@ -16320,9 +16258,14 @@ } }, "node_modules/mbta_metro": { +<<<<<<< HEAD "version": "0.0.51", "resolved": "https://registry.npmjs.org/mbta_metro/-/mbta_metro-0.0.51.tgz", "integrity": "sha512-J75aeQCvXbv75OKMZcqLQweoBYo5vZsiVy7DI0F38ktal1XzFb/ryp8a9WBmpeXJZI0Yz5U2v57f1kl1egzxqQ==", +======= + "version": "0.0.1", + "resolved": "file:../deps/mbta_metro/priv", +>>>>>>> a4334d71 (dont use npm for metro) "dependencies": { "@tailwindcss/forms": "0.5.9", "camelcase-keys": "9.1.3", @@ -17962,12 +17905,12 @@ "license": "MIT" }, "node_modules/phoenix": { - "resolved": "../deps/phoenix", - "link": true + "version": "1.7.14", + "resolved": "file:../deps/phoenix" }, "node_modules/phoenix_html": { - "resolved": "../deps/phoenix_html", - "link": true + "version": "4.1.0", + "resolved": "file:../deps/phoenix_html" }, "node_modules/phoenix_live_view": { "version": "0.20.1", @@ -21291,20 +21234,6 @@ "node": ">= 0.8.0" } }, - "node_modules/set-value": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/set-value/-/set-value-2.0.1.tgz", - "integrity": "sha512-JxHc1weCN68wRY0fhCoXpyK55m/XPHafOmK4UWD7m2CI14GMcFypt4w/0+NV5f/ZMby2F6S2wwA7fgynh9gWSw==", - "dependencies": { - "extend-shallow": "^2.0.1", - "is-extendable": "^0.1.1", - "is-plain-object": "^2.0.3", - "split-string": "^3.0.1" - }, - "engines": { - "node": ">=0.10.0" - } - }, "node_modules/setprototypeof": { "version": "1.2.0", "dev": true, @@ -21481,38 +21410,6 @@ "websocket-driver": "^0.7.4" } }, - "node_modules/sort-asc": { - "version": "0.2.0", - "resolved": "https://registry.npmjs.org/sort-asc/-/sort-asc-0.2.0.tgz", - "integrity": "sha512-umMGhjPeHAI6YjABoSTrFp2zaBtXBej1a0yKkuMUyjjqu6FJsTF+JYwCswWDg+zJfk/5npWUUbd33HH/WLzpaA==", - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/sort-desc": { - "version": "0.2.0", - "resolved": "https://registry.npmjs.org/sort-desc/-/sort-desc-0.2.0.tgz", - "integrity": "sha512-NqZqyvL4VPW+RAxxXnB8gvE1kyikh8+pR+T+CXLksVRN9eiQqkQlPwqWYU0mF9Jm7UnctShlxLyAt1CaBOTL1w==", - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/sort-object": { - "version": "3.0.3", - "resolved": "https://registry.npmjs.org/sort-object/-/sort-object-3.0.3.tgz", - "integrity": "sha512-nK7WOY8jik6zaG9CRwZTaD5O7ETWDLZYMM12pqY8htll+7dYeqGfEUPcUBHOpSJg2vJOrvFIY2Dl5cX2ih1hAQ==", - "dependencies": { - "bytewise": "^1.1.0", - "get-value": "^2.0.2", - "is-extendable": "^0.1.1", - "sort-asc": "^0.2.0", - "sort-desc": "^0.2.0", - "union-value": "^1.0.1" - }, - "engines": { - "node": ">=0.10.0" - } - }, "node_modules/source-map": { "version": "0.6.1", "dev": true, @@ -21655,40 +21552,6 @@ "node": "*" } }, - "node_modules/split-string": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/split-string/-/split-string-3.1.0.tgz", - "integrity": "sha512-NzNVhJDYpwceVVii8/Hu6DKfD2G+NrQHlS/V/qgv763EYudVwEcMQNxd2lh+0VrUByXN/oJkl5grOhYWvQUYiw==", - "dependencies": { - "extend-shallow": "^3.0.0" - }, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/split-string/node_modules/extend-shallow": { - "version": "3.0.2", - "resolved": "https://registry.npmjs.org/extend-shallow/-/extend-shallow-3.0.2.tgz", - "integrity": "sha512-BwY5b5Ql4+qZoefgMj2NUmx+tehVTH/Kf4k1ZEtOHNFcm2wSxMRo992l6X3TIgni2eZVTZ85xMOjF31fwZAj6Q==", - "dependencies": { - "assign-symbols": "^1.0.0", - "is-extendable": "^1.0.1" - }, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/split-string/node_modules/is-extendable": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/is-extendable/-/is-extendable-1.0.1.tgz", - "integrity": "sha512-arnXMxT1hhoKo9k1LZdmlNyJdDDfy2v0fXjFlmok4+i8ul/6WlbVge9bhM74OpNPQPMGUToDtz+KXa1PneJxOA==", - "dependencies": { - "is-plain-object": "^2.0.4" - }, - "engines": { - "node": ">=0.10.0" - } - }, "node_modules/sprintf-js": { "version": "1.0.3", "dev": true, @@ -23379,19 +23242,6 @@ "node": ">=4.2.0" } }, - "node_modules/typewise": { - "version": "1.0.3", - "resolved": "https://registry.npmjs.org/typewise/-/typewise-1.0.3.tgz", - "integrity": "sha512-aXofE06xGhaQSPzt8hlTY+/YWQhm9P0jYUp1f2XtmW/3Bk0qzXcyFWAtPoo2uTGQj1ZwbDuSyuxicq+aDo8lCQ==", - "dependencies": { - "typewise-core": "^1.2.0" - } - }, - "node_modules/typewise-core": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/typewise-core/-/typewise-core-1.2.0.tgz", - "integrity": "sha512-2SCC/WLzj2SbUwzFOzqMCkz5amXLlxtJqDKTICqg30x+2DZxcfZN2MvQZmGfXWKNWaKK9pBPsvkcwv8bF/gxKg==" - }, "node_modules/unbox-primitive": { "version": "1.0.2", "dev": true, @@ -23471,20 +23321,6 @@ "url": "https://opencollective.com/unified" } }, - "node_modules/union-value": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/union-value/-/union-value-1.0.1.tgz", - "integrity": "sha512-tJfXmxMeWYnczCVs7XAEvIV7ieppALdyepWMkHkwciRpZraG/xwT+s2JN8+pr1+8jCRf80FFzvr+MpQeeoF4Xg==", - "dependencies": { - "arr-union": "^3.1.0", - "get-value": "^2.0.6", - "is-extendable": "^0.1.1", - "set-value": "^2.0.1" - }, - "engines": { - "node": ">=0.10.0" - } - }, "node_modules/unist-util-find-all-after": { "version": "3.0.2", "dev": true, diff --git a/assets/package.json b/assets/package.json index 930ffe9258..9bf4b1f703 100644 --- a/assets/package.json +++ b/assets/package.json @@ -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", diff --git a/deploy/dotcom/prod/Dockerfile b/deploy/dotcom/prod/Dockerfile index bbb6150de6..4e82a67013 100644 --- a/deploy/dotcom/prod/Dockerfile +++ b/deploy/dotcom/prod/Dockerfile @@ -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 diff --git a/mix.exs b/mix.exs index 065fa0009f..a373759b30 100644 --- a/mix.exs +++ b/mix.exs @@ -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"}, diff --git a/mix.lock b/mix.lock index 79937ed1ee..e80e8dcd03 100644 --- a/mix.lock +++ b/mix.lock @@ -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"},