Skip to content

Commit d6bdff8

Browse files
committed
refactor: move src types folder
1 parent dd39e7e commit d6bdff8

File tree

99 files changed

+130
-131
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

99 files changed

+130
-131
lines changed

.github/CONTRIBUTING.md

+3-3

api-extractor.tsconfig.json

+2-1
Original file line numberDiff line numberDiff line change
@@ -28,8 +28,9 @@
2828
"web/*": ["src/platforms/web/*"],
2929
"v3": ["src/v3/index"],
3030
"v3/*": ["src/v3/*"],
31+
"types/*": ["src/types/*"],
3132
"vue": ["src/platforms/web/entry-runtime-with-compiler"]
3233
}
3334
},
34-
"include": ["src", "typescript"]
35+
"include": ["src"]
3536
}

packages/server-renderer/src/create-basic-renderer.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import { createWriteFunction } from './write'
22
import { createRenderFunction } from './render'
33
import type { RenderOptions } from './create-renderer'
4-
import type { Component } from 'typescript/component'
4+
import type { Component } from 'types/component'
55

66
export function createBasicRenderer({
77
modules = [],

packages/server-renderer/src/create-renderer.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ import { createRenderFunction } from './render'
44
import { createPromiseCallback } from './util'
55
import TemplateRenderer from './template-renderer/index'
66
import type { ClientManifest } from './template-renderer/index'
7-
import type { Component } from 'typescript/component'
7+
import type { Component } from 'types/component'
88
import VNode from 'core/vdom/vnode'
99
import { Readable } from 'stream'
1010

packages/server-renderer/src/optimizing-compiler/codegen.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ import {
2323
import { escape } from 'web/server/util'
2424
import { optimizability } from './optimizer'
2525
import type { CodegenResult } from 'compiler/codegen/index'
26-
import { ASTElement, ASTNode, CompilerOptions } from 'typescript/compiler'
26+
import { ASTElement, ASTNode, CompilerOptions } from 'types/compiler'
2727

2828
export type StringSegment = {
2929
type: number

packages/server-renderer/src/optimizing-compiler/index.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ import { parse } from 'compiler/parser/index'
22
import { generate } from './codegen'
33
import { optimize } from './optimizer'
44
import { createCompilerCreator } from 'compiler/create-compiler'
5-
import { CompiledResult, CompilerOptions } from 'typescript/compiler'
5+
import { CompiledResult, CompilerOptions } from 'types/compiler'
66

77
export const createCompiler = createCompilerCreator(function baseCompile(
88
template: string,

packages/server-renderer/src/optimizing-compiler/modules.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ import { isBooleanAttr, isEnumeratedAttr } from 'web/util/attrs'
1010

1111
import type { StringSegment } from './codegen'
1212
import type { CodegenState } from 'compiler/codegen/index'
13-
import { ASTAttr, ASTElement } from 'typescript/compiler'
13+
import { ASTAttr, ASTElement } from 'types/compiler'
1414

1515
const plainStringRE = /^"(?:[^"\\]|\\.)*"$|^'(?:[^'\\]|\\.)*'$/
1616

packages/server-renderer/src/optimizing-compiler/optimizer.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
*/
1010

1111
import { no, makeMap, isBuiltInTag } from 'shared/util'
12-
import { ASTElement, ASTNode, CompilerOptions } from 'typescript/compiler'
12+
import { ASTElement, ASTNode, CompilerOptions } from 'types/compiler'
1313

1414
// optimizability constants
1515
export const optimizability = {

packages/server-renderer/src/optimizing-compiler/runtime-helpers.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ import {
1111
} from 'core/vdom/helpers/normalize-children'
1212

1313
import { propsToAttrMap, isRenderableAttr } from 'web/server/util'
14-
import type { Component } from 'typescript/component'
14+
import type { Component } from 'types/component'
1515

1616
const ssrHelpers = {
1717
_ssrEscape: escape,

packages/server-renderer/src/render-context.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import VNode from 'core/vdom/vnode'
22
import { isUndef } from 'shared/util'
3-
import { Component } from 'typescript/component'
3+
import { Component } from 'types/component'
44

55
type RenderState =
66
| {

packages/server-renderer/src/render.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,8 @@ import {
1313
createComponentInstanceForVnode
1414
} from 'core/vdom/create-component'
1515
import VNode from 'core/vdom/vnode'
16-
import type { VNodeDirective } from 'typescript/vnode'
17-
import type { Component } from 'typescript/component'
16+
import type { VNodeDirective } from 'types/vnode'
17+
import type { Component } from 'types/component'
1818

1919
let warned = Object.create(null)
2020
const warnOnce = msg => {

packages/server-renderer/tsconfig.json

+2-2
Original file line numberDiff line numberDiff line change
@@ -29,9 +29,9 @@
2929
"web/*": ["../../src/platforms/web/*"],
3030
"v3": ["../../src/v3/index"],
3131
"v3/*": ["../../src/v3/*"],
32-
"typescript/*": ["../../typescript/*"],
32+
"types/*": ["../../src/types/*"],
3333
"vue": ["../../src/platforms/web/entry-runtime-with-compiler"]
3434
}
3535
},
36-
"include": ["../../src", "../../typescript", "../../test/test-env.d.ts", "."]
36+
"include": ["../../src", "../../test/test-env.d.ts", "."]
3737
}

src/compiler/codegen/events.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { ASTElementHandler, ASTElementHandlers } from 'typescript/compiler'
1+
import { ASTElementHandler, ASTElementHandlers } from 'types/compiler'
22

33
const fnExpRE = /^([\w$_]+|\([^)]*?\))\s*=>|^function(?:\s+[\w$]+)?\s*\(/
44
const fnInvokeRE = /\([^)]*?\);*$/

src/compiler/codegen/index.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ import {
1212
ASTNode,
1313
ASTText,
1414
CompilerOptions
15-
} from 'typescript/compiler'
15+
} from 'types/compiler'
1616

1717
type TransformFunction = (el: ASTElement, code: string) => string
1818
type DataGenFunction = (el: ASTElement) => string

src/compiler/create-compiler.ts

+1-5
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,5 @@
11
import { extend } from 'shared/util'
2-
import {
3-
CompilerOptions,
4-
CompiledResult,
5-
WarningMessage
6-
} from 'typescript/compiler'
2+
import { CompilerOptions, CompiledResult, WarningMessage } from 'types/compiler'
73
import { detectErrors } from './error-detector'
84
import { createCompileToFunctionFn } from './to-function'
95

src/compiler/directives/bind.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { ASTDirective, ASTElement } from 'typescript/compiler'
1+
import { ASTDirective, ASTElement } from 'types/compiler'
22

33
export default function bind(el: ASTElement, dir: ASTDirective) {
44
el.wrapData = (code: string) => {

src/compiler/directives/model.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { ASTElement, ASTModifiers } from 'typescript/compiler'
1+
import { ASTElement, ASTModifiers } from 'types/compiler'
22

33
/**
44
* Cross-platform code generation for component v-model

src/compiler/directives/on.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import { warn } from 'core/util/index'
2-
import { ASTDirective, ASTElement } from 'typescript/compiler'
2+
import { ASTDirective, ASTElement } from 'types/compiler'
33

44
export default function on(el: ASTElement, dir: ASTDirective) {
55
if (__DEV__ && dir.modifiers) {

src/compiler/error-detector.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { ASTElement, ASTNode } from 'typescript/compiler'
1+
import { ASTElement, ASTNode } from 'types/compiler'
22
import { dirRE, onRE } from './parser/index'
33

44
type Range = { start?: number; end?: number }

src/compiler/helpers.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import { emptyObject } from 'shared/util'
2-
import { ASTElement, ASTModifiers } from 'typescript/compiler'
2+
import { ASTElement, ASTModifiers } from 'types/compiler'
33
import { parseFilters } from './parser/filter-parser'
44

55
type Range = { start?: number; end?: number }

src/compiler/index.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ import { parse } from './parser/index'
22
import { optimize } from './optimizer'
33
import { generate } from './codegen/index'
44
import { createCompilerCreator } from './create-compiler'
5-
import { CompilerOptions, CompiledResult } from 'typescript/compiler'
5+
import { CompilerOptions, CompiledResult } from 'types/compiler'
66

77
// `createCompilerCreator` allows creating compilers that use alternative
88
// parser/optimizer/codegen, e.g the SSR optimizing compiler.

src/compiler/optimizer.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import { makeMap, isBuiltInTag, cached, no } from 'shared/util'
2-
import { ASTElement, CompilerOptions, ASTNode } from 'typescript/compiler'
2+
import { ASTElement, CompilerOptions, ASTNode } from 'types/compiler'
33

44
let isStaticKey
55
let isPlatformReservedTag

src/compiler/parser/index.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ import {
2626
ASTNode,
2727
ASTText,
2828
CompilerOptions
29-
} from 'typescript/compiler'
29+
} from 'types/compiler'
3030

3131
export const onRE = /^@|^v-on:/
3232
export const dirRE = process.env.VBIND_PROP_SHORTHAND

src/compiler/to-function.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
import { noop, extend } from 'shared/util'
22
import { warn as baseWarn, tip } from 'core/util/debug'
33
import { generateCodeFrame } from './codeframe'
4-
import type { Component } from 'typescript/component'
5-
import { CompilerOptions } from 'typescript/compiler'
4+
import type { Component } from 'types/component'
5+
import { CompilerOptions } from 'types/compiler'
66

77
type CompiledFunctionResult = {
88
render: Function

src/core/components/keep-alive.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
import { isRegExp, isArray, remove } from 'shared/util'
22
import { getFirstComponentChild } from 'core/vdom/helpers/index'
33
import type VNode from 'core/vdom/vnode'
4-
import type { VNodeComponentOptions } from 'typescript/vnode'
5-
import type { Component } from 'typescript/component'
4+
import type { VNodeComponentOptions } from 'types/vnode'
5+
import type { Component } from 'types/component'
66

77
type CacheEntry = {
88
name?: string

src/core/config.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import { no, noop, identity } from 'shared/util'
22

33
import { LIFECYCLE_HOOKS } from 'shared/constants'
4-
import type { Component } from 'typescript/component'
4+
import type { Component } from 'types/component'
55

66
/**
77
* @internal

src/core/global-api/assets.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import { ASSET_TYPES } from 'shared/constants'
2-
import type { GlobalAPI } from 'typescript/global-api'
2+
import type { GlobalAPI } from 'types/global-api'
33
import { isFunction, isPlainObject, validateComponentName } from '../util/index'
44

55
export function initAssetRegisters(Vue: GlobalAPI) {

src/core/global-api/extend.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import { ASSET_TYPES } from 'shared/constants'
2-
import type { Component } from 'typescript/component'
3-
import type { GlobalAPI } from 'typescript/global-api'
2+
import type { Component } from 'types/component'
3+
import type { GlobalAPI } from 'types/global-api'
44
import { defineComputed, proxy } from '../instance/state'
55
import { extend, mergeOptions, validateComponentName } from '../util/index'
66

src/core/global-api/index.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ import {
1515
mergeOptions,
1616
defineReactive
1717
} from '../util/index'
18-
import type { GlobalAPI } from 'typescript/global-api'
18+
import type { GlobalAPI } from 'types/global-api'
1919

2020
export function initGlobalAPI(Vue: GlobalAPI) {
2121
// config

src/core/global-api/mixin.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import type { GlobalAPI } from 'typescript/global-api'
1+
import type { GlobalAPI } from 'types/global-api'
22
import { mergeOptions } from '../util/index'
33

44
export function initMixin(Vue: GlobalAPI) {

src/core/global-api/use.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import type { GlobalAPI } from 'typescript/global-api'
1+
import type { GlobalAPI } from 'types/global-api'
22
import { toArray, isFunction } from '../util/index'
33

44
export function initUse(Vue: GlobalAPI) {

src/core/instance/events.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import type { Component } from 'typescript/component'
1+
import type { Component } from 'types/component'
22
import {
33
tip,
44
toArray,

src/core/instance/index.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ import { renderMixin } from './render'
44
import { eventsMixin } from './events'
55
import { lifecycleMixin } from './lifecycle'
66
import { warn } from '../util/index'
7-
import type { GlobalAPI } from 'typescript/global-api'
7+
import type { GlobalAPI } from 'types/global-api'
88

99
function Vue(options) {
1010
if (__DEV__ && !(this instanceof Vue)) {

src/core/instance/init.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,8 @@ import { mark, measure } from '../util/perf'
77
import { initLifecycle, callHook } from './lifecycle'
88
import { initProvide, initInjections } from './inject'
99
import { extend, mergeOptions, formatComponentName } from '../util/index'
10-
import type { Component } from 'typescript/component'
11-
import type { InternalComponentOptions } from 'typescript/options'
10+
import type { Component } from 'types/component'
11+
import type { InternalComponentOptions } from 'types/options'
1212
import { EffectScope } from 'v3/reactivity/effectScope'
1313

1414
let uid = 0

src/core/instance/inject.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import { warn, hasSymbol, isFunction } from '../util/index'
22
import { defineReactive, toggleObserving } from '../observer/index'
3-
import type { Component } from 'typescript/component'
3+
import type { Component } from 'types/component'
44
import { provide } from 'v3/apiInject'
55
import { setCurrentInstance } from '../../v3/currentInstance'
66

src/core/instance/lifecycle.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,8 @@ import { updateComponentListeners } from './events'
66
import { resolveSlots } from './render-helpers/resolve-slots'
77
import { toggleObserving } from '../observer/index'
88
import { pushTarget, popTarget } from '../observer/dep'
9-
import type { Component } from '../../../typescript/component'
10-
import type { MountedComponentVNode } from '../../../typescript/vnode'
9+
import type { Component } from 'types/component'
10+
import type { MountedComponentVNode } from 'types/vnode'
1111

1212
import {
1313
warn,

src/core/instance/render-helpers/bind-object-listeners.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import { warn, extend, isPlainObject } from 'core/util/index'
2-
import type { VNodeData } from 'typescript/vnode'
2+
import type { VNodeData } from 'types/vnode'
33

44
export function bindObjectListeners(data: any, value: any): VNodeData {
55
if (value) {

src/core/instance/render-helpers/bind-object-props.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ import {
99
hyphenate,
1010
isArray
1111
} from 'core/util/index'
12-
import type { VNodeData } from 'typescript/vnode'
12+
import type { VNodeData } from 'types/vnode'
1313

1414
/**
1515
* Runtime helper for merging v-bind="object" into a VNode's data.

src/core/instance/render-helpers/resolve-scoped-slots.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import type { ScopedSlotsData } from 'typescript/vnode'
1+
import type { ScopedSlotsData } from 'types/vnode'
22
import { isArray } from 'core/util'
33

44
export function resolveScopedSlots(

src/core/instance/render-helpers/resolve-slots.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import type VNode from 'core/vdom/vnode'
2-
import type { Component } from 'typescript/component'
2+
import type { Component } from 'types/component'
33

44
/**
55
* Runtime helper for resolving raw children VNodes into a slot object.

src/core/instance/render.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ import { normalizeScopedSlots } from '../vdom/helpers/normalize-scoped-slots'
1414
import VNode, { createEmptyVNode } from '../vdom/vnode'
1515

1616
import { isUpdatingChildComponent } from './lifecycle'
17-
import type { Component } from 'typescript/component'
17+
import type { Component } from 'types/component'
1818
import { setCurrentInstance } from 'v3/currentInstance'
1919
import { syncSetupSlots } from 'v3/apiSetup'
2020

src/core/instance/state.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ import {
2929
invokeWithErrorHandling,
3030
isFunction
3131
} from '../util/index'
32-
import type { Component } from 'typescript/component'
32+
import type { Component } from 'types/component'
3333
import { TrackOpTypes } from '../../v3'
3434

3535
const sharedPropertyDefinition = {

src/core/observer/scheduler.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ import Dep from './dep'
44
import { callHook, activateChildComponent } from '../instance/lifecycle'
55

66
import { warn, nextTick, devtools, inBrowser, isIE } from '../util/index'
7-
import type { Component } from 'typescript/component'
7+
import type { Component } from 'types/component'
88

99
export const MAX_UPDATE_COUNT = 100
1010

src/core/observer/watcher.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ import Dep, { pushTarget, popTarget, DepTarget } from './dep'
1616
import { DebuggerEvent, DebuggerOptions } from 'v3/debug'
1717

1818
import type { SimpleSet } from '../util/index'
19-
import type { Component } from 'typescript/component'
19+
import type { Component } from 'types/component'
2020
import { activeEffectScope, recordEffectScope } from 'v3/reactivity/effectScope'
2121

2222
let uid = 0

src/core/util/debug.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import config from '../config'
22
import { noop, isArray, isFunction } from 'shared/util'
3-
import type { Component } from 'typescript/component'
3+
import type { Component } from 'types/component'
44
import { currentInstance } from 'v3/currentInstance'
55

66
export let warn = noop

0 commit comments

Comments
 (0)