forked from mozilla-extensions/firefox-translations
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathpackage.json
99 lines (99 loc) · 7.21 KB
/
package.json
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
{
"name": "firefox-translations",
"description": "Firefox Translations",
"version": "0.4.5",
"author": "Mozilla",
"engines": {
"npm": "please-use-yarn",
"yarn": ">=1.21.1",
"node": ">=12.21.0"
},
"husky": {
"hooks": {
"pre-commit": "lint-staged",
"post-commit": "git update-index --again"
}
},
"keywords": [
"bergamot",
"mozilla",
"neural-machine-translation",
"translation"
],
"license": "MPL-2.0",
"lint-staged": {
"*.{jsm,js,json}": [
"prettier --ignore-path=.eslintignore --write",
"eslint --ext jsm,js,json",
"git add"
],
"*.{ts,tsx}": [
"prettier --ignore-path=.eslintignore --write",
"eslint --ext ts,tsx",
"git add"
],
"*.{md}": [
"prettier --ignore-path=.eslintignore --write",
"doctoc --title '**Contents**'",
"git add"
],
"*.{html}": [
"prettier --ignore-path=.eslintignore --write",
"eslint --ext html",
"git add"
],
"*.{css,scss,json}": [
"prettier --ignore-path=.eslintignore --write",
"git add"
]
},
"private": true,
"scripts": {
"addons-linter": "npm-run-all addons-linter:firefox-infobar-ui addons-linter:cross-browser-ui:* ",
"addons-linter:cross-browser-ui:chrome": "addons-linter build/production/chrome/cross-browser-ui",
"addons-linter:cross-browser-ui:firefox": "addons-linter build/production/firefox/cross-browser-ui",
"addons-linter:firefox-infobar-ui": "addons-linter build/production/firefox/firefox-infobar-ui",
"bergamot-translator:download-and-import": "./download-bergamot-translator-wasm-artifacts.sh && ./import-bergamot-translator.sh ./downloaded-bergamot-translator-wasm-artifacts",
"build:cross-browser-ui:chrome": "export TARGET_BROWSER=chrome UI=cross-browser-ui NODE_ENV=${NODE_ENV:-production}; yarn workspace cross-browser-ui webpack:build:chrome && web-ext build",
"build:cross-browser-ui:firefox": "export TARGET_BROWSER=firefox UI=cross-browser-ui NODE_ENV=${NODE_ENV:-production}; yarn workspace cross-browser-ui webpack:build:firefox && web-ext build",
"build:firefox-infobar-ui": "export TARGET_BROWSER=firefox UI=firefox-infobar-ui NODE_ENV=${NODE_ENV:-production}; yarn workspace firefox-infobar-ui webpack:build && web-ext build",
"ci:install-firefox:linux": "[ ! -d \"./firefox-nightly-linux\" ] && get-firefox --branch nightly --platform linux --extract && mv firefox firefox-nightly-linux || true",
"clean": "trash build/${NODE_ENV}/${TARGET_BROWSER}/${UI}/",
"clean:test": "trash test/build",
"e2e-tests": "concurrently --success first --kill-others 'npm-run-all -n e2e-tests:test-infra e2e-tests:firefox-infobar-ui e2e-tests:cross-browser-ui:firefox' 'yarn geckodriver -vv 1> test/e2e/results/logs/geckodriver.log 2> test/e2e/results/logs/geckodriver.errors.log'",
"e2e-tests:cross-browser-ui:firefox": "export TARGET_BROWSER=firefox UI=cross-browser-ui FIREFOX_BINARY=${FIREFOX_BINARY:-nightly} EXTENSION_ARTIFACT=./dist/production/firefox/cross-browser-ui/bergamot-browser-extension-$npm_package_version-firefox-cross-browser-ui.xpi GECKODRIVER_URL=http://127.0.0.1:4444; ts-mocha -p test/e2e/tsconfig.json test/e2e/tests/cross-browser-ui/*.spec.ts --bail --full-trace --timeout 10000",
"e2e-tests:firefox-infobar-ui": "export TARGET_BROWSER=firefox UI=firefox-infobar-ui FIREFOX_BINARY=${FIREFOX_BINARY:-nightly} EXTENSION_ARTIFACT=./dist/production/firefox/firefox-infobar-ui/firefox-translations-$npm_package_version.xpi GECKODRIVER_URL=http://127.0.0.1:4444; ts-mocha -p test/e2e/tsconfig.json test/e2e/tests/firefox-infobar-ui/*.spec.ts --bail --full-trace --timeout 10000",
"e2e-tests:test-infra": "export FIREFOX_BINARY=${FIREFOX_BINARY:-nightly} GECKODRIVER_URL=http://127.0.0.1:4444; ts-mocha -p test/e2e/tsconfig.json test/e2e/tests/test-infra/*.spec.ts --bail --full-trace --timeout 10000",
"format": "npm-run-all -s -n format:prettier format:eslint format:fixpack",
"format:eslint": "npm run lint:eslint -- --fix",
"format:fixpack": "fixpack && fixpack src/core/package.json && fixpack src/cross-browser-ui/package.json && fixpack src/firefox-infobar-ui/package.json",
"format:prettier": "prettier '**/*.{css,scss,js,ts,tsx,json,jsm,html}' --ignore-path=.eslintignore --write",
"generate-glean": "npm-run-all generate-glean:glinter generate-glean:metrics generate-glean:docs format",
"generate-glean:docs": "cd ./src/core/ts/background-scripts/background.js/telemetry && glean translate -o ./generated -f markdown metrics.yaml pings.yaml",
"generate-glean:glinter": "cd ./src/core/ts/background-scripts/background.js/telemetry && glean glinter metrics.yaml pings.yaml",
"generate-glean:metrics": "cd ./src/core/ts/background-scripts/background.js/telemetry && glean translate -o ./generated -f typescript metrics.yaml pings.yaml",
"generate-manifest": "node generate-manifest.js",
"generate-model-registry": "node generate-model-registry.js && prettier src/core/ts/modelRegistry.ts --write",
"generate-wee": "yarn workspace firefox-infobar-ui generate-wee && npm-run-all format",
"init-dotenv-config": "./init-dotenv-config.sh",
"lint": "npm-run-all lint:*",
"lint:eslint": "eslint . --ext jsm,js,json,ts,tsx",
"models:import": "./import-models.sh",
"prebuild:cross-browser-ui:chrome": "export TARGET_BROWSER=chrome UI=cross-browser-ui NODE_ENV=${NODE_ENV:-production}; npm-run-all init-dotenv-config clean generate-manifest",
"prebuild:cross-browser-ui:firefox": "export TARGET_BROWSER=firefox UI=cross-browser-ui NODE_ENV=${NODE_ENV:-production}; npm-run-all init-dotenv-config clean generate-manifest",
"prebuild:firefox-infobar-ui": "export TARGET_BROWSER=firefox UI=firefox-infobar-ui NODE_ENV=${NODE_ENV:-production}; npm-run-all init-dotenv-config clean generate-manifest",
"serve-locally-hosted-files": "http-serve test/locally-hosted-files/ --gzip",
"watch:cross-browser-ui:chrome": "export TARGET_BROWSER=chrome UI=cross-browser-ui NODE_ENV=development REMOTE_DEV_SERVER_PORT=8182; npm-run-all build:${UI}:${TARGET_BROWSER} && concurrently 'yarn workspace ${UI} webpack:watch:${TARGET_BROWSER}' 'web-ext run -t chromium' 'remotedev --port=8182' 'yarn serve-locally-hosted-files -p 4000'",
"watch:cross-browser-ui:firefox": "export TARGET_BROWSER=firefox UI=cross-browser-ui NODE_ENV=development REMOTE_DEV_SERVER_PORT=8181; npm-run-all build:${UI}:${TARGET_BROWSER} && concurrently 'yarn workspace ${UI} webpack:watch:${TARGET_BROWSER}' 'web-ext run' 'remotedev --port=8181' 'yarn serve-locally-hosted-files -p 4000'",
"watch:firefox-infobar-ui": "export TARGET_BROWSER=firefox UI=firefox-infobar-ui NODE_ENV=development REMOTE_DEV_SERVER_PORT=8183; npm-run-all build:${UI} && concurrently 'yarn workspace ${UI} webpack:watch' 'web-ext run' 'remotedev --port=8183' 'yarn serve-locally-hosted-files -p 4000'",
"web-ext-lint:cross-browser-ui:chrome": "export TARGET_BROWSER=chrome UI=cross-browser-ui; web-ext lint",
"web-ext-lint:cross-browser-ui:firefox": "export TARGET_BROWSER=firefox UI=cross-browser-ui; web-ext lint",
"web-ext-lint:firefox-infobar-ui": "export TARGET_BROWSER=firefox UI=firefox-infobar-ui; web-ext lint"
},
"workspaces": [
"src/core",
"src/cross-browser-ui",
"src/firefox-infobar-ui",
"docs"
]
}