sunpeak 0.17.3 → 0.17.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/bin/commands/build.mjs +4 -0
- package/bin/commands/dev.mjs +2 -0
- package/bin/lib/css.mjs +13 -0
- package/package.json +1 -1
- package/template/dist/albums/albums.json +1 -1
- package/template/dist/carousel/carousel.json +1 -1
- package/template/dist/map/map.json +1 -1
- package/template/dist/review/review.json +1 -1
- package/template/tests/e2e/review.spec.ts +7 -5
package/bin/commands/build.mjs
CHANGED
|
@@ -5,6 +5,7 @@ import { createRequire } from 'module';
|
|
|
5
5
|
import { pathToFileURL } from 'url';
|
|
6
6
|
import { toPascalCase } from '../lib/patterns.mjs';
|
|
7
7
|
import { extractResourceExport } from '../lib/extract-resource.mjs';
|
|
8
|
+
import { lightningcssConfig } from '../lib/css.mjs';
|
|
8
9
|
|
|
9
10
|
/**
|
|
10
11
|
* Resolve the ESM entry point for a package from a specific project directory.
|
|
@@ -237,6 +238,9 @@ export async function build(projectRoot = process.cwd(), { quiet = false } = {})
|
|
|
237
238
|
define: {
|
|
238
239
|
'process.env.NODE_ENV': JSON.stringify('production'),
|
|
239
240
|
},
|
|
241
|
+
css: {
|
|
242
|
+
lightningcss: lightningcssConfig,
|
|
243
|
+
},
|
|
240
244
|
resolve: {
|
|
241
245
|
conditions: ['style', 'import', 'module', 'browser', 'default'],
|
|
242
246
|
alias: {
|
package/bin/commands/dev.mjs
CHANGED
|
@@ -8,6 +8,7 @@ import { pathToFileURL } from 'url';
|
|
|
8
8
|
import { spawn } from 'child_process';
|
|
9
9
|
import { getPort } from '../lib/get-port.mjs';
|
|
10
10
|
import { startSandboxServer } from '../lib/sandbox-server.mjs';
|
|
11
|
+
import { lightningcssConfig } from '../lib/css.mjs';
|
|
11
12
|
import { inspectServer } from './inspect.mjs';
|
|
12
13
|
|
|
13
14
|
/**
|
|
@@ -422,6 +423,7 @@ if (import.meta.hot) {
|
|
|
422
423
|
root: projectRoot,
|
|
423
424
|
cacheDir: 'node_modules/.vite-mcp',
|
|
424
425
|
plugins: [react(), tailwindcss(), sunpeakEntryPlugin()],
|
|
426
|
+
css: { lightningcss: lightningcssConfig },
|
|
425
427
|
resolve: {
|
|
426
428
|
alias: {
|
|
427
429
|
'@': path.resolve(projectRoot, 'src'),
|
package/bin/lib/css.mjs
ADDED
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Shared lightningcss configuration for all Vite instances that process Tailwind CSS.
|
|
3
|
+
*
|
|
4
|
+
* Tailwind v4's `@source` directive is consumed by `@tailwindcss/vite` but may
|
|
5
|
+
* still be visible to lightningcss during parsing/minification, producing
|
|
6
|
+
* "Unknown at rule: @source" warnings. Declaring it as a custom at-rule
|
|
7
|
+
* tells lightningcss the rule is intentional.
|
|
8
|
+
*/
|
|
9
|
+
export const lightningcssConfig = {
|
|
10
|
+
customAtRules: {
|
|
11
|
+
source: { prelude: '<string>' },
|
|
12
|
+
},
|
|
13
|
+
};
|
package/package.json
CHANGED
|
@@ -318,7 +318,9 @@ for (const host of hosts) {
|
|
|
318
318
|
const iframe = page.frameLocator('iframe').frameLocator('iframe');
|
|
319
319
|
const publishButton = iframe.locator('button:has-text("Publish")');
|
|
320
320
|
await expect(publishButton).toBeVisible();
|
|
321
|
-
|
|
321
|
+
// Use evaluate to dispatch click directly — Playwright's coordinate-based
|
|
322
|
+
// click can miss the target inside the double cross-origin iframe.
|
|
323
|
+
await publishButton.evaluate((el) => (el as HTMLElement).click());
|
|
322
324
|
|
|
323
325
|
// Should show the server's success message from serverTools mock
|
|
324
326
|
await expect(iframe.locator('text=Completed.')).toBeVisible({ timeout: 10000 });
|
|
@@ -338,7 +340,7 @@ for (const host of hosts) {
|
|
|
338
340
|
const iframe = page.frameLocator('iframe').frameLocator('iframe');
|
|
339
341
|
const cancelButton = iframe.locator('button:has-text("Cancel")');
|
|
340
342
|
await expect(cancelButton).toBeVisible();
|
|
341
|
-
await cancelButton.click();
|
|
343
|
+
await cancelButton.evaluate((el) => (el as HTMLElement).click());
|
|
342
344
|
|
|
343
345
|
// Server returned cancelled status via serverTools when condition
|
|
344
346
|
await expect(iframe.locator('text=Cancelled.')).toBeVisible({ timeout: 10000 });
|
|
@@ -378,7 +380,7 @@ for (const host of hosts) {
|
|
|
378
380
|
const iframe = page.frameLocator('iframe').frameLocator('iframe');
|
|
379
381
|
const placeOrderButton = iframe.locator('button:has-text("Place Order")');
|
|
380
382
|
await expect(placeOrderButton).toBeVisible();
|
|
381
|
-
await placeOrderButton.click();
|
|
383
|
+
await placeOrderButton.evaluate((el) => (el as HTMLElement).click());
|
|
382
384
|
|
|
383
385
|
// After server responds, should show what the user clicked and the server result
|
|
384
386
|
await expect(iframe.locator('text=Placing order...')).toBeVisible({ timeout: 10000 });
|
|
@@ -399,7 +401,7 @@ for (const host of hosts) {
|
|
|
399
401
|
const iframe = page.frameLocator('iframe').frameLocator('iframe');
|
|
400
402
|
const applyButton = iframe.locator('button:has-text("Apply Changes")');
|
|
401
403
|
await expect(applyButton).toBeVisible();
|
|
402
|
-
await applyButton.click();
|
|
404
|
+
await applyButton.evaluate((el) => (el as HTMLElement).click());
|
|
403
405
|
|
|
404
406
|
// Should show the decision label and server response
|
|
405
407
|
await expect(iframe.locator('text=Applying changes...')).toBeVisible({ timeout: 10000 });
|
|
@@ -418,7 +420,7 @@ for (const host of hosts) {
|
|
|
418
420
|
const iframe = page.frameLocator('iframe').frameLocator('iframe');
|
|
419
421
|
const cancelButton = iframe.locator('button:has-text("Cancel")');
|
|
420
422
|
await expect(cancelButton).toBeVisible();
|
|
421
|
-
await cancelButton.click();
|
|
423
|
+
await cancelButton.evaluate((el) => (el as HTMLElement).click());
|
|
422
424
|
|
|
423
425
|
// Server returned cancelled status via when condition matching
|
|
424
426
|
await expect(iframe.locator('text=Cancelled.')).toBeVisible({ timeout: 10000 });
|