Created github workflows

* Create codeql.yml
* Adding workflow configs
* Added CI Workflow
* Track package-lock.json for reliable builds
* Fix pipeline for rimraf
* Fixed npm run lint
* Linter continue on error
* Type check continue on error
main
Bhaumik Maan 2 years ago committed by GitHub
parent 65a25d0417
commit 6f8695fe44
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

@ -0,0 +1,47 @@
name: CI
on:
push:
branches: [main]
pull_request:
branches: [main]
types: [opened, synchronize, reopened]
jobs:
build-and-test:
name: Build and Test on ${{ matrix.os }}
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-latest, macos-latest, windows-latest]
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: 20
cache: 'npm'
- name: Install dependencies
run: npm i
- name: Clearing previous builds
run: npm run clean
- name: Run Linter
run: npm run lint
continue-on-error: true
- name: Type Check
run: npx tsc --noEmit
continue-on-error: true
- name: Build
run: npm run build
- name: Run Tests
run: npm test

@ -0,0 +1,100 @@
# For most projects, this workflow file will not need changing; you simply need
# to commit it to your repository.
#
# You may wish to alter this file to override the set of languages analyzed,
# or to provide custom queries or build logic.
#
# ******** NOTE ********
# We have attempted to detect the languages in your repository. Please check
# the `language` matrix defined below to confirm you have the correct set of
# supported CodeQL languages.
#
name: "CodeQL Advanced"
on:
push:
branches: [ "main" ]
pull_request:
branches: [ "main" ]
pull_request_target:
branches: [ "main" ]
schedule:
- cron: '18 13 * * 2'
jobs:
analyze:
name: Analyze (${{ matrix.language }})
# Runner size impacts CodeQL analysis time. To learn more, please see:
# - https://gh.io/recommended-hardware-resources-for-running-codeql
# - https://gh.io/supported-runners-and-hardware-resources
# - https://gh.io/using-larger-runners (GitHub.com only)
# Consider using larger runners or machines with greater resources for possible analysis time improvements.
runs-on: ${{ (matrix.language == 'swift' && 'macos-latest') || 'ubuntu-latest' }}
permissions:
# required for all workflows
security-events: write
# required to fetch internal or private CodeQL packs
packages: read
# only required for workflows in private repositories
actions: read
contents: read
strategy:
fail-fast: false
matrix:
include:
- language: javascript-typescript
build-mode: none
# CodeQL supports the following values keywords for 'language': 'actions', 'c-cpp', 'csharp', 'go', 'java-kotlin', 'javascript-typescript', 'python', 'ruby', 'swift'
# Use `c-cpp` to analyze code written in C, C++ or both
# Use 'java-kotlin' to analyze code written in Java, Kotlin or both
# Use 'javascript-typescript' to analyze code written in JavaScript, TypeScript or both
# To learn more about changing the languages that are analyzed or customizing the build mode for your analysis,
# see https://docs.github.com/en/code-security/code-scanning/creating-an-advanced-setup-for-code-scanning/customizing-your-advanced-setup-for-code-scanning.
# If you are analyzing a compiled language, you can modify the 'build-mode' for that language to customize how
# your codebase is analyzed, see https://docs.github.com/en/code-security/code-scanning/creating-an-advanced-setup-for-code-scanning/codeql-code-scanning-for-compiled-languages
steps:
- name: Checkout repository
uses: actions/checkout@v4
# Add any setup steps before running the `github/codeql-action/init` action.
# This includes steps like installing compilers or runtimes (`actions/setup-node`
# or others). This is typically only required for manual builds.
# - name: Setup runtime (example)
# uses: actions/setup-example@v1
# Initializes the CodeQL tools for scanning.
- name: Initialize CodeQL
uses: github/codeql-action/init@v3
with:
languages: ${{ matrix.language }}
build-mode: ${{ matrix.build-mode }}
# If you wish to specify custom queries, you can do so here or in a config file.
# By default, queries listed here will override any specified in a config file.
# Prefix the list here with "+" to use these queries and those in the config file.
# For more details on CodeQL's query packs, refer to: https://docs.github.com/en/code-security/code-scanning/automatically-scanning-your-code-for-vulnerabilities-and-errors/configuring-code-scanning#using-queries-in-ql-packs
# queries: security-extended,security-and-quality
# If the analyze step fails for one of the languages you are analyzing with
# "We were unable to automatically build your code", modify the matrix above
# to set the build mode to "manual" for that language. Then modify this step
# to build your code.
# ℹ️ Command-line programs to run using the OS shell.
# 📚 See https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#jobsjob_idstepsrun
- if: matrix.build-mode == 'manual'
shell: bash
run: |
echo 'If you are using a "manual" build mode for one or more of the' \
'languages you are analyzing, replace this with the commands to build' \
'your code, for example:'
echo ' make bootstrap'
echo ' make release'
exit 1
- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@v3
with:
category: "/language:${{matrix.language}}"

