- Download Node.js for your platform.
- Ensure you have the
npm
command available. Test this withnpm --version
. - Install
gulp
globally:npm install -g gulp
. - Install the EditorConfig plugin for your favourite editor. We use this to enforce some style rules not covered by code linting.
- Make a clone of the project, or update an existing copy.
- Install project dependencies with
npm install
.
Serving extensions and themes locally is useful for rapid development without requiring the use of the XKit Editor, but some initial set up is required:
- Run
gulp server
to start the resource server. This task will automatically build the extension and theme files from source before the server starts. Seegulp server
for more information. - Navigate to
https://localhost:31337
and create a security exception for thelocalhost
domain. The project uses self-signed SSL/TLS certificates that are untrusted by default in order to work around mixed-content warnings for websites like Tumblr that are served over HTTPS. - Change the relevant line with the URL string in
xkit.js
tohttps://localhost:31337/Extensions/dist/
to point XKit atlocalhost
.
- Note: Ensure the above URL is copied exactly. Malformed URLs will result in XKit falling back to the old servers.
- Build the XKit extension from source with
gulp build:PLATFORM
, wherePLATFORM
is one of the supported platforms. Seegulp build
for more information. - Reload the XKit extension in the browser under test:
- Chrome: simply reload the unpacked extension
- Firefox: remove any previous versions of XKit used for development and re-install it from the
.xpi
file inbuild/firefox/
- Open the XKit settings menu and navigate to Other > Update All and click "Update all my extensions".
Note: changes to extension and theme files are not automatically propagated to the XKit extension in the browser. Each time changes are made, XKit must be force-updated through "Update all my extensions" before the changes will be reflected.
The default task.
See also: gulp lint
.
Watches filesystem and lints files on change.
See also: gulp lint:scripts
, gulp lint:css
.
Top-level cleaning task.
See also: gulp clean:build
.
Cleans the build/
directory, deleting it and any subfolders.
Cleans the node_modules/
directory, deleting it and any subfolders.
Cleans the build/chrome/
directory, deleting the previous build for Chrome.
Cleans the build/firefox/
directory, deleting the previous build for Firefox.
Cleans the build/safari.safariextension/
directory, deleting the previous build for Safari.
Top-level linting task.
See also gulp lint:scripts
, gulp lint:css
.
Lints JavaScript files using JSHint and JSCS, and reports the output.
Lints CSS files using CSSLint and reports the output.
Top-level build task.
See also: gulp build:chrome
, gulp build:firefox
, gulp build:safari
.
Builds the Chrome browser extension from source and outputs it to build/chrome/
. Also creates an archive, new-xkit-x.x.x.zip
, and outputs it to build/chrome/
.
Builds the Chrome browser extension from source and outputs it to build/chrome/
.
See also: gulp build
, gulp build:chrome
, gulp compress:chrome
.
Creates an archive, new-xkit-x.x.x.zip
, from an existing Chrome source build and outputs it to build/chrome/
.
See also: gulp build
, gulp build:chrome
, gulp copy:chrome
.
Builds the Firefox browser extension from source and outputs it to build/firefox/
. Also creates a Cross-platform Installer Module, @new-xkit-x.x.x.xpi
, and outputs it to build/firefox/
.
See also: gulp compress:firefox
, gulp copy:firefox
.
Builds the Firefox browser extension from source and outputs it to build/firefox/
.
See also: gulp build
, gulp build:firefox
, gulp compress:firefox
.
Creates a Cross-platform Installer Module, @new-xkit-x.x.x.xpi
, from an existing Firefox source build and outputs it to build/firefox/
.
See also: gulp build
, gulp build:firefox
, gulp copy:firefox
.
Builds the Safari browser extension from source and outputs it to build/safari.safariextension/
.
See also: gulp copy:safari
.
Builds the Safari browser extension from source and outputs it to build/safari.safariextension/
.
See also: gulp build
, gulp build:safari
.
Builds the extension distribution from source, including the JSON-ified extension files, list.json
, and gallery.json
.
See also: gulp lint:scripts
.
Builds the themes distribution from source, including themes.json
.
See also: gulp lint:css
.
Serve extension and theme files locally.
See also: gulp build:extensions
, gulp build:themes
.