4 Commits

Author SHA1 Message Date
82e7361567 Version 4.2.6 2019-11-26 13:13:09 +01:00
5c84493a0f build: cleanup stale bundles 2019-11-26 13:05:16 +01:00
83cb8e32f1 Update Readme.md 2019-11-25 19:14:51 +01:00
c49af54532 Remove compresslevel from build.py
Makes python3.6 choke
2019-11-25 19:08:33 +01:00
4 changed files with 42 additions and 9 deletions

View File

@ -31,28 +31,59 @@ If you would like to help out translating DTA, please see our [translation guide
## Development
### Requirements
You will want to `yarn` the development dependencies such as webpack first.
- [node](https://nodejs.org/en/)
- [yarn](https://yarnpkg.com/)
- [python3](https://www.python.org/) >= 3.6 (to build zips)
- [web-ext](https://www.npmjs.com/package/web-ext) (for development ease)
### Setup
Afterwards, you will want to run`yarn watch`.
You will want to run `yarn` to install the development dependencies such as webpack first.
### Making changes
Just use your favorite text editor to edit the files.
You will want to run`yarn watch`.
This will run the webpack bundler in watch mode, transpiling the TypeScript to Javascript and updating bundles as you change the source.
Please note: You have to run `yarn watch` (at least once) as it builds the actual script bundles.
Please note: You have to run `yarn watch` or `yarn build` (at least once) as it builds the actual script bundles.
### Firefox
### Running in Firefox
I recommend you install the [`web-ext`](https://www.npmjs.com/package/web-ext) tools from mozilla. It is not listed as a dependency by design at it causes problems with dependency resolution in yarn right now if installed in the same location as the rest of the dependencies.
If you did, then running `yarn webext` (additionally to `yarn watch`) will run the WebExtension in a development profile. This will use the directory `../dtalite.p` to keep a development profile. You might need to create this directory before you use this command. Furthermore `yarn webext` will watch for changes to the sources and automatically reload the extension.
Alternative, you can also `yarn build`, which then builds an *unsigned* zip that you can then install permanently in a browser that does not enforce signing (i.e. Nightly or the Unbranded Firefox with the right about:config preferences).
Alternatively, you can also `yarn build`, which then builds an *unsigned* zip that you can then install permanently in a browser that does not enforce signing (i.e. Nightly or the Unbranded Firefox with the right about:config preferences).
### Chrome
### Running in Chrome/Chromium/etc
You have to build the bundles first, of course.
Then put your Chrome into Developement Mode on the Extensions page, and Load Unpacked the directory of your downthemall clone.
### Making release zips
To get a basic unofficial set of zips for Firefox and chrome, run `yarn build`.
If you want to generate release builds like the ones that are eventually released in the extension stores, use `python3 util/build.py --mode=release`.
The output is located in `web-ext-artifacts`.
- `-fx.zip` are Firefox builds
- `-crx.zip` are Chrome/Chromium builds
- `-opr.zip` are Opera builds (essentially like the Chrome one, but without sounds)
### The AMO Editors tl;dr guide
1. Install the requirements.
2. `yarn && python3 build/util.py --mode=release`
3. Have a look in `web-ext-artifacts/dta-*-fx.zip`
### Patches
Before submitting patches, please make sure you run eslint (if this isn't done automatically in your text editor/IDE), and eslint does not report any open issues. Code contributions should favor typescript code over javascript code. External dependencies that would ship with the final product (including all npm/yarn packages) should be kept to a bare minimum and need justification.

View File

@ -1,7 +1,7 @@
{
"manifest_version": 2,
"name": "DownThemAll!",
"version": "4.2.5",
"version": "4.2.6",
"description": "__MSG_extensionDescription__",
"homepage_url": "https://downthemall.org/",

View File

@ -8,6 +8,7 @@
},
"scripts": {
"build": "util/build.py",
"build:cleanup": "rm -rf bundles",
"build:bundles": "webpack",
"build:regexps": "node util/makexregexps.js > data/xregexps.json",
"stats": "cloc --vcs=git --exclude-lang=Markdown,SVG",

View File

@ -32,6 +32,7 @@ PERM_IGNORED_FX = set(("downloads.shelf", "webRequest", "webRequestBlocking"))
PERM_IGNORED_CHROME = set(("menus", "sessions", "theme"))
SCRIPTS = [
"yarn build:cleanup",
"yarn build:regexps",
"yarn build:bundles",
]
@ -56,7 +57,7 @@ def files(additional_ignored):
yield file
def build(out, manifest, additional_ignored=set()):
with ZipFile(out, "w", compression=ZIP_DEFLATED, allowZip64=False, compresslevel=2) as zp:
with ZipFile(out, "w", compression=ZIP_DEFLATED, allowZip64=False) as zp:
for file in files(additional_ignored):
if str(file) == "manifest.json":
buf = manifest
@ -70,7 +71,7 @@ def build(out, manifest, additional_ignored=set()):
if file.suffix in UNCOMPRESSABLE:
zp.writestr(zinfo, buf, compress_type=ZIP_STORED)
else:
zp.writestr(zinfo, buf, compress_type=ZIP_DEFLATED, compresslevel=2)
zp.writestr(zinfo, buf, compress_type=ZIP_DEFLATED)
print(file)