refactor: rename packages

This commit is contained in:
Evan You 2018-10-26 15:44:50 -04:00
parent f142c322e0
commit e05673f4d3
81 changed files with 91 additions and 91 deletions

View File

@ -6,7 +6,7 @@
"scripts": { "scripts": {
"dev": "node scripts/dev.js", "dev": "node scripts/dev.js",
"build": "node scripts/build.js", "build": "node scripts/build.js",
"size": "node scripts/build.js renderer-dom -f esm-browser", "size": "node scripts/build.js runtime-dom -f esm-browser",
"lint": "prettier --write --parser typescript 'packages/**/*.ts'", "lint": "prettier --write --parser typescript 'packages/**/*.ts'",
"test": "jest" "test": "jest"
}, },

View File

@ -0,0 +1 @@
# @vue/compiler-core

View File

@ -0,0 +1,7 @@
'use strict'
if (process.env.NODE_ENV === 'production') {
module.exports = require('./dist/compiler-core.cjs.prod.js')
} else {
module.exports = require('./dist/compiler-core.cjs.js')
}

View File

@ -1,9 +1,9 @@
{ {
"name": "@vue/compiler", "name": "@vue/compiler-core",
"version": "3.0.0-alpha.1", "version": "3.0.0-alpha.1",
"description": "@vue/compiler", "description": "@vue/compiler-core",
"main": "index.js", "main": "index.js",
"module": "dist/compiler.esm-bundler.js", "module": "dist/compiler-core.esm-bundler.js",
"types": "dist/index.d.ts", "types": "dist/index.d.ts",
"sideEffects": false, "sideEffects": false,
"repository": { "repository": {
@ -18,5 +18,5 @@
"bugs": { "bugs": {
"url": "https://github.com/vuejs/vue/issues" "url": "https://github.com/vuejs/vue/issues"
}, },
"homepage": "https://github.com/vuejs/vue/tree/dev/packages/compiler#readme" "homepage": "https://github.com/vuejs/vue/tree/dev/packages/compiler-core#readme"
} }

View File

@ -1 +0,0 @@
# @vue/compiler

View File

@ -1,7 +0,0 @@
'use strict'
if (process.env.NODE_ENV === 'production') {
module.exports = require('./dist/compiler.cjs.prod.js')
} else {
module.exports = require('./dist/compiler.cjs.js')
}

View File

@ -1,7 +0,0 @@
'use strict'
if (process.env.NODE_ENV === 'production') {
module.exports = require('./dist/core.cjs.prod.js')
} else {
module.exports = require('./dist/core.cjs.js')
}

View File

@ -2,7 +2,7 @@
## Usage Note ## Usage Note
This package is inlined into Global & Browser ESM builds of user-facing renderers (e.g. `@vue/renderer-dom`), but also published as a package that can be used standalone. The standalone build should not be used alongside a pre-bundled build of a user-facing renderer, as they will have different internal storage for reactivity connections. A user-facing renderer should re-export all APIs from this package. This package is inlined into Global & Browser ESM builds of user-facing renderers (e.g. `@vue/runtime-dom`), but also published as a package that can be used standalone. The standalone build should not be used alongside a pre-bundled build of a user-facing renderer, as they will have different internal storage for reactivity connections. A user-facing renderer should re-export all APIs from this package.
## Credits ## Credits

View File

@ -1,7 +0,0 @@
'use strict'
if (process.env.NODE_ENV === 'production') {
module.exports = require('./dist/renderer-dom.cjs.prod.js')
} else {
module.exports = require('./dist/renderer-dom.cjs.js')
}

View File

@ -1 +0,0 @@
# @vue/renderer-server

View File

@ -1,7 +0,0 @@
'use strict'
if (process.env.NODE_ENV === 'production') {
module.exports = require('./dist/renderer-server.cjs.prod.js')
} else {
module.exports = require('./dist/renderer-server.cjs.js')
}

View File

@ -1,7 +0,0 @@
'use strict'
if (process.env.NODE_ENV === 'production') {
module.exports = require('./dist/renderer-test.cjs.prod.js')
} else {
module.exports = require('./dist/renderer-test.cjs.js')
}

View File

@ -1,9 +1,9 @@
# @vue/core # @vue/runtime-core
> This package is published only for typing and building custom renderers. It is NOT meant to be used in applications. > This package is published only for typing and building custom renderers. It is NOT meant to be used in applications.
``` ts ``` ts
import { createRenderer, h } from '@vue/core' import { createRenderer, h } from '@vue/runtime-core'
const { render } = createRenderer({ const { render } = createRenderer({
nodeOps, nodeOps,

View File

@ -1,5 +1,5 @@
// using DOM renderer because this case is mostly DOM-specific // using DOM renderer because this case is mostly DOM-specific
import { h, render, Component, nextTick, cloneVNode } from '@vue/renderer-dom' import { h, render, Component, nextTick, cloneVNode } from '@vue/runtime-dom'
describe('attribute fallthrough', () => { describe('attribute fallthrough', () => {
it('everything should be in props when component has no declared props', async () => { it('everything should be in props when component has no declared props', async () => {

View File

@ -13,7 +13,7 @@ import {
resetOps, resetOps,
dumpOps, dumpOps,
NodeOpTypes NodeOpTypes
} from '@vue/renderer-test' } from '@vue/runtime-test'
describe('Fragments', () => { describe('Fragments', () => {
it('should allow returning multiple component root nodes', () => { it('should allow returning multiple component root nodes', () => {

View File

@ -6,8 +6,8 @@ import {
KeepAlive, KeepAlive,
ComponentPropsOptions, ComponentPropsOptions,
ComponentWatchOptions ComponentWatchOptions
} from '@vue/core' } from '@vue/runtime-core'
import { createInstance, renderIntsance } from '@vue/renderer-test' import { createInstance, renderIntsance } from '@vue/runtime-test'
describe('class inheritance', () => { describe('class inheritance', () => {
it('should merge data', () => { it('should merge data', () => {

View File

@ -1,5 +1,5 @@
import { Component, ComponentClass, mixins } from '@vue/core' import { Component, ComponentClass, mixins } from '@vue/runtime-core'
import { createInstance } from '@vue/renderer-test' import { createInstance } from '@vue/runtime-test'
const calls: string[] = [] const calls: string[] = []

View File

@ -5,7 +5,7 @@ import {
nodeOps, nodeOps,
observable, observable,
nextTick nextTick
} from '@vue/renderer-test' } from '@vue/runtime-test'
describe('Parent chain management', () => { describe('Parent chain management', () => {
it('should have correct $parent / $root / $children', async () => { it('should have correct $parent / $root / $children', async () => {

View File

@ -0,0 +1,7 @@
'use strict'
if (process.env.NODE_ENV === 'production') {
module.exports = require('./dist/runtime-core.cjs.prod.js')
} else {
module.exports = require('./dist/runtime-core.cjs.js')
}

View File

@ -1,9 +1,9 @@
{ {
"name": "@vue/core", "name": "@vue/runtime-core",
"version": "3.0.0-alpha.1", "version": "3.0.0-alpha.1",
"description": "@vue/core", "description": "@vue/runtime-core",
"main": "index.js", "main": "index.js",
"module": "dist/core.esm-bundler.js", "module": "dist/runtime-core.esm-bundler.js",
"types": "dist/index.d.ts", "types": "dist/index.d.ts",
"sideEffects": false, "sideEffects": false,
"repository": { "repository": {
@ -18,7 +18,7 @@
"bugs": { "bugs": {
"url": "https://github.com/vuejs/vue/issues" "url": "https://github.com/vuejs/vue/issues"
}, },
"homepage": "https://github.com/vuejs/vue/tree/dev/packages/core#readme", "homepage": "https://github.com/vuejs/vue/tree/dev/packages/runtime-core#readme",
"dependencies": { "dependencies": {
"@vue/observer": "3.0.0-alpha.1", "@vue/observer": "3.0.0-alpha.1",
"@vue/scheduler": "3.0.0-alpha.1" "@vue/scheduler": "3.0.0-alpha.1"

View File

@ -1,7 +1,7 @@
# @vue/renderer-dom # @vue/runtime-dom
``` js ``` js
import { h, render, Component } from '@vue/renderer-dom' import { h, render, Component } from '@vue/runtime-dom'
class App extends Component { class App extends Component {
data () { data () {

View File

@ -0,0 +1,7 @@
'use strict'
if (process.env.NODE_ENV === 'production') {
module.exports = require('./dist/runtime-dom.cjs.prod.js')
} else {
module.exports = require('./dist/runtime-dom.cjs.js')
}

View File

@ -1,11 +1,11 @@
{ {
"name": "@vue/renderer-dom", "name": "@vue/runtime-dom",
"version": "3.0.0-alpha.1", "version": "3.0.0-alpha.1",
"description": "@vue/renderer-dom", "description": "@vue/runtime-dom",
"main": "index.js", "main": "index.js",
"module": "dist/renderer-dom.esm-bundler.js", "module": "dist/runtime-dom.esm-bundler.js",
"types": "dist/index.d.ts", "types": "dist/index.d.ts",
"unpkg": "dist/renderer-dom.global.js", "unpkg": "dist/runtime-dom.global.js",
"sideEffects": false, "sideEffects": false,
"buildOptions": { "buildOptions": {
"name": "VueDOMRenderer", "name": "VueDOMRenderer",
@ -23,8 +23,8 @@
"bugs": { "bugs": {
"url": "https://github.com/vuejs/vue/issues" "url": "https://github.com/vuejs/vue/issues"
}, },
"homepage": "https://github.com/vuejs/vue/tree/dev/packages/renderer-dom#readme", "homepage": "https://github.com/vuejs/vue/tree/dev/packages/runtime-dom#readme",
"dependencies": { "dependencies": {
"@vue/core": "3.0.0-alpha.1" "@vue/runtime-core": "3.0.0-alpha.1"
} }
} }

View File

@ -1,4 +1,4 @@
import { createRenderer, VNode, Component } from '@vue/core' import { createRenderer, VNode, Component } from '@vue/runtime-core'
import { nodeOps } from './nodeOps' import { nodeOps } from './nodeOps'
import { patchData } from './patchData' import { patchData } from './patchData'
import { teardownVNode } from './teardownVNode' import { teardownVNode } from './teardownVNode'
@ -17,4 +17,4 @@ export const render = _render as publicRender
// re-export everything from core // re-export everything from core
// h, Component, observer API, nextTick, flags & types // h, Component, observer API, nextTick, flags & types
export * from '@vue/core' export * from '@vue/runtime-core'

View File

@ -1,4 +1,4 @@
import { VNode, ChildrenFlags } from '@vue/core' import { VNode, ChildrenFlags } from '@vue/runtime-core'
export function patchDOMProp( export function patchDOMProp(
el: any, el: any,

View File

@ -1,4 +1,4 @@
import { VNode } from '@vue/core' import { VNode } from '@vue/runtime-core'
import { patchClass } from './modules/class' import { patchClass } from './modules/class'
import { patchStyle } from './modules/style' import { patchStyle } from './modules/style'
import { patchAttr } from './modules/attrs' import { patchAttr } from './modules/attrs'

View File

@ -1,4 +1,4 @@
import { VNode } from '@vue/core' import { VNode } from '@vue/runtime-core'
import { handleDelegatedEvent } from './modules/events' import { handleDelegatedEvent } from './modules/events'
import { isOn } from '@vue/shared' import { isOn } from '@vue/shared'

View File

@ -1,4 +1,4 @@
# @vue/renderer-test # @vue/runtime-test
``` js ``` js
import { import {
@ -8,7 +8,7 @@ import {
nodeOps, nodeOps,
startRecordingOps, startRecordingOps,
dumpOps dumpOps
} from '@vue/renderer-test' } from '@vue/runtime-test'
class App extends Component { class App extends Component {
data () { data () {

View File

@ -0,0 +1,7 @@
'use strict'
if (process.env.NODE_ENV === 'production') {
module.exports = require('./dist/runtime-test.cjs.prod.js')
} else {
module.exports = require('./dist/runtime-test.cjs.js')
}

View File

@ -1,9 +1,9 @@
{ {
"name": "@vue/renderer-test", "name": "@vue/runtime-test",
"version": "3.0.0-alpha.1", "version": "3.0.0-alpha.1",
"description": "@vue/renderer-test", "description": "@vue/runtime-test",
"main": "index.js", "main": "index.js",
"module": "dist/renderer-test.esm-bundler.js", "module": "dist/runtime-test.esm-bundler.js",
"types": "dist/index.d.ts", "types": "dist/index.d.ts",
"repository": { "repository": {
"type": "git", "type": "git",
@ -17,8 +17,8 @@
"bugs": { "bugs": {
"url": "https://github.com/vuejs/vue/issues" "url": "https://github.com/vuejs/vue/issues"
}, },
"homepage": "https://github.com/vuejs/vue/tree/dev/packages/renderer-test#readme", "homepage": "https://github.com/vuejs/vue/tree/dev/packages/runtime-test#readme",
"dependencies": { "dependencies": {
"@vue/core": "3.0.0-alpha.1" "@vue/runtime-core": "3.0.0-alpha.1"
} }
} }

View File

@ -4,7 +4,7 @@ import {
VNode, VNode,
Component, Component,
createComponentInstance createComponentInstance
} from '@vue/core' } from '@vue/runtime-core'
import { nodeOps, TestElement } from './nodeOps' import { nodeOps, TestElement } from './nodeOps'
import { patchData } from './patchData' import { patchData } from './patchData'
@ -35,4 +35,4 @@ export function renderIntsance<T extends Component>(
export { serialize } from './serialize' export { serialize } from './serialize'
export * from './nodeOps' export * from './nodeOps'
export * from '@vue/core' export * from '@vue/runtime-core'

View File

@ -0,0 +1 @@
# @vue/server-renderer

View File

@ -0,0 +1,7 @@
'use strict'
if (process.env.NODE_ENV === 'production') {
module.exports = require('./dist/server-renderer.cjs.prod.js')
} else {
module.exports = require('./dist/server-renderer.cjs.js')
}

View File

@ -1,7 +1,7 @@
{ {
"name": "@vue/renderer-server", "name": "@vue/server-renderer",
"version": "3.0.0-alpha.1", "version": "3.0.0-alpha.1",
"description": "@vue/renderer-server", "description": "@vue/server-renderer",
"main": "index.js", "main": "index.js",
"types": "dist/index.d.ts", "types": "dist/index.d.ts",
"buildOptions": { "buildOptions": {
@ -19,5 +19,5 @@
"bugs": { "bugs": {
"url": "https://github.com/vuejs/vue/issues" "url": "https://github.com/vuejs/vue/issues"
}, },
"homepage": "https://github.com/vuejs/vue/tree/dev/packages/renderer-server#readme" "homepage": "https://github.com/vuejs/vue/tree/dev/packages/server-renderer#readme"
} }

View File

@ -25,6 +25,6 @@
}, },
"homepage": "https://github.com/vuejs/vue/tree/dev/packages/vue#readme", "homepage": "https://github.com/vuejs/vue/tree/dev/packages/vue#readme",
"dependencies": { "dependencies": {
"@vue/renderer-dom": "3.0.0-alpha.1" "@vue/runtime-dom": "3.0.0-alpha.1"
} }
} }

View File

@ -4,7 +4,7 @@ import {
nextTick, nextTick,
createComponentInstance, createComponentInstance,
createComponentClassFromOptions createComponentClassFromOptions
} from '@vue/renderer-dom' } from '@vue/runtime-dom'
// Note: typing for this is intentionally loose, as it will be using 2.x types. // Note: typing for this is intentionally loose, as it will be using 2.x types.

View File

@ -24,6 +24,6 @@
}, },
"homepage": "https://github.com/vuejs/vue/tree/dev/packages/vue#readme", "homepage": "https://github.com/vuejs/vue/tree/dev/packages/vue#readme",
"dependencies": { "dependencies": {
"@vue/renderer-dom": "3.0.0-alpha.1" "@vue/runtime-dom": "3.0.0-alpha.1"
} }
} }

View File

@ -1,3 +1,3 @@
// TODO this package will be the "full-build" that includes both the runtime // TODO this package will be the "full-build" that includes both the runtime
// and the compiler // and the compiler
export * from '@vue/renderer-dom' export * from '@vue/runtime-dom'

View File

@ -20,18 +20,18 @@
"rootDir": ".", "rootDir": ".",
"paths": { "paths": {
"@vue/shared": ["packages/shared/src"], "@vue/shared": ["packages/shared/src"],
"@vue/core": ["packages/core/src"], "@vue/runtime-core": ["packages/runtime-core/src"],
"@vue/runtime-dom": ["packages/runtime-dom/src"],
"@vue/runtime-test": ["packages/runtime-test/src"],
"@vue/observer": ["packages/observer/src"], "@vue/observer": ["packages/observer/src"],
"@vue/scheduler": ["packages/scheduler/src"], "@vue/scheduler": ["packages/scheduler/src"],
"@vue/renderer-dom": ["packages/renderer-dom/src"], "@vue/compiler-core": ["packages/compiler-core/src"],
"@vue/renderer-server": ["packages/renderer-server/src"], "@vue/server-renderer": ["packages/server-renderer/src"]
"@vue/renderer-test": ["packages/renderer-test/src"],
"@vue/compiler": ["packages/compiler-core/src"]
} }
}, },
"include": [ "include": [
"packages/global.d.ts", "packages/global.d.ts",
"packages/renderer-dom/jsx.d.ts", "packages/runtime-dom/jsx.d.ts",
"packages/*/src", "packages/*/src",
"packages/*/__tests__" "packages/*/__tests__"
] ]