@razorwind/ghostty 0.0.7 → 0.0.9
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/index.cjs +2 -2
- package/dist/index.d.cts +2 -0
- package/dist/index.d.cts.map +1 -1
- package/dist/index.d.mts +2 -0
- package/dist/index.mjs +3 -3
- package/package.json +3 -3
package/dist/index.cjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:`Module`}});let e=require("@razorwind/core/plugin"),t=require("@razorwind/core/utils"),n=require("node:path");function r(e){let t=e.themes[0],n=e.themes.length===1?t.displayName:`Ghostty Themes
|
|
1
|
+
Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:`Module`}});let e=require("@razorwind/core/plugin"),t=require("@razorwind/core/utils"),n=require("node:path");function r(e){let t=e.themes[0],n=e.title??(e.themes.length===1?t.displayName:`Ghostty Themes`),r=e.themes.map(e=>`- \`${e.fileName}\` — ${e.displayName} (\`theme = ${e.name}\`)`).join(`
|
|
2
2
|
`),i=e.themes.map(e=>`- \`${e.name}\` (${e.displayName})`).join(`
|
|
3
3
|
`);return`# Installing ${n}
|
|
4
4
|
|
|
@@ -38,4 +38,4 @@ Alternatively, copy the contents of the theme file directly into \`config\`.
|
|
|
38
38
|
|
|
39
39
|
\`theme\` must match the theme filename without a path (e.g. \`${t.fileName}\` → \`theme = ${t.name}\`).
|
|
40
40
|
`}function i(e){return(0,t.themeDisplayName)(e)}const a={name:`razorwind-ghostty`},o=[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15];function s(e,n,r){return(0,t.createDocument)(e,n,a,r)}function c(e){return(0,t.isObject)(e)&&typeof e.name==`string`&&e.name.length>0}function l(e){if(Array.isArray(e))return e.map((e,t)=>{if(!c(e))throw TypeError(`@razorwind/ghostty mapTheme()[${t}] must be a GhosttyTheme with name`);return e});if(c(e))return[e];if(!(0,t.isObject)(e))throw TypeError(`@razorwind/ghostty mapTheme() must return a theme, theme array, or theme record`);return Object.entries(e).map(([e,t])=>{if(!c(t))throw TypeError(`@razorwind/ghostty mapTheme()["${e}"] must be a GhosttyTheme with name`);return{...t,name:t.name||e}})}function u(e){if(!e.mapTheme)throw Error(`@razorwind/ghostty requires options.mapTheme`)}function d(e){let t=e.trim();return t.startsWith(`#`)?t.toLowerCase():/^[0-9a-fA-F]{6}$/.test(t)?`#${t.toLowerCase()}`:t}function f(e){return e?Array.isArray(e)?e.flatMap((e,t)=>e===void 0||e===``||t>15?[]:[[t,d(e)]]):o.flatMap(t=>{let n=e[t];return n===void 0||n===``?[]:[[t,d(n)]]}):[]}function p(e,t,n){e.push(`${t} = ${n}`)}function m(e,t){if(t)for(let[n,r]of Object.entries(t)){if(n===`theme`||n===`config-file`)throw TypeError(`@razorwind/ghostty theme config cannot set "${n}" — use GhosttyTheme.name / user config instead`);if(Array.isArray(r)){for(let t of r)p(e,n,t);continue}p(e,n,r)}}function h(e){let t=[`# ${i(e)} — generated by @razorwind/ghostty`,`#`,`# Ghostty theme. Install: https://draculatheme.com/ghostty`,`# Docs: https://ghostty.org/docs/features/theme`,`#`];for(let[n,r]of f(e.palette))p(t,`palette`,`${n}=${r}`);return e.background&&p(t,`background`,d(e.background)),e.foreground&&p(t,`foreground`,d(e.foreground)),e.cursorColor&&p(t,`cursor-color`,d(e.cursorColor)),e.cursorText&&p(t,`cursor-text`,d(e.cursorText)),e.selectionForeground&&p(t,`selection-foreground`,d(e.selectionForeground)),e.selectionBackground&&p(t,`selection-background`,d(e.selectionBackground)),m(t,e.config),`${t.join(`
|
|
41
|
-
`)}\n`}function g(e,a){u(a);let o=a.outputPath??`ghostty-themes`,c=l(a.mapTheme(e.tokens));if(c.length===0)throw Error(`@razorwind/ghostty mapTheme() returned no themes`);let d={},f=new Set,p=[];for(let e of c){let r=(0,t.slugifyThemeName)(e.name);if(!r)throw TypeError(`@razorwind/ghostty theme name "${e.name}" slugifies to an empty string`);if(f.has(r)){let n=2;for(;f.has(`${(0,t.slugifyThemeName)(e.name)}-${n}`);)n+=1;r=`${(0,t.slugifyThemeName)(e.name)}-${n}`}f.add(r);let a=r,c=(0,n.join)(o,a);d[c]=s(c,h({...e,name:r}),`ini`),p.push({name:r,displayName:i(e),fileName:a})}let m=a.installGuide??r({themes:p}),g=(0,n.join)(o,`INSTALL.md`);return d[g]=s(g,m,`markdown`),d}var _=(0,e.definePlugin)(e=>({name:`ghostty`,generate:async t=>{if(!e)throw Error(`@razorwind/ghostty requires options: { mapTheme }`);return g(t,e)}}));exports.default=_,Object.defineProperty(exports,"flattenTokens",{enumerable:!0,get:function(){return t.flattenTokens}}),Object.defineProperty(exports,"formatTokenValue",{enumerable:!0,get:function(){return t.formatTokenValue}}),exports.generateGhosttyTheme=g,exports.normalizeThemes=l,exports.renderGhosttyTheme=h,exports.renderInstallMd=r,Object.defineProperty(exports,"resolveTokenSets",{enumerable:!0,get:function(){return t.resolveTokenSets}}),Object.defineProperty(exports,"toCssVar",{enumerable:!0,get:function(){return t.toCssVar}}),exports.toGhosttyColor=d;
|
|
41
|
+
`)}\n`}function g(e,a){u(a);let o=a.outputPath??`ghostty-themes`,c=l(a.mapTheme(e.tokens));if(c.length===0)throw Error(`@razorwind/ghostty mapTheme() returned no themes`);let d={},f=new Set,p=[];for(let e of c){let r=(0,t.slugifyThemeName)(e.name);if(!r)throw TypeError(`@razorwind/ghostty theme name "${e.name}" slugifies to an empty string`);if(f.has(r)){let n=2;for(;f.has(`${(0,t.slugifyThemeName)(e.name)}-${n}`);)n+=1;r=`${(0,t.slugifyThemeName)(e.name)}-${n}`}f.add(r);let a=r,c=(0,n.join)(o,a);d[c]=s(c,h({...e,name:r}),`ini`),p.push({name:r,displayName:i(e),fileName:a})}let m=a.installGuide??r({themes:p,title:(0,t.resolveSchemaIdentity)(e).title}),g=(0,n.join)(o,`INSTALL.md`);return d[g]=s(g,m,`markdown`),d}var _=(0,e.definePlugin)(e=>({name:`ghostty`,generate:async t=>{if(!e)throw Error(`@razorwind/ghostty requires options: { mapTheme }`);return g(t,e)}}));exports.default=_,Object.defineProperty(exports,"flattenTokens",{enumerable:!0,get:function(){return t.flattenTokens}}),Object.defineProperty(exports,"formatTokenValue",{enumerable:!0,get:function(){return t.formatTokenValue}}),exports.generateGhosttyTheme=g,exports.normalizeThemes=l,exports.renderGhosttyTheme=h,exports.renderInstallMd=r,Object.defineProperty(exports,"resolveTokenSets",{enumerable:!0,get:function(){return t.resolveTokenSets}}),Object.defineProperty(exports,"toCssVar",{enumerable:!0,get:function(){return t.toCssVar}}),exports.toGhosttyColor=d;
|
package/dist/index.d.cts
CHANGED
|
@@ -121,6 +121,8 @@ declare function renderInstallMd(options: {
|
|
|
121
121
|
displayName: string;
|
|
122
122
|
fileName: string;
|
|
123
123
|
}>;
|
|
124
|
+
/** Design-system / package title from Schema when multiple themes. */
|
|
125
|
+
title?: string;
|
|
124
126
|
}): string;
|
|
125
127
|
//#endregion
|
|
126
128
|
//#region src/generate.d.ts
|
package/dist/index.d.cts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.cts","names":[],"sources":["../src/types.ts","../src/install.ts","../src/generate.ts","../src/index.ts"],"mappings":";;;;;;;;UAyBiB;;EAEf;;EAEA,OAAO;;EAEP;;EAEA;;EAEA;;EAEA;;;KAIU;;;;;;KAOA,iBACR,QAAQ,OAAO;;;;;;;;;;;UAaF;;;;;EAKf;;EAEA;;;;;EAKA,UAAU;;EAEV;;EAEA;;EAEA;;EAEA;;EAEA;;EAEA;;;;;;EAMA,SAAS;;;;;;;KAQC,wBACV,QAAQ,SAAS,eAAe,YAC7B,eAAe,iBAAiB,eAAe;;;;;;UAOnC;;;;;;EAMf;;;;;;EAOA,UAAU;;;;;;;EAQV;;;;;EAMA,eAAe;;;;;;;;;;iBC5GD,gBAAgB;EAC9B,QAAQ;IAAQ;IAAc;IAAqB
|
|
1
|
+
{"version":3,"file":"index.d.cts","names":[],"sources":["../src/types.ts","../src/install.ts","../src/generate.ts","../src/index.ts"],"mappings":";;;;;;;;UAyBiB;;EAEf;;EAEA,OAAO;;EAEP;;EAEA;;EAEA;;EAEA;;;KAIU;;;;;;KAOA,iBACR,QAAQ,OAAO;;;;;;;;;;;UAaF;;;;;EAKf;;EAEA;;;;;EAKA,UAAU;;EAEV;;EAEA;;EAEA;;EAEA;;EAEA;;EAEA;;;;;;EAMA,SAAS;;;;;;;KAQC,wBACV,QAAQ,SAAS,eAAe,YAC7B,eAAe,iBAAiB,eAAe;;;;;;UAOnC;;;;;;EAMf;;;;;;EAOA,UAAU;;;;;;;EAQV;;;;;EAMA,eAAe;;;;;;;;;;iBC5GD,gBAAgB;EAC9B,QAAQ;IAAQ;IAAc;IAAqB;;;EAEnD;;;;;;;iBC4Bc,gBACd,QAAQ,eAAe,iBAAiB,eAAe,gBACtD;;;;iBAgDa,eAAe;;;;;;;;;iBA6Ef,mBAAmB,OAAO;;;;;;iBAqD1B,qBACd,MAAM,QACN,SAAS,uBACR,wBAAwB,QAAQ"}
|
package/dist/index.d.mts
CHANGED
|
@@ -121,6 +121,8 @@ declare function renderInstallMd(options: {
|
|
|
121
121
|
displayName: string;
|
|
122
122
|
fileName: string;
|
|
123
123
|
}>;
|
|
124
|
+
/** Design-system / package title from Schema when multiple themes. */
|
|
125
|
+
title?: string;
|
|
124
126
|
}): string;
|
|
125
127
|
//#endregion
|
|
126
128
|
//#region src/generate.d.ts
|
package/dist/index.mjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{definePlugin as e}from"@razorwind/core/plugin";import{createDocument as t,flattenTokens as n,formatTokenValue as r,isObject as i,
|
|
1
|
+
import{definePlugin as e}from"@razorwind/core/plugin";import{createDocument as t,flattenTokens as n,formatTokenValue as r,isObject as i,resolveSchemaIdentity as a,resolveTokenSets as o,slugifyThemeName as s,themeDisplayName as c,toCssVar as l}from"@razorwind/core/utils";import{join as u}from"node:path";function d(e){let t=e.themes[0],n=e.title??(e.themes.length===1?t.displayName:`Ghostty Themes`),r=e.themes.map(e=>`- \`${e.fileName}\` — ${e.displayName} (\`theme = ${e.name}\`)`).join(`
|
|
2
2
|
`),i=e.themes.map(e=>`- \`${e.name}\` (${e.displayName})`).join(`
|
|
3
3
|
`);return`# Installing ${n}
|
|
4
4
|
|
|
@@ -37,6 +37,6 @@ Alternatively, copy the contents of the theme file directly into \`config\`.
|
|
|
37
37
|
## Select / load theme
|
|
38
38
|
|
|
39
39
|
\`theme\` must match the theme filename without a path (e.g. \`${t.fileName}\` → \`theme = ${t.name}\`).
|
|
40
|
-
`}function
|
|
41
|
-
`)}\n`}function
|
|
40
|
+
`}function f(e){return c(e)}const p={name:`razorwind-ghostty`},m=[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15];function h(e,n,r){return t(e,n,p,r)}function g(e){return i(e)&&typeof e.name==`string`&&e.name.length>0}function _(e){if(Array.isArray(e))return e.map((e,t)=>{if(!g(e))throw TypeError(`@razorwind/ghostty mapTheme()[${t}] must be a GhosttyTheme with name`);return e});if(g(e))return[e];if(!i(e))throw TypeError(`@razorwind/ghostty mapTheme() must return a theme, theme array, or theme record`);return Object.entries(e).map(([e,t])=>{if(!g(t))throw TypeError(`@razorwind/ghostty mapTheme()["${e}"] must be a GhosttyTheme with name`);return{...t,name:t.name||e}})}function v(e){if(!e.mapTheme)throw Error(`@razorwind/ghostty requires options.mapTheme`)}function y(e){let t=e.trim();return t.startsWith(`#`)?t.toLowerCase():/^[0-9a-fA-F]{6}$/.test(t)?`#${t.toLowerCase()}`:t}function b(e){return e?Array.isArray(e)?e.flatMap((e,t)=>e===void 0||e===``||t>15?[]:[[t,y(e)]]):m.flatMap(t=>{let n=e[t];return n===void 0||n===``?[]:[[t,y(n)]]}):[]}function x(e,t,n){e.push(`${t} = ${n}`)}function S(e,t){if(t)for(let[n,r]of Object.entries(t)){if(n===`theme`||n===`config-file`)throw TypeError(`@razorwind/ghostty theme config cannot set "${n}" — use GhosttyTheme.name / user config instead`);if(Array.isArray(r)){for(let t of r)x(e,n,t);continue}x(e,n,r)}}function C(e){let t=[`# ${f(e)} — generated by @razorwind/ghostty`,`#`,`# Ghostty theme. Install: https://draculatheme.com/ghostty`,`# Docs: https://ghostty.org/docs/features/theme`,`#`];for(let[n,r]of b(e.palette))x(t,`palette`,`${n}=${r}`);return e.background&&x(t,`background`,y(e.background)),e.foreground&&x(t,`foreground`,y(e.foreground)),e.cursorColor&&x(t,`cursor-color`,y(e.cursorColor)),e.cursorText&&x(t,`cursor-text`,y(e.cursorText)),e.selectionForeground&&x(t,`selection-foreground`,y(e.selectionForeground)),e.selectionBackground&&x(t,`selection-background`,y(e.selectionBackground)),S(t,e.config),`${t.join(`
|
|
41
|
+
`)}\n`}function w(e,t){v(t);let n=t.outputPath??`ghostty-themes`,r=_(t.mapTheme(e.tokens));if(r.length===0)throw Error(`@razorwind/ghostty mapTheme() returned no themes`);let i={},o=new Set,c=[];for(let e of r){let t=s(e.name);if(!t)throw TypeError(`@razorwind/ghostty theme name "${e.name}" slugifies to an empty string`);if(o.has(t)){let n=2;for(;o.has(`${s(e.name)}-${n}`);)n+=1;t=`${s(e.name)}-${n}`}o.add(t);let r=t,a=u(n,r);i[a]=h(a,C({...e,name:t}),`ini`),c.push({name:t,displayName:f(e),fileName:r})}let l=t.installGuide??d({themes:c,title:a(e).title}),p=u(n,`INSTALL.md`);return i[p]=h(p,l,`markdown`),i}var T=e(e=>({name:`ghostty`,generate:async t=>{if(!e)throw Error(`@razorwind/ghostty requires options: { mapTheme }`);return w(t,e)}}));export{T as default,n as flattenTokens,r as formatTokenValue,w as generateGhosttyTheme,_ as normalizeThemes,C as renderGhosttyTheme,d as renderInstallMd,o as resolveTokenSets,l as toCssVar,y as toGhosttyColor};
|
|
42
42
|
//# sourceMappingURL=index.mjs.map
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@razorwind/ghostty",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.9",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"description": "Razorwind plugin that generates Ghostty terminal themes from design tokens.",
|
|
6
6
|
"repository": {
|
|
@@ -68,7 +68,7 @@
|
|
|
68
68
|
"dependencies": {
|
|
69
69
|
"@power-plant/core": "^0.0.81",
|
|
70
70
|
"@power-plant/dtcg-schema": "^0.0.1",
|
|
71
|
-
"@razorwind/core": "0.0.
|
|
71
|
+
"@razorwind/core": "0.0.35"
|
|
72
72
|
},
|
|
73
73
|
"devDependencies": {
|
|
74
74
|
"@powerlines/plugin-tsdown": "^0.1.591",
|
|
@@ -76,5 +76,5 @@
|
|
|
76
76
|
"typescript": "^6.0.3"
|
|
77
77
|
},
|
|
78
78
|
"publishConfig": { "access": "public" },
|
|
79
|
-
"gitHead": "
|
|
79
|
+
"gitHead": "fed2066dc78c935df74d70ea7f4a30924022ddaa"
|
|
80
80
|
}
|