@astrojs/compiler 1.5.4 → 1.5.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/astro.wasm CHANGED
Binary file
@@ -1,3 +1,3 @@
1
- "use strict";var l=Object.defineProperty;var d=Object.getOwnPropertyDescriptor;var p=Object.getOwnPropertyNames;var N=Object.prototype.hasOwnProperty;var u=(o,e)=>{for(var t in e)l(o,t,{get:e[t],enumerable:!0})},f=(o,e,t,n)=>{if(e&&typeof e=="object"||typeof e=="function")for(let r of p(e))!N.call(o,r)&&r!==t&&l(o,r,{get:()=>e[r],enumerable:!(n=d(e,r))||n.enumerable});return o};var h=o=>f(l({},"__esModule",{value:!0}),o);var v={};u(v,{is:()=>s,serialize:()=>g,walk:()=>y});module.exports=h(v);function i(o){return e=>e.type===o}var s={parent(o){return Array.isArray(o.children)},literal(o){return typeof o.value=="string"},tag(o){return o.type==="element"||o.type==="custom-element"||o.type==="component"||o.type==="fragment"},whitespace(o){return o.type==="text"&&o.value.trim().length===0},root:i("root"),element:i("element"),customElement:i("custom-element"),component:i("component"),fragment:i("fragment"),expression:i("expression"),text:i("text"),doctype:i("doctype"),comment:i("comment"),frontmatter:i("frontmatter")},m=class{constructor(e){this.callback=e}async visit(e,t,n){if(await this.callback(e,t,n),s.parent(e)){let r=[];for(let a=0;a<e.children.length;a++){let c=e.children[a];r.push(this.callback(c,e,a))}await Promise.all(r)}}};function y(o,e){new m(e).visit(o)}function x(o){let e="";for(let t of o.attributes)switch(e+=" ",t.kind){case"empty":{e+=`${t.name}`;break}case"expression":{e+=`${t.name}={${t.value}}`;break}case"quoted":{e+=`${t.name}="${t.value}"`;break}case"template-literal":{e+=`${t.name}=\`${t.value}\``;break}case"shorthand":{e+=`{${t.name}}`;break}case"spread":{e+=`{...${t.value}}`;break}}return e}function g(o,e={selfClose:!0}){let t="";function n(r){s.root(r)?r.children.forEach(a=>n(a)):s.frontmatter(r)?t+=`---${r.value}---
1
+ "use strict";var l=Object.defineProperty;var d=Object.getOwnPropertyDescriptor;var p=Object.getOwnPropertyNames;var N=Object.prototype.hasOwnProperty;var u=(o,e)=>{for(var t in e)l(o,t,{get:e[t],enumerable:!0})},f=(o,e,t,n)=>{if(e&&typeof e=="object"||typeof e=="function")for(let r of p(e))!N.call(o,r)&&r!==t&&l(o,r,{get:()=>e[r],enumerable:!(n=d(e,r))||n.enumerable});return o};var h=o=>f(l({},"__esModule",{value:!0}),o);var v={};u(v,{is:()=>s,serialize:()=>g,walk:()=>y});module.exports=h(v);function i(o){return e=>e.type===o}var s={parent(o){return Array.isArray(o.children)},literal(o){return typeof o.value=="string"},tag(o){return o.type==="element"||o.type==="custom-element"||o.type==="component"||o.type==="fragment"},whitespace(o){return o.type==="text"&&o.value.trim().length===0},root:i("root"),element:i("element"),customElement:i("custom-element"),component:i("component"),fragment:i("fragment"),expression:i("expression"),text:i("text"),doctype:i("doctype"),comment:i("comment"),frontmatter:i("frontmatter")},m=class{constructor(e){this.callback=e}async visit(e,t,n){if(await this.callback(e,t,n),s.parent(e)){let r=[];for(let a=0;a<e.children.length;a++){let c=e.children[a];r.push(this.callback(c,e,a))}await Promise.all(r)}}};function y(o,e){new m(e).visit(o)}function x(o){let e="";for(let t of o.attributes)switch(e+=" ",t.kind){case"empty":{e+=`${t.name}`;break}case"expression":{e+=`${t.name}={${t.value}}`;break}case"quoted":{e+=`${t.name}=${t.raw}`;break}case"template-literal":{e+=`${t.name}=\`${t.value}\``;break}case"shorthand":{e+=`{${t.name}}`;break}case"spread":{e+=`{...${t.value}}`;break}}return e}function g(o,e={selfClose:!0}){let t="";function n(r){s.root(r)?r.children.forEach(a=>n(a)):s.frontmatter(r)?t+=`---${r.value}---
2
2
 
3
3
  `:s.comment(r)?t+=`<!--${r.value}-->`:s.expression(r)?(t+="{",r.children.forEach(a=>n(a)),t+="}"):s.literal(r)?t+=r.value:s.tag(r)&&(t+=`<${r.name}`,t+=x(r),r.children.length==0&&e.selfClose?t+=" />":(t+=">",r.children.forEach(a=>n(a)),t+=`</${r.name}>`))}return n(o),t}0&&(module.exports={is,serialize,walk});
