build: make @vue/shared public
This avoids it being inlined multiple times in esm bundler builds
This commit is contained in:
@@ -18,7 +18,7 @@
|
||||
},
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "git+https://github.com/vuejs/vue.git"
|
||||
"url": "git+https://github.com/vuejs/vue-next.git"
|
||||
},
|
||||
"keywords": [
|
||||
"vue"
|
||||
@@ -26,10 +26,11 @@
|
||||
"author": "Evan You",
|
||||
"license": "MIT",
|
||||
"bugs": {
|
||||
"url": "https://github.com/vuejs/vue/issues"
|
||||
"url": "https://github.com/vuejs/vue-next/issues"
|
||||
},
|
||||
"homepage": "https://github.com/vuejs/vue/tree/dev/packages/compiler-core#readme",
|
||||
"homepage": "https://github.com/vuejs/vue-next/tree/master/packages/compiler-core#readme",
|
||||
"dependencies": {
|
||||
"@vue/shared": "3.0.0-alpha.7",
|
||||
"@babel/parser": "^7.8.6",
|
||||
"@babel/types": "^7.8.6",
|
||||
"estree-walker": "^0.8.1",
|
||||
|
||||
@@ -50,12 +50,4 @@ export {
|
||||
} from './transforms/vSlot'
|
||||
export { resolveComponentType, buildProps } from './transforms/transformElement'
|
||||
export { processSlotOutlet } from './transforms/transformSlotOutlet'
|
||||
|
||||
// utility, but need to rewrite typing to avoid dts relying on @vue/shared
|
||||
import { generateCodeFrame as _genCodeFrame } from '@vue/shared'
|
||||
const generateCodeFrame = _genCodeFrame as (
|
||||
source: string,
|
||||
start?: number,
|
||||
end?: number
|
||||
) => string
|
||||
export { generateCodeFrame }
|
||||
export { generateCodeFrame } from '@vue/shared'
|
||||
|
||||
@@ -22,7 +22,7 @@
|
||||
},
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "git+https://github.com/vuejs/vue.git"
|
||||
"url": "git+https://github.com/vuejs/vue-next.git"
|
||||
},
|
||||
"keywords": [
|
||||
"vue"
|
||||
@@ -30,10 +30,11 @@
|
||||
"author": "Evan You",
|
||||
"license": "MIT",
|
||||
"bugs": {
|
||||
"url": "https://github.com/vuejs/vue/issues"
|
||||
"url": "https://github.com/vuejs/vue-next/issues"
|
||||
},
|
||||
"homepage": "https://github.com/vuejs/vue/tree/dev/packages/compiler-dom#readme",
|
||||
"homepage": "https://github.com/vuejs/vue-next/tree/master/packages/compiler-dom#readme",
|
||||
"dependencies": {
|
||||
"@vue/shared": "3.0.0-alpha.7",
|
||||
"@vue/compiler-core": "3.0.0-alpha.7"
|
||||
}
|
||||
}
|
||||
|
||||
@@ -15,7 +15,7 @@
|
||||
},
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "git+https://github.com/vuejs/vue.git"
|
||||
"url": "git+https://github.com/vuejs/vue-next.git"
|
||||
},
|
||||
"keywords": [
|
||||
"vue"
|
||||
@@ -23,13 +23,14 @@
|
||||
"author": "Evan You",
|
||||
"license": "MIT",
|
||||
"bugs": {
|
||||
"url": "https://github.com/vuejs/vue/issues"
|
||||
"url": "https://github.com/vuejs/vue-next/issues"
|
||||
},
|
||||
"homepage": "https://github.com/vuejs/vue/tree/dev/packages/compiler-sfc#readme",
|
||||
"homepage": "https://github.com/vuejs/vue-next/tree/master/packages/compiler-sfc#readme",
|
||||
"peerDependencies": {
|
||||
"vue": "3.0.0-alpha.7"
|
||||
},
|
||||
"dependencies": {
|
||||
"@vue/shared": "3.0.0-alpha.7",
|
||||
"@vue/compiler-core": "3.0.0-alpha.7",
|
||||
"@vue/compiler-dom": "3.0.0-alpha.7",
|
||||
"consolidate": "^0.15.1",
|
||||
|
||||
@@ -15,7 +15,7 @@
|
||||
},
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "git+https://github.com/vuejs/vue.git"
|
||||
"url": "git+https://github.com/vuejs/vue-next.git"
|
||||
},
|
||||
"keywords": [
|
||||
"vue"
|
||||
@@ -23,10 +23,11 @@
|
||||
"author": "Evan You",
|
||||
"license": "MIT",
|
||||
"bugs": {
|
||||
"url": "https://github.com/vuejs/vue/issues"
|
||||
"url": "https://github.com/vuejs/vue-next/issues"
|
||||
},
|
||||
"homepage": "https://github.com/vuejs/vue/tree/dev/packages/compiler-ssr#readme",
|
||||
"homepage": "https://github.com/vuejs/vue-next/tree/master/packages/compiler-ssr#readme",
|
||||
"dependencies": {
|
||||
"@vue/shared": "3.0.0-alpha.7",
|
||||
"@vue/compiler-dom": "3.0.0-alpha.7"
|
||||
}
|
||||
}
|
||||
|
||||
@@ -13,7 +13,7 @@
|
||||
"sideEffects": false,
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "git+https://github.com/vuejs/vue.git"
|
||||
"url": "git+https://github.com/vuejs/vue-next.git"
|
||||
},
|
||||
"buildOptions": {
|
||||
"name": "VueReactivity",
|
||||
@@ -30,7 +30,10 @@
|
||||
"author": "Evan You",
|
||||
"license": "MIT",
|
||||
"bugs": {
|
||||
"url": "https://github.com/vuejs/vue/issues"
|
||||
"url": "https://github.com/vuejs/vue-next/issues"
|
||||
},
|
||||
"homepage": "https://github.com/vuejs/vue/tree/dev/packages/reactivity#readme"
|
||||
"homepage": "https://github.com/vuejs/vue-next/tree/master/packages/reactivity#readme",
|
||||
"dependencies": {
|
||||
"@vue/shared": "3.0.0-alpha.7"
|
||||
}
|
||||
}
|
||||
|
||||
@@ -19,7 +19,7 @@
|
||||
"sideEffects": false,
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "git+https://github.com/vuejs/vue.git"
|
||||
"url": "git+https://github.com/vuejs/vue-next.git"
|
||||
},
|
||||
"keywords": [
|
||||
"vue"
|
||||
@@ -27,10 +27,11 @@
|
||||
"author": "Evan You",
|
||||
"license": "MIT",
|
||||
"bugs": {
|
||||
"url": "https://github.com/vuejs/vue/issues"
|
||||
"url": "https://github.com/vuejs/vue-next/issues"
|
||||
},
|
||||
"homepage": "https://github.com/vuejs/vue/tree/dev/packages/runtime-core#readme",
|
||||
"homepage": "https://github.com/vuejs/vue-next/tree/master/packages/runtime-core#readme",
|
||||
"dependencies": {
|
||||
"@vue/shared": "3.0.0-alpha.7",
|
||||
"@vue/reactivity": "3.0.0-alpha.7"
|
||||
}
|
||||
}
|
||||
|
||||
@@ -101,15 +101,7 @@ export {
|
||||
createCommentVNode,
|
||||
createStaticVNode
|
||||
} from './vnode'
|
||||
// Since @vue/shared is inlined into final builds,
|
||||
// when re-exporting from @vue/shared we need to avoid relying on their original
|
||||
// types so that the bundled d.ts does not attempt to import from it.
|
||||
import {
|
||||
toDisplayString as _toDisplayString,
|
||||
camelize as _camelize
|
||||
} from '@vue/shared'
|
||||
export const toDisplayString = _toDisplayString as (s: unknown) => string
|
||||
export const camelize = _camelize as (s: string) => string
|
||||
export { toDisplayString, camelize } from '@vue/shared'
|
||||
|
||||
// For integration with runtime compiler
|
||||
export { registerRuntimeCompiler } from './component'
|
||||
|
||||
@@ -25,7 +25,7 @@
|
||||
},
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "git+https://github.com/vuejs/vue.git"
|
||||
"url": "git+https://github.com/vuejs/vue-next.git"
|
||||
},
|
||||
"keywords": [
|
||||
"vue"
|
||||
@@ -33,10 +33,11 @@
|
||||
"author": "Evan You",
|
||||
"license": "MIT",
|
||||
"bugs": {
|
||||
"url": "https://github.com/vuejs/vue/issues"
|
||||
"url": "https://github.com/vuejs/vue-next/issues"
|
||||
},
|
||||
"homepage": "https://github.com/vuejs/vue/tree/dev/packages/runtime-dom#readme",
|
||||
"homepage": "https://github.com/vuejs/vue-next/tree/master/packages/runtime-dom#readme",
|
||||
"dependencies": {
|
||||
"@vue/shared": "3.0.0-alpha.7",
|
||||
"@vue/runtime-core": "3.0.0-alpha.7",
|
||||
"csstype": "^2.6.8"
|
||||
}
|
||||
|
||||
@@ -12,7 +12,7 @@
|
||||
],
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "git+https://github.com/vuejs/vue.git"
|
||||
"url": "git+https://github.com/vuejs/vue-next.git"
|
||||
},
|
||||
"buildOptions": {
|
||||
"name": "VueRuntimeTest",
|
||||
@@ -26,10 +26,11 @@
|
||||
"author": "Evan You",
|
||||
"license": "MIT",
|
||||
"bugs": {
|
||||
"url": "https://github.com/vuejs/vue/issues"
|
||||
"url": "https://github.com/vuejs/vue-next/issues"
|
||||
},
|
||||
"homepage": "https://github.com/vuejs/vue/tree/dev/packages/runtime-test#readme",
|
||||
"homepage": "https://github.com/vuejs/vue-next/tree/master/packages/runtime-test#readme",
|
||||
"dependencies": {
|
||||
"@vue/shared": "3.0.0-alpha.7",
|
||||
"@vue/runtime-core": "3.0.0-alpha.7"
|
||||
}
|
||||
}
|
||||
|
||||
@@ -15,7 +15,7 @@
|
||||
},
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "git+https://github.com/vuejs/vue.git"
|
||||
"url": "git+https://github.com/vuejs/vue-next.git"
|
||||
},
|
||||
"keywords": [
|
||||
"vue"
|
||||
@@ -23,13 +23,14 @@
|
||||
"author": "Evan You",
|
||||
"license": "MIT",
|
||||
"bugs": {
|
||||
"url": "https://github.com/vuejs/vue/issues"
|
||||
"url": "https://github.com/vuejs/vue-next/issues"
|
||||
},
|
||||
"homepage": "https://github.com/vuejs/vue/tree/dev/packages/server-renderer#readme",
|
||||
"homepage": "https://github.com/vuejs/vue-next/tree/master/packages/server-renderer#readme",
|
||||
"peerDependencies": {
|
||||
"vue": "3.0.0-alpha.7"
|
||||
},
|
||||
"dependencies": {
|
||||
"@vue/shared": "3.0.0-alpha.7",
|
||||
"@vue/compiler-ssr": "3.0.0-alpha.7"
|
||||
}
|
||||
}
|
||||
|
||||
7
packages/shared/api-extractor.json
Normal file
7
packages/shared/api-extractor.json
Normal file
@@ -0,0 +1,7 @@
|
||||
{
|
||||
"extends": "../../api-extractor.json",
|
||||
"mainEntryPointFilePath": "./dist/packages/<unscopedPackageName>/src/index.d.ts",
|
||||
"dtsRollup": {
|
||||
"untrimmedFilePath": "./dist/<unscopedPackageName>.d.ts"
|
||||
}
|
||||
}
|
||||
7
packages/shared/index.js
Normal file
7
packages/shared/index.js
Normal file
@@ -0,0 +1,7 @@
|
||||
'use strict'
|
||||
|
||||
if (process.env.NODE_ENV === 'production') {
|
||||
module.exports = require('./dist/shared.cjs.prod.js')
|
||||
} else {
|
||||
module.exports = require('./dist/shared.cjs.js')
|
||||
}
|
||||
@@ -1,5 +1,31 @@
|
||||
{
|
||||
"name": "@vue/shared",
|
||||
"version": "3.0.0-alpha.7",
|
||||
"private": true
|
||||
"description": "internal utils shared across @vue packages",
|
||||
"main": "index.js",
|
||||
"module": "dist/shared.esm-bundler.js",
|
||||
"types": "dist/shared.d.ts",
|
||||
"files": [
|
||||
"index.js",
|
||||
"dist"
|
||||
],
|
||||
"buildOptions": {
|
||||
"formats": [
|
||||
"esm-bundler",
|
||||
"cjs"
|
||||
]
|
||||
},
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "git+https://github.com/vuejs/vue-next.git"
|
||||
},
|
||||
"keywords": [
|
||||
"vue"
|
||||
],
|
||||
"author": "Evan You",
|
||||
"license": "MIT",
|
||||
"bugs": {
|
||||
"url": "https://github.com/vuejs/vue-next/issues"
|
||||
},
|
||||
"homepage": "https://github.com/vuejs/vue-next/tree/master/packages/shared#readme"
|
||||
}
|
||||
|
||||
@@ -24,7 +24,7 @@
|
||||
},
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "git+https://github.com/vuejs/vue.git"
|
||||
"url": "git+https://github.com/vuejs/vue-next.git"
|
||||
},
|
||||
"keywords": [
|
||||
"vue"
|
||||
@@ -32,10 +32,11 @@
|
||||
"author": "Evan You",
|
||||
"license": "MIT",
|
||||
"bugs": {
|
||||
"url": "https://github.com/vuejs/vue/issues"
|
||||
"url": "https://github.com/vuejs/vue-next/issues"
|
||||
},
|
||||
"homepage": "https://github.com/vuejs/vue/tree/dev/packages/vue#readme",
|
||||
"homepage": "https://github.com/vuejs/vue-next/tree/master/packages/vue#readme",
|
||||
"dependencies": {
|
||||
"@vue/shared": "3.0.0-alpha.7",
|
||||
"@vue/compiler-dom": "3.0.0-alpha.7",
|
||||
"@vue/runtime-dom": "3.0.0-alpha.7"
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user