refactor: move decorators into their own package
This commit is contained in:
parent
4a4c1b247d
commit
f00097127a
3
packages/decorators/.npmignore
Normal file
3
packages/decorators/.npmignore
Normal file
@ -0,0 +1,3 @@
|
||||
__tests__/
|
||||
__mocks__/
|
||||
dist/packages
|
1
packages/decorators/README.md
Normal file
1
packages/decorators/README.md
Normal file
@ -0,0 +1 @@
|
||||
# @vue/decorators
|
@ -1,4 +1,4 @@
|
||||
import { prop } from '../src/optional/propDecorator'
|
||||
import { prop } from '../src/prop'
|
||||
import { Component, createInstance } from '@vue/runtime-test'
|
||||
|
||||
test('without options', () => {
|
7
packages/decorators/index.js
Normal file
7
packages/decorators/index.js
Normal file
@ -0,0 +1,7 @@
|
||||
'use strict'
|
||||
|
||||
if (process.env.NODE_ENV === 'production') {
|
||||
module.exports = require('./dist/decorators.cjs.prod.js')
|
||||
} else {
|
||||
module.exports = require('./dist/decorators.cjs.js')
|
||||
}
|
21
packages/decorators/package.json
Normal file
21
packages/decorators/package.json
Normal file
@ -0,0 +1,21 @@
|
||||
{
|
||||
"name": "@vue/decorators",
|
||||
"version": "3.0.0-alpha.1",
|
||||
"description": "@vue/decorators",
|
||||
"main": "index.js",
|
||||
"module": "dist/decorators.esm-bundler.js",
|
||||
"types": "dist/index.d.ts",
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "git+https://github.com/vuejs/vue.git"
|
||||
},
|
||||
"keywords": [
|
||||
"vue"
|
||||
],
|
||||
"author": "Evan You",
|
||||
"license": "MIT",
|
||||
"bugs": {
|
||||
"url": "https://github.com/vuejs/vue/issues"
|
||||
},
|
||||
"homepage": "https://github.com/vuejs/vue/tree/dev/packages/decorators#readme"
|
||||
}
|
2
packages/decorators/src/index.ts
Normal file
2
packages/decorators/src/index.ts
Normal file
@ -0,0 +1,2 @@
|
||||
export { prop } from './prop'
|
||||
export { inject } from './inject'
|
1
packages/decorators/src/inject.ts
Normal file
1
packages/decorators/src/inject.ts
Normal file
@ -0,0 +1 @@
|
||||
export function inject() {}
|
@ -1,5 +1,4 @@
|
||||
import { Component } from '../component'
|
||||
import { PropValidator } from '../componentOptions'
|
||||
import { Component, PropValidator } from '@vue/runtime-core'
|
||||
import { camelize } from '@vue/shared'
|
||||
|
||||
export function prop(
|
@ -24,13 +24,12 @@ export { nextTick } from '@vue/scheduler'
|
||||
|
||||
// Optional APIs
|
||||
// these are imported on-demand and can be tree-shaken
|
||||
export { applyDirectives } from './optional/directives'
|
||||
export { createAsyncComponent } from './optional/asyncComponent'
|
||||
export { KeepAlive } from './optional/keepAlive'
|
||||
export { applyDirectives } from './optional/directives'
|
||||
export { mixins } from './optional/mixins'
|
||||
export { EventEmitter } from './optional/eventEmitter'
|
||||
export { memoize } from './optional/memoize'
|
||||
export { prop } from './optional/propDecorator'
|
||||
|
||||
// flags & types
|
||||
export { ComponentType, ComponentClass, FunctionalComponent } from './component'
|
||||
|
Loading…
Reference in New Issue
Block a user