This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// requireAllowed(nameList) rejects any URL name not in the provided whitelist. | |
func requireAllowed(nameList []string) func(http.Handler) http.Handler { | |
allowed := map[string]struct{}{} | |
for _, n := range nameList { allowed[n] = struct{}{} } | |
return func(next http.Handler) http.Handler { | |
return http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { | |
name := chi.URLParam(r, "name") | |
if _, ok := allowed[name]; !ok { | |
http.Error(w, "Forbidden", http.StatusForbidden) | |
return |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
version: 2 | |
updates: | |
# Enable version updates for go.mod | |
- package-ecosystem: "gomod" | |
# Look for a `go.mod` file in the `root` directory | |
directory: "/" | |
# Check for updates once a month | |
schedule: | |
interval: "monthly" | |
# Update only explicitly defined dependencies |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env bash | |
set -euo pipefail | |
ISLAND_PATH="$1" | |
PACKAGE_JSON="$ISLAND_PATH/package.json" | |
YARN_LOCK="$ISLAND_PATH/yarn.lock" | |
echo "🔍 Reading production dependencies from $PACKAGE_JSON" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env bash | |
set -euo pipefail | |
ISLANDS_DIR="re-store/islands" | |
TMP_ALL_DEPS="/tmp/all-packages.txt" | |
TMP_UNIQUE="/tmp/unique-packages.txt" | |
TMP_PER_ISLAND="/tmp/island-deprecated" | |
> "$TMP_ALL_DEPS" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
📊 Deprecated packages per island: | |
🔹 about-frontend: | |
⚠ @zeit/next-css@1.0.1 Next.js now has built-in support for CSS: https://nextjs.org/docs/basic-features/built-in-css-support. The built-in support solves many bugs and painpoints that the next-css plugin had. | |
⚠ core-js@3.6.5 core-js@<3.23.3 is no longer maintained and not recommended for usage due to the number of issues. Because of the V8 engine whims, feature detection in old core-js versions could cause a slowdown up to 100x even if nothing is polyfilled. Some versions have web compatibility issues. Please, upgrade your dependencies to the actual version of core-js. | |
⚠ google-p12-pem@3.1.2 Package is no longer maintained | |
⚠ rimraf@3.0.2 Rimraf versions prior to v4 are no longer supported | |
⚠ glob@7.1.6 Glob versions prior to v9 are no longer supported | |
⚠ inflight@1.0.6 This module is not suppo |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env bash | |
set -euo pipefail | |
INPUT_FILE=${1:-packages.txt} | |
CONCURRENCY=${2:-16} # number of concurrent jobs | |
echo "⚡ Running yarn info in parallel from: $INPUT_FILE" | |
echo "🔄 Concurrency: $CONCURRENCY" | |
start=$(date +%s) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env bash | |
set -euo pipefail | |
INPUT_FILE=${1:-packages.txt} | |
echo "📦 Profiling yarn info over packages in: $INPUT_FILE" | |
echo | |
start=$(date +%s) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env bash | |
set -euo pipefail | |
TARGET_DIR=${1:-.} | |
cd "$TARGET_DIR" | |
echo "🔍 Measuring yarn list + jq parsing in: $TARGET_DIR" | |
echo | |
start=$(date +%s) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package main | |
import ( | |
"bufio" | |
"context" | |
"fmt" | |
"log" | |
"os" | |
"cloud.google.com/go/storage" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package main | |
import ( | |
"bufio" | |
"context" | |
"fmt" | |
"log" | |
"os" | |
"strings" |
NewerOlder