@lssm/example.content-generation 0.0.0-canary-20251217063201 → 0.0.0-canary-20251217072406
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/.turbo/turbo-build$colon$bundle.log +73 -69
- package/.turbo/turbo-build.log +74 -18
- package/CHANGELOG.md +5 -4
- package/dist/docs/content-generation.docblock.js +27 -14
- package/dist/docs/index.js +1 -1
- package/dist/example.js +38 -1
- package/dist/generate.js +52 -1
- package/dist/index.js +5 -1
- package/dist/libs/content-gen/dist/generators/blog.js +68 -1
- package/dist/libs/content-gen/dist/generators/email.js +96 -9
- package/dist/libs/content-gen/dist/generators/landing-page.js +76 -2
- package/dist/libs/content-gen/dist/generators/social.js +73 -1
- package/dist/libs/content-gen/dist/seo/optimizer.js +48 -1
- package/dist/libs/contracts/dist/docs/PUBLISHING.docblock.js +16 -76
- package/dist/libs/contracts/dist/docs/accessibility_wcag_compliance_specs.docblock.js +16 -350
- package/dist/libs/contracts/dist/docs/index.js +29 -1
- package/dist/libs/contracts/dist/docs/presentations.js +71 -1
- package/dist/libs/contracts/dist/docs/registry.js +44 -1
- package/dist/libs/contracts/dist/docs/tech/PHASE_1_QUICKSTART.docblock.js +16 -383
- package/dist/libs/contracts/dist/docs/tech/PHASE_2_AI_NATIVE_OPERATIONS.docblock.js +16 -68
- package/dist/libs/contracts/dist/docs/tech/PHASE_3_AUTO_EVOLUTION.docblock.js +16 -140
- package/dist/libs/contracts/dist/docs/tech/PHASE_4_PERSONALIZATION_ENGINE.docblock.js +16 -86
- package/dist/libs/contracts/dist/docs/tech/PHASE_5_ZERO_TOUCH_OPERATIONS.docblock.js +16 -1
- package/dist/libs/contracts/dist/docs/tech/auth/better-auth-nextjs.docblock.js +24 -2
- package/dist/libs/contracts/dist/docs/tech/contracts/openapi-export.docblock.js +21 -2
- package/dist/libs/contracts/dist/docs/tech/lifecycle-stage-system.docblock.js +16 -213
- package/dist/libs/contracts/dist/docs/tech/llm/llm-integration.docblock.js +73 -5
- package/dist/libs/contracts/dist/docs/tech/mcp-endpoints.docblock.js +37 -1
- package/dist/libs/contracts/dist/docs/tech/presentation-runtime.docblock.js +16 -1
- package/dist/libs/contracts/dist/docs/tech/schema/README.docblock.js +20 -262
- package/dist/libs/contracts/dist/docs/tech/studio/learning-events.docblock.js +48 -1
- package/dist/libs/contracts/dist/docs/tech/studio/learning-journeys.docblock.js +24 -2
- package/dist/libs/contracts/dist/docs/tech/studio/platform-admin-panel.docblock.js +23 -2
- package/dist/libs/contracts/dist/docs/tech/studio/project-access-teams.docblock.js +25 -16
- package/dist/libs/contracts/dist/docs/tech/studio/project-routing.docblock.js +67 -1
- package/dist/libs/contracts/dist/docs/tech/studio/sandbox-unlogged.docblock.js +22 -2
- package/dist/libs/contracts/dist/docs/tech/studio/team-invitations.docblock.js +40 -36
- package/dist/libs/contracts/dist/docs/tech/studio/workspace-ops.docblock.js +47 -1
- package/dist/libs/contracts/dist/docs/tech/studio/workspaces.docblock.js +23 -2
- package/dist/libs/contracts/dist/docs/tech/telemetry-ingest.docblock.js +36 -3
- package/dist/libs/contracts/dist/docs/tech/templates/runtime.docblock.js +20 -1
- package/dist/libs/contracts/dist/docs/tech/vscode-extension.docblock.js +36 -3
- package/dist/libs/contracts/dist/docs/tech/workflows/overview.docblock.js +20 -1
- package/dist/libs/logger/dist/context.node.js +78 -1
- package/dist/libs/logger/dist/elysia-plugin.js +3 -1
- package/dist/libs/logger/dist/formatters.js +163 -9
- package/dist/libs/logger/dist/index.js +7 -1
- package/dist/libs/logger/dist/logger.node.js +189 -1
- package/dist/libs/logger/dist/timer.js +126 -1
- package/dist/libs/logger/dist/tracer.node.js +115 -1
- package/dist/libs/logger/dist/types.js +13 -1
- package/package.json +7 -6
- package/tsconfig.tsbuildinfo +1 -1
|
@@ -1,13 +1,100 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
1
|
+
//#region ../../libs/content-gen/dist/generators/email.js
|
|
2
|
+
var EmailCampaignGenerator = class {
|
|
3
|
+
llm;
|
|
4
|
+
model;
|
|
5
|
+
temperature;
|
|
6
|
+
constructor(options) {
|
|
7
|
+
this.llm = options?.llm;
|
|
8
|
+
this.model = options?.model;
|
|
9
|
+
this.temperature = options?.temperature ?? .6;
|
|
10
|
+
}
|
|
11
|
+
async generate(input) {
|
|
12
|
+
if (this.llm) {
|
|
13
|
+
const draft = await this.generateWithLlm(input);
|
|
14
|
+
if (draft) return draft;
|
|
15
|
+
}
|
|
16
|
+
return this.generateFallback(input);
|
|
17
|
+
}
|
|
18
|
+
async generateWithLlm(input) {
|
|
19
|
+
const jsonPart = (await this.llm.chat([{
|
|
20
|
+
role: "system",
|
|
21
|
+
content: [{
|
|
22
|
+
type: "text",
|
|
23
|
+
text: "Draft product marketing email as JSON {subject, previewText, body, cta}."
|
|
24
|
+
}]
|
|
25
|
+
}, {
|
|
26
|
+
role: "user",
|
|
27
|
+
content: [{
|
|
28
|
+
type: "text",
|
|
29
|
+
text: JSON.stringify(input)
|
|
30
|
+
}]
|
|
31
|
+
}], {
|
|
32
|
+
responseFormat: "json",
|
|
33
|
+
model: this.model,
|
|
34
|
+
temperature: this.temperature
|
|
35
|
+
})).message.content.find((chunk) => "text" in chunk);
|
|
36
|
+
if (!jsonPart || !("text" in jsonPart)) return null;
|
|
37
|
+
const parsed = JSON.parse(jsonPart.text);
|
|
38
|
+
if (!parsed.subject || !parsed.body || !parsed.cta) return null;
|
|
39
|
+
return {
|
|
40
|
+
subject: parsed.subject,
|
|
41
|
+
previewText: parsed.previewText ?? this.defaultPreview(input),
|
|
42
|
+
body: parsed.body,
|
|
43
|
+
cta: parsed.cta,
|
|
44
|
+
variant: input.variant
|
|
45
|
+
};
|
|
46
|
+
}
|
|
47
|
+
generateFallback(input) {
|
|
48
|
+
const { brief, variant } = input;
|
|
49
|
+
return {
|
|
50
|
+
subject: this.subjects(brief.title, variant)[0] ?? `${brief.title} update`,
|
|
51
|
+
previewText: this.defaultPreview(input),
|
|
52
|
+
body: this.renderBody(input),
|
|
53
|
+
cta: brief.callToAction ?? "Explore the sandbox",
|
|
54
|
+
variant
|
|
55
|
+
};
|
|
56
|
+
}
|
|
57
|
+
subjects(title, variant) {
|
|
58
|
+
switch (variant) {
|
|
59
|
+
case "announcement": return [
|
|
60
|
+
`Launch: ${title}`,
|
|
61
|
+
`${title} is live`,
|
|
62
|
+
`New: ${title}`
|
|
63
|
+
];
|
|
64
|
+
case "onboarding": return [`Get started with ${title}`, `Your ${title} guide`];
|
|
65
|
+
case "nurture":
|
|
66
|
+
default: return [`How ${title} speeds ops`, `Proof ${title} works`];
|
|
67
|
+
}
|
|
68
|
+
}
|
|
69
|
+
defaultPreview(input) {
|
|
70
|
+
return `See how teams ${input.brief.metrics?.[0] ?? "ship faster without policy gaps"}.`;
|
|
71
|
+
}
|
|
72
|
+
renderBody(input) {
|
|
73
|
+
const { brief, variant } = input;
|
|
74
|
+
const greeting = "Hi there,";
|
|
75
|
+
const hook = this.variantHook(variant, brief);
|
|
76
|
+
const proof = brief.metrics?.map((metric) => `• ${metric}`).join("\n") ?? "";
|
|
77
|
+
return `${greeting}
|
|
3
78
|
|
|
4
|
-
${
|
|
79
|
+
${hook}
|
|
5
80
|
|
|
6
|
-
Top reasons teams adopt ${
|
|
7
|
-
${
|
|
8
|
-
`)}
|
|
81
|
+
Top reasons teams adopt ${brief.title}:
|
|
82
|
+
${brief.solutions.map((solution) => `• ${solution}`).join("\n")}
|
|
9
83
|
|
|
10
|
-
${
|
|
84
|
+
${proof}
|
|
11
85
|
|
|
12
|
-
${
|
|
13
|
-
|
|
86
|
+
${brief.callToAction ?? "Spin up a sandbox"} → ${(input.cadenceDay ?? 0) + 1}
|
|
87
|
+
`;
|
|
88
|
+
}
|
|
89
|
+
variantHook(variant, brief) {
|
|
90
|
+
switch (variant) {
|
|
91
|
+
case "announcement": return `${brief.title} is live. ${brief.summary}`;
|
|
92
|
+
case "onboarding": return `Here is your next step to unlock ${brief.title}.`;
|
|
93
|
+
case "nurture":
|
|
94
|
+
default: return `Operators like ${brief.audience.role} keep asking how to automate policy checks. Here is what works.`;
|
|
95
|
+
}
|
|
96
|
+
}
|
|
97
|
+
};
|
|
98
|
+
|
|
99
|
+
//#endregion
|
|
100
|
+
export { EmailCampaignGenerator };
|
|
@@ -1,2 +1,76 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
1
|
+
//#region ../../libs/content-gen/dist/generators/landing-page.js
|
|
2
|
+
var LandingPageGenerator = class {
|
|
3
|
+
llm;
|
|
4
|
+
model;
|
|
5
|
+
constructor(options) {
|
|
6
|
+
this.options = options;
|
|
7
|
+
this.llm = options?.llm;
|
|
8
|
+
this.model = options?.model;
|
|
9
|
+
}
|
|
10
|
+
async generate(brief) {
|
|
11
|
+
if (this.llm) return this.generateWithLlm(brief);
|
|
12
|
+
return this.generateFallback(brief);
|
|
13
|
+
}
|
|
14
|
+
async generateWithLlm(brief) {
|
|
15
|
+
const part = (await this.llm.chat([{
|
|
16
|
+
role: "system",
|
|
17
|
+
content: [{
|
|
18
|
+
type: "text",
|
|
19
|
+
text: "Write JSON landing page copy with hero/highlights/socialProof/faq arrays."
|
|
20
|
+
}]
|
|
21
|
+
}, {
|
|
22
|
+
role: "user",
|
|
23
|
+
content: [{
|
|
24
|
+
type: "text",
|
|
25
|
+
text: JSON.stringify({ brief })
|
|
26
|
+
}]
|
|
27
|
+
}], {
|
|
28
|
+
responseFormat: "json",
|
|
29
|
+
model: this.model,
|
|
30
|
+
temperature: this.options?.temperature ?? .5
|
|
31
|
+
})).message.content.find((chunk) => "text" in chunk);
|
|
32
|
+
if (part && "text" in part) return JSON.parse(part.text);
|
|
33
|
+
return this.generateFallback(brief);
|
|
34
|
+
}
|
|
35
|
+
generateFallback(brief) {
|
|
36
|
+
return {
|
|
37
|
+
hero: {
|
|
38
|
+
eyebrow: `${brief.audience.industry ?? "Operations"} teams`,
|
|
39
|
+
title: brief.title,
|
|
40
|
+
subtitle: brief.summary,
|
|
41
|
+
primaryCta: brief.callToAction ?? "Launch a sandbox",
|
|
42
|
+
secondaryCta: "View docs"
|
|
43
|
+
},
|
|
44
|
+
highlights: brief.solutions.slice(0, 3).map((solution, index) => ({
|
|
45
|
+
heading: [
|
|
46
|
+
"Policy-safe by default",
|
|
47
|
+
"Auto-adapts per tenant",
|
|
48
|
+
"Launch-ready in days"
|
|
49
|
+
][index] ?? "Key capability",
|
|
50
|
+
body: solution
|
|
51
|
+
})),
|
|
52
|
+
socialProof: {
|
|
53
|
+
heading: "Teams using ContractSpec",
|
|
54
|
+
body: brief.proofPoints?.join("\n") ?? "“We ship compliant workflows 5x faster while cutting ops toil in half.”"
|
|
55
|
+
},
|
|
56
|
+
faq: this.buildFaq(brief)
|
|
57
|
+
};
|
|
58
|
+
}
|
|
59
|
+
buildFaq(brief) {
|
|
60
|
+
const faqs = [{
|
|
61
|
+
heading: "How does this keep policies enforced?",
|
|
62
|
+
body: "All workflows compile from TypeScript specs and pass through PDP checks before execution, so no shadow logic slips through."
|
|
63
|
+
}, {
|
|
64
|
+
heading: "Will it fit our existing stack?",
|
|
65
|
+
body: "Runtime adapters plug into REST, GraphQL, or MCP. Integrations stay vendor agnostic."
|
|
66
|
+
}];
|
|
67
|
+
if (brief.complianceNotes?.length) faqs.push({
|
|
68
|
+
heading: "What about compliance requirements?",
|
|
69
|
+
body: brief.complianceNotes.join(" ")
|
|
70
|
+
});
|
|
71
|
+
return faqs;
|
|
72
|
+
}
|
|
73
|
+
};
|
|
74
|
+
|
|
75
|
+
//#endregion
|
|
76
|
+
export { LandingPageGenerator };
|
|
@@ -1 +1,73 @@
|
|
|
1
|
-
|
|
1
|
+
//#region ../../libs/content-gen/dist/generators/social.js
|
|
2
|
+
var SocialPostGenerator = class {
|
|
3
|
+
llm;
|
|
4
|
+
model;
|
|
5
|
+
constructor(options) {
|
|
6
|
+
this.llm = options?.llm;
|
|
7
|
+
this.model = options?.model;
|
|
8
|
+
}
|
|
9
|
+
async generate(brief) {
|
|
10
|
+
if (this.llm) {
|
|
11
|
+
const posts = await this.generateWithLlm(brief);
|
|
12
|
+
if (posts.length) return posts;
|
|
13
|
+
}
|
|
14
|
+
return this.generateFallback(brief);
|
|
15
|
+
}
|
|
16
|
+
async generateWithLlm(brief) {
|
|
17
|
+
const part = (await this.llm.chat([{
|
|
18
|
+
role: "system",
|
|
19
|
+
content: [{
|
|
20
|
+
type: "text",
|
|
21
|
+
text: "Create JSON array of social posts for twitter/linkedin/threads with body, hashtags, cta."
|
|
22
|
+
}]
|
|
23
|
+
}, {
|
|
24
|
+
role: "user",
|
|
25
|
+
content: [{
|
|
26
|
+
type: "text",
|
|
27
|
+
text: JSON.stringify(brief)
|
|
28
|
+
}]
|
|
29
|
+
}], {
|
|
30
|
+
responseFormat: "json",
|
|
31
|
+
model: this.model
|
|
32
|
+
})).message.content.find((chunk) => "text" in chunk);
|
|
33
|
+
if (!part || !("text" in part)) return [];
|
|
34
|
+
return JSON.parse(part.text);
|
|
35
|
+
}
|
|
36
|
+
generateFallback(brief) {
|
|
37
|
+
const hashtags = this.buildHashtags(brief);
|
|
38
|
+
return [
|
|
39
|
+
{
|
|
40
|
+
channel: "linkedin",
|
|
41
|
+
body: `${brief.title}: ${brief.summary}\n${brief.problems[0]} → ${brief.solutions[0]}`,
|
|
42
|
+
hashtags,
|
|
43
|
+
cta: brief.callToAction ?? "Book a 15-min run-through"
|
|
44
|
+
},
|
|
45
|
+
{
|
|
46
|
+
channel: "twitter",
|
|
47
|
+
body: `${brief.solutions[0]} in <60s. ${brief.solutions[1] ?? ""}`.trim(),
|
|
48
|
+
hashtags: hashtags.slice(0, 3),
|
|
49
|
+
cta: "→ contractspec.lssm.tech/sandbox"
|
|
50
|
+
},
|
|
51
|
+
{
|
|
52
|
+
channel: "threads",
|
|
53
|
+
body: `Ops + policy can move fast. ${brief.title} automates guardrails so teams ship daily.`,
|
|
54
|
+
hashtags: hashtags.slice(1, 4)
|
|
55
|
+
}
|
|
56
|
+
];
|
|
57
|
+
}
|
|
58
|
+
buildHashtags(brief) {
|
|
59
|
+
const base = [
|
|
60
|
+
brief.audience.industry ? `#${camel(brief.audience.industry)}` : "#operations",
|
|
61
|
+
"#automation",
|
|
62
|
+
"#aiops",
|
|
63
|
+
"#compliance"
|
|
64
|
+
];
|
|
65
|
+
return [...new Set(base.map((tag) => tag.replace(/\s+/g, "")))].slice(0, 5);
|
|
66
|
+
}
|
|
67
|
+
};
|
|
68
|
+
function camel(text) {
|
|
69
|
+
return text.split(/\s|-/).filter(Boolean).map((word) => word[0]?.toUpperCase() + word.slice(1)).join("");
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
//#endregion
|
|
73
|
+
export { SocialPostGenerator };
|
|
@@ -1 +1,48 @@
|
|
|
1
|
-
|
|
1
|
+
//#region ../../libs/content-gen/dist/seo/optimizer.js
|
|
2
|
+
var SeoOptimizer = class {
|
|
3
|
+
optimize(brief) {
|
|
4
|
+
const keywords = this.keywords(brief);
|
|
5
|
+
const metaTitle = `${brief.title} | ContractSpec`;
|
|
6
|
+
const metaDescription = `${brief.summary} — built for ${brief.audience.role}${brief.audience.industry ? ` in ${brief.audience.industry}` : ""}.`;
|
|
7
|
+
return {
|
|
8
|
+
metaTitle,
|
|
9
|
+
metaDescription,
|
|
10
|
+
keywords,
|
|
11
|
+
slug: this.slugify(brief.title),
|
|
12
|
+
schemaMarkup: this.schema(brief, metaDescription, keywords)
|
|
13
|
+
};
|
|
14
|
+
}
|
|
15
|
+
keywords(brief) {
|
|
16
|
+
const base = [
|
|
17
|
+
brief.title,
|
|
18
|
+
...brief.problems,
|
|
19
|
+
...brief.solutions
|
|
20
|
+
];
|
|
21
|
+
return [...new Set(base.flatMap((entry) => entry.toLowerCase().split(/\s+/)))].filter((word) => word.length > 3).slice(0, 12);
|
|
22
|
+
}
|
|
23
|
+
slugify(text) {
|
|
24
|
+
return text.toLowerCase().replace(/[^a-z0-9]+/g, "-").replace(/^-+|-+$/g, "");
|
|
25
|
+
}
|
|
26
|
+
schema(brief, description, keywords) {
|
|
27
|
+
return {
|
|
28
|
+
"@context": "https://schema.org",
|
|
29
|
+
"@type": "Product",
|
|
30
|
+
name: brief.title,
|
|
31
|
+
description,
|
|
32
|
+
audience: {
|
|
33
|
+
"@type": "Audience",
|
|
34
|
+
audienceType: brief.audience.role,
|
|
35
|
+
industry: brief.audience.industry
|
|
36
|
+
},
|
|
37
|
+
offers: {
|
|
38
|
+
"@type": "Offer",
|
|
39
|
+
description: brief.callToAction ?? "Start building with ContractSpec"
|
|
40
|
+
},
|
|
41
|
+
keywords: keywords.join(", "),
|
|
42
|
+
citation: brief.references?.map((ref) => ref.url)
|
|
43
|
+
};
|
|
44
|
+
}
|
|
45
|
+
};
|
|
46
|
+
|
|
47
|
+
//#endregion
|
|
48
|
+
export { SeoOptimizer };
|
|
@@ -1,76 +1,16 @@
|
|
|
1
|
-
import{
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
## Prerequisites
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
## Canary Workflow (Automatic)
|
|
19
|
-
|
|
20
|
-
Every commit pushed to \`main\` triggers the \`.github/workflows/publish-canary.yml\` workflow.
|
|
21
|
-
|
|
22
|
-
1. **Trigger**: Push to \`main\`.
|
|
23
|
-
2. **Versioning**: Runs \`changeset version --snapshot canary\` to generate a temporary snapshot version.
|
|
24
|
-
3. **Publish**: Packages are published to npm with the \`canary\` tag using \`changeset publish --tag canary\`.
|
|
25
|
-
|
|
26
|
-
### Consuming Canary Builds
|
|
27
|
-
|
|
28
|
-
To install the latest bleeding-edge version:
|
|
29
|
-
|
|
30
|
-
\`\`\`bash
|
|
31
|
-
npm install @lssm/lib.contracts@canary
|
|
32
|
-
# or
|
|
33
|
-
bun add @lssm/lib.contracts@canary
|
|
34
|
-
\`\`\`
|
|
35
|
-
|
|
36
|
-
## Stable Release Workflow (Manual)
|
|
37
|
-
|
|
38
|
-
Stable releases are managed via the \`release\` branch using the standard [Changesets Action](https://github.com/changesets/action).
|
|
39
|
-
|
|
40
|
-
1. **Develop on \`main\`**: Create features and fixes.
|
|
41
|
-
2. **Add Changesets**: Run \`bun changeset\` to document changes and impact (major/minor/patch).
|
|
42
|
-
3. **Merge to \`release\`**: When ready to ship, open a PR from \`main\` to \`release\` or merge manually.
|
|
43
|
-
4. **"Version Packages" PR**:
|
|
44
|
-
- The GitHub Action detects new changesets and automatically creates a Pull Request titled **"Version Packages"**.
|
|
45
|
-
- This PR contains the version bumps and updated \`CHANGELOG.md\` files.
|
|
46
|
-
5. **Merge & Publish**:
|
|
47
|
-
- Review and merge the "Version Packages" PR.
|
|
48
|
-
- The Action runs again, detects the versions have been bumped, builds the libraries, and publishes them to npm with the \`latest\` tag.
|
|
49
|
-
|
|
50
|
-
### Publishing Steps
|
|
51
|
-
|
|
52
|
-
1. Ensure all changesets are present on \`main\`.
|
|
53
|
-
2. Merge \`main\` into \`release\`:
|
|
54
|
-
\`\`\`bash
|
|
55
|
-
git checkout release
|
|
56
|
-
git pull origin release
|
|
57
|
-
git merge main
|
|
58
|
-
git push origin release
|
|
59
|
-
\`\`\`
|
|
60
|
-
3. Go to GitHub Pull Requests. You will see a **"Version Packages"** PR created by the bot.
|
|
61
|
-
4. Merge that PR.
|
|
62
|
-
5. The release is now live on npm!
|
|
63
|
-
|
|
64
|
-
## Manual Verification (Optional)
|
|
65
|
-
|
|
66
|
-
Before publishing a new version you can run:
|
|
67
|
-
|
|
68
|
-
\`\`\`bash
|
|
69
|
-
bun run build:not-apps
|
|
70
|
-
npx npm-packlist --json packages/libs/contracts
|
|
71
|
-
\`\`\`
|
|
72
|
-
|
|
73
|
-
## Rollback
|
|
74
|
-
|
|
75
|
-
If a publish fails mid-way, re-run the workflow once the issue is fixed. Already published packages are skipped automatically. Use \`npm deprecate <package>@<version>\` if we need to warn consumers about a broken release.
|
|
76
|
-
`}]);
|
|
1
|
+
import { registerDocBlocks } from "./registry.js";
|
|
2
|
+
|
|
3
|
+
//#region ../../libs/contracts/dist/docs/PUBLISHING.docblock.js
|
|
4
|
+
const PUBLISHING_DocBlocks = [{
|
|
5
|
+
id: "docs.PUBLISHING",
|
|
6
|
+
title: "Publishing ContractSpec Libraries",
|
|
7
|
+
summary: "This guide describes how we release the ContractSpec libraries to npm. We use a dual-track release system: **Stable** (manual) and **Canary** (automatic).",
|
|
8
|
+
kind: "reference",
|
|
9
|
+
visibility: "public",
|
|
10
|
+
route: "/docs/PUBLISHING",
|
|
11
|
+
tags: ["PUBLISHING"],
|
|
12
|
+
body: "# Publishing ContractSpec Libraries\n\nThis guide describes how we release the ContractSpec libraries to npm. We use a dual-track release system: **Stable** (manual) and **Canary** (automatic).\n\n## Release Tracks\n\n| Track | Branch | npm Tag | Frequency | Versioning | Use Case |\n|-------|--------|---------|-----------|------------|----------|\n| **Stable** | `release` | `latest` | Manual | SemVer (e.g., `1.7.4`) | Production, external users |\n| **Canary** | `main` | `canary` | Every Push | Snapshot (e.g., `1.7.4-canary...`) | Dev, internal testing |\n\n## Prerequisites\n\n- ✅ `NPM_TOKEN` secret is configured in GitHub (owner or automation token with _publish_ scope).\n- ✅ `GITHUB_TOKEN` (built-in) has permissions to create PRs (enabled by default in new repos).\n- ✅ For stable releases: `release` branch exists and is protected.\n\n## Canary Workflow (Automatic)\n\nEvery commit pushed to `main` triggers the `.github/workflows/publish-canary.yml` workflow.\n\n1. **Trigger**: Push to `main`.\n2. **Versioning**: Runs `changeset version --snapshot canary` to generate a temporary snapshot version.\n3. **Publish**: Packages are published to npm with the `canary` tag using `changeset publish --tag canary`.\n\n### Consuming Canary Builds\n\nTo install the latest bleeding-edge version:\n\n```bash\nnpm install @lssm/lib.contracts@canary\n# or\nbun add @lssm/lib.contracts@canary\n```\n\n## Stable Release Workflow (Manual)\n\nStable releases are managed via the `release` branch using the standard [Changesets Action](https://github.com/changesets/action).\n\n1. **Develop on `main`**: Create features and fixes.\n2. **Add Changesets**: Run `bun changeset` to document changes and impact (major/minor/patch).\n3. **Merge to `release`**: When ready to ship, open a PR from `main` to `release` or merge manually.\n4. **\"Version Packages\" PR**:\n - The GitHub Action detects new changesets and automatically creates a Pull Request titled **\"Version Packages\"**.\n - This PR contains the version bumps and updated `CHANGELOG.md` files.\n5. **Merge & Publish**:\n - Review and merge the \"Version Packages\" PR.\n - The Action runs again, detects the versions have been bumped, builds the libraries, and publishes them to npm with the `latest` tag.\n\n### Publishing Steps\n\n1. Ensure all changesets are present on `main`.\n2. Merge `main` into `release`:\n ```bash\n git checkout release\n git pull origin release\n git merge main\n git push origin release\n ```\n3. Go to GitHub Pull Requests. You will see a **\"Version Packages\"** PR created by the bot.\n4. Merge that PR.\n5. The release is now live on npm!\n\n## Manual Verification (Optional)\n\nBefore publishing a new version you can run:\n\n```bash\nbun run build:not-apps\nnpx npm-packlist --json packages/libs/contracts\n```\n\n## Rollback\n\nIf a publish fails mid-way, re-run the workflow once the issue is fixed. Already published packages are skipped automatically. Use `npm deprecate <package>@<version>` if we need to warn consumers about a broken release.\n"
|
|
13
|
+
}];
|
|
14
|
+
registerDocBlocks(PUBLISHING_DocBlocks);
|
|
15
|
+
|
|
16
|
+
//#endregion
|