@razorwind/cursor 0.0.3 → 0.0.6
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 +6 -6
- package/dist/index.d.cts +17 -31
- package/dist/index.d.cts.map +1 -1
- package/dist/index.d.mts +17 -31
- package/dist/index.d.mts.map +1 -1
- package/dist/index.mjs +6 -6
- 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){return`import { existsSync, readFileSync, renameSync, writeFileSync } from "node:fs";
|
|
2
2
|
import { dirname, join } from "node:path";
|
|
3
3
|
import { fileURLToPath } from "node:url";
|
|
4
4
|
|
|
@@ -62,7 +62,7 @@ export function withVsixPackageShim(action: () => void): void {
|
|
|
62
62
|
console.log(\`\\nRestored package name: \${originalName}\`);
|
|
63
63
|
}
|
|
64
64
|
}
|
|
65
|
-
`}function
|
|
65
|
+
`}function i(e){let t=`dist/${e}.vsix`;return`import { execFileSync } from "node:child_process";
|
|
66
66
|
import { mkdirSync } from "node:fs";
|
|
67
67
|
import { join } from "node:path";
|
|
68
68
|
import { packageRoot, withVsixPackageShim } from "./vsixPackageShim.ts";
|
|
@@ -86,7 +86,7 @@ withVsixPackageShim(() => {
|
|
|
86
86
|
}
|
|
87
87
|
);
|
|
88
88
|
});
|
|
89
|
-
`}function
|
|
89
|
+
`}function a(e){let t=e.themes.map(e=>`- ${e.label}`).join(`
|
|
90
90
|
`),n=e.repositoryUrl?`\n## Links\n\n- [GitHub](${e.repositoryUrl})\n`:``;return`# ${e.displayName}
|
|
91
91
|
|
|
92
92
|
${e.description}
|
|
@@ -98,7 +98,7 @@ See **INSTALL.md** for Cursor VSIX install steps (\`Extensions: Install from VSI
|
|
|
98
98
|
## Themes
|
|
99
99
|
|
|
100
100
|
${t||`- (generated themes)`}
|
|
101
|
-
${n}`}function
|
|
101
|
+
${n}`}function o(e){let t=e.themes.map(e=>`- \`${e.path}\` — ${e.label}`).join(`
|
|
102
102
|
`),n=e.themes.map(e=>`- **${e.label}**`).join(`
|
|
103
103
|
`),r=`./dist/${e.extensionName}.vsix`;return`# Installing ${e.displayName}
|
|
104
104
|
|
|
@@ -134,7 +134,7 @@ ${n}
|
|
|
134
134
|
## Select theme
|
|
135
135
|
|
|
136
136
|
\`Preferences → Color Theme\` (or Command Palette → **Color Theme**) → choose a contributed label above.
|
|
137
|
-
`}function
|
|
137
|
+
`}function s(){return`node_modules/**
|
|
138
138
|
src/**
|
|
139
139
|
scripts/**
|
|
140
140
|
test/**
|
|
@@ -150,4 +150,4 @@ artifacts/**
|
|
|
150
150
|
README.md.bak
|
|
151
151
|
INSTALL.md
|
|
152
152
|
.DS_Store
|
|
153
|
-
`}const
|
|
153
|
+
`}const c={name:`razorwind-cursor`},l={vscode:`^1.85.0`};function u(e,n,r){return(0,t.createDocument)(e,n,c,r)}function d(e){switch(e){case`light`:return`vs`;case`hc`:return`hc-black`;case`hcLight`:return`hc-light`;case`dark`:return`vs-dark`;default:return`vs-dark`}}function f(e){return(0,t.isObject)(e)&&typeof e.name==`string`&&(e.type===`light`||e.type===`dark`||e.type===`hc`||e.type===`hcLight`)}function p(e){if(Array.isArray(e))return e.map((e,t)=>{if(!f(e))throw TypeError(`@razorwind/cursor mapTheme()[${t}] must be a CursorTheme with name + type`);return e});if(f(e))return[e];if(!(0,t.isObject)(e))throw TypeError(`@razorwind/cursor mapTheme() must return a theme, theme array, or theme record`);return Object.entries(e).map(([e,t])=>{if(!f(t))throw TypeError(`@razorwind/cursor mapTheme()["${e}"] must be a CursorTheme with name + type`);return{...t,name:t.name||e}})}function m(e){if(typeof e==`string`)return e;if(e&&typeof e.url==`string`)return e.url}function h(e){if(!e.mapTheme)throw Error(`@razorwind/cursor requires options.mapTheme`);if(!e.name||e.name.includes(`/`))throw Error(`@razorwind/cursor requires options.name (unscoped extension id)`);if(!e.publisher)throw Error(`@razorwind/cursor requires options.publisher`)}function g(e){return e===`light`||e===`hcLight`?`light`:`dark`}function _(e){let t={name:e.name,type:g(e.type),colors:e.colors??{}};return e.displayName&&(t.displayName=e.displayName),e.tokenColors&&(t.tokenColors=e.tokenColors),e.semanticHighlighting!==void 0&&(t.semanticHighlighting=e.semanticHighlighting),e.semanticTokenColors&&(t.semanticTokenColors=e.semanticTokenColors),`${JSON.stringify(t,null,2)}\n`}function v(e,n,r){let i=e.includeScripts!==!1,a=e.displayName??(0,t.titleCase)(e.name),o=e.description??`${a} — Cursor themes generated by Razorwind`,s={themes:n.map((e,n)=>({label:e.displayName??e.name,uiTheme:d(e.type),path:r?.[n]??`./themes/${(0,t.slugifyThemeName)(e.name)}.json`}))},c=i?{"package-vsix":`node --import tsx scripts/buildCursorPackage.ts`}:void 0,u={name:e.name,displayName:a,description:o,version:e.version??`0.0.1`,publisher:e.publisher,license:e.license??`Apache-2.0`,categories:e.categories??[`Themes`],engines:e.engines??{...l},contributes:s,...e.keywords?{keywords:e.keywords}:{},...e.repository?{repository:e.repository}:{},...e.homepage?{homepage:e.homepage}:{},...e.bugs?{bugs:e.bugs}:{},...e.author?{author:e.author}:{},...e.icon?{icon:e.icon}:{},...e.galleryBanner?{galleryBanner:e.galleryBanner}:{},...c?{scripts:c}:{},...e.packageJson??{}};return u.name=e.name,u.publisher=e.publisher,u.contributes=s,c&&(u.scripts=(0,t.isObject)(u.scripts)&&!Array.isArray(u.scripts)?{...u.scripts,...c}:c),`${JSON.stringify(u,null,2)}\n`}function y(e,c){h(c);let l=c.outputPath??`cursor-extension`,d=c.includeScripts!==!1,f=c.extensionName??c.name,g=c.displayName??(0,t.titleCase)(c.name),y=c.description??`${g} — Cursor themes generated by Razorwind`,b=p(c.mapTheme(e.tokens));if(b.length===0)throw Error(`@razorwind/cursor mapTheme() returned no themes`);let x={},S=new Set,C=[];for(let e of b){let r=(0,t.slugifyThemeName)(e.name);if(S.has(r)){let n=2;for(;S.has(`${(0,t.slugifyThemeName)(e.name)}-${n}`);)n+=1;r=`${(0,t.slugifyThemeName)(e.name)}-${n}`}S.add(r);let i=`${r}.json`,a=(0,n.join)(l,`themes`,i);x[a]=u(a,_(e),`json`),C.push({label:e.displayName??e.name,path:`themes/${i}`,slug:r})}let w=(0,n.join)(l,`package.json`);x[w]=u(w,v(c,b,C.map(e=>`./${e.path}`)),`json`);let T=(0,n.join)(l,`.vscodeignore`);x[T]=u(T,s(),`ignore`);let E=C.map(e=>({label:e.label})),D=c.readme??a({displayName:g,description:y,themes:E,repositoryUrl:m(c.repository)}),O=(0,n.join)(l,`README.md`);x[O]=u(O,D,`markdown`);let k=c.installGuide??o({displayName:g,extensionName:f,themes:C.map(e=>({label:e.label,path:e.path}))}),A=(0,n.join)(l,`INSTALL.md`);if(x[A]=u(A,k,`markdown`),d){let e=(0,n.join)(l,`scripts`,`vsixPackageShim.ts`);x[e]=u(e,r(f),`typescript`);let t=(0,n.join)(l,`scripts`,`buildCursorPackage.ts`);x[t]=u(t,i(f),`typescript`);let o=(0,n.join)(l,`scripts`,`README.package.md`);x[o]=u(o,a({displayName:g,description:y,themes:E,repositoryUrl:m(c.repository)}),`markdown`)}return x}var b=(0,e.definePlugin)(e=>({name:`cursor`,generate:async t=>{if(!e)throw Error(`@razorwind/cursor requires options: { name, publisher, mapTheme }`);return y(t,e)}}));exports.default=b,Object.defineProperty(exports,"flattenTokens",{enumerable:!0,get:function(){return t.flattenTokens}}),Object.defineProperty(exports,"formatTokenValue",{enumerable:!0,get:function(){return t.formatTokenValue}}),exports.generateCursorExtension=y,exports.normalizeThemes=p,exports.renderInstallMd=o,exports.renderPackageJson=v,exports.renderThemeJson=_,Object.defineProperty(exports,"resolveTokenSets",{enumerable:!0,get:function(){return t.resolveTokenSets}}),Object.defineProperty(exports,"toCssVar",{enumerable:!0,get:function(){return t.toCssVar}});
|
package/dist/index.d.cts
CHANGED
|
@@ -1,7 +1,22 @@
|
|
|
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
|
-
|
|
4
|
-
|
|
5
|
+
//#region src/scripts.d.ts
|
|
6
|
+
/**
|
|
7
|
+
* Cursor-specific install guide (VSIX via Command Palette).
|
|
8
|
+
*
|
|
9
|
+
* @see https://draculatheme.com/cursor
|
|
10
|
+
*/
|
|
11
|
+
declare function renderInstallMd(options: {
|
|
12
|
+
displayName: string;
|
|
13
|
+
extensionName: string;
|
|
14
|
+
themes: Array<{
|
|
15
|
+
label: string;
|
|
16
|
+
path: string;
|
|
17
|
+
}>;
|
|
18
|
+
}): string;
|
|
19
|
+
//#endregion
|
|
5
20
|
//#region src/types.d.ts
|
|
6
21
|
/**
|
|
7
22
|
* A flattened design token ready for Cursor theme mapping.
|
|
@@ -184,35 +199,6 @@ interface CursorPluginOptions {
|
|
|
184
199
|
packageJson?: Record<string, unknown>;
|
|
185
200
|
}
|
|
186
201
|
//#endregion
|
|
187
|
-
//#region src/flatten.d.ts
|
|
188
|
-
interface TokenSet {
|
|
189
|
-
id: string;
|
|
190
|
-
tokens: Tokens;
|
|
191
|
-
}
|
|
192
|
-
/**
|
|
193
|
-
* Split `Schema.tokens` into one or more named token sets.
|
|
194
|
-
*/
|
|
195
|
-
declare function resolveTokenSets(tokens: Tokens | Record<string, Tokens>): TokenSet[];
|
|
196
|
-
/**
|
|
197
|
-
* Flatten DTCG token trees into rows helpful for {@link CursorPluginOptions.mapTheme}.
|
|
198
|
-
*/
|
|
199
|
-
declare function flattenTokens(tokens: Tokens | Record<string, Tokens>, options?: Pick<CursorPluginOptions, "includeTypes">): FlatToken[];
|
|
200
|
-
//#endregion
|
|
201
|
-
//#region src/scripts.d.ts
|
|
202
|
-
/**
|
|
203
|
-
* Cursor-specific install guide (VSIX via Command Palette).
|
|
204
|
-
*
|
|
205
|
-
* @see https://draculatheme.com/cursor
|
|
206
|
-
*/
|
|
207
|
-
declare function renderInstallMd(options: {
|
|
208
|
-
displayName: string;
|
|
209
|
-
extensionName: string;
|
|
210
|
-
themes: Array<{
|
|
211
|
-
label: string;
|
|
212
|
-
path: string;
|
|
213
|
-
}>;
|
|
214
|
-
}): string;
|
|
215
|
-
//#endregion
|
|
216
202
|
//#region src/generate.d.ts
|
|
217
203
|
/**
|
|
218
204
|
* Normalize {@link CursorPluginOptions.mapTheme} results into a theme list.
|
package/dist/index.d.cts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.cts","names":[],"sources":["../src/
|
|
1
|
+
{"version":3,"file":"index.d.cts","names":[],"sources":["../src/scripts.ts","../src/types.ts","../src/generate.ts","../src/index.ts"],"mappings":";;;;;;;;;;iBAkKgB,gBAAgB;EAC9B;EACA;EACA,QAAQ;IAAQ;IAAe;;;;;;;;UC7IhB;;EAEf;;EAEA,OAAO;;EAEP;;EAEA;;EAEA;;EAEA;;;;;;;UAQe;EACf;EACA;EACA;IACE;IACA;IACA;;;;;;;;;;;UAYa;;EAEf;;EAEA;;EAEA;EACA,SAAS;EACT,cAAc;EACd;EACA,sBAAsB;IAET;IAAqB;IAAoB;;;;;;;;KAS5C,uBACV,QAAQ,SAAS,eAAe,YAC7B,cAAc,gBAAgB,eAAe;;;;KAKtC;EAGN;EACA;EACA;;;;;;;;UASW;;;;;;;EAOf;;;;;;EAOA,UAAU;;;;;EAMV;;EAGA;;EAGA;;;;;;EAOA;;EAGA;;;;;EAMA;;;;EAKA;EAEA;IAGM;IACA;IACA;;EAGN;EAEA;IAGM;IACA;;EAGN,SAAS;;;;;EAMT;EAEA;IACE;IACA;;;;;EAMF;EAEA;;;;;;EAOA;IACE;;;;;;;;;;EAWF;;;;;EAMA;;;;;;;EAQA;;;;;EAMA,eAAe;;;;;EAMf,cAAc;;;;;;;iBC1JA,gBACd,QAAQ,cAAc,gBAAgB,eAAe,eACpD;iBA0Ea,gBAAgB,OAAO;;;;;;;iBA6BvB,kBACd,SAAS,qBACT,QAAQ,eACR;;;;;;;;;iBAsEc,wBACd,MAAM,QACN,SAAS,sBACR,wBAAwB,QAAQ"}
|
package/dist/index.d.mts
CHANGED
|
@@ -1,7 +1,22 @@
|
|
|
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
|
-
|
|
5
|
+
//#region src/scripts.d.ts
|
|
6
|
+
/**
|
|
7
|
+
* Cursor-specific install guide (VSIX via Command Palette).
|
|
8
|
+
*
|
|
9
|
+
* @see https://draculatheme.com/cursor
|
|
10
|
+
*/
|
|
11
|
+
declare function renderInstallMd(options: {
|
|
12
|
+
displayName: string;
|
|
13
|
+
extensionName: string;
|
|
14
|
+
themes: Array<{
|
|
15
|
+
label: string;
|
|
16
|
+
path: string;
|
|
17
|
+
}>;
|
|
18
|
+
}): string;
|
|
19
|
+
//#endregion
|
|
5
20
|
//#region src/types.d.ts
|
|
6
21
|
/**
|
|
7
22
|
* A flattened design token ready for Cursor theme mapping.
|
|
@@ -184,35 +199,6 @@ interface CursorPluginOptions {
|
|
|
184
199
|
packageJson?: Record<string, unknown>;
|
|
185
200
|
}
|
|
186
201
|
//#endregion
|
|
187
|
-
//#region src/flatten.d.ts
|
|
188
|
-
interface TokenSet {
|
|
189
|
-
id: string;
|
|
190
|
-
tokens: Tokens;
|
|
191
|
-
}
|
|
192
|
-
/**
|
|
193
|
-
* Split `Schema.tokens` into one or more named token sets.
|
|
194
|
-
*/
|
|
195
|
-
declare function resolveTokenSets(tokens: Tokens | Record<string, Tokens>): TokenSet[];
|
|
196
|
-
/**
|
|
197
|
-
* Flatten DTCG token trees into rows helpful for {@link CursorPluginOptions.mapTheme}.
|
|
198
|
-
*/
|
|
199
|
-
declare function flattenTokens(tokens: Tokens | Record<string, Tokens>, options?: Pick<CursorPluginOptions, "includeTypes">): FlatToken[];
|
|
200
|
-
//#endregion
|
|
201
|
-
//#region src/scripts.d.ts
|
|
202
|
-
/**
|
|
203
|
-
* Cursor-specific install guide (VSIX via Command Palette).
|
|
204
|
-
*
|
|
205
|
-
* @see https://draculatheme.com/cursor
|
|
206
|
-
*/
|
|
207
|
-
declare function renderInstallMd(options: {
|
|
208
|
-
displayName: string;
|
|
209
|
-
extensionName: string;
|
|
210
|
-
themes: Array<{
|
|
211
|
-
label: string;
|
|
212
|
-
path: string;
|
|
213
|
-
}>;
|
|
214
|
-
}): string;
|
|
215
|
-
//#endregion
|
|
216
202
|
//#region src/generate.d.ts
|
|
217
203
|
/**
|
|
218
204
|
* Normalize {@link CursorPluginOptions.mapTheme} results into a theme list.
|
package/dist/index.d.mts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.mts","names":[],"sources":["../src/
|
|
1
|
+
{"version":3,"file":"index.d.mts","names":[],"sources":["../src/scripts.ts","../src/types.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,titleCase as s,toCssVar as c}from"@razorwind/core/utils";import{join as l}from"node:path";function u(e){return`import { existsSync, readFileSync, renameSync, writeFileSync } from "node:fs";
|
|
2
2
|
import { dirname, join } from "node:path";
|
|
3
3
|
import { fileURLToPath } from "node:url";
|
|
4
4
|
|
|
@@ -62,7 +62,7 @@ export function withVsixPackageShim(action: () => void): void {
|
|
|
62
62
|
console.log(\`\\nRestored package name: \${originalName}\`);
|
|
63
63
|
}
|
|
64
64
|
}
|
|
65
|
-
`}function
|
|
65
|
+
`}function d(e){let t=`dist/${e}.vsix`;return`import { execFileSync } from "node:child_process";
|
|
66
66
|
import { mkdirSync } from "node:fs";
|
|
67
67
|
import { join } from "node:path";
|
|
68
68
|
import { packageRoot, withVsixPackageShim } from "./vsixPackageShim.ts";
|
|
@@ -86,7 +86,7 @@ withVsixPackageShim(() => {
|
|
|
86
86
|
}
|
|
87
87
|
);
|
|
88
88
|
});
|
|
89
|
-
`}function
|
|
89
|
+
`}function f(e){let t=e.themes.map(e=>`- ${e.label}`).join(`
|
|
90
90
|
`),n=e.repositoryUrl?`\n## Links\n\n- [GitHub](${e.repositoryUrl})\n`:``;return`# ${e.displayName}
|
|
91
91
|
|
|
92
92
|
${e.description}
|
|
@@ -98,7 +98,7 @@ See **INSTALL.md** for Cursor VSIX install steps (\`Extensions: Install from VSI
|
|
|
98
98
|
## Themes
|
|
99
99
|
|
|
100
100
|
${t||`- (generated themes)`}
|
|
101
|
-
${n}`}function
|
|
101
|
+
${n}`}function p(e){let t=e.themes.map(e=>`- \`${e.path}\` — ${e.label}`).join(`
|
|
102
102
|
`),n=e.themes.map(e=>`- **${e.label}**`).join(`
|
|
103
103
|
`),r=`./dist/${e.extensionName}.vsix`;return`# Installing ${e.displayName}
|
|
104
104
|
|
|
@@ -134,7 +134,7 @@ ${n}
|
|
|
134
134
|
## Select theme
|
|
135
135
|
|
|
136
136
|
\`Preferences → Color Theme\` (or Command Palette → **Color Theme**) → choose a contributed label above.
|
|
137
|
-
`}function
|
|
137
|
+
`}function m(){return`node_modules/**
|
|
138
138
|
src/**
|
|
139
139
|
scripts/**
|
|
140
140
|
test/**
|
|
@@ -150,5 +150,5 @@ artifacts/**
|
|
|
150
150
|
README.md.bak
|
|
151
151
|
INSTALL.md
|
|
152
152
|
.DS_Store
|
|
153
|
-
`}const
|
|
153
|
+
`}const h={name:`razorwind-cursor`},g={vscode:`^1.85.0`};function _(e,n,r){return t(e,n,h,r)}function v(e){switch(e){case`light`:return`vs`;case`hc`:return`hc-black`;case`hcLight`:return`hc-light`;case`dark`:return`vs-dark`;default:return`vs-dark`}}function y(e){return i(e)&&typeof e.name==`string`&&(e.type===`light`||e.type===`dark`||e.type===`hc`||e.type===`hcLight`)}function b(e){if(Array.isArray(e))return e.map((e,t)=>{if(!y(e))throw TypeError(`@razorwind/cursor mapTheme()[${t}] must be a CursorTheme with name + type`);return e});if(y(e))return[e];if(!i(e))throw TypeError(`@razorwind/cursor mapTheme() must return a theme, theme array, or theme record`);return Object.entries(e).map(([e,t])=>{if(!y(t))throw TypeError(`@razorwind/cursor mapTheme()["${e}"] must be a CursorTheme with name + type`);return{...t,name:t.name||e}})}function x(e){if(typeof e==`string`)return e;if(e&&typeof e.url==`string`)return e.url}function S(e){if(!e.mapTheme)throw Error(`@razorwind/cursor requires options.mapTheme`);if(!e.name||e.name.includes(`/`))throw Error(`@razorwind/cursor requires options.name (unscoped extension id)`);if(!e.publisher)throw Error(`@razorwind/cursor requires options.publisher`)}function C(e){return e===`light`||e===`hcLight`?`light`:`dark`}function w(e){let t={name:e.name,type:C(e.type),colors:e.colors??{}};return e.displayName&&(t.displayName=e.displayName),e.tokenColors&&(t.tokenColors=e.tokenColors),e.semanticHighlighting!==void 0&&(t.semanticHighlighting=e.semanticHighlighting),e.semanticTokenColors&&(t.semanticTokenColors=e.semanticTokenColors),`${JSON.stringify(t,null,2)}\n`}function T(e,t,n){let r=e.includeScripts!==!1,a=e.displayName??s(e.name),c=e.description??`${a} — Cursor themes generated by Razorwind`,l={themes:t.map((e,t)=>({label:e.displayName??e.name,uiTheme:v(e.type),path:n?.[t]??`./themes/${o(e.name)}.json`}))},u=r?{"package-vsix":`node --import tsx scripts/buildCursorPackage.ts`}:void 0,d={name:e.name,displayName:a,description:c,version:e.version??`0.0.1`,publisher:e.publisher,license:e.license??`Apache-2.0`,categories:e.categories??[`Themes`],engines:e.engines??{...g},contributes:l,...e.keywords?{keywords:e.keywords}:{},...e.repository?{repository:e.repository}:{},...e.homepage?{homepage:e.homepage}:{},...e.bugs?{bugs:e.bugs}:{},...e.author?{author:e.author}:{},...e.icon?{icon:e.icon}:{},...e.galleryBanner?{galleryBanner:e.galleryBanner}:{},...u?{scripts:u}:{},...e.packageJson??{}};return d.name=e.name,d.publisher=e.publisher,d.contributes=l,u&&(d.scripts=i(d.scripts)&&!Array.isArray(d.scripts)?{...d.scripts,...u}:u),`${JSON.stringify(d,null,2)}\n`}function E(e,t){S(t);let n=t.outputPath??`cursor-extension`,r=t.includeScripts!==!1,i=t.extensionName??t.name,a=t.displayName??s(t.name),c=t.description??`${a} — Cursor themes generated by Razorwind`,h=b(t.mapTheme(e.tokens));if(h.length===0)throw Error(`@razorwind/cursor mapTheme() returned no themes`);let g={},v=new Set,y=[];for(let e of h){let t=o(e.name);if(v.has(t)){let n=2;for(;v.has(`${o(e.name)}-${n}`);)n+=1;t=`${o(e.name)}-${n}`}v.add(t);let r=`${t}.json`,i=l(n,`themes`,r);g[i]=_(i,w(e),`json`),y.push({label:e.displayName??e.name,path:`themes/${r}`,slug:t})}let C=l(n,`package.json`);g[C]=_(C,T(t,h,y.map(e=>`./${e.path}`)),`json`);let E=l(n,`.vscodeignore`);g[E]=_(E,m(),`ignore`);let D=y.map(e=>({label:e.label})),O=t.readme??f({displayName:a,description:c,themes:D,repositoryUrl:x(t.repository)}),k=l(n,`README.md`);g[k]=_(k,O,`markdown`);let A=t.installGuide??p({displayName:a,extensionName:i,themes:y.map(e=>({label:e.label,path:e.path}))}),j=l(n,`INSTALL.md`);if(g[j]=_(j,A,`markdown`),r){let e=l(n,`scripts`,`vsixPackageShim.ts`);g[e]=_(e,u(i),`typescript`);let r=l(n,`scripts`,`buildCursorPackage.ts`);g[r]=_(r,d(i),`typescript`);let o=l(n,`scripts`,`README.package.md`);g[o]=_(o,f({displayName:a,description:c,themes:D,repositoryUrl:x(t.repository)}),`markdown`)}return g}var D=e(e=>({name:`cursor`,generate:async t=>{if(!e)throw Error(`@razorwind/cursor requires options: { name, publisher, mapTheme }`);return E(t,e)}}));export{D as default,n as flattenTokens,r as formatTokenValue,E as generateCursorExtension,b as normalizeThemes,p as renderInstallMd,T as renderPackageJson,w as renderThemeJson,a as resolveTokenSets,c as toCssVar};
|
|
154
154
|
//# sourceMappingURL=index.mjs.map
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@razorwind/cursor",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.6",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"description": "Razorwind Cursor theme extension plugin that creates VSIX 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.31"
|
|
73
73
|
},
|
|
74
74
|
"devDependencies": {
|
|
75
|
-
"@powerlines/plugin-tsdown": "^0.1.
|
|
75
|
+
"@powerlines/plugin-tsdown": "^0.1.591",
|
|
76
76
|
"@types/node": "^25.9.5",
|
|
77
77
|
"typescript": "^6.0.3"
|
|
78
78
|
},
|
|
79
79
|
"publishConfig": { "access": "public" },
|
|
80
|
-
"gitHead": "
|
|
80
|
+
"gitHead": "e5f1a6ed40a0cd566735910851df15a8a1647116"
|
|
81
81
|
}
|