Skip to content

Commit

Permalink
Merge pull request #1 from motin/restore-compatibility-with-latest-ni…
Browse files Browse the repository at this point in the history
…ghtly

Restore compatibility with latest nightly (and make this fork up to date in general)
  • Loading branch information
kpu authored Oct 29, 2021
2 parents 167bb58 + ca7bbd0 commit 02b7a0f
Show file tree
Hide file tree
Showing 96 changed files with 3,070 additions and 711 deletions.
126 changes: 122 additions & 4 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
version: 2.1

jobs:
build_and_test_extension:
###########################################################################
# Ordinary "build and test" CI flow
build-and-test-extension:
docker:
- image: circleci/node:latest-browsers

Expand Down Expand Up @@ -109,8 +111,124 @@ jobs:
path: "test/e2e/results"
destination: "test/e2e/results"

workflows:
###########################################################################
# Docs
generate-docs:
docker:
- image: circleci/node:latest-browsers
steps:
- checkout
- restore_cache:
keys:
- dependencies-{{ checksum "docs/package.json" }}
- run:
name: Install npm deps
command: cd docs && yarn install --immutable
- save_cache:
paths:
- node_modules
key: dependencies-{{ checksum "docs/package.json" }}
- run:
name: Upgrade packages
command: sudo apt update
- run:
name: Install Aspell and Rust
command: sudo apt install aspell aspell-en rustc
- run:
name: Version information
command: rustc --version; cargo --version; aspell --version; yarn --version
- run:
name: Install mdbook-dtmo
command: |
MDBOOK_VERSION=0.8.1
MDBOOK="mdbook-dtmo-${MDBOOK_VERSION}-x86_64-unknown-linux-gnu.tar.gz"
MDBOOK_SHA256=5b8fc7444816c685ae6a3018e6168844a2fcde73e681a9bfbe4775f361dec64c
curl -sfSL --retry 5 -O "https://github.com/badboy/mdbook-dtmo/releases/download/${MDBOOK_VERSION}/${MDBOOK}"
echo "${MDBOOK_SHA256} *${MDBOOK}" | shasum -a 256 -c -
tar -xvf "${MDBOOK}"
# We rename it to mdbook here, so other tools keep working as expected
mkdir -p ~/.local/bin/
mv mdbook-dtmo ~/.local/bin/mdbook
mdbook --version
- run:
name: Generate API docs
command: cd docs && yarn generate-api-docs
- run:
name: Build documentation
command: cd docs && yarn build
- run:
name: Check documentation links
command: cd docs && yarn linkcheck
- persist_to_workspace:
root: build/
paths:
- docs/user
- docs/dev
- docs/shared
- docs/index.html

docs-spellcheck:
docker:
# This is a separate job so that we can use Ubuntu Focal (20.04) and that
# way get aspell 0.60.8 or later (which contains markdown support)
- image: circleci/buildpack-deps:focal
steps:
- checkout
- run:
name: Upgrade packages
command: sudo apt update
- run:
name: Install aspell
command: sudo apt install aspell aspell-en
- run:
name: Check documentation spelling
command: cd docs && bin/spellcheck.sh list

build-and-test:
# via https://circleci.com/blog/deploying-documentation-to-github-pages-with-continuous-integration/
docs-deploy:
docker:
- image: node:8.10.0
steps:
- checkout
- attach_workspace:
at: build/
- run:
name: Disable jekyll builds
command: touch build/docs/.nojekyll
- run:
name: Show contents
command: ls -R
# Needed for write access to the GitHub repository;
# see https://circleci.com/docs/2.0/gh-bb-integration/#deployment-keys-and-user-keys
- add_ssh_keys:
fingerprints:
- "15:15:41:db:aa:14:12:c6:a5:53:e1:06:e9:e6:a1:57"
# The gh-pages npm package can be used to push a directory to a git branch;
# see https://www.npmjs.com/package/gh-pages
- run:
name: Deploy docs to gh-pages branch
command: |
git config user.email "ci-docs-deploy@firefox-translations"
git config user.name "CircleCI docs-deploy job"
npm install -g --silent [email protected]
gh-pages --dotfiles --message "[skip ci] Updates" --dist build/docs
###########################################################################
# Workflows

