Skip to content

Commit efdc76a

Browse files
authored
feat!: ready for rolldown vite (#494)
* feat!: ready for rolldown-vite * fix: bump unplugin * fix: add moduleType supporting dev version deps * fix: hook filter implementation * fix: port from bundle-utils v12-alpha logic * fix: hook filter & module type implementation * fix * fix * fix: tweak unit test * chore: tweak test
1 parent 16effda commit efdc76a

30 files changed

+2516
-1519
lines changed

.github/workflows/build.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -22,13 +22,13 @@ jobs:
2222
strategy:
2323
matrix:
2424
os: [ubuntu-latest]
25-
node: [18]
25+
node: [20]
2626
steps:
2727
- name: Checkout
2828
uses: actions/checkout@v4
2929

30-
- name: Enable corepack
31-
run: corepack enable
30+
- name: Install pnpm
31+
uses: pnpm/action-setup@v4
3232

3333
- name: Setup Node.js ${{ matrix.node }}
3434
uses: actions/setup-node@v4

.github/workflows/lint.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -22,13 +22,13 @@ jobs:
2222
strategy:
2323
matrix:
2424
os: [ubuntu-latest]
25-
node: [18]
25+
node: [20]
2626
steps:
2727
- name: Checkout
2828
uses: actions/checkout@v4
2929

30-
- name: Enable corepack
31-
run: corepack enable
30+
- name: Install pnpm
31+
uses: pnpm/action-setup@v4
3232

3333
- name: Setup Node.js ${{ matrix.node }}
3434
uses: actions/setup-node@v4

.github/workflows/test.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -22,13 +22,13 @@ jobs:
2222
strategy:
2323
matrix:
2424
os: [ubuntu-latest]
25-
node: [18, 20, 22]
25+
node: [20, 22, 24]
2626
steps:
2727
- name: Checkout
2828
uses: actions/checkout@v4
2929

30-
- name: Enable corepack
31-
run: corepack enable
30+
- name: Install pnpm
31+
uses: pnpm/action-setup@v4
3232

3333
- name: Setup Node.js ${{ matrix.node }}
3434
uses: actions/setup-node@v4
@@ -60,4 +60,4 @@ jobs:
6060
run: pnpm build
6161

6262
- name: Testing
63-
run: pnpm test
63+
run: pnpm test:unit

examples/vite/vite.config.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import path from 'path'
1+
import path from 'node:path'
22
import { defineConfig } from 'vite'
33
import vue from '@vitejs/plugin-vue'
44
import vueI18n from '../../packages/unplugin-vue-i18n/src/vite'

package.json

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@
7070
"tiny-glob": "^0.2.9",
7171
"typescript": "^5.6.3",
7272
"typescript-eslint": "^8.13.0",
73-
"vite": "^5.4.10",
73+
"vite": "https://pkg.pr.new/vitejs/rolldown-vite@12e3568",
7474
"vitest": "^2.1.4",
7575
"vue": "^3.2.25",
7676
"vue-i18n": "^11.1.2",
@@ -79,11 +79,19 @@
7979
"vue-loader17": "npm:[email protected]",
8080
"vue-template-compiler": "^2.6.14",
8181
"vue2": "npm:vue@^2.6.14",
82-
"webpack": "^5.88.2",
82+
"webpack": "^5.99.8",
8383
"webpack-cli": "^5.1.4",
8484
"webpack-dev-server": "^4.15.1",
8585
"webpack-merge": "^5.9.0"
8686
},
87+
"pnpm": {
88+
"overrides": {
89+
"rolldown": "https://pkg.pr.new/rolldown@4554"
90+
},
91+
"onlyBuiltDependencies": [
92+
"esbuild"
93+
]
94+
},
8795
"license": "MIT",
8896
"lint-staged": {
8997
"*.js": [
@@ -150,5 +158,5 @@
150158
"release:webpack": "pnpm --filter @intlify/vue-i18n-loader release",
151159
"release:unplugin": "pnpm --filter @intlify/unplugin-vue-i18n release"
152160
},
153-
"packageManager": "pnpm@9.15.1"
161+
"packageManager": "pnpm@10.10.0"
154162
}

packages/bundle-utils/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,10 +22,10 @@
2222
"@intlify/message-compiler": "^11.1.2",
2323
"@intlify/shared": "^11.1.2",
2424
"acorn": "^8.8.2",
25+
"esbuild": "^0.25.4",
2526
"escodegen": "^2.1.0",
2627
"estree-walker": "^2.0.2",
2728
"jsonc-eslint-parser": "^2.3.0",
28-
"mlly": "^1.2.0",
2929
"source-map-js": "^1.0.1",
3030
"yaml-eslint-parser": "^1.2.2"
3131
},

packages/bundle-utils/src/codegen.ts

Lines changed: 13 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,22 @@
1-
import { SourceMapGenerator, SourceMapConsumer } from 'source-map-js'
2-
import {
3-
format,
4-
escapeHtml as sanitizeHtml,
5-
isBoolean,
6-
friendlyJSONstringify
7-
} from '@intlify/shared'
81
import {
92
baseCompile,
103
detectHtmlTag,
114
LOCATION_STUB
125
} from '@intlify/message-compiler'
6+
import {
7+
format,
8+
friendlyJSONstringify,
9+
isBoolean,
10+
escapeHtml as sanitizeHtml
11+
} from '@intlify/shared'
12+
import { SourceMapConsumer, SourceMapGenerator } from 'source-map-js'
1313

14-
import type { RawSourceMap, MappedPosition, MappingItem } from 'source-map-js'
1514
import type {
1615
CompileError,
17-
ResourceNode,
18-
CompileOptions
16+
CompileOptions,
17+
ResourceNode
1918
} from '@intlify/message-compiler'
19+
import type { MappedPosition, MappingItem, RawSourceMap } from 'source-map-js'
2020

2121
/**
2222
* Compilation dev environments
@@ -25,13 +25,13 @@ import type {
2525
*/
2626
export type DevEnv = 'development' | 'production'
2727

28-
export interface Position {
28+
interface Position {
2929
line: number
3030
column: number
3131
offset?: number
3232
}
3333

34-
export interface SourceLocationable {
34+
interface SourceLocationable {
3535
start?: number
3636
loc?: {
3737
start: Position
@@ -44,8 +44,6 @@ export interface SourceLocationable {
4444
*/
4545
export interface CodeGenOptions {
4646
type?: 'plain' | 'sfc' | 'bare'
47-
legacy?: boolean
48-
bridge?: boolean
4947
exportESM?: boolean
5048
onlyLocales?: string[]
5149
source?: string
@@ -75,7 +73,7 @@ export interface CodeGenOptions {
7573
) => void
7674
}
7775

78-
export interface CodeGenContext {
76+
interface CodeGenContext {
7977
source?: string
8078
code: string
8179
indentLevel: number

0 commit comments

Comments
 (0)