Skip to content

Commit

Permalink
fix: generate vite cache in user root
Browse files Browse the repository at this point in the history
  • Loading branch information
YunYouJun committed Feb 25, 2024
1 parent 54b9317 commit c29ec16
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 4 deletions.
4 changes: 3 additions & 1 deletion e2e/create-valaxy/index.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,16 +15,18 @@ test.describe('Create Valaxy Demo', () => {
})

test('banner', async ({ page }) => {
await page.goto('/')
await page.waitForSelector('#yun-banner')
await expect(page.locator('.char-box')).toHaveCount(6)
await expect(page.locator('.char-box').nth(0)).toHaveText('云')
})

test('sidebar', async ({ page }) => {
await page.waitForSelector('.sidebar')
await expect(page.locator('.sidebar')).toContainText('Valaxy Theme Yun')
})

test('post list', async ({ page }) => {
await page.waitForSelector('.post-title-link')
await expect(page.locator('.post-title-link')).toHaveText('Hello, Valaxy!')
})

Expand Down
2 changes: 1 addition & 1 deletion e2e/theme-yun/encrypt.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ test.describe('Encrypted Post', () => {
test('encrypted post', async ({ page }) => {
await page.goto('/posts/encrypted-post')

await expect(page.locator('.markdown-body')).toHaveCount(1)
await page.waitForSelector('.markdown-body')
await expect(page.locator('.decrypt-password-container')).toHaveCount(1)

await page.fill('.decrypt-password-container input', 'valaxy')
Expand Down
1 change: 1 addition & 0 deletions packages/valaxy/node/plugins/extendConfig.ts
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,7 @@ export function createConfigPlugin(options: ResolvedValaxyOptions): Plugin {
// root: options.userRoot,
// can not transform valaxy/client/*.ts when use userRoot
root: options.clientRoot,
cacheDir: join(options.userRoot, 'node_modules/.vite'),
publicDir: join(options.userRoot, 'public'),

define: getDefine(options),
Expand Down
4 changes: 2 additions & 2 deletions playwright.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -75,12 +75,12 @@ export default defineConfig({
/* Run your local dev server before starting the tests */
webServer: [
{
command: 'npm run docs:dev',
command: 'pnpm run docs:dev',
url: 'http://localhost:4859',
reuseExistingServer: !process.env.CI,
},
{
command: 'npm run demo',
command: 'pnpm run demo',
url: 'http://localhost:4860',
reuseExistingServer: !process.env.CI,
},
Expand Down

1 comment on commit c29ec16

@github-actions
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🎉 Published on https://yun.valaxy.site as production
🚀 Deployed on https://65db2bf205596cc780ae53cc--valaxy.netlify.app

Please sign in to comment.