dsh-featherhunter-plugin-base 0.0.1 → 0.0.2-drill
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/data/img/card-wechat-2026-11-06.png +0 -0
- package/data/img/qr-wechat-2026-11-06.png +0 -0
- package/data/manifest.json +6 -6
- package/dist/client/content.d.ts +116 -0
- package/dist/client/index.d.ts +2 -0
- package/dist/client/index.js +507 -16
- package/dist/client/modal.d.ts +14 -0
- package/dist/client/types.d.ts +5 -0
- package/dist/core/index.js +6 -6
- package/dist/node/cli.js +737 -7
- package/dist/node/index.d.ts +3 -26
- package/dist/node/index.js +382 -21
- package/dist/node/readme-sync.d.ts +143 -0
- package/dist/node/renderers.d.ts +48 -0
- package/dist/node/types.d.ts +20 -1
- package/package.json +4 -1
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
import type { Group, Manifest } from "../core/types";
|
|
2
|
+
import type { BlockRenderOptions } from "./types";
|
|
3
|
+
/** jsDelivr base of the published data package (exact-version images). */
|
|
4
|
+
export declare const DEFAULT_CDN_BASE = "https://cdn.jsdelivr.net/npm/dsh-featherhunter-plugin-base";
|
|
5
|
+
/** Whole-card image width used by the README contact table (spec rule 9). */
|
|
6
|
+
export declare const CONTACT_CARD_WIDTH = 260;
|
|
7
|
+
/** Fixed wording of the contact block, independent of the group data. */
|
|
8
|
+
export declare const CONTACT_TEXT: {
|
|
9
|
+
readonly sub: "CONNECT";
|
|
10
|
+
readonly heading: {
|
|
11
|
+
readonly zh: "反馈与联系";
|
|
12
|
+
readonly en: "Feedback and Contact";
|
|
13
|
+
};
|
|
14
|
+
readonly welcome: {
|
|
15
|
+
readonly zh: "👏欢迎提交PR、ISSUE。星星之火可以燎原🔥有任何建议、意见、想法、吐槽、idea都可以进群交流。";
|
|
16
|
+
readonly en: "👏Welcome PRs and issues. A single spark can start a prairie fire 🔥. Any suggestion, opinion, idea or rant — come join the group and talk.";
|
|
17
|
+
};
|
|
18
|
+
};
|
|
19
|
+
/**
|
|
20
|
+
* Cache-busting date for a limited-time card (`YYYYMMDD`), or null for a
|
|
21
|
+
* permanent card.
|
|
22
|
+
*
|
|
23
|
+
* A card counts as limited-time when the manifest marks it with `validUntil`
|
|
24
|
+
* or the published file name carries a `YYYY-MM-DD` date. The date in the
|
|
25
|
+
* file name wins; otherwise the manifest `updatedAt` date is used, because
|
|
26
|
+
* GitHub's camo proxy caches images by URL and a new QR code must get a new
|
|
27
|
+
* URL.
|
|
28
|
+
*/
|
|
29
|
+
export declare function contactCardCacheDate(group: Group, manifest: Manifest): string | null;
|
|
30
|
+
/**
|
|
31
|
+
* Absolute pristine CDN URL of one published card image.
|
|
32
|
+
*
|
|
33
|
+
* Shape: `<cdnBase>@<manifest.version>/data/img/<card>[?v=YYYYMMDD]`. The
|
|
34
|
+
* base must be an absolute https URL — README images are never relative or
|
|
35
|
+
* copied into the plugin repositories.
|
|
36
|
+
*/
|
|
37
|
+
export declare function contactCardUrl(group: Group, manifest: Manifest, options?: BlockRenderOptions): string;
|
|
38
|
+
/**
|
|
39
|
+
* Render the README contact block content (no markers).
|
|
40
|
+
*
|
|
41
|
+
* Keeps the pre-migration structure: heading, centered wrapper, welcome line,
|
|
42
|
+
* one header row and one row of {@link CONTACT_CARD_WIDTH}-wide whole cards.
|
|
43
|
+
* Modal-only fields (`title`, `subtitle`, `note`, `qr`) never appear here.
|
|
44
|
+
*
|
|
45
|
+
* @param options data + language + image base; `variant` selects the standard
|
|
46
|
+
* CONNECT h2 (default) or ilife's Markdown `##` heading.
|
|
47
|
+
*/
|
|
48
|
+
export declare function renderContactBlock(options?: BlockRenderOptions): string;
|
package/dist/node/types.d.ts
CHANGED
|
@@ -1,4 +1,9 @@
|
|
|
1
1
|
import type { Lang, Manifest } from "../core/types";
|
|
2
|
+
/**
|
|
3
|
+
* Heading form of a rendered block. Most repositories use an HTML <h2>
|
|
4
|
+
* heading; ilife (and the prompt MORE block) use a Markdown `##` heading.
|
|
5
|
+
*/
|
|
6
|
+
export type HeadingVariant = "html-heading" | "markdown-heading";
|
|
2
7
|
/** Shared options for the README block renderers. */
|
|
3
8
|
export interface BlockRenderOptions {
|
|
4
9
|
/** Manifest to render from; defaults to the packaged baseline manifest. */
|
|
@@ -9,6 +14,8 @@ export interface BlockRenderOptions {
|
|
|
9
14
|
lang?: Lang;
|
|
10
15
|
/** CDN base URL override (tests / mirrors). */
|
|
11
16
|
cdnBase?: string;
|
|
17
|
+
/** Heading form override; renderers default to their repository convention. */
|
|
18
|
+
variant?: HeadingVariant;
|
|
12
19
|
}
|
|
13
20
|
/** Marker names of the four managed README blocks. */
|
|
14
21
|
export type BlockName = "contact" | "star-history" | "thanks" | "more";
|
|
@@ -20,11 +27,23 @@ export interface VerifyResult {
|
|
|
20
27
|
export interface ReadmeSyncOptions {
|
|
21
28
|
/** Repository roots to update. */
|
|
22
29
|
roots: string[];
|
|
30
|
+
/** `init` may insert missing marker pairs; `sync` only rewrites marked text. */
|
|
31
|
+
command?: "init" | "sync";
|
|
23
32
|
/** Report drift without writing. */
|
|
24
33
|
check?: boolean;
|
|
25
|
-
/**
|
|
34
|
+
/** Process every target root and keep going after per-file errors. */
|
|
26
35
|
all?: boolean;
|
|
27
36
|
dryRun?: boolean;
|
|
37
|
+
/** Manifest to render from; defaults to the packaged baseline manifest. */
|
|
38
|
+
manifest?: Manifest;
|
|
39
|
+
/** Published package version, used for precise CDN URLs. */
|
|
40
|
+
version?: string;
|
|
41
|
+
/** CDN base URL override (tests / mirrors). */
|
|
42
|
+
cdnBase?: string;
|
|
43
|
+
/** Target language override; detected from the README when omitted. */
|
|
44
|
+
lang?: Lang;
|
|
45
|
+
/** Heading form override; detected from the README when omitted. */
|
|
46
|
+
variant?: HeadingVariant;
|
|
28
47
|
}
|
|
29
48
|
export interface DoctorCheck {
|
|
30
49
|
name: string;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "dsh-featherhunter-plugin-base",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.2-drill",
|
|
4
4
|
"description": "FeatherHunter DSH plugin shared base: settings-panel contact modal / author plugins card widgets and README block renderers",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"dsh",
|
|
@@ -51,6 +51,9 @@
|
|
|
51
51
|
"build:data": "node scripts/run-ts.mjs build-data",
|
|
52
52
|
"data:check": "node scripts/run-ts.mjs build-data --check",
|
|
53
53
|
"contact:update": "node scripts/run-ts.mjs contact-update",
|
|
54
|
+
"readme:init": "node dist/node/cli.js readme:init",
|
|
55
|
+
"readme:sync": "node dist/node/cli.js readme:sync",
|
|
56
|
+
"readme:check": "node dist/node/cli.js readme:sync --check",
|
|
54
57
|
"typecheck": "tsc -p tsconfig.json --noEmit",
|
|
55
58
|
"test": "vitest run",
|
|
56
59
|
"test:watch": "vitest",
|