@@ -1,3 +1,3 @@
1
- function i(o){return t=>t.type===o}var n={parent(o){return Array.isArray(o.children)},literal(o){return typeof o.value=="string"},tag(o){return o.type==="element"||o.type==="custom-element"||o.type==="component"||o.type==="fragment"},whitespace(o){return o.type==="text"&&o.value.trim().length===0},root:i("root"),element:i("element"),customElement:i("custom-element"),component:i("component"),fragment:i("fragment"),expression:i("expression"),text:i("text"),doctype:i("doctype"),comment:i("comment"),frontmatter:i("frontmatter")},l=class{constructor(t){this.callback=t}async visit(t,e,s){if(await this.callback(t,e,s),n.parent(t)){let r=[];for(let a=0;a<t.children.length;a++){let m=t.children[a];r.push(this.callback(m,t,a))}await Promise.all(r)}}};function N(o,t){new l(t).visit(o)}function c(o){let t="";for(let e of o.attributes)switch(t+=" ",e.kind){case"empty":{t+=`${e.name}`;break}case"expression":{t+=`${e.name}={${e.value}}`;break}case"quoted":{t+=`${e.name}="${e.value}"`;break}case"template-literal":{t+=`${e.name}=\`${e.value}\``;break}case"shorthand":{t+=`{${e.name}}`;break}case"spread":{t+=`{...${e.value}}`;break}}return t}function u(o,t={selfClose:!0}){let e="";function s(r){n.root(r)?r.children.forEach(a=>s(a)):n.frontmatter(r)?e+=`---${r.value}---
1
+ function i(o){return t=>t.type===o}var n={parent(o){return Array.isArray(o.children)},literal(o){return typeof o.value=="string"},tag(o){return o.type==="element"||o.type==="custom-element"||o.type==="component"||o.type==="fragment"},whitespace(o){return o.type==="text"&&o.value.trim().length===0},root:i("root"),element:i("element"),customElement:i("custom-element"),component:i("component"),fragment:i("fragment"),expression:i("expression"),text:i("text"),doctype:i("doctype"),comment:i("comment"),frontmatter:i("frontmatter")},l=class{constructor(t){this.callback=t}async visit(t,e,s){if(await this.callback(t,e,s),n.parent(t)){let r=[];for(let a=0;a<t.children.length;a++){let m=t.children[a];r.push(this.callback(m,t,a))}await Promise.all(r)}}};function N(o,t){new l(t).visit(o)}function c(o){let t="";for(let e of o.attributes)switch(t+=" ",e.kind){case"empty":{t+=`${e.name}`;break}case"expression":{t+=`${e.name}={${e.value}}`;break}case"quoted":{t+=`${e.name}=${e.raw}`;break}case"template-literal":{t+=`${e.name}=\`${e.value}\``;break}case"shorthand":{t+=`{${e.name}}`;break}case"spread":{t+=`{...${e.value}}`;break}}return t}function u(o,t={selfClose:!0}){let e="";function s(r){n.root(r)?r.children.forEach(a=>s(a)):n.frontmatter(r)?e+=`---${r.value}---
2
2
 
3
3
  `:n.comment(r)?e+=`<!--${r.value}-->`:n.expression(r)?(e+="{",r.children.forEach(a=>s(a)),e+="}"):n.literal(r)?e+=r.value:n.tag(r)&&(e+=`<${r.name}`,e+=c(r),r.children.length==0&&t.selfClose?e+=" />":(e+=">",r.children.forEach(a=>s(a)),e+=`</${r.name}>`))}return s(o),e}export{n as is,u as serialize,N as walk};
