From 868be8214d2587b36ff4de34f5a5609a0d3a784d Mon Sep 17 00:00:00 2001 From: Robert Prehn Date: Fri, 2 Jul 2021 23:04:14 +0000 Subject: [PATCH 1/9] chore(deps): bump elixir from 1.12.1-alpine to 1.12.2-alpine Bumps elixir from 1.12.1-alpine to 1.12.2-alpine. --- Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Dockerfile b/Dockerfile index 87b7d607..6d190b51 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,4 +1,4 @@ -FROM elixir:1.12.1-alpine AS elixir-builder +FROM elixir:1.12.2-alpine AS elixir-builder RUN mix local.hex --force \ && mix local.rebar --force From e2581ed3034effd388fce646ec3516d6c488b026 Mon Sep 17 00:00:00 2001 From: Robert Prehn Date: Wed, 14 Jul 2021 23:04:54 +0000 Subject: [PATCH 2/9] chore(deps): bump node from 16.3.0 to 16.5.0 Bumps node from 16.3.0 to 16.5.0. --- Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Dockerfile b/Dockerfile index 87b7d607..c51eb266 100644 --- a/Dockerfile +++ b/Dockerfile @@ -27,7 +27,7 @@ RUN mix deps.get # Leave off here so that we can built assets and compile the elixir app in parallel -FROM node:16.3.0 AS asset-builder +FROM node:16.5.0 AS asset-builder # Build assets in a node container ADD ./apps/app/assets/ /root/app/apps/app/assets/ From 0181464b1b7dbd555a5239dfca5813b074099e55 Mon Sep 17 00:00:00 2001 From: Robert Prehn <3952444+prehnRA@users.noreply.github.com> Date: Mon, 19 Jul 2021 12:44:35 -0500 Subject: [PATCH 3/9] chore: Build docker image in CI when Dockerfile changes --- .gitlab-ci.yml | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 083260ee..eb5817ac 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -41,8 +41,10 @@ test_1.12.1: build_image_for_commit: stage: test image: "docker:20.10" - only: - - master + rules: + - if: $CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH + - changes: + - Dockerfile services: - name: docker:20.10-dind before_script: From 0bef114208023ecc63b17c7f68e485747abbf699 Mon Sep 17 00:00:00 2001 From: Robert Prehn <3952444+prehnRA@users.noreply.github.com> Date: Mon, 19 Jul 2021 12:54:28 -0500 Subject: [PATCH 4/9] fix: Only run docker build on default branch or when Dockerfile changes --- .gitlab-ci.yml | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index eb5817ac..7e7b6d93 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -42,9 +42,12 @@ build_image_for_commit: stage: test image: "docker:20.10" rules: - - if: $CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH - - changes: + - if: '$CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH' + when: on_success + - if: '$CI_PIPELINE_SOURCE == "merge_request_event"' + changes: - Dockerfile + when: on_success services: - name: docker:20.10-dind before_script: From 928691565a1b108f4fefedb8a279ada38d184cbb Mon Sep 17 00:00:00 2001 From: Robert Prehn Date: Mon, 19 Jul 2021 19:34:26 +0000 Subject: [PATCH 5/9] chore(release): 2.11.3 [skip ci] --- apps/admin/mix.exs | 2 +- apps/content/mix.exs | 2 +- apps/core/mix.exs | 2 +- infrastructure/kube.yaml | 2 +- mix.exs | 2 +- package.json | 2 +- 6 files changed, 6 insertions(+), 6 deletions(-) diff --git a/apps/admin/mix.exs b/apps/admin/mix.exs index aa19d878..5bccdaa0 100644 --- a/apps/admin/mix.exs +++ b/apps/admin/mix.exs @@ -1,7 +1,7 @@ defmodule Legendary.Admin.MixProject do use Mix.Project - @version "2.11.2" + @version "2.11.3" def project do [ diff --git a/apps/content/mix.exs b/apps/content/mix.exs index 4e93179d..303d116d 100644 --- a/apps/content/mix.exs +++ b/apps/content/mix.exs @@ -1,7 +1,7 @@ defmodule Legendary.Content.MixProject do use Mix.Project - @version "2.11.2" + @version "2.11.3" def project do [ diff --git a/apps/core/mix.exs b/apps/core/mix.exs index 01ded59a..fd0987ac 100644 --- a/apps/core/mix.exs +++ b/apps/core/mix.exs @@ -1,7 +1,7 @@ defmodule Legendary.Core.MixProject do use Mix.Project - @version "2.11.2" + @version "2.11.3" def project do [ diff --git a/infrastructure/kube.yaml b/infrastructure/kube.yaml index 3319ca66..6f64ea54 100644 --- a/infrastructure/kube.yaml +++ b/infrastructure/kube.yaml @@ -20,7 +20,7 @@ spec: spec: containers: - name: app - image: registry.gitlab.com/mythic-insight/legendary:2.11.2 + image: registry.gitlab.com/mythic-insight/legendary:2.11.3 command: ["elixir"] args: - "--name" diff --git a/mix.exs b/mix.exs index ad9032fd..45ca7b24 100644 --- a/mix.exs +++ b/mix.exs @@ -1,7 +1,7 @@ defmodule Legendary.Mixfile do use Mix.Project - @version "2.11.2" + @version "2.11.3" def project do [ diff --git a/package.json b/package.json index 7898c854..74bba5a1 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@mythic-insight/legendary", - "version": "2.11.2", + "version": "2.11.3", "private": true, "description": "The Legendary Phoenix Boilerplate.", "main": "index.js", From 2b7588707ce1f4a0d3e9576a6140b4c6095fd78c Mon Sep 17 00:00:00 2001 From: Robert Prehn <3952444+prehnRA@users.noreply.github.com> Date: Mon, 19 Jul 2021 16:27:47 -0500 Subject: [PATCH 6/9] fix: Only purge CSS in production mode --- apps/app/assets/package-lock.json | 3 ++- apps/app/assets/package.json | 3 ++- apps/app/assets/tailwind.config.js | 7 ++++++- apps/app/assets/webpack.config.js | 1 - config/dev.exs | 1 + mix.lock | 2 +- 6 files changed, 12 insertions(+), 5 deletions(-) diff --git a/apps/app/assets/package-lock.json b/apps/app/assets/package-lock.json index 087b18dd..1612a51e 100644 --- a/apps/app/assets/package-lock.json +++ b/apps/app/assets/package-lock.json @@ -42,7 +42,8 @@ "stylelint-order": "^4.1.0", "terser-webpack-plugin": "^2.3.2", "webpack": "^5.1.0", - "webpack-cli": "^4.7.2" + "webpack-cli": "^4.7.2", + "yargs-parser": "^20.2.9" } }, "../../../deps/phoenix": { diff --git a/apps/app/assets/package.json b/apps/app/assets/package.json index 5401529f..1e76738b 100644 --- a/apps/app/assets/package.json +++ b/apps/app/assets/package.json @@ -44,7 +44,8 @@ "stylelint-order": "^4.1.0", "terser-webpack-plugin": "^2.3.2", "webpack": "^5.1.0", - "webpack-cli": "^4.7.2" + "webpack-cli": "^4.7.2", + "yargs-parser": "^20.2.9" }, "resolutions": { "graceful-fs": "4.2.3" diff --git a/apps/app/assets/tailwind.config.js b/apps/app/assets/tailwind.config.js index 47f08864..b416207c 100644 --- a/apps/app/assets/tailwind.config.js +++ b/apps/app/assets/tailwind.config.js @@ -1,10 +1,15 @@ +const yargsParser = require('yargs-parser'); +const cliArgs = yargsParser(process.argv); + +const mode = process.env.NODE_ENV || cliArgs.mode || 'development'; + module.exports = { future: { removeDeprecatedGapUtilities: true, purgeLayersByDefault: true, }, purge: { - enabled: true, + enabled: mode == 'production', layers: ['base', 'components', 'utilities'], content: [ '../../../**/views/*.ex', diff --git a/apps/app/assets/webpack.config.js b/apps/app/assets/webpack.config.js index 79a98075..952a34b7 100644 --- a/apps/app/assets/webpack.config.js +++ b/apps/app/assets/webpack.config.js @@ -22,7 +22,6 @@ module.exports = (env, options) => { entry: { 'app': glob.sync('./vendor/**/*.js').concat(['./js/app.js']), 'content-editor': ['./js/content-editor.js'], - 'tailwind': ['./tailwind.config.js'], }, output: { filename: 'js/[name].js', diff --git a/config/dev.exs b/config/dev.exs index 1fe611ae..99633450 100644 --- a/config/dev.exs +++ b/config/dev.exs @@ -26,6 +26,7 @@ use Mix.Config "development", "--watch", "--watch-options-stdin", + "--progress", cd: Path.expand("../apps/#{otp_app}/assets", __DIR__) ] ] diff --git a/mix.lock b/mix.lock index bdd2db83..d791998f 100644 --- a/mix.lock +++ b/mix.lock @@ -64,7 +64,7 @@ "phoenix_live_reload": {:hex, :phoenix_live_reload, "1.2.4", "940c0344b1d66a2e46eef02af3a70e0c5bb45a4db0bf47917add271b76cd3914", [:mix], [{:file_system, "~> 0.2.1 or ~> 0.3", [hex: :file_system, repo: "hexpm", optional: false]}, {:phoenix, "~> 1.4", [hex: :phoenix, repo: "hexpm", optional: false]}], "hexpm", "38f9308357dea4cc77f247e216da99fcb0224e05ada1469167520bed4cb8cccd"}, "phoenix_live_view": {:hex, :phoenix_live_view, "0.15.7", "09720b8e5151b3ca8ef739cd7626d4feb987c69ba0b509c9bbdb861d5a365881", [:mix], [{:jason, "~> 1.0", [hex: :jason, repo: "hexpm", optional: true]}, {:phoenix, "~> 1.5.7", [hex: :phoenix, repo: "hexpm", optional: false]}, {:phoenix_html, "~> 2.14", [hex: :phoenix_html, repo: "hexpm", optional: false]}, {:telemetry, "~> 0.4.2 or ~> 0.5", [hex: :telemetry, repo: "hexpm", optional: false]}], "hexpm", "3a756cf662420272d0f1b3b908cce5222163b5a95aa9bab404f9d29aff53276e"}, "phoenix_pubsub": {:hex, :phoenix_pubsub, "2.0.0", "a1ae76717bb168cdeb10ec9d92d1480fec99e3080f011402c0a2d68d47395ffb", [:mix], [], "hexpm", "c52d948c4f261577b9c6fa804be91884b381a7f8f18450c5045975435350f771"}, - "php_serializer": {:hex, :php_serializer, "0.9.2", "59c5fd6bd3096671fd89358fb8229341ac7423b50ad8d45a15213b02ea2edab2", [:mix], [], "hexpm", "34eb835a460944f7fc216773b363c02e7dcf8ac0390c9e9ccdbd92b31a7ca59a"}, + "php_serializer": {:hex, :php_serializer, "2.0.0", "b43f31aca22ed7321f32da2b94fe2ddf9b6739a965cb51541969119e572e821d", [:mix], [], "hexpm", "61e402e99d9062c0225a3f4fcf7e43b4cba1b8654944c0e7c139c3ca9de481da"}, "plug": {:hex, :plug, "1.11.1", "f2992bac66fdae679453c9e86134a4201f6f43a687d8ff1cd1b2862d53c80259", [:mix], [{:mime, "~> 1.0", [hex: :mime, repo: "hexpm", optional: false]}, {:plug_crypto, "~> 1.1.1 or ~> 1.2", [hex: :plug_crypto, repo: "hexpm", optional: false]}, {:telemetry, "~> 0.4", [hex: :telemetry, repo: "hexpm", optional: false]}], "hexpm", "23524e4fefbb587c11f0833b3910bfb414bf2e2534d61928e920f54e3a1b881f"}, "plug_cowboy": {:hex, :plug_cowboy, "2.5.0", "51c998f788c4e68fc9f947a5eba8c215fbb1d63a520f7604134cab0270ea6513", [:mix], [{:cowboy, "~> 2.7", [hex: :cowboy, repo: "hexpm", optional: false]}, {:cowboy_telemetry, "~> 0.3", [hex: :cowboy_telemetry, repo: "hexpm", optional: false]}, {:plug, "~> 1.7", [hex: :plug, repo: "hexpm", optional: false]}, {:telemetry, "~> 0.4", [hex: :telemetry, repo: "hexpm", optional: false]}], "hexpm", "5b2c8925a5e2587446f33810a58c01e66b3c345652eeec809b76ba007acde71a"}, "plug_crypto": {:hex, :plug_crypto, "1.2.2", "05654514ac717ff3a1843204b424477d9e60c143406aa94daf2274fdd280794d", [:mix], [], "hexpm", "87631c7ad914a5a445f0a3809f99b079113ae4ed4b867348dd9eec288cecb6db"}, From b099ebf9c84b603be0038a3265daafc4eec2d663 Mon Sep 17 00:00:00 2001 From: Robert Prehn Date: Mon, 19 Jul 2021 21:36:16 +0000 Subject: [PATCH 7/9] chore(release): 2.11.4 [skip ci] --- apps/admin/mix.exs | 2 +- apps/content/mix.exs | 2 +- apps/core/mix.exs | 2 +- infrastructure/kube.yaml | 2 +- mix.exs | 2 +- package.json | 2 +- 6 files changed, 6 insertions(+), 6 deletions(-) diff --git a/apps/admin/mix.exs b/apps/admin/mix.exs index 5bccdaa0..0c87fe76 100644 --- a/apps/admin/mix.exs +++ b/apps/admin/mix.exs @@ -1,7 +1,7 @@ defmodule Legendary.Admin.MixProject do use Mix.Project - @version "2.11.3" + @version "2.11.4" def project do [ diff --git a/apps/content/mix.exs b/apps/content/mix.exs index 303d116d..4e4a6d91 100644 --- a/apps/content/mix.exs +++ b/apps/content/mix.exs @@ -1,7 +1,7 @@ defmodule Legendary.Content.MixProject do use Mix.Project - @version "2.11.3" + @version "2.11.4" def project do [ diff --git a/apps/core/mix.exs b/apps/core/mix.exs index fd0987ac..04ac3705 100644 --- a/apps/core/mix.exs +++ b/apps/core/mix.exs @@ -1,7 +1,7 @@ defmodule Legendary.Core.MixProject do use Mix.Project - @version "2.11.3" + @version "2.11.4" def project do [ diff --git a/infrastructure/kube.yaml b/infrastructure/kube.yaml index 6f64ea54..d5e0dfa5 100644 --- a/infrastructure/kube.yaml +++ b/infrastructure/kube.yaml @@ -20,7 +20,7 @@ spec: spec: containers: - name: app - image: registry.gitlab.com/mythic-insight/legendary:2.11.3 + image: registry.gitlab.com/mythic-insight/legendary:2.11.4 command: ["elixir"] args: - "--name" diff --git a/mix.exs b/mix.exs index 45ca7b24..9f274b00 100644 --- a/mix.exs +++ b/mix.exs @@ -1,7 +1,7 @@ defmodule Legendary.Mixfile do use Mix.Project - @version "2.11.3" + @version "2.11.4" def project do [ diff --git a/package.json b/package.json index 74bba5a1..9bfa8f6b 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@mythic-insight/legendary", - "version": "2.11.3", + "version": "2.11.4", "private": true, "description": "The Legendary Phoenix Boilerplate.", "main": "index.js", From b3467b0302705783f1dcb1a6b82430dae25252ce Mon Sep 17 00:00:00 2001 From: Robert Prehn <3952444+prehnRA@users.noreply.github.com> Date: Tue, 20 Jul 2021 09:55:58 -0500 Subject: [PATCH 8/9] fix: Fix typo in documentation --- apps/core/guides/tutorial.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/apps/core/guides/tutorial.md b/apps/core/guides/tutorial.md index 95a0186d..9c9e493b 100644 --- a/apps/core/guides/tutorial.md +++ b/apps/core/guides/tutorial.md @@ -301,7 +301,7 @@ We also need to filter the items shown based on the current user. In inventory.e ```elixir def list_items(user_id) do Item - |> where(owner_id: user_id) + |> where(owner_id: ^user_id) |> Repo.all() end ``` From d8902ec569eda045436bc2136cda79b93960ff16 Mon Sep 17 00:00:00 2001 From: Robert Prehn Date: Tue, 20 Jul 2021 15:16:30 +0000 Subject: [PATCH 9/9] chore(release): 2.11.5 [skip ci] --- apps/admin/mix.exs | 2 +- apps/content/mix.exs | 2 +- apps/core/mix.exs | 2 +- infrastructure/kube.yaml | 2 +- mix.exs | 2 +- package.json | 2 +- 6 files changed, 6 insertions(+), 6 deletions(-) diff --git a/apps/admin/mix.exs b/apps/admin/mix.exs index 0c87fe76..5de98c1d 100644 --- a/apps/admin/mix.exs +++ b/apps/admin/mix.exs @@ -1,7 +1,7 @@ defmodule Legendary.Admin.MixProject do use Mix.Project - @version "2.11.4" + @version "2.11.5" def project do [ diff --git a/apps/content/mix.exs b/apps/content/mix.exs index 4e4a6d91..ab58af5f 100644 --- a/apps/content/mix.exs +++ b/apps/content/mix.exs @@ -1,7 +1,7 @@ defmodule Legendary.Content.MixProject do use Mix.Project - @version "2.11.4" + @version "2.11.5" def project do [ diff --git a/apps/core/mix.exs b/apps/core/mix.exs index 04ac3705..e6b001b3 100644 --- a/apps/core/mix.exs +++ b/apps/core/mix.exs @@ -1,7 +1,7 @@ defmodule Legendary.Core.MixProject do use Mix.Project - @version "2.11.4" + @version "2.11.5" def project do [ diff --git a/infrastructure/kube.yaml b/infrastructure/kube.yaml index d5e0dfa5..8d55c168 100644 --- a/infrastructure/kube.yaml +++ b/infrastructure/kube.yaml @@ -20,7 +20,7 @@ spec: spec: containers: - name: app - image: registry.gitlab.com/mythic-insight/legendary:2.11.4 + image: registry.gitlab.com/mythic-insight/legendary:2.11.5 command: ["elixir"] args: - "--name" diff --git a/mix.exs b/mix.exs index 9f274b00..b166ea77 100644 --- a/mix.exs +++ b/mix.exs @@ -1,7 +1,7 @@ defmodule Legendary.Mixfile do use Mix.Project - @version "2.11.4" + @version "2.11.5" def project do [ diff --git a/package.json b/package.json index 9bfa8f6b..2ef77edd 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@mythic-insight/legendary", - "version": "2.11.4", + "version": "2.11.5", "private": true, "description": "The Legendary Phoenix Boilerplate.", "main": "index.js",