Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 0 additions & 15 deletions .babelrc

This file was deleted.

5 changes: 0 additions & 5 deletions .dev.sample.json

This file was deleted.

9 changes: 9 additions & 0 deletions .env.sample
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
VITE_BETA=true
VITE_MAC=true
VITE_DEFAULT_API_URL=https://app.simplelogin.io
# A comma-separated list of domains that are allowed to use the extra permission
VITE_EXTRA_ALLOWED_DOMAINS=abc.com,def.com,ghi.com
# A comma-separated list of **manifest.json** permissions that are allowed to be used by the extra permission
PERMISSIONS=abc,def,ghi
FIREFOX=true
LITE=true
38 changes: 38 additions & 0 deletions .eslintrc.cjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
/* eslint-env node */
require('@rushstack/eslint-patch/modern-module-resolution')

const { defineConfig } = require('eslint-define-config')

module.exports = defineConfig({
root: true,
extends: [
'plugin:vue/vue3-recommended',
'eslint:recommended',
'@vue/eslint-config-typescript/recommended',
'@vue/eslint-config-prettier'
],
parserOptions: {
ecmaVersion: 'latest'
},
rules: {
'prettier/prettier': [
'warn',
{
endOfLine: 'auto'
}
],
'vue/component-name-in-template-casing': ['error', 'PascalCase'],
'vue/html-self-closing': [
'error',
{
html: {
void: 'always',
normal: 'always',
component: 'always'
},
svg: 'always',
math: 'always'
}
]
}
})
12 changes: 5 additions & 7 deletions .github/workflows/lint.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,12 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v2
uses: actions/checkout@v4

- name: Install NodeJS
uses: actions/setup-node@v3
with:
node-version: 16
- name: Install Bun
uses: oven-sh/setup-bun@v2

- name: Perform linting
run: |
npm install
npm run prettier:check
bun install
bun run prettier:check
55 changes: 28 additions & 27 deletions .github/workflows/release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,9 @@ jobs:
with:
fetch-depth: 1

- name: Install Bun
uses: oven-sh/setup-bun@v2

- name: Install dependencies and check tag format
run: |
sudo apt update && sudo apt install -y jq
Expand Down Expand Up @@ -66,7 +69,7 @@ jobs:
run: echo "${{ env.EXTENSION_VERSION }}" > artifacts/release-version

- name: Upload artifacts
uses: actions/upload-artifact@v1
uses: actions/upload-artifact@v4
with:
name: artifacts
path: artifacts
Expand All @@ -85,17 +88,15 @@ jobs:
run: echo "Starting build process for variant = ${{ matrix.variant }}"

- name: Checkout repository
uses: actions/checkout@v2
uses: actions/checkout@v4
with:
fetch-depth: 1

- name: Install NodeJS
uses: actions/setup-node@v3
with:
node-version: 16
- name: Install Bun
uses: oven-sh/setup-bun@v2

- name: Get release download URL
uses: actions/download-artifact@v1
uses: actions/download-artifact@v4
with:
name: artifacts
path: artifacts
Expand All @@ -118,59 +119,59 @@ jobs:
env:
ENABLE_LOGIN_WITH_PROTON: true
run: |
npm run generate:buildconfig
bun run generate:buildConfig

- name: Build lite version
if: matrix.variant == 'lite'
shell: bash
run: |
npm install
npm run build:lite
SUFFIX=lite npm run build-zip
bun install
bun run build:lite
SUFFIX=lite bun run generate:zip

- name: Build beta version for Chromium
if: matrix.variant == 'beta'
shell: bash
run: |
npm install
npm run build:beta
npm run build-zip
bun install
bun run build:beta
bun run generate:zip

- name: Build beta version for Firefox
if: matrix.variant == 'beta-firefox'
shell: bash
run: |
npm install
npm run build:firefox:beta
bun install
bun run build:firefox:beta

# dist-zip/simplelogin-extension-beta-firefox-v... can be submitted to firefox
SUFFIX=firefox npm run build-zip
SUFFIX=firefox bun run generate:zip

- name: Build production version for Firefox
if: matrix.variant == 'beta-firefox'
shell: bash
run: |
npm install
npm run build:firefox
bun install
bun run build:firefox

# dist-zip/simplelogin-extension-beta-firefox-v... can be submitted to firefox
SUFFIX=firefox npm run build-zip
SUFFIX=firefox bun run generate:zip

- name: Build production version for Chromium
if: matrix.variant == 'full'
shell: bash
run: |
npm install
npm run build
npm run build-zip
bun install
bun run build
bun run generate:zip

- name: Build Mac version
if: matrix.variant == 'mac'
shell: bash
run: |
npm install
npm run build:mac
SUFFIX=mac npm run build-zip
bun install
bun run build:mac
SUFFIX=mac bun run generate:zip

- name: Package extension
run: |
Expand All @@ -196,7 +197,7 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Get artifacts
uses: actions/download-artifact@v1
uses: actions/download-artifact@v4
with:
name: artifacts
path: artifacts
Expand Down
33 changes: 32 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,35 @@
.DS_Store
.idea/
.dev.json
code-for-reviewer/
code-for-reviewer/

# Logs
logs
*.log
npm-debug.log*
yarn-debug.log*
yarn-error.log*
pnpm-debug.log*
lerna-debug.log*

node_modules
.DS_Store
dist
dist-ssr
coverage
*.local

/cypress/videos/
/cypress/screenshots/

# Editor directories and files
.vscode/*
!.vscode/extensions.json
.idea
*.suo
*.ntvs*
*.njsproj
*.sln
*.sw?

components.d.ts
3 changes: 0 additions & 3 deletions .jshintrc

This file was deleted.

1 change: 0 additions & 1 deletion .nvmrc

This file was deleted.

8 changes: 8 additions & 0 deletions .prettierrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
{
"$schema": "https://json.schemastore.org/prettierrc",
"semi": false,
"tabWidth": 2,
"singleQuote": true,
"printWidth": 100,
"trailingComma": "none"
}
6 changes: 2 additions & 4 deletions DEVELOPMENT.md → CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# DEVELOPMENT
# CONTRIBUTING

This document contains an overview on how the extension is organized, which parts does it have and how does it work.

Expand All @@ -9,14 +9,13 @@ The extension consists of 2 main screens:
- main screen: displays email alias recommendation, alias creation and existing alias.
- new alias screen: when a new alias is created, user is redirected to this screen so they can copy it.


## How to change the domain where the extension is connecting to

In order to change the backend URL, you will need to:

1. Copy the `.dev.sample.json` file into a `.dev.json` file.
2. Edit the `DEFAULT_API_URL` parameter and enter the URL you want to use.
3. You may need to run `npm start` again in order for the changes to take effect.
3. You may need to run `bun start` again in order for the changes to take effect.

## How does the extension setup work

Expand All @@ -40,7 +39,6 @@ Here you have a full definition of the flow:
3. Once the setup is done, they will be redirected to the `/onboarding/final` page.
2. Once the user reaches the `/onboarding/final` page, the extension will be correctly set up, the user will be able to use it, and the page will contain the extension version at the bottom of the page


## Add custom allowed domains

The messages for both performing the extension setup and for checking if it's installed are only allowed if they come from a [predefined set of origins](https://github.com/simple-login/browser-extension/blob/55629849838b716dabcb008898c97c4ee1118da1/src/background/index.js#L72-L77).
Expand Down
2 changes: 1 addition & 1 deletion LICENSE
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
MIT License

Copyright (c) 2019 SimpleLogin
Copyright (c) 2024 SimpleLogin

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
Expand Down
Loading