Skip to content

Commit dbe81e2

Browse files
committed
chore: release v0.5.5
1 parent a96b379 commit dbe81e2

File tree

11 files changed

+29
-26
lines changed

11 files changed

+29
-26
lines changed

CHANGELOG.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,8 @@
1+
## 0.5.5 (2025-1-13)
2+
3+
- Fix `vite-plugin` sourcemap missing.
4+
- Fix `babel-plugin` should respect windows.
5+
16
## v0.5.2 (2024-12-23)
27

38
- Synchronize official changes to `rootdir`.

package.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"name": "stylex-extend",
33
"description": "An unofficial stylexjs extension",
4-
"version": "0.5.4",
4+
"version": "0.5.5",
55
"scripts": {
66
"test": "pnpm -r run test"
77
},
@@ -15,8 +15,8 @@
1515
"@stylex-extend/shared": "workspace:*",
1616
"@rollup/plugin-node-resolve": "^15.3.0",
1717
"@stylex-extend/vite": "workspace:*",
18-
"@stylexjs/babel-plugin": "^0.9.3",
19-
"@stylexjs/stylex": "^0.9.3",
18+
"@stylexjs/babel-plugin": "0.9.3",
19+
"@stylexjs/stylex": "0.9.3",
2020
"@swc/core": "^1.5.7",
2121
"@types/node": "^20.11.30",
2222
"dprint": "^0.45.1",

packages/babel-plugin/package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@stylex-extend/babel-plugin",
3-
"version": "0.5.4",
3+
"version": "0.5.5",
44
"description": "A friendly stylex babel plugin extension.",
55
"module": "./dist/index.mjs",
66
"main": "./dist/index.js",
@@ -29,7 +29,7 @@
2929
},
3030
"dependencies": {
3131
"@babel/core": "^7.23.9",
32-
"@stylexjs/shared": "^0.9.3",
32+
"@stylexjs/shared": "0.9.3",
3333
"stylis": "^4.3.1",
3434
"@dual-bundle/import-meta-resolve": "^4.1.0"
3535
},

packages/babel-plugin/src/module.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ const schema = v.object({
2020
unstable_moduleResolution: v.optional(
2121
v.object({
2222
type: v.enum(unstable_moduleResolution),
23-
rootDir: v.string(),
23+
rootDir: v.optional(v.string(), ''),
2424
themeFileExtension: v.optional(v.string(), '.stylex')
2525
}),
2626
{
@@ -118,7 +118,7 @@ function filePathResolver(relativeFilePath: string, sourceFilePath: string, alia
118118

119119
if (relativeFilePath[0] === '.') {
120120
try {
121-
return moduleResolve(importPathStr, url.pathToFileURL(sourceFilePath)).pathname
121+
return url.fileURLToPath(moduleResolve(importPathStr, url.pathToFileURL(sourceFilePath)))
122122
} catch {
123123
continue
124124
}
@@ -127,7 +127,7 @@ function filePathResolver(relativeFilePath: string, sourceFilePath: string, alia
127127
// Otherwise, try to resolve the path with aliases
128128
for (const possiblePath of allAliases) {
129129
try {
130-
return moduleResolve(possiblePath, url.pathToFileURL(sourceFilePath)).pathname
130+
return url.fileURLToPath(moduleResolve(possiblePath, url.pathToFileURL(sourceFilePath)))
131131
} catch {
132132
continue
133133
}

packages/core/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
"main": "dist/index.js",
44
"types": "dist/index.d.ts",
55
"module": "dist/index.mjs",
6-
"version": "0.5.4",
6+
"version": "0.5.5",
77
"license": "MIT",
88
"repository": "https://github.com/nonzzz/stylex-extend.git",
99
"scripts": {

packages/react/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
"main": "./src/index.js",
44
"module": "./src/index.js",
55
"types": "./src/index.d.ts",
6-
"version": "0.5.4",
6+
"version": "0.5.5",
77
"repository": "https://github.com/nonzzz/stylex-extend.git",
88
"license": "MIT",
99
"devDependencies": {

packages/shared/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"name": "@stylex-extend/shared",
33
"description": "Shared utilities for StyleX Extend",
4-
"version": "0.5.4",
4+
"version": "0.5.5",
55
"license": "MIT",
66
"main": "./dist/index.js",
77
"module": "./dist/index.mjs",

packages/vite/package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@stylex-extend/vite",
3-
"version": "0.5.4",
3+
"version": "0.5.5",
44
"main": "./dist/index.js",
55
"module": "./dist/index.mjs",
66
"files": [
@@ -22,7 +22,7 @@
2222
"build": "rollup --config rollup.config.ts --configPlugin swc3"
2323
},
2424
"dependencies": {
25-
"@stylexjs/babel-plugin": "^0.9.3",
25+
"@stylexjs/babel-plugin": "0.9.3",
2626
"@stylex-extend/babel-plugin": "workspace:*",
2727
"@rollup/pluginutils": "^5.1.0",
2828
"@babel/core": "^7.25.2"

packages/vite/src/index.ts

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ import type { Options, Rule } from '@stylexjs/babel-plugin'
1212
import stylexBabelPlugin from '@stylexjs/babel-plugin'
1313
import path from 'path'
1414
import type { HookHandler, Plugin, Update, ViteDevServer } from 'vite'
15-
import { normalizePath, searchForWorkspaceRoot } from 'vite'
15+
import { normalizePath } from 'vite'
1616

1717
type UnionToIntersection<U> = (U extends any ? (k: U) => void : never) extends ((k: infer I) => void) ? I : never
1818
type LastOf<T> = UnionToIntersection<T extends any ? () => T : never> extends () => infer R ? R : never
@@ -263,7 +263,10 @@ export function stylex(options: StyleXOptions = {}): Plugin[] {
263263
// @ts-expect-error safe
264264
plugins: [...(babelConfig?.plugins ?? []), plugin.withOptions(opts.options)],
265265
presets: babelConfig?.presets,
266-
parserOpts: opts.parserOpts ?? {}
266+
parserOpts: opts.parserOpts ?? {},
267+
generatorOpts: {
268+
sourceMaps: true
269+
}
267270
})
268271
}
269272

@@ -333,11 +336,6 @@ export function stylex(options: StyleXOptions = {}): Plugin[] {
333336
}
334337
}
335338

336-
if (!options.unstable_moduleResolution) {
337-
// For monorepo.
338-
options.unstable_moduleResolution = { type: 'commonJS', rootDir: searchForWorkspaceRoot(config.root) }
339-
}
340-
341339
const optimizedDeps = unique([
342340
...Array.isArray(options.optimizedDeps) ? options.optimizedDeps : [],
343341
...Array.isArray(options.importSources) ? options.importSources.map((s) => typeof s === 'string' ? s : s.from) : [],

packages/vue/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
"main": "./index.js",
44
"module": "./index.js",
55
"types": "./index.d.ts",
6-
"version": "0.5.4",
6+
"version": "0.5.5",
77
"license": "MIT",
88
"repository": "https://github.com/nonzzz/stylex-extend.git",
99
"devDependencies": {

0 commit comments

Comments
 (0)