From 851e83c082aeb1b8f816a9233eaf210b59173c81 Mon Sep 17 00:00:00 2001 From: Jolie Rabideau Date: Thu, 9 Nov 2023 12:45:54 -0500 Subject: [PATCH 1/2] update import from papi-backend, and add papi-frontend/react to webpack externals --- src/main.ts | 4 +--- webpack/webpack.config.base.ts | 1 + 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/src/main.ts b/src/main.ts index 2a9499c..5b24402 100644 --- a/src/main.ts +++ b/src/main.ts @@ -1,6 +1,4 @@ -import papi from 'papi-backend'; - -const { logger } = papi; +import { logger } from 'papi-backend'; export async function activate() { logger.info('Extension template is activating!'); diff --git a/webpack/webpack.config.base.ts b/webpack/webpack.config.base.ts index 68122da..3e4e06a 100644 --- a/webpack/webpack.config.base.ts +++ b/webpack/webpack.config.base.ts @@ -44,6 +44,7 @@ const configBase: webpack.Configuration = { 'react-dom', 'react-dom/client', 'papi-frontend', + 'papi-frontend/react', 'papi-backend', '@sillsdev/scripture', ], From 958632527870f4a661774169f0274eb5d1070cab Mon Sep 17 00:00:00 2001 From: tjcouch-sil Date: Thu, 30 Nov 2023 18:56:59 -0600 Subject: [PATCH 2/2] Added cache/extension-types to typeRoots for easy sharing extension types --- tsconfig.json | 22 ++++++++++++++++++++-- 1 file changed, 20 insertions(+), 2 deletions(-) diff --git a/tsconfig.json b/tsconfig.json index 5f73ea1..5a78f8a 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -26,11 +26,29 @@ "node_modules/@types", // Include papi-dts type declarations (for papi.d.ts) "../paranext-core/lib", - // Include other extensions' type declarations + // Include core extensions' type declarations "../paranext-core/extensions/src", // Include this extension's type declarations. It's in this location so there aren't any // unexpected files there for typeRoots to include - "src/types" + "src/types", + + /** + * Add extension repos' `src/types` folders here if you want to use local development type + * declarations. These will override the cached extension type declarations included in + * final entry in this array. Note that running extensions' local development type + * declaration files get copied into the cached extension type declarations while running + * Platform.Bible in development, but adding extension repos' `src/types` folders here means + * the local development type declarations will always be up-to-date instead of only when + * Platform.Bible is running in development. + * + * @example Adding `"../paranext-extension-word-list/src/types",` includes the local version + * of the Word List extension's type declarations. Then, your extension can use types from the + * local build of the Word List extension. + */ + + // Include cached extension type declarations in case this extension needs to depend on them + // These are last, so any modules in the above typeRoots take precedence. + "../paranext-core/dev-appdata/cache/extension-types" ], // Papi exposes decorators for use in classes "experimentalDecorators": true,