Skip to content

Commit

Permalink
Merge pull request #85 from duckduckgo/release/identities
Browse files Browse the repository at this point in the history
Merge release branch into main
  • Loading branch information
GioSensation authored Mar 2, 2022
2 parents aec2ae7 + 98ab3b8 commit a42fdfe
Show file tree
Hide file tree
Showing 209 changed files with 55,863 additions and 9,163 deletions.
2 changes: 1 addition & 1 deletion .babelrc
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
{
"plugins": ["@babel/plugin-proposal-class-properties"]
"plugins": []
}
6 changes: 4 additions & 2 deletions .eslintrc
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,9 @@
"extends": "standard",
"parser": "@babel/eslint-parser",
"parserOptions": {
"ecmaVersion": 2020
"ecmaVersion": 2020,
"requireConfigFile" : false,
"babelOptions": { "configFile": "./.babelrc" }
},
"rules": {
"indent": ["error", 4],
Expand All @@ -14,5 +16,5 @@
"jasmine": true,
"jest": true
},
"ignorePatterns": ["src/**/*.d.ts", "dist/*"]
"ignorePatterns": ["src/**/*.d.ts", "dist/*", "integration-test/extension/autofill.js"]
}
38 changes: 38 additions & 0 deletions .github/workflows/password-rules.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
name: Password Rules

on:
pull_request:
types: [opened]

jobs:
test:
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v2
- name: Use Node.js 16
uses: actions/setup-node@v1
with:
node-version: 16.x
- uses: actions/cache@v2
with:
path: ~/.npm
key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }}
restore-keys: |
${{ runner.os }}-node-
- uses: actions/github-script@v6
with:
#language=javascript
script: |
const current = require('./packages/password/rules.json')
const {summary, intoMarkdown, REMOTE_URL} = require('./packages/password/scripts/rules.js')
const result = await github.request(REMOTE_URL);
const lines = summary(current, JSON.parse(result.data));
if (lines.length === 0) return;
await github.rest.issues.createComment({
issue_number: context.issue.number,
owner: context.repo.owner,
repo: context.repo.repo,
body: intoMarkdown(lines),
})
35 changes: 35 additions & 0 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
name: Test

on: [push, pull_request]

jobs:
test:
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v2
- name: Use Node.js 16
uses: actions/setup-node@v1
with:
node-version: 16.x
- uses: actions/cache@v2
with:
path: ~/.npm
key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }}
restore-keys: |
${{ runner.os }}-node-
- name: npm install
run: "npm install"
- name: "Clean tree"
run: "npm run test:clean-tree"
- name: "ESLint"
run: "npm run lint"
- name: "Typescript"
run: "npm run tsc"
- name: "Unit Tests"
run: "npm run test:unit"
- name: "Password unit tests"
run: "npm run test:passwords"
- name: "Install dependencies for CI integration tests"
run: sudo apt-get install xvfb
- run: npm rebuild puppeteer
- run: npm run test-int-x
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@

test-report.html
.cache/
coverage/
!dist/index.html
Expand Down
2 changes: 1 addition & 1 deletion .nvmrc
Original file line number Diff line number Diff line change
@@ -1 +1 @@
16
16.13.2
31 changes: 18 additions & 13 deletions Gruntfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,12 @@ module.exports = function (grunt) {
dist: {
options: {
transform: [
['babelify', { presets: ['@babel/preset-env'] }]
[
'babelify', {
presets: ['@babel/preset-env'],
global: true
}
]
]
},
files: {
Expand All @@ -27,33 +32,33 @@ module.exports = function (grunt) {
target: 'src/**/*.js'
},
exec: {
copyAutofillStylesToCSS: 'cp src/UI/styles/autofill-tooltip-styles.js dist/autofill.css && sed -i "" \'/`/d\' dist/autofill.css',
copyHostStyles: 'cp src/UI/styles/autofill-host-styles.css dist/autofill-host-styles_chrome.css && cp src/UI/styles/autofill-host-styles.css dist/autofill-host-styles_firefox.css',
// Firefox and Chrome treat relative url differently in injected scripts. This fixes it.
updateFirefoxRelativeUrl: `sed -i "" "s/chrome-extension:\\/\\/__MSG_@@extension_id__\\/public/../g" dist/autofill-host-styles_firefox.css`
copyAssets: 'npm run copy-assets',
copyHtml: 'cp src/TopAutofill.html dist/TopAutofill.html'
},
/**
* Run predefined tasks whenever watched files are added,
* modified or deleted.
*/
watch: {
scripts: {
files: ['src/**/*.js'],
tasks: ['browserify']
files: ['src/**/*.js', 'packages/password/**/*.{json,js}'],
tasks: ['browserify', 'exec:copyAssets']
},
html: {
files: ['src/**/*.html'],
tasks: ['exec:copyHtml']
},
styles: {
files: ['src/**/*.css'],
tasks: ['exec:copyAutofillStylesToCSS', 'exec:copyHostStyles', 'exec:updateFirefoxRelativeUrl']
files: ['src/**/*.css', 'src/UI/styles/*'],
tasks: ['exec:copyAssets']
}
}
})

grunt.registerTask('default', [
'eslint',
'browserify',
'exec:copyAutofillStylesToCSS',
'exec:copyHostStyles',
'exec:updateFirefoxRelativeUrl'
'exec:copyHtml',
'exec:copyAssets'
])
grunt.registerTask('dev', ['default', 'watch'])
}
13 changes: 13 additions & 0 deletions dist/TopAutofill.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
<html>
<head>
<style>
html, body {
margin: 0;
background-color: rgba(242, 240, 240, 0.9);
}
</style>
</head>
<body id="topAutofill">
<main></main>
</body>
</html>
106 changes: 81 additions & 25 deletions dist/autofill.css

Large diffs are not rendered by default.

Loading

0 comments on commit a42fdfe

Please sign in to comment.