@sparkletree/cli 0.3.0 → 0.5.0
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/README.md +8 -0
- package/dist/bin.d.ts.map +1 -1
- package/dist/bin.js +16 -0
- package/dist/bin.js.map +1 -1
- package/dist/index.d.ts +1 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +1 -0
- package/dist/index.js.map +1 -1
- package/dist/registry.d.ts.map +1 -1
- package/dist/registry.js +38 -9
- package/dist/registry.js.map +1 -1
- package/dist/upgrade.d.ts +71 -0
- package/dist/upgrade.d.ts.map +1 -0
- package/dist/upgrade.js +234 -0
- package/dist/upgrade.js.map +1 -0
- package/package.json +3 -2
package/README.md
CHANGED
|
@@ -17,10 +17,18 @@ they import like any other dependency.
|
|
|
17
17
|
|
|
18
18
|
```
|
|
19
19
|
sparkletree add <component...> [options]
|
|
20
|
+
sparkletree upgrade [options]
|
|
20
21
|
sparkletree list
|
|
21
22
|
sparkletree help
|
|
22
23
|
```
|
|
23
24
|
|
|
25
|
+
`upgrade` ports hero/cta copies made by a 0.3.0 `add` to the 0.4.0 reservation
|
|
26
|
+
wiring (the hold now reserves space with your fallback instead of rendering
|
|
27
|
+
nothing — see LAYOUT-DOCTRINE.md in the repo). It rewrites a copy only where
|
|
28
|
+
it still matches the 0.3.0 template exactly, ignoring the Tailwind classes you
|
|
29
|
+
were invited to change; a copy edited where the wiring lands is left untouched
|
|
30
|
+
and reported, never guessed at. `--dry-run` previews the verdicts.
|
|
31
|
+
|
|
24
32
|
| Option | What it does |
|
|
25
33
|
|---|---|
|
|
26
34
|
| `--dir <path>` | Where components are written. Default `components`. |
|
package/dist/bin.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"bin.d.ts","sourceRoot":"","sources":["../src/bin.ts"],"names":[],"mappings":";AACA;;;;;;GAMG;
|
|
1
|
+
{"version":3,"file":"bin.d.ts","sourceRoot":"","sources":["../src/bin.ts"],"names":[],"mappings":";AACA;;;;;;GAMG;AA+BH,UAAU,UAAU;IAClB,OAAO,EAAE,MAAM,CAAC;IAChB,KAAK,EAAE,MAAM,EAAE,CAAC;IAChB,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,KAAK,EAAE,OAAO,CAAC;IACf,MAAM,EAAE,OAAO,CAAC;IAChB,IAAI,EAAE,OAAO,CAAC;IACd,OAAO,EAAE,OAAO,CAAC;CAClB;AAeD,wBAAgB,SAAS,CAAC,IAAI,EAAE,MAAM,EAAE,GAAG,UAAU,CAuBpD;AAaD,iBAAe,IAAI,CAAC,IAAI,EAAE,MAAM,EAAE,GAAG,OAAO,CAAC,MAAM,CAAC,CAsFnD;AA6CD,OAAO,EAAE,IAAI,EAAE,CAAC"}
|
package/dist/bin.js
CHANGED
|
@@ -11,10 +11,12 @@ import { dirname, join } from "node:path";
|
|
|
11
11
|
import { fileURLToPath } from "node:url";
|
|
12
12
|
import { add, formatAddResult } from "./add.js";
|
|
13
13
|
import { REGISTRY, findComponent } from "./registry.js";
|
|
14
|
+
import { formatUpgradeResult, upgrade } from "./upgrade.js";
|
|
14
15
|
const HELP = `sparkletree — add SparkleTree components to your project
|
|
15
16
|
|
|
16
17
|
Usage
|
|
17
18
|
sparkletree add <component...> [options]
|
|
19
|
+
sparkletree upgrade [options] port 0.3.0 copies to the 0.4.0 reservation wiring
|
|
18
20
|
sparkletree list
|
|
19
21
|
sparkletree help
|
|
20
22
|
|
|
@@ -136,6 +138,20 @@ async function main(argv) {
|
|
|
136
138
|
// non-zero would break it in CI for no reason.
|
|
137
139
|
return 0;
|
|
138
140
|
}
|
|
141
|
+
case "upgrade": {
|
|
142
|
+
// No names: the codemod knows exactly which copies it can upgrade, and
|
|
143
|
+
// "upgrade hero" silently skipping an outdated cta would be worse than
|
|
144
|
+
// refusing a spelling of the command that suggests it takes arguments.
|
|
145
|
+
if (args.names.length) {
|
|
146
|
+
console.error("upgrade takes no component names — it upgrades every copied hero and cta it finds.");
|
|
147
|
+
return 1;
|
|
148
|
+
}
|
|
149
|
+
const result = await upgrade({ cwd: args.cwd, targetDir: args.dir, dryRun: args.dryRun });
|
|
150
|
+
console.log(formatUpgradeResult(result, args.dryRun));
|
|
151
|
+
// Diverged files are a report, not a failure: the command's contract is
|
|
152
|
+
// "never guess at edited code", and honouring it should not fail CI.
|
|
153
|
+
return 0;
|
|
154
|
+
}
|
|
139
155
|
case "help":
|
|
140
156
|
case "--help":
|
|
141
157
|
case "-h":
|
package/dist/bin.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"bin.js","sourceRoot":"","sources":["../src/bin.ts"],"names":[],"mappings":";AACA;;;;;;GAMG;AAEH,OAAO,EAAE,YAAY,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AACrD,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AAC1C,OAAO,EAAE,aAAa,EAAE,MAAM,UAAU,CAAC;AAEzC,OAAO,EAAE,GAAG,EAAE,eAAe,EAAE,MAAM,UAAU,CAAC;AAChD,OAAO,EAAE,QAAQ,EAAE,aAAa,EAAE,MAAM,eAAe,CAAC;
|
|
1
|
+
{"version":3,"file":"bin.js","sourceRoot":"","sources":["../src/bin.ts"],"names":[],"mappings":";AACA;;;;;;GAMG;AAEH,OAAO,EAAE,YAAY,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AACrD,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AAC1C,OAAO,EAAE,aAAa,EAAE,MAAM,UAAU,CAAC;AAEzC,OAAO,EAAE,GAAG,EAAE,eAAe,EAAE,MAAM,UAAU,CAAC;AAChD,OAAO,EAAE,QAAQ,EAAE,aAAa,EAAE,MAAM,eAAe,CAAC;AACxD,OAAO,EAAE,mBAAmB,EAAE,OAAO,EAAE,MAAM,cAAc,CAAC;AAE5D,MAAM,IAAI,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
|
|
7
7
|
export { add, formatAddResult, targetPathFor, type AddOptions, type AddResult } from "./add.js";
|
|
8
|
+
export { upgrade, formatUpgradeResult, UPGRADE_TARGETS, type UpgradeOptions, type UpgradeResult, type UpgradeTarget, } from "./upgrade.js";
|
|
8
9
|
export { REGISTRY, findComponent, resolveWithDependencies, type RegistryComponent, } from "./registry.js";
|
|
9
10
|
//# sourceMappingURL=index.d.ts.map
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,EAAE,GAAG,EAAE,eAAe,EAAE,aAAa,EAAE,KAAK,UAAU,EAAE,KAAK,SAAS,EAAE,MAAM,UAAU,CAAC;AAChG,OAAO,EACL,QAAQ,EACR,aAAa,EACb,uBAAuB,EACvB,KAAK,iBAAiB,GACvB,MAAM,eAAe,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,EAAE,GAAG,EAAE,eAAe,EAAE,aAAa,EAAE,KAAK,UAAU,EAAE,KAAK,SAAS,EAAE,MAAM,UAAU,CAAC;AAChG,OAAO,EACL,OAAO,EACP,mBAAmB,EACnB,eAAe,EACf,KAAK,cAAc,EACnB,KAAK,aAAa,EAClB,KAAK,aAAa,GACnB,MAAM,cAAc,CAAC;AACtB,OAAO,EACL,QAAQ,EACR,aAAa,EACb,uBAAuB,EACvB,KAAK,iBAAiB,GACvB,MAAM,eAAe,CAAC"}
|
package/dist/index.js
CHANGED
|
@@ -5,5 +5,6 @@
|
|
|
5
5
|
* anyone scripting a scaffold can use `add` without shelling out.
|
|
6
6
|
*/
|
|
7
7
|
export { add, formatAddResult, targetPathFor } from "./add.js";
|
|
8
|
+
export { upgrade, formatUpgradeResult, UPGRADE_TARGETS, } from "./upgrade.js";
|
|
8
9
|
export { REGISTRY, findComponent, resolveWithDependencies, } from "./registry.js";
|
|
9
10
|
//# sourceMappingURL=index.js.map
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,EAAE,GAAG,EAAE,eAAe,EAAE,aAAa,EAAmC,MAAM,UAAU,CAAC;AAChG,OAAO,EACL,QAAQ,EACR,aAAa,EACb,uBAAuB,GAExB,MAAM,eAAe,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,EAAE,GAAG,EAAE,eAAe,EAAE,aAAa,EAAmC,MAAM,UAAU,CAAC;AAChG,OAAO,EACL,OAAO,EACP,mBAAmB,EACnB,eAAe,GAIhB,MAAM,cAAc,CAAC;AACtB,OAAO,EACL,QAAQ,EACR,aAAa,EACb,uBAAuB,GAExB,MAAM,eAAe,CAAC"}
|
package/dist/registry.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"registry.d.ts","sourceRoot":"","sources":["../src/registry.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;GAqBG;AAEH,MAAM,WAAW,iBAAiB;IAChC,IAAI,EAAE,MAAM,CAAC;IACb,WAAW,EAAE,MAAM,CAAC;IACpB,uDAAuD;IACvD,KAAK,EAAE;QAAE,IAAI,EAAE,MAAM,CAAC;QAAC,OAAO,EAAE,MAAM,CAAA;KAAE,EAAE,CAAC;IAC3C,mCAAmC;IACnC,YAAY,EAAE,MAAM,EAAE,CAAC;IACvB,mDAAmD;IACnD,oBAAoB,EAAE,MAAM,EAAE,CAAC;CAChC;
|
|
1
|
+
{"version":3,"file":"registry.d.ts","sourceRoot":"","sources":["../src/registry.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;GAqBG;AAEH,MAAM,WAAW,iBAAiB;IAChC,IAAI,EAAE,MAAM,CAAC;IACb,WAAW,EAAE,MAAM,CAAC;IACpB,uDAAuD;IACvD,KAAK,EAAE;QAAE,IAAI,EAAE,MAAM,CAAC;QAAC,OAAO,EAAE,MAAM,CAAA;KAAE,EAAE,CAAC;IAC3C,mCAAmC;IACnC,YAAY,EAAE,MAAM,EAAE,CAAC;IACvB,mDAAmD;IACnD,oBAAoB,EAAE,MAAM,EAAE,CAAC;CAChC;AAmYD,eAAO,MAAM,QAAQ,EAAE,SAAS,iBAAiB,EAoChD,CAAC;AAEF,wBAAgB,aAAa,CAAC,IAAI,EAAE,MAAM,GAAG,iBAAiB,GAAG,SAAS,CAEzE;AAED;;;;;GAKG;AACH,wBAAgB,uBAAuB,CAAC,KAAK,EAAE,MAAM,EAAE,GAAG,iBAAiB,EAAE,CAe5E"}
|
package/dist/registry.js
CHANGED
|
@@ -22,7 +22,8 @@
|
|
|
22
22
|
*/
|
|
23
23
|
const HERO_TSX = `"use client";
|
|
24
24
|
|
|
25
|
-
import { StreamText, useIsland, type UseIslandOptions } from "@sparkletree/react";
|
|
25
|
+
import { StreamText, useIsland, withReserve, type UseIslandOptions } from "@sparkletree/react";
|
|
26
|
+
import type { FieldState } from "@sparkletree/react";
|
|
26
27
|
import { themeStyle } from "@sparkletree/core";
|
|
27
28
|
|
|
28
29
|
/**
|
|
@@ -74,6 +75,16 @@ export function Hero({ campaignId, fallback }: HeroProps) {
|
|
|
74
75
|
const { state, ref } = useIsland({ campaignId, island: "hero", fallback });
|
|
75
76
|
const backgroundImage = safeActionUrl(state.backgroundImage);
|
|
76
77
|
|
|
78
|
+
// The hold RESERVES (LAYOUT-DOCTRINE.md): while the canvas waits, each
|
|
79
|
+
// field carries its fallback so StreamText keeps the geometry invisibly —
|
|
80
|
+
// nothing below the hero moves whichever way the wait ends. Delete this
|
|
81
|
+
// and the section collapses during the hold; it is load-bearing.
|
|
82
|
+
const holding = state.phase === "holding";
|
|
83
|
+
const reserveOf = (name: "greeting" | "headline" | "body") =>
|
|
84
|
+
state.held?.[name] || fallback[name];
|
|
85
|
+
const held = (field: FieldState, reserve?: string) =>
|
|
86
|
+
holding && reserve && !field.text ? withReserve(field, reserve) : field;
|
|
87
|
+
|
|
77
88
|
return (
|
|
78
89
|
<section
|
|
79
90
|
ref={ref}
|
|
@@ -89,9 +100,9 @@ export function Hero({ campaignId, fallback }: HeroProps) {
|
|
|
89
100
|
) : null}
|
|
90
101
|
|
|
91
102
|
<div className="relative">
|
|
92
|
-
{state.fields.greeting.text ? (
|
|
103
|
+
{state.fields.greeting.text || (holding && reserveOf("greeting")) ? (
|
|
93
104
|
<StreamText
|
|
94
|
-
field={state.fields.greeting}
|
|
105
|
+
field={held(state.fields.greeting, reserveOf("greeting"))}
|
|
95
106
|
as="p"
|
|
96
107
|
className="text-sm uppercase tracking-wide opacity-80"
|
|
97
108
|
/>
|
|
@@ -100,13 +111,17 @@ export function Hero({ campaignId, fallback }: HeroProps) {
|
|
|
100
111
|
{/* h2 to match the packaged Hero. The heading level is yours: pass
|
|
101
112
|
as="h1" if this section is your page's primary heading. */}
|
|
102
113
|
<StreamText
|
|
103
|
-
field={state.fields.headline}
|
|
114
|
+
field={held(state.fields.headline, reserveOf("headline"))}
|
|
104
115
|
as="h2"
|
|
105
116
|
className="mt-2 text-4xl font-semibold"
|
|
106
117
|
/>
|
|
107
118
|
|
|
108
|
-
{state.fields.body.text ? (
|
|
109
|
-
<StreamText
|
|
119
|
+
{state.fields.body.text || (holding && reserveOf("body")) ? (
|
|
120
|
+
<StreamText
|
|
121
|
+
field={held(state.fields.body, reserveOf("body"))}
|
|
122
|
+
as="p"
|
|
123
|
+
className="mt-4 max-w-prose"
|
|
124
|
+
/>
|
|
110
125
|
) : null}
|
|
111
126
|
</div>
|
|
112
127
|
</section>
|
|
@@ -115,7 +130,7 @@ export function Hero({ campaignId, fallback }: HeroProps) {
|
|
|
115
130
|
`;
|
|
116
131
|
const CTA_TSX = `"use client";
|
|
117
132
|
|
|
118
|
-
import { StreamText, useIsland, useSparkletree, type UseIslandOptions } from "@sparkletree/react";
|
|
133
|
+
import { StreamText, useIsland, useSparkletree, withReserve, type UseIslandOptions } from "@sparkletree/react";
|
|
119
134
|
import { readableTextColor, themeStyle, track } from "@sparkletree/core";
|
|
120
135
|
|
|
121
136
|
/**
|
|
@@ -187,6 +202,16 @@ export function Cta(props: CtaProps) {
|
|
|
187
202
|
onClick?.();
|
|
188
203
|
};
|
|
189
204
|
|
|
205
|
+
// The hold RESERVES (LAYOUT-DOCTRINE.md): a holding label rides the
|
|
206
|
+
// fallback into StreamText invisibly, so the button keeps the size its
|
|
207
|
+
// label will need. Delete this and the button collapses during the hold.
|
|
208
|
+
const holding = state.phase === "holding";
|
|
209
|
+
const ctaReserve = state.held?.cta || islandOptions.fallback.cta;
|
|
210
|
+
const reserved = holding && !!ctaReserve && !state.fields.cta.text;
|
|
211
|
+
const labelField = reserved
|
|
212
|
+
? withReserve(state.fields.cta, ctaReserve as string)
|
|
213
|
+
: state.fields.cta;
|
|
214
|
+
|
|
190
215
|
// Shared by the link and the no-destination fallback below.
|
|
191
216
|
const shared = {
|
|
192
217
|
onClick: handleClick,
|
|
@@ -203,7 +228,11 @@ export function Cta(props: CtaProps) {
|
|
|
203
228
|
// A CTA whose label is still empty is not yet a button a viewer can
|
|
204
229
|
// meaningfully act on — but it must still occupy its space, or the
|
|
205
230
|
// layout shifts when the copy lands.
|
|
231
|
+
// A reserved button is full-size but its visible label is a hidden
|
|
232
|
+
// reservation outside the a11y tree — never a NAMELESS control: the
|
|
233
|
+
// reservation text is the honest accessible name.
|
|
206
234
|
"aria-disabled": state.fields.cta.text ? undefined : true,
|
|
235
|
+
"aria-label": reserved ? (ctaReserve as string) : undefined,
|
|
207
236
|
};
|
|
208
237
|
|
|
209
238
|
// Neither the stream nor you resolved a destination: render a
|
|
@@ -214,14 +243,14 @@ export function Cta(props: CtaProps) {
|
|
|
214
243
|
if (action === undefined) {
|
|
215
244
|
return (
|
|
216
245
|
<span ref={ref as unknown as (element: HTMLSpanElement | null) => void} {...shared}>
|
|
217
|
-
<StreamText field={
|
|
246
|
+
<StreamText field={labelField} />
|
|
218
247
|
</span>
|
|
219
248
|
);
|
|
220
249
|
}
|
|
221
250
|
|
|
222
251
|
return (
|
|
223
252
|
<a ref={ref} href={action} {...shared}>
|
|
224
|
-
<StreamText field={
|
|
253
|
+
<StreamText field={labelField} />
|
|
225
254
|
</a>
|
|
226
255
|
);
|
|
227
256
|
}
|
package/dist/registry.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"registry.js","sourceRoot":"","sources":["../src/registry.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;GAqBG;AAaH,MAAM,QAAQ,GAAG
|
|
1
|
+
{"version":3,"file":"registry.js","sourceRoot":"","sources":["../src/registry.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;GAqBG;AAaH,MAAM,QAAQ,GAAG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA2GhB,CAAC;AAEF,MAAM,OAAO,GAAG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA8Hf,CAAC;AAEF,MAAM,aAAa,GAAG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAqCrB,CAAC;AAEF,MAAM,gBAAgB,GAAG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAkDxB,CAAC;AAEF,MAAM,YAAY,GAAG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;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EF,MAAM,UAAU,aAAa,CAAC,IAAY;IACxC,OAAO,QAAQ,CAAC,IAAI,CAAC,CAAC,SAAS,EAAE,EAAE,CAAC,SAAS,CAAC,IAAI,KAAK,IAAI,CAAC,CAAC;AAC/D,CAAC;AAED;;;;;GAKG;AACH,MAAM,UAAU,uBAAuB,CAAC,KAAe;IACrD,MAAM,QAAQ,GAAwB,EAAE,CAAC;IACzC,MAAM,IAAI,GAAG,IAAI,GAAG,EAAU,CAAC;IAE/B,MAAM,KAAK,GAAG,CAAC,IAAY,EAAE,EAAE;QAC7B,IAAI,IAAI,CAAC,GAAG,CAAC,IAAI,CAAC;YAAE,OAAO;QAC3B,IAAI,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC;QACf,MAAM,SAAS,GAAG,aAAa,CAAC,IAAI,CAAC,CAAC;QACtC,IAAI,CAAC,SAAS;YAAE,MAAM,IAAI,KAAK,CAAC,sBAAsB,IAAI,GAAG,CAAC,CAAC;QAC/D,KAAK,MAAM,UAAU,IAAI,SAAS,CAAC,oBAAoB;YAAE,KAAK,CAAC,UAAU,CAAC,CAAC;QAC3E,QAAQ,CAAC,IAAI,CAAC,SAAS,CAAC,CAAC;IAC3B,CAAC,CAAC;IAEF,KAAK,MAAM,IAAI,IAAI,KAAK;QAAE,KAAK,CAAC,IAAI,CAAC,CAAC;IACtC,OAAO,QAAQ,CAAC;AAClB,CAAC"}
|
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* `sparkletree upgrade`
|
|
3
|
+
*
|
|
4
|
+
* The 0.3.0 → 0.4.0 codemod for copied components. Copies are the customer's
|
|
5
|
+
* files (see registry.ts), so the SDK cannot patch them at runtime — but 0.4.0
|
|
6
|
+
* moved the hold from blanking to RESERVING (LAYOUT-DOCTRINE.md), and a copy
|
|
7
|
+
* without the reservation wiring still collapses during the hold. This command
|
|
8
|
+
* ports that wiring into copies that came from `add` at 0.3.0.
|
|
9
|
+
*
|
|
10
|
+
* How it stays safe in someone else's repository:
|
|
11
|
+
*
|
|
12
|
+
* - exact-substring hunks, all-or-nothing per file. Every hunk must match
|
|
13
|
+
* exactly once (or, where marked, at least once) before anything is
|
|
14
|
+
* written. One miss means the file has diverged from the template at a
|
|
15
|
+
* line the upgrade needs, and guessing at edited code is how a tool
|
|
16
|
+
* "reverts three months of my hero" — so we write nothing and say which
|
|
17
|
+
* hunks failed, so the wiring can be ported by hand;
|
|
18
|
+
* - hunks avoid the Tailwind classNames, which `add` explicitly invites
|
|
19
|
+
* customers to change. A restyled copy still upgrades;
|
|
20
|
+
* - idempotent: a file that already has the wiring (it imports
|
|
21
|
+
* `withReserve`) is reported up to date and never touched;
|
|
22
|
+
* - `--dry-run` reports the same verdicts and writes nothing.
|
|
23
|
+
*/
|
|
24
|
+
interface Hunk {
|
|
25
|
+
/** For the skipped-report: which part of the wiring this is. */
|
|
26
|
+
label: string;
|
|
27
|
+
/** Exact text as `add` wrote it at 0.3.0. */
|
|
28
|
+
find: string;
|
|
29
|
+
replace: string;
|
|
30
|
+
/** Replace every occurrence instead of requiring exactly one. */
|
|
31
|
+
all?: boolean;
|
|
32
|
+
}
|
|
33
|
+
export interface UpgradeTarget {
|
|
34
|
+
component: string;
|
|
35
|
+
/** Where `add` writes it, relative to the target directory. */
|
|
36
|
+
path: string;
|
|
37
|
+
/** Already-upgraded detection: 0.3.0 copies never mention withReserve. */
|
|
38
|
+
marker: string;
|
|
39
|
+
hunks: Hunk[];
|
|
40
|
+
}
|
|
41
|
+
export declare const UPGRADE_TARGETS: readonly UpgradeTarget[];
|
|
42
|
+
export interface UpgradeOptions {
|
|
43
|
+
cwd?: string;
|
|
44
|
+
/** Same meaning as `add --dir`: where the copies live. */
|
|
45
|
+
targetDir?: string;
|
|
46
|
+
dryRun?: boolean;
|
|
47
|
+
}
|
|
48
|
+
export interface UpgradeResult {
|
|
49
|
+
upgraded: string[];
|
|
50
|
+
upToDate: string[];
|
|
51
|
+
/** No file at the path — the component was never added. Not a failure. */
|
|
52
|
+
missing: string[];
|
|
53
|
+
/** File exists but a hunk did not match exactly; nothing was written. */
|
|
54
|
+
diverged: {
|
|
55
|
+
path: string;
|
|
56
|
+
hunks: string[];
|
|
57
|
+
}[];
|
|
58
|
+
/**
|
|
59
|
+
* The installed @sparkletree/react version, when it predates the wiring.
|
|
60
|
+
* The upgraded source reads `state.held`, which does not exist before
|
|
61
|
+
* 0.4.0 — writing it against an old install trades a layout gap for a
|
|
62
|
+
* compile error. When set, the run behaved as a dry run: `upgraded` lists
|
|
63
|
+
* what WOULD be written once the packages are updated.
|
|
64
|
+
*/
|
|
65
|
+
blockedByReact: string | null;
|
|
66
|
+
}
|
|
67
|
+
export declare function upgrade(options?: UpgradeOptions): Promise<UpgradeResult>;
|
|
68
|
+
/** Human-readable summary. Mirrors what `upgrade` actually did. */
|
|
69
|
+
export declare function formatUpgradeResult(result: UpgradeResult, dryRun?: boolean): string;
|
|
70
|
+
export {};
|
|
71
|
+
//# sourceMappingURL=upgrade.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"upgrade.d.ts","sourceRoot":"","sources":["../src/upgrade.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;GAsBG;AAKH,UAAU,IAAI;IACZ,gEAAgE;IAChE,KAAK,EAAE,MAAM,CAAC;IACd,6CAA6C;IAC7C,IAAI,EAAE,MAAM,CAAC;IACb,OAAO,EAAE,MAAM,CAAC;IAChB,iEAAiE;IACjE,GAAG,CAAC,EAAE,OAAO,CAAC;CACf;AAED,MAAM,WAAW,aAAa;IAC5B,SAAS,EAAE,MAAM,CAAC;IAClB,+DAA+D;IAC/D,IAAI,EAAE,MAAM,CAAC;IACb,0EAA0E;IAC1E,MAAM,EAAE,MAAM,CAAC;IACf,KAAK,EAAE,IAAI,EAAE,CAAC;CACf;AAsBD,eAAO,MAAM,eAAe,EAAE,SAAS,aAAa,EAkFnD,CAAC;AAEF,MAAM,WAAW,cAAc;IAC7B,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,0DAA0D;IAC1D,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,MAAM,CAAC,EAAE,OAAO,CAAC;CAClB;AAED,MAAM,WAAW,aAAa;IAC5B,QAAQ,EAAE,MAAM,EAAE,CAAC;IACnB,QAAQ,EAAE,MAAM,EAAE,CAAC;IACnB,0EAA0E;IAC1E,OAAO,EAAE,MAAM,EAAE,CAAC;IAClB,yEAAyE;IACzE,QAAQ,EAAE;QAAE,IAAI,EAAE,MAAM,CAAC;QAAC,KAAK,EAAE,MAAM,EAAE,CAAA;KAAE,EAAE,CAAC;IAC9C;;;;;;OAMG;IACH,cAAc,EAAE,MAAM,GAAG,IAAI,CAAC;CAC/B;AAmCD,wBAAsB,OAAO,CAAC,OAAO,GAAE,cAAmB,GAAG,OAAO,CAAC,aAAa,CAAC,CAoDlF;AAED,mEAAmE;AACnE,wBAAgB,mBAAmB,CAAC,MAAM,EAAE,aAAa,EAAE,MAAM,UAAQ,GAAG,MAAM,CA4CjF"}
|
package/dist/upgrade.js
ADDED
|
@@ -0,0 +1,234 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* `sparkletree upgrade`
|
|
3
|
+
*
|
|
4
|
+
* The 0.3.0 → 0.4.0 codemod for copied components. Copies are the customer's
|
|
5
|
+
* files (see registry.ts), so the SDK cannot patch them at runtime — but 0.4.0
|
|
6
|
+
* moved the hold from blanking to RESERVING (LAYOUT-DOCTRINE.md), and a copy
|
|
7
|
+
* without the reservation wiring still collapses during the hold. This command
|
|
8
|
+
* ports that wiring into copies that came from `add` at 0.3.0.
|
|
9
|
+
*
|
|
10
|
+
* How it stays safe in someone else's repository:
|
|
11
|
+
*
|
|
12
|
+
* - exact-substring hunks, all-or-nothing per file. Every hunk must match
|
|
13
|
+
* exactly once (or, where marked, at least once) before anything is
|
|
14
|
+
* written. One miss means the file has diverged from the template at a
|
|
15
|
+
* line the upgrade needs, and guessing at edited code is how a tool
|
|
16
|
+
* "reverts three months of my hero" — so we write nothing and say which
|
|
17
|
+
* hunks failed, so the wiring can be ported by hand;
|
|
18
|
+
* - hunks avoid the Tailwind classNames, which `add` explicitly invites
|
|
19
|
+
* customers to change. A restyled copy still upgrades;
|
|
20
|
+
* - idempotent: a file that already has the wiring (it imports
|
|
21
|
+
* `withReserve`) is reported up to date and never touched;
|
|
22
|
+
* - `--dry-run` reports the same verdicts and writes nothing.
|
|
23
|
+
*/
|
|
24
|
+
import { readFile, writeFile } from "node:fs/promises";
|
|
25
|
+
import { dirname, join, relative, resolve } from "node:path";
|
|
26
|
+
const HERO_RESERVATION = ` // The hold RESERVES (LAYOUT-DOCTRINE.md): while the canvas waits, each
|
|
27
|
+
// field carries its fallback so StreamText keeps the geometry invisibly —
|
|
28
|
+
// nothing below the hero moves whichever way the wait ends. Delete this
|
|
29
|
+
// and the section collapses during the hold; it is load-bearing.
|
|
30
|
+
const holding = state.phase === "holding";
|
|
31
|
+
const reserveOf = (name: "greeting" | "headline" | "body") =>
|
|
32
|
+
state.held?.[name] || fallback[name];
|
|
33
|
+
const held = (field: FieldState, reserve?: string) =>
|
|
34
|
+
holding && reserve && !field.text ? withReserve(field, reserve) : field;`;
|
|
35
|
+
const CTA_RESERVATION = ` // The hold RESERVES (LAYOUT-DOCTRINE.md): a holding label rides the
|
|
36
|
+
// fallback into StreamText invisibly, so the button keeps the size its
|
|
37
|
+
// label will need. Delete this and the button collapses during the hold.
|
|
38
|
+
const holding = state.phase === "holding";
|
|
39
|
+
const ctaReserve = state.held?.cta || islandOptions.fallback.cta;
|
|
40
|
+
const reserved = holding && !!ctaReserve && !state.fields.cta.text;
|
|
41
|
+
const labelField = reserved
|
|
42
|
+
? withReserve(state.fields.cta, ctaReserve as string)
|
|
43
|
+
: state.fields.cta;`;
|
|
44
|
+
export const UPGRADE_TARGETS = [
|
|
45
|
+
{
|
|
46
|
+
component: "hero",
|
|
47
|
+
path: "sparkletree/hero.tsx",
|
|
48
|
+
marker: "withReserve",
|
|
49
|
+
hunks: [
|
|
50
|
+
{
|
|
51
|
+
label: "imports",
|
|
52
|
+
find: `import { StreamText, useIsland, type UseIslandOptions } from "@sparkletree/react";`,
|
|
53
|
+
replace: `import { StreamText, useIsland, withReserve, type UseIslandOptions } from "@sparkletree/react";
|
|
54
|
+
import type { FieldState } from "@sparkletree/react";`,
|
|
55
|
+
},
|
|
56
|
+
{
|
|
57
|
+
label: "reservation helpers",
|
|
58
|
+
find: `const backgroundImage = safeActionUrl(state.backgroundImage);`,
|
|
59
|
+
replace: `const backgroundImage = safeActionUrl(state.backgroundImage);
|
|
60
|
+
|
|
61
|
+
${HERO_RESERVATION}`,
|
|
62
|
+
},
|
|
63
|
+
{
|
|
64
|
+
label: "greeting condition",
|
|
65
|
+
find: `{state.fields.greeting.text ? (`,
|
|
66
|
+
replace: `{state.fields.greeting.text || (holding && reserveOf("greeting")) ? (`,
|
|
67
|
+
},
|
|
68
|
+
{
|
|
69
|
+
label: "greeting field",
|
|
70
|
+
find: `field={state.fields.greeting}`,
|
|
71
|
+
replace: `field={held(state.fields.greeting, reserveOf("greeting"))}`,
|
|
72
|
+
},
|
|
73
|
+
{
|
|
74
|
+
label: "headline field",
|
|
75
|
+
find: `field={state.fields.headline}`,
|
|
76
|
+
replace: `field={held(state.fields.headline, reserveOf("headline"))}`,
|
|
77
|
+
},
|
|
78
|
+
{
|
|
79
|
+
label: "body condition",
|
|
80
|
+
find: `{state.fields.body.text ? (`,
|
|
81
|
+
replace: `{state.fields.body.text || (holding && reserveOf("body")) ? (`,
|
|
82
|
+
},
|
|
83
|
+
{
|
|
84
|
+
label: "body field",
|
|
85
|
+
find: `field={state.fields.body}`,
|
|
86
|
+
replace: `field={held(state.fields.body, reserveOf("body"))}`,
|
|
87
|
+
},
|
|
88
|
+
],
|
|
89
|
+
},
|
|
90
|
+
{
|
|
91
|
+
component: "cta",
|
|
92
|
+
path: "sparkletree/cta.tsx",
|
|
93
|
+
marker: "withReserve",
|
|
94
|
+
hunks: [
|
|
95
|
+
{
|
|
96
|
+
label: "imports",
|
|
97
|
+
find: `import { StreamText, useIsland, useSparkletree, type UseIslandOptions } from "@sparkletree/react";`,
|
|
98
|
+
replace: `import { StreamText, useIsland, useSparkletree, withReserve, type UseIslandOptions } from "@sparkletree/react";`,
|
|
99
|
+
},
|
|
100
|
+
{
|
|
101
|
+
label: "reservation helpers",
|
|
102
|
+
find: ` onClick?.();
|
|
103
|
+
};`,
|
|
104
|
+
replace: ` onClick?.();
|
|
105
|
+
};
|
|
106
|
+
|
|
107
|
+
${CTA_RESERVATION}`,
|
|
108
|
+
},
|
|
109
|
+
{
|
|
110
|
+
label: "accessible name",
|
|
111
|
+
find: ` "aria-disabled": state.fields.cta.text ? undefined : true,`,
|
|
112
|
+
replace: ` // A reserved button is full-size but its visible label is a hidden
|
|
113
|
+
// reservation outside the a11y tree — never a NAMELESS control: the
|
|
114
|
+
// reservation text is the honest accessible name.
|
|
115
|
+
"aria-disabled": state.fields.cta.text ? undefined : true,
|
|
116
|
+
"aria-label": reserved ? (ctaReserve as string) : undefined,`,
|
|
117
|
+
},
|
|
118
|
+
{
|
|
119
|
+
label: "label field",
|
|
120
|
+
find: `<StreamText field={state.fields.cta} />`,
|
|
121
|
+
replace: `<StreamText field={labelField} />`,
|
|
122
|
+
all: true,
|
|
123
|
+
},
|
|
124
|
+
],
|
|
125
|
+
},
|
|
126
|
+
];
|
|
127
|
+
function occurrences(haystack, needle) {
|
|
128
|
+
return haystack.split(needle).length - 1;
|
|
129
|
+
}
|
|
130
|
+
/** The @sparkletree/react actually installed for `cwd`, resolved the way
|
|
131
|
+
* Node would: nearest node_modules, walking up. Null when not found — a
|
|
132
|
+
* hoisted monorepo we cannot see into is not a reason to refuse. */
|
|
133
|
+
async function installedReactVersion(cwd) {
|
|
134
|
+
let dir = resolve(cwd);
|
|
135
|
+
for (;;) {
|
|
136
|
+
try {
|
|
137
|
+
const raw = await readFile(join(dir, "node_modules", "@sparkletree", "react", "package.json"), "utf8");
|
|
138
|
+
const version = JSON.parse(raw).version;
|
|
139
|
+
return typeof version === "string" ? version : null;
|
|
140
|
+
}
|
|
141
|
+
catch {
|
|
142
|
+
// No install at this level; keep walking up.
|
|
143
|
+
}
|
|
144
|
+
const parent = dirname(dir);
|
|
145
|
+
if (parent === dir)
|
|
146
|
+
return null;
|
|
147
|
+
dir = parent;
|
|
148
|
+
}
|
|
149
|
+
}
|
|
150
|
+
function supportsReservation(version) {
|
|
151
|
+
const [major = 0, minor = 0] = version.split(".").map(Number);
|
|
152
|
+
// Unparseable versions are not evidence of an old install.
|
|
153
|
+
if (!Number.isFinite(major) || !Number.isFinite(minor))
|
|
154
|
+
return true;
|
|
155
|
+
return major > 0 || minor >= 4;
|
|
156
|
+
}
|
|
157
|
+
export async function upgrade(options = {}) {
|
|
158
|
+
const cwd = options.cwd ?? process.cwd();
|
|
159
|
+
const targetDir = options.targetDir ?? "components";
|
|
160
|
+
const reactVersion = await installedReactVersion(cwd);
|
|
161
|
+
const blockedByReact = reactVersion !== null && !supportsReservation(reactVersion) ? reactVersion : null;
|
|
162
|
+
const result = {
|
|
163
|
+
upgraded: [],
|
|
164
|
+
upToDate: [],
|
|
165
|
+
missing: [],
|
|
166
|
+
diverged: [],
|
|
167
|
+
blockedByReact,
|
|
168
|
+
};
|
|
169
|
+
for (const target of UPGRADE_TARGETS) {
|
|
170
|
+
const absolute = resolve(cwd, targetDir, target.path);
|
|
171
|
+
const path = relative(cwd, absolute);
|
|
172
|
+
let content;
|
|
173
|
+
try {
|
|
174
|
+
content = await readFile(absolute, "utf8");
|
|
175
|
+
}
|
|
176
|
+
catch {
|
|
177
|
+
result.missing.push(path);
|
|
178
|
+
continue;
|
|
179
|
+
}
|
|
180
|
+
if (content.includes(target.marker)) {
|
|
181
|
+
result.upToDate.push(path);
|
|
182
|
+
continue;
|
|
183
|
+
}
|
|
184
|
+
const failed = target.hunks
|
|
185
|
+
.filter((hunk) => {
|
|
186
|
+
const count = occurrences(content, hunk.find);
|
|
187
|
+
return hunk.all ? count === 0 : count !== 1;
|
|
188
|
+
})
|
|
189
|
+
.map((hunk) => hunk.label);
|
|
190
|
+
if (failed.length) {
|
|
191
|
+
result.diverged.push({ path, hunks: failed });
|
|
192
|
+
continue;
|
|
193
|
+
}
|
|
194
|
+
let next = content;
|
|
195
|
+
for (const hunk of target.hunks) {
|
|
196
|
+
next = hunk.all ? next.replaceAll(hunk.find, hunk.replace) : next.replace(hunk.find, hunk.replace);
|
|
197
|
+
}
|
|
198
|
+
if (!options.dryRun && !blockedByReact)
|
|
199
|
+
await writeFile(absolute, next, "utf8");
|
|
200
|
+
result.upgraded.push(path);
|
|
201
|
+
}
|
|
202
|
+
return result;
|
|
203
|
+
}
|
|
204
|
+
/** Human-readable summary. Mirrors what `upgrade` actually did. */
|
|
205
|
+
export function formatUpgradeResult(result, dryRun = false) {
|
|
206
|
+
const lines = [];
|
|
207
|
+
const verb = dryRun || result.blockedByReact ? "Would upgrade" : "Upgraded";
|
|
208
|
+
if (result.blockedByReact) {
|
|
209
|
+
lines.push(`Nothing written: @sparkletree/react ${result.blockedByReact} is installed,`, "and the reservation wiring needs ^0.4.0 (`state.held` does not exist", "before it). Update @sparkletree/react and @sparkletree/core, then", "re-run `sparkletree upgrade`.", "");
|
|
210
|
+
}
|
|
211
|
+
if (result.upgraded.length) {
|
|
212
|
+
lines.push(`${verb} to the 0.4.0 reservation wiring:`);
|
|
213
|
+
for (const path of result.upgraded)
|
|
214
|
+
lines.push(` ${path}`);
|
|
215
|
+
}
|
|
216
|
+
if (result.upToDate.length) {
|
|
217
|
+
lines.push("", "Already up to date:");
|
|
218
|
+
for (const path of result.upToDate)
|
|
219
|
+
lines.push(` ${path}`);
|
|
220
|
+
}
|
|
221
|
+
if (result.diverged.length) {
|
|
222
|
+
lines.push("", "Left alone — edited where the upgrade needs to land:");
|
|
223
|
+
for (const item of result.diverged) {
|
|
224
|
+
lines.push(` ${item.path} — did not match at: ${item.hunks.join(", ")}`);
|
|
225
|
+
}
|
|
226
|
+
lines.push("", "Nothing was written to those files. Port the reservation wiring by", "hand (the current templates show it: `sparkletree add <name> --dir", "/tmp/fresh` writes a reference copy), or re-copy with `add --force`", "if you are happy to lose your edits.");
|
|
227
|
+
}
|
|
228
|
+
if (!lines.length) {
|
|
229
|
+
lines.push("Nothing to upgrade — no copied hero or cta found.");
|
|
230
|
+
}
|
|
231
|
+
lines.push("", "Why: 0.4.0 holds by RESERVING space with the fallback instead of", "rendering nothing. Without this wiring a copied hero or cta collapses", "during the hold and the page shifts when copy arrives.");
|
|
232
|
+
return lines.join("\n");
|
|
233
|
+
}
|
|
234
|
+
//# sourceMappingURL=upgrade.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"upgrade.js","sourceRoot":"","sources":["../src/upgrade.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;GAsBG;AAEH,OAAO,EAAE,QAAQ,EAAE,SAAS,EAAE,MAAM,kBAAkB,CAAC;AACvD,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,QAAQ,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAqB7D,MAAM,gBAAgB,GAAG;;;;;;;;6EAQoD,CAAC;AAE9E,MAAM,eAAe,GAAG;;;;;;;;wBAQA,CAAC;AAEzB,MAAM,CAAC,MAAM,eAAe,GAA6B;IACvD;QACE,SAAS,EAAE,MAAM;QACjB,IAAI,EAAE,sBAAsB;QAC5B,MAAM,EAAE,aAAa;QACrB,KAAK,EAAE;YACL;gBACE,KAAK,EAAE,SAAS;gBAChB,IAAI,EAAE,oFAAoF;gBAC1F,OAAO,EAAE;sDACqC;aAC/C;YACD;gBACE,KAAK,EAAE,qBAAqB;gBAC5B,IAAI,EAAE,+DAA+D;gBACrE,OAAO,EAAE;;EAEf,gBAAgB,EAAE;aACb;YACD;gBACE,KAAK,EAAE,oBAAoB;gBAC3B,IAAI,EAAE,iCAAiC;gBACvC,OAAO,EAAE,uEAAuE;aACjF;YACD;gBACE,KAAK,EAA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,CAAC,CAAC;IAC9D,CAAC;IACD,IAAI,MAAM,CAAC,QAAQ,CAAC,MAAM,EAAE,CAAC;QAC3B,KAAK,CAAC,IAAI,CAAC,EAAE,EAAE,qBAAqB,CAAC,CAAC;QACtC,KAAK,MAAM,IAAI,IAAI,MAAM,CAAC,QAAQ;YAAE,KAAK,CAAC,IAAI,CAAC,KAAK,IAAI,EAAE,CAAC,CAAC;IAC9D,CAAC;IACD,IAAI,MAAM,CAAC,QAAQ,CAAC,MAAM,EAAE,CAAC;QAC3B,KAAK,CAAC,IAAI,CAAC,EAAE,EAAE,sDAAsD,CAAC,CAAC;QACvE,KAAK,MAAM,IAAI,IAAI,MAAM,CAAC,QAAQ,EAAE,CAAC;YACnC,KAAK,CAAC,IAAI,CAAC,KAAK,IAAI,CAAC,IAAI,wBAAwB,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;QAC5E,CAAC;QACD,KAAK,CAAC,IAAI,CACR,EAAE,EACF,oEAAoE,EACpE,oEAAoE,EACpE,qEAAqE,EACrE,sCAAsC,CACvC,CAAC;IACJ,CAAC;IACD,IAAI,CAAC,KAAK,CAAC,MAAM,EAAE,CAAC;QAClB,KAAK,CAAC,IAAI,CAAC,mDAAmD,CAAC,CAAC;IAClE,CAAC;IACD,KAAK,CAAC,IAAI,CACR,EAAE,EACF,kEAAkE,EAClE,uEAAuE,EACvE,wDAAwD,CACzD,CAAC;IACF,OAAO,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;AAC1B,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@sparkletree/cli",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.5.0",
|
|
4
4
|
"description": "sparkletree — add SparkleTree components to your project.",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"type": "module",
|
|
@@ -26,7 +26,8 @@
|
|
|
26
26
|
"vitest": "^3.2.4"
|
|
27
27
|
},
|
|
28
28
|
"publishConfig": {
|
|
29
|
-
"access": "public"
|
|
29
|
+
"access": "public",
|
|
30
|
+
"provenance": true
|
|
30
31
|
},
|
|
31
32
|
"repository": {
|
|
32
33
|
"type": "git",
|