@razorwind/zsh 0.0.2 → 0.0.4
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 +3 -3
- package/dist/index.d.cts +2 -16
- package/dist/index.d.cts.map +1 -1
- package/dist/index.d.mts +2 -16
- package/dist/index.d.mts.map +1 -1
- package/dist/index.mjs +3 -3
- package/package.json +5 -5
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");
|
|
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:`Oh My Zsh Themes`,r=e.themes.map(e=>`- \`${e.fileName}\` — ${e.displayName} (\`ZSH_THEME="${e.name}"\`)`).join(`
|
|
2
2
|
`),i=e.themes.map(e=>`- \`${e.name}\` (${e.displayName})`).join(`
|
|
3
3
|
`);return`# Installing ${n}
|
|
4
4
|
|
|
@@ -46,5 +46,5 @@ source ~/.zshrc
|
|
|
46
46
|
|
|
47
47
|
\`ZSH_THEME\` must match the \`*.zsh-theme\` filename without the extension
|
|
48
48
|
(e.g. \`${t.fileName}\` → \`${t.name}\`).
|
|
49
|
-
`}function
|
|
50
|
-
`)}\n`}function
|
|
49
|
+
`}function i(e){return(0,t.themeDisplayName)(e)}const a={name:`razorwind-zsh`},o={success:`#50fa7b`,error:`#ff5555`,warning:`#f1fa8c`,time:`#50fa7b`,context:`#ff79c6`,directory:`#bd93f9`,custom:`#f1fa8c`,git:`#8be9fd`,gitClean:`#50fa7b`,gitDirty:`#f1fa8c`};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/zsh mapTheme()[${t}] must be a ZshTheme with name`);return e});if(c(e))return[e];if(!(0,t.isObject)(e))throw TypeError(`@razorwind/zsh mapTheme() must return a theme, theme array, or theme record`);return Object.entries(e).map(([e,t])=>{if(!c(t))throw TypeError(`@razorwind/zsh mapTheme()["${e}"] must be a ZshTheme with name`);return{...t,name:t.name||e}})}function u(e){if(!e.mapTheme)throw Error(`@razorwind/zsh requires options.mapTheme`)}function d(e){return{success:e?.success??o.success,error:e?.error??o.error,warning:e?.warning??o.warning,time:e?.time??o.time,context:e?.context??o.context,directory:e?.directory??o.directory,custom:e?.custom??o.custom,git:e?.git??o.git,gitClean:e?.gitClean??o.gitClean,gitDirty:e?.gitDirty??o.gitDirty}}function f(e){let t=e.trim();return t.startsWith(`#`)?t.toLowerCase():t}function p(e){return`'${e.replaceAll(`'`,`'"'"'`)}'`}function m(e,t){return e??t?`1`:`0`}function h(e){let t=d(e.colors),n=i(e),r=e.arrowIcon??`➜ `,a=e.timeFormat??`%-H:%M`,o=e.dirTrim??0,s=m(e.displayGit,!0),c=m(e.displayTime,!1),l=m(e.displayContext,!1),u=m(e.displayFullCwd,!1),h=m(e.displayNewLine,!1),g=f(t.success),_=f(t.error),v=f(t.warning),y=f(t.time),b=f(t.context),x=f(t.directory),S=f(t.custom),C=f(t.git),w=f(t.gitClean),T=f(t.gitDirty),E=e.gitPromptPrefix??`%F{${C}}%B(`,D=e.gitPromptSuffix??`%f%b`,O=e.gitPromptClean??`) %F{${w}}%B✓ `,k=e.gitPromptDirty??`) %F{${T}}%B✗ `,A=[`# -*- mode: sh; -*-`,`# vim: set ft=sh :`,`# ${n} — generated by @razorwind/zsh`,`#`,`# Oh My Zsh theme. Segment layout inspired by Dracula for Zsh:`,`# https://draculatheme.com/zsh`,`#`,``,`setopt PROMPT_SUBST`,``];return e.prompt===void 0?A.push(`# Configuration (override in ~/.zshrc before the theme loads)`,`RW_ZSH_DISPLAY_GIT=\${RW_ZSH_DISPLAY_GIT:-${s}}`,`RW_ZSH_DISPLAY_TIME=\${RW_ZSH_DISPLAY_TIME:-${c}}`,`RW_ZSH_DISPLAY_CONTEXT=\${RW_ZSH_DISPLAY_CONTEXT:-${l}}`,`RW_ZSH_DISPLAY_FULL_CWD=\${RW_ZSH_DISPLAY_FULL_CWD:-${u}}`,`RW_ZSH_DIR_TRIM=\${RW_ZSH_DIR_TRIM:-${o}}`,`RW_ZSH_DISPLAY_NEW_LINE=\${RW_ZSH_DISPLAY_NEW_LINE:-${h}}`,`RW_ZSH_ARROW_ICON=\${RW_ZSH_ARROW_ICON:-${p(r)}}`,`RW_ZSH_TIME_FORMAT=\${RW_ZSH_TIME_FORMAT:-${p(a)}}`,``,`rw_zsh_arrow() {`,` if [[ "$1" = "start" ]] && (( ! RW_ZSH_DISPLAY_NEW_LINE )); then`,` print -P -- "$RW_ZSH_ARROW_ICON"`,` elif [[ "$1" = "end" ]] && (( RW_ZSH_DISPLAY_NEW_LINE )); then`,` print -P -- "\\n$RW_ZSH_ARROW_ICON"`,` fi`,`}`,``,`rw_zsh_time_segment() {`,` if (( RW_ZSH_DISPLAY_TIME )); then`,` print -P "%D{$RW_ZSH_TIME_FORMAT} "`,` fi`,`}`,``,`rw_zsh_context() {`,` if (( RW_ZSH_DISPLAY_CONTEXT )); then`,' if [[ -n "${SSH_CONNECTION-}${SSH_CLIENT-}${SSH_TTY-}" ]] || (( EUID == 0 )); then',` print -- '%n@%m '`,` else`,` print -- '%n '`,` fi`,` fi`,`}`,``,`rw_zsh_directory() {`,` if (( RW_ZSH_DISPLAY_FULL_CWD )); then`,' print -P "%${RW_ZSH_DIR_TRIM}~ "',` else`,` print -P '%c '`,` fi`,`}`,``,`rw_zsh_custom_variable() {`,` [[ -z "$RW_ZSH_CUSTOM_VARIABLE" ]] && return`,` print -- "%F{${S}}$RW_ZSH_CUSTOM_VARIABLE "`,`}`,``,`rw_zsh_git_info() {`,` (( ! RW_ZSH_DISPLAY_GIT )) && return`,` print -P -- "$(git_prompt_info)"`,`}`,``,`PROMPT=''`,`# Status arrow — success=${g}, error=${_}, vi-cmd=${v}`,`PROMPT+='%(?:%F{${g}}:%F{${_}})%B$(rw_zsh_arrow start)'`,`PROMPT+='%F{${y}}%B$(rw_zsh_time_segment)'`,`PROMPT+='%F{${b}}%B$(rw_zsh_context)'`,`PROMPT+='%F{${x}}%B$(rw_zsh_directory)'`,`PROMPT+='$(rw_zsh_custom_variable)'`,`PROMPT+='$(rw_zsh_git_info)'`,`PROMPT+='%(?:%F{${g}}:%F{${_}})%B$(rw_zsh_arrow end)'`,`PROMPT+='%f%b'`,``):A.push(`PROMPT=${p(e.prompt)}`,``),e.rprompt!==void 0&&A.push(`RPROMPT=${p(e.rprompt)}`,``),A.push(`ZSH_THEME_GIT_PROMPT_PREFIX=${p(E)}`,`ZSH_THEME_GIT_PROMPT_SUFFIX=${p(D)}`,`ZSH_THEME_GIT_PROMPT_CLEAN=${p(O)}`,`ZSH_THEME_GIT_PROMPT_DIRTY=${p(k)}`,``),e.extra&&A.push(e.extra.replace(/\n$/,``),``),`${A.join(`
|
|
50
|
+
`)}\n`}function g(e,a){u(a);let o=a.outputPath??`zsh-themes`,c=l(a.mapTheme(e.tokens));if(c.length===0)throw Error(`@razorwind/zsh 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/zsh 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}.zsh-theme`,c=(0,n.join)(o,a);d[c]=s(c,h({...e,name:r}),`shellscript`),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:`zsh`,generate:async t=>{if(!e)throw Error(`@razorwind/zsh 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.generateZshTheme=g,exports.normalizeThemes=l,exports.renderInstallMd=r,exports.renderZshTheme=h,Object.defineProperty(exports,"resolveTokenSets",{enumerable:!0,get:function(){return t.resolveTokenSets}}),Object.defineProperty(exports,"toCssVar",{enumerable:!0,get:function(){return t.toCssVar}}),exports.toZshFg=f;
|
package/dist/index.d.cts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
+
import { flattenTokens, formatTokenValue, resolveTokenSets, toCssVar } from "@razorwind/core/utils";
|
|
2
|
+
import { GeneratorFunctionResult } from "@power-plant/core";
|
|
1
3
|
import { Schema, Tokens } from "@razorwind/core/schema";
|
|
2
4
|
import { TokenType } from "@power-plant/dtcg-schema";
|
|
3
|
-
import { formatTokenValue, toCssVar } from "@razorwind/core/utils";
|
|
4
|
-
import { GeneratorFunctionResult } from "@power-plant/core";
|
|
5
5
|
//#region src/types.d.ts
|
|
6
6
|
/**
|
|
7
7
|
* A flattened design token ready for Oh My Zsh theme mapping.
|
|
@@ -193,20 +193,6 @@ interface ZshPluginOptions {
|
|
|
193
193
|
includeTypes?: TokenType[];
|
|
194
194
|
}
|
|
195
195
|
//#endregion
|
|
196
|
-
//#region src/flatten.d.ts
|
|
197
|
-
interface TokenSet {
|
|
198
|
-
id: string;
|
|
199
|
-
tokens: Tokens;
|
|
200
|
-
}
|
|
201
|
-
/**
|
|
202
|
-
* Split `Schema.tokens` into one or more named token sets.
|
|
203
|
-
*/
|
|
204
|
-
declare function resolveTokenSets(tokens: Tokens | Record<string, Tokens>): TokenSet[];
|
|
205
|
-
/**
|
|
206
|
-
* Flatten DTCG token trees into rows helpful for {@link ZshPluginOptions.mapTheme}.
|
|
207
|
-
*/
|
|
208
|
-
declare function flattenTokens(tokens: Tokens | Record<string, Tokens>, options?: Pick<ZshPluginOptions, "includeTypes">): FlatToken[];
|
|
209
|
-
//#endregion
|
|
210
196
|
//#region src/install.d.ts
|
|
211
197
|
/**
|
|
212
198
|
* Build Oh My Zsh INSTALL.md for generated `*.zsh-theme` files.
|
package/dist/index.d.cts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.cts","names":[],"sources":["../src/types.ts","../src/
|
|
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;;;;;;;;;;;;UAae;;EAEf;;EAEA;;EAEA;;EAEA;;EAEA;;EAEA;;EAEA;;EAEA;;EAEA;;EAEA;;;;;;;;;;;;UAae;;;;;EAKf;;;;EAKA;;;;EAKA,SAAS;;;;;;EAOT;;;;;EAMA;;;;EAKA;;;;;;EAOA;;;;;;EAOA;;;;;;EAOA;;;;;;EAOA;;;;;;EAOA;;;;;;;EAQA;;;;;;EAOA;;;;EAKA;;;;EAKA;;;;EAKA;;;;EAKA;;;;EAKA;;;;;;;KAQU,oBACV,QAAQ,SAAS,eAAe,YAC7B,WAAW,aAAa,eAAe;;;;;;UAO3B;;;;;;EAMf;;;;;;EAOA,UAAU;;;;;;;EAQV;;;;;EAMA,eAAe;;;;;;;;;;iBC/MD,gBAAgB;EAC9B,QAAQ;IAAQ;IAAc;IAAqB;;;;;;;;iBCmCrC,gBACd,QAAQ,WAAW,aAAa,eAAe,YAC9C;;;;iBA+Da,QAAQ;;;;;;;;;;iBAyBR,eAAe,OAAO;;;;;;iBA4ItB,iBACd,MAAM,QACN,SAAS,mBACR,wBAAwB,QAAQ"}
|
package/dist/index.d.mts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { formatTokenValue, toCssVar } from "@razorwind/core/utils";
|
|
1
|
+
import { flattenTokens, formatTokenValue, resolveTokenSets, toCssVar } from "@razorwind/core/utils";
|
|
2
|
+
import { GeneratorFunctionResult } from "@power-plant/core";
|
|
2
3
|
import { Schema, Tokens } from "@razorwind/core/schema";
|
|
3
4
|
import { TokenType } from "@power-plant/dtcg-schema";
|
|
4
|
-
import { GeneratorFunctionResult } from "@power-plant/core";
|
|
5
5
|
//#region src/types.d.ts
|
|
6
6
|
/**
|
|
7
7
|
* A flattened design token ready for Oh My Zsh theme mapping.
|
|
@@ -193,20 +193,6 @@ interface ZshPluginOptions {
|
|
|
193
193
|
includeTypes?: TokenType[];
|
|
194
194
|
}
|
|
195
195
|
//#endregion
|
|
196
|
-
//#region src/flatten.d.ts
|
|
197
|
-
interface TokenSet {
|
|
198
|
-
id: string;
|
|
199
|
-
tokens: Tokens;
|
|
200
|
-
}
|
|
201
|
-
/**
|
|
202
|
-
* Split `Schema.tokens` into one or more named token sets.
|
|
203
|
-
*/
|
|
204
|
-
declare function resolveTokenSets(tokens: Tokens | Record<string, Tokens>): TokenSet[];
|
|
205
|
-
/**
|
|
206
|
-
* Flatten DTCG token trees into rows helpful for {@link ZshPluginOptions.mapTheme}.
|
|
207
|
-
*/
|
|
208
|
-
declare function flattenTokens(tokens: Tokens | Record<string, Tokens>, options?: Pick<ZshPluginOptions, "includeTypes">): FlatToken[];
|
|
209
|
-
//#endregion
|
|
210
196
|
//#region src/install.d.ts
|
|
211
197
|
/**
|
|
212
198
|
* Build Oh My Zsh INSTALL.md for generated `*.zsh-theme` files.
|
package/dist/index.d.mts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.mts","names":[],"sources":["../src/types.ts","../src/
|
|
1
|
+
{"version":3,"file":"index.d.mts","names":[],"sources":["../src/types.ts","../src/install.ts","../src/generate.ts","../src/index.ts"],"mappings":""}
|
package/dist/index.mjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{definePlugin as e}from"@razorwind/core/plugin";import{createDocument as t,
|
|
1
|
+
import{definePlugin as e}from"@razorwind/core/plugin";import{createDocument as t,flattenTokens as n,formatTokenValue as r,isObject as i,resolveTokenSets as a,slugifyThemeName as o,themeDisplayName as s,toCssVar as c}from"@razorwind/core/utils";import{join as l}from"node:path";function u(e){let t=e.themes[0],n=e.themes.length===1?t.displayName:`Oh My Zsh Themes`,r=e.themes.map(e=>`- \`${e.fileName}\` — ${e.displayName} (\`ZSH_THEME="${e.name}"\`)`).join(`
|
|
2
2
|
`),i=e.themes.map(e=>`- \`${e.name}\` (${e.displayName})`).join(`
|
|
3
3
|
`);return`# Installing ${n}
|
|
4
4
|
|
|
@@ -46,6 +46,6 @@ source ~/.zshrc
|
|
|
46
46
|
|
|
47
47
|
\`ZSH_THEME\` must match the \`*.zsh-theme\` filename without the extension
|
|
48
48
|
(e.g. \`${t.fileName}\` → \`${t.name}\`).
|
|
49
|
-
`}function
|
|
50
|
-
`)}\n`}function
|
|
49
|
+
`}function d(e){return s(e)}const f={name:`razorwind-zsh`},p={success:`#50fa7b`,error:`#ff5555`,warning:`#f1fa8c`,time:`#50fa7b`,context:`#ff79c6`,directory:`#bd93f9`,custom:`#f1fa8c`,git:`#8be9fd`,gitClean:`#50fa7b`,gitDirty:`#f1fa8c`};function m(e,n,r){return t(e,n,f,r)}function h(e){return i(e)&&typeof e.name==`string`&&e.name.length>0}function g(e){if(Array.isArray(e))return e.map((e,t)=>{if(!h(e))throw TypeError(`@razorwind/zsh mapTheme()[${t}] must be a ZshTheme with name`);return e});if(h(e))return[e];if(!i(e))throw TypeError(`@razorwind/zsh mapTheme() must return a theme, theme array, or theme record`);return Object.entries(e).map(([e,t])=>{if(!h(t))throw TypeError(`@razorwind/zsh mapTheme()["${e}"] must be a ZshTheme with name`);return{...t,name:t.name||e}})}function _(e){if(!e.mapTheme)throw Error(`@razorwind/zsh requires options.mapTheme`)}function v(e){return{success:e?.success??p.success,error:e?.error??p.error,warning:e?.warning??p.warning,time:e?.time??p.time,context:e?.context??p.context,directory:e?.directory??p.directory,custom:e?.custom??p.custom,git:e?.git??p.git,gitClean:e?.gitClean??p.gitClean,gitDirty:e?.gitDirty??p.gitDirty}}function y(e){let t=e.trim();return t.startsWith(`#`)?t.toLowerCase():t}function b(e){return`'${e.replaceAll(`'`,`'"'"'`)}'`}function x(e,t){return e??t?`1`:`0`}function S(e){let t=v(e.colors),n=d(e),r=e.arrowIcon??`➜ `,i=e.timeFormat??`%-H:%M`,a=e.dirTrim??0,o=x(e.displayGit,!0),s=x(e.displayTime,!1),c=x(e.displayContext,!1),l=x(e.displayFullCwd,!1),u=x(e.displayNewLine,!1),f=y(t.success),p=y(t.error),m=y(t.warning),h=y(t.time),g=y(t.context),_=y(t.directory),S=y(t.custom),C=y(t.git),w=y(t.gitClean),T=y(t.gitDirty),E=e.gitPromptPrefix??`%F{${C}}%B(`,D=e.gitPromptSuffix??`%f%b`,O=e.gitPromptClean??`) %F{${w}}%B✓ `,k=e.gitPromptDirty??`) %F{${T}}%B✗ `,A=[`# -*- mode: sh; -*-`,`# vim: set ft=sh :`,`# ${n} — generated by @razorwind/zsh`,`#`,`# Oh My Zsh theme. Segment layout inspired by Dracula for Zsh:`,`# https://draculatheme.com/zsh`,`#`,``,`setopt PROMPT_SUBST`,``];return e.prompt===void 0?A.push(`# Configuration (override in ~/.zshrc before the theme loads)`,`RW_ZSH_DISPLAY_GIT=\${RW_ZSH_DISPLAY_GIT:-${o}}`,`RW_ZSH_DISPLAY_TIME=\${RW_ZSH_DISPLAY_TIME:-${s}}`,`RW_ZSH_DISPLAY_CONTEXT=\${RW_ZSH_DISPLAY_CONTEXT:-${c}}`,`RW_ZSH_DISPLAY_FULL_CWD=\${RW_ZSH_DISPLAY_FULL_CWD:-${l}}`,`RW_ZSH_DIR_TRIM=\${RW_ZSH_DIR_TRIM:-${a}}`,`RW_ZSH_DISPLAY_NEW_LINE=\${RW_ZSH_DISPLAY_NEW_LINE:-${u}}`,`RW_ZSH_ARROW_ICON=\${RW_ZSH_ARROW_ICON:-${b(r)}}`,`RW_ZSH_TIME_FORMAT=\${RW_ZSH_TIME_FORMAT:-${b(i)}}`,``,`rw_zsh_arrow() {`,` if [[ "$1" = "start" ]] && (( ! RW_ZSH_DISPLAY_NEW_LINE )); then`,` print -P -- "$RW_ZSH_ARROW_ICON"`,` elif [[ "$1" = "end" ]] && (( RW_ZSH_DISPLAY_NEW_LINE )); then`,` print -P -- "\\n$RW_ZSH_ARROW_ICON"`,` fi`,`}`,``,`rw_zsh_time_segment() {`,` if (( RW_ZSH_DISPLAY_TIME )); then`,` print -P "%D{$RW_ZSH_TIME_FORMAT} "`,` fi`,`}`,``,`rw_zsh_context() {`,` if (( RW_ZSH_DISPLAY_CONTEXT )); then`,' if [[ -n "${SSH_CONNECTION-}${SSH_CLIENT-}${SSH_TTY-}" ]] || (( EUID == 0 )); then',` print -- '%n@%m '`,` else`,` print -- '%n '`,` fi`,` fi`,`}`,``,`rw_zsh_directory() {`,` if (( RW_ZSH_DISPLAY_FULL_CWD )); then`,' print -P "%${RW_ZSH_DIR_TRIM}~ "',` else`,` print -P '%c '`,` fi`,`}`,``,`rw_zsh_custom_variable() {`,` [[ -z "$RW_ZSH_CUSTOM_VARIABLE" ]] && return`,` print -- "%F{${S}}$RW_ZSH_CUSTOM_VARIABLE "`,`}`,``,`rw_zsh_git_info() {`,` (( ! RW_ZSH_DISPLAY_GIT )) && return`,` print -P -- "$(git_prompt_info)"`,`}`,``,`PROMPT=''`,`# Status arrow — success=${f}, error=${p}, vi-cmd=${m}`,`PROMPT+='%(?:%F{${f}}:%F{${p}})%B$(rw_zsh_arrow start)'`,`PROMPT+='%F{${h}}%B$(rw_zsh_time_segment)'`,`PROMPT+='%F{${g}}%B$(rw_zsh_context)'`,`PROMPT+='%F{${_}}%B$(rw_zsh_directory)'`,`PROMPT+='$(rw_zsh_custom_variable)'`,`PROMPT+='$(rw_zsh_git_info)'`,`PROMPT+='%(?:%F{${f}}:%F{${p}})%B$(rw_zsh_arrow end)'`,`PROMPT+='%f%b'`,``):A.push(`PROMPT=${b(e.prompt)}`,``),e.rprompt!==void 0&&A.push(`RPROMPT=${b(e.rprompt)}`,``),A.push(`ZSH_THEME_GIT_PROMPT_PREFIX=${b(E)}`,`ZSH_THEME_GIT_PROMPT_SUFFIX=${b(D)}`,`ZSH_THEME_GIT_PROMPT_CLEAN=${b(O)}`,`ZSH_THEME_GIT_PROMPT_DIRTY=${b(k)}`,``),e.extra&&A.push(e.extra.replace(/\n$/,``),``),`${A.join(`
|
|
50
|
+
`)}\n`}function C(e,t){_(t);let n=t.outputPath??`zsh-themes`,r=g(t.mapTheme(e.tokens));if(r.length===0)throw Error(`@razorwind/zsh mapTheme() returned no themes`);let i={},a=new Set,s=[];for(let e of r){let t=o(e.name);if(!t)throw TypeError(`@razorwind/zsh theme name "${e.name}" slugifies to an empty string`);if(a.has(t)){let n=2;for(;a.has(`${o(e.name)}-${n}`);)n+=1;t=`${o(e.name)}-${n}`}a.add(t);let r=`${t}.zsh-theme`,c=l(n,r);i[c]=m(c,S({...e,name:t}),`shellscript`),s.push({name:t,displayName:d(e),fileName:r})}let c=t.installGuide??u({themes:s}),f=l(n,`INSTALL.md`);return i[f]=m(f,c,`markdown`),i}var w=e(e=>({name:`zsh`,generate:async t=>{if(!e)throw Error(`@razorwind/zsh requires options: { mapTheme }`);return C(t,e)}}));export{w as default,n as flattenTokens,r as formatTokenValue,C as generateZshTheme,g as normalizeThemes,u as renderInstallMd,S as renderZshTheme,a as resolveTokenSets,c as toCssVar,y as toZshFg};
|
|
51
51
|
//# sourceMappingURL=index.mjs.map
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@razorwind/zsh",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.4",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"description": "Razorwind plugin that generates Oh My Zsh themes from design tokens.",
|
|
6
6
|
"repository": {
|
|
@@ -67,15 +67,15 @@
|
|
|
67
67
|
"types": "./dist/index.d.cts",
|
|
68
68
|
"typings": "dist/index.d.mts",
|
|
69
69
|
"dependencies": {
|
|
70
|
-
"@power-plant/core": "^0.0.
|
|
70
|
+
"@power-plant/core": "^0.0.81",
|
|
71
71
|
"@power-plant/dtcg-schema": "^0.0.1",
|
|
72
|
-
"@razorwind/core": "0.0.
|
|
72
|
+
"@razorwind/core": "^0.0.30"
|
|
73
73
|
},
|
|
74
74
|
"devDependencies": {
|
|
75
|
-
"@powerlines/plugin-tsdown": "^0.1.
|
|
75
|
+
"@powerlines/plugin-tsdown": "^0.1.590",
|
|
76
76
|
"@types/node": "^25.9.5",
|
|
77
77
|
"typescript": "^6.0.3"
|
|
78
78
|
},
|
|
79
79
|
"publishConfig": { "access": "public" },
|
|
80
|
-
"gitHead": "
|
|
80
|
+
"gitHead": "11a6e827627acf51ef0044e366fd9493f2173ec2"
|
|
81
81
|
}
|