Skip to content

Commit

Permalink
Add contributions folder for menus.json
Browse files Browse the repository at this point in the history
  • Loading branch information
lyonsil committed Feb 9, 2024
1 parent 59dd379 commit 12bb452
Show file tree
Hide file tree
Showing 4 changed files with 21 additions and 0 deletions.
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,7 @@ The general file structure is as follows:
- `*.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. It is copied into the build folder
- `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
- `dist/` is a generated folder containing the built extension files
- `release/` is a generated folder containing a zip of the built extension files
Expand Down
17 changes: 17 additions & 0 deletions contributions/menus.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
{
"mainMenu": {
"columns": {},
"groups": {},
"items": []
},
"defaultWebViewTopMenu": {
"columns": {},
"groups": {},
"items": []
},
"defaultWebViewContextMenu": {
"groups": {},
"items": []
},
"webViewMenus": {}
}
1 change: 1 addition & 0 deletions manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,5 +6,6 @@
"license": "MIT",
"main": "src/main.ts",
"types": "src/types/paranext-extension-template.d.ts",
"menus": "contributions/menus.json",
"activationEvents": []
}
2 changes: 2 additions & 0 deletions webpack/webpack.config.main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,8 @@ const configMain: webpack.Configuration = merge(configBase, {
{ from: 'public', to: './', noErrorOnMissing: true },
// We want all files from the assets folder copied into the output folder under assets
{ from: 'assets', to: './assets/', noErrorOnMissing: true },
// We want all files from the contributions folder copied into the output folder under contributions
{ from: 'contributions', to: './contributions/', noErrorOnMissing: true },
// Copy this extension's type declaration file into the output folder under src/types
{ from: 'src/types', to: './src/types', noErrorOnMissing: true },
// We need to distribute the package.json for Platform.Bible to read the extension properly
Expand Down

0 comments on commit 12bb452

Please sign in to comment.