Compare commits

...

5 Commits

Author SHA1 Message Date
github-actions[bot]
ce3298d218 Version Packages 2022-08-11 18:24:03 +02:00
Thomas Allmer
a22da493dd fix(building-rollup): apply user provided developmentMode 2022-08-11 18:18:52 +02:00
Thomas Allmer
7a8f165625 chore: refresh lock file 2022-08-11 18:18:52 +02:00
Thomas Allmer
c8081071f7 chore: in readme use us images from main branch 2022-08-11 16:53:18 +02:00
Thomas Allmer
ab2436162c fix(mdjs-preview): add server folder to the published npm package 2022-08-11 16:53:18 +02:00
18 changed files with 2713 additions and 3390 deletions

View File

@@ -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"

View File

@@ -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

View File

@@ -1,6 +1,6 @@
{
"name": "@rocket/building-rollup",
"version": "0.4.0",
"version": "0.4.1",
"publishConfig": {
"access": "public"
},

View File

@@ -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;

View File

@@ -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;

View File

@@ -15,9 +15,6 @@
{
"path": "../plugins-manager/tsconfig.json"
},
{
"path": "../mdjs-core/tsconfig.json"
},
{
"path": "../engine/tsconfig.json"
}

View File

@@ -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,

View File

@@ -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';

View File

@@ -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();
});
});

View File

@@ -14,9 +14,6 @@
"references": [
{
"path": "../plugins-manager/tsconfig.json"
},
{
"path": "../mdjs-core/tsconfig.json"
}
],
"include": [

View File

@@ -15,9 +15,6 @@
{
"path": "../plugins-manager/tsconfig.json"
},
{
"path": "../mdjs-core/tsconfig.json"
},
{
"path": "../engine/tsconfig.json"
},

View File

@@ -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

View File

@@ -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": {

View File

@@ -15,9 +15,6 @@
{
"path": "../plugins-manager/tsconfig.json"
},
{
"path": "../mdjs-core/tsconfig.json"
},
{
"path": "../engine/tsconfig.json"
},

View File

@@ -2529,6 +2529,11 @@
"text": "Simulator states",
"id": "simulator-states",
"level": 2
},
{
"text": "Extending mdjs-preview",
"id": "extending-mdjs-preview",
"level": 2
}
],
"name": "Preview",

View File

@@ -7,9 +7,6 @@
{
"path": "./packages/plugins-manager/tsconfig.json"
},
{
"path": "./packages/mdjs-core/tsconfig.json"
},
{
"path": "./packages/engine/tsconfig.json"
},

View File

@@ -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' },
];

6018
yarn.lock

File diff suppressed because it is too large Load Diff