From 8dfa251d7b75e5dfdbc4eb2080827ef7d00f95a3 Mon Sep 17 00:00:00 2001 From: ACompleteNoobSmoke Date: Tue, 16 Jan 2024 07:55:19 -0600 Subject: [PATCH 01/20] Ready for deployment --- .ebignore | 0 .gitignore | 5 + Procfile | 1 + __tests__/page.test.tsx | 16 +- package-lock.json | 565 +++++++++++++++++++++++++++++++++++++ package.json | 1 + src/app/page.tsx | 9 +- src/app/utils/flagsmith.ts | 8 + 8 files changed, 602 insertions(+), 3 deletions(-) create mode 100644 .ebignore create mode 100644 Procfile create mode 100644 src/app/utils/flagsmith.ts diff --git a/.ebignore b/.ebignore new file mode 100644 index 0000000..e69de29 diff --git a/.gitignore b/.gitignore index 7555eb3..4c4e178 100644 --- a/.gitignore +++ b/.gitignore @@ -36,3 +36,8 @@ yarn-error.log* # typescript *.tsbuildinfo next-env.d.ts + +# Elastic Beanstalk Files +.elasticbeanstalk/* +!.elasticbeanstalk/*.cfg.yml +!.elasticbeanstalk/*.global.yml diff --git a/Procfile b/Procfile new file mode 100644 index 0000000..37c039a --- /dev/null +++ b/Procfile @@ -0,0 +1 @@ +web: npm run start -- -p $PORT diff --git a/__tests__/page.test.tsx b/__tests__/page.test.tsx index 9cb8ae4..aac9fd1 100644 --- a/__tests__/page.test.tsx +++ b/__tests__/page.test.tsx @@ -2,9 +2,21 @@ import { render, screen } from "@testing-library/react"; import Home from "../src/app/page"; import "@testing-library/jest-dom"; +jest.mock("../src/app/utils/flagsmith", () => { + return { + getEnvironmentFlags: jest.fn(() => + Promise.resolve({ + isFeatureEnabled: () => { + return true; + }, + }), + ), + }; +}); + describe("Home", () => { - it("renders a heading", () => { - render(); + it("renders a heading", async () => { + render(await Home()); const docH = screen.getByRole("heading", { name: "Hello World", diff --git a/package-lock.json b/package-lock.json index e920d76..95eb9a6 100644 --- a/package-lock.json +++ b/package-lock.json @@ -13,6 +13,7 @@ "@types/react-dom": "18.2.7", "eslint": "8.45.0", "eslint-config-next": "13.4.12", + "flagsmith-nodejs": "^3.2.0", "next": "13.4.12", "react": "18.2.0", "react-dom": "18.2.0", @@ -1854,6 +1855,17 @@ "integrity": "sha512-j2afSsaIENvHZN2B8GOpF566vZ5WVk5opAiMTvWgaQT8DkbOqsTfvNAvHoRGU2zzP8cPoqys+xHTRDWW8L+/BA==", "dev": true }, + "node_modules/abort-controller": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/abort-controller/-/abort-controller-3.0.0.tgz", + "integrity": "sha512-h8lQ8tacZYnR3vNQTgibj+tODHI5/+l06Au2Pcriv/Gmet0eaj4TwWH41sO9wnHDiQsEj19q0drzdWdeAHtweg==", + "dependencies": { + "event-target-shim": "^5.0.0" + }, + "engines": { + "node": ">=6.5" + } + }, "node_modules/acorn": { "version": "8.10.0", "resolved": "https://registry.npmjs.org/acorn/-/acorn-8.10.0.tgz", @@ -2126,6 +2138,14 @@ "integrity": "sha512-Oei9OH4tRh0YqU3GxhX79dM/mwVgvbZJaSNaRk+bshkj0S5cfHcgYakreBjrHwatXKbz+IoIdYLxrKim2MjW0Q==", "dev": true }, + "node_modules/atomic-sleep": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/atomic-sleep/-/atomic-sleep-1.0.0.tgz", + "integrity": "sha512-kNOjDqAh7px0XWNI+4QbzoiR/nTkHAWNud2uvnJquD1/x5a7EQZMJT0AczqK0Qn67oY/TTQ1LbUKajZpp3I9tQ==", + "engines": { + "node": ">=8.0.0" + } + }, "node_modules/available-typed-arrays": { "version": "1.0.5", "resolved": "https://registry.npmjs.org/available-typed-arrays/-/available-typed-arrays-1.0.5.tgz", @@ -2249,6 +2269,25 @@ "resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-1.0.2.tgz", "integrity": "sha512-3oSeUO0TMV67hN1AmbXsK4yaqU7tjiHlbxRDZOpH0KW9+CeX4bRAaX0Anxt0tx2MrpRpWwQaPwIlISEJhYU5Pw==" }, + "node_modules/base64-js": { + "version": "1.5.1", + "resolved": "https://registry.npmjs.org/base64-js/-/base64-js-1.5.1.tgz", + "integrity": "sha512-AKpaYlHn8t4SVbOHCy+b5+KKgvR4vrsD8vbvrbiQJps7fKDTkjkDry6ji0rUJjC0kzbNePLwzxq8iypo41qeWA==", + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/feross" + }, + { + "type": "patreon", + "url": "https://www.patreon.com/feross" + }, + { + "type": "consulting", + "url": "https://feross.org/support" + } + ] + }, "node_modules/big-integer": { "version": "1.6.51", "resolved": "https://registry.npmjs.org/big-integer/-/big-integer-1.6.51.tgz", @@ -2329,6 +2368,29 @@ "node-int64": "^0.4.0" } }, + "node_modules/buffer": { + "version": "6.0.3", + "resolved": "https://registry.npmjs.org/buffer/-/buffer-6.0.3.tgz", + "integrity": "sha512-FTiCpNxtwiZZHEZbcbTIcZjERVICn9yq/pDFkTl95/AxzD1naBctN7YO68riM/gLSDY7sdrMby8hofADYuuqOA==", + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/feross" + }, + { + "type": "patreon", + "url": "https://www.patreon.com/feross" + }, + { + "type": "consulting", + "url": "https://feross.org/support" + } + ], + "dependencies": { + "base64-js": "^1.3.1", + "ieee754": "^1.2.1" + } + }, "node_modules/buffer-from": { "version": "1.1.2", "resolved": "https://registry.npmjs.org/buffer-from/-/buffer-from-1.1.2.tgz", @@ -2432,6 +2494,14 @@ "node": ">=10" } }, + "node_modules/charenc": { + "version": "0.0.2", + "resolved": "https://registry.npmjs.org/charenc/-/charenc-0.0.2.tgz", + "integrity": "sha512-yrLQ/yVUFXkzg7EDQsPieE/53+0RlaWTs+wBrvW36cyilJ2SaDWfl4Yj7MtLTXleV9uEKefbAGUPv2/iWSooRA==", + "engines": { + "node": "*" + } + }, "node_modules/ci-info": { "version": "3.8.0", "resolved": "https://registry.npmjs.org/ci-info/-/ci-info-3.8.0.tgz", @@ -2540,6 +2610,14 @@ "node": ">= 8" } }, + "node_modules/crypt": { + "version": "0.0.2", + "resolved": "https://registry.npmjs.org/crypt/-/crypt-0.0.2.tgz", + "integrity": "sha512-mCxBlsHFYh9C+HVpiEacem8FEBnMXgU9gy4zmNC+SXAZNB/1idgp/aulFJ4FgCi7GPEVbfyng092GqL2k2rmow==", + "engines": { + "node": "*" + } + }, "node_modules/css.escape": { "version": "1.5.1", "resolved": "https://registry.npmjs.org/css.escape/-/css.escape-1.5.1.tgz", @@ -3464,6 +3542,22 @@ "node": ">=0.10.0" } }, + "node_modules/event-target-shim": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/event-target-shim/-/event-target-shim-5.0.1.tgz", + "integrity": "sha512-i/2XbnSz/uxRCU6+NdVJgKWDTM427+MqYbkQzD321DuCQJUqOuJKIA0IM2+W2xtYHdKOmZ4dR6fExsd4SXL+WQ==", + "engines": { + "node": ">=6" + } + }, + "node_modules/events": { + "version": "3.3.0", + "resolved": "https://registry.npmjs.org/events/-/events-3.3.0.tgz", + "integrity": "sha512-mQw+2fkQbALzQ7V0MY0IqdnXNOeTtP4r0lN9z7AAawCXgqea7bDii20AYrIBrFd/Hx0M2Ocz6S111CaFkUcb0Q==", + "engines": { + "node": ">=0.8.x" + } + }, "node_modules/execa": { "version": "7.2.0", "resolved": "https://registry.npmjs.org/execa/-/execa-7.2.0.tgz", @@ -3553,6 +3647,14 @@ "resolved": "https://registry.npmjs.org/fast-levenshtein/-/fast-levenshtein-2.0.6.tgz", "integrity": "sha512-DCXu6Ifhqcks7TZKY3Hxp3y6qphY5SJZmrWMDrKcERSOXWQdMhU9Ig/PYrzyw/ul9jOIyh0N4M0tbC5hodg8dw==" }, + "node_modules/fast-redact": { + "version": "3.3.0", + "resolved": "https://registry.npmjs.org/fast-redact/-/fast-redact-3.3.0.tgz", + "integrity": "sha512-6T5V1QK1u4oF+ATxs1lWUmlEk6P2T9HqJG3e2DnHOdVgZy2rFJBoEnrIedcTXlkAHU/zKC+7KETJ+KGGKwxgMQ==", + "engines": { + "node": ">=6" + } + }, "node_modules/fastq": { "version": "1.15.0", "resolved": "https://registry.npmjs.org/fastq/-/fastq-1.15.0.tgz", @@ -3607,6 +3709,19 @@ "url": "https://github.com/sponsors/sindresorhus" } }, + "node_modules/flagsmith-nodejs": { + "version": "3.2.0", + "resolved": "https://registry.npmjs.org/flagsmith-nodejs/-/flagsmith-nodejs-3.2.0.tgz", + "integrity": "sha512-X1xxHia1Q5/oX5HPUKW7h1anOwyun64lP12RFn0neznsUb+Tl53hjjNrk5EeYOrKuHSrxcVoRcx9UyDeTVwYRg==", + "dependencies": { + "big-integer": "^1.6.51", + "md5": "^2.3.0", + "node-fetch": "^2.1.2", + "pino": "^8.8.0", + "semver": "^7.3.7", + "uuid": "^8.3.2" + } + }, "node_modules/flat-cache": { "version": "3.0.4", "resolved": "https://registry.npmjs.org/flat-cache/-/flat-cache-3.0.4.tgz", @@ -4015,6 +4130,25 @@ "node": ">=0.10.0" } }, + "node_modules/ieee754": { + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/ieee754/-/ieee754-1.2.1.tgz", + "integrity": "sha512-dcyqhDvX1C46lXZcVqCpK+FtMRQVdIMN6/Df5js2zouUsqG7I6sFxitIC+7KYK29KdXOLHdu9zL4sFnoVQnqaA==", + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/feross" + }, + { + "type": "patreon", + "url": "https://www.patreon.com/feross" + }, + { + "type": "consulting", + "url": "https://feross.org/support" + } + ] + }, "node_modules/ignore": { "version": "5.2.4", "resolved": "https://registry.npmjs.org/ignore/-/ignore-5.2.4.tgz", @@ -4162,6 +4296,11 @@ "url": "https://github.com/sponsors/ljharb" } }, + "node_modules/is-buffer": { + "version": "1.1.6", + "resolved": "https://registry.npmjs.org/is-buffer/-/is-buffer-1.1.6.tgz", + "integrity": "sha512-NcdALwpXkTm5Zvvbk7owOUSvVvBKDgKP5/ewfXEznmQFfs4ZRmanOeKBTjRVjka3QFoN6XJ+9F3USqfHqTaU5w==" + }, "node_modules/is-callable": { "version": "1.2.7", "resolved": "https://registry.npmjs.org/is-callable/-/is-callable-1.2.7.tgz", @@ -5476,6 +5615,16 @@ "tmpl": "1.0.5" } }, + "node_modules/md5": { + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/md5/-/md5-2.3.0.tgz", + "integrity": "sha512-T1GITYmFaKuO91vxyoQMFETst+O71VUPEU3ze5GNzDm0OWdP8v1ziTaAEPUr/3kLsY3Sftgz242A1SetQiDL7g==", + "dependencies": { + "charenc": "0.0.2", + "crypt": "0.0.2", + "is-buffer": "~1.1.6" + } + }, "node_modules/merge-stream": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/merge-stream/-/merge-stream-2.0.0.tgz", @@ -5638,6 +5787,44 @@ } } }, + "node_modules/node-fetch": { + "version": "2.7.0", + "resolved": "https://registry.npmjs.org/node-fetch/-/node-fetch-2.7.0.tgz", + "integrity": "sha512-c4FRfUm/dbcWZ7U+1Wq0AwCyFL+3nt2bEw05wfxSz+DWpWsitgmSgYmy2dQdWyKC1694ELPqMs/YzUSNozLt8A==", + "dependencies": { + "whatwg-url": "^5.0.0" + }, + "engines": { + "node": "4.x || >=6.0.0" + }, + "peerDependencies": { + "encoding": "^0.1.0" + }, + "peerDependenciesMeta": { + "encoding": { + "optional": true + } + } + }, + "node_modules/node-fetch/node_modules/tr46": { + "version": "0.0.3", + "resolved": "https://registry.npmjs.org/tr46/-/tr46-0.0.3.tgz", + "integrity": "sha512-N3WMsuqV66lT30CrXNbEjx4GEwlow3v6rr4mCcv6prnfwhS01rkgyFdjPNBYd9br7LpXV1+Emh01fHnq2Gdgrw==" + }, + "node_modules/node-fetch/node_modules/webidl-conversions": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/webidl-conversions/-/webidl-conversions-3.0.1.tgz", + "integrity": "sha512-2JAn3z8AR6rjK8Sm8orRC0h/bcl/DqL7tRPdGZ4I1CjdF+EaMLmYxBHyXuKL849eucPFhvBoxMsflfOb8kxaeQ==" + }, + "node_modules/node-fetch/node_modules/whatwg-url": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/whatwg-url/-/whatwg-url-5.0.0.tgz", + "integrity": "sha512-saE57nupxk6v3HY35+jzBwYa0rKSy0XR8JSxZPwgLr7ys0IBzhGviA1/TUGJLmSVqs8pb9AnvICXEuOHLprYTw==", + "dependencies": { + "tr46": "~0.0.3", + "webidl-conversions": "^3.0.0" + } + }, "node_modules/node-int64": { "version": "0.4.0", "resolved": "https://registry.npmjs.org/node-int64/-/node-int64-0.4.0.tgz", @@ -5815,6 +6002,14 @@ "url": "https://github.com/sponsors/ljharb" } }, + "node_modules/on-exit-leak-free": { + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/on-exit-leak-free/-/on-exit-leak-free-2.1.2.tgz", + "integrity": "sha512-0eJJY6hXLGf1udHwfNftBqH+g73EU4B504nZeKpz1sYRKafAghwxEJunB2O7rDZkL4PGfsMVnTXZ2EjibbqcsA==", + "engines": { + "node": ">=14.0.0" + } + }, "node_modules/once": { "version": "1.4.0", "resolved": "https://registry.npmjs.org/once/-/once-1.4.0.tgz", @@ -6001,6 +6196,41 @@ "url": "https://github.com/sponsors/jonschlinkert" } }, + "node_modules/pino": { + "version": "8.17.2", + "resolved": "https://registry.npmjs.org/pino/-/pino-8.17.2.tgz", + "integrity": "sha512-LA6qKgeDMLr2ux2y/YiUt47EfgQ+S9LznBWOJdN3q1dx2sv0ziDLUBeVpyVv17TEcGCBuWf0zNtg3M5m1NhhWQ==", + "dependencies": { + "atomic-sleep": "^1.0.0", + "fast-redact": "^3.1.1", + "on-exit-leak-free": "^2.1.0", + "pino-abstract-transport": "v1.1.0", + "pino-std-serializers": "^6.0.0", + "process-warning": "^3.0.0", + "quick-format-unescaped": "^4.0.3", + "real-require": "^0.2.0", + "safe-stable-stringify": "^2.3.1", + "sonic-boom": "^3.7.0", + "thread-stream": "^2.0.0" + }, + "bin": { + "pino": "bin.js" + } + }, + "node_modules/pino-abstract-transport": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/pino-abstract-transport/-/pino-abstract-transport-1.1.0.tgz", + "integrity": "sha512-lsleG3/2a/JIWUtf9Q5gUNErBqwIu1tUKTT3dUzaf5DySw9ra1wcqKjJjLX1VTY64Wk1eEOYsVGSaGfCK85ekA==", + "dependencies": { + "readable-stream": "^4.0.0", + "split2": "^4.0.0" + } + }, + "node_modules/pino-std-serializers": { + "version": "6.2.2", + "resolved": "https://registry.npmjs.org/pino-std-serializers/-/pino-std-serializers-6.2.2.tgz", + "integrity": "sha512-cHjPPsE+vhj/tnhCy/wiMh3M3z3h/j15zHQX+S9GkTBgqJuTuJzYJ4gUyACLhDaJ7kk9ba9iRDmbH2tJU03OiA==" + }, "node_modules/pirates": { "version": "4.0.6", "resolved": "https://registry.npmjs.org/pirates/-/pirates-4.0.6.tgz", @@ -6164,6 +6394,19 @@ "integrity": "sha512-xWGDIW6x921xtzPkhiULtthJHoJvBbF3q26fzloPCK0hsvxtPVelvftw3zjbHWSkR2km9Z+4uxbDDK/6Zw9B8w==", "dev": true }, + "node_modules/process": { + "version": "0.11.10", + "resolved": "https://registry.npmjs.org/process/-/process-0.11.10.tgz", + "integrity": "sha512-cdGef/drWFoydD1JsMzuFf8100nZl+GT+yacc2bEced5f9Rjk4z+WtFUTBu9PhOi9j/jfmBPu0mMEY4wIdAF8A==", + "engines": { + "node": ">= 0.6.0" + } + }, + "node_modules/process-warning": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/process-warning/-/process-warning-3.0.0.tgz", + "integrity": "sha512-mqn0kFRl0EoqhnL0GQ0veqFHyIN1yig9RHh/InzORTUiZHFRAur+aMtRkELNwGs9aNwKS6tg/An4NYBPGwvtzQ==" + }, "node_modules/prompts": { "version": "2.4.2", "resolved": "https://registry.npmjs.org/prompts/-/prompts-2.4.2.tgz", @@ -6242,6 +6485,11 @@ } ] }, + "node_modules/quick-format-unescaped": { + "version": "4.0.4", + "resolved": "https://registry.npmjs.org/quick-format-unescaped/-/quick-format-unescaped-4.0.4.tgz", + "integrity": "sha512-tYC1Q1hgyRuHgloV/YXs2w15unPVh8qfu/qCTfhTYamaw7fyhumKa2yGpdSo87vY32rIclj+4fWYQXUMs9EHvg==" + }, "node_modules/react": { "version": "18.2.0", "resolved": "https://registry.npmjs.org/react/-/react-18.2.0.tgz", @@ -6270,6 +6518,29 @@ "resolved": "https://registry.npmjs.org/react-is/-/react-is-16.13.1.tgz", "integrity": "sha512-24e6ynE2H+OKt4kqsOvNd8kBpV65zoxbA4BVsEOB3ARVWQki/DHzaUoC5KuON/BiccDaCCTZBuOcfZs70kR8bQ==" }, + "node_modules/readable-stream": { + "version": "4.5.2", + "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-4.5.2.tgz", + "integrity": "sha512-yjavECdqeZ3GLXNgRXgeQEdz9fvDDkNKyHnbHRFtOr7/LcfgBcmct7t/ET+HaCTqfh06OzoAxrkN/IfjJBVe+g==", + "dependencies": { + "abort-controller": "^3.0.0", + "buffer": "^6.0.3", + "events": "^3.3.0", + "process": "^0.11.10", + "string_decoder": "^1.3.0" + }, + "engines": { + "node": "^12.22.0 || ^14.17.0 || >=16.0.0" + } + }, + "node_modules/real-require": { + "version": "0.2.0", + "resolved": "https://registry.npmjs.org/real-require/-/real-require-0.2.0.tgz", + "integrity": "sha512-57frrGM/OCTLqLOAh0mhVA9VBMHd+9U7Zb2THMGdBUoZVOtGbJzjxsYGDJ3A9AYYCP4hn6y1TVbaOfzWtm5GFg==", + "engines": { + "node": ">= 12.13.0" + } + }, "node_modules/redent": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/redent/-/redent-3.0.0.tgz", @@ -6539,6 +6810,25 @@ "url": "https://github.com/sponsors/ljharb" } }, + "node_modules/safe-buffer": { + "version": "5.2.1", + "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.2.1.tgz", + "integrity": "sha512-rp3So07KcdmmKbGvgaNxQSJr7bGVSVk5S9Eq1F+ppbRo70+YeaDxkw5Dd8NPN+GD6bjnYm2VuPuCXmpuYvmCXQ==", + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/feross" + }, + { + "type": "patreon", + "url": "https://www.patreon.com/feross" + }, + { + "type": "consulting", + "url": "https://feross.org/support" + } + ] + }, "node_modules/safe-regex-test": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/safe-regex-test/-/safe-regex-test-1.0.0.tgz", @@ -6552,6 +6842,14 @@ "url": "https://github.com/sponsors/ljharb" } }, + "node_modules/safe-stable-stringify": { + "version": "2.4.3", + "resolved": "https://registry.npmjs.org/safe-stable-stringify/-/safe-stable-stringify-2.4.3.tgz", + "integrity": "sha512-e2bDA2WJT0wxseVd4lsDP4+3ONX6HpMXQa1ZhFQ7SU+GjvORCmShbCMltrtIDfkYhVHrOcPtj+KhmDBdPdZD1g==", + "engines": { + "node": ">=10" + } + }, "node_modules/safer-buffer": { "version": "2.1.2", "resolved": "https://registry.npmjs.org/safer-buffer/-/safer-buffer-2.1.2.tgz", @@ -6643,6 +6941,14 @@ "node": ">=8" } }, + "node_modules/sonic-boom": { + "version": "3.8.0", + "resolved": "https://registry.npmjs.org/sonic-boom/-/sonic-boom-3.8.0.tgz", + "integrity": "sha512-ybz6OYOUjoQQCQ/i4LU8kaToD8ACtYP+Cj5qd2AO36bwbdewxWJ3ArmJ2cr6AvxlL2o0PqnCcPGUgkILbfkaCA==", + "dependencies": { + "atomic-sleep": "^1.0.0" + } + }, "node_modules/source-map": { "version": "0.6.1", "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz", @@ -6670,6 +6976,14 @@ "source-map": "^0.6.0" } }, + "node_modules/split2": { + "version": "4.2.0", + "resolved": "https://registry.npmjs.org/split2/-/split2-4.2.0.tgz", + "integrity": "sha512-UcjcJOWknrNkF6PLX83qcHM6KHgVKNkV62Y8a5uYDVv9ydGQVwAHMKqHdJje1VTWpljG0WYpCDhrCdAOYH4TWg==", + "engines": { + "node": ">= 10.x" + } + }, "node_modules/sprintf-js": { "version": "1.0.3", "resolved": "https://registry.npmjs.org/sprintf-js/-/sprintf-js-1.0.3.tgz", @@ -6717,6 +7031,14 @@ "node": ">=10.0.0" } }, + "node_modules/string_decoder": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.3.0.tgz", + "integrity": "sha512-hkRX8U1WjJFd8LsDJ2yQ/wWWxaopEsABU1XfkM8A+j0+85JAGppt16cr1Whg6KIbb4okU6Mql6BOj+uup/wKeA==", + "dependencies": { + "safe-buffer": "~5.2.0" + } + }, "node_modules/string-length": { "version": "4.0.2", "resolved": "https://registry.npmjs.org/string-length/-/string-length-4.0.2.tgz", @@ -6955,6 +7277,14 @@ "resolved": "https://registry.npmjs.org/text-table/-/text-table-0.2.0.tgz", "integrity": "sha512-N+8UisAXDGk8PFXP4HAzVR9nbfmVJ3zYLAWiTIoqC5v5isinhr+r5uaO8+7r3BMfuNIufIsA7RdpVgacC2cSpw==" }, + "node_modules/thread-stream": { + "version": "2.4.1", + "resolved": "https://registry.npmjs.org/thread-stream/-/thread-stream-2.4.1.tgz", + "integrity": "sha512-d/Ex2iWd1whipbT681JmTINKw0ZwOUBZm7+Gjs64DHuX34mmw8vJL2bFAaNacaW72zYiTJxSHi5abUuOi5nsfg==", + "dependencies": { + "real-require": "^0.2.0" + } + }, "node_modules/titleize": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/titleize/-/titleize-3.0.0.tgz", @@ -7237,6 +7567,14 @@ "requires-port": "^1.0.0" } }, + "node_modules/uuid": { + "version": "8.3.2", + "resolved": "https://registry.npmjs.org/uuid/-/uuid-8.3.2.tgz", + "integrity": "sha512-+NYs2QeMWy+GWFOEm9xnn6HCDp0l7QBD7ml8zLUmJ+93Q5NF0NocErnwkTkXVFNiX3/fpC6afS8Dhb/gz7R7eg==", + "bin": { + "uuid": "dist/bin/uuid" + } + }, "node_modules/v8-to-istanbul": { "version": "9.1.0", "resolved": "https://registry.npmjs.org/v8-to-istanbul/-/v8-to-istanbul-9.1.0.tgz", @@ -8898,6 +9236,14 @@ "integrity": "sha512-j2afSsaIENvHZN2B8GOpF566vZ5WVk5opAiMTvWgaQT8DkbOqsTfvNAvHoRGU2zzP8cPoqys+xHTRDWW8L+/BA==", "dev": true }, + "abort-controller": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/abort-controller/-/abort-controller-3.0.0.tgz", + "integrity": "sha512-h8lQ8tacZYnR3vNQTgibj+tODHI5/+l06Au2Pcriv/Gmet0eaj4TwWH41sO9wnHDiQsEj19q0drzdWdeAHtweg==", + "requires": { + "event-target-shim": "^5.0.0" + } + }, "acorn": { "version": "8.10.0", "resolved": "https://registry.npmjs.org/acorn/-/acorn-8.10.0.tgz", @@ -9094,6 +9440,11 @@ "integrity": "sha512-Oei9OH4tRh0YqU3GxhX79dM/mwVgvbZJaSNaRk+bshkj0S5cfHcgYakreBjrHwatXKbz+IoIdYLxrKim2MjW0Q==", "dev": true }, + "atomic-sleep": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/atomic-sleep/-/atomic-sleep-1.0.0.tgz", + "integrity": "sha512-kNOjDqAh7px0XWNI+4QbzoiR/nTkHAWNud2uvnJquD1/x5a7EQZMJT0AczqK0Qn67oY/TTQ1LbUKajZpp3I9tQ==" + }, "available-typed-arrays": { "version": "1.0.5", "resolved": "https://registry.npmjs.org/available-typed-arrays/-/available-typed-arrays-1.0.5.tgz", @@ -9187,6 +9538,11 @@ "resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-1.0.2.tgz", "integrity": "sha512-3oSeUO0TMV67hN1AmbXsK4yaqU7tjiHlbxRDZOpH0KW9+CeX4bRAaX0Anxt0tx2MrpRpWwQaPwIlISEJhYU5Pw==" }, + "base64-js": { + "version": "1.5.1", + "resolved": "https://registry.npmjs.org/base64-js/-/base64-js-1.5.1.tgz", + "integrity": "sha512-AKpaYlHn8t4SVbOHCy+b5+KKgvR4vrsD8vbvrbiQJps7fKDTkjkDry6ji0rUJjC0kzbNePLwzxq8iypo41qeWA==" + }, "big-integer": { "version": "1.6.51", "resolved": "https://registry.npmjs.org/big-integer/-/big-integer-1.6.51.tgz", @@ -9238,6 +9594,15 @@ "node-int64": "^0.4.0" } }, + "buffer": { + "version": "6.0.3", + "resolved": "https://registry.npmjs.org/buffer/-/buffer-6.0.3.tgz", + "integrity": "sha512-FTiCpNxtwiZZHEZbcbTIcZjERVICn9yq/pDFkTl95/AxzD1naBctN7YO68riM/gLSDY7sdrMby8hofADYuuqOA==", + "requires": { + "base64-js": "^1.3.1", + "ieee754": "^1.2.1" + } + }, "buffer-from": { "version": "1.1.2", "resolved": "https://registry.npmjs.org/buffer-from/-/buffer-from-1.1.2.tgz", @@ -9300,6 +9665,11 @@ "integrity": "sha512-kWWXztvZ5SBQV+eRgKFeh8q5sLuZY2+8WUIzlxWVTg+oGwY14qylx1KbKzHd8P6ZYkAg0xyIDU9JMHhyJMZ1jw==", "dev": true }, + "charenc": { + "version": "0.0.2", + "resolved": "https://registry.npmjs.org/charenc/-/charenc-0.0.2.tgz", + "integrity": "sha512-yrLQ/yVUFXkzg7EDQsPieE/53+0RlaWTs+wBrvW36cyilJ2SaDWfl4Yj7MtLTXleV9uEKefbAGUPv2/iWSooRA==" + }, "ci-info": { "version": "3.8.0", "resolved": "https://registry.npmjs.org/ci-info/-/ci-info-3.8.0.tgz", @@ -9383,6 +9753,11 @@ "which": "^2.0.1" } }, + "crypt": { + "version": "0.0.2", + "resolved": "https://registry.npmjs.org/crypt/-/crypt-0.0.2.tgz", + "integrity": "sha512-mCxBlsHFYh9C+HVpiEacem8FEBnMXgU9gy4zmNC+SXAZNB/1idgp/aulFJ4FgCi7GPEVbfyng092GqL2k2rmow==" + }, "css.escape": { "version": "1.5.1", "resolved": "https://registry.npmjs.org/css.escape/-/css.escape-1.5.1.tgz", @@ -10063,6 +10438,16 @@ "resolved": "https://registry.npmjs.org/esutils/-/esutils-2.0.3.tgz", "integrity": "sha512-kVscqXk4OCp68SZ0dkgEKVi6/8ij300KBWTJq32P/dYeWTSwK41WyTxalN1eRmA5Z9UU/LX9D7FWSmV9SAYx6g==" }, + "event-target-shim": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/event-target-shim/-/event-target-shim-5.0.1.tgz", + "integrity": "sha512-i/2XbnSz/uxRCU6+NdVJgKWDTM427+MqYbkQzD321DuCQJUqOuJKIA0IM2+W2xtYHdKOmZ4dR6fExsd4SXL+WQ==" + }, + "events": { + "version": "3.3.0", + "resolved": "https://registry.npmjs.org/events/-/events-3.3.0.tgz", + "integrity": "sha512-mQw+2fkQbALzQ7V0MY0IqdnXNOeTtP4r0lN9z7AAawCXgqea7bDii20AYrIBrFd/Hx0M2Ocz6S111CaFkUcb0Q==" + }, "execa": { "version": "7.2.0", "resolved": "https://registry.npmjs.org/execa/-/execa-7.2.0.tgz", @@ -10136,6 +10521,11 @@ "resolved": "https://registry.npmjs.org/fast-levenshtein/-/fast-levenshtein-2.0.6.tgz", "integrity": "sha512-DCXu6Ifhqcks7TZKY3Hxp3y6qphY5SJZmrWMDrKcERSOXWQdMhU9Ig/PYrzyw/ul9jOIyh0N4M0tbC5hodg8dw==" }, + "fast-redact": { + "version": "3.3.0", + "resolved": "https://registry.npmjs.org/fast-redact/-/fast-redact-3.3.0.tgz", + "integrity": "sha512-6T5V1QK1u4oF+ATxs1lWUmlEk6P2T9HqJG3e2DnHOdVgZy2rFJBoEnrIedcTXlkAHU/zKC+7KETJ+KGGKwxgMQ==" + }, "fastq": { "version": "1.15.0", "resolved": "https://registry.npmjs.org/fastq/-/fastq-1.15.0.tgz", @@ -10178,6 +10568,19 @@ "path-exists": "^4.0.0" } }, + "flagsmith-nodejs": { + "version": "3.2.0", + "resolved": "https://registry.npmjs.org/flagsmith-nodejs/-/flagsmith-nodejs-3.2.0.tgz", + "integrity": "sha512-X1xxHia1Q5/oX5HPUKW7h1anOwyun64lP12RFn0neznsUb+Tl53hjjNrk5EeYOrKuHSrxcVoRcx9UyDeTVwYRg==", + "requires": { + "big-integer": "^1.6.51", + "md5": "^2.3.0", + "node-fetch": "^2.1.2", + "pino": "^8.8.0", + "semver": "^7.3.7", + "uuid": "^8.3.2" + } + }, "flat-cache": { "version": "3.0.4", "resolved": "https://registry.npmjs.org/flat-cache/-/flat-cache-3.0.4.tgz", @@ -10462,6 +10865,11 @@ "safer-buffer": ">= 2.1.2 < 3.0.0" } }, + "ieee754": { + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/ieee754/-/ieee754-1.2.1.tgz", + "integrity": "sha512-dcyqhDvX1C46lXZcVqCpK+FtMRQVdIMN6/Df5js2zouUsqG7I6sFxitIC+7KYK29KdXOLHdu9zL4sFnoVQnqaA==" + }, "ignore": { "version": "5.2.4", "resolved": "https://registry.npmjs.org/ignore/-/ignore-5.2.4.tgz", @@ -10564,6 +10972,11 @@ "has-tostringtag": "^1.0.0" } }, + "is-buffer": { + "version": "1.1.6", + "resolved": "https://registry.npmjs.org/is-buffer/-/is-buffer-1.1.6.tgz", + "integrity": "sha512-NcdALwpXkTm5Zvvbk7owOUSvVvBKDgKP5/ewfXEznmQFfs4ZRmanOeKBTjRVjka3QFoN6XJ+9F3USqfHqTaU5w==" + }, "is-callable": { "version": "1.2.7", "resolved": "https://registry.npmjs.org/is-callable/-/is-callable-1.2.7.tgz", @@ -11516,6 +11929,16 @@ "tmpl": "1.0.5" } }, + "md5": { + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/md5/-/md5-2.3.0.tgz", + "integrity": "sha512-T1GITYmFaKuO91vxyoQMFETst+O71VUPEU3ze5GNzDm0OWdP8v1ziTaAEPUr/3kLsY3Sftgz242A1SetQiDL7g==", + "requires": { + "charenc": "0.0.2", + "crypt": "0.0.2", + "is-buffer": "~1.1.6" + } + }, "merge-stream": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/merge-stream/-/merge-stream-2.0.0.tgz", @@ -11613,6 +12036,35 @@ "zod": "3.21.4" } }, + "node-fetch": { + "version": "2.7.0", + "resolved": "https://registry.npmjs.org/node-fetch/-/node-fetch-2.7.0.tgz", + "integrity": "sha512-c4FRfUm/dbcWZ7U+1Wq0AwCyFL+3nt2bEw05wfxSz+DWpWsitgmSgYmy2dQdWyKC1694ELPqMs/YzUSNozLt8A==", + "requires": { + "whatwg-url": "^5.0.0" + }, + "dependencies": { + "tr46": { + "version": "0.0.3", + "resolved": "https://registry.npmjs.org/tr46/-/tr46-0.0.3.tgz", + "integrity": "sha512-N3WMsuqV66lT30CrXNbEjx4GEwlow3v6rr4mCcv6prnfwhS01rkgyFdjPNBYd9br7LpXV1+Emh01fHnq2Gdgrw==" + }, + "webidl-conversions": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/webidl-conversions/-/webidl-conversions-3.0.1.tgz", + "integrity": "sha512-2JAn3z8AR6rjK8Sm8orRC0h/bcl/DqL7tRPdGZ4I1CjdF+EaMLmYxBHyXuKL849eucPFhvBoxMsflfOb8kxaeQ==" + }, + "whatwg-url": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/whatwg-url/-/whatwg-url-5.0.0.tgz", + "integrity": "sha512-saE57nupxk6v3HY35+jzBwYa0rKSy0XR8JSxZPwgLr7ys0IBzhGviA1/TUGJLmSVqs8pb9AnvICXEuOHLprYTw==", + "requires": { + "tr46": "~0.0.3", + "webidl-conversions": "^3.0.0" + } + } + } + }, "node-int64": { "version": "0.4.0", "resolved": "https://registry.npmjs.org/node-int64/-/node-int64-0.4.0.tgz", @@ -11738,6 +12190,11 @@ "es-abstract": "^1.20.4" } }, + "on-exit-leak-free": { + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/on-exit-leak-free/-/on-exit-leak-free-2.1.2.tgz", + "integrity": "sha512-0eJJY6hXLGf1udHwfNftBqH+g73EU4B504nZeKpz1sYRKafAghwxEJunB2O7rDZkL4PGfsMVnTXZ2EjibbqcsA==" + }, "once": { "version": "1.4.0", "resolved": "https://registry.npmjs.org/once/-/once-1.4.0.tgz", @@ -11864,6 +12321,38 @@ "resolved": "https://registry.npmjs.org/picomatch/-/picomatch-2.3.1.tgz", "integrity": "sha512-JU3teHTNjmE2VCGFzuY8EXzCDVwEqB2a8fsIvwaStHhAWJEeVd1o1QD80CU6+ZdEXXSLbSsuLwJjkCBWqRQUVA==" }, + "pino": { + "version": "8.17.2", + "resolved": "https://registry.npmjs.org/pino/-/pino-8.17.2.tgz", + "integrity": "sha512-LA6qKgeDMLr2ux2y/YiUt47EfgQ+S9LznBWOJdN3q1dx2sv0ziDLUBeVpyVv17TEcGCBuWf0zNtg3M5m1NhhWQ==", + "requires": { + "atomic-sleep": "^1.0.0", + "fast-redact": "^3.1.1", + "on-exit-leak-free": "^2.1.0", + "pino-abstract-transport": "v1.1.0", + "pino-std-serializers": "^6.0.0", + "process-warning": "^3.0.0", + "quick-format-unescaped": "^4.0.3", + "real-require": "^0.2.0", + "safe-stable-stringify": "^2.3.1", + "sonic-boom": "^3.7.0", + "thread-stream": "^2.0.0" + } + }, + "pino-abstract-transport": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/pino-abstract-transport/-/pino-abstract-transport-1.1.0.tgz", + "integrity": "sha512-lsleG3/2a/JIWUtf9Q5gUNErBqwIu1tUKTT3dUzaf5DySw9ra1wcqKjJjLX1VTY64Wk1eEOYsVGSaGfCK85ekA==", + "requires": { + "readable-stream": "^4.0.0", + "split2": "^4.0.0" + } + }, + "pino-std-serializers": { + "version": "6.2.2", + "resolved": "https://registry.npmjs.org/pino-std-serializers/-/pino-std-serializers-6.2.2.tgz", + "integrity": "sha512-cHjPPsE+vhj/tnhCy/wiMh3M3z3h/j15zHQX+S9GkTBgqJuTuJzYJ4gUyACLhDaJ7kk9ba9iRDmbH2tJU03OiA==" + }, "pirates": { "version": "4.0.6", "resolved": "https://registry.npmjs.org/pirates/-/pirates-4.0.6.tgz", @@ -11970,6 +12459,16 @@ } } }, + "process": { + "version": "0.11.10", + "resolved": "https://registry.npmjs.org/process/-/process-0.11.10.tgz", + "integrity": "sha512-cdGef/drWFoydD1JsMzuFf8100nZl+GT+yacc2bEced5f9Rjk4z+WtFUTBu9PhOi9j/jfmBPu0mMEY4wIdAF8A==" + }, + "process-warning": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/process-warning/-/process-warning-3.0.0.tgz", + "integrity": "sha512-mqn0kFRl0EoqhnL0GQ0veqFHyIN1yig9RHh/InzORTUiZHFRAur+aMtRkELNwGs9aNwKS6tg/An4NYBPGwvtzQ==" + }, "prompts": { "version": "2.4.2", "resolved": "https://registry.npmjs.org/prompts/-/prompts-2.4.2.tgz", @@ -12018,6 +12517,11 @@ "resolved": "https://registry.npmjs.org/queue-microtask/-/queue-microtask-1.2.3.tgz", "integrity": "sha512-NuaNSa6flKT5JaSYQzJok04JzTL1CA6aGhv5rfLW3PgqA+M2ChpZQnAC8h8i4ZFkBS8X5RqkDBHA7r4hej3K9A==" }, + "quick-format-unescaped": { + "version": "4.0.4", + "resolved": "https://registry.npmjs.org/quick-format-unescaped/-/quick-format-unescaped-4.0.4.tgz", + "integrity": "sha512-tYC1Q1hgyRuHgloV/YXs2w15unPVh8qfu/qCTfhTYamaw7fyhumKa2yGpdSo87vY32rIclj+4fWYQXUMs9EHvg==" + }, "react": { "version": "18.2.0", "resolved": "https://registry.npmjs.org/react/-/react-18.2.0.tgz", @@ -12040,6 +12544,23 @@ "resolved": "https://registry.npmjs.org/react-is/-/react-is-16.13.1.tgz", "integrity": "sha512-24e6ynE2H+OKt4kqsOvNd8kBpV65zoxbA4BVsEOB3ARVWQki/DHzaUoC5KuON/BiccDaCCTZBuOcfZs70kR8bQ==" }, + "readable-stream": { + "version": "4.5.2", + "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-4.5.2.tgz", + "integrity": "sha512-yjavECdqeZ3GLXNgRXgeQEdz9fvDDkNKyHnbHRFtOr7/LcfgBcmct7t/ET+HaCTqfh06OzoAxrkN/IfjJBVe+g==", + "requires": { + "abort-controller": "^3.0.0", + "buffer": "^6.0.3", + "events": "^3.3.0", + "process": "^0.11.10", + "string_decoder": "^1.3.0" + } + }, + "real-require": { + "version": "0.2.0", + "resolved": "https://registry.npmjs.org/real-require/-/real-require-0.2.0.tgz", + "integrity": "sha512-57frrGM/OCTLqLOAh0mhVA9VBMHd+9U7Zb2THMGdBUoZVOtGbJzjxsYGDJ3A9AYYCP4hn6y1TVbaOfzWtm5GFg==" + }, "redent": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/redent/-/redent-3.0.0.tgz", @@ -12214,6 +12735,11 @@ "isarray": "^2.0.5" } }, + "safe-buffer": { + "version": "5.2.1", + "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.2.1.tgz", + "integrity": "sha512-rp3So07KcdmmKbGvgaNxQSJr7bGVSVk5S9Eq1F+ppbRo70+YeaDxkw5Dd8NPN+GD6bjnYm2VuPuCXmpuYvmCXQ==" + }, "safe-regex-test": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/safe-regex-test/-/safe-regex-test-1.0.0.tgz", @@ -12224,6 +12750,11 @@ "is-regex": "^1.1.4" } }, + "safe-stable-stringify": { + "version": "2.4.3", + "resolved": "https://registry.npmjs.org/safe-stable-stringify/-/safe-stable-stringify-2.4.3.tgz", + "integrity": "sha512-e2bDA2WJT0wxseVd4lsDP4+3ONX6HpMXQa1ZhFQ7SU+GjvORCmShbCMltrtIDfkYhVHrOcPtj+KhmDBdPdZD1g==" + }, "safer-buffer": { "version": "2.1.2", "resolved": "https://registry.npmjs.org/safer-buffer/-/safer-buffer-2.1.2.tgz", @@ -12294,6 +12825,14 @@ "resolved": "https://registry.npmjs.org/slash/-/slash-3.0.0.tgz", "integrity": "sha512-g9Q1haeby36OSStwb4ntCGGGaKsaVSjQ68fBxoQcutl5fS1vuY18H3wSt3jFyFtrkx+Kz0V1G85A4MyAdDMi2Q==" }, + "sonic-boom": { + "version": "3.8.0", + "resolved": "https://registry.npmjs.org/sonic-boom/-/sonic-boom-3.8.0.tgz", + "integrity": "sha512-ybz6OYOUjoQQCQ/i4LU8kaToD8ACtYP+Cj5qd2AO36bwbdewxWJ3ArmJ2cr6AvxlL2o0PqnCcPGUgkILbfkaCA==", + "requires": { + "atomic-sleep": "^1.0.0" + } + }, "source-map": { "version": "0.6.1", "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz", @@ -12315,6 +12854,11 @@ "source-map": "^0.6.0" } }, + "split2": { + "version": "4.2.0", + "resolved": "https://registry.npmjs.org/split2/-/split2-4.2.0.tgz", + "integrity": "sha512-UcjcJOWknrNkF6PLX83qcHM6KHgVKNkV62Y8a5uYDVv9ydGQVwAHMKqHdJje1VTWpljG0WYpCDhrCdAOYH4TWg==" + }, "sprintf-js": { "version": "1.0.3", "resolved": "https://registry.npmjs.org/sprintf-js/-/sprintf-js-1.0.3.tgz", @@ -12352,6 +12896,14 @@ "resolved": "https://registry.npmjs.org/streamsearch/-/streamsearch-1.1.0.tgz", "integrity": "sha512-Mcc5wHehp9aXz1ax6bZUyY5afg9u2rv5cqQI3mRrYkGC8rW2hM02jWuwjtL++LS5qinSyhj2QfLyNsuc+VsExg==" }, + "string_decoder": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.3.0.tgz", + "integrity": "sha512-hkRX8U1WjJFd8LsDJ2yQ/wWWxaopEsABU1XfkM8A+j0+85JAGppt16cr1Whg6KIbb4okU6Mql6BOj+uup/wKeA==", + "requires": { + "safe-buffer": "~5.2.0" + } + }, "string-length": { "version": "4.0.2", "resolved": "https://registry.npmjs.org/string-length/-/string-length-4.0.2.tgz", @@ -12515,6 +13067,14 @@ "resolved": "https://registry.npmjs.org/text-table/-/text-table-0.2.0.tgz", "integrity": "sha512-N+8UisAXDGk8PFXP4HAzVR9nbfmVJ3zYLAWiTIoqC5v5isinhr+r5uaO8+7r3BMfuNIufIsA7RdpVgacC2cSpw==" }, + "thread-stream": { + "version": "2.4.1", + "resolved": "https://registry.npmjs.org/thread-stream/-/thread-stream-2.4.1.tgz", + "integrity": "sha512-d/Ex2iWd1whipbT681JmTINKw0ZwOUBZm7+Gjs64DHuX34mmw8vJL2bFAaNacaW72zYiTJxSHi5abUuOi5nsfg==", + "requires": { + "real-require": "^0.2.0" + } + }, "titleize": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/titleize/-/titleize-3.0.0.tgz", @@ -12709,6 +13269,11 @@ "requires-port": "^1.0.0" } }, + "uuid": { + "version": "8.3.2", + "resolved": "https://registry.npmjs.org/uuid/-/uuid-8.3.2.tgz", + "integrity": "sha512-+NYs2QeMWy+GWFOEm9xnn6HCDp0l7QBD7ml8zLUmJ+93Q5NF0NocErnwkTkXVFNiX3/fpC6afS8Dhb/gz7R7eg==" + }, "v8-to-istanbul": { "version": "9.1.0", "resolved": "https://registry.npmjs.org/v8-to-istanbul/-/v8-to-istanbul-9.1.0.tgz", diff --git a/package.json b/package.json index 0d20265..c05df3d 100644 --- a/package.json +++ b/package.json @@ -19,6 +19,7 @@ "@types/react-dom": "18.2.7", "eslint": "8.45.0", "eslint-config-next": "13.4.12", + "flagsmith-nodejs": "^3.2.0", "next": "13.4.12", "react": "18.2.0", "react-dom": "18.2.0", diff --git a/src/app/page.tsx b/src/app/page.tsx index 9c149d1..d522481 100644 --- a/src/app/page.tsx +++ b/src/app/page.tsx @@ -1,12 +1,19 @@ import Link from "next/link"; +import flag from "@/app/utils/flagsmith" +import flagsmith from "@/app/utils/flagsmith"; -export default function Home() { +export const revalidate = 0; + +export default async function Home() { + const flags = await flagsmith.getEnvironmentFlags(); return (

