diff --git a/packages/@interactjs/actions/plugin.ts b/packages/@interactjs/actions/plugin.ts index 2db78dbfa..f629535a9 100644 --- a/packages/@interactjs/actions/plugin.ts +++ b/packages/@interactjs/actions/plugin.ts @@ -1,9 +1,16 @@ import type { Scope } from '@interactjs/core/scope' +/* eslint-disable import/no-duplicates */ +import './drag/plugin' +import './drop/plugin' +import './gesture/plugin' +import './resize/plugin' + import drag from './drag/plugin' import drop from './drop/plugin' import gesture from './gesture/plugin' import resize from './resize/plugin' +/* eslint-enable import/no-duplicates */ export default { id: 'actions', diff --git a/packages/@interactjs/dev-tools/plugin.ts b/packages/@interactjs/dev-tools/plugin.ts index 5bd8d71b8..b426b4e1d 100644 --- a/packages/@interactjs/dev-tools/plugin.ts +++ b/packages/@interactjs/dev-tools/plugin.ts @@ -1,7 +1,10 @@ +// eslint-disable-next-line import/no-extraneous-dependencies, import/no-duplicates +import '@interactjs/dev-tools/visualizer/plugin' + import type Interaction from '@interactjs/core/Interaction' import type { Scope, Plugin } from '@interactjs/core/scope' import type { Element, OptionMethod } from '@interactjs/core/types' -// eslint-disable-next-line import/no-extraneous-dependencies +// eslint-disable-next-line import/no-extraneous-dependencies, import/no-duplicates import visualizer from '@interactjs/dev-tools/visualizer/plugin' import domObjects from '@interactjs/utils/domObjects' import { parentNode } from '@interactjs/utils/domUtils' diff --git a/scripts/addPluginIndexes.js b/scripts/addPluginIndexes.js index b10875946..44e57f18e 100644 --- a/scripts/addPluginIndexes.js +++ b/scripts/addPluginIndexes.js @@ -12,15 +12,17 @@ module.exports = (plugins) => { const dest = path.join(packagePath, path.dirname(path.relative(packagePath, pluginPath)), 'index.ts') const destDir = path.dirname(dest) + const pluginSpecifier = pluginPath.replace(/^packages./, '') + await mkdirp(destDir) await fs.writeFile( dest, [ - '/* eslint-disable import/order, no-console, eol-last */', + '/* eslint-disable no-console, eol-last, import/no-duplicates, import/no-extraneous-dependencies, import/order */', + `import '${pluginSpecifier}'`, "import interact from '@interactjs/interact/index'", - '// eslint-disable-next-line import/no-extraneous-dependencies', - `import plugin from '${pluginPath.replace(/^packages./, '')}'`, + `import plugin from '${pluginSpecifier}'`, 'interact.use(plugin)', ].join('\n'), )