workflows:
version: 2
ci:
jobs:
- build_and_test_extension
- build-and-test-extension
- generate-docs
- docs-spellcheck:
requires:
- generate-docs
- docs-deploy:
requires:
- docs-spellcheck
filters:
branches:
only: main
5 changes: 4 additions & 1 deletion .eslintignore
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
# do not lint/format generated artifacts
dist/
build/
debug/
test/e2e/results/
stats.json
yarn-error.log
Expand All @@ -20,11 +21,13 @@ test/locally-hosted-files/
.venv
venv
bergamot-translator/
bergamot-models/
firefox-translations-models/
emsdk/
node_modules/
test/in-browser/static/test-runner/inc/
firefox-nightly-linux
downloaded-bergamot-translator-wasm-artifacts*
# don't lint ci configuration
.circleci/
# formatted/linted separately
docs
4 changes: 2 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@
*.pyc
dist/
build/
test/build/
test/results/coverage/
debug/
test/e2e/results/
stats.json
yarn-error.log
*.map
Expand Down
14 changes: 9 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,13 +1,17 @@
# Bergamot Translate Browser Extension
```
This repo has been archived and the work on Firefox Translations will continue here:
https://github.com/mozilla/firefox-translations
```
# Firefox Translations Web Extension

[![CircleCI badge](https://img.shields.io/circleci/project/github/mozilla-extensions/bergamot-browser-extension/main.svg?label=CircleCI)](https://circleci.com/gh/mozilla-extensions/bergamot-browser-extension/)
[![CircleCI badge](https://img.shields.io/circleci/project/github/mozilla-extensions/firefox-translations/main.svg?label=CircleCI)](https://circleci.com/gh/mozilla-extensions/firefox-translations/)

For more information see [The Bergamot Project website](https://browser.mt/).

## Installation instructions
## Installation and usage instructions

See [docs/INSTALL.md](./docs/INSTALL.md) for instructions on how to get a pre-released version of the extension running locally.
See [this document](https://mozilla-extensions.github.io/firefox-translations/user/index.html) for instructions on how to get a pre-released version of the extension running locally.

## Developer documentation

See [docs/DEV.md](./docs/DEV.md) for details on how to work with this extension as a developer.
See [this document](https://mozilla-extensions.github.io/firefox-translations/dev/index.html) for details on how to work with this extension as a developer.
10 changes: 8 additions & 2 deletions build-config.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,9 @@ const targetBrowser = process.env.TARGET_BROWSER;
const ui = process.env.UI;

let extensionBuildEnvironment;
if (process.env.CIRCLECI === "true") {
if (process.env.MC === "1") {
extensionBuildEnvironment = "mozilla";
} else if (process.env.CIRCLECI === "true") {
extensionBuildEnvironment = "circleci";
} else if (process.env.CI === "true") {
extensionBuildEnvironment = "ci";
Expand All @@ -27,7 +29,11 @@ if (targetEnvironment !== "production") {

const extensionId =
ui === "firefox-infobar-ui"
? "[email protected]"
? `${
process.env.MC === "1"
? "[email protected]"
: "[email protected]"
}`
: "[email protected]";

const buildPath = path.join(
Expand Down
37 changes: 37 additions & 0 deletions docs/.dictionary
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
personal_ws-1.1 en 36 utf-8
BERGAMOT
Bergamot
CircleCI
Geckodriver
Github
MPL
PRs
README
TypeDoc
UI
WASM
Webpage
XQuartz
aspell
bergamot
cli
codebase
config
deps
eg
env
erDiagram
geckodriver
infobar
js
mdBook
mitmproxy
monolingually
pre
programme
repo
submodule
submodules
typedoc
ui
webpack
9 changes: 9 additions & 0 deletions docs/.eslintignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
# don't lint/format generated files
dev/api-docs/
dev/api-docs-summary.md
# don't lint/format package.json since npm install formats it differently by default
package.json
# don't lint/format third party modules
node_modules/
user/*.js
shared/mermaid.min.js
2 changes: 2 additions & 0 deletions docs/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
dev/api-docs/
dev/api-docs-summary.md
Loading

0 comments on commit 02b7a0f

Please sign in to comment.