2018-01-19 05:29:12 +00:00
|
|
|
# Pinafore
|
2018-01-06 23:51:25 +00:00
|
|
|
|
2018-02-18 22:38:10 +00:00
|
|
|
An alternative web client for [Mastodon](https://joinmastodon.org]).
|
|
|
|
|
2018-03-11 19:55:46 +00:00
|
|
|
## Goals and non-goals
|
|
|
|
|
|
|
|
This section lays out some high-level goals for Pinafore, as well as the goals it _doesn't_ intend to tackle.
|
|
|
|
|
|
|
|
### Goals
|
|
|
|
|
|
|
|
- Support the most common use cases
|
|
|
|
- Fast even on low-end phones
|
|
|
|
- Works offline in read-only mode
|
|
|
|
- Progressive Web App features
|
|
|
|
- Multi-instance support
|
|
|
|
- Support latest versions of Chrome, Edge, Firefox, and Safari
|
|
|
|
- a11y (keyboard navigation, screen readers)
|
|
|
|
|
|
|
|
### Possible future goals
|
|
|
|
|
|
|
|
- Works as an alternative frontend self-hosted by instances
|
|
|
|
- Ship in the Android/iOS app stores as a Cordova app
|
|
|
|
- Support Pleroma/non-Mastodon backends
|
|
|
|
- i18n
|
2018-03-21 15:39:06 +00:00
|
|
|
- Offline search
|
2018-03-11 19:55:46 +00:00
|
|
|
|
|
|
|
### Non-goals
|
|
|
|
|
|
|
|
- Supporting old browsers, proxy browsers, or text-based browsers
|
|
|
|
- React Native / NativeScript / hybrid-native version
|
|
|
|
- Full functionality with JavaScript disabled
|
|
|
|
- Emoji support beyond the built-in system emoji
|
|
|
|
- Custom emoji keyboard
|
|
|
|
- Multi-column support
|
|
|
|
- Keyboard shortcuts
|
|
|
|
- Admin/moderation panel
|
|
|
|
- Works offline in read-write mode
|
|
|
|
|
2018-02-18 22:38:10 +00:00
|
|
|
## Building
|
|
|
|
|
|
|
|
npm install
|
|
|
|
npm run build
|
|
|
|
PORT=4002 npm start
|
|
|
|
|
2018-03-11 19:55:46 +00:00
|
|
|
Now it's running at `localhost:4002`.
|
|
|
|
|
2018-02-18 22:38:10 +00:00
|
|
|
## Development
|
|
|
|
|
|
|
|
npm run dev
|
|
|
|
|
2018-03-11 19:55:46 +00:00
|
|
|
Now it's running at `localhost:4002`.
|
|
|
|
|
2018-02-18 22:38:10 +00:00
|
|
|
## Testing in development mode
|
|
|
|
|
|
|
|
In separate terminals:
|
|
|
|
|
|
|
|
1\. Run a Mastodon dev server (note this destroys the `mastodon_development` database and inserts canned data):
|
|
|
|
|
|
|
|
npm run run-mastodon
|
|
|
|
|
|
|
|
2\. Run a Pinafore dev server:
|
|
|
|
|
|
|
|
npm run dev
|
|
|
|
|
2018-02-20 02:24:22 +00:00
|
|
|
3\. Run a debuggable TestCafé instance:
|
2018-02-18 22:38:10 +00:00
|
|
|
|
2018-02-20 02:36:54 +00:00
|
|
|
npx testcafe --hostname localhost --skip-js-errors --debug-mode firefox tests/spec
|
2018-02-18 22:38:10 +00:00
|
|
|
|
|
|
|
If you want to export the current data in the Mastodon instance as canned data, so that it can be loaded later:
|
|
|
|
|
|
|
|
npm run backup-mastodon-data
|
|
|
|
|
|
|
|
## Testing
|
|
|
|
|
|
|
|
Lint:
|
|
|
|
|
|
|
|
npm run lint
|
|
|
|
|
2018-02-20 02:24:22 +00:00
|
|
|
Run integration tests:
|
2018-02-18 22:38:10 +00:00
|
|
|
|
2018-02-20 02:25:59 +00:00
|
|
|
npm test
|
|
|
|
|
2018-02-20 02:36:54 +00:00
|
|
|
Run tests for a particular browser:
|
|
|
|
|
|
|
|
BROWSER=chrome npm run test-browser
|
|
|
|
BROWSER=chrome:headless npm run test-browser
|
|
|
|
BROWSER=firefox npm run test-browser
|
|
|
|
BROWSER=firefox:headless npm run test-browser
|
|
|
|
BROWSER=safari npm run test-browser
|
|
|
|
BROWSER=edge npm run test-browser
|
|
|
|
|
2018-02-20 02:25:59 +00:00
|
|
|
Automatically fix most linting issues:
|
|
|
|
|
2018-03-11 19:55:46 +00:00
|
|
|
npx standard --fix
|