Hello World

About +
+ {flags.isFeatureEnabled("search") && }
); } diff --git a/src/app/utils/flagsmith.ts b/src/app/utils/flagsmith.ts new file mode 100644 index 0000000..71cf87b --- /dev/null +++ b/src/app/utils/flagsmith.ts @@ -0,0 +1,8 @@ +import Flagsmith from "flagsmith-nodejs" + +const flagsmith = new Flagsmith({ + environmentKey: process.env.FLAGSMITH_KEY as string, + requestTimeoutSeconds: 60 +}); + +export default flagsmith; \ No newline at end of file From af9bd0cb1aa4764a7bdf367562ae2bb3f091d722 Mon Sep 17 00:00:00 2001 From: ACompleteNoobSmoke Date: Tue, 16 Jan 2024 07:56:52 -0600 Subject: [PATCH 02/20] ebignore file --- .ebignore | 42 ++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 42 insertions(+) diff --git a/.ebignore b/.ebignore index e69de29..89de5cd 100644 --- a/.ebignore +++ b/.ebignore @@ -0,0 +1,42 @@ +# See https://help.github.com/articles/ignoring-files/ for more about ignoring files. + +# dependencies +/node_modules +/.pnp +.pnp.js + +# testing +/coverage +/test-results +/playwright-report + +# next.js +/out/ +.swc + +# production +/build + +# misc +.DS_Store +*.pem + +# debug +npm-debug.log* +yarn-debug.log* +yarn-error.log* + +# local env files +.env*.local + +# vercel +.vercel + +# typescript +*.tsbuildinfo +next-env.d.ts + +# Elastic Beanstalk Files +.elasticbeanstalk/* +!.elasticbeanstalk/*.cfg.yml +!.elasticbeanstalk/*.global.yml From 4f295d29bebc40291de6476e6ca7b1c9e5cc6149 Mon Sep 17 00:00:00 2001 From: ACompleteNoobSmoke Date: Wed, 17 Jan 2024 05:29:42 -0600 Subject: [PATCH 03/20] Worked on multiple workflows --- .github/CODEOWNERS | 1 + .github/slack/test-failure-slack-payload.json | 11 +++++++++++ .github/workflows/ci.yaml | 15 +++++++++++++++ .github/workflows/test.yaml | Bin 0 -> 4278 bytes 4 files changed, 27 insertions(+) create mode 100644 .github/CODEOWNERS create mode 100644 .github/slack/test-failure-slack-payload.json create mode 100644 .github/workflows/ci.yaml create mode 100644 .github/workflows/test.yaml diff --git a/.github/CODEOWNERS b/.github/CODEOWNERS new file mode 100644 index 0000000..95ed8a9 --- /dev/null +++ b/.github/CODEOWNERS @@ -0,0 +1 @@ +* @ACompleteNoobSmoke diff --git a/.github/slack/test-failure-slack-payload.json b/.github/slack/test-failure-slack-payload.json new file mode 100644 index 0000000..b55037e --- /dev/null +++ b/.github/slack/test-failure-slack-payload.json @@ -0,0 +1,11 @@ +{ + "blocks": [ + { + "type": "section", + "text": { + "type": "mrkdwn", + "text": "* * failed." + } + } + ] +} \ No newline at end of file diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml new file mode 100644 index 0000000..9ce3594 --- /dev/null +++ b/.github/workflows/ci.yaml @@ -0,0 +1,15 @@ +name: CI + +on: + pull_request: + branches: [main] + +concurrency: + group: ${{ github.workflow }}-${{ github.event.pull_request.number }} + cancel-in-progress: true + +jobs: + run-tests: + name: Run Test + uses: ./.github/workflows/test.yaml + secrets: inherit diff --git a/.github/workflows/test.yaml b/.github/workflows/test.yaml new file mode 100644 index 0000000000000000000000000000000000000000..d6f284d5305235905c3dd0876f7a26e0296a5bfc GIT binary patch literal 4278 zcmeH~TW`}q5QXO%iT_|#2*HCJT6jQxq76ZyLROyJUJ?Ti=HE z%}%YyziT_PV^De={yTkp&YLfw6)nfp5mLU-?8H*OxwI~pC#5gLShM*(g~`UPWy~$u z4SAa}ehLrqPq^1u8U9`Jv@d7${* zhpBw<Bo*pReNKS%_V?(yGiP&%A`{RfUG@h0As2 zQ)Xv8ZShVsuBg?`^<7^6Nka7t!DCmU%)_%~d-l=sQ^h3>evl&XjINdIg-2Ra)$i@XK7%*65ppjh3V0% z*16zEnNx9gwT5|}ZKEKah+$R62wNGU*hn9*IZx1>XZE}@KC=6F^W(S_i@FHNn>b6# z_KW38-Ms8FI|HZ8VT?b~h#$L-aU6SDXeINO>O|suRcGF*%vYIO6|d%8<(sz6 zirRwzwtc40+~>N<{g%tAC-$8q!B6oUa+c4_?(5lBiT&WH^1oaM<@J5Xb&eBqc}Q-b z(XXgpH@H(LEGCPusy84=@l+i}T&>t~cahS$hCV5E^P&!Q5r2Z#v}~0)K8(@?eObf% zRep=`Dduxv)g+q#^~UeYW@Sd|vOUy!RlI|~#|l)BxR@qsZ=v0sx`2dEPMNG7P-35W zGvWxV#x~!nD{WIdJv3f5TgSc&vR07MEpDAftY5iRn;Pq~GUrcH>euf%v^Tt~Wh-dO zs=ea;qLyW-%K3ILnvDtm`0goXjZ{23aERw=iIE%pVwN%g2HN9y>_UiRnijk)j<(F+ ve8k9E%}z&|vxru!gI`B`H__=sv}MEIqt?>vBRZR1-f9;Aq}lb>xpw~s Date: Wed, 17 Jan 2024 05:38:41 -0600 Subject: [PATCH 04/20] Worked on multiple workflows --- src/app/page.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/app/page.tsx b/src/app/page.tsx index d522481..b738e47 100644 --- a/src/app/page.tsx +++ b/src/app/page.tsx @@ -9,7 +9,7 @@ export default async function Home() { return (
-