@@ -1,3 +1,3 @@
1
- "use strict";var l=Object.defineProperty;var d=Object.getOwnPropertyDescriptor;var p=Object.getOwnPropertyNames;var N=Object.prototype.hasOwnProperty;var u=(o,e)=>{for(var t in e)l(o,t,{get:e[t],enumerable:!0})},f=(o,e,t,n)=>{if(e&&typeof e=="object"||typeof e=="function")for(let r of p(e))!N.call(o,r)&&r!==t&&l(o,r,{get:()=>e[r],enumerable:!(n=d(e,r))||n.enumerable});return o};var h=o=>f(l({},"__esModule",{value:!0}),o);var v={};u(v,{is:()=>s,serialize:()=>g,walk:()=>y});module.exports=h(v);function i(o){return e=>e.type===o}var s={parent(o){return Array.isArray(o.children)},literal(o){return typeof o.value=="string"},tag(o){return o.type==="element"||o.type==="custom-element"||o.type==="component"||o.type==="fragment"},whitespace(o){return o.type==="text"&&o.value.trim().length===0},root:i("root"),element:i("element"),customElement:i("custom-element"),component:i("component"),fragment:i("fragment"),expression:i("expression"),text:i("text"),doctype:i("doctype"),comment:i("comment"),frontmatter:i("frontmatter")},m=class{constructor(e){this.callback=e}async visit(e,t,n){if(await this.callback(e,t,n),s.parent(e)){let r=[];for(let a=0;a<e.children.length;a++){let c=e.children[a];r.push(this.callback(c,e,a))}await Promise.all(r)}}};function y(o,e){new m(e).visit(o)}function x(o){let e="";for(let t of o.attributes)switch(e+=" ",t.kind){case"empty":{e+=`${t.name}`;break}case"expression":{e+=`${t.name}={${t.value}}`;break}case"quoted":{e+=`${t.name}="${t.value}"`;break}case"template-literal":{e+=`${t.name}=\`${t.value}\``;break}case"shorthand":{e+=`{${t.name}}`;break}case"spread":{e+=`{...${t.name}}`;break}}return e}function g(o,e={selfClose:!0}){let t="";function n(r){s.root(r)?r.children.forEach(a=>n(a)):s.frontmatter(r)?t+=`---${r.value}---
1
+ "use strict";var l=Object.defineProperty;var d=Object.getOwnPropertyDescriptor;var p=Object.getOwnPropertyNames;var N=Object.prototype.hasOwnProperty;var u=(o,e)=>{for(var t in e)l(o,t,{get:e[t],enumerable:!0})},f=(o,e,t,n)=>{if(e&&typeof e=="object"||typeof e=="function")for(let r of p(e))!N.call(o,r)&&r!==t&&l(o,r,{get:()=>e[r],enumerable:!(n=d(e,r))||n.enumerable});return o};var h=o=>f(l({},"__esModule",{value:!0}),o);var k={};u(k,{is:()=>s,serialize:()=>g,walk:()=>y});module.exports=h(k);function i(o){return e=>e.type===o}var s={parent(o){return Array.isArray(o.children)},literal(o){return typeof o.value=="string"},tag(o){return o.type==="element"||o.type==="custom-element"||o.type==="component"||o.type==="fragment"},whitespace(o){return o.type==="text"&&o.value.trim().length===0},root:i("root"),element:i("element"),customElement:i("custom-element"),component:i("component"),fragment:i("fragment"),expression:i("expression"),text:i("text"),doctype:i("doctype"),comment:i("comment"),frontmatter:i("frontmatter")},m=class{constructor(e){this.callback=e}async visit(e,t,n){if(await this.callback(e,t,n),s.parent(e)){let r=[];for(let a=0;a<e.children.length;a++){let c=e.children[a];r.push(this.callback(c,e,a))}await Promise.all(r)}}};function y(o,e){new m(e).visit(o)}function x(o){let e="";for(let t of o.attributes)switch(e+=" ",t.kind){case"empty":{e+=`${t.name}`;break}case"expression":{e+=`${t.name}={${t.value}}`;break}case"quoted":{e+=`${t.name}=${t.raw}`;break}case"template-literal":{e+=`${t.name}=\`${t.value}\``;break}case"shorthand":{e+=`{${t.name}}`;break}case"spread":{e+=`{...${t.name}}`;break}}return e}function g(o,e={selfClose:!0}){let t="";function n(r){s.root(r)?r.children.forEach(a=>n(a)):s.frontmatter(r)?t+=`---${r.value}---
2
2
 
3
3
  `:s.comment(r)?t+=`<!--${r.value}-->`:s.expression(r)?(t+="{",r.children.forEach(a=>n(a)),t+="}"):s.literal(r)?t+=r.value:s.tag(r)&&(t+=`<${r.name}`,t+=x(r),r.children.length==0&&e.selfClose?t+=" />":(t+=">",r.children.forEach(a=>n(a)),t+=`</${r.name}>`))}return n(o),t}0&&(module.exports={is,serialize,walk});
