MCPcopy Index your code
hub / github.com/klembot/twinejs

github.com/klembot/twinejs @2.12.0 sqlite

repository ↗ · DeepWiki ↗ · release 2.12.0 ↗
1,013 symbols 3,674 edges 676 files 7 documented · 1%
README

twinejs

by Chris Klimas, Lorenzo Ancora, 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 browser and Electron app. See twinery.org for more info.

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

BUILDS

Binary packages for Twine are available on the Releases tab for Windows, MacOS and Linux. Community-created builds exist on other platforms, such as the Snap Store or Arch User Repository. As always, only install from sources you trust.

INSTALL

Run npm install at the top level of the directory to install all goodies.

Working with the documentation requires installing mdbook, which is not a Node-based project. You can either install it directly from the project web site or use your operating system's package manager.

BUILDING

Run npm start to begin serving a development version of Twine locally. This server will automatically update with changes you make.

Run npm run start:electron to run a development version of the Electron app. Running this can damage files in your Twine storied folder. Take a backup copy of this folder before proceeding. Most of the app will automatically update as you work, but if you want the app to read story files initially again, you will need to restart the process.

To create a release, run npm run build. Finished files will be found under dist/. In order to build Windows apps on macOS or Linux, you will need to have Wine and makensis 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.

The build process looks for these environment variables when notarizing a macOS build:

  • APPLE_APP_ID: The app ID to use. The convention is country.company.appname.
  • APPLE_ID: User name of the Apple account to use for notarization.
  • APPLE_ID_PASSWORD: App-specific password for the Apple account to use for notarization.
  • APPLE_TEAM_ID: ID of the Apple team account to use for notarization.

If any of these environment variables are not set, the build process will skip notarizing. This means users will need to right-click the application and open it manually.

You must have the full Xcode app installed to notarize the app, not just the Xcode command line tools.

npm test will test the source code respectively.

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

Extension points exported contracts — how you extend this code

ZoomTransition (Interface)
* Information about a single zoom transition.
src/routes/story-edit/use-zoom-transition.ts
ControlledProps (Interface)
(no doc)
src/__mocks__/react-codemirror2.tsx
MainContentProps (Interface)
(no doc)
src/components/container/main-content.tsx
StoryFile (Interface)
(no doc)
src/electron/main-process/story-file.ts
UsePublishingProps (Interface)
(no doc)
src/store/use-publishing.ts
BuildActionsProps (Interface)
(no doc)
src/route-actions/build-actions.tsx
CMPrefixTriggerOptions (Interface)
(no doc)
src/codemirror/prefix-trigger.ts
StoryFormatInspectorProps (Interface)
(no doc)
src/test-util/story-format-inspector.tsx

Core symbols most depended-on inside this repo

fakeStory
called by 323
src/test-util/fakes.ts
t
called by 246
src/__mocks__/react-i18next.ts
fakePassage
called by 167
src/test-util/fakes.ts
fakeLoadedStoryFormat
called by 111
src/test-util/fakes.ts
useTranslation
called by 77
src/__mocks__/react-i18next.ts
useStoriesContext
called by 57
src/store/stories/stories-context.tsx
fakePrefs
called by 41
src/test-util/fakes.ts
i
called by 40
public/story-formats/harlowe-3.3.9/format.js

Shape

Function 843
Interface 161
Method 5
Class 4

Languages

TypeScript100%

Modules by API surface

public/story-formats/harlowe-3.3.9/format.js62 symbols
src/store/stories/stories.types.ts15 symbols
src/test-util/fakes.ts10 symbols
src/store/stories/getters.ts10 symbols
src/util/geometry.ts9 symbols
src/electron/main-process/preload.ts9 symbols
src/electron/main-process/__tests__/story-file.test.ts9 symbols
src/__mocks__/electron.ts9 symbols
src/util/twee.ts8 symbols
src/util/parse-links.ts8 symbols
src/route-actions/build-actions.tsx8 symbols
src/dialogs/story-search.tsx8 symbols

Dependencies from manifests, versioned

@electron/notarize2.1.0 · 1×
@faker-js/faker8.4.1 · 1×
@lukeed/uuid2.0.1 · 1×
@playwright/test1.27.1 · 1×
@popperjs/core2.9.1 · 1×
@tabler/icons1.119.0 · 1×
@testing-library/dom9.3.1 · 1×
@testing-library/react11.1.0 · 1×
@testing-library/user-event12.1.10 · 1×
@types/classnames2.2.11 · 1×

For agents

$ claude mcp add twinejs \
  -- python -m otcore.mcp_server <graph>

⬇ download graph artifact