Skip to content

Latest commit

 

History

History

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

README.md

fw-lite-extension

FieldWorks Lite packaged as an extension for Platform.Bible.

Summary

The general file structure is as follows:

  • package.json contains information about this extension's npm package. It is required for Platform.Bible to use the extension properly. It is copied into the build folder
  • manifest.json is the manifest file that defines the extension and important properties for Platform.Bible. It is copied into the build folder
  • src/ contains the source code for the extension
    • src/components/ contains stand-alone (i.e., WebView- and service-independent) components
    • src/main.ts is the main entry file for the extension
    • src/services/ contains services to be used with networkObjects.set() in src/main.ts
    • src/types/fw-lite-extension.d.ts is this extension's types file that defines how other extensions can use this extension through the papi. It is copied into the build folder
    • src/utils/ contains utility classes and functions
    • src/web-views/ contains WebView components to be used with registerWebViewProvider() in src/main.ts
      • *.web-view.tsx files will be treated as React WebViews
      • *.web-view.html files are a conventional way to provide HTML WebViews (no special functionality)
  • assets/ contains asset files the extension and its WebViews can retrieve using the papi-extension: protocol, as well as textual descriptions in various languages. It is copied into the build folder
    • assets/displayData.json contains (optionally) a path to the extension's icon file as well as text for the extension's display name, short summary, and path to the full description file
    • assets/descriptions/ contains textual descriptions of the extension in various languages
      • assets/descriptions/description-<locale>.md contains a brief description of the extension in the language specified by <locale>
  • contributions/ contains JSON files the platform uses to extend data structures for things like menus and settings. The JSON files are referenced from the manifest
  • public/ contains other static files that are copied into the build folder
  • webpack/ contains configs, scripts, and utils used by webpack.config.ts in the root folder
  • dist/ is a generated folder containing the built extension files
  • release/ is a generated folder containing a zip of the built extension files

See the Extension Anatomy wiki page for more information about the various files that comprise an extension and their relationships to each other.

To install

Configure paths to paranext-core repo

In order to interact with paranext-core, you must clone paranext-core in the same parent directory in which you cloned this repository so you do not have to reconfigure paths to paranext-core. For example, if you cloned this repository in C:\dev\LexBox\, you would clone paranext-core in C:\dev\paranext-core\.

Install dependencies:

  1. In the paranext-core repository, run npm install
  2. In this folder, run npm install to install local and published dependencies

To run

First, you must build FieldWorks Lite using the task defined in this folder:

task build-fw-lite-web

This is a normal production build, so changes to FwLite files will not be rebuilt automatically. If you want to do FwLite development, look at README.md

Running Platform.Bible with this extension

Warning: you must not use pnpm, only npm.

To run Platform.Bible with this extension:

npm start

Note: The built extension will be in the dist folder. In order for Platform.Bible to run this extension, you must provide the directory to this built extension to Platform.Bible via a command-line argument. This command-line argument is already provided in this package.json's start script. If you want to start Platform.Bible and use this extension any other way, you must provide this command-line argument or put the dist folder into Platform.Bible's extensions folder.

Building this extension independently

To watch extension files (in src) for changes:

npm run watch

To build the extension once:

npm run build