]> git.ipfire.org Git - thirdparty/vuejs/core.git/commitdiff
build: add vue package
authorEvan You <yyx990803@gmail.com>
Tue, 23 Oct 2018 15:58:37 +0000 (11:58 -0400)
committerEvan You <yyx990803@gmail.com>
Tue, 23 Oct 2018 15:58:37 +0000 (11:58 -0400)
packages/vue-compat/package.json
packages/vue/.npmignore [new file with mode: 0644]
packages/vue/README.md [new file with mode: 0644]
packages/vue/index.js [new file with mode: 0644]
packages/vue/package.json [new file with mode: 0644]
packages/vue/src/index.ts [new file with mode: 0644]
rollup.config.js
scripts/bootstrap.js
scripts/build.js
scripts/utils.js

index 517d07f44d02526fbe0e40fe96864a3a71caa26f..58e802bb9d5880d47f334df37c9f3bcd1ce2c85e 100644 (file)
@@ -1,7 +1,7 @@
 {
   "name": "vue-compat",
   "version": "3.0.0-alpha.1",
-  "description": "vue",
+  "description": "Vue 2.x compat build",
   "main": "index.js",
   "module": "dist/vue.esm-bundler.js",
   "unpkg": "dist/vue.global.js",
diff --git a/packages/vue/.npmignore b/packages/vue/.npmignore
new file mode 100644 (file)
index 0000000..bb5c8a5
--- /dev/null
@@ -0,0 +1,3 @@
+__tests__/
+__mocks__/
+dist/packages
\ No newline at end of file
diff --git a/packages/vue/README.md b/packages/vue/README.md
new file mode 100644 (file)
index 0000000..9a0fc3e
--- /dev/null
@@ -0,0 +1 @@
+# vue
\ No newline at end of file
diff --git a/packages/vue/index.js b/packages/vue/index.js
new file mode 100644 (file)
index 0000000..7a3dc2d
--- /dev/null
@@ -0,0 +1,7 @@
+'use strict'
+
+if (process.env.NODE_ENV === 'production') {
+  module.exports = require('./dist/vue.cjs.prod.js')
+} else {
+  module.exports = require('./dist/vue.cjs.js')
+}
diff --git a/packages/vue/package.json b/packages/vue/package.json
new file mode 100644 (file)
index 0000000..d624af8
--- /dev/null
@@ -0,0 +1,29 @@
+{
+  "name": "vue",
+  "version": "3.0.0-alpha.1",
+  "description": "vue",
+  "main": "index.js",
+  "module": "dist/vue.esm-bundler.js",
+  "types": "dist/index.d.ts",
+  "unpkg": "dist/vue.global.js",
+  "buildOptions": {
+    "name": "Vue",
+    "formats": ["esm", "cjs", "global", "esm-browser"]
+  },
+  "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/vue#readme",
+  "dependencies": {
+    "@vue/renderer-dom": "3.0.0-alpha.1"
+  }
+}
diff --git a/packages/vue/src/index.ts b/packages/vue/src/index.ts
new file mode 100644 (file)
index 0000000..cda6a7c
--- /dev/null
@@ -0,0 +1,3 @@
+// TODO this package will be the "full-build" that includes both the runtime
+// and the compiler
+export * from '@vue/renderer-dom'
index 4a31cbb88fabe3de355b5ad86df1ef27ca7c0fd9..4a24b15d26c2208298cf5ebda374ec92563ed5c4 100644 (file)
@@ -19,7 +19,7 @@ const packageOptions = pkg.buildOptions || {}
 const aliasOptions = { resolve: ['.ts'] }
 fs.readdirSync(packagesDir).forEach(dir => {
   if (
-    dir !== 'vue' &&
+    !dir.startsWith('vue') &&
     fs.statSync(path.resolve(packagesDir, dir)).isDirectory()
   ) {
     aliasOptions[`@vue/${dir}`] = path.resolve(packagesDir, `${dir}/src/index`)
index 8ee7e961ecfb29d4cd4eae93bfee0a803a2b11c8..557b6fc56777a14b993bc9f8bfe659381baaa869 100644 (file)
@@ -9,6 +9,9 @@ const packagesDir = path.resolve(__dirname, '../packages')
 const files = fs.readdirSync(packagesDir)
 
 files.forEach(shortName => {
+  if (shortName === 'shared') {
+    return
+  }
   if (!fs.statSync(path.join(packagesDir, shortName)).isDirectory()) {
     return
   }
index e65ea810c74e03adc340cf1c0c4e58a9121f5a94..e37746c6c0ad11924f3b9db0540b981f7d591d2d 100644 (file)
@@ -25,13 +25,14 @@ const { targets, fuzzyMatchTarget } = require('./utils')
 const args = require('minimist')(process.argv.slice(2))
 const target = args._[0]
 const formats = args.formats || args.f
+const buildAllMatching = args.all || args.a
 ;(async () => {
   if (!target) {
     await buildAll(targets)
     checkAllSizes(targets)
   } else {
-    await buildAll(fuzzyMatchTarget(target))
-    checkAllSizes(fuzzyMatchTarget(target))
+    await buildAll(fuzzyMatchTarget(target, buildAllMatching))
+    checkAllSizes(fuzzyMatchTarget(target, buildAllMatching))
   }
 })()
 
index 8aca7cab7619463ab38796a6aadf95e005d87822..9816d795d7bd28a68d8ad0a103145558b62ad835 100644 (file)
@@ -11,11 +11,14 @@ const targets = (exports.targets = fs.readdirSync('packages').filter(f => {
   return true
 }))
 
-exports.fuzzyMatchTarget = partialTarget => {
+exports.fuzzyMatchTarget = (partialTarget, includeAllMatching) => {
   const matched = []
   for (const target of targets) {
     if (target.match(partialTarget)) {
       matched.push(target)
+      if (!includeAllMatching) {
+        return matched
+      }
     }
   }
   if (matched.length) {