Skip to content

Commit

Permalink
Merge branch 'main' into fix/626
Browse files Browse the repository at this point in the history
  • Loading branch information
EthanThatOneKid committed Oct 26, 2022
2 parents 0ed79ce + ede06e6 commit dfbbae0
Show file tree
Hide file tree
Showing 94 changed files with 138 additions and 458 deletions.
2 changes: 1 addition & 1 deletion .env.example
@@ -1,7 +1,7 @@
DEBUG_FLAG_ENABLED=1

GH_DISCUSSION_CATEGORY_ID="DIC_kwDOE7ysSc4CAC0o"
GH_ACCESS_TOKEN=💖
GH_ACCESS_TOKEN="💖"

# The Analytics ID is provided when your app builds on Vercel.
# It is accessed at runtime via svelte.config.js preprocessing.
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/check_website.yaml
Expand Up @@ -42,13 +42,13 @@ jobs:
- name: Copy .env from .env.example
run: cp .env.example .env

- name: Svelte check
run: npm run check

# checks for lint errors AND format errors
- name: Lint
run: npm run lint && git diff --exit-code

- name: Check
run: npm run check

- name: npx playwright install
run: npx playwright install

Expand Down
21 changes: 0 additions & 21 deletions .github/workflows/create_issue_channel.yaml

This file was deleted.

23 changes: 0 additions & 23 deletions .github/workflows/create_message.yaml

This file was deleted.

73 changes: 73 additions & 0 deletions .github/workflows/gitcord.yaml
@@ -0,0 +1,73 @@
# Gitcord workflow copied from:
# https://etok.codes/gitcord/blob/main/.github/workflows/gitcord.yaml
name: Gitcord

on:
issues:
types:
- opened
- edited
- deleted
- transferred
- closed
- reopened
- assigned
- unassigned
- labeled
- unlabeled
- locked
- unlocked
- milestoned
- demilestoned
issue_comment:
types:
- created
- edited
- deleted
pull_request:
types:
- opened
- edited
- deleted
- transferred
- review_requested
- review_request_removed
- ready_for_review
- closed
- reopened
- assigned
- unassigned
- labeled
- unlabeled
- locked
- unlocked
- milestoned
- demilestoned
pull_request_review:
types:
- submitted
- edited
- dismissed
pull_request_review_comment:
types:
- created
- edited
- deleted

jobs:
gitcord:
runs-on: ubuntu-latest
steps:
- name: Read GitHub event payload
id: event_payload
run: |
echo ::set-output name=payload::$(cat $GITHUB_EVENT_PATH)
- name: 'Gitcord ${{ github.event_name }}:${{ github.event.action }} (${{ github.repository }})'
uses: ethanthatonekid/gitcord@main
with:
github-event-name: ${{ github.event_name }}
github-event-payload: ${{ steps.event_payload.outputs.payload }}
github-token: ${{ github.token }}
discord-token: ${{ secrets.DISCORD_TOKEN }}
discord-channel-id: ${{ secrets.DISCORD_CHANNEL_ID }}
1 change: 1 addition & 0 deletions package-lock.json

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

22 changes: 21 additions & 1 deletion scripts/close-issue-channel.js
@@ -1,4 +1,5 @@
import { startBot, getNArg } from './common.js';
import { Client, Intents } from 'discord.js';
import { config } from 'dotenv';

startBot(async (client) => {
console.log(`Logged in as ${client.user.tag}`);
Expand All @@ -10,6 +11,25 @@ startBot(async (client) => {
process.exit(success ? 0 : 1);
});

// eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types
function getNArg(n = 2) {
const payload = process.argv[n];
try {
return JSON.parse(payload);
// eslint-disable-next-line no-empty
} catch {}
return payload;
}

// eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types
function startBot(start) {
config();
const intents = [Intents.FLAGS.GUILDS, Intents.FLAGS.GUILD_MESSAGES];
const client = new Client({ intents });
client.on('ready', async () => await start(client));
client.login(process.env.DISCORD_BOT_TOKEN);
}

/**
* ### Close Issue Channel Script
*
Expand Down
21 changes: 0 additions & 21 deletions scripts/common.js

This file was deleted.

46 changes: 0 additions & 46 deletions scripts/create-issue-channel.js

This file was deleted.

37 changes: 0 additions & 37 deletions scripts/create-message.js

This file was deleted.

16 changes: 0 additions & 16 deletions src/lib/public/analytics/send.ts

This file was deleted.

2 changes: 1 addition & 1 deletion src/lib/public/analytics/types.ts
@@ -1,4 +1,4 @@
export type { Metric } from 'web-vitals';
export type { Metric, ReportHandler, ReportCallback, ReportOpts } from 'web-vitals';

export interface AnalyticsOptions {
id?: string;
Expand Down
26 changes: 23 additions & 3 deletions src/lib/public/analytics/vitals.ts
@@ -1,9 +1,29 @@
import type { AnalyticsOptions, Metric } from './types';
export { onCLS, onFCP, onFID, onLCP, onTTFB } from 'web-vitals';
import { onCLS, onFCP, onFID, onLCP, onTTFB } from 'web-vitals';
import type { AnalyticsOptions, Metric, ReportCallback, ReportOpts } from './types';

export function send(
options: AnalyticsOptions,
handlers = [onFID, onTTFB, onLCP, onCLS, onFCP]
): void {
if (!options.id) return;

try {
handlers.forEach((handler) => doVital(handler, options));
} catch (err) {
console.error('[Analytics]', err);
}
}

function doVital(
handler: (onReport: ReportCallback, opts?: ReportOpts | undefined) => void,
options: AnalyticsOptions
): void {
handler((metric: Metric) => sendToAnalytics(metric, options));
}

type VitalsNavigator = Navigator & { connection: { effectiveType: string } };

export function sendToAnalytics(metric: Metric, options: AnalyticsOptions) {
function sendToAnalytics(metric: Metric, options: AnalyticsOptions) {
if (!options.url) {
options.url = 'https://vitals.vercel-analytics.com/v1/vitals';
}
Expand Down
7 changes: 7 additions & 0 deletions src/lib/server/links/data.ts
Expand Up @@ -23,4 +23,11 @@ export const LINKS = {
'frank-grid': 'https://codepen.io/alancortez1337/pen/xxjPVbG',
arch: 'https://github.com/EthanThatOneKid/acmcsuf.com/blob/main/ARCHITECTURE.md',
'game-night': 'https://discord.com/events/710225099923521558/1031436363259723817',
webdevform:
'https://docs.google.com/forms/d/e/1FAIpQLSflnzKjgYKmNOkwIYRVveGVGuzso4Fm9Ph0gxAULgt6w5Xx9A/viewform',
icpcform:
'https://docs.google.com/forms/d/e/1FAIpQLSf_z4XjkpKQMNBGWArGZswmTmn38teFjsx-MjtT8xV-cVW-sQ/viewform',
botform:
'https://docs.google.com/forms/d/e/1FAIpQLSe07zvJR8kfjWXWIDilIMdTzjenCeiFdAGTjX81dcI6XotE5Q/viewform',
'intro-to-python': 'https://colab.research.google.com/drive/1oXXibZCxEnFnyCfEnxk9x-Qcgp1n4zJa',
} as const;

0 comments on commit dfbbae0

Please sign in to comment.