Skip to content

Commit

Permalink
Merge branch 'develop'
Browse files Browse the repository at this point in the history
  • Loading branch information
Chris Klimas committed Dec 15, 2018
2 parents 2bdc659 + 91862a0 commit 9440163
Show file tree
Hide file tree
Showing 87 changed files with 24,497 additions and 16,331 deletions.
19 changes: 7 additions & 12 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -1,16 +1,11 @@
# Contributing

Please give [Chris a holler on Bitbucket](https://bitbucket.org/klembot) if you
Please [open a GitHub issue](https://github.com/klembot/twinejs/issues) if you
have a feature you would like to add or a change you'd like to make to existing
functionality, so we can come to agreement on the change itself before you
spend time writing code. Bugfixes don't require discussion, though -- we can
hash things out in the comments of your pull request as needed.
functionality, so we can come to agreement on the change itself before you spend
time writing code. Bugfixes don't require discussion, though. We can hash things
out in the comments of your pull request as needed.

Pull requests should be accompanied by [Selenium IDE
tests](http://docs.seleniumhq.org/projects/ide/) where possible; there are some
things related to uploaded or downloaded files that Selenium isn't able to
test. If you're adding a new JavaScript file, please make sure it has ["use
strict";]() at the top, and passes the `grunt jslint` task, and that methods
and classes are documented properly (we use
[YUIDoc](https://yui.github.io/yuidoc/syntax/) -- use `grunt doc` to regenerate
documentation).
Pull requests adding code should be accompanied by [Jest unit
tests](https://jestjs.io/) where possible. Your code should also pass the `npm
run lint` task.
80 changes: 36 additions & 44 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,27 +1,20 @@
twinejs
-------
## twinejs

by Chris Klimas, Leon Arnott, Daithi O Crualaoich, Ingrid Cheung, Thomas Michael
Edwards, Micah Fitch, Juhana Leinonen, Michael Savich, and Ross Smith

### SYNOPSIS

This is a port of Twine to a local browser-based app. See
This is a port of Twine to a browser and Electron app. See
[twinery.org](https://twinery.org) for more info.

The story formats in minified format under `story-formats/` exist in separate
repositories:

* [Harlowe](https://bitbucket.org/_L_/harlowe)
* [Paperthin](https://github.com/klembot/paperthin)
* [Snowman](https://github.com/klembot/snowman)
* [SugarCube](https://bitbucket.org/tmedwards/sugarcube)

### A NOTE ABOUT YARN

Any time you read `npm` below, you can also use `yarn` ([more
information](https://yarnpkg.com/)). Using `yarn` is a little more foolproof, as
it ensures that everyone is using the exact same version of dependencies.
- [Harlowe](https://bitbucket.org/_L_/harlowe)
- [Paperthin](https://github.com/klembot/paperthin)
- [Snowman](https://github.com/klembot/snowman)
- [SugarCube](https://bitbucket.org/tmedwards/sugarcube)

### INSTALL

Expand All @@ -31,23 +24,22 @@ Run `npm install` at the top level of the directory to install all goodies.

Run `npm start` to begin serving a development version of Twine to
http://localhost:8080. This server will automatically update with changes you
make. You can also create a dev build at `build/` with `npm run build`.
make.

To create a release, run `npm run build`. Finished files will be found under
`dist/`. In order to build Windows apps on OS X or Linux, you will need to have
[Wine](https://www.winehq.org/) and [makensis](http://nsis.sourceforge.net/)
installed. A file named `2.json` is created under `dist/` which contains
information relevant to the autoupdater process, and is currently posted to
https://twinery.org/latestversion/2.json.

To run the app in an Electron context, run `npm run electron`. `npm run electron-dev` is a bit faster as it skips minification.

`npm run lint` and `npm test` will lint and test the source code respectively.

`npm run pot` will create a POT template file for localization at
`src/locale/po/template.pot`. See Localization below for more information.

`npm run nw` will build NW.js-based apps in `dist/nw`. In order to build Windows
apps on OS X or Linux, you will need to have [Wine](https://www.winehq.org/)
and [makensis](http://nsis.sourceforge.net/) installed.

To build distributable versions of Twine, use `npm run package`. This will
create ZIP archives and Windows installer packages under `dist/uploads`. An
additional file named `2.json` is created under `dist/`. This contains
information relevant to the autoupdater process, and is currently posted to
http://twinery.org/latestversion/2.json.

`npm run clean` will delete existing files in `build/` and `dist/`.

### LOCALIZATION
Expand All @@ -56,27 +48,27 @@ Would you like to help localize Twine for another language? Awesome! You don't
need to know JavaScript to do so. Here's how it works:

1. Download
[template.pot](https://bitbucket.org/klembot/twinejs/raw/4b64592fd47dd6678d9d0ebb0f07067f1bfaeabb/locale/po/template.pot)
from the repository.
[template.pot](https://github.com/klembot/twinejs/blob/master/src/locale/po/template.pot)
from the repository.

2. Use a translation application like [Poedit](http://poedit.net/) to create a
.po file with the source text translated. If you are using Poedit, get started
by choosing **New from POT/PO File** from the **File** menu. Make sure to name
your po file according to the [IETF locale naming
convention](https://en.wikipedia.org/wiki/IETF_language_tag) -- Poedit can help
suggest that as well. For example, a generic French translation should be named
`fr.po`, while an Australian English one would be named `en-au.po`.
.po file with the source text translated. If you are using Poedit, get started
by choosing **New from POT/PO File** from the **File** menu. Make sure to name
your po file according to the [IETF locale naming
convention](https://en.wikipedia.org/wiki/IETF_language_tag) -- Poedit can help
suggest that as well. For example, a generic French translation should be named
`fr.po`, while an Australian English one would be named `en-au.po`.

3. Finally, two other things are needed: an SVG-formatted image of the flag
that should be associated with your language, and what native speakers call the
language you are localizing to (e.g. Français for French speakers).
[Wikimedia
Commons](https://commons.wikimedia.org/wiki/Category:SVG_flags_by_country) is
your best bet for nice-looking SVG flags. Obviously, whatever image you provide
must either be in the public domain or otherwise OK to use in Twine without any
compensation.

4. If you're comfortable using Mercurial, then you can open a pull request to
have your localization added. Please place it in the `src/locale/po` directory. If
you aren't, you can instead open a bug tracker issue and attach your PO file,
flag image, and language name and we'll take it from there.
that should be associated with your language, and what native speakers call the
language you are localizing to (e.g. Français for French speakers).
[Wikimedia
Commons](https://commons.wikimedia.org/wiki/Category:SVG_flags_by_country) is
your best bet for nice-looking SVG flags. Obviously, whatever image you provide
must either be in the public domain or otherwise OK to use in Twine without any
compensation.

4. If you're comfortable using Git, then you can open a pull request to have
your localization added. Please place it in the `src/locale/po` directory. If
you aren't, you can instead open a bug tracker issue and attach your PO file,
flag image, and language name and we'll take it from there.
19 changes: 19 additions & 0 deletions electron-builder.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
{
"directories": {"output": "dist/electron"},
"forceCodeSigning": false,
"linux": {
"target": "zip"
},
"mac": {
"icon": "icons/app.icns",
"target": "dmg"
},
"nsis": {
"oneClick": false,
"allowToChangeInstallationDirectory": true
},
"win": {
"icon": "icons/app.ico",
"target": "nsis"
}
}
File renamed without changes.
Binary file added icons/app.ico
Binary file not shown.
File renamed without changes
6 changes: 6 additions & 0 deletions jest.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
module.exports = {
moduleNameMapper: {
'\\.html$': 'identity-obj-proxy',
'\\.less$': 'identity-obj-proxy'
}
};
Loading

0 comments on commit 9440163

Please sign in to comment.