@danxbot/plugin-sdk 0.2.32 → 0.2.35
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 +2 -0
- package/dist/card-kit.d.ts +33 -2
- package/dist/publish.d.ts +6 -0
- package/dist/vite.d.ts +5 -0
- package/dist/vite.js +8 -6
- package/package.json +2 -2
package/README.md
CHANGED
|
@@ -25,6 +25,8 @@ import { danxPlugin } from "@danxbot/plugin-sdk/vite";
|
|
|
25
25
|
export default defineConfig({ plugins: [danxPlugin()] });
|
|
26
26
|
```
|
|
27
27
|
|
|
28
|
+
A plugin whose `CardView` is made for particular card types names them: `danxPlugin({ cardTypes: ["Bug"] })`. Each becomes that type's default view once the plugin's revision is approved and active (a team admin's card-view board shows it as "Default" and reverts a type to it); where two plugins name one type, the one activated first wins. The names go into `danx-plugin.json` as `cardTypes`, and the upload refuses a key that is not a card type key or a plugin that exports no `CardView`.
|
|
29
|
+
|
|
28
30
|
`tsconfig.json`: add `"types": ["@danxbot/plugin-sdk/card-kit"]`: the kit's declarations. They are self-contained (they import only `react`, `@danxbot/ui` and `react-router`) and the specifier is not a package, so TypeScript reads them as ambient types.
|
|
29
31
|
|
|
30
32
|
`src/index.tsx` exports `CardView` and/or `CardListView`:
|
package/dist/card-kit.d.ts
CHANGED
|
@@ -240,6 +240,11 @@ declare module "@danxbot/card-kit@1" {
|
|
|
240
240
|
recommended: boolean;
|
|
241
241
|
}
|
|
242
242
|
|
|
243
|
+
interface DocsProposalPromotionV2 {
|
|
244
|
+
plan_id: number;
|
|
245
|
+
attempt: number;
|
|
246
|
+
}
|
|
247
|
+
|
|
243
248
|
interface V2CopyComment {
|
|
244
249
|
author: string;
|
|
245
250
|
text: string;
|
|
@@ -307,6 +312,7 @@ declare module "@danxbot/card-kit@1" {
|
|
|
307
312
|
title: string;
|
|
308
313
|
created_by: string;
|
|
309
314
|
created_at: string;
|
|
315
|
+
archived_at: string | null;
|
|
310
316
|
revisions: V2CopyDesignRevision[];
|
|
311
317
|
decisions: V2CopyDesignDecision[];
|
|
312
318
|
}
|
|
@@ -323,6 +329,16 @@ declare module "@danxbot/card-kit@1" {
|
|
|
323
329
|
created_at: string;
|
|
324
330
|
updated_at: string;
|
|
325
331
|
}
|
|
332
|
+
interface V2CopyDocsProposal {
|
|
333
|
+
repo: string;
|
|
334
|
+
page_id: string;
|
|
335
|
+
new_page_title: string | null;
|
|
336
|
+
change: string;
|
|
337
|
+
author: string;
|
|
338
|
+
team_agent: string | null;
|
|
339
|
+
created_at: string;
|
|
340
|
+
updated_at: string;
|
|
341
|
+
}
|
|
326
342
|
interface V2CopyAc {
|
|
327
343
|
title: string;
|
|
328
344
|
checked: boolean;
|
|
@@ -430,6 +446,7 @@ declare module "@danxbot/card-kit@1" {
|
|
|
430
446
|
checklists: V2CopyChecklist[];
|
|
431
447
|
comments: V2CopyComment[];
|
|
432
448
|
agent_notes: V2CopyAgentNote[];
|
|
449
|
+
docs_proposals: V2CopyDocsProposal[];
|
|
433
450
|
dependencies: V2CopyDependency[];
|
|
434
451
|
retro: V2CopyRetro | null;
|
|
435
452
|
mirrors: V2CopyMirror[];
|
|
@@ -870,6 +887,19 @@ declare module "@danxbot/card-kit@1" {
|
|
|
870
887
|
updated_at: string;
|
|
871
888
|
text: string;
|
|
872
889
|
metadata: unknown;
|
|
890
|
+
}>);
|
|
891
|
+
docs_proposals?: undefined | (Array<{
|
|
892
|
+
id: number;
|
|
893
|
+
repo: string;
|
|
894
|
+
page_id: string;
|
|
895
|
+
new_page_title: null | string;
|
|
896
|
+
change: string;
|
|
897
|
+
author: string;
|
|
898
|
+
by: AuthorV2;
|
|
899
|
+
via_key: null | ViaKey;
|
|
900
|
+
promotion: null | DocsProposalPromotionV2;
|
|
901
|
+
created_at: string;
|
|
902
|
+
updated_at: string;
|
|
873
903
|
}>);
|
|
874
904
|
designs?: undefined | (Array<{
|
|
875
905
|
id: number;
|
|
@@ -877,6 +907,7 @@ declare module "@danxbot/card-kit@1" {
|
|
|
877
907
|
title: string;
|
|
878
908
|
created_by: string;
|
|
879
909
|
created_at: string;
|
|
910
|
+
archived_at: null | string;
|
|
880
911
|
review_state: "rejected" | "awaiting_review" | "changes_requested" | "approved";
|
|
881
912
|
revision_count: number;
|
|
882
913
|
latest_revision_no: number;
|
|
@@ -930,6 +961,7 @@ declare module "@danxbot/card-kit@1" {
|
|
|
930
961
|
id: string;
|
|
931
962
|
name: string;
|
|
932
963
|
status: "Cancelled" | "Review" | "ToDo" | "In Progress" | "Backlog" | "Done";
|
|
964
|
+
board_id: string;
|
|
933
965
|
type?: undefined | string;
|
|
934
966
|
priority?: undefined | number;
|
|
935
967
|
summary?: undefined | null | string;
|
|
@@ -1076,6 +1108,7 @@ declare module "@danxbot/card-kit@1" {
|
|
|
1076
1108
|
title: string;
|
|
1077
1109
|
created_by: string;
|
|
1078
1110
|
created_at: string;
|
|
1111
|
+
archived_at: null | string;
|
|
1079
1112
|
review_state: "rejected" | "awaiting_review" | "changes_requested" | "approved";
|
|
1080
1113
|
revision_count: number;
|
|
1081
1114
|
latest_revision_no: number;
|
|
@@ -1243,14 +1276,12 @@ declare module "@danxbot/card-kit@1" {
|
|
|
1243
1276
|
mutation: CardMutation;
|
|
1244
1277
|
}): react.JSX.Element;
|
|
1245
1278
|
|
|
1246
|
-
type CardTone = "success" | "warning" | "danger" | "info" | "neutral" | "accent" | "brand" | "muted";
|
|
1247
1279
|
interface ChildProgress {
|
|
1248
1280
|
done: number;
|
|
1249
1281
|
total: number;
|
|
1250
1282
|
}
|
|
1251
1283
|
interface CardStatusPresentation {
|
|
1252
1284
|
label: string;
|
|
1253
|
-
tone: CardTone;
|
|
1254
1285
|
icon: string;
|
|
1255
1286
|
reason: string | null;
|
|
1256
1287
|
live: boolean;
|
package/dist/publish.d.ts
CHANGED
|
@@ -27,6 +27,12 @@ interface PluginManifest {
|
|
|
27
27
|
readonly screenshot?: string;
|
|
28
28
|
/** Each shared library's major the plugin was built against (`PLUGIN_RUNTIME_LIBRARIES`), compared with what the app serves. */
|
|
29
29
|
readonly runtime: Readonly<Record<string, number>>;
|
|
30
|
+
/**
|
|
31
|
+
* DX-6178: the card types the plugin's `CardView` is made for (card type keys, e.g. `["Bug"]`); absent when it is made for none. Each is that type's DEFAULT view
|
|
32
|
+
* while the plugin's active revision is approved and exports `CardView`: the admin's card-view board shows it as the type's "Default" and reverts to it.
|
|
33
|
+
* Where two plugins declare one type, the one activated first wins (`plugins.activated_at`).
|
|
34
|
+
*/
|
|
35
|
+
readonly cardTypes?: readonly string[];
|
|
30
36
|
/** DX-5282: which view modules the entry exports (`PLUGIN_VIEW_EXPORTS`), recorded at build from the entry chunk's real exports; never empty. */
|
|
31
37
|
readonly exports: readonly PluginViewExport[];
|
|
32
38
|
readonly files: readonly PluginManifestFile[];
|
package/dist/vite.d.ts
CHANGED
|
@@ -5,6 +5,11 @@ declare const PLUGIN_ENTRY_FILE = "index.js";
|
|
|
5
5
|
interface DanxPluginOptions {
|
|
6
6
|
/** The module exporting `CardView` and/or `CardListView`, relative to the project root. */
|
|
7
7
|
readonly entry?: string;
|
|
8
|
+
/**
|
|
9
|
+
* DX-6178: the card types the plugin's `CardView` is made for (card type keys, e.g. `["Bug"]`). Each becomes that type's DEFAULT view once the plugin's revision is approved
|
|
10
|
+
* and active, and the team can always set the type back to it. Leave it out for a plugin made for no particular type.
|
|
11
|
+
*/
|
|
12
|
+
readonly cardTypes?: readonly string[];
|
|
8
13
|
}
|
|
9
14
|
/**
|
|
10
15
|
* The Vite preset for a 50 Arms card-type plugin: an ES-module library build whose output the app loads with `import()`.
|
package/dist/vite.js
CHANGED
|
@@ -49,7 +49,7 @@ function describeFile(root, file) {
|
|
|
49
49
|
sha256: createHash("sha256").update(bytes).digest("hex")
|
|
50
50
|
};
|
|
51
51
|
}
|
|
52
|
-
function buildManifest(outDir, entry, exports) {
|
|
52
|
+
function buildManifest(outDir, entry, exports, cardTypes = []) {
|
|
53
53
|
const files = filesUnder(outDir).map((file) => describeFile(outDir, file)).filter((file) => file.path !== PLUGIN_MANIFEST_FILE);
|
|
54
54
|
if (!files.some((file) => file.path === entry)) throw new Error(`danx-plugin: the build produced no entry module ${entry} in ${outDir}`);
|
|
55
55
|
return {
|
|
@@ -57,11 +57,13 @@ function buildManifest(outDir, entry, exports) {
|
|
|
57
57
|
styles: files.filter((file) => file.path.endsWith(".css")).map((file) => file.path),
|
|
58
58
|
runtime: pluginRuntimeContract().majors,
|
|
59
59
|
exports: [...exports],
|
|
60
|
+
// DX-6178: the card types the plugin's card view is made for, written only when the author named some.
|
|
61
|
+
...cardTypes.length === 0 ? {} : { cardTypes: [...cardTypes] },
|
|
60
62
|
files
|
|
61
63
|
};
|
|
62
64
|
}
|
|
63
|
-
function writeManifest(outDir, entry, exports) {
|
|
64
|
-
const manifest = buildManifest(outDir, entry, exports);
|
|
65
|
+
function writeManifest(outDir, entry, exports, cardTypes = []) {
|
|
66
|
+
const manifest = buildManifest(outDir, entry, exports, cardTypes);
|
|
65
67
|
writeFileSync(join(outDir, PLUGIN_MANIFEST_FILE), `${JSON.stringify(manifest, null, 2)}
|
|
66
68
|
`);
|
|
67
69
|
return manifest;
|
|
@@ -120,9 +122,9 @@ function danxPlugin(options = {}) {
|
|
|
120
122
|
}
|
|
121
123
|
}
|
|
122
124
|
},
|
|
123
|
-
writeBundle(
|
|
124
|
-
if (
|
|
125
|
-
writeManifest(
|
|
125
|
+
writeBundle(output) {
|
|
126
|
+
if (output.dir === void 0) throw new Error("danx-plugin: the build has no output directory to write the manifest into");
|
|
127
|
+
writeManifest(output.dir, PLUGIN_ENTRY_FILE, viewExports, options.cardTypes ?? []);
|
|
126
128
|
}
|
|
127
129
|
};
|
|
128
130
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@danxbot/plugin-sdk",
|
|
3
|
-
"version": "0.2.
|
|
3
|
+
"version": "0.2.35",
|
|
4
4
|
"description": "SDK for building 50 Arms card-type plugins (DX-5170): the card kit's type declarations, a Vite preset that builds a plugin against the app's shared runtime and writes its manifest, and the danx-plugin CLI.",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"type": "module",
|
|
@@ -46,7 +46,7 @@
|
|
|
46
46
|
"test": "vitest run"
|
|
47
47
|
},
|
|
48
48
|
"devDependencies": {
|
|
49
|
-
"@danxbot/ui": "28.
|
|
49
|
+
"@danxbot/ui": "28.4.0",
|
|
50
50
|
"@types/node": "^22.0.0",
|
|
51
51
|
"@types/react": "^19.2.2",
|
|
52
52
|
"esbuild": "^0.25.0",
|