Files
insomnia/packages/insomnia/scripts/verify-bundle-plugins.ts
T
Jack Kavanagh c62a114d28 Chore: eslint-autofixes (#9421)
* sort and remove a few

* autofix 1

* remove useless undefined

* fix types

* number seperators

* native coercion

* utf8

* explicit number

* dom node dataset

* explicit unused catch

* array find

* fix types

* prefer negative index

* from code point

* fix error layout

* prefer ternary

* explicit length

* useless case

* named functions

* utf8

* import style

* default parameters

* no instance of

* clone

* use regex test

* single call

* prettier

* fix types

* Revert "use regex test"

This reverts commit 8fb9e991fffa9e3a51ff75cdc29dad331ed2fb66.
2025-11-27 09:36:52 +00:00

29 lines
773 B
TypeScript

import { bundlePlugins } from '../config/config.json';
const isModuleInstalled = (moduleName: string) => {
try {
require.resolve(moduleName);
return true;
} catch {
return false;
}
};
export const verifyBundlePlugins = () => {
const executeInGithubActions = process.env.GITHUB_ACTIONS === 'true';
if (executeInGithubActions) {
console.log('[NPM Install] Verifying bundle plugins...');
const missingBundlePlugin = bundlePlugins.find(p => !isModuleInstalled(p.name));
if (missingBundlePlugin) {
// execute in Github Actions
console.error(
'[npm install] ERROR:',
`Required bundle plugin module ${missingBundlePlugin.name} is not installed.`,
);
process.exit(1);
}
}
};
verifyBundlePlugins();