diff --git a/docs/writing-a-plugin.md b/docs/writing-a-plugin.md index 56651f06d..6acbcd7d2 100644 --- a/docs/writing-a-plugin.md +++ b/docs/writing-a-plugin.md @@ -175,7 +175,8 @@ usually they depend on `devDependencies`. However, some plugins target productio Here's an example from the latter: ```ts -export const PRODUCTION_ENTRY_FILE_PATTERNS = [ +/** @public */ +const PRODUCTION_ENTRY_FILE_PATTERNS = [ 'app/root.tsx', 'app/entry.{client,server}.{js,jsx,ts,tsx}', 'app/routes/**/*.{js,ts,tsx}', diff --git a/src/plugins/_template/index.ts b/src/plugins/_template/index.ts index 85cf2e24c..0fe5330dd 100644 --- a/src/plugins/_template/index.ts +++ b/src/plugins/_template/index.ts @@ -14,8 +14,10 @@ export const isEnabled: IsPluginEnabledCallback = ({ dependencies }) => hasDepen export const CONFIG_FILE_PATTERNS = []; +/** @public */ export const ENTRY_FILE_PATTERNS = []; +/** @public */ export const PRODUCTION_ENTRY_FILE_PATTERNS = []; export const PROJECT_FILE_PATTERNS = []; diff --git a/src/plugins/ava/index.ts b/src/plugins/ava/index.ts index d7d04d09c..c0ce5b25c 100644 --- a/src/plugins/ava/index.ts +++ b/src/plugins/ava/index.ts @@ -16,6 +16,7 @@ export const isEnabled: IsPluginEnabledCallback = ({ dependencies }) => hasDepen export const CONFIG_FILE_PATTERNS = ['ava.config.{js,cjs,mjs}', 'package.json']; +/** @public */ export const ENTRY_FILE_PATTERNS = [ `test.{js,cjs,mjs}`, `{src,source}/test.{js,cjs,mjs}`, diff --git a/src/plugins/cypress/index.ts b/src/plugins/cypress/index.ts index cb4abec00..fa407b650 100644 --- a/src/plugins/cypress/index.ts +++ b/src/plugins/cypress/index.ts @@ -11,6 +11,7 @@ export const ENABLERS = ['cypress']; export const isEnabled: IsPluginEnabledCallback = ({ dependencies }) => hasDependency(dependencies, ENABLERS); +/** @public */ export const ENTRY_FILE_PATTERNS = [ 'cypress.config.{js,ts,mjs,cjs}', 'cypress/support/e2e.{js,jsx,ts,tsx}', diff --git a/src/plugins/eslint/index.ts b/src/plugins/eslint/index.ts index 8f25f6cff..a3cb7b0ad 100644 --- a/src/plugins/eslint/index.ts +++ b/src/plugins/eslint/index.ts @@ -18,6 +18,7 @@ export const CONFIG_FILE_PATTERNS = ['.eslintrc', '.eslintrc.{js,json,cjs}', '.e // New: https://eslint.org/docs/latest/user-guide/configuring/configuration-files-new // We can handle eslint.config.js just like other source code (as dependencies are imported) +/** @public */ export const ENTRY_FILE_PATTERNS = ['eslint.config.js']; // Note: shareable configs should use `peerDependencies` for plugins diff --git a/src/plugins/gatsby/index.ts b/src/plugins/gatsby/index.ts index ad2d23fa7..a62286156 100644 --- a/src/plugins/gatsby/index.ts +++ b/src/plugins/gatsby/index.ts @@ -16,6 +16,7 @@ export const isEnabled: IsPluginEnabledCallback = ({ dependencies }) => hasDepen export const CONFIG_FILE_PATTERNS = ['gatsby-{config,node}.{js,jsx,ts,tsx}']; +/** @public */ export const PRODUCTION_ENTRY_FILE_PATTERNS = [ 'gatsby-{browser,ssr}.{js,jsx,ts,tsx}', 'src/api/**/*.{js,ts}', diff --git a/src/plugins/jest/index.ts b/src/plugins/jest/index.ts index 83d989f7d..871c5e7b1 100644 --- a/src/plugins/jest/index.ts +++ b/src/plugins/jest/index.ts @@ -21,6 +21,7 @@ export const isEnabled: IsPluginEnabledCallback = ({ dependencies, manifest }) = export const CONFIG_FILE_PATTERNS = ['jest.config.{js,ts,mjs,cjs,json}', 'package.json']; +/** @public */ export const ENTRY_FILE_PATTERNS = ['**/__tests__/**/*.[jt]s?(x)', '**/?(*.)+(spec|test).[jt]s?(x)']; const resolveExtensibleConfig = async (configFilePath: string) => { diff --git a/src/plugins/mocha/index.ts b/src/plugins/mocha/index.ts index 84e25d054..1fc96fd98 100644 --- a/src/plugins/mocha/index.ts +++ b/src/plugins/mocha/index.ts @@ -14,6 +14,7 @@ export const isEnabled: IsPluginEnabledCallback = ({ dependencies }) => hasDepen export const CONFIG_FILE_PATTERNS = ['.mocharc.{js,cjs,json,jsonc,yml,yaml}', 'package.json']; +/** @public */ export const ENTRY_FILE_PATTERNS = ['**/test/*.{js,cjs,mjs}']; const findMochaDependencies: GenericPluginCallback = async (configFilePath, { manifest, isProduction }) => { diff --git a/src/plugins/next/index.ts b/src/plugins/next/index.ts index 63cad6a9f..4f0875e95 100644 --- a/src/plugins/next/index.ts +++ b/src/plugins/next/index.ts @@ -11,6 +11,7 @@ export const ENABLERS = ['next']; export const isEnabled: IsPluginEnabledCallback = ({ dependencies }) => hasDependency(dependencies, ENABLERS); +/** @public */ export const ENTRY_FILE_PATTERNS = ['next.config.{js,ts,cjs,mjs}']; const productionEntryFilePatternsWithoutSrc = [ @@ -24,6 +25,7 @@ const productionEntryFilePatternsWithoutSrc = [ 'pages/**/*.{js,jsx,ts,tsx}', ]; +/** @public */ export const PRODUCTION_ENTRY_FILE_PATTERNS = [ ...productionEntryFilePatternsWithoutSrc, ...productionEntryFilePatternsWithoutSrc.map(pattern => `src/${pattern}`), diff --git a/src/plugins/node-test-runner/index.ts b/src/plugins/node-test-runner/index.ts index 6fdc4232d..d4f734a0c 100644 --- a/src/plugins/node-test-runner/index.ts +++ b/src/plugins/node-test-runner/index.ts @@ -14,6 +14,7 @@ export const isEnabled: IsPluginEnabledCallback = ({ manifest }) => { return Boolean(manifest.scripts?.test && /node.+--test/.test(manifest.scripts?.test)); }; +/** @public */ export const ENTRY_FILE_PATTERNS = [ '**/test.{js,cjs,mjs}', '**/test-*.{js,cjs,mjs}', diff --git a/src/plugins/playwright-ct/index.ts b/src/plugins/playwright-ct/index.ts index 84393d9c6..ed97e4441 100644 --- a/src/plugins/playwright-ct/index.ts +++ b/src/plugins/playwright-ct/index.ts @@ -15,6 +15,7 @@ export const isEnabled: IsPluginEnabledCallback = ({ dependencies }) => hasDepen export const CONFIG_FILE_PATTERNS = ['playwright-ct.config.{js,ts}', 'playwright/index.{js,ts,jsx,tsx}']; +/** @public */ export const ENTRY_FILE_PATTERNS = ['**/*.@(spec|test).?(c|m)[jt]s?(x)']; const findPlaywrightCTDependencies: GenericPluginCallback = async configFilePath => { diff --git a/src/plugins/playwright/index.ts b/src/plugins/playwright/index.ts index 1f95c70b9..b753b1596 100644 --- a/src/plugins/playwright/index.ts +++ b/src/plugins/playwright/index.ts @@ -13,6 +13,7 @@ export const ENABLERS = ['@playwright/test']; export const isEnabled: IsPluginEnabledCallback = ({ dependencies }) => hasDependency(dependencies, ENABLERS); +/** @public */ export const ENTRY_FILE_PATTERNS = ['**/*.@(spec|test).?(c|m)[jt]s?(x)']; export const CONFIG_FILE_PATTERNS = ['playwright.config.{js,ts}']; diff --git a/src/plugins/remix/index.ts b/src/plugins/remix/index.ts index 96c5c7853..9266150be 100644 --- a/src/plugins/remix/index.ts +++ b/src/plugins/remix/index.ts @@ -12,8 +12,10 @@ export const ENABLERS = [/^@remix-run\//]; export const isEnabled: IsPluginEnabledCallback = ({ dependencies }) => hasDependency(dependencies, ENABLERS); +/** @public */ export const ENTRY_FILE_PATTERNS = ['remix.config.js', 'remix.init/index.js']; +/** @public */ export const PRODUCTION_ENTRY_FILE_PATTERNS = [ 'app/root.tsx', 'app/entry.{client,server}.{js,jsx,ts,tsx}', diff --git a/src/plugins/rollup/index.ts b/src/plugins/rollup/index.ts index 6a34fa972..0201ee055 100644 --- a/src/plugins/rollup/index.ts +++ b/src/plugins/rollup/index.ts @@ -12,6 +12,7 @@ export const ENABLERS = ['rollup']; export const isEnabled: IsPluginEnabledCallback = ({ dependencies }) => hasDependency(dependencies, ENABLERS); +/** @public */ export const ENTRY_FILE_PATTERNS = ['rollup.config.{js,mjs,ts}']; const findRollupDependencies: GenericPluginCallback = async () => { diff --git a/src/plugins/sentry/index.ts b/src/plugins/sentry/index.ts index bd1bd67e7..1bc4ec41f 100644 --- a/src/plugins/sentry/index.ts +++ b/src/plugins/sentry/index.ts @@ -12,6 +12,7 @@ export const ENABLERS = [/^@sentry\//]; export const isEnabled: IsPluginEnabledCallback = ({ dependencies }) => hasDependency(dependencies, ENABLERS); +/** @public */ export const ENTRY_FILE_PATTERNS = ['sentry.{client,server,edge}.config.{js,ts}']; const findSentryDependencies: GenericPluginCallback = async () => { diff --git a/src/plugins/storybook/index.ts b/src/plugins/storybook/index.ts index fef563bac..71d1b8053 100644 --- a/src/plugins/storybook/index.ts +++ b/src/plugins/storybook/index.ts @@ -15,6 +15,7 @@ export const isEnabled: IsPluginEnabledCallback = ({ dependencies }) => hasDepen export const CONFIG_FILE_PATTERNS = ['.storybook/{main,manager,test-runner}.{js,ts}']; +/** @public */ export const ENTRY_FILE_PATTERNS = ['.storybook/preview.{js,jsx,ts,tsx}', '**/*.stories.{js,jsx,ts,tsx}']; export const PROJECT_FILE_PATTERNS = ['.storybook/**/*.{js,jsx,ts,tsx}']; diff --git a/src/plugins/svelte/index.ts b/src/plugins/svelte/index.ts index d88952b8e..6abb44cb9 100644 --- a/src/plugins/svelte/index.ts +++ b/src/plugins/svelte/index.ts @@ -12,8 +12,10 @@ export const ENABLERS = ['svelte']; export const isEnabled: IsPluginEnabledCallback = ({ dependencies }) => hasDependency(dependencies, ENABLERS); +/** @public */ export const ENTRY_FILE_PATTERNS = ['svelte.config.js', 'vite.config.ts']; +/** @public */ export const PRODUCTION_ENTRY_FILE_PATTERNS = [ 'src/routes/**/+{page,server,page.server,error,layout,layout.server}{,@*}.{js,ts,svelte}', ]; diff --git a/src/plugins/vitest/index.ts b/src/plugins/vitest/index.ts index 05ccc34bc..b6a152101 100644 --- a/src/plugins/vitest/index.ts +++ b/src/plugins/vitest/index.ts @@ -21,6 +21,7 @@ export const isEnabled: IsPluginEnabledCallback = ({ dependencies }) => hasDepen export const CONFIG_FILE_PATTERNS = ['vitest.config.ts', 'vitest.{workspace,projects}.{ts,js,json}']; +/** @public */ export const ENTRY_FILE_PATTERNS = ['**/*.{test,spec}.?(c|m)[jt]s?(x)']; export const findVitestDeps = (config: VitestConfig, options: GenericPluginCallbackOptions) => {