@@ -1,3 +1,3 @@
1
- function i(o){return t=>t.type===o}var n={parent(o){return Array.isArray(o.children)},literal(o){return typeof o.value=="string"},tag(o){return o.type==="element"||o.type==="custom-element"||o.type==="component"||o.type==="fragment"},whitespace(o){return o.type==="text"&&o.value.trim().length===0},root:i("root"),element:i("element"),customElement:i("custom-element"),component:i("component"),fragment:i("fragment"),expression:i("expression"),text:i("text"),doctype:i("doctype"),comment:i("comment"),frontmatter:i("frontmatter")},l=class{constructor(t){this.callback=t}async visit(t,e,s){if(await this.callback(t,e,s),n.parent(t)){let r=[];for(let a=0;a<t.children.length;a++){let m=t.children[a];r.push(this.callback(m,t,a))}await Promise.all(r)}}};function N(o,t){new l(t).visit(o)}function c(o){let t="";for(let e of o.attributes)switch(t+=" ",e.kind){case"empty":{t+=`${e.name}`;break}case"expression":{t+=`${e.name}={${e.value}}`;break}case"quoted":{t+=`${e.name}="${e.value}"`;break}case"template-literal":{t+=`${e.name}=\`${e.value}\``;break}case"shorthand":{t+=`{${e.name}}`;break}case"spread":{t+=`{...${e.name}}`;break}}return t}function u(o,t={selfClose:!0}){let e="";function s(r){n.root(r)?r.children.forEach(a=>s(a)):n.frontmatter(r)?e+=`---${r.value}---
1
+ function i(o){return t=>t.type===o}var n={parent(o){return Array.isArray(o.children)},literal(o){return typeof o.value=="string"},tag(o){return o.type==="element"||o.type==="custom-element"||o.type==="component"||o.type==="fragment"},whitespace(o){return o.type==="text"&&o.value.trim().length===0},root:i("root"),element:i("element"),customElement:i("custom-element"),component:i("component"),fragment:i("fragment"),expression:i("expression"),text:i("text"),doctype:i("doctype"),comment:i("comment"),frontmatter:i("frontmatter")},l=class{constructor(t){this.callback=t}async visit(t,e,s){if(await this.callback(t,e,s),n.parent(t)){let r=[];for(let a=0;a<t.children.length;a++){let m=t.children[a];r.push(this.callback(m,t,a))}await Promise.all(r)}}};function N(o,t){new l(t).visit(o)}function c(o){let t="";for(let e of o.attributes)switch(t+=" ",e.kind){case"empty":{t+=`${e.name}`;break}case"expression":{t+=`${e.name}={${e.value}}`;break}case"quoted":{t+=`${e.name}=${e.raw}`;break}case"template-literal":{t+=`${e.name}=\`${e.value}\``;break}case"shorthand":{t+=`{${e.name}}`;break}case"spread":{t+=`{...${e.name}}`;break}}return t}function u(o,t={selfClose:!0}){let e="";function s(r){n.root(r)?r.children.forEach(a=>s(a)):n.frontmatter(r)?e+=`---${r.value}---
2
2
 
3
3
  `:n.comment(r)?e+=`<!--${r.value}-->`:n.expression(r)?(e+="{",r.children.forEach(a=>s(a)),e+="}"):n.literal(r)?e+=r.value:n.tag(r)&&(e+=`<${r.name}`,e+=c(r),r.children.length==0&&t.selfClose?e+=" />":(e+=">",r.children.forEach(a=>s(a)),e+=`</${r.name}>`))}return s(o),e}export{n as is,u as serialize,N as walk};
@@ -32,6 +32,7 @@ interface AttributeNode extends BaseNode {
32
32
  kind: 'quoted' | 'empty' | 'expression' | 'spread' | 'shorthand' | 'template-literal';
33
33
  name: string;
34
34
  value: string;
35
+ raw?: string;
35
36
  }
36
37
  interface TextNode extends ValueNode {
37
38
  type: 'text';
package/package.json CHANGED
@@ -5,7 +5,7 @@
5
5
  "type": "module",
6
6
  "bugs": "https://github.com/withastro/compiler/issues",
7
7
  "homepage": "https://astro.build",
8
- "version": "1.5.4",
8
+ "version": "1.5.5",
9
9
  "main": "./dist/node/index.js",
10
10
  "types": "./dist/shared/types.d.ts",
11
11
  "repository": {