1
.gitignore vendored

@ -7,7 +7,6 @@ dist
**/.DS_Store
**/.vscode
**/.idea
**/package-lock.json
scripts/
**/scripts/
scripts/manual-notarize.js

@ -0,0 +1,58 @@
import js from "@eslint/js";
import globals from "globals";
import tseslintPlugin from "@typescript-eslint/eslint-plugin";
import tseslintParser from "@typescript-eslint/parser";
import json from "@eslint/json";
import markdown from "@eslint/markdown";
import css from "@eslint/css";
export default [
js.configs.recommended,
{
files: ["**/*.{js,mjs,cjs,ts,tsx}"],
languageOptions: {
parser: tseslintParser,
parserOptions: {
ecmaVersion: "latest",
sourceType: "module",
},
globals: {
...globals.browser,
...globals.node,
},
},
plugins: {
"@typescript-eslint": tseslintPlugin,
},
rules: {
...tseslintPlugin.configs.recommended.rules,
},
},
{
files: ["**/*.json"],
plugins: { json },
rules: { ...json.configs.recommended.rules },
},
{
files: ["**/*.jsonc"],
plugins: { json },
rules: { ...json.configs.recommended.rules },
},
{
files: ["**/*.json5"],
plugins: { json },
rules: { ...json.configs.recommended.rules },
},
{
files: ["**/*.md"],
plugins: { markdown },
rules: { ...markdown.configs.recommended.rules },
},
{
files: ["**/*.css"],
plugins: { css },
rules: { ...css.configs.recommended.rules },
},
];

12140
package-lock.json generated

File diff suppressed because it is too large Load Diff

@ -3,10 +3,12 @@
"version": "1.0.19",
"main": "./dist-electron/main.js",
"scripts": {
"clean": "rimraf dist dist-electron",
"clean": "npx rimraf dist dist-electron",
"dev": "cross-env NODE_ENV=development npm run clean && concurrently \"tsc -w -p tsconfig.electron.json\" \"vite\" \"wait-on -t 30000 http://localhost:54321 && electron ./dist-electron/main.js\"",
"test": "echo \"No tests defined. Please contribute if you like\" && exit 0",
"lint": "npx eslint .",
"start": "cross-env NODE_ENV=development concurrently \"tsc -p tsconfig.electron.json\" \"vite\" \"wait-on -t 30000 http://localhost:54321 && electron ./dist-electron/main.js\"",
"build": "cross-env NODE_ENV=production rimraf dist dist-electron && vite build && tsc -p tsconfig.electron.json",
"build": "cross-env NODE_ENV=production npm run clean && vite build && tsc -p tsconfig.electron.json",
"run-prod": "cross-env NODE_ENV=production electron ./dist-electron/main.js",
"package": "npm run build && electron-builder build",
"package-mac": "npm run build && electron-builder build --mac",
@ -152,6 +154,10 @@
},
"devDependencies": {
"@electron/typescript-definitions": "^8.14.0",
"@eslint/css": "^0.6.0",
"@eslint/js": "^9.24.0",
"@eslint/json": "^0.11.0",
"@eslint/markdown": "^6.3.0",
"@types/color": "^4.2.0",
"@types/diff": "^6.0.0",
"@types/electron-store": "^1.3.1",
@ -161,8 +167,9 @@
"@types/react-syntax-highlighter": "^15.5.13",
"@types/screenshot-desktop": "^1.12.3",
"@types/uuid": "^9.0.8",
"@typescript-eslint/eslint-plugin": "^7.3.1",
"@typescript-eslint/parser": "^7.3.1",
"@typescript-eslint/eslint-plugin": "^7.18.0",
"@typescript-eslint/parser": "^7.18.0",
"@typescript-eslint/utils": "^8.29.1",
"@vitejs/plugin-react": "^4.2.1",
"autoprefixer": "^10.4.20",
"concurrently": "^8.2.2",
@ -170,9 +177,11 @@
"electron": "^29.1.4",
"electron-builder": "^24.13.3",
"electron-is-dev": "^3.0.1",
"eslint": "^8.57.0",
"eslint": "^8.57.1",
"eslint-flat-config-utils": "^2.0.1",
"eslint-plugin-react-hooks": "^4.6.0",
"eslint-plugin-react-refresh": "^0.4.6",
"globals": "^16.0.0",
"postcss": "^8.4.49",
"rimraf": "^6.0.1",
"tailwindcss": "^3.4.15",

Loading…
Cancel
Save