From 5bb53481b04e61f6bb2cd62aae2950aceb2bb054 Mon Sep 17 00:00:00 2001 From: Alvis HT Tang Date: Mon, 5 Jun 2023 13:55:42 +0100 Subject: [PATCH] feat(types): separate types from presetter --- package.json | 3 +++ source/index.ts | 3 ++- source/rollup.ts | 8 +++----- spec/rollup.spec.ts | 2 +- 4 files changed, 9 insertions(+), 7 deletions(-) diff --git a/package.json b/package.json index 5ce4a44..26f327d 100644 --- a/package.json +++ b/package.json @@ -50,5 +50,8 @@ "presetter": "file:../presetter", "presetter-preset-strict": "file:../preset-strict", "type-fest": "^2.0.0" + }, + "dependencies": { + "presetter-types": "file:../types" } } diff --git a/source/index.ts b/source/index.ts index 518f271..18cb5ad 100644 --- a/source/index.ts +++ b/source/index.ts @@ -19,8 +19,9 @@ import { loadFile, template } from 'presetter'; import { getRollupParameter } from './rollup'; +import type { PresetAsset } from 'presetter-types'; + import type { RollupConfig } from './rollup'; -import type { PresetAsset } from 'presetter'; // paths to the template directory const TEMPLATES = resolve(__dirname, '..', 'templates'); diff --git a/source/rollup.ts b/source/rollup.ts index feca86e..03dad14 100644 --- a/source/rollup.ts +++ b/source/rollup.ts @@ -23,17 +23,15 @@ import { import { assertPluginManifest } from './plugin'; +import type { ApplyDirective, ImportDirective } from 'presetter'; +import type { ResolvedPresetContext } from 'presetter-types'; + import type { PluginConfiguration, PluginList, PluginManifest, PluginObject, } from './plugin'; -import type { - ApplyDirective, - ImportDirective, - ResolvedPresetContext, -} from 'presetter'; /** preset configuration for rollup */ export interface RollupConfig { diff --git a/spec/rollup.spec.ts b/spec/rollup.spec.ts index 44c5c9c..453df85 100644 --- a/spec/rollup.spec.ts +++ b/spec/rollup.spec.ts @@ -15,7 +15,7 @@ import { getRollupParameter } from '#rollup'; -import type { Config, ResolvedPresetContext } from 'presetter'; +import type { Config, ResolvedPresetContext } from 'presetter-types'; describe('fn:getRollupParameter', () => { const generateContext = (config?: Config): ResolvedPresetContext => ({