فهرست منبع

chore: bump build deps

Evan You 3 سال پیش
والد
کامیت
cc14d4452c
5فایلهای تغییر یافته به همراه260 افزوده شده و 245 حذف شده
  1. 3 3
      package.json
  2. 1 1
      packages/compiler-sfc/package.json
  3. 7 3
      packages/compiler-sfc/src/compileScript.ts
  4. 244 234
      pnpm-lock.yaml
  5. 5 4
      scripts/config.js

+ 3 - 3
package.json

@@ -117,15 +117,15 @@
     "prettier": "^2.6.2",
     "puppeteer": "^14.3.0",
     "rimraf": "^3.0.2",
-    "rollup": "^2.75.6",
-    "rollup-plugin-typescript2": "^0.31.2",
+    "rollup": "^2.79.1",
+    "rollup-plugin-typescript2": "^0.32.0",
     "semver": "^7.3.7",
     "shelljs": "^0.8.5",
     "terser": "^5.14.0",
     "todomvc-app-css": "^2.4.2",
     "ts-node": "^10.8.1",
     "tslib": "^2.4.0",
-    "typescript": "^4.7.3",
+    "typescript": "^4.8.4",
     "vitest": "^0.12.10",
     "yorkie": "^2.0.0"
   }

+ 1 - 1
packages/compiler-sfc/package.json

@@ -13,7 +13,7 @@
     "source-map": "^0.6.1"
   },
   "devDependencies": {
-    "@babel/types": "^7.18.4",
+    "@babel/types": "^7.19.4",
     "@types/estree": "^0.0.48",
     "@types/hash-sum": "^1.0.0",
     "@types/lru-cache": "^5.1.1",

+ 7 - 3
packages/compiler-sfc/src/compileScript.ts

@@ -780,7 +780,7 @@ export function compileScript(
     if (node.trailingComments && node.trailingComments.length > 0) {
       const lastCommentNode =
         node.trailingComments[node.trailingComments.length - 1]
-      end = lastCommentNode.end + startOffset
+      end = lastCommentNode.end! + startOffset
     }
     // locate the end of whitespace between this statement and the next
     while (end <= source.length) {
@@ -1582,14 +1582,18 @@ function extractEventNames(
   ) {
     const typeNode = eventName.typeAnnotation.typeAnnotation
     if (typeNode.type === 'TSLiteralType') {
-      if (typeNode.literal.type !== 'UnaryExpression') {
+      if (
+        typeNode.literal.type !== 'UnaryExpression' &&
+        typeNode.literal.type !== 'TemplateLiteral'
+      ) {
         emits.add(String(typeNode.literal.value))
       }
     } else if (typeNode.type === 'TSUnionType') {
       for (const t of typeNode.types) {
         if (
           t.type === 'TSLiteralType' &&
-          t.literal.type !== 'UnaryExpression'
+          t.literal.type !== 'UnaryExpression' &&
+          t.literal.type !== 'TemplateLiteral'
         ) {
           emits.add(String(t.literal.value))
         }

تفاوت فایلی نمایش داده نمی شود زیرا این فایل بسیار بزرگ است
+ 244 - 234
pnpm-lock.yaml


+ 5 - 4
scripts/config.js

@@ -227,6 +227,9 @@ const builds = {
 
 function genConfig(name) {
   const opts = builds[name]
+  const isTargetingBrowser = !(
+    opts.transpile === false || opts.format === 'cjs'
+  )
 
   // console.log('__dir', __dirname)
   const config = {
@@ -243,11 +246,9 @@ function genConfig(name) {
           compilerOptions: {
             // if targeting browser, target es5
             // if targeting node, es2017 means Node 8
-            target:
-              opts.transpile === false || opts.format === 'cjs'
-                ? 'es2017'
-                : 'es5'
+            target: isTargetingBrowser ? 'es5' : 'es2017'
           },
+          include: isTargetingBrowser ? ['src'] : ['src', 'packages/*/src'],
           exclude: ['test', 'test-dts']
         }
       })

برخی فایل ها در این مقایسه diff نمایش داده نمی شوند زیرا تعداد فایل ها بسیار زیاد است