-
Notifications
You must be signed in to change notification settings - Fork 303
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #2143 from ing-bank/feature/start-using-patch-package
chore: start using patch-package
- Loading branch information
Showing
9 changed files
with
284 additions
and
378 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,275 @@ | ||
diff --git a/node_modules/@mdjs/core/src/mdjsParse.js b/node_modules/@mdjs/core/src/mdjsParse.js | ||
index 730e32a..5d6f3f5 100644 | ||
--- a/node_modules/@mdjs/core/src/mdjsParse.js | ||
+++ b/node_modules/@mdjs/core/src/mdjsParse.js | ||
@@ -5,13 +5,12 @@ import { remove } from 'unist-util-remove'; | ||
/** @typedef {import('unist').Node} Node */ | ||
|
||
export function mdjsParse() { | ||
- let jsCode = ''; | ||
- | ||
/** | ||
* @param {Node} tree | ||
* @param {VFileOptions} file | ||
*/ | ||
function transformer(tree, file) { | ||
+ let jsCode = ''; | ||
visit( | ||
tree, | ||
'code', | ||
diff --git a/node_modules/@mdjs/core/src/mdjsSetupCode.js b/node_modules/@mdjs/core/src/mdjsSetupCode.js | ||
index 02a7c56..db3e466 100644 | ||
--- a/node_modules/@mdjs/core/src/mdjsSetupCode.js | ||
+++ b/node_modules/@mdjs/core/src/mdjsSetupCode.js | ||
@@ -76,10 +76,6 @@ export function mdjsSetupCode({ | ||
` Object.assign(storyEl, ${JSON.stringify(simulationSettings)});`, | ||
' }', | ||
`};`, | ||
- 'if (needsMdjsElements) {', | ||
- ` if (!customElements.get('mdjs-preview')) { import('@mdjs/mdjs-preview/define'); }`, | ||
- ` if (!customElements.get('mdjs-story')) { import('@mdjs/mdjs-story/define'); }`, | ||
- '}', | ||
].join('\n'); | ||
} | ||
|
||
diff --git a/node_modules/@mdjs/core/src/mdjsStoryParse.js b/node_modules/@mdjs/core/src/mdjsStoryParse.js | ||
index fe734a3..3ddd3a1 100644 | ||
--- a/node_modules/@mdjs/core/src/mdjsStoryParse.js | ||
+++ b/node_modules/@mdjs/core/src/mdjsStoryParse.js | ||
@@ -54,132 +54,130 @@ export function mdjsStoryParse({ | ||
storyTag = defaultStoryTag, | ||
previewStoryTag = defaultPreviewStoryTag, | ||
} = {}) { | ||
- /** @type {Story[]} */ | ||
- const stories = []; | ||
- let htmlIndex = 0; | ||
- | ||
- /* eslint-disable no-param-reassign */ | ||
- | ||
/** | ||
- * @param {UnistNode} _node | ||
- * @param {number} index | ||
- * @param {UnistParent} parent | ||
+ * @param {Node} tree | ||
+ * @param {VFileOptions} file | ||
*/ | ||
- const nodeCodeVisitor = (_node, index, parent) => { | ||
- let node = /** @type {UnistNode & {[key: string]: unknown}} */ (_node); | ||
- if (node.lang === 'js' && node.meta === 'story' && typeof node.value === 'string') { | ||
- const storyData = extractStoryData(node.value); | ||
- node.type = 'html'; | ||
- node.value = storyTag(storyData.name); | ||
- stories.push(storyData); | ||
- } | ||
- if (node.lang === 'js' && node.meta === 'preview-story' && typeof node.value === 'string') { | ||
- const storyData = extractStoryData(node.value); | ||
- const newValue = previewStoryTag(storyData.name); | ||
- if (newValue.includes('[[CODE SLOT]]')) { | ||
- const tagParts = newValue.split('[[CODE SLOT]]'); | ||
- | ||
- const inside = [node]; | ||
- let skipAmount = 1; | ||
+ async function transformer(tree, file) { | ||
+ /** @type {Story[]} */ | ||
+ const stories = []; | ||
+ let htmlIndex = 0; | ||
+ | ||
+ /** | ||
+ * @param {UnistNode} _node | ||
+ * @param {number} index | ||
+ * @param {UnistParent} parent | ||
+ */ | ||
+ const nodeCodeVisitor = (_node, index, parent) => { | ||
+ let node = /** @type {UnistNode & {[key: string]: unknown}} */ (_node); | ||
+ if (node.lang === 'js' && node.meta === 'story' && typeof node.value === 'string') { | ||
+ const storyData = extractStoryData(node.value); | ||
+ node.type = 'html'; | ||
+ node.value = storyTag(storyData.name); | ||
+ stories.push(storyData); | ||
+ } | ||
+ if (node.lang === 'js' && node.meta === 'preview-story' && typeof node.value === 'string') { | ||
+ const storyData = extractStoryData(node.value); | ||
+ const newValue = previewStoryTag(storyData.name); | ||
+ if (newValue.includes('[[CODE SLOT]]')) { | ||
+ const tagParts = newValue.split('[[CODE SLOT]]'); | ||
|
||
- const next = /** @type {UnistNode & {[key: string]: unknown}} */ ( | ||
- parent.children[index + 1] | ||
- ); | ||
- if (next && next.type === 'code' && next.meta === 'story-code') { | ||
- inside.push(next); | ||
- skipAmount += 1; | ||
+ const inside = [node]; | ||
+ let skipAmount = 1; | ||
|
||
- const next2 = /** @type {UnistNode & {[key: string]: unknown}} */ ( | ||
- parent.children[index + 2] | ||
+ const next = /** @type {UnistNode & {[key: string]: unknown}} */ ( | ||
+ parent.children[index + 1] | ||
); | ||
- if (next2 && next2.type === 'code' && next2.meta === 'story-code') { | ||
- inside.push(next2); | ||
+ if (next && next.type === 'code' && next.meta === 'story-code') { | ||
+ inside.push(next); | ||
skipAmount += 1; | ||
+ | ||
+ const next2 = /** @type {UnistNode & {[key: string]: unknown}} */ ( | ||
+ 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' }, | ||
+ ...inside, | ||
+ { type: 'text', value: '\n\n' }, | ||
+ { type: 'html', value: tagParts[1] }, | ||
+ ], | ||
+ }; | ||
+ parent.children.splice(index, skipAmount, node); | ||
+ } else { | ||
+ node.type = 'html'; | ||
+ node.value = previewStoryTag(storyData.name); | ||
} | ||
|
||
- node = { | ||
- type: 'root', | ||
- children: [ | ||
- { type: 'html', value: tagParts[0] }, | ||
- { type: 'text', value: '\n\n' }, | ||
- ...inside, | ||
- { type: 'text', value: '\n\n' }, | ||
- { type: 'html', value: tagParts[1] }, | ||
- ], | ||
- }; | ||
- parent.children.splice(index, skipAmount, node); | ||
- } else { | ||
- node.type = 'html'; | ||
- node.value = previewStoryTag(storyData.name); | ||
+ stories.push(storyData); | ||
} | ||
|
||
- stories.push(storyData); | ||
- } | ||
- | ||
- if (node.lang === 'html' && node.meta === 'story') { | ||
- const storyData = extractStoryData( | ||
- `export const HtmlStory${htmlIndex} = () => html\`${node.value}\`;`, | ||
- { type: 'html' }, | ||
- ); | ||
- node.type = 'html'; | ||
- node.value = storyTag(storyData.name); | ||
- stories.push(storyData); | ||
- htmlIndex += 1; | ||
- } | ||
- if (node.lang === 'html' && node.meta === 'preview-story') { | ||
- const storyData = extractStoryData( | ||
- `export const HtmlStory${htmlIndex} = () => html\`${node.value}\`;`, | ||
- { type: 'html' }, | ||
- ); | ||
- | ||
- const newValue = previewStoryTag(storyData.name); | ||
- if (newValue.includes('[[CODE SLOT]]')) { | ||
- const tagParts = newValue.split('[[CODE SLOT]]'); | ||
- const inside = [node]; | ||
- let skipAmount = 1; | ||
- const next = /** @type {UnistNode & {[key: string]: unknown}} */ ( | ||
- parent.children[index + 1] | ||
+ if (node.lang === 'html' && node.meta === 'story') { | ||
+ const storyData = extractStoryData( | ||
+ `export const HtmlStory${htmlIndex} = () => html\`${node.value}\`;`, | ||
+ { type: 'html' }, | ||
+ ); | ||
+ node.type = 'html'; | ||
+ node.value = storyTag(storyData.name); | ||
+ stories.push(storyData); | ||
+ htmlIndex += 1; | ||
+ } | ||
+ if (node.lang === 'html' && node.meta === 'preview-story') { | ||
+ const storyData = extractStoryData( | ||
+ `export const HtmlStory${htmlIndex} = () => html\`${node.value}\`;`, | ||
+ { type: 'html' }, | ||
); | ||
- if (next && next.type === 'code' && next.meta === 'story-code') { | ||
- inside.push(next); | ||
- skipAmount += 1; | ||
|
||
- const next2 = /** @type {UnistNode & {[key: string]: unknown}} */ ( | ||
- parent.children[index + 2] | ||
+ const newValue = previewStoryTag(storyData.name); | ||
+ if (newValue.includes('[[CODE SLOT]]')) { | ||
+ const tagParts = newValue.split('[[CODE SLOT]]'); | ||
+ const inside = [node]; | ||
+ let skipAmount = 1; | ||
+ const next = /** @type {UnistNode & {[key: string]: unknown}} */ ( | ||
+ parent.children[index + 1] | ||
); | ||
- if (next2 && next2.type === 'code' && next2.meta === 'story-code') { | ||
- inside.push(next2); | ||
+ if (next && next.type === 'code' && next.meta === 'story-code') { | ||
+ inside.push(next); | ||
skipAmount += 1; | ||
+ | ||
+ const next2 = /** @type {UnistNode & {[key: string]: unknown}} */ ( | ||
+ 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' }, | ||
+ ...inside, | ||
+ { type: 'text', value: '\n\n' }, | ||
+ { type: 'html', value: tagParts[1] }, | ||
+ ], | ||
+ }; | ||
+ parent.children.splice(index, skipAmount, node); | ||
+ } else { | ||
+ node.type = 'html'; | ||
+ node.value = previewStoryTag(storyData.name); | ||
} | ||
|
||
- node = { | ||
- type: 'root', | ||
- children: [ | ||
- { type: 'html', value: tagParts[0] }, | ||
- { type: 'text', value: '\n\n' }, | ||
- ...inside, | ||
- { type: 'text', value: '\n\n' }, | ||
- { type: 'html', value: tagParts[1] }, | ||
- ], | ||
- }; | ||
- parent.children.splice(index, skipAmount, node); | ||
- } else { | ||
- node.type = 'html'; | ||
- node.value = previewStoryTag(storyData.name); | ||
+ stories.push(storyData); | ||
+ htmlIndex += 1; | ||
} | ||
+ }; | ||
|
||
- stories.push(storyData); | ||
- htmlIndex += 1; | ||
- } | ||
- }; | ||
- | ||
- /** | ||
- * @param {Node} tree | ||
- * @param {VFileOptions} file | ||
- */ | ||
- async function transformer(tree, file) { | ||
// unifiedjs expects node changes to be made on the given node... | ||
await init; | ||
// @ts-ignore |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
diff --git a/node_modules/lit/index.js b/node_modules/lit/index.js | ||
index 599d7d0..68a9dcb 100644 | ||
--- a/node_modules/lit/index.js | ||
+++ b/node_modules/lit/index.js | ||
@@ -1,2 +1,2 @@ | ||
-import"@lit/reactive-element";import"lit-html";export*from"lit-element/lit-element.js";export*from"lit-html/is-server.js"; | ||
+import"@lit/reactive-element";import"lit-html";export { nothing } from 'lit-html';export*from"lit-element/lit-element.js";export*from"lit-html/is-server.js"; | ||
//# sourceMappingURL=index.js.map |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.