Skip to content

Commit

Permalink
Initial commit
Browse files Browse the repository at this point in the history
  • Loading branch information
vanessa committed Nov 12, 2023
0 parents commit 217ff3c
Show file tree
Hide file tree
Showing 100 changed files with 11,574 additions and 0 deletions.
2 changes: 2 additions & 0 deletions .eslintignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
dist
node_modules
50 changes: 50 additions & 0 deletions .eslintrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
{
"env": {
"browser": true,
"es6": true,
"node": true
},
"extends": [
"eslint:recommended",
"plugin:react/recommended",
"plugin:@typescript-eslint/recommended",
"plugin:react-hooks/recommended",
"plugin:import/recommended",
"plugin:jsx-a11y/recommended",
"prettier"
],
"parser": "@typescript-eslint/parser",
"parserOptions": {
"ecmaFeatures": {
"jsx": true
},
"ecmaVersion": "latest",
"sourceType": "module"
},
"plugins": [
"react",
"@typescript-eslint",
"react-hooks",
"import",
"jsx-a11y",
"prettier"
],
"settings": {
"react": {
"version": "detect"
}
},
"rules": {
"react/react-in-jsx-scope": "off",
"import/no-unresolved": "off",
"@typescript-eslint/no-explicit-any": "warn",
"@typescript-eslint/ban-ts-comment": "warn"
},
"globals": {
"chrome": "readonly"
},
"ignorePatterns": [
"watch.js",
"dist/**"
]
}
5 changes: 5 additions & 0 deletions .github/actions/release-beta/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
name: Send Beta Version to Slack
description: This uploads the packed extension to a channel in Slack.
runs:
using: "node20"
main: "dist/index.mjs"
17 changes: 17 additions & 0 deletions .github/actions/release-beta/dist/index.mjs

Large diffs are not rendered by default.

16 changes: 16 additions & 0 deletions .github/actions/release-beta/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
{
"private": true,
"version": "1.0.0",
"description": "Notify beta release on Slack",
"main": "dist/index.mjs",
"scripts": {
"build": "ncc --no-source-map-register -m -o dist build src/index.mjs"
},
"dependencies": {
"@actions/core": "^1.10.1",
"@slack/web-api": "^6.9.1"
},
"devDependencies": {
"@vercel/ncc": "^0.38.1"
}
}
232 changes: 232 additions & 0 deletions .github/actions/release-beta/pnpm-lock.yaml

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

61 changes: 61 additions & 0 deletions .github/actions/release-beta/src/index.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
import { WebClient } from '@slack/web-api';
import core from '@actions/core';
import fs from 'fs';

import packageJson from '../../../../package.json';

const EXTENSION_ZIP_PATH = './chrome-extension-beta.zip';

// Not used for now, but should be added to the message in the future
const COMMIT_MESSAGE = process.env.COMMIT_MSG;
const COMMIT_SHA = process.env.COMMIT_SHA;

const run = async () => {
try {
if (!process.env.SLACK_BOT_TOKEN) {
throw new TypeError('SLACK_BOT_TOKEN is not set');
}

if (!process.env.SLACK_CHANNEL_ID) {
throw new TypeError('SLACK_CHANNEL_ID is not set');
}

const slack = new WebClient(process.env.SLACK_BOT_TOKEN);
const zipExists = fs.existsSync(EXTENSION_ZIP_PATH);

if (!zipExists) {
core.info('chrome-extension-beta.zip does not exist. Skipping notification.');
return;
}

const version = determineVersion();

await slack.files.uploadV2({
channel_id: process.env.SLACK_CHANNEL_ID,
file: EXTENSION_ZIP_PATH,
filename: `chrome-extension-${version}.zip`,
initial_comment: [
`✨ *New beta release available (\`v${version}\`)*`,
COMMIT_MESSAGE &&
COMMIT_SHA &&
`> ${COMMIT_MESSAGE} (<https://github.com/monarchmoney/mint-exporter-ext/commit/${COMMIT_SHA}|${COMMIT_SHA.slice(
0,
7,
)}>)`,
`To learn how to test it locally, follow <https://developer.chrome.com/docs/extensions/mv3/getstarted/development-basics/#load-unpacked|this guide from Google>.`,
]
.filter(Boolean)
.join('\n'),
});
} catch (e) {
core.setFailed(e.message);
}
};

const determineVersion = () => {
const { version } = packageJson;
const runNumber = process.env.GITHUB_RUN_NUMBER;
return runNumber ? `${version}.${runNumber}` : `${version}-beta`;
};

run();
11 changes: 11 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
# To get started with Dependabot version updates, you'll need to specify which
# package ecosystems to update and where the package manifests are located.
# Please see the documentation for all configuration options:
# https://docs.github.com/github/administering-a-repository/configuration-options-for-dependency-updates

version: 2
updates:
- package-ecosystem: "npm" # See documentation for possible values
directory: "/" # Location of package manifests
schedule:
interval: "weekly"
Binary file added .github/img/banner.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading

0 comments on commit 217ff3c

Please sign in to comment.