mirror of
https://github.com/modernweb-dev/rocket.git
synced 2026-03-21 08:51:18 +00:00
Compare commits
21 Commits
@rocket/cl
...
@rocket/dr
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
26d3de1444 | ||
|
|
1f141058c1 | ||
|
|
08574c9b31 | ||
|
|
e81b77f236 | ||
|
|
456b8e78f0 | ||
|
|
0d7ea015af | ||
|
|
445b02872f | ||
|
|
1a599db3ed | ||
|
|
6b6bed5391 | ||
|
|
30eb822151 | ||
|
|
15a82c0e4d | ||
|
|
0197bee621 | ||
|
|
5c6b9c91eb | ||
|
|
6221e5f9ea | ||
|
|
06741ed729 | ||
|
|
23c164c822 | ||
|
|
c2a76c3f53 | ||
|
|
70bb7a128e | ||
|
|
3c342473d7 | ||
|
|
9e0579ab19 | ||
|
|
de202da0a5 |
@@ -123,6 +123,68 @@ export const header = () => {
|
||||
};
|
||||
```
|
||||
|
||||
```js story-code
|
||||
// not defined for android
|
||||
```
|
||||
|
||||
```js story-code
|
||||
// not defined for ios
|
||||
```
|
||||
|
||||
#### Story Code
|
||||
|
||||
If your preview is followed by a code blocks marked as `story-code` then those will be shown when switching between multiple platforms
|
||||
|
||||
````md
|
||||
```js preview-story
|
||||
// will be visible when platform web is selected
|
||||
export const JsPreviewStory = () => html` <demo-wc-card>JS Preview Story</demo-wc-card> `;
|
||||
```
|
||||
|
||||
```xml story-code
|
||||
<!-- will be visible when platform android is selected -->
|
||||
<Button
|
||||
android:id="@+id/demoWcCard"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="Android Code"
|
||||
style="@style/Widget.FooComponents.Demo.Wc.Card"
|
||||
/>
|
||||
```
|
||||
|
||||
```swift story-code
|
||||
// will be visible when platform ios is selected
|
||||
import DemoWc.Card
|
||||
|
||||
let card = DemoWcButton()
|
||||
```
|
||||
````
|
||||
|
||||
See it in action by opening up the code block and switching platforms
|
||||
|
||||
```js preview-story
|
||||
// will be visible when platform web is selected
|
||||
export const JsPreviewStory = () => html` <demo-wc-card>JS Preview Story</demo-wc-card> `;
|
||||
```
|
||||
|
||||
```xml story-code
|
||||
<!-- will be visible when platform android is selected -->
|
||||
<Button
|
||||
android:id="@+id/demoWcCard"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="Android Code"
|
||||
style="@style/Widget.FooComponents.Demo.Wc.Card"
|
||||
/>
|
||||
```
|
||||
|
||||
```swift story-code
|
||||
// will be visible when platform ios is selected
|
||||
import DemoWc.Card
|
||||
|
||||
let card = DemoWcButton()
|
||||
```
|
||||
|
||||
## Supported Systems
|
||||
|
||||
### Storybook
|
||||
|
||||
@@ -40,6 +40,68 @@ will result in
|
||||
export const foo = () => html` <demo-element></demo-element> `;
|
||||
```
|
||||
|
||||
```js story-code
|
||||
// not defined for android
|
||||
```
|
||||
|
||||
```js story-code
|
||||
// not defined for ios
|
||||
```
|
||||
|
||||
#### Story Code
|
||||
|
||||
If your preview is followed by a code blocks marked as `story-code` then those will be shown when switching between multiple platforms
|
||||
|
||||
````md
|
||||
```js preview-story
|
||||
// will be visible when platform web is selected
|
||||
export const JsPreviewStory = () => html` <demo-element></demo-element> `;
|
||||
```
|
||||
|
||||
```xml story-code
|
||||
<!-- will be visible when platform android is selected -->
|
||||
<Button
|
||||
android:id="@+id/demoElement"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="Android Code"
|
||||
style="@style/Widget.Demo.Element"
|
||||
/>
|
||||
```
|
||||
|
||||
```swift story-code
|
||||
// will be visible when platform ios is selected
|
||||
import Demo.Element
|
||||
|
||||
let card = DemoElement()
|
||||
```
|
||||
````
|
||||
|
||||
See it in action by opening up the code block and switching platforms
|
||||
|
||||
```js preview-story
|
||||
// will be visible when platform web is selected
|
||||
export const JsPreviewStory = () => html` <demo-element></demo-element> `;
|
||||
```
|
||||
|
||||
```xml story-code
|
||||
<!-- will be visible when platform android is selected -->
|
||||
<Button
|
||||
android:id="@+id/demoElement"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="Android Code"
|
||||
style="@style/Widget.Demo.Element"
|
||||
/>
|
||||
```
|
||||
|
||||
```swift story-code
|
||||
// will be visible when platform ios is selected
|
||||
import Demo.Element
|
||||
|
||||
let card = DemoElement()
|
||||
```
|
||||
|
||||
## HTML Story
|
||||
|
||||
````md
|
||||
|
||||
@@ -1,4 +1,3 @@
|
||||
# Presets >> Launch || 20
|
||||
|
||||
- [Preset](./preset/)
|
||||
- [Custom Elements](./custom-elements/)
|
||||
|
||||
@@ -1,4 +1,3 @@
|
||||
# Presets >> Search || 10
|
||||
|
||||
- [Preset](./preset/)
|
||||
- [Custom Elements](./custom-elements/)
|
||||
|
||||
@@ -3,6 +3,111 @@
|
||||
The Plugins Manager replaces the specific registration/execution (with options) in a given plugin system by an intend to use a plugin (with these options).
|
||||
This allows your users to adjust the options before actually applying the plugins.
|
||||
|
||||
## Setup
|
||||
|
||||
1. Install npm package
|
||||
```bash
|
||||
npm i plugins-manager
|
||||
```
|
||||
2. Change your public API from an array of plugin "instances" to an array of setup functions
|
||||
```diff
|
||||
import myPlugin from 'my-plugin';
|
||||
+ import { addPlugin } from 'plugins-manager';
|
||||
export default {
|
||||
- plugins: [myPlugin],
|
||||
+ setupPlugins: [addPlugin(myPlugin)]
|
||||
}
|
||||
```
|
||||
3. Convert setup function to plugins
|
||||
|
||||
```js
|
||||
import { applyPlugins } from 'plugins-manager';
|
||||
|
||||
const finalConfig = applyPlugins(config); // "converts" setupPlugins to plugins
|
||||
|
||||
// work with plugins or pass it on to another tool
|
||||
const bundle = await rollup(finalConfig);
|
||||
```
|
||||
|
||||
## Usage
|
||||
|
||||
As you users in most cases you will need to either add or adjust a given plugin in a config file.
|
||||
|
||||
👉 `my-tool.config.js`
|
||||
|
||||
```js
|
||||
import { addPlugin, adjustPluginOptions } from 'plugins-manager';
|
||||
import json from '@rollup/plugin-json';
|
||||
import { nodeResolve } from '@rollup/plugin-node-resolve';
|
||||
|
||||
export default {
|
||||
setupPlugins: [
|
||||
// add a new plugin with optional plugin options
|
||||
addPlugin(json, {
|
||||
/* ... */
|
||||
}),
|
||||
|
||||
// adjust the options of a plugin that is already registered
|
||||
adjustPluginOptions(nodeResolve, {
|
||||
/* ... */
|
||||
}),
|
||||
],
|
||||
};
|
||||
```
|
||||
|
||||
## Plugins can be functions or classes
|
||||
|
||||
### Function Plugins
|
||||
|
||||
```js
|
||||
function myPlugin({ lastName: 'initial-second' }) {
|
||||
// ...
|
||||
}
|
||||
|
||||
export default {
|
||||
setupPlugins: [addPlugin(myPlugin)],
|
||||
};
|
||||
|
||||
// function parameters are type safe
|
||||
addPlugin(myPlugin, { lastName: 'new name' }); // ts ok
|
||||
addPlugin(myPlugin, { otherProp: 'new name' }); // ts error
|
||||
```
|
||||
|
||||
### Class Plugins
|
||||
|
||||
The options are passed to the constructor.
|
||||
|
||||
```js
|
||||
/**
|
||||
* @typedef {object} MyClassOptions
|
||||
* @property {string} lastName
|
||||
*/
|
||||
|
||||
class MyClass {
|
||||
/** @type {MyClassOptions} */
|
||||
options = {
|
||||
lastName: 'initial-second',
|
||||
};
|
||||
|
||||
/**
|
||||
* @param {Partial<MyClassOptions>} options
|
||||
*/
|
||||
constructor(options = {}) {
|
||||
this.options = { ...this.options, ...options };
|
||||
}
|
||||
|
||||
// ...
|
||||
}
|
||||
|
||||
export default {
|
||||
setupPlugins: [addPlugin(MyClass)],
|
||||
};
|
||||
|
||||
// constructor parameters are type safe
|
||||
addPlugin(MyClass, { lastName: 'new name' }); // ts ok
|
||||
addPlugin(MyClass, { otherProp: 'new name' }); // ts error
|
||||
```
|
||||
|
||||
## Problem
|
||||
|
||||
Many plugin systems require you to either execute a plugin function like in `rollup`.
|
||||
@@ -48,18 +153,14 @@ This means if you wish to define default plugins and allow your user to override
|
||||
|
||||
The plugins manager lets you orchestrate a set of "meta plugins" which are defined by
|
||||
|
||||
- name
|
||||
- plugin
|
||||
- options
|
||||
- plugin (class or function)
|
||||
- it's options
|
||||
|
||||
```js
|
||||
import beep from '@rollup/plugin-beep';
|
||||
import url from '@rollup/plugin-url';
|
||||
|
||||
let metaPlugins = [
|
||||
{ name: 'beep', plugin: beep },
|
||||
{ name: 'url', plugin: url, options: { limit: 10000 } },
|
||||
];
|
||||
let metaPlugins = [{ plugin: beep }, { plugin: url, options: { limit: 10000 } }];
|
||||
```
|
||||
|
||||
This array can be modified by adding/removing or adjusting options.
|
||||
@@ -94,16 +195,13 @@ export default {
|
||||
|
||||
### Adding Helpers
|
||||
|
||||
Doing array manipulations is kinda error-prone so we offer encourage to use an array of setup function. Where as each setup function can either add a new plugin (with a unique name) or adjust an already existing plugin.
|
||||
Doing array manipulations is kinda error-prone so we encourage to use an array of setup function. Where as each setup function can either add a new plugin (with a unique name) or adjust an already existing plugin.
|
||||
|
||||
```js
|
||||
import { addPlugin, adjustPluginOptions } from 'plugins-manager';
|
||||
|
||||
const systemSetupFunctions = [
|
||||
addPlugin({ name: 'first', plugin: first }),
|
||||
addPlugin({ name: 'second', plugin: second }),
|
||||
];
|
||||
const userSetupFunctions = [adjustPluginOptions('first', { my: 'options' })];
|
||||
const systemSetupFunctions = [addPlugin(first), addPlugin(second)];
|
||||
const userSetupFunctions = [adjustPluginOptions(first, { my: 'options' })];
|
||||
```
|
||||
|
||||
Arrays of functions can by merged like so
|
||||
@@ -115,9 +213,9 @@ const finalSetupFunctions = [...systemSetupFunctions, ...userSetupFunctions];
|
||||
and then converted to the final output.
|
||||
|
||||
```js
|
||||
import { metaPluginsToRollupPlugins } from 'plugins-manager';
|
||||
import { applyPlugins } from 'plugins-manager';
|
||||
|
||||
const plugins = metaPluginsToRollupPlugins(finalSetupFunctions, metaPlugins);
|
||||
const plugins = applyPlugins(finalSetupFunctions, metaPlugins);
|
||||
```
|
||||
|
||||
## Adding a Plugin
|
||||
@@ -133,18 +231,27 @@ By default it adds at the bottom.
|
||||
import json from '@rollup/plugin-json';
|
||||
import { addPlugin } from 'plugins-manager';
|
||||
|
||||
const userSetupFunctions = [
|
||||
addPlugin({ name: 'json', plugin: json, options: { preferConst: true } }),
|
||||
];
|
||||
const userSetupFunctions = [addPlugin(json, { preferConst: true })];
|
||||
```
|
||||
|
||||
Example usage:
|
||||
|
||||
```js
|
||||
addPlugin({ name: 'json', plugin: json }); // Add at the bottom (default)
|
||||
addPlugin({ name: 'json', plugin: json, location: 'top' }); // Add at the top/beginning of the array
|
||||
addPlugin({ name: 'json', plugin: json, location: 'beep' }); // Add after (default) plugin 'beep'
|
||||
addPlugin({ name: 'json', plugin: json, location: 'beep', how: 'before' }); // Add before plugin 'beep'
|
||||
addPlugin(json); // Add at the bottom (default)
|
||||
addPlugin(json, {}, { location: 'top' }); // Add at the top/beginning of the array
|
||||
addPlugin(json, {}, { location: beep }); // Add after (default) plugin 'beep'
|
||||
addPlugin(json, {}, { location: beep, how: 'before' }); // Add before plugin 'beep'
|
||||
```
|
||||
|
||||
This is type safe and typescript will throw an error if you pass the wrong type.
|
||||
|
||||
```js
|
||||
function myPlugin({ myFlag = false } = {}) {
|
||||
// ...
|
||||
}
|
||||
|
||||
addPlugin(myPlugin, { myFlag: true }); // ts ok
|
||||
addPlugin(myPlugin, { notExisting: true }); // ts error
|
||||
```
|
||||
|
||||
## Adjusting Plugin Options
|
||||
@@ -154,12 +261,14 @@ Adjusting options means to either
|
||||
- flatly merge objects (e.g. only the first level will be preserved)
|
||||
- calling a function to do the merge yourself
|
||||
- setting the raw value (if not an object or function)
|
||||
- you need to have a reference to the plugin (which is used to auto complete the available options via typescript)
|
||||
|
||||
```js
|
||||
import json from '@rollup/plugin-json';
|
||||
import { adjustPluginOptions } from 'plugins-manager';
|
||||
|
||||
const userSetupFunctions = [
|
||||
adjustPluginOptions('json', { preferConst: false, anotherOption: 'format' }),
|
||||
adjustPluginOptions(json, { preferConst: false, anotherOption: 'format' }),
|
||||
];
|
||||
```
|
||||
|
||||
@@ -167,36 +276,53 @@ Example usage:
|
||||
|
||||
```js
|
||||
// given
|
||||
addPlugin({
|
||||
name: 'json',
|
||||
plugin: json,
|
||||
options: {
|
||||
other: {
|
||||
nested: 'other.nested',
|
||||
nested2: 'other.nested2',
|
||||
},
|
||||
main: true,
|
||||
addPlugin(json, {
|
||||
other: {
|
||||
nested: 'other.nested',
|
||||
nested2: 'other.nested2',
|
||||
},
|
||||
main: true,
|
||||
});
|
||||
|
||||
// merge objects flately
|
||||
adjustPluginOptions('json', { other: { nested: '--overwritten--' } });
|
||||
adjustPluginOptions(json, { other: { nested: '--overwritten--' } });
|
||||
// resulting options = { other: { nested: '--overwritten--' }, main: true }
|
||||
// NOTE: nested2 is removed
|
||||
|
||||
// merge via function
|
||||
adjustPluginOptions('json', config => ({ other: { ...config.other, nested: '--overwritten--' } }));
|
||||
adjustPluginOptions(json, config => ({ other: { ...config.other, nested: '--overwritten--' } }));
|
||||
// resulting options = { other: { nested: '--overwritten--', nested2: 'other.nested2' }, main: true }
|
||||
|
||||
// merge via function to override full options
|
||||
adjustPluginOptions('json', config => ({ only: 'this' }));
|
||||
adjustPluginOptions(json, config => ({ only: 'this' }));
|
||||
// resulting options = { only: 'this' }
|
||||
|
||||
// setting a raw value
|
||||
adjustPluginOptions('json', false);
|
||||
adjustPluginOptions(json, false);
|
||||
// resulting options = false
|
||||
```
|
||||
|
||||
This is type safe and typescript will throw an error if you pass the wrong type.
|
||||
|
||||
```js
|
||||
function myPlugin({ myFlag = false } = {}) {
|
||||
// ...
|
||||
}
|
||||
|
||||
adjustPluginOptions(myPlugin, { myFlag: true }); // ts ok
|
||||
adjustPluginOptions(myPlugin, { notExisting: true }); // ts error
|
||||
```
|
||||
|
||||
## Remove Plugin
|
||||
|
||||
Sometimes you would like to remove a default plugin from the config.
|
||||
|
||||
```js
|
||||
export default {
|
||||
setupPlugins: [removePlugin(json)],
|
||||
};
|
||||
```
|
||||
|
||||
## Converting metaPlugins to an Actual Plugin
|
||||
|
||||
To execute all setup function you can use this little helper
|
||||
@@ -227,25 +353,9 @@ Rollup has a more specific helper that handles
|
||||
Note: if you provide `config.plugins` then it will return that directly ignoring `setupPlugins`
|
||||
|
||||
```js
|
||||
import { metaConfigToRollupConfig } from 'plugins-manager';
|
||||
import { applyPlugins } from 'plugins-manager';
|
||||
|
||||
const finalConfig = metaConfigToRollupConfig(currentConfig, defaultMetaPlugins);
|
||||
```
|
||||
|
||||
Web Dev Server has a more specific helper that handles
|
||||
|
||||
- `config.setupPlugins`
|
||||
- `config.setupRollupPlugins`
|
||||
|
||||
Note: if you provide `config.plugins` then it will return that directly ignoring `setupPlugins` and `setupRollupPlugins`
|
||||
|
||||
```js
|
||||
import { metaConfigToWebDevServerConfig } from 'plugins-manager';
|
||||
import { fromRollup } from '@web/dev-server-rollup';
|
||||
|
||||
const finalConfig = metaConfigToWebDevServerConfig(currentConfig, defaultMetaPlugins, {
|
||||
rollupWrapperFunction: fromRollup,
|
||||
});
|
||||
const finalConfig = applyPlugins(currentConfig, defaultMetaPlugins);
|
||||
```
|
||||
|
||||
Eleventy
|
||||
|
||||
4
netlify.toml
Normal file
4
netlify.toml
Normal file
@@ -0,0 +1,4 @@
|
||||
[[headers]]
|
||||
for = "/*"
|
||||
[headers.values]
|
||||
Content-Security-Policy = "default-src 'self'; script-src 'self' www.googletagmanager.com 'sha256-W6Gq+BvrdAAMbF8E7WHA7UPQxuUOfJM8E9mpKD0oihA=' 'sha256-vFU+IJ5dUUukI5Varwy49dN2d89DmFj7UNewqQv88sw='; style-src 'self' 'unsafe-inline' fonts.googleapis.com; font-src 'self' data: fonts.gstatic.com;"
|
||||
@@ -33,8 +33,8 @@
|
||||
"setup": "npm run setup:ts-configs && npm run build:packages",
|
||||
"setup:patches": "npx patch-package",
|
||||
"setup:ts-configs": "node scripts/generate-ts-configs.mjs",
|
||||
"prestart": "yarn analyze",
|
||||
"start": "node packages/cli/src/cli.js start",
|
||||
"xprestart": "yarn analyze",
|
||||
"start": "node --trace-warnings packages/cli/src/cli.js start",
|
||||
"test": "yarn test:node && yarn test:web",
|
||||
"test:node": "mocha \"packages/*/test-node/**/*.test.{ts,js,mjs,cjs}\" --timeout 5000 --reporter dot --exit",
|
||||
"test:web": "web-test-runner",
|
||||
@@ -62,7 +62,7 @@
|
||||
"@typescript-eslint/parser": "^4.13.0",
|
||||
"@web/test-runner": "^0.12.2",
|
||||
"@web/test-runner-commands": "^0.4.0",
|
||||
"@web/test-runner-playwright": "^0.8.0",
|
||||
"@web/test-runner-playwright": "^0.8.8",
|
||||
"cem-plugin-readme": "^0.1.3",
|
||||
"chai": "^4.2.0",
|
||||
"concurrently": "^5.3.0",
|
||||
@@ -80,6 +80,7 @@
|
||||
"onchange": "^7.1.0",
|
||||
"prettier": "^2.2.1",
|
||||
"prettier-plugin-package": "^1.3.0",
|
||||
"publish-docs": "^0.1.2",
|
||||
"puppeteer": "^9.0.0",
|
||||
"remark-emoji": "^2.1.0",
|
||||
"rimraf": "^3.0.2",
|
||||
|
||||
@@ -1,5 +1,32 @@
|
||||
# @rocket/blog
|
||||
|
||||
## 0.4.0
|
||||
|
||||
### Minor Changes
|
||||
|
||||
- 70bb7a1: BREAKING CHANGE: Update to latest plugins manager to get type safe options
|
||||
|
||||
There is no longer a name string as a key for a plugin. It is identified by it's function/class. You will need to adjust your code if you are adding or adjusting plugins.
|
||||
|
||||
```diff
|
||||
- addPlugin({ name: 'my-plugin', plugin: myPlugin, options: { myFlag: true }, location: 'top' });
|
||||
+ addPlugin(myPlugin, { myFlag: true }, { location: 'top' });
|
||||
- adjustPluginOptions('my-plugin', { myFlag: true });
|
||||
+ adjustPluginOptions(myPlugin, { myFlag: true });
|
||||
```
|
||||
|
||||
For more details please see the [Changelog](https://github.com/modernweb-dev/rocket/blob/main/packages/plugins-manager/CHANGELOG.md#030) of the plugins-manager package.
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- Updated dependencies [70bb7a1]
|
||||
- Updated dependencies [70bb7a1]
|
||||
- Updated dependencies [70bb7a1]
|
||||
- Updated dependencies [70bb7a1]
|
||||
- Updated dependencies [70bb7a1]
|
||||
- Updated dependencies [70bb7a1]
|
||||
- plugins-manager@0.3.0
|
||||
|
||||
## 0.3.3
|
||||
|
||||
### Patch Changes
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@rocket/blog",
|
||||
"version": "0.3.3",
|
||||
"version": "0.4.0",
|
||||
"publishConfig": {
|
||||
"access": "public"
|
||||
},
|
||||
@@ -38,6 +38,6 @@
|
||||
"testing"
|
||||
],
|
||||
"dependencies": {
|
||||
"plugins-manager": "^0.2.4"
|
||||
"plugins-manager": "^0.3.0"
|
||||
}
|
||||
}
|
||||
|
||||
@@ -47,6 +47,6 @@ export function rocketBlog({ section = SECTION, postCollection = POST_COLLECTION
|
||||
|
||||
return {
|
||||
path: path.resolve(__dirname),
|
||||
setupEleventyPlugins: [addPlugin({ name: 'rocket-blog', plugin: eleventyPluginRocketBlog })],
|
||||
setupEleventyPlugins: [addPlugin(eleventyPluginRocketBlog)],
|
||||
};
|
||||
}
|
||||
|
||||
@@ -1,5 +1,22 @@
|
||||
# @rocket/building-rollup
|
||||
|
||||
## 0.4.0
|
||||
|
||||
### Minor Changes
|
||||
|
||||
- 70bb7a1: BREAKING CHANGE: Update to latest plugins manager to get type safe options
|
||||
|
||||
There is no longer a name string as a key for a plugin. It is identified by it's function/class. You will need to adjust your code if you are adding or adjusting plugins.
|
||||
|
||||
```diff
|
||||
- addPlugin({ name: 'my-plugin', plugin: myPlugin, options: { myFlag: true }, location: 'top' });
|
||||
+ addPlugin(myPlugin, { myFlag: true }, { location: 'top' });
|
||||
- adjustPluginOptions('my-plugin', { myFlag: true });
|
||||
+ adjustPluginOptions(myPlugin, { myFlag: true });
|
||||
```
|
||||
|
||||
For more details please see the [Changelog](https://github.com/modernweb-dev/rocket/blob/main/packages/plugins-manager/CHANGELOG.md#030) of the plugins-manager package.
|
||||
|
||||
## 0.3.1
|
||||
|
||||
### Patch Changes
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@rocket/building-rollup",
|
||||
"version": "0.3.1",
|
||||
"version": "0.4.0",
|
||||
"publishConfig": {
|
||||
"access": "public"
|
||||
},
|
||||
|
||||
@@ -2,13 +2,13 @@ import resolve from '@rollup/plugin-node-resolve';
|
||||
import { terser } from 'rollup-plugin-terser';
|
||||
import babelPkg from '@rollup/plugin-babel';
|
||||
|
||||
import { metaConfigToRollupConfig } from 'plugins-manager';
|
||||
import { applyPlugins } from 'plugins-manager';
|
||||
|
||||
const { babel } = babelPkg;
|
||||
|
||||
export function createBasicConfig(userConfig) {
|
||||
const { config, metaPlugins } = createBasicMetaConfig(userConfig);
|
||||
return metaConfigToRollupConfig(config, metaPlugins);
|
||||
return applyPlugins(config, metaPlugins);
|
||||
}
|
||||
|
||||
export function createBasicMetaConfig(userConfig = { output: {} }) {
|
||||
@@ -39,14 +39,12 @@ export function createBasicMetaConfig(userConfig = { output: {} }) {
|
||||
|
||||
let metaPlugins = [
|
||||
{
|
||||
name: 'node-resolve',
|
||||
plugin: resolve,
|
||||
options: {
|
||||
moduleDirectories: ['node_modules', 'web_modules'],
|
||||
},
|
||||
},
|
||||
{
|
||||
name: 'babel',
|
||||
plugin: babel,
|
||||
options: {
|
||||
babelHelpers: 'bundled',
|
||||
@@ -73,7 +71,6 @@ export function createBasicMetaConfig(userConfig = { output: {} }) {
|
||||
},
|
||||
},
|
||||
{
|
||||
name: 'terser',
|
||||
plugin: terser,
|
||||
},
|
||||
];
|
||||
|
||||
@@ -1,10 +1,11 @@
|
||||
import { createSpaMetaConfig } from './createSpaConfig.js';
|
||||
import { adjustPluginOptions, metaConfigToRollupConfig } from 'plugins-manager';
|
||||
import { adjustPluginOptions, applyPlugins } from 'plugins-manager';
|
||||
import { rollupPluginHTML } from '@web/rollup-plugin-html';
|
||||
|
||||
export function createMpaConfig(userConfig) {
|
||||
const { config, metaPlugins } = createMpaMetaConfig(userConfig);
|
||||
|
||||
const final = metaConfigToRollupConfig(config, metaPlugins);
|
||||
const final = applyPlugins(config, metaPlugins);
|
||||
return final;
|
||||
}
|
||||
|
||||
@@ -12,7 +13,7 @@ export function createMpaMetaConfig(userConfig = { output: {}, setupPlugins: []
|
||||
const { config, metaPlugins } = createSpaMetaConfig(userConfig);
|
||||
|
||||
config.setupPlugins = [
|
||||
adjustPluginOptions('html', {
|
||||
adjustPluginOptions(rollupPluginHTML, {
|
||||
flattenOutput: false,
|
||||
}),
|
||||
...config.setupPlugins,
|
||||
|
||||
@@ -3,13 +3,13 @@ import { terser } from 'rollup-plugin-terser';
|
||||
import babelPkg from '@rollup/plugin-babel';
|
||||
import replace from '@rollup/plugin-replace';
|
||||
|
||||
import { metaConfigToRollupConfig } from 'plugins-manager';
|
||||
import { applyPlugins } from 'plugins-manager';
|
||||
|
||||
const { babel } = babelPkg;
|
||||
|
||||
export function createServiceWorkerConfig(userConfig) {
|
||||
const { config, metaPlugins } = createServiceWorkerMetaConfig(userConfig);
|
||||
return metaConfigToRollupConfig(config, metaPlugins);
|
||||
return applyPlugins(config, metaPlugins);
|
||||
}
|
||||
|
||||
export function createServiceWorkerMetaConfig(userConfig = { output: {} }) {
|
||||
@@ -33,21 +33,19 @@ export function createServiceWorkerMetaConfig(userConfig = { output: {} }) {
|
||||
|
||||
let metaPlugins = [
|
||||
{
|
||||
name: 'node-resolve',
|
||||
plugin: resolve,
|
||||
options: {
|
||||
moduleDirectories: ['node_modules', 'web_modules'],
|
||||
},
|
||||
},
|
||||
{
|
||||
name: 'replace',
|
||||
plugin: replace,
|
||||
options: {
|
||||
'process.env.NODE_ENV': JSON.stringify(developmentMode ? 'development' : 'production'),
|
||||
preventAssignment: true,
|
||||
},
|
||||
},
|
||||
{
|
||||
name: 'babel',
|
||||
plugin: babel,
|
||||
options: {
|
||||
babelHelpers: 'bundled',
|
||||
@@ -74,7 +72,6 @@ export function createServiceWorkerMetaConfig(userConfig = { output: {} }) {
|
||||
},
|
||||
},
|
||||
{
|
||||
name: 'terser',
|
||||
plugin: terser,
|
||||
options: {
|
||||
mangle: {
|
||||
|
||||
@@ -1,13 +1,13 @@
|
||||
import { rollupPluginHTML } from '@web/rollup-plugin-html';
|
||||
import { importMetaAssets } from '@web/rollup-plugin-import-meta-assets';
|
||||
import { polyfillsLoader } from '@web/rollup-plugin-polyfills-loader';
|
||||
import { metaConfigToRollupConfig } from 'plugins-manager';
|
||||
import { applyPlugins } from 'plugins-manager';
|
||||
|
||||
import { createBasicMetaConfig } from './createBasicConfig.js';
|
||||
|
||||
export function createSpaConfig(userConfig) {
|
||||
const { config, metaPlugins } = createSpaMetaConfig(userConfig);
|
||||
return metaConfigToRollupConfig(config, metaPlugins);
|
||||
return applyPlugins(config, metaPlugins);
|
||||
}
|
||||
|
||||
export function createSpaMetaConfig(userConfig = { output: {} }) {
|
||||
@@ -30,7 +30,6 @@ export function createSpaMetaConfig(userConfig = { output: {} }) {
|
||||
const spaMetaPlugins = [
|
||||
...metaPlugins,
|
||||
{
|
||||
name: 'html',
|
||||
plugin: rollupPluginHTML,
|
||||
options: {
|
||||
rootDir,
|
||||
@@ -38,11 +37,9 @@ export function createSpaMetaConfig(userConfig = { output: {} }) {
|
||||
},
|
||||
},
|
||||
{
|
||||
name: 'import-meta-assets',
|
||||
plugin: importMetaAssets,
|
||||
},
|
||||
{
|
||||
name: 'polyfills-loader',
|
||||
plugin: polyfillsLoader,
|
||||
options: {
|
||||
polyfills: {},
|
||||
|
||||
@@ -1,5 +1,47 @@
|
||||
# @rocket/cli
|
||||
|
||||
## 0.10.1
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- 15a82c0: Enable including script files into the simulator via `<script src=".." mdjs-use>`
|
||||
- 15a82c0: Allow only a limited set of characters for simulator includes `[a-zA-Z0-9\/\-_]`.
|
||||
Notably, there is no:
|
||||
|
||||
- `:` to prevent `http://...` includes
|
||||
- `.` so filenames as `this.is.my.js` are not supported. Also includes will be without file endings which will be added automatically
|
||||
|
||||
## 0.10.0
|
||||
|
||||
### Minor Changes
|
||||
|
||||
- 70bb7a1: BREAKING CHANGE: Update to latest plugins manager to get type safe options
|
||||
|
||||
There is no longer a name string as a key for a plugin. It is identified by it's function/class. You will need to adjust your code if you are adding or adjusting plugins.
|
||||
|
||||
```diff
|
||||
- addPlugin({ name: 'my-plugin', plugin: myPlugin, options: { myFlag: true }, location: 'top' });
|
||||
+ addPlugin(myPlugin, { myFlag: true }, { location: 'top' });
|
||||
- adjustPluginOptions('my-plugin', { myFlag: true });
|
||||
+ adjustPluginOptions(myPlugin, { myFlag: true });
|
||||
```
|
||||
|
||||
For more details please see the [Changelog](https://github.com/modernweb-dev/rocket/blob/main/packages/plugins-manager/CHANGELOG.md#030) of the plugins-manager package.
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- Updated dependencies [70bb7a1]
|
||||
- Updated dependencies [70bb7a1]
|
||||
- Updated dependencies [70bb7a1]
|
||||
- Updated dependencies [70bb7a1]
|
||||
- Updated dependencies [70bb7a1]
|
||||
- Updated dependencies [70bb7a1]
|
||||
- Updated dependencies [70bb7a1]
|
||||
- Updated dependencies [70bb7a1]
|
||||
- plugins-manager@0.3.0
|
||||
- @rocket/eleventy-plugin-mdjs-unified@0.6.0
|
||||
- @rocket/building-rollup@0.4.0
|
||||
|
||||
## 0.9.11
|
||||
|
||||
### Patch Changes
|
||||
|
||||
@@ -1,10 +1,26 @@
|
||||
const { setComputedConfig, getComputedConfig } = require('./src/public/computedConfig.cjs');
|
||||
const { generateEleventyComputed } = require('./src/public/generateEleventyComputed.cjs');
|
||||
const {
|
||||
generateEleventyComputed,
|
||||
LayoutPlugin,
|
||||
TitleMetaPlugin,
|
||||
TitlePlugin,
|
||||
EleventyNavigationPlugin,
|
||||
SectionPlugin,
|
||||
SocialMediaImagePlugin,
|
||||
JoiningBlocksPlugin,
|
||||
} = require('./src/public/generateEleventyComputed.cjs');
|
||||
const { createSocialImage } = require('./src/public/createSocialImage.cjs');
|
||||
|
||||
module.exports = {
|
||||
setComputedConfig,
|
||||
getComputedConfig,
|
||||
generateEleventyComputed,
|
||||
LayoutPlugin,
|
||||
TitleMetaPlugin,
|
||||
TitlePlugin,
|
||||
EleventyNavigationPlugin,
|
||||
SectionPlugin,
|
||||
SocialMediaImagePlugin,
|
||||
JoiningBlocksPlugin,
|
||||
createSocialImage,
|
||||
};
|
||||
|
||||
@@ -1,3 +1,16 @@
|
||||
/** @typedef {import('@rocket/cli/types/main').RocketCliOptions} RocketCliOptions */
|
||||
|
||||
export { setComputedConfig, getComputedConfig } from './src/public/computedConfig.cjs';
|
||||
export {
|
||||
generateEleventyComputed,
|
||||
LayoutPlugin,
|
||||
TitleMetaPlugin,
|
||||
TitlePlugin,
|
||||
EleventyNavigationPlugin,
|
||||
SectionPlugin,
|
||||
SocialMediaImagePlugin,
|
||||
JoiningBlocksPlugin,
|
||||
} from './src/public/generateEleventyComputed.cjs';
|
||||
export { createSocialImage } from './src/public/createSocialImage.cjs';
|
||||
|
||||
export { RocketCli } from './src/RocketCli.js';
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@rocket/cli",
|
||||
"version": "0.9.11",
|
||||
"version": "0.10.1",
|
||||
"publishConfig": {
|
||||
"access": "public"
|
||||
},
|
||||
@@ -57,9 +57,9 @@
|
||||
"dependencies": {
|
||||
"@11ty/eleventy": "^0.11.1",
|
||||
"@11ty/eleventy-img": "^0.9.0",
|
||||
"@rocket/building-rollup": "^0.3.1",
|
||||
"@rocket/building-rollup": "^0.4.0",
|
||||
"@rocket/core": "^0.1.2",
|
||||
"@rocket/eleventy-plugin-mdjs-unified": "^0.5.2",
|
||||
"@rocket/eleventy-plugin-mdjs-unified": "^0.6.0",
|
||||
"@rocket/eleventy-rocket-nav": "^0.3.0",
|
||||
"@rollup/plugin-babel": "^5.2.2",
|
||||
"@rollup/plugin-node-resolve": "^11.0.1",
|
||||
@@ -72,7 +72,7 @@
|
||||
"command-line-usage": "^6.1.1",
|
||||
"fs-extra": "^9.0.1",
|
||||
"micromatch": "^4.0.2",
|
||||
"plugins-manager": "^0.2.4",
|
||||
"plugins-manager": "^0.3.0",
|
||||
"slash": "^3.0.0",
|
||||
"utf8": "^3.0.0",
|
||||
"workbox-window": "^6.1.5"
|
||||
|
||||
@@ -14,19 +14,37 @@
|
||||
<script type="module">
|
||||
import { render } from '@mdjs/mdjs-story';
|
||||
|
||||
function sanitize(input, type) {
|
||||
return `${document.location.origin}/${input.match(/[a-zA-Z0-9\/\-_]*/)[0]}.${type}`;
|
||||
}
|
||||
|
||||
async function onHashChange() {
|
||||
const urlParts = new URLSearchParams(document.location.hash.substr(1));
|
||||
|
||||
if (urlParts.get('stylesheets')) {
|
||||
for (const stylesheet of urlParts.getAll('stylesheets')) {
|
||||
if (!document.querySelector(`link[rel="stylesheet"][href="${stylesheet}"]`)) {
|
||||
const safeStylesheetUrl = sanitize(stylesheet, 'css');
|
||||
if (!document.querySelector(`link[rel="stylesheet"][href="${safeStylesheetUrl}"]`)) {
|
||||
const link = document.createElement('link');
|
||||
link.rel = 'stylesheet';
|
||||
link.href = stylesheet;
|
||||
link.href = safeStylesheetUrl;
|
||||
document.head.appendChild(link);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (urlParts.get('moduleUrls')) {
|
||||
for (const moduleUrl of urlParts.getAll('moduleUrls')) {
|
||||
const safeModuleUrl = sanitize(moduleUrl, 'js');
|
||||
if (!document.querySelector(`script[type=module][src="${safeModuleUrl}"]`)) {
|
||||
const script = document.createElement('script');
|
||||
script.type = 'module';
|
||||
script.src = safeModuleUrl;
|
||||
document.head.appendChild(script);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (urlParts.get('theme')) {
|
||||
document.documentElement.setAttribute('theme', urlParts.get('theme'));
|
||||
}
|
||||
@@ -46,7 +64,8 @@
|
||||
document.documentElement.removeAttribute('edge-distance');
|
||||
}
|
||||
|
||||
const mod = await import(urlParts.get('story-file'));
|
||||
const safeStoryUrl = sanitize(urlParts.get('story-file'), 'js');
|
||||
const mod = await import(safeStoryUrl);
|
||||
render(mod[urlParts.get('story-key')]({ shadowRoot: document }), document.body);
|
||||
}
|
||||
|
||||
|
||||
@@ -5,6 +5,7 @@ import { rollup } from 'rollup';
|
||||
import fs from 'fs-extra';
|
||||
import path from 'path';
|
||||
import { copy } from '@web/rollup-plugin-copy';
|
||||
import { rollupPluginHTML } from '@web/rollup-plugin-html';
|
||||
|
||||
import { createMpaConfig, createServiceWorkerConfig } from '@rocket/building-rollup';
|
||||
import { addPlugin, adjustPluginOptions } from 'plugins-manager';
|
||||
@@ -25,18 +26,14 @@ async function buildAndWrite(config) {
|
||||
|
||||
async function productionBuild(config) {
|
||||
const defaultSetupPlugins = [
|
||||
addPlugin({
|
||||
name: 'copy',
|
||||
plugin: copy,
|
||||
options: {
|
||||
patterns: ['!(*.md|*.html)*', '_merged_assets/_static/**/*'],
|
||||
rootDir: config.outputDevDir,
|
||||
},
|
||||
addPlugin(copy, {
|
||||
patterns: ['!(*.md|*.html)*', '_merged_assets/_static/**/*'],
|
||||
rootDir: config.outputDevDir,
|
||||
}),
|
||||
];
|
||||
if (config.pathPrefix) {
|
||||
defaultSetupPlugins.push(
|
||||
adjustPluginOptions('html', { absolutePathPrefix: config.pathPrefix }),
|
||||
adjustPluginOptions(rollupPluginHTML, { absolutePathPrefix: config.pathPrefix }),
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
@@ -298,7 +298,7 @@ export class RocketCli {
|
||||
async cleanup() {
|
||||
setComputedConfig({});
|
||||
if (this.eleventy) {
|
||||
this.eleventy.finish();
|
||||
// this.eleventy.finish();
|
||||
// await this.eleventy.stopWatch();
|
||||
}
|
||||
this.stop();
|
||||
|
||||
@@ -1,11 +1,61 @@
|
||||
/* eslint-disable @typescript-eslint/ban-ts-comment */
|
||||
import { startDevServer } from '@web/dev-server';
|
||||
import { fromRollup } from '@web/dev-server-rollup';
|
||||
import { metaConfigToWebDevServerConfig } from 'plugins-manager';
|
||||
import { executeSetupFunctions } from 'plugins-manager';
|
||||
|
||||
/** @typedef {import('../types/main').RocketCliOptions} RocketCliOptions */
|
||||
/** @typedef {import('@web/dev-server').DevServerConfig} DevServerConfig */
|
||||
|
||||
/**
|
||||
* @param {any} config
|
||||
* @param {MetaPluginWrapable[]} metaPlugins
|
||||
* @param {object} [options]
|
||||
* @param {function | null} [options.rollupWrapperFunction]
|
||||
*/
|
||||
export function metaConfigToWebDevServerConfig(
|
||||
config,
|
||||
metaPlugins,
|
||||
{ rollupWrapperFunction = null } = {},
|
||||
) {
|
||||
if (config.plugins) {
|
||||
delete config.setupPlugins;
|
||||
delete config.setupRollupPlugins;
|
||||
return config;
|
||||
}
|
||||
|
||||
const metaPluginsNoWrap = metaPlugins.map(pluginObj => {
|
||||
pluginObj.__noWrap = true;
|
||||
return pluginObj;
|
||||
});
|
||||
|
||||
const rollupPlugins = /** @type {MetaPluginWrapable[]} */ (executeSetupFunctions(
|
||||
config.setupRollupPlugins,
|
||||
[...metaPluginsNoWrap],
|
||||
));
|
||||
|
||||
const wrappedRollupPlugins = rollupPlugins.map(pluginObj => {
|
||||
if (typeof rollupWrapperFunction === 'function' && pluginObj.__noWrap !== true) {
|
||||
pluginObj.plugin = rollupWrapperFunction(pluginObj.plugin);
|
||||
}
|
||||
return pluginObj;
|
||||
});
|
||||
|
||||
const _metaPlugins = executeSetupFunctions(config.setupPlugins, [...wrappedRollupPlugins]);
|
||||
|
||||
const plugins = _metaPlugins.map(pluginObj => {
|
||||
if (pluginObj.options) {
|
||||
return pluginObj.plugin(pluginObj.options);
|
||||
} else {
|
||||
return pluginObj.plugin();
|
||||
}
|
||||
});
|
||||
config.plugins = plugins;
|
||||
|
||||
delete config.setupPlugins;
|
||||
delete config.setupRollupPlugins;
|
||||
return config;
|
||||
}
|
||||
|
||||
export class RocketStart {
|
||||
static pluginName = 'RocketStart';
|
||||
commands = ['start'];
|
||||
|
||||
@@ -174,11 +174,7 @@ export async function normalizeConfig(inConfig) {
|
||||
config._presetPaths.push(path.resolve(_inputDirCwdRelative));
|
||||
|
||||
/** @type {MetaPlugin[]} */
|
||||
let pluginsMeta = [
|
||||
{ name: 'RocketStart', plugin: RocketStart },
|
||||
{ name: 'RocketBuild', plugin: RocketBuild },
|
||||
{ name: 'RocketLint', plugin: RocketLint },
|
||||
];
|
||||
let pluginsMeta = [{ plugin: RocketStart }, { plugin: RocketBuild }, { plugin: RocketLint }];
|
||||
|
||||
if (Array.isArray(config.setupCliPlugins)) {
|
||||
for (const setupFn of config.setupCliPlugins) {
|
||||
|
||||
@@ -5,8 +5,10 @@ const { createSocialImage: defaultCreateSocialImage } = require('./createSocialI
|
||||
const { getComputedConfig } = require('./computedConfig.cjs');
|
||||
const { executeSetupFunctions } = require('plugins-manager');
|
||||
|
||||
function titleMetaPlugin() {
|
||||
return async data => {
|
||||
class TitleMetaPlugin {
|
||||
static dataName = 'titleMeta';
|
||||
|
||||
async execute(data) {
|
||||
if (data.titleMeta) {
|
||||
return data.titleMeta;
|
||||
}
|
||||
@@ -17,29 +19,35 @@ function titleMetaPlugin() {
|
||||
return titleMetaFromContent;
|
||||
}
|
||||
return {};
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
function titlePlugin() {
|
||||
return async data => {
|
||||
class TitlePlugin {
|
||||
static dataName = 'title';
|
||||
|
||||
async execute(data) {
|
||||
if (data.title) {
|
||||
return data.title;
|
||||
}
|
||||
return data.titleMeta?.title;
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
function eleventyNavigationPlugin() {
|
||||
return async data => {
|
||||
class EleventyNavigationPlugin {
|
||||
static dataName = 'eleventyNavigation';
|
||||
|
||||
async execute(data) {
|
||||
if (data.eleventyNavigation) {
|
||||
return data.eleventyNavigation;
|
||||
}
|
||||
return data.titleMeta?.eleventyNavigation;
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
function sectionPlugin() {
|
||||
return async data => {
|
||||
class SectionPlugin {
|
||||
static dataName = 'section';
|
||||
|
||||
async execute(data) {
|
||||
if (data.section) {
|
||||
return data.section;
|
||||
}
|
||||
@@ -52,11 +60,17 @@ function sectionPlugin() {
|
||||
return parts[1];
|
||||
}
|
||||
}
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
function layoutPlugin({ defaultLayout = 'layout-default' } = {}) {
|
||||
return async data => {
|
||||
class LayoutPlugin {
|
||||
static dataName = 'layout';
|
||||
|
||||
constructor({ defaultLayout = 'layout-default' } = {}) {
|
||||
this.defaultLayout = defaultLayout;
|
||||
}
|
||||
|
||||
async execute(data) {
|
||||
if (data.layout) {
|
||||
return data.layout;
|
||||
}
|
||||
@@ -66,22 +80,29 @@ function layoutPlugin({ defaultLayout = 'layout-default' } = {}) {
|
||||
return 'layout-index';
|
||||
}
|
||||
}
|
||||
return defaultLayout;
|
||||
};
|
||||
return this.defaultLayout;
|
||||
}
|
||||
}
|
||||
|
||||
function socialMediaImagePlugin(args = {}) {
|
||||
const { createSocialImage = defaultCreateSocialImage, rocketConfig = {} } = args;
|
||||
class SocialMediaImagePlugin {
|
||||
static dataName = 'socialMediaImage';
|
||||
|
||||
const cleanedUpArgs = { ...args };
|
||||
delete cleanedUpArgs.createSocialImage;
|
||||
constructor(args = {}) {
|
||||
const { createSocialImage = defaultCreateSocialImage, rocketConfig = {} } = args;
|
||||
|
||||
return async data => {
|
||||
this.cleanedUpArgs = { ...args };
|
||||
delete this.cleanedUpArgs.createSocialImage;
|
||||
|
||||
this.rocketConfig = rocketConfig;
|
||||
this.createSocialImage = createSocialImage;
|
||||
}
|
||||
|
||||
async execute(data) {
|
||||
if (data.socialMediaImage) {
|
||||
return data.socialMediaImage;
|
||||
}
|
||||
|
||||
if (rocketConfig.createSocialMediaImages === false) {
|
||||
if (this.rocketConfig.createSocialMediaImages === false) {
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -95,15 +116,15 @@ function socialMediaImagePlugin(args = {}) {
|
||||
const section = data.section ? ' ' + data.section[0].toUpperCase() + data.section.slice(1) : '';
|
||||
const footer = `${data.site.name}${section}`;
|
||||
|
||||
const imgUrl = await createSocialImage({
|
||||
const imgUrl = await this.createSocialImage({
|
||||
title,
|
||||
subTitle,
|
||||
footer,
|
||||
section,
|
||||
...cleanedUpArgs,
|
||||
...this.cleanedUpArgs,
|
||||
});
|
||||
return imgUrl;
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
function sortByOrder(a, b) {
|
||||
@@ -146,26 +167,31 @@ async function dirToTree(sourcePath, extra = '') {
|
||||
return sortedTree;
|
||||
}
|
||||
|
||||
function joiningBlocksPlugin(rocketConfig) {
|
||||
const { _inputDirCwdRelative } = rocketConfig;
|
||||
const partialsSource = path.resolve(_inputDirCwdRelative, '_merged_includes');
|
||||
return async () => {
|
||||
const joiningBlocks = await dirToTree(partialsSource, '_joiningBlocks');
|
||||
class JoiningBlocksPlugin {
|
||||
static dataName = '_joiningBlocks';
|
||||
|
||||
constructor(rocketConfig) {
|
||||
const { _inputDirCwdRelative } = rocketConfig;
|
||||
this.partialsSource = path.resolve(_inputDirCwdRelative, '_merged_includes');
|
||||
}
|
||||
|
||||
async execute() {
|
||||
const joiningBlocks = await dirToTree(this.partialsSource, '_joiningBlocks');
|
||||
return joiningBlocks;
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
function generateEleventyComputed() {
|
||||
const rocketConfig = getComputedConfig();
|
||||
|
||||
let metaPlugins = [
|
||||
{ name: 'titleMeta', plugin: titleMetaPlugin },
|
||||
{ name: 'title', plugin: titlePlugin },
|
||||
{ name: 'eleventyNavigation', plugin: eleventyNavigationPlugin },
|
||||
{ name: 'section', plugin: sectionPlugin },
|
||||
{ name: 'socialMediaImage', plugin: socialMediaImagePlugin, options: { rocketConfig } },
|
||||
{ name: '_joiningBlocks', plugin: joiningBlocksPlugin, options: rocketConfig },
|
||||
{ name: 'layout', plugin: layoutPlugin },
|
||||
{ plugin: TitleMetaPlugin, options: {} },
|
||||
{ plugin: TitlePlugin, options: {} },
|
||||
{ plugin: EleventyNavigationPlugin, options: {} },
|
||||
{ plugin: SectionPlugin, options: {} },
|
||||
{ plugin: SocialMediaImagePlugin, options: { rocketConfig } },
|
||||
{ plugin: JoiningBlocksPlugin, options: rocketConfig },
|
||||
{ plugin: LayoutPlugin, options: {} },
|
||||
];
|
||||
|
||||
const finalMetaPlugins = executeSetupFunctions(
|
||||
@@ -176,13 +202,24 @@ function generateEleventyComputed() {
|
||||
const eleventyComputed = {};
|
||||
for (const pluginObj of finalMetaPlugins) {
|
||||
if (pluginObj.options) {
|
||||
eleventyComputed[pluginObj.name] = pluginObj.plugin(pluginObj.options);
|
||||
const inst = new pluginObj.plugin(pluginObj.options);
|
||||
eleventyComputed[inst.constructor.dataName] = inst.execute.bind(inst);
|
||||
} else {
|
||||
eleventyComputed[pluginObj.name] = pluginObj.plugin();
|
||||
const inst = new pluginObj.plugin();
|
||||
eleventyComputed[inst.constructor.dataName] = inst.execute.bind(inst);
|
||||
}
|
||||
}
|
||||
|
||||
return eleventyComputed;
|
||||
}
|
||||
|
||||
module.exports = { generateEleventyComputed };
|
||||
module.exports = {
|
||||
generateEleventyComputed,
|
||||
LayoutPlugin,
|
||||
TitleMetaPlugin,
|
||||
TitlePlugin,
|
||||
EleventyNavigationPlugin,
|
||||
SectionPlugin,
|
||||
SocialMediaImagePlugin,
|
||||
JoiningBlocksPlugin,
|
||||
};
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
const eleventyPluginMdjsUnified = require('@rocket/eleventy-plugin-mdjs-unified');
|
||||
const eleventyRocketNav = require('@rocket/eleventy-rocket-nav');
|
||||
const remark2rehype = require('remark-rehype');
|
||||
|
||||
const { getComputedConfig } = require('../public/computedConfig.cjs');
|
||||
const rocketFilters = require('../eleventy-plugins/rocketFilters.cjs');
|
||||
@@ -9,7 +10,7 @@ const { adjustPluginOptions } = require('plugins-manager');
|
||||
const image = require('./mdjsImageHandler.cjs');
|
||||
|
||||
const defaultSetupUnifiedPlugins = [
|
||||
adjustPluginOptions('remark2rehype', {
|
||||
adjustPluginOptions(remark2rehype, {
|
||||
handlers: {
|
||||
image,
|
||||
},
|
||||
@@ -23,28 +24,24 @@ module.exports = function (eleventyConfig) {
|
||||
|
||||
let metaPlugins = [
|
||||
{
|
||||
name: 'rocket-filters',
|
||||
plugin: rocketFilters,
|
||||
options: { _inputDirCwdRelative },
|
||||
},
|
||||
{
|
||||
name: 'rocket-copy',
|
||||
plugin: rocketCopy,
|
||||
options: { _inputDirCwdRelative },
|
||||
},
|
||||
{
|
||||
name: 'eleventy-plugin-mdjs-unified',
|
||||
plugin: eleventyPluginMdjsUnified,
|
||||
options: {
|
||||
setupUnifiedPlugins: [...defaultSetupUnifiedPlugins, ...config.setupUnifiedPlugins],
|
||||
},
|
||||
},
|
||||
{
|
||||
name: 'eleventy-rocket-nav',
|
||||
plugin: eleventyRocketNav,
|
||||
options: {},
|
||||
},
|
||||
{
|
||||
name: 'rocket-collections',
|
||||
plugin: rocketCollections,
|
||||
options: { _inputDirCwdRelative },
|
||||
},
|
||||
|
||||
@@ -91,86 +91,78 @@ export async function readOutput(
|
||||
return text;
|
||||
}
|
||||
|
||||
export function startOutputExist(cli, fileName) {
|
||||
const outputDir = cli.config.outputDevDir;
|
||||
return fs.existsSync(path.join(outputDir, fileName));
|
||||
}
|
||||
|
||||
export function buildOutputExist(cli, fileName) {
|
||||
const outputDir = cli.config.outputDir;
|
||||
return fs.existsSync(path.join(outputDir, fileName));
|
||||
}
|
||||
|
||||
/**
|
||||
* @param {*} cli
|
||||
* @param {string} fileName
|
||||
* @param {readOutputOptions} options
|
||||
*/
|
||||
export async function readStartOutput(cli, fileName, options = {}) {
|
||||
options.type = 'start';
|
||||
return readOutput(cli, fileName, options);
|
||||
}
|
||||
|
||||
/**
|
||||
* @param {*} cli
|
||||
* @param {string} fileName
|
||||
* @param {readOutputOptions} options
|
||||
*/
|
||||
export async function readBuildOutput(cli, fileName, options = {}) {
|
||||
options.type = 'build';
|
||||
return readOutput(cli, fileName, options);
|
||||
}
|
||||
|
||||
export async function getfixtureExpectedFiles(pathToDir) {
|
||||
const cwd = path.join(fixtureDir, pathToDir);
|
||||
const paths = await globby('**/*', { cwd, absolute: true, dot: true });
|
||||
return paths;
|
||||
}
|
||||
|
||||
export async function execute(cli, configFileDir) {
|
||||
export async function execute(pathToConfig, { type = 'start', captureLog = false } = {}) {
|
||||
let log = [];
|
||||
const origLog = console.log;
|
||||
if (captureLog) {
|
||||
console.log = (...args) => {
|
||||
log = [...log, ...args];
|
||||
};
|
||||
}
|
||||
|
||||
const configFile = path.join(fixtureDir, pathToConfig.split('/').join(path.sep));
|
||||
const configFileDir = path.dirname(configFile);
|
||||
|
||||
const cli = new RocketCli({
|
||||
argv: [type, '--config-file', configFile],
|
||||
});
|
||||
|
||||
await cli.setup();
|
||||
cli.config.outputDevDir = path.join(configFileDir, '__output-dev');
|
||||
cli.config.devServer.open = false;
|
||||
cli.config.devServer.port = 8080;
|
||||
cli.config.watch = false;
|
||||
cli.config.outputDir = path.join(configFileDir, '__output');
|
||||
|
||||
await fs.emptyDir(cli.config.outputDevDir);
|
||||
await fs.emptyDir(cli.config.outputDir);
|
||||
|
||||
await cli.run();
|
||||
return cli;
|
||||
|
||||
/**
|
||||
* @param {*} cli
|
||||
* @param {string} fileName
|
||||
* @param {readOutputOptions} options
|
||||
*/
|
||||
async function readOutput2(fileName, options = {}) {
|
||||
options.type = type;
|
||||
return readOutput(cli, fileName, options);
|
||||
}
|
||||
|
||||
function outputExists(fileName) {
|
||||
const outputDir = type === 'build' ? cli.config.outputDir : cli.config.outputDevDir;
|
||||
const filePath = path.join(outputDir, fileName);
|
||||
|
||||
return fs.existsSync(filePath);
|
||||
}
|
||||
|
||||
if (captureLog) {
|
||||
console.log = origLog;
|
||||
}
|
||||
return { log, readOutput: readOutput2, cli, outputExists };
|
||||
}
|
||||
|
||||
export async function executeBootstrap(pathToDir) {
|
||||
const configFileDir = path.join(fixtureDir, pathToDir.split('/').join(path.sep));
|
||||
const cli = new RocketCli({ argv: ['bootstrap'] });
|
||||
|
||||
await cli.setup();
|
||||
cli.config.outputDevDir = path.join(configFileDir, '__output-dev');
|
||||
cli.config.devServer.open = false;
|
||||
cli.config.devServer.port = 8080;
|
||||
cli.config.watch = false;
|
||||
cli.config.outputDir = path.join(configFileDir, '__output');
|
||||
|
||||
await fs.emptyDir(configFileDir);
|
||||
await execute(cli, configFileDir);
|
||||
return cli;
|
||||
}
|
||||
await cli.run();
|
||||
|
||||
export async function executeStart(pathToConfig) {
|
||||
const configFile = path.join(fixtureDir, pathToConfig.split('/').join(path.sep));
|
||||
const cli = new RocketCli({
|
||||
argv: ['start', '--config-file', configFile],
|
||||
});
|
||||
await execute(cli, path.dirname(configFile));
|
||||
return cli;
|
||||
}
|
||||
|
||||
export async function executeBuild(pathToConfig) {
|
||||
const configFile = path.join(fixtureDir, pathToConfig.split('/').join(path.sep));
|
||||
const cli = new RocketCli({
|
||||
argv: ['build', '--config-file', configFile],
|
||||
});
|
||||
await execute(cli, path.dirname(configFile));
|
||||
return cli;
|
||||
}
|
||||
|
||||
export async function executeLint(pathToConfig) {
|
||||
const configFile = path.join(fixtureDir, pathToConfig.split('/').join(path.sep));
|
||||
const cli = new RocketCli({
|
||||
argv: ['lint', '--config-file', configFile],
|
||||
});
|
||||
await execute(cli, path.dirname(configFile));
|
||||
return cli;
|
||||
return { cli };
|
||||
}
|
||||
|
||||
export function trimWhiteSpace(inString) {
|
||||
|
||||
@@ -1,17 +1,11 @@
|
||||
import chai from 'chai';
|
||||
import chalk from 'chalk';
|
||||
import {
|
||||
executeBuild,
|
||||
executeStart,
|
||||
readBuildOutput,
|
||||
readStartOutput,
|
||||
setFixtureDir,
|
||||
} from '@rocket/cli/test-helpers';
|
||||
import { execute, setFixtureDir } from '@rocket/cli/test-helpers';
|
||||
|
||||
const { expect } = chai;
|
||||
|
||||
describe('RocketCli computedConfig', () => {
|
||||
let cli;
|
||||
let cleanupCli;
|
||||
|
||||
before(() => {
|
||||
// ignore colors in tests as most CIs won't support it
|
||||
@@ -20,90 +14,117 @@ describe('RocketCli computedConfig', () => {
|
||||
});
|
||||
|
||||
afterEach(async () => {
|
||||
if (cli?.cleanup) {
|
||||
await cli.cleanup();
|
||||
if (cleanupCli?.cleanup) {
|
||||
await cleanupCli.cleanup();
|
||||
}
|
||||
});
|
||||
|
||||
it('will extract a title from markdown and set first folder as section', async () => {
|
||||
cli = await executeStart('computed-config-fixtures/headlines/rocket.config.js');
|
||||
const { cli, readOutput } = await execute(
|
||||
'computed-config-fixtures/headlines/rocket.config.js',
|
||||
{ captureLog: true },
|
||||
);
|
||||
cleanupCli = cli;
|
||||
|
||||
const indexHtml = await readStartOutput(cli, 'index.html');
|
||||
const indexHtml = await readOutput('index.html');
|
||||
const [indexTitle, indexSection] = indexHtml.split('\n');
|
||||
expect(indexTitle).to.equal('Root');
|
||||
expect(indexSection).to.be.undefined;
|
||||
|
||||
const subHtml = await readStartOutput(cli, 'sub/index.html');
|
||||
const subHtml = await readOutput('sub/index.html');
|
||||
const [subTitle, subSection] = subHtml.split('\n');
|
||||
expect(subTitle).to.equal('Root: Sub');
|
||||
expect(subSection).to.equal('sub');
|
||||
|
||||
const subSubHtml = await readStartOutput(cli, 'sub/subsub/index.html');
|
||||
const subSubHtml = await readOutput('sub/subsub/index.html');
|
||||
const [subSubTitle, subSubSection] = subSubHtml.split('\n');
|
||||
expect(subSubTitle).to.equal('Sub: SubSub');
|
||||
expect(subSubSection).to.equal('sub');
|
||||
|
||||
const sub2Html = await readStartOutput(cli, 'sub2/index.html');
|
||||
const sub2Html = await readOutput('sub2/index.html');
|
||||
const [sub2Title, sub2Section] = sub2Html.split('\n');
|
||||
expect(sub2Title).to.equal('Root: Sub2');
|
||||
expect(sub2Section).to.equal('sub2');
|
||||
|
||||
const withDataHtml = await readStartOutput(cli, 'with-data/index.html');
|
||||
const withDataHtml = await readOutput('with-data/index.html');
|
||||
const [withDataTitle, withDataSection] = withDataHtml.split('\n');
|
||||
expect(withDataTitle).to.equal('Set via data');
|
||||
expect(withDataSection).be.undefined;
|
||||
});
|
||||
|
||||
it('will note create a social media image in "start"', async () => {
|
||||
cli = await executeStart('computed-config-fixtures/social-images-only-build/rocket.config.js');
|
||||
const { cli, readOutput } = await execute(
|
||||
'computed-config-fixtures/social-images-only-build/rocket.config.js',
|
||||
{
|
||||
captureLog: true,
|
||||
},
|
||||
);
|
||||
cleanupCli = cli;
|
||||
|
||||
const indexHtml = await readStartOutput(cli, 'index.html');
|
||||
const indexHtml = await readOutput('index.html');
|
||||
expect(indexHtml).to.equal('');
|
||||
});
|
||||
|
||||
it('will create a social media image in "build"', async () => {
|
||||
cli = await executeBuild('computed-config-fixtures/social-images-only-build/rocket.config.js');
|
||||
const { cli, readOutput } = await execute(
|
||||
'computed-config-fixtures/social-images-only-build/rocket.config.js',
|
||||
{
|
||||
captureLog: true,
|
||||
type: 'build',
|
||||
},
|
||||
);
|
||||
cleanupCli = cli;
|
||||
|
||||
const indexHtml = await readBuildOutput(cli, 'index.html', {
|
||||
const indexHtml = await readOutput('index.html', {
|
||||
stripToBody: true,
|
||||
});
|
||||
expect(indexHtml).to.equal('/_merged_assets/11ty-img/5893749-1200.png');
|
||||
});
|
||||
|
||||
it('will create a social media image for every page', async () => {
|
||||
cli = await executeStart('computed-config-fixtures/social-images/rocket.config.js');
|
||||
const { cli, readOutput } = await execute(
|
||||
'computed-config-fixtures/social-images/rocket.config.js',
|
||||
{
|
||||
captureLog: true,
|
||||
},
|
||||
);
|
||||
cleanupCli = cli;
|
||||
|
||||
const indexHtml = await readStartOutput(cli, 'index.html');
|
||||
const indexHtml = await readOutput('index.html');
|
||||
expect(indexHtml).to.equal('/_merged_assets/11ty-img/c4c29ec7-1200.png');
|
||||
|
||||
const guidesHtml = await readStartOutput(cli, 'guides/index.html');
|
||||
const guidesHtml = await readOutput('guides/index.html');
|
||||
expect(guidesHtml).to.equal('/_merged_assets/11ty-img/c593a8cd-1200.png');
|
||||
|
||||
const gettingStartedHtml = await readStartOutput(
|
||||
cli,
|
||||
'guides/first-pages/getting-started/index.html',
|
||||
);
|
||||
const gettingStartedHtml = await readOutput('guides/first-pages/getting-started/index.html');
|
||||
expect(gettingStartedHtml).to.equal('/_merged_assets/11ty-img/d989ab1a-1200.png');
|
||||
});
|
||||
|
||||
it('can override the svg function globally to adjust all social media image', async () => {
|
||||
cli = await executeStart('computed-config-fixtures/social-images-override/rocket.config.js');
|
||||
const { cli, readOutput } = await execute(
|
||||
'computed-config-fixtures/social-images-override/rocket.config.js',
|
||||
{
|
||||
captureLog: true,
|
||||
},
|
||||
);
|
||||
cleanupCli = cli;
|
||||
|
||||
const indexHtml = await readStartOutput(cli, 'index.html');
|
||||
const indexHtml = await readOutput('index.html');
|
||||
expect(indexHtml).to.equal('/_merged_assets/11ty-img/d76265ed-1200.png');
|
||||
|
||||
const guidesHtml = await readStartOutput(cli, 'guides/index.html');
|
||||
const guidesHtml = await readOutput('guides/index.html');
|
||||
expect(guidesHtml).to.equal('/_merged_assets/11ty-img/d76265ed-1200.png');
|
||||
|
||||
const gettingStartedHtml = await readStartOutput(
|
||||
cli,
|
||||
'guides/first-pages/getting-started/index.html',
|
||||
);
|
||||
const gettingStartedHtml = await readOutput('guides/first-pages/getting-started/index.html');
|
||||
expect(gettingStartedHtml).to.equal('/_merged_assets/11ty-img/d76265ed-1200.png');
|
||||
});
|
||||
|
||||
it('will add "../" for links and image urls only within named template files', async () => {
|
||||
cli = await executeStart('computed-config-fixtures/image-link/rocket.config.js');
|
||||
const {
|
||||
cli,
|
||||
readOutput,
|
||||
} = await execute('computed-config-fixtures/image-link/rocket.config.js', { captureLog: true });
|
||||
cleanupCli = cli;
|
||||
|
||||
const namedMdContent = [
|
||||
'<p>',
|
||||
@@ -127,22 +148,22 @@ describe('RocketCli computedConfig', () => {
|
||||
'</div>',
|
||||
];
|
||||
|
||||
const templateHtml = await readStartOutput(cli, 'template/index.html', { formatHtml: true });
|
||||
const templateHtml = await readOutput('template/index.html', { formatHtml: true });
|
||||
expect(templateHtml, 'template/index.html does not match').to.equal(
|
||||
namedHtmlContent.join('\n'),
|
||||
);
|
||||
|
||||
const guidesHtml = await readStartOutput(cli, 'guides/index.html', { formatHtml: true });
|
||||
const guidesHtml = await readOutput('guides/index.html', { formatHtml: true });
|
||||
expect(guidesHtml, 'guides/index.html does not match').to.equal(
|
||||
[...namedMdContent, ...namedHtmlContent].join('\n'),
|
||||
);
|
||||
|
||||
const noAdjustHtml = await readStartOutput(cli, 'no-adjust/index.html');
|
||||
const noAdjustHtml = await readOutput('no-adjust/index.html');
|
||||
expect(noAdjustHtml, 'no-adjust/index.html does not match').to.equal(
|
||||
'<p>Nothing to adjust in here</p>',
|
||||
);
|
||||
|
||||
const rawHtml = await readStartOutput(cli, 'one-level/raw/index.html');
|
||||
const rawHtml = await readOutput('one-level/raw/index.html');
|
||||
expect(rawHtml, 'raw/index.html does not match').to.equal(
|
||||
[
|
||||
'<div>',
|
||||
@@ -159,7 +180,7 @@ describe('RocketCli computedConfig', () => {
|
||||
);
|
||||
|
||||
// for index files no '../' will be added
|
||||
const indexHtml = await readStartOutput(cli, 'index.html', { formatHtml: true });
|
||||
const indexHtml = await readOutput('index.html', { formatHtml: true });
|
||||
expect(indexHtml, 'index.html does not match').to.equal(
|
||||
[
|
||||
'<p>',
|
||||
@@ -188,19 +209,28 @@ describe('RocketCli computedConfig', () => {
|
||||
});
|
||||
|
||||
it('can be configured via setupEleventyComputedConfig', async () => {
|
||||
cli = await executeStart('computed-config-fixtures/setup/addPlugin.rocket.config.js');
|
||||
const { cli, readOutput } = await execute(
|
||||
'computed-config-fixtures/setup/addPlugin.rocket.config.js',
|
||||
{
|
||||
captureLog: true,
|
||||
},
|
||||
);
|
||||
cleanupCli = cli;
|
||||
|
||||
const indexHtml = await readStartOutput(cli, 'index.html');
|
||||
const indexHtml = await readOutput('index.html');
|
||||
expect(indexHtml).to.equal('test-value');
|
||||
});
|
||||
|
||||
it('always assigns layout-default exept for index.* files who get layout-index', async () => {
|
||||
cli = await executeStart('computed-config-fixtures/layout/rocket.config.js');
|
||||
const { cli, readOutput } = await execute('computed-config-fixtures/layout/rocket.config.js', {
|
||||
captureLog: true,
|
||||
});
|
||||
cleanupCli = cli;
|
||||
|
||||
const indexHtml = await readStartOutput(cli, 'index.html');
|
||||
const indexHtml = await readOutput('index.html');
|
||||
expect(indexHtml).to.include('<body layout="layout-index">');
|
||||
|
||||
const pageHtml = await readStartOutput(cli, 'page/index.html');
|
||||
const pageHtml = await readOutput('page/index.html');
|
||||
expect(pageHtml).to.include('<body layout="layout-default">');
|
||||
});
|
||||
});
|
||||
|
||||
@@ -2,13 +2,9 @@ import chai from 'chai';
|
||||
import fetch from 'node-fetch';
|
||||
import chalk from 'chalk';
|
||||
import {
|
||||
execute,
|
||||
executeBootstrap,
|
||||
executeBuild,
|
||||
executeLint,
|
||||
executeStart,
|
||||
expectThrowsAsync,
|
||||
readBuildOutput,
|
||||
readStartOutput,
|
||||
getfixtureExpectedFiles,
|
||||
setFixtureDir,
|
||||
} from '@rocket/cli/test-helpers';
|
||||
@@ -17,7 +13,7 @@ import fs from 'fs-extra';
|
||||
const { expect } = chai;
|
||||
|
||||
describe('RocketCli e2e', () => {
|
||||
let cli;
|
||||
let cleanupCli;
|
||||
|
||||
before(() => {
|
||||
// ignore colors in tests as most CIs won't support it
|
||||
@@ -26,20 +22,24 @@ describe('RocketCli e2e', () => {
|
||||
});
|
||||
|
||||
afterEach(async () => {
|
||||
if (cli?.cleanup) {
|
||||
await cli.cleanup();
|
||||
if (cleanupCli?.cleanup) {
|
||||
await cleanupCli.cleanup();
|
||||
}
|
||||
});
|
||||
|
||||
it('can add a unified plugin via the config', async () => {
|
||||
cli = await executeStart('e2e-fixtures/unified-plugin/rocket.config.js');
|
||||
const indexHtml = await readStartOutput(cli, 'index.html');
|
||||
const { cli, readOutput } = await execute('e2e-fixtures/unified-plugin/rocket.config.js', {
|
||||
captureLog: true,
|
||||
});
|
||||
cleanupCli = cli;
|
||||
const indexHtml = await readOutput('index.html');
|
||||
expect(indexHtml).to.equal(`<p>See a 🐶</p>`);
|
||||
});
|
||||
|
||||
describe('bootstrap command', () => {
|
||||
it('can bootstrap a project', async () => {
|
||||
cli = await executeBootstrap('e2e-fixtures/bootstrap/__output');
|
||||
const { cli } = await executeBootstrap('e2e-fixtures/bootstrap/__output');
|
||||
cleanupCli = cli;
|
||||
|
||||
for (const p of await getfixtureExpectedFiles('e2e-fixtures/bootstrap/expected')) {
|
||||
const actual = await fs.readFile(
|
||||
@@ -54,8 +54,11 @@ describe('RocketCli e2e', () => {
|
||||
|
||||
describe('eleventy in config', () => {
|
||||
it('can modify eleventy via an elventy function in the config', async () => {
|
||||
cli = await executeStart('e2e-fixtures/content/eleventy.rocket.config.js');
|
||||
const indexHtml = await readStartOutput(cli, 'index.html');
|
||||
const { cli, readOutput } = await execute('e2e-fixtures/content/eleventy.rocket.config.js', {
|
||||
captureLog: true,
|
||||
});
|
||||
cleanupCli = cli;
|
||||
const indexHtml = await readOutput('index.html');
|
||||
expect(indexHtml).to.equal(
|
||||
['# BEFORE #', '<p>Content inside <code>docs/index.md</code></p>'].join('\n'),
|
||||
);
|
||||
@@ -63,7 +66,8 @@ describe('RocketCli e2e', () => {
|
||||
|
||||
it('will throw if you try to set options by returning an object', async () => {
|
||||
await expectThrowsAsync(
|
||||
() => executeStart('e2e-fixtures/content/eleventy-return.rocket.config.js'),
|
||||
() =>
|
||||
execute('e2e-fixtures/content/eleventy-return.rocket.config.js', { captureLog: true }),
|
||||
{
|
||||
errorMatch: /Error in your Eleventy config file.*/,
|
||||
},
|
||||
@@ -73,13 +77,23 @@ describe('RocketCli e2e', () => {
|
||||
|
||||
describe('setupDevAndBuildPlugins in config', () => {
|
||||
it('can add a rollup plugin via setupDevAndBuildPlugins for build command', async () => {
|
||||
cli = await executeBuild('e2e-fixtures/rollup-plugin/devbuild.rocket.config.js');
|
||||
const inlineModule = await readBuildOutput(cli, 'e97af63d.js');
|
||||
const { cli, readOutput } = await execute(
|
||||
'e2e-fixtures/rollup-plugin/devbuild.rocket.config.js',
|
||||
{
|
||||
captureLog: true,
|
||||
type: 'build',
|
||||
},
|
||||
);
|
||||
cleanupCli = cli;
|
||||
const inlineModule = await readOutput('e97af63d.js');
|
||||
expect(inlineModule).to.equal('var a={test:"data"};console.log(a);');
|
||||
});
|
||||
|
||||
it('can add a rollup plugin via setupDevAndBuildPlugins for start command', async () => {
|
||||
cli = await executeStart('e2e-fixtures/rollup-plugin/devbuild.rocket.config.js');
|
||||
const { cli } = await execute('e2e-fixtures/rollup-plugin/devbuild.rocket.config.js', {
|
||||
captureLog: true,
|
||||
});
|
||||
cleanupCli = cli;
|
||||
|
||||
const response = await fetch('http://localhost:8080/test-data.json');
|
||||
expect(response.ok).to.be.true; // no server error
|
||||
@@ -90,37 +104,56 @@ describe('RocketCli e2e', () => {
|
||||
});
|
||||
|
||||
it('can add a rollup plugin for dev & build and modify a build only plugin via the config', async () => {
|
||||
cli = await executeBuild('e2e-fixtures/rollup-plugin/devbuild-build.rocket.config.js');
|
||||
const inlineModule = await readBuildOutput(cli, 'e97af63d.js');
|
||||
const { cli, readOutput } = await execute(
|
||||
'e2e-fixtures/rollup-plugin/devbuild-build.rocket.config.js',
|
||||
{
|
||||
captureLog: true,
|
||||
type: 'build',
|
||||
},
|
||||
);
|
||||
cleanupCli = cli;
|
||||
const inlineModule = await readOutput('e97af63d.js');
|
||||
expect(inlineModule).to.equal('var a={test:"data"};console.log(a);');
|
||||
});
|
||||
|
||||
it('can adjust the inputDir', async () => {
|
||||
cli = await executeStart('e2e-fixtures/change-input-dir/rocket.config.js');
|
||||
const { cli, readOutput } = await execute('e2e-fixtures/change-input-dir/rocket.config.js', {
|
||||
captureLog: true,
|
||||
});
|
||||
cleanupCli = cli;
|
||||
|
||||
const indexHtml = await readStartOutput(cli, 'index.html');
|
||||
const indexHtml = await readOutput('index.html');
|
||||
expect(indexHtml).to.equal('<p>Markdown in <code>docs/page/index.md</code></p>');
|
||||
});
|
||||
|
||||
it('can access main rocket config values via {{rocketConfig.value}}', async () => {
|
||||
cli = await executeStart('e2e-fixtures/rocket-config-in-template/rocket.config.js');
|
||||
const { cli, readOutput } = await execute(
|
||||
'e2e-fixtures/rocket-config-in-template/rocket.config.js',
|
||||
{
|
||||
captureLog: true,
|
||||
},
|
||||
);
|
||||
cleanupCli = cli;
|
||||
|
||||
const indexHtml = await readStartOutput(cli, 'index.html');
|
||||
const indexHtml = await readOutput('index.html');
|
||||
expect(indexHtml).to.equal(
|
||||
'<p>You can show Rocket config data like rocketConfig.absoluteBaseUrl = <a href="http://test-domain.com/">http://test-domain.com/</a></p>',
|
||||
);
|
||||
});
|
||||
|
||||
it('can add a pathPrefix that will not influence the start command', async () => {
|
||||
cli = await executeStart('e2e-fixtures/content/pathPrefix.rocket.config.js');
|
||||
const { cli, readOutput } = await execute('e2e-fixtures/content/pathPrefix.rocket.config.js', {
|
||||
captureLog: true,
|
||||
});
|
||||
cleanupCli = cli;
|
||||
|
||||
const linkHtml = await readStartOutput(cli, 'link/index.html');
|
||||
const linkHtml = await readOutput('link/index.html');
|
||||
expect(linkHtml).to.equal(
|
||||
['<p><a href="../">home</a></p>', '<p><a href="/">absolute home</a></p>'].join('\n'),
|
||||
);
|
||||
const assetHtml = await readStartOutput(cli, 'use-assets/index.html');
|
||||
const assetHtml = await readOutput('use-assets/index.html');
|
||||
expect(assetHtml).to.equal('<link rel="stylesheet" href="/_merged_assets/some.css">');
|
||||
const imageHtml = await readStartOutput(cli, 'image/index.html', { replaceImageHashes: true });
|
||||
const imageHtml = await readOutput('image/index.html', { replaceImageHashes: true });
|
||||
expect(imageHtml).to.equal(
|
||||
[
|
||||
'<p>',
|
||||
@@ -147,9 +180,13 @@ describe('RocketCli e2e', () => {
|
||||
});
|
||||
|
||||
it('can add a pathPrefix that will be used in the build command', async () => {
|
||||
cli = await executeBuild('e2e-fixtures/content/pathPrefix.rocket.config.js');
|
||||
const { cli, readOutput } = await execute('e2e-fixtures/content/pathPrefix.rocket.config.js', {
|
||||
captureLog: true,
|
||||
type: 'build',
|
||||
});
|
||||
cleanupCli = cli;
|
||||
|
||||
const linkHtml = await readBuildOutput(cli, 'link/index.html', {
|
||||
const linkHtml = await readOutput('link/index.html', {
|
||||
stripToBody: true,
|
||||
});
|
||||
expect(linkHtml).to.equal(
|
||||
@@ -157,11 +194,11 @@ describe('RocketCli e2e', () => {
|
||||
'\n',
|
||||
),
|
||||
);
|
||||
const assetHtml = await readBuildOutput(cli, 'use-assets/index.html');
|
||||
const assetHtml = await readOutput('use-assets/index.html');
|
||||
expect(assetHtml).to.equal(
|
||||
'<html><head><link rel="stylesheet" href="../41297ffa.css">\n\n</head><body>\n\n</body></html>',
|
||||
);
|
||||
let imageHtml = await readBuildOutput(cli, 'image/index.html');
|
||||
let imageHtml = await readOutput('image/index.html');
|
||||
imageHtml = imageHtml.replace(/\.\.\/([a-z0-9]+)\./g, '../__HASH__.');
|
||||
expect(imageHtml).to.equal(
|
||||
[
|
||||
@@ -184,15 +221,22 @@ describe('RocketCli e2e', () => {
|
||||
});
|
||||
|
||||
it('smoke test for link checking', async () => {
|
||||
await expectThrowsAsync(() => executeLint('e2e-fixtures/lint-links/rocket.config.js'), {
|
||||
errorMatch: /Found 1 missing reference targets/,
|
||||
});
|
||||
await expectThrowsAsync(
|
||||
() => execute('e2e-fixtures/lint-links/rocket.config.js', { captureLog: true, type: 'lint' }),
|
||||
{
|
||||
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 { cli, readOutput } = await execute('e2e-fixtures/rollup-override/rocket.config.js', {
|
||||
captureLog: true,
|
||||
type: 'build',
|
||||
});
|
||||
cleanupCli = cli;
|
||||
|
||||
const indexHtml = await readBuildOutput(cli, 'index.html', {
|
||||
const indexHtml = await readOutput('index.html', {
|
||||
stripToBody: true,
|
||||
formatHtml: true,
|
||||
});
|
||||
@@ -210,14 +254,27 @@ describe('RocketCli e2e', () => {
|
||||
|
||||
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');
|
||||
const { cli, readOutput } = await execute(
|
||||
'e2e-fixtures/adjust-eleventy-config/rocket.config.js',
|
||||
{
|
||||
captureLog: true,
|
||||
},
|
||||
);
|
||||
cleanupCli = cli;
|
||||
const indexHtml = await readOutput('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', {
|
||||
const { cli, readOutput } = await execute(
|
||||
'e2e-fixtures/adjust-eleventy-config/rocket.config.js',
|
||||
{
|
||||
captureLog: true,
|
||||
type: 'build',
|
||||
},
|
||||
);
|
||||
cleanupCli = cli;
|
||||
const indexBuildHtml = await readOutput('index.html', {
|
||||
stripToBody: true,
|
||||
});
|
||||
expect(indexBuildHtml).to.equal('<p><a href="build:/path/to/page/">link</a></p>');
|
||||
|
||||
@@ -1,11 +1,11 @@
|
||||
import chai from 'chai';
|
||||
import chalk from 'chalk';
|
||||
import { executeStart, readStartOutput, setFixtureDir } from '@rocket/cli/test-helpers';
|
||||
import { execute, setFixtureDir } from '@rocket/cli/test-helpers';
|
||||
|
||||
const { expect } = chai;
|
||||
|
||||
describe('RocketCli images', () => {
|
||||
let cli;
|
||||
let cleanupCli;
|
||||
|
||||
before(() => {
|
||||
// ignore colors in tests as most CIs won't support it
|
||||
@@ -14,15 +14,18 @@ describe('RocketCli images', () => {
|
||||
});
|
||||
|
||||
afterEach(async () => {
|
||||
if (cli?.cleanup) {
|
||||
await cli.cleanup();
|
||||
if (cleanupCli?.cleanup) {
|
||||
await cleanupCli.cleanup();
|
||||
}
|
||||
});
|
||||
|
||||
describe('Images', () => {
|
||||
it('does render content images responsive', async () => {
|
||||
cli = await executeStart('e2e-fixtures/images/rocket.config.js');
|
||||
const indexHtml = await readStartOutput(cli, 'index.html', {
|
||||
const { cli, readOutput } = await execute('e2e-fixtures/images/rocket.config.js', {
|
||||
captureLog: true,
|
||||
});
|
||||
cleanupCli = cli;
|
||||
const indexHtml = await readOutput('index.html', {
|
||||
formatHtml: true,
|
||||
replaceImageHashes: true,
|
||||
});
|
||||
@@ -57,7 +60,7 @@ describe('RocketCli images', () => {
|
||||
].join('\n'),
|
||||
);
|
||||
|
||||
const keepSvgHtml = await readStartOutput(cli, 'ignores/index.html', {
|
||||
const keepSvgHtml = await readOutput('ignores/index.html', {
|
||||
formatHtml: true,
|
||||
replaceImageHashes: true,
|
||||
});
|
||||
@@ -102,7 +105,7 @@ describe('RocketCli images', () => {
|
||||
].join('\n'),
|
||||
);
|
||||
|
||||
const tableHtml = await readStartOutput(cli, 'table/index.html', {
|
||||
const tableHtml = await readOutput('table/index.html', {
|
||||
formatHtml: true,
|
||||
replaceImageHashes: true,
|
||||
});
|
||||
@@ -150,8 +153,12 @@ describe('RocketCli images', () => {
|
||||
});
|
||||
|
||||
it('can configure more patterns to ignore', async () => {
|
||||
cli = await executeStart('e2e-fixtures/images/ignore-more.rocket.config.js');
|
||||
const keepSvgHtml = await readStartOutput(cli, 'ignores/index.html', {
|
||||
const { cli, readOutput } = await execute(
|
||||
'e2e-fixtures/images/ignore-more.rocket.config.js',
|
||||
{ captureLog: true },
|
||||
);
|
||||
cleanupCli = cli;
|
||||
const keepSvgHtml = await readOutput('ignores/index.html', {
|
||||
formatHtml: true,
|
||||
replaceImageHashes: true,
|
||||
});
|
||||
@@ -178,8 +185,11 @@ describe('RocketCli images', () => {
|
||||
});
|
||||
|
||||
it('renders multiple images in the correct order', async () => {
|
||||
cli = await executeStart('e2e-fixtures/images/rocket.config.js');
|
||||
const indexHtml = await readStartOutput(cli, 'two-images/index.html', {
|
||||
const { cli, readOutput } = await execute('e2e-fixtures/images/rocket.config.js', {
|
||||
captureLog: true,
|
||||
});
|
||||
cleanupCli = cli;
|
||||
const indexHtml = await readOutput('two-images/index.html', {
|
||||
formatHtml: true,
|
||||
replaceImageHashes: true,
|
||||
});
|
||||
@@ -242,8 +252,11 @@ describe('RocketCli images', () => {
|
||||
});
|
||||
|
||||
it('can configure those responsive images', async () => {
|
||||
cli = await executeStart('e2e-fixtures/images/small.rocket.config.js');
|
||||
const indexHtml = await readStartOutput(cli, 'index.html', {
|
||||
const { cli, readOutput } = await execute('e2e-fixtures/images/small.rocket.config.js', {
|
||||
captureLog: true,
|
||||
});
|
||||
cleanupCli = cli;
|
||||
const indexHtml = await readOutput('index.html', {
|
||||
formatHtml: true,
|
||||
replaceImageHashes: true,
|
||||
});
|
||||
@@ -280,8 +293,11 @@ describe('RocketCli images', () => {
|
||||
});
|
||||
|
||||
it('will only render a figure & figcaption if there is a caption/title', async () => {
|
||||
cli = await executeStart('e2e-fixtures/images/small.rocket.config.js');
|
||||
const indexHtml = await readStartOutput(cli, 'no-title/index.html', {
|
||||
const { cli, readOutput } = await execute('e2e-fixtures/images/small.rocket.config.js', {
|
||||
captureLog: true,
|
||||
});
|
||||
cleanupCli = cli;
|
||||
const indexHtml = await readOutput('no-title/index.html', {
|
||||
formatHtml: true,
|
||||
replaceImageHashes: true,
|
||||
});
|
||||
@@ -315,8 +331,12 @@ describe('RocketCli images', () => {
|
||||
});
|
||||
|
||||
it('will render an img with srcset and sizes if there is only one image format', async () => {
|
||||
cli = await executeStart('e2e-fixtures/images/single-format.rocket.config.js');
|
||||
const indexHtml = await readStartOutput(cli, 'no-title/index.html', {
|
||||
const {
|
||||
cli,
|
||||
readOutput,
|
||||
} = await execute('e2e-fixtures/images/single-format.rocket.config.js', { captureLog: true });
|
||||
cleanupCli = cli;
|
||||
const indexHtml = await readOutput('no-title/index.html', {
|
||||
formatHtml: true,
|
||||
replaceImageHashes: true,
|
||||
});
|
||||
|
||||
@@ -1,16 +1,11 @@
|
||||
import chai from 'chai';
|
||||
import chalk from 'chalk';
|
||||
import {
|
||||
executeStart,
|
||||
readStartOutput,
|
||||
trimWhiteSpace,
|
||||
setFixtureDir,
|
||||
} from '@rocket/cli/test-helpers';
|
||||
import { execute, trimWhiteSpace, setFixtureDir } from '@rocket/cli/test-helpers';
|
||||
|
||||
const { expect } = chai;
|
||||
|
||||
describe('RocketCli mergeTemplates', () => {
|
||||
let cli;
|
||||
let cleanupCli;
|
||||
|
||||
before(() => {
|
||||
// ignore colors in tests as most CIs won't support it
|
||||
@@ -19,15 +14,18 @@ describe('RocketCli mergeTemplates', () => {
|
||||
});
|
||||
|
||||
afterEach(async () => {
|
||||
if (cli?.cleanup) {
|
||||
await cli.cleanup();
|
||||
if (cleanupCli?.cleanup) {
|
||||
await cleanupCli.cleanup();
|
||||
}
|
||||
});
|
||||
|
||||
it('merges it in the defined order', async () => {
|
||||
cli = await executeStart('merge-templates-fixtures/order/rocket.config.js');
|
||||
const { cli, readOutput } = await execute('merge-templates-fixtures/order/rocket.config.js', {
|
||||
captureLog: true,
|
||||
});
|
||||
cleanupCli = cli;
|
||||
|
||||
const indexHtml = await readStartOutput(cli, 'index.html');
|
||||
const indexHtml = await readOutput('index.html');
|
||||
expect(trimWhiteSpace(indexHtml)).to.equal(
|
||||
[
|
||||
'<p>30-first</p>',
|
||||
@@ -40,9 +38,13 @@ describe('RocketCli mergeTemplates', () => {
|
||||
});
|
||||
|
||||
it('presets can overwrite in order', async () => {
|
||||
cli = await executeStart('merge-templates-fixtures/overwrite/rocket.config.js');
|
||||
const { cli, readOutput } = await execute(
|
||||
'merge-templates-fixtures/overwrite/rocket.config.js',
|
||||
{ captureLog: true },
|
||||
);
|
||||
cleanupCli = cli;
|
||||
|
||||
const indexHtml = await readStartOutput(cli, 'index.html');
|
||||
const indexHtml = await readOutput('index.html');
|
||||
expect(trimWhiteSpace(indexHtml)).to.equal(
|
||||
['<p>overwritten second</p>', '<p>third</p>', '<p>overwritten first to be last</p>'].join(
|
||||
'\n',
|
||||
@@ -51,9 +53,12 @@ describe('RocketCli mergeTemplates', () => {
|
||||
});
|
||||
|
||||
it('presets can add inbetween', async () => {
|
||||
cli = await executeStart('merge-templates-fixtures/add/rocket.config.js');
|
||||
const { cli, readOutput } = await execute('merge-templates-fixtures/add/rocket.config.js', {
|
||||
captureLog: true,
|
||||
});
|
||||
cleanupCli = cli;
|
||||
|
||||
const indexHtml = await readStartOutput(cli, 'index.html');
|
||||
const indexHtml = await readOutput('index.html');
|
||||
expect(trimWhiteSpace(indexHtml)).to.equal(
|
||||
[
|
||||
'<p>first</p>',
|
||||
|
||||
@@ -1,11 +1,11 @@
|
||||
import chai from 'chai';
|
||||
import chalk from 'chalk';
|
||||
import { executeStart, readStartOutput, setFixtureDir } from '@rocket/cli/test-helpers';
|
||||
import { execute, setFixtureDir } from '@rocket/cli/test-helpers';
|
||||
|
||||
const { expect } = chai;
|
||||
|
||||
describe('RocketCli preset', () => {
|
||||
let cli;
|
||||
let cleanupCli;
|
||||
|
||||
before(() => {
|
||||
// ignore colors in tests as most CIs won't support it
|
||||
@@ -14,21 +14,24 @@ describe('RocketCli preset', () => {
|
||||
});
|
||||
|
||||
afterEach(async () => {
|
||||
if (cli?.cleanup) {
|
||||
await cli.cleanup();
|
||||
if (cleanupCli?.cleanup) {
|
||||
await cleanupCli.cleanup();
|
||||
}
|
||||
});
|
||||
|
||||
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');
|
||||
it('offers a default layout (with head, header, content, footer, bottom) and raw layout', async () => {
|
||||
const { cli, readOutput } = await execute('preset-fixtures/default/rocket.config.js', {
|
||||
captureLog: true,
|
||||
});
|
||||
cleanupCli = cli;
|
||||
|
||||
const rawHtml = await readStartOutput(cli, 'raw/index.html');
|
||||
const rawHtml = await readOutput('raw/index.html');
|
||||
expect(rawHtml).to.equal('<p>Just raw</p>');
|
||||
|
||||
const indexHtml = await readStartOutput(cli, 'index.html');
|
||||
const indexHtml = await readOutput('index.html');
|
||||
expect(indexHtml).to.include('<body layout="layout-index">');
|
||||
|
||||
const pageHtml = await readStartOutput(cli, 'page/index.html', {
|
||||
const pageHtml = await readOutput('page/index.html', {
|
||||
stripScripts: true,
|
||||
formatHtml: true,
|
||||
});
|
||||
@@ -93,16 +96,22 @@ describe('RocketCli preset', () => {
|
||||
});
|
||||
|
||||
it('allows to add content to the head without overriding', async () => {
|
||||
cli = await executeStart('preset-fixtures/add-to-head/rocket.config.js');
|
||||
const { cli, readOutput } = await execute('preset-fixtures/add-to-head/rocket.config.js', {
|
||||
captureLog: true,
|
||||
});
|
||||
cleanupCli = cli;
|
||||
|
||||
const indexHtml = await readStartOutput(cli, 'index.html');
|
||||
const indexHtml = await readOutput('index.html');
|
||||
expect(indexHtml).to.include('<meta name="added" content="at the top" />');
|
||||
});
|
||||
|
||||
it('a preset can provide an adjustImagePresets() function', async () => {
|
||||
cli = await executeStart('preset-fixtures/use-preset/rocket.config.js');
|
||||
const { cli, readOutput } = await execute('preset-fixtures/use-preset/rocket.config.js', {
|
||||
captureLog: true,
|
||||
});
|
||||
cleanupCli = cli;
|
||||
|
||||
const indexHtml = await readStartOutput(cli, 'index.html', {
|
||||
const indexHtml = await readOutput('index.html', {
|
||||
formatHtml: true,
|
||||
replaceImageHashes: true,
|
||||
});
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import chai from 'chai';
|
||||
import chalk from 'chalk';
|
||||
import { executeBuild, readStartOutput, setFixtureDir } from '@rocket/cli/test-helpers';
|
||||
import { execute, setFixtureDir } from '@rocket/cli/test-helpers';
|
||||
|
||||
const { expect } = chai;
|
||||
|
||||
@@ -17,7 +17,7 @@ function getServiceWorkerUrl(text) {
|
||||
}
|
||||
|
||||
describe('RocketCli e2e', () => {
|
||||
let cli;
|
||||
let cleanupCli;
|
||||
|
||||
before(() => {
|
||||
// ignore colors in tests as most CIs won't support it
|
||||
@@ -26,20 +26,28 @@ describe('RocketCli e2e', () => {
|
||||
});
|
||||
|
||||
afterEach(async () => {
|
||||
if (cli?.cleanup) {
|
||||
await cli.cleanup();
|
||||
if (cleanupCli?.cleanup) {
|
||||
await cleanupCli.cleanup();
|
||||
}
|
||||
});
|
||||
|
||||
it.only('will add a script to inject the service worker', async () => {
|
||||
cli = await executeBuild('e2e-fixtures/service-worker/rocket.config.js');
|
||||
const indexHtml = await readStartOutput(cli, 'index.html');
|
||||
it('will add a script to inject the service worker', async () => {
|
||||
const { cli, readOutput } = await execute('e2e-fixtures/service-worker/rocket.config.js', {
|
||||
captureLog: true,
|
||||
type: 'build',
|
||||
});
|
||||
cleanupCli = cli;
|
||||
|
||||
// we check the start output here as in the rollup build version it's hard to find
|
||||
const indexHtml = await readOutput('../__output-dev/index.html');
|
||||
const indexInject = getInjectServiceWorker(indexHtml);
|
||||
expect(indexInject).to.equal(
|
||||
'<script type="module" inject-service-worker="" src="/_merged_assets/scripts/registerServiceWorker.js"></script>',
|
||||
);
|
||||
expect(getServiceWorkerUrl(indexHtml)).to.equal('/service-worker.js');
|
||||
const subHtml = await readStartOutput(cli, 'sub/index.html');
|
||||
|
||||
// we check the start output here as in the rollup build version it's hard to find
|
||||
const subHtml = await readOutput('../__output-dev/sub/index.html');
|
||||
const subInject = getInjectServiceWorker(subHtml);
|
||||
expect(subInject).to.equal(
|
||||
'<script type="module" inject-service-worker="" src="/_merged_assets/scripts/registerServiceWorker.js"></script>',
|
||||
@@ -49,14 +57,21 @@ describe('RocketCli e2e', () => {
|
||||
|
||||
// TODO: find a way to run these test either by forcing pathPrefix in start or skipping asset gathering for build or ...
|
||||
it.skip('will add a script to inject the service worker', async () => {
|
||||
cli = await executeBuild('e2e-fixtures/service-worker/pathPrefix.rocket.config.js');
|
||||
const indexHtml = await readStartOutput(cli, 'index.html');
|
||||
const { cli, readOutput } = await execute(
|
||||
'e2e-fixtures/service-worker/pathPrefix.rocket.config.js',
|
||||
{
|
||||
captureLog: true,
|
||||
type: 'build',
|
||||
},
|
||||
);
|
||||
cleanupCli = cli;
|
||||
const indexHtml = await readOutput('index.html');
|
||||
const indexInject = getInjectServiceWorker(indexHtml);
|
||||
expect(indexInject).to.equal(
|
||||
'<script type="module" inject-service-worker="" src="/my-prefix-folder/_merged_assets/scripts/registerServiceWorker.js"></script>',
|
||||
);
|
||||
expect(getServiceWorkerUrl(indexHtml)).to.equal('/my-prefix-folder/service-worker.js');
|
||||
const subHtml = await readStartOutput(cli, 'sub/index.html');
|
||||
const subHtml = await readOutput('sub/index.html');
|
||||
const subInject = getInjectServiceWorker(subHtml);
|
||||
expect(subInject).to.equal(
|
||||
'<script type="module" inject-service-worker="" src="/my-prefix-folder/_merged_assets/scripts/registerServiceWorker.js"></script>',
|
||||
|
||||
@@ -1,16 +1,11 @@
|
||||
import chai from 'chai';
|
||||
import chalk from 'chalk';
|
||||
import {
|
||||
executeStart,
|
||||
readStartOutput,
|
||||
setFixtureDir,
|
||||
startOutputExist,
|
||||
} from '@rocket/cli/test-helpers';
|
||||
import { execute, setFixtureDir } from '@rocket/cli/test-helpers';
|
||||
|
||||
const { expect } = chai;
|
||||
|
||||
describe('RocketCli use cases', () => {
|
||||
let cli;
|
||||
let cleanupCli;
|
||||
|
||||
before(() => {
|
||||
// ignore colors in tests as most CIs won't support it
|
||||
@@ -19,18 +14,22 @@ describe('RocketCli use cases', () => {
|
||||
});
|
||||
|
||||
afterEach(async () => {
|
||||
if (cli?.cleanup) {
|
||||
await cli.cleanup();
|
||||
if (cleanupCli?.cleanup) {
|
||||
await cleanupCli.cleanup();
|
||||
}
|
||||
});
|
||||
|
||||
it('supports dynamic imports', async () => {
|
||||
cli = await executeStart('use-cases/dynamic-imports/rocket.config.js');
|
||||
const {
|
||||
cli,
|
||||
readOutput,
|
||||
outputExists,
|
||||
} = await execute('use-cases/dynamic-imports/rocket.config.js', { captureLog: true });
|
||||
cleanupCli = cli;
|
||||
|
||||
expect(startOutputExist(cli, 'sub/assets/myData.js'), 'static files did not get copied').to.be
|
||||
.true;
|
||||
expect(outputExists('sub/assets/myData.js'), 'static files did not get copied').to.be.true;
|
||||
|
||||
const aboutHtml = await readStartOutput(cli, 'about/index.html', { formatHtml: true });
|
||||
const aboutHtml = await readOutput('about/index.html', { formatHtml: true });
|
||||
expect(aboutHtml).to.equal(
|
||||
[
|
||||
'<p><code>about.md</code></p>',
|
||||
@@ -38,7 +37,7 @@ describe('RocketCli use cases', () => {
|
||||
].join('\n'),
|
||||
);
|
||||
|
||||
const subHtml = await readStartOutput(cli, 'sub/index.html', { formatHtml: true });
|
||||
const subHtml = await readOutput('sub/index.html', { formatHtml: true });
|
||||
expect(subHtml).to.equal(
|
||||
[
|
||||
'<p><code>sub/index.md</code></p>',
|
||||
@@ -46,7 +45,7 @@ describe('RocketCli use cases', () => {
|
||||
].join('\n'),
|
||||
);
|
||||
|
||||
const subDetailsHtml = await readStartOutput(cli, 'sub/details/index.html', {
|
||||
const subDetailsHtml = await readOutput('sub/details/index.html', {
|
||||
formatHtml: true,
|
||||
});
|
||||
expect(subDetailsHtml).to.equal(
|
||||
@@ -56,7 +55,7 @@ describe('RocketCli use cases', () => {
|
||||
].join('\n'),
|
||||
);
|
||||
|
||||
const indexHtml = await readStartOutput(cli, 'index.html', { formatHtml: true });
|
||||
const indexHtml = await readOutput('index.html', { formatHtml: true });
|
||||
expect(indexHtml).to.equal(
|
||||
[
|
||||
'<p><code>index.md</code></p>',
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
import remark2rehype from 'remark-rehype';
|
||||
import { adjustPluginOptions } from 'plugins-manager';
|
||||
|
||||
function image(h, node) {
|
||||
@@ -10,7 +11,7 @@ function image(h, node) {
|
||||
/** @type {Partial<import("../../../types/main").RocketCliOptions>} */
|
||||
const config = {
|
||||
setupUnifiedPlugins: [
|
||||
adjustPluginOptions('remark2rehype', {
|
||||
adjustPluginOptions(remark2rehype, {
|
||||
handlers: {
|
||||
image,
|
||||
},
|
||||
|
||||
@@ -1,8 +1,16 @@
|
||||
import { addPlugin } from 'plugins-manager';
|
||||
|
||||
class Test {
|
||||
static dataName = 'test';
|
||||
|
||||
execute() {
|
||||
return 'test-value';
|
||||
}
|
||||
}
|
||||
|
||||
/** @type {Partial<import("../../../types/main").RocketCliOptions>} */
|
||||
const config = {
|
||||
setupEleventyComputedConfig: [addPlugin({ name: 'test', plugin: () => 'test-value' })],
|
||||
setupEleventyComputedConfig: [addPlugin(Test)],
|
||||
};
|
||||
|
||||
export default config;
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
import { adjustPluginOptions } from 'plugins-manager';
|
||||
import { SocialMediaImagePlugin } from '@rocket/cli';
|
||||
|
||||
/** @type {Partial<import("../../../types/main").RocketCliOptions>} */
|
||||
const config = {
|
||||
@@ -6,7 +7,7 @@ const config = {
|
||||
createSocialMediaImages: true,
|
||||
},
|
||||
setupEleventyComputedConfig: [
|
||||
adjustPluginOptions('socialMediaImage', {
|
||||
adjustPluginOptions(SocialMediaImagePlugin, {
|
||||
createSocialImageSvg: async () => {
|
||||
return `
|
||||
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 1200 630">
|
||||
|
||||
@@ -1,11 +1,14 @@
|
||||
// @ts-no-check
|
||||
import json from '@rollup/plugin-json';
|
||||
import { rollupPluginHTML } from '@web/rollup-plugin-html';
|
||||
import { addPlugin, adjustPluginOptions } from 'plugins-manager';
|
||||
|
||||
/** @type {Partial<import("../../../types/main").RocketCliOptions>} */
|
||||
const config = {
|
||||
setupDevAndBuildPlugins: [addPlugin({ name: 'json', plugin: json, location: 'top' })],
|
||||
setupBuildPlugins: [adjustPluginOptions('html', { absoluteBaseUrl: 'https://test-me.com' })],
|
||||
setupDevAndBuildPlugins: [addPlugin(json, {}, { location: 'top' })],
|
||||
setupBuildPlugins: [
|
||||
adjustPluginOptions(rollupPluginHTML, { absoluteBaseUrl: 'https://test-me.com' }),
|
||||
],
|
||||
};
|
||||
|
||||
export default config;
|
||||
|
||||
@@ -1,10 +1,9 @@
|
||||
// @ts-no-check
|
||||
import json from '@rollup/plugin-json';
|
||||
import { addPlugin } from 'plugins-manager';
|
||||
|
||||
/** @type {Partial<import("../../../types/main").RocketCliOptions>} */
|
||||
const config = {
|
||||
setupDevAndBuildPlugins: [addPlugin({ name: 'json', plugin: json, location: 'top' })],
|
||||
setupDevAndBuildPlugins: [addPlugin(json, {}, { location: 'top' })],
|
||||
devServer: {
|
||||
mimeTypes: {
|
||||
// serve all json files as js
|
||||
|
||||
@@ -1,10 +1,11 @@
|
||||
// @ts-check
|
||||
import emoji from 'remark-emoji';
|
||||
import { addPlugin } from 'plugins-manager';
|
||||
import markdown from 'remark-parse';
|
||||
|
||||
/** @type {Partial<import("../../../types/main").RocketCliOptions>} */
|
||||
const config = {
|
||||
setupUnifiedPlugins: [addPlugin({ location: 'markdown', name: 'emoji', plugin: emoji })],
|
||||
setupUnifiedPlugins: [addPlugin(emoji, {}, { location: markdown })],
|
||||
};
|
||||
|
||||
export default config;
|
||||
|
||||
@@ -1,89 +0,0 @@
|
||||
import chai from 'chai';
|
||||
import { RocketCli } from '../src/RocketCli.js';
|
||||
import path from 'path';
|
||||
import { fileURLToPath } from 'url';
|
||||
import fs from 'fs-extra';
|
||||
|
||||
const __dirname = path.dirname(fileURLToPath(import.meta.url));
|
||||
|
||||
const { expect } = chai;
|
||||
|
||||
/**
|
||||
* @param {function} method
|
||||
* @param {string} errorMessage
|
||||
*/
|
||||
export async function expectThrowsAsync(method, { errorMatch, errorMessage } = {}) {
|
||||
let error = null;
|
||||
try {
|
||||
await method();
|
||||
} catch (err) {
|
||||
error = err;
|
||||
}
|
||||
expect(error).to.be.an('Error', 'No error was thrown');
|
||||
if (errorMatch) {
|
||||
expect(error.message).to.match(errorMatch);
|
||||
}
|
||||
if (errorMessage) {
|
||||
expect(error.message).to.equal(errorMessage);
|
||||
}
|
||||
}
|
||||
|
||||
export async function readOutput(
|
||||
cli,
|
||||
fileName,
|
||||
{ stripToBody = false, stripStartEndWhitespace = true, type = 'build' } = {},
|
||||
) {
|
||||
const outputDir = type === 'build' ? cli.config.outputDir : cli.config.outputDevDir;
|
||||
let text = await fs.promises.readFile(path.join(outputDir, fileName));
|
||||
text = text.toString();
|
||||
if (stripToBody) {
|
||||
const bodyOpenTagEnd = text.indexOf('>', text.indexOf('<body') + 1) + 1;
|
||||
const bodyCloseTagStart = text.indexOf('</body>');
|
||||
text = text.substring(bodyOpenTagEnd, bodyCloseTagStart);
|
||||
}
|
||||
if (stripStartEndWhitespace) {
|
||||
text = text.trim();
|
||||
}
|
||||
return text;
|
||||
}
|
||||
|
||||
export async function readStartOutput(cli, fileName, options = {}) {
|
||||
options.type = 'start';
|
||||
return readOutput(cli, fileName, options);
|
||||
}
|
||||
|
||||
export async function execute(cli, configFileDir) {
|
||||
await cli.setup();
|
||||
cli.config.outputDevDir = path.join(configFileDir, '__output-dev');
|
||||
cli.config.devServer.open = false;
|
||||
cli.config.watch = false;
|
||||
cli.config.outputDir = path.join(configFileDir, '__output');
|
||||
await cli.run();
|
||||
return cli;
|
||||
}
|
||||
|
||||
export async function executeStart(pathToConfig) {
|
||||
const configFile = path.join(__dirname, pathToConfig.split('/').join(path.sep));
|
||||
const cli = new RocketCli({
|
||||
argv: ['start', '--config-file', configFile],
|
||||
});
|
||||
await execute(cli, path.dirname(configFile));
|
||||
return cli;
|
||||
}
|
||||
|
||||
export async function executeLint(pathToConfig) {
|
||||
const configFile = path.join(__dirname, pathToConfig.split('/').join(path.sep));
|
||||
const cli = new RocketCli({
|
||||
argv: ['lint', '--config-file', configFile],
|
||||
});
|
||||
await execute(cli, path.dirname(configFile));
|
||||
return cli;
|
||||
}
|
||||
|
||||
export function trimWhiteSpace(inString) {
|
||||
return inString
|
||||
.split('\n')
|
||||
.map(line => line.trim())
|
||||
.filter(line => line)
|
||||
.join('\n');
|
||||
}
|
||||
@@ -1,5 +1,17 @@
|
||||
# @rocket/drawer
|
||||
|
||||
## 0.1.5
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- 1f14105: Add export map which enables side effect import via `@rocket/drawer/define`
|
||||
|
||||
## 0.1.4
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- 445b028: Update to latest lit, @open-wc, @lion packages
|
||||
|
||||
## 0.1.3
|
||||
|
||||
### Patch Changes
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@rocket/drawer",
|
||||
"version": "0.1.3",
|
||||
"version": "0.1.5",
|
||||
"publishConfig": {
|
||||
"access": "public"
|
||||
},
|
||||
@@ -13,6 +13,11 @@
|
||||
},
|
||||
"author": "Modern Web <hello@modern-web.dev> (https://modern-web.dev/)",
|
||||
"main": "index.js",
|
||||
"exports": {
|
||||
".": "./index.js",
|
||||
"./rocket-drawer.js": "./rocket-drawer.js",
|
||||
"./define": "./rocket-drawer.js"
|
||||
},
|
||||
"scripts": {
|
||||
"dev": "web-dev-server --node-resolve --root-dir ../../ --open packages/drawer/ --watch",
|
||||
"rocket:build": "node src/build/cli.js -c demo/docs",
|
||||
@@ -33,8 +38,8 @@
|
||||
"testing"
|
||||
],
|
||||
"dependencies": {
|
||||
"@lion/overlays": "^0.26.1",
|
||||
"lit-element": "^2.4.0"
|
||||
"@lion/overlays": "^0.29.1",
|
||||
"lit": "^2.0.0"
|
||||
},
|
||||
"types": "dist-types/index.d.ts"
|
||||
}
|
||||
|
||||
@@ -1,5 +1,16 @@
|
||||
# @rocket/eleventy-plugin-mdjs-unified
|
||||
|
||||
## 0.6.0
|
||||
|
||||
### Minor Changes
|
||||
|
||||
- 70bb7a1: BREAKING CHANGE: Updating to latest version of `@mdjs/core` which requires the latest version of `plugins-manager`
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- Updated dependencies [70bb7a1]
|
||||
- @mdjs/core@0.9.0
|
||||
|
||||
## 0.5.2
|
||||
|
||||
### Patch Changes
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@rocket/eleventy-plugin-mdjs-unified",
|
||||
"version": "0.5.2",
|
||||
"version": "0.6.0",
|
||||
"publishConfig": {
|
||||
"access": "public"
|
||||
},
|
||||
@@ -31,7 +31,7 @@
|
||||
"mdjs"
|
||||
],
|
||||
"dependencies": {
|
||||
"@mdjs/core": "^0.8.2",
|
||||
"@mdjs/core": "^0.9.0",
|
||||
"es-module-lexer": "^0.3.26",
|
||||
"unist-util-visit": "^2.0.3"
|
||||
},
|
||||
|
||||
@@ -5,6 +5,7 @@ const fs = require('fs');
|
||||
const { mdjsProcess } = require('@mdjs/core');
|
||||
const visit = require('unist-util-visit');
|
||||
const { init, parse } = require('es-module-lexer');
|
||||
const markdown = require('remark-parse');
|
||||
|
||||
// @ts-ignore
|
||||
const { parseTitle } = require('@rocket/core/title');
|
||||
@@ -45,12 +46,12 @@ function cleanupTitleHeadline() {
|
||||
* @param {MdjsProcessPlugin[]} plugins
|
||||
*/
|
||||
function addCleanupTitleHeadline(plugins) {
|
||||
if (plugins.findIndex(plugin => plugin.name === 'cleanupTitleHeadline') === -1) {
|
||||
if (plugins.findIndex(pluginObj => pluginObj.plugin === cleanupTitleHeadline) === -1) {
|
||||
// add plugins right after markdown
|
||||
const markdownPluginIndex = plugins.findIndex(plugin => plugin.name === 'markdown');
|
||||
const markdownPluginIndex = plugins.findIndex(pluginObj => pluginObj.plugin === markdown);
|
||||
plugins.splice(markdownPluginIndex + 1, 0, {
|
||||
name: 'cleanupTitleHeadline',
|
||||
plugin: cleanupTitleHeadline,
|
||||
options: {},
|
||||
});
|
||||
}
|
||||
return plugins;
|
||||
|
||||
@@ -1,8 +1,9 @@
|
||||
const htmlHeading = require('rehype-autolink-headings');
|
||||
const pluginMdjs = require('../../../index.js');
|
||||
|
||||
function addClassAnchorToHtmlHeading(plugins) {
|
||||
return plugins.map(pluginObj => {
|
||||
if (pluginObj.name === 'htmlHeading') {
|
||||
if (pluginObj.plugin === htmlHeading) {
|
||||
return {
|
||||
...pluginObj,
|
||||
options: {
|
||||
|
||||
@@ -1,5 +1,22 @@
|
||||
# @rocket/launch
|
||||
|
||||
## 0.6.0
|
||||
|
||||
### Minor Changes
|
||||
|
||||
- 70bb7a1: BREAKING CHANGE: Update to latest plugins manager to get type safe options
|
||||
|
||||
There is no longer a name string as a key for a plugin. It is identified by it's function/class. You will need to adjust your code if you are adding or adjusting plugins.
|
||||
|
||||
```diff
|
||||
- addPlugin({ name: 'my-plugin', plugin: myPlugin, options: { myFlag: true }, location: 'top' });
|
||||
+ addPlugin(myPlugin, { myFlag: true }, { location: 'top' });
|
||||
- adjustPluginOptions('my-plugin', { myFlag: true });
|
||||
+ adjustPluginOptions(myPlugin, { myFlag: true });
|
||||
```
|
||||
|
||||
For more details please see the [Changelog](https://github.com/modernweb-dev/rocket/blob/main/packages/plugins-manager/CHANGELOG.md#030) of the plugins-manager package.
|
||||
|
||||
## 0.5.6
|
||||
|
||||
### Patch Changes
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@rocket/launch",
|
||||
"version": "0.5.6",
|
||||
"version": "0.6.0",
|
||||
"publishConfig": {
|
||||
"access": "public"
|
||||
},
|
||||
|
||||
@@ -2,12 +2,14 @@ import path from 'path';
|
||||
import { adjustPluginOptions } from 'plugins-manager';
|
||||
// import { addPlugin } from 'plugins-manager';
|
||||
import { fileURLToPath } from 'url';
|
||||
import { LayoutPlugin } from '@rocket/cli';
|
||||
import htmlHeading from 'rehype-autolink-headings';
|
||||
|
||||
const __dirname = path.dirname(fileURLToPath(import.meta.url));
|
||||
|
||||
function addOcticonToHeadlines(plugins) {
|
||||
return plugins.map(pluginObj => {
|
||||
if (pluginObj.name === 'htmlHeading') {
|
||||
if (pluginObj.plugin === htmlHeading) {
|
||||
return {
|
||||
...pluginObj,
|
||||
options: {
|
||||
@@ -50,7 +52,7 @@ export function rocketLaunch() {
|
||||
path: path.resolve(__dirname),
|
||||
setupUnifiedPlugins: [addOcticonToHeadlines],
|
||||
setupEleventyComputedConfig: [
|
||||
adjustPluginOptions('layout', { defaultLayout: 'layout-sidebar' }),
|
||||
adjustPluginOptions(LayoutPlugin, { defaultLayout: 'layout-sidebar' }),
|
||||
],
|
||||
adjustImagePresets: imagePresets => ({
|
||||
...imagePresets,
|
||||
|
||||
@@ -1,11 +1,11 @@
|
||||
import chai from 'chai';
|
||||
import chalk from 'chalk';
|
||||
import { executeStart, readStartOutput, setFixtureDir } from '@rocket/cli/test-helpers';
|
||||
import { execute, setFixtureDir } from '@rocket/cli/test-helpers';
|
||||
|
||||
const { expect } = chai;
|
||||
|
||||
describe('RocketLaunch preset', () => {
|
||||
let cli;
|
||||
let cleanupCli;
|
||||
|
||||
before(() => {
|
||||
// ignore colors in tests as most CIs won't support it
|
||||
@@ -14,15 +14,18 @@ describe('RocketLaunch preset', () => {
|
||||
});
|
||||
|
||||
afterEach(async () => {
|
||||
if (cli?.cleanup) {
|
||||
await cli.cleanup();
|
||||
if (cleanupCli?.cleanup) {
|
||||
await cleanupCli.cleanup();
|
||||
}
|
||||
});
|
||||
|
||||
it.only('sets layout-sidebar as default', async () => {
|
||||
cli = await executeStart('fixtures/layout-sidebar/rocket.config.js');
|
||||
it('sets layout-sidebar as default', async () => {
|
||||
const { cli, readOutput } = await execute('fixtures/layout-sidebar/rocket.config.js', {
|
||||
captureLog: true,
|
||||
});
|
||||
cleanupCli = cli;
|
||||
|
||||
const indexHtml = await readStartOutput(cli, 'page/index.html', {
|
||||
const indexHtml = await readOutput('page/index.html', {
|
||||
stripScripts: true,
|
||||
formatHtml: true,
|
||||
});
|
||||
@@ -251,9 +254,12 @@ describe('RocketLaunch preset', () => {
|
||||
});
|
||||
|
||||
it('offers a layout-home', async () => {
|
||||
cli = await executeStart('fixtures/layout-home/rocket.config.js');
|
||||
const { cli, readOutput } = await execute('fixtures/layout-home/rocket.config.js', {
|
||||
captureLog: true,
|
||||
});
|
||||
cleanupCli = cli;
|
||||
|
||||
const indexHtml = await readStartOutput(cli, 'index.html', {
|
||||
const indexHtml = await readOutput('index.html', {
|
||||
stripScripts: true,
|
||||
formatHtml: true,
|
||||
});
|
||||
@@ -502,12 +508,6 @@ describe('RocketLaunch preset', () => {
|
||||
' </footer>',
|
||||
'',
|
||||
' <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>',
|
||||
'</html>',
|
||||
].join('\n'),
|
||||
|
||||
@@ -1,5 +1,70 @@
|
||||
# Change Log
|
||||
|
||||
## 0.9.1
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- 6221e5f: If your preview is followed by a code blocks marked as `story-code` then those will be shown when switching between multiple platforms
|
||||
|
||||
````md
|
||||
```js preview-story
|
||||
// will be visible when platform web is selected
|
||||
export const JsPreviewStory = () =>
|
||||
html`
|
||||
<demo-wc-card>JS Preview Story</demo-wc-card>
|
||||
`;
|
||||
```
|
||||
|
||||
```xml story-code
|
||||
<!-- will be visible when platform android is selected -->
|
||||
<Button
|
||||
android:id="@+id/demoWcCard"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="Android Code"
|
||||
style="@style/Widget.FooComponents.Demo.Wc.Card"
|
||||
/>
|
||||
```
|
||||
|
||||
```swift story-code
|
||||
// will be visible when platform ios is selected
|
||||
import DemoWc.Card
|
||||
|
||||
let card = DemoWcButton()
|
||||
```
|
||||
````
|
||||
|
||||
- Updated dependencies [5c6b9c9]
|
||||
- Updated dependencies [6221e5f]
|
||||
- @mdjs/mdjs-preview@0.5.3
|
||||
|
||||
## 0.9.0
|
||||
|
||||
### Minor Changes
|
||||
|
||||
- 70bb7a1: BREAKING CHANGE: Update to latest plugins manager to get type safe options
|
||||
|
||||
There is no longer a name string as a key for a plugin. It is identified by it's function/class. You will need to adjust your code if you are adding or adjusting plugins.
|
||||
|
||||
```diff
|
||||
- addPlugin({ name: 'my-plugin', plugin: myPlugin, options: { myFlag: true }, location: 'top' });
|
||||
+ addPlugin(myPlugin, { myFlag: true }, { location: 'top' });
|
||||
- adjustPluginOptions('my-plugin', { myFlag: true });
|
||||
+ adjustPluginOptions(myPlugin, { myFlag: true });
|
||||
```
|
||||
|
||||
For more details please see the [Changelog](https://github.com/modernweb-dev/rocket/blob/main/packages/plugins-manager/CHANGELOG.md#030) of the plugins-manager package.
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- Updated dependencies [70bb7a1]
|
||||
- Updated dependencies [70bb7a1]
|
||||
- Updated dependencies [70bb7a1]
|
||||
- Updated dependencies [70bb7a1]
|
||||
- Updated dependencies [70bb7a1]
|
||||
- Updated dependencies [70bb7a1]
|
||||
- plugins-manager@0.3.0
|
||||
|
||||
## 0.8.2
|
||||
|
||||
### Patch Changes
|
||||
|
||||
@@ -1,5 +1,3 @@
|
||||
# Markdown with JavaScript (mdjs)
|
||||
|
||||
Combine Markdown with JavaScript
|
||||
|
||||
For docs please see our homepage [https://rocket.modern-web.dev/docs/markdown-javascript/overview/](https://rocket.modern-web.dev/docs/markdown-javascript/overview/).
|
||||
[=> See Source <=](../../docs/docs/markdown-javascript/overview.md)
|
||||
|
||||
@@ -3,6 +3,7 @@
|
||||
/** @typedef {import('@mdjs/core/types/code').MdjsProcessPlugin} MdjsProcessPlugin */
|
||||
|
||||
const { mdjsParse } = require('./src/mdjsParse.js');
|
||||
const { mdjsSetupCode } = require('./src/mdjsSetupCode.js');
|
||||
const { mdjsStoryParse } = require('./src/mdjsStoryParse.js');
|
||||
const { mdjsDocPage } = require('./src/mdjsDocPage.js');
|
||||
const { mdjsProcess } = require('./src/mdjsProcess.js');
|
||||
@@ -14,4 +15,5 @@ module.exports = {
|
||||
mdjsDocPage,
|
||||
mdjsProcess,
|
||||
isMdjsContent,
|
||||
mdjsSetupCode,
|
||||
};
|
||||
|
||||
@@ -1,5 +1,12 @@
|
||||
import cjsEntrypoint from './index.js';
|
||||
|
||||
const { mdjsParse, mdjsStoryParse, mdjsDocPage, mdjsProcess, isMdjsContent } = cjsEntrypoint;
|
||||
const {
|
||||
mdjsParse,
|
||||
mdjsStoryParse,
|
||||
mdjsDocPage,
|
||||
mdjsProcess,
|
||||
isMdjsContent,
|
||||
mdjsSetupCode,
|
||||
} = cjsEntrypoint;
|
||||
|
||||
export { mdjsParse, mdjsStoryParse, mdjsDocPage, mdjsProcess, isMdjsContent };
|
||||
export { mdjsParse, mdjsStoryParse, mdjsDocPage, mdjsProcess, isMdjsContent, mdjsSetupCode };
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@mdjs/core",
|
||||
"version": "0.8.2",
|
||||
"version": "0.9.1",
|
||||
"publishConfig": {
|
||||
"access": "public"
|
||||
},
|
||||
@@ -21,6 +21,7 @@
|
||||
}
|
||||
},
|
||||
"scripts": {
|
||||
"prepublishOnly": "publish-docs --github-url https://github.com/modernweb-dev/rocket/ --git-root-dir ../../",
|
||||
"start": "npm run start:stories",
|
||||
"start:script": "web-dev-server -c demo/script/server.js --root-dir ../../",
|
||||
"start:stories": "web-dev-server -c demo/stories/server.js --root-dir ../../",
|
||||
@@ -44,12 +45,12 @@
|
||||
"remark"
|
||||
],
|
||||
"dependencies": {
|
||||
"@mdjs/mdjs-preview": "^0.5.1",
|
||||
"@mdjs/mdjs-preview": "^0.5.3",
|
||||
"@mdjs/mdjs-story": "^0.3.0",
|
||||
"@types/unist": "^2.0.3",
|
||||
"es-module-lexer": "^0.3.26",
|
||||
"github-markdown-css": "^4.0.0",
|
||||
"plugins-manager": "^0.2.4",
|
||||
"plugins-manager": "^0.3.0",
|
||||
"rehype-autolink-headings": "^5.0.1",
|
||||
"rehype-prism-template": "^0.4.1",
|
||||
"rehype-raw": "^5.0.0",
|
||||
@@ -66,7 +67,7 @@
|
||||
"devDependencies": {
|
||||
"demo-wc-card": "^0.1.0",
|
||||
"remark-autolink-headings": "^6.0.1",
|
||||
"remark-html": "^13.0.1",
|
||||
"remark-html": "^13.0.2",
|
||||
"remark-slug": "^6.0.0",
|
||||
"remark-stringify": "^9.0.1"
|
||||
},
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
/* eslint-disable @typescript-eslint/ban-ts-comment */
|
||||
/** @typedef {import('@mdjs/core/types/code').Story} Story */
|
||||
/** @typedef {import('@mdjs/core/types/code').ParseResult} ParseResult */
|
||||
/** @typedef {import('@mdjs/core/types/code').ProcessResult} ProcessResult */
|
||||
/** @typedef {import('@mdjs/core/types/code').MdjsProcessPlugin} MdjsProcessPlugin */
|
||||
/** @typedef {import('../types/code').Story} Story */
|
||||
/** @typedef {import('../types/code').ParseResult} ParseResult */
|
||||
/** @typedef {import('../types/code').ProcessResult} ProcessResult */
|
||||
/** @typedef {import('../types/code').MdjsProcessPlugin} MdjsProcessPlugin */
|
||||
|
||||
const unified = require('unified');
|
||||
const markdown = require('remark-parse');
|
||||
@@ -22,23 +22,23 @@ const { mdjsSetupCode } = require('./mdjsSetupCode.js');
|
||||
|
||||
/** @type {MdjsProcessPlugin[]} */
|
||||
const defaultMetaPlugins = [
|
||||
{ name: 'markdown', plugin: markdown },
|
||||
{ name: 'gfm', plugin: gfm },
|
||||
{ name: 'mdjsParse', plugin: mdjsParse },
|
||||
{ name: 'mdjsStoryParse', plugin: mdjsStoryParse },
|
||||
{ name: 'mdjsSetupCode', plugin: mdjsSetupCode },
|
||||
{ plugin: markdown, options: {} },
|
||||
{ plugin: gfm, options: {} },
|
||||
{ plugin: mdjsParse, options: {} },
|
||||
{ plugin: mdjsStoryParse, options: {} },
|
||||
{ plugin: mdjsSetupCode, options: {} },
|
||||
// @ts-ignore
|
||||
{ name: 'remark2rehype', plugin: remark2rehype, options: { allowDangerousHtml: true } },
|
||||
{ plugin: remark2rehype, options: { allowDangerousHtml: true } },
|
||||
// @ts-ignore
|
||||
{ name: 'rehypePrism', plugin: rehypePrism },
|
||||
{ plugin: rehypePrism, options: {} },
|
||||
// @ts-ignore
|
||||
{ name: 'raw', plugin: raw },
|
||||
{ plugin: raw, options: {} },
|
||||
// @ts-ignore
|
||||
{ name: 'htmlSlug', plugin: htmlSlug },
|
||||
{ plugin: htmlSlug, options: {} },
|
||||
// @ts-ignore
|
||||
{ name: 'htmlHeading', plugin: htmlHeading },
|
||||
{ plugin: htmlHeading, options: {} },
|
||||
// @ts-ignore
|
||||
{ name: 'htmlStringify', plugin: htmlStringify },
|
||||
{ plugin: htmlStringify, options: {} },
|
||||
];
|
||||
|
||||
/**
|
||||
@@ -57,33 +57,8 @@ async function mdjsProcess(mdjs, { setupUnifiedPlugins = [] } = {}) {
|
||||
|
||||
const metaPlugins = executeSetupFunctions(setupUnifiedPlugins, defaultMetaPlugins);
|
||||
|
||||
/**
|
||||
* @param {string} code
|
||||
*/
|
||||
async function highlightCode(code) {
|
||||
// @ts-ignore
|
||||
const codePlugins = metaPlugins.filter(pluginObj =>
|
||||
['markdown', 'remark2rehype', 'rehypePrism', 'htmlStringify'].includes(pluginObj.name),
|
||||
);
|
||||
const codeParser = unified();
|
||||
// @ts-ignore
|
||||
for (const pluginObj of codePlugins) {
|
||||
codeParser.use(pluginObj.plugin, pluginObj.options);
|
||||
}
|
||||
const codeResult = await codeParser.process(code);
|
||||
return codeResult.contents;
|
||||
}
|
||||
|
||||
// @ts-ignore
|
||||
for (const pluginObj of metaPlugins) {
|
||||
if (pluginObj.name === 'mdjsSetupCode') {
|
||||
if (pluginObj.options && !pluginObj.options.highlightCode) {
|
||||
pluginObj.options.highlightCode = highlightCode;
|
||||
}
|
||||
if (!pluginObj.options) {
|
||||
pluginObj.options = { highlightCode };
|
||||
}
|
||||
}
|
||||
// @ts-ignore
|
||||
parser.use(pluginObj.plugin, pluginObj.options);
|
||||
}
|
||||
|
||||
|
||||
@@ -77,17 +77,32 @@ function mdjsStoryParse({
|
||||
const newValue = previewStoryTag(storyData.name);
|
||||
if (newValue.includes('[[CODE SLOT]]')) {
|
||||
const tagParts = newValue.split('[[CODE SLOT]]');
|
||||
|
||||
const inside = [node];
|
||||
let skipAmount = 1;
|
||||
const next = parent.children[index + 1];
|
||||
if (next && next.type === 'code' && next.meta === 'story-code') {
|
||||
inside.push(next);
|
||||
skipAmount += 1;
|
||||
|
||||
const next2 = parent.children[index + 2];
|
||||
if (next2 && next2.type === 'code' && next2.meta === 'story-code') {
|
||||
inside.push(next2);
|
||||
skipAmount += 1;
|
||||
}
|
||||
}
|
||||
|
||||
node = {
|
||||
type: 'root',
|
||||
children: [
|
||||
{ type: 'html', value: tagParts[0] },
|
||||
{ type: 'text', value: '\n\n' },
|
||||
node,
|
||||
...inside,
|
||||
{ type: 'text', value: '\n\n' },
|
||||
{ type: 'html', value: tagParts[1] },
|
||||
],
|
||||
};
|
||||
parent.children.splice(index, 1, node);
|
||||
parent.children.splice(index, skipAmount, node);
|
||||
} else {
|
||||
node.type = 'html';
|
||||
node.value = previewStoryTag(storyData.name);
|
||||
@@ -115,17 +130,31 @@ function mdjsStoryParse({
|
||||
const newValue = previewStoryTag(storyData.name);
|
||||
if (newValue.includes('[[CODE SLOT]]')) {
|
||||
const tagParts = newValue.split('[[CODE SLOT]]');
|
||||
const inside = [node];
|
||||
let skipAmount = 1;
|
||||
const next = parent.children[index + 1];
|
||||
if (next && next.type === 'code' && next.meta === 'story-code') {
|
||||
inside.push(next);
|
||||
skipAmount += 1;
|
||||
|
||||
const next2 = parent.children[index + 2];
|
||||
if (next2 && next2.type === 'code' && next2.meta === 'story-code') {
|
||||
inside.push(next2);
|
||||
skipAmount += 1;
|
||||
}
|
||||
}
|
||||
|
||||
node = {
|
||||
type: 'root',
|
||||
children: [
|
||||
{ type: 'html', value: tagParts[0] },
|
||||
{ type: 'text', value: '\n\n' },
|
||||
node,
|
||||
...inside,
|
||||
{ type: 'text', value: '\n\n' },
|
||||
{ type: 'html', value: tagParts[1] },
|
||||
],
|
||||
};
|
||||
parent.children.splice(index, 1, node);
|
||||
parent.children.splice(index, skipAmount, node);
|
||||
} else {
|
||||
node.type = 'html';
|
||||
node.value = previewStoryTag(storyData.name);
|
||||
|
||||
@@ -106,7 +106,7 @@ describe('Integration', () => {
|
||||
})
|
||||
.use(mdSlug)
|
||||
.use(mdHeadings)
|
||||
.use(mdStringify);
|
||||
.use(mdStringify, { sanitize: false });
|
||||
const result = await parser.process(input);
|
||||
expect(result.contents).to.equal(expected);
|
||||
expect(/** @type {MDJSVFileData} */ (result.data).stories).to.deep.equal([
|
||||
|
||||
@@ -3,6 +3,8 @@
|
||||
const chai = require('chai');
|
||||
const { adjustPluginOptions } = require('plugins-manager');
|
||||
const { mdjsProcess } = require('../src/mdjsProcess.js');
|
||||
const { mdjsSetupCode } = require('../src/mdjsSetupCode.js');
|
||||
const { mdjsStoryParse } = require('../src/mdjsStoryParse.js');
|
||||
|
||||
const { expect } = chai;
|
||||
|
||||
@@ -106,7 +108,7 @@ describe('mdjsProcess', () => {
|
||||
|
||||
function replaceStoryTag(plugins) {
|
||||
return plugins.map(pluginObj => {
|
||||
if (pluginObj.name === 'mdjsStoryParse') {
|
||||
if (pluginObj.plugin === mdjsStoryParse) {
|
||||
return {
|
||||
...pluginObj,
|
||||
options: {
|
||||
@@ -136,7 +138,7 @@ describe('mdjsProcess', () => {
|
||||
|
||||
function replaceStoryTag2(plugins) {
|
||||
return plugins.map(pluginObj => {
|
||||
if (pluginObj.name === 'mdjsStoryParse') {
|
||||
if (pluginObj.plugin === mdjsStoryParse) {
|
||||
return {
|
||||
...pluginObj,
|
||||
options: {
|
||||
@@ -202,7 +204,7 @@ describe('mdjsProcess', () => {
|
||||
].join('\n');
|
||||
const result = await mdjsProcess(input, {
|
||||
setupUnifiedPlugins: [
|
||||
adjustPluginOptions('mdjsSetupCode', {
|
||||
adjustPluginOptions(mdjsSetupCode, {
|
||||
simulationSettings: { languages: [{ key: 'en', name: 'English' }] },
|
||||
}),
|
||||
],
|
||||
|
||||
@@ -20,7 +20,7 @@ describe('mdjsParse', () => {
|
||||
'const bar = 22;',
|
||||
'```',
|
||||
].join('\n');
|
||||
const parser = unified().use(markdown).use(mdjsParse).use(html);
|
||||
const parser = unified().use(markdown).use(mdjsParse).use(html, { sanitize: false });
|
||||
const result = await parser.process(input);
|
||||
expect(result.contents).to.equal(
|
||||
'<h2>Intro</h2>\n<pre><code class="language-js">const foo = 1;\n</code></pre>\n',
|
||||
@@ -36,7 +36,7 @@ describe('mdjsParse', () => {
|
||||
'const bar = 22;',
|
||||
'```',
|
||||
].join('\n');
|
||||
const parser = unified().use(markdown).use(mdjsParse).use(html);
|
||||
const parser = unified().use(markdown).use(mdjsParse).use(html, { sanitize: false });
|
||||
const result = await parser.process(input);
|
||||
expect(result.contents).to.equal('');
|
||||
expect(/** @type {MDJSVFileData} */ (result.data).jsCode).to.equal('const bar = 22;');
|
||||
|
||||
@@ -61,7 +61,7 @@ describe('mdjsStoryParse', () => {
|
||||
'',
|
||||
].join('\n');
|
||||
|
||||
const parser = unified().use(markdown).use(mdjsStoryParse).use(html);
|
||||
const parser = unified().use(markdown).use(mdjsStoryParse).use(html, { sanitize: false });
|
||||
const result = await parser.process(input);
|
||||
expect(result.contents).to.equal(expected);
|
||||
expect(/** @type {MDJSVFileData} */ (result.data).stories).to.deep.equal([
|
||||
@@ -110,7 +110,139 @@ describe('mdjsStoryParse', () => {
|
||||
storyTag: name => `<Story name="${name}"></Story>`,
|
||||
previewStoryTag: name => `<Preview><Story name="${name}"></Story></Preview>`,
|
||||
})
|
||||
.use(html);
|
||||
.use(html, { sanitize: false });
|
||||
const result = await parser.process(input);
|
||||
expect(result.contents).to.equal(expected);
|
||||
});
|
||||
|
||||
it('will wrap following story-code blocks', async () => {
|
||||
const input = [
|
||||
'```js preview-story',
|
||||
'export const foo = () => {};',
|
||||
'```',
|
||||
'',
|
||||
'```swift story-code',
|
||||
'CODE for iOS',
|
||||
'```',
|
||||
'',
|
||||
'```xml story-code',
|
||||
'CODE for Android',
|
||||
'```',
|
||||
].join('\n');
|
||||
|
||||
const expected = [
|
||||
'<mdjs-preview mdjs-story-name="foo">',
|
||||
'',
|
||||
'',
|
||||
'',
|
||||
'<pre><code class="language-js">export const foo = () => {};',
|
||||
'</code></pre>',
|
||||
'<pre><code class="language-swift">CODE for iOS',
|
||||
'</code></pre>',
|
||||
'<pre><code class="language-xml">CODE for Android',
|
||||
'</code></pre>',
|
||||
'',
|
||||
'',
|
||||
'',
|
||||
'</mdjs-preview>',
|
||||
'',
|
||||
].join('\n');
|
||||
|
||||
const parser = unified().use(markdown).use(mdjsStoryParse).use(html, { sanitize: false });
|
||||
const result = await parser.process(input);
|
||||
expect(result.contents).to.equal(expected);
|
||||
});
|
||||
|
||||
it('will wrap following story-code blocks also for html stories', async () => {
|
||||
const input = [
|
||||
'```html preview-story',
|
||||
'<my-el></my-el>',
|
||||
'```',
|
||||
'',
|
||||
'```swift story-code',
|
||||
'CODE for iOS',
|
||||
'```',
|
||||
'',
|
||||
'```xml story-code',
|
||||
'CODE for Android',
|
||||
'```',
|
||||
].join('\n');
|
||||
|
||||
const expected = [
|
||||
'<mdjs-preview mdjs-story-name="HtmlStory0">',
|
||||
'',
|
||||
'',
|
||||
'',
|
||||
'<pre><code class="language-html"><my-el></my-el>',
|
||||
'</code></pre>',
|
||||
'<pre><code class="language-swift">CODE for iOS',
|
||||
'</code></pre>',
|
||||
'<pre><code class="language-xml">CODE for Android',
|
||||
'</code></pre>',
|
||||
'',
|
||||
'',
|
||||
'',
|
||||
'</mdjs-preview>',
|
||||
'',
|
||||
].join('\n');
|
||||
|
||||
const parser = unified().use(markdown).use(mdjsStoryParse).use(html, { sanitize: false });
|
||||
const result = await parser.process(input);
|
||||
expect(result.contents).to.equal(expected);
|
||||
});
|
||||
|
||||
it('will wrap only following story-code blocks', async () => {
|
||||
const input = [
|
||||
'```js preview-story',
|
||||
'export const foo = () => {};',
|
||||
'```',
|
||||
'```swift story-code',
|
||||
'CODE for iOS',
|
||||
'```',
|
||||
'# hey',
|
||||
'```swift story-code',
|
||||
'SHOULD BE OUTSIDE',
|
||||
'```',
|
||||
'```js preview-story',
|
||||
'export const foo2 = () => {};',
|
||||
'```',
|
||||
'```xml story-code',
|
||||
'CODE for Android',
|
||||
'```',
|
||||
].join('\n');
|
||||
|
||||
const expected = [
|
||||
'<mdjs-preview mdjs-story-name="foo">',
|
||||
'',
|
||||
'',
|
||||
'',
|
||||
'<pre><code class="language-js">export const foo = () => {};',
|
||||
'</code></pre>',
|
||||
'<pre><code class="language-swift">CODE for iOS',
|
||||
'</code></pre>',
|
||||
'',
|
||||
'',
|
||||
'',
|
||||
'</mdjs-preview>',
|
||||
'<h1>hey</h1>',
|
||||
'<pre><code class="language-swift">SHOULD BE OUTSIDE',
|
||||
'</code></pre>',
|
||||
'<mdjs-preview mdjs-story-name="foo2">',
|
||||
'',
|
||||
'',
|
||||
'',
|
||||
'<pre><code class="language-js">export const foo2 = () => {};',
|
||||
'</code></pre>',
|
||||
'<pre><code class="language-xml">CODE for Android',
|
||||
'</code></pre>',
|
||||
'',
|
||||
'',
|
||||
'',
|
||||
'</mdjs-preview>',
|
||||
'',
|
||||
].join('\n');
|
||||
|
||||
const parser = unified().use(markdown).use(mdjsStoryParse).use(html, { sanitize: false });
|
||||
const result = await parser.process(input);
|
||||
expect(result.contents).to.equal(expected);
|
||||
});
|
||||
|
||||
2
packages/mdjs-core/types/code.d.ts
vendored
2
packages/mdjs-core/types/code.d.ts
vendored
@@ -31,4 +31,4 @@ export interface ParseResult {
|
||||
};
|
||||
}
|
||||
|
||||
export type MdjsProcessPlugin = MetaPlugin<unified.Plugin, unified.Settings>;
|
||||
export type MdjsProcessPlugin = MetaPlugin<unified.Plugin>;
|
||||
|
||||
@@ -1,5 +1,84 @@
|
||||
# @mdjs/mdjs-preview
|
||||
|
||||
## 0.5.6
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- e81b77f: Change theme attribute into preview-theme attribute to separate theme styling of the preview section and the full mdjs viewer.
|
||||
- 456b8e7: Add css variable to style border-color of the mdjs-viewer
|
||||
|
||||
## 0.5.5
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- 445b028: Update to latest lit, @open-wc, @lion packages
|
||||
|
||||
## 0.5.4
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- 15a82c0: Enable including script files into the simulator via `<script src=".." mdjs-use>`
|
||||
- 15a82c0: Allow only a limited set of characters for simulator includes `[a-zA-Z0-9\/\-_]`.
|
||||
Notably, there is no:
|
||||
|
||||
- `:` to prevent `http://...` includes
|
||||
- `.` so filenames as `this.is.my.js` are not supported. Also includes will be without file endings which will be added automatically
|
||||
|
||||
## 0.5.3
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- 5c6b9c9: The Platform and Size controls are now moved above the preview.
|
||||
For the web platform we added a special "inline" size.
|
||||
Only when platform=web & size=webInline it will render to dom.
|
||||
On all other selections it will render the preview via an iframe.
|
||||
|
||||
```js
|
||||
sizes: [
|
||||
{
|
||||
key: 'webInline',
|
||||
name: 'Inline',
|
||||
platform: 'web',
|
||||
width: 360,
|
||||
height: 640,
|
||||
dpr: 1,
|
||||
},
|
||||
{
|
||||
// ...
|
||||
},
|
||||
];
|
||||
```
|
||||
|
||||
- 6221e5f: If your preview is followed by a code blocks marked as `story-code` then those will be shown when switching between multiple platforms
|
||||
|
||||
````md
|
||||
```js preview-story
|
||||
// will be visible when platform web is selected
|
||||
export const JsPreviewStory = () =>
|
||||
html`
|
||||
<demo-wc-card>JS Preview Story</demo-wc-card>
|
||||
`;
|
||||
```
|
||||
|
||||
```xml story-code
|
||||
<!-- will be visible when platform android is selected -->
|
||||
<Button
|
||||
android:id="@+id/demoWcCard"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="Android Code"
|
||||
style="@style/Widget.FooComponents.Demo.Wc.Card"
|
||||
/>
|
||||
```
|
||||
|
||||
```swift story-code
|
||||
// will be visible when platform ios is selected
|
||||
import DemoWc.Card
|
||||
|
||||
let card = DemoWcButton()
|
||||
```
|
||||
````
|
||||
|
||||
## 0.5.2
|
||||
|
||||
### Patch Changes
|
||||
|
||||
@@ -1,3 +1,3 @@
|
||||
# Preview element for mdjs
|
||||
|
||||
For docs please see our homepage [https://rocket.modern-web.dev/docs/markdown-javascript/preview/](https://rocket.modern-web.dev/docs/markdown-javascript/preview/).
|
||||
[=> See Source <=](../../docs/docs/markdown-javascript/preview.md)
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@mdjs/mdjs-preview",
|
||||
"version": "0.5.2",
|
||||
"version": "0.5.6",
|
||||
"publishConfig": {
|
||||
"access": "public"
|
||||
},
|
||||
@@ -20,6 +20,7 @@
|
||||
"./define": "./src/define/define.js"
|
||||
},
|
||||
"scripts": {
|
||||
"prepublishOnly": "publish-docs --github-url https://github.com/modernweb-dev/rocket/ --git-root-dir ../../",
|
||||
"debug": "cd ../../ && npm run debug -- --group mdjs-preview",
|
||||
"test": "npm run test:web",
|
||||
"test:web": "cd ../../ && npm run test:web -- --group mdjs-preview"
|
||||
@@ -31,9 +32,9 @@
|
||||
"src"
|
||||
],
|
||||
"dependencies": {
|
||||
"@lion/accordion": "^0.6.1",
|
||||
"@open-wc/scoped-elements": "^2.0.0-next.3",
|
||||
"lit": "^2.0.0-rc.2"
|
||||
"@lion/accordion": "^0.7.2",
|
||||
"@open-wc/scoped-elements": "^2.0.0",
|
||||
"lit": "^2.0.0"
|
||||
},
|
||||
"types": "dist-types/index.d.ts"
|
||||
}
|
||||
|
||||
@@ -10,6 +10,16 @@ import {
|
||||
} from './mdjsViewerSharedStates.js';
|
||||
import { addResizeHandler } from './resizeHandler.js';
|
||||
|
||||
/**
|
||||
* @param {string} input
|
||||
* @param {'js'|'css'} type
|
||||
* @returns {string}
|
||||
*/
|
||||
function sanitize(input, type) {
|
||||
const url = new URL(input);
|
||||
return url.pathname.slice(1, (type.length + 1) * -1);
|
||||
}
|
||||
|
||||
/**
|
||||
* @typedef {object} StoryOptions
|
||||
* @property {HTMLElement | null} StoryOptions.shadowRoot
|
||||
@@ -47,11 +57,11 @@ export class MdJsPreview extends ScopedElementsMixin(LitElement) {
|
||||
contentHeight: { type: Number },
|
||||
simulatorUrl: { type: String },
|
||||
// page settings
|
||||
platform: { type: String },
|
||||
platform: { type: String, reflect: true },
|
||||
platforms: { type: Array },
|
||||
size: { type: String },
|
||||
sizes: { type: Array },
|
||||
theme: { type: String, reflect: true },
|
||||
previewTheme: { type: String, reflect: true, attribute: 'preview-theme' },
|
||||
themes: { type: Array },
|
||||
language: { type: String },
|
||||
languages: { type: Array },
|
||||
@@ -72,7 +82,7 @@ export class MdJsPreview extends ScopedElementsMixin(LitElement) {
|
||||
this.__supportsClipboard = 'clipboard' in navigator;
|
||||
this.__copyButtonText = 'Copy Code';
|
||||
|
||||
this.theme = 'light';
|
||||
this.previewTheme = 'light';
|
||||
/** @type {{ key: string, name: string }[]} */
|
||||
this.themes = [
|
||||
// { key: 'light', name: 'Light' },
|
||||
@@ -107,8 +117,16 @@ export class MdJsPreview extends ScopedElementsMixin(LitElement) {
|
||||
// { key: 'ios', name: 'iOS' },
|
||||
];
|
||||
|
||||
this.size = 'webSmall';
|
||||
this.size = 'webInline';
|
||||
this.sizes = [
|
||||
{
|
||||
key: 'webInline',
|
||||
name: 'Inline',
|
||||
platform: 'web',
|
||||
width: 360,
|
||||
height: 640,
|
||||
dpr: 1,
|
||||
},
|
||||
{
|
||||
key: 'webSmall',
|
||||
name: 'Small',
|
||||
@@ -241,6 +259,10 @@ export class MdJsPreview extends ScopedElementsMixin(LitElement) {
|
||||
if (this.lightDomRenderTarget && changeProps.has('story')) {
|
||||
render(this.story({ shadowRoot: this }), this.lightDomRenderTarget);
|
||||
}
|
||||
|
||||
if (changeProps.has('platform') || changeProps.has('size')) {
|
||||
this.deviceMode = this.platform === 'web' && this.size === 'webInline' ? false : true;
|
||||
}
|
||||
}
|
||||
|
||||
disconnectedCallback() {
|
||||
@@ -261,11 +283,10 @@ export class MdJsPreview extends ScopedElementsMixin(LitElement) {
|
||||
if (!mdjsSetupScript) {
|
||||
throw new Error('Could not find a <script type="module" src="..." mdjs-setup></script>');
|
||||
}
|
||||
|
||||
const params = new URLSearchParams();
|
||||
params.set('story-file', mdjsSetupScript.src);
|
||||
params.set('story-file', sanitize(mdjsSetupScript.src, 'js'));
|
||||
params.set('story-key', this.key);
|
||||
params.set('theme', this.theme);
|
||||
params.set('theme', this.previewTheme);
|
||||
params.set('platform', this.platform);
|
||||
params.set('language', this.language);
|
||||
params.set('edge-distance', this.edgeDistance.toString());
|
||||
@@ -275,7 +296,16 @@ export class MdJsPreview extends ScopedElementsMixin(LitElement) {
|
||||
]);
|
||||
for (const link of links) {
|
||||
if (link.href) {
|
||||
params.append('stylesheets', link.href);
|
||||
params.append('stylesheets', sanitize(link.href, 'css'));
|
||||
}
|
||||
}
|
||||
|
||||
const moduleUrls = /** @type {HTMLScriptElement[]} */ ([
|
||||
...document.querySelectorAll('script[type=module][mdjs-use]'),
|
||||
]);
|
||||
for (const moduleUrl of moduleUrls) {
|
||||
if (moduleUrl.src) {
|
||||
params.append('moduleUrls', sanitize(moduleUrl.src, 'js'));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -292,8 +322,15 @@ export class MdJsPreview extends ScopedElementsMixin(LitElement) {
|
||||
}
|
||||
|
||||
async onCopy() {
|
||||
if (this.textContent) {
|
||||
await navigator.clipboard.writeText(this.textContent.trim());
|
||||
let nodeToConsider = this.children[0];
|
||||
if (this.platform === 'android') {
|
||||
nodeToConsider = this.children[1];
|
||||
}
|
||||
if (this.platform === 'ios') {
|
||||
nodeToConsider = this.children[2];
|
||||
}
|
||||
if (nodeToConsider && nodeToConsider.textContent) {
|
||||
await navigator.clipboard.writeText(nodeToConsider.textContent.trim());
|
||||
this.__copyButtonText = 'Copied ✅';
|
||||
setTimeout(() => {
|
||||
this.__copyButtonText = 'Copy code';
|
||||
@@ -304,7 +341,6 @@ export class MdJsPreview extends ScopedElementsMixin(LitElement) {
|
||||
renderPlatforms() {
|
||||
if (this.platforms.length) {
|
||||
return html`
|
||||
<h4>Platform</h4>
|
||||
<div
|
||||
class="segmented-control"
|
||||
@change=${
|
||||
@@ -337,17 +373,27 @@ export class MdJsPreview extends ScopedElementsMixin(LitElement) {
|
||||
if (this.platforms.length) {
|
||||
return html`
|
||||
<div>
|
||||
<h3>Platform</h3>
|
||||
<h4>Platform</h4>
|
||||
${this.renderPlatforms()}
|
||||
</div>
|
||||
`;
|
||||
}
|
||||
}
|
||||
|
||||
renderSize() {
|
||||
if (this.sizes.length) {
|
||||
return html`
|
||||
<div>
|
||||
<h4>Size</h4>
|
||||
${this.renderSizes()}
|
||||
</div>
|
||||
`;
|
||||
}
|
||||
}
|
||||
|
||||
renderSizes() {
|
||||
if (this.sizes.length) {
|
||||
return html`
|
||||
<h4>Size</h4>
|
||||
<div
|
||||
class="segmented-control"
|
||||
@change=${
|
||||
@@ -380,7 +426,7 @@ export class MdJsPreview extends ScopedElementsMixin(LitElement) {
|
||||
return html`
|
||||
<div>
|
||||
<h3>Viewport</h3>
|
||||
${this.renderSizes()} ${this.renderAutoHeight()}
|
||||
${this.renderAutoHeight()}
|
||||
</div>
|
||||
`;
|
||||
}
|
||||
@@ -393,20 +439,20 @@ export class MdJsPreview extends ScopedElementsMixin(LitElement) {
|
||||
@change=${
|
||||
/** @param {Event} ev */ ev => {
|
||||
if (ev.target) {
|
||||
this.theme = /** @type {HTMLInputElement} */ (ev.target).value;
|
||||
this.previewTheme = /** @type {HTMLInputElement} */ (ev.target).value;
|
||||
}
|
||||
}
|
||||
}
|
||||
>
|
||||
${this.themes.map(
|
||||
theme => html`
|
||||
<label class="${this.theme === theme.key ? 'selected' : ''}">
|
||||
<span>${theme.name}</span>
|
||||
previewTheme => html`
|
||||
<label class="${this.previewTheme === previewTheme.key ? 'selected' : ''}">
|
||||
<span>${previewTheme.name}</span>
|
||||
<input
|
||||
type="radio"
|
||||
name="theme"
|
||||
value="${theme.key}"
|
||||
?checked=${this.theme === theme.key}
|
||||
value="${previewTheme.key}"
|
||||
?checked=${this.previewTheme === previewTheme.key}
|
||||
/>
|
||||
</label>
|
||||
`,
|
||||
@@ -564,6 +610,11 @@ export class MdJsPreview extends ScopedElementsMixin(LitElement) {
|
||||
|
||||
render() {
|
||||
return html`
|
||||
${this.simulatorUrl
|
||||
? html`
|
||||
<div class="platform-size-controls">${this.renderPlatform()} ${this.renderSize()}</div>
|
||||
`
|
||||
: ``}
|
||||
<div id="wrapper">
|
||||
<slot name="story"></slot>
|
||||
${this.deviceMode === true
|
||||
@@ -581,19 +632,28 @@ export class MdJsPreview extends ScopedElementsMixin(LitElement) {
|
||||
: nothing}
|
||||
</div>
|
||||
<lion-accordion class="options">
|
||||
${this.deviceMode
|
||||
${this.simulatorUrl
|
||||
? html`
|
||||
<h3 slot="invoker">
|
||||
<button>Settings</button>
|
||||
</h3>
|
||||
<div slot="content">
|
||||
${this.deviceMode
|
||||
? ``
|
||||
: html`<div>
|
||||
Note: Additional settings become available when not in web inline mode
|
||||
</div>`}
|
||||
<div class="settings-wrapper">
|
||||
${this.renderPlatform()} ${this.renderViewport()} ${this.renderVisual()}
|
||||
${this.renderLocalization()} ${this.renderSyncSettings()}
|
||||
${this.deviceMode
|
||||
? html`
|
||||
${this.renderViewport()} ${this.renderVisual()} ${this.renderLocalization()}
|
||||
${this.renderSyncSettings()}
|
||||
`
|
||||
: html` ${this.renderSyncSettings()} `}
|
||||
</div>
|
||||
</div>
|
||||
`
|
||||
: ''}
|
||||
: ``}
|
||||
<h3 slot="invoker">
|
||||
<button>Code</button>
|
||||
</h3>
|
||||
@@ -608,12 +668,6 @@ export class MdJsPreview extends ScopedElementsMixin(LitElement) {
|
||||
? html`
|
||||
<div class="controls">
|
||||
<a href=${this.iframeUrl} target="_blank">Open simulation in new window</a>
|
||||
<button
|
||||
@click=${() => (this.deviceMode = !this.deviceMode)}
|
||||
class="simulation-toggle"
|
||||
>
|
||||
${this.deviceMode ? html`Disable` : html`Enable`} device simulation
|
||||
</button>
|
||||
</div>
|
||||
`
|
||||
: ''}
|
||||
@@ -631,8 +685,12 @@ export class MdJsPreview extends ScopedElementsMixin(LitElement) {
|
||||
display: none;
|
||||
}
|
||||
|
||||
:host(:not([device-mode])) #wrapper {
|
||||
border: 2px solid var(--primary-lines-color, #4caf50);
|
||||
}
|
||||
|
||||
iframe {
|
||||
border: 2px solid #4caf50;
|
||||
border: 2px solid var(--primary-lines-color, #4caf50);
|
||||
background: #fff;
|
||||
}
|
||||
|
||||
@@ -725,6 +783,15 @@ export class MdJsPreview extends ScopedElementsMixin(LitElement) {
|
||||
padding: 15px 0;
|
||||
}
|
||||
|
||||
.platform-size-controls {
|
||||
display: flex;
|
||||
justify-content: flex-start;
|
||||
}
|
||||
|
||||
.platform-size-controls > * {
|
||||
margin-right: 25px;
|
||||
}
|
||||
|
||||
.controls {
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
@@ -845,6 +912,21 @@ export class MdJsPreview extends ScopedElementsMixin(LitElement) {
|
||||
border: 1px solid #333;
|
||||
border-radius: 3px;
|
||||
}
|
||||
|
||||
/** Showing/Hiding additional code blocks **/
|
||||
::slotted(pre) {
|
||||
display: none;
|
||||
}
|
||||
|
||||
:host([platform='web']) ::slotted(pre:nth-child(1)) {
|
||||
display: block;
|
||||
}
|
||||
:host([platform='android']) ::slotted(pre:nth-child(2)) {
|
||||
display: block;
|
||||
}
|
||||
:host([platform='ios']) ::slotted(pre:nth-child(3)) {
|
||||
display: block;
|
||||
}
|
||||
`;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
const _sharedStates = {
|
||||
platform: 'web',
|
||||
size: 'webSmall',
|
||||
theme: 'light',
|
||||
previewTheme: 'light',
|
||||
language: 'en',
|
||||
autoHeight: true,
|
||||
deviceMode: false,
|
||||
|
||||
@@ -28,11 +28,8 @@ describe('mdjs-preview', () => {
|
||||
expect(preview1.edgeDistance).to.be.true;
|
||||
expect(preview2.edgeDistance).to.be.true;
|
||||
|
||||
preview1.platform = 'android';
|
||||
preview1.edgeDistance = false;
|
||||
await preview1.updateComplete;
|
||||
expect(preview1.platform).to.equal('android');
|
||||
expect(preview2.platform).to.equal('android');
|
||||
expect(preview1.edgeDistance).to.be.false;
|
||||
expect(preview2.edgeDistance).to.be.false;
|
||||
});
|
||||
|
||||
@@ -1,5 +1,11 @@
|
||||
# @mdjs/mdjs-story
|
||||
|
||||
## 0.3.1
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- 445b028: Update to latest lit, @open-wc, @lion packages
|
||||
|
||||
## 0.3.0
|
||||
|
||||
### Minor Changes
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@mdjs/mdjs-story",
|
||||
"version": "0.3.0",
|
||||
"version": "0.3.1",
|
||||
"publishConfig": {
|
||||
"access": "public"
|
||||
},
|
||||
@@ -31,7 +31,7 @@
|
||||
"src"
|
||||
],
|
||||
"dependencies": {
|
||||
"lit": "^2.0.0-rc.2"
|
||||
"lit": "^2.0.0"
|
||||
},
|
||||
"types": "dist-types/index.d.ts"
|
||||
}
|
||||
|
||||
@@ -1,5 +1,92 @@
|
||||
# plugins-manager
|
||||
|
||||
## 0.3.0
|
||||
|
||||
### Minor Changes
|
||||
|
||||
- 70bb7a1: BREAKING CHANGE: `addPlugin` API changed
|
||||
|
||||
```diff
|
||||
- addPlugin({ name: 'my-plugin', plugin: myPlugin, options: { myFlag: true }, location: 'top' });
|
||||
+ addPlugin(myPlugin, { myFlag: true }, { location: 'top' });
|
||||
```
|
||||
|
||||
This is now type safe and typescript will throw an error if you pass the wrong type.
|
||||
|
||||
```js
|
||||
function myPlugin({ myFlag = false } = {}) {
|
||||
// ...
|
||||
}
|
||||
|
||||
addPlugin(myPlugin, { myFlag: true }); // ts ok
|
||||
addPlugin(myPlugin, { notExisting: true }); // ts error
|
||||
```
|
||||
|
||||
- 70bb7a1: BREAKING CHANGE: `adjustPluginOptions` API changed
|
||||
|
||||
```diff
|
||||
- adjustPluginOptions('my-plugin', { myFlag: true });
|
||||
+ adjustPluginOptions(myPlugin, { myFlag: true });
|
||||
```
|
||||
|
||||
This is now type safe and typescript will throw an error if you pass the wrong type.
|
||||
|
||||
```js
|
||||
function myPlugin({ myFlag = false } = {}) {
|
||||
// ...
|
||||
}
|
||||
|
||||
adjustPluginOptions(myPlugin, { myFlag: true }); // ts ok
|
||||
adjustPluginOptions(myPlugin, { notExisting: true }); // ts error
|
||||
```
|
||||
|
||||
- 70bb7a1: Add `removePlugin` functionality
|
||||
|
||||
```js
|
||||
export default {
|
||||
setupPlugins: [removePlugin(json)],
|
||||
};
|
||||
```
|
||||
|
||||
- 70bb7a1: BREAKING CHANGE: `metaConfigToRollupConfig` has been renamed to `applyPlugins`
|
||||
|
||||
```diff
|
||||
- const finalConfig = metaConfigToRollupConfig(currentConfig, defaultMetaPlugins);
|
||||
+ const finalConfig = applyPlugins(currentConfig, defaultMetaPlugins);
|
||||
```
|
||||
|
||||
- 70bb7a1: BREAKING CHANGE: `metaConfigToWebDevServerConfig` has been removed
|
||||
- 70bb7a1: Plugins can now be classes as well. The options are passed to the constructor.
|
||||
|
||||
```js
|
||||
/**
|
||||
* @typedef {object} MyClassOptions
|
||||
* @property {string} lastName
|
||||
*/
|
||||
|
||||
class MyClass {
|
||||
/** @type {MyClassOptions} */
|
||||
options = {
|
||||
lastName: 'initial-second',
|
||||
};
|
||||
|
||||
/**
|
||||
* @param {Partial<MyClassOptions>} options
|
||||
*/
|
||||
constructor(options = {}) {
|
||||
this.options = { ...this.options, ...options };
|
||||
}
|
||||
}
|
||||
|
||||
export default {
|
||||
setupPlugins: [addPlugin(MyClass)],
|
||||
};
|
||||
|
||||
// constructor parameters are type safe
|
||||
addPlugin(MyClass, { lastName: 'new name' }); // ts ok
|
||||
addPlugin(MyClass, { otherProp: 'new name' }); // ts error
|
||||
```
|
||||
|
||||
## 0.2.4
|
||||
|
||||
### Patch Changes
|
||||
|
||||
@@ -1,6 +1,3 @@
|
||||
# Plugins Manager
|
||||
|
||||
The Plugins Manager replaces the specific registration/execution (with options) in a given plugin system by an intent to use a plugin (with these options).
|
||||
This allows your users to adjust the options before actually applying the plugins.
|
||||
|
||||
For docs please see our homepage [https://rocket.modern-web.dev/docs/plugins-manager/overview/](https://rocket.modern-web.dev/docs/plugins-manager/overview/).
|
||||
[=> See Source <=](../../docs/docs/tools/plugins-manager.md)
|
||||
|
||||
@@ -1,9 +1,11 @@
|
||||
/** @typedef {import('./types/main').MetaPlugin} MetaPlugin */
|
||||
/** @typedef {import('./types/main').AddPluginFn} AddPluginFn */
|
||||
/** @typedef {import('./types/main').AddPluginType} AddPluginType */
|
||||
/**
|
||||
* @template T
|
||||
* @typedef {import('./types/main').MetaPlugin<T>} MetaPlugin
|
||||
**/
|
||||
/** @typedef {import('./types/main').Plugin} Plugin */
|
||||
|
||||
export { addPlugin } from './src/addPlugin.js';
|
||||
export { removePlugin } from './src/removePlugin.js';
|
||||
export { adjustPluginOptions } from './src/adjustPluginOptions.js';
|
||||
export { metaConfigToRollupConfig } from './src/metaConfigToRollupConfig.js';
|
||||
export { metaConfigToWebDevServerConfig } from './src/metaConfigToWebDevServerConfig.js';
|
||||
export { applyPlugins } from './src/applyPlugins.js';
|
||||
export { executeSetupFunctions } from './src/executeSetupFunctions.js';
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "plugins-manager",
|
||||
"version": "0.2.4",
|
||||
"version": "0.3.0",
|
||||
"publishConfig": {
|
||||
"access": "public"
|
||||
},
|
||||
@@ -23,6 +23,7 @@
|
||||
},
|
||||
"scripts": {
|
||||
"build:package": "rimraf dist && esbuild --platform=node --format=cjs --bundle --outfile=dist/index.cjs ./index.js",
|
||||
"prepublishOnly": "publish-docs --github-url https://github.com/modernweb-dev/rocket/ --git-root-dir ../../",
|
||||
"test": "mocha --timeout 5000 test-node/**/*.test.{js,cjs} test-node/*.test.{js,cjs}",
|
||||
"test:watch": "onchange 'src/**/*.{js,cjs}' 'test-node/**/*.{js,cjs}' -- npm test",
|
||||
"types:copy": "copyfiles \"./types/**/*.d.ts\" dist-types/"
|
||||
|
||||
@@ -1,26 +1,19 @@
|
||||
/** @typedef {import('../types/main').MetaPlugin} MetaPlugin */
|
||||
|
||||
/**
|
||||
* @template {Function} T
|
||||
* @param {import('../types/main').AddPluginOptions<T>} metaPluginAndOptions
|
||||
* @template {import('../types/main').Plugin} T
|
||||
* @param {T} plugin
|
||||
* @param {import('../types/main').GetPluginOptions<T>} [options]
|
||||
* @param {import('../types/main').ManagerOptions} [managerOptions]
|
||||
*/
|
||||
export function addPlugin(metaPluginAndOptions) {
|
||||
const {
|
||||
name,
|
||||
plugin,
|
||||
options = undefined,
|
||||
how = 'after',
|
||||
location = 'bottom',
|
||||
} = metaPluginAndOptions;
|
||||
export function addPlugin(plugin, options = {}, { how = 'after', location = 'bottom' } = {}) {
|
||||
/**
|
||||
* @param {MetaPlugin[]} plugins
|
||||
* @param {import('../types/main').MetaPlugin<T>[]} plugins
|
||||
*/
|
||||
const addPluginFn = plugins => {
|
||||
if (plugins === undefined) {
|
||||
plugins = [];
|
||||
}
|
||||
// only add if name is not already in the meta plugin list
|
||||
if (plugins.findIndex(pluginObj => pluginObj.name === name) === -1) {
|
||||
if (plugins.findIndex(pluginObj => pluginObj.plugin === plugin) === -1) {
|
||||
let index = -1;
|
||||
let _how = how;
|
||||
switch (location) {
|
||||
@@ -33,11 +26,12 @@ export function addPlugin(metaPluginAndOptions) {
|
||||
_how = 'fixed';
|
||||
break;
|
||||
default:
|
||||
index = plugins.findIndex(plugin => plugin.name === location);
|
||||
index = plugins.findIndex(pluginObj => pluginObj.plugin === location);
|
||||
}
|
||||
if (index < 0) {
|
||||
const errorName = location === 'top' || location === 'bottom' ? location : location.name;
|
||||
throw new Error(
|
||||
`Could not find a plugin with the name "${location}" to insert "${name}" ${how} it.`,
|
||||
`Could not find a plugin with the name "${errorName}" to insert "${plugin.name}" ${how} it.`,
|
||||
);
|
||||
}
|
||||
|
||||
@@ -46,7 +40,6 @@ export function addPlugin(metaPluginAndOptions) {
|
||||
}
|
||||
|
||||
plugins.splice(index, 0, {
|
||||
name,
|
||||
plugin,
|
||||
options,
|
||||
});
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
/** @typedef {import('../types/main').MetaPlugin} MetaPlugin */
|
||||
/** @typedef {import('../types/main').Plugin} Plugin */
|
||||
|
||||
/**
|
||||
* @param {any} obj
|
||||
@@ -8,23 +8,35 @@ function isObject(obj) {
|
||||
}
|
||||
|
||||
/**
|
||||
* @param {string} pluginName
|
||||
* @param {any} mergeOptions
|
||||
* @param {*} x
|
||||
* @returns {x is function}
|
||||
*/
|
||||
export function adjustPluginOptions(pluginName, mergeOptions) {
|
||||
function isFunction(x) {
|
||||
return typeof x === 'function';
|
||||
}
|
||||
|
||||
/**
|
||||
* @template {import('../types/main').Plugin} T
|
||||
* @param {T} plugin
|
||||
* @param {import('../types/main').adjustPluginOptionsOptions<T>} mergeOptions
|
||||
*/
|
||||
export function adjustPluginOptions(plugin, mergeOptions) {
|
||||
/**
|
||||
* @param {MetaPlugin[]} plugins
|
||||
* @template {Function} T
|
||||
* @param {import('../types/main').MetaPlugin<T>[]} plugins
|
||||
*/
|
||||
const adjustPluginOptionsFn = plugins => {
|
||||
const index = plugins.findIndex(plugin => plugin.name === pluginName);
|
||||
const index = plugins.findIndex(pluginObj => pluginObj.plugin === plugin);
|
||||
|
||||
if (index === -1) {
|
||||
throw new Error(
|
||||
`Could not find a plugin with the name "${pluginName}" to adjust the options.`,
|
||||
`Could not find a plugin with the name "${
|
||||
plugin.name
|
||||
}" to adjust it's options with:\n${JSON.stringify(mergeOptions, null, 2)}`,
|
||||
);
|
||||
}
|
||||
|
||||
if (typeof mergeOptions === 'function') {
|
||||
if (isFunction(mergeOptions)) {
|
||||
plugins[index].options = mergeOptions(plugins[index].options);
|
||||
} else if (isObject(plugins[index].options)) {
|
||||
plugins[index].options = { ...plugins[index].options, ...mergeOptions };
|
||||
|
||||
46
packages/plugins-manager/src/applyPlugins.js
Normal file
46
packages/plugins-manager/src/applyPlugins.js
Normal file
@@ -0,0 +1,46 @@
|
||||
import { executeSetupFunctions } from './executeSetupFunctions.js';
|
||||
|
||||
/** @typedef {import('../types/main').Constructor} Constructor */
|
||||
/** @typedef {import('../types/main').AnyFn} AnyFn */
|
||||
|
||||
/**
|
||||
* @param {unknown} func
|
||||
* @returns {boolean}
|
||||
*/
|
||||
function isClass(func) {
|
||||
if (typeof func === 'function' && func.prototype) {
|
||||
try {
|
||||
func.arguments && func.caller;
|
||||
} catch (error) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
* @template {import('../types/main').Plugin} T
|
||||
* @param {any} config
|
||||
* @param {import('../types/main').MetaPlugin<T>[]} [defaultPlugins]
|
||||
*/
|
||||
export function applyPlugins(config, defaultPlugins = []) {
|
||||
if (config.plugins) {
|
||||
delete config.setupPlugins;
|
||||
return config;
|
||||
}
|
||||
const _metaPlugins = executeSetupFunctions(config.setupPlugins, [...defaultPlugins]);
|
||||
|
||||
const plugins = _metaPlugins.map(pluginObj => {
|
||||
if (isClass(pluginObj.plugin)) {
|
||||
const ClassPlugin = /** @type {Constructor} */ (pluginObj.plugin);
|
||||
return pluginObj.options ? new ClassPlugin(pluginObj.options) : new ClassPlugin();
|
||||
} else {
|
||||
const fnPlugin = /** @type {AnyFn} */ (pluginObj.plugin);
|
||||
return pluginObj.options ? fnPlugin(pluginObj.options) : fnPlugin();
|
||||
}
|
||||
});
|
||||
config.plugins = plugins;
|
||||
|
||||
delete config.setupPlugins;
|
||||
return config;
|
||||
}
|
||||
@@ -1,9 +1,8 @@
|
||||
/** @typedef {import('../types/main').MetaPlugin} MetaPlugin */
|
||||
|
||||
/**
|
||||
* @template T
|
||||
* @param {function[]} setupFunctions
|
||||
* @param {MetaPlugin[]} metaPlugins
|
||||
* @return {MetaPlugin[]}
|
||||
* @param {import('../types/main').MetaPlugin<T>[]} metaPlugins
|
||||
* @return {import('../types/main').MetaPlugin<T>[]}
|
||||
*/
|
||||
export function executeSetupFunctions(setupFunctions, metaPlugins = []) {
|
||||
let _metaPlugins = [...metaPlugins];
|
||||
|
||||
@@ -1,27 +0,0 @@
|
||||
/** @typedef {import('../types/main').MetaPlugin} MetaPlugin */
|
||||
|
||||
import { executeSetupFunctions } from 'plugins-manager';
|
||||
|
||||
/**
|
||||
* @param {any} config
|
||||
* @param {MetaPlugin[]} [metaPlugins]
|
||||
*/
|
||||
export function metaConfigToRollupConfig(config, metaPlugins = []) {
|
||||
if (config.plugins) {
|
||||
delete config.setupPlugins;
|
||||
return config;
|
||||
}
|
||||
const _metaPlugins = executeSetupFunctions(config.setupPlugins, [...metaPlugins]);
|
||||
|
||||
const plugins = _metaPlugins.map(pluginObj => {
|
||||
if (pluginObj.options) {
|
||||
return pluginObj.plugin(pluginObj.options);
|
||||
} else {
|
||||
return pluginObj.plugin();
|
||||
}
|
||||
});
|
||||
config.plugins = plugins;
|
||||
|
||||
delete config.setupPlugins;
|
||||
return config;
|
||||
}
|
||||
@@ -1,53 +0,0 @@
|
||||
/** @typedef {import('../types/main').MetaPluginWrapable} MetaPluginWrapable */
|
||||
|
||||
import { executeSetupFunctions } from 'plugins-manager';
|
||||
|
||||
/**
|
||||
* @param {any} config
|
||||
* @param {MetaPluginWrapable[]} metaPlugins
|
||||
* @param {object} [options]
|
||||
* @param {function | null} [options.rollupWrapperFunction]
|
||||
*/
|
||||
export function metaConfigToWebDevServerConfig(
|
||||
config,
|
||||
metaPlugins,
|
||||
{ rollupWrapperFunction = null } = {},
|
||||
) {
|
||||
if (config.plugins) {
|
||||
delete config.setupPlugins;
|
||||
delete config.setupRollupPlugins;
|
||||
return config;
|
||||
}
|
||||
|
||||
const metaPluginsNoWrap = metaPlugins.map(pluginObj => {
|
||||
pluginObj.__noWrap = true;
|
||||
return pluginObj;
|
||||
});
|
||||
|
||||
const rollupPlugins = /** @type {MetaPluginWrapable[]} */ (executeSetupFunctions(
|
||||
config.setupRollupPlugins,
|
||||
[...metaPluginsNoWrap],
|
||||
));
|
||||
|
||||
const wrappedRollupPlugins = rollupPlugins.map(pluginObj => {
|
||||
if (typeof rollupWrapperFunction === 'function' && pluginObj.__noWrap !== true) {
|
||||
pluginObj.plugin = rollupWrapperFunction(pluginObj.plugin);
|
||||
}
|
||||
return pluginObj;
|
||||
});
|
||||
|
||||
const _metaPlugins = executeSetupFunctions(config.setupPlugins, [...wrappedRollupPlugins]);
|
||||
|
||||
const plugins = _metaPlugins.map(pluginObj => {
|
||||
if (pluginObj.options) {
|
||||
return pluginObj.plugin(pluginObj.options);
|
||||
} else {
|
||||
return pluginObj.plugin();
|
||||
}
|
||||
});
|
||||
config.plugins = plugins;
|
||||
|
||||
delete config.setupPlugins;
|
||||
delete config.setupRollupPlugins;
|
||||
return config;
|
||||
}
|
||||
23
packages/plugins-manager/src/removePlugin.js
Normal file
23
packages/plugins-manager/src/removePlugin.js
Normal file
@@ -0,0 +1,23 @@
|
||||
/** @typedef {import('../types/main').Plugin} Plugin */
|
||||
|
||||
/**
|
||||
* @param {import('../types/main').Plugin} plugin
|
||||
*/
|
||||
export function removePlugin(plugin) {
|
||||
/**
|
||||
* @template {Function} T
|
||||
* @param {import('../types/main').MetaPlugin<T>[]} plugins
|
||||
*/
|
||||
const removePluginFn = plugins => {
|
||||
const index = plugins.findIndex(pluginObj => pluginObj.plugin === plugin);
|
||||
|
||||
if (index === -1) {
|
||||
throw new Error(`Could not find a plugin with the name "${plugin.name}" to remove.`);
|
||||
}
|
||||
|
||||
plugins.splice(index, 1);
|
||||
|
||||
return plugins;
|
||||
};
|
||||
return removePluginFn;
|
||||
}
|
||||
@@ -1,82 +1,93 @@
|
||||
import chai from 'chai';
|
||||
|
||||
import { addPlugin, metaConfigToRollupConfig } from 'plugins-manager';
|
||||
import { addPlugin, applyPlugins } from '../index.js';
|
||||
|
||||
const { expect } = chai;
|
||||
|
||||
describe('addPlugin', () => {
|
||||
const insertPlugin = (options = 'insert') => `-- ${options}Plugin --`;
|
||||
const oneExistingPlugin = [{ name: 'first', plugin: () => 'firstPlugin' }];
|
||||
const insertPlugin = ({ firstName = 'first', lastName = 'last' } = {}) =>
|
||||
`-- ${firstName} ${lastName} Plugin --`;
|
||||
const firstPlugin = () => 'firstPlugin';
|
||||
const secondPlugin = () => 'secondPlugin';
|
||||
const thirdPlugin = () => 'thirdPlugin';
|
||||
|
||||
/**
|
||||
* @template T
|
||||
* @type {import('../types/main.js').MetaPlugin<T>[]}
|
||||
*/
|
||||
const oneExistingPlugin = [{ plugin: firstPlugin, options: {} }];
|
||||
/**
|
||||
* @template T
|
||||
* @type {import('../types/main.js').MetaPlugin<T>[]}
|
||||
*/
|
||||
const threeExistingPlugins = [
|
||||
{ name: 'first', plugin: () => 'firstPlugin' },
|
||||
{ name: 'second', plugin: () => 'secondPlugin' },
|
||||
{ name: 'third', plugin: () => 'thirdPlugin' },
|
||||
{ plugin: firstPlugin, options: {} },
|
||||
{ plugin: secondPlugin, options: {} },
|
||||
{ plugin: thirdPlugin, options: {} },
|
||||
];
|
||||
|
||||
it('adds plugins at the bottom by default', async () => {
|
||||
const config = metaConfigToRollupConfig({
|
||||
setupPlugins: [addPlugin({ name: 'insert', plugin: insertPlugin })],
|
||||
const config = applyPlugins({
|
||||
setupPlugins: [addPlugin(insertPlugin)],
|
||||
});
|
||||
expect(config.plugins).to.deep.equal(['-- insertPlugin --']);
|
||||
expect(config.plugins).to.deep.equal(['-- first last Plugin --']);
|
||||
|
||||
const config2 = metaConfigToRollupConfig(
|
||||
const config2 = applyPlugins(
|
||||
{
|
||||
setupPlugins: [addPlugin({ name: 'insert', plugin: insertPlugin })],
|
||||
setupPlugins: [addPlugin(insertPlugin)],
|
||||
},
|
||||
oneExistingPlugin,
|
||||
);
|
||||
expect(config2.plugins).to.deep.equal(['firstPlugin', '-- insertPlugin --']);
|
||||
expect(config2.plugins).to.deep.equal(['firstPlugin', '-- first last Plugin --']);
|
||||
});
|
||||
|
||||
it('can add at the top', async () => {
|
||||
const config = metaConfigToRollupConfig(
|
||||
const config = applyPlugins(
|
||||
{
|
||||
setupPlugins: [addPlugin({ name: 'insert', plugin: insertPlugin, location: 'top' })],
|
||||
setupPlugins: [addPlugin(insertPlugin, undefined, { location: 'top' })],
|
||||
},
|
||||
oneExistingPlugin,
|
||||
);
|
||||
expect(config.plugins).to.deep.equal(['-- insertPlugin --', 'firstPlugin']);
|
||||
expect(config.plugins).to.deep.equal(['-- first last Plugin --', 'firstPlugin']);
|
||||
});
|
||||
|
||||
it('handles inserting "before" the 0 index ', async () => {
|
||||
const config = metaConfigToRollupConfig(
|
||||
const config = applyPlugins(
|
||||
{
|
||||
setupPlugins: [
|
||||
addPlugin({ name: 'insert', plugin: insertPlugin, location: 'top', how: 'before' }),
|
||||
],
|
||||
setupPlugins: [addPlugin(insertPlugin, undefined, { location: 'top', how: 'before' })],
|
||||
},
|
||||
oneExistingPlugin,
|
||||
);
|
||||
expect(config.plugins).to.deep.equal(['-- insertPlugin --', 'firstPlugin']);
|
||||
expect(config.plugins).to.deep.equal(['-- first last Plugin --', 'firstPlugin']);
|
||||
});
|
||||
|
||||
it('adds after a given location by default', async () => {
|
||||
const config = metaConfigToRollupConfig(
|
||||
const config = applyPlugins(
|
||||
{
|
||||
setupPlugins: [addPlugin({ name: 'insert', plugin: insertPlugin, location: 'second' })],
|
||||
setupPlugins: [addPlugin(insertPlugin, undefined, { location: secondPlugin })],
|
||||
},
|
||||
threeExistingPlugins,
|
||||
);
|
||||
expect(config.plugins).to.deep.equal([
|
||||
'firstPlugin',
|
||||
'secondPlugin',
|
||||
'-- insertPlugin --',
|
||||
'-- first last Plugin --',
|
||||
'thirdPlugin',
|
||||
]);
|
||||
});
|
||||
|
||||
it('can adds before a given location', async () => {
|
||||
const config = metaConfigToRollupConfig(
|
||||
const config = applyPlugins(
|
||||
{
|
||||
setupPlugins: [
|
||||
addPlugin({ name: 'insert', plugin: insertPlugin, location: 'second', how: 'before' }),
|
||||
addPlugin(insertPlugin, undefined, { location: secondPlugin, how: 'before' }),
|
||||
],
|
||||
},
|
||||
threeExistingPlugins,
|
||||
);
|
||||
expect(config.plugins).to.deep.equal([
|
||||
'firstPlugin',
|
||||
'-- insertPlugin --',
|
||||
'-- first last Plugin --',
|
||||
'secondPlugin',
|
||||
'thirdPlugin',
|
||||
]);
|
||||
@@ -84,16 +95,18 @@ describe('addPlugin', () => {
|
||||
|
||||
it('throws if given location does not exist', async () => {
|
||||
expect(() => {
|
||||
metaConfigToRollupConfig({
|
||||
setupPlugins: [addPlugin({ name: 'insert', plugin: insertPlugin, location: 'not-found' })],
|
||||
applyPlugins({
|
||||
setupPlugins: [addPlugin(insertPlugin, undefined, { location: firstPlugin })],
|
||||
});
|
||||
}).to.throw('Could not find a plugin with the name "not-found" to insert "insert" after it.');
|
||||
}).to.throw(
|
||||
'Could not find a plugin with the name "firstPlugin" to insert "insertPlugin" after it.',
|
||||
);
|
||||
});
|
||||
|
||||
it('accepts options', async () => {
|
||||
const config = metaConfigToRollupConfig({
|
||||
setupPlugins: [addPlugin({ name: 'insert', plugin: insertPlugin, options: 'extra' })],
|
||||
const config = applyPlugins({
|
||||
setupPlugins: [addPlugin(insertPlugin, { firstName: 'newFirst' })],
|
||||
});
|
||||
expect(config.plugins).to.deep.equal(['-- extraPlugin --']);
|
||||
expect(config.plugins).to.deep.equal(['-- newFirst last Plugin --']);
|
||||
});
|
||||
});
|
||||
|
||||
@@ -1,33 +1,43 @@
|
||||
// @ts-check
|
||||
|
||||
import chai from 'chai';
|
||||
|
||||
import { adjustPluginOptions, metaConfigToRollupConfig } from 'plugins-manager';
|
||||
import { adjustPluginOptions, applyPlugins } from '../index.js';
|
||||
|
||||
const { expect } = chai;
|
||||
|
||||
describe('adjustPluginOptions', () => {
|
||||
const firstPlugin = ({ flag = 'default-flag' } = {}) => `firstPlugin-${flag}`;
|
||||
|
||||
/**
|
||||
* @param {object} options
|
||||
* @param {object} [options.other]
|
||||
* @param {string} [options.other.nested]
|
||||
* @param {string} [options.other.nested2]
|
||||
* @returns
|
||||
*/
|
||||
const secondPlugin = ({ other = { nested: 'other.nested', nested2: 'other.nested2' } } = {}) =>
|
||||
`secondPlugin-${other.nested}-${other.nested2}`;
|
||||
const thirdPlugin = ({ name = 'name' }) => `thirdPlugin-${name}`;
|
||||
|
||||
const defaultCurrentMetaPlugins = [
|
||||
{ plugin: firstPlugin, options: { flag: 'firstSettings' } },
|
||||
{
|
||||
name: 'first',
|
||||
plugin: options => `firstPlugin-${options.flag}`,
|
||||
options: { flag: 'firstSettings' },
|
||||
},
|
||||
{
|
||||
name: 'second',
|
||||
plugin: options => `secondPlugin-${options.other.nested}-${options.other.nested2}`,
|
||||
plugin: secondPlugin,
|
||||
options: { other: { nested: 'other.nested', nested2: 'other.nested2' } },
|
||||
},
|
||||
{ name: 'third', plugin: options => `thirdPlugin-${options}`, options: 'aString' },
|
||||
{ plugin: thirdPlugin, options: { name: 'name' } },
|
||||
];
|
||||
function newCurrentMetaPlugins() {
|
||||
return defaultCurrentMetaPlugins.map(obj => ({ ...obj }));
|
||||
}
|
||||
|
||||
it('will merge options objects (flatly)', async () => {
|
||||
const config = metaConfigToRollupConfig(
|
||||
const config = applyPlugins(
|
||||
{
|
||||
setupPlugins: [
|
||||
adjustPluginOptions('first', { flag: '#mod#FirstSettings' }),
|
||||
adjustPluginOptions('second', { other: { nested: '#mod#other.nested' } }),
|
||||
adjustPluginOptions(firstPlugin, { flag: '#mod#FirstSettings' }),
|
||||
adjustPluginOptions(secondPlugin, { other: { nested: '#mod#other.nested' } }),
|
||||
],
|
||||
},
|
||||
newCurrentMetaPlugins(),
|
||||
@@ -35,14 +45,14 @@ describe('adjustPluginOptions', () => {
|
||||
expect(config.plugins).to.deep.equal([
|
||||
'firstPlugin-#mod#FirstSettings',
|
||||
'secondPlugin-#mod#other.nested-undefined',
|
||||
'thirdPlugin-aString',
|
||||
'thirdPlugin-name',
|
||||
]);
|
||||
});
|
||||
|
||||
it('will override non object settings', async () => {
|
||||
const config = metaConfigToRollupConfig(
|
||||
const config = applyPlugins(
|
||||
{
|
||||
setupPlugins: [adjustPluginOptions('third', '#mod#aString')],
|
||||
setupPlugins: [adjustPluginOptions(thirdPlugin, { name: '#mod#aString' })],
|
||||
},
|
||||
newCurrentMetaPlugins(),
|
||||
);
|
||||
@@ -54,11 +64,11 @@ describe('adjustPluginOptions', () => {
|
||||
});
|
||||
|
||||
it('accepts a function as a setting to manually merge objects', async () => {
|
||||
const config = metaConfigToRollupConfig(
|
||||
const config = applyPlugins(
|
||||
{
|
||||
setupPlugins: [
|
||||
adjustPluginOptions('second', config => ({
|
||||
other: { ...config.other, nested: '#mod#other.nested' },
|
||||
adjustPluginOptions(secondPlugin, config => ({
|
||||
other: { ...config?.other, nested: '#mod#other.nested' },
|
||||
})),
|
||||
],
|
||||
},
|
||||
@@ -67,15 +77,76 @@ describe('adjustPluginOptions', () => {
|
||||
expect(config.plugins).to.deep.equal([
|
||||
'firstPlugin-firstSettings',
|
||||
'secondPlugin-#mod#other.nested-other.nested2',
|
||||
'thirdPlugin-aString',
|
||||
'thirdPlugin-name',
|
||||
]);
|
||||
});
|
||||
|
||||
it('throws if given location does not exist', async () => {
|
||||
it('throws if given plugin does not exist', async () => {
|
||||
expect(() => {
|
||||
metaConfigToRollupConfig({
|
||||
setupPlugins: [adjustPluginOptions('not-found', '#mod#aString')],
|
||||
applyPlugins({
|
||||
setupPlugins: [adjustPluginOptions(firstPlugin, { flag: 'newFlag' })],
|
||||
});
|
||||
}).to.throw('Could not find a plugin with the name "not-found" to adjust the options.');
|
||||
}).to.throw(
|
||||
[
|
||||
'Could not find a plugin with the name "firstPlugin" to adjust it\'s options with:',
|
||||
'{',
|
||||
' "flag": "newFlag"',
|
||||
'}',
|
||||
].join('\n'),
|
||||
);
|
||||
});
|
||||
|
||||
it('works with classes', async () => {
|
||||
class FirstClass {
|
||||
constructor({ firstName = 'initial-first' } = {}) {
|
||||
this.options = { firstName };
|
||||
}
|
||||
|
||||
render() {
|
||||
return `[[ firstName: ${this.options.firstName} ]]`;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @typedef {object} SecondClassOptions
|
||||
* @property {string} lastName
|
||||
*/
|
||||
|
||||
class SecondClass {
|
||||
/** @type {SecondClassOptions} */
|
||||
options = {
|
||||
lastName: 'initial-second',
|
||||
};
|
||||
|
||||
/**
|
||||
* @param {Partial<SecondClassOptions>} options
|
||||
*/
|
||||
constructor(options = {}) {
|
||||
this.options = { ...this.options, ...options };
|
||||
}
|
||||
|
||||
render() {
|
||||
return `[[ lastName: ${this.options.lastName} ]]`;
|
||||
}
|
||||
}
|
||||
|
||||
const config = applyPlugins(
|
||||
{
|
||||
setupPlugins: [
|
||||
adjustPluginOptions(SecondClass, { lastName: 'set-via-adjustPluginOptions' }),
|
||||
],
|
||||
},
|
||||
[
|
||||
{ plugin: FirstClass, options: {} },
|
||||
{ plugin: SecondClass, options: {} },
|
||||
],
|
||||
);
|
||||
|
||||
expect(
|
||||
config.plugins.map(/** @param {FirstClass | SecondClass} cls */ cls => cls.render()),
|
||||
).to.deep.equal([
|
||||
'[[ firstName: initial-first ]]',
|
||||
'[[ lastName: set-via-adjustPluginOptions ]]',
|
||||
]);
|
||||
});
|
||||
});
|
||||
|
||||
92
packages/plugins-manager/test-node/applyPlugins.test.js
Normal file
92
packages/plugins-manager/test-node/applyPlugins.test.js
Normal file
@@ -0,0 +1,92 @@
|
||||
import chai from 'chai';
|
||||
|
||||
import { applyPlugins, addPlugin } from '../index.js';
|
||||
|
||||
const { expect } = chai;
|
||||
|
||||
describe('applyPlugins', () => {
|
||||
const insertPlugin = () => `-- insertPlugin --`;
|
||||
/**
|
||||
* @template T
|
||||
* @type {import('../types/main.js').MetaPlugin<T>[]}
|
||||
*/
|
||||
const oneExistingPlugin = [{ plugin: () => 'firstPlugin', options: {} }];
|
||||
/**
|
||||
* @template T
|
||||
* @type {import('../types/main.js').MetaPlugin<T>[]}
|
||||
*/
|
||||
const threeExistingPlugin = [
|
||||
{ plugin: () => 'firstPlugin', options: {} },
|
||||
{ plugin: () => 'secondPlugin', options: {} },
|
||||
{ plugin: () => 'thirdPlugin', options: {} },
|
||||
];
|
||||
|
||||
it('converts meta config by executing the plugins and assigning it to the config', async () => {
|
||||
const config = applyPlugins({}, threeExistingPlugin);
|
||||
expect(config.plugins).to.deep.equal(['firstPlugin', 'secondPlugin', 'thirdPlugin']);
|
||||
});
|
||||
|
||||
it('incorporates "setupPlugin" functions in the config & removes "setupPlugins"', async () => {
|
||||
const config = applyPlugins(
|
||||
{
|
||||
setupPlugins: [addPlugin(insertPlugin)],
|
||||
},
|
||||
oneExistingPlugin,
|
||||
);
|
||||
expect(config.plugins).to.deep.equal(['firstPlugin', '-- insertPlugin --']);
|
||||
expect(config.setupPlugins).to.be.undefined;
|
||||
});
|
||||
|
||||
it('a provided plugins property will always win even if it is an empty array', async () => {
|
||||
const config = applyPlugins({
|
||||
setupPlugins: [addPlugin(insertPlugin)],
|
||||
plugins: [],
|
||||
});
|
||||
expect(config.plugins).to.deep.equal([]);
|
||||
expect(config.setupPlugins).to.be.undefined;
|
||||
});
|
||||
|
||||
it('prefers a user set config.plugins', async () => {
|
||||
const config = applyPlugins(
|
||||
{
|
||||
setupPlugins: [addPlugin(insertPlugin)],
|
||||
plugins: ['user-set'],
|
||||
},
|
||||
threeExistingPlugin,
|
||||
);
|
||||
expect(config.plugins).to.deep.equal(['user-set']);
|
||||
expect(config.setupPlugins).to.be.undefined;
|
||||
});
|
||||
|
||||
it('works with classes', async () => {
|
||||
class FirstClass {
|
||||
constructor({ firstName = 'initial-first' } = {}) {
|
||||
this.options = { firstName };
|
||||
}
|
||||
|
||||
render() {
|
||||
return `[[ firstName: ${this.options.firstName} ]]`;
|
||||
}
|
||||
}
|
||||
class SecondClass {
|
||||
constructor({ lastName = 'initial-second' } = {}) {
|
||||
this.options = { lastName };
|
||||
}
|
||||
|
||||
render() {
|
||||
return `[[ lastName: ${this.options.lastName} ]]`;
|
||||
}
|
||||
}
|
||||
|
||||
const config = applyPlugins({
|
||||
setupPlugins: [
|
||||
addPlugin(FirstClass),
|
||||
addPlugin(SecondClass, { lastName: 'set-via-addPlugin' }),
|
||||
],
|
||||
});
|
||||
|
||||
expect(
|
||||
config.plugins.map(/** @param {FirstClass | SecondClass} cls */ cls => cls.render()),
|
||||
).to.deep.equal(['[[ firstName: initial-first ]]', '[[ lastName: set-via-addPlugin ]]']);
|
||||
});
|
||||
});
|
||||
@@ -1,6 +1,6 @@
|
||||
import chai from 'chai';
|
||||
|
||||
import { executeSetupFunctions, addPlugin } from 'plugins-manager';
|
||||
import { executeSetupFunctions, addPlugin } from '../index.js';
|
||||
|
||||
const { expect } = chai;
|
||||
|
||||
@@ -9,27 +9,28 @@ describe('executeSetupFunctions', () => {
|
||||
const secondPlugin = () => 'secondPlugin';
|
||||
const thirdPlugin = () => 'thirdPlugin';
|
||||
|
||||
/**
|
||||
* @template T
|
||||
* @type {import('../types/main.js').MetaPlugin<T>[]}
|
||||
*/
|
||||
const threeExistingPlugin = [
|
||||
{ name: 'first', plugin: firstPlugin },
|
||||
{ name: 'second', plugin: secondPlugin },
|
||||
{ name: 'third', plugin: thirdPlugin },
|
||||
{ plugin: firstPlugin, options: {} },
|
||||
{ plugin: secondPlugin, options: {} },
|
||||
{ plugin: thirdPlugin, options: {} },
|
||||
];
|
||||
|
||||
it('executes and returns a new array not adjusting the original', async () => {
|
||||
const metaPlugins = executeSetupFunctions(
|
||||
[
|
||||
addPlugin({ name: 'add-a', plugin: () => 'a' }),
|
||||
addPlugin({ name: 'add-b', plugin: () => 'b' }),
|
||||
],
|
||||
[addPlugin(() => 'a'), addPlugin(() => 'b')],
|
||||
threeExistingPlugin,
|
||||
);
|
||||
expect(metaPlugins.length).to.equal(5);
|
||||
|
||||
// does not change original array
|
||||
expect(threeExistingPlugin).to.deep.equal([
|
||||
{ name: 'first', plugin: firstPlugin },
|
||||
{ name: 'second', plugin: secondPlugin },
|
||||
{ name: 'third', plugin: thirdPlugin },
|
||||
{ plugin: firstPlugin, options: {} },
|
||||
{ plugin: secondPlugin, options: {} },
|
||||
{ plugin: thirdPlugin, options: {} },
|
||||
]);
|
||||
});
|
||||
});
|
||||
|
||||
@@ -1,43 +0,0 @@
|
||||
import chai from 'chai';
|
||||
|
||||
import { metaConfigToRollupConfig, addPlugin } from 'plugins-manager';
|
||||
|
||||
const { expect } = chai;
|
||||
|
||||
describe('metaConfigToRollupConfig', () => {
|
||||
const insertPlugin = () => `-- insertPlugin --`;
|
||||
const oneExistingPlugin = [{ name: 'first', plugin: () => 'firstPlugin' }];
|
||||
const threeExistingPlugin = [
|
||||
{ name: 'first', plugin: () => 'firstPlugin' },
|
||||
{ name: 'second', plugin: () => 'secondPlugin' },
|
||||
{ name: 'third', plugin: () => 'thirdPlugin' },
|
||||
];
|
||||
|
||||
it('converts meta config by executing the plugins and assigning it to the config', async () => {
|
||||
const config = metaConfigToRollupConfig({}, threeExistingPlugin);
|
||||
expect(config.plugins).to.deep.equal(['firstPlugin', 'secondPlugin', 'thirdPlugin']);
|
||||
});
|
||||
|
||||
it('incorporates "setupPlugin" functions in the config & removes "setupPlugins"', async () => {
|
||||
const config = metaConfigToRollupConfig(
|
||||
{
|
||||
setupPlugins: [addPlugin({ name: 'insert', plugin: insertPlugin })],
|
||||
},
|
||||
oneExistingPlugin,
|
||||
);
|
||||
expect(config.plugins).to.deep.equal(['firstPlugin', '-- insertPlugin --']);
|
||||
expect(config.setupPlugins).to.be.undefined;
|
||||
});
|
||||
|
||||
it('prefers a user set config.plugins', async () => {
|
||||
const config = metaConfigToRollupConfig(
|
||||
{
|
||||
setupPlugins: [addPlugin({ name: 'insert', plugin: insertPlugin })],
|
||||
plugins: ['user-set'],
|
||||
},
|
||||
threeExistingPlugin,
|
||||
);
|
||||
expect(config.plugins).to.deep.equal(['user-set']);
|
||||
expect(config.setupPlugins).to.be.undefined;
|
||||
});
|
||||
});
|
||||
@@ -1,56 +0,0 @@
|
||||
import chai from 'chai';
|
||||
|
||||
import { metaConfigToWebDevServerConfig, addPlugin } from 'plugins-manager';
|
||||
|
||||
const { expect } = chai;
|
||||
|
||||
describe('metaConfigToWebDevServerConfig', () => {
|
||||
const twoExistingPlugin = [
|
||||
{ name: 'first', plugin: () => 'firstPlugin' },
|
||||
{ name: 'second', plugin: () => 'secondPlugin' },
|
||||
];
|
||||
|
||||
it('accepts a rollupWrapperFunction for setupRollupPlugins', async () => {
|
||||
function rollupWrapperFunction(srcFn) {
|
||||
return () => `*wrapped* ${srcFn()}`;
|
||||
}
|
||||
|
||||
const config = metaConfigToWebDevServerConfig(
|
||||
{
|
||||
setupRollupPlugins: [
|
||||
addPlugin({ name: 'third', plugin: () => 'thirdPlugin' }),
|
||||
addPlugin({ name: 'fourth', plugin: () => 'fourthPlugin' }),
|
||||
],
|
||||
setupPlugins: [
|
||||
addPlugin({ name: 'fifth', plugin: () => 'fifthPlugin' }),
|
||||
addPlugin({ name: 'sixth', plugin: () => 'sixthPlugin' }),
|
||||
],
|
||||
},
|
||||
twoExistingPlugin,
|
||||
{ rollupWrapperFunction },
|
||||
);
|
||||
|
||||
expect(config.plugins).to.deep.equal([
|
||||
'firstPlugin',
|
||||
'secondPlugin',
|
||||
'*wrapped* thirdPlugin',
|
||||
'*wrapped* fourthPlugin',
|
||||
'fifthPlugin',
|
||||
'sixthPlugin',
|
||||
]);
|
||||
});
|
||||
|
||||
it('prefers a user set config.plugins', async () => {
|
||||
const config = metaConfigToWebDevServerConfig(
|
||||
{
|
||||
setupPlugins: [addPlugin({ name: 'first', plugin: () => 'firstPlugin' })],
|
||||
setupRollupPlugins: [addPlugin({ name: 'second', plugin: () => 'secondPlugin' })],
|
||||
plugins: ['user-set'],
|
||||
},
|
||||
twoExistingPlugin,
|
||||
);
|
||||
expect(config.plugins).to.deep.equal(['user-set']);
|
||||
expect(config.setupPlugins).to.be.undefined;
|
||||
expect(config.setupRollupPlugins).to.be.undefined;
|
||||
});
|
||||
});
|
||||
39
packages/plugins-manager/test-node/removePlugin.test.js
Normal file
39
packages/plugins-manager/test-node/removePlugin.test.js
Normal file
@@ -0,0 +1,39 @@
|
||||
import chai from 'chai';
|
||||
|
||||
import { removePlugin, applyPlugins } from '../index.js';
|
||||
|
||||
const { expect } = chai;
|
||||
|
||||
describe('removePlugin', () => {
|
||||
const firstPlugin = () => 'firstPlugin';
|
||||
const secondPlugin = () => 'secondPlugin';
|
||||
const thirdPlugin = () => 'thirdPlugin';
|
||||
const fourthPlugin = () => 'fourthPlugin';
|
||||
|
||||
const defaultCurrentMetaPlugins = [
|
||||
{ plugin: firstPlugin, options: {} },
|
||||
{ plugin: secondPlugin, options: {} },
|
||||
{ plugin: thirdPlugin, options: {} },
|
||||
];
|
||||
function newCurrentMetaPlugins() {
|
||||
return defaultCurrentMetaPlugins.map(obj => ({ ...obj }));
|
||||
}
|
||||
|
||||
it('removes a plugin', async () => {
|
||||
const config = applyPlugins(
|
||||
{
|
||||
setupPlugins: [removePlugin(secondPlugin)],
|
||||
},
|
||||
newCurrentMetaPlugins(),
|
||||
);
|
||||
expect(config.plugins).to.deep.equal(['firstPlugin', 'thirdPlugin']);
|
||||
});
|
||||
|
||||
it('throws if given plugin does not exist', async () => {
|
||||
expect(() => {
|
||||
applyPlugins({
|
||||
setupPlugins: [removePlugin(fourthPlugin)],
|
||||
});
|
||||
}).to.throw('Could not find a plugin with the name "fourthPlugin" to remove.');
|
||||
});
|
||||
});
|
||||
37
packages/plugins-manager/types/main.d.ts
vendored
37
packages/plugins-manager/types/main.d.ts
vendored
@@ -1,24 +1,25 @@
|
||||
// using `{}` as the default type for Constructor is a well-established pattern which we'll adopt here
|
||||
// eslint-disable-next-line @typescript-eslint/ban-types
|
||||
type Constructor<T = {}> = { new (...args: any[]): T };
|
||||
type AnyFn = (...args: any[]) => any;
|
||||
type Plugin = Constructor | AnyFn;
|
||||
|
||||
export interface MetaPlugin<F = AnyFn> {
|
||||
name: string;
|
||||
plugin: F extends (options?: infer O) => unknown ? F : any;
|
||||
options?: /* prettier-ignore */ (
|
||||
F extends (eleventyConfig: any, options?: infer O) => void ? O
|
||||
: F extends (options: infer O) => unknown ? O
|
||||
: any
|
||||
);
|
||||
export type GetPluginOptions<T> = T extends Constructor
|
||||
? ConstructorParameters<T>[0]
|
||||
: T extends AnyFn
|
||||
? Parameters<T>[0]
|
||||
: Partial<T>;
|
||||
|
||||
export interface MetaPlugin<T> {
|
||||
plugin: Plugin;
|
||||
options: GetPluginOptions<T>;
|
||||
}
|
||||
|
||||
export interface MetaPluginWrapable extends MetaPlugin {
|
||||
__noWrap?: boolean;
|
||||
}
|
||||
|
||||
export type AddPluginOptions<T> = MetaPlugin<T> & {
|
||||
export interface ManagerOptions {
|
||||
how?: 'after' | 'before' | 'fixed';
|
||||
location?: 'top' | 'bottom' | string;
|
||||
};
|
||||
location?: 'top' | 'bottom' | Plugin;
|
||||
}
|
||||
|
||||
export type AddPluginFn = (plugins: MetaPlugin[]) => MetaPlugin[];
|
||||
|
||||
export type AddPluginType = <F>(metaPluginAndOptions: AddPluginOptions<F>) => AddPluginFn;
|
||||
export type adjustPluginOptionsOptions<T> =
|
||||
| GetPluginOptions<T>
|
||||
| ((options: GetPluginOptions<T>) => GetPluginOptions<T>);
|
||||
|
||||
@@ -1,5 +1,38 @@
|
||||
# @rocket/search
|
||||
|
||||
## 0.5.1
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- 445b028: Update to latest lit, @open-wc, @lion packages
|
||||
|
||||
## 0.5.0
|
||||
|
||||
### Minor Changes
|
||||
|
||||
- 70bb7a1: BREAKING CHANGE: Update to latest plugins manager to get type safe options
|
||||
|
||||
There is no longer a name string as a key for a plugin. It is identified by it's function/class. You will need to adjust your code if you are adding or adjusting plugins.
|
||||
|
||||
```diff
|
||||
- addPlugin({ name: 'my-plugin', plugin: myPlugin, options: { myFlag: true }, location: 'top' });
|
||||
+ addPlugin(myPlugin, { myFlag: true }, { location: 'top' });
|
||||
- adjustPluginOptions('my-plugin', { myFlag: true });
|
||||
+ adjustPluginOptions(myPlugin, { myFlag: true });
|
||||
```
|
||||
|
||||
For more details please see the [Changelog](https://github.com/modernweb-dev/rocket/blob/main/packages/plugins-manager/CHANGELOG.md#030) of the plugins-manager package.
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- Updated dependencies [70bb7a1]
|
||||
- Updated dependencies [70bb7a1]
|
||||
- Updated dependencies [70bb7a1]
|
||||
- Updated dependencies [70bb7a1]
|
||||
- Updated dependencies [70bb7a1]
|
||||
- Updated dependencies [70bb7a1]
|
||||
- plugins-manager@0.3.0
|
||||
|
||||
## 0.4.1
|
||||
|
||||
### Patch Changes
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@rocket/search",
|
||||
"version": "0.4.1",
|
||||
"version": "0.5.1",
|
||||
"publishConfig": {
|
||||
"access": "public"
|
||||
},
|
||||
@@ -42,13 +42,13 @@
|
||||
"search"
|
||||
],
|
||||
"dependencies": {
|
||||
"@lion/combobox": "^0.8.0",
|
||||
"@lion/core": "^0.18.0",
|
||||
"@lion/listbox": "^0.10.1",
|
||||
"@open-wc/scoped-elements": "^2.0.0-next.3",
|
||||
"@lion/combobox": "^0.8.6",
|
||||
"@lion/core": "^0.19.0",
|
||||
"@lion/listbox": "^0.10.7",
|
||||
"@open-wc/scoped-elements": "^2.0.0",
|
||||
"chalk": "^4.0.0",
|
||||
"minisearch": "^3.0.2",
|
||||
"plugins-manager": "^0.2.4",
|
||||
"plugins-manager": "^0.3.0",
|
||||
"sax-wasm": "^2.0.0"
|
||||
},
|
||||
"customElements": "custom-elements.json"
|
||||
|
||||
@@ -8,6 +8,6 @@ const __dirname = path.dirname(fileURLToPath(import.meta.url));
|
||||
export function rocketSearch() {
|
||||
return {
|
||||
path: path.resolve(__dirname),
|
||||
setupCliPlugins: [addPlugin({ name: 'rocket-search', plugin: RocketSearchPlugin })],
|
||||
setupCliPlugins: [addPlugin(RocketSearchPlugin)],
|
||||
};
|
||||
}
|
||||
|
||||
@@ -189,7 +189,7 @@ export class RocketSearchCombobox extends LionCombobox {
|
||||
}
|
||||
|
||||
static get properties() {
|
||||
return /** @type {typeof LionCombobox['properties'] & { showInput: import("lit-element").PropertyDeclaration } } */ ({
|
||||
return /** @type {typeof LionCombobox['properties'] & { showInput: import("lit").PropertyDeclaration } } */ ({
|
||||
showInput: { type: Boolean, reflect: true, attribute: 'show-input' },
|
||||
});
|
||||
}
|
||||
|
||||
@@ -3,8 +3,10 @@ import { rocketBlog } from '@rocket/blog';
|
||||
import { rocketSearch } from '@rocket/search';
|
||||
import { absoluteBaseUrlNetlify } from '@rocket/core/helpers';
|
||||
import { adjustPluginOptions } from 'plugins-manager';
|
||||
import { codeTabs } from 'rocket-preset-code-tabs';
|
||||
import { customElementsManifest } from 'rocket-preset-custom-elements-manifest';
|
||||
import { mdjsSetupCode } from '@mdjs/core';
|
||||
// TODO: preset needs to be updated to use the new plugin manager
|
||||
// import { codeTabs } from 'rocket-preset-code-tabs';
|
||||
// import { customElementsManifest } from 'rocket-preset-custom-elements-manifest';
|
||||
|
||||
/** @type {import('./packages/cli/types/main').RocketCliOptions} */
|
||||
export default {
|
||||
@@ -14,20 +16,20 @@ export default {
|
||||
rocketLaunch(),
|
||||
rocketBlog(),
|
||||
rocketSearch(),
|
||||
codeTabs({
|
||||
collections: {
|
||||
packageManagers: {
|
||||
npm: { label: 'NPM', iconHref: '/_merged_assets/_static/logos/npm.svg' },
|
||||
yarn: { label: 'Yarn', iconHref: '/_merged_assets/_static/logos/yarn.svg' },
|
||||
pnpm: { label: 'PNPM', iconHref: '/_merged_assets/_static/logos/pnpm.svg' },
|
||||
},
|
||||
},
|
||||
}),
|
||||
customElementsManifest(),
|
||||
// codeTabs({
|
||||
// collections: {
|
||||
// packageManagers: {
|
||||
// npm: { label: 'NPM', iconHref: '/_merged_assets/_static/logos/npm.svg' },
|
||||
// yarn: { label: 'Yarn', iconHref: '/_merged_assets/_static/logos/yarn.svg' },
|
||||
// pnpm: { label: 'PNPM', iconHref: '/_merged_assets/_static/logos/pnpm.svg' },
|
||||
// },
|
||||
// },
|
||||
// }),
|
||||
// customElementsManifest(),
|
||||
],
|
||||
|
||||
setupUnifiedPlugins: [
|
||||
adjustPluginOptions('mdjsSetupCode', {
|
||||
adjustPluginOptions(mdjsSetupCode, {
|
||||
simulationSettings: {
|
||||
simulatorUrl: '/simulator/',
|
||||
themes: [
|
||||
|
||||
@@ -40,7 +40,7 @@ function compareVersions(versionsA, versionsB) {
|
||||
versionsA[dep] &&
|
||||
versionsB[dep] &&
|
||||
versionsA[dep] !== versionsB[dep] &&
|
||||
!semver.satisfies(versionsA[dep], versionsB[dep])
|
||||
!semver.intersects(versionsA[dep], versionsB[dep])
|
||||
) {
|
||||
output += ` - "${dep}" should be "${versionsA[dep]}" but is "${versionsB[dep]}"\n`;
|
||||
}
|
||||
|
||||
602
yarn.lock
602
yarn.lock
@@ -1130,93 +1130,70 @@
|
||||
dependencies:
|
||||
"@types/chai" "^4.2.12"
|
||||
|
||||
"@lion/accordion@^0.6.1":
|
||||
version "0.6.1"
|
||||
resolved "https://registry.yarnpkg.com/@lion/accordion/-/accordion-0.6.1.tgz#fe10e9e7cc540a10ad4d87f8421e436f6110f026"
|
||||
integrity sha512-0s+puCY2yfCingyjzBZN+g2mpRZ8h8w470ZKmF4oTHitCFdT41kb5tfOHo57SStSLjqET3Qq8FAvFs1KBPMGqg==
|
||||
"@lion/accordion@^0.7.2":
|
||||
version "0.7.2"
|
||||
resolved "https://registry.yarnpkg.com/@lion/accordion/-/accordion-0.7.2.tgz#c60c149ddca0d2fea826868f209c7e2b12dd9afa"
|
||||
integrity sha512-oIKizAXwemVDW1rEKXSXT6KZhEJemQuFrUrNhQZPQaDDyb1K05wV8FIfquE0mNyo6xk69+bqv5O2G89nDwfIkQ==
|
||||
dependencies:
|
||||
"@lion/core" "0.18.1"
|
||||
"@lion/core" "0.19.0"
|
||||
|
||||
"@lion/combobox@^0.8.0":
|
||||
version "0.8.0"
|
||||
resolved "https://registry.yarnpkg.com/@lion/combobox/-/combobox-0.8.0.tgz#ef60cfcfa55b659033900615efb207dd80708320"
|
||||
integrity sha512-qjudhZ/UAbvPjJavWT/VZt9t76Xa0MFaqRnmX7Ga0acJhm29vtMi4r5BqniF/JfCucXz5ya3oFYNqxkOQcWReA==
|
||||
"@lion/combobox@^0.8.6":
|
||||
version "0.8.6"
|
||||
resolved "https://registry.yarnpkg.com/@lion/combobox/-/combobox-0.8.6.tgz#746028d0cd9f468dfc35cf2dfbdb603367f4e281"
|
||||
integrity sha512-24hm557YTdwK5/CShfgM6VqQD3uATyghU3JZq9rdzVQl2Ff+Sd2wp4zMEKWtKGnSbWPQNdrCn7kdNv7bF54PVg==
|
||||
dependencies:
|
||||
"@lion/core" "0.18.0"
|
||||
"@lion/form-core" "0.14.1"
|
||||
"@lion/listbox" "0.10.1"
|
||||
"@lion/overlays" "0.28.1"
|
||||
"@lion/core" "0.19.0"
|
||||
"@lion/form-core" "0.15.4"
|
||||
"@lion/listbox" "0.10.7"
|
||||
"@lion/overlays" "0.29.1"
|
||||
|
||||
"@lion/core@0.16.0":
|
||||
version "0.16.0"
|
||||
resolved "https://registry.yarnpkg.com/@lion/core/-/core-0.16.0.tgz#c4c8ac81b8d5bece6d40d561a392382c7ae73533"
|
||||
integrity sha512-/MB/G44fZtL+s8iX1GAnyjw+Drn+fROkA13BpTn808UrDMGQ+WW1oq67Wp9Hr+t34LB3ghH3tm7afniDMa1VCA==
|
||||
"@lion/core@0.19.0", "@lion/core@^0.19.0":
|
||||
version "0.19.0"
|
||||
resolved "https://registry.yarnpkg.com/@lion/core/-/core-0.19.0.tgz#4bf86059acd0ef3f74e6d0689250edc4d6664836"
|
||||
integrity sha512-SU2JzKEgGdwOVK9WdsmjKiYkgQ/hOYC05jxyHfG9qJWmOzEUsuvvULjwU8hd1u7gLy5gSxsdEO2nJ2zyWV2ihg==
|
||||
dependencies:
|
||||
"@open-wc/dedupe-mixin" "^1.2.18"
|
||||
"@open-wc/scoped-elements" "^1.3.3"
|
||||
lit-element "~2.4.0"
|
||||
lit-html "^1.3.0"
|
||||
"@open-wc/dedupe-mixin" "^1.3.0"
|
||||
"@open-wc/scoped-elements" "^2.0.1"
|
||||
lit "^2.0.2"
|
||||
|
||||
"@lion/core@0.18.0", "@lion/core@^0.18.0":
|
||||
version "0.18.0"
|
||||
resolved "https://registry.yarnpkg.com/@lion/core/-/core-0.18.0.tgz#475b872407829ab7860f50ff771c2e5ee957b204"
|
||||
integrity sha512-tfSKvd/YvGY8JPqb3Nv4TV85nzgeXOxXfnnNVpAGGC0yoRK9jKR4FvRdqDROenbPsfPOVz9+uL/2fd+GJl6qKg==
|
||||
"@lion/form-core@0.15.4":
|
||||
version "0.15.4"
|
||||
resolved "https://registry.yarnpkg.com/@lion/form-core/-/form-core-0.15.4.tgz#e5fdc49199b9a491becf70370ab6de1407bc7a66"
|
||||
integrity sha512-QkTl0c1BS2Egd2gTHTnfIfvvv3Ywkh1+6mDfEelIQOoptf84AFGw5OdVoMPqrAk0gYUkm8YvdpTZSzh3mMANiQ==
|
||||
dependencies:
|
||||
"@open-wc/dedupe-mixin" "^1.2.18"
|
||||
"@open-wc/scoped-elements" "^2.0.0-next.3"
|
||||
lit "^2.0.0-rc.2"
|
||||
"@lion/core" "0.19.0"
|
||||
"@lion/localize" "0.21.3"
|
||||
|
||||
"@lion/core@0.18.1":
|
||||
version "0.18.1"
|
||||
resolved "https://registry.yarnpkg.com/@lion/core/-/core-0.18.1.tgz#cacad48bdc7c1382148f208c7feff8ec2dbb4263"
|
||||
integrity sha512-eazXRm6oqxOJXEf95bVbBVsOFxUA63yEtf8MHHd6cmJEIIWn7VQS8gq4fVe4jydyP6aOHccZSIom5zuQBOpkyg==
|
||||
"@lion/listbox@0.10.7", "@lion/listbox@^0.10.7":
|
||||
version "0.10.7"
|
||||
resolved "https://registry.yarnpkg.com/@lion/listbox/-/listbox-0.10.7.tgz#9af689615ea0964e4a5613c3e5b2df9b33fc2d54"
|
||||
integrity sha512-hCVWnYsJv/det/+o5LHPd5w3f5mXiRE1q0ZVf+Hat5lvcHiHXfKnlrKaB2DzMqqL9y9k4ZG7feyQZlNE5PLNrQ==
|
||||
dependencies:
|
||||
"@open-wc/dedupe-mixin" "^1.2.18"
|
||||
"@open-wc/scoped-elements" "^2.0.0-next.3"
|
||||
lit "^2.0.0-rc.2"
|
||||
"@lion/core" "0.19.0"
|
||||
"@lion/form-core" "0.15.4"
|
||||
|
||||
"@lion/form-core@0.14.1":
|
||||
version "0.14.1"
|
||||
resolved "https://registry.yarnpkg.com/@lion/form-core/-/form-core-0.14.1.tgz#404e047e32ea56ae5318db6444809cf83089d5f3"
|
||||
integrity sha512-WQQASer/vv0dyaxdp4nK2M+SqosCdk2JIyvShMmo9aqsTtUlKfyof/JszHj1e5pkydGHqC4x7ehN3gx4UiDk2g==
|
||||
dependencies:
|
||||
"@lion/core" "0.18.0"
|
||||
"@lion/localize" "0.20.1"
|
||||
|
||||
"@lion/listbox@0.10.1", "@lion/listbox@^0.10.1":
|
||||
version "0.10.1"
|
||||
resolved "https://registry.yarnpkg.com/@lion/listbox/-/listbox-0.10.1.tgz#c6a6e4cebc4f76386c1261faf582c46e58f41a37"
|
||||
integrity sha512-WrQ1/BiaEo3TBAQgFuRxqHTYlhLD4BZxp73Itlf9ooH6p/NlRsYKlppPfzWmhtoc7uJRbc9PDoo2krxvMFKxfA==
|
||||
dependencies:
|
||||
"@lion/core" "0.18.0"
|
||||
"@lion/form-core" "0.14.1"
|
||||
|
||||
"@lion/localize@0.20.1":
|
||||
version "0.20.1"
|
||||
resolved "https://registry.yarnpkg.com/@lion/localize/-/localize-0.20.1.tgz#92b3e795b1cec1cffeac8e54ed9a19ad6fc934fc"
|
||||
integrity sha512-su55r7wsNAYUl0s5J2ySv6KThIKAXt76nA/6OkCFGTS5e4LClCenqvK6jrhpGQKZ29I4OW4XQMFXTu/XlaKNMQ==
|
||||
"@lion/localize@0.21.3":
|
||||
version "0.21.3"
|
||||
resolved "https://registry.yarnpkg.com/@lion/localize/-/localize-0.21.3.tgz#6ed63aa79d4a6df37536d8be8d03d11b855c32b6"
|
||||
integrity sha512-BXFuKYYM+XABlULS8tLddj1TviRHK0Bm1AR6cOrdStv8vSrTK9szV63c5Ybl+kD6QstBSQ4qNwbjd3hAIJVGhQ==
|
||||
dependencies:
|
||||
"@bundled-es-modules/message-format" "6.0.4"
|
||||
"@lion/core" "0.18.0"
|
||||
"@lion/core" "0.19.0"
|
||||
singleton-manager "1.4.2"
|
||||
|
||||
"@lion/overlays@0.28.1":
|
||||
version "0.28.1"
|
||||
resolved "https://registry.yarnpkg.com/@lion/overlays/-/overlays-0.28.1.tgz#08f0d781a45208c7beef2730c66f42b571d49ab8"
|
||||
integrity sha512-MiEkGtPIUHewGqay3VI++S6UXcTrSLt2Or0RxYFZfS64PIPMRPmKKsyW8xiouuKXWGV7vafP7apAauP8CxaY+g==
|
||||
"@lion/overlays@0.29.1", "@lion/overlays@^0.29.1":
|
||||
version "0.29.1"
|
||||
resolved "https://registry.yarnpkg.com/@lion/overlays/-/overlays-0.29.1.tgz#0e2cff719d119a89a09cc7adc9baea1579dab022"
|
||||
integrity sha512-MtoPavlnSVbisPPK+VPOyvekE5STHOH3GubC63danjVbMC9Nf927kzLT19l89JPxseejpU0fXHSdz7PVhNGgIA==
|
||||
dependencies:
|
||||
"@lion/core" "0.18.0"
|
||||
"@lion/core" "0.19.0"
|
||||
"@popperjs/core" "^2.5.4"
|
||||
singleton-manager "1.4.2"
|
||||
|
||||
"@lion/overlays@^0.26.1":
|
||||
version "0.26.1"
|
||||
resolved "https://registry.yarnpkg.com/@lion/overlays/-/overlays-0.26.1.tgz#d1bfa4f5f97108982afa7b409ba4300f8b2d2ba5"
|
||||
integrity sha512-1FvphbR/yTQ1WtcB1gNuH772i9qAydQkI6NwibIw8QeOGXisA+6SChv2OHS7CijlpDJnDxNyX44LGdDM1/Pd8A==
|
||||
dependencies:
|
||||
"@lion/core" "0.16.0"
|
||||
"@popperjs/core" "^2.5.4"
|
||||
singleton-manager "1.4.1"
|
||||
"@lit/reactive-element@^1.0.0":
|
||||
version "1.0.2"
|
||||
resolved "https://registry.yarnpkg.com/@lit/reactive-element/-/reactive-element-1.0.2.tgz#daa7a7c7a6c63d735f0c9634de6b7dbd70a702ab"
|
||||
integrity sha512-oz3d3MKjQ2tXynQgyaQaMpGTDNyNDeBdo6dXf1AbjTwhA1IRINHmA7kSaVYv9ttKweNkEoNqp9DqteDdgWzPEg==
|
||||
|
||||
"@lit/reactive-element@^1.0.0-rc.1", "@lit/reactive-element@^1.0.0-rc.2":
|
||||
version "1.0.0-rc.2"
|
||||
@@ -1273,18 +1250,19 @@
|
||||
"@open-wc/semantic-dom-diff" "^0.13.16"
|
||||
"@types/chai" "^4.1.7"
|
||||
|
||||
"@open-wc/dedupe-mixin@^1.2.18", "@open-wc/dedupe-mixin@^1.3.0":
|
||||
"@open-wc/dedupe-mixin@^1.3.0":
|
||||
version "1.3.0"
|
||||
resolved "https://registry.yarnpkg.com/@open-wc/dedupe-mixin/-/dedupe-mixin-1.3.0.tgz#0df5d438285fc3482838786ee81895318f0ff778"
|
||||
integrity sha512-UfdK1MPnR6T7f3svzzYBfu3qBkkZ/KsPhcpc3JYhsUY4hbpwNF9wEQtD4Z+/mRqMTJrKg++YSxIxE0FBhY3RIw==
|
||||
|
||||
"@open-wc/scoped-elements@^1.3.3":
|
||||
version "1.3.3"
|
||||
resolved "https://registry.yarnpkg.com/@open-wc/scoped-elements/-/scoped-elements-1.3.3.tgz#fe008aef4d74fb00c553c900602960638fc1c7b0"
|
||||
integrity sha512-vFIQVYYjFw67odUE4JzZOpctnF7S/2DX+S+clrL3bQPql7HvEnV0wMFwOWUavQTuCJi0rfU8GTcNMiUybio+Yg==
|
||||
"@open-wc/scoped-elements@^2.0.0", "@open-wc/scoped-elements@^2.0.1":
|
||||
version "2.0.1"
|
||||
resolved "https://registry.yarnpkg.com/@open-wc/scoped-elements/-/scoped-elements-2.0.1.tgz#6b1c3535f809bd90710574db80093a81e3a1fc2d"
|
||||
integrity sha512-JS6ozxUFwFX3+Er91v9yQzNIaFn7OnE0iESKTbFvkkKdNwvAPtp1fpckBKIvWk8Ae9ZcoI9DYZuT2DDbMPcadA==
|
||||
dependencies:
|
||||
"@lit/reactive-element" "^1.0.0"
|
||||
"@open-wc/dedupe-mixin" "^1.3.0"
|
||||
lit-html "^1.0.0"
|
||||
"@webcomponents/scoped-custom-element-registry" "^0.0.3"
|
||||
|
||||
"@open-wc/scoped-elements@^2.0.0-next.0":
|
||||
version "2.0.0-next.3"
|
||||
@@ -1295,15 +1273,6 @@
|
||||
"@open-wc/dedupe-mixin" "^1.3.0"
|
||||
"@webcomponents/scoped-custom-element-registry" "0.0.1"
|
||||
|
||||
"@open-wc/scoped-elements@^2.0.0-next.3":
|
||||
version "2.0.0-next.4"
|
||||
resolved "https://registry.yarnpkg.com/@open-wc/scoped-elements/-/scoped-elements-2.0.0-next.4.tgz#d8294358e3e8ad2ba44200ab805549fde49245f6"
|
||||
integrity sha512-BMd5n5BHLi3FBhwhPbBuN7pZdi8I1CIQn10aKLZtg9aplVhN2BG1rwr0ANebXJ6fdq8m1PE1wQAaCXYCcEBTEQ==
|
||||
dependencies:
|
||||
"@lit/reactive-element" "^1.0.0-rc.1"
|
||||
"@open-wc/dedupe-mixin" "^1.3.0"
|
||||
"@webcomponents/scoped-custom-element-registry" "0.0.2"
|
||||
|
||||
"@open-wc/semantic-dom-diff@^0.13.16":
|
||||
version "0.13.21"
|
||||
resolved "https://registry.yarnpkg.com/@open-wc/semantic-dom-diff/-/semantic-dom-diff-0.13.21.tgz#718b9ec5f9a98935fc775e577ad094ae8d8b7dea"
|
||||
@@ -1475,6 +1444,11 @@
|
||||
resolved "https://registry.yarnpkg.com/@types/babel-types/-/babel-types-7.0.9.tgz#01d7b86949f455402a94c788883fe4ba574cad41"
|
||||
integrity sha512-qZLoYeXSTgQuK1h7QQS16hqLGdmqtRmN8w/rl3Au/l5x/zkHx+a4VHrHyBsi1I1vtK2oBHxSzKIu0R5p6spdOA==
|
||||
|
||||
"@types/babel__code-frame@^7.0.2":
|
||||
version "7.0.3"
|
||||
resolved "https://registry.yarnpkg.com/@types/babel__code-frame/-/babel__code-frame-7.0.3.tgz#eda94e1b7c9326700a4b69c485ebbc9498a0b63f"
|
||||
integrity sha512-2TN6oiwtNjOezilFVl77zwdNPwQWaDBBCCWWxyo1ctiO3vAtd7H/aB/CBJdw9+kqq3+latD0SXoedIuHySSZWw==
|
||||
|
||||
"@types/babylon@^6.16.2":
|
||||
version "6.16.5"
|
||||
resolved "https://registry.yarnpkg.com/@types/babylon/-/babylon-6.16.5.tgz#1c5641db69eb8cdf378edd25b4be7754beeb48b4"
|
||||
@@ -1507,6 +1481,14 @@
|
||||
resolved "https://registry.yarnpkg.com/@types/chai/-/chai-4.2.18.tgz#0c8e298dbff8205e2266606c1ea5fbdba29b46e4"
|
||||
integrity sha512-rS27+EkB/RE1Iz3u0XtVL5q36MGDWbgYe7zWiodyKNUnthxY0rukK5V36eiUCtCisB7NN8zKYH6DO2M37qxFEQ==
|
||||
|
||||
"@types/co-body@^6.1.0":
|
||||
version "6.1.0"
|
||||
resolved "https://registry.yarnpkg.com/@types/co-body/-/co-body-6.1.0.tgz#b52625390eb0d113c9b697ea92c3ffae7740cdb9"
|
||||
integrity sha512-3e0q2jyDAnx/DSZi0z2H0yoZ2wt5yRDZ+P7ymcMObvq0ufWRT4tsajyO+Q1VwVWiv9PRR4W3YEjEzBjeZlhF+w==
|
||||
dependencies:
|
||||
"@types/node" "*"
|
||||
"@types/qs" "*"
|
||||
|
||||
"@types/command-line-args@^5.0.0":
|
||||
version "5.0.0"
|
||||
resolved "https://registry.yarnpkg.com/@types/command-line-args/-/command-line-args-5.0.0.tgz#484e704d20dbb8754a8f091eee45cdd22bcff28c"
|
||||
@@ -1524,6 +1506,11 @@
|
||||
resolved "https://registry.yarnpkg.com/@types/content-disposition/-/content-disposition-0.5.3.tgz#0aa116701955c2faa0717fc69cd1596095e49d96"
|
||||
integrity sha512-P1bffQfhD3O4LW0ioENXUhZ9OIa0Zn+P7M+pWgkCKaT53wVLSq0mrKksCID/FGHpFhRSxRGhgrQmfhRuzwtKdg==
|
||||
|
||||
"@types/convert-source-map@^1.5.1":
|
||||
version "1.5.2"
|
||||
resolved "https://registry.yarnpkg.com/@types/convert-source-map/-/convert-source-map-1.5.2.tgz#318dc22d476632a4855594c16970c6dc3ed086e7"
|
||||
integrity sha512-tHs++ZeXer40kCF2JpE51Hg7t4HPa18B1b1Dzy96S0eCw8QKECNMYMfwa1edK/x8yCN0r4e6ewvLcc5CsVGkdg==
|
||||
|
||||
"@types/cookies@*":
|
||||
version "0.7.6"
|
||||
resolved "https://registry.yarnpkg.com/@types/cookies/-/cookies-0.7.6.tgz#71212c5391a976d3bae57d4b09fac20fc6bda504"
|
||||
@@ -1534,6 +1521,11 @@
|
||||
"@types/keygrip" "*"
|
||||
"@types/node" "*"
|
||||
|
||||
"@types/debounce@^1.2.0":
|
||||
version "1.2.1"
|
||||
resolved "https://registry.yarnpkg.com/@types/debounce/-/debounce-1.2.1.tgz#79b65710bc8b6d44094d286aecf38e44f9627852"
|
||||
integrity sha512-epMsEE85fi4lfmJUH/89/iV/LI+F5CvNIvmgs5g5jYFPfhO2S/ae8WSsLOKWdwtoaZw9Q2IhJ4tQ5tFCcS/4HA==
|
||||
|
||||
"@types/debug@^4.0.0":
|
||||
version "4.1.6"
|
||||
resolved "https://registry.yarnpkg.com/@types/debug/-/debug-4.1.6.tgz#0b7018723084918a865eff99249c490505df2163"
|
||||
@@ -1600,11 +1592,25 @@
|
||||
resolved "https://registry.yarnpkg.com/@types/http-errors/-/http-errors-1.8.0.tgz#682477dbbbd07cd032731cb3b0e7eaee3d026b69"
|
||||
integrity sha512-2aoSC4UUbHDj2uCsCxcG/vRMXey/m17bC7UwitVm5hn22nI8O8Y9iDpA76Orc+DWkQ4zZrOKEshCqR/jSuXAHA==
|
||||
|
||||
"@types/istanbul-lib-coverage@^2.0.1":
|
||||
"@types/istanbul-lib-coverage@*", "@types/istanbul-lib-coverage@^2.0.1", "@types/istanbul-lib-coverage@^2.0.3":
|
||||
version "2.0.3"
|
||||
resolved "https://registry.yarnpkg.com/@types/istanbul-lib-coverage/-/istanbul-lib-coverage-2.0.3.tgz#4ba8ddb720221f432e443bd5f9117fd22cfd4762"
|
||||
integrity sha512-sz7iLqvVUg1gIedBOvlkxPlc8/uVzyS5OwGz1cKjXzkl3FpL3al0crU8YGU1WoHkxn0Wxbw5tyi6hvzJKNzFsw==
|
||||
|
||||
"@types/istanbul-lib-report@*":
|
||||
version "3.0.0"
|
||||
resolved "https://registry.yarnpkg.com/@types/istanbul-lib-report/-/istanbul-lib-report-3.0.0.tgz#c14c24f18ea8190c118ee7562b7ff99a36552686"
|
||||
integrity sha512-plGgXAPfVKFoYfa9NpYDAkseG+g6Jr294RqeqcqDixSbU34MZVJRi/P+7Y8GDpzkEwLaGZZOpKIEmeVZNtKsrg==
|
||||
dependencies:
|
||||
"@types/istanbul-lib-coverage" "*"
|
||||
|
||||
"@types/istanbul-reports@^3.0.0":
|
||||
version "3.0.1"
|
||||
resolved "https://registry.yarnpkg.com/@types/istanbul-reports/-/istanbul-reports-3.0.1.tgz#9153fe98bba2bd565a63add9436d6f0d7f8468ff"
|
||||
integrity sha512-c3mAZEuK0lvBp8tmuL74XRKn1+y2dcwOUpH7x4WrF6gk1GIgiluDRgMYQtw2OFcBvAJWlt6ASU3tSqxp0Uu0Aw==
|
||||
dependencies:
|
||||
"@types/istanbul-lib-report" "*"
|
||||
|
||||
"@types/json-schema@^7.0.3":
|
||||
version "7.0.6"
|
||||
resolved "https://registry.yarnpkg.com/@types/json-schema/-/json-schema-7.0.6.tgz#f4c7ec43e81b319a9815115031709f26987891f0"
|
||||
@@ -1705,6 +1711,11 @@
|
||||
resolved "https://registry.yarnpkg.com/@types/parse5/-/parse5-5.0.3.tgz#e7b5aebbac150f8b5fdd4a46e7f0bd8e65e19109"
|
||||
integrity sha512-kUNnecmtkunAoQ3CnjmMkzNU/gtxG8guhi+Fk2U/kOpIKjIMKnXGp4IJCgQJrXSgMsWYimYG4TGjz/UzbGEBTw==
|
||||
|
||||
"@types/parse5@^6.0.1":
|
||||
version "6.0.1"
|
||||
resolved "https://registry.yarnpkg.com/@types/parse5/-/parse5-6.0.1.tgz#f8ae4fbcd2b9ba4ff934698e28778961f9cb22ca"
|
||||
integrity sha512-ARATsLdrGPUnaBvxLhUlnltcMgn7pQG312S8ccdYlnyijabrX9RN/KN/iGj9Am96CoW8e/K9628BA7Bv4XHdrA==
|
||||
|
||||
"@types/qs@*":
|
||||
version "6.9.5"
|
||||
resolved "https://registry.yarnpkg.com/@types/qs/-/qs-6.9.5.tgz#434711bdd49eb5ee69d90c1d67c354a9a8ecb18b"
|
||||
@@ -1767,6 +1778,11 @@
|
||||
resolved "https://registry.yarnpkg.com/@types/trusted-types/-/trusted-types-1.0.6.tgz#569b8a08121d3203398290d602d84d73c8dcf5da"
|
||||
integrity sha512-230RC8sFeHoT6sSUlRO6a8cAnclO06eeiq1QDfiv2FGCLWFvvERWgwIQD4FWqD9A69BN7Lzee4OXwoMVnnsWDw==
|
||||
|
||||
"@types/trusted-types@^2.0.2":
|
||||
version "2.0.2"
|
||||
resolved "https://registry.yarnpkg.com/@types/trusted-types/-/trusted-types-2.0.2.tgz#fc25ad9943bcac11cceb8168db4f275e0e72e756"
|
||||
integrity sha512-F5DIZ36YVLE+PN+Zwws4kJogq47hNgX3Nx6WyDJ3kcplxyke3XIzB8uK5n/Lpm1HBsbGzd6nmGehL8cPekP+Tg==
|
||||
|
||||
"@types/unist@*", "@types/unist@^2.0.0", "@types/unist@^2.0.2", "@types/unist@^2.0.3":
|
||||
version "2.0.3"
|
||||
resolved "https://registry.yarnpkg.com/@types/unist/-/unist-2.0.3.tgz#9c088679876f374eb5983f150d4787aa6fb32d7e"
|
||||
@@ -1869,6 +1885,13 @@
|
||||
dependencies:
|
||||
errorstacks "^2.2.0"
|
||||
|
||||
"@web/browser-logs@^0.2.1":
|
||||
version "0.2.5"
|
||||
resolved "https://registry.yarnpkg.com/@web/browser-logs/-/browser-logs-0.2.5.tgz#0895efb641eacb0fbc1138c6092bd18c01df2734"
|
||||
integrity sha512-Qxo1wY/L7yILQqg0jjAaueh+tzdORXnZtxQgWH23SsTCunz9iq9FvsZa8Q5XlpjnZ3vLIsFEuEsCMqFeohJnEg==
|
||||
dependencies:
|
||||
errorstacks "^2.2.0"
|
||||
|
||||
"@web/config-loader@^0.1.3":
|
||||
version "0.1.3"
|
||||
resolved "https://registry.yarnpkg.com/@web/config-loader/-/config-loader-0.1.3.tgz#8325ea54f75ef2ee7166783e64e66936db25bff7"
|
||||
@@ -1876,6 +1899,30 @@
|
||||
dependencies:
|
||||
semver "^7.3.4"
|
||||
|
||||
"@web/dev-server-core@^0.3.16":
|
||||
version "0.3.16"
|
||||
resolved "https://registry.yarnpkg.com/@web/dev-server-core/-/dev-server-core-0.3.16.tgz#7404383d05031f462a29f578dc35948d0af35344"
|
||||
integrity sha512-nj6liCErIGtpuZYPf6QaxGQ9nlaHd8Cf/NBcRhogskvjOVFkF3FS9xpjRw3WidkmOQnk+D0ZGCeXjtTibgy5CA==
|
||||
dependencies:
|
||||
"@types/koa" "^2.11.6"
|
||||
"@types/ws" "^7.4.0"
|
||||
"@web/parse5-utils" "^1.2.0"
|
||||
chokidar "^3.4.3"
|
||||
clone "^2.1.2"
|
||||
es-module-lexer "^0.9.0"
|
||||
get-stream "^6.0.0"
|
||||
is-stream "^2.0.0"
|
||||
isbinaryfile "^4.0.6"
|
||||
koa "^2.13.0"
|
||||
koa-etag "^4.0.0"
|
||||
koa-send "^5.0.1"
|
||||
koa-static "^5.0.0"
|
||||
lru-cache "^6.0.0"
|
||||
mime-types "^2.1.27"
|
||||
parse5 "^6.0.1"
|
||||
picomatch "^2.2.2"
|
||||
ws "^7.4.2"
|
||||
|
||||
"@web/dev-server-core@^0.3.2", "@web/dev-server-core@^0.3.3":
|
||||
version "0.3.3"
|
||||
resolved "https://registry.yarnpkg.com/@web/dev-server-core/-/dev-server-core-0.3.3.tgz#814bc86460c43ab9d66b640f2b3b65d452ce30e0"
|
||||
@@ -1940,6 +1987,14 @@
|
||||
"@types/parse5" "^5.0.3"
|
||||
parse5 "^6.0.1"
|
||||
|
||||
"@web/parse5-utils@^1.2.0":
|
||||
version "1.3.0"
|
||||
resolved "https://registry.yarnpkg.com/@web/parse5-utils/-/parse5-utils-1.3.0.tgz#e2e9e98b31a4ca948309f74891bda8d77399f6bd"
|
||||
integrity sha512-Pgkx3ECc8EgXSlS5EyrgzSOoUbM6P8OKS471HLAyvOBcP1NCBn0to4RN/OaKASGq8qa3j+lPX9H14uA5AHEnQg==
|
||||
dependencies:
|
||||
"@types/parse5" "^6.0.1"
|
||||
parse5 "^6.0.1"
|
||||
|
||||
"@web/parse5-utils@^1.2.2":
|
||||
version "1.2.2"
|
||||
resolved "https://registry.yarnpkg.com/@web/parse5-utils/-/parse5-utils-1.2.2.tgz#33eec93321eb07cf364651c131b980a7afd8c4d7"
|
||||
@@ -2039,6 +2094,38 @@
|
||||
picomatch "^2.2.2"
|
||||
uuid "^8.3.2"
|
||||
|
||||
"@web/test-runner-core@^0.10.20":
|
||||
version "0.10.21"
|
||||
resolved "https://registry.yarnpkg.com/@web/test-runner-core/-/test-runner-core-0.10.21.tgz#fe8a01f3595330940189ff4b9d32514ede55d184"
|
||||
integrity sha512-Dh1TJITyil4w22DXwCmYEyp4BBzRFxRqiUbJ/iPziT1E5heAx/pZPug1oFs83LKUc/crOcDhObz6u4ynGWz9wQ==
|
||||
dependencies:
|
||||
"@babel/code-frame" "^7.12.11"
|
||||
"@types/babel__code-frame" "^7.0.2"
|
||||
"@types/co-body" "^6.1.0"
|
||||
"@types/convert-source-map" "^1.5.1"
|
||||
"@types/debounce" "^1.2.0"
|
||||
"@types/istanbul-lib-coverage" "^2.0.3"
|
||||
"@types/istanbul-reports" "^3.0.0"
|
||||
"@web/browser-logs" "^0.2.1"
|
||||
"@web/dev-server-core" "^0.3.16"
|
||||
chokidar "^3.4.3"
|
||||
cli-cursor "^3.1.0"
|
||||
co-body "^6.1.0"
|
||||
convert-source-map "^1.7.0"
|
||||
debounce "^1.2.0"
|
||||
dependency-graph "^0.11.0"
|
||||
globby "^11.0.1"
|
||||
ip "^1.1.5"
|
||||
istanbul-lib-coverage "^3.0.0"
|
||||
istanbul-lib-report "^3.0.0"
|
||||
istanbul-reports "^3.0.2"
|
||||
log-update "^4.0.0"
|
||||
nanocolors "^0.2.1"
|
||||
nanoid "^3.1.25"
|
||||
open "^8.0.2"
|
||||
picomatch "^2.2.2"
|
||||
source-map "^0.7.3"
|
||||
|
||||
"@web/test-runner-coverage-v8@^0.4.0":
|
||||
version "0.4.0"
|
||||
resolved "https://registry.yarnpkg.com/@web/test-runner-coverage-v8/-/test-runner-coverage-v8-0.4.0.tgz#8289d12fb826c92c1d3cb8334b9e580a3b99927c"
|
||||
@@ -2048,6 +2135,16 @@
|
||||
istanbul-lib-coverage "^3.0.0"
|
||||
v8-to-istanbul "^7.1.0"
|
||||
|
||||
"@web/test-runner-coverage-v8@^0.4.8":
|
||||
version "0.4.8"
|
||||
resolved "https://registry.yarnpkg.com/@web/test-runner-coverage-v8/-/test-runner-coverage-v8-0.4.8.tgz#d4ff9ebd9c48312d09a7391abbfdfc47f21e9d0d"
|
||||
integrity sha512-Ib0AscR8Xf9E/V7rf3XOVQTe4vKIbwSTupxV1xGgzj3x4RKUuMUg9FLz9EigZ5iN0mOzZKDllyRS523hbdhDtA==
|
||||
dependencies:
|
||||
"@web/test-runner-core" "^0.10.20"
|
||||
istanbul-lib-coverage "^3.0.0"
|
||||
picomatch "^2.2.2"
|
||||
v8-to-istanbul "^8.0.0"
|
||||
|
||||
"@web/test-runner-mocha@^0.7.0":
|
||||
version "0.7.0"
|
||||
resolved "https://registry.yarnpkg.com/@web/test-runner-mocha/-/test-runner-mocha-0.7.0.tgz#1c844ee0446345deacfbbfeae614db7d45a1a7dc"
|
||||
@@ -2056,14 +2153,14 @@
|
||||
"@types/mocha" "^8.2.0"
|
||||
"@web/test-runner-core" "^0.10.0"
|
||||
|
||||
"@web/test-runner-playwright@^0.8.0":
|
||||
version "0.8.0"
|
||||
resolved "https://registry.yarnpkg.com/@web/test-runner-playwright/-/test-runner-playwright-0.8.0.tgz#65c4f31edf8db845960c2af10e5b40b213274351"
|
||||
integrity sha512-VoRfBxioOJuUFRROcwKkXL75iRtf4Qc9zVSGUvVlCZoLstG5EuqYyuvIdnGCkcf/sqCXsAh1WbQ+wfRXd7h6Cw==
|
||||
"@web/test-runner-playwright@^0.8.8":
|
||||
version "0.8.8"
|
||||
resolved "https://registry.yarnpkg.com/@web/test-runner-playwright/-/test-runner-playwright-0.8.8.tgz#c06de60c0283611f5f0ef478779a7605a35e0895"
|
||||
integrity sha512-bhb0QVldfDoPJqOj5mm1hpE6FReyddc/iIuAkVf/kbJvgggTCT2bWGxUvXJlGzf+4epmDhU+hSTfEoLL9R2vGw==
|
||||
dependencies:
|
||||
"@web/test-runner-core" "^0.10.0"
|
||||
"@web/test-runner-coverage-v8" "^0.4.0"
|
||||
playwright "^1.7.1"
|
||||
"@web/test-runner-core" "^0.10.20"
|
||||
"@web/test-runner-coverage-v8" "^0.4.8"
|
||||
playwright "^1.14.0"
|
||||
|
||||
"@web/test-runner@^0.12.2":
|
||||
version "0.12.2"
|
||||
@@ -2092,10 +2189,10 @@
|
||||
resolved "https://registry.yarnpkg.com/@webcomponents/scoped-custom-element-registry/-/scoped-custom-element-registry-0.0.1.tgz#196365260a019f87bddbded154ab09faf0e666fc"
|
||||
integrity sha512-ef5/v4U2vCxrnSMpo41LSWTjBOXCQ4JOt4+Y6PaSd8ympYioPhOP6E1tKmIk2ppwLSjCKbTyYf7ocHvwDat7bA==
|
||||
|
||||
"@webcomponents/scoped-custom-element-registry@0.0.2":
|
||||
version "0.0.2"
|
||||
resolved "https://registry.yarnpkg.com/@webcomponents/scoped-custom-element-registry/-/scoped-custom-element-registry-0.0.2.tgz#c863d163cb39c60063808e5ae23e06a1766fbe5f"
|
||||
integrity sha512-lKCoZfKoE3FHvmmj2ytaLBB8Grxp4HaxfSzaGlIZN6xXnOILfpCO0PFJkAxanefLGJWMho4kRY5PhgxWFhmSOw==
|
||||
"@webcomponents/scoped-custom-element-registry@^0.0.3":
|
||||
version "0.0.3"
|
||||
resolved "https://registry.yarnpkg.com/@webcomponents/scoped-custom-element-registry/-/scoped-custom-element-registry-0.0.3.tgz#774591a886b0b0e4914717273ba53fd8d5657522"
|
||||
integrity sha512-lpSzgDCGbM99dytb3+J3Suo4+Bk1E13MPnWB42JK8GwxSAxFz+tC7TTv2hhDSIE2IirGNKNKCf3m08ecu6eAsQ==
|
||||
|
||||
"@webcomponents/webcomponentsjs@^2.5.0":
|
||||
version "2.5.0"
|
||||
@@ -2236,9 +2333,9 @@ ansi-regex@^4.1.0:
|
||||
integrity sha512-1apePfXM1UOSqw0o9IiFAovVz9M5S1Dg+4TrDwfMewQ6p/rmMueb7tWZjQ1rx4Loy1ArBggoqGpfqqdI4rondg==
|
||||
|
||||
ansi-regex@^5.0.0:
|
||||
version "5.0.0"
|
||||
resolved "https://registry.yarnpkg.com/ansi-regex/-/ansi-regex-5.0.0.tgz#388539f55179bf39339c81af30a654d69f87cb75"
|
||||
integrity sha512-bY6fj56OUQ0hU1KjFNDQuJFezqKdrAyFdIevADiqrWHwSlbmBNMHp5ak2f40Pm8JTFyM2mqxkG6ngkHO11f/lg==
|
||||
version "5.0.1"
|
||||
resolved "https://registry.yarnpkg.com/ansi-regex/-/ansi-regex-5.0.1.tgz#082cb2c89c9fe8659a311a53bd6a4dc5301db304"
|
||||
integrity sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ==
|
||||
|
||||
ansi-styles@^2.2.1:
|
||||
version "2.2.1"
|
||||
@@ -2633,27 +2730,16 @@ browser-sync@^2.26.13:
|
||||
ua-parser-js "^0.7.18"
|
||||
yargs "^15.4.1"
|
||||
|
||||
browserslist@^4.14.5, browserslist@^4.15.0:
|
||||
version "4.16.0"
|
||||
resolved "https://registry.yarnpkg.com/browserslist/-/browserslist-4.16.0.tgz#410277627500be3cb28a1bfe037586fbedf9488b"
|
||||
integrity sha512-/j6k8R0p3nxOC6kx5JGAxsnhc9ixaWJfYc+TNTzxg6+ARaESAvQGV7h0uNOB4t+pLQJZWzcrMxXOxjgsCj3dqQ==
|
||||
browserslist@^4.14.5, browserslist@^4.15.0, browserslist@^4.16.1:
|
||||
version "4.18.1"
|
||||
resolved "https://registry.yarnpkg.com/browserslist/-/browserslist-4.18.1.tgz#60d3920f25b6860eb917c6c7b185576f4d8b017f"
|
||||
integrity sha512-8ScCzdpPwR2wQh8IT82CA2VgDwjHyqMovPBZSNH54+tm4Jk2pCuv90gmAdH6J84OCRWi0b4gMe6O6XPXuJnjgQ==
|
||||
dependencies:
|
||||
caniuse-lite "^1.0.30001165"
|
||||
colorette "^1.2.1"
|
||||
electron-to-chromium "^1.3.621"
|
||||
caniuse-lite "^1.0.30001280"
|
||||
electron-to-chromium "^1.3.896"
|
||||
escalade "^3.1.1"
|
||||
node-releases "^1.1.67"
|
||||
|
||||
browserslist@^4.16.1:
|
||||
version "4.16.1"
|
||||
resolved "https://registry.yarnpkg.com/browserslist/-/browserslist-4.16.1.tgz#bf757a2da376b3447b800a16f0f1c96358138766"
|
||||
integrity sha512-UXhDrwqsNcpTYJBTZsbGATDxZbiVDsx6UjpmRUmtnP10pr8wAYr5LgFoEFw9ixriQH2mv/NX2SfGzE/o8GndLA==
|
||||
dependencies:
|
||||
caniuse-lite "^1.0.30001173"
|
||||
colorette "^1.2.1"
|
||||
electron-to-chromium "^1.3.634"
|
||||
escalade "^3.1.1"
|
||||
node-releases "^1.1.69"
|
||||
node-releases "^2.0.1"
|
||||
picocolors "^1.0.0"
|
||||
|
||||
bs-recipes@1.3.4:
|
||||
version "1.3.4"
|
||||
@@ -2756,10 +2842,10 @@ camelcase@^6.0.0, camelcase@^6.2.0:
|
||||
resolved "https://registry.yarnpkg.com/camelcase/-/camelcase-6.2.0.tgz#924af881c9d525ac9d87f40d964e5cea982a1809"
|
||||
integrity sha512-c7wVvbw3f37nuobQNtgsgG9POC9qMbNuMQmTCqZv23b6MIz0fcYpBiOlv9gEN/hdLdnZTDQhg6e9Dq5M1vKvfg==
|
||||
|
||||
caniuse-lite@^1.0.30001165, caniuse-lite@^1.0.30001173:
|
||||
version "1.0.30001239"
|
||||
resolved "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001239.tgz"
|
||||
integrity sha512-cyBkXJDMeI4wthy8xJ2FvDU6+0dtcZSJW3voUF8+e9f1bBeuvyZfc3PNbkOETyhbR+dGCPzn9E7MA3iwzusOhQ==
|
||||
caniuse-lite@^1.0.30001280:
|
||||
version "1.0.30001280"
|
||||
resolved "https://registry.yarnpkg.com/caniuse-lite/-/caniuse-lite-1.0.30001280.tgz#066a506046ba4be34cde5f74a08db7a396718fb7"
|
||||
integrity sha512-kFXwYvHe5rix25uwueBxC569o53J6TpnGu0BEEn+6Lhl2vsnAumRFWEBhDft1fwyo6m1r4i+RqA4+163FpeFcA==
|
||||
|
||||
ccount@^1.0.0:
|
||||
version "1.1.0"
|
||||
@@ -3086,9 +3172,9 @@ color-name@^1.0.0, color-name@~1.1.4:
|
||||
integrity sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==
|
||||
|
||||
color-string@^1.5.4:
|
||||
version "1.5.4"
|
||||
resolved "https://registry.yarnpkg.com/color-string/-/color-string-1.5.4.tgz#dd51cd25cfee953d138fe4002372cc3d0e504cb6"
|
||||
integrity sha512-57yF5yt8Xa3czSEW1jfQDE79Idk0+AkN/4KWad6tbdxUmAs3MvjxlWSWD4deYytcRfoZ9nhKyFl1kj5tBvidbw==
|
||||
version "1.6.0"
|
||||
resolved "https://registry.yarnpkg.com/color-string/-/color-string-1.6.0.tgz#c3915f61fe267672cb7e1e064c9d692219f6c312"
|
||||
integrity sha512-c/hGS+kRWJutUBEngKKmk4iH3sD59MBkoxVapS/0wgpCz2u7XsNloxknyvBhzwEs1IbV36D9PwqLPJ2DTu3vMA==
|
||||
dependencies:
|
||||
color-name "^1.0.0"
|
||||
simple-swizzle "^0.2.2"
|
||||
@@ -3101,11 +3187,6 @@ color@^3.1.3:
|
||||
color-convert "^1.9.1"
|
||||
color-string "^1.5.4"
|
||||
|
||||
colorette@^1.2.1:
|
||||
version "1.2.1"
|
||||
resolved "https://registry.yarnpkg.com/colorette/-/colorette-1.2.1.tgz#4d0b921325c14faf92633086a536db6e89564b1b"
|
||||
integrity sha512-puCDz0CzydiSYOrnXpz/PKd69zRrribezjtE9yd4zvytoRc8+RY/KJPvtPFKZS3E3wP6neGyMe0vOTlHO5L3Pw==
|
||||
|
||||
comma-separated-tokens@^1.0.0:
|
||||
version "1.0.8"
|
||||
resolved "https://registry.yarnpkg.com/comma-separated-tokens/-/comma-separated-tokens-1.0.8.tgz#632b80b6117867a158f1080ad498b2fbe7e3f5ea"
|
||||
@@ -3146,7 +3227,7 @@ commander@^5.1.0:
|
||||
resolved "https://registry.yarnpkg.com/commander/-/commander-5.1.0.tgz#46abbd1652f8e059bddaef99bbdcb2ad9cf179ae"
|
||||
integrity sha512-P0CysNDQ7rtVw4QIQtm+MRxV66vKFSvlsQvGYXZWR3qFU0jlMKHZZZgw8e+8DSah4UDKMqnknRDQz+xuQXQ/Zg==
|
||||
|
||||
commander@^6.2.0:
|
||||
commander@^6.1.0, commander@^6.2.0:
|
||||
version "6.2.1"
|
||||
resolved "https://registry.yarnpkg.com/commander/-/commander-6.2.1.tgz#0792eb682dfbc325999bb2b84fddddba110ac73c"
|
||||
integrity sha512-U7VdrJFnJgo4xjrHpTzu0yrHPGImdsmD95ZlgYSEajAn2JKzDhDTPG9kBTefmObL2w/ngeZnilk+OV9CG3d7UA==
|
||||
@@ -3534,6 +3615,11 @@ defaults@^1.0.3:
|
||||
dependencies:
|
||||
clone "^1.0.2"
|
||||
|
||||
define-lazy-prop@^2.0.0:
|
||||
version "2.0.0"
|
||||
resolved "https://registry.yarnpkg.com/define-lazy-prop/-/define-lazy-prop-2.0.0.tgz#3f7ae421129bcaaac9bc74905c98a0009ec9ee7f"
|
||||
integrity sha512-Ds09qNh8yw3khSjiJjiUInaGX9xlqZDY7JVryGxdxV7NPeuqQfplOpQ66yJFZut3jLa5zOwkXw1g9EI2uKh4Og==
|
||||
|
||||
define-properties@^1.1.2, define-properties@^1.1.3:
|
||||
version "1.1.3"
|
||||
resolved "https://registry.yarnpkg.com/define-properties/-/define-properties-1.1.3.tgz#cf88da6cbee26fe6db7094f61d870cbd84cee9f1"
|
||||
@@ -3586,6 +3672,11 @@ dependency-graph@^0.10.0:
|
||||
resolved "https://registry.yarnpkg.com/dependency-graph/-/dependency-graph-0.10.0.tgz#dfebe384f1f36faf7782be203a7a71102a6335a6"
|
||||
integrity sha512-c9amUgpgxSi1bE5/sbLwcs5diLD0ygCQYmhfM5H1s5VH1mCsYkcmAL3CcNdv4kdSw6JuMoHeDGzLgj/gAXdWVg==
|
||||
|
||||
dependency-graph@^0.11.0:
|
||||
version "0.11.0"
|
||||
resolved "https://registry.yarnpkg.com/dependency-graph/-/dependency-graph-0.11.0.tgz#ac0ce7ed68a54da22165a85e97a01d53f5eb2e27"
|
||||
integrity sha512-JeMq7fEshyepOWDfcfHK06N3MhyPhz++vtqWhMT5O9A3K42rdsEDpfdVqjaqaAhsw6a+ZqeDvQVtD0hFHQWrzg==
|
||||
|
||||
dependency-graph@^0.9.0:
|
||||
version "0.9.0"
|
||||
resolved "https://registry.yarnpkg.com/dependency-graph/-/dependency-graph-0.9.0.tgz#11aed7e203bc8b00f48356d92db27b265c445318"
|
||||
@@ -3707,15 +3798,10 @@ ejs@^2.7.4:
|
||||
resolved "https://registry.yarnpkg.com/ejs/-/ejs-2.7.4.tgz#48661287573dcc53e366c7a1ae52c3a120eec9ba"
|
||||
integrity sha512-7vmuyh5+kuUyJKePhQfRQBhXV5Ce+RnaeeQArKu1EAMpL3WbgMt5WG6uQZpEVvYSSsxMXRKOewtDk9RaTKXRlA==
|
||||
|
||||
electron-to-chromium@^1.3.621:
|
||||
version "1.3.633"
|
||||
resolved "https://registry.yarnpkg.com/electron-to-chromium/-/electron-to-chromium-1.3.633.tgz#16dd5aec9de03894e8d14a1db4cda8a369b9b7fe"
|
||||
integrity sha512-bsVCsONiVX1abkWdH7KtpuDAhsQ3N3bjPYhROSAXE78roJKet0Y5wznA14JE9pzbwSZmSMAW6KiKYf1RvbTJkA==
|
||||
|
||||
electron-to-chromium@^1.3.634:
|
||||
version "1.3.636"
|
||||
resolved "https://registry.yarnpkg.com/electron-to-chromium/-/electron-to-chromium-1.3.636.tgz#6980bd90813a9fb744e43f5e848f16cea4930058"
|
||||
integrity sha512-Adcvng33sd3gTjNIDNXGD1G4H6qCImIy2euUJAQHtLNplEKU5WEz5KRJxupRNIIT8sD5oFZLTKBWAf12Bsz24A==
|
||||
electron-to-chromium@^1.3.896:
|
||||
version "1.3.898"
|
||||
resolved "https://registry.yarnpkg.com/electron-to-chromium/-/electron-to-chromium-1.3.898.tgz#0bd4090bf7c7003cb9bd31c4223a9f6aa1aab9dc"
|
||||
integrity sha512-dxEsaHy9Ter268LO7P8uWomuChbyML4zZk5F9+UZSozFRS7ggC5cQ8fPIM8Pec+6uWGdujuDagQhIbqjohUK2w==
|
||||
|
||||
eleventy-plugin-add-web-component-definitions@^2.0.3:
|
||||
version "2.0.3"
|
||||
@@ -3897,6 +3983,11 @@ es-module-lexer@^0.3.26:
|
||||
resolved "https://registry.yarnpkg.com/es-module-lexer/-/es-module-lexer-0.3.26.tgz#7b507044e97d5b03b01d4392c74ffeb9c177a83b"
|
||||
integrity sha512-Va0Q/xqtrss45hWzP8CZJwzGSZJjDM5/MJRE3IXXnUCcVLElR9BRaE9F62BopysASyc4nM3uwhSW7FFB9nlWAA==
|
||||
|
||||
es-module-lexer@^0.9.0:
|
||||
version "0.9.3"
|
||||
resolved "https://registry.yarnpkg.com/es-module-lexer/-/es-module-lexer-0.9.3.tgz#6f13db00cc38417137daf74366f535c8eb438f19"
|
||||
integrity sha512-1HQ2M2sPtxwnvOvT1ZClHyQDiggdNjURWpY2we6aMKCQiUVxTmVs2UYPLIrD84sS+kMdUwfBSylbJPwNnBrnHQ==
|
||||
|
||||
es-to-primitive@^1.2.1:
|
||||
version "1.2.1"
|
||||
resolved "https://registry.yarnpkg.com/es-to-primitive/-/es-to-primitive-1.2.1.tgz#e55cd4c9cdc188bcefb03b366c736323fc5c898a"
|
||||
@@ -3938,6 +4029,11 @@ escape-string-regexp@4.0.0:
|
||||
resolved "https://registry.yarnpkg.com/escape-string-regexp/-/escape-string-regexp-4.0.0.tgz#14ba83a5d373e3d311e5afca29cf5bfad965bf34"
|
||||
integrity sha512-TtpcNJ3XAzx3Gq8sWRzJaVajRs0uVxA2YAkdb1jm2YkPz4G6egUFAyA3n5vtEIZefPk5Wa4UXbKuS5fKkJWdgA==
|
||||
|
||||
escape-string-regexp@^2.0.0:
|
||||
version "2.0.0"
|
||||
resolved "https://registry.yarnpkg.com/escape-string-regexp/-/escape-string-regexp-2.0.0.tgz#a30304e99daa32e23b2fd20f51babd07cffca344"
|
||||
integrity sha512-UpzcLCXolUWcNu5HtVMHYdXJjArjsF9C0aNnquZYY4uW/Vu0miy5YoWvbV345HauVvcAUnpRuhMMcqTcGOY2+w==
|
||||
|
||||
escape-string-regexp@^5.0.0:
|
||||
version "5.0.0"
|
||||
resolved "https://registry.yarnpkg.com/escape-string-regexp/-/escape-string-regexp-5.0.0.tgz#4683126b500b61762f2dbebace1806e8be31b1c8"
|
||||
@@ -4343,6 +4439,16 @@ fs-extra@^8.1.0:
|
||||
jsonfile "^4.0.0"
|
||||
universalify "^0.1.0"
|
||||
|
||||
fs-extra@^9.0.0:
|
||||
version "9.1.0"
|
||||
resolved "https://registry.yarnpkg.com/fs-extra/-/fs-extra-9.1.0.tgz#5954460c764a8da2094ba3554bf839e6b9a7c86d"
|
||||
integrity sha512-hcg3ZmepS30/7BSFqRvoo3DOMQu7IjqxO5nCDt+zM9XWjb33Wg7ziNT+Qvqbuc3+gWpzO02JubVyk2G4Zvo1OQ==
|
||||
dependencies:
|
||||
at-least-node "^1.0.0"
|
||||
graceful-fs "^4.2.0"
|
||||
jsonfile "^6.0.1"
|
||||
universalify "^2.0.0"
|
||||
|
||||
fs-extra@^9.0.1:
|
||||
version "9.0.1"
|
||||
resolved "https://registry.yarnpkg.com/fs-extra/-/fs-extra-9.0.1.tgz#910da0062437ba4c39fedd863f1675ccfefcb9fc"
|
||||
@@ -4463,14 +4569,7 @@ github-slugger@^1.0.0, github-slugger@^1.1.1:
|
||||
dependencies:
|
||||
emoji-regex ">=6.0.0 <=6.1.1"
|
||||
|
||||
glob-parent@^5.0.0, glob-parent@^5.1.0, glob-parent@~5.1.0:
|
||||
version "5.1.1"
|
||||
resolved "https://registry.yarnpkg.com/glob-parent/-/glob-parent-5.1.1.tgz#b6c1ef417c4e5663ea498f1c45afac6916bbc229"
|
||||
integrity sha512-FnI+VGOpnlGHWZxthPGR+QhR78fuiK0sNLkHQv+bL9fQi57lNNdquIbna/WrfROrolq8GK5Ek6BiMwqL/voRYQ==
|
||||
dependencies:
|
||||
is-glob "^4.0.1"
|
||||
|
||||
glob-parent@~5.1.2:
|
||||
glob-parent@^5.0.0, glob-parent@^5.1.0, glob-parent@~5.1.0, glob-parent@~5.1.2:
|
||||
version "5.1.2"
|
||||
resolved "https://registry.yarnpkg.com/glob-parent/-/glob-parent-5.1.2.tgz#869832c58034fe68a4093c17dc15e8340d8401c4"
|
||||
integrity sha512-AOIgSQCepiJYwP3ARnGx+5VnTu2HBYdzbGP45eLw1vr3zB3vZLeyed1sC9hnbcOc9/SrMyM5RPQrkGz4aS9Zow==
|
||||
@@ -4592,9 +4691,9 @@ hanbi@^0.4.1:
|
||||
integrity sha512-z5UYPq/+PfDDT7uZ/IrO4e5BhWcNnR73oP6CUaDUERbskABmBqrDzfePktI0BIPAV4xfyAhue8ZTmyCOh7rZ3g==
|
||||
|
||||
handlebars@^4.7.6:
|
||||
version "4.7.6"
|
||||
resolved "https://registry.yarnpkg.com/handlebars/-/handlebars-4.7.6.tgz#d4c05c1baf90e9945f77aa68a7a219aa4a7df74e"
|
||||
integrity sha512-1f2BACcBfiwAfStCKZNrUCgqNZkGsAT7UM3kkYtXuLo0KnaVfjKOyf7PRzB6++aK9STyT1Pd2ZCPe3EGOXleXA==
|
||||
version "4.7.7"
|
||||
resolved "https://registry.yarnpkg.com/handlebars/-/handlebars-4.7.7.tgz#9ce33416aad02dbd6c8fafa8240d5d98004945a1"
|
||||
integrity sha512-aAcXm5OAfE/8IXkcZvCepKU3VzW1/39Fb5ZuqMtgI/hT8X2YgoMvBY5dLhq/cpOvw7Lk1nK/UF71aLG/ZnVYRA==
|
||||
dependencies:
|
||||
minimist "^1.2.5"
|
||||
neo-async "^2.6.0"
|
||||
@@ -4825,9 +4924,9 @@ hirestime@6.1.0, hirestime@^6.1.0:
|
||||
integrity sha512-sCVxYT/2iSUanrRuiUspZaF78crKojzmVz2mI+gjq1/N+7RPCyZu8S0KyBlE4O+Aq/YmtTzJWGxLxByZvCiKPA==
|
||||
|
||||
hosted-git-info@^2.1.4:
|
||||
version "2.8.8"
|
||||
resolved "https://registry.yarnpkg.com/hosted-git-info/-/hosted-git-info-2.8.8.tgz#7539bd4bc1e0e0a895815a2e0262420b12858488"
|
||||
integrity sha512-f/wzC2QaWBs7t9IYqB4T3sR1xviIViXJRJTWBlx2Gf3g0Xi5vI7Yy4koXQ1c9OYDGHN9sBy1DQ2AB8fqZBWhUg==
|
||||
version "2.8.9"
|
||||
resolved "https://registry.yarnpkg.com/hosted-git-info/-/hosted-git-info-2.8.9.tgz#dffc0bf9a21c02209090f2aa69429e1414daf3f9"
|
||||
integrity sha512-mxIDAb9Lsm6DoOJ7xH+5+X4y1LU/4Hi50L9C5sIswK3JzULS4bwk1FvjdBgvYR4bzT4tuUQiC15FE2f5HbLvYw==
|
||||
|
||||
html-escaper@^2.0.0:
|
||||
version "2.0.2"
|
||||
@@ -5143,6 +5242,11 @@ is-docker@^2.0.0:
|
||||
resolved "https://registry.yarnpkg.com/is-docker/-/is-docker-2.1.1.tgz#4125a88e44e450d384e09047ede71adc2d144156"
|
||||
integrity sha512-ZOoqiXfEwtGknTiuDEy8pN2CfE3TxMHprvNer1mXiqwkOT77Rw3YVrUQ52EqAOU3QAWDQ+bQdx7HJzrv7LS2Hw==
|
||||
|
||||
is-docker@^2.1.1:
|
||||
version "2.2.1"
|
||||
resolved "https://registry.yarnpkg.com/is-docker/-/is-docker-2.2.1.tgz#33eeabe23cfe86f14bde4408a02c0cfb853acdaa"
|
||||
integrity sha512-F+i2BKsFrH66iaUFc0woD8sLy8getkwTwtOBjvs56Cx4CgJDeKQeqfz8wAYiSb8JOprWhHH5p77PbmYCvvUuXQ==
|
||||
|
||||
is-expression@^3.0.0:
|
||||
version "3.0.0"
|
||||
resolved "https://registry.yarnpkg.com/is-expression/-/is-expression-3.0.0.tgz#39acaa6be7fd1f3471dc42c7416e61c24317ac9f"
|
||||
@@ -5711,7 +5815,7 @@ listr2@^3.2.2:
|
||||
rxjs "^6.6.3"
|
||||
through "^2.3.8"
|
||||
|
||||
lit-element@^2.0.1, lit-element@^2.4.0, lit-element@~2.4.0:
|
||||
lit-element@^2.0.1:
|
||||
version "2.4.0"
|
||||
resolved "https://registry.yarnpkg.com/lit-element/-/lit-element-2.4.0.tgz#b22607a037a8fc08f5a80736dddf7f3f5d401452"
|
||||
integrity sha512-pBGLglxyhq/Prk2H91nA0KByq/hx/wssJBQFiYqXhGDvEnY31PRGYf1RglVzyLeRysu0IHm2K0P196uLLWmwFg==
|
||||
@@ -5725,6 +5829,14 @@ lit-element@^2.5.1:
|
||||
dependencies:
|
||||
lit-html "^1.1.1"
|
||||
|
||||
lit-element@^3.0.0:
|
||||
version "3.0.2"
|
||||
resolved "https://registry.yarnpkg.com/lit-element/-/lit-element-3.0.2.tgz#6422b68ba166a32695f524d6f3eb41712610bf50"
|
||||
integrity sha512-9vTJ47D2DSE4Jwhle7aMzEwO2ZcOPRikqfT3CVG7Qol2c9/I4KZwinZNW5Xv8hNm+G/enSSfIwqQhIXi6ioAUg==
|
||||
dependencies:
|
||||
"@lit/reactive-element" "^1.0.0"
|
||||
lit-html "^2.0.0"
|
||||
|
||||
lit-element@^3.0.0-rc.2:
|
||||
version "3.0.0-rc.2"
|
||||
resolved "https://registry.yarnpkg.com/lit-element/-/lit-element-3.0.0-rc.2.tgz#883d0b6fd7b846226d360699d1b713da5fc7e1b7"
|
||||
@@ -5733,11 +5845,18 @@ lit-element@^3.0.0-rc.2:
|
||||
"@lit/reactive-element" "^1.0.0-rc.2"
|
||||
lit-html "^2.0.0-rc.3"
|
||||
|
||||
lit-html@^1.0.0, lit-html@^1.1.1, lit-html@^1.3.0:
|
||||
lit-html@^1.1.1:
|
||||
version "1.3.0"
|
||||
resolved "https://registry.yarnpkg.com/lit-html/-/lit-html-1.3.0.tgz#c80f3cc5793a6dea6c07172be90a70ab20e56034"
|
||||
integrity sha512-0Q1bwmaFH9O14vycPHw8C/IeHMk/uSDldVLIefu/kfbTBGIc44KGH6A8p1bDfxUfHdc8q6Ct7kQklWoHgr4t1Q==
|
||||
|
||||
lit-html@^2.0.0:
|
||||
version "2.0.2"
|
||||
resolved "https://registry.yarnpkg.com/lit-html/-/lit-html-2.0.2.tgz#6a17caac4135757710c5fb3e4becc622c476e431"
|
||||
integrity sha512-dON7Zg8btb14/fWohQLQBdSgkoiQA4mIUy87evmyJHtxRq7zS6LlC32bT5EPWiof5PUQaDpF45v2OlrxHA5Clg==
|
||||
dependencies:
|
||||
"@types/trusted-types" "^2.0.2"
|
||||
|
||||
lit-html@^2.0.0-rc.3:
|
||||
version "2.0.0-rc.3"
|
||||
resolved "https://registry.yarnpkg.com/lit-html/-/lit-html-2.0.0-rc.3.tgz#1c216e548630e18d3093d97f4e29563abce659af"
|
||||
@@ -5745,6 +5864,15 @@ lit-html@^2.0.0-rc.3:
|
||||
dependencies:
|
||||
"@types/trusted-types" "^1.0.1"
|
||||
|
||||
lit@^2.0.0, lit@^2.0.2:
|
||||
version "2.0.2"
|
||||
resolved "https://registry.yarnpkg.com/lit/-/lit-2.0.2.tgz#5e6f422924e0732258629fb379556b6d23f7179c"
|
||||
integrity sha512-hKA/1YaSB+P+DvKWuR2q1Xzy/iayhNrJ3aveD0OQ9CKn6wUjsdnF/7LavDOJsKP/K5jzW/kXsuduPgRvTFrFJw==
|
||||
dependencies:
|
||||
"@lit/reactive-element" "^1.0.0"
|
||||
lit-element "^3.0.0"
|
||||
lit-html "^2.0.0"
|
||||
|
||||
lit@^2.0.0-rc.1, lit@^2.0.0-rc.2:
|
||||
version "2.0.0-rc.2"
|
||||
resolved "https://registry.yarnpkg.com/lit/-/lit-2.0.0-rc.2.tgz#724a2d621aa098001d73bf7106f3a72b7b5948ef"
|
||||
@@ -5837,9 +5965,9 @@ lodash.toarray@^4.4.0:
|
||||
integrity sha1-JMS/zWsvuji/0FlNsRedjptlZWE=
|
||||
|
||||
lodash@^4.17.10, lodash@^4.17.14, lodash@^4.17.15, lodash@^4.17.19, lodash@^4.17.20, lodash@^4.17.4:
|
||||
version "4.17.20"
|
||||
resolved "https://registry.yarnpkg.com/lodash/-/lodash-4.17.20.tgz#b44a9b6297bcb698f1c51a3545a2b3b368d59c52"
|
||||
integrity sha512-PlhdFcillOINfeV7Ni6oF1TAEayyZBoZ8bcshTHqOYJYlrqzRK5hagpagky5o4HfCzzd1TRkXPMFq6cKk9rGmA==
|
||||
version "4.17.21"
|
||||
resolved "https://registry.yarnpkg.com/lodash/-/lodash-4.17.21.tgz#679591c564c3bffaae8454cf0b3df370c3d6911c"
|
||||
integrity sha512-v2kDEe57lecTulaDIuNTPy3Ry4gLGJ6Z1O3vE1krgXZNrsQ+LFTGHVxVjcXPs17LhbZVGedAJv8XZ1tvj5FvSg==
|
||||
|
||||
log-symbols@2.2.0:
|
||||
version "2.2.0"
|
||||
@@ -6667,11 +6795,21 @@ mustache@^2.3.2:
|
||||
resolved "https://registry.yarnpkg.com/mustache/-/mustache-2.3.2.tgz#a6d4d9c3f91d13359ab889a812954f9230a3d0c5"
|
||||
integrity sha512-KpMNwdQsYz3O/SBS1qJ/o3sqUJ5wSb8gb0pul8CO0S56b9Y2ALm8zCfsjPXsqGFfoNBkDwZuZIAjhsZI03gYVQ==
|
||||
|
||||
nanocolors@^0.2.1:
|
||||
version "0.2.12"
|
||||
resolved "https://registry.yarnpkg.com/nanocolors/-/nanocolors-0.2.12.tgz#4d05932e70116078673ea4cc6699a1c56cc77777"
|
||||
integrity sha512-SFNdALvzW+rVlzqexid6epYdt8H9Zol7xDoQarioEFcFN0JHo4CYNztAxmtfgGTVRCmFlEOqqhBpoFGKqSAMug==
|
||||
|
||||
nanoid@3.1.12:
|
||||
version "3.1.12"
|
||||
resolved "https://registry.yarnpkg.com/nanoid/-/nanoid-3.1.12.tgz#6f7736c62e8d39421601e4a0c77623a97ea69654"
|
||||
integrity sha512-1qstj9z5+x491jfiC4Nelk+f8XBad7LN20PmyWINJEMRSf3wcAjAWysw1qaA8z6NSKe2sjq1hRSDpBH5paCb6A==
|
||||
|
||||
nanoid@^3.1.25:
|
||||
version "3.1.29"
|
||||
resolved "https://registry.yarnpkg.com/nanoid/-/nanoid-3.1.29.tgz#214fb2d7a33e1a5bef4757b779dfaeb6a4e5aeb4"
|
||||
integrity sha512-dW2pUSGZ8ZnCFIlBIA31SV8huOGCHb6OwzVCc7A69rb/a+SgPBwfmLvK5TKQ3INPbRkcI8a/Owo0XbiTNH19wg==
|
||||
|
||||
napi-build-utils@^1.0.1:
|
||||
version "1.0.2"
|
||||
resolved "https://registry.yarnpkg.com/napi-build-utils/-/napi-build-utils-1.0.2.tgz#b1fddc0b2c46e380a0b7a76f984dd47c41a13806"
|
||||
@@ -6748,15 +6886,10 @@ node-fetch@^2.6.1:
|
||||
resolved "https://registry.yarnpkg.com/node-fetch/-/node-fetch-2.6.1.tgz#045bd323631f76ed2e2b55573394416b639a0052"
|
||||
integrity sha512-V4aYg89jEoVRxRb2fJdAg8FHvI7cEyYdVAh94HH0UIK8oJxUfkjlDQN9RbMx+bEjP7+ggMiFRprSti032Oipxw==
|
||||
|
||||
node-releases@^1.1.67:
|
||||
version "1.1.67"
|
||||
resolved "https://registry.yarnpkg.com/node-releases/-/node-releases-1.1.67.tgz#28ebfcccd0baa6aad8e8d4d8fe4cbc49ae239c12"
|
||||
integrity sha512-V5QF9noGFl3EymEwUYzO+3NTDpGfQB4ve6Qfnzf3UNydMhjQRVPR1DZTuvWiLzaFJYw2fmDwAfnRNEVb64hSIg==
|
||||
|
||||
node-releases@^1.1.69:
|
||||
version "1.1.69"
|
||||
resolved "https://registry.yarnpkg.com/node-releases/-/node-releases-1.1.69.tgz#3149dbde53b781610cd8b486d62d86e26c3725f6"
|
||||
integrity sha512-DGIjo79VDEyAnRlfSqYTsy+yoHd2IOjJiKUozD2MV2D85Vso6Bug56mb9tT/fY5Urt0iqk01H7x+llAruDR2zA==
|
||||
node-releases@^2.0.1:
|
||||
version "2.0.1"
|
||||
resolved "https://registry.yarnpkg.com/node-releases/-/node-releases-2.0.1.tgz#3d1d395f204f1f2f29a54358b9fb678765ad2fc5"
|
||||
integrity sha512-CqyzN6z7Q6aMeF/ktcMVTzhAHCEpf8SOarwpzpf8pNBY2k5/oM34UHldUwp8VKI7uxct2HxSRdJjBaZeESzcxA==
|
||||
|
||||
noms@0.0.0:
|
||||
version "0.0.0"
|
||||
@@ -6833,9 +6966,9 @@ npmlog@^4.0.1:
|
||||
set-blocking "~2.0.0"
|
||||
|
||||
nth-check@^2.0.0:
|
||||
version "2.0.0"
|
||||
resolved "https://registry.yarnpkg.com/nth-check/-/nth-check-2.0.0.tgz#1bb4f6dac70072fc313e8c9cd1417b5074c0a125"
|
||||
integrity sha512-i4sc/Kj8htBrAiH1viZ0TgU8Y5XqCaV/FziYK6TBczxmeKm3AEFWqqF3195yKudrarqy7Zu80Ra5dobFjn9X/Q==
|
||||
version "2.0.1"
|
||||
resolved "https://registry.yarnpkg.com/nth-check/-/nth-check-2.0.1.tgz#2efe162f5c3da06a28959fbd3db75dbeea9f0fc2"
|
||||
integrity sha512-it1vE95zF6dTT9lBsYbxvqh0Soy4SPowchj0UBGj/V6cTPnXXtQOPUbhZ6CmGzAD/rW22LQK6E96pcdJXk4A4w==
|
||||
dependencies:
|
||||
boolbase "^1.0.0"
|
||||
|
||||
@@ -6951,6 +7084,15 @@ open@^7.3.0:
|
||||
is-docker "^2.0.0"
|
||||
is-wsl "^2.1.1"
|
||||
|
||||
open@^8.0.2:
|
||||
version "8.3.0"
|
||||
resolved "https://registry.yarnpkg.com/open/-/open-8.3.0.tgz#fdef1cdfe405e60dec8ebd18889e7e812f39c59f"
|
||||
integrity sha512-7INcPWb1UcOwSQxAXTnBJ+FxVV4MPs/X++FWWBtgY69/J5lc+tCteMt/oFK1MnkyHC4VILLa9ntmwKTwDR4Q9w==
|
||||
dependencies:
|
||||
define-lazy-prop "^2.0.0"
|
||||
is-docker "^2.1.1"
|
||||
is-wsl "^2.2.0"
|
||||
|
||||
opencollective-postinstall@^2.0.2:
|
||||
version "2.0.3"
|
||||
resolved "https://registry.yarnpkg.com/opencollective-postinstall/-/opencollective-postinstall-2.0.3.tgz#7a0fff978f6dbfa4d006238fbac98ed4198c3259"
|
||||
@@ -7235,9 +7377,9 @@ path-key@^3.0.0, path-key@^3.1.0:
|
||||
integrity sha512-ojmeN0qd+y0jszEtoY48r0Peq5dwMEkIlCOu6Q5f41lfkswXuKtYrhgoTpLnyIcHm24Uhqx+5Tqm2InSwLhE6Q==
|
||||
|
||||
path-parse@^1.0.6:
|
||||
version "1.0.6"
|
||||
resolved "https://registry.yarnpkg.com/path-parse/-/path-parse-1.0.6.tgz#d62dbb5679405d72c4737ec58600e9ddcf06d24c"
|
||||
integrity sha512-GSmOT2EbHrINBf9SR7CDELwlJ8AENk3Qn7OikK4nFYAu3Ote2+JYNVvkpAEQm3/TLNEJFD/xZJjzyxg3KBWOzw==
|
||||
version "1.0.7"
|
||||
resolved "https://registry.yarnpkg.com/path-parse/-/path-parse-1.0.7.tgz#fbc114b60ca42b30d9daf5858e4bd68bbedb6735"
|
||||
integrity sha512-LDJzPVEEEPR+y48z93A0Ed0yXb8pAByGWo/k5YYdYgpY2/2EsOsksJrq7lOHxryrVOn1ejG6oAp8ahvOIQD8sw==
|
||||
|
||||
path-root-regex@^0.1.0:
|
||||
version "0.1.2"
|
||||
@@ -7280,6 +7422,11 @@ pend@~1.2.0:
|
||||
resolved "https://registry.yarnpkg.com/pend/-/pend-1.2.0.tgz#7a57eb550a6783f9115331fcf4663d5c8e007a50"
|
||||
integrity sha1-elfrVQpng/kRUzH89GY9XI4AelA=
|
||||
|
||||
picocolors@^1.0.0:
|
||||
version "1.0.0"
|
||||
resolved "https://registry.yarnpkg.com/picocolors/-/picocolors-1.0.0.tgz#cb5bdc74ff3f51892236eaf79d68bc44564ab81c"
|
||||
integrity sha512-1fygroTLlHu66zi26VoTDv8yRgm0Fccecssto+MhsZ0D/DGW2sm8E8AjW7NU5VVTRt5GxbeZ5qBuJr+HyLYkjQ==
|
||||
|
||||
picomatch@^2.0.4, picomatch@^2.0.5, picomatch@^2.2.1, picomatch@^2.2.2:
|
||||
version "2.2.2"
|
||||
resolved "https://registry.yarnpkg.com/picomatch/-/picomatch-2.2.2.tgz#21f333e9b6b8eaff02468f5146ea406d345f4dad"
|
||||
@@ -7331,11 +7478,12 @@ pkg-dir@^5.0.0:
|
||||
dependencies:
|
||||
find-up "^5.0.0"
|
||||
|
||||
playwright@^1.7.1:
|
||||
version "1.7.1"
|
||||
resolved "https://registry.yarnpkg.com/playwright/-/playwright-1.7.1.tgz#841638811bc39eb2fed792ffaacbcc959a0aaf5e"
|
||||
integrity sha512-dOSWME42wDedJ/PXv8k0zG0Kxd6d6R2OKA51/05++Z2ISdA4N58gHlWqlVKPDkBog1MI6lu/KNt7QDn19AybWQ==
|
||||
playwright@^1.14.0:
|
||||
version "1.15.2"
|
||||
resolved "https://registry.yarnpkg.com/playwright/-/playwright-1.15.2.tgz#b350056d1fffbe5de5b1bdaca6ab73e35758baad"
|
||||
integrity sha512-+Z+7ckihyxR6rK5q8DWC6eUbKARfXpyxpjNcoJfgwSr64lAOzjhyFQiPC/JkdIqhsLgZjxpWfl1S7fLb+wPkgA==
|
||||
dependencies:
|
||||
commander "^6.1.0"
|
||||
debug "^4.1.1"
|
||||
extract-zip "^2.0.1"
|
||||
https-proxy-agent "^5.0.0"
|
||||
@@ -7346,7 +7494,9 @@ playwright@^1.7.1:
|
||||
proper-lockfile "^4.1.1"
|
||||
proxy-from-env "^1.1.0"
|
||||
rimraf "^3.0.2"
|
||||
ws "^7.3.1"
|
||||
stack-utils "^2.0.3"
|
||||
ws "^7.4.6"
|
||||
yazl "^2.5.1"
|
||||
|
||||
please-upgrade-node@^3.2.0:
|
||||
version "3.2.0"
|
||||
@@ -7508,6 +7658,15 @@ pseudomap@^1.0.2:
|
||||
resolved "https://registry.yarnpkg.com/pseudomap/-/pseudomap-1.0.2.tgz#f052a28da70e618917ef0a8ac34c1ae5a68286b3"
|
||||
integrity sha1-8FKijacOYYkX7wqKw0wa5aaChrM=
|
||||
|
||||
publish-docs@^0.1.2:
|
||||
version "0.1.2"
|
||||
resolved "https://registry.yarnpkg.com/publish-docs/-/publish-docs-0.1.2.tgz#5e3040fd55164381d24a084e19ee5aac704b4a9c"
|
||||
integrity sha512-h6weNnTDtgDW0RXfCeY0ffYZQhJyv+4rbJc+NUFVIqqL54sXHXFyT/H7OyjkyoIpVTwTsqhmBYx8zrrhhN+gJQ==
|
||||
dependencies:
|
||||
command-line-args "^5.1.1"
|
||||
fs-extra "^9.0.0"
|
||||
glob "^7.1.6"
|
||||
|
||||
pug-attrs@^2.0.4:
|
||||
version "2.0.4"
|
||||
resolved "https://registry.yarnpkg.com/pug-attrs/-/pug-attrs-2.0.4.tgz#b2f44c439e4eb4ad5d4ef25cac20d18ad28cc336"
|
||||
@@ -7518,9 +7677,9 @@ pug-attrs@^2.0.4:
|
||||
pug-runtime "^2.0.5"
|
||||
|
||||
pug-code-gen@^2.0.2:
|
||||
version "2.0.2"
|
||||
resolved "https://registry.yarnpkg.com/pug-code-gen/-/pug-code-gen-2.0.2.tgz#ad0967162aea077dcf787838d94ed14acb0217c2"
|
||||
integrity sha512-kROFWv/AHx/9CRgoGJeRSm+4mLWchbgpRzTEn8XCiwwOy6Vh0gAClS8Vh5TEJ9DBjaP8wCjS3J6HKsEsYdvaCw==
|
||||
version "2.0.3"
|
||||
resolved "https://registry.yarnpkg.com/pug-code-gen/-/pug-code-gen-2.0.3.tgz#122eb9ada9b5bf601705fe15aaa0a7d26bc134ab"
|
||||
integrity sha512-r9sezXdDuZJfW9J91TN/2LFbiqDhmltTFmGpHTsGdrNGp3p4SxAjjXEfnuK2e4ywYsRIVP0NeLbSAMHUcaX1EA==
|
||||
dependencies:
|
||||
constantinople "^3.1.2"
|
||||
doctypes "^1.1.0"
|
||||
@@ -7985,10 +8144,10 @@ remark-gfm@^1.0.0:
|
||||
mdast-util-gfm "^0.1.0"
|
||||
micromark-extension-gfm "^0.3.0"
|
||||
|
||||
remark-html@^13.0.1:
|
||||
version "13.0.1"
|
||||
resolved "https://registry.yarnpkg.com/remark-html/-/remark-html-13.0.1.tgz#d5b2d8be01203e61fc37403167ca7584879ad675"
|
||||
integrity sha512-K5KQCXWVz+harnyC+UVM/J9eJWCgjYRqFeZoZf2NgP0iFbuuw/RgMZv3MA34b/OEpGnstl3oiOUtZzD3tJ+CBw==
|
||||
remark-html@^13.0.2:
|
||||
version "13.0.2"
|
||||
resolved "https://registry.yarnpkg.com/remark-html/-/remark-html-13.0.2.tgz#de5f052749ff61fc904c9708c155c88a2e2655dc"
|
||||
integrity sha512-LhSRQ+3RKdBqB/RGesFWkNNfkGqprDUCwjq54SylfFeNyZby5kqOG8Dn/vYsRoM8htab6EWxFXCY6XIZvMoRiQ==
|
||||
dependencies:
|
||||
hast-util-sanitize "^3.0.0"
|
||||
hast-util-to-html "^7.0.0"
|
||||
@@ -8257,9 +8416,9 @@ semver-compare@^1.0.0:
|
||||
integrity sha1-De4hahyUGrN+nvsXiPavxf9VN/w=
|
||||
|
||||
semver-regex@^3.1.2:
|
||||
version "3.1.2"
|
||||
resolved "https://registry.yarnpkg.com/semver-regex/-/semver-regex-3.1.2.tgz#34b4c0d361eef262e07199dbef316d0f2ab11807"
|
||||
integrity sha512-bXWyL6EAKOJa81XG1OZ/Yyuq+oT0b2YLlxx7c+mrdYPaPbnj6WgVULXhinMIeZGufuUBu/eVRqXEhiv4imfwxA==
|
||||
version "3.1.3"
|
||||
resolved "https://registry.yarnpkg.com/semver-regex/-/semver-regex-3.1.3.tgz#b2bcc6f97f63269f286994e297e229b6245d0dc3"
|
||||
integrity sha512-Aqi54Mk9uYTjVexLnR67rTyBusmwd04cLkHy9hNvk3+G3nT2Oyg7E0l4XVbOaNwIvQ3hHeYxGcyEy+mKreyBFQ==
|
||||
|
||||
"semver@2 || 3 || 4 || 5", semver@^5.4.1, semver@^5.5.0, semver@^5.6.0, semver@^5.7.0:
|
||||
version "5.7.1"
|
||||
@@ -8452,11 +8611,6 @@ simple-swizzle@^0.2.2:
|
||||
dependencies:
|
||||
is-arrayish "^0.3.1"
|
||||
|
||||
singleton-manager@1.4.1:
|
||||
version "1.4.1"
|
||||
resolved "https://registry.yarnpkg.com/singleton-manager/-/singleton-manager-1.4.1.tgz#0a9cd1db2b26e5cbc4ecdc20d5a16f284b36aabb"
|
||||
integrity sha512-HOvKT/WcHvl2cLYGqmO6MaC2J4wAA82LntGwtLn6avnTq15UDLCnSRVXedmglVooLbQGVsQJ+dQz2sKz+2GUZA==
|
||||
|
||||
singleton-manager@1.4.2:
|
||||
version "1.4.2"
|
||||
resolved "https://registry.yarnpkg.com/singleton-manager/-/singleton-manager-1.4.2.tgz#4649acafca3eccf987d828ab16369ee59c4a22a5"
|
||||
@@ -8570,9 +8724,9 @@ socket.io-parser@~3.2.0:
|
||||
isarray "2.0.1"
|
||||
|
||||
socket.io-parser@~3.3.0:
|
||||
version "3.3.1"
|
||||
resolved "https://registry.yarnpkg.com/socket.io-parser/-/socket.io-parser-3.3.1.tgz#f07d9c8cb3fb92633aa93e76d98fd3a334623199"
|
||||
integrity sha512-1QLvVAe8dTz+mKmZ07Swxt+LAo4Y1ff50rlyoEx00TQmDFVQYPfcqGvIDJLGaBdhdNCecXtyKpD+EgKGcmmbuQ==
|
||||
version "3.3.2"
|
||||
resolved "https://registry.yarnpkg.com/socket.io-parser/-/socket.io-parser-3.3.2.tgz#ef872009d0adcf704f2fbe830191a14752ad50b6"
|
||||
integrity sha512-FJvDBuOALxdCI9qwRrO/Rfp9yfndRtc1jSgVgV8FDraihmSP/MLGD5PEuJrNfjALvcQ+vMDM/33AWOYP/JSjDg==
|
||||
dependencies:
|
||||
component-emitter "~1.3.0"
|
||||
debug "~3.1.0"
|
||||
@@ -8667,6 +8821,13 @@ sprintf-js@~1.0.2:
|
||||
resolved "https://registry.yarnpkg.com/sprintf-js/-/sprintf-js-1.0.3.tgz#04e6926f662895354f3dd015203633b857297e2c"
|
||||
integrity sha1-BOaSb2YolTVPPdAVIDYzuFcpfiw=
|
||||
|
||||
stack-utils@^2.0.3:
|
||||
version "2.0.5"
|
||||
resolved "https://registry.yarnpkg.com/stack-utils/-/stack-utils-2.0.5.tgz#d25265fca995154659dbbfba3b49254778d2fdd5"
|
||||
integrity sha512-xrQcmYhOsn/1kX+Vraq+7j4oE2j/6BFscZ0etmYg81xuM8Gq0022Pxb8+IqgOFUIaxHs0KaSb7T1+OegiNrNFA==
|
||||
dependencies:
|
||||
escape-string-regexp "^2.0.0"
|
||||
|
||||
"statuses@>= 1.4.0 < 2", "statuses@>= 1.5.0 < 2", statuses@^1.5.0:
|
||||
version "1.5.0"
|
||||
resolved "https://registry.yarnpkg.com/statuses/-/statuses-1.5.0.tgz#161c7dac177659fd9811f43771fa99381478628c"
|
||||
@@ -9097,9 +9258,9 @@ tree-kill@^1.2.2:
|
||||
integrity sha512-L0Orpi8qGpRG//Nd+H90vFB+3iHnue1zSSGmNOOCh1GLJ7rUKVwV2HvijphGQS2UmhUZewS9VgvxYIdgr+fG1A==
|
||||
|
||||
trim-newlines@^3.0.0:
|
||||
version "3.0.0"
|
||||
resolved "https://registry.yarnpkg.com/trim-newlines/-/trim-newlines-3.0.0.tgz#79726304a6a898aa8373427298d54c2ee8b1cb30"
|
||||
integrity sha512-C4+gOpvmxaSMKuEf9Qc134F1ZuOHVXKRbtEflf4NTtuuJDEIJ9p5PXsalL8SkeRw+qit1Mo+yuvMPAKwWg/1hA==
|
||||
version "3.0.1"
|
||||
resolved "https://registry.yarnpkg.com/trim-newlines/-/trim-newlines-3.0.1.tgz#260a5d962d8b752425b32f3a7db0dcacd176c144"
|
||||
integrity sha512-c1PTsA3tYrIsLGkJkzHF+w9F2EyxfXGo4UyJc4pFL++FMjnq0HJS69T3M7d//gKrFKwy429bouPescbjecU+Zw==
|
||||
|
||||
trough@^1.0.0:
|
||||
version "1.0.5"
|
||||
@@ -9220,9 +9381,9 @@ typical@^5.0.0, typical@^5.2.0:
|
||||
integrity sha512-dvdQgNDNJo+8B2uBQoqdb11eUCE1JQXhvjC/CZtgvZseVd5TYMXnq0+vuUemXbd/Se29cTaUuPX3YIc2xgbvIg==
|
||||
|
||||
ua-parser-js@^0.7.18:
|
||||
version "0.7.23"
|
||||
resolved "https://registry.yarnpkg.com/ua-parser-js/-/ua-parser-js-0.7.23.tgz#704d67f951e13195fbcd3d78818577f5bc1d547b"
|
||||
integrity sha512-m4hvMLxgGHXG3O3fQVAyyAQpZzDOvwnhOTjYz5Xmr7r/+LpkNy3vJXdVRWgd1TkAb7NGROZuSy96CrlNVjA7KA==
|
||||
version "0.7.31"
|
||||
resolved "https://registry.yarnpkg.com/ua-parser-js/-/ua-parser-js-0.7.31.tgz#649a656b191dffab4f21d5e053e27ca17cbff5c6"
|
||||
integrity sha512-qLK/Xe9E2uzmYI3qLeOmI0tEOt+TBBQyUIAh4aAgU05FVYzeZrKUdkAZfBNVGRaHVgV0TDkdEngJSw/SyQchkQ==
|
||||
|
||||
uc.micro@^1.0.1, uc.micro@^1.0.5:
|
||||
version "1.0.6"
|
||||
@@ -9273,9 +9434,9 @@ unc-path-regex@^0.1.2:
|
||||
integrity sha1-5z3T17DXxe2G+6xrCufYxqadUPo=
|
||||
|
||||
underscore@^1.9.1:
|
||||
version "1.12.0"
|
||||
resolved "https://registry.yarnpkg.com/underscore/-/underscore-1.12.0.tgz#4814940551fc80587cef7840d1ebb0f16453be97"
|
||||
integrity sha512-21rQzss/XPMjolTiIezSu3JAjgagXKROtNrYFEOWK109qY1Uv2tVjPTZ1ci2HgvQDA16gHYSthQIJfB+XId/rQ==
|
||||
version "1.13.1"
|
||||
resolved "https://registry.yarnpkg.com/underscore/-/underscore-1.13.1.tgz#0c1c6bd2df54b6b69f2314066d65b6cde6fcf9d1"
|
||||
integrity sha512-hzSoAVtJF+3ZtiFX0VgfFPHEDRm7Y/QPjGyNo4TVdnDTdft3tr8hEkD25a1jC+TjTuE7tkHGKkhwCgs9dgBB2g==
|
||||
|
||||
unicode-canonical-property-names-ecmascript@^1.0.4:
|
||||
version "1.0.4"
|
||||
@@ -9499,6 +9660,15 @@ v8-to-istanbul@^7.1.0:
|
||||
convert-source-map "^1.6.0"
|
||||
source-map "^0.7.3"
|
||||
|
||||
v8-to-istanbul@^8.0.0:
|
||||
version "8.1.0"
|
||||
resolved "https://registry.yarnpkg.com/v8-to-istanbul/-/v8-to-istanbul-8.1.0.tgz#0aeb763894f1a0a1676adf8a8b7612a38902446c"
|
||||
integrity sha512-/PRhfd8aTNp9Ggr62HPzXg2XasNFGy5PBt0Rp04du7/8GNNSgxFL6WBTkgMKSL9bFjH+8kKEG3f37FmxiTqUUA==
|
||||
dependencies:
|
||||
"@types/istanbul-lib-coverage" "^2.0.1"
|
||||
convert-source-map "^1.6.0"
|
||||
source-map "^0.7.3"
|
||||
|
||||
valid-url@^1.0.9:
|
||||
version "1.0.9"
|
||||
resolved "https://registry.yarnpkg.com/valid-url/-/valid-url-1.0.9.tgz#1c14479b40f1397a75782f115e4086447433a200"
|
||||
@@ -9742,15 +9912,10 @@ wrappy@1:
|
||||
resolved "https://registry.yarnpkg.com/wrappy/-/wrappy-1.0.2.tgz#b5243d8f3ec1aa35f1364605bc0d1036e30ab69f"
|
||||
integrity sha1-tSQ9jz7BqjXxNkYFvA0QNuMKtp8=
|
||||
|
||||
ws@^7.2.3, ws@^7.3.1:
|
||||
version "7.4.1"
|
||||
resolved "https://registry.yarnpkg.com/ws/-/ws-7.4.1.tgz#a333be02696bd0e54cea0434e21dcc8a9ac294bb"
|
||||
integrity sha512-pTsP8UAfhy3sk1lSk/O/s4tjD0CRwvMnzvwr4OKGX7ZvqZtUyx4KIJB5JWbkykPoc55tixMGgTNoh3k4FkNGFQ==
|
||||
|
||||
ws@^7.4.2:
|
||||
version "7.4.2"
|
||||
resolved "https://registry.yarnpkg.com/ws/-/ws-7.4.2.tgz#782100048e54eb36fe9843363ab1c68672b261dd"
|
||||
integrity sha512-T4tewALS3+qsrpGI/8dqNMLIVdq/g/85U98HPMa6F0m6xTbvhXU6RCQLqPH3+SlomNV/LdY6RXEbBpMH6EOJnA==
|
||||
ws@^7.2.3, ws@^7.4.2, ws@^7.4.6:
|
||||
version "7.5.5"
|
||||
resolved "https://registry.yarnpkg.com/ws/-/ws-7.5.5.tgz#8b4bc4af518cfabd0473ae4f99144287b33eb881"
|
||||
integrity sha512-BAkMFcAzl8as1G/hArkxOxq3G7pjUqQ3gzYbLL0/5zNkph70e+lCoxBGnm6AW1+/aiNeV4fnKqZ8m4GZewmH2w==
|
||||
|
||||
ws@~3.3.1:
|
||||
version "3.3.3"
|
||||
@@ -9923,6 +10088,13 @@ yauzl@^2.10.0:
|
||||
buffer-crc32 "~0.2.3"
|
||||
fd-slicer "~1.1.0"
|
||||
|
||||
yazl@^2.5.1:
|
||||
version "2.5.1"
|
||||
resolved "https://registry.yarnpkg.com/yazl/-/yazl-2.5.1.tgz#a3d65d3dd659a5b0937850e8609f22fffa2b5c35"
|
||||
integrity sha512-phENi2PLiHnHb6QBVot+dJnaAZ0xosj7p3fWl+znIjBDlnMI2PsZCJZ306BPTFOaHf5qdDEI8x5qFrSOBN5vrw==
|
||||
dependencies:
|
||||
buffer-crc32 "~0.2.3"
|
||||
|
||||
yeast@0.1.2:
|
||||
version "0.1.2"
|
||||
resolved "https://registry.yarnpkg.com/yeast/-/yeast-0.1.2.tgz#008e06d8094320c372dbc2f8ed76a0ca6c8ac419"
|
||||
|
||||
Reference in New Issue
Block a user