Skip to content

Commit

Permalink
types: expose SchemaOrgPluginOptions
Browse files Browse the repository at this point in the history
  • Loading branch information
harlan-zw committed Aug 26, 2022
1 parent 2816003 commit 4054568
Show file tree
Hide file tree
Showing 6 changed files with 24 additions and 22 deletions.
2 changes: 1 addition & 1 deletion packages/schema-org/src/plugins/alias.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import { dirname, relative, resolve } from 'pathe'
import { readTSConfig, resolveTSConfig, writeTSConfig } from 'pkg-types'
import { createFilter } from '@rollup/pluginutils'
import { AliasRuntime, PkgName } from '../'
import type { SchemaOrgPluginOptions } from './types'
import type { SchemaOrgPluginOptions } from '../types'

interface AliasPaths {
pkg: string
Expand Down
2 changes: 1 addition & 1 deletion packages/schema-org/src/plugins/remove-use-schema.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import { createFilter } from '@rollup/pluginutils'
import type { Transformer } from 'unplugin-ast'
import { transform } from 'unplugin-ast'
import type { CallExpression } from '@babel/types'
import type { SchemaOrgPluginOptions } from './types'
import type { SchemaOrgPluginOptions } from '../types'

export const RemoveFunctions = (functionNames: string[]): Transformer<CallExpression> => ({
onNode: node =>
Expand Down
18 changes: 0 additions & 18 deletions packages/schema-org/src/plugins/types.ts

This file was deleted.

2 changes: 1 addition & 1 deletion packages/schema-org/src/plugins/vite.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import type { SchemaOrgPluginOptions } from '../types'
import AliasRuntimePlugin from './alias'
import type { SchemaOrgPluginOptions } from './types'
import RemoveUseSchemaPlugin from './remove-use-schema'

export default (args: SchemaOrgPluginOptions = {}) => {
Expand Down
2 changes: 1 addition & 1 deletion packages/schema-org/src/plugins/webpack.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import type { SchemaOrgPluginOptions } from '../types'
import AliasRuntimePlugin from './alias'
import RemoveUseSchemaPlugin from './remove-use-schema'
import type { SchemaOrgPluginOptions } from './types'

export default (args: SchemaOrgPluginOptions = {}) => {
const plugins = [
Expand Down
20 changes: 20 additions & 0 deletions packages/schema-org/src/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -90,3 +90,23 @@ export interface UserConfig {
*/
debug?: boolean
}

export interface SchemaOrgPluginOptions {
/**
* Root directory
*/
root?: string
/**
* Whether the tsconfig.json should be updated with the aliases.
*/
dts?: boolean
/**
* Should the runtime be swapped out with a mock one, used for SSR-only mode.
*/
mock?: boolean
/**
* Whether to use schema-dts types on define functions.
*/
full?: boolean
}

0 comments on commit 4054568

Please sign in to comment.