diff --git a/packages/svelte-template-compiler/src/ir/svelte.test.ts b/packages/svelte-template-compiler/src/ir/svelte.test.ts index 59ce26f..a87fe24 100644 --- a/packages/svelte-template-compiler/src/ir/svelte.test.ts +++ b/packages/svelte-template-compiler/src/ir/svelte.test.ts @@ -301,14 +301,13 @@ describe('enableStructures', () => { expect(awaitBlock.parent).toEqual(div) expect(awaitBlock.prev).toEqual(h) expect(awaitBlock.next).toBeUndefined() - // {:pending} const pendingBlock = awaitBlock.pending as SveltePendingBlock expect(pendingBlock.parent).toEqual(awaitBlock) expect(pendingBlock.prev).toBeUndefined() expect(pendingBlock.next).toBeUndefined() - // p inside {:pending} + // p inside {#await} const pInsidePending = pendingBlock.children[1] - expect(pInsidePending.parent).toEqual(pendingBlock) + expect(pInsidePending.parent).toEqual(awaitBlock) expect(pInsidePending.prev).toBeUndefined() // {:then} const thenBlock = awaitBlock.then as SvelteThenBlock @@ -317,7 +316,7 @@ describe('enableStructures', () => { expect(thenBlock.next).toBeUndefined() // p inside {:then} const pInsideThen = thenBlock.children[1] - expect(pInsideThen.parent).toEqual(thenBlock) + expect(pInsideThen.parent).toEqual(awaitBlock) expect(pInsideThen.prev).toBeUndefined() // {:catch} const catchBlock = awaitBlock.catch as SvelteElseBlock @@ -326,7 +325,7 @@ describe('enableStructures', () => { expect(catchBlock.next).toBeUndefined() // p inside {:catch} const pInsideCatch = catchBlock.children[1] - expect(pInsideCatch.parent).toEqual(catchBlock) + expect(pInsideCatch.parent).toEqual(awaitBlock) expect(pInsideCatch.prev).toBeUndefined() }) @@ -358,14 +357,13 @@ describe('enableStructures', () => { expect(awaitBlock.parent).toEqual(div) expect(awaitBlock.prev).toEqual(h) expect(awaitBlock.next).toBeUndefined() - // {:pending} const pendingBlock = awaitBlock.pending as SveltePendingBlock expect(pendingBlock.parent).toEqual(awaitBlock) expect(pendingBlock.prev).toBeUndefined() expect(pendingBlock.next).toBeUndefined() - // p inside {:pending} + // p inside {:await} const pInsidePending = pendingBlock.children[1] - expect(pInsidePending.parent).toEqual(pendingBlock) + expect(pInsidePending.parent).toEqual(awaitBlock) expect(pInsidePending.prev).toBeUndefined() // {:then} const thenBlock = awaitBlock.then as SvelteThenBlock @@ -374,7 +372,7 @@ describe('enableStructures', () => { expect(thenBlock.next).toBeUndefined() // p inside {:then} const pInsideThen = thenBlock.children[1] - expect(pInsideThen.parent).toEqual(thenBlock) + expect(pInsideThen.parent).toEqual(awaitBlock) expect(pInsideThen.prev).toBeUndefined() }) @@ -404,7 +402,6 @@ describe('enableStructures', () => { expect(awaitBlock.parent).toEqual(div) expect(awaitBlock.prev).toEqual(h) expect(awaitBlock.next).toBeUndefined() - // {:pending} const pendingBlock = awaitBlock.pending as SveltePendingBlock expect(pendingBlock.parent).toEqual(awaitBlock) expect(pendingBlock.prev).toBeUndefined() @@ -416,7 +413,7 @@ describe('enableStructures', () => { expect(thenBlock.next).toBeUndefined() // p inside {:then} const pInsideThen = thenBlock.children[1] - expect(pInsideThen.parent).toEqual(thenBlock) + expect(pInsideThen.parent).toEqual(awaitBlock) expect(pInsideThen.prev).toBeUndefined() }) @@ -446,7 +443,6 @@ describe('enableStructures', () => { expect(awaitBlock.parent).toEqual(div) expect(awaitBlock.prev).toEqual(h) expect(awaitBlock.next).toBeUndefined() - // {:pending} const pendingBlock = awaitBlock.pending as SveltePendingBlock expect(pendingBlock.parent).toEqual(awaitBlock) expect(pendingBlock.prev).toBeUndefined() @@ -463,7 +459,7 @@ describe('enableStructures', () => { expect(catchBlock.next).toBeUndefined() // p inside {:catch} const pInsideCatch = catchBlock.children[1] - expect(pInsideCatch.parent).toEqual(catchBlock) + expect(pInsideCatch.parent).toEqual(awaitBlock) expect(pInsideCatch.prev).toBeUndefined() }) }) diff --git a/packages/svelte-template-compiler/src/ir/svelte.ts b/packages/svelte-template-compiler/src/ir/svelte.ts index aaab224..105ed06 100644 --- a/packages/svelte-template-compiler/src/ir/svelte.ts +++ b/packages/svelte-template-compiler/src/ir/svelte.ts @@ -229,21 +229,23 @@ export type CompatLocationable = { export function enableStructures(node: SvelteTemplateNode): void { let last: SvelteTemplateNode | undefined const children = node.children || [] - if (__DEV__) { - console.log('enableStructures type:', node.type, node.parent?.type, children.length) + + if (node.type === 'Fragment') { + node.parent = null // eslint-disable-line unicorn/no-null } - children.forEach(child => { - if (__DEV__) { - console.log('enableStructures child type:', child.type) - } + const parent = + isSveltePendingBlock(node) || isSvelteThenBlock(node) || isSvelteCatchBlock(node) + ? node.parent + : node + children.forEach(child => { // ignores if (isSvelteText(child) || isSvelteComponentTag(child)) { return } - child.parent = node + child.parent = parent if (last) { last.next = child diff --git a/packages/svelte-template-compiler/src/style/selector.ts b/packages/svelte-template-compiler/src/style/selector.ts index a1a399a..e2f26fe 100644 --- a/packages/svelte-template-compiler/src/style/selector.ts +++ b/packages/svelte-template-compiler/src/style/selector.ts @@ -58,8 +58,8 @@ export class Block { root: boolean combinator: CssNode | null selectors: CssNode[] - start: number | null - end: number | null + start: number + end: number shouldEncapsulate: boolean constructor(combinator: CssNode | null) { @@ -67,8 +67,8 @@ export class Block { this.host = false this.root = false this.selectors = [] - this.start = null // eslint-disable-line unicorn/no-null - this.end = null // eslint-disable-line unicorn/no-null + this.start = -1 + this.end = -1 this.shouldEncapsulate = false } @@ -100,7 +100,6 @@ function groupSelectors(selector: CssNode): Block[] { if (hasChildren(selector)) { selector.children?.forEach((child, _index) => { - // console.log('groupSelectors', child.type, JSON.stringify(child), index) if (isWhiteSpace(child) || isCombinator(child)) { block = new Block(child) blocks.push(block) @@ -118,7 +117,6 @@ export function applySelector( node: SvelteElement | undefined, toEncapsulate: { node: SvelteElement; block: Block }[] ): boolean { - // console.log('applySelector', '-', node?.type, node?.name, JSON.stringify(node?.attributes), blocks.length, '-') const block = blocks.pop() if (!block) { @@ -170,6 +168,8 @@ export function applySelector( toEncapsulate.push({ node, block }) return true } + + return false } else if (isCombinator(block.combinator) && block.combinator.name === '>') { const hasGlobalParent = blocks.every(block => block.global) @@ -188,7 +188,6 @@ export function applySelector( isCombinator(block.combinator) && (block.combinator.name === '+' || block.combinator.name === '~') ) { - // console.log('applySelector', 'type', node.type, 'combinator', block.combinator.name, JSON.stringify(block)) const [siblings, hasSlotSibling] = getPossibleElementSiblings( node, block.combinator.name === '+' @@ -207,7 +206,6 @@ export function applySelector( } for (const possibleSibling of siblings.keys()) { - // console.log('applySelector possibleSibling', possibleSibling.type, possibleSibling.name) // eslint-disable-next-line unicorn/prefer-spread if (applySelector(blocks.slice(), possibleSibling as SvelteElement, toEncapsulate)) { toEncapsulate.push({ node, block }) @@ -240,11 +238,13 @@ const WHITELIST_ATTRIBUTE_SELECTOR = new Map([ ]) function blockMightApplyToNode(block: Block, node: SvelteElement): BlockAppliesToNode { - // console.log('blockMightApplyToNode', node.type, node.name, JSON.stringify(node.attributes), block.selectors.length) + if (block.host || block.root) { + return BlockAppliesToNode.NotPossible + } + let i = block.selectors.length while (i--) { const selector = block.selectors[i] - // console.log('blockMightApplyToNode selector', selector.type, JSON.stringify(selector), i) const name = hasName(selector) && @@ -333,7 +333,6 @@ function attributeMatches( operator: string, caseInsensitive: boolean ): boolean { - // console.log('attributeMatches', name, expectedValue, operator, caseInsensitive) // const spread = node.attributes.find((attr) => attr.type === 'Spread'); const spread = node.attributes.find(attr => isSvelteSpreadAttribute(attr)) if (spread) { @@ -537,9 +536,10 @@ function isDynamicElement(node: SvelteElement): boolean { } function getElementParent(node: SvelteTemplateNode): SvelteElement | undefined { - let parent: SvelteTemplateNode | undefined = node + let parent: SvelteTemplateNode | undefined | null = node + // while ((parent = parent.parent) && !(isSvelteElement(parent) || parent?.type === 'Fragment')); while ((parent = parent.parent) && !isSvelteElement(parent)); - return parent + return parent as unknown as SvelteElement } enum NodeExist { @@ -551,18 +551,19 @@ function getPossibleElementSiblings( node: SvelteTemplateNode, adjacentOnly: boolean ): [Map, boolean] { - // console.log('getPossibleElementSiblings', node.type, JSON.stringify(node.attributes), adjacentOnly) const result = new Map() let prev: SvelteTemplateNode | undefined = node let hasSlotSibling = false let slotSiblingFound = false - while (([prev, slotSiblingFound] = findPreviousSibling(prev)) && prev) { - // console.log('getPossibleElementSiblings loop', prev?.type) - if (isSvelteElement(prev)) { - hasSlotSibling = hasSlotSibling || slotSiblingFound + while (([prev, slotSiblingFound] = findPreviousSibling(prev))) { + hasSlotSibling = hasSlotSibling || slotSiblingFound + if (!prev) { + break + } + if (isSvelteElement(prev)) { if ( // eslint-disable-next-line unicorn/prefer-array-some !prev.attributes.find(attr => isSvelteAttribute(attr) && attr.name.toLowerCase() === 'slot') @@ -575,7 +576,6 @@ function getPossibleElementSiblings( } } else if (prev.type === 'EachBlock' || prev.type === 'IfBlock' || prev.type === 'AwaitBlock') { const possibleLastChild = getPossibleLastChild(prev, adjacentOnly) - // console.log('getPossibleElementSiblings possibleLastChild', possibleLastChild) addToMap(possibleLastChild, result) if (adjacentOnly && hasDefiniteElements(possibleLastChild)) { return [result, hasSlotSibling] @@ -584,9 +584,8 @@ function getPossibleElementSiblings( } if (!prev || !adjacentOnly) { - let parent: SvelteTemplateNode | undefined = node + let parent: SvelteTemplateNode | undefined | null = node let skipEachForLastChild = node.type === 'ElseBlock' - // console.log('getPossibleElementSiblings deep', parent?.type, skipEachForLastChild) while ( (parent = parent.parent) && (parent.type === 'EachBlock' || @@ -594,7 +593,6 @@ function getPossibleElementSiblings( parent.type === 'ElseBlock' || parent.type === 'AwaitBlock') ) { - // console.log('getPossibleElementSiblings deep in', parent?.type) const [possibleSiblings, slotSiblingFound] = getPossibleElementSiblings(parent, adjacentOnly) hasSlotSibling = hasSlotSibling || slotSiblingFound addToMap(possibleSiblings, result) @@ -640,7 +638,7 @@ function findPreviousSibling(node: SvelteTemplateNode): [SvelteTemplateNode | un currentNode = currentNode.parent } currentNode = currentNode.prev - } while (currentNode != null && isSvelteSlot(currentNode)) // eslint-disable-line unicorn/no-null + } while (currentNode && isSvelteSlot(currentNode)) return [currentNode, hasSlotSibling] } @@ -649,7 +647,6 @@ function getPossibleLastChild( block: SvelteTemplateNode, adjacentOnly: boolean ): Map { - // console.log('getPossibleLastChild', block.type, adjacentOnly) const result = new Map() const blockChildren = block.children || [] @@ -757,7 +754,6 @@ function loopChild( for (let i = children.length - 1; i >= 0; i--) { const child = children[i] - // console.log('loopChild child.type', child.type) if (isSvelteElement(child)) { result.set(child, NodeExist.Definitely) diff --git a/packages/svelte-template-compiler/src/style/stylesheet.test.ts b/packages/svelte-template-compiler/src/style/stylesheet.test.ts index 7503ebb..2fcd758 100644 --- a/packages/svelte-template-compiler/src/style/stylesheet.test.ts +++ b/packages/svelte-template-compiler/src/style/stylesheet.test.ts @@ -181,12 +181,11 @@ describe('render with fixtures', async () => { const ast = parse(input) enableStructures(ast.html) const stylesheet = new SvelteStylesheet( - Object.assign({}, { ast: ast.css!, source: input }, config.compilerOptions || {}) + Object.assign({}, { ast: ast.css!, source: input }, config.compileOptions || {}) ) walk(ast.html, { enter(node) { if (isSvelteElement(node)) { - // console.log('applying ...', node.type, node.name, JSON.stringify(node.attributes)) stylesheet.apply(node) } } diff --git a/packages/svelte-template-compiler/src/style/stylesheet.ts b/packages/svelte-template-compiler/src/style/stylesheet.ts index 103a1b9..ee6343a 100644 --- a/packages/svelte-template-compiler/src/style/stylesheet.ts +++ b/packages/svelte-template-compiler/src/style/stylesheet.ts @@ -10,7 +10,7 @@ import { pushArray } from 'inclusion-vapor-shared' import { MagicStringAST } from 'magic-string-ast' import { createAttributeChunks, isSvelteSpreadAttribute, isSvelteText } from '../ir/index.ts' import { hash } from '../utils.ts' -import { hasChildren, hasProperty, isCombinator, isWhiteSpace } from './csstree.ts' +import { hasChildren, isCombinator, isWhiteSpace } from './csstree.ts' import { Selector, applySelector } from './selector.ts' import type { @@ -36,7 +36,7 @@ const getDefaultCssHash = (css: string, hash: (str: string) => string): string = export class SvelteStylesheet { ast: SvelteStyle - dev: boolean = true + dev: boolean source: string = '' filename: string = '' id: string = '' @@ -120,11 +120,8 @@ export class SvelteStylesheet { } apply(node: SvelteElement, incremental = false): void { - // for (const child of this.children) { - // apply(node, child, this) - // } - for (let i = 0; i < this.children.length; i += 1) { - apply(node, this.children[i], this) + for (const child of this.children) { + apply(node, child, this) } if (incremental) { this.reify() @@ -235,12 +232,9 @@ class Rule { this.selectors = hasChildren(node.prelude) ? (node.prelude.children.map(node => new Selector(node)) as unknown as Selector[]) : [] - // this.declarations = node.block.children.map( - // node => new Declaration(node) - // ) as unknown as Declaration[] - this.declarations = node.block.children - .filter(hasProperty) // eslint-disable-line unicorn/no-array-callback-reference - .map(node => new Declaration(node)) as unknown as Declaration[] + this.declarations = node.block.children.map( + node => new Declaration(node) + ) as unknown as Declaration[] } } @@ -254,8 +248,8 @@ class Atrule { } class Declaration { - node: CssDeclaration - constructor(node: CssDeclaration) { + node: CssNode + constructor(node: CssNode) { this.node = node } } @@ -267,12 +261,9 @@ function apply( ): void { if (css instanceof Rule) { // for Rule - // for (const selector of css.selectors) { - // apply(node, selector, stylesheet) - // } - css.selectors.forEach(selector => { + for (const selector of css.selectors) { apply(node, selector, stylesheet) - }) + } } else if (css instanceof Atrule) { // for Atrule if ( @@ -281,45 +272,30 @@ function apply( css.node.name === 'supports' || css.node.name === 'layer' ) { - // for (const child of css.children) { - // apply(node, child, stylesheet) - // } - css.children.forEach(child => { + for (const child of css.children) { apply(node, child, stylesheet) - }) + } } else if (isKeyFramesNode(css.node)) { - // for (const rule of css.children) { - // if (rule instanceof Rule) { - // for (const selector of rule.selectors) { - // selector.used = true - // } - // } - // } - css.children.forEach(rule => { + for (const rule of css.children) { if (rule instanceof Rule) { - rule.selectors.forEach(selector => { + for (const selector of rule.selectors) { selector.used = true - }) + } } - }) + } } } else if (css instanceof Selector) { // for Selector const toEncapsulate: { node: SvelteElement; block: Block }[] = [] - // console.log('css.localBlocks', JSON.stringify(css.localBlocks), css.localBlocks.length) // eslint-disable-next-line unicorn/prefer-spread applySelector(css.localBlocks.slice(), node, toEncapsulate) if (toEncapsulate.length > 0) { - // for (const { node: templateNode, block } of toEncapsulate) { - // stylesheet.nodesWithCssClass.add(templateNode) - // block.shouldEncapsulate = true - // } - toEncapsulate.forEach(({ node: templateNode, block }) => { + for (const { node: templateNode, block } of toEncapsulate) { stylesheet.nodesWithCssClass.add(templateNode) block.shouldEncapsulate = true - }) + } css.used = true } } else { @@ -454,7 +430,7 @@ function transform( max - css.blocks.filter(block => block.shouldEncapsulate).length css.blocks.forEach((block, index) => { if (block.global) { - removeGlobalResudoClass(code, block.selectors[0] as CssNodeWithChildren) + removeGlobalPesudoClass(code, block.selectors[0] as CssNodeWithChildren) } if (block.shouldEncapsulate) { encapsulateBlock( @@ -466,16 +442,18 @@ function transform( }) } else if (css instanceof Declaration) { // for Declaration - const property = removeCssPrefix(css.node.property.toLowerCase()) - if ( - (property === 'animation' || property === 'animation-name') && - hasChildren(css.node.value) - ) { - for (const block of css.node.value.children) { - if (block.type === 'Identifier') { - const name = block.name - if (keyframes.has(name)) { - code.update(block.start!, block.end!, keyframes.get(name)!) + if (css.node.type === 'Declaration') { + const property = removeCssPrefix(css.node.property.toLowerCase()) + if ( + (property === 'animation' || property === 'animation-name') && + hasChildren(css.node.value) + ) { + for (const block of css.node.value.children) { + if (block.type === 'Identifier') { + const name = block.name + if (keyframes.has(name)) { + code.update(block.start!, block.end!, keyframes.get(name)!) + } } } } @@ -485,7 +463,7 @@ function transform( } } -function removeGlobalResudoClass(code: MagicStringAST, selector: CssNodeWithChildren): void { +function removeGlobalPesudoClass(code: MagicStringAST, selector: CssNodeWithChildren): void { if (!hasChildren(selector)) { throw new TypeError('selector children is null') } @@ -499,7 +477,7 @@ function removeGlobalResudoClass(code: MagicStringAST, selector: CssNodeWithChil function encapsulateBlock(code: MagicStringAST, block: Block, attr: string): void { for (const selector of block.selectors) { if (selector.type === 'PseudoClassSelector' && selector.name === 'global') { - removeGlobalResudoClass(code, selector) + removeGlobalPesudoClass(code, selector) } } let i = block.selectors.length @@ -609,7 +587,7 @@ function minify( // for Selector let c: number | null = null // eslint-disable-line unicorn/no-null css.blocks.forEach((block, i) => { - if (i > 0 && block.start! - c! > 1) { + if (i > 0 && block.start - c! > 1) { // prettier-ignore const v = block.combinator == null // eslint-disable-line unicorn/no-null ? ' ' @@ -618,13 +596,13 @@ function minify( : isWhiteSpace(block.combinator) ? block.combinator.value : ' ' - code.update(c!, block.start!, v) + code.update(c!, block.start, v) } c = block.end }) } else if (css instanceof Declaration) { // for Declaration - if (!css.node.property) { + if (!(css.node.type === 'Declaration' && css.node.property)) { // @apply, and possibly other weird cases? return } diff --git a/packages/svelte-template-compiler/test/fixtures/custom-css-hash.skip/_config.js b/packages/svelte-template-compiler/test/fixtures/custom-css-hash.skip/_config.js deleted file mode 100644 index 3d55fa1..0000000 --- a/packages/svelte-template-compiler/test/fixtures/custom-css-hash.skip/_config.js +++ /dev/null @@ -1,12 +0,0 @@ -export default { - compileOptions: { - filename: 'src/components/FooSwitcher.svelte', - cssHash({ hash, css, name, filename }) { - const min_filename = filename - .split('/') - .map((i) => i.charAt(0).toLowerCase()) - .join(''); - return `sv-${name}-${min_filename}-${hash(css)}`; - } - } -}; diff --git a/packages/svelte-template-compiler/test/fixtures/custom-css-hash.skip/expected.css b/packages/svelte-template-compiler/test/fixtures/custom-css-hash.skip/expected.css deleted file mode 100644 index fe71059..0000000 --- a/packages/svelte-template-compiler/test/fixtures/custom-css-hash.skip/expected.css +++ /dev/null @@ -1 +0,0 @@ -div.sv-FooSwitcher-scf-bzh57p{color:red} \ No newline at end of file diff --git a/packages/svelte-template-compiler/test/fixtures/custom-css-hash/config.js b/packages/svelte-template-compiler/test/fixtures/custom-css-hash/config.js new file mode 100644 index 0000000..af55bb1 --- /dev/null +++ b/packages/svelte-template-compiler/test/fixtures/custom-css-hash/config.js @@ -0,0 +1,8 @@ +export default { + compileOptions: { + filename: 'src/components/FooSwitcher.svelte', + cssHash(css, hash) { + return `sv-${hash(css)}` + } + } +} diff --git a/packages/svelte-template-compiler/test/fixtures/custom-css-hash/expected.css b/packages/svelte-template-compiler/test/fixtures/custom-css-hash/expected.css new file mode 100644 index 0000000..8306d18 --- /dev/null +++ b/packages/svelte-template-compiler/test/fixtures/custom-css-hash/expected.css @@ -0,0 +1 @@ +div.sv-11ol9nw{color:red} diff --git a/packages/svelte-template-compiler/test/fixtures/custom-css-hash.skip/input.svelte b/packages/svelte-template-compiler/test/fixtures/custom-css-hash/input.svelte similarity index 100% rename from packages/svelte-template-compiler/test/fixtures/custom-css-hash.skip/input.svelte rename to packages/svelte-template-compiler/test/fixtures/custom-css-hash/input.svelte diff --git a/packages/svelte-template-compiler/test/fixtures/empty-rule-dev/_config.js b/packages/svelte-template-compiler/test/fixtures/empty-rule-dev/config.js similarity index 100% rename from packages/svelte-template-compiler/test/fixtures/empty-rule-dev/_config.js rename to packages/svelte-template-compiler/test/fixtures/empty-rule-dev/config.js diff --git a/packages/svelte-template-compiler/test/fixtures/empty-rule/config.js b/packages/svelte-template-compiler/test/fixtures/empty-rule/config.js new file mode 100644 index 0000000..001e6d7 --- /dev/null +++ b/packages/svelte-template-compiler/test/fixtures/empty-rule/config.js @@ -0,0 +1,5 @@ +export default { + compileOptions: { + dev: false + } +}; diff --git a/packages/svelte-template-compiler/test/fixtures/empty-rule.skip/expected.css b/packages/svelte-template-compiler/test/fixtures/empty-rule/expected.css similarity index 100% rename from packages/svelte-template-compiler/test/fixtures/empty-rule.skip/expected.css rename to packages/svelte-template-compiler/test/fixtures/empty-rule/expected.css diff --git a/packages/svelte-template-compiler/test/fixtures/empty-rule.skip/input.svelte b/packages/svelte-template-compiler/test/fixtures/empty-rule/input.svelte similarity index 100% rename from packages/svelte-template-compiler/test/fixtures/empty-rule.skip/input.svelte rename to packages/svelte-template-compiler/test/fixtures/empty-rule/input.svelte diff --git a/packages/svelte-template-compiler/test/fixtures/general-siblings-combinator-await-not-exhaustive.skip/_config.js b/packages/svelte-template-compiler/test/fixtures/general-siblings-combinator-await-not-exhaustive/_config.js similarity index 100% rename from packages/svelte-template-compiler/test/fixtures/general-siblings-combinator-await-not-exhaustive.skip/_config.js rename to packages/svelte-template-compiler/test/fixtures/general-siblings-combinator-await-not-exhaustive/_config.js diff --git a/packages/svelte-template-compiler/test/fixtures/general-siblings-combinator-await-not-exhaustive.skip/expected.css b/packages/svelte-template-compiler/test/fixtures/general-siblings-combinator-await-not-exhaustive/expected.css similarity index 100% rename from packages/svelte-template-compiler/test/fixtures/general-siblings-combinator-await-not-exhaustive.skip/expected.css rename to packages/svelte-template-compiler/test/fixtures/general-siblings-combinator-await-not-exhaustive/expected.css diff --git a/packages/svelte-template-compiler/test/fixtures/general-siblings-combinator-await-not-exhaustive.skip/expected.html b/packages/svelte-template-compiler/test/fixtures/general-siblings-combinator-await-not-exhaustive/expected.html similarity index 100% rename from packages/svelte-template-compiler/test/fixtures/general-siblings-combinator-await-not-exhaustive.skip/expected.html rename to packages/svelte-template-compiler/test/fixtures/general-siblings-combinator-await-not-exhaustive/expected.html diff --git a/packages/svelte-template-compiler/test/fixtures/general-siblings-combinator-await-not-exhaustive.skip/input.svelte b/packages/svelte-template-compiler/test/fixtures/general-siblings-combinator-await-not-exhaustive/input.svelte similarity index 100% rename from packages/svelte-template-compiler/test/fixtures/general-siblings-combinator-await-not-exhaustive.skip/input.svelte rename to packages/svelte-template-compiler/test/fixtures/general-siblings-combinator-await-not-exhaustive/input.svelte diff --git a/packages/svelte-template-compiler/test/fixtures/general-siblings-combinator-await.skip/_config.js b/packages/svelte-template-compiler/test/fixtures/general-siblings-combinator-await/_config.js similarity index 100% rename from packages/svelte-template-compiler/test/fixtures/general-siblings-combinator-await.skip/_config.js rename to packages/svelte-template-compiler/test/fixtures/general-siblings-combinator-await/_config.js diff --git a/packages/svelte-template-compiler/test/fixtures/general-siblings-combinator-await.skip/expected.css b/packages/svelte-template-compiler/test/fixtures/general-siblings-combinator-await/expected.css similarity index 100% rename from packages/svelte-template-compiler/test/fixtures/general-siblings-combinator-await.skip/expected.css rename to packages/svelte-template-compiler/test/fixtures/general-siblings-combinator-await/expected.css diff --git a/packages/svelte-template-compiler/test/fixtures/general-siblings-combinator-await.skip/expected.html b/packages/svelte-template-compiler/test/fixtures/general-siblings-combinator-await/expected.html similarity index 100% rename from packages/svelte-template-compiler/test/fixtures/general-siblings-combinator-await.skip/expected.html rename to packages/svelte-template-compiler/test/fixtures/general-siblings-combinator-await/expected.html diff --git a/packages/svelte-template-compiler/test/fixtures/general-siblings-combinator-await.skip/input.svelte b/packages/svelte-template-compiler/test/fixtures/general-siblings-combinator-await/input.svelte similarity index 100% rename from packages/svelte-template-compiler/test/fixtures/general-siblings-combinator-await.skip/input.svelte rename to packages/svelte-template-compiler/test/fixtures/general-siblings-combinator-await/input.svelte diff --git a/packages/svelte-template-compiler/test/fixtures/host.skip/_config.js b/packages/svelte-template-compiler/test/fixtures/host/_config.js similarity index 100% rename from packages/svelte-template-compiler/test/fixtures/host.skip/_config.js rename to packages/svelte-template-compiler/test/fixtures/host/_config.js diff --git a/packages/svelte-template-compiler/test/fixtures/host.skip/expected.css b/packages/svelte-template-compiler/test/fixtures/host/expected.css similarity index 100% rename from packages/svelte-template-compiler/test/fixtures/host.skip/expected.css rename to packages/svelte-template-compiler/test/fixtures/host/expected.css diff --git a/packages/svelte-template-compiler/test/fixtures/host.skip/input.svelte b/packages/svelte-template-compiler/test/fixtures/host/input.svelte similarity index 100% rename from packages/svelte-template-compiler/test/fixtures/host.skip/input.svelte rename to packages/svelte-template-compiler/test/fixtures/host/input.svelte diff --git a/packages/svelte-template-compiler/test/fixtures/siblings-combinator-await-not-exhaustive.skip/_config.js b/packages/svelte-template-compiler/test/fixtures/siblings-combinator-await-not-exhaustive/_config.js similarity index 100% rename from packages/svelte-template-compiler/test/fixtures/siblings-combinator-await-not-exhaustive.skip/_config.js rename to packages/svelte-template-compiler/test/fixtures/siblings-combinator-await-not-exhaustive/_config.js diff --git a/packages/svelte-template-compiler/test/fixtures/siblings-combinator-await-not-exhaustive.skip/expected.css b/packages/svelte-template-compiler/test/fixtures/siblings-combinator-await-not-exhaustive/expected.css similarity index 100% rename from packages/svelte-template-compiler/test/fixtures/siblings-combinator-await-not-exhaustive.skip/expected.css rename to packages/svelte-template-compiler/test/fixtures/siblings-combinator-await-not-exhaustive/expected.css diff --git a/packages/svelte-template-compiler/test/fixtures/siblings-combinator-await-not-exhaustive.skip/expected.html b/packages/svelte-template-compiler/test/fixtures/siblings-combinator-await-not-exhaustive/expected.html similarity index 100% rename from packages/svelte-template-compiler/test/fixtures/siblings-combinator-await-not-exhaustive.skip/expected.html rename to packages/svelte-template-compiler/test/fixtures/siblings-combinator-await-not-exhaustive/expected.html diff --git a/packages/svelte-template-compiler/test/fixtures/siblings-combinator-await-not-exhaustive.skip/input.svelte b/packages/svelte-template-compiler/test/fixtures/siblings-combinator-await-not-exhaustive/input.svelte similarity index 100% rename from packages/svelte-template-compiler/test/fixtures/siblings-combinator-await-not-exhaustive.skip/input.svelte rename to packages/svelte-template-compiler/test/fixtures/siblings-combinator-await-not-exhaustive/input.svelte diff --git a/packages/svelte-template-compiler/test/fixtures/siblings-combinator-await.skip/_config.js b/packages/svelte-template-compiler/test/fixtures/siblings-combinator-await/_config.js similarity index 100% rename from packages/svelte-template-compiler/test/fixtures/siblings-combinator-await.skip/_config.js rename to packages/svelte-template-compiler/test/fixtures/siblings-combinator-await/_config.js diff --git a/packages/svelte-template-compiler/test/fixtures/siblings-combinator-await.skip/expected.css b/packages/svelte-template-compiler/test/fixtures/siblings-combinator-await/expected.css similarity index 100% rename from packages/svelte-template-compiler/test/fixtures/siblings-combinator-await.skip/expected.css rename to packages/svelte-template-compiler/test/fixtures/siblings-combinator-await/expected.css diff --git a/packages/svelte-template-compiler/test/fixtures/siblings-combinator-await.skip/expected.html b/packages/svelte-template-compiler/test/fixtures/siblings-combinator-await/expected.html similarity index 100% rename from packages/svelte-template-compiler/test/fixtures/siblings-combinator-await.skip/expected.html rename to packages/svelte-template-compiler/test/fixtures/siblings-combinator-await/expected.html diff --git a/packages/svelte-template-compiler/test/fixtures/siblings-combinator-await.skip/input.svelte b/packages/svelte-template-compiler/test/fixtures/siblings-combinator-await/input.svelte similarity index 100% rename from packages/svelte-template-compiler/test/fixtures/siblings-combinator-await.skip/input.svelte rename to packages/svelte-template-compiler/test/fixtures/siblings-combinator-await/input.svelte diff --git a/packages/svelte-template-compiler/test/fixtures/siblings-combinator-global-slots.skip/_config.js b/packages/svelte-template-compiler/test/fixtures/siblings-combinator-global-slots/_config.js similarity index 100% rename from packages/svelte-template-compiler/test/fixtures/siblings-combinator-global-slots.skip/_config.js rename to packages/svelte-template-compiler/test/fixtures/siblings-combinator-global-slots/_config.js diff --git a/packages/svelte-template-compiler/test/fixtures/siblings-combinator-global-slots.skip/expected.css b/packages/svelte-template-compiler/test/fixtures/siblings-combinator-global-slots/expected.css similarity index 100% rename from packages/svelte-template-compiler/test/fixtures/siblings-combinator-global-slots.skip/expected.css rename to packages/svelte-template-compiler/test/fixtures/siblings-combinator-global-slots/expected.css diff --git a/packages/svelte-template-compiler/test/fixtures/siblings-combinator-global-slots.skip/input.svelte b/packages/svelte-template-compiler/test/fixtures/siblings-combinator-global-slots/input.svelte similarity index 100% rename from packages/svelte-template-compiler/test/fixtures/siblings-combinator-global-slots.skip/input.svelte rename to packages/svelte-template-compiler/test/fixtures/siblings-combinator-global-slots/input.svelte diff --git a/packages/svelte-template-compiler/test/fixtures/siblings-combinator-global.skip/_config.js b/packages/svelte-template-compiler/test/fixtures/siblings-combinator-global/_config.js similarity index 100% rename from packages/svelte-template-compiler/test/fixtures/siblings-combinator-global.skip/_config.js rename to packages/svelte-template-compiler/test/fixtures/siblings-combinator-global/_config.js diff --git a/packages/svelte-template-compiler/test/fixtures/siblings-combinator-global.skip/expected.css b/packages/svelte-template-compiler/test/fixtures/siblings-combinator-global/expected.css similarity index 100% rename from packages/svelte-template-compiler/test/fixtures/siblings-combinator-global.skip/expected.css rename to packages/svelte-template-compiler/test/fixtures/siblings-combinator-global/expected.css diff --git a/packages/svelte-template-compiler/test/fixtures/siblings-combinator-global.skip/input.svelte b/packages/svelte-template-compiler/test/fixtures/siblings-combinator-global/input.svelte similarity index 100% rename from packages/svelte-template-compiler/test/fixtures/siblings-combinator-global.skip/input.svelte rename to packages/svelte-template-compiler/test/fixtures/siblings-combinator-global/input.svelte diff --git a/packages/svelte-template-compiler/test/fixtures/unknown-at-rule-with-following-rules/config.js b/packages/svelte-template-compiler/test/fixtures/unknown-at-rule-with-following-rules/config.js new file mode 100644 index 0000000..001e6d7 --- /dev/null +++ b/packages/svelte-template-compiler/test/fixtures/unknown-at-rule-with-following-rules/config.js @@ -0,0 +1,5 @@ +export default { + compileOptions: { + dev: false + } +}; diff --git a/packages/svelte-template-compiler/test/fixtures/unknown-at-rule-with-following-rules.skip/expected.css b/packages/svelte-template-compiler/test/fixtures/unknown-at-rule-with-following-rules/expected.css similarity index 100% rename from packages/svelte-template-compiler/test/fixtures/unknown-at-rule-with-following-rules.skip/expected.css rename to packages/svelte-template-compiler/test/fixtures/unknown-at-rule-with-following-rules/expected.css diff --git a/packages/svelte-template-compiler/test/fixtures/unknown-at-rule-with-following-rules.skip/input.svelte b/packages/svelte-template-compiler/test/fixtures/unknown-at-rule-with-following-rules/input.svelte similarity index 100% rename from packages/svelte-template-compiler/test/fixtures/unknown-at-rule-with-following-rules.skip/input.svelte rename to packages/svelte-template-compiler/test/fixtures/unknown-at-rule-with-following-rules/input.svelte diff --git a/packages/svelte-template-compiler/test/fixtures/unknown-at-rule.skip/expected.css b/packages/svelte-template-compiler/test/fixtures/unknown-at-rule/expected.css similarity index 100% rename from packages/svelte-template-compiler/test/fixtures/unknown-at-rule.skip/expected.css rename to packages/svelte-template-compiler/test/fixtures/unknown-at-rule/expected.css diff --git a/packages/svelte-template-compiler/test/fixtures/unknown-at-rule.skip/input.svelte b/packages/svelte-template-compiler/test/fixtures/unknown-at-rule/input.svelte similarity index 100% rename from packages/svelte-template-compiler/test/fixtures/unknown-at-rule.skip/input.svelte rename to packages/svelte-template-compiler/test/fixtures/unknown-at-rule/input.svelte diff --git a/packages/svelte-template-compiler/test/fixtures/unused-selector-child-combinator.skip/_config.js b/packages/svelte-template-compiler/test/fixtures/unused-selector-child-combinator/_config.js similarity index 100% rename from packages/svelte-template-compiler/test/fixtures/unused-selector-child-combinator.skip/_config.js rename to packages/svelte-template-compiler/test/fixtures/unused-selector-child-combinator/_config.js diff --git a/packages/svelte-template-compiler/test/fixtures/unused-selector-child-combinator.skip/expected.css b/packages/svelte-template-compiler/test/fixtures/unused-selector-child-combinator/expected.css similarity index 100% rename from packages/svelte-template-compiler/test/fixtures/unused-selector-child-combinator.skip/expected.css rename to packages/svelte-template-compiler/test/fixtures/unused-selector-child-combinator/expected.css diff --git a/packages/svelte-template-compiler/test/fixtures/unused-selector-child-combinator.skip/input.svelte b/packages/svelte-template-compiler/test/fixtures/unused-selector-child-combinator/input.svelte similarity index 100% rename from packages/svelte-template-compiler/test/fixtures/unused-selector-child-combinator.skip/input.svelte rename to packages/svelte-template-compiler/test/fixtures/unused-selector-child-combinator/input.svelte diff --git a/patches/svelte@4.2.18.patch b/patches/svelte@4.2.18.patch index fdfaa85..809e263 100644 --- a/patches/svelte@4.2.18.patch +++ b/patches/svelte@4.2.18.patch @@ -156,7 +156,7 @@ index 3d4ab358df18d42b7af4288ff3b4718d1774ec44..fcdfbd2bcd078253c671da3d01e00278 content: ast }; diff --git a/types/index.d.ts b/types/index.d.ts -index 2055385b0a8af122d4cff8dcccdf456ef0b3c239..3c21d81665f71e2104d02b4d9d5f105ad07da313 100644 +index 2055385b0a8af122d4cff8dcccdf456ef0b3c239..9acfbfb6fb38807bbaa68fa36a84200766047f11 100644 --- a/types/index.d.ts +++ b/types/index.d.ts @@ -90,7 +90,7 @@ declare module 'svelte' { @@ -226,7 +226,7 @@ index 2055385b0a8af122d4cff8dcccdf456ef0b3c239..3c21d81665f71e2104d02b4d9d5f105a end: number; type: string; children?: TemplateNode[]; -+ parent?: TemplateNode; ++ parent?: TemplateNode | null; + prev?: TemplateNode; + next?: TemplateNode; [prop_name: string]: any; @@ -379,7 +379,7 @@ index 2055385b0a8af122d4cff8dcccdf456ef0b3c239..3c21d81665f71e2104d02b4d9d5f105a end: number; type: string; children?: TemplateNode[]; -+ parent?: TemplateNode; ++ parent?: TemplateNode | null; + prev?: TemplateNode; + next?: TemplateNode; [prop_name: string]: any; diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 1302d84..156efbf 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -48,7 +48,7 @@ patchedDependencies: hash: sml6kvvq45dxnre3fch4hlkdqu path: patches/@types__css-tree@2.3.9.patch svelte@4.2.18: - hash: 7p2q5fxxg3auyioysmww7w462i + hash: zf3pkt63yjzxvp2jnynlxqax3a path: patches/svelte@4.2.18.patch importers: @@ -60,7 +60,7 @@ importers: version: 6.2.1 '@kazupon/eslint-config': specifier: ^0.18.0 - version: 0.18.0(b22f45gze6t44tvfvbxvvpoggq) + version: 0.18.0(vsqril6k5e26nywoq4chjytgcu) '@kazupon/prettier-config': specifier: ^0.1.1 version: 0.1.1 @@ -96,7 +96,7 @@ importers: version: 2.7.0(eslint@9.11.0(jiti@2.4.2)) eslint-plugin-svelte: specifier: ^2.43.0 - version: 2.46.0(eslint@9.11.0(jiti@2.4.2))(svelte@4.2.18(patch_hash=7p2q5fxxg3auyioysmww7w462i)) + version: 2.46.0(eslint@9.11.0(jiti@2.4.2))(svelte@4.2.18(patch_hash=zf3pkt63yjzxvp2jnynlxqax3a)) eslint-plugin-toml: specifier: ^0.11.1 version: 0.11.1(eslint@9.11.0(jiti@2.4.2)) @@ -132,7 +132,7 @@ importers: version: 3.4.1 prettier-plugin-svelte: specifier: ^3.2.6 - version: 3.2.8(prettier@3.4.1)(svelte@4.2.18(patch_hash=7p2q5fxxg3auyioysmww7w462i)) + version: 3.2.8(prettier@3.4.1)(svelte@4.2.18(patch_hash=zf3pkt63yjzxvp2jnynlxqax3a)) prettier-plugin-toml: specifier: ^2.0.1 version: 2.0.1(prettier@3.4.1) @@ -346,7 +346,7 @@ importers: version: 1.2.0 svelte: specifier: 'catalog:' - version: 4.2.18(patch_hash=7p2q5fxxg3auyioysmww7w462i) + version: 4.2.18(patch_hash=zf3pkt63yjzxvp2jnynlxqax3a) svelte-vapor-template-compiler: specifier: workspace:* version: link:../svelte-template-compiler @@ -392,7 +392,7 @@ importers: version: 1.2.0 svelte: specifier: 'catalog:' - version: 4.2.18(patch_hash=7p2q5fxxg3auyioysmww7w462i) + version: 4.2.18(patch_hash=zf3pkt63yjzxvp2jnynlxqax3a) devDependencies: '@babel/types': specifier: 'catalog:' @@ -423,7 +423,7 @@ importers: version: 1.2.0 svelte: specifier: 'catalog:' - version: 4.2.18(patch_hash=7p2q5fxxg3auyioysmww7w462i) + version: 4.2.18(patch_hash=zf3pkt63yjzxvp2jnynlxqax3a) svelte-vapor-template-compiler: specifier: workspace:* version: link:../svelte-template-compiler @@ -445,7 +445,7 @@ importers: devDependencies: svelte: specifier: 'catalog:' - version: 4.2.18(patch_hash=7p2q5fxxg3auyioysmww7w462i) + version: 4.2.18(patch_hash=zf3pkt63yjzxvp2jnynlxqax3a) tsdown: specifier: 'catalog:' version: 0.4.4(rollup@4.28.1)(typescript@5.7.2) @@ -536,7 +536,7 @@ importers: version: 0.24.0 svelte: specifier: 'catalog:' - version: 4.2.18(patch_hash=7p2q5fxxg3auyioysmww7w462i) + version: 4.2.18(patch_hash=zf3pkt63yjzxvp2jnynlxqax3a) svelte-vapor-runtime: specifier: workspace:* version: link:../svelte-vapor-runtime @@ -6187,7 +6187,7 @@ snapshots: string-argv: 0.3.2 type-detect: 4.1.0 - '@kazupon/eslint-config@0.18.0(b22f45gze6t44tvfvbxvvpoggq)': + '@kazupon/eslint-config@0.18.0(vsqril6k5e26nywoq4chjytgcu)': dependencies: '@eslint-community/eslint-plugin-eslint-comments': 4.4.1(eslint@9.11.0(jiti@2.4.2)) '@eslint/js': 9.15.0 @@ -6204,13 +6204,13 @@ snapshots: eslint-plugin-react-hooks: 4.6.2(eslint@9.11.0(jiti@2.4.2)) eslint-plugin-react-refresh: 0.4.14(eslint@9.11.0(jiti@2.4.2)) eslint-plugin-regexp: 2.7.0(eslint@9.11.0(jiti@2.4.2)) - eslint-plugin-svelte: 2.46.0(eslint@9.11.0(jiti@2.4.2))(svelte@4.2.18(patch_hash=7p2q5fxxg3auyioysmww7w462i)) + eslint-plugin-svelte: 2.46.0(eslint@9.11.0(jiti@2.4.2))(svelte@4.2.18(patch_hash=zf3pkt63yjzxvp2jnynlxqax3a)) eslint-plugin-toml: 0.11.1(eslint@9.11.0(jiti@2.4.2)) eslint-plugin-unicorn: 54.0.0(eslint@9.11.0(jiti@2.4.2)) eslint-plugin-unused-imports: 4.1.4(@typescript-eslint/eslint-plugin@8.18.1(@typescript-eslint/parser@8.18.1(eslint@9.11.0(jiti@2.4.2))(typescript@5.6.2))(eslint@9.11.0(jiti@2.4.2))(typescript@5.6.2))(eslint@9.11.0(jiti@2.4.2)) eslint-plugin-vue: 9.31.0(eslint@9.11.0(jiti@2.4.2)) eslint-plugin-yml: 1.15.0(eslint@9.11.0(jiti@2.4.2)) - svelte: 4.2.18(patch_hash=7p2q5fxxg3auyioysmww7w462i) + svelte: 4.2.18(patch_hash=zf3pkt63yjzxvp2jnynlxqax3a) typescript-eslint: 8.18.1(eslint@9.11.0(jiti@2.4.2))(typescript@5.6.2) transitivePeerDependencies: - '@vue/reactivity' @@ -8142,7 +8142,7 @@ snapshots: regexp-ast-analysis: 0.7.1 scslre: 0.3.0 - eslint-plugin-svelte@2.46.0(eslint@9.11.0(jiti@2.4.2))(svelte@4.2.18(patch_hash=7p2q5fxxg3auyioysmww7w462i)): + eslint-plugin-svelte@2.46.0(eslint@9.11.0(jiti@2.4.2))(svelte@4.2.18(patch_hash=zf3pkt63yjzxvp2jnynlxqax3a)): dependencies: '@eslint-community/eslint-utils': 4.4.1(eslint@9.11.0(jiti@2.4.2)) '@jridgewell/sourcemap-codec': 1.5.0 @@ -8155,9 +8155,9 @@ snapshots: postcss-safe-parser: 6.0.0(postcss@8.4.49) postcss-selector-parser: 6.1.2 semver: 7.6.3 - svelte-eslint-parser: 0.43.0(svelte@4.2.18(patch_hash=7p2q5fxxg3auyioysmww7w462i)) + svelte-eslint-parser: 0.43.0(svelte@4.2.18(patch_hash=zf3pkt63yjzxvp2jnynlxqax3a)) optionalDependencies: - svelte: 4.2.18(patch_hash=7p2q5fxxg3auyioysmww7w462i) + svelte: 4.2.18(patch_hash=zf3pkt63yjzxvp2jnynlxqax3a) transitivePeerDependencies: - ts-node @@ -9899,10 +9899,10 @@ snapshots: prelude-ls@1.2.1: {} - prettier-plugin-svelte@3.2.8(prettier@3.4.1)(svelte@4.2.18(patch_hash=7p2q5fxxg3auyioysmww7w462i)): + prettier-plugin-svelte@3.2.8(prettier@3.4.1)(svelte@4.2.18(patch_hash=zf3pkt63yjzxvp2jnynlxqax3a)): dependencies: prettier: 3.4.1 - svelte: 4.2.18(patch_hash=7p2q5fxxg3auyioysmww7w462i) + svelte: 4.2.18(patch_hash=zf3pkt63yjzxvp2jnynlxqax3a) prettier-plugin-toml@2.0.1(prettier@3.4.1): dependencies: @@ -10479,7 +10479,7 @@ snapshots: supports-preserve-symlinks-flag@1.0.0: {} - svelte-eslint-parser@0.43.0(svelte@4.2.18(patch_hash=7p2q5fxxg3auyioysmww7w462i)): + svelte-eslint-parser@0.43.0(svelte@4.2.18(patch_hash=zf3pkt63yjzxvp2jnynlxqax3a)): dependencies: eslint-scope: 7.2.2 eslint-visitor-keys: 3.4.3 @@ -10487,9 +10487,9 @@ snapshots: postcss: 8.4.49 postcss-scss: 4.0.9(postcss@8.4.49) optionalDependencies: - svelte: 4.2.18(patch_hash=7p2q5fxxg3auyioysmww7w462i) + svelte: 4.2.18(patch_hash=zf3pkt63yjzxvp2jnynlxqax3a) - svelte@4.2.18(patch_hash=7p2q5fxxg3auyioysmww7w462i): + svelte@4.2.18(patch_hash=zf3pkt63yjzxvp2jnynlxqax3a): dependencies: '@ampproject/remapping': 2.3.0 '@jridgewell/sourcemap-codec': 1.5.0