-
Notifications
You must be signed in to change notification settings - Fork 164
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'main' into dirname_shims_1115
- Loading branch information
Showing
104 changed files
with
1,626 additions
and
1,060 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
import { build, rspackOnlyTest } from '@e2e/helper'; | ||
import { expect } from '@playwright/test'; | ||
|
||
rspackOnlyTest( | ||
'should allow to use `new URL` to reference script as assets', | ||
async ({ page }) => { | ||
const rsbuild = await build({ | ||
cwd: __dirname, | ||
page, | ||
}); | ||
|
||
const files = await rsbuild.unwrapOutputJSON(); | ||
const filenames = Object.keys(files); | ||
|
||
const test1 = filenames.find((filename) => | ||
filename.includes('dist/static/assets/test1.js'), | ||
); | ||
const test2 = filenames.find((filename) => | ||
filename.includes('dist/static/assets/test2.ts'), | ||
); | ||
const test3 = filenames.find((filename) => | ||
filename.includes('dist/static/assets/test3.mjs'), | ||
); | ||
|
||
expect(test1).toBeDefined(); | ||
expect(test2).toBeDefined(); | ||
expect(test3).toBeDefined(); | ||
|
||
expect(files[test1!]).toEqual('export const test="test1";'); | ||
expect(files[test2!]).toContain(`export const test2: string = 'test2';`); | ||
expect(files[test3!]).toEqual('export const test="test3";'); | ||
|
||
expect(await page.evaluate('window.test1')).toBe( | ||
`http://localhost:${rsbuild.port}/static/assets/test1.js`, | ||
); | ||
expect(await page.evaluate('window.test2')).toBe( | ||
`http://localhost:${rsbuild.port}/static/assets/test2.ts`, | ||
); | ||
expect(await page.evaluate('window.test3')).toBe( | ||
`http://localhost:${rsbuild.port}/static/assets/test3.mjs`, | ||
); | ||
}, | ||
); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
import { defineConfig } from '@rsbuild/core'; | ||
|
||
export default defineConfig({ | ||
output: { | ||
filenameHash: false, | ||
}, | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
const test1 = new URL('./test1.js', import.meta.url).href; | ||
const test2 = new URL('./test2.ts', import.meta.url).href; | ||
const test3 = new URL('./test3.mjs', import.meta.url).href; | ||
|
||
window.test1 = test1; | ||
window.test2 = test2; | ||
window.test3 = test3; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
export const test = 'test1'; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
export const test2: string = 'test2'; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
export const test = 'test3'; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
import { build, rspackOnlyTest } from '@e2e/helper'; | ||
import { expect } from '@playwright/test'; | ||
|
||
rspackOnlyTest( | ||
'should allow to use `new URL` to reference styles as assets', | ||
async ({ page }) => { | ||
const rsbuild = await build({ | ||
cwd: __dirname, | ||
page, | ||
}); | ||
|
||
const files = await rsbuild.unwrapOutputJSON(); | ||
const filenames = Object.keys(files); | ||
|
||
const test1 = filenames.find((filename) => | ||
filename.includes('dist/static/assets/test1.css'), | ||
); | ||
const test2 = filenames.find((filename) => | ||
filename.includes('dist/static/assets/test2.less'), | ||
); | ||
const test3 = filenames.find((filename) => | ||
filename.includes('dist/static/assets/test3.scss'), | ||
); | ||
const test4 = filenames.find((filename) => | ||
filename.includes('dist/static/assets/test4.styl'), | ||
); | ||
|
||
expect(test1).toBeDefined(); | ||
expect(test2).toBeDefined(); | ||
expect(test3).toBeDefined(); | ||
expect(test4).toBeDefined(); | ||
expect(files[test1!]).toContain('body{color:red}'); | ||
expect(files[test2!]).toContain('& .foo'); | ||
expect(files[test3!]).toContain('& .foo'); | ||
expect(files[test4!]).toContain('& .foo'); | ||
expect(await page.evaluate('window.test1')).toBe( | ||
`http://localhost:${rsbuild.port}/static/assets/test1.css`, | ||
); | ||
expect(await page.evaluate('window.test2')).toBe( | ||
`http://localhost:${rsbuild.port}/static/assets/test2.less`, | ||
); | ||
expect(await page.evaluate('window.test3')).toBe( | ||
`http://localhost:${rsbuild.port}/static/assets/test3.scss`, | ||
); | ||
expect(await page.evaluate('window.test4')).toBe( | ||
`http://localhost:${rsbuild.port}/static/assets/test4.styl`, | ||
); | ||
}, | ||
); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
import { defineConfig } from '@rsbuild/core'; | ||
import { pluginLess } from '@rsbuild/plugin-less'; | ||
import { pluginSass } from '@rsbuild/plugin-sass'; | ||
import { pluginStylus } from '@rsbuild/plugin-stylus'; | ||
|
||
export default defineConfig({ | ||
plugins: [pluginLess(), pluginSass(), pluginStylus()], | ||
output: { | ||
filenameHash: false, | ||
}, | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
window.test1 = new URL('./test1.css', import.meta.url).href; | ||
window.test2 = new URL('./test2.less', import.meta.url).href; | ||
window.test3 = new URL('./test3.scss', import.meta.url).href; | ||
window.test4 = new URL('./test4.styl', import.meta.url).href; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
body { | ||
color: red; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
body { | ||
& .foo { | ||
color: blue; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
body { | ||
& .foo { | ||
color: green; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
body { | ||
& .foo { | ||
color: yellow; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
import { build, proxyConsole } from '@e2e/helper'; | ||
import { expect, test } from '@playwright/test'; | ||
|
||
test('should log error module trace', async () => { | ||
const { restore, logs } = proxyConsole(); | ||
|
||
await expect( | ||
build({ | ||
cwd: __dirname, | ||
rsbuildConfig: {}, | ||
}), | ||
).rejects.toThrowError('build failed'); | ||
|
||
expect(logs.some((log) => log.includes('@ ./src/index.tsx'))).toBeTruthy(); | ||
|
||
restore(); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
import './test'; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
import './test1'; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,6 +3,6 @@ | |
"name": "@e2e/vue3", | ||
"version": "1.0.0", | ||
"dependencies": { | ||
"vue": "^3.5.12" | ||
"vue": "^3.5.13" | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -46,11 +46,11 @@ | |
"cross-env": "^7.0.3", | ||
"cspell-ban-words": "^0.0.4", | ||
"nano-staged": "^0.8.0", | ||
"nx": "^20.1.0", | ||
"nx": "^20.1.2", | ||
"prettier": "^3.3.3", | ||
"simple-git-hooks": "^2.11.1", | ||
"typescript": "^5.6.3", | ||
"vitest": "^2.1.4" | ||
"vitest": "^2.1.5" | ||
}, | ||
"packageManager": "[email protected]", | ||
"engines": { | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.