mirror of
https://github.com/modernweb-dev/rocket.git
synced 2026-03-21 15:54:57 +00:00
Compare commits
14 Commits
@rocket/cl
...
@mdjs/mdjs
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
509a8d9115 | ||
|
|
42418f2c00 | ||
|
|
cadd8588b0 | ||
|
|
aabe011427 | ||
|
|
e1089c5701 | ||
|
|
9f10386eb2 | ||
|
|
0987a41620 | ||
|
|
7301a0f354 | ||
|
|
5ac6aa6693 | ||
|
|
9f1633cccc | ||
|
|
00f4a91550 | ||
|
|
eb62dd9fd5 | ||
|
|
bb07267289 | ||
|
|
738941afdd |
@@ -19,6 +19,9 @@ html {
|
|||||||
--primary-color: rgb(44, 62, 80);
|
--primary-color: rgb(44, 62, 80);
|
||||||
--primary-lines-color: #ccc;
|
--primary-lines-color: #ccc;
|
||||||
--primary-text-color: #2c3e50;
|
--primary-text-color: #2c3e50;
|
||||||
|
--primary-text-inverse-color: #eee;
|
||||||
|
--switch-unselected-color: #808080;
|
||||||
|
--switch-selected-color: #42b983;
|
||||||
}
|
}
|
||||||
|
|
||||||
@media (prefers-color-scheme: dark) {
|
@media (prefers-color-scheme: dark) {
|
||||||
@@ -45,6 +48,9 @@ html {
|
|||||||
--rocket-search-highlight-color: #41ffb0;
|
--rocket-search-highlight-color: #41ffb0;
|
||||||
--rocket-search-hover-background-color: #6b717a;
|
--rocket-search-hover-background-color: #6b717a;
|
||||||
--rocket-search-fill-color: #fff;
|
--rocket-search-fill-color: #fff;
|
||||||
|
--primary-text-inverse-color: #2c3e50;
|
||||||
|
--switch-unselected-color: #808080;
|
||||||
|
--switch-selected-color: #42b983;
|
||||||
|
|
||||||
/* Markdown */
|
/* Markdown */
|
||||||
--markdown-octicon-link: var(--primary-text-color);
|
--markdown-octicon-link: var(--primary-text-color);
|
||||||
|
|||||||
@@ -107,3 +107,60 @@ export default ({
|
|||||||
});
|
});
|
||||||
```
|
```
|
||||||
<!-- prettier-ignore-end -->
|
<!-- prettier-ignore-end -->
|
||||||
|
|
||||||
|
## Advanced
|
||||||
|
|
||||||
|
Sometimes you need even more control over specific settings.
|
||||||
|
|
||||||
|
### Rollup
|
||||||
|
|
||||||
|
For example if you wanna add an `acron` plugin to rollup
|
||||||
|
|
||||||
|
<!-- prettier-ignore-start -->
|
||||||
|
```js
|
||||||
|
import { importAssertions } from 'acorn-import-assertions';
|
||||||
|
|
||||||
|
/** @type {import('rocket/cli').RocketCliConfig} */
|
||||||
|
export default ({
|
||||||
|
rollup: config => ({
|
||||||
|
...config,
|
||||||
|
acornInjectPlugins: [importAssertions],
|
||||||
|
}),
|
||||||
|
});
|
||||||
|
```
|
||||||
|
<!-- prettier-ignore-end -->
|
||||||
|
|
||||||
|
### Eleventy
|
||||||
|
|
||||||
|
For example to add custom filter you can access the eleventy config directly
|
||||||
|
|
||||||
|
<!-- prettier-ignore-start -->
|
||||||
|
```js
|
||||||
|
/** @type {import('rocket/cli').RocketCliConfig} */
|
||||||
|
export default ({
|
||||||
|
eleventy: eleventyConfig => {
|
||||||
|
eleventyConfig.addFilter('value', value => `prefix${value}`);
|
||||||
|
},
|
||||||
|
});
|
||||||
|
```
|
||||||
|
<!-- prettier-ignore-end -->
|
||||||
|
|
||||||
|
You even have access to the full rocketConfig if you for example want to create filters that behave differently during start/build.
|
||||||
|
|
||||||
|
<!-- prettier-ignore-start -->
|
||||||
|
```js
|
||||||
|
/** @type {import('rocket/cli').RocketCliConfig} */
|
||||||
|
export default ({
|
||||||
|
eleventy: (config, rocketConfig) => {
|
||||||
|
config.addFilter('conditional-resolve', value => {
|
||||||
|
if (rocketConfig.command === 'build') {
|
||||||
|
return `build:${value}`;
|
||||||
|
}
|
||||||
|
if (rocketConfig.command === 'start') {
|
||||||
|
return `start:${value}`;
|
||||||
|
}
|
||||||
|
});
|
||||||
|
},
|
||||||
|
});
|
||||||
|
```
|
||||||
|
<!-- prettier-ignore-end -->
|
||||||
|
|||||||
@@ -42,11 +42,13 @@ eleventyExcludeFromCollections: true
|
|||||||
<?xml version="1.0" encoding="utf-8"?>
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">
|
<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">
|
||||||
{% raw %}{% for page in collections.all %}
|
{% raw %}{% for page in collections.all %}
|
||||||
|
{%- if page.url !== '/404.html' -%}
|
||||||
<url>
|
<url>
|
||||||
<loc>{{ rocketConfig.absoluteBaseUrl }}{{ page.url | url }}</loc>
|
<loc>{{ rocketConfig.absoluteBaseUrl }}{{ page.url | url }}</loc>
|
||||||
<lastmod>{{ page.date.toISOString() }}</lastmod>
|
<lastmod>{{ page.date.toISOString() }}</lastmod>
|
||||||
<changefreq>{{ page.data.changeFreq if page.data.changeFreq else "monthly" }}</changefreq>
|
<changefreq>{{ page.data.changeFreq if page.data.changeFreq else "monthly" }}</changefreq>
|
||||||
</url>
|
</url>
|
||||||
|
{%- endif -%}
|
||||||
{% endfor %}{% endraw %}
|
{% endfor %}{% endraw %}
|
||||||
</urlset>
|
</urlset>
|
||||||
```
|
```
|
||||||
|
|||||||
@@ -1,5 +1,17 @@
|
|||||||
# @rocket/blog
|
# @rocket/blog
|
||||||
|
|
||||||
|
## 0.3.3
|
||||||
|
|
||||||
|
### Patch Changes
|
||||||
|
|
||||||
|
- e1089c5: add title to blog page
|
||||||
|
|
||||||
|
## 0.3.2
|
||||||
|
|
||||||
|
### Patch Changes
|
||||||
|
|
||||||
|
- 00f4a91: alignment + spacings for article grids
|
||||||
|
|
||||||
## 0.3.1
|
## 0.3.1
|
||||||
|
|
||||||
### Patch Changes
|
### Patch Changes
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "@rocket/blog",
|
"name": "@rocket/blog",
|
||||||
"version": "0.3.1",
|
"version": "0.3.3",
|
||||||
"publishConfig": {
|
"publishConfig": {
|
||||||
"access": "public"
|
"access": "public"
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -20,6 +20,8 @@ body[layout='layout-blog-details'] #sidebar-nav li.anchor a:hover::before {
|
|||||||
flex-wrap: wrap;
|
flex-wrap: wrap;
|
||||||
margin: calc(-1 * var(--gap)) 0 0 calc(-1 * var(--gap));
|
margin: calc(-1 * var(--gap)) 0 0 calc(-1 * var(--gap));
|
||||||
width: calc(100% + var(--gap));
|
width: calc(100% + var(--gap));
|
||||||
|
|
||||||
|
align-items: flex-start;
|
||||||
}
|
}
|
||||||
|
|
||||||
.articles article {
|
.articles article {
|
||||||
@@ -32,6 +34,12 @@ body[layout='layout-blog-details'] #sidebar-nav li.anchor a:hover::before {
|
|||||||
.articles article h2 {
|
.articles article h2 {
|
||||||
margin: 0;
|
margin: 0;
|
||||||
border: none;
|
border: none;
|
||||||
|
padding-top: 1rem;
|
||||||
|
}
|
||||||
|
|
||||||
|
.articles article .thumbnail {
|
||||||
|
display: block;
|
||||||
|
height: 200px;
|
||||||
}
|
}
|
||||||
|
|
||||||
.articles article .read {
|
.articles article .read {
|
||||||
@@ -48,7 +56,7 @@ body[layout='layout-blog-details'] #sidebar-nav li.anchor a:hover::before {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@media screen and (min-width: 1024px) {
|
@media screen and (min-width: 1024px) {
|
||||||
body[layout='layout-blog-details'] #sidebar {
|
body[layout='layout-blog-details'] #sidebar {
|
||||||
display: block;
|
display: block;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,3 +1,6 @@
|
|||||||
|
{% if title %}
|
||||||
|
<h1>{{title}}</h1>
|
||||||
|
{% endif %}
|
||||||
{% if cover_image %}
|
{% if cover_image %}
|
||||||
<img src="{{ cover_image | url }}" alt="">
|
<img src="{{ cover_image | url }}" alt="">
|
||||||
{% endif %}
|
{% endif %}
|
||||||
|
|||||||
@@ -3,8 +3,7 @@
|
|||||||
{% if post.data.published %}
|
{% if post.data.published %}
|
||||||
<article>
|
<article>
|
||||||
{% if post.data.cover_image %}
|
{% if post.data.cover_image %}
|
||||||
<a href="{{ post.url | url }}">
|
<a href="{{ post.url | url }}" class="thumbnail" style="background-image: url({{ post.data.cover_image | url }});">
|
||||||
<img src="{{ post.data.cover_image | url }}" alt="">
|
|
||||||
</a>
|
</a>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
<div class="content">
|
<div class="content">
|
||||||
|
|||||||
@@ -1 +1,9 @@
|
|||||||
<link rel="stylesheet" href="{{ '/_assets/rocket-blog.css' | asset | url }}">
|
<link rel="stylesheet" href="{{ '/_assets/rocket-blog.css' | asset | url }}">
|
||||||
|
{%- if layout == 'layout-blog-overview' -%}
|
||||||
|
<style>
|
||||||
|
.articles article .thumbnail {
|
||||||
|
background-size: cover;
|
||||||
|
background-position: center;
|
||||||
|
}
|
||||||
|
</style>
|
||||||
|
{%- endif -%}
|
||||||
|
|||||||
@@ -1,5 +1,31 @@
|
|||||||
# @rocket/cli
|
# @rocket/cli
|
||||||
|
|
||||||
|
## 0.9.11
|
||||||
|
|
||||||
|
### Patch Changes
|
||||||
|
|
||||||
|
- 7301a0f: Pass on rocketConfig to the eleventy function to enable conditional configurations/filters
|
||||||
|
- 42418f2: Disable the service worker for local development
|
||||||
|
- 5ac6aa6: Set the encoding of the simulator to utf8 via a html meta tag
|
||||||
|
|
||||||
|
## 0.9.10
|
||||||
|
|
||||||
|
### Patch Changes
|
||||||
|
|
||||||
|
- 738941a: In `rocket.config.js` you can now supply a rollup config function.
|
||||||
|
|
||||||
|
```js
|
||||||
|
export default {
|
||||||
|
rollup: config => {
|
||||||
|
// config will be the fully generated config object after all presets have been applied
|
||||||
|
if (config.plugins.includes('...')) {
|
||||||
|
// change some config options
|
||||||
|
}
|
||||||
|
return config;
|
||||||
|
},
|
||||||
|
};
|
||||||
|
```
|
||||||
|
|
||||||
## 0.9.9
|
## 0.9.9
|
||||||
|
|
||||||
### Patch Changes
|
### Patch Changes
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "@rocket/cli",
|
"name": "@rocket/cli",
|
||||||
"version": "0.9.9",
|
"version": "0.9.11",
|
||||||
"publishConfig": {
|
"publishConfig": {
|
||||||
"access": "public"
|
"access": "public"
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -4,4 +4,6 @@
|
|||||||
window.__rocketServiceWorkerUrl = '{{ rocketServiceWorkerUrl | url }}';
|
window.__rocketServiceWorkerUrl = '{{ rocketServiceWorkerUrl | url }}';
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
|
{% if rocketConfig.command == 'build' %}
|
||||||
<script type="module" inject-service-worker="" src="{{ '/_assets/scripts/registerServiceWorker.js' | asset | url }}"></script>
|
<script type="module" inject-service-worker="" src="{{ '/_assets/scripts/registerServiceWorker.js' | asset | url }}"></script>
|
||||||
|
{% endif %}
|
||||||
|
|||||||
@@ -1,6 +1,7 @@
|
|||||||
<html theme="light" platform="web" lang="en">
|
<html theme="light" platform="web" lang="en">
|
||||||
<head>
|
<head>
|
||||||
<meta name="viewport" content="width=device-width, initial-scale=1" />
|
<meta name="viewport" content="width=device-width, initial-scale=1">
|
||||||
|
<meta charset="utf-8">
|
||||||
<style type="text/css">
|
<style type="text/css">
|
||||||
body {
|
body {
|
||||||
margin: 0;
|
margin: 0;
|
||||||
|
|||||||
@@ -54,8 +54,8 @@ async function productionBuild(config) {
|
|||||||
...config.setupBuildPlugins,
|
...config.setupBuildPlugins,
|
||||||
],
|
],
|
||||||
});
|
});
|
||||||
|
const finalConfig = typeof config.rollup === 'function' ? config.rollup(mpaConfig) : mpaConfig;
|
||||||
await buildAndWrite(mpaConfig);
|
await buildAndWrite(finalConfig);
|
||||||
|
|
||||||
const serviceWorkerSourcePath = path.resolve('docs/_merged_assets/service-worker.js');
|
const serviceWorkerSourcePath = path.resolve('docs/_merged_assets/service-worker.js');
|
||||||
if (fs.existsSync(serviceWorkerSourcePath)) {
|
if (fs.existsSync(serviceWorkerSourcePath)) {
|
||||||
|
|||||||
@@ -69,7 +69,7 @@ module.exports = function (eleventyConfig) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (config.eleventy) {
|
if (config.eleventy) {
|
||||||
const returnValue = config.eleventy(eleventyConfig);
|
const returnValue = config.eleventy(eleventyConfig, config);
|
||||||
if (returnValue) {
|
if (returnValue) {
|
||||||
const returnString = JSON.stringify(returnValue, null, 2);
|
const returnString = JSON.stringify(returnValue, null, 2);
|
||||||
const msg = [
|
const msg = [
|
||||||
|
|||||||
@@ -188,4 +188,39 @@ describe('RocketCli e2e', () => {
|
|||||||
errorMatch: /Found 1 missing reference targets/,
|
errorMatch: /Found 1 missing reference targets/,
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
|
it('can completely take over the rollup config', async () => {
|
||||||
|
cli = await executeBuild('e2e-fixtures/rollup-override/rocket.config.js');
|
||||||
|
|
||||||
|
const indexHtml = await readBuildOutput(cli, 'index.html', {
|
||||||
|
stripToBody: true,
|
||||||
|
formatHtml: true,
|
||||||
|
});
|
||||||
|
expect(indexHtml).to.equal(
|
||||||
|
[
|
||||||
|
'<h1 id="importing-foo">',
|
||||||
|
' <a aria-hidden="true" tabindex="-1" href="#importing-foo"><span class="icon icon-link"></span></a',
|
||||||
|
' >Importing foo',
|
||||||
|
'</h1>',
|
||||||
|
'',
|
||||||
|
'<script type="module" src="./7338509a.js" mdjs-setup=""></script>',
|
||||||
|
].join('\n'),
|
||||||
|
);
|
||||||
|
});
|
||||||
|
|
||||||
|
describe('can adjust the eleventy config while having access to the rocketConfig', () => {
|
||||||
|
it('testing start', async () => {
|
||||||
|
cli = await executeStart('e2e-fixtures/adjust-eleventy-config/rocket.config.js');
|
||||||
|
const indexHtml = await readStartOutput(cli, 'index.html');
|
||||||
|
expect(indexHtml).to.equal('<p><a href="start:/path/to/page/">link</a></p>');
|
||||||
|
});
|
||||||
|
|
||||||
|
it('testing build', async () => {
|
||||||
|
cli = await executeBuild('e2e-fixtures/adjust-eleventy-config/rocket.config.js');
|
||||||
|
const indexBuildHtml = await readBuildOutput(cli, 'index.html', {
|
||||||
|
stripToBody: true,
|
||||||
|
});
|
||||||
|
expect(indexBuildHtml).to.equal('<p><a href="build:/path/to/page/">link</a></p>');
|
||||||
|
});
|
||||||
|
});
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -19,7 +19,7 @@ describe('RocketCli preset', () => {
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
it('offers a default layout (with head, header, content, footer, bottom) and raw layout', async () => {
|
it.only('offers a default layout (with head, header, content, footer, bottom) and raw layout', async () => {
|
||||||
cli = await executeStart('preset-fixtures/default/rocket.config.js');
|
cli = await executeStart('preset-fixtures/default/rocket.config.js');
|
||||||
|
|
||||||
const rawHtml = await readStartOutput(cli, 'raw/index.html');
|
const rawHtml = await readStartOutput(cli, 'raw/index.html');
|
||||||
@@ -86,12 +86,6 @@ describe('RocketCli preset', () => {
|
|||||||
' </div>',
|
' </div>',
|
||||||
'',
|
'',
|
||||||
' <footer id="main-footer"></footer>',
|
' <footer id="main-footer"></footer>',
|
||||||
'',
|
|
||||||
' <script',
|
|
||||||
' type="module"',
|
|
||||||
' inject-service-worker=""',
|
|
||||||
' src="/_merged_assets/scripts/registerServiceWorker.js"',
|
|
||||||
' ></script>',
|
|
||||||
' </body>',
|
' </body>',
|
||||||
'</html>',
|
'</html>',
|
||||||
].join('\n'),
|
].join('\n'),
|
||||||
|
|||||||
@@ -31,7 +31,7 @@ describe('RocketCli e2e', () => {
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
it('will add a script to inject the service worker', async () => {
|
it.only('will add a script to inject the service worker', async () => {
|
||||||
cli = await executeBuild('e2e-fixtures/service-worker/rocket.config.js');
|
cli = await executeBuild('e2e-fixtures/service-worker/rocket.config.js');
|
||||||
const indexHtml = await readStartOutput(cli, 'index.html');
|
const indexHtml = await readStartOutput(cli, 'index.html');
|
||||||
const indexInject = getInjectServiceWorker(indexHtml);
|
const indexInject = getInjectServiceWorker(indexHtml);
|
||||||
|
|||||||
@@ -0,0 +1 @@
|
|||||||
|
**/*.njk
|
||||||
@@ -0,0 +1,5 @@
|
|||||||
|
---
|
||||||
|
layout: layout-raw
|
||||||
|
---
|
||||||
|
|
||||||
|
<a href="{{ '/path/to/page/' | conditional-resolve }}">link</a>
|
||||||
@@ -0,0 +1,15 @@
|
|||||||
|
/** @type {Partial<import("../../../types/main").RocketCliOptions>} */
|
||||||
|
const config = {
|
||||||
|
eleventy: (config, rocketConfig) => {
|
||||||
|
config.addFilter('conditional-resolve', value => {
|
||||||
|
if (rocketConfig.command === 'build') {
|
||||||
|
return `build:${value}`;
|
||||||
|
}
|
||||||
|
if (rocketConfig.command === 'start') {
|
||||||
|
return `start:${value}`;
|
||||||
|
}
|
||||||
|
});
|
||||||
|
},
|
||||||
|
};
|
||||||
|
|
||||||
|
export default config;
|
||||||
@@ -0,0 +1 @@
|
|||||||
|
**/*.njk
|
||||||
@@ -0,0 +1,11 @@
|
|||||||
|
---
|
||||||
|
layout: layout-raw
|
||||||
|
---
|
||||||
|
|
||||||
|
# Importing foo
|
||||||
|
|
||||||
|
```js script
|
||||||
|
import { foo } from './not-foo.js';
|
||||||
|
|
||||||
|
console.log(foo);
|
||||||
|
```
|
||||||
@@ -0,0 +1 @@
|
|||||||
|
export const notFoo = 'not-foo';
|
||||||
@@ -0,0 +1,11 @@
|
|||||||
|
// @ts-no-check
|
||||||
|
|
||||||
|
/** @type {Partial<import("../../../types/main").RocketCliOptions>} */
|
||||||
|
const config = {
|
||||||
|
rollup: config => ({
|
||||||
|
...config,
|
||||||
|
shimMissingExports: true,
|
||||||
|
}),
|
||||||
|
};
|
||||||
|
|
||||||
|
export default config;
|
||||||
1
packages/cli/types/main.d.ts
vendored
1
packages/cli/types/main.d.ts
vendored
@@ -40,6 +40,7 @@ export interface RocketCliOptions extends Pick<RocketPreset, PresetKeys> {
|
|||||||
start?: RocketStartConfig;
|
start?: RocketStartConfig;
|
||||||
|
|
||||||
// advanced
|
// advanced
|
||||||
|
rollup?: (config: any) => void; // TODO: improve
|
||||||
devServer?: DevServerConfig;
|
devServer?: DevServerConfig;
|
||||||
eleventy?: (eleventyConfig: any) => void; // TODO: improve
|
eleventy?: (eleventyConfig: any) => void; // TODO: improve
|
||||||
plugins?: RocketPlugin[];
|
plugins?: RocketPlugin[];
|
||||||
|
|||||||
@@ -1,5 +1,11 @@
|
|||||||
# @rocket/launch
|
# @rocket/launch
|
||||||
|
|
||||||
|
## 0.5.6
|
||||||
|
|
||||||
|
### Patch Changes
|
||||||
|
|
||||||
|
- 0987a41: Fix styling in darkmode
|
||||||
|
|
||||||
## 0.5.5
|
## 0.5.5
|
||||||
|
|
||||||
### Patch Changes
|
### Patch Changes
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "@rocket/launch",
|
"name": "@rocket/launch",
|
||||||
"version": "0.5.5",
|
"version": "0.5.6",
|
||||||
"publishConfig": {
|
"publishConfig": {
|
||||||
"access": "public"
|
"access": "public"
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -5,6 +5,7 @@ html {
|
|||||||
--primary-color-accent: #cee5f6;
|
--primary-color-accent: #cee5f6;
|
||||||
--primary-text-color: #2c3e50;
|
--primary-text-color: #2c3e50;
|
||||||
--primary-lines-color: #ccc;
|
--primary-lines-color: #ccc;
|
||||||
|
--primary-text-inverse-color: #eee;
|
||||||
|
|
||||||
/* Contrast colors */
|
/* Contrast colors */
|
||||||
--contrast-color-light: #fff;
|
--contrast-color-light: #fff;
|
||||||
@@ -19,6 +20,10 @@ html {
|
|||||||
--primary-font-family: 'Open Sans', sans-serif;
|
--primary-font-family: 'Open Sans', sans-serif;
|
||||||
--secondary-font-family: 'Montserrat', sans-serif;
|
--secondary-font-family: 'Montserrat', sans-serif;
|
||||||
--monospace-font-family: 'SFMono-Regular', 'Consolas', 'Liberation Mono', 'Menlo', 'Courier', monospace;
|
--monospace-font-family: 'SFMono-Regular', 'Consolas', 'Liberation Mono', 'Menlo', 'Courier', monospace;
|
||||||
|
|
||||||
|
/* controls */
|
||||||
|
--switch-unselected-color: #808080;
|
||||||
|
--switch-selected-color: #42b983;
|
||||||
}
|
}
|
||||||
|
|
||||||
html.dark {
|
html.dark {
|
||||||
@@ -27,6 +32,7 @@ html.dark {
|
|||||||
--primary-color-darker: #a22831;
|
--primary-color-darker: #a22831;
|
||||||
--primary-color-accent: #cee5f6;
|
--primary-color-accent: #cee5f6;
|
||||||
--primary-text-color: #eee;
|
--primary-text-color: #eee;
|
||||||
|
--primary-text-inverse-color: #2c3e50;
|
||||||
|
|
||||||
/* Contrast colors */
|
/* Contrast colors */
|
||||||
--contrast-color-light: #fff;
|
--contrast-color-light: #fff;
|
||||||
@@ -39,6 +45,10 @@ html.dark {
|
|||||||
/* typography */
|
/* typography */
|
||||||
--text-color: white;
|
--text-color: white;
|
||||||
|
|
||||||
|
/* controls */
|
||||||
|
--switch-unselected-color: #808080;
|
||||||
|
--switch-selected-color: #42b983;
|
||||||
|
|
||||||
/* markdown */
|
/* markdown */
|
||||||
--markdown-octicon-link: white;
|
--markdown-octicon-link: white;
|
||||||
--markdown-syntax-background-color: #a0a0a0;
|
--markdown-syntax-background-color: #a0a0a0;
|
||||||
|
|||||||
@@ -19,7 +19,7 @@ describe('RocketLaunch preset', () => {
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
it('sets layout-sidebar as default', async () => {
|
it.only('sets layout-sidebar as default', async () => {
|
||||||
cli = await executeStart('fixtures/layout-sidebar/rocket.config.js');
|
cli = await executeStart('fixtures/layout-sidebar/rocket.config.js');
|
||||||
|
|
||||||
const indexHtml = await readStartOutput(cli, 'page/index.html', {
|
const indexHtml = await readStartOutput(cli, 'page/index.html', {
|
||||||
@@ -244,12 +244,6 @@ describe('RocketLaunch preset', () => {
|
|||||||
' </footer>',
|
' </footer>',
|
||||||
'',
|
'',
|
||||||
' <script type="module" src="/_merged_assets/scripts/init-navigation.js"></script>',
|
' <script type="module" src="/_merged_assets/scripts/init-navigation.js"></script>',
|
||||||
'',
|
|
||||||
' <script',
|
|
||||||
' type="module"',
|
|
||||||
' inject-service-worker=""',
|
|
||||||
' src="/_merged_assets/scripts/registerServiceWorker.js"',
|
|
||||||
' ></script>',
|
|
||||||
' </body>',
|
' </body>',
|
||||||
'</html>',
|
'</html>',
|
||||||
].join('\n'),
|
].join('\n'),
|
||||||
|
|||||||
@@ -1,5 +1,12 @@
|
|||||||
# @mdjs/mdjs-preview
|
# @mdjs/mdjs-preview
|
||||||
|
|
||||||
|
## 0.5.2
|
||||||
|
|
||||||
|
### Patch Changes
|
||||||
|
|
||||||
|
- 0987a41: - Make [slot="content"] selector more specific
|
||||||
|
- 0987a41: Fix styling in darkmode
|
||||||
|
|
||||||
## 0.5.1
|
## 0.5.1
|
||||||
|
|
||||||
### Patch Changes
|
### Patch Changes
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "@mdjs/mdjs-preview",
|
"name": "@mdjs/mdjs-preview",
|
||||||
"version": "0.5.1",
|
"version": "0.5.2",
|
||||||
"publishConfig": {
|
"publishConfig": {
|
||||||
"access": "public"
|
"access": "public"
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -652,7 +652,7 @@ export class MdJsPreview extends ScopedElementsMixin(LitElement) {
|
|||||||
|
|
||||||
[part='copy-button']:hover {
|
[part='copy-button']:hover {
|
||||||
background-color: var(--primary-color, #3f51b5);
|
background-color: var(--primary-color, #3f51b5);
|
||||||
color: #fff;
|
color: var(--primary-text-inverse-color, #eee);
|
||||||
}
|
}
|
||||||
|
|
||||||
.switch {
|
.switch {
|
||||||
@@ -668,7 +668,7 @@ export class MdJsPreview extends ScopedElementsMixin(LitElement) {
|
|||||||
[part='switch-button'] {
|
[part='switch-button'] {
|
||||||
display: inline-block;
|
display: inline-block;
|
||||||
width: 44px;
|
width: 44px;
|
||||||
background: #808080;
|
background: var(--switch-unselected-color, #808080);
|
||||||
height: 25px;
|
height: 25px;
|
||||||
border-radius: 15px;
|
border-radius: 15px;
|
||||||
position: relative;
|
position: relative;
|
||||||
@@ -687,7 +687,7 @@ export class MdJsPreview extends ScopedElementsMixin(LitElement) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
.switch.selected [part='switch-button'] {
|
.switch.selected [part='switch-button'] {
|
||||||
background: var(--primary-color, #008000);
|
background: var(--switch-selected-color, #42b983);
|
||||||
}
|
}
|
||||||
|
|
||||||
.switch.selected [part='switch-button']::after {
|
.switch.selected [part='switch-button']::after {
|
||||||
@@ -699,7 +699,7 @@ export class MdJsPreview extends ScopedElementsMixin(LitElement) {
|
|||||||
margin: -5px 0 10px 0;
|
margin: -5px 0 10px 0;
|
||||||
text-align: right;
|
text-align: right;
|
||||||
font-size: 12px;
|
font-size: 12px;
|
||||||
color: #333;
|
color: var(--primary-text-color, #2c3e50);
|
||||||
}
|
}
|
||||||
|
|
||||||
.settings-wrapper {
|
.settings-wrapper {
|
||||||
@@ -748,7 +748,7 @@ export class MdJsPreview extends ScopedElementsMixin(LitElement) {
|
|||||||
|
|
||||||
.simulation-toggle:hover {
|
.simulation-toggle:hover {
|
||||||
background-color: var(--primary-color, #3f51b5);
|
background-color: var(--primary-color, #3f51b5);
|
||||||
color: #fff;
|
color: var(--primary-text-inverse-color, #eee);
|
||||||
}
|
}
|
||||||
|
|
||||||
h3[slot='invoker'] button {
|
h3[slot='invoker'] button {
|
||||||
@@ -759,6 +759,7 @@ export class MdJsPreview extends ScopedElementsMixin(LitElement) {
|
|||||||
border: none;
|
border: none;
|
||||||
border-bottom: 1px solid #bbb;
|
border-bottom: 1px solid #bbb;
|
||||||
width: 100%;
|
width: 100%;
|
||||||
|
color: var(--primary-text-color, #2c3e50);
|
||||||
background: none;
|
background: none;
|
||||||
text-align: left;
|
text-align: left;
|
||||||
font-weight: bold;
|
font-weight: bold;
|
||||||
@@ -780,7 +781,7 @@ export class MdJsPreview extends ScopedElementsMixin(LitElement) {
|
|||||||
border-bottom: none;
|
border-bottom: none;
|
||||||
}
|
}
|
||||||
|
|
||||||
[slot='content'] {
|
.options > [slot='content'] {
|
||||||
border-bottom: 1px solid #bbb;
|
border-bottom: 1px solid #bbb;
|
||||||
padding: 10px;
|
padding: 10px;
|
||||||
}
|
}
|
||||||
@@ -820,7 +821,7 @@ export class MdJsPreview extends ScopedElementsMixin(LitElement) {
|
|||||||
|
|
||||||
.segmented-control label.selected span {
|
.segmented-control label.selected span {
|
||||||
background: var(--primary-color, #3f51b5);
|
background: var(--primary-color, #3f51b5);
|
||||||
color: #fff;
|
color: var(--primary-text-inverse-color, #eee);
|
||||||
}
|
}
|
||||||
|
|
||||||
.segmented-control label:focus-within span {
|
.segmented-control label:focus-within span {
|
||||||
|
|||||||
@@ -1,5 +1,6 @@
|
|||||||
/* eslint-disable */
|
/* eslint-disable */
|
||||||
import { readdirSync, existsSync, readFileSync } from 'fs';
|
import { readdirSync, existsSync, readFileSync } from 'fs';
|
||||||
|
import semver from 'semver';
|
||||||
|
|
||||||
const getDirectories = source =>
|
const getDirectories = source =>
|
||||||
readdirSync(source, { withFileTypes: true })
|
readdirSync(source, { withFileTypes: true })
|
||||||
@@ -35,7 +36,12 @@ function compareVersions(versionsA, versionsB) {
|
|||||||
let output = '';
|
let output = '';
|
||||||
const newVersions = { ...versionsA };
|
const newVersions = { ...versionsA };
|
||||||
Object.keys(versionsB).forEach(dep => {
|
Object.keys(versionsB).forEach(dep => {
|
||||||
if (versionsA[dep] && versionsB[dep] && versionsA[dep] !== versionsB[dep]) {
|
if (
|
||||||
|
versionsA[dep] &&
|
||||||
|
versionsB[dep] &&
|
||||||
|
versionsA[dep] !== versionsB[dep] &&
|
||||||
|
!semver.satisfies(versionsA[dep], versionsB[dep])
|
||||||
|
) {
|
||||||
output += ` - "${dep}" should be "${versionsA[dep]}" but is "${versionsB[dep]}"\n`;
|
output += ` - "${dep}" should be "${versionsA[dep]}" but is "${versionsB[dep]}"\n`;
|
||||||
}
|
}
|
||||||
if (!newVersions[dep]) {
|
if (!newVersions[dep]) {
|
||||||
|
|||||||
Reference in New Issue
Block a user