Skip to content

Commit eda02e7

Browse files
feat: make Preferences link to docs site (#871)
Co-authored-by: Jessica Schilling <[email protected]> Co-authored-by: Marcin Rataj <[email protected]>
1 parent 793bd6c commit eda02e7

22 files changed

+248
-631
lines changed

CONTRIBUTING.md

+4-4
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ This repository falls under the IPFS [Code of Conduct](https://github.com/ipfs/c
1010

1111
### Creating New Issues
1212

13-
Do not hesitate and [create a new Issue](https://github.com/ipfs/ipfs-companion/issues/new) if you see a bug, room for improvement or simply have a question.
13+
Do not hesitate and [create a new Issue](https://github.com/ipfs/ipfs-companion/issues/new/choose) if you see a bug, room for improvement or simply have a question.
1414

1515
### Working on existing Issues
1616

@@ -19,7 +19,7 @@ As a courtesy, please add a comment informing about your intent. That way we wi
1919

2020
### Submitting Pull Requests
2121

22-
Just make sure your PR comes with its own tests and does pass [automated CI build](https://ci.ipfs.team/blue/organizations/jenkins/IPFS%20Shipyard%2Fipfs-companion/pr).
22+
Just make sure your PR comes with its own tests and does pass CI tests.
2323
See the [GitHub Flow Guide](https://guides.github.com/introduction/flow/) for details.
2424

2525

@@ -28,11 +28,11 @@ See the [GitHub Flow Guide](https://guides.github.com/introduction/flow/) for de
2828

2929
Go to Transifex and join [IPFS Companion Translation Project](https://www.transifex.com/ipfs/ipfs-companion/) :sparkles:
3030

31-
If you want to downoad translations from Transifex and run them locally, make sure to read [Localization Notes](docs/localization-notes.md) first.
31+
If you want to downoad translations from Transifex and run them locally, make sure to read [Localization Notes](LOCALIZATION-NOTES.md) first.
3232

3333
## Writing Code
3434

35-
**If you plan to write code make sure to read [Developer Notes](docs/developer-notes.md) to get familiar with tools and commands that will make your work easier.**
35+
**If you plan to write code make sure to read [Developer Notes](DEVELOPER-NOTES.md) to get familiar with tools and commands that will make your work easier.**
3636

3737
## How to Help with Things Beyond Browser Extension?
3838

DEVELOPER-NOTES.md

+174
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,174 @@
1+
# Developer notes for IPFS Companion
2+
3+
### Table of contents
4+
5+
* [Build from source](#build-from-source)
6+
* [Clone and install dependencies](#clone-and-install-dependencies)
7+
* [Build and run in Firefox](#build-and-run-in-firefox)
8+
* [Build and manually install in Chromium](#build-and-manually-install-in-chromium)
9+
* [Useful tasks](#useful-tasks)
10+
* [Other tips](#other-tips)
11+
* [Using IPFS Companion on Firefox for Android](#using-ipfs-companion-on-firefox-for-android)
12+
* [Install Firefox for Android](#install-firefox-for-android)
13+
* [Install IPFS Companion](#install-ipfs-companion)
14+
* [Hot-deploy over USB](#hot-deploy-over-usb)
15+
* [Debugging in Firefox for Android](#debugging-in-firefox-for-android)
16+
* [Further resources](#further-resources)
17+
18+
## Build from source
19+
20+
If you're looking to develop on IPFS Companion, you should build the project from source. You will need [NodeJS](https://nodejs.org/) and [Firefox](https://www.mozilla.org/en-US/firefox/developer/). Make sure `npm` and `firefox` are in your `PATH`.
21+
22+
You can use `yarn` instead of `npm`. We provide `yarn.lock` if you choose to do so. This guide assumes you are using `npm`.
23+
24+
### Clone and install dependencies
25+
26+
First, clone the `ipfs-shipyard/ipfs-companion` [repository](https://github.com/ipfs-shipyard/ipfs-companion):
27+
28+
```bash
29+
git clone https://github.com/ipfs-shipyard/ipfs-companion.git
30+
```
31+
32+
To install all dependencies into the `node_modules` directory, execute:
33+
34+
```bash
35+
npm install
36+
```
37+
38+
### Build and run in Firefox
39+
40+
Use this one-stop command to build, test and deploy the add-on to Firefox:
41+
42+
```bash
43+
npm start # all-in-one
44+
```
45+
46+
If you run into issues, you can run each step manually to pinpoint where the process is failing:
47+
48+
```bash
49+
npm run build # build runs bundle:firefox at the end, so manifest will be ok
50+
npm run test # test suite
51+
npm run firefox # spawn new Firefox
52+
```
53+
54+
It is also possible to load the extension manually. Enter `about:debugging` in the URL bar, and then click "Load Temporary Add-on" and point it at `add-on/manifest.json`.
55+
56+
### Build and manually install in Chromium
57+
58+
First, clone the repository:
59+
60+
```bash
61+
git clone https://github.com/ipfs-shipyard/ipfs-companion.git
62+
```
63+
64+
Then build it manually:
65+
66+
```bash
67+
npm run build bundle:chromium # last part is important: it overwrites manifest
68+
```
69+
70+
Then open `chrome://extensions` in your Chromium-based browser, enable "Developer mode", click "Load unpacked extension..." and point it at the `add-on` folder within your project folder.
71+
72+
| Chrome "unpacked extension" | Firefox "temporary add-on" |
73+
|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
74+
| ![installing ipfs-companion as an unpacked extension in chrome](https://bafybeih34e3a5sgkh57lwv26c6253fxn2jdvte6ilhyld6l4ghuhybzldi.ipfs.dweb.link/ipfs-companion-install-chrome-dev.gif) | ![installing ipfs-companion as a temporary add on in firefox](https://bafybeih34e3a5sgkh57lwv26c6253fxn2jdvte6ilhyld6l4ghuhybzldi.ipfs.dweb.link/ipfs-companion-install-firefox-dev.gif) |
75+
76+
77+
## Useful tasks
78+
79+
Each `npm` task can run separately, but most of the time, `dev-build`, `test`, and `fix:lint` are all you need.
80+
81+
- `npm install`: Install all NPM dependencies
82+
- `npm run build`: Build the add-on (copy external libraries, create `.zip` bundles for Chrome and Firefox)
83+
- `npm run bundle:chromium`: Overwrite manifest and package a generic, Chromium-compatible version
84+
- `npm run bundle:brave`: Overwrite manifest and package a Brave-compatible version requesting access to `chrome.sockets`
85+
- `npm run bundle:firefox`: Overwrite manifest and package a Firefox-compatible version
86+
- `npm run build:rename-artifacts`: Rename artifacts to include runtimes in filenames
87+
- `npm run ci`: Run tests and build (with frozen `yarn.lock`)
88+
- `npm test`: Run the entire test suite
89+
- `npm run lint`: Read-only check for potential syntax problems (run all linters)
90+
- `npm run fix:lint`: Try to fix simple syntax problems (run `standard` with `--fix`, etc.)
91+
- `npm run lint:standard`: Run [Standard](http://standardjs.com) linter ([IPFS JavaScript projects default to standard code style](https://github.com/ipfs/community/blob/master/CONTRIBUTING_JS.md))
92+
- `npm run lint:web-ext`: Run [addons-linter](https://github.com/mozilla/addons-linter) shipped with `web-ext` tool
93+
- `npm run firefox`: Run as temporary add-on in Firefox
94+
- `npm run chromium`: Run as temporary add-on in Chromium
95+
- `npm run get-firefox-nightly`: Fetch latest Firefox nightly build to `./firefox/`
96+
- `npm run firefox:beta:add -- --update-link "https://host/path/to/file.xpi" file.xpi`: Add a manifest entry for new self-hosted beta for Firefox
97+
98+
Release build shortcuts:
99+
100+
- `npm run dev-build`: All-in-one: fast dependency install, build with yarn (updates yarn.lock if needed)
101+
- `npm run beta-build`: Reproducible beta build in docker with frozen `yarn.lock`
102+
- `npm run release-build`: Reproducible release build in docker with frozen `yarn.lock`
103+
104+
## Other tips
105+
106+
- You can switch to an alternative Firefox version by overriding your `PATH`:
107+
108+
```bash
109+
export PATH="/path/to/alternative/version/of/firefox/:${PATH}"
110+
```
111+
112+
- [Using localization in IPFS Companion](LOCALIZATION-NOTES.md) (running browsers with specific locale, etc)
113+
- [Testing persistent and restart features (Mozilla)](https://developer.mozilla.org/en-US/Add-ons/WebExtensions/Testing_persistent_and_restart_features)
114+
115+
## Using IPFS Companion on Firefox for Android
116+
117+
Firefox for Android is capable of running some of the same extensions as the desktop version. This makes it very useful for experimenting with IPFS.
118+
119+
### Install Firefox for Android
120+
121+
All channels are available at the Google Play Store:
122+
123+
- [Latest stable](https://play.google.com/store/apps/details?id=org.mozilla.firefox&hl=en)
124+
- [Latest beta](https://play.google.com/store/apps/details?id=org.mozilla.firefox_beta)
125+
126+
### Install IPFS Companion
127+
128+
For full installation instructions, see [`README/#install`](https://github.com/ipfs-shipyard/ipfs-companion#install) in the IPFS Companion repo.
129+
130+
You can also test the latest code locally on an emulator, or via USB on your own device. See below for details.
131+
132+
### Hot-deploy over USB
133+
134+
To run your extension in [Firefox for Android](https://www.mozilla.org/en-US/firefox/mobile/), follow these instructions:
135+
136+
- [Set up your computer and Android emulator or device](https://developer.mozilla.org/en-US/docs/Mozilla/Add-ons/WebExtensions/Developing_WebExtensions_for_Firefox_for_Android#Set_up_your_computer_and_Android_emulator_or_device) (enable Developer Mode, USB debugging, etc.)
137+
138+
Build everything, and switch `add-on/manifest.json` to the Fennec profile:
139+
140+
```
141+
npm run dev-build
142+
npm run bundle:fennec
143+
```
144+
145+
Then, with your device connected to your development computer, run:
146+
147+
```
148+
web-ext run -s add-on --target=firefox-android
149+
```
150+
151+
It will list all connected devices with their IDs. If the list is empty, go back to the setup step and try again.
152+
153+
Next, deploy your extension to the specific device:
154+
155+
```
156+
web-ext run -s add-on --target=firefox-android --android-device=<device ID>
157+
```
158+
159+
The first time you run this command, there may be a popup on your Android device asking if you want to grant access over USB.
160+
161+
162+
### Debugging in Firefox for Android
163+
164+
The remote debug port will be printed to the console right after successful deployment:
165+
166+
```
167+
You can connect to this Android device on TCP port <debug PORT>
168+
```
169+
170+
The fastest way to connect is to open `chrome://devtools/content/framework/connect/connect.xhtml` in Firefox on the same machine you run `web-ext` from.
171+
172+
### Further resources
173+
174+
- [MDN: Developing extensions for Firefox for Android](https://developer.mozilla.org/en-US/Add-ons/WebExtensions/Developing_WebExtensions_for_Firefox_for_Android)

LOCALIZATION-NOTES.md

+47
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
# Localization in IPFS Companion
2+
3+
### Table of contents
4+
5+
* [Running Chrome with a specific locale](#running-chrome-with-a-specific-locale)
6+
* [Running Firefox with a specific locale](#running-firefox-with-a-specific-locale)
7+
* [Contributing translations](#contributing-translations)
8+
9+
IPFS Companion supports running in specific locales, with translations provided by the community via Transifex.
10+
11+
## Running Chrome with a specific locale
12+
13+
Chrome comes with locales out of the box, so it is enough to set the proper env:
14+
15+
```go
16+
LANGUAGE=pl chromium --user-data-dir=`mktemp -d`
17+
```
18+
19+
### Further resources
20+
21+
- [Language Codes in Chromium Project](https://src.chromium.org/viewvc/chrome/trunk/src/third_party/cld/languages/internal/languages.cc)
22+
23+
## Running Firefox with a specific locale
24+
25+
Unless you've installed a locale-specific build, Firefox will have English only. If your build already has the locale you are interested in, skip step #2.
26+
27+
1. Set `intl.locale.requested` in `about:config` or the command line via:
28+
29+
```bash
30+
web-ext run --pref intl.locale.requested=pl
31+
```
32+
33+
2. Install your language pack from https://addons.mozilla.org/firefox/language-tools/
34+
3. Reload the browser extension; it should detect your new locale
35+
36+
### Further resources
37+
38+
- [Mozilla: Use Firefox in another language](https://support.mozilla.org/en-US/kb/use-firefox-interface-other-languages-language-pack#w_how-to-change-the-language-of-the-user-interface)
39+
- [Mozilla: Locale Codes](https://wiki.mozilla.org/L10n:Locale_Codes)
40+
41+
## Contributing translations
42+
43+
Internationalization in IPFS Companion (and all IPFS-related projects) depends on the contributions of the community. You can give back by contributing translations in your language(s)! Go to the [IPFS Companion Transifex page](https://www.transifex.com/ipfs/ipfs-companion/), send a request to join a specific language team, and start translating. You can also download raw files from Transifex, translate them in your own editor/tool, and then upload them back there, but many people prefer using the simple and friendly Transifex GUI.
44+
45+
If your language is not present in `add-on/_locales` yet, but is supported by mainstream browsers, please create a [new issue](https://github.com/ipfs/ipfs-companion/issues/new) requesting it.
46+
47+
Don't worry if GitHub does not immediately reflect translations added at Transifex: New translations are merged manually before every release. Locale files at GitHub are often behind what is already translated at Transifex. It is a good idea to keep Transifex email notifications enabled to be notified about new strings to translate.

docs/privacy-policy.md renamed to PRIVACY-POLICY.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# **IPFS Companion Privacy Policy**
22

33
<em>First Posted: 2019-02-15<br/>
4-
Last Update: 2019-12-10</em> ([change history](https://github.com/ipfs-shipyard/ipfs-companion/commits/master/docs/privacy-policy.md))
4+
Last Update: 2020-05-08</em> ([change history](https://github.com/ipfs-shipyard/ipfs-companion/commits/master/PRIVACY-POLICY.md))
55

66
The IPFS Companion browser extension is owned by Protocol Labs Inc. and created
77
by the IPFS Project. We know you care about how your personal data is used and

README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -258,7 +258,7 @@ Feel free to modify it, but get familiar with [ABE rule syntax](https://noscript
258258

259259
## Privacy Policy
260260

261-
See [`docs/privacy-policy.md`](docs/privacy-policy.md)
261+
See [`PRIVACY-POLICY.md`](PRIVACY-POLICY.md)
262262

263263
## License
264264

add-on/src/options/forms/dnslink-form.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ function dnslinkForm ({
2525
<dt>${browser.i18n.getMessage('option_dnslinkPolicy_title')}</dt>
2626
<dd>
2727
${browser.i18n.getMessage('option_dnslinkPolicy_description')}
28-
<p><a href="https://github.com/ipfs-shipyard/ipfs-companion/blob/master/docs/dnslink.md#dnslink-support-in-ipfs-companion" target="_blank">
28+
<p><a href="https://docs-beta.ipfs.io/how-to/dnslink-companion/" target="_blank">
2929
${browser.i18n.getMessage('option_legend_readMore')}
3030
</a></p>
3131
</dd>
@@ -65,7 +65,7 @@ function dnslinkForm ({
6565
<dd>
6666
${browser.i18n.getMessage('option_dnslinkRedirect_description')}
6767
${dnslinkRedirect ? html`<p class="red i">${browser.i18n.getMessage('option_dnslinkRedirect_warning')}</p>` : null}
68-
<p><a href="https://github.com/ipfs-shipyard/ipfs-companion/issues/667" target="_blank">
68+
<p><a href="https://docs-beta.ipfs.io/how-to/address-ipfs-on-web/#subdomain-gateway" target="_blank">
6969
${browser.i18n.getMessage('option_legend_readMore')}
7070
</a></p>
7171
</dd>

add-on/src/options/forms/experiments-form.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ function experimentsForm ({
6969
<dl>
7070
<dt>${browser.i18n.getMessage('option_detectIpfsPathHeader_title')}</dt>
7171
<dd>${browser.i18n.getMessage('option_detectIpfsPathHeader_description')}
72-
<p><a href="https://github.com/ipfs-shipyard/ipfs-companion/blob/master/docs/x-ipfs-path-header.md#x-ipfs-path-header-support-in-ipfs-companion" target="_blank">
72+
<p><a href="https://docs-beta.ipfs.io/how-to/companion-x-ipfs-path-header/" target="_blank">
7373
${browser.i18n.getMessage('option_legend_readMore')}
7474
</a></p>
7575
</dd>
@@ -91,7 +91,7 @@ function experimentsForm ({
9191
</a>` : html`<del>${browser.i18n.getMessage('option_ipfsProxy_link_manage_permissions')}</del>`}
9292
</p>
9393
-->
94-
<p><a href="https://github.com/ipfs-shipyard/ipfs-companion/blob/master/docs/window.ipfs.md#%EF%B8%8F-windowipfs-is-disabled-for-now" target="_blank">
94+
<p><a href="https://docs-beta.ipfs.io/how-to/companion-window-ipfs/" target="_blank">
9595
${browser.i18n.getMessage('option_legend_readMore')}
9696
</a></p>
9797
</dd>

add-on/src/options/forms/file-import-form.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ function fileImportForm ({ importDir, openViaWebUI, preloadAtPublicGateway, onOp
1919
<dt>${browser.i18n.getMessage('option_importDir_title')}</dt>
2020
<dd>
2121
${browser.i18n.getMessage('option_importDir_description')}
22-
<p><a href="https://docs.ipfs.io/guides/concepts/mfs/" target="_blank">
22+
<p><a href="https://docs-beta.ipfs.io/concepts/file-systems/#mutable-file-system-mfs" target="_blank">
2323
${browser.i18n.getMessage('option_legend_readMore')}
2424
</a></p>
2525
</dd>

add-on/src/options/forms/gateways-form.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ function gatewaysForm ({
5959
<dt>${browser.i18n.getMessage('option_publicSubdomainGatewayUrl_title')}</dt>
6060
<dd>
6161
${browser.i18n.getMessage('option_publicSubdomainGatewayUrl_description')}
62-
<p><a href="https://docs.ipfs.io/guides/guides/addressing/#subdomain-gateway" target="_blank">
62+
<p><a href="https://docs-beta.ipfs.io/how-to/address-ipfs-on-web/#subdomain-gateway" target="_blank">
6363
${browser.i18n.getMessage('option_legend_readMore')}
6464
</a></p>
6565
</dd>
@@ -118,7 +118,7 @@ function gatewaysForm ({
118118
<dt>${browser.i18n.getMessage('option_useSubdomains_title')}</dt>
119119
<dd>
120120
${browser.i18n.getMessage('option_useSubdomains_description')}
121-
<p><a href="https://docs.ipfs.io/guides/guides/addressing/#subdomain-gateway" target="_blank">
121+
<p><a href="https://docs-beta.ipfs.io/how-to/address-ipfs-on-web/#subdomain-gateway" target="_blank">
122122
${browser.i18n.getMessage('option_legend_readMore')}
123123
</a></p>
124124
</dd>

add-on/src/options/forms/ipfs-node-form.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ function ipfsNodeForm ({ ipfsNodeType, ipfsNodeConfig, onOptionChange }) {
2020
<dd>
2121
<p>${browser.i18n.getMessage('option_ipfsNodeType_external_description')}</p>
2222
<p>${browser.i18n.getMessage(withChromeSockets ? 'option_ipfsNodeType_embedded_chromesockets_description' : 'option_ipfsNodeType_embedded_description')}</p>
23-
<p><a href="https://github.com/ipfs-shipyard/ipfs-companion/blob/master/docs/node-types.md#node-types-in-ipfs-companion" target="_blank">
23+
<p><a href="https://docs-beta.ipfs.io/how-to/companion-node-types/" target="_blank">
2424
${browser.i18n.getMessage('option_legend_readMore')}
2525
</a></p>
2626
</dd>

docs/README.md

+1-3
Original file line numberDiff line numberDiff line change
@@ -1,3 +1 @@
1-
# IPFS Companion
2-
3-
These pages are scheduled to be moved to [IPFS Docs](https://docs-beta.ipfs.io).
1+
Content present in this directory was moved to [IPFS Docs](https://docs-beta.ipfs.io).

docs/_config.yml

-1
This file was deleted.

0 commit comments

Comments
 (0)