Hello World

+

Hello World!

About
From 378d15597f246410d6ddc74944c2f701560c4673 Mon Sep 17 00:00:00 2001 From: ACompleteNoobSmoke Date: Wed, 17 Jan 2024 05:40:49 -0600 Subject: [PATCH 05/20] Worked on multiple workflows --- .github/workflows/test.yaml | Bin 4278 -> 4336 bytes 1 file changed, 0 insertions(+), 0 deletions(-) diff --git a/.github/workflows/test.yaml b/.github/workflows/test.yaml index d6f284d5305235905c3dd0876f7a26e0296a5bfc..142e78890a7022087ae2afff86a68a0ef44ab1a0 100644 GIT binary patch delta 46 zcmdm{_(5^QH9pBqhBO8%1_dCQ$dJj9!%)gl#E{CM!Js*rkwtNG4 Date: Wed, 17 Jan 2024 05:44:50 -0600 Subject: [PATCH 06/20] Test --- .github/workflows/test.yaml | Bin 4336 -> 5386 bytes 1 file changed, 0 insertions(+), 0 deletions(-) diff --git a/.github/workflows/test.yaml b/.github/workflows/test.yaml index 142e78890a7022087ae2afff86a68a0ef44ab1a0..ea7cff6eae23b0f346c0f0766b39bb15305a95e3 100644 GIT binary patch delta 598 zcmZuv!AiqG6r6|{si-j^c<_*}dMVQ8EaE{C714SSL`9_9REyS>Bqf$M)RPCV3x0>6 z;3xI$$=NjxHOhmq@4b05^L8^VzLh>c=gkc`jJ~W{Yx2dIHhTKxn%1Jg4Ibg+77qv^ zppcho*CuuY(#Xnj6 z%h*CdH+950zI0-c=M*T>^(OAA646`8Eh>yVdWu->aK|z|`e?DbiXP*4FQCUZ`=Orj zsozDysGv5sTgW^>XFyx(_&-sH-D}d+X-QG^Q=F5Nj47wqZ0PHcQ?$dS^L0v+b4xGT zprM&2M?4CYA;$08NU}`5+bFY)D_vLbo=9G}ys+NoS7Ay03G&ric29AR6YT1@Kfp0| XP{k3{X^*R%v9pbR)~YzfEDHDrzj%3? delta 143 zcmeCu`k=Vs0DrwMLmERSLk>eKgDyh>Ln1>7Lk5Etg93vRgC2uE5T^rWL1Lv0NkD!v zP-P-RGD9|yT>{io3?xA&B!bN-WherhgHQ!Avl6H)AE+h;XkHdjPd-B)(0pD7E(V3k M>@3ogIYg!b08x<}#{d8T From f951e38381385c3da09aee8f992bcfd3ea9d0d4a Mon Sep 17 00:00:00 2001 From: ACompleteNoobSmoke Date: Wed, 17 Jan 2024 05:51:20 -0600 Subject: [PATCH 07/20] Fixed Format --- .github/slack/test-failure-slack-payload.json | 20 +++++++++--------- .github/workflows/ci.yaml | 16 +++++++------- .github/workflows/test.yaml | Bin 5386 -> 5391 bytes src/app/page.tsx | 2 +- src/app/utils/flagsmith.ts | 8 +++---- 5 files changed, 23 insertions(+), 23 deletions(-) diff --git a/.github/slack/test-failure-slack-payload.json b/.github/slack/test-failure-slack-payload.json index b55037e..078abc9 100644 --- a/.github/slack/test-failure-slack-payload.json +++ b/.github/slack/test-failure-slack-payload.json @@ -1,11 +1,11 @@ { - "blocks": [ - { - "type": "section", - "text": { - "type": "mrkdwn", - "text": "* * failed." - } - } - ] -} \ No newline at end of file + "blocks": [ + { + "type": "section", + "text": { + "type": "mrkdwn", + "text": "* * failed." + } + } + ] +} diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index 9ce3594..2d5b078 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -1,15 +1,15 @@ name: CI on: - pull_request: - branches: [main] + pull_request: + branches: [main] concurrency: - group: ${{ github.workflow }}-${{ github.event.pull_request.number }} - cancel-in-progress: true + group: ${{ github.workflow }}-${{ github.event.pull_request.number }} + cancel-in-progress: true jobs: - run-tests: - name: Run Test - uses: ./.github/workflows/test.yaml - secrets: inherit + run-tests: + name: Run Test + uses: ./.github/workflows/test.yaml + secrets: inherit diff --git a/.github/workflows/test.yaml b/.github/workflows/test.yaml index ea7cff6eae23b0f346c0f0766b39bb15305a95e3..a972044c41cbc10ad9e8c31e547480698f026943 100644 GIT binary patch delta 804 zcmah{O-mb56n&G)WIi%ZXC^@;1QJqdb!Jde6#Qz`V!%xoMeN2dV#z{5T`1Xz;3{Y- zXt*FQ4Y+pUQYiID6c^$z2m#Th3+cV@y=hz&$_(@FJ@348&%1ZN2gkwi!>^zCZm}xc zWHmO$ifkFz9kz?n7gk}Ge74yZ?pn?8eI|xB*fv{3D#5iu#e$Za0YkT&mwh5>-bE74 zDK?MBVO4Q4dUQfKQ{HhbgtkIFfw}NGk>gnbek3f6=H0h&ohZuaB_YH^SWpKfucP_e zH@42mLG>?|gPEkLT86`9tl80WaGx}g)l$pQuk}iPWapu-k++r_!j;zL_ao+|mN<`G zyKtH!?9qAc(9lVVytaF6_@s-^z=yCl@$ z|K84ehL9_~jY!Rk^Ff}!aL6ll?A8%=c4Xe2@zopA!BE}fuE!v71u~0VCG!yuJs*C% zq(oWZ#nFLc;2wD;oU*`kA>}`FWD&pf?zFluRMoG14S9}^UUkaL9wFDumf6^HpO2E;Jn{DDnltjlzWf zy)g;LI%-ypQFzt^_1+|O8%-QJ%!7SHdXm~VhV0L)-mIAsl?P{L605p9=0^qe`D!sM z!;@MiyF9^uQgdWO+26){#CCsF=(IxCY=?9}yp+aaEg)a^S3e!ZS)~uV!Qb;yxDN_H z)P+=NP-w@2#qfit xab#5#c;@=UF{!-L4uyoL&LM44U{~NR9&#;~P8f-;@fkEf5^IB}SX#&b`U_x%z9j$v diff --git a/src/app/page.tsx b/src/app/page.tsx index b738e47..fa50542 100644 --- a/src/app/page.tsx +++ b/src/app/page.tsx @@ -1,5 +1,5 @@ import Link from "next/link"; -import flag from "@/app/utils/flagsmith" +import flag from "@/app/utils/flagsmith"; import flagsmith from "@/app/utils/flagsmith"; export const revalidate = 0; diff --git a/src/app/utils/flagsmith.ts b/src/app/utils/flagsmith.ts index 71cf87b..10dd66c 100644 --- a/src/app/utils/flagsmith.ts +++ b/src/app/utils/flagsmith.ts @@ -1,8 +1,8 @@ -import Flagsmith from "flagsmith-nodejs" +import Flagsmith from "flagsmith-nodejs"; const flagsmith = new Flagsmith({ - environmentKey: process.env.FLAGSMITH_KEY as string, - requestTimeoutSeconds: 60 + environmentKey: process.env.FLAGSMITH_KEY as string, + requestTimeoutSeconds: 60, }); -export default flagsmith; \ No newline at end of file +export default flagsmith; From 3bd8cad734bf6593d040df442cd36563bfa9083a Mon Sep 17 00:00:00 2001 From: ACompleteNoobSmoke Date: Wed, 17 Jan 2024 05:54:08 -0600 Subject: [PATCH 08/20] Fixed Format --- .github/workflows/test.yaml | Bin 5391 -> 2530 bytes 1 file changed, 0 insertions(+), 0 deletions(-) diff --git a/.github/workflows/test.yaml b/.github/workflows/test.yaml index a972044c41cbc10ad9e8c31e547480698f026943..3f2c1d1cbc5c8fdb769048697b418244b1662258 100644 GIT binary patch literal 2530 zcmc&$QE$^Q5Pt8kI8_M2L>d@8pa>zhE)!^Doz{*$AXK@D+j>py$adOQTYni3{3QMY zXD4avG^Kq&BGR-i_uY5ryYDXk{qq+mQyM^zDh+q%jfUVs1Mry(ITlwsRm(BKa_IywD_;)vbwU<%$wp%hr&7!nE(!;~lI#Pd zYbYyLg6El~eOj^<^)*E8|E`pE6+CJC>>PYOJzKbX z?R0Ua!U=Q}5>4PMRmzM(hr>BxNhaNT;4s7iCjNOy)A>;yXfCUrJFBo z^VLqG9FF@7;RljVrN9v6h6Osib-RP8n+enhatuYwJPBnC=z1~sZg*`woSWG8t~BwkHjnZeKR}k zrFEuDOX3f+X=iWeo9~=Cx7oYfo4ebaP#SV3O<5Erb&P$9aJDC(WG+5B65=VZRD2Ai zBRx5lBWdGoAp3Fvlr|3Y9^XB|lb=A#N=ESv0p1VgPy)PjE-gqN=H9e(jpz3iOqTB@ z)7-3F4^KnPAAkq>D_nD~5c-|tZW|0Nn{o2ALsPmV8d!Wg20%`8tjaIQ9l$yr%tKpN zadwD%<7Tla9M3Tq?N6=^AVjbWx%Z`lt1RjVxscaR#5}JZU{muh&^Ka6N@~Erz&t%Y z6a9epnT9EKF!Kb!GMf9@QvU&XM9?$qF=-2>&n(D^9EV)_RnexuX#ML@?Mclu3BjWJlICKSs=K__braX}Q&9s8@7W zyrLK{iRmH?ldPv?ORwSy{EOMbg)-j5>`Ep%*oBc_$6Z*3`M-hereq0R=wU}Xru=MN z*^XJtBC}Ftksl|UBvo)SYuH@W)v?8_rKF7bYRV<-P;stC-jdtM%OT`<@y{HXRN`sk zlb8n0Rp+c8c~05YWeqcVwt)=NOfhtM46*4Ev<>s)0RKbeoM-afX&=h{yZ&*IvxUzB z)F$mEdHG_#;#-$(tWH;F<_MOiCw1^|dk{0Xk8#@elwc(@lI%p%*No1jQ<*F>SrsoP ztnyXaL`AKE|E7FJpIOJait7#SQ%~dyhk~Bu*TX+`F6+0)ODXw{!=-;d4)XPVOLvY# z_;L@veT;sE@w$vFcEV&*ysBOTffc%Y zG&a91Li+{$itx$$vt?Cw(sFO4q*w?chN3NuDx?uFW`7p=xr-mf}Wg} z>)OX2i8FtH5RyfF7!NCL#}e|d>CX+P64;r3*zBH5@^UJc>3K|VXXcp=`!sr1i!;Q= zDLj9Gh?$iR>Dkh{l;j0g^PR3`5qzEBASyW0K3>Mkcd*;5h^e~SXN+TJBksZ@j6JLg zD{Tedn)CESx@Hv0E1|ma{vGU From b5e39bf5cf0571768ac021e4f54b67d707ac7ce1 Mon Sep 17 00:00:00 2001 From: ACompleteNoobSmoke Date: Wed, 17 Jan 2024 05:55:45 -0600 Subject: [PATCH 09/20] Fixed Format --- .github/workflows/test.yaml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/test.yaml b/.github/workflows/test.yaml index 3f2c1d1..956896e 100644 --- a/.github/workflows/test.yaml +++ b/.github/workflows/test.yaml @@ -70,4 +70,5 @@ jobs: ] } env: - SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }} \ No newline at end of file + SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }} + SLACK_WEBHOOK_TYPE: INCOMING_WEBHOOK \ No newline at end of file From f8bbc6fdd36ffd1743b1caf60a84bb092c3bae3b Mon Sep 17 00:00:00 2001 From: ACompleteNoobSmoke Date: Wed, 17 Jan 2024 05:59:09 -0600 Subject: [PATCH 10/20] Fixed Format --- .github/workflows/test.yaml | 138 ++++++++++++++++++------------------ 1 file changed, 69 insertions(+), 69 deletions(-) diff --git a/.github/workflows/test.yaml b/.github/workflows/test.yaml index 956896e..48869c3 100644 --- a/.github/workflows/test.yaml +++ b/.github/workflows/test.yaml @@ -1,74 +1,74 @@ -name: Test WF +name: Test WF on: - workflow_call: + workflow_call: jobs: - test-and-build: - name: Test & Build - runs-on: ubuntu-latest - steps: - - name: Checkout Code - uses: actions/checkout@v3 - - name: Setup Node Environment - uses: actions/setup-node@v3 - with: - node-version: 18 - cache: "npm" - - name: Install Dependencies - run: npm ci - - name: Check For Formatting Errors - run: npm run format - - name: Check For ESLint Errors - run: npm run lint - - name: Check For Type Errors - run: npm run typecheck - - name: Build Project - run: npm run build - - name: Upload Artifact - uses: actions/upload-artifact@v3 - with: - name: build - path: .next/ - - name: Run Unit Tests - run: npm run unit test - - name: Upload Coverage Test - if: always() - uses: actions/upload-artifact@v3 - with: - name: coverage - path: coverage/ - - name: Upload Coverage Reports To Codecov - uses: codecov/codecov-action@v3 - env: - CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }} - - name: Install Playwright Browsers - run: npx playwright install --with-deps - - name: Run E2E Tests - run: npm run test:e2e - - name: Upload E2E Coverage Test - if: always() - uses: actions/upload-artifact@v3 - with: - name: playwright-report - path: playwright-report/ - - name: Send A Slack Message On Failure - id: slack - if: failure() - uses: slackapi/slack-github-action@v1.24.0 - with: - payload: | - { - "blocks": [ - { - "type": "section", - "text": { - "type": "mrkdwn", - "text": "* * failed." - } - } - ] + test-and-build: + name: Test & Build + runs-on: ubuntu-latest + steps: + - name: Checkout Code + uses: actions/checkout@v3 + - name: Setup Node Environment + uses: actions/setup-node@v3 + with: + node-version: 18 + cache: "npm" + - name: Install Dependencies + run: npm ci + - name: Check For Formatting Errors + run: npm run format + - name: Check For ESLint Errors + run: npm run lint + - name: Check For Type Errors + run: npm run typecheck + - name: Build Project + run: npm run build + - name: Upload Artifact + uses: actions/upload-artifact@v3 + with: + name: build + path: .next/ + - name: Run Unit Tests + run: npm run unit test + - name: Upload Coverage Test + if: always() + uses: actions/upload-artifact@v3 + with: + name: coverage + path: coverage/ + - name: Upload Coverage Reports To Codecov + uses: codecov/codecov-action@v3 + env: + CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }} + - name: Install Playwright Browsers + run: npx playwright install --with-deps + - name: Run E2E Tests + run: npm run test:e2e + - name: Upload E2E Coverage Test + if: always() + uses: actions/upload-artifact@v3 + with: + name: playwright-report + path: playwright-report/ + - name: Send A Slack Message On Failure + id: slack + if: failure() + uses: slackapi/slack-github-action@v1.24.0 + with: + payload: | + { + "blocks": [ + { + "type": "section", + "text": { + "type": "mrkdwn", + "text": "* * failed." } - env: - SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }} - SLACK_WEBHOOK_TYPE: INCOMING_WEBHOOK \ No newline at end of file + } + ] + } + env: + SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }} + SLACK_WEBHOOK_TYPE: INCOMING_WEBHOOK From 01ffd97b24be395ce9b4cd8beb0c28f3675f6e48 Mon Sep 17 00:00:00 2001 From: ACompleteNoobSmoke Date: Wed, 17 Jan 2024 06:05:19 -0600 Subject: [PATCH 11/20] Fixed Format --- .github/workflows/test.yaml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/.github/workflows/test.yaml b/.github/workflows/test.yaml index 48869c3..29da3c4 100644 --- a/.github/workflows/test.yaml +++ b/.github/workflows/test.yaml @@ -25,6 +25,8 @@ jobs: run: npm run typecheck - name: Build Project run: npm run build + env: + FLAGSMITH_KEY: ${{ secrets.FLAGSMITH_KEY }} - name: Upload Artifact uses: actions/upload-artifact@v3 with: @@ -46,6 +48,8 @@ jobs: run: npx playwright install --with-deps - name: Run E2E Tests run: npm run test:e2e + env: + FLAGSMITH_KEY: ${{ secrets.FLAGSMITH_KEY }} - name: Upload E2E Coverage Test if: always() uses: actions/upload-artifact@v3 From 0110bb4529b417a51098cdbbb453b0869404d980 Mon Sep 17 00:00:00 2001 From: ACompleteNoobSmoke Date: Wed, 17 Jan 2024 06:06:37 -0600 Subject: [PATCH 12/20] Fixed Format --- .github/workflows/test.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/test.yaml b/.github/workflows/test.yaml index 29da3c4..435eaf3 100644 --- a/.github/workflows/test.yaml +++ b/.github/workflows/test.yaml @@ -26,7 +26,7 @@ jobs: - name: Build Project run: npm run build env: - FLAGSMITH_KEY: ${{ secrets.FLAGSMITH_KEY }} + FLAGSMITH_KEY: ${{ secrets.FLAGSMITH_KEY }} - name: Upload Artifact uses: actions/upload-artifact@v3 with: @@ -49,7 +49,7 @@ jobs: - name: Run E2E Tests run: npm run test:e2e env: - FLAGSMITH_KEY: ${{ secrets.FLAGSMITH_KEY }} + FLAGSMITH_KEY: ${{ secrets.FLAGSMITH_KEY }} - name: Upload E2E Coverage Test if: always() uses: actions/upload-artifact@v3 From 02c0b28b41c2d88362dc1ea19c5e1b40327a6278 Mon Sep 17 00:00:00 2001 From: ACompleteNoobSmoke Date: Wed, 17 Jan 2024 06:10:19 -0600 Subject: [PATCH 13/20] Fixed Format Again --- .github/workflows/test.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/test.yaml b/.github/workflows/test.yaml index 435eaf3..f3d0637 100644 --- a/.github/workflows/test.yaml +++ b/.github/workflows/test.yaml @@ -33,7 +33,7 @@ jobs: name: build path: .next/ - name: Run Unit Tests - run: npm run unit test + run: npm run test - name: Upload Coverage Test if: always() uses: actions/upload-artifact@v3 From ebba659fbdf80c8cc346191db4c96d745fc644fa Mon Sep 17 00:00:00 2001 From: ACompleteNoobSmoke Date: Wed, 17 Jan 2024 06:13:01 -0600 Subject: [PATCH 14/20] Passed Test --- src/app/page.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/app/page.tsx b/src/app/page.tsx index fa50542..d468d69 100644 --- a/src/app/page.tsx +++ b/src/app/page.tsx @@ -9,7 +9,7 @@ export default async function Home() { return (
-

Hello World!

+

Hello World

About
From c2d226c83db165cd39205ac95929ffcc91b6cc56 Mon Sep 17 00:00:00 2001 From: ACompleteNoobSmoke Date: Wed, 17 Jan 2024 06:25:39 -0600 Subject: [PATCH 15/20] Passed Test --- .github/workflows/test.yaml | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/.github/workflows/test.yaml b/.github/workflows/test.yaml index f3d0637..c534431 100644 --- a/.github/workflows/test.yaml +++ b/.github/workflows/test.yaml @@ -44,7 +44,20 @@ jobs: uses: codecov/codecov-action@v3 env: CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }} + - name: Store Playwright's Version + run: | + PLAYWRIGHT_VERSION=$(npm ls @playwright/test | grep @playwright | sed 's/. + *@//') + echo "Playwright's Version: $PLAYWRIGHT_VERSION" + echo "PLAYWRIGHT_VERSION=$PLAYWRIGHT_VERSION" >> $GITHUB_ENV + - name: Cache Playwright Browsers + uses: actions/cache@v3 + id: cache-playwright + with: + path: ~/.cache/ms-playwright + key: playwright-browsers-${{ env.PLAYWRIGHT_VERSION }} - name: Install Playwright Browsers + if: steps.cache-playwright.outputs.cache-hit != 'true' run: npx playwright install --with-deps - name: Run E2E Tests run: npm run test:e2e From 291a58e918d1fd86fc4af47323fb9920454dceae Mon Sep 17 00:00:00 2001 From: ACompleteNoobSmoke Date: Wed, 17 Jan 2024 06:29:41 -0600 Subject: [PATCH 16/20] Passed Test --- .github/workflows/test.yaml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/.github/workflows/test.yaml b/.github/workflows/test.yaml index c534431..206bb73 100644 --- a/.github/workflows/test.yaml +++ b/.github/workflows/test.yaml @@ -46,8 +46,7 @@ jobs: CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }} - name: Store Playwright's Version run: | - PLAYWRIGHT_VERSION=$(npm ls @playwright/test | grep @playwright | sed 's/. - *@//') + PLAYWRIGHT_VERSION=$(npm ls @playwright/test | grep @playwright | sed 's/.*@//') echo "Playwright's Version: $PLAYWRIGHT_VERSION" echo "PLAYWRIGHT_VERSION=$PLAYWRIGHT_VERSION" >> $GITHUB_ENV - name: Cache Playwright Browsers From 0cc3a734106686e26d98627a11a4df86dec6f10a Mon Sep 17 00:00:00 2001 From: ACompleteNoobSmoke Date: Thu, 18 Jan 2024 06:37:08 -0600 Subject: [PATCH 17/20] Deploy WF created --- .github/workflows/deploy.yaml | 120 ++++++++++++++++++++++++++++++++++ 1 file changed, 120 insertions(+) create mode 100644 .github/workflows/deploy.yaml diff --git a/.github/workflows/deploy.yaml b/.github/workflows/deploy.yaml new file mode 100644 index 0000000..3af035c --- /dev/null +++ b/.github/workflows/deploy.yaml @@ -0,0 +1,120 @@ +name: Deploy + +run-name: Deploy + +on: + workflow_dispatch: + inputs: + aws-env: + description: "AWS Elastic Beanstalk Environmnet" + required: true + default: "gha-course-staging" + type: string + github-env: + description: "Github Environment" + required: true + default: "staging" + type: string + workflow_call: + inputs: + aws-env: + description: "AWS Elastic Beanstalk Environment" + required: true + default: "gha-course-staging" + type: string + github-env: + description: "Github Environment" + required: true + default: "staging" + type: string + + +concurrency: + group: ${{ github.workflow }}-${{ github.ref }}-${{ inputs.github-env }} + +jobs: + deploy: + name: Deploy Project + runs-on: ubuntu-latest + environment: + name: ${{ inputs.github-env }} + url: "http://${{steps.get-env-cname.outputs.aws_cname}}" + steps: + - name: Avoid deploying to production using a non-production env + if: inputs.aws-env == vars.AWS_EB_PRODUCTION_ENV && inputs.github-env != 'production' + run: | + echo "::error::Cannot deploy to production using a non production environment" + exit 1 + - name: Configure AWS Credentials + uses: aws-actions/configure-aws-credentials@v2 + with: + aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }} + aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }} + aws-region: ${{ vars.AWS_REGION }} + - name: Checkout Code + uses: actions/checkout@v3 + - name: Setup Node Environment + uses: actions/setup-node@v3 + with: + node-version: 18 + cache: "npm" + - name: Install Dependencies + run: npm ci + - name: Build App + run: npm run build + - name: Cache + uses: actions/cache@v3 + with: + path: ~/.cache/pip + key: ${{runner.os}}-pip + - name: Install EB CLI + id: install-eb-cli + run: pip install awsebcli + - name: Get AWS ENV Name + id: get-env-name + run: echo "aws_env=$(aws elasticbeanstalk describe-environments --application-name ${{vars.AWS_EB_APP_NAME}} + --environment-name ${{inputs.aws_env}} --query "Environments[0].EnvironmentName" + --output text)" >> $GITHUB_OUTPUT + - name: Get AWS ENV Status + id: get-env-status + run: echo "aws_status=$(aws elasticbeanstalk describe-environments --application-name ${{vars.AWS_EB_APP_NAME}} + --environment-name ${{inputs.aws_env}} --query "Environments[0].Status" + --output text)" >> $GITHUB_OUTPUT + - name: Initialize EB + run: eb init ${{vars.AWS_EB_APP_NAME}} --platform ${{vars.AWS_EB_PLATFORM}} --region ${{vars.AWS_REGION}} + - name: Create A New Environment + if: steps.get-env-name.outputs.aws_env == 'None' || steps.get-env-status.outputs.aws_status == 'Terminated' + run: eb create ${{inputs.aws-env}} --instance-types ${{vars.AWS_EB_ENV_INSTANCE_TYPES}} --cname ${{inputs.aws-env}} + --envvars FLAGSMITH_KEY=${{ secrets.FLAGSMITH_KEY }} + - name: Deploy if Environment Exists + if: steps.get-env-name.outputs.aws_env == inputs.aws-env && steps.get-env-status.outputs.aws_status != 'Terminated' + run: eb deploy ${{inputs.aws-env}} + - name: Get AWS ENV CNAME + id: get-env-cname + run: echo "aws_cname=$(aws elasticbeanstalk describe-environments --application-name ${{vars.AWS_EB_APP_NAME}} + --environment-name ${{inputs.aws_env}} --query "Environments[0].CNAME" + --output text)" >> $GITHUB_OUTPUT + - name: Send A Slack Message On Failure + id: slack + uses: slackapi/slack-github-action@v1.24.0 + continue-on-errr: true + with: + payload: | + { + "blocks": [ + { + "type": "section", + "text": { + "type": "mrkdwn", + "text": ":muscle-rocket: Deployment to AWS environment *${{inputs.aws_env}}* + using *${{inputs.github-env}}* GitHub environment was successfull. " + } + } + ] + } + env: + SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }} + SLACK_WEBHOOK_TYPE: INCOMING_WEBHOOK + - name: Abort if Cancelled + if: cancelled() && steps.install-eb-cli.conclusion == 'success' + run: eb abort ${{ inputs.aws-env}} \ No newline at end of file From 428e2a0c05c8bc8038a68205c4d36089c7ddd2fd Mon Sep 17 00:00:00 2001 From: ACompleteNoobSmoke Date: Thu, 18 Jan 2024 06:38:02 -0600 Subject: [PATCH 18/20] Deploy WF created --- .github/workflows/deploy.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/deploy.yaml b/.github/workflows/deploy.yaml index 3af035c..98a3697 100644 --- a/.github/workflows/deploy.yaml +++ b/.github/workflows/deploy.yaml @@ -97,7 +97,7 @@ jobs: - name: Send A Slack Message On Failure id: slack uses: slackapi/slack-github-action@v1.24.0 - continue-on-errr: true + continue-on-error: true with: payload: | { From a9474106e49c85d900884c007fede2bb694cb22f Mon Sep 17 00:00:00 2001 From: ACompleteNoobSmoke Date: Thu, 18 Jan 2024 06:39:12 -0600 Subject: [PATCH 19/20] Deploy WF created --- .github/workflows/deploy.yaml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/deploy.yaml b/.github/workflows/deploy.yaml index 98a3697..cdb7953 100644 --- a/.github/workflows/deploy.yaml +++ b/.github/workflows/deploy.yaml @@ -99,7 +99,7 @@ jobs: uses: slackapi/slack-github-action@v1.24.0 continue-on-error: true with: - payload: | + payload: | { "blocks": [ { @@ -112,9 +112,9 @@ jobs: } ] } - env: - SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }} - SLACK_WEBHOOK_TYPE: INCOMING_WEBHOOK + env: + SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }} + SLACK_WEBHOOK_TYPE: INCOMING_WEBHOOK - name: Abort if Cancelled if: cancelled() && steps.install-eb-cli.conclusion == 'success' run: eb abort ${{ inputs.aws-env}} \ No newline at end of file From b320537ff5c3ebc756f79d68d669a55d41f0155f Mon Sep 17 00:00:00 2001 From: ACompleteNoobSmoke Date: Thu, 18 Jan 2024 06:40:14 -0600 Subject: [PATCH 20/20] Deploy WF created --- .github/workflows/deploy.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/deploy.yaml b/.github/workflows/deploy.yaml index cdb7953..e70dcca 100644 --- a/.github/workflows/deploy.yaml +++ b/.github/workflows/deploy.yaml @@ -96,8 +96,8 @@ jobs: --output text)" >> $GITHUB_OUTPUT - name: Send A Slack Message On Failure id: slack - uses: slackapi/slack-github-action@v1.24.0 continue-on-error: true + uses: slackapi/slack-github-action@v1.24.0 with: payload: | { @@ -112,7 +112,7 @@ jobs: } ] } - env: + env: SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }} SLACK_WEBHOOK_TYPE: INCOMING_WEBHOOK - name: Abort if Cancelled