mirror of
https://github.com/modernweb-dev/rocket.git
synced 2026-03-21 08:51:18 +00:00
Compare commits
5 Commits
@rocket/la
...
@mdjs/mdjs
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
ce3298d218 | ||
|
|
a22da493dd | ||
|
|
7a8f165625 | ||
|
|
c8081071f7 | ||
|
|
ab2436162c |
@@ -2,15 +2,15 @@
|
||||
|
||||
<p align="center">
|
||||
<picture width="60%">
|
||||
<source media="(prefers-color-scheme: dark)" srcset="https://raw.githubusercontent.com/modernweb-dev/rocket/next/site/src/assets/rocket-logo-dark-with-text.svg">
|
||||
<img alt="Rocket Logo" src="https://raw.githubusercontent.com/modernweb-dev/rocket/next/site/src/assets/rocket-logo-light-with-text.svg">
|
||||
<source media="(prefers-color-scheme: dark)" srcset="https://raw.githubusercontent.com/modernweb-dev/rocket/main/site/src/assets/rocket-logo-dark-with-text.svg">
|
||||
<img alt="Rocket Logo" src="https://raw.githubusercontent.com/modernweb-dev/rocket/main/site/src/assets/rocket-logo-light-with-text.svg">
|
||||
</picture>
|
||||
</p>
|
||||
|
||||
<p align="center">
|
||||
<a href="https://github.com/modernweb-dev/rocket/actions"
|
||||
><img
|
||||
src="https://img.shields.io/github/workflow/status/modernweb-dev/rocket/Release/next?label=workflow&style=flat-square"
|
||||
src="https://img.shields.io/github/workflow/status/modernweb-dev/rocket/Release/main?label=workflow&style=flat-square"
|
||||
alt="GitHub Actions workflow status"
|
||||
/></a>
|
||||
<a href="https://twitter.com/modern_web_dev"
|
||||
|
||||
@@ -1,5 +1,11 @@
|
||||
# @rocket/building-rollup
|
||||
|
||||
## 0.4.1
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- a22da49: Make sure user provided `developmentMode` actually gets applied.
|
||||
|
||||
## 0.4.0
|
||||
|
||||
### Minor Changes
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@rocket/building-rollup",
|
||||
"version": "0.4.0",
|
||||
"version": "0.4.1",
|
||||
"publishConfig": {
|
||||
"access": "public"
|
||||
},
|
||||
|
||||
@@ -13,7 +13,7 @@ export function createBasicConfig(userConfig) {
|
||||
|
||||
export function createBasicMetaConfig(userConfig = { output: {} }) {
|
||||
const developmentMode =
|
||||
typeof userConfig.developmentMode !== undefined
|
||||
typeof userConfig.developmentMode !== 'undefined'
|
||||
? userConfig.developmentMode
|
||||
: !!process.env.ROLLUP_WATCH;
|
||||
delete userConfig.developmentMode;
|
||||
|
||||
@@ -14,7 +14,7 @@ export function createServiceWorkerConfig(userConfig) {
|
||||
|
||||
export function createServiceWorkerMetaConfig(userConfig = { output: {} }) {
|
||||
const developmentMode =
|
||||
typeof userConfig.developmentMode !== undefined
|
||||
typeof userConfig.developmentMode !== 'undefined'
|
||||
? userConfig.developmentMode
|
||||
: !!process.env.ROLLUP_WATCH;
|
||||
delete userConfig.developmentMode;
|
||||
|
||||
@@ -15,9 +15,6 @@
|
||||
{
|
||||
"path": "../plugins-manager/tsconfig.json"
|
||||
},
|
||||
{
|
||||
"path": "../mdjs-core/tsconfig.json"
|
||||
},
|
||||
{
|
||||
"path": "../engine/tsconfig.json"
|
||||
}
|
||||
|
||||
@@ -46,7 +46,8 @@ export function devServerAdjustAssetUrls({
|
||||
const outputFilePath = getOutputFilePath(sourceFilePath);
|
||||
const sourceRelativeFilePath = path.relative(inputDir, sourceFilePath);
|
||||
const outputRelativeFilePath = path.relative(outputDir, outputFilePath);
|
||||
const newBody = await adjustAssetUrl.transform(context.body, {
|
||||
const body = /** @type {string} */ (context.body);
|
||||
const newBody = await adjustAssetUrl.transform(body, {
|
||||
sourceFilePath,
|
||||
sourceRelativeFilePath,
|
||||
outputFilePath,
|
||||
|
||||
@@ -4,6 +4,7 @@ import 'rehype-prism';
|
||||
import '@lit-labs/ssr/lib/install-global-dom-shim.js';
|
||||
|
||||
/* eslint-disable @typescript-eslint/ban-ts-comment */
|
||||
// @ts-ignore
|
||||
import { mdjsProcess } from '@mdjs/core';
|
||||
import { existsSync } from 'fs';
|
||||
import { readFile, writeFile } from 'fs/promises';
|
||||
|
||||
@@ -179,15 +179,16 @@ test.describe('hydration', async () => {
|
||||
await cleanup();
|
||||
});
|
||||
|
||||
test("55: hydrate onMedia('(min-width: 640px)') || onClick", async ({ page }) => {
|
||||
test("55: hydrate onMedia('(min-width: 640px)') || onClick - on desktop", async ({ page }) => {
|
||||
const { engine, cleanup } = await setupTestEngine(
|
||||
'fixtures/14-components/55-hydration-onMedia-or-onClick/docs',
|
||||
);
|
||||
await engine.start();
|
||||
const { port } = engine.devServer.config;
|
||||
|
||||
// 1. start on small screen
|
||||
await page.setViewportSize({
|
||||
width: 640,
|
||||
width: 320,
|
||||
height: 480,
|
||||
});
|
||||
await page.goto(`localhost:${port}`);
|
||||
@@ -195,25 +196,40 @@ test.describe('hydration', async () => {
|
||||
const hydrated1 = await myEl.getAttribute('hydrated');
|
||||
expect(hydrated1).toBe(null); // not hydrated
|
||||
|
||||
// 2. go bigger
|
||||
await page.setViewportSize({
|
||||
width: 640,
|
||||
height: 480,
|
||||
});
|
||||
await page.waitForLoadState('networkidle0');
|
||||
|
||||
const hydrated2 = await myEl.getAttribute('hydrated');
|
||||
expect(hydrated2).toBe(''); // boolean attribute is there
|
||||
|
||||
// revisit page on "mobile"
|
||||
await cleanup();
|
||||
});
|
||||
|
||||
test("55b: hydrate onMedia('(min-width: 640px)') || onClick - on mobile", async ({ page }) => {
|
||||
const { engine, cleanup } = await setupTestEngine(
|
||||
'fixtures/14-components/55-hydration-onMedia-or-onClick/docs',
|
||||
);
|
||||
await engine.start();
|
||||
const { port } = engine.devServer.config;
|
||||
|
||||
await page.setViewportSize({
|
||||
width: 320,
|
||||
height: 480,
|
||||
});
|
||||
await page.reload();
|
||||
const myEl2 = await page.locator('my-el');
|
||||
const hydrated3 = await myEl2.getAttribute('hydrated');
|
||||
await page.goto(`localhost:${port}`);
|
||||
const myEl = await page.locator('my-el');
|
||||
|
||||
const hydrated3 = await myEl.getAttribute('hydrated');
|
||||
expect(hydrated3).toBe(null); // not hydrated
|
||||
|
||||
await myEl.click();
|
||||
await page.waitForLoadState('networkidle0');
|
||||
|
||||
const hydrated4 = await myEl2.getAttribute('hydrated');
|
||||
const hydrated4 = await myEl.getAttribute('hydrated');
|
||||
expect(hydrated4).toBe(''); // boolean attribute is there
|
||||
|
||||
await cleanup();
|
||||
@@ -243,7 +259,7 @@ test.describe('hydration', async () => {
|
||||
const focusInEv = await myEl.getAttribute('focusin-ev');
|
||||
expect(focusInEv).toBe('');
|
||||
|
||||
// NOTE: focus event is NOT supported as it does not bubble
|
||||
// NOTE: we are using the focusin event as the focus event is NOT supported as it does not bubble
|
||||
await cleanup();
|
||||
});
|
||||
});
|
||||
|
||||
@@ -14,9 +14,6 @@
|
||||
"references": [
|
||||
{
|
||||
"path": "../plugins-manager/tsconfig.json"
|
||||
},
|
||||
{
|
||||
"path": "../mdjs-core/tsconfig.json"
|
||||
}
|
||||
],
|
||||
"include": [
|
||||
|
||||
@@ -15,9 +15,6 @@
|
||||
{
|
||||
"path": "../plugins-manager/tsconfig.json"
|
||||
},
|
||||
{
|
||||
"path": "../mdjs-core/tsconfig.json"
|
||||
},
|
||||
{
|
||||
"path": "../engine/tsconfig.json"
|
||||
},
|
||||
|
||||
@@ -1,5 +1,11 @@
|
||||
# @mdjs/mdjs-preview
|
||||
|
||||
## 0.5.9
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- ab24361: Add server folder to the published npm package
|
||||
|
||||
## 0.5.8
|
||||
|
||||
### Patch Changes
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@mdjs/mdjs-preview",
|
||||
"version": "0.5.8",
|
||||
"version": "0.5.9",
|
||||
"publishConfig": {
|
||||
"access": "public"
|
||||
},
|
||||
@@ -30,6 +30,7 @@
|
||||
"*.js",
|
||||
"assets",
|
||||
"dist-types",
|
||||
"server",
|
||||
"src"
|
||||
],
|
||||
"dependencies": {
|
||||
|
||||
@@ -15,9 +15,6 @@
|
||||
{
|
||||
"path": "../plugins-manager/tsconfig.json"
|
||||
},
|
||||
{
|
||||
"path": "../mdjs-core/tsconfig.json"
|
||||
},
|
||||
{
|
||||
"path": "../engine/tsconfig.json"
|
||||
},
|
||||
|
||||
@@ -2529,6 +2529,11 @@
|
||||
"text": "Simulator states",
|
||||
"id": "simulator-states",
|
||||
"level": 2
|
||||
},
|
||||
{
|
||||
"text": "Extending mdjs-preview",
|
||||
"id": "extending-mdjs-preview",
|
||||
"level": 2
|
||||
}
|
||||
],
|
||||
"name": "Preview",
|
||||
|
||||
@@ -7,9 +7,6 @@
|
||||
{
|
||||
"path": "./packages/plugins-manager/tsconfig.json"
|
||||
},
|
||||
{
|
||||
"path": "./packages/mdjs-core/tsconfig.json"
|
||||
},
|
||||
{
|
||||
"path": "./packages/engine/tsconfig.json"
|
||||
},
|
||||
|
||||
@@ -6,7 +6,7 @@ const packages = [
|
||||
{ name: 'search', type: 'js', environment: 'node-esm' },
|
||||
// { name: 'check-html-links', type: 'js', environment: 'node-esm' },
|
||||
// { name: 'drawer', type: 'js', environment: 'browser' },
|
||||
{ name: 'mdjs-core', type: 'js', environment: 'node' },
|
||||
// { name: 'mdjs-core', type: 'js', environment: 'node' },
|
||||
// { name: 'mdjs-preview', type: 'js', environment: 'browser' },
|
||||
// { name: 'mdjs-story', type: 'js', environment: 'browser' },
|
||||
];
|
||||
|
||||
Reference in New Issue
Block a user