-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
0 parents
commit 217ff3c
Showing
100 changed files
with
11,574 additions
and
0 deletions.
There are no files selected for viewing
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
dist | ||
node_modules |
This file contains 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
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/**" | ||
] | ||
} |
This file contains 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
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" |
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains 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
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" | ||
} | ||
} |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains 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
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(); |
This file contains 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
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" |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Oops, something went wrong.