This PR checks and validates at build time that the extensions and their dependencies are loaded correctly. If there are some missing or disabled dependencies, then we will crash the app with a descriptive error message.
[x] Write tests
[x] Clean up code (e.g. remove the 2nd sample extension)
How to test-drive the PR
The typescript-minimal project installs 2 sample extensions. The 2nd sample extension depends on the 1st one. Let's see what happens if the dependency is disabled/deleted.
Revert the last commit to bring back the sample extensions.
npm ci at the monorepo root
Tweak the extensions config found in typescript-minimal's package.json, such that the 1st sample extension is disabled or deleted.
Then try running npm start or npm run build and you'll see the results as follows:
npm start
> typescript-minimal@4.0.0-dev start
> pwa-kit-dev start
info: Validating app extensions...
error: Extension(s) missing or disabled: @salesforce/extension-sample, as required by @salesforce/extension-sample-2
error: Please double-check your configuration.
npm run build
> typescript-minimal@4.0.0-dev build
> pwa-kit-dev build
info: Validating app extensions...
error: Extension(s) missing or disabled: @salesforce/extension-sample, as required by @salesforce/extension-sample-2
error: Please double-check your configuration.
This PR checks and validates at build time that the extensions and their dependencies are loaded correctly. If there are some missing or disabled dependencies, then we will crash the app with a descriptive error message.
How to test-drive the PR
The typescript-minimal project installs 2 sample extensions. The 2nd sample extension depends on the 1st one. Let's see what happens if the dependency is disabled/deleted.
npm ci
at the monorepo rootpackage.json
, such that the 1st sample extension is disabled or deleted.npm start
ornpm run build
and you'll see